summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/basicbox.cxx4
-rw-r--r--basctl/source/basicide/baside2.cxx2
-rw-r--r--basctl/source/basicide/baside2.hxx3
-rw-r--r--basctl/source/basicide/baside3.cxx2
-rw-r--r--basctl/source/basicide/basidesh.cxx7
-rw-r--r--basctl/source/basicide/basobj2.cxx240
-rw-r--r--basctl/source/basicide/bastypes.cxx2
-rw-r--r--basctl/source/basicide/iderdll.cxx17
-rw-r--r--basctl/source/basicide/iderdll2.hxx2
-rw-r--r--basctl/source/inc/baside3.hxx3
-rw-r--r--basctl/source/inc/basidesh.hxx3
-rw-r--r--basctl/source/inc/bastypes.hxx9
-rw-r--r--basctl/util/makefile.mk1
-rw-r--r--basic/inc/basic/basmgr.hxx7
-rw-r--r--basic/source/app/appedit.cxx4
-rw-r--r--basic/source/basmgr/basmgr.cxx112
-rwxr-xr-xcanvas/source/directx/dx_canvashelper_texturefill.cxx2
-rw-r--r--chart2/prj/build.lst2
-rwxr-xr-xchart2/source/controller/chartapiwrapper/AxisWrapper.cxx110
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/AxisWrapper.hxx17
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx7
-rwxr-xr-xchart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx233
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx32
-rwxr-xr-xchart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx10
-rwxr-xr-xchart2/source/controller/chartapiwrapper/DiagramWrapper.cxx236
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx86
-rwxr-xr-xchart2/source/controller/chartapiwrapper/GridWrapper.cxx13
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/GridWrapper.hxx13
-rwxr-xr-xchart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx106
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx3
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx58
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.hxx2
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx25
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.hxx6
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx4
-rw-r--r--chart2/source/controller/dialogs/ObjectNameProvider.cxx11
-rw-r--r--chart2/source/controller/dialogs/Strings.src9
-rw-r--r--chart2/source/controller/dialogs/Strings_Scale.src8
-rw-r--r--chart2/source/controller/dialogs/TabPages.hrc25
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx4
-rw-r--r--chart2/source/controller/dialogs/res_ErrorBar.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.cxx12
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.cxx450
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.hrc63
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.hxx31
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/dialogs/tp_Scale.src211
-rw-r--r--chart2/source/controller/inc/AxisItemConverter.hxx11
-rw-r--r--chart2/source/controller/inc/DataPointItemConverter.hxx2
-rwxr-xr-xchart2/source/controller/inc/ErrorBarItemConverter.hxx2
-rw-r--r--chart2/source/controller/inc/StatisticsItemConverter.hxx2
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx366
-rw-r--r--chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx30
-rw-r--r--chart2/source/controller/main/ChartController.cxx41
-rw-r--r--chart2/source/controller/main/ChartController.hxx7
-rw-r--r--chart2/source/controller/main/ChartController_EditData.cxx6
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx198
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx4
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx10
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx30
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx74
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx18
-rw-r--r--chart2/source/controller/main/ChartDropTargetHelper.cxx77
-rwxr-xr-xchart2/source/controller/main/ChartModelClone.cxx280
-rwxr-xr-xchart2/source/controller/main/ChartModelClone.hxx89
-rw-r--r--chart2/source/controller/main/CommandDispatchContainer.cxx6
-rw-r--r--chart2/source/controller/main/CommandDispatchContainer.hxx9
-rw-r--r--chart2/source/controller/main/ImplUndoManager.cxx503
-rw-r--r--chart2/source/controller/main/ImplUndoManager.hxx227
-rw-r--r--chart2/source/controller/main/UndoActions.cxx178
-rw-r--r--chart2/source/controller/main/UndoActions.hxx134
-rw-r--r--chart2/source/controller/main/UndoCommandDispatch.cxx48
-rw-r--r--chart2/source/controller/main/UndoCommandDispatch.hxx7
-rw-r--r--chart2/source/controller/main/UndoGuard.cxx165
-rw-r--r--chart2/source/controller/main/UndoGuard.hxx137
-rw-r--r--chart2/source/controller/main/UndoManager.cxx438
-rw-r--r--chart2/source/controller/main/makefile.mk9
-rw-r--r--chart2/source/inc/AxisHelper.hxx11
-rw-r--r--chart2/source/inc/ChartModelHelper.hxx1
-rw-r--r--chart2/source/inc/ChartTypeHelper.hxx3
-rw-r--r--chart2/source/inc/CommonFunctors.hxx13
-rw-r--r--chart2/source/inc/DiagramHelper.hxx17
-rw-r--r--chart2/source/inc/ExplicitCategoriesProvider.hxx43
-rwxr-xr-xchart2/source/inc/InternalData.hxx24
-rw-r--r--chart2/source/inc/InternalDataProvider.hxx30
-rwxr-xr-x[-rw-r--r--]chart2/source/inc/NumberFormatterWrapper.hxx (renamed from chart2/source/inc/chartview/NumberFormatterWrapper.hxx)11
-rw-r--r--chart2/source/inc/Strings.hrc8
-rw-r--r--chart2/source/inc/UndoGuard.hxx120
-rw-r--r--chart2/source/inc/UndoManager.hxx180
-rw-r--r--chart2/source/inc/chartview/ChartSfxItemIds.hxx167
-rw-r--r--chart2/source/inc/chartview/ExplicitScaleValues.hxx165
-rw-r--r--chart2/source/inc/chartview/ExplicitValueProvider.hxx11
-rw-r--r--chart2/source/inc/servicenames.hxx2
-rw-r--r--chart2/source/model/inc/Diagram.hxx11
-rwxr-xr-xchart2/source/model/main/ChartModel.cxx153
-rwxr-xr-xchart2/source/model/main/ChartModel.hxx21
-rwxr-xr-xchart2/source/model/main/Diagram.cxx17
-rwxr-xr-xchart2/source/model/main/UndoManager.cxx427
-rwxr-xr-xchart2/source/model/main/UndoManager.hxx109
-rw-r--r--chart2/source/model/main/makefile.mk1
-rw-r--r--chart2/source/model/makefile.mk3
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BubbleDataInterpreter.cxx43
-rwxr-xr-xchart2/source/model/template/ChartTypeTemplate.cxx23
-rwxr-xr-xchart2/source/model/template/DataInterpreter.cxx8
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/DataInterpreter.hxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/XYDataInterpreter.cxx31
-rwxr-xr-xchart2/source/tools/AxisHelper.cxx232
-rwxr-xr-xchart2/source/tools/ChartTypeHelper.cxx25
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/DataSourceHelper.cxx19
-rwxr-xr-xchart2/source/tools/DiagramHelper.cxx214
-rwxr-xr-xchart2/source/tools/ExplicitCategoriesProvider.cxx242
-rwxr-xr-xchart2/source/tools/InternalData.cxx42
-rwxr-xr-xchart2/source/tools/InternalDataProvider.cxx337
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NumberFormatterWrapper.cxx (renamed from chart2/source/view/main/NumberFormatterWrapper.cxx)21
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ResId.cxx2
-rw-r--r--chart2/source/tools/makefile.mk1
-rw-r--r--chart2/source/view/axes/DateHelper.cxx132
-rw-r--r--chart2/source/view/axes/DateScaling.cxx216
-rw-r--r--chart2/source/view/axes/DateScaling.hxx114
-rw-r--r--chart2/source/view/axes/MinimumAndMaximumSupplier.cxx21
-rw-r--r--chart2/source/view/axes/ScaleAutomatism.cxx336
-rw-r--r--chart2/source/view/axes/Tickmarks.cxx333
-rw-r--r--chart2/source/view/axes/Tickmarks.hxx166
-rw-r--r--chart2/source/view/axes/Tickmarks_Dates.cxx171
-rw-r--r--chart2/source/view/axes/Tickmarks_Dates.hxx65
-rw-r--r--chart2/source/view/axes/Tickmarks_Equidistant.cxx671
-rw-r--r--chart2/source/view/axes/Tickmarks_Equidistant.hxx (renamed from chart2/source/view/axes/TickmarkHelper.hxx)160
-rw-r--r--chart2/source/view/axes/VAxisBase.cxx26
-rw-r--r--chart2/source/view/axes/VAxisBase.hxx21
-rw-r--r--chart2/source/view/axes/VAxisOrGridBase.cxx17
-rw-r--r--chart2/source/view/axes/VAxisOrGridBase.hxx21
-rw-r--r--chart2/source/view/axes/VAxisProperties.cxx19
-rw-r--r--chart2/source/view/axes/VAxisProperties.hxx1
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx303
-rw-r--r--chart2/source/view/axes/VCartesianAxis.hxx27
-rw-r--r--chart2/source/view/axes/VCartesianCoordinateSystem.cxx17
-rw-r--r--chart2/source/view/axes/VCartesianGrid.cxx13
-rw-r--r--chart2/source/view/axes/VCartesianGrid.hxx2
-rw-r--r--chart2/source/view/axes/VCoordinateSystem.cxx30
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.cxx22
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.hxx9
-rw-r--r--chart2/source/view/axes/VPolarAxis.cxx6
-rw-r--r--chart2/source/view/axes/VPolarAxis.hxx8
-rw-r--r--chart2/source/view/axes/VPolarCoordinateSystem.cxx9
-rw-r--r--chart2/source/view/axes/VPolarGrid.cxx27
-rw-r--r--chart2/source/view/axes/VPolarGrid.hxx14
-rw-r--r--chart2/source/view/axes/VPolarRadiusAxis.cxx27
-rw-r--r--chart2/source/view/axes/VPolarRadiusAxis.hxx24
-rw-r--r--chart2/source/view/axes/makefile.mk6
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx34
-rw-r--r--chart2/source/view/charttypes/AreaChart.hxx13
-rw-r--r--[-rwxr-xr-x]chart2/source/view/charttypes/BarChart.cxx103
-rw-r--r--chart2/source/view/charttypes/BarChart.hxx18
-rw-r--r--chart2/source/view/charttypes/BarPositionHelper.cxx79
-rw-r--r--chart2/source/view/charttypes/BarPositionHelper.hxx19
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx4
-rw-r--r--chart2/source/view/charttypes/BubbleChart.hxx6
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx104
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.hxx13
-rw-r--r--chart2/source/view/charttypes/CategoryPositionHelper.cxx17
-rw-r--r--chart2/source/view/charttypes/CategoryPositionHelper.hxx5
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx12
-rw-r--r--chart2/source/view/charttypes/PieChart.hxx18
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx145
-rw-r--r--chart2/source/view/diagram/VDiagram.cxx5
-rw-r--r--chart2/source/view/inc/DateHelper.hxx60
-rw-r--r--chart2/source/view/inc/MinimumAndMaximumSupplier.hxx9
-rw-r--r--chart2/source/view/inc/PlotterBase.hxx31
-rw-r--r--chart2/source/view/inc/PlottingPositionHelper.hxx78
-rw-r--r--chart2/source/view/inc/ScaleAutomatism.hxx37
-rw-r--r--chart2/source/view/inc/VCoordinateSystem.hxx27
-rw-r--r--chart2/source/view/inc/VDataSeries.hxx4
-rw-r--r--chart2/source/view/inc/VDiagram.hxx2
-rw-r--r--chart2/source/view/inc/VSeriesPlotter.hxx14
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx84
-rw-r--r--chart2/source/view/main/ChartView.cxx237
-rw-r--r--chart2/source/view/main/ChartView.hxx4
-rw-r--r--chart2/source/view/main/PlotterBase.cxx9
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx77
-rw-r--r--chart2/source/view/main/VDataSeries.cxx16
-rw-r--r--chart2/source/view/main/VLegend.cxx2
-rw-r--r--chart2/source/view/main/VLegend.hxx2
-rw-r--r--chart2/source/view/main/VTitle.cxx2
-rw-r--r--chart2/source/view/main/VTitle.hxx2
-rw-r--r--chart2/source/view/main/makefile.mk1
-rw-r--r--comphelper/inc/comphelper/TypeGeneration.hxx1
-rw-r--r--comphelper/inc/comphelper/asyncnotification.hxx3
-rw-r--r--comphelper/inc/comphelper/documentconstants.hxx1
-rwxr-xr-xcomphelper/inc/comphelper/flagguard.hxx83
-rw-r--r--comphelper/inc/comphelper/scopeguard.hxx15
-rw-r--r--comphelper/source/misc/scopeguard.cxx10
-rw-r--r--comphelper/source/property/TypeGeneration.cxx4
-rw-r--r--connectivity/inc/connectivity/PColumn.hxx18
-rw-r--r--connectivity/inc/connectivity/dbconversion.hxx9
-rw-r--r--connectivity/inc/connectivity/virtualdbtools.hxx7
-rw-r--r--connectivity/prj/build.lst2
-rw-r--r--connectivity/qa/complex/connectivity/DBaseDriverTest.java (renamed from connectivity/qa/drivers/dbase/DBaseDriverTest.java)38
-rwxr-xr-xconnectivity/qa/complex/connectivity/FlatFileAccess.java237
-rw-r--r--connectivity/qa/complex/connectivity/HsqlDriverTest.java (renamed from connectivity/qa/drivers/hsqldb/DriverTest.java)38
-rw-r--r--connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java (renamed from connectivity/qa/drivers/jdbc/LongVarCharTest.java)3
-rwxr-xr-xconnectivity/qa/complex/connectivity/SubTestCase.java23
-rwxr-xr-x[-rw-r--r--]connectivity/qa/complex/connectivity/TestCase.java (renamed from sfx2/inc/sfxbasic.hxx)21
-rw-r--r--connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java (renamed from connectivity/qa/drivers/dbase/DBaseDateFunctions.java)26
-rw-r--r--connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java (renamed from connectivity/qa/drivers/dbase/DBaseNumericFunctions.java)19
-rwxr-xr-xconnectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java (renamed from connectivity/qa/drivers/dbase/DBaseSqlTests.java)20
-rw-r--r--connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java (renamed from connectivity/qa/drivers/dbase/DBaseStringFunctions.java)18
-rw-r--r--connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData.java (renamed from connectivity/qa/drivers/hsqldb/DatabaseMetaData.java)10
-rw-r--r--connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java (renamed from connectivity/qa/drivers/hsqldb/TestCacheSize.java)20
-rwxr-xr-xconnectivity/qa/connectivity/tools/AbstractDatabase.java24
-rwxr-xr-xconnectivity/qa/connectivity/tools/CsvDatabase.java18
-rw-r--r--connectivity/qa/connectivity/tools/DataSource.java38
-rwxr-xr-xconnectivity/qa/connectivity/tools/DbaseDatabase.java90
-rwxr-xr-xconnectivity/qa/connectivity/tools/FlatFileDatabase.java116
-rw-r--r--connectivity/qa/connectivity/tools/RowSet.java17
-rw-r--r--connectivity/qa/connectivity/tools/makefile.mk8
-rw-r--r--connectivity/qa/drivers/dbase/.nbattrs10
-rw-r--r--connectivity/qa/drivers/dbase/test.properties5
-rw-r--r--connectivity/qa/makefile.mk (renamed from connectivity/qa/drivers/jdbc/makefile.mk)36
-rw-r--r--connectivity/qa/scenarios.sce4
-rw-r--r--connectivity/source/commontools/DateConversion.cxx73
-rw-r--r--connectivity/source/commontools/TSkipDeletedSet.cxx9
-rw-r--r--connectivity/source/commontools/dbtools.cxx5
-rw-r--r--connectivity/source/commontools/formattedcolumnvalue.cxx2
-rw-r--r--connectivity/source/drivers/ado/ACatalog.cxx8
-rw-r--r--connectivity/source/drivers/ado/AColumns.cxx8
-rw-r--r--connectivity/source/drivers/ado/ADriver.cxx31
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu5
-rw-r--r--connectivity/source/drivers/ado/adoimp.cxx3
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DIndexColumns.cxx4
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx12
-rw-r--r--connectivity/source/drivers/evoab/LFolderList.cxx2
-rw-r--r--connectivity/source/drivers/evoab/LTable.cxx4
-rw-r--r--connectivity/source/drivers/file/FColumns.cxx2
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx4
-rw-r--r--connectivity/source/drivers/file/FTable.cxx4
-rw-r--r--connectivity/source/drivers/flat/EConnection.cxx6
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx312
-rwxr-xr-xconnectivity/source/drivers/flat/flat.xcu10
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx6
-rw-r--r--connectivity/source/inc/TSkipDeletedSet.hxx2
-rw-r--r--connectivity/source/inc/dbase/DIndexColumns.hxx2
-rw-r--r--connectivity/source/inc/dbase/DIndexes.hxx2
-rw-r--r--connectivity/source/inc/file/FColumns.hxx2
-rw-r--r--connectivity/source/inc/file/FTables.hxx2
-rw-r--r--connectivity/source/inc/flat/EConnection.hxx2
-rw-r--r--connectivity/source/inc/flat/ETable.hxx4
-rw-r--r--connectivity/source/parse/PColumn.cxx98
-rw-r--r--connectivity/source/parse/sqliterator.cxx6
-rw-r--r--connectivity/source/simpledbt/staticdbtools_s.cxx14
-rw-r--r--connectivity/source/simpledbt/staticdbtools_s.hxx7
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx17
-rw-r--r--cui/source/customize/acccfg.cxx4
-rw-r--r--cui/source/customize/acccfg.hrc2
-rw-r--r--cui/source/customize/acccfg.src4
-rw-r--r--cui/source/customize/cfg.cxx1
-rw-r--r--cui/source/customize/cfgutil.cxx570
-rw-r--r--cui/source/customize/eventdlg.cxx1
-rw-r--r--cui/source/customize/macropg.cxx9
-rw-r--r--cui/source/customize/selector.cxx1
-rwxr-xr-xcui/source/dialogs/SpellDialog.cxx38
-rw-r--r--cui/source/inc/SpellDialog.hxx2
-rw-r--r--cui/source/inc/cfgutil.hxx32
-rw-r--r--[-rwxr-xr-x]cui/source/inc/macroass.hxx8
-rw-r--r--cui/source/inc/macropg.hxx2
-rwxr-xr-x[-rw-r--r--]cui/source/options/optlingu.src7
-rw-r--r--cui/source/tabpages/macroass.cxx243
-rw-r--r--cui/source/tabpages/macroass.hrc2
-rw-r--r--cui/source/tabpages/macroass.src13
-rw-r--r--cui/source/tabpages/page.h6
-rw-r--r--cui/source/tabpages/page.src2
-rw-r--r--dbaccess/inc/IEnvironment.hxx77
-rw-r--r--dbaccess/inc/dataview.hxx17
-rw-r--r--dbaccess/inc/dbaccess_helpid.hrc1
-rwxr-xr-xdbaccess/inc/dbaundomanager.hxx103
-rw-r--r--dbaccess/inc/dbsubcomponentcontroller.hxx (renamed from dbaccess/inc/singledoccontroller.hxx)59
-rw-r--r--dbaccess/prj/build.lst3
-rw-r--r--dbaccess/prj/d.lst1
-rw-r--r--dbaccess/qa/complex/dbaccess/ApplicationController.java29
-rw-r--r--dbaccess/qa/complex/dbaccess/Beamer.java57
-rw-r--r--dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java12
-rwxr-xr-xdbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java8
-rwxr-xr-xdbaccess/qa/complex/dbaccess/CopyTableWizard.java55
-rw-r--r--dbaccess/qa/complex/dbaccess/DataSource.java37
-rw-r--r--dbaccess/qa/complex/dbaccess/DatabaseDocument.java63
-rw-r--r--dbaccess/qa/complex/dbaccess/Parser.java32
-rw-r--r--dbaccess/qa/complex/dbaccess/PropertyBag.java35
-rw-r--r--dbaccess/qa/complex/dbaccess/Query.java22
-rw-r--r--dbaccess/qa/complex/dbaccess/QueryInQuery.java38
-rw-r--r--dbaccess/qa/complex/dbaccess/RowSet.java54
-rw-r--r--dbaccess/qa/complex/dbaccess/RowSetEventListener.java2
-rwxr-xr-xdbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java62
-rw-r--r--dbaccess/qa/complex/dbaccess/TestCase.java131
-rw-r--r--dbaccess/qa/complex/dbaccess/UISettings.java28
-rw-r--r--dbaccess/qa/complex/dbaccess/dbaccess.sce12
-rwxr-xr-xdbaccess/qa/complex/dbaccess/makefile.mk101
-rw-r--r--dbaccess/source/core/api/BookmarkSet.hxx2
-rw-r--r--dbaccess/source/core/api/CacheSet.cxx5
-rw-r--r--dbaccess/source/core/api/CacheSet.hxx3
-rw-r--r--dbaccess/source/core/api/KeySet.cxx12
-rw-r--r--dbaccess/source/core/api/KeySet.hxx3
-rw-r--r--dbaccess/source/core/api/OptimisticSet.cxx7
-rw-r--r--dbaccess/source/core/api/OptimisticSet.hxx3
-rw-r--r--dbaccess/source/core/api/RowSet.cxx20
-rw-r--r--dbaccess/source/core/api/RowSetBase.cxx3
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx18
-rw-r--r--dbaccess/source/core/api/RowSetCache.hxx5
-rw-r--r--dbaccess/source/core/api/SingleSelectQueryComposer.cxx2
-rw-r--r--dbaccess/source/core/api/StaticSet.cxx5
-rw-r--r--dbaccess/source/core/api/StaticSet.hxx4
-rw-r--r--dbaccess/source/core/api/WrappedResultSet.hxx2
-rw-r--r--dbaccess/source/core/api/query.cxx2
-rw-r--r--dbaccess/source/core/resource/strings.src2
-rw-r--r--dbaccess/source/filter/migration/cfgimport.cxx1260
-rw-r--r--dbaccess/source/filter/migration/cfgimport.hxx223
-rw-r--r--dbaccess/source/filter/migration/cfgservices.cxx94
-rw-r--r--dbaccess/source/filter/migration/dbacfg.component34
-rw-r--r--dbaccess/source/filter/migration/makefile.mk82
-rw-r--r--dbaccess/source/inc/cfgstrings.hrc99
-rw-r--r--dbaccess/source/shared/cfgstrings.cxx91
-rw-r--r--dbaccess/source/shared/makefile.mk7
-rw-r--r--dbaccess/source/ui/app/AppController.cxx4
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx122
-rw-r--r--dbaccess/source/ui/browser/dataview.cxx39
-rw-r--r--dbaccess/source/ui/browser/exsrcbrw.cxx2
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx12
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx340
-rw-r--r--dbaccess/source/ui/control/sqledit.cxx4
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx36
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.hrc2
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.hxx5
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.src19
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx2
-rw-r--r--dbaccess/source/ui/inc/JoinController.hxx12
-rw-r--r--dbaccess/source/ui/inc/TableController.hxx23
-rw-r--r--dbaccess/source/ui/inc/brwctrlr.hxx11
-rw-r--r--dbaccess/source/ui/inc/dsitems.hxx3
-rw-r--r--dbaccess/source/ui/inc/dsmeta.hxx1
-rw-r--r--dbaccess/source/ui/inc/exsrcbrw.hxx2
-rwxr-xr-xdbaccess/source/ui/inc/singledoccontroller.hxx93
-rw-r--r--dbaccess/source/ui/inc/unodatbr.hxx6
-rwxr-xr-xdbaccess/source/ui/misc/dbaundomanager.cxx395
-rw-r--r--dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx672
-rw-r--r--dbaccess/source/ui/misc/dsmeta.cxx1
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx3
-rw-r--r--dbaccess/source/ui/misc/makefile.mk75
-rwxr-xr-x[-rw-r--r--]dbaccess/source/ui/misc/singledoccontroller.cxx697
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/QueryViewSwitch.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx8
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx2
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx29
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx26
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.hxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx11
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx15
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-16-01.pngbin0 -> 3678 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-16-02.pngbin0 -> 3681 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-16-03.pngbin0 -> 3687 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-16-04.pngbin0 -> 3689 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-16-05.pngbin0 -> 3694 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-16-06.pngbin0 -> 3690 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-01.pngbin0 -> 441 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-02.pngbin0 -> 436 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-03.pngbin0 -> 435 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-04.pngbin0 -> 435 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-05.pngbin0 -> 439 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-06.pngbin0 -> 443 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-07.pngbin0 -> 444 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-08.pngbin0 -> 439 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-09.pngbin0 -> 427 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-10.pngbin0 -> 429 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-11.pngbin0 -> 429 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-32-12.pngbin0 -> 435 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-01.pngbin0 -> 3984 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-02.pngbin0 -> 3996 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-03.pngbin0 -> 3993 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-04.pngbin0 -> 3950 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-05.pngbin0 -> 4018 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-06.pngbin0 -> 4036 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-07.pngbin0 -> 4035 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-08.pngbin0 -> 4118 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-09.pngbin0 -> 4063 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-10.pngbin0 -> 4004 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-11.pngbin0 -> 4083 bytes
-rwxr-xr-xdefault_images/hicontrast/shared/spinner-64-12.pngbin0 -> 4077 bytes
-rwxr-xr-xdefault_images/shared/spinner-16-01.pngbin0 -> 3737 bytes
-rwxr-xr-xdefault_images/shared/spinner-16-02.pngbin0 -> 3752 bytes
-rwxr-xr-xdefault_images/shared/spinner-16-03.pngbin0 -> 3752 bytes
-rwxr-xr-xdefault_images/shared/spinner-16-04.pngbin0 -> 3743 bytes
-rwxr-xr-xdefault_images/shared/spinner-16-05.pngbin0 -> 3752 bytes
-rwxr-xr-xdefault_images/shared/spinner-16-06.pngbin0 -> 3759 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-01.pngbin0 -> 666 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-02.pngbin0 -> 668 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-03.pngbin0 -> 678 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-04.pngbin0 -> 680 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-05.pngbin0 -> 671 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-06.pngbin0 -> 676 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-07.pngbin0 -> 692 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-08.pngbin0 -> 682 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-09.pngbin0 -> 675 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-10.pngbin0 -> 673 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-11.pngbin0 -> 679 bytes
-rwxr-xr-xdefault_images/shared/spinner-32-12.pngbin0 -> 676 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-01.pngbin0 -> 1566 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-02.pngbin0 -> 1578 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-03.pngbin0 -> 1561 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-04.pngbin0 -> 1586 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-05.pngbin0 -> 1602 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-06.pngbin0 -> 1590 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-07.pngbin0 -> 1594 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-08.pngbin0 -> 1595 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-09.pngbin0 -> 1568 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-10.pngbin0 -> 1579 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-11.pngbin0 -> 1587 bytes
-rwxr-xr-xdefault_images/shared/spinner-64-12.pngbin0 -> 1569 bytes
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedialog.cxx26
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedialog.hxx4
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedialog.src4
-rw-r--r--desktop/source/migration/pages.cxx14
-rw-r--r--desktop/source/migration/pages.hxx10
-rw-r--r--desktop/source/migration/wizard.cxx56
-rw-r--r--desktop/source/migration/wizard.hrc1
-rw-r--r--desktop/source/migration/wizard.hxx5
-rw-r--r--desktop/source/migration/wizard.src7
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx15
-rwxr-xr-xediteng/inc/editeng/editeng.hxx7
-rw-r--r--editeng/inc/editeng/editund2.hxx6
-rw-r--r--editeng/inc/editeng/outliner.hxx10
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/editeng/editundo.cxx8
-rw-r--r--editeng/source/editeng/impedit5.cxx4
-rw-r--r--editeng/source/outliner/outliner.cxx2
-rw-r--r--embeddedobj/source/commonembedding/embedobj.cxx5
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx2
-rw-r--r--[-rwxr-xr-x]extensions/source/update/check/updatecheck.cxx0
-rw-r--r--extensions/source/update/check/updatehdl.cxx14
-rw-r--r--filter/source/config/cache/constant.hxx2
-rw-r--r--filter/source/config/cache/filtercache.cxx6
-rw-r--r--filter/source/config/fragments/filters/StarCalc_3_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_4_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarChart_3_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarChart_4_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarChart_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_4_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarMath_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_3_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_3_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_GlobalDocument_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_Web_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_4_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_4_0_GlobalDocument.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_4_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_GlobalDocument_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_Web_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_5_0_GlobalDocument.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_5_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_GlobalDocument_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_Web_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_Web_4_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarWriter_Web_5_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/graphicfilter/itga/itga.cxx30
-rw-r--r--filter/source/msfilter/svxmsbas.cxx4
-rw-r--r--filter/source/pdf/pdfexport.cxx6
-rw-r--r--forms/qa/makefile.mk18
-rw-r--r--forms/source/component/FormattedField.cxx2
-rw-r--r--framework/Library_fwe.mk2
-rw-r--r--framework/Package_inc.mk4
-rwxr-xr-xframework/inc/framework/documentundoguard.hxx70
-rwxr-xr-xframework/inc/framework/iguard.hxx69
-rw-r--r--framework/inc/framework/imutex.hxx (renamed from framework/inc/threadhelp/imutex.h)4
-rwxr-xr-xframework/inc/framework/undomanagerhelper.hxx160
-rw-r--r--framework/inc/threadhelp/lockhelper.hxx2
-rw-r--r--framework/inc/threadhelp/resetableguard.hxx2
-rwxr-xr-xframework/source/fwe/helper/documentundoguard.cxx271
-rwxr-xr-xframework/source/fwe/helper/undomanagerhelper.cxx1165
-rw-r--r--hyphen/hyphen-2.4.patch169
-rw-r--r--hyphen/hyphen-2.7.1-read-charset.patch20
-rw-r--r--hyphen/hyphen-2.7.1.patch72
-rw-r--r--hyphen/makefile.mk8
-rw-r--r--hyphen/prj/d.lst4
-rw-r--r--i18npool/inc/i18npool/paper.hxx7
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx4
-rw-r--r--i18npool/source/paper/paper.cxx6
-rw-r--r--l10ntools/source/filter/utils/Cache.java8
-rw-r--r--libtextcat/data/new_fingerprints/fpdb.conf3
-rw-r--r--libtextcat/data/new_fingerprints/lm/serbian-latin.lm400
-rw-r--r--libtextcat/data/new_fingerprints/lm/serbian.lm400
-rw-r--r--libtextcat/data/new_fingerprints/lm/serbian_ascii.lm400
-rw-r--r--libxml2/libxml2-xpath.patch31
-rw-r--r--linguistic/source/misc2.cxx5
-rw-r--r--neon/makefile.mk4
-rw-r--r--neon/neon.patch113
-rw-r--r--neon/neon_exports_unix.patch4
-rw-r--r--neon/neon_exports_win.patch4
-rw-r--r--neon/version.mk4
-rw-r--r--odk/examples/DevelopersGuide/Database/CodeSamples.java42
-rwxr-xr-xoffapi/com/sun/star/awt/AnimatedImagesControl.idl58
-rwxr-xr-xoffapi/com/sun/star/awt/AnimatedImagesControlModel.idl57
-rwxr-xr-xoffapi/com/sun/star/awt/SpinningProgressControlModel.idl54
-rw-r--r--offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl55
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/awt/UnoControlSimpleAnimation.idl9
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/awt/UnoControlSimpleAnimationModel.idl26
-rw-r--r--offapi/com/sun/star/awt/UnoControlThrobber.idl9
-rw-r--r--offapi/com/sun/star/awt/UnoControlThrobberModel.idl10
-rwxr-xr-xoffapi/com/sun/star/awt/XAnimatedImages.idl176
-rwxr-xr-xoffapi/com/sun/star/awt/XAnimation.idl63
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/awt/XSimpleAnimation.idl19
-rw-r--r--offapi/com/sun/star/awt/XThrobber.idl13
-rw-r--r--offapi/com/sun/star/awt/makefile.mk8
-rw-r--r--offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl (renamed from dbaccess/source/inc/cfg_reghelper.hxx)48
-rw-r--r--offapi/com/sun/star/awt/tab/UnoControlTabPage.idl56
-rw-r--r--offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl55
-rw-r--r--offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl55
-rw-r--r--offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl56
-rw-r--r--offapi/com/sun/star/awt/tab/XTabPage.idl52
-rw-r--r--offapi/com/sun/star/awt/tab/XTabPageContainer.idl109
-rw-r--r--offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl57
-rw-r--r--offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl53
-rw-r--r--offapi/com/sun/star/awt/tab/XTabPageModel.idl87
-rw-r--r--offapi/com/sun/star/awt/tab/makefile.mk (renamed from connectivity/qa/connectivity/makefile.mk)53
-rw-r--r--offapi/com/sun/star/chart/ChartAxis.idl39
-rw-r--r--offapi/com/sun/star/chart/ChartAxisType.idl (renamed from offapi/com/sun/star/chart2/XUndoSupplier.idl)34
-rw-r--r--offapi/com/sun/star/chart/Diagram.idl10
-rw-r--r--offapi/com/sun/star/chart/TimeIncrement.idl67
-rw-r--r--offapi/com/sun/star/chart/TimeInterval.idl57
-rw-r--r--offapi/com/sun/star/chart/TimeUnit.idl (renamed from offapi/com/sun/star/chart2/Break.idl)16
-rwxr-xr-xoffapi/com/sun/star/chart/XAxis.idl60
-rwxr-xr-xoffapi/com/sun/star/chart/XAxisSupplier.idl61
-rw-r--r--offapi/com/sun/star/chart/XChartDocument.idl7
-rwxr-xr-xoffapi/com/sun/star/chart/XDateCategories.idl70
-rw-r--r--offapi/com/sun/star/chart/makefile.mk7
-rw-r--r--offapi/com/sun/star/chart2/AxisType.idl3
-rw-r--r--offapi/com/sun/star/chart2/ExplicitIncrementData.idl96
-rw-r--r--offapi/com/sun/star/chart2/ExplicitScaleData.idl45
-rw-r--r--offapi/com/sun/star/chart2/ExplicitSubIncrement.idl30
-rw-r--r--offapi/com/sun/star/chart2/IncrementData.idl4
-rw-r--r--offapi/com/sun/star/chart2/ScaleData.idl36
-rw-r--r--offapi/com/sun/star/chart2/StandardDiagramCreationParameters.idl5
-rw-r--r--offapi/com/sun/star/chart2/SubIncrement.idl4
-rwxr-xr-xoffapi/com/sun/star/chart2/XAnyDescriptionAccess.idl103
-rw-r--r--offapi/com/sun/star/chart2/XAxis.idl26
-rw-r--r--offapi/com/sun/star/chart2/XCoordinateSystem.idl26
-rw-r--r--offapi/com/sun/star/chart2/XDiagram.idl27
-rw-r--r--offapi/com/sun/star/chart2/XPlotter.idl128
-rw-r--r--offapi/com/sun/star/chart2/XUndoHelper.idl90
-rw-r--r--offapi/com/sun/star/chart2/XUndoManager.idl111
-rw-r--r--offapi/com/sun/star/chart2/makefile.mk9
-rwxr-xr-xoffapi/com/sun/star/document/EmptyUndoStackException.idl51
-rw-r--r--offapi/com/sun/star/document/OfficeDocument.idl40
-rwxr-xr-xoffapi/com/sun/star/document/UndoContextNotClosedException.idl51
-rwxr-xr-xoffapi/com/sun/star/document/UndoFailedException.idl56
-rwxr-xr-xoffapi/com/sun/star/document/UndoManagerEvent.idl63
-rwxr-xr-xoffapi/com/sun/star/document/XUndoAction.idl76
-rwxr-xr-xoffapi/com/sun/star/document/XUndoManager.idl337
-rwxr-xr-xoffapi/com/sun/star/document/XUndoManagerListener.idl144
-rwxr-xr-xoffapi/com/sun/star/document/XUndoManagerSupplier.idl55
-rw-r--r--offapi/com/sun/star/document/makefile.mk10
-rw-r--r--offapi/com/sun/star/linguistic2/XLanguageGuessing.idl4
-rw-r--r--offapi/com/sun/star/util/DiskFullException.idl2
-rw-r--r--offapi/com/sun/star/util/FileIOException.idl3
-rwxr-xr-xoffapi/com/sun/star/util/NotLockedException.idl50
-rw-r--r--offapi/com/sun/star/util/XBroadcaster.idl6
-rwxr-xr-xoffapi/com/sun/star/util/XLockable.idl79
-rw-r--r--offapi/com/sun/star/util/makefile.mk2
-rw-r--r--offapi/prj/build.lst3
-rw-r--r--offapi/prj/d.lst2
-rw-r--r--offapi/util/makefile.mk1
-rwxr-xr-x[-rw-r--r--]officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu7
-rwxr-xr-x[-rw-r--r--]officecfg/registry/schema/org/openoffice/Office/Math.xcs14
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Scripting.xcs23
-rw-r--r--offuh/prj/d.lst3
-rw-r--r--oox/inc/oox/drawingml/chart/axismodel.hxx4
-rw-r--r--oox/inc/oox/xls/biffhelper.hxx2
-rw-r--r--oox/source/drawingml/chart/axiscontext.cxx2
-rw-r--r--oox/source/drawingml/chart/axisconverter.cxx99
-rw-r--r--oox/source/drawingml/chart/axismodel.cxx1
-rw-r--r--oox/source/dump/biffdumper.cxx24
-rw-r--r--oox/source/dump/biffdumper.ini30
-rw-r--r--oox/source/helper/zipstorage.cxx4
-rw-r--r--package/source/zipapi/ZipFile.cxx9
-rw-r--r--postprocess/packcomponents/makefile.mk1
-rwxr-xr-xpostprocess/rebase/coffbase.txt1
-rw-r--r--pyuno/demo/pyunoenv.tcsh7
-rw-r--r--qadevOOo/runner/complexlib/Assurance.java25
-rw-r--r--reportbuilder/java/com/sun/star/report/SDBCReportData.java12
-rw-r--r--reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk22
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java63
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java22
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java1
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java22
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xml786
-rwxr-xr-x[-rw-r--r--]reportdesign/inc/ReportDefinition.hxx77
-rw-r--r--reportdesign/inc/RptModel.hxx8
-rw-r--r--reportdesign/inc/UndoActions.hxx52
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx179
-rw-r--r--reportdesign/source/core/sdr/RptModel.cxx2
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx2
-rw-r--r--reportdesign/source/core/sdr/UndoActions.cxx2
-rw-r--r--reportdesign/source/core/sdr/UndoEnv.cxx23
-rw-r--r--reportdesign/source/core/sdr/formatnormalizer.cxx4
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.cxx4
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx16
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx2
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx101
-rw-r--r--reportdesign/source/ui/inc/RptUndo.hxx (renamed from reportdesign/source/ui/inc/Undo.hxx)0
-rw-r--r--reportdesign/source/ui/misc/RptUndo.cxx (renamed from reportdesign/source/ui/misc/Undo.cxx)11
-rw-r--r--reportdesign/source/ui/misc/makefile.mk2
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx7
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx246
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx7
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx2
-rw-r--r--sc/inc/document.hxx22
-rw-r--r--sc/inc/drwlayer.hxx2
-rw-r--r--sc/inc/table.hxx16
-rw-r--r--sc/source/core/data/document.cxx7
-rw-r--r--sc/source/core/data/drwlayer.cxx6
-rw-r--r--sc/source/core/data/table1.cxx38
-rw-r--r--sc/source/core/data/table2.cxx94
-rw-r--r--sc/source/core/data/table3.cxx69
-rw-r--r--sc/source/core/data/validat.cxx5
-rw-r--r--sc/source/core/tool/chartpos.cxx24
-rw-r--r--sc/source/core/tool/compiler.cxx4
-rwxr-xr-xsc/source/core/tool/interpr4.cxx8
-rw-r--r--sc/source/filter/excel/xechart.cxx201
-rw-r--r--[-rwxr-xr-x]sc/source/filter/excel/xichart.cxx143
-rwxr-xr-xsc/source/filter/excel/xlchart.cxx21
-rw-r--r--sc/source/filter/excel/xlroot.cxx6
-rw-r--r--sc/source/filter/inc/xechart.hxx17
-rw-r--r--sc/source/filter/inc/xichart.hxx5
-rwxr-xr-xsc/source/filter/inc/xlchart.hxx35
-rw-r--r--sc/source/filter/inc/xlroot.hxx2
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx17
-rw-r--r--sc/source/ui/app/scmod.cxx11
-rw-r--r--sc/source/ui/docshell/docfunc.cxx9
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
-rw-r--r--sc/source/ui/docshell/docsh4.cxx15
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx7
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx2
-rw-r--r--sc/source/ui/inc/docsh.hxx5
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/inc/undobase.hxx5
-rw-r--r--sc/source/ui/undo/undobase.cxx16
-rw-r--r--sc/source/ui/undo/undoblk.cxx5
-rw-r--r--sc/source/ui/undo/undoblk2.cxx20
-rw-r--r--sc/source/ui/undo/undoblk3.cxx29
-rw-r--r--sc/source/ui/undo/undotab.cxx5
-rw-r--r--sc/source/ui/undo/undoutil.cxx5
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx5
-rw-r--r--sc/source/ui/view/auditsh.cxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx5
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/dbfunc3.cxx2
-rw-r--r--sc/source/ui/view/drawview.cxx2
-rw-r--r--sc/source/ui/view/editsh.cxx2
-rw-r--r--sc/source/ui/view/formatsh.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx2
-rw-r--r--sc/source/ui/view/pgbrksh.cxx2
-rw-r--r--sc/source/ui/view/pivotsh.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx4
-rw-r--r--sc/source/ui/view/tabvwsha.cxx87
-rw-r--r--sc/source/ui/view/tabvwshb.cxx95
-rw-r--r--sc/source/ui/view/tabvwshe.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx2
-rw-r--r--sc/source/ui/view/viewfun3.cxx4
-rwxr-xr-xscp2/source/ooo/file_library_ooo.scp2
-rw-r--r--scp2/source/ooo/file_ooo.scp11
-rw-r--r--scp2/source/ooo/module_hidden_ooo.scp4
-rw-r--r--scripting/source/dlgprov/DialogModelProvider.cxx196
-rw-r--r--scripting/source/dlgprov/DialogModelProvider.hxx92
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx158
-rw-r--r--scripting/source/dlgprov/dlgprov.hxx7
-rw-r--r--scripting/source/dlgprov/makefile.mk1
-rw-r--r--scripting/source/inc/util/util.hxx15
-rw-r--r--scripting/source/protocolhandler/makefile.mk1
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx41
-rw-r--r--scripting/source/provider/ActiveMSPList.cxx1
-rwxr-xr-xscripting/source/provider/MasterScriptProvider.cxx8
-rw-r--r--scripting/source/provider/ProviderCache.cxx17
-rw-r--r--scripting/source/provider/ScriptImpl.cxx8
-rwxr-xr-xscripting/source/provider/ScriptingContext.cxx5
-rw-r--r--scripting/source/runtimemgr/ScriptNameResolverImpl.cxx71
-rwxr-xr-xscripting/source/runtimemgr/ScriptRuntimeManager.cxx61
-rw-r--r--scripting/source/runtimemgr/StorageBridge.cxx32
-rw-r--r--scripting/source/storage/ScriptMetadataImporter.cxx29
-rwxr-xr-xscripting/source/storage/ScriptSecurityManager.cxx162
-rw-r--r--scripting/source/storage/ScriptStorage.cxx67
-rw-r--r--scripting/source/storage/ScriptStorageManager.cxx53
-rwxr-xr-x[-rw-r--r--]sd/inc/undo/undomanager.hxx14
-rwxr-xr-xsd/source/core/drawdoc3.cxx6
-rwxr-xr-xsd/source/core/sdpage.cxx26
-rwxr-xr-x[-rw-r--r--]sd/source/core/undo/undomanager.cxx39
-rwxr-xr-xsd/source/ui/animations/CustomAnimationPane.cxx4
-rwxr-xr-xsd/source/ui/animations/SlideTransitionPane.cxx6
-rw-r--r--sd/source/ui/app/app.img120
-rwxr-xr-xsd/source/ui/dlg/LayerTabBar.cxx2
-rwxr-xr-xsd/source/ui/dlg/dlgass.cxx2
-rwxr-xr-xsd/source/ui/docshell/docshell.cxx4
-rwxr-xr-x[-rw-r--r--]sd/source/ui/func/fubullet.cxx4
-rwxr-xr-x[-rw-r--r--]sd/source/ui/func/fuoaprms.cxx2
-rwxr-xr-xsd/source/ui/func/fupage.cxx2
-rwxr-xr-xsd/source/ui/inc/DrawDocShell.hxx4
-rwxr-xr-xsd/source/ui/inc/SlideSorterViewShell.hxx2
-rwxr-xr-xsd/source/ui/inc/ViewShell.hxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/unmodpg.hxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx4
-rwxr-xr-xsd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx2
-rwxr-xr-xsd/source/ui/toolpanel/controls/DocumentHelper.cxx4
-rwxr-xr-xsd/source/ui/view/ViewShellImplementation.cxx4
-rwxr-xr-xsd/source/ui/view/ViewShellManager.cxx4
-rwxr-xr-xsd/source/ui/view/drviews2.cxx2
-rwxr-xr-xsd/source/ui/view/drviewsb.cxx6
-rwxr-xr-xsd/source/ui/view/outlview.cxx50
-rwxr-xr-xsd/source/ui/view/sdview.cxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/view/unmodpg.cxx4
-rw-r--r--sd/source/ui/view/viewshe3.cxx4
-rwxr-xr-xsd/source/ui/view/viewshel.cxx43
-rwxr-xr-xsfx2/Library_sfx.mk2
-rw-r--r--sfx2/Package_inc.mk1
-rw-r--r--sfx2/inc/sfx2/app.hxx14
-rw-r--r--sfx2/inc/sfx2/dispatch.hxx3
-rw-r--r--sfx2/inc/sfx2/evntconf.hxx4
-rw-r--r--sfx2/inc/sfx2/macrconf.hxx155
-rw-r--r--sfx2/inc/sfx2/objsh.hxx35
-rwxr-xr-x[-rw-r--r--]sfx2/inc/sfx2/sfx.hrc30
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx78
-rwxr-xr-x[-rw-r--r--]sfx2/inc/sfx2/sfxcommands.h687
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc40
-rw-r--r--sfx2/inc/sfx2/shell.hxx13
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx1
-rw-r--r--sfx2/prj/build.lst17
-rw-r--r--sfx2/qa/complex/sfx2/DocumentInfo.java (renamed from sfx2/qa/complex/docinfo/DocumentProperties.java)19
-rw-r--r--sfx2/qa/complex/sfx2/DocumentMetadataAccess.java (renamed from sfx2/qa/complex/framework/DocumentMetadataAccessTest.java)201
-rw-r--r--sfx2/qa/complex/sfx2/DocumentProperties.java (renamed from sfx2/qa/complex/framework/DocumentPropertiesTest.java)34
-rw-r--r--sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java (renamed from sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java)14
-rw-r--r--sfx2/qa/complex/sfx2/StandaloneDocumentInfo.java (renamed from sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java)26
-rwxr-xr-xsfx2/qa/complex/sfx2/UndoManager.java1464
-rw-r--r--sfx2/qa/complex/sfx2/makefile.mk (renamed from connectivity/qa/drivers/dbase/makefile.mk)64
-rw-r--r--sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest.java (renamed from sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoTest.java)2
-rw-r--r--sfx2/qa/complex/sfx2/standalonedocinfo/Test01.java (renamed from sfx2/qa/complex/standalonedocumentinfo/Test01.java)4
-rw-r--r--sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper.java (renamed from sfx2/qa/complex/standalonedocumentinfo/TestHelper.java)2
-rw-r--r--sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt (renamed from sfx2/qa/complex/framework/testdocuments/CUSTOM.odt)bin1021 -> 1021 bytes
-rw-r--r--sfx2/qa/complex/sfx2/testdocuments/TEST.odt (renamed from sfx2/qa/complex/framework/testdocuments/TEST.odt)bin13803 -> 13803 bytes
-rw-r--r--sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt (renamed from sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt)bin7540 -> 7540 bytes
-rw-r--r--sfx2/qa/complex/sfx2/testdocuments/empty.rdf (renamed from sfx2/qa/complex/framework/testdocuments/empty.rdf)0
-rw-r--r--sfx2/qa/complex/sfx2/tools/DialogThread.java (renamed from sfx2/qa/complex/framework/DialogThread.java)19
-rw-r--r--sfx2/qa/complex/sfx2/tools/TestDocument.java (renamed from sfx2/qa/complex/framework/TestDocument.java)4
-rw-r--r--sfx2/qa/complex/sfx2/tools/WriterHelper.java (renamed from sfx2/qa/complex/framework/WriterHelper.java)34
-rwxr-xr-xsfx2/qa/complex/sfx2/undo/CalcDocumentTest.java96
-rwxr-xr-xsfx2/qa/complex/sfx2/undo/ChartDocumentTest.java277
-rwxr-xr-xsfx2/qa/complex/sfx2/undo/DocumentTest.java61
-rwxr-xr-xsfx2/qa/complex/sfx2/undo/DocumentTestBase.java29
-rwxr-xr-x[-rw-r--r--]sfx2/qa/complex/sfx2/undo/DrawDocumentTest.java (renamed from dbaccess/source/shared/cfg_reghelper.cxx)35
-rwxr-xr-xsfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java196
-rwxr-xr-xsfx2/qa/complex/sfx2/undo/ImpressDocumentTest.java46
-rwxr-xr-xsfx2/qa/complex/sfx2/undo/WriterDocumentTest.java104
-rw-r--r--sfx2/qa/complex/tests.sce3
-rw-r--r--sfx2/sdi/docslots.sdi5
-rw-r--r--sfx2/sdi/sfx.sdi75
-rw-r--r--sfx2/source/appl/app.cxx6
-rw-r--r--sfx2/source/appl/app.hrc91
-rw-r--r--sfx2/source/appl/app.src470
-rw-r--r--sfx2/source/appl/appbas.cxx176
-rw-r--r--sfx2/source/appl/appcfg.cxx20
-rw-r--r--sfx2/source/appl/appdata.cxx2
-rw-r--r--sfx2/source/appl/appdde.cxx5
-rw-r--r--sfx2/source/appl/appinit.cxx5
-rw-r--r--sfx2/source/appl/appquit.cxx4
-rw-r--r--sfx2/source/appl/appserv.cxx8
-rw-r--r--sfx2/source/appl/appuno.cxx105
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx48
-rw-r--r--sfx2/source/config/evntconf.cxx2
-rw-r--r--sfx2/source/control/bindings.cxx11
-rwxr-xr-xsfx2/source/control/dispatch.cxx71
-rw-r--r--sfx2/source/control/macrconf.cxx874
-rw-r--r--sfx2/source/control/msgpool.cxx1
-rw-r--r--sfx2/source/control/shell.cxx26
-rw-r--r--sfx2/source/doc/doc.hrc5
-rw-r--r--sfx2/source/doc/doc.src13
-rw-r--r--sfx2/source/doc/doctemplates.cxx28
-rwxr-xr-xsfx2/source/doc/docundomanager.cxx457
-rw-r--r--sfx2/source/doc/guisaveas.cxx2
-rw-r--r--sfx2/source/doc/objmisc.cxx184
-rw-r--r--sfx2/source/doc/objserv.cxx7
-rw-r--r--sfx2/source/doc/objstor.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx109
-rw-r--r--sfx2/source/inc/appdata.hxx2
-rwxr-xr-xsfx2/source/inc/docundomanager.hxx116
-rw-r--r--sfx2/source/inc/eventsupplier.hxx13
-rw-r--r--sfx2/source/inc/sfxurlrelocator.hxx5
-rw-r--r--sfx2/source/menu/mnuitem.cxx3
-rwxr-xr-xsfx2/source/menu/mnumgr.cxx1
-rw-r--r--sfx2/source/menu/virtmenu.cxx19
-rw-r--r--sfx2/source/notify/eventsupplier.cxx130
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx1
-rw-r--r--sfx2/source/view/viewfrm.cxx24
-rw-r--r--smoketestoo_native/data/Test_10er.xml71
-rwxr-xr-x[-rw-r--r--]solenv/inc/_tg_rslb.mk60
-rw-r--r--solenv/inc/_tg_shl.mk50
-rw-r--r--solenv/inc/installationtest.mk21
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--solenv/inc/tg_jar.mk14
-rw-r--r--solenv/inc/tg_java.mk11
-rw-r--r--solenv/inc/tg_rslb.mk6
-rw-r--r--solenv/inc/tg_shl.mk5
-rwxr-xr-xsolenv/inc/wntmsci11.mk3
-rwxr-xr-x[-rw-r--r--]starmath/inc/dialog.hxx1
-rwxr-xr-x[-rw-r--r--]starmath/inc/document.hxx18
-rwxr-xr-x[-rw-r--r--]starmath/inc/parse.hxx80
-rwxr-xr-x[-rw-r--r--]starmath/inc/starmath.hrc5
-rw-r--r--starmath/source/cfgitem.cxx28
-rw-r--r--starmath/source/cfgitem.hxx3
-rwxr-xr-x[-rw-r--r--]starmath/source/config.cxx5
-rwxr-xr-x[-rw-r--r--]starmath/source/dialog.cxx7
-rwxr-xr-x[-rw-r--r--]starmath/source/dialog.hrc9
-rwxr-xr-x[-rw-r--r--]starmath/source/document.cxx44
-rwxr-xr-x[-rw-r--r--]starmath/source/makefile.mk22
-rwxr-xr-x[-rw-r--r--]starmath/source/mathmlexport.cxx16
-rwxr-xr-x[-rw-r--r--]starmath/source/mathmlimport.cxx63
-rwxr-xr-x[-rw-r--r--]starmath/source/mathmlimport.hxx8
-rwxr-xr-xstarmath/source/parse.cxx917
-rwxr-xr-x[-rw-r--r--]starmath/source/smmod.cxx1
-rwxr-xr-xstarmath/source/smres.src7
-rw-r--r--starmath/source/symbol.cxx17
-rwxr-xr-xstarmath/source/unomodel.cxx16
-rwxr-xr-xstarmath/source/view.cxx49
-rw-r--r--svl/inc/svl/undo.hxx352
-rw-r--r--svl/source/undo/undo.cxx1203
-rw-r--r--svtools/inc/svtools/textdata.hxx20
-rw-r--r--svtools/inc/svtools/texteng.hxx13
-rw-r--r--svtools/inc/svtools/xtextedt.hxx4
-rw-r--r--svtools/source/contnr/svtreebx.cxx4
-rwxr-xr-xsvtools/source/control/inettbc.cxx3
-rw-r--r--svtools/source/edit/texteng.cxx16
-rw-r--r--svtools/source/edit/textundo.cxx29
-rw-r--r--svtools/source/edit/textundo.hxx8
-rw-r--r--svtools/source/edit/textview.cxx32
-rw-r--r--svtools/source/edit/xtextedt.cxx8
-rw-r--r--svtools/source/misc/templatefoldercache.cxx11
-rw-r--r--svtools/source/uno/unoiface.cxx2
-rw-r--r--svx/inc/svx/svdmodel.hxx1
-rw-r--r--svx/source/fmcomp/fmgridif.cxx37
-rw-r--r--svx/source/fmcomp/gridcell.cxx10
-rw-r--r--svx/source/form/fmscriptingenv.cxx83
-rw-r--r--svx/source/form/fmview.cxx1
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/inc/typeconversionclient.hxx9
-rwxr-xr-x[-rw-r--r--]svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx12
-rw-r--r--svx/source/svdraw/svdmodel.cxx5
-rw-r--r--svx/source/unodraw/unopage.cxx14
-rw-r--r--svx/source/unodraw/unoshape.cxx9
-rwxr-xr-xsw/inc/IDocumentDeviceAccess.hxx2
-rw-r--r--sw/inc/IDocumentUndoRedo.hxx260
-rw-r--r--sw/inc/IShellCursorSupplier.hxx51
-rw-r--r--sw/inc/SwRewriter.hxx6
-rw-r--r--sw/inc/SwUndoField.hxx26
-rw-r--r--sw/inc/cmdid.h3
-rw-r--r--sw/inc/crsrsh.hxx15
-rw-r--r--sw/inc/dbgoutsw.hxx2
-rw-r--r--sw/inc/doc.hxx89
-rw-r--r--sw/inc/docary.hxx7
-rw-r--r--sw/inc/editsh.hxx50
-rw-r--r--sw/inc/ndarr.hxx15
-rw-r--r--sw/inc/ndindex.hxx19
-rw-r--r--sw/inc/prtopt.hxx (renamed from sw/source/ui/inc/prtopt.hxx)0
-rw-r--r--sw/inc/shellio.hxx4
-rw-r--r--sw/inc/swdbtoolsclient.hxx2
-rw-r--r--sw/inc/swundo.hxx32
-rw-r--r--sw/inc/undobj.hxx1680
-rw-r--r--sw/inc/unoprnms.hxx3
-rw-r--r--sw/inc/viewsh.hxx3
-rw-r--r--sw/source/core/bastyp/swtypes.cxx3
-rw-r--r--sw/source/core/crsr/bookmrk.cxx18
-rw-r--r--sw/source/core/crsr/crsrsh.cxx15
-rw-r--r--sw/source/core/crsr/crstrvl.cxx11
-rw-r--r--sw/source/core/crsr/findattr.cxx17
-rw-r--r--sw/source/core/crsr/findcoll.cxx21
-rw-r--r--sw/source/core/crsr/findtxt.cxx25
-rw-r--r--sw/source/core/crsr/swcrsr.cxx14
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx71
-rw-r--r--sw/source/core/doc/doc.cxx148
-rw-r--r--sw/source/core/doc/docbasic.cxx4
-rw-r--r--sw/source/core/doc/docbm.cxx1
-rw-r--r--sw/source/core/doc/doccomp.cxx55
-rw-r--r--sw/source/core/doc/doccorr.cxx4
-rw-r--r--sw/source/core/doc/docdesc.cxx36
-rw-r--r--sw/source/core/doc/docdraw.cxx39
-rw-r--r--sw/source/core/doc/docedt.cxx200
-rw-r--r--sw/source/core/doc/docfld.cxx18
-rw-r--r--sw/source/core/doc/docfly.cxx119
-rw-r--r--sw/source/core/doc/docfmt.cxx123
-rw-r--r--sw/source/core/doc/docftn.cxx22
-rw-r--r--sw/source/core/doc/docglbl.cxx5
-rw-r--r--sw/source/core/doc/docglos.cxx14
-rw-r--r--sw/source/core/doc/doclay.cxx260
-rw-r--r--sw/source/core/doc/docnew.cxx90
-rw-r--r--sw/source/core/doc/docnum.cxx122
-rw-r--r--sw/source/core/doc/docredln.cxx82
-rw-r--r--sw/source/core/doc/docruby.cxx15
-rw-r--r--sw/source/core/doc/docsort.cxx44
-rw-r--r--sw/source/core/doc/doctxm.cxx25
-rw-r--r--sw/source/core/doc/extinput.cxx18
-rw-r--r--sw/source/core/doc/poolfmt.cxx47
-rw-r--r--sw/source/core/doc/tblcpy.cxx13
-rw-r--r--sw/source/core/doc/tblrwcl.cxx3
-rw-r--r--sw/source/core/docnode/ndcopy.cxx110
-rw-r--r--sw/source/core/docnode/ndsect.cxx82
-rw-r--r--sw/source/core/docnode/ndtbl.cxx373
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx46
-rw-r--r--sw/source/core/docnode/nodes.cxx67
-rw-r--r--sw/source/core/docnode/section.cxx17
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx2
-rw-r--r--sw/source/core/draw/dflyobj.cxx5
-rw-r--r--sw/source/core/draw/dview.cxx5
-rw-r--r--sw/source/core/edit/acorrect.cxx24
-rw-r--r--sw/source/core/edit/autofmt.cxx61
-rw-r--r--sw/source/core/edit/edatmisc.cxx26
-rw-r--r--sw/source/core/edit/eddel.cxx18
-rw-r--r--sw/source/core/edit/edfcol.cxx7
-rw-r--r--sw/source/core/edit/edglbldc.cxx22
-rw-r--r--sw/source/core/edit/editsh.cxx18
-rw-r--r--sw/source/core/edit/edlingu.cxx9
-rw-r--r--sw/source/core/edit/ednumber.cxx34
-rw-r--r--sw/source/core/edit/edsect.cxx9
-rw-r--r--sw/source/core/edit/edtab.cxx19
-rw-r--r--sw/source/core/edit/edtox.cxx24
-rw-r--r--sw/source/core/edit/edundo.cxx204
-rw-r--r--sw/source/core/edit/edws.cxx56
-rw-r--r--sw/source/core/fields/reffld.cxx2
-rw-r--r--sw/source/core/fields/usrfld.cxx8
-rw-r--r--sw/source/core/frmedt/fecopy.cxx10
-rw-r--r--sw/source/core/frmedt/fedesc.cxx12
-rw-r--r--sw/source/core/frmedt/fefly1.cxx22
-rw-r--r--sw/source/core/frmedt/feshview.cxx13
-rw-r--r--sw/source/core/frmedt/fetab.cxx4
-rw-r--r--sw/source/core/frmedt/tblsel.cxx15
-rw-r--r--sw/source/core/inc/SwUndoFmt.hxx (renamed from sw/inc/SwUndoFmt.hxx)33
-rw-r--r--sw/source/core/inc/SwUndoPageDesc.hxx (renamed from sw/inc/SwUndoPageDesc.hxx)25
-rw-r--r--sw/source/core/inc/SwUndoTOXChange.hxx (renamed from sw/inc/SwUndoTOXChange.hxx)14
-rw-r--r--sw/source/core/inc/UndoAttribute.hxx288
-rw-r--r--sw/source/core/inc/UndoBookmark.hxx (renamed from connectivity/qa/connectivity/GeneralTest.java)75
-rw-r--r--sw/source/core/inc/UndoCore.hxx263
-rw-r--r--sw/source/core/inc/UndoDelete.hxx115
-rw-r--r--sw/source/core/inc/UndoDraw.hxx150
-rw-r--r--sw/source/core/inc/UndoInsert.hxx235
-rw-r--r--sw/source/core/inc/UndoManager.hxx124
-rw-r--r--sw/source/core/inc/UndoNumbering.hxx154
-rw-r--r--sw/source/core/inc/UndoOverwrite.hxx105
-rw-r--r--sw/source/core/inc/UndoRedline.hxx145
-rw-r--r--sw/source/core/inc/UndoSection.hxx82
-rw-r--r--sw/source/core/inc/UndoSort.hxx97
-rw-r--r--sw/source/core/inc/UndoSplitMove.hxx96
-rw-r--r--sw/source/core/inc/UndoTable.hxx391
-rw-r--r--sw/source/core/inc/acorrect.hxx2
-rw-r--r--sw/source/core/inc/rolbck.hxx (renamed from sw/inc/rolbck.hxx)0
-rw-r--r--sw/source/core/inc/undoflystrattr.hxx11
-rw-r--r--sw/source/core/layout/atrfrm.cxx13
-rw-r--r--sw/source/core/layout/flycnt.cxx8
-rw-r--r--sw/source/core/layout/laycache.cxx3
-rw-r--r--sw/source/core/layout/trvlfrm.cxx7
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx8
-rw-r--r--sw/source/core/table/swnewtable.cxx12
-rw-r--r--sw/source/core/table/swtable.cxx3
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx20
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx14
-rw-r--r--sw/source/core/txtnode/thints.cxx18
-rw-r--r--sw/source/core/txtnode/txtedt.cxx83
-rw-r--r--sw/source/core/undo/SwUndoField.cxx38
-rw-r--r--sw/source/core/undo/SwUndoFmt.cxx81
-rw-r--r--sw/source/core/undo/SwUndoPageDesc.cxx66
-rw-r--r--sw/source/core/undo/SwUndoTOXChange.cxx16
-rw-r--r--sw/source/core/undo/docundo.cxx1133
-rw-r--r--sw/source/core/undo/rolbck.cxx46
-rw-r--r--sw/source/core/undo/unattr.cxx288
-rw-r--r--sw/source/core/undo/unbkmk.cxx17
-rw-r--r--sw/source/core/undo/undel.cxx54
-rw-r--r--sw/source/core/undo/undobj.cxx275
-rw-r--r--sw/source/core/undo/undobj1.cxx155
-rw-r--r--sw/source/core/undo/undoflystrattr.cxx9
-rw-r--r--sw/source/core/undo/undraw.cxx53
-rw-r--r--sw/source/core/undo/unfmco.cxx43
-rw-r--r--sw/source/core/undo/unins.cxx288
-rw-r--r--sw/source/core/undo/unmove.cxx27
-rw-r--r--sw/source/core/undo/unnum.cxx172
-rw-r--r--sw/source/core/undo/unoutl.cxx27
-rw-r--r--sw/source/core/undo/unovwr.cxx78
-rw-r--r--sw/source/core/undo/unredln.cxx137
-rw-r--r--sw/source/core/undo/unsect.cxx62
-rw-r--r--sw/source/core/undo/unsort.cxx83
-rw-r--r--sw/source/core/undo/unspnd.cxx48
-rw-r--r--sw/source/core/undo/untbl.cxx357
-rw-r--r--sw/source/core/undo/untblk.cxx64
-rw-r--r--sw/source/core/unocore/unobkm.cxx11
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx11
-rw-r--r--sw/source/core/unocore/unodraw.cxx9
-rw-r--r--sw/source/core/unocore/unoframe.cxx22
-rw-r--r--sw/source/core/unocore/unomap.cxx1
-rw-r--r--sw/source/core/unocore/unoobj.cxx19
-rw-r--r--sw/source/core/unocore/unoobj2.cxx13
-rw-r--r--sw/source/core/unocore/unoprnms.cxx1
-rw-r--r--sw/source/core/unocore/unosect.cxx5
-rw-r--r--sw/source/core/unocore/unostyle.cxx9
-rw-r--r--sw/source/core/unocore/unotbl.cxx12
-rw-r--r--sw/source/core/unocore/unotext.cxx48
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx3
-rw-r--r--sw/source/core/view/viewsh.cxx7
-rw-r--r--sw/source/core/view/vnew.cxx10
-rw-r--r--sw/source/core/view/vprint.cxx17
-rw-r--r--sw/source/filter/basflt/shellio.cxx34
-rw-r--r--sw/source/filter/html/htmlbas.cxx8
-rw-r--r--sw/source/filter/html/htmlcss1.cxx2
-rw-r--r--sw/source/filter/html/htmldraw.cxx6
-rw-r--r--sw/source/filter/html/htmlform.cxx4
-rw-r--r--sw/source/filter/html/htmlsect.cxx14
-rw-r--r--sw/source/filter/html/htmltab.cxx21
-rw-r--r--sw/source/filter/html/swhtml.cxx34
-rw-r--r--sw/source/filter/rtf/rtffly.cxx6
-rw-r--r--sw/source/filter/rtf/rtftbl.cxx4
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx3
-rw-r--r--sw/source/filter/writer/writer.cxx6
-rw-r--r--sw/source/filter/ww1/fltshell.cxx13
-rw-r--r--sw/source/filter/ww8/ww8par.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx2
-rw-r--r--sw/source/ui/app/apphdl.cxx30
-rw-r--r--sw/source/ui/app/appopt.cxx4
-rw-r--r--sw/source/ui/app/docsh.cxx5
-rw-r--r--sw/source/ui/app/docsh2.cxx35
-rw-r--r--sw/source/ui/app/docst.cxx25
-rw-r--r--sw/source/ui/app/docstyle.cxx20
-rw-r--r--sw/source/ui/config/optload.cxx6
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx15
-rw-r--r--sw/source/ui/dbui/swdbtoolsclient.cxx4
-rw-r--r--sw/source/ui/dialog/macassgn.cxx33
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx14
-rw-r--r--sw/source/ui/docvw/AnnotationWin.cxx9
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx8
-rw-r--r--sw/source/ui/docvw/SidebarTxtControl.cxx1
-rw-r--r--sw/source/ui/docvw/edtwin.cxx10
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx5
-rwxr-xr-xsw/source/ui/inc/annotsh.hxx3
-rw-r--r--sw/source/ui/inc/drwtxtsh.hxx3
-rw-r--r--sw/source/ui/inc/inputwin.hxx21
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx13
-rw-r--r--sw/source/ui/index/toxmgr.cxx20
-rw-r--r--sw/source/ui/lingu/olmenu.cxx3
-rw-r--r--sw/source/ui/misc/glshell.cxx14
-rw-r--r--sw/source/ui/misc/redlndlg.cxx19
-rw-r--r--sw/source/ui/ribbar/drawbase.cxx7
-rwxr-xr-xsw/source/ui/ribbar/inputwin.cxx94
-rwxr-xr-xsw/source/ui/shells/annotsh.cxx32
-rw-r--r--sw/source/ui/shells/basesh.cxx30
-rw-r--r--sw/source/ui/shells/drwbassh.cxx2
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx18
-rw-r--r--sw/source/ui/shells/grfshex.cxx15
-rwxr-xr-x[-rw-r--r--]sw/source/ui/shells/langhelper.cxx6
-rw-r--r--sw/source/ui/shells/textsh.cxx11
-rw-r--r--sw/source/ui/table/chartins.cxx4
-rw-r--r--sw/source/ui/uiview/srcview.cxx2
-rw-r--r--sw/source/ui/uiview/view.cxx8
-rw-r--r--sw/source/ui/uiview/view2.cxx14
-rw-r--r--sw/source/ui/uiview/viewprt.cxx6
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx15
-rw-r--r--sw/source/ui/uiview/viewstat.cxx11
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx6
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx5
-rw-r--r--sw/source/ui/uno/unomod.cxx16
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx54
-rw-r--r--sw/source/ui/utlui/content.cxx24
-rw-r--r--sw/source/ui/wrtsh/select.cxx6
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx5
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx25
-rw-r--r--sw/source/ui/wrtsh/wrtundo.cxx53
-rw-r--r--test/prj/build.lst1
-rw-r--r--test/prj/d.lst1
-rw-r--r--test/source/java/org/openoffice/test/makefile.mk9
-rw-r--r--test/source/java/org/openoffice/test/tools/DocumentType.java64
-rw-r--r--test/source/java/org/openoffice/test/tools/OfficeDocument.java328
-rw-r--r--test/source/java/org/openoffice/test/tools/OfficeDocumentView.java144
-rw-r--r--test/source/java/org/openoffice/test/tools/SpreadsheetDocument.java73
-rw-r--r--test/source/java/org/openoffice/test/tools/SpreadsheetView.java72
-rw-r--r--test/source/java/org/openoffice/test/tools/makefile.mk49
-rwxr-xr-xtestautomation/chart2/optional/ch2_losa_ods_to_sdc.bas67
-rwxr-xr-xtestautomation/chart2/optional/ch2_losa_sxc_to_sdc.bas68
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc19
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/required/ch2_updt_calc.bas3
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/required/includes/ch2_file.inc77
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/required/includes/ch2_format.inc37
-rw-r--r--testautomation/dbaccess/optional/dba_rpt_Charts.bas47
-rw-r--r--[-rwxr-xr-x]testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc12
-rw-r--r--[-rwxr-xr-x]testautomation/dbaccess/optional/includes/db_Query.inc48
-rw-r--r--testautomation/dbaccess/optional/includes/rpt_Charts.inc94
-rw-r--r--[-rwxr-xr-x]testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc7
-rw-r--r--testautomation/dbaccess/tools/dbcreatetools.inc9
-rw-r--r--[-rwxr-xr-x]testautomation/dbaccess/tools/tabletools.inc1
-rwxr-xr-xtestautomation/extensions/optional/e_display_name.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_fileopen.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_help.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_identifiers.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_issues.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_location.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_meta-inf.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_online_update.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_options.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_platforms.bas2
-rwxr-xr-xtestautomation/extensions/optional/e_publisher.bas2
-rw-r--r--[-rwxr-xr-x]testautomation/extensions/optional/includes/display_name.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/extensions/optional/includes/fileopen.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/extensions/optional/includes/help.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/extensions/optional/includes/identifiers.inc2
-rwxr-xr-xtestautomation/extensions/optional/includes/issue110083.inc2
-rw-r--r--testautomation/extensions/optional/includes/location.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/extensions/optional/includes/meta-inf.inc2
-rw-r--r--testautomation/extensions/optional/includes/online_update.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/extensions/optional/includes/options.inc2
-rw-r--r--testautomation/extensions/optional/includes/platforms.inc2
-rw-r--r--testautomation/extensions/optional/includes/publisher.inc2
-rwxr-xr-x[-rw-r--r--]testautomation/extensions/required/e_update.bas2
-rw-r--r--testautomation/extensions/required/includes/e_update.inc2
-rwxr-xr-xtestautomation/framework/optional/f_basic_dialog_i18n.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_documents.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_first.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_formcontrols.bas2
-rw-r--r--testautomation/framework/optional/f_basic_gridcontrol.bas1
-rwxr-xr-xtestautomation/framework/optional/f_basic_issues.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_library_export_import.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_modules.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_package_export_import.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_protected_libraries.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_shared_modules.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_templatedocuments.bas2
-rwxr-xr-xtestautomation/framework/optional/f_basic_vba-compat.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_labels.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_samplefileopen.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_sampleopen.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_samplepreview.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_tableautoformat.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_templatefileopen.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_templateopen.bas2
-rwxr-xr-xtestautomation/framework/optional/f_extras_templatepreview.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_allowed_names.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_autocompletion.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_cjk_files.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_dialogtest.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_folder_navigation.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_forbidden_names_windows.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_multiselection.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_passwords.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_reserved_names_unix.bas2
-rwxr-xr-xtestautomation/framework/optional/f_filedlg_reserved_names_windows.bas2
-rwxr-xr-xtestautomation/framework/optional/f_help_bookmarks.bas2
-rwxr-xr-xtestautomation/framework/optional/f_help_compare_applications.bas2
-rwxr-xr-xtestautomation/framework/optional/f_help_compare_content.bas2
-rwxr-xr-xtestautomation/framework/optional/f_help_compare_topics.bas2
-rwxr-xr-xtestautomation/framework/optional/f_help_search.bas2
-rwxr-xr-xtestautomation/framework/optional/f_help_view_topics.bas2
-rwxr-xr-xtestautomation/framework/optional/f_scripting_organizers.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_broken_signature.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_certification_dialogs.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_certified_docs.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_evilmacro.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_incorrect_password.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_macrosecurity.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_recommend_password.bas2
-rwxr-xr-xtestautomation/framework/optional/f_security_trusted_path.bas2
-rwxr-xr-xtestautomation/framework/optional/f_toolbar_items.bas2
-rwxr-xr-xtestautomation/framework/optional/f_usage_tracking.bas2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_delete_modules.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_documents.inc2
-rw-r--r--testautomation/framework/optional/includes/basic_formcontrols.inc2
-rw-r--r--testautomation/framework/optional/includes/basic_gridcontrol.inc52
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_ide.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_issues.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_library_export.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_library_import.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_macros.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_modulehide.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_modulenames.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_modules.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_package_export.inc2
-rw-r--r--testautomation/framework/optional/includes/basic_package_import.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_protected_libraries.inc2
-rw-r--r--testautomation/framework/optional/includes/basic_shared_modules.inc2
-rw-r--r--testautomation/framework/optional/includes/basic_spectemplate.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_usertemplate.inc2
-rw-r--r--testautomation/framework/optional/includes/basic_vba-compat_application-union.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc2
-rw-r--r--testautomation/framework/optional/includes/basic_vba-compat_security_check.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/basic_vba_compat_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/extras_file_open.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/extras_labels.inc2
-rw-r--r--testautomation/framework/optional/includes/extras_modify_objects.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/extras_preview.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/extras_table_autoformat.inc2
-rw-r--r--testautomation/framework/optional/includes/f_usage_tracking.inc6
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_allowed_names.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_autocomplete.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_cjk_files.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_cjk_folders.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_document_properties.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_filternames.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_folders1.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_folders2.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_folders3.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_folders4.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_folders5.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_folders6.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_folders7.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_multiselection.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_passwords.inc2
-rw-r--r--testautomation/framework/optional/includes/filedlg_rename.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/filedlg_triggers.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/help_bookmarks.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/help_compare_applications.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/help_compare_content.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/help_compare_topics.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/help_search.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/help_view_topics.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/options_loadsave_html.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/options_loadsave_msoffice.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/options_loadsave_vba.inc2
-rw-r--r--testautomation/framework/optional/includes/options_ooo_general.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/options_ooo_memory.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/scripting_organizers.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/security_broken_signature.inc2
-rw-r--r--testautomation/framework/optional/includes/security_certification_dialogs.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/security_certified_docs.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/security_evilmacro1.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/security_evilmacro2.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/security_evilmacro3.inc2
-rw-r--r--testautomation/framework/optional/includes/security_incorrect_password.inc2
-rw-r--r--testautomation/framework/optional/includes/security_macrosecurity.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/security_recommend_password.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/security_trusted_path.inc3
-rw-r--r--[-rwxr-xr-x]testautomation/framework/optional/includes/standardbar2.inc2
-rwxr-xr-xtestautomation/framework/optional/input/gridcontrol.odtbin14075 -> 12252 bytes
-rwxr-xr-xtestautomation/framework/required/f_help_browser.bas2
-rwxr-xr-xtestautomation/framework/required/f_printer_administration.bas2
-rw-r--r--testautomation/framework/required/f_programmability_dialogs.bas2
-rwxr-xr-xtestautomation/framework/required/f_security_dialogs.bas2
-rwxr-xr-xtestautomation/framework/required/f_standard_toolbar.bas2
-rwxr-xr-xtestautomation/framework/required/f_tools_customize.bas2
-rwxr-xr-xtestautomation/framework/required/f_tools_options.bas2
-rwxr-xr-xtestautomation/framework/required/f_topten.bas2
-rwxr-xr-xtestautomation/framework/required/f_window_functions.bas2
-rwxr-xr-xtestautomation/framework/required/f_wizards.bas2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/basic_dialog_export.inc2
-rw-r--r--testautomation/framework/required/includes/basic_dialog_i18n.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/basic_dialog_i18n_import.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/basic_macroassignment.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/basic_organizer.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/first.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/help_browser.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/printer_administration.inc2
-rw-r--r--testautomation/framework/required/includes/script_organizers.inc2
-rw-r--r--testautomation/framework/required/includes/scripting_basics.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/security_dialogs.inc2
-rw-r--r--testautomation/framework/required/includes/smoketest.inc4
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/standard_toolbar_1.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/standard_toolbar_3.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/standard_toolbar_4.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/standard_toolbar_5.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/standard_toolbar_6.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/tools_customize.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/tools_options.inc2
-rw-r--r--testautomation/framework/required/includes/topten.inc107
-rwxr-xr-xtestautomation/framework/required/includes/window_functions.inc2
-rw-r--r--testautomation/framework/required/includes/wizard_agenda.inc2
-rw-r--r--testautomation/framework/required/includes/wizard_documentconverter.inc2
-rw-r--r--testautomation/framework/required/includes/wizard_euroconverter.inc2
-rw-r--r--testautomation/framework/required/includes/wizard_fax.inc2
-rw-r--r--testautomation/framework/required/includes/wizard_firsttime.inc2
-rw-r--r--testautomation/framework/required/includes/wizard_letter.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/required/includes/wizard_mailmerge.inc2
-rw-r--r--testautomation/framework/required/includes/wizard_presentation.inc2
-rwxr-xr-xtestautomation/framework/required/input/10erTest_680.sxwbin32670 -> 33373 bytes
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/customize_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/fileoperations.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/formcontrols.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/help_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/i18n_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/pbrowser_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/private_environment.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/scriptorganizer_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/spadmin_tools.inc2
-rw-r--r--testautomation/framework/tools/includes/template_tools.inc2
-rw-r--r--testautomation/framework/tools/includes/toolbar_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/webtools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/framework/tools/includes/window_tools.inc2
-rw-r--r--testautomation/framework/tools/includes/wizards.inc2
-rw-r--r--testautomation/global/required/includes/g_findbar.inc2
-rw-r--r--testautomation/global/required/includes/g_option.inc2
-rw-r--r--testautomation/global/required/includes/g_printing.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_accels.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_basic_ide_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc2
-rw-r--r--testautomation/global/tools/includes/optional/t_control_objects.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_docfuncs.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_extension_manager_tools.inc2
-rw-r--r--testautomation/global/tools/includes/optional/t_filetools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_key_tools.inc2
-rw-r--r--testautomation/global/tools/includes/optional/t_listfuncs.inc2
-rw-r--r--testautomation/global/tools/includes/optional/t_macro_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_ole.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_security_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_stringtools.inc2
-rw-r--r--testautomation/global/tools/includes/optional/t_treelist_tools.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_ui_filters.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/optional/t_user_info.inc2
-rw-r--r--testautomation/global/tools/includes/required/t_filters.inc2
-rw-r--r--[-rwxr-xr-x]testautomation/global/tools/includes/required/t_tools1.inc2
-rwxr-xr-x[-rw-r--r--]testautomation/global/win/dial_d_h.win6
-rwxr-xr-x[-rw-r--r--]testautomation/global/win/edia_d_h.win2
-rwxr-xr-x[-rw-r--r--]testautomation/global/win/edia_t_z.win1
-rwxr-xr-x[-rw-r--r--]testautomation/global/win/etab_a_d.win11
-rwxr-xr-xtestautomation/graphics/optional/g_spellcheck.bas4
-rw-r--r--testautomation/graphics/optional/includes/global/g_clipboard.inc15
-rw-r--r--testautomation/graphics/optional/includes/global/g_spellcheck.inc10
-rw-r--r--testautomation/graphics/optional/includes/impress/i_slidecopy.inc5
-rw-r--r--testautomation/graphics/required/includes/global/id_001.inc162
-rw-r--r--testautomation/graphics/required/includes/global/id_004.inc2
-rw-r--r--testautomation/math/optional/includes/m_101_.inc3
-rw-r--r--testautomation/writer/optional/includes/loadsave/w_loadsave.inc45
-rw-r--r--testautomation/writer/optional/includes/number/w_207_.inc15
-rw-r--r--testautomation/writer/required/includes/w_007_.inc3
-rw-r--r--toolkit/Library_tk.mk8
-rw-r--r--toolkit/Package_inc.mk1
-rwxr-xr-xtoolkit/inc/toolkit/awt/animatedimagespeer.hxx106
-rw-r--r--toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx90
-rw-r--r--toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx82
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindows.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/xsimpleanimation.hxx27
-rw-r--r--toolkit/inc/toolkit/awt/xthrobber.hxx26
-rwxr-xr-xtoolkit/inc/toolkit/controls/animatedimages.hxx144
-rw-r--r--toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx261
-rw-r--r--toolkit/inc/toolkit/controls/dialogcontrol.hxx206
-rw-r--r--toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx1
-rw-r--r--toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx6
-rwxr-xr-xtoolkit/inc/toolkit/controls/spinningprogress.hxx70
-rw-r--r--toolkit/inc/toolkit/controls/tabpagecontainer.hxx147
-rw-r--r--toolkit/inc/toolkit/controls/tabpagemodel.hxx147
-rw-r--r--toolkit/inc/toolkit/controls/tksimpleanimation.hxx18
-rw-r--r--toolkit/inc/toolkit/controls/unocontrols.hxx1
-rw-r--r--toolkit/inc/toolkit/helper/listenermultiplexer.hxx8
-rw-r--r--toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx2
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx1
-rw-r--r--toolkit/inc/toolkit/helper/servicenames.hxx10
-rw-r--r--toolkit/inc/toolkit/helper/throbberimpl.hxx84
-rw-r--r--toolkit/inc/toolkit/helper/tkresmgr.hxx1
-rwxr-xr-xtoolkit/source/awt/animatedimagespeer.cxx538
-rw-r--r--toolkit/source/awt/vclxtabpagecontainer.cxx233
-rw-r--r--toolkit/source/awt/vclxtabpagemodel.cxx150
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx57
-rw-r--r--toolkit/source/awt/vclxwindow.cxx29
-rw-r--r--toolkit/source/awt/vclxwindows.cxx61
-rw-r--r--toolkit/source/awt/xsimpleanimation.cxx116
-rw-r--r--toolkit/source/awt/xthrobber.cxx76
-rwxr-xr-xtoolkit/source/controls/animatedimages.cxx491
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx1811
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx1739
-rwxr-xr-xtoolkit/source/controls/spinningprogress.cxx138
-rw-r--r--toolkit/source/controls/tabpagecontainer.cxx301
-rw-r--r--toolkit/source/controls/tabpagemodel.cxx404
-rw-r--r--toolkit/source/controls/tksimpleanimation.cxx55
-rw-r--r--toolkit/source/controls/unocontrolcontainer.cxx1
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx2
-rw-r--r--toolkit/source/controls/unocontrols.cxx7
-rw-r--r--toolkit/source/helper/listenermultiplexer.cxx6
-rw-r--r--toolkit/source/helper/property.cxx4
-rw-r--r--toolkit/source/helper/registerservices.cxx45
-rw-r--r--toolkit/source/helper/servicenames.cxx8
-rw-r--r--toolkit/source/helper/throbberimpl.cxx138
-rw-r--r--toolkit/source/helper/tkresmgr.cxx35
-rw-r--r--toolkit/util/tk.component21
-rw-r--r--ucb/source/ucp/webdav/ContentProperties.cxx120
-rw-r--r--ucb/source/ucp/webdav/ContentProperties.hxx38
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx8
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.hxx4
-rw-r--r--unotools/inc/unotools/pathoptions.hxx5
-rw-r--r--unotools/source/config/pathoptions.cxx101
-rw-r--r--vcl/inc/vcl/fixed.hxx4
-rw-r--r--vcl/inc/vcl/imgctrl.hxx14
-rw-r--r--vcl/inc/vcl/throbber.hxx103
-rw-r--r--vcl/prj/d.lst1
-rw-r--r--vcl/source/control/imgctrl.cxx192
-rw-r--r--vcl/source/control/makefile.mk22
-rw-r--r--vcl/source/control/throbber.cxx325
-rw-r--r--vcl/source/src/makefile.mk3
-rwxr-xr-xvcl/source/src/throbber.src114
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx2
-rw-r--r--vcl/workben/svpclient.cxx2
-rw-r--r--wizards/com/sun/star/wizards/agenda/AgendaTemplate.java3
-rw-r--r--wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java26
-rw-r--r--wizards/com/sun/star/wizards/agenda/TopicsControl.java9
-rw-r--r--wizards/com/sun/star/wizards/common/Configuration.java4
-rw-r--r--wizards/com/sun/star/wizards/common/PropertyNames.java49
-rw-r--r--wizards/com/sun/star/wizards/db/ColumnPropertySet.java9
-rw-r--r--wizards/com/sun/star/wizards/db/DBMetaData.java27
-rw-r--r--wizards/com/sun/star/wizards/db/SQLQueryComposer.java2
-rw-r--r--wizards/com/sun/star/wizards/db/TableDescriptor.java21
-rw-r--r--wizards/com/sun/star/wizards/document/Control.java6
-rw-r--r--wizards/com/sun/star/wizards/document/DatabaseControl.java9
-rw-r--r--wizards/com/sun/star/wizards/document/FormHandler.java2
-rw-r--r--wizards/com/sun/star/wizards/document/GridControl.java2
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxDocument.java2
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialog.java110
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java80
-rw-r--r--wizards/com/sun/star/wizards/form/DataEntrySetter.java25
-rw-r--r--wizards/com/sun/star/wizards/form/FieldLinker.java45
-rw-r--r--wizards/com/sun/star/wizards/form/Finalizer.java11
-rw-r--r--wizards/com/sun/star/wizards/form/FormConfiguration.java25
-rw-r--r--wizards/com/sun/star/wizards/form/FormControlArranger.java5
-rw-r--r--wizards/com/sun/star/wizards/form/FormWizard.java11
-rw-r--r--wizards/com/sun/star/wizards/form/StyleApplier.java15
-rw-r--r--wizards/com/sun/star/wizards/form/UIControlArranger.java55
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterDocument.java6
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialog.java164
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java211
-rw-r--r--wizards/com/sun/star/wizards/makefile.mk1
-rw-r--r--wizards/com/sun/star/wizards/query/Finalizer.java29
-rw-r--r--wizards/com/sun/star/wizards/query/QuerySummary.java11
-rw-r--r--wizards/com/sun/star/wizards/query/QueryWizard.java17
-rw-r--r--wizards/com/sun/star/wizards/report/DBColumn.java2
-rw-r--r--wizards/com/sun/star/wizards/report/Dataimport.java12
-rw-r--r--wizards/com/sun/star/wizards/report/GroupFieldHandler.java11
-rw-r--r--wizards/com/sun/star/wizards/report/ReportFinalizer.java30
-rw-r--r--wizards/com/sun/star/wizards/report/ReportLayouter.java34
-rw-r--r--wizards/com/sun/star/wizards/report/ReportTextImplementation.java2
-rw-r--r--wizards/com/sun/star/wizards/report/ReportWizard.java133
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java16
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java3
-rw-r--r--wizards/com/sun/star/wizards/table/CGTable.java3
-rw-r--r--wizards/com/sun/star/wizards/table/FieldDescription.java11
-rw-r--r--wizards/com/sun/star/wizards/table/FieldFormatter.java39
-rw-r--r--wizards/com/sun/star/wizards/table/Finalizer.java23
-rw-r--r--wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java65
-rw-r--r--wizards/com/sun/star/wizards/table/ScenarioSelector.java13
-rw-r--r--wizards/com/sun/star/wizards/table/TableWizard.java2
-rw-r--r--wizards/com/sun/star/wizards/text/TextFieldHandler.java9
-rw-r--r--wizards/com/sun/star/wizards/ui/AggregateComponent.java26
-rw-r--r--wizards/com/sun/star/wizards/ui/ButtonList.java74
-rw-r--r--wizards/com/sun/star/wizards/ui/CommandFieldSelection.java8
-rw-r--r--wizards/com/sun/star/wizards/ui/ControlScroller.java18
-rw-r--r--wizards/com/sun/star/wizards/ui/FieldSelection.java48
-rw-r--r--wizards/com/sun/star/wizards/ui/FilterComponent.java191
-rw-r--r--wizards/com/sun/star/wizards/ui/ImageList.java71
-rwxr-xr-xwizards/com/sun/star/wizards/ui/PathSelection.java9
-rw-r--r--wizards/com/sun/star/wizards/ui/PeerConfig.java3
-rw-r--r--wizards/com/sun/star/wizards/ui/SortingComponent.java52
-rw-r--r--wizards/com/sun/star/wizards/ui/TitlesComponent.java20
-rw-r--r--wizards/com/sun/star/wizards/ui/UnoDialog.java60
-rw-r--r--wizards/com/sun/star/wizards/ui/UnoDialog2.java5
-rw-r--r--wizards/com/sun/star/wizards/ui/WizardDialog.java55
-rw-r--r--wizards/com/sun/star/wizards/ui/event/AbstractListener.java3
-rw-r--r--wizards/com/sun/star/wizards/ui/event/DataAware.java3
-rw-r--r--wizards/com/sun/star/wizards/ui/event/DataAwareFields.java2
-rw-r--r--wizards/com/sun/star/wizards/ui/event/MethodInvocation.java1
-rw-r--r--wizards/com/sun/star/wizards/ui/event/UnoDataAware.java9
-rw-r--r--wizards/com/sun/star/wizards/web/FTPDialog.java23
-rw-r--r--wizards/com/sun/star/wizards/web/ImageListDialog.java9
-rw-r--r--wizards/com/sun/star/wizards/web/StatusDialog.java15
-rw-r--r--wizards/com/sun/star/wizards/web/WWD_Events.java5
-rw-r--r--wizards/com/sun/star/wizards/web/WWD_General.java5
-rw-r--r--wizards/com/sun/star/wizards/web/WWD_Startup.java7
-rw-r--r--wizards/com/sun/star/wizards/web/WebWizardDialog.java61
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGDocument.java3
-rw-r--r--wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java3
-rw-r--r--writerfilter/inc/dmapper/DomainMapper.hxx62
-rw-r--r--writerfilter/inc/resourcemodel/Fraction.hxx60
-rw-r--r--writerfilter/inc/resourcemodel/LoggedResources.hxx128
-rw-r--r--writerfilter/inc/resourcemodel/TagLogger.hxx8
-rw-r--r--writerfilter/inc/resourcemodel/XPathLogger.hxx65
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docxbin0 -> 10420 bytes
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docxbin0 -> 10440 bytes
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docxbin0 -> 10393 bytes
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docxbin0 -> 10622 bytes
-rw-r--r--writerfilter/source/dmapper/BorderHandler.cxx33
-rw-r--r--writerfilter/source/dmapper/BorderHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/CellColorHandler.cxx14
-rw-r--r--writerfilter/source/dmapper/CellColorHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/CellMarginHandler.cxx24
-rw-r--r--writerfilter/source/dmapper/CellMarginHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx141
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx67
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx8
-rw-r--r--writerfilter/source/dmapper/FFDataHandler.cxx44
-rw-r--r--writerfilter/source/dmapper/FFDataHandler.hxx14
-rw-r--r--writerfilter/source/dmapper/FontTable.cxx43
-rw-r--r--writerfilter/source/dmapper/FontTable.hxx57
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.cxx26
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.hxx16
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx214
-rw-r--r--writerfilter/source/dmapper/GraphicImport.hxx58
-rw-r--r--writerfilter/source/dmapper/MeasureHandler.cxx12
-rw-r--r--writerfilter/source/dmapper/MeasureHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx46
-rw-r--r--writerfilter/source/dmapper/NumberingManager.hxx46
-rw-r--r--writerfilter/source/dmapper/OLEHandler.cxx13
-rw-r--r--writerfilter/source/dmapper/OLEHandler.hxx13
-rw-r--r--writerfilter/source/dmapper/PageBordersHandler.cxx11
-rw-r--r--writerfilter/source/dmapper/PageBordersHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx508
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx46
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx5
-rw-r--r--writerfilter/source/dmapper/PropertyMapHelper.cxx2
-rw-r--r--writerfilter/source/dmapper/PropertyMapHelper.hxx2
-rw-r--r--writerfilter/source/dmapper/SectionColumnHandler.cxx15
-rw-r--r--writerfilter/source/dmapper/SectionColumnHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/SettingsTable.cxx44
-rw-r--r--[-rwxr-xr-x]writerfilter/source/dmapper/SettingsTable.hxx19
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx144
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.hxx39
-rw-r--r--writerfilter/source/dmapper/TDefTableHandler.cxx17
-rw-r--r--writerfilter/source/dmapper/TDefTableHandler.hxx13
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.cxx15
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/ThemeTable.cxx16
-rw-r--r--writerfilter/source/dmapper/ThemeTable.hxx15
-rw-r--r--writerfilter/source/dmapper/WrapPolygonHandler.cxx216
-rw-r--r--writerfilter/source/dmapper/WrapPolygonHandler.hxx91
-rw-r--r--writerfilter/source/dmapper/dmapperLoggers.hxx3
-rw-r--r--writerfilter/source/dmapper/makefile.mk8
-rw-r--r--writerfilter/source/filter/ImportFilter.cxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.cxx65
-rw-r--r--[-rwxr-xr-x]writerfilter/source/ooxml/OOXMLFactory.hxx3
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx379
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLFastHelper.hxx77
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.cxx5
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.hxx5
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx11
-rw-r--r--writerfilter/source/ooxml/analyzemodel.xsl1
-rw-r--r--writerfilter/source/ooxml/effort.xsl59
-rw-r--r--writerfilter/source/ooxml/factory_ns.xsl11
-rw-r--r--writerfilter/source/ooxml/factoryimpl.xsl24
-rw-r--r--writerfilter/source/ooxml/factoryimpl_ns.xsl230
-rw-r--r--writerfilter/source/ooxml/model.xml671
-rw-r--r--writerfilter/source/resourcemodel/Fraction.cxx150
-rw-r--r--writerfilter/source/resourcemodel/LoggedResources.cxx322
-rw-r--r--writerfilter/source/resourcemodel/TagLogger.cxx514
-rw-r--r--writerfilter/source/resourcemodel/XPathLogger.cxx90
-rw-r--r--writerfilter/source/resourcemodel/makefile.mk13
-rw-r--r--xmloff/Library_xo.mk1
-rw-r--r--xmloff/inc/SchXMLImport.hxx14
-rw-r--r--xmloff/inc/xmloff/SchXMLImportHelper.hxx4
-rw-r--r--xmloff/inc/xmloff/formlayerexport.hxx3
-rw-r--r--xmloff/inc/xmloff/formlayerimport.hxx5
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx8
-rwxr-xr-xxmloff/source/chart/SchXMLAxisContext.cxx1053
-rwxr-xr-xxmloff/source/chart/SchXMLAxisContext.hxx83
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx63
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx1007
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx42
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx1010
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.hxx61
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx4
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx28
-rw-r--r--xmloff/source/chart/makefile.mk71
-rw-r--r--xmloff/source/chart/transporttypes.hxx8
-rw-r--r--xmloff/source/core/xmltoken.cxx8
-rw-r--r--xmloff/source/draw/shapeimport.cxx6
-rw-r--r--xmloff/source/forms/formlayerexport.cxx6
-rw-r--r--xmloff/source/forms/formlayerimport.cxx6
-rw-r--r--xmloff/source/forms/layerimport.cxx11
-rw-r--r--xmloff/source/forms/layerimport.hxx8
-rw-r--r--xpdf/makefile.mk2
-rw-r--r--xpdf/xpdf-3.02-sec.patch29
-rw-r--r--xpdf/xpdf-3.02.patch29
1598 files changed, 46467 insertions, 31081 deletions
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx
index 4ab42fbe97a7..fa7954172134 100644
--- a/basctl/source/basicide/basicbox.cxx
+++ b/basctl/source/basicide/basicbox.cxx
@@ -144,9 +144,7 @@ void DocListenerBox::onDocumentSaveAsDone( const ScriptDocument& /*_rDocument*/
void DocListenerBox::onDocumentClosed( const ScriptDocument& /*_rDocument*/ )
{
- if ( SFX_APP()->IsInBasicCall() )
- // Nicht wenn Office beendet
- FillBox();
+ FillBox();
}
void DocListenerBox::onDocumentTitleChanged( const ScriptDocument& /*_rDocument*/ )
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index d0a8ca1a6ddb..77a9af87df03 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1332,7 +1332,7 @@ USHORT ModulWindow::StartSearchAndReplace( const SvxSearchItem& rSearchItem, BOO
return nFound;
}
-SfxUndoManager* __EXPORT ModulWindow::GetUndoManager()
+::svl::IUndoManager* __EXPORT ModulWindow::GetUndoManager()
{
if ( GetEditEngine() )
return &GetEditEngine()->GetUndoManager();
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 280bb6ee3ab6..925e5fab1d4b 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -443,7 +443,8 @@ public:
virtual void BasicStarted();
virtual void BasicStopped();
- virtual SfxUndoManager* GetUndoManager();
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
const ::rtl::OUString& GetModule() const { return m_aModule; }
void SetModule( const ::rtl::OUString& aModule ) { m_aModule = aModule; }
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 84291656c755..5dfc2d281f25 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -1281,7 +1281,7 @@ BOOL __EXPORT DialogWindow::IsModified()
return pEditor->IsModified();
}
-SfxUndoManager* __EXPORT DialogWindow::GetUndoManager()
+::svl::IUndoManager* __EXPORT DialogWindow::GetUndoManager()
{
return pUndoMgr;
}
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 0af7b9dda920..02dbb525b972 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -210,8 +210,6 @@ void BasicIDEShell::Init()
SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BasicIDE" ) ) );
SetHelpId( SVX_INTERFACE_BASIDE_VIEWSH );
- SFX_APP()->EnterBasicCall();
-
LibBoxControl::RegisterControl( SID_BASICIDE_LIBSELECTOR );
LanguageBoxControl::RegisterControl( SID_BASICIDE_CURRENT_LANG );
@@ -289,7 +287,6 @@ __EXPORT BasicIDEShell::~BasicIDEShell()
// ObjSh loslaesst. Es wusste auch keiner mehr wozu das gut war.
// GetViewFrame()->GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
- SFX_APP()->LeaveBasicCall();
IDE_DLL()->GetExtraData()->ShellInCriticalSection() = FALSE;
GnBasicIDEShellCount--;
@@ -554,9 +551,9 @@ void BasicIDEShell::ArrangeTabBar()
-SfxUndoManager* BasicIDEShell::GetUndoManager()
+::svl::IUndoManager* BasicIDEShell::GetUndoManager()
{
- SfxUndoManager* pMgr = NULL;
+ ::svl::IUndoManager* pMgr = NULL;
if( pCurWin )
pMgr = pCurWin->GetUndoManager();
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 9604a8bd9933..88c5b6fd63ec 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -30,23 +30,29 @@
#include <ide_pch.hxx>
-#include <vector>
-#include <algorithm>
-#include <basic/sbx.hxx>
-#include <unotools/moduleoptions.hxx>
+#include "basobj.hxx"
+#include "iderdll.hxx"
+#include "iderdll2.hxx"
+#include "iderid.hxx"
+#include "macrodlg.hxx"
+#include "moduldlg.hxx"
+#include "basidesh.hxx"
+#include "basidesh.hrc"
+#include "baside2.hxx"
+#include "basicmod.hxx"
+#include "basdoc.hxx"
+
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/document/XScriptInvocationContext.hpp>
-#include <basobj.hxx>
-#include <iderdll.hxx>
-#include <iderdll2.hxx>
-#include <iderid.hxx>
-#include <macrodlg.hxx>
-#include <moduldlg.hxx>
-#include <basidesh.hxx>
-#include <basidesh.hrc>
-#include <baside2.hxx>
-#include <basicmod.hxx>
-#include <basdoc.hxx>
+
+#include <basic/sbx.hxx>
+#include <framework/documentundoguard.hxx>
+#include <tools/diagnose_ex.h>
+#include <unotools/moduleoptions.hxx>
+
+#include <vector>
+#include <algorithm>
+#include <memory>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -216,6 +222,51 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const
return true;
}
+
+//----------------------------------------------------------------------------
+
+namespace
+{
+ struct MacroExecutionData
+ {
+ ScriptDocument aDocument;
+ SbMethodRef xMethod;
+
+ MacroExecutionData()
+ :aDocument( ScriptDocument::NoDocument )
+ ,xMethod( NULL )
+ {
+ }
+ };
+
+ class MacroExecution
+ {
+ public:
+ DECL_STATIC_LINK( MacroExecution, ExecuteMacroEvent, MacroExecutionData* );
+ };
+
+
+ IMPL_STATIC_LINK( MacroExecution, ExecuteMacroEvent, MacroExecutionData*, i_pData )
+ {
+ (void)pThis;
+ ENSURE_OR_RETURN( i_pData, "wrong MacroExecutionData", 0L );
+ // take ownership of the data
+ ::std::auto_ptr< MacroExecutionData > pData( i_pData );
+
+ DBG_ASSERT( pData->xMethod->GetParent()->GetFlags() & SBX_EXTSEARCH, "Kein EXTSEARCH!" );
+
+ // in case this is a document-local macro, try to protect the document's Undo Manager from
+ // flawed scripts
+ ::std::auto_ptr< ::framework::DocumentUndoGuard > pUndoGuard;
+ if ( pData->aDocument.isDocument() )
+ pUndoGuard.reset( new ::framework::DocumentUndoGuard( pData->aDocument.getDocument() ) );
+
+ BasicIDE::RunMethod( pData->xMethod );
+
+ return 1L;
+ }
+}
+
//----------------------------------------------------------------------------
::rtl::OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument, BOOL bChooseOnly, const ::rtl::OUString& rMacroDesc )
@@ -225,13 +276,12 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const
BasicIDEDLL::Init();
IDE_DLL()->GetExtraData()->ChoosingMacro() = TRUE;
- SFX_APP()->EnterBasicCall();
String aScriptURL;
BOOL bError = FALSE;
SbMethod* pMethod = NULL;
- MacroChooser* pChooser = new MacroChooser( NULL, TRUE );
+ ::std::auto_ptr< MacroChooser > pChooser( new MacroChooser( NULL, TRUE ) );
if ( bChooseOnly || !SvtModuleOptions().IsBasicIDE() )
pChooser->SetMode( MACROCHOOSER_CHOOSEONLY );
@@ -251,103 +301,95 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const
if ( !pMethod && pChooser->GetMode() == MACROCHOOSER_RECORDING )
pMethod = pChooser->CreateMacro();
- if ( pMethod )
+ if ( !pMethod )
+ break;
+
+ SbModule* pModule = pMethod->GetModule();
+ ENSURE_OR_BREAK( pModule, "BasicIDE::ChooseMacro: No Module found!" );
+
+ StarBASIC* pBasic = (StarBASIC*)pModule->GetParent();
+ ENSURE_OR_BREAK( pBasic, "BasicIDE::ChooseMacro: No Basic found!" );
+
+ BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic );
+ ENSURE_OR_BREAK( pBasMgr, "BasicIDE::ChooseMacro: No BasicManager found!" );
+
+ // name
+ String aName;
+ aName += pBasic->GetName();
+ aName += '.';
+ aName += pModule->GetName();
+ aName += '.';
+ aName += pMethod->GetName();
+
+ // language
+ String aLanguage = String::CreateFromAscii("Basic");
+
+ // location
+ String aLocation;
+ ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
+ if ( aDocument.isDocument() )
{
- SbModule* pModule = pMethod->GetModule();
- DBG_ASSERT(pModule, "BasicIDE::ChooseMacro: No Module found!");
- if ( pModule )
- {
- StarBASIC* pBasic = (StarBASIC*)pModule->GetParent();
- DBG_ASSERT(pBasic, "BasicIDE::ChooseMacro: No Basic found!");
- if ( pBasic )
- {
- BasicManager* pBasMgr = BasicIDE::FindBasicManager( pBasic );
- DBG_ASSERT(pBasMgr, "BasicIDE::ChooseMacro: No BasicManager found!");
- if ( pBasMgr )
- {
- // name
- String aName;
- aName += pBasic->GetName();
- aName += '.';
- aName += pModule->GetName();
- aName += '.';
- aName += pMethod->GetName();
-
- // language
- String aLanguage = String::CreateFromAscii("Basic");
-
- // location
- String aLocation;
- ScriptDocument aDocument( ScriptDocument::getDocumentForBasicManager( pBasMgr ) );
- if ( aDocument.isDocument() )
- {
- // document basic
- aLocation = String::CreateFromAscii("document");
-
- if ( rxLimitToDocument.is() )
- {
- uno::Reference< frame::XModel > xLimitToDocument( rxLimitToDocument );
-
- uno::Reference< document::XEmbeddedScripts > xScripts( rxLimitToDocument, UNO_QUERY );
- if ( !xScripts.is() )
- { // the document itself does not support embedding scripts
- uno::Reference< document::XScriptInvocationContext > xContext( rxLimitToDocument, UNO_QUERY );
- if ( xContext.is() )
- xScripts = xContext->getScriptContainer();
- if ( xScripts.is() )
- { // but it is able to refer to a document which actually does support this
- xLimitToDocument.set( xScripts, UNO_QUERY );
- if ( !xLimitToDocument.is() )
- {
- OSL_ENSURE( false, "BasicIDE::ChooseMacro: a script container which is no document!?" );
- xLimitToDocument = rxLimitToDocument;
- }
- }
- }
-
- if ( xLimitToDocument != aDocument.getDocument() )
- {
- // error
- bError = TRUE;
- ErrorBox( NULL, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_ERRORCHOOSEMACRO ) ) ).Execute();
- }
- }
- }
- else
- {
- // application basic
- aLocation = String::CreateFromAscii("application");
- }
+ // document basic
+ aLocation = String::CreateFromAscii("document");
- // script URL
- if ( !bError )
+ if ( rxLimitToDocument.is() )
+ {
+ uno::Reference< frame::XModel > xLimitToDocument( rxLimitToDocument );
+
+ uno::Reference< document::XEmbeddedScripts > xScripts( rxLimitToDocument, UNO_QUERY );
+ if ( !xScripts.is() )
+ { // the document itself does not support embedding scripts
+ uno::Reference< document::XScriptInvocationContext > xContext( rxLimitToDocument, UNO_QUERY );
+ if ( xContext.is() )
+ xScripts = xContext->getScriptContainer();
+ if ( xScripts.is() )
+ { // but it is able to refer to a document which actually does support this
+ xLimitToDocument.set( xScripts, UNO_QUERY );
+ if ( !xLimitToDocument.is() )
{
- aScriptURL = String::CreateFromAscii("vnd.sun.star.script:");
- aScriptURL += aName;
- aScriptURL += String::CreateFromAscii("?language=");
- aScriptURL += aLanguage;
- aScriptURL += String::CreateFromAscii("&location=");
- aScriptURL += aLocation;
+ OSL_ENSURE( false, "BasicIDE::ChooseMacro: a script container which is no document!?" );
+ xLimitToDocument = rxLimitToDocument;
}
}
}
+
+ if ( xLimitToDocument != aDocument.getDocument() )
+ {
+ // error
+ bError = TRUE;
+ ErrorBox( NULL, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_ERRORCHOOSEMACRO ) ) ).Execute();
+ }
}
}
+ else
+ {
+ // application basic
+ aLocation = String::CreateFromAscii("application");
+ }
+
+ // script URL
+ if ( !bError )
+ {
+ aScriptURL = String::CreateFromAscii("vnd.sun.star.script:");
+ aScriptURL += aName;
+ aScriptURL += String::CreateFromAscii("?language=");
+ aScriptURL += aLanguage;
+ aScriptURL += String::CreateFromAscii("&location=");
+ aScriptURL += aLocation;
+ }
- if ( pMethod && !rxLimitToDocument.is() )
+ if ( !rxLimitToDocument.is() )
{
- pMethod->AddRef(); // festhalten, bis Event abgearbeitet.
- Application::PostUserEvent( LINK( IDE_DLL()->GetExtraData(), BasicIDEData, ExecuteMacroEvent ), pMethod );
+ MacroExecutionData* pExecData = new MacroExecutionData;
+ pExecData->aDocument = aDocument;
+ pExecData->xMethod = pMethod; // keep alive until the event has been processed
+ Application::PostUserEvent( STATIC_LINK( NULL, MacroExecution, ExecuteMacroEvent ), pExecData );
}
}
break;
}
- delete pChooser;
-
- SFX_APP()->LeaveBasicCall();
-
- return ::rtl::OUString( aScriptURL );
+ return aScriptURL;
}
//----------------------------------------------------------------------------
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 150e10a5a76f..223d82604c47 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -260,7 +260,7 @@ Window* __EXPORT IDEBaseWindow::GetLayoutWindow()
return this;
}
-SfxUndoManager* __EXPORT IDEBaseWindow::GetUndoManager()
+::svl::IUndoManager* __EXPORT IDEBaseWindow::GetUndoManager()
{
return NULL;
}
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index a15bed689b6f..25f00564c703 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -211,20 +211,3 @@ IMPL_LINK( BasicIDEData, GlobalBasicBreakHdl, StarBASIC *, pBasic )
return nRet;
}
-
-IMPL_LINK( BasicIDEData, ExecuteMacroEvent, void *, pData )
-{
- if ( pData )
- {
- SFX_APP()->EnterBasicCall();
- SbMethod* pMethod = (SbMethod*)pData;
-
- // Ist es eine StarScript-Methode? Am Parent erkennen
- DBG_ASSERT( pMethod->GetParent()->GetFlags() & SBX_EXTSEARCH, "Kein EXTSEARCH!" );
- BasicIDE::RunMethod( pMethod );
- pMethod->ReleaseRef(); // muss vorher inkrementiert worden sein!
- SFX_APP()->LeaveBasicCall();
- }
- return 0;
-}
-
diff --git a/basctl/source/basicide/iderdll2.hxx b/basctl/source/basicide/iderdll2.hxx
index 162d08ddcb5e..fd811de71b08 100644
--- a/basctl/source/basicide/iderdll2.hxx
+++ b/basctl/source/basicide/iderdll2.hxx
@@ -100,8 +100,6 @@ public:
const String& GetAddLibFilter() const { return aAddLibFilter; }
void SetAddLibFilter( const String& rFilter ) { aAddLibFilter = rFilter; }
-
- DECL_LINK( ExecuteMacroEvent, void * );
};
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index c55e5bd721d5..92bb2b22998a 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -106,7 +106,8 @@ public:
virtual BOOL IsModified();
virtual BOOL IsPasteAllowed();
- virtual SfxUndoManager* GetUndoManager();
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
// return number of pages to be printed
virtual sal_Int32 countPages( Printer* pPrinter );
// print page
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 07bc2dfa3149..f404a486eb11 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -197,7 +197,8 @@ public:
SdrView* GetCurDlgView() const;
- SfxUndoManager* GetUndoManager();
+ ::svl::IUndoManager*
+ GetUndoManager();
virtual com::sun::star::uno::Reference< com::sun::star::view::XRenderable > GetRenderable();
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index bc588fccaf14..33f2d45549ad 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -164,9 +164,13 @@ public:
#define BASWIN_INRESCHEDULE 0x08
class Printer;
-class SfxUndoManager;
class BasicEntryDescriptor;
+namespace svl
+{
+ class IUndoManager;
+}
+
class IDEBaseWindow : public Window
{
private:
@@ -228,7 +232,8 @@ public:
virtual Window* GetLayoutWindow();
- virtual SfxUndoManager* GetUndoManager();
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
virtual USHORT GetSearchOptions();
diff --git a/basctl/util/makefile.mk b/basctl/util/makefile.mk
index e690a5a20a3b..1719a7c9c078 100644
--- a/basctl/util/makefile.mk
+++ b/basctl/util/makefile.mk
@@ -54,6 +54,7 @@ SHL1STDLIBS= \
$(SVXCORELIB) \
$(SVXLIB) \
$(SFX2LIB) \
+ $(FWELIB) \
$(BASICLIB) \
$(SVTOOLLIB) \
$(TKLIB) \
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx
index 5c62c347fbdd..720a6efd2182 100644
--- a/basic/inc/basic/basmgr.hxx
+++ b/basic/inc/basic/basmgr.hxx
@@ -237,6 +237,13 @@ public:
*/
bool LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< rtl::OUString >& _out_rModuleNames );
+ /// determines whether the Basic Manager has a given macro, given by fully qualified name
+ bool HasMacro( String const& i_fullyQualifiedName ) const;
+ /// executes a given macro
+ ErrCode ExecuteMacro( String const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue );
+ /// executes a given macro
+ ErrCode ExecuteMacro( String const& i_fullyQualifiedName, String const& i_commaSeparatedArgs, SbxValue* i_retValue );
+
private:
BOOL IsReference( USHORT nLib );
diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx
index d5769f3acb31..a969d227395c 100644
--- a/basic/source/app/appedit.cxx
+++ b/basic/source/app/appedit.cxx
@@ -201,8 +201,8 @@ long AppEdit::InitMenu( Menu* pMenu )
if( pDataEdit )
{
- USHORT UndoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetUndoActionCount();
- USHORT RedoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetRedoActionCount();
+ size_t UndoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetUndoActionCount();
+ size_t RedoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetRedoActionCount();
pMenu->EnableItem( RID_EDITUNDO, UndoCount > 0 );
pMenu->EnableItem( RID_EDITREDO, RedoCount > 0 );
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 84763468e64c..a491b957fef6 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -42,6 +42,8 @@
#include <tools/diagnose_ex.h>
#include <basic/sbmod.hxx>
#include <basic/sbobjmod.hxx>
+#include <unotools/intlwrapper.hxx>
+#include <comphelper/processfactory.hxx>
#include <basic/sbuno.hxx>
#include <basic/basmgr.hxx>
@@ -1868,6 +1870,116 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequen
return false;
}
+
+namespace
+{
+ SbMethod* lcl_queryMacro( BasicManager* i_manager, String const& i_fullyQualifiedName )
+ {
+ sal_uInt16 nLast = 0;
+ String sMacro = i_fullyQualifiedName;
+ String sLibName = sMacro.GetToken( 0, '.', nLast );
+ String sModule = sMacro.GetToken( 0, '.', nLast );
+ sMacro.Erase( 0, nLast );
+
+ IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
+ const CollatorWrapper* pCollator = aIntlWrapper.getCollator();
+ sal_uInt16 nLibCount = i_manager->GetLibCount();
+ for ( sal_uInt16 nLib = 0; nLib < nLibCount; ++nLib )
+ {
+ if ( COMPARE_EQUAL == pCollator->compareString( i_manager->GetLibName( nLib ), sLibName ) )
+ {
+ StarBASIC* pLib = i_manager->GetLib( nLib );
+ if( !pLib )
+ {
+ i_manager->LoadLib( nLib );
+ pLib = i_manager->GetLib( nLib );
+ }
+
+ if( pLib )
+ {
+ sal_uInt16 nModCount = pLib->GetModules()->Count();
+ for( sal_uInt16 nMod = 0; nMod < nModCount; ++nMod )
+ {
+ SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod );
+ if ( pMod && COMPARE_EQUAL == pCollator->compareString( pMod->GetName(), sModule ) )
+ {
+ SbMethod* pMethod = (SbMethod*)pMod->Find( sMacro, SbxCLASS_METHOD );
+ if( pMethod )
+ return pMethod;
+ }
+ }
+ }
+ }
+ }
+ return 0;
+ }
+}
+
+bool BasicManager::HasMacro( String const& i_fullyQualifiedName ) const
+{
+ return ( NULL != lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) );
+}
+
+ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue )
+{
+ SbMethod* pMethod = lcl_queryMacro( this, i_fullyQualifiedName );
+ ErrCode nError = 0;
+ if ( pMethod )
+ {
+ if ( i_arguments )
+ pMethod->SetParameters( i_arguments );
+ nError = pMethod->Call( i_retValue );
+ }
+ else
+ nError = ERRCODE_BASIC_PROC_UNDEFINED;
+ return nError;
+}
+
+ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, String const& i_commaSeparatedArgs, SbxValue* i_retValue )
+{
+ SbMethod* pMethod = lcl_queryMacro( this, i_fullyQualifiedName );
+ if ( !pMethod )
+ return ERRCODE_BASIC_PROC_UNDEFINED;
+
+ // arguments must be quoted
+ String sQuotedArgs;
+ String sArgs( i_commaSeparatedArgs );
+ if ( sArgs.Len()<2 || sArgs.GetBuffer()[1] == '\"')
+ // no args or already quoted args
+ sQuotedArgs = sArgs;
+ else
+ {
+ // quote parameters
+ sArgs.Erase( 0, 1 );
+ sArgs.Erase( sArgs.Len()-1, 1 );
+
+ sQuotedArgs = '(';
+
+ sal_uInt16 nCount = sArgs.GetTokenCount(',');
+ for ( sal_uInt16 n=0; n<nCount; ++n )
+ {
+ sQuotedArgs += '\"';
+ sQuotedArgs += sArgs.GetToken( n, ',' );
+ sQuotedArgs += '\"';
+ if ( n<nCount-1 )
+ sQuotedArgs += ',';
+ }
+
+ sQuotedArgs += ')';
+ }
+
+ // add quoted arguments and do the call
+ String sCall( '[' );
+ sCall += pMethod->GetName();
+ sCall += sQuotedArgs;
+ sCall += ']';
+
+ SbxVariable* pRet = pMethod->GetParent()->Execute( sCall );
+ if ( pRet )
+ *i_retValue = *pRet;
+ return SbxBase::GetError();
+}
+
//=====================================================================
class ModuleInfo_Impl : public ModuleInfoHelper
diff --git a/canvas/source/directx/dx_canvashelper_texturefill.cxx b/canvas/source/directx/dx_canvashelper_texturefill.cxx
index 80224aa3d53c..17d5a2983f7c 100755
--- a/canvas/source/directx/dx_canvashelper_texturefill.cxx
+++ b/canvas/source/directx/dx_canvashelper_texturefill.cxx
@@ -227,6 +227,7 @@ namespace dxcanvas
Gdiplus::SolidBrush aBackgroundBrush( rColors[0] );
rGraphics->FillPath( &aBackgroundBrush, pFillPath.get() );
+ Gdiplus::Matrix aMatrix;
// scale focus according to aspect ratio: for wider-than-tall
// bounds (nAspectRatio > 1.0), the focus must have non-zero
// width. Specifically, a bound rect twice as wide as tall has
@@ -383,7 +384,6 @@ namespace dxcanvas
// one sets both, only the translational components of the
// texture is respected.
- Gdiplus::Matrix aMatrix;
tools::gdiPlusMatrixFromAffineMatrix2D( aMatrix,
texture.AffineTransform );
GraphicsPathSharedPtr pGradientPath(
diff --git a/chart2/prj/build.lst b/chart2/prj/build.lst
index 5526e2964680..ec6658d212c6 100644
--- a/chart2/prj/build.lst
+++ b/chart2/prj/build.lst
@@ -1,4 +1,4 @@
-ch chart2 : l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 LIBXSLT:libxslt NULL
+ch chart2 : offapi offuh l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 LIBXSLT:libxslt NULL
ch chart2 usr1 - all ch_mkout NULL
ch chart2\inc nmake - all ch_inc NULL
ch chart2\source\inc get - all ch_source_inc NULL
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index ebb9459e7d54..80b7cd20574b 100755
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -29,10 +29,15 @@
#include "precompiled_chart2.hxx"
#include "AxisWrapper.hxx"
#include "AxisHelper.hxx"
+#include "TitleHelper.hxx"
#include "Chart2ModelContact.hxx"
#include "ContainerHelper.hxx"
#include "macros.hxx"
#include "WrappedDirectStateProperty.hxx"
+#include "GridWrapper.hxx"
+#include "TitleWrapper.hxx"
+#include "DisposeHelper.hxx"
+
#include <comphelper/InlineContainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
@@ -82,6 +87,9 @@ enum
PROP_AXIS_AUTO_MIN,
PROP_AXIS_AUTO_STEPMAIN,
PROP_AXIS_AUTO_STEPHELP,
+ PROP_AXIS_TYPE,
+ PROP_AXIS_TIME_INCREMENT,
+ PROP_AXIS_EXPLICIT_TIME_INCREMENT,
PROP_AXIS_LOGARITHMIC,
PROP_AXIS_REVERSEDIRECTION,
PROP_AXIS_VISIBLE,
@@ -174,6 +182,27 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
+ Property( C2U( "AxisType" ),
+ PROP_AXIS_TYPE,
+ ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), //type com::sun::star::chart::ChartAxisType
+ //#i111967# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( C2U( "TimeIncrement" ),
+ PROP_AXIS_TIME_INCREMENT,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::TimeIncrement * >(0)),
+ //#i111967# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
+ Property( C2U( "ExplicitTimeIncrement" ),
+ PROP_AXIS_EXPLICIT_TIME_INCREMENT,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::TimeIncrement * >(0)),
+ beans::PropertyAttribute::READONLY |
+ beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
Property( C2U( "Logarithmic" ),
PROP_AXIS_LOGARITHMIC,
::getBooleanCppuType(),
@@ -374,6 +403,83 @@ AxisWrapper::~AxisWrapper()
{
}
+// ____ chart::XAxis ____
+Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getAxisTitle() throw (uno::RuntimeException)
+{
+ if( !m_xAxisTitle.is() )
+ {
+ TitleHelper::eTitleType eTitleType( TitleHelper::X_AXIS_TITLE );
+ switch( m_eType )
+ {
+ case X_AXIS:
+ eTitleType = TitleHelper::X_AXIS_TITLE;
+ break;
+ case Y_AXIS:
+ eTitleType = TitleHelper::Y_AXIS_TITLE;
+ break;
+ case Z_AXIS:
+ eTitleType = TitleHelper::Z_AXIS_TITLE;
+ break;
+ case SECOND_X_AXIS:
+ eTitleType = TitleHelper::SECONDARY_X_AXIS_TITLE;
+ break;
+ case SECOND_Y_AXIS:
+ eTitleType = TitleHelper::SECONDARY_Y_AXIS_TITLE;
+ break;
+ default:
+ return 0;
+ }
+ m_xAxisTitle = new TitleWrapper( eTitleType, m_spChart2ModelContact );
+ }
+ return m_xAxisTitle;
+}
+Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMajorGrid() throw (uno::RuntimeException)
+{
+ if( !m_xMajorGrid.is() )
+ {
+ GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
+ switch( m_eType )
+ {
+ case X_AXIS:
+ eGridType = GridWrapper::X_MAJOR_GRID;
+ break;
+ case Y_AXIS:
+ eGridType = GridWrapper::Y_MAJOR_GRID;
+ break;
+ case Z_AXIS:
+ eGridType = GridWrapper::Z_MAJOR_GRID;
+ break;
+ default:
+ return 0;
+ }
+ m_xMajorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
+ }
+ return m_xMajorGrid;
+}
+Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMinorGrid() throw (uno::RuntimeException)
+{
+ if( !m_xMinorGrid.is() )
+ {
+ GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
+ switch( m_eType )
+ {
+ case X_AXIS:
+ eGridType = GridWrapper::X_MINOR_GRID;
+ break;
+ case Y_AXIS:
+ eGridType = GridWrapper::Y_MINOR_GRID;
+ break;
+ case Z_AXIS:
+ eGridType = GridWrapper::Z_MINOR_GRID;
+ break;
+ default:
+ return 0;
+ }
+ m_xMinorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
+ }
+ return m_xMinorGrid;
+}
+
// ____ XShape ____
awt::Point SAL_CALL AxisWrapper::getPosition()
throw (uno::RuntimeException)
@@ -454,6 +560,10 @@ void SAL_CALL AxisWrapper::dispose()
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ DisposeHelper::DisposeAndClear( m_xAxisTitle );
+ DisposeHelper::DisposeAndClear( m_xMajorGrid );
+ DisposeHelper::DisposeAndClear( m_xMinorGrid );
+
clearWrappedPropertySet();
}
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
index 86bd52367bbe..f7a7d514e1f4 100644..100755
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
@@ -30,9 +30,10 @@
#include "WrappedPropertySet.hxx"
#include "ReferenceSizePropertyProvider.hxx"
#include "ServiceMacros.hxx"
-#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase5.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <com/sun/star/chart/XAxis.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/drawing/XShape.hpp>
@@ -45,14 +46,13 @@
namespace chart
{
-
namespace wrapper
{
-
class Chart2ModelContact;
-class AxisWrapper : public ::cppu::ImplInheritanceHelper4<
+class AxisWrapper : public ::cppu::ImplInheritanceHelper5<
WrappedPropertySet
+ , com::sun::star::chart::XAxis
, com::sun::star::drawing::XShape
, com::sun::star::lang::XComponent
, com::sun::star::lang::XServiceInfo
@@ -93,6 +93,11 @@ public:
::com::sun::star::lang::XEventListener >& aListener )
throw (::com::sun::star::uno::RuntimeException);
+ // ____ chart::XAxis ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getAxisTitle( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMajorGrid( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMinorGrid( ) throw (::com::sun::star::uno::RuntimeException);
+
// ____ XShape ____
virtual ::com::sun::star::awt::Point SAL_CALL getPosition()
throw (::com::sun::star::uno::RuntimeException);
@@ -131,6 +136,10 @@ private: //member
tAxisType m_eType;
::com::sun::star::uno::Any m_aTemporaryHelpStepValue;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xAxisTitle;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xMajorGrid;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xMinorGrid;
};
} // namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
index e20167e216c2..dafef0f2aa72 100644..100755
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
@@ -27,8 +27,7 @@
#ifndef CHART_CHART2MODELCONTACT_HXX
#define CHART_CHART2MODELCONTACT_HXX
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
+#include <chartview/ExplicitScaleValues.hxx>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
@@ -79,8 +78,8 @@ public:
sal_Bool getExplicitValuesForAxis(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XAxis > & xAxis,
- ::com::sun::star::chart2::ExplicitScaleData & rOutExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData & rOutExplicitIncrement );
+ ExplicitScaleData & rOutExplicitScale,
+ ExplicitIncrementData & rOutExplicitIncrement );
sal_Int32 getExplicitNumberFormatKeyForAxis(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis );
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 7a0907b05a28..3498b812557a 100755
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -64,9 +64,11 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
using ::osl::MutexGuard;
+using ::com::sun::star::chart2::XAnyDescriptionAccess;
using ::com::sun::star::chart::XComplexDescriptionAccess;
using ::com::sun::star::chart::XChartData;
using ::com::sun::star::chart::XChartDataArray;
+using ::com::sun::star::chart::XDateCategories;
namespace
{
@@ -132,7 +134,7 @@ struct lcl_Operator
virtual ~lcl_Operator()
{
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess ) = 0;
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) = 0;
virtual bool setsCategories( bool /*bDataInColumns*/ )
{
@@ -155,13 +157,20 @@ struct lcl_AllOperator : public lcl_Operator
return true;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( !xDataAccess.is() )
return;
+ Reference< XAnyDescriptionAccess > xNewAny( m_xDataToApply, uno::UNO_QUERY );
Reference< XComplexDescriptionAccess > xNewComplex( m_xDataToApply, uno::UNO_QUERY );
- if( xNewComplex.is() )
+ if( xNewAny.is() )
+ {
+ xDataAccess->setData( xNewAny->getData() );
+ xDataAccess->setComplexRowDescriptions( xNewAny->getComplexRowDescriptions() );
+ xDataAccess->setComplexColumnDescriptions( xNewAny->getComplexColumnDescriptions() );
+ }
+ else if( xNewComplex.is() )
{
xDataAccess->setData( xNewComplex->getData() );
xDataAccess->setComplexRowDescriptions( xNewComplex->getComplexRowDescriptions() );
@@ -192,7 +201,7 @@ struct lcl_DataOperator : public lcl_Operator
{
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
xDataAccess->setData( lcl_getNANInsteadDBL_MIN( m_rData ) );
@@ -205,96 +214,208 @@ struct lcl_DataOperator : public lcl_Operator
struct lcl_RowDescriptionsOperator : public lcl_Operator
{
- lcl_RowDescriptionsOperator( const Sequence< OUString >& rRowDescriptions )
+ lcl_RowDescriptionsOperator( const Sequence< OUString >& rRowDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rRowDescriptions( rRowDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
+ m_bDataInColumns = bDataInColumns;
return bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setRowDescriptions( m_rRowDescriptions );
+ if( m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< OUString >& m_rRowDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
};
//--------------------------------------------------------------------------
struct lcl_ComplexRowDescriptionsOperator : public lcl_Operator
{
- lcl_ComplexRowDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexRowDescriptions )
+ lcl_ComplexRowDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexRowDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rComplexRowDescriptions( rComplexRowDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
+ m_bDataInColumns = bDataInColumns;
return bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setComplexRowDescriptions( m_rComplexRowDescriptions );
+ if( m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< Sequence< OUString > >& m_rComplexRowDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
+};
+//--------------------------------------------------------------------------
+
+struct lcl_AnyRowDescriptionsOperator : public lcl_Operator
+{
+ lcl_AnyRowDescriptionsOperator( const Sequence< Sequence< uno::Any > >& rAnyRowDescriptions )
+ : lcl_Operator()
+ , m_rAnyRowDescriptions( rAnyRowDescriptions )
+ {
+ }
+
+ virtual bool setsCategories( bool bDataInColumns )
+ {
+ return bDataInColumns;
+ }
+
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
+ {
+ if( xDataAccess.is() )
+ xDataAccess->setAnyRowDescriptions( m_rAnyRowDescriptions );
+ }
+
+ const Sequence< Sequence< uno::Any > >& m_rAnyRowDescriptions;
};
//--------------------------------------------------------------------------
struct lcl_ColumnDescriptionsOperator : public lcl_Operator
{
- lcl_ColumnDescriptionsOperator( const Sequence< OUString >& rColumnDescriptions )
+ lcl_ColumnDescriptionsOperator( const Sequence< OUString >& rColumnDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rColumnDescriptions( rColumnDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
+ m_bDataInColumns = bDataInColumns;
return !bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setColumnDescriptions( m_rColumnDescriptions );
+ if( !m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< OUString >& m_rColumnDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
};
//--------------------------------------------------------------------------
struct lcl_ComplexColumnDescriptionsOperator : public lcl_Operator
{
- lcl_ComplexColumnDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexColumnDescriptions )
+ lcl_ComplexColumnDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexColumnDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rComplexColumnDescriptions( rComplexColumnDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
+ m_bDataInColumns = bDataInColumns;
return !bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setComplexColumnDescriptions( m_rComplexColumnDescriptions );
+ if( !m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< Sequence< OUString > >& m_rComplexColumnDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
+};
+
+//--------------------------------------------------------------------------
+
+struct lcl_AnyColumnDescriptionsOperator : public lcl_Operator
+{
+ lcl_AnyColumnDescriptionsOperator( const Sequence< Sequence< uno::Any > >& rAnyColumnDescriptions )
+ : lcl_Operator()
+ , m_rAnyColumnDescriptions( rAnyColumnDescriptions )
+ {
+ }
+
+ virtual bool setsCategories( bool bDataInColumns )
+ {
+ return bDataInColumns;
+ }
+
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
+ {
+ if( xDataAccess.is() )
+ xDataAccess->setAnyColumnDescriptions( m_rAnyColumnDescriptions );
+ }
+
+ const Sequence< Sequence< uno::Any > >& m_rAnyColumnDescriptions;
+};
+
+//--------------------------------------------------------------------------
+
+struct lcl_DateCategoriesOperator : public lcl_Operator
+{
+ lcl_DateCategoriesOperator( const Sequence< double >& rDates )
+ : lcl_Operator()
+ , m_rDates( rDates )
+ {
+ }
+
+ virtual bool setsCategories( bool /*bDataInColumns*/ )
+ {
+ return true;
+ }
+
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
+ {
+ Reference< XDateCategories > xDateCategories( xDataAccess, uno::UNO_QUERY );
+ if( xDateCategories.is() )
+ xDateCategories->setDateCategories( m_rDates );
+ }
+
+ const Sequence< double >& m_rDates;
};
//--------------------------------------------------------------------------
@@ -353,6 +474,7 @@ Sequence< OUString > SAL_CALL ChartDataWrapper::getColumnDescriptions()
return m_xDataAccess->getColumnDescriptions();
return Sequence< OUString > ();
}
+
// ____ XComplexDescriptionAccess (read) ____
Sequence< Sequence< OUString > > SAL_CALL ChartDataWrapper::getComplexRowDescriptions() throw (uno::RuntimeException)
{
@@ -369,6 +491,32 @@ Sequence< Sequence< OUString > > SAL_CALL ChartDataWrapper::getComplexColumnDesc
return Sequence< Sequence< OUString > >();
}
+// ____ XAnyDescriptionAccess (read) ____
+Sequence< Sequence< uno::Any > > SAL_CALL ChartDataWrapper::getAnyRowDescriptions() throw (uno::RuntimeException)
+{
+ initDataAccess();
+ if( m_xDataAccess.is() )
+ return m_xDataAccess->getAnyRowDescriptions();
+ return Sequence< Sequence< uno::Any > >();
+}
+Sequence< Sequence< uno::Any > > SAL_CALL ChartDataWrapper::getAnyColumnDescriptions() throw (uno::RuntimeException)
+{
+ initDataAccess();
+ if( m_xDataAccess.is() )
+ return m_xDataAccess->getAnyColumnDescriptions();
+ return Sequence< Sequence< uno::Any > >();
+}
+
+// ____ XDateCategories (read) ____
+Sequence< double > SAL_CALL ChartDataWrapper::getDateCategories() throw (uno::RuntimeException)
+{
+ initDataAccess();
+ Reference< XDateCategories > xDateCategories( m_xDataAccess, uno::UNO_QUERY );
+ if( xDateCategories.is() )
+ return xDateCategories->getDateCategories();
+ return Sequence< double >();
+}
+
// ____ XChartDataArray (write)____
void SAL_CALL ChartDataWrapper::setData( const Sequence< Sequence< double > >& rData )
throw (uno::RuntimeException)
@@ -379,28 +527,50 @@ void SAL_CALL ChartDataWrapper::setData( const Sequence< Sequence< double > >& r
void SAL_CALL ChartDataWrapper::setRowDescriptions( const Sequence< OUString >& rRowDescriptions )
throw (uno::RuntimeException)
{
- lcl_RowDescriptionsOperator aOperator( rRowDescriptions );
+ lcl_RowDescriptionsOperator aOperator( rRowDescriptions, m_spChart2ModelContact->getChart2Document() );
applyData( aOperator );
}
void SAL_CALL ChartDataWrapper::setColumnDescriptions( const Sequence< OUString >& rColumnDescriptions )
throw (uno::RuntimeException)
{
- lcl_ColumnDescriptionsOperator aOperator( rColumnDescriptions );
+ lcl_ColumnDescriptionsOperator aOperator( rColumnDescriptions, m_spChart2ModelContact->getChart2Document() );
applyData( aOperator );
}
// ____ XComplexDescriptionAccess (write) ____
void SAL_CALL ChartDataWrapper::setComplexRowDescriptions( const Sequence< Sequence< ::rtl::OUString > >& rRowDescriptions ) throw (uno::RuntimeException)
{
- lcl_ComplexRowDescriptionsOperator aOperator( rRowDescriptions );
+ lcl_ComplexRowDescriptionsOperator aOperator( rRowDescriptions, m_spChart2ModelContact->getChart2Document() );
applyData( aOperator );
}
void SAL_CALL ChartDataWrapper::setComplexColumnDescriptions( const Sequence< Sequence< ::rtl::OUString > >& rColumnDescriptions ) throw (uno::RuntimeException)
{
- lcl_ComplexColumnDescriptionsOperator aOperator( rColumnDescriptions );
+ lcl_ComplexColumnDescriptionsOperator aOperator( rColumnDescriptions, m_spChart2ModelContact->getChart2Document() );
+ applyData( aOperator );
+}
+
+// ____ XAnyDescriptionAccess (write) ____
+void SAL_CALL ChartDataWrapper::setAnyRowDescriptions( const Sequence< Sequence< uno::Any > >& rRowDescriptions ) throw (uno::RuntimeException)
+{
+ lcl_AnyRowDescriptionsOperator aOperator( rRowDescriptions );
+ applyData( aOperator );
+}
+void SAL_CALL ChartDataWrapper::setAnyColumnDescriptions( const Sequence< Sequence< uno::Any > >& rColumnDescriptions ) throw (uno::RuntimeException)
+{
+ lcl_AnyColumnDescriptionsOperator aOperator( rColumnDescriptions );
applyData( aOperator );
}
+// ____ XDateCategories (write) ____
+void SAL_CALL ChartDataWrapper::setDateCategories( const Sequence< double >& rDates ) throw (uno::RuntimeException)
+{
+ Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
+ ControllerLockGuard aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ lcl_DateCategoriesOperator aOperator( rDates );
+ applyData( aOperator );
+ DiagramHelper::switchToDateCategories( xChartDoc );
+}
+
//--------------------------------------------------------------------------------------
// ____ XChartData (base of XChartDataArray) ____
@@ -508,11 +678,11 @@ void ChartDataWrapper::initDataAccess()
if( !xChartDoc.is() )
return;
if( xChartDoc->hasInternalDataProvider() )
- m_xDataAccess = Reference< XComplexDescriptionAccess >( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
+ m_xDataAccess = Reference< XAnyDescriptionAccess >( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
else
{
//create a separate "internal data provider" that is not connected to the model
- m_xDataAccess = Reference< XComplexDescriptionAccess >( ChartModelHelper::createInternalDataProvider(
+ m_xDataAccess = Reference< XAnyDescriptionAccess >( ChartModelHelper::createInternalDataProvider(
xChartDoc, false /*bConnectToModel*/ ), uno::UNO_QUERY_THROW );
}
}
@@ -569,30 +739,9 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
return;
uno::Reference< chart2::data::XDataSource > xSource( xDataProvider->createDataSource( aArguments ) );
- // determine a template
- uno::Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
- uno::Reference< chart2::XDiagram > xDia( xChartDoc->getFirstDiagram());
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDia, xFact );
- ::rtl::OUString aServiceName( aTemplateAndService.second );
- uno::Reference< chart2::XChartTypeTemplate > xTemplate = aTemplateAndService.first;
-
- // (fall-back)
- if( ! xTemplate.is())
- {
- if( aServiceName.getLength() == 0 )
- aServiceName = C2U("com.sun.star.chart2.template.Column");
- xTemplate.set( xFact->createInstance( aServiceName ), uno::UNO_QUERY );
- }
- OSL_ASSERT( xTemplate.is());
-
- if( xTemplate.is() && xSource.is())
- {
- // argument detection works with internal knowledge of the
- // ArrayDataProvider
- OSL_ASSERT( xDia.is());
- xTemplate->changeDiagramData( xDia, xSource, aArguments );
- }
+ uno::Reference< chart2::XDiagram > xDia( xChartDoc->getFirstDiagram() );
+ if( xDia.is() )
+ xDia->setDiagramData( xSource, aArguments );
//correct stacking mode
if( bStacked || bPercent || bDeep )
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
index d56397953d79..16695914f892 100644..100755
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
@@ -29,9 +29,10 @@
#include "ServiceMacros.hxx"
#include "MutexContainer.hxx"
-#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
+#include <com/sun/star/chart/XDateCategories.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -48,8 +49,9 @@ class Chart2ModelContact;
struct lcl_Operator;
class ChartDataWrapper : public MutexContainer, public
- ::cppu::WeakImplHelper4<
- com::sun::star::chart::XComplexDescriptionAccess,
+ ::cppu::WeakImplHelper5<
+ com::sun::star::chart2::XAnyDescriptionAccess,
+ com::sun::star::chart::XDateCategories,
com::sun::star::lang::XServiceInfo,
com::sun::star::lang::XEventListener,
com::sun::star::lang::XComponent >
@@ -64,7 +66,25 @@ public:
APPHELPER_XSERVICEINFO_DECL()
protected:
- // ____ XComplexDescriptionAccess ____
+ // ____ XDateCategories ____
+ virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getDateCategories() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDateCategories( const ::com::sun::star::uno::Sequence< double >& rDates ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XAnyDescriptionAccess ____
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyRowDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aRowDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyColumnDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyColumnDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aColumnDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XComplexDescriptionAccess (base of XAnyDescriptionAccess) ____
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL
getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setComplexRowDescriptions(
@@ -136,7 +156,7 @@ private: //methods
private: //member
::com::sun::star::uno::Reference<
- ::com::sun::star::chart::XComplexDescriptionAccess > m_xDataAccess;
+ ::com::sun::star::chart2::XAnyDescriptionAccess > m_xDataAccess;
::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index e8d91cd6c124..42d5667b7d82 100755
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -56,11 +56,9 @@
#include "WrappedAddInProperty.hxx"
#include "WrappedIgnoreProperty.hxx"
#include "ChartRenderer.hxx"
-#include "UndoManager.hxx"
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <comphelper/InlineContainer.hxx>
// header for function SvxShapeCollection_NewInstance
#include <svx/unoshcol.hxx>
@@ -81,8 +79,8 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart;
-using ::com::sun::star::chart::XComplexDescriptionAccess;
using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::Property;
@@ -1413,12 +1411,6 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
xResult.set( m_xChartView );
bServiceFound = true;
}
- else if ( aServiceSpecifier.equals( CHART_UNDOMANAGER_SERVICE_NAME ) )
- {
- Reference< chart2::XUndoManager > xUndoManager( new UndoManager() );
- xResult.set( xUndoManager );
- bServiceFound = true;
- }
else
{
// try to create a shape
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index c174614a0bf3..e365edb7bd46 100755
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -30,14 +30,11 @@
#include "DiagramWrapper.hxx"
#include "macros.hxx"
#include "servicenames_charttypes.hxx"
-#include "TitleWrapper.hxx"
#include "DataSeriesPointWrapper.hxx"
#include "AxisWrapper.hxx"
#include "AxisHelper.hxx"
#include "Chart2ModelContact.hxx"
#include "PositionAndSizeHelper.hxx"
-#include "TitleHelper.hxx"
-#include "GridWrapper.hxx"
#include "WallFloorWrapper.hxx"
#include "MinMaxLineWrapper.hxx"
#include "UpDownBarWrapper.hxx"
@@ -88,6 +85,7 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::Property;
+using ::com::sun::star::chart::XAxis;
using ::osl::MutexGuard;
using ::rtl::OUString;
@@ -884,193 +882,209 @@ void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxesAndAxisTitles( cons
return m_spChart2ModelContact->GetDiagramRectangleIncludingTitle();
}
-// ____ XAxisZSupplier ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle()
+// ____ XAxisSupplier ____
+Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex )
throw (uno::RuntimeException)
{
- if( !m_xZAxisTitle.is() )
+ Reference< XAxis > xAxis;
+ if(!nDimensionIndex)
+ {
+ if( !m_xXAxis.is() )
+ m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
+ xAxis = m_xXAxis;
+ }
+ else if(1==nDimensionIndex)
+ {
+ if( !m_xYAxis.is() )
+ m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
+ xAxis = m_xYAxis;
+ }
+ else if(2==nDimensionIndex)
{
- m_xZAxisTitle = new TitleWrapper( TitleHelper::Z_AXIS_TITLE, m_spChart2ModelContact );
+ if( !m_xZAxis.is() )
+ m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
+ xAxis = m_xZAxis;
}
- return m_xZAxisTitle;
+ return xAxis;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid()
+Reference< XAxis > SAL_CALL DiagramWrapper::getSecondaryAxis( sal_Int32 nDimensionIndex )
throw (uno::RuntimeException)
{
- if( ! m_xZMainGrid.is())
+ Reference< XAxis > xAxis;
+ if(!nDimensionIndex)
{
- m_xZMainGrid = new GridWrapper( GridWrapper::Z_MAIN_GRID, m_spChart2ModelContact );
+ if( !m_xSecondXAxis.is() )
+ m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
+ xAxis = m_xSecondXAxis;
}
- return m_xZMainGrid;
+ else if(1==nDimensionIndex)
+ {
+ if( !m_xSecondYAxis.is() )
+ m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
+ xAxis = m_xSecondYAxis;
+ }
+ return xAxis;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid()
+// ____ XAxisZSupplier ____
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xZHelpGrid.is() )
- {
- m_xZHelpGrid = new GridWrapper( GridWrapper::Z_SUB_GRID, m_spChart2ModelContact );
- }
- return m_xZHelpGrid;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getAxis(2) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid()
+ throw (uno::RuntimeException)
+{
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(2) );
+ if( xAxis.is() )
+ xRet = xAxis->getMajorGrid();
+ return xRet;
+}
+
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid()
+ throw (uno::RuntimeException)
+{
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(2) );
+ if( xAxis.is() )
+ xRet = xAxis->getMinorGrid();
+ return xRet;
+}
+
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis()
throw (uno::RuntimeException)
{
if( ! m_xZAxis.is())
- {
m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
- }
- return m_xZAxis;
+ return Reference< beans::XPropertySet >( m_xZAxis, uno::UNO_QUERY );
}
// ____ XTwoAxisXSupplier ____
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis()
throw (uno::RuntimeException)
{
if( ! m_xSecondXAxis.is())
- {
m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
- }
- return m_xSecondXAxis;
+ return Reference< beans::XPropertySet >( m_xSecondXAxis, uno::UNO_QUERY );
}
// ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle()
throw (uno::RuntimeException)
{
-
- if( !m_xXAxisTitle.is() )
- {
- m_xXAxisTitle = new TitleWrapper( TitleHelper::X_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xXAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getAxis(0) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis()
throw (uno::RuntimeException)
{
if( ! m_xXAxis.is())
- {
m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
- }
-
- return m_xXAxis;
+ return Reference< beans::XPropertySet >( m_xXAxis, uno::UNO_QUERY );
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid()
throw (uno::RuntimeException)
{
- if( ! m_xXMainGrid.is())
- {
- m_xXMainGrid = new GridWrapper( GridWrapper::X_MAIN_GRID, m_spChart2ModelContact );
- }
-
- return m_xXMainGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(0) );
+ if( xAxis.is() )
+ xRet = xAxis->getMajorGrid();
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid()
throw (uno::RuntimeException)
{
- if( ! m_xXHelpGrid.is())
- {
- m_xXHelpGrid = new GridWrapper( GridWrapper::X_SUB_GRID, m_spChart2ModelContact );
- }
- return m_xXHelpGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(0) );
+ if( xAxis.is() )
+ xRet = xAxis->getMinorGrid();
+ return xRet;
}
// ____ XTwoAxisYSupplier ____
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis()
throw (uno::RuntimeException)
{
if( ! m_xSecondYAxis.is())
- {
m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
- }
- return m_xSecondYAxis;
+ return Reference< beans::XPropertySet >( m_xSecondYAxis, uno::UNO_QUERY );
}
// ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xYAxisTitle.is() )
- {
- m_xYAxisTitle = new TitleWrapper( TitleHelper::Y_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xYAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getAxis(1) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis()
throw (uno::RuntimeException)
{
if( ! m_xYAxis.is())
- {
m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
- }
- return m_xYAxis;
+ return Reference< beans::XPropertySet >( m_xYAxis, uno::UNO_QUERY );
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid()
throw (uno::RuntimeException)
{
- if( ! m_xYHelpGrid.is())
- {
- m_xYHelpGrid = new GridWrapper( GridWrapper::Y_SUB_GRID, m_spChart2ModelContact );
- }
- return m_xYHelpGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(1) );
+ if( xAxis.is() )
+ xRet = xAxis->getMajorGrid();
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid()
throw (uno::RuntimeException)
{
- if( ! m_xYMainGrid.is())
- {
- m_xYMainGrid = new GridWrapper( GridWrapper::Y_MAIN_GRID, m_spChart2ModelContact );
- }
- return m_xYMainGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(1) );
+ if( xAxis.is() )
+ xRet = xAxis->getMinorGrid();
+ return xRet;
}
// ____ XSecondAxisTitleSupplier ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xSecondXAxisTitle.is() )
- {
- m_xSecondXAxisTitle = new TitleWrapper( TitleHelper::SECONDARY_X_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xSecondXAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getSecondaryAxis(0) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xSecondYAxisTitle.is() )
- {
- m_xSecondYAxisTitle = new TitleWrapper( TitleHelper::SECONDARY_Y_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xSecondYAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getSecondaryAxis(1) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
// ____ XStatisticDisplay ____
@@ -1163,22 +1177,11 @@ void SAL_CALL DiagramWrapper::dispose()
// /--
MutexGuard aGuard( GetMutex());
- DisposeHelper::DisposeAndClear( m_xXAxisTitle );
- DisposeHelper::DisposeAndClear( m_xYAxisTitle );
- DisposeHelper::DisposeAndClear( m_xZAxisTitle );
- DisposeHelper::DisposeAndClear( m_xSecondXAxisTitle );
- DisposeHelper::DisposeAndClear( m_xSecondYAxisTitle );
DisposeHelper::DisposeAndClear( m_xXAxis );
DisposeHelper::DisposeAndClear( m_xYAxis );
DisposeHelper::DisposeAndClear( m_xZAxis );
DisposeHelper::DisposeAndClear( m_xSecondXAxis );
DisposeHelper::DisposeAndClear( m_xSecondYAxis );
- DisposeHelper::DisposeAndClear( m_xXMainGrid );
- DisposeHelper::DisposeAndClear( m_xYMainGrid );
- DisposeHelper::DisposeAndClear( m_xZMainGrid );
- DisposeHelper::DisposeAndClear( m_xXHelpGrid );
- DisposeHelper::DisposeAndClear( m_xYHelpGrid );
- DisposeHelper::DisposeAndClear( m_xZHelpGrid );
DisposeHelper::DisposeAndClear( m_xWall );
DisposeHelper::DisposeAndClear( m_xFloor );
DisposeHelper::DisposeAndClear( m_xMinMaxLineWrapper );
@@ -2147,3 +2150,4 @@ APPHELPER_XSERVICEINFO_IMPL( DiagramWrapper, lcl_aServiceName );
} // namespace wrapper
} // namespace chart
+
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
index 111e24bd6a8b..678041420cf3 100644..100755
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
@@ -30,7 +30,13 @@
#include "WrappedPropertySet.hxx"
#include "ServiceMacros.hxx"
#include "DiagramHelper.hxx"
-#include <cppuhelper/implbase12.hxx>
+
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13
+#include "comphelper/implbase_var.hxx"
+#endif
+
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -41,6 +47,7 @@
#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <com/sun/star/chart2/XChartTypeManager.hpp>
#include <com/sun/star/chart/XDiagram.hpp>
+#include <com/sun/star/chart/XAxisSupplier.hpp>
#include <com/sun/star/chart/XAxisZSupplier.hpp>
#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
@@ -56,15 +63,15 @@
namespace chart
{
-
namespace wrapper
{
class Chart2ModelContact;
-class DiagramWrapper : public ::cppu::ImplInheritanceHelper12<
+class DiagramWrapper : public ::comphelper::ImplInheritanceHelper13<
WrappedPropertySet
, ::com::sun::star::chart::XDiagram
+ , ::com::sun::star::chart::XAxisSupplier
, ::com::sun::star::chart::XAxisZSupplier
, ::com::sun::star::chart::XTwoAxisXSupplier // : XAxisXSupplier
, ::com::sun::star::chart::XTwoAxisYSupplier // : XAxisYSupplier
@@ -123,6 +130,14 @@ public:
virtual ::rtl::OUString SAL_CALL getShapeType()
throw (::com::sun::star::uno::RuntimeException);
+ // ____ XAxisSupplier ____
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart::XAxis > SAL_CALL getAxis( sal_Int32 nDimensionIndex )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart::XAxis > SAL_CALL getSecondaryAxis( sal_Int32 nDimensionIndex )
+ throw (::com::sun::star::uno::RuntimeException);
+
// ____ XAxisZSupplier ____
virtual ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape > SAL_CALL getZAxisTitle()
@@ -244,72 +259,27 @@ private:
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xXAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xYAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xZAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xSecondXAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xSecondYAxisTitle;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xXAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xYAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xZAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xSecondXAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xSecondYAxis;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xXMainGrid;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xYMainGrid;
+ ::com::sun::star::chart::XAxis > m_xXAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xZMainGrid;
+ ::com::sun::star::chart::XAxis > m_xYAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xXHelpGrid;
+ ::com::sun::star::chart::XAxis > m_xZAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xYHelpGrid;
+ ::com::sun::star::chart::XAxis > m_xSecondXAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xZHelpGrid;
+ ::com::sun::star::chart::XAxis > m_xSecondYAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xWall;
+ ::com::sun::star::beans::XPropertySet > m_xWall;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xFloor;
+ ::com::sun::star::beans::XPropertySet > m_xFloor;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xMinMaxLineWrapper;
+ ::com::sun::star::beans::XPropertySet > m_xMinMaxLineWrapper;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xUpBarWrapper;
+ ::com::sun::star::beans::XPropertySet > m_xUpBarWrapper;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xDownBarWrapper;
+ ::com::sun::star::beans::XPropertySet > m_xDownBarWrapper;
};
} // namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
index 6586511424db..51c269d7dd40 100755
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
@@ -112,17 +112,17 @@ void GridWrapper::getDimensionAndSubGridBool( tGridType eType, sal_Int32& rnDime
switch( eType )
{
- case X_MAIN_GRID:
+ case X_MAJOR_GRID:
rnDimensionIndex = 0; rbSubGrid = false; break;
- case Y_MAIN_GRID:
+ case Y_MAJOR_GRID:
rnDimensionIndex = 1; rbSubGrid = false; break;
- case Z_MAIN_GRID:
+ case Z_MAJOR_GRID:
rnDimensionIndex = 2; rbSubGrid = false; break;
- case X_SUB_GRID:
+ case X_MINOR_GRID:
rnDimensionIndex = 0; rbSubGrid = true; break;
- case Y_SUB_GRID:
+ case Y_MINOR_GRID:
rnDimensionIndex = 1; rbSubGrid = true; break;
- case Z_SUB_GRID:
+ case Z_MINOR_GRID:
rnDimensionIndex = 2; rbSubGrid = true; break;
}
}
@@ -209,3 +209,4 @@ APPHELPER_XSERVICEINFO_IMPL( GridWrapper, lcl_aServiceName );
} // namespace wrapper
} // namespace chart
+
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
index c731b6c22666..653c46353676 100644..100755
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
@@ -42,7 +42,6 @@
namespace chart
{
-
namespace wrapper
{
@@ -57,12 +56,12 @@ class GridWrapper : public ::cppu::ImplInheritanceHelper2<
public:
enum tGridType
{
- X_MAIN_GRID,
- Y_MAIN_GRID,
- Z_MAIN_GRID,
- X_SUB_GRID,
- Y_SUB_GRID,
- Z_SUB_GRID
+ X_MAJOR_GRID,
+ Y_MAJOR_GRID,
+ Z_MAJOR_GRID,
+ X_MINOR_GRID,
+ Y_MINOR_GRID,
+ Z_MINOR_GRID
};
GridWrapper( tGridType eType, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
index a89ca372d9ee..64773ad062f9 100755
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
@@ -33,9 +33,8 @@
#include "CommonConverters.hxx"
#include "AxisHelper.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <com/sun/star/chart2/AxisOrientation.hpp>
+#include <com/sun/star/chart/ChartAxisType.hpp>
+#include <chartview/ExplicitScaleValues.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -43,6 +42,7 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
+using ::com::sun::star::chart::TimeIncrement;
//.............................................................................
namespace chart
@@ -91,6 +91,15 @@ WrappedScaleProperty::WrappedScaleProperty( tScaleProperty eScaleProperty
case SCALE_PROP_AUTO_STEPHELP:
m_aOuterName = C2U("AutoStepHelp");
break;
+ case SCALE_PROP_AXIS_TYPE:
+ m_aOuterName = C2U("AxisType");
+ break;
+ case SCALE_PROP_DATE_INCREMENT:
+ m_aOuterName = C2U("TimeIncrement");
+ break;
+ case SCALE_PROP_EXPLICIT_DATE_INCREMENT:
+ m_aOuterName = C2U("ExplicitTimeIncrement");
+ break;
case SCALE_PROP_LOGARITHMIC:
m_aOuterName = C2U("Logarithmic");
break;
@@ -121,6 +130,9 @@ void WrappedScaleProperty::addWrappedProperties( std::vector< WrappedProperty* >
rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_ORIGIN, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_STEPMAIN, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_STEPHELP, spChart2ModelContact ) );
+ rList.push_back( new WrappedScaleProperty( SCALE_PROP_AXIS_TYPE, spChart2ModelContact ) );
+ rList.push_back( new WrappedScaleProperty( SCALE_PROP_DATE_INCREMENT, spChart2ModelContact ) );
+ rList.push_back( new WrappedScaleProperty( SCALE_PROP_EXPLICIT_DATE_INCREMENT, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_LOGARITHMIC, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_REVERSEDIRECTION, spChart2ModelContact ) );
}
@@ -265,6 +277,43 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons
bSetScaleData = true;
break;
}
+ case SCALE_PROP_AXIS_TYPE:
+ {
+ sal_Int32 nType = 0;
+ if( (rOuterValue >>= nType) )
+ {
+ if( ::com::sun::star::chart::ChartAxisType::AUTOMATIC == nType )
+ {
+ aScaleData.AutoDateAxis = true;
+ if( aScaleData.AxisType == AxisType::DATE )
+ aScaleData.AxisType = AxisType::CATEGORY;
+ }
+ else if( ::com::sun::star::chart::ChartAxisType::CATEGORY == nType )
+ {
+ aScaleData.AutoDateAxis = false;
+ if( aScaleData.AxisType == AxisType::DATE )
+ aScaleData.AxisType = AxisType::CATEGORY;
+ }
+ else if( ::com::sun::star::chart::ChartAxisType::DATE == nType )
+ {
+ if( aScaleData.AxisType == AxisType::CATEGORY )
+ aScaleData.AxisType = AxisType::DATE;
+ }
+ bSetScaleData = true;
+ }
+ break;
+ }
+ case SCALE_PROP_DATE_INCREMENT:
+ {
+ TimeIncrement aTimeIncrement;
+ rOuterValue >>= aTimeIncrement;
+ aScaleData.TimeIncrement = aTimeIncrement;
+ bSetScaleData = true;
+ break;
+ }
+ case SCALE_PROP_EXPLICIT_DATE_INCREMENT:
+ //read only property
+ break;
case SCALE_PROP_LOGARITHMIC:
{
if( rOuterValue >>= bBool )
@@ -319,8 +368,8 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
chart2::ScaleData aScaleData( xAxis->getScaleData() );
- chart2::ExplicitScaleData aExplicitScale;
- chart2::ExplicitIncrementData aExplicitIncrement;
+ ExplicitScaleData aExplicitScale;
+ ExplicitIncrementData aExplicitIncrement;
switch( eScaleProperty )
{
@@ -400,7 +449,8 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
{
m_spChart2ModelContact->getExplicitValuesForAxis(
xAxis, aExplicitScale, aExplicitIncrement );
- if( aExplicitIncrement.SubIncrements.getLength() > 0 &&
+
+ if( !aExplicitIncrement.SubIncrements.empty() &&
aExplicitIncrement.SubIncrements[ 0 ].IntervalCount > 0 )
{
if( bLogarithmic )
@@ -439,7 +489,7 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
if( bNeedToCalculateExplicitValues )
{
m_spChart2ModelContact->getExplicitValuesForAxis( xAxis, aExplicitScale, aExplicitIncrement );
- if( aExplicitIncrement.SubIncrements.getLength() > 0 )
+ if( !aExplicitIncrement.SubIncrements.empty() )
nIntervalCount = aExplicitIncrement.SubIncrements[ 0 ].IntervalCount;
}
aRet = uno::makeAny( nIntervalCount );
@@ -485,6 +535,46 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
aRet <<= !hasDoubleValue(aScaleData.Origin);
break;
}
+ case SCALE_PROP_AXIS_TYPE:
+ {
+ sal_Int32 nType = ::com::sun::star::chart::ChartAxisType::AUTOMATIC;
+ if( aScaleData.AxisType == AxisType::DATE )
+ {
+ nType = ::com::sun::star::chart::ChartAxisType::DATE;
+ }
+ else if( aScaleData.AxisType == AxisType::CATEGORY )
+ {
+ if( !aScaleData.AutoDateAxis )
+ nType = ::com::sun::star::chart::ChartAxisType::CATEGORY;
+ }
+ aRet = uno::makeAny( nType );
+ break;
+ }
+ case SCALE_PROP_DATE_INCREMENT:
+ {
+ if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis )
+ aRet = uno::makeAny( aScaleData.TimeIncrement );
+ break;
+ }
+ case SCALE_PROP_EXPLICIT_DATE_INCREMENT:
+ {
+ if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis )
+ {
+ m_spChart2ModelContact->getExplicitValuesForAxis( xAxis, aExplicitScale, aExplicitIncrement );
+ if( aExplicitScale.AxisType == AxisType::DATE )
+ {
+ TimeIncrement aTimeIncrement;
+ aTimeIncrement.MajorTimeInterval = uno::makeAny( aExplicitIncrement.MajorTimeInterval );
+ aTimeIncrement.MinorTimeInterval = uno::makeAny( aExplicitIncrement.MinorTimeInterval );
+ aTimeIncrement.TimeResolution = uno::makeAny( aExplicitScale.TimeResolution );
+ aRet = uno::makeAny(aTimeIncrement);
+ }
+ }
+
+ if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis )
+ aRet = uno::makeAny( aScaleData.TimeIncrement );
+ break;
+ }
case SCALE_PROP_LOGARITHMIC:
{
aRet <<= static_cast< sal_Bool >( AxisHelper::isLogarithmic(aScaleData.Scaling) );
@@ -506,5 +596,5 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
}
} // namespace wrapper
-} //namespace chart
+} // namespace chart
//.............................................................................
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
index 4d29bc009777..8df55339a46e 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
@@ -55,6 +55,9 @@ public:
, SCALE_PROP_AUTO_ORIGIN
, SCALE_PROP_AUTO_STEPMAIN
, SCALE_PROP_AUTO_STEPHELP
+ , SCALE_PROP_AXIS_TYPE
+ , SCALE_PROP_DATE_INCREMENT
+ , SCALE_PROP_EXPLICIT_DATE_INCREMENT
, SCALE_PROP_LOGARITHMIC
, SCALE_PROP_REVERSEDIRECTION
};
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index fedcfaffebc4..c4c2ba8bdcd8 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -47,7 +47,7 @@
#include "ChartModelHelper.hxx"
#include "CommonConverters.hxx"
#include "macros.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "servicenames_charttypes.hxx"
#include "ResId.hxx"
#include "Bitmaps.hrc"
@@ -64,6 +64,7 @@
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/util/XNumberFormats.hpp>
#include <algorithm>
#include <functional>
@@ -696,6 +697,23 @@ String DataBrowser::GetCellText( long nRow, USHORT nColumnId ) const
GetNumberFormatKey( nRow, nColumnId ),
fData, nLabelColor, bColorChanged ));
}
+ else if( m_apDataBrowserModel->getCellType( nColIndex, nRow ) == DataBrowserModel::TEXTORDATE )
+ {
+ uno::Any aAny = m_apDataBrowserModel->getCellAny( nColIndex, nRow );
+ OUString aText;
+ double fDouble=0.0;
+ if( aAny>>=aText )
+ aResult = aText;
+ else if( aAny>>=fDouble )
+ {
+ sal_Int32 nLabelColor;
+ bool bColorChanged = false;
+ sal_Int32 nDateNumberFormat = DiagramHelper::getDateNumberFormat( Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY) );
+ if( ! ::rtl::math::isNan( fDouble ) && m_spNumberFormatterWrapper.get() )
+ aResult = String( m_spNumberFormatterWrapper->getFormattedString(
+ nDateNumberFormat, fDouble, nLabelColor, bColorChanged ));
+ }
+ }
else
{
OSL_ASSERT( m_apDataBrowserModel->getCellType( nColIndex, nRow ) == DataBrowserModel::TEXT );
@@ -854,6 +872,9 @@ void DataBrowser::SetDataFromModel(
new NumberFormatterWrapper(
Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY )));
+ if( m_spNumberFormatterWrapper.get() )
+ m_aNumberEditField.SetFormatter( m_spNumberFormatterWrapper->getSvNumberFormatter() );
+
RenewTable();
const sal_Int32 nColCnt = m_apDataBrowserModel->getColumnCount();
@@ -1134,6 +1155,22 @@ sal_uInt32 DataBrowser::GetNumberFormatKey( sal_Int32 nRow, sal_uInt16 nCol ) co
return m_apDataBrowserModel->getNumberFormatKey( lcl_getColumnInData( nCol ), lcl_getRowInData( nRow ));
}
+bool DataBrowser::isDateString( rtl::OUString aInputString, double& fOutDateValue )
+{
+ sal_uInt32 nNumberFormat=0;
+ SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : 0;
+ if( aInputString.getLength() > 0 && pSvNumberFormatter && pSvNumberFormatter->IsNumberFormat( aInputString, nNumberFormat, fOutDateValue ) )
+ {
+ Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( m_xChartDoc, uno::UNO_QUERY );
+ Reference< util::XNumberFormats > xNumberFormats;
+ if( xNumberFormatsSupplier.is() )
+ xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+ if( DiagramHelper::isDateNumberFormat( nNumberFormat, xNumberFormats ) )
+ return true;
+ }
+ return false;
+}
+
sal_Bool DataBrowser::SaveModified()
{
if( ! IsModified() )
@@ -1146,6 +1183,7 @@ sal_Bool DataBrowser::SaveModified()
DBG_ASSERT( nRow >= 0 || nCol >= 0, "This cell should not be modified!" );
+ SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : 0;
switch( m_apDataBrowserModel->getCellType( nCol, nRow ))
{
case DataBrowserModel::NUMBER:
@@ -1155,11 +1193,8 @@ sal_Bool DataBrowser::SaveModified()
String aText( m_aNumberEditField.GetText());
// an empty string is valid, if no numberformatter exists, all
// values are treated as valid
- if( aText.Len() > 0 &&
- m_spNumberFormatterWrapper.get() &&
- m_spNumberFormatterWrapper->getSvNumberFormatter() &&
- ! m_spNumberFormatterWrapper->getSvNumberFormatter()->IsNumberFormat(
- aText, nDummy, fDummy ))
+ if( aText.Len() > 0 && pSvNumberFormatter &&
+ ! pSvNumberFormatter->IsNumberFormat( aText, nDummy, fDummy ) )
{
bChangeValid = sal_False;
}
@@ -1170,6 +1205,17 @@ sal_Bool DataBrowser::SaveModified()
}
}
break;
+ case DataBrowserModel::TEXTORDATE:
+ {
+ OUString aText( m_aTextEditField.GetText() );
+ double fDateValue=0.0;
+ bChangeValid = sal_False;
+ if( isDateString( aText, fDateValue ) )
+ bChangeValid = m_apDataBrowserModel->setCellAny( nCol, nRow, uno::makeAny( fDateValue ) );
+ if(!bChangeValid)
+ bChangeValid = m_apDataBrowserModel->setCellAny( nCol, nRow, uno::makeAny( aText ) );
+ }
+ break;
case DataBrowserModel::TEXT:
{
OUString aText( m_aTextEditField.GetText());
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index 3583db2770c0..b5cd2a731f7b 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -93,6 +93,8 @@ public:
*/
double GetCellNumber( long nRow, USHORT nColumnId ) const;
+ bool isDateString( rtl::OUString aInputString, double& fOutDateValue );
+
// Window
virtual void Resize();
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index c0b865536686..23fda0f472af 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -43,6 +43,7 @@
#include "ExplicitCategoriesProvider.hxx"
#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -589,7 +590,7 @@ Reference< chart2::XDataSeries >
return 0;
}
-DataBrowserModel::eCellType DataBrowserModel::getCellType( sal_Int32 nAtColumn, sal_Int32 /* nAtRow */ )
+DataBrowserModel::eCellType DataBrowserModel::getCellType( sal_Int32 nAtColumn, sal_Int32 /* nAtRow */ ) const
{
eCellType eResult = TEXT;
tDataColumnVector::size_type nIndex( nAtColumn );
@@ -619,6 +620,26 @@ double DataBrowserModel::getCellNumber( sal_Int32 nAtColumn, sal_Int32 nAtRow )
return fResult;
}
+uno::Any DataBrowserModel::getCellAny( sal_Int32 nAtColumn, sal_Int32 nAtRow )
+{
+ uno::Any aResult;
+
+ tDataColumnVector::size_type nIndex( nAtColumn );
+ if( nIndex < m_aColumns.size() &&
+ m_aColumns[ nIndex ].m_xLabeledDataSequence.is())
+ {
+ Reference< chart2::data::XDataSequence > xData(
+ m_aColumns[ nIndex ].m_xLabeledDataSequence->getValues() );
+ if( xData.is() )
+ {
+ Sequence< uno::Any > aValues( xData->getData());
+ if( nAtRow < aValues.getLength())
+ aResult = aValues[nAtRow];
+ }
+ }
+ return aResult;
+}
+
OUString DataBrowserModel::getCellText( sal_Int32 nAtColumn, sal_Int32 nAtRow )
{
OUString aResult;
@@ -800,7 +821,7 @@ void DataBrowserModel::updateFromModel()
aCategories.m_aUIRoleName = DialogModel::GetRoleDataLabel();
else
aCategories.m_aUIRoleName = lcl_getUIRoleName( xCategories );
- aCategories.m_eCellType = TEXT;
+ aCategories.m_eCellType = TEXTORDATE;
m_aColumns.push_back( aCategories );
++nHeaderStart;
}
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.hxx b/chart2/source/controller/dialogs/DataBrowserModel.hxx
index a4378972f70f..bde29f1771e4 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.hxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.hxx
@@ -81,13 +81,15 @@ public:
enum eCellType
{
NUMBER,
- TEXT
+ TEXT,
+ TEXTORDATE
};
- eCellType getCellType( sal_Int32 nAtColumn, sal_Int32 nAtRow );
+ eCellType getCellType( sal_Int32 nAtColumn, sal_Int32 nAtRow ) const;
/// If getCellType( nAtColumn, nAtRow ) returns TEXT, the result will be Nan
double getCellNumber( sal_Int32 nAtColumn, sal_Int32 nAtRow );
::rtl::OUString getCellText( sal_Int32 nAtColumn, sal_Int32 nAtRow );
+ ::com::sun::star::uno::Any getCellAny( sal_Int32 nAtColumn, sal_Int32 nAtRow );
sal_uInt32 getNumberFormatKey( sal_Int32 nAtColumn, sal_Int32 nAtRow );
/// returns </TRUE> if the number could successfully be set at the given position
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index eedd2e3c6ba9..6e145dc1dfbf 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -160,7 +160,7 @@ void lcl_createRoleIndexMap( lcl_tRoleIndexMap & rOutMap )
struct lcl_DataSeriesContainerAppend : public
::std::iterator< ::std::output_iterator_tag, Reference< XDataSeriesContainer > >
{
- typedef ::std::vector< chart::DialogModel::tSeriesWithChartTypeByName > tContainerType;
+ typedef ::std::vector< ::chart::DialogModel::tSeriesWithChartTypeByName > tContainerType;
explicit lcl_DataSeriesContainerAppend( tContainerType & rCnt )
: m_rDestCnt( rCnt )
@@ -180,7 +180,7 @@ struct lcl_DataSeriesContainerAppend : public
for( sal_Int32 nI = 0; nI < aSeq.getLength(); ++ nI )
{
m_rDestCnt.push_back(
- chart::DialogModel::tSeriesWithChartTypeByName(
+ ::chart::DialogModel::tSeriesWithChartTypeByName(
::chart::DataSeriesHelper::getDataSeriesLabel( aSeq[nI], aRole ),
::std::make_pair( aSeq[nI], xCT )));
}
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 9057b850332f..483424d04497 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -40,7 +40,7 @@
#include "AxisIndexDefines.hxx"
#include "ExplicitCategoriesProvider.hxx"
#include "CommonConverters.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "RegressionCurveHelper.hxx"
#include <rtl/math.hxx>
#include <tools/debug.hxx>
@@ -191,14 +191,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
if( aX.getLength() == 0 )
{
- rtl::OUString aCategory = ::rtl::OUString( String(SchResId(STR_TIP_CATEGORY_VALUE)));
-
- replaceParamterInString( aCategory
- , C2U("%CATEGORYVALUE")
- , ExplicitCategoriesProvider::getCategoryByIndex( xCooSys, xChartModel, nPointIndex )
- );
-
- aRet = aCategory;
+ aRet = ExplicitCategoriesProvider::getCategoryByIndex( xCooSys, xChartModel, nPointIndex );
}
else
{
diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src
index 4b4cec65426e..1c0a066df046 100644
--- a/chart2/source/controller/dialogs/Strings.src
+++ b/chart2/source/controller/dialogs/Strings.src
@@ -388,11 +388,6 @@ String STR_TIP_DATAPOINT_VALUES
Text [ en-US ] = "Values: %POINTVALUES";
};
-String STR_TIP_CATEGORY_VALUE
-{
- Text [ en-US ] = "'%CATEGORYVALUE'";
-};
-
String STR_TIP_DATAPOINT
{
Text [ en-US ] = "Data Point %POINTNUMBER, data series %SERIESNUMBER, values: %POINTVALUES";
@@ -463,6 +458,10 @@ String STR_ACTION_NOTPOSSIBLE
{
Text [ en-US ] = "This function cannot be completed with the selected objects." ;
};
+String STR_ACTION_EDIT_TEXT
+{
+ Text [ en-US ] = "Edit text";
+};
String STR_COLUMN_LABEL
{
diff --git a/chart2/source/controller/dialogs/Strings_Scale.src b/chart2/source/controller/dialogs/Strings_Scale.src
index e7a3d6c2b1cf..6f8b75d9509c 100644
--- a/chart2/source/controller/dialogs/Strings_Scale.src
+++ b/chart2/source/controller/dialogs/Strings_Scale.src
@@ -42,3 +42,11 @@ String STR_MIN_GREATER_MAX
{
Text [ en-US ] = "The minimum must be lower than the maximum. Check your input." ;
};
+String STR_INVALID_INTERVALS
+{
+ Text [ en-US ] = "The major interval needs to be greater than the minor interval. Check your input." ;
+};
+String STR_INVALID_TIME_UNIT
+{
+ Text [ en-US ] = "The major and minor interval need to be greater or equal to the resolution. Check your input." ;
+};
diff --git a/chart2/source/controller/dialogs/TabPages.hrc b/chart2/source/controller/dialogs/TabPages.hrc
index 1f445083738f..dbc166e4f2cd 100644
--- a/chart2/source/controller/dialogs/TabPages.hrc
+++ b/chart2/source/controller/dialogs/TabPages.hrc
@@ -111,31 +111,6 @@
#define FT_AXIS_TEXTDIR 19
#define LB_AXIS_TEXTDIR 20
-//#define TP_SCALE 903
-
-#define FL_SCALE 1
-
-#define TXT_MIN 1
-#define TXT_MAX 2
-#define TXT_STEP_MAIN 3
-#define TXT_STEP_HELP 4
-#define TXT_ORIGIN 5
-
-#define CBX_AUTO_MIN 1
-#define CBX_AUTO_MAX 2
-#define CBX_AUTO_STEP_MAIN 3
-#define CBX_AUTO_STEP_HELP 4
-#define CBX_AUTO_ORIGIN 5
-#define CBX_LOGARITHM 6
-#define CBX_REVERSE 7
-
-#define EDT_STEP_MAIN 1
-#define EDT_MAX 2
-#define EDT_MIN 3
-#define EDT_ORIGIN 4
-
-#define MT_STEPHELP 10
-
//#define TP_AXIS_POSITIONS 904
#define FL_AXIS_LINE 1
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
index 50aa10ec6e6b..9c0d8f1e1b10 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
@@ -118,7 +118,7 @@ double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals(
pExplicitValueProvider->getExplicitValuesForAxis( xAxis,aExplicitScale, aExplicitIncrement );
fStepWidth = aExplicitIncrement.Distance;
- if( aExplicitIncrement.SubIncrements.getLength() && aExplicitIncrement.SubIncrements[0].IntervalCount>0 )
+ if( !aExplicitIncrement.SubIncrements.empty() && aExplicitIncrement.SubIncrements[0].IntervalCount>0 )
fStepWidth=fStepWidth/double(aExplicitIncrement.SubIncrements[0].IntervalCount);
else
fStepWidth/=10;
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 448adbf3e89c..fd14db521416 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -56,7 +56,7 @@
#include "ChartTypeHelper.hxx"
#include "ObjectNameProvider.hxx"
#include "DiagramHelper.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "AxisIndexDefines.hxx"
#include "AxisHelper.hxx"
#include "ExplicitCategoriesProvider.hxx"
@@ -181,7 +181,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
ScaleData aData( xAxis->getScaleData() );
if( chart2::AxisType::SERIES == aData.AxisType )
m_bHasScaleProperties = false;
- if( chart2::AxisType::REALNUMBER == aData.AxisType || chart2::AxisType::PERCENT == aData.AxisType )
+ if( chart2::AxisType::SERIES != aData.AxisType )
m_bHasNumberProperties = true;
sal_Int32 nCooSysIndex=0;
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 8b649072538e..c71e9de73a31 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -474,12 +474,12 @@ IMPL_LINK( ErrorBarResources, ChooseRange, RangeSelectionButton *, pButton )
if( pButton == &m_aIbRangePositive )
{
m_pCurrentRangeChoosingField = &m_aEdRangePositive;
- aUIString = ::rtl::OUString( String( SchResId( STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS )));
+ aUIString = String( SchResId( STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS ));
}
else
{
m_pCurrentRangeChoosingField = &m_aEdRangeNegative;
- aUIString = ::rtl::OUString( String( SchResId( STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS )));
+ aUIString = String( SchResId( STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS ));
}
OSL_ASSERT( m_pParentDialog );
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index 87cc48ec6a55..58322534cba6 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -142,13 +142,13 @@ BOOL SchAxisLabelTabPage::FillItemSet( SfxItemSet& rOutAttrs )
bRadioButtonChecked = false;
if( bRadioButtonChecked )
- rOutAttrs.Put( SvxChartTextOrderItem( eOrder, SCHATTR_TEXT_ORDER ));
+ rOutAttrs.Put( SvxChartTextOrderItem( eOrder, SCHATTR_AXIS_LABEL_ORDER ));
}
if( aCbTextOverlap.GetState() != STATE_DONTKNOW )
- rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXT_OVERLAP, aCbTextOverlap.IsChecked() ) );
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_LABEL_OVERLAP, aCbTextOverlap.IsChecked() ) );
if( aCbTextBreak.GetState() != STATE_DONTKNOW )
- rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXTBREAK, aCbTextBreak.IsChecked() ) );
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_LABEL_BREAK, aCbTextBreak.IsChecked() ) );
if( aCbShowDescription.GetState() != STATE_DONTKNOW )
rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_SHOWDESCR, aCbShowDescription.IsChecked() ) );
@@ -212,7 +212,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
m_aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
// Text overlap ----------
- aState = rInAttrs.GetItemState( SCHATTR_TEXT_OVERLAP, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_OVERLAP, FALSE, &pPoolItem );
if( aState == SFX_ITEM_DONTCARE )
{
aCbTextOverlap.EnableTriState( TRUE );
@@ -231,7 +231,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
}
// text break ----------
- aState = rInAttrs.GetItemState( SCHATTR_TEXTBREAK, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_BREAK, FALSE, &pPoolItem );
if( aState == SFX_ITEM_DONTCARE )
{
aCbTextBreak.EnableTriState( TRUE );
@@ -256,7 +256,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
// text order ----------
if( m_bShowStaggeringControls )
{
- aState = rInAttrs.GetItemState( SCHATTR_TEXT_ORDER, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_ORDER, FALSE, &pPoolItem );
if( aState == SFX_ITEM_SET )
{
SvxChartTextOrder eOrder = static_cast< const SvxChartTextOrderItem * >( pPoolItem )->GetValue();
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index 3ba6ca0f74b2..82a1d19ffdb3 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -366,7 +366,7 @@ IMPL_LINK( RangeChooserTabPage, ChooseRangeHdl, void *, EMPTYARG )
{
rtl::OUString aRange = m_aED_Range.GetText();
// using assignment for broken gcc 3.3
- rtl::OUString aTitle = ::rtl::OUString( String( SchResId( STR_PAGE_DATA_RANGE ) ));
+ rtl::OUString aTitle = String( SchResId( STR_PAGE_DATA_RANGE ) );
lcl_enableRangeChoosing( true, m_pParentDialog );
m_rDialogModel.getRangeSelectionHelper()->chooseRange( aRange, aTitle, *this );
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 34fc0702bafe..3cb2d2838e8c 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -28,9 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#include "tp_Scale.hxx"
+#include "tp_Scale.hrc"
#include "ResId.hxx"
-#include "TabPages.hrc"
#include "Strings.hrc"
#include "chartview/ChartSfxItemIds.hxx"
#include "NoWarningThisInCTOR.hxx"
@@ -72,6 +72,20 @@ namespace chart
namespace
{
+void lcl_placeControlAtX( Control& rControl, long nNewXPos )
+{
+ Point aPos( rControl.GetPosPixel() );
+ aPos.X() = nNewXPos;
+ rControl.SetPosPixel(aPos);
+}
+
+void lcl_placeControlAtY( Control& rControl, long nNewYPos )
+{
+ Point aPos( rControl.GetPosPixel() );
+ aPos.Y() = nNewYPos;
+ rControl.SetPosPixel(aPos);
+}
+
void lcl_shiftControls( Control& rEdit, Control& rAuto, long nNewXPos )
{
Point aPos( rEdit.GetPosPixel() );
@@ -84,16 +98,15 @@ void lcl_shiftControls( Control& rEdit, Control& rAuto, long nNewXPos )
rAuto.SetPosPixel(aPos);
}
-void lcl_placeControlsAtY( Control& rTop, Control& rBottom, long nNewYPos )
+long lcl_getLabelDistance( Control& rControl )
{
- Point aPos( rTop.GetPosPixel() );
- long nShift = nNewYPos - aPos.Y();
- aPos.Y() = nNewYPos;
- rTop.SetPosPixel(aPos);
+ return rControl.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
+}
- aPos = rBottom.GetPosPixel();
- aPos.Y() += nShift;
- rBottom.SetPosPixel(aPos);
+void lcl_setValue( FormattedField& rFmtField, double fValue )
+{
+ rFmtField.SetValue( fValue );
+ rFmtField.SetDefaultValue( fValue );
}
}
@@ -102,32 +115,51 @@ ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
SfxTabPage(pWindow, SchResId(TP_SCALE), rInAttrs),
aFlScale(this, SchResId(FL_SCALE)),
+
+ aCbxReverse(this, SchResId(CBX_REVERSE)),
+ aCbxLogarithm(this, SchResId(CBX_LOGARITHM)),
+
+ m_aTxt_AxisType(this, SchResId (TXT_AXIS_TYPE)),
+ m_aLB_AxisType(this, SchResId(LB_AXIS_TYPE)),
+
aTxtMin (this, SchResId (TXT_MIN)),
aFmtFldMin(this, SchResId(EDT_MIN)),
aCbxAutoMin(this, SchResId(CBX_AUTO_MIN)),
+
aTxtMax(this, SchResId (TXT_MAX)),
aFmtFldMax(this, SchResId(EDT_MAX)),
aCbxAutoMax(this, SchResId(CBX_AUTO_MAX)),
+
+ m_aTxt_TimeResolution(this, SchResId (TXT_TIME_RESOLUTION)),
+ m_aLB_TimeResolution(this, SchResId(LB_TIME_RESOLUTION)),
+ m_aCbx_AutoTimeResolution(this, SchResId(CBX_AUTO_TIME_RESOLUTION)),
+
aTxtMain (this, SchResId (TXT_STEP_MAIN)),
aFmtFldStepMain(this, SchResId(EDT_STEP_MAIN)),
+ m_aMt_MainDateStep(this, SchResId(MT_MAIN_DATE_STEP)),
+ m_aLB_MainTimeUnit(this, SchResId(LB_MAIN_TIME_UNIT)),
aCbxAutoStepMain(this, SchResId(CBX_AUTO_STEP_MAIN)),
+
+ aTxtHelpCount (this, SchResId (TXT_STEP_HELP_COUNT)),
aTxtHelp (this, SchResId (TXT_STEP_HELP)),
aMtStepHelp (this, SchResId (MT_STEPHELP)),
+ m_aLB_HelpTimeUnit(this, SchResId(LB_HELP_TIME_UNIT)),
aCbxAutoStepHelp(this, SchResId(CBX_AUTO_STEP_HELP)),
aTxtOrigin (this, SchResId (TXT_ORIGIN)),
aFmtFldOrigin(this, SchResId(EDT_ORIGIN)),
aCbxAutoOrigin(this, SchResId(CBX_AUTO_ORIGIN)),
- aCbxLogarithm(this, SchResId(CBX_LOGARITHM)),
- aCbxReverse(this, SchResId(CBX_REVERSE)),
-
fMin(0.0),
fMax(0.0),
fStepMain(0.0),
nStepHelp(0),
fOrigin(0.0),
- nAxisType(chart2::AxisType::REALNUMBER),
+ m_nTimeResolution(1),
+ m_nMainTimeUnit(1),
+ m_nHelpTimeUnit(1),
+ m_nAxisType(chart2::AxisType::REALNUMBER),
+ m_bAllowDateAxis(false),
pNumFormatter(NULL),
m_bShowAxisOrigin(false)
{
@@ -139,6 +171,26 @@ ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
aCbxAutoStepMain.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoStepHelp.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoOrigin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
+ m_aCbx_AutoTimeResolution.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
+
+ m_aLB_AxisType.SetDropDownLineCount(3);
+ m_aLB_AxisType.SetSelectHdl(LINK(this, ScaleTabPage, SelectAxisTypeHdl));
+
+ m_aLB_TimeResolution.SetDropDownLineCount(3);
+ m_aLB_MainTimeUnit.SetDropDownLineCount(3);
+ m_aLB_HelpTimeUnit.SetDropDownLineCount(3);
+
+ aFmtFldMin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldMax.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldStepMain.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldOrigin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+}
+
+IMPL_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied )
+{
+ if( pFmtFied )
+ pFmtFied->SetDefaultValue( pFmtFied->GetValue() );
+ return 0;
}
void ScaleTabPage::StateChanged( StateChangedType nType )
@@ -155,10 +207,13 @@ void ScaleTabPage::AdjustControlPositions()
long nLabelWidth = ::std::max( aTxtMin.CalcMinimumSize().Width(), aTxtMax.CalcMinimumSize().Width() );
nLabelWidth = ::std::max( aTxtMain.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth = ::std::max( aTxtHelp.CalcMinimumSize().Width(), nLabelWidth );
+ nLabelWidth = ::std::max( aTxtHelpCount.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth = ::std::max( aTxtOrigin.CalcMinimumSize().Width(), nLabelWidth );
+ nLabelWidth = ::std::max( m_aTxt_TimeResolution.CalcMinimumSize().Width(), nLabelWidth );
+ nLabelWidth = ::std::max( m_aTxt_AxisType.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth+=1;
- long nLabelDistance = aTxtMin.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
+ long nLabelDistance = lcl_getLabelDistance(aTxtMin);
long nNewXPos = aTxtMin.GetPosPixel().X() + nLabelWidth + nLabelDistance;
//ensure that the auto checkboxes are wide enough and have correct size for calculation
@@ -167,9 +222,10 @@ void ScaleTabPage::AdjustControlPositions()
aCbxAutoStepMain.SetSizePixel( aCbxAutoStepMain.CalcMinimumSize() );
aCbxAutoStepHelp.SetSizePixel( aCbxAutoStepHelp.CalcMinimumSize() );
aCbxAutoOrigin.SetSizePixel( aCbxAutoOrigin.CalcMinimumSize() );
+ m_aCbx_AutoTimeResolution.SetSizePixel( m_aCbx_AutoTimeResolution.CalcMinimumSize() );
//ensure new pos is ok
- long nWidthOfOtherControls = aCbxAutoMin.GetPosPixel().X() + aCbxAutoMin.GetSizePixel().Width() - aFmtFldMin.GetPosPixel().X();
+ long nWidthOfOtherControls = m_aLB_MainTimeUnit.GetPosPixel().X() + m_aLB_MainTimeUnit.GetSizePixel().Width() - aFmtFldMin.GetPosPixel().X();
long nDialogWidth = GetSizePixel().Width();
long nLeftSpace = nDialogWidth - nNewXPos - nWidthOfOtherControls;
@@ -181,72 +237,180 @@ void ScaleTabPage::AdjustControlPositions()
aTxtMax.SetSizePixel(aSize);
aTxtMain.SetSizePixel(aSize);
aTxtHelp.SetSizePixel(aSize);
+ aTxtHelpCount.SetSizePixel(aSize);
aTxtOrigin.SetSizePixel(aSize);
+ m_aTxt_TimeResolution.SetSizePixel(aSize);
+ m_aTxt_AxisType.SetSizePixel(aSize);
+
+ long nOrgAutoCheckX = aCbxAutoMin.GetPosPixel().X();
+ lcl_placeControlAtX( aCbxAutoStepMain, nOrgAutoCheckX );
+ lcl_placeControlAtX( aCbxAutoStepHelp, nOrgAutoCheckX );
lcl_shiftControls( aFmtFldMin, aCbxAutoMin, nNewXPos );
lcl_shiftControls( aFmtFldMax, aCbxAutoMax, nNewXPos );
lcl_shiftControls( aFmtFldStepMain, aCbxAutoStepMain, nNewXPos );
+ lcl_placeControlAtX( m_aMt_MainDateStep, aFmtFldStepMain.GetPosPixel().X() );
lcl_shiftControls( aMtStepHelp, aCbxAutoStepHelp, nNewXPos );
lcl_shiftControls( aFmtFldOrigin, aCbxAutoOrigin, nNewXPos );
+ lcl_shiftControls( m_aLB_TimeResolution, m_aCbx_AutoTimeResolution, nNewXPos );
+ lcl_placeControlAtX( m_aLB_AxisType, nNewXPos );
+
+ nNewXPos = aCbxAutoStepMain.GetPosPixel().X() + aCbxAutoStepMain.GetSizePixel().Width() + nLabelDistance;
+ lcl_placeControlAtX( m_aLB_MainTimeUnit, nNewXPos );
+ lcl_placeControlAtX( m_aLB_HelpTimeUnit, nNewXPos );
}
+ PlaceIntervalControlsAccordingToAxisType();
}
-void ScaleTabPage::EnableControls()
+void ScaleTabPage::PlaceIntervalControlsAccordingToAxisType()
{
- bool bEnableForValueOrPercentAxis = chart2::AxisType::REALNUMBER == nAxisType || chart2::AxisType::PERCENT == nAxisType;
- aFlScale.Enable( bEnableForValueOrPercentAxis );
- aTxtMin.Enable( bEnableForValueOrPercentAxis );
- aFmtFldMin.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoMin.Enable( bEnableForValueOrPercentAxis );
- aTxtMax.Enable( bEnableForValueOrPercentAxis );
- aFmtFldMax.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoMax.Enable( bEnableForValueOrPercentAxis );
- aTxtMain.Enable( bEnableForValueOrPercentAxis );
- aFmtFldStepMain.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoStepMain.Enable( bEnableForValueOrPercentAxis );
- aTxtHelp.Enable( bEnableForValueOrPercentAxis );
- aMtStepHelp.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoStepHelp.Enable( bEnableForValueOrPercentAxis );
- aCbxLogarithm.Enable( bEnableForValueOrPercentAxis );
-
- aTxtOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
- aFmtFldOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
- aCbxAutoOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
-
- long nNewYPos = aTxtOrigin.GetPosPixel().Y();
- if( m_bShowAxisOrigin )
- nNewYPos += ( aTxtOrigin.GetPosPixel().Y() - aTxtHelp.GetPosPixel().Y() );
- lcl_placeControlsAtY( aCbxLogarithm, aCbxReverse, nNewYPos );
+ long nMinX = std::min( aCbxAutoStepMain.GetPosPixel().X(), m_aLB_MainTimeUnit.GetPosPixel().X() );
+ long nLabelDistance = lcl_getLabelDistance(aTxtMin);
+ long nListWidth = m_aLB_MainTimeUnit.GetSizePixel().Width();
+
+ if( chart2::AxisType::DATE == m_nAxisType )
+ {
+ lcl_placeControlAtX( m_aLB_MainTimeUnit, nMinX );
+ lcl_placeControlAtX( m_aLB_HelpTimeUnit, nMinX );
+ long nSecondX = nMinX + nListWidth + nLabelDistance;
+ lcl_placeControlAtX( aCbxAutoStepMain, nSecondX );
+ lcl_placeControlAtX( aCbxAutoStepHelp, nSecondX );
+
+ long nOne = m_aMt_MainDateStep.LogicToPixel( Size(0, 1), MapMode(MAP_APPFONT) ).Height();
+
+ long nYMajor = m_aMt_MainDateStep.GetPosPixel().Y();
+ lcl_placeControlAtY( aCbxAutoStepMain , nYMajor+(3*nOne));
+ lcl_placeControlAtY( aTxtMain , nYMajor+nOne+nOne);
+
+ long nYMinor = m_aLB_HelpTimeUnit.GetPosPixel().Y();
+ lcl_placeControlAtY( aMtStepHelp , nYMinor );
+ lcl_placeControlAtY( aCbxAutoStepHelp , nYMinor+(3*nOne));
+ }
+ else
+ {
+ lcl_placeControlAtX( aCbxAutoStepMain, nMinX );
+ lcl_placeControlAtX( aCbxAutoStepHelp, nMinX );
+ long nSecondX = nMinX + aCbxAutoStepMain.GetSizePixel().Width() + nLabelDistance;
+ long nSecondXMax = GetSizePixel().Width() - nListWidth;
+ if( nSecondX > nSecondXMax )
+ nSecondX = nSecondXMax;
+ lcl_placeControlAtX( m_aLB_MainTimeUnit, nSecondX );
+ lcl_placeControlAtX( m_aLB_HelpTimeUnit, nSecondX );
+ }
}
+void ScaleTabPage::EnableControls()
+{
+ bool bValueAxis = chart2::AxisType::REALNUMBER == m_nAxisType || chart2::AxisType::PERCENT == m_nAxisType || chart2::AxisType::DATE == m_nAxisType;
+ bool bDateAxis = chart2::AxisType::DATE == m_nAxisType;
+
+ m_aTxt_AxisType.Show(m_bAllowDateAxis);
+ m_aLB_AxisType.Show(m_bAllowDateAxis);
+
+ aCbxLogarithm.Show( bValueAxis && !bDateAxis );
+ aTxtMin.Show( bValueAxis );
+ aFmtFldMin.Show( bValueAxis );
+ aCbxAutoMin.Show( bValueAxis );
+ aTxtMax.Show( bValueAxis );
+ aFmtFldMax.Show( bValueAxis );
+ aCbxAutoMax.Show( bValueAxis );
+ aTxtMain.Show( bValueAxis );
+ aFmtFldStepMain.Show( bValueAxis );
+ aCbxAutoStepMain.Show( bValueAxis );
+ aTxtHelp.Show( bValueAxis );
+ aTxtHelpCount.Show( bValueAxis );
+ aMtStepHelp.Show( bValueAxis );
+ aCbxAutoStepHelp.Show( bValueAxis );
+
+ aTxtOrigin.Show( m_bShowAxisOrigin && bValueAxis );
+ aFmtFldOrigin.Show( m_bShowAxisOrigin && bValueAxis );
+ aCbxAutoOrigin.Show( m_bShowAxisOrigin && bValueAxis );
+
+ aTxtHelpCount.Show( bValueAxis && !bDateAxis );
+ aTxtHelp.Show( bDateAxis );
+
+ m_aTxt_TimeResolution.Show( bDateAxis );
+ m_aLB_TimeResolution.Show( bDateAxis );
+ m_aCbx_AutoTimeResolution.Show( bDateAxis );
+
+ bool bWasDateAxis = m_aMt_MainDateStep.IsVisible();
+ if( bWasDateAxis != bDateAxis )
+ {
+ //transport value from one to other control
+ if( bWasDateAxis )
+ lcl_setValue( aFmtFldStepMain, m_aMt_MainDateStep.GetValue() );
+ else
+ m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(aFmtFldStepMain.GetValue()) );
+ }
+ aFmtFldStepMain.Show( bValueAxis && !bDateAxis );
+ m_aMt_MainDateStep.Show( bDateAxis );
+
+ m_aLB_MainTimeUnit.Show( bDateAxis );
+ m_aLB_HelpTimeUnit.Show( bDateAxis );
+ EnableValueHdl(&aCbxAutoMin);
+ EnableValueHdl(&aCbxAutoMax);
+ EnableValueHdl(&aCbxAutoStepMain);
+ EnableValueHdl(&aCbxAutoStepHelp);
+ EnableValueHdl(&aCbxAutoOrigin);
+ EnableValueHdl(&m_aCbx_AutoTimeResolution);
+}
IMPL_LINK( ScaleTabPage, EnableValueHdl, CheckBox *, pCbx )
{
+ bool bEnable = pCbx && !pCbx->IsChecked() && pCbx->IsEnabled();
if (pCbx == &aCbxAutoMin)
{
- aFmtFldMin.Enable(!aCbxAutoMin.IsChecked());
+ aFmtFldMin.Enable( bEnable );
}
else if (pCbx == &aCbxAutoMax)
{
- aFmtFldMax.Enable(!aCbxAutoMax.IsChecked());
+ aFmtFldMax.Enable( bEnable );
}
else if (pCbx == &aCbxAutoStepMain)
{
- aFmtFldStepMain.Enable(!aCbxAutoStepMain.IsChecked());
+ aFmtFldStepMain.Enable( bEnable );
+ m_aMt_MainDateStep.Enable( bEnable );
+ m_aLB_MainTimeUnit.Enable( bEnable );
}
else if (pCbx == &aCbxAutoStepHelp)
{
- aMtStepHelp.Show ();
- aMtStepHelp.Enable( ! aCbxAutoStepHelp.IsChecked() );
+ aMtStepHelp.Enable( bEnable );
+ m_aLB_HelpTimeUnit.Enable( bEnable );
+ }
+ else if (pCbx == &m_aCbx_AutoTimeResolution)
+ {
+ m_aLB_TimeResolution.Enable( bEnable );
}
else if (pCbx == &aCbxAutoOrigin)
{
- aFmtFldOrigin.Enable(!aCbxAutoOrigin.IsChecked());
+ aFmtFldOrigin.Enable( bEnable );
}
return 0;
}
+enum AxisTypeListBoxEntry
+{
+ TYPE_AUTO=0,
+ TYPE_TEXT=1,
+ TYPE_DATE=2
+};
+
+IMPL_LINK( ScaleTabPage, SelectAxisTypeHdl, void *, EMPTYARG )
+{
+ USHORT nPos = m_aLB_AxisType.GetSelectEntryPos();
+ if( nPos==TYPE_DATE )
+ m_nAxisType = chart2::AxisType::DATE;
+ else
+ m_nAxisType = chart2::AxisType::CATEGORY;
+ if( chart2::AxisType::DATE == m_nAxisType )
+ aCbxLogarithm.Check(false);
+ EnableControls();
+ PlaceIntervalControlsAccordingToAxisType();
+ SetNumFormat();
+ return 0;
+}
+
SfxTabPage* ScaleTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
{
return new ScaleTabPage(pWindow, rOutAttrs);
@@ -256,10 +420,18 @@ BOOL ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
DBG_ASSERT( pNumFormatter, "No NumberFormatter available" );
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MIN ,aCbxAutoMin.IsChecked()));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MAX ,aCbxAutoMax.IsChecked()));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,aCbxAutoStepHelp.IsChecked()));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,aCbxAutoOrigin.IsChecked()));
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXISTYPE, m_nAxisType));
+ if(m_bAllowDateAxis)
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS, TYPE_AUTO==m_aLB_AxisType.GetSelectEntryPos()));
+
+ bool bAutoScale = false;
+ if( m_nAxisType==chart2::AxisType::CATEGORY )
+ bAutoScale = true;//reset scaling for category charts
+
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MIN ,bAutoScale || aCbxAutoMin.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MAX ,bAutoScale || aCbxAutoMax.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,bAutoScale || aCbxAutoStepHelp.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,bAutoScale || aCbxAutoOrigin.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_LOGARITHM ,aCbxLogarithm.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_REVERSE ,aCbxReverse.IsChecked()));
rOutAttrs.Put(SvxDoubleItem(fMax , SCHATTR_AXIS_MAX));
@@ -267,9 +439,15 @@ BOOL ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs)
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_STEP_HELP, nStepHelp));
rOutAttrs.Put(SvxDoubleItem(fOrigin , SCHATTR_AXIS_ORIGIN));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN,aCbxAutoStepMain.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN,bAutoScale || aCbxAutoStepMain.IsChecked()));
rOutAttrs.Put(SvxDoubleItem(fStepMain,SCHATTR_AXIS_STEP_MAIN));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,bAutoScale || m_aCbx_AutoTimeResolution.IsChecked()));
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION,m_nTimeResolution));
+
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT,m_nMainTimeUnit));
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT,m_nHelpTimeUnit));
+
return TRUE;
}
@@ -280,20 +458,50 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
return;
const SfxPoolItem *pPoolItem = NULL;
- nAxisType=chart2::AxisType::REALNUMBER;
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_ALLOW_DATEAXIS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ m_bAllowDateAxis = (bool) ((const SfxBoolItem*)pPoolItem)->GetValue();
+ m_nAxisType=chart2::AxisType::REALNUMBER;
if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ m_nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue();
+ if( m_nAxisType==chart2::AxisType::DATE && !m_bAllowDateAxis )
+ m_nAxisType=chart2::AxisType::CATEGORY;
+ if( m_bAllowDateAxis )
{
- nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue();
- EnableControls();
+ bool bAutoDateAxis = false;
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_DATEAXIS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ bAutoDateAxis = (bool) ((const SfxBoolItem*)pPoolItem)->GetValue();
+
+ USHORT nPos = 0;
+ if( m_nAxisType==chart2::AxisType::DATE )
+ nPos=TYPE_DATE;
+ else if( bAutoDateAxis )
+ nPos=TYPE_AUTO;
+ else
+ nPos=TYPE_TEXT;
+ m_aLB_AxisType.SelectEntryPos( nPos );
}
+ if( m_bAllowDateAxis )
+ aCbxReverse.SetHelpId("chart2:CheckBox:TP_SCALE:CBX_REVERSE:MayBeDateAxis");
+ else if( m_nAxisType==chart2::AxisType::CATEGORY || m_nAxisType==chart2::AxisType::SERIES )
+ aCbxReverse.SetHelpId("chart2:CheckBox:TP_SCALE:CBX_REVERSE:Category");
+
+ PlaceIntervalControlsAccordingToAxisType();
+
+ aCbxAutoMin.Check( true );
+ aCbxAutoMax.Check( true );
+ aCbxAutoStepMain.Check( true );
+ aCbxAutoStepHelp.Check( true );
+ aCbxAutoOrigin.Check( true );
+ m_aCbx_AutoTimeResolution.Check( true );
+
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MIN,TRUE,&pPoolItem) == SFX_ITEM_SET)
aCbxAutoMin.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
if (rInAttrs.GetItemState(SCHATTR_AXIS_MIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldMin.SetValue( fMin );
+ lcl_setValue( aFmtFldMin, fMin );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
@@ -302,7 +510,7 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_AXIS_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fMax = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldMax.SetValue( fMax );
+ lcl_setValue( aFmtFldMax, fMax );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
@@ -311,7 +519,8 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fStepMain = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldStepMain.SetValue( fStepMain );
+ lcl_setValue( aFmtFldStepMain, fStepMain );
+ m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(fStepMain) );
}
if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET)
aCbxAutoStepHelp.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
@@ -329,14 +538,30 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
if (rInAttrs.GetItemState(SCHATTR_AXIS_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
{
fOrigin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldOrigin.SetValue( fOrigin );
+ lcl_setValue( aFmtFldOrigin, fOrigin );
}
- EnableValueHdl(&aCbxAutoMin);
- EnableValueHdl(&aCbxAutoMax);
- EnableValueHdl(&aCbxAutoStepMain);
- EnableValueHdl(&aCbxAutoStepHelp);
- EnableValueHdl(&aCbxAutoOrigin);
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ m_aCbx_AutoTimeResolution.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_TIME_RESOLUTION,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ {
+ m_nTimeResolution = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ m_aLB_TimeResolution.SelectEntryPos( m_nTimeResolution );
+ }
+
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_MAIN_TIME_UNIT,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ {
+ m_nMainTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ m_aLB_MainTimeUnit.SelectEntryPos( m_nMainTimeUnit );
+ }
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_HELP_TIME_UNIT,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ {
+ m_nHelpTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ m_aLB_HelpTimeUnit.SelectEntryPos( m_nHelpTimeUnit );
+ }
+
+ EnableControls();
+ SetNumFormat();
}
int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
@@ -347,6 +572,8 @@ int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
return LEAVE_PAGE;
}
+ bool bDateAxis = chart2::AxisType::DATE == m_nAxisType;
+
sal_uInt32 nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM);
const SfxPoolItem *pPoolItem = NULL;
if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, TRUE, &pPoolItem ) == SFX_ITEM_SET )
@@ -356,75 +583,105 @@ int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
OSL_ENSURE( false, "Using Standard Language" );
}
- Edit* pEdit = NULL;
+ Control* pControl = NULL;
USHORT nErrStrId = 0;
double fDummy;
fMax = aFmtFldMax.GetValue();
fMin = aFmtFldMin.GetValue();
fOrigin = aFmtFldOrigin.GetValue();
- fStepMain = aFmtFldStepMain.GetValue();
+ fStepMain = bDateAxis ? m_aMt_MainDateStep.GetValue() : aFmtFldStepMain.GetValue();
nStepHelp = static_cast< sal_Int32 >( aMtStepHelp.GetValue());
+ m_nTimeResolution = m_aLB_TimeResolution.GetSelectEntryPos();
+ m_nMainTimeUnit = m_aLB_MainTimeUnit.GetSelectEntryPos();
+ m_nHelpTimeUnit = m_aLB_HelpTimeUnit.GetSelectEntryPos();
+
+ if( chart2::AxisType::REALNUMBER != m_nAxisType )
+ aCbxLogarithm.Show( false );
+
+ //check wich entries need user action
- //do some reasonable automatic correction of user input if necessary
- if (!aCbxAutoMax.IsChecked() && !aCbxAutoMin.IsChecked() &&
- fMin >= fMax)
- {
- pEdit = &aFmtFldMin;
- nErrStrId = STR_MIN_GREATER_MAX;
- }
- // check for entries in invalid ranges
if ( aCbxLogarithm.IsChecked() &&
( ( !aCbxAutoMin.IsChecked() && fMin <= 0.0 )
|| ( !aCbxAutoMax.IsChecked() && fMax <= 0.0 ) ) )
{
- pEdit = &aFmtFldMin;
+ pControl = &aFmtFldMin;
nErrStrId = STR_BAD_LOGARITHM;
}
- if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0)
+ else if (!aCbxAutoMax.IsChecked() && !aCbxAutoMin.IsChecked() &&
+ fMin >= fMax)
+ {
+ pControl = &aFmtFldMin;
+ nErrStrId = STR_MIN_GREATER_MAX;
+ }
+ else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0)
{
- pEdit = &aFmtFldStepMain;
+ pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
}
-
- //check wich entries need user action
-
// check for entries that cannot be parsed for the current number format
- if ( aFmtFldMin.IsModified()
+ else if ( aFmtFldMin.IsModified()
&& !aCbxAutoMin.IsChecked()
&& !pNumFormatter->IsNumberFormat(aFmtFldMin.GetText(), nIndex, fDummy))
{
- pEdit = &aFmtFldMin;
+ pControl = &aFmtFldMin;
nErrStrId = STR_INVALID_NUMBER;
}
else if (aFmtFldMax.IsModified() && !aCbxAutoMax.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldMax.GetText(),
nIndex, fDummy))
{
- pEdit = &aFmtFldMax;
+ pControl = &aFmtFldMax;
nErrStrId = STR_INVALID_NUMBER;
}
- else if (aFmtFldStepMain.IsModified() && !aCbxAutoStepMain.IsChecked() &&
+ else if ( !bDateAxis && aFmtFldStepMain.IsModified() && !aCbxAutoStepMain.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldStepMain.GetText(),
nIndex, fDummy))
{
- pEdit = &aFmtFldStepMain;
+ pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
}
else if (aFmtFldOrigin.IsModified() && !aCbxAutoOrigin.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldOrigin.GetText(),
nIndex, fDummy))
{
- pEdit = &aFmtFldOrigin;
+ pControl = &aFmtFldOrigin;
nErrStrId = STR_INVALID_NUMBER;
}
else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0.0)
{
- pEdit = &aFmtFldStepMain;
+ pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
}
+ else if( bDateAxis )
+ {
+ if( !aCbxAutoStepMain.IsChecked() && !aCbxAutoStepHelp.IsChecked() )
+ {
+ if( m_nHelpTimeUnit > m_nMainTimeUnit )
+ {
+ pControl = &m_aLB_MainTimeUnit;
+ nErrStrId = STR_INVALID_INTERVALS;
+ }
+ else if( m_nHelpTimeUnit == m_nMainTimeUnit && nStepHelp > fStepMain )
+ {
+ pControl = &m_aLB_MainTimeUnit;
+ nErrStrId = STR_INVALID_INTERVALS;
+ }
+ }
+ if( !nErrStrId && !m_aCbx_AutoTimeResolution.IsChecked() )
+ {
+ if( (!aCbxAutoStepMain.IsChecked() && m_nTimeResolution > m_nMainTimeUnit )
+ ||
+ (!aCbxAutoStepHelp.IsChecked() && m_nTimeResolution > m_nHelpTimeUnit )
+ )
+ {
+ pControl = &m_aLB_TimeResolution;
+ nErrStrId = STR_INVALID_TIME_UNIT;
+ }
+ }
+ }
- if( ShowWarning( nErrStrId, pEdit ) )
+ if( ShowWarning( nErrStrId, pControl ) )
return KEEP_PAGE;
if( pItemSet )
@@ -486,6 +743,19 @@ void ScaleTabPage::SetNumFormat()
else
nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME );
}
+
+ if( chart2::AxisType::DATE == m_nAxisType && ( eType != NUMBERFORMAT_DATE && eType != NUMBERFORMAT_DATETIME) )
+ {
+ const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
+ if( pFormat )
+ nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE, pFormat->GetLanguage() );
+ else
+ nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE );
+
+ aFmtFldMax.SetFormatKey( nFmt );
+ aFmtFldMin.SetFormatKey( nFmt );
+ aFmtFldOrigin.SetFormatKey( nFmt );
+ }
}
aFmtFldStepMain.SetFormatKey( nFmt );
@@ -499,7 +769,7 @@ void ScaleTabPage::ShowAxisOrigin( bool bShowOrigin )
m_bShowAxisOrigin = true;
}
-bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL */ )
+bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Control* pControl /* = NULL */ )
{
if( nResIdMessage == 0 )
return false;
@@ -508,7 +778,9 @@ bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL
if( pControl )
{
pControl->GrabFocus();
- pControl->SetSelection( Selection( 0, SELECTION_MAX ));
+ Edit* pEdit = dynamic_cast<Edit*>(pControl);
+ if(pEdit)
+ pEdit->SetSelection( Selection( 0, SELECTION_MAX ));
}
return true;
}
diff --git a/chart2/source/controller/dialogs/tp_Scale.hrc b/chart2/source/controller/dialogs/tp_Scale.hrc
new file mode 100644
index 000000000000..bde6c21c7924
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_Scale.hrc
@@ -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 "ResourceIds.hrc"
+
+#define FL_SCALE 1
+
+#define TXT_MIN 1
+#define TXT_MAX 2
+#define TXT_STEP_MAIN 3
+#define TXT_STEP_HELP_COUNT 4
+#define TXT_ORIGIN 5
+#define TXT_TIME_RESOLUTION 6
+#define TXT_AXIS_TYPE 7
+#define TXT_STEP_HELP 8
+
+#define CBX_AUTO_MIN 1
+#define CBX_AUTO_MAX 2
+#define CBX_AUTO_STEP_MAIN 3
+#define CBX_AUTO_STEP_HELP 4
+#define CBX_AUTO_ORIGIN 5
+#define CBX_LOGARITHM 6
+#define CBX_REVERSE 7
+#define CBX_AUTO_TIME_RESOLUTION 8
+
+#define EDT_STEP_MAIN 1
+#define EDT_MAX 2
+#define EDT_MIN 3
+#define EDT_ORIGIN 4
+
+#define MT_STEPHELP 10
+#define MT_MAIN_DATE_STEP 11
+
+#define LB_AXIS_TYPE 1
+#define LB_MAIN_TIME_UNIT 2
+#define LB_HELP_TIME_UNIT 3
+#define LB_TIME_RESOLUTION 4
+
+#define STR_LIST_TIME_UNIT 1
diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx
index 8d0e02186c38..ecfc42c2c513 100644
--- a/chart2/source/controller/dialogs/tp_Scale.hxx
+++ b/chart2/source/controller/dialogs/tp_Scale.hxx
@@ -37,6 +37,8 @@
#include <vcl/button.hxx>
// header for MetricField
#include <vcl/field.hxx>
+// header for class ListBox
+#include <vcl/lstbox.hxx>
//.............................................................................
namespace chart
@@ -64,6 +66,13 @@ public:
private:
FixedLine aFlScale;
+ CheckBox aCbxReverse;
+
+ CheckBox aCbxLogarithm;
+
+ FixedText m_aTxt_AxisType;
+ ListBox m_aLB_AxisType;
+
FixedText aTxtMin;
FormattedField aFmtFldMin;
CheckBox aCbxAutoMin;
@@ -72,35 +81,47 @@ private:
FormattedField aFmtFldMax;
CheckBox aCbxAutoMax;
+ FixedText m_aTxt_TimeResolution;
+ ListBox m_aLB_TimeResolution;
+ CheckBox m_aCbx_AutoTimeResolution;
+
FixedText aTxtMain;
FormattedField aFmtFldStepMain;
+ MetricField m_aMt_MainDateStep;
+ ListBox m_aLB_MainTimeUnit;
CheckBox aCbxAutoStepMain;
+ FixedText aTxtHelpCount;
FixedText aTxtHelp;
MetricField aMtStepHelp;
+ ListBox m_aLB_HelpTimeUnit;
CheckBox aCbxAutoStepHelp;
FixedText aTxtOrigin;
FormattedField aFmtFldOrigin;
CheckBox aCbxAutoOrigin;
- CheckBox aCbxLogarithm;
- CheckBox aCbxReverse;
-
double fMin;
double fMax;
double fStepMain;
sal_Int32 nStepHelp;
double fOrigin;
- int nAxisType;
+ sal_Int32 m_nTimeResolution;
+ sal_Int32 m_nMainTimeUnit;
+ sal_Int32 m_nHelpTimeUnit;
+ int m_nAxisType;
+ bool m_bAllowDateAxis;
SvNumberFormatter* pNumFormatter;
bool m_bShowAxisOrigin;
void AdjustControlPositions();
void EnableControls();
+ void PlaceIntervalControlsAccordingToAxisType();
+ DECL_LINK( SelectAxisTypeHdl, void* );
DECL_LINK( EnableValueHdl, CheckBox* );
+ DECL_LINK( FmtFieldModifiedHdl, FormattedField* );
/** shows a warning window due to an invalid input.
@@ -115,7 +136,7 @@ private:
@return false, if nResIdMessage was 0, true otherwise
*/
- bool ShowWarning( USHORT nResIdMessage, Edit * pControl = NULL );
+ bool ShowWarning( USHORT nResIdMessage, Control* pControl = NULL );
};
//.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_Scale.src b/chart2/source/controller/dialogs/tp_Scale.src
index 9e92e70f6f43..0b0e7efcdb9c 100644..100755
--- a/chart2/source/controller/dialogs/tp_Scale.src
+++ b/chart2/source/controller/dialogs/tp_Scale.src
@@ -25,7 +25,7 @@
*
************************************************************************/
#include "HelpIds.hrc"
-#include "TabPages.hrc"
+#include "tp_Scale.hrc"
#define YLine1 3
#define Y1 (YLine1+13)
@@ -33,16 +33,26 @@
#define Y3 (Y2+16)
#define Y4 (Y3+16)
#define Y5 (Y4+16)
-#define Y6 (Y5+17)
-#define Y7 (Y6+15)
+#define Y6 (Y5+16)
+#define Y7 (Y6+16)
+#define Y8 (Y7+16)
#define LABELWIDTH 88
-#define AUTOCHECKWIDTH 88
+#define AUTOCHECKWIDTH 41
#define EDITWIDTH 50
#define X1 6
#define X2 11
#define X3 (X2+LABELWIDTH+4)
#define X4 (X3+EDITWIDTH+5)
+#define X5 (X4+AUTOCHECKWIDTH+5)
+
+#define STR_LIST_TIME_UNIT \
+ StringList [ en-US ] = \
+ { \
+ "Days" ; \
+ "Months" ; \
+ "Years" ; \
+ };
TabPage TP_SCALE
{
@@ -57,86 +67,201 @@ TabPage TP_SCALE
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Scale" ;
};
- FixedText TXT_MIN
+ //---------------------------
+ CheckBox CBX_REVERSE
{
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_REVERSE:ValueAxis";
Pos = MAP_APPFONT ( X2 , Y1 ) ;
+ Size = MAP_APPFONT ( 244 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "~Reverse direction" ;
+ };
+ //---------------------------
+ CheckBox CBX_LOGARITHM
+ {
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_LOGARITHM";
+ Pos = MAP_APPFONT ( X2 , Y2 ) ;
+ Size = MAP_APPFONT ( 244 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "~Logarithmic scale" ;
+ };
+ //---------------------------
+ FixedText TXT_AXIS_TYPE
+ {
+ Pos = MAP_APPFONT ( X2 , Y2 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "~Minimum:" ;
+ Text [ en-US ] = "T~ype" ;
+ };
+ ListBox LB_AXIS_TYPE
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_AXIS_TYPE";
+ Border = TRUE ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X3 , Y2-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+
+ StringList [ en-US ] =
+ {
+ "Automatic" ;
+ "Text" ;
+ "Date" ;
+ };
+ };
+ //---------------------------
+ FixedText TXT_MIN
+ {
+ Pos = MAP_APPFONT ( X2 , Y3 ) ;
+ Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
+ Text [ en-US ] = "~Minimum" ;
};
SpinField EDT_MIN
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_MIN";
Border = TRUE ;
SVLook = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y1-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y3-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_MIN
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_MIN";
- Pos = MAP_APPFONT ( X4 , Y1-1 ) ;
+ Pos = MAP_APPFONT ( X4 , Y3+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Automatic" ;
};
-
+ //---------------------------
FixedText TXT_MAX
{
- Pos = MAP_APPFONT ( X2 , Y2 ) ;
+ Pos = MAP_APPFONT ( X2 , Y4 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Ma~ximum:" ;
+ Text [ en-US ] = "Ma~ximum" ;
};
SpinField EDT_MAX
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_MAX";
Border = TRUE ;
SVLook = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y2-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y4-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_MAX
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_MAX";
- Pos = MAP_APPFONT ( X4 , Y2-1 ) ;
+ Pos = MAP_APPFONT ( X4 , Y4+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "A~utomatic" ;
};
+ //---------------------------
+ FixedText TXT_TIME_RESOLUTION
+ {
+ Pos = MAP_APPFONT ( X2 , Y5 ) ;
+ Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
+ Text [ en-US ] = "R~esolution" ;
+ };
+ ListBox LB_TIME_RESOLUTION
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_TIME_RESOLUTION";
+ Border = TRUE ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+
+ STR_LIST_TIME_UNIT
+ };
+ CheckBox CBX_AUTO_TIME_RESOLUTION
+ {
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_TIME_RESOLUTION";
+ Pos = MAP_APPFONT ( X4 , Y5+1 ) ;
+ Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Automat~ic" ;
+ };
+ //---------------------------
FixedText TXT_STEP_MAIN
{
- Pos = MAP_APPFONT ( X2 , Y3 ) ;
+ Pos = MAP_APPFONT ( X2 , Y5 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Ma~jor interval:" ;
+ Text [ en-US ] = "Ma~jor interval" ;
};
SpinField EDT_STEP_MAIN
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_STEP_MAIN";
Border = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y3-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
+ MetricField MT_MAIN_DATE_STEP
+ {
+ HelpID = "chart2:MetricField:TP_SCALE:MT_MAIN_DATE_STEP";
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( X3 , Y6-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 100000 ;
+ StrictFormat = TRUE ;
+ Unit = FUNIT_CUSTOM ;
+ First = 1 ;
+ Last = 100000 ;
+ SpinSize = 1 ;
+ };
+
+ ListBox LB_MAIN_TIME_UNIT
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_MAIN_TIME_UNIT";
+ Border = TRUE ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X5 , Y6-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+
+ STR_LIST_TIME_UNIT
+ };
+
CheckBox CBX_AUTO_STEP_MAIN
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_MAIN";
- Pos = MAP_APPFONT ( X4 , Y3-1 ) ;
+ Pos = MAP_APPFONT ( X4 , Y5+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Au~tomatic" ;
};
+ //---------------------------
+ FixedText TXT_STEP_HELP_COUNT
+ {
+ Pos = MAP_APPFONT ( X2 , Y6 ) ;
+ Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
+ Text [ en-US ] = "Minor inter~val count" ;
+ };
FixedText TXT_STEP_HELP
{
- Pos = MAP_APPFONT ( X2 , Y4 ) ;
+ Pos = MAP_APPFONT ( X2 , Y7 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Minor interval ~count:" ;
+ Text [ en-US ] = "Minor inter~val" ;
};
MetricField MT_STEPHELP
{
HelpID = "chart2:MetricField:TP_SCALE:MT_STEPHELP";
Border = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y4-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y6-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
@@ -149,55 +274,51 @@ TabPage TP_SCALE
Last = 100 ;
SpinSize = 1 ;
};
+ ListBox LB_HELP_TIME_UNIT
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_HELP_TIME_UNIT";
+ Border = TRUE ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X5 , Y7-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+
+ STR_LIST_TIME_UNIT
+ };
CheckBox CBX_AUTO_STEP_HELP
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_HELP";
- Pos = MAP_APPFONT ( X4 , Y4-1 ) ;
+ Pos = MAP_APPFONT ( X4 , Y6+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Aut~omatic" ;
};
-
+ //---------------------------
FixedText TXT_ORIGIN
{
- Pos = MAP_APPFONT ( X2 , Y5 ) ;
+ Pos = MAP_APPFONT ( X2 , Y7 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Reference ~value:" ;
+ Text [ en-US ] = "Re~ference value" ;
};
SpinField EDT_ORIGIN
{
HelpID = "chart2:SpinField:TP_SCALE:EDT_ORIGIN";
Border = TRUE ;
SVLook = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y7-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_ORIGIN
{
HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_ORIGIN";
- Pos = MAP_APPFONT ( X4 , Y5-1 ) ;
+ Pos = MAP_APPFONT ( X4 , Y7+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Automat~ic" ;
};
-
- CheckBox CBX_LOGARITHM
- {
- HelpID = "chart2:CheckBox:TP_SCALE:CBX_LOGARITHM";
- Pos = MAP_APPFONT ( X2 , Y6 ) ;
- Size = MAP_APPFONT ( 244 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Logarithmic scale" ;
- };
-
- CheckBox CBX_REVERSE
- {
- HelpID = "chart2:CheckBox:TP_SCALE:CBX_REVERSE";
- Pos = MAP_APPFONT ( X2 , Y7 ) ;
- Size = MAP_APPFONT ( 244 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Reverse direction" ;
- };
-
+ //---------------------------
};
diff --git a/chart2/source/controller/inc/AxisItemConverter.hxx b/chart2/source/controller/inc/AxisItemConverter.hxx
index 7c8f83452963..647f82a9eb6a 100644
--- a/chart2/source/controller/inc/AxisItemConverter.hxx
+++ b/chart2/source/controller/inc/AxisItemConverter.hxx
@@ -27,8 +27,7 @@
#ifndef CHART_AXISITEMCONVERTER_HXX
#define CHART_AXISITEMCONVERTER_HXX
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
+#include <chartview/ExplicitScaleValues.hxx>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/awt/Size.hpp>
@@ -55,8 +54,8 @@ public:
SdrModel& rDrawModel,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc,
- ::com::sun::star::chart2::ExplicitScaleData * pScale = NULL,
- ::com::sun::star::chart2::ExplicitIncrementData * pIncrement = NULL,
+ ExplicitScaleData * pScale = NULL,
+ ExplicitIncrementData * pIncrement = NULL,
::std::auto_ptr< ::com::sun::star::awt::Size > pRefSize =
::std::auto_ptr< ::com::sun::star::awt::Size >() );
virtual ~AxisItemConverter();
@@ -81,8 +80,8 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartDoc;
- ::com::sun::star::chart2::ExplicitScaleData * m_pExplicitScale;
- ::com::sun::star::chart2::ExplicitIncrementData * m_pExplicitIncrement;
+ ExplicitScaleData* m_pExplicitScale;
+ ExplicitIncrementData* m_pExplicitIncrement;
};
} // namespace wrapper
diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx
index d738cf8f6245..c5072e26f648 100644
--- a/chart2/source/controller/inc/DataPointItemConverter.hxx
+++ b/chart2/source/controller/inc/DataPointItemConverter.hxx
@@ -29,7 +29,7 @@
#include "ItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/awt/Size.hpp>
diff --git a/chart2/source/controller/inc/ErrorBarItemConverter.hxx b/chart2/source/controller/inc/ErrorBarItemConverter.hxx
index 9dffde68cd5b..484458a63a84 100755
--- a/chart2/source/controller/inc/ErrorBarItemConverter.hxx
+++ b/chart2/source/controller/inc/ErrorBarItemConverter.hxx
@@ -29,7 +29,7 @@
#include "ItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/chart2/source/controller/inc/StatisticsItemConverter.hxx b/chart2/source/controller/inc/StatisticsItemConverter.hxx
index cb4227185093..cb706e92cc97 100644
--- a/chart2/source/controller/inc/StatisticsItemConverter.hxx
+++ b/chart2/source/controller/inc/StatisticsItemConverter.hxx
@@ -31,7 +31,7 @@
#include "ItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <vector>
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index 8cf07aabad08..b1f861461817 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -38,12 +38,14 @@
#include "ChartModelHelper.hxx"
#include "AxisHelper.hxx"
#include "CommonConverters.hxx"
+#include "ChartTypeHelper.hxx"
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/AxisOrientation.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
// for SfxBoolItem
#include <svl/eitem.hxx>
@@ -58,6 +60,8 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
+using ::com::sun::star::chart::TimeInterval;
+using ::com::sun::star::chart::TimeIncrement;
namespace
{
@@ -65,13 +69,13 @@ namespace
{
static ::comphelper::ItemPropertyMapType aAxisPropertyMap(
::comphelper::MakeItemPropertyMap
- IPM_MAP_ENTRY( SCHATTR_AXIS_SHOWDESCR, "DisplayLabels", 0 )
- IPM_MAP_ENTRY( SCHATTR_AXIS_TICKS, "MajorTickmarks", 0 )
- IPM_MAP_ENTRY( SCHATTR_AXIS_HELPTICKS, "MinorTickmarks", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXT_ORDER, "ArrangeOrder", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXT_STACKED, "StackCharacters", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXTBREAK, "TextBreak", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXT_OVERLAP, "TextOverlap", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_SHOWDESCR, "DisplayLabels", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_TICKS, "MajorTickmarks", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_HELPTICKS, "MinorTickmarks", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_ORDER, "ArrangeOrder", 0 )
+ IPM_MAP_ENTRY( SCHATTR_TEXT_STACKED, "StackCharacters", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_BREAK, "TextBreak", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_OVERLAP, "TextOverlap", 0 )
);
return aAxisPropertyMap;
@@ -88,8 +92,8 @@ AxisItemConverter::AxisItemConverter(
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
const Reference< chart2::XChartDocument > & xChartDoc,
- chart2::ExplicitScaleData * pScale /* = NULL */,
- chart2::ExplicitIncrementData * pIncrement /* = NULL */,
+ ::chart::ExplicitScaleData * pScale /* = NULL */,
+ ::chart::ExplicitIncrementData * pIncrement /* = NULL */,
::std::auto_ptr< awt::Size > pRefSize /* = NULL */ ) :
ItemConverter( rPropertySet, rItemPool ),
m_xChartDoc( xChartDoc ),
@@ -99,9 +103,9 @@ AxisItemConverter::AxisItemConverter(
Reference< lang::XMultiServiceFactory > xNamedPropertyContainerFactory( xChartDoc, uno::UNO_QUERY );
if( pScale )
- m_pExplicitScale = new chart2::ExplicitScaleData( *pScale );
+ m_pExplicitScale = new ::chart::ExplicitScaleData( *pScale );
if( pIncrement )
- m_pExplicitIncrement = new chart2::ExplicitIncrementData( *pIncrement );
+ m_pExplicitIncrement = new ::chart::ExplicitIncrementData( *pIncrement );
m_aConverters.push_back( new GraphicPropertyItemConverter(
rPropertySet, rItemPool, rDrawModel,
@@ -162,30 +166,40 @@ bool AxisItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWit
return true;
}
+bool lcl_hasTimeIntervalValue( const uno::Any& rAny )
+{
+ bool bRet = false;
+ TimeInterval aValue;
+ if( rAny >>= aValue )
+ bRet = true;
+ return bRet;
+}
+
void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
- if( ! m_xAxis.is() )
+ if( !m_xAxis.is() )
return;
- const chart2::ScaleData aScale( m_xAxis->getScaleData() );
- const chart2::IncrementData aInc( aScale.IncrementData );
- const uno::Sequence< chart2::SubIncrement > aSubIncs( aScale.IncrementData.SubIncrements );
+ const chart2::ScaleData& rScale( m_xAxis->getScaleData() );
+ const chart2::IncrementData& rIncrement( rScale.IncrementData );
+ const uno::Sequence< chart2::SubIncrement >& rSubIncrements( rScale.IncrementData.SubIncrements );
+ const TimeIncrement& rTimeIncrement( rScale.TimeIncrement );
+ bool bDateAxis = (chart2::AxisType::DATE == rScale.AxisType);
+ if( m_pExplicitScale )
+ bDateAxis = (chart2::AxisType::DATE == m_pExplicitScale->AxisType);
switch( nWhichId )
{
case SCHATTR_AXIS_AUTO_MAX:
- // if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Maximum) ) );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Maximum) ) );
break;
case SCHATTR_AXIS_MAX:
{
double fMax = 10.0;
- if( aScale.Maximum >>= fMax )
- {
+ if( rScale.Maximum >>= fMax )
rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
- }
else
{
if( m_pExplicitScale )
@@ -196,106 +210,141 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS
break;
case SCHATTR_AXIS_AUTO_MIN:
- // if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Minimum) ) );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Minimum) ) );
break;
case SCHATTR_AXIS_MIN:
{
double fMin = 0.0;
- if( aScale.Minimum >>= fMin )
- {
+ if( rScale.Minimum >>= fMin )
rOutItemSet.Put( SvxDoubleItem( fMin, nWhichId ) );
- }
- else
- {
- if( m_pExplicitScale )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
- }
+ else if( m_pExplicitScale )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
}
break;
case SCHATTR_AXIS_LOGARITHM:
- {
- BOOL bValue = AxisHelper::isLogarithmic( aScale.Scaling );
- rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
- }
- break;
+ {
+ BOOL bValue = AxisHelper::isLogarithmic( rScale.Scaling );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
+ }
+ break;
case SCHATTR_AXIS_REVERSE:
- rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == aScale.Orientation) ));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == rScale.Orientation) ));
break;
// Increment
case SCHATTR_AXIS_AUTO_STEP_MAIN:
- // if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aInc.Distance) ) );
+ if( bDateAxis )
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MajorTimeInterval) ) );
+ else
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rIncrement.Distance) ) );
+ break;
+
+ case SCHATTR_AXIS_MAIN_TIME_UNIT:
+ {
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) );
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MajorTimeInterval.TimeUnit ) );
+ }
break;
case SCHATTR_AXIS_STEP_MAIN:
+ if( bDateAxis )
+ {
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SvxDoubleItem(aTimeInterval.Number, nWhichId ));
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->MajorTimeInterval.Number, nWhichId ));
+ }
+ else
{
double fDistance = 1.0;
- if( aInc.Distance >>= fDistance )
- {
+ if( rIncrement.Distance >>= fDistance )
rOutItemSet.Put( SvxDoubleItem(fDistance, nWhichId ));
- }
- else
- {
- if( m_pExplicitIncrement )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
- }
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
}
break;
// SubIncrement
case SCHATTR_AXIS_AUTO_STEP_HELP:
- {
- // if the any has no value => auto is on
- rOutItemSet.Put(
- SfxBoolItem(
- nWhichId,
- ! ( aSubIncs.getLength() > 0 &&
- aSubIncs[0].IntervalCount.hasValue() )));
- }
- break;
+ if( bDateAxis )
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MinorTimeInterval) ) );
+ else
+ rOutItemSet.Put( SfxBoolItem( nWhichId,
+ ! ( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue() )));
+ break;
+
+ case SCHATTR_AXIS_HELP_TIME_UNIT:
+ {
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) );
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.TimeUnit ) );
+ }
+ break;
case SCHATTR_AXIS_STEP_HELP:
- {
- if( aSubIncs.getLength() > 0 &&
- aSubIncs[0].IntervalCount.hasValue())
+ if( bDateAxis )
{
- OSL_ASSERT( aSubIncs[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG );
- rOutItemSet.Put(
- SfxInt32Item(
- nWhichId,
- *reinterpret_cast< const sal_Int32 * >(
- aSubIncs[0].IntervalCount.getValue()) ));
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.Number ));
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.Number ));
}
else
{
- if( m_pExplicitIncrement &&
- m_pExplicitIncrement->SubIncrements.getLength() > 0 )
+ if( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue())
+ {
+ OSL_ASSERT( rSubIncrements[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG );
+ rOutItemSet.Put( SfxInt32Item( nWhichId,
+ *reinterpret_cast< const sal_Int32 * >(
+ rSubIncrements[0].IntervalCount.getValue()) ));
+ }
+ else
{
- rOutItemSet.Put(
- SfxInt32Item(
- nWhichId,
- m_pExplicitIncrement->SubIncrements[0].IntervalCount ));
+ if( m_pExplicitIncrement && !m_pExplicitIncrement->SubIncrements.empty() )
+ {
+ rOutItemSet.Put( SfxInt32Item( nWhichId,
+ m_pExplicitIncrement->SubIncrements[0].IntervalCount ));
+ }
}
}
- }
- break;
+ break;
+
+ case SCHATTR_AXIS_AUTO_TIME_RESOLUTION:
+ {
+ rOutItemSet.Put( SfxBoolItem( nWhichId,
+ !rTimeIncrement.TimeResolution.hasValue() ));
+ }
+ break;
+ case SCHATTR_AXIS_TIME_RESOLUTION:
+ {
+ long nTimeResolution=0;
+ if( rTimeIncrement.TimeResolution >>= nTimeResolution )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, nTimeResolution ) );
+ else if( m_pExplicitScale )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitScale->TimeResolution ) );
+ }
+ break;
case SCHATTR_AXIS_AUTO_ORIGIN:
{
- // if the any has no double value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(aScale.Origin) )));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(rScale.Origin) )));
}
break;
case SCHATTR_AXIS_ORIGIN:
{
double fOrigin = 0.0;
- if( !(aScale.Origin >>= fOrigin) )
+ if( !(rScale.Origin >>= fOrigin) )
{
if( m_pExplicitScale )
fOrigin = m_pExplicitScale->Origin;
@@ -367,7 +416,6 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS
break;
case SID_ATTR_NUMBERFORMAT_VALUE:
-// case SCHATTR_AXIS_NUMFMT:
{
if( m_pExplicitScale )
{
@@ -391,11 +439,44 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS
break;
case SCHATTR_AXISTYPE:
- rOutItemSet.Put( SfxInt32Item( nWhichId, aScale.AxisType ));
+ rOutItemSet.Put( SfxInt32Item( nWhichId, rScale.AxisType ));
+ break;
+
+ case SCHATTR_AXIS_AUTO_DATEAXIS:
+ rOutItemSet.Put( SfxBoolItem( nWhichId, rScale.AutoDateAxis ));
+ break;
+
+ case SCHATTR_AXIS_ALLOW_DATEAXIS:
+ {
+ Reference< chart2::XCoordinateSystem > xCooSys(
+ AxisHelper::getCoordinateSystemOfAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ sal_Int32 nDimensionIndex=0; sal_Int32 nAxisIndex=0;
+ AxisHelper::getIndicesForAxis(m_xAxis, xCooSys, nDimensionIndex, nAxisIndex );
+ bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), 2, nDimensionIndex );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, bChartTypeAllowsDateAxis ));
+ }
break;
}
}
+bool lcl_isDateAxis( const SfxItemSet & rItemSet )
+{
+ sal_Int32 nAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( SCHATTR_AXISTYPE )).GetValue();//::com::sun::star::chart2::AxisType
+ return (chart2::AxisType::DATE == nAxisType);
+}
+
+bool lcl_isAutoMajor( const SfxItemSet & rItemSet )
+{
+ bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue();
+ return bRet;
+}
+
+bool lcl_isAutoMinor( const SfxItemSet & rItemSet )
+{
+ bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue();
+ return bRet;
+}
+
bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
@@ -502,23 +583,47 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
// Increment
case SCHATTR_AXIS_AUTO_STEP_MAIN:
- if( (static_cast< const SfxBoolItem & >(
- rItemSet.Get( nWhichId )).GetValue() ))
+ if( lcl_isAutoMajor(rItemSet) )
{
aScale.IncrementData.Distance.clear();
+ aScale.TimeIncrement.MajorTimeInterval.clear();
bSetScale = true;
}
// else SCHATTR_AXIS_STEP_MAIN must have some value
break;
+ case SCHATTR_AXIS_MAIN_TIME_UNIT:
+ if( !lcl_isAutoMajor(rItemSet) )
+ {
+ if( rItemSet.Get( nWhichId ).QueryValue( aValue ) )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval;
+ aValue >>= aTimeInterval.TimeUnit;
+ aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval );
+ bSetScale = true;
+ }
+ }
+ break;
+
case SCHATTR_AXIS_STEP_MAIN:
// only if auto if false
- if( ! (static_cast< const SfxBoolItem & >(
- rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue() ))
+ if( !lcl_isAutoMajor(rItemSet) )
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
-
- if( aScale.IncrementData.Distance != aValue )
+ if( lcl_isDateAxis(rItemSet) )
+ {
+ double fValue = 1.0;
+ if( aValue >>= fValue )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval;
+ aTimeInterval.Number = static_cast<double>(fValue);
+ aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval );
+ bSetScale = true;
+ }
+ }
+ else if( aScale.IncrementData.Distance != aValue )
{
aScale.IncrementData.Distance = aValue;
bSetScale = true;
@@ -528,35 +633,85 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
// SubIncrement
case SCHATTR_AXIS_AUTO_STEP_HELP:
- if( (static_cast< const SfxBoolItem & >(
- rItemSet.Get( nWhichId )).GetValue() ) &&
- aScale.IncrementData.SubIncrements.getLength() > 0 &&
- aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() )
+ if( lcl_isAutoMinor(rItemSet) )
{
- aScale.IncrementData.SubIncrements[0].IntervalCount.clear();
+ if( aScale.IncrementData.SubIncrements.getLength() > 0 &&
+ aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() )
+ {
+ aScale.IncrementData.SubIncrements[0].IntervalCount.clear();
+ bSetScale = true;
+ }
+ if( aScale.TimeIncrement.MinorTimeInterval.hasValue() )
+ {
+ aScale.TimeIncrement.MinorTimeInterval.clear();
bSetScale = true;
+ }
}
// else SCHATTR_AXIS_STEP_MAIN must have some value
break;
+ case SCHATTR_AXIS_HELP_TIME_UNIT:
+ if( !lcl_isAutoMinor(rItemSet) )
+ {
+ if( rItemSet.Get( nWhichId ).QueryValue( aValue ) )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval;
+ aValue >>= aTimeInterval.TimeUnit;
+ aScale.TimeIncrement.MinorTimeInterval = uno::makeAny( aTimeInterval );
+ bSetScale = true;
+ }
+ }
+ break;
+
case SCHATTR_AXIS_STEP_HELP:
- // only if auto if false
- if( ! (static_cast< const SfxBoolItem & >(
- rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue() ) &&
- aScale.IncrementData.SubIncrements.getLength() > 0 )
+ // only if auto is false
+ if( !lcl_isAutoMinor(rItemSet) )
+ {
+ rItemSet.Get( nWhichId ).QueryValue( aValue );
+ if( lcl_isDateAxis(rItemSet) )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval;
+ aValue >>= aTimeInterval.Number;
+ aScale.TimeIncrement.MinorTimeInterval = uno::makeAny(aTimeInterval);
+ bSetScale = true;
+ }
+ else if( aScale.IncrementData.SubIncrements.getLength() > 0 )
+ {
+ if( ! aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() ||
+ aScale.IncrementData.SubIncrements[0].IntervalCount != aValue )
+ {
+ OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG );
+ aScale.IncrementData.SubIncrements[0].IntervalCount = aValue;
+ bSetScale = true;
+ }
+ }
+ }
+ break;
+
+ case SCHATTR_AXIS_AUTO_TIME_RESOLUTION:
+ if( (static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue() ))
+ {
+ aScale.TimeIncrement.TimeResolution.clear();
+ bSetScale = true;
+ }
+ break;
+ case SCHATTR_AXIS_TIME_RESOLUTION:
+ // only if auto is false
+ if( ! (static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_TIME_RESOLUTION )).GetValue() ))
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
- if( ! aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() ||
- aScale.IncrementData.SubIncrements[0].IntervalCount != aValue )
+ if( aScale.TimeIncrement.TimeResolution != aValue )
{
- OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG );
- aScale.IncrementData.SubIncrements[0].IntervalCount = aValue;
+ aScale.TimeIncrement.TimeResolution = aValue;
bSetScale = true;
}
}
break;
+
case SCHATTR_AXIS_AUTO_ORIGIN:
{
if( (static_cast< const SfxBoolItem & >(
@@ -757,7 +912,6 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
break;
case SID_ATTR_NUMBERFORMAT_VALUE:
-// case SCHATTR_AXIS_NUMFMT:
{
if( m_pExplicitScale )
{
@@ -821,7 +975,23 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
break;
case SCHATTR_AXISTYPE:
- //don't allow to change the axis type so far
+ {
+ sal_Int32 nNewAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();//::com::sun::star::chart2::AxisType
+ aScale.AxisType = nNewAxisType;
+ bSetScale = true;
+ }
+ break;
+
+ case SCHATTR_AXIS_AUTO_DATEAXIS:
+ {
+ bool bNewValue = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue();
+ bool bOldValue = aScale.AutoDateAxis;
+ if( bOldValue != bNewValue )
+ {
+ aScale.AutoDateAxis = bNewValue;
+ bSetScale = true;
+ }
+ }
break;
}
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
index f7ddeb42c11e..139283b92e23 100644
--- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
+++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
@@ -45,8 +45,7 @@ namespace
const USHORT nTitleWhichPairs[] =
{
- SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx
SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx
@@ -60,24 +59,17 @@ const USHORT nAxisWhichPairs[] =
CHARACTER_WHICHPAIRS,
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, // 10585 - 10585 svx/svxids.hrc
SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, // 11432 svx/svxids.hrc
- SCHATTR_AXISTYPE, SCHATTR_AXISTYPE, // 39 sch/schattr.hxx
- SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
- SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx
- SCHATTR_AXIS_START, SCHATTR_AXIS_END, // 70 - 95 sch/schattr.hxx
- SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx
+ SCHATTR_AXIS_START, SCHATTR_AXIS_END,
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
const USHORT nAllAxisWhichPairs[] =
{
- XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
+ XATTR_LINE_FIRST, XATTR_LINE_LAST,
CHARACTER_WHICHPAIRS,
- SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
- SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx
- SCHATTR_AXIS_SHOWDESCR, SCHATTR_AXIS_SHOWDESCR, // 85 sch/schattr.hxx
- SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx
+ SCHATTR_AXIS_LABEL_START, SCHATTR_AXIS_LABEL_END,
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
@@ -102,8 +94,6 @@ const USHORT nDataLabelWhichPairs[] =
SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END,
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, /* 10585 - 10585 svx/svxids.hrc */ \
SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432 svx/svxids.hrc */ \
- SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, /* 40 sch/schattr.hxx*/ \
- SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /* 41 sch/schattr.hxx*/ \
SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES,
EE_PARA_WRITINGDIR,EE_PARA_WRITINGDIR,
0
@@ -117,8 +107,6 @@ const USHORT nDataLabelWhichPairs[] =
SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END, /* 1 - 2 sch/schattr.hxx*/ \
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, /* 10585 - 10585 svx/svxids.hrc */ \
SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432 svx/svxids.hrc */ \
- SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, /* 40 sch/schattr.hxx*/ \
- SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /* 41 sch/schattr.hxx*/ \
SCHATTR_TEXT_DEGREES, SCHATTR_TEXT_DEGREES, \
SCHATTR_STYLE_START,SCHATTR_STYLE_END, /* 59 - 68 sch/schattr.hxx*/ \
SCHATTR_SYMBOL_BRUSH,SCHATTR_SYMBOL_BRUSH, /* 94 sch/schattr.hxx*/ \
@@ -165,16 +153,14 @@ const USHORT nAreaWhichPairs[] =
const USHORT nTextWhichPairs[] =
{
CHARACTER_WHICHPAIRS,
- SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
const USHORT nTextOrientWhichPairs[] =
{
CHARACTER_WHICHPAIRS,
- SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 675bcf40e7a2..ac3ef57a1bd9 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -49,17 +49,15 @@
#include "macros.hxx"
#include "dlg_CreationWizard.hxx"
#include "dlg_ChartType.hxx"
-//#include "svx/ActionDescriptionProvider.hxx"
#include "AccessibleChartView.hxx"
#include "DrawCommandDispatch.hxx"
#include "ShapeController.hxx"
-#include "UndoManager.hxx"
+#include "UndoActions.hxx"
#include <comphelper/InlineContainer.hxx>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XUndoSupplier.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/util/XCloneable.hpp>
@@ -67,6 +65,8 @@
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+#include <com/sun/star/document/XUndoAction.hpp>
//-------
// header for define RET_OK
@@ -86,6 +86,7 @@
// object in the DTOR
#include <svtools/acceleratorexecute.hxx>
#include <svx/ActionDescriptionProvider.hxx>
+#include <tools/diagnose_ex.h>
// enable the following define to let the controller listen to model changes and
// react on this by rebuilding the view
@@ -133,7 +134,6 @@ ChartController::ChartController(uno::Reference<uno::XComponentContext> const &
, m_eDrawMode( CHARTDRAW_SELECT )
{
DBG_CTOR(ChartController,NULL);
-// m_aDispatchContainer.setUndoManager( m_xUndoManager );
m_aDoubleClickTimer.SetTimeoutHdl( LINK( this, ChartController, DoubleClickWaitingHdl ) );
}
@@ -622,9 +622,8 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
m_pChartWindow->Invalidate();
}
- uno::Reference< chart2::XUndoSupplier > xUndoSupplier( getModel(), uno::UNO_QUERY );
- if( xUndoSupplier.is())
- m_xUndoManager.set( xUndoSupplier->getUndoManager());
+ uno::Reference< document::XUndoManagerSupplier > xSuppUndo( getModel(), uno::UNO_QUERY_THROW );
+ m_xUndoManager.set( xSuppUndo->getUndoManager(), uno::UNO_QUERY_THROW );
return sal_True;
}
@@ -1335,7 +1334,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType()
{
// using assignment for broken gcc 3.3
UndoLiveUpdateGuard aUndoGuard = UndoLiveUpdateGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_CHARTTYPE ))), m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_EDIT_CHARTTYPE )), m_xUndoManager );
// /--
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
@@ -1344,7 +1343,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType()
if( aDlg.Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
// \--
}
@@ -1360,7 +1359,7 @@ void SAL_CALL ChartController::executeDispatch_SourceData()
// using assignment for broken gcc 3.3
UndoLiveUpdateGuard aUndoGuard = UndoLiveUpdateGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_DATA_RANGES ))), m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_EDIT_DATA_RANGES )), m_xUndoManager );
if( xChartDoc.is())
{
// /--
@@ -1369,7 +1368,7 @@ void SAL_CALL ChartController::executeDispatch_SourceData()
if( aDlg.Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
// \--
}
@@ -1387,14 +1386,14 @@ void SAL_CALL ChartController::executeDispatch_MoveSeries( sal_Bool bForward )
UndoGuardWithSelection aUndoGuard(
ActionDescriptionProvider::createDescription(
(bForward ? ActionDescriptionProvider::MOVE_TOTOP : ActionDescriptionProvider::MOVE_TOBOTTOM),
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATASERIES )))),
- m_xUndoManager, getModel());
+ String( SchResId( STR_OBJECT_DATASERIES ))),
+ m_xUndoManager );
bool bChanged = DiagramHelper::moveSeries( ChartModelHelper::findDiagram( getModel() ), xGivenDataSeries, bForward );
if( bChanged )
{
m_aSelection.setSelection( ObjectIdentifier::getMovedSeriesCID( aObjectCID, bForward ) );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -1454,13 +1453,21 @@ void SAL_CALL ChartController::modified( const lang::EventObject& /* aEvent */ )
IMPL_LINK( ChartController, NotifyUndoActionHdl, SdrUndoAction*, pUndoAction )
{
+ ENSURE_OR_RETURN( pUndoAction, "invalid Undo action", 1L );
+
::rtl::OUString aObjectCID = m_aSelection.getSelectedCID();
if ( aObjectCID.getLength() == 0 )
{
- UndoManager* pUndoManager = UndoManager::getImplementation( m_xUndoManager );
- if ( pUndoManager )
+ try
+ {
+ const Reference< document::XUndoManagerSupplier > xSuppUndo( getModel(), uno::UNO_QUERY_THROW );
+ const Reference< document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), uno::UNO_QUERY_THROW );
+ const Reference< document::XUndoAction > xAction( new impl::ShapeUndoElement( *pUndoAction ) );
+ xUndoManager->addUndoAction( xAction );
+ }
+ catch( const uno::Exception& )
{
- pUndoManager->addShapeUndoAction( pUndoAction );
+ DBG_UNHANDLED_EXCEPTION();
}
}
return 0L;
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index f2b64eb7a9c5..7c06a4ad4ca2 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -42,7 +42,7 @@
#include <cppuhelper/implbase12.hxx>
#include <com/sun/star/accessibility/XAccessible.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
+#include <com/sun/star/document/XUndoManager.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -89,6 +89,8 @@ namespace chart
{
//.............................................................................
+class UndoGuard;
+
enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT };
class WindowController
@@ -578,7 +580,8 @@ private:
bool volatile m_bConnectingToView;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+ ::std::auto_ptr< UndoGuard > m_pTextActionUndoGuard;
/// needed for dispatching URLs in FeatureStateEvents
mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx
index 0248732a63a7..7c9bfe0c3986 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -66,12 +66,12 @@ void ChartController::executeDispatch_EditData()
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
// using assignment for broken gcc 3.3
UndoLiveUpdateGuardWithData aUndoGuard = UndoLiveUpdateGuardWithData(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_CHART_DATA ))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_EDIT_CHART_DATA )),
+ m_xUndoManager );
DataEditor aDataEditorDialog( pParent, xChartDoc, m_xCC );
// the dialog has no OK/Cancel
aDataEditorDialog.Execute();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
// \--
}
}
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 0a7a4057ef9a..b6928ac99284 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -44,7 +44,7 @@
#include "DiagramHelper.hxx"
#include "macros.hxx"
#include "chartview/DrawModelWrapper.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "ViewElementListProvider.hxx"
#include "MultipleChartConverters.hxx"
#include "ControllerLockGuard.hxx"
@@ -121,8 +121,8 @@ void ChartController::executeDispatch_InsertAxes()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AXES )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AXES ))),
+ m_xUndoManager );
try
{
@@ -146,7 +146,7 @@ void ChartController::executeDispatch_InsertAxes()
, aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC
, mpRefSizeProvider.get() );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -159,8 +159,8 @@ void ChartController::executeDispatch_InsertGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRIDS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_GRIDS ))),
+ m_xUndoManager );
try
{
@@ -180,7 +180,7 @@ void ChartController::executeDispatch_InsertGrid()
bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram
, aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -196,8 +196,8 @@ void ChartController::executeDispatch_InsertTitles()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLES )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_TITLES ))),
+ m_xUndoManager );
try
{
@@ -214,7 +214,7 @@ void ChartController::executeDispatch_InsertTitles()
aDlg.getResult( aDialogOutput );
bool bChanged = aDialogOutput.writeDifferenceToModel( getModel(), m_xCC, &aDialogInput );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -227,30 +227,30 @@ void ChartController::executeDispatch_DeleteLegend()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
LegendHelper::hideLegend( getModel() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertLegend()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
Reference< chart2::XLegend > xLegend = LegendHelper::showLegend( getModel(), m_xCC );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_OpenLegendDialog()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
try
{
@@ -264,7 +264,7 @@ void ChartController::executeDispatch_OpenLegendDialog()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aDlg.writeToModel( getModel() );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -280,8 +280,8 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_DATALABELS ))),
+ m_xUndoManager );
//if a series is selected insert labels for that series only:
uno::Reference< chart2::XDataSeries > xSeries(
@@ -298,7 +298,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, true );
if( bSuccess )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
return;
}
@@ -330,7 +330,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -354,7 +354,7 @@ void ChartController::executeDispatch_InsertMenu_YErrorBars()
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::INSERT, ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_ERRORS ) ),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
try
{
@@ -380,7 +380,7 @@ void ChartController::executeDispatch_InsertMenu_YErrorBars()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -393,19 +393,19 @@ void ChartController::executeDispatch_InsertMeanValue()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
lcl_InsertMeanValueLine( m_xCC ).operator()(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertMenu_MeanValues()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
uno::Reference< chart2::XDataSeries > xSeries(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ), uno::UNO_QUERY );
@@ -420,7 +420,7 @@ void ChartController::executeDispatch_InsertMenu_MeanValues()
DiagramHelper::getDataSeriesFromDiagram( ChartModelHelper::findDiagram( getModel() )));
::std::for_each( aSeries.begin(), aSeries.end(), lcl_InsertMeanValueLine( m_xCC ));
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertMenu_Trendlines()
@@ -437,7 +437,7 @@ void ChartController::executeDispatch_InsertMenu_Trendlines()
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::INSERT, ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_CURVE ) ),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
try
{
@@ -460,7 +460,7 @@ void ChartController::executeDispatch_InsertMenu_Trendlines()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -477,8 +477,8 @@ void ChartController::executeDispatch_InsertTrendline()
{
UndoLiveUpdateGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE ))),
+ m_xUndoManager );
// add a linear curve
RegressionCurveHelper::addRegressionCurve(
@@ -518,7 +518,7 @@ void ChartController::executeDispatch_InsertTrendline()
ControllerLockGuard aCLGuard( getModel() );
aItemConverter.ApplyItemSet( *pOutItemSet );
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -531,8 +531,8 @@ void ChartController::executeDispatch_InsertYErrorBars()
{
UndoLiveUpdateGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_BARS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_ERROR_BARS ))),
+ m_xUndoManager );
// add error bars with standard deviation
uno::Reference< beans::XPropertySet > xErrorBarProp(
@@ -568,7 +568,7 @@ void ChartController::executeDispatch_InsertYErrorBars()
ControllerLockGuard aCLGuard( getModel() );
aItemConverter.ApplyItemSet( *pOutItemSet );
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -591,11 +591,11 @@ void ChartController::executeDispatch_InsertTrendlineEquation( bool bInsertR2 )
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
xEqProp->setPropertyValue( C2U("ShowEquation"), uno::makeAny( true ));
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( bInsertR2 ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -608,10 +608,10 @@ void ChartController::executeDispatch_InsertR2Value()
{
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( true ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -623,10 +623,10 @@ void ChartController::executeDispatch_DeleteR2Value()
{
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -638,10 +638,10 @@ void ChartController::executeDispatch_DeleteMeanValue()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
RegressionCurveHelper::removeMeanValueLine( xRegCurveCnt );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -653,10 +653,10 @@ void ChartController::executeDispatch_DeleteTrendline()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE ))),
+ m_xUndoManager );
RegressionCurveHelper::removeAllExceptMeanValueLine( xRegCurveCnt );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -668,10 +668,10 @@ void ChartController::executeDispatch_DeleteTrendlineEquation()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
RegressionCurveHelper::removeEquations( xRegCurveCnt );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -683,10 +683,10 @@ void ChartController::executeDispatch_DeleteYErrorBars()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE ))),
+ m_xUndoManager );
StatisticsHelper::removeErrorBars( xDataSeries );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -697,20 +697,20 @@ void ChartController::executeDispatch_InsertDataLabels()
if( xSeries.is() )
{
UndoGuard aUndoGuard = UndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::INSERT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATALABELS ))),
+ m_xUndoManager );
DataSeriesHelper::insertDataLabelsToSeriesAndAllPoints( xSeries );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
void ChartController::executeDispatch_InsertDataLabel()
{
UndoGuard aUndoGuard = UndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::INSERT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_LABEL )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_LABEL ))),
+ m_xUndoManager );
DataSeriesHelper::insertDataLabelToPoint( ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), getModel() ) );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_DeleteDataLabels()
@@ -720,44 +720,44 @@ void ChartController::executeDispatch_DeleteDataLabels()
if( xSeries.is() )
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::DELETE,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATALABELS ))),
+ m_xUndoManager );
DataSeriesHelper::deleteDataLabelsFromSeriesAndAllPoints( xSeries );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
void ChartController::executeDispatch_DeleteDataLabel()
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::DELETE,
- ::rtl::OUString( String( SchResId( STR_OBJECT_LABEL )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_LABEL ))),
+ m_xUndoManager );
DataSeriesHelper::deleteDataLabelsFromPoint( ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), getModel() ) );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_ResetAllDataPoints()
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::FORMAT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATAPOINTS )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATAPOINTS ))),
+ m_xUndoManager );
uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ), uno::UNO_QUERY );
if( xSeries.is() )
xSeries->resetAllDataPoints();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_ResetDataPoint()
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::FORMAT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATAPOINT )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATAPOINT ))),
+ m_xUndoManager );
uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ), uno::UNO_QUERY );
if( xSeries.is() )
{
sal_Int32 nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
xSeries->resetDataPoint( nPointIndex );
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertAxisTitle()
@@ -768,8 +768,8 @@ void ChartController::executeDispatch_InsertAxisTitle()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_TITLE ))),
+ m_xUndoManager );
Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getModel() );
sal_Int32 nDimensionIndex = -1;
@@ -787,7 +787,7 @@ void ChartController::executeDispatch_InsertAxisTitle()
::std::auto_ptr< ReferenceSizeProvider > apRefSizeProvider( impl_createReferenceSizeProvider());
xTitle = TitleHelper::createTitle( eTitleType, ObjectNameProvider::getTitleNameByType(eTitleType), getModel(), m_xCC, apRefSizeProvider.get() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
/*
@@ -809,8 +809,8 @@ void ChartController::executeDispatch_InsertAxis()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AXIS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AXIS ))),
+ m_xUndoManager );
try
{
@@ -818,7 +818,7 @@ void ChartController::executeDispatch_InsertAxis()
if( xAxis.is() )
{
AxisHelper::makeAxisVisible( xAxis );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -831,8 +831,8 @@ void ChartController::executeDispatch_DeleteAxis()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AXIS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_AXIS ))),
+ m_xUndoManager );
try
{
@@ -840,7 +840,7 @@ void ChartController::executeDispatch_DeleteAxis()
if( xAxis.is() )
{
AxisHelper::makeAxisInvisible( xAxis );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -853,8 +853,8 @@ void ChartController::executeDispatch_InsertMajorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -862,7 +862,7 @@ void ChartController::executeDispatch_InsertMajorGrid()
if( xAxis.is() )
{
AxisHelper::makeGridVisible( xAxis->getGridProperties() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -875,8 +875,8 @@ void ChartController::executeDispatch_DeleteMajorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -884,7 +884,7 @@ void ChartController::executeDispatch_DeleteMajorGrid()
if( xAxis.is() )
{
AxisHelper::makeGridInvisible( xAxis->getGridProperties() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -897,8 +897,8 @@ void ChartController::executeDispatch_InsertMinorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -908,7 +908,7 @@ void ChartController::executeDispatch_InsertMinorGrid()
Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
AxisHelper::makeGridVisible( aSubGrids[nN] );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -921,8 +921,8 @@ void ChartController::executeDispatch_DeleteMinorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -932,7 +932,7 @@ void ChartController::executeDispatch_DeleteMinorGrid()
Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
AxisHelper::makeGridInvisible( aSubGrids[nN] );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 619d308ffad2..ceb6877e64e9 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -139,7 +139,7 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::POS_SIZE,
ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aCID ))),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
SfxAbstractTabDialog * pDlg = NULL;
try
@@ -174,7 +174,7 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
, awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
, awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
delete pDlg;
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 649b9cb62f9d..29f1bfa9f389 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -720,11 +720,11 @@ void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUStrin
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::FORMAT,
ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, false );
if( bSuccess )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( const ::rtl::OUString& rObjectCID, bool bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso )
@@ -838,15 +838,15 @@ void SAL_CALL ChartController::executeDispatch_View3D()
{
// using assignment for broken gcc 3.3
UndoLiveUpdateGuard aUndoGuard = UndoLiveUpdateGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_3D_VIEW ))),
- m_xUndoManager, getModel());
+ String( SchResId( STR_ACTION_EDIT_3D_VIEW )),
+ m_xUndoManager );
// /--
//open dialog
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorTable() );
if( aDlg.Execute() == RET_OK )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
// \--
}
catch( uno::RuntimeException& e)
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 6091fd8ef3f8..9354c911ad67 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -29,6 +29,8 @@
#include "precompiled_chart2.hxx"
#include "ChartController.hxx"
+#include "ResId.hxx"
+#include "UndoGuard.hxx"
#include "DrawViewWrapper.hxx"
#include "ChartWindow.hxx"
#include "TitleHelper.hxx"
@@ -36,6 +38,7 @@
#include "macros.hxx"
#include "ControllerLockGuard.hxx"
#include "AccessibleTextHelper.hxx"
+#include "Strings.hrc"
#include "chartview/DrawModelWrapper.hxx"
#include <svx/svdotext.hxx>
@@ -81,7 +84,9 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
if(!pTextObj)
return;
- m_xUndoManager->preAction( getModel());
+ OSL_PRECOND( !m_pTextActionUndoGuard.get(), "ChartController::StartTextEdit: already have a TextUndoGuard!?" );
+ m_pTextActionUndoGuard.reset( new UndoGuard(
+ String( SchResId( STR_ACTION_EDIT_TEXT ) ), m_xUndoManager ) );
SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
//pOutliner->SetRefDevice(m_pChartWindow);
//pOutliner->SetStyleSheetPool((SfxStyleSheetPool*)pStyleSheetPool);
@@ -165,26 +170,11 @@ bool ChartController::EndTextEdit()
TitleHelper::setCompleteString( aString, uno::Reference<
::com::sun::star::chart2::XTitle >::query( xPropSet ), m_xCC );
- try
- {
- m_xUndoManager->postAction( C2U("Edit Text") );
- }
- catch( uno::RuntimeException& e)
- {
- ASSERT_EXCEPTION( e );
- }
- }
- else
- {
- try
- {
- m_xUndoManager->cancelAction();
- }
- catch ( uno::RuntimeException& e )
- {
- ASSERT_EXCEPTION( e );
- }
+ OSL_ENSURE( m_pTextActionUndoGuard.get(), "ChartController::EndTextEdit: no TextUndoGuard!" );
+ if ( m_pTextActionUndoGuard.get() )
+ m_pTextActionUndoGuard->commit();
}
+ m_pTextActionUndoGuard.reset();
}
return true;
}
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 735cb9634671..945ccf4b4b34 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -102,7 +102,7 @@ namespace
bool lcl_deleteDataSeries(
const OUString & rCID,
const Reference< frame::XModel > & xModel,
- const Reference< chart2::XUndoManager > & xUndoManager )
+ const Reference< document::XUndoManager > & xUndoManager )
{
bool bResult = false;
uno::Reference< chart2::XDataSeries > xSeries( ::chart::ObjectIdentifier::getDataSeriesForCID( rCID, xModel ));
@@ -115,8 +115,8 @@ bool lcl_deleteDataSeries(
{
::chart::UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( ::chart::SchResId( STR_OBJECT_DATASERIES )))),
- xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( ::chart::SchResId( STR_OBJECT_DATASERIES ))),
+ xUndoManager );
Reference< chart2::XDiagram > xDiagram( ::chart::ChartModelHelper::findDiagram( xModel ) );
uno::Reference< chart2::XAxis > xAxis( ::chart::DiagramHelper::getAttachedAxis( xSeries, xDiagram ) );
@@ -126,7 +126,7 @@ bool lcl_deleteDataSeries(
::chart::AxisHelper::hideAxisIfNoDataIsAttached( xAxis, xDiagram );
bResult = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
return bResult;
@@ -135,7 +135,7 @@ bool lcl_deleteDataSeries(
bool lcl_deleteDataCurve(
const OUString & rCID,
const Reference< frame::XModel > & xModel,
- const Reference< chart2::XUndoManager > & xUndoManager )
+ const Reference< document::XUndoManager > & xUndoManager )
{
bool bResult = false;
uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
@@ -145,11 +145,11 @@ bool lcl_deleteDataCurve(
{
::chart::UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( ::chart::SchResId( STR_OBJECT_CURVE )))),
- xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( ::chart::SchResId( STR_OBJECT_CURVE ))),
+ xUndoManager );
::chart::RegressionCurveHelper::removeAllExceptMeanValueLine( xRegCurveCnt );
bResult = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
return bResult;
}
@@ -235,8 +235,8 @@ void ChartController::executeDispatch_NewArrangement()
{
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_REARRANGE_CHART ))),
- m_xUndoManager, xModel );
+ String( SchResId( STR_ACTION_REARRANGE_CHART )),
+ m_xUndoManager );
ControllerLockGuard aCtlLockGuard( xModel );
// diagram
@@ -271,7 +271,7 @@ void ChartController::executeDispatch_NewArrangement()
::std::for_each( aRegressionCurves.begin(), aRegressionCurves.end(),
RegressionCurveHelper::resetEquationPosition );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException & ex )
@@ -285,14 +285,14 @@ void ChartController::executeDispatch_ScaleText()
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_SCALE_TEXT ))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_SCALE_TEXT )),
+ m_xUndoManager );
ControllerLockGuard aCtlLockGuard( getModel() );
::std::auto_ptr< ReferenceSizeProvider > apRefSizeProv( impl_createReferenceSizeProvider());
OSL_ASSERT( apRefSizeProv.get());
if( apRefSizeProv.get())
apRefSizeProv->toggleAutoResizeState();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_Paste()
@@ -655,12 +655,12 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLE )))),
- m_xUndoManager, getModel());
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_TITLE ))),
+ m_xUndoManager );
TitleHelper::removeTitle(
ObjectIdentifier::getTitleTypeForCID( aCID ), getModel() );
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
break;
}
case OBJECTTYPE_LEGEND:
@@ -674,11 +674,11 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
xLegendProp->setPropertyValue( C2U("Show"), uno::makeAny( false ));
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
break;
@@ -709,11 +709,11 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
RegressionCurveHelper::removeMeanValueLine( xRegCurveCnt );
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -732,15 +732,15 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
{
ControllerLockGuard aCtlLockGuard( xModel );
xEqProp->setPropertyValue( C2U("ShowEquation"), uno::makeAny( false ));
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
}
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -755,8 +755,8 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_BARS )))),
- m_xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_ERROR_BARS ))),
+ m_xUndoManager );
{
ControllerLockGuard aCtlLockGuard( xModel );
xErrorBarProp->setPropertyValue(
@@ -764,7 +764,7 @@ bool ChartController::executeDispatch_Delete()
uno::makeAny( ::com::sun::star::chart::ErrorBarStyle::NONE ));
}
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -780,7 +780,7 @@ bool ChartController::executeDispatch_Delete()
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::DELETE, ::rtl::OUString( String(
SchResId( aObjectType == OBJECTTYPE_DATA_LABEL ? STR_OBJECT_LABEL : STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
chart2::DataPointLabel aLabel;
xObjectProperties->getPropertyValue( C2U( "Label" ) ) >>= aLabel;
aLabel.ShowNumber = false;
@@ -795,7 +795,7 @@ bool ChartController::executeDispatch_Delete()
else
xObjectProperties->setPropertyValue( C2U( "Label" ), uno::makeAny(aLabel) );
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -844,7 +844,7 @@ void ChartController::executeDispatch_ToggleLegend()
{
Reference< frame::XModel > xModel( getModel() );
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_TOGGLE_LEGEND ))), m_xUndoManager, xModel );
+ String( SchResId( STR_ACTION_TOGGLE_LEGEND )), m_xUndoManager );
Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend( xModel ), uno::UNO_QUERY );
bool bChanged = false;
if( xLegendProp.is())
@@ -871,14 +871,14 @@ void ChartController::executeDispatch_ToggleLegend()
}
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_ToggleGridHorizontal()
{
Reference< frame::XModel > xModel( getModel() );
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_TOGGLE_GRID_HORZ ))), m_xUndoManager, xModel );
+ String( SchResId( STR_ACTION_TOGGLE_GRID_HORZ )), m_xUndoManager );
Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( getModel() ));
if( xDiagram.is())
{
@@ -893,7 +893,7 @@ void ChartController::executeDispatch_ToggleGridHorizontal()
else
AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, bIsMainGrid, xDiagram, m_xCC );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -911,9 +911,9 @@ void ChartController::impl_switchDiagramPositioningToExcludingPositioning()
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::POS_SIZE,
ObjectNameProvider::getName( OBJECTTYPE_DIAGRAM)),
- m_xUndoManager, m_aModel->getModel() );
+ m_xUndoManager );
if( DiagramHelper::switchDiagramPositioningToExcludingPositioning( m_aModel->getModel(), true, true ) )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
} // namespace chart
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 885e37126dc2..0a81048d771b 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -801,7 +801,11 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if ( m_eDrawMode == CHARTDRAW_INSERT && pDrawViewWrapper->IsCreateObj() )
{
pDrawViewWrapper->EndCreateObj( SDRCREATE_FORCEEND );
- impl_switchDiagramPositioningToExcludingPositioning();
+ {
+ HiddenUndoContext aUndoContext( m_xUndoManager );
+ // don't want the positioning Undo action to appear in the UI
+ impl_switchDiagramPositioningToExcludingPositioning();
+ }
if ( pDrawViewWrapper->AreObjectsMarked() )
{
if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT )
@@ -838,12 +842,12 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if( pChartDragMethod )
{
UndoGuard aUndoGuard( pChartDragMethod->getUndoDescription(),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
if( pDrawViewWrapper->EndDragObj(false) )
{
bDraggingDone = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -871,7 +875,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
ActionDescriptionProvider::createDescription(
eActionType,
ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() ))),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
bool bChanged = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
, getModel()
, awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
@@ -879,7 +883,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if( bChanged )
{
bDraggingDone = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -1832,7 +1836,7 @@ bool ChartController::impl_moveOrResizeObject(
ObjectType eObjectType = ObjectIdentifier::getObjectType( rCID );
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
- eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager, xChartModel );
+ eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager );
{
ControllerLockGuard aCLGuard( xChartModel );
if( bNeedShift )
@@ -1840,7 +1844,7 @@ bool ChartController::impl_moveOrResizeObject(
if( bNeedResize || (eObjectType == OBJECTTYPE_DIAGRAM) )//Also set an explicat size at the diagram when an explicit position is set
xObjProp->setPropertyValue( C2U("RelativeSize"), uno::makeAny( aRelSize ));
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
return bResult;
diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx b/chart2/source/controller/main/ChartDropTargetHelper.cxx
index 8749ca1bc062..fd7dc3ad1744 100644
--- a/chart2/source/controller/main/ChartDropTargetHelper.cxx
+++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx
@@ -137,58 +137,47 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
// parent)
if( bDataComesFromParent )
{
+ Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
Reference< chart2::data::XDataProvider > xDataProvider( m_xChartDocument->getDataProvider());
- if( xDataProvider.is() &&
+ if( xDataProvider.is() && xDiagram.is() &&
DataSourceHelper::allArgumentsForRectRangeDetected( m_xChartDocument ))
{
- DiagramHelper::tTemplateWithServiceName aTempWithServ(
- DiagramHelper::getTemplateForDiagram(
- m_xChartDocument->getFirstDiagram(),
- Reference< lang::XMultiServiceFactory >(
- m_xChartDocument->getChartTypeManager(), uno::UNO_QUERY )));
- if( aTempWithServ.first.is())
+ Reference< chart2::data::XDataSource > xDataSource(
+ DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
+ Sequence< beans::PropertyValue > aArguments(
+ xDataProvider->detectArguments( xDataSource ));
+
+ OUString aOldRange;
+ beans::PropertyValue * pCellRange = 0;
+ for( sal_Int32 i=0; i<aArguments.getLength(); ++i )
{
- Reference< chart2::data::XDataSource > xDataSource(
- DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
- Sequence< beans::PropertyValue > aArguments(
- xDataProvider->detectArguments( xDataSource ));
-
- OUString aOldRange;
- beans::PropertyValue * pCellRange = 0;
- for( sal_Int32 i=0; i<aArguments.getLength(); ++i )
+ if( aArguments[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("CellRangeRepresentation")))
{
- if( aArguments[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("CellRangeRepresentation")))
- {
- pCellRange = (aArguments.getArray() + i);
- aArguments[i].Value >>= aOldRange;
- break;
- }
+ pCellRange = (aArguments.getArray() + i);
+ aArguments[i].Value >>= aOldRange;
+ break;
}
- if( pCellRange )
+ }
+ if( pCellRange )
+ {
+ // copy means add ranges, move means replace
+ if( rEvt.mnAction == DND_ACTION_COPY )
+ {
+ // @todo: using implcit knowledge that ranges can be
+ // merged with ";". This should be done more general
+ pCellRange->Value <<= (aOldRange + OUString( sal_Unicode(';')) + aRangeString );
+ }
+ // move means replace range
+ else
{
- // copy means add ranges, move means replace
- if( rEvt.mnAction == DND_ACTION_COPY )
- {
- // @todo: using implcit knowledge that ranges can be
- // merged with ";". This should be done more general
- pCellRange->Value <<= (aOldRange + OUString( sal_Unicode(';')) + aRangeString );
- }
- // move means replace range
- else
- {
- pCellRange->Value <<= aRangeString;
- }
-
- xDataSource.set( xDataProvider->createDataSource( aArguments ));
- aTempWithServ.first->changeDiagramData(
- m_xChartDocument->getFirstDiagram(),
- xDataSource,
- aArguments );
-
- // always return copy state to avoid deletion of the
- // dragged range
- nResult = DND_ACTION_COPY;
+ pCellRange->Value <<= aRangeString;
}
+
+ xDataSource.set( xDataProvider->createDataSource( aArguments ));
+ xDiagram->setDiagramData( xDataSource, aArguments );
+
+ // always return copy state to avoid deletion of the dragged range
+ nResult = DND_ACTION_COPY;
}
}
}
diff --git a/chart2/source/controller/main/ChartModelClone.cxx b/chart2/source/controller/main/ChartModelClone.cxx
new file mode 100755
index 000000000000..69991eb081df
--- /dev/null
+++ b/chart2/source/controller/main/ChartModelClone.cxx
@@ -0,0 +1,280 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_chart2.hxx"
+
+#include "ChartModelClone.hxx"
+#include "ChartModelHelper.hxx"
+#include "ControllerLockGuard.hxx"
+#include "DataSourceHelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/chart2/XTitled.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/chart2/data/XDataSource.hpp>
+#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/property.hxx>
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::frame::XModel;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::chart2::XChartDocument;
+ using ::com::sun::star::chart2::XInternalDataProvider;
+ using ::com::sun::star::chart2::XAnyDescriptionAccess;
+ using ::com::sun::star::view::XSelectionSupplier;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::chart2::XTitled;
+ using ::com::sun::star::util::XModifiable;
+ using ::com::sun::star::chart2::data::XDataSource;
+ using ::com::sun::star::chart2::data::XLabeledDataSequence;
+ /** === end UNO using === **/
+
+ // =================================================================================================================
+ // = helper
+ // =================================================================================================================
+ namespace
+ {
+ Reference< XModel > lcl_cloneModel( const Reference< XModel > & xModel )
+ {
+ Reference< XModel > xResult;
+ try
+ {
+ const Reference< XCloneable > xCloneable( xModel, UNO_QUERY_THROW );
+ xResult.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return xResult;
+ }
+
+ }
+
+ // =================================================================================================================
+ // = ChartModelClone
+ // =================================================================================================================
+ // -----------------------------------------------------------------------------------------------------------------
+ ChartModelClone::ChartModelClone( const Reference< XModel >& i_model, const ModelFacet i_facet )
+ {
+ m_xModelClone.set( lcl_cloneModel( i_model ) );
+
+ try
+ {
+ if ( i_facet == E_MODEL_WITH_DATA )
+ {
+ const Reference< XChartDocument > xChartDoc( m_xModelClone, UNO_QUERY_THROW );
+ ENSURE_OR_THROW( xChartDoc->hasInternalDataProvider(), "invalid chart model" );
+
+ const Reference< XCloneable > xCloneable( xChartDoc->getDataProvider(), UNO_QUERY_THROW );
+ m_xDataClone.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+
+ if ( i_facet == E_MODEL_WITH_SELECTION )
+ {
+ const Reference< XSelectionSupplier > xSelSupp( m_xModelClone->getCurrentController(), UNO_QUERY_THROW );
+ m_aSelection = xSelSupp->getSelection();
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+
+ // -----------------------------------------------------------------------------------------------------------------
+ ChartModelClone::~ChartModelClone()
+ {
+ if ( !impl_isDisposed() )
+ dispose();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void ChartModelClone::dispose()
+ {
+ if ( impl_isDisposed() )
+ return;
+
+ try
+ {
+ Reference< XComponent > xComp( m_xModelClone, UNO_QUERY_THROW );
+ xComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ m_xModelClone.clear();
+ m_xDataClone.clear();
+ m_aSelection.clear();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ ModelFacet ChartModelClone::getFacet() const
+ {
+ if ( m_aSelection.hasValue() )
+ return E_MODEL_WITH_SELECTION;
+ if ( m_xDataClone.is() )
+ return E_MODEL_WITH_DATA;
+ return E_MODEL;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void ChartModelClone::applyToModel( const Reference< XModel >& i_model ) const
+ {
+ applyModelContentToModel( i_model, m_xModelClone, m_xDataClone );
+
+ if ( m_aSelection.hasValue() )
+ {
+ try
+ {
+ Reference< XSelectionSupplier > xCurrentSelectionSuppl( i_model->getCurrentController(), UNO_QUERY_THROW );
+ xCurrentSelectionSuppl->select( m_aSelection );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ void ImplApplyDataToModel( const Reference< XModel >& i_model, const Reference< XInternalDataProvider > & i_data )
+ {
+ Reference< XChartDocument > xDoc( i_model, UNO_QUERY );
+ OSL_ASSERT( xDoc.is() && xDoc->hasInternalDataProvider() );
+
+ // copy data from stored internal data provider
+ if( xDoc.is() && xDoc->hasInternalDataProvider())
+ {
+ Reference< XAnyDescriptionAccess > xCurrentData( xDoc->getDataProvider(), UNO_QUERY );
+ Reference< XAnyDescriptionAccess > xSavedData( i_data, UNO_QUERY );
+ if ( xCurrentData.is() && xSavedData.is() )
+ {
+ xCurrentData->setData( xSavedData->getData() );
+ xCurrentData->setAnyRowDescriptions( xSavedData->getAnyRowDescriptions());
+ xCurrentData->setAnyColumnDescriptions( xSavedData->getAnyColumnDescriptions());
+ }
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void ChartModelClone::applyModelContentToModel( const Reference< XModel >& i_model,
+ const Reference< XModel >& i_modelToCopyFrom, const Reference< XInternalDataProvider >& i_data )
+ {
+ ENSURE_OR_RETURN_VOID( i_model.is(), "ChartModelElement::applyModelContentToModel: invalid source model!" );
+ ENSURE_OR_RETURN_VOID( i_modelToCopyFrom.is(), "ChartModelElement::applyModelContentToModel: invalid source model!" );
+ try
+ {
+ // /-- loccked controllers of destination
+ ControllerLockGuard aLockedControllers( i_model );
+ Reference< XChartDocument > xSource( i_modelToCopyFrom, UNO_QUERY_THROW );
+ Reference< XChartDocument > xDestination( i_model, UNO_QUERY_THROW );
+
+ // propagate the correct flag for plotting of hidden values to the data provider and all used sequences
+ ChartModelHelper::setIncludeHiddenCells( ChartModelHelper::isIncludeHiddenCells( i_modelToCopyFrom ) , i_model );
+
+ // diagram
+ xDestination->setFirstDiagram( xSource->getFirstDiagram() );
+
+ // main title
+ Reference< XTitled > xDestinationTitled( xDestination, UNO_QUERY_THROW );
+ Reference< XTitled > xSourceTitled( xSource, UNO_QUERY_THROW );
+ xDestinationTitled->setTitleObject( xSourceTitled->getTitleObject() );
+
+ // page background
+ ::comphelper::copyProperties(
+ xSource->getPageBackground(),
+ xDestination->getPageBackground() );
+
+ // apply data (not applied in standard Undo)
+ if ( i_data.is() )
+ ImplApplyDataToModel( i_model, i_data );
+
+ // register all sequences at the internal data provider to get adapted
+ // indexes when columns are added/removed
+ if ( xDestination->hasInternalDataProvider() )
+ {
+ Reference< XInternalDataProvider > xNewDataProvider( xDestination->getDataProvider(), UNO_QUERY );
+ Reference< XDataSource > xUsedData( DataSourceHelper::getUsedData( i_model ) );
+ if ( xUsedData.is() && xNewDataProvider.is() )
+ {
+ Sequence< Reference< XLabeledDataSequence > > aData( xUsedData->getDataSequences() );
+ for( sal_Int32 i=0; i<aData.getLength(); ++i )
+ {
+ xNewDataProvider->registerDataSequenceForChanges( aData[i]->getValues() );
+ xNewDataProvider->registerDataSequenceForChanges( aData[i]->getLabel() );
+ }
+ }
+ }
+
+ // restore modify status
+ Reference< XModifiable > xSourceMod( xSource, UNO_QUERY );
+ Reference< XModifiable > xDestMod( xDestination, UNO_QUERY );
+ if ( xSourceMod.is() && xDestMod.is() && !xSourceMod->isModified() )
+ {
+ xDestMod->setModified( sal_False );
+ }
+ // \-- loccked controllers of destination
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
diff --git a/chart2/source/controller/main/ChartModelClone.hxx b/chart2/source/controller/main/ChartModelClone.hxx
new file mode 100755
index 000000000000..d5653b8e1ccc
--- /dev/null
+++ b/chart2/source/controller/main/ChartModelClone.hxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef CHART2_CHARTMODELCLONE_HXX
+#define CHART2_CHARTMODELCLONE_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/chart2/XInternalDataProvider.hpp>
+/** === end UNO includes === **/
+
+#include <boost/noncopyable.hpp>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ModelFacet
+ //==================================================================================================================
+ enum ModelFacet
+ {
+ E_MODEL,
+ E_MODEL_WITH_DATA,
+ E_MODEL_WITH_SELECTION
+ };
+
+ //==================================================================================================================
+ //= ChartModelClone
+ //==================================================================================================================
+ class ChartModelClone : public ::boost::noncopyable
+ {
+ public:
+ ChartModelClone(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_model,
+ const ModelFacet i_facet
+ );
+
+ ~ChartModelClone();
+
+ ModelFacet getFacet() const;
+
+ void applyToModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_model ) const;
+
+ static void applyModelContentToModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & i_model,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & i_modelToCopyFrom,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > & i_data );
+
+ void dispose();
+
+ private:
+ bool impl_isDisposed() const { return !m_xModelClone.is(); }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModelClone;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > m_xDataClone;
+ ::com::sun::star::uno::Any m_aSelection;
+ };
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
+
+#endif // CHART2_CHARTMODELCLONE_HXX
diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx
index e0d689340760..c0847a490ea1 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.cxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.cxx
@@ -75,12 +75,6 @@ void CommandDispatchContainer::setModel(
m_xModel = xModel;
}
-// void CommandDispatchContainer::setUndoManager(
-// const Reference< chart2::XUndoManager > & xUndoManager )
-// {
-// m_xUndoManager = xUndoManager;
-// }
-
void CommandDispatchContainer::setChartDispatch(
const Reference< frame::XDispatch > xChartDispatch,
const ::std::set< OUString > & rChartCommands )
diff --git a/chart2/source/controller/main/CommandDispatchContainer.hxx b/chart2/source/controller/main/CommandDispatchContainer.hxx
index 1c8769e0a6d9..a5995253e059 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.hxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.hxx
@@ -28,7 +28,6 @@
#define CHART2_COMMANDDISPATCHCONTAINER_HXX
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
@@ -86,9 +85,6 @@ public:
void setModel(
const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > & xModel );
-// void setUndoManager(
-// const ::com::sun::star::uno::Reference<
-// ::com::sun::star::chart2::XUndoManager > & xUndoManager );
/** Set a chart dispatcher that is used for all commands contained in
rChartCommands
@@ -140,9 +136,8 @@ private:
mutable tDispatchMap m_aCachedDispatches;
mutable tDisposeVector m_aToBeDisposedDispatches;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
- ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > m_xModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > m_xModel;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xChartDispatcher;
::std::set< ::rtl::OUString > m_aChartCommands;
diff --git a/chart2/source/controller/main/ImplUndoManager.cxx b/chart2/source/controller/main/ImplUndoManager.cxx
deleted file mode 100644
index 0976b7db286e..000000000000
--- a/chart2/source/controller/main/ImplUndoManager.cxx
+++ /dev/null
@@ -1,503 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_chart2.hxx"
-
-#include "ImplUndoManager.hxx"
-#include "DisposeHelper.hxx"
-#include "CommonFunctors.hxx"
-#include "ControllerLockGuard.hxx"
-#include "PropertyHelper.hxx"
-#include "DataSourceHelper.hxx"
-#include "ChartModelHelper.hxx"
-
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XInternalDataProvider.hpp>
-#include <com/sun/star/chart2/XTitled.hpp>
-#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-
-#include <boost/bind.hpp>
-#include <algorithm>
-
-using namespace ::com::sun::star;
-
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::rtl::OUString;
-using ::com::sun::star::chart::XComplexDescriptionAccess;
-
-namespace chart
-{
-namespace impl
-{
-
-void ImplApplyDataToModel(
- Reference< frame::XModel > & xInOutModelToChange,
- const Reference< chart2::XInternalDataProvider > & xData )
-{
- Reference< chart2::XChartDocument > xDoc( xInOutModelToChange, uno::UNO_QUERY );
- OSL_ASSERT( xDoc.is() && xDoc->hasInternalDataProvider());
-
- // copy data from stored internal data provider
- if( xDoc.is() && xDoc->hasInternalDataProvider())
- {
- Reference< XComplexDescriptionAccess > xCurrentData( xDoc->getDataProvider(), uno::UNO_QUERY );
- Reference< XComplexDescriptionAccess > xSavedData( xData, uno::UNO_QUERY );
- if( xCurrentData.is() && xSavedData.is())
- {
- xCurrentData->setData( xSavedData->getData());
- xCurrentData->setComplexRowDescriptions( xSavedData->getComplexRowDescriptions());
- xCurrentData->setComplexColumnDescriptions( xSavedData->getComplexColumnDescriptions());
- }
- }
-}
-
-// ----------------------------------------
-
-UndoElement::UndoElement(
- const OUString & rActionString,
- const Reference< frame::XModel > & xModel ) :
- m_aActionString( rActionString )
-{
- initialize( xModel );
-}
-
-UndoElement::UndoElement(
- const Reference< frame::XModel > & xModel )
-{
- initialize( xModel );
-}
-
-UndoElement::UndoElement( const UndoElement & rOther ) :
- m_aActionString( rOther.m_aActionString )
-{
- initialize( rOther.m_xModel );
-}
-
-UndoElement::~UndoElement()
-{}
-
-void UndoElement::initialize( const Reference< frame::XModel > & xModel )
-{
- if ( xModel.is() )
- {
- m_xModel.set( UndoElement::cloneModel( xModel ) );
- }
-}
-
-void UndoElement::dispose()
-{
- Reference< lang::XComponent > xComp( m_xModel, uno::UNO_QUERY );
- if( xComp.is())
- xComp->dispose();
- m_xModel.set( 0 );
-}
-
-void UndoElement::applyToModel(
- Reference< frame::XModel > & xInOutModelToChange )
-{
- UndoElement::applyModelContentToModel( xInOutModelToChange, m_xModel );
-}
-
-UndoElement * UndoElement::createFromModel(
- const Reference< frame::XModel > & xModel )
-{
- return new UndoElement( getActionString(), xModel );
-}
-
-void UndoElement::setActionString( const ::rtl::OUString & rActionString )
-{
- m_aActionString = rActionString;
-}
-
-OUString UndoElement::getActionString() const
-{
- return m_aActionString;
-}
-
-Reference< frame::XModel > UndoElement::cloneModel( const Reference< frame::XModel > & xModel )
-{
- Reference< frame::XModel > xResult;
- uno::Reference< util::XCloneable > xCloneable( xModel, uno::UNO_QUERY );
- OSL_ENSURE( xCloneable.is(), "Cannot clone model" );
- if( xCloneable.is())
- xResult.set( xCloneable->createClone(), uno::UNO_QUERY );
-
- return xResult;
-}
-
-void UndoElement::applyModelContentToModel(
- Reference< frame::XModel > & xInOutModelToChange,
- const Reference< frame::XModel > & xModelToCopyFrom,
- const Reference< chart2::XInternalDataProvider > & xData /* = 0 */ )
-{
-
- if( xModelToCopyFrom.is() && xInOutModelToChange.is())
- {
- try
- {
- // /-- loccked controllers of destination
- ControllerLockGuard aLockedControllers( xInOutModelToChange );
- Reference< chart2::XChartDocument > xSource( xModelToCopyFrom, uno::UNO_QUERY_THROW );
- Reference< chart2::XChartDocument > xDestination( xInOutModelToChange, uno::UNO_QUERY_THROW );
-
- // propagate the correct flag for plotting of hidden values to the data provider and all used sequences
- ChartModelHelper::setIncludeHiddenCells( ChartModelHelper::isIncludeHiddenCells( xModelToCopyFrom ) , xInOutModelToChange );
-
- // diagram
- xDestination->setFirstDiagram( xSource->getFirstDiagram());
-
- // main title
- Reference< chart2::XTitled > xDestinationTitled( xDestination, uno::UNO_QUERY_THROW );
- Reference< chart2::XTitled > xSourceTitled( xSource, uno::UNO_QUERY_THROW );
- xDestinationTitled->setTitleObject( xSourceTitled->getTitleObject());
-
- // page background
- comphelper::copyProperties(
- xSource->getPageBackground(),
- xDestination->getPageBackground() );
-
- // apply data (not applied in standard Undo)
- if( xData.is())
- ImplApplyDataToModel( xInOutModelToChange, xData );
-
- // register all sequences at the internal data provider to get adapted
- // indexes when columns are added/removed
- if( xDestination->hasInternalDataProvider())
- {
- Reference< chart2::XInternalDataProvider > xNewDataProvider( xDestination->getDataProvider(), uno::UNO_QUERY );
- Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( xInOutModelToChange ));
- if( xUsedData.is() && xNewDataProvider.is())
- {
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
- for( sal_Int32 i=0; i<aData.getLength(); ++i )
- {
- xNewDataProvider->registerDataSequenceForChanges( aData[i]->getValues());
- xNewDataProvider->registerDataSequenceForChanges( aData[i]->getLabel());
- }
- }
- }
-
- // restore modify status
- Reference< util::XModifiable > xSourceMod( xSource, uno::UNO_QUERY );
- Reference< util::XModifiable > xDestMod( xDestination, uno::UNO_QUERY );
- if( xSourceMod.is() && xDestMod.is() &&
- ! xSourceMod->isModified() )
- {
- xDestMod->setModified( sal_False );
- }
- // \-- loccked controllers of destination
- }
- catch( uno::Exception & )
- {
- }
- }
-}
-
-// ----------------------------------------
-
-UndoElementWithData::UndoElementWithData(
- const OUString & rActionString,
- const Reference< frame::XModel > & xModel ) :
- UndoElement( rActionString, xModel )
-{
- initializeData();
-}
-
-UndoElementWithData::UndoElementWithData(
- const Reference< frame::XModel > & xModel ) :
- UndoElement( xModel )
-{
- initializeData();
-}
-
-
-UndoElementWithData::UndoElementWithData(
- const UndoElementWithData & rOther ) :
- UndoElement( rOther )
-{
- initializeData();
-}
-
-UndoElementWithData::~UndoElementWithData()
-{}
-
-void UndoElementWithData::initializeData()
-{
- try
- {
- Reference< chart2::XChartDocument > xChartDoc( m_xModel, uno::UNO_QUERY_THROW );
- OSL_ASSERT( xChartDoc->hasInternalDataProvider());
- if( xChartDoc->hasInternalDataProvider())
- {
- Reference< util::XCloneable > xCloneable( xChartDoc->getDataProvider(), uno::UNO_QUERY );
- OSL_ENSURE( xCloneable.is(), "Cannot clone data" );
- if( xCloneable.is())
- m_xData.set( xCloneable->createClone(), uno::UNO_QUERY );
- }
- }
- catch( uno::Exception & )
- {
- }
-}
-
-void UndoElementWithData::dispose()
-{
- UndoElement::dispose();
- m_xData.set( 0 );
-}
-
-void UndoElementWithData::applyToModel(
- Reference< frame::XModel > & xInOutModelToChange )
-{
- UndoElement::applyModelContentToModel( xInOutModelToChange, m_xModel, m_xData );
-}
-
-UndoElement * UndoElementWithData::createFromModel(
- const Reference< frame::XModel > & xModel )
-{
- return new UndoElementWithData( getActionString(), xModel );
-}
-
-// ========================================
-
-// ----------------------------------------
-
-UndoElementWithSelection::UndoElementWithSelection(
- const OUString & rActionString,
- const Reference< frame::XModel > & xModel ) :
- UndoElement( rActionString, xModel )
-{
- initialize( xModel );
-}
-
-UndoElementWithSelection::UndoElementWithSelection(
- const Reference< frame::XModel > & xModel ) :
- UndoElement( xModel )
-{
- initialize( xModel );
-}
-
-UndoElementWithSelection::UndoElementWithSelection(
- const UndoElementWithSelection & rOther ) :
- UndoElement( rOther )
-{
- initialize( rOther.m_xModel );
-}
-
-UndoElementWithSelection::~UndoElementWithSelection()
-{}
-
-void UndoElementWithSelection::initialize( const Reference< frame::XModel > & xModel )
-{
- try
- {
- uno::Reference< view::XSelectionSupplier > xSelSupp( xModel->getCurrentController(), uno::UNO_QUERY );
- OSL_ASSERT( xSelSupp.is() );
-
- if( xSelSupp.is() )
- m_aSelection = xSelSupp->getSelection();
- }
- catch( const uno::Exception & )
- {
- }
-}
-
-void UndoElementWithSelection::dispose()
-{
- UndoElement::dispose();
- m_aSelection.clear();
-}
-
-void UndoElementWithSelection::applyToModel(
- Reference< frame::XModel > & xInOutModelToChange )
-{
- UndoElement::applyModelContentToModel( xInOutModelToChange, m_xModel );
- Reference< view::XSelectionSupplier > xCurrentSelectionSuppl( xInOutModelToChange->getCurrentController(), uno::UNO_QUERY );
- OSL_ASSERT( xCurrentSelectionSuppl.is() );
-
- if( xCurrentSelectionSuppl.is())
- xCurrentSelectionSuppl->select( m_aSelection );
-}
-
-UndoElement * UndoElementWithSelection::createFromModel(
- const Reference< frame::XModel > & xModel )
-{
- return new UndoElementWithSelection( getActionString(), xModel );
-}
-
-// ----------------------------------------
-
-ShapeUndoElement::ShapeUndoElement( const OUString& rActionString, SdrUndoAction* pAction )
- :UndoElement( rActionString, Reference< frame::XModel >() )
- ,m_pAction( pAction )
-{
-}
-
-ShapeUndoElement::ShapeUndoElement( const ShapeUndoElement& rOther )
- :UndoElement( rOther )
- ,m_pAction( rOther.m_pAction )
-{
-}
-
-ShapeUndoElement::~ShapeUndoElement()
-{
-}
-
-SdrUndoAction* ShapeUndoElement::getSdrUndoAction()
-{
- return m_pAction;
-}
-
-// ========================================
-
-UndoStack::UndoStack() :
- m_nSizeLimit( 1000 )
-{
-}
-
-UndoStack::~UndoStack()
-{
- disposeAndClear();
-}
-
-void UndoStack::pop()
-{
- if( ! empty())
- {
- top()->dispose();
- delete top();
- m_aStack.pop_back();
- }
-}
-
-void UndoStack::push( UndoElement * pElement )
-{
- m_aStack.push_back( pElement );
- applyLimitation();
-}
-
-UndoElement * UndoStack::top() const
-{
- return m_aStack.back();
-}
-
-OUString UndoStack::topUndoString() const
-{
- if( ! empty())
- return top()->getActionString();
- return OUString();
-}
-
-Sequence< OUString > UndoStack::getUndoStrings() const
-{
- sal_Int32 nSize( static_cast< sal_Int32 >( m_aStack.size()));
- Sequence< OUString > aResult( nSize );
- for( sal_Int32 i=0; i<nSize; ++i )
- aResult[i] = m_aStack[i]->getActionString();
- return aResult;
-}
-
-bool UndoStack::empty() const
-{
- return m_aStack.empty();
-}
-
-void UndoStack::disposeAndClear()
-{
- ::std::for_each( m_aStack.begin(), m_aStack.end(), ::boost::mem_fn( & UndoElement::dispose ));
- ::std::for_each( m_aStack.begin(), m_aStack.end(), CommonFunctors::DeletePtr< UndoElement >() );
- m_aStack.clear();
-}
-
-void UndoStack::limitSize( sal_Int32 nMaxSize )
-{
- m_nSizeLimit = nMaxSize;
- applyLimitation();
-}
-
-void UndoStack::applyLimitation()
-{
- if( m_aStack.size() > static_cast< sal_uInt32 >( m_nSizeLimit ))
- {
- tUndoStackType::iterator aBegin( m_aStack.begin());
- tUndoStackType::iterator aEnd( aBegin + (m_aStack.size() - m_nSizeLimit));
- // dispose and remove all undo elements that are over the limit
- ::std::for_each( aBegin, aEnd, ::boost::mem_fn( & UndoElement::dispose ));
- ::std::for_each( aBegin, aEnd, CommonFunctors::DeletePtr< UndoElement >() );
- m_aStack.erase( aBegin, aEnd );
- }
-}
-
-// ================================================================================
-
-namespace
-{
-static const OUString aUndoStepsPropName( RTL_CONSTASCII_USTRINGPARAM("Steps"));
-} // anonymous namespace
-
-UndoStepsConfigItem::UndoStepsConfigItem( ConfigItemListener & rListener ) :
- ::utl::ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Undo"))),
- m_rListener( rListener )
-{
- EnableNotification( Sequence< OUString >( & aUndoStepsPropName, 1 ));
-}
-
-UndoStepsConfigItem::~UndoStepsConfigItem()
-{
-}
-
-void UndoStepsConfigItem::Notify( const Sequence< OUString > & aPropertyNames )
-{
- for( sal_Int32 nIdx=0; nIdx<aPropertyNames.getLength(); ++nIdx )
- {
- if( aPropertyNames[nIdx].equals( aUndoStepsPropName ))
- m_rListener.notify( aPropertyNames[nIdx] );
- }
-}
-
-void UndoStepsConfigItem::Commit()
-{
-}
-
-// mtehod is not const, because GetProperties is not const
-sal_Int32 UndoStepsConfigItem::getUndoSteps()
-{
- sal_Int32 nSteps = -1;
- Sequence< uno::Any > aValues(
- GetProperties( Sequence< OUString >( & aUndoStepsPropName, 1 )));
- if( aValues.getLength())
- aValues[0] >>= nSteps;
- return nSteps;
-}
-
-} // namespace impl
-} // namespace chart
diff --git a/chart2/source/controller/main/ImplUndoManager.hxx b/chart2/source/controller/main/ImplUndoManager.hxx
deleted file mode 100644
index 4dde0bc65719..000000000000
--- a/chart2/source/controller/main/ImplUndoManager.hxx
+++ /dev/null
@@ -1,227 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART2_IMPLUNDOMANAGER_HXX
-#define CHART2_IMPLUNDOMANAGER_HXX
-
-#include "ConfigItemListener.hxx"
-
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include <rtl/ustring.hxx>
-#include <unotools/configitem.hxx>
-
-#include <utility>
-#include <deque>
-
-
-class SdrUndoAction;
-
-namespace com { namespace sun { namespace star {
-namespace chart2 {
- class XInternalDataProvider;
-}
-}}}
-
-
-namespace chart
-{
-namespace impl
-{
-
-class UndoElement
-{
-public:
- UndoElement( const ::rtl::OUString & rActionString,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElement( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElement( const UndoElement & rOther );
- virtual ~UndoElement();
-
- virtual void dispose();
- virtual UndoElement * createFromModel(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- virtual void applyToModel(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xInOutModelToChange );
-
- void setActionString( const ::rtl::OUString & rActionString );
- ::rtl::OUString getActionString() const;
-
- static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > cloneModel(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel );
-
- static void applyModelContentToModel(
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xInOutModelToChange,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModelToCopyFrom,
- const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > & xData = 0 );
-
-protected:
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > m_xModel;
-
-private:
- void initialize( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- ::rtl::OUString m_aActionString;
-};
-
-class UndoElementWithData : public UndoElement
-{
-public:
- UndoElementWithData( const ::rtl::OUString & rActionString,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithData( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithData( const UndoElementWithData & rOther );
- virtual ~UndoElementWithData();
-
- virtual void dispose();
- virtual UndoElement * createFromModel(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- virtual void applyToModel(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xInOutModelToChange );
-
-private:
- void initializeData();
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XInternalDataProvider > m_xData;
-};
-
-class UndoElementWithSelection : public UndoElement
-{
-public:
- UndoElementWithSelection( const ::rtl::OUString & rActionString,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithSelection( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithSelection( const UndoElementWithSelection & rOther );
- virtual ~UndoElementWithSelection();
-
- virtual void dispose();
- virtual UndoElement * createFromModel(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- virtual void applyToModel(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xInOutModelToChange );
-
-private:
- void initialize( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- ::com::sun::star::uno::Any m_aSelection;
-};
-
-class ShapeUndoElement : public UndoElement
-{
-public:
- ShapeUndoElement( const ::rtl::OUString& rActionString, SdrUndoAction* pAction );
- ShapeUndoElement( const ShapeUndoElement& rOther );
- virtual ~ShapeUndoElement();
-
- SdrUndoAction* getSdrUndoAction();
-
-private:
- SdrUndoAction* m_pAction;
-};
-
-/** Note that all models that are put into this container are at some point
- disposed of inside this class. (At least in the destructor). That means
- the models retrieved here should never be used, but instead their content
- should be copied to a living model.
- */
-class UndoStack
-{
-public:
- UndoStack();
- // disposes of all models left in the stack
- ~UndoStack();
-
- // removes he last undo action and disposes of the model
- void pop();
- void push( UndoElement * rElement );
-
- // precondition: !empty()
- UndoElement * top() const;
- ::rtl::OUString topUndoString() const;
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString > getUndoStrings() const;
-
- bool empty() const;
- void disposeAndClear();
-
- // removes all actions that have been inserted more than nMaxSize steps ago.
- // The models of those actions are disposed of
- void limitSize( sal_Int32 nMaxSize );
-
-private:
- void applyLimitation();
-
- typedef ::std::deque< UndoElement * > tUndoStackType;
-
- tUndoStackType m_aStack;
- sal_Int32 m_nSizeLimit;
-};
-
-// ----------------------------------------
-
-class UndoStepsConfigItem : public ::utl::ConfigItem
-{
-public:
- explicit UndoStepsConfigItem( ConfigItemListener & rListener );
- virtual ~UndoStepsConfigItem();
-
- sal_Int32 getUndoSteps();
-
-protected:
- // ____ ::utl::ConfigItem ____
- virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString > & aPropertyNames );
- virtual void Commit();
-
-private:
- ConfigItemListener & m_rListener;
-};
-
-
-} // namespace impl
-} // namespace chart
-
-// CHART2_IMPLUNDOMANAGER_HXX
-#endif
diff --git a/chart2/source/controller/main/UndoActions.cxx b/chart2/source/controller/main/UndoActions.cxx
new file mode 100644
index 000000000000..86c0e365f590
--- /dev/null
+++ b/chart2/source/controller/main/UndoActions.cxx
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_chart2.hxx"
+
+#include "UndoActions.hxx"
+#include "DisposeHelper.hxx"
+#include "CommonFunctors.hxx"
+#include "PropertyHelper.hxx"
+#include "ChartModelClone.hxx"
+
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+
+#include <tools/diagnose_ex.h>
+#include <svx/svdundo.hxx>
+
+#include <boost/bind.hpp>
+#include <algorithm>
+
+using namespace ::com::sun::star;
+
+using ::rtl::OUString;
+
+namespace chart
+{
+namespace impl
+{
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::frame::XModel;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::view::XSelectionSupplier;
+ using ::com::sun::star::chart2::XChartDocument;
+ using ::com::sun::star::document::UndoFailedException;
+ /** === end UNO using === **/
+
+// ---------------------------------------------------------------------------------------------------------------------
+UndoElement::UndoElement( const OUString& i_actionString, const Reference< XModel >& i_documentModel, const ::boost::shared_ptr< ChartModelClone >& i_modelClone )
+ :UndoElement_MBase()
+ ,UndoElement_TBase( m_aMutex )
+ ,m_sActionString( i_actionString )
+ ,m_xDocumentModel( i_documentModel )
+ ,m_pModelClone( i_modelClone )
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+UndoElement::~UndoElement()
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UndoElement::disposing()
+{
+ if ( !!m_pModelClone )
+ m_pModelClone->dispose();
+ m_pModelClone.reset();
+ m_xDocumentModel.clear();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+::rtl::OUString SAL_CALL UndoElement::getTitle() throw (RuntimeException)
+{
+ return m_sActionString;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void UndoElement::impl_toggleModelState()
+{
+ // get a snapshot of the current state of our model
+ ::boost::shared_ptr< ChartModelClone > pNewClone( new ChartModelClone( m_xDocumentModel, m_pModelClone->getFacet() ) );
+ // apply the previous snapshot to our model
+ m_pModelClone->applyToModel( m_xDocumentModel );
+ // remember the new snapshot, for the next toggle
+ m_pModelClone = pNewClone;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UndoElement::undo( ) throw (UndoFailedException, RuntimeException)
+{
+ impl_toggleModelState();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UndoElement::redo( ) throw (UndoFailedException, RuntimeException)
+{
+ impl_toggleModelState();
+}
+
+// =====================================================================================================================
+// = ShapeUndoElement
+// =====================================================================================================================
+
+// ---------------------------------------------------------------------------------------------------------------------
+ShapeUndoElement::ShapeUndoElement( SdrUndoAction& i_sdrUndoAction )
+ :ShapeUndoElement_MBase()
+ ,ShapeUndoElement_TBase( m_aMutex )
+ ,m_pAction( &i_sdrUndoAction )
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+ShapeUndoElement::~ShapeUndoElement()
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ShapeUndoElement::getTitle() throw (RuntimeException)
+{
+ if ( !m_pAction )
+ throw DisposedException( ::rtl::OUString(), *this );
+ return m_pAction->GetComment();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ShapeUndoElement::undo( ) throw (UndoFailedException, RuntimeException)
+{
+ if ( !m_pAction )
+ throw DisposedException( ::rtl::OUString(), *this );
+ m_pAction->Undo();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ShapeUndoElement::redo( ) throw (UndoFailedException, RuntimeException)
+{
+ if ( !m_pAction )
+ throw DisposedException( ::rtl::OUString(), *this );
+ m_pAction->Redo();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ShapeUndoElement::disposing()
+{
+}
+
+} // namespace impl
+} // namespace chart
diff --git a/chart2/source/controller/main/UndoActions.hxx b/chart2/source/controller/main/UndoActions.hxx
new file mode 100644
index 000000000000..2c98d6af1d54
--- /dev/null
+++ b/chart2/source/controller/main/UndoActions.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 CHART2_IMPLUNDOMANAGER_HXX
+#define CHART2_IMPLUNDOMANAGER_HXX
+
+#include "ConfigItemListener.hxx"
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/document/XUndoAction.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <rtl/ustring.hxx>
+#include <unotools/configitem.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <utility>
+#include <deque>
+
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+
+class SdrUndoAction;
+
+namespace com { namespace sun { namespace star {
+namespace chart2 {
+ class XInternalDataProvider;
+}
+}}}
+
+
+namespace chart
+{
+class ChartModelClone;
+
+namespace impl
+{
+
+typedef ::cppu::BaseMutex UndoElement_MBase;
+typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > UndoElement_TBase;
+
+class UndoElement :public UndoElement_MBase
+ ,public UndoElement_TBase
+ ,public ::boost::noncopyable
+{
+public:
+ /** creates a new undo action
+
+ @param i_actionString
+ is the title of the Undo action
+ @param i_documentModel
+ is the actual document model which the undo actions operates on
+ @param i_modelClone
+ is the cloned model from before the changes, which the Undo action represents, have been applied.
+ Upon <member>invoking</member>, the clone model is applied to the document model.
+ */
+ UndoElement( const ::rtl::OUString & i_actionString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_documentModel,
+ const ::boost::shared_ptr< ChartModelClone >& i_modelClone
+ );
+
+ // XUndoAction
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+protected:
+ virtual ~UndoElement();
+
+private:
+ void impl_toggleModelState();
+
+private:
+ ::rtl::OUString m_sActionString;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocumentModel;
+ ::boost::shared_ptr< ChartModelClone > m_pModelClone;
+};
+
+
+typedef ::cppu::BaseMutex ShapeUndoElement_MBase;
+typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > ShapeUndoElement_TBase;
+class ShapeUndoElement :public ShapeUndoElement_MBase
+ ,public ShapeUndoElement_TBase
+{
+public:
+ ShapeUndoElement( SdrUndoAction& i_sdrUndoAction );
+
+ // XUndoAction
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+protected:
+ virtual ~ShapeUndoElement();
+
+private:
+ SdrUndoAction* m_pAction;
+};
+
+} // namespace impl
+} // namespace chart
+
+// CHART2_IMPLUNDOMANAGER_HXX
+#endif
diff --git a/chart2/source/controller/main/UndoCommandDispatch.cxx b/chart2/source/controller/main/UndoCommandDispatch.cxx
index 128a4b4091d0..487def377d5c 100644
--- a/chart2/source/controller/main/UndoCommandDispatch.cxx
+++ b/chart2/source/controller/main/UndoCommandDispatch.cxx
@@ -29,13 +29,15 @@
#include "precompiled_chart2.hxx"
#include "UndoCommandDispatch.hxx"
+#include "ResId.hxx"
#include "macros.hxx"
-#include <com/sun/star/chart2/XUndoSupplier.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
// for ressource strings STR_UNDO and STR_REDO
#include <svtools/svtools.hrc>
@@ -56,10 +58,8 @@ UndoCommandDispatch::UndoCommandDispatch(
CommandDispatch( xContext ),
m_xModel( xModel )
{
- Reference< chart2::XUndoSupplier > xUndoSupplier( xModel, uno::UNO_QUERY );
- OSL_ASSERT( xUndoSupplier.is());
- if( xUndoSupplier.is())
- m_xUndoManager.set( xUndoSupplier->getUndoManager());
+ uno::Reference< document::XUndoManagerSupplier > xSuppUndo( m_xModel, uno::UNO_QUERY_THROW );
+ m_xUndoManager.set( xSuppUndo->getUndoManager(), uno::UNO_QUERY_THROW );
}
UndoCommandDispatch::~UndoCommandDispatch()
@@ -68,10 +68,8 @@ UndoCommandDispatch::~UndoCommandDispatch()
void UndoCommandDispatch::initialize()
{
Reference< util::XModifyBroadcaster > xBroadcaster( m_xUndoManager, uno::UNO_QUERY );
- if( xBroadcaster.is() )
- {
- xBroadcaster->addModifyListener( this );
- }
+ ENSURE_OR_RETURN_VOID( xBroadcaster.is(), "UndoCommandDispatch::initialize: missing modification broadcaster interface!" );
+ xBroadcaster->addModifyListener( this );
}
void UndoCommandDispatch::fireStatusEvent(
@@ -82,23 +80,23 @@ void UndoCommandDispatch::fireStatusEvent(
{
bool bFireAll = (rURL.getLength() == 0);
uno::Any aUndoState, aRedoState;
- if( m_xUndoManager->undoPossible())
+ if( m_xUndoManager->isUndoPossible())
{
// using assignment for broken gcc 3.3
OUString aUndo = OUString( String( SvtResId( STR_UNDO )));
- aUndoState <<= ( aUndo + m_xUndoManager->getCurrentUndoString());
+ aUndoState <<= ( aUndo + m_xUndoManager->getCurrentUndoActionTitle());
}
- if( m_xUndoManager->redoPossible())
+ if( m_xUndoManager->isRedoPossible())
{
// using assignment for broken gcc 3.3
OUString aRedo = OUString( String( SvtResId( STR_REDO )));
- aRedoState <<= ( aRedo + m_xUndoManager->getCurrentRedoString());
+ aRedoState <<= ( aRedo + m_xUndoManager->getCurrentRedoActionTitle());
}
if( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Undo")))
- fireStatusEventForURL( C2U(".uno:Undo"), aUndoState, m_xUndoManager->undoPossible(), xSingleListener );
+ fireStatusEventForURL( C2U(".uno:Undo"), aUndoState, m_xUndoManager->isUndoPossible(), xSingleListener );
if( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Redo")))
- fireStatusEventForURL( C2U(".uno:Redo"), aRedoState, m_xUndoManager->redoPossible(), xSingleListener );
+ fireStatusEventForURL( C2U(".uno:Redo"), aRedoState, m_xUndoManager->isRedoPossible(), xSingleListener );
}
}
@@ -113,10 +111,21 @@ void SAL_CALL UndoCommandDispatch::dispatch(
// why is it necessary to lock the solar mutex here?
// /--
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- if( URL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Undo" )))
- m_xUndoManager->undo( m_xModel );
- else
- m_xUndoManager->redo( m_xModel );
+ try
+ {
+ if( URL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Undo" )))
+ m_xUndoManager->undo();
+ else
+ m_xUndoManager->redo();
+ }
+ catch( const document::UndoFailedException& )
+ {
+ // silently ignore
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
// \--
}
}
@@ -126,6 +135,7 @@ void SAL_CALL UndoCommandDispatch::dispatch(
void SAL_CALL UndoCommandDispatch::disposing()
{
Reference< util::XModifyBroadcaster > xBroadcaster( m_xUndoManager, uno::UNO_QUERY );
+ OSL_ENSURE( xBroadcaster.is(), "UndoCommandDispatch::initialize: missing modification broadcaster interface!" );
if( xBroadcaster.is() )
{
xBroadcaster->removeModifyListener( this );
diff --git a/chart2/source/controller/main/UndoCommandDispatch.hxx b/chart2/source/controller/main/UndoCommandDispatch.hxx
index 28fb813f63de..891ab8b019e5 100644
--- a/chart2/source/controller/main/UndoCommandDispatch.hxx
+++ b/chart2/source/controller/main/UndoCommandDispatch.hxx
@@ -30,15 +30,12 @@
#include "CommandDispatch.hxx"
#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
+#include <com/sun/star/document/XUndoManager.hpp>
namespace chart
{
/** This is a CommandDispatch implementation for Undo and Redo.
-
- You need to pass an UndoManager to this class that is then used for Undo and
- Redo. The changes are applied to the given XModel.
*/
class UndoCommandDispatch : public CommandDispatch
{
@@ -77,7 +74,7 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > m_xModel;
::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
+ ::com::sun::star::document::XUndoManager > m_xUndoManager;
};
} // namespace chart
diff --git a/chart2/source/controller/main/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx
index 8513b6ba9093..52ea27aa8d49 100644
--- a/chart2/source/controller/main/UndoGuard.cxx
+++ b/chart2/source/controller/main/UndoGuard.cxx
@@ -29,6 +29,12 @@
#include "precompiled_chart2.hxx"
#include "UndoGuard.hxx"
+#include "ChartModelClone.hxx"
+#include "UndoActions.hxx"
+
+#include <com/sun/star/container/XChild.hpp>
+
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
@@ -39,105 +45,154 @@ using ::rtl::OUString;
namespace chart
{
-UndoGuard_Base::UndoGuard_Base( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : m_xModel( xModel )
- , m_xUndoManager( xUndoManager )
- , m_aUndoString( rUndoString )
- , m_bActionPosted( false )
+//-----------------------------------------------------------------------------
+
+UndoGuard::UndoGuard( const OUString& i_undoString, const uno::Reference< document::XUndoManager > & i_undoManager,
+ const ModelFacet i_facet )
+ :m_xChartModel( i_undoManager->getParent(), uno::UNO_QUERY_THROW )
+ ,m_xUndoManager( i_undoManager )
+ ,m_pDocumentSnapshot()
+ ,m_aUndoString( i_undoString )
+ ,m_bActionPosted( false )
{
+ m_pDocumentSnapshot.reset( new ChartModelClone( m_xChartModel, i_facet ) );
}
-UndoGuard_Base::~UndoGuard_Base()
+//-----------------------------------------------------------------------------
+
+UndoGuard::~UndoGuard()
{
+ if ( !!m_pDocumentSnapshot )
+ discardSnapshot();
}
-void UndoGuard_Base::commitAction()
+//-----------------------------------------------------------------------------
+
+void UndoGuard::commit()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->postAction( m_aUndoString );
+ if ( !m_bActionPosted && !!m_pDocumentSnapshot )
+ {
+ try
+ {
+ const Reference< document::XUndoAction > xAction( new impl::UndoElement( m_aUndoString, m_xChartModel, m_pDocumentSnapshot ) );
+ m_pDocumentSnapshot.reset(); // don't dispose, it's data went over to the UndoElement
+ m_xUndoManager->addUndoAction( xAction );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
m_bActionPosted = true;
}
//-----------------------------------------------------------------------------
-UndoGuard::UndoGuard( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+void UndoGuard::rollback()
{
- if( m_xUndoManager.is() )
- m_xUndoManager->preAction( m_xModel );
+ ENSURE_OR_RETURN_VOID( !!m_pDocumentSnapshot, "no snapshot!" );
+ m_pDocumentSnapshot->applyToModel( m_xChartModel );
+ discardSnapshot();
}
-UndoGuard::~UndoGuard()
+//-----------------------------------------------------------------------------
+void UndoGuard::discardSnapshot()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelAction();
+ ENSURE_OR_RETURN_VOID( !!m_pDocumentSnapshot, "no snapshot!" );
+ m_pDocumentSnapshot->dispose();
+ m_pDocumentSnapshot.reset();
}
//-----------------------------------------------------------------------------
-UndoLiveUpdateGuard::UndoLiveUpdateGuard( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+UndoLiveUpdateGuard::UndoLiveUpdateGuard( const OUString& i_undoString, const uno::Reference< document::XUndoManager >& i_undoManager )
+ :UndoGuard( i_undoString, i_undoManager, E_MODEL )
{
- if( m_xUndoManager.is() )
- m_xUndoManager->preAction( m_xModel );
}
UndoLiveUpdateGuard::~UndoLiveUpdateGuard()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelActionWithUndo( m_xModel );
+ if ( !isActionPosted() )
+ rollback();
}
//-----------------------------------------------------------------------------
-UndoLiveUpdateGuardWithData::UndoLiveUpdateGuardWithData( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+UndoLiveUpdateGuardWithData::UndoLiveUpdateGuardWithData(
+ const OUString& i_undoString, const uno::Reference< document::XUndoManager >& i_undoManager )
+ :UndoGuard( i_undoString, i_undoManager, E_MODEL_WITH_DATA )
{
- if( m_xUndoManager.is() )
- {
- Sequence< beans::PropertyValue > aArgs(1);
- aArgs[0] = beans::PropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM("WithData")), -1, uno::Any(),
- beans::PropertyState_DIRECT_VALUE );
- m_xUndoManager->preActionWithArguments( m_xModel, aArgs );
- }
}
UndoLiveUpdateGuardWithData::~UndoLiveUpdateGuardWithData()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelActionWithUndo( m_xModel );
+ if ( !isActionPosted() )
+ rollback();
}
//-----------------------------------------------------------------------------
-UndoGuardWithSelection::UndoGuardWithSelection( const rtl::OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+UndoGuardWithSelection::UndoGuardWithSelection(
+ const OUString& i_undoString, const uno::Reference< document::XUndoManager >& i_undoManager )
+ :UndoGuard( i_undoString, i_undoManager, E_MODEL_WITH_SELECTION )
{
- if( m_xUndoManager.is() )
+}
+
+//-----------------------------------------------------------------------------
+
+UndoGuardWithSelection::~UndoGuardWithSelection()
+{
+ if ( !isActionPosted() )
+ rollback();
+}
+
+//-----------------------------------------------------------------------------
+
+UndoContext::UndoContext( const Reference< document::XUndoManager > & i_undoManager, const ::rtl::OUString& i_undoTitle )
+ :m_xUndoManager( i_undoManager )
+{
+ ENSURE_OR_THROW( m_xUndoManager.is(), "invalid undo manager!" );
+ m_xUndoManager->enterUndoContext( i_undoTitle );
+}
+
+//-----------------------------------------------------------------------------
+
+UndoContext::~UndoContext()
+{
+ m_xUndoManager->leaveUndoContext();
+}
+
+//-----------------------------------------------------------------------------
+
+HiddenUndoContext::HiddenUndoContext( const Reference< document::XUndoManager > & i_undoManager )
+ :m_xUndoManager( i_undoManager )
+{
+ ENSURE_OR_THROW( m_xUndoManager.is(), "invalid undo manager!" );
+ try
+ {
+ m_xUndoManager->enterHiddenUndoContext();
+ }
+ catch( const uno::Exception& )
{
- Sequence< beans::PropertyValue > aArgs(1);
- aArgs[0] = beans::PropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM("WithSelection")), -1, uno::Any(),
- beans::PropertyState_DIRECT_VALUE );
- m_xUndoManager->preActionWithArguments( m_xModel, aArgs );
+ DBG_UNHANDLED_EXCEPTION();
+ m_xUndoManager.clear();
+ // prevents the leaveUndoContext in the dtor
}
}
-UndoGuardWithSelection::~UndoGuardWithSelection()
+//-----------------------------------------------------------------------------
+
+HiddenUndoContext::~HiddenUndoContext()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelAction();
+ try
+ {
+ if ( m_xUndoManager.is() )
+ m_xUndoManager->leaveUndoContext();
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
} // namespace chart
diff --git a/chart2/source/controller/main/UndoGuard.hxx b/chart2/source/controller/main/UndoGuard.hxx
new file mode 100644
index 000000000000..c5c00dd62d1b
--- /dev/null
+++ b/chart2/source/controller/main/UndoGuard.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 CHART2_UNDOGUARD_HXX
+#define CHART2_UNDOGUARD_HXX
+
+#include "ChartModelClone.hxx"
+
+#include <com/sun/star/document/XUndoManager.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
+#include <rtl/ustring.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+namespace chart
+{
+
+/** A guard which which does nothing, unless you explicitly call commitAction. In particular, in its destructor, it
+ does neither auto-commit nor auto-rollback the model changes.
+ */
+class UndoGuard
+{
+public:
+ explicit UndoGuard(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager,
+ const ModelFacet i_facet = E_MODEL
+ );
+ ~UndoGuard();
+
+ void commit();
+ void rollback();
+
+protected:
+ bool isActionPosted() const { return m_bActionPosted; }
+
+private:
+ void discardSnapshot();
+
+private:
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xChartModel;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+
+ ::boost::shared_ptr< ChartModelClone > m_pDocumentSnapshot;
+ rtl::OUString m_aUndoString;
+ bool m_bActionPosted;
+};
+
+/** A guard which, in its destructor, restores the model state it found in the constructor. If
+ <member>commitAction</member> is called inbetween, the restouration is not performed.
+ */
+class UndoLiveUpdateGuard : public UndoGuard
+{
+public:
+ explicit UndoLiveUpdateGuard(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ ~UndoLiveUpdateGuard();
+};
+
+/** Same as UndoLiveUpdateGuard but with additional storage of the chart's data.
+ Only use this if the data has internal data.
+ */
+class UndoLiveUpdateGuardWithData :
+ public UndoGuard
+{
+public:
+ explicit UndoLiveUpdateGuardWithData(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ ~UndoLiveUpdateGuardWithData();
+};
+
+class UndoGuardWithSelection : public UndoGuard
+{
+public:
+ explicit UndoGuardWithSelection(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ virtual ~UndoGuardWithSelection();
+};
+
+class UndoContext
+{
+public:
+ UndoContext(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager,
+ const ::rtl::OUString& i_undoTitle
+ );
+ ~UndoContext();
+
+private:
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+};
+
+class HiddenUndoContext
+{
+public:
+ HiddenUndoContext(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ ~HiddenUndoContext();
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+};
+
+}
+// CHART2_UNDOGUARD_HXX
+#endif
diff --git a/chart2/source/controller/main/UndoManager.cxx b/chart2/source/controller/main/UndoManager.cxx
deleted file mode 100644
index 21b3bbc1f725..000000000000
--- a/chart2/source/controller/main/UndoManager.cxx
+++ /dev/null
@@ -1,438 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_chart2.hxx"
-
-#include "UndoManager.hxx"
-#include "ImplUndoManager.hxx"
-#include "DisposeHelper.hxx"
-#include "MutexContainer.hxx"
-#include "macros.hxx"
-#include "ChartViewHelper.hxx"
-
-#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-
-#include <unotools/configitem.hxx>
-#include <cppuhelper/compbase1.hxx>
-#include <rtl/uuid.h>
-#include <svx/svdundo.hxx>
-
-#include <functional>
-
-using namespace ::com::sun::star;
-
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::rtl::OUString;
-
-
-// --------------------------------------------------------------------------------
-
-namespace chart
-{
-
-namespace impl
-{
-typedef ::cppu::WeakComponentImplHelper1<
- util::XModifyBroadcaster >
- ModifyBroadcaster_Base;
-
-class ModifyBroadcaster :
- public ::chart::MutexContainer,
- public ModifyBroadcaster_Base
-{
-public:
- ModifyBroadcaster();
-
- void fireEvent();
-
-protected:
- // ____ XModifyBroadcaster ____
- virtual void SAL_CALL addModifyListener( const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL removeModifyListener( const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException);
-};
-
-ModifyBroadcaster::ModifyBroadcaster() :
- ModifyBroadcaster_Base( m_aMutex )
-{}
-
-void SAL_CALL ModifyBroadcaster::addModifyListener(
- const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException)
-{
- rBHelper.addListener( ::getCppuType( & xListener ), xListener);
-}
-
-void SAL_CALL ModifyBroadcaster::removeModifyListener(
- const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException)
-{
- rBHelper.removeListener( ::getCppuType( & xListener ), xListener );
-}
-
-void ModifyBroadcaster::fireEvent()
-{
- ::cppu::OInterfaceContainerHelper* pIC = rBHelper.getContainer(
- ::getCppuType((const uno::Reference< util::XModifyListener >*)0) );
- if( pIC )
- {
- lang::EventObject aEvent( static_cast< lang::XComponent* >( this ) );
- ::cppu::OInterfaceIteratorHelper aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- uno::Reference< util::XModifyListener > xListener( aIt.next(), uno::UNO_QUERY );
- if( xListener.is() )
- xListener->modified( aEvent );
- }
- }
-}
-
-} // namespace impl
-
-UndoManager::UndoManager() :
- impl::UndoManager_Base( m_aMutex ),
- m_apUndoStack( new impl::UndoStack()),
- m_apRedoStack( new impl::UndoStack()),
- m_pLastRemeberedUndoElement( 0 ),
- m_nMaxNumberOfUndos( 100 ),
- m_pModifyBroadcaster( 0 )
-{}
-
-UndoManager::~UndoManager()
-{
- DisposeHelper::Dispose( m_xModifyBroadcaster );
- m_apUndoStack->disposeAndClear();
- m_apRedoStack->disposeAndClear();
-
- delete m_pLastRemeberedUndoElement;
- m_pLastRemeberedUndoElement = 0;
-}
-
-void UndoManager::addShapeUndoAction( SdrUndoAction* pAction )
-{
- if ( !pAction )
- {
- return;
- }
-
- impl::ShapeUndoElement* pShapeUndoElement = new impl::ShapeUndoElement( pAction->GetComment(), pAction );
- if ( pShapeUndoElement )
- {
- m_apUndoStack->push( pShapeUndoElement );
- m_apRedoStack->disposeAndClear();
- if ( !m_apUndoStepsConfigItem.get() )
- {
- retrieveConfigUndoSteps();
- }
- fireModifyEvent();
- }
-}
-
-void UndoManager::impl_undoRedo(
- Reference< frame::XModel > & xCurrentModel,
- impl::UndoStack * pStackToRemoveFrom,
- impl::UndoStack * pStackToAddTo,
- bool bUndo )
-{
- if( pStackToRemoveFrom && ! pStackToRemoveFrom->empty() )
- {
- // get model from undo/redo
- impl::UndoElement * pTop( pStackToRemoveFrom->top());
- if( pTop )
- {
- impl::ShapeUndoElement* pShapeUndoElement = dynamic_cast< impl::ShapeUndoElement* >( pTop );
- if ( pShapeUndoElement )
- {
- impl::ShapeUndoElement* pNewShapeUndoElement = new impl::ShapeUndoElement( *pShapeUndoElement );
- pStackToAddTo->push( pNewShapeUndoElement );
- SdrUndoAction* pAction = pNewShapeUndoElement->getSdrUndoAction();
- if ( pAction )
- {
- if ( bUndo )
- {
- pAction->Undo();
- }
- else
- {
- pAction->Redo();
- }
- }
- }
- else
- {
- // put a clone of current model into redo/undo stack with the same
- // action string as the undo/redo
- pStackToAddTo->push( pTop->createFromModel( xCurrentModel ));
- // change current model by properties of the model from undo
- pTop->applyToModel( xCurrentModel );
- }
- // remove the top undo element
- pStackToRemoveFrom->pop(), pTop = 0;
- ChartViewHelper::setViewToDirtyState( xCurrentModel );
- fireModifyEvent();
- }
- }
- else
- {
- OSL_ENSURE( false, "Can't Undo/Redo" );
- }
-}
-
-void UndoManager::fireModifyEvent()
-{
- if( m_xModifyBroadcaster.is())
- m_pModifyBroadcaster->fireEvent();
-}
-
-
-// ____ ConfigItemListener ____
-void UndoManager::notify( const ::rtl::OUString & rPropertyName )
-{
- OSL_ENSURE( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Steps" )),
- "Unwanted config property change Notified" );
- if( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Steps" )))
- retrieveConfigUndoSteps();
-}
-
-void UndoManager::retrieveConfigUndoSteps()
-{
- if( ! m_apUndoStepsConfigItem.get())
- m_apUndoStepsConfigItem.reset( new impl::UndoStepsConfigItem( *this ));
- m_nMaxNumberOfUndos = m_apUndoStepsConfigItem->getUndoSteps();
- m_apUndoStack->limitSize( m_nMaxNumberOfUndos );
- m_apRedoStack->limitSize( m_nMaxNumberOfUndos );
-
- // a list of available undo steps could shrink here
- fireModifyEvent();
-}
-
-// ____ XModifyBroadcaster ____
-void SAL_CALL UndoManager::addModifyListener( const Reference< util::XModifyListener >& aListener )
- throw (uno::RuntimeException)
-{
- if( ! m_xModifyBroadcaster.is())
- {
- m_pModifyBroadcaster = new impl::ModifyBroadcaster();
- m_xModifyBroadcaster.set( static_cast< cppu::OWeakObject* >( m_pModifyBroadcaster ), uno::UNO_QUERY );
- }
- m_xModifyBroadcaster->addModifyListener( aListener );
-}
-
-void SAL_CALL UndoManager::removeModifyListener( const Reference< util::XModifyListener >& aListener )
- throw (uno::RuntimeException)
-{
- if( ! m_xModifyBroadcaster.is())
- {
- m_pModifyBroadcaster = new impl::ModifyBroadcaster();
- m_xModifyBroadcaster.set( static_cast< cppu::OWeakObject* >( m_pModifyBroadcaster ), uno::UNO_QUERY );
- }
- m_xModifyBroadcaster->removeModifyListener( aListener );
-}
-
-// ____ chart2::XUndoManager ____
-void SAL_CALL UndoManager::preAction( const Reference< frame::XModel >& xModelBeforeChange )
- throw (uno::RuntimeException)
-{
- OSL_ENSURE( ! m_pLastRemeberedUndoElement, "Looks like postAction or cancelAction call was missing" );
- m_pLastRemeberedUndoElement = new impl::UndoElement( xModelBeforeChange );
-}
-
-void SAL_CALL UndoManager::preActionWithArguments(
- const Reference< frame::XModel >& xModelBeforeChange,
- const Sequence< beans::PropertyValue >& aArguments )
- throw (uno::RuntimeException)
-{
- bool bActionHandled( false );
- OSL_ENSURE( ! m_pLastRemeberedUndoElement, "Looks like postAction or cancelAction call was missing" );
- if( aArguments.getLength() > 0 )
- {
- OSL_ENSURE( aArguments.getLength() == 1, "More than one argument is not supported yet" );
- if( aArguments[0].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("WithData")))
- {
- m_pLastRemeberedUndoElement = new impl::UndoElementWithData( xModelBeforeChange );
- bActionHandled = true;
- }
- else if( aArguments[0].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("WithSelection")))
- {
- m_pLastRemeberedUndoElement = new impl::UndoElementWithSelection( xModelBeforeChange );
- bActionHandled = true;
- }
- }
-
- if( !bActionHandled )
- preAction( xModelBeforeChange );
-}
-
-void SAL_CALL UndoManager::postAction( const OUString& aUndoText )
- throw (uno::RuntimeException)
-{
- OSL_ENSURE( m_pLastRemeberedUndoElement, "Looks like preAction call was missing" );
- if( m_pLastRemeberedUndoElement )
- {
- m_pLastRemeberedUndoElement->setActionString( aUndoText );
- m_apUndoStack->push( m_pLastRemeberedUndoElement );
- m_pLastRemeberedUndoElement = 0;
-
- // redo no longer possible
- m_apRedoStack->disposeAndClear();
-
- // it suffices to get the number of undo steps from config after the
- // first time postAction has been called
- if( ! m_apUndoStepsConfigItem.get())
- retrieveConfigUndoSteps();
-
- fireModifyEvent();
- }
-}
-
-void SAL_CALL UndoManager::cancelAction()
- throw (uno::RuntimeException)
-{
- delete m_pLastRemeberedUndoElement;
- m_pLastRemeberedUndoElement = 0;
-}
-
-void SAL_CALL UndoManager::cancelActionWithUndo( Reference< frame::XModel >& xModelToRestore )
- throw (uno::RuntimeException)
-{
- if( m_pLastRemeberedUndoElement )
- {
- m_pLastRemeberedUndoElement->applyToModel( xModelToRestore );
- cancelAction();
- }
-}
-
-void SAL_CALL UndoManager::undo( Reference< frame::XModel >& xCurrentModel )
- throw (uno::RuntimeException)
-{
- OSL_ASSERT( m_apUndoStack.get() && m_apRedoStack.get());
- impl_undoRedo( xCurrentModel, m_apUndoStack.get(), m_apRedoStack.get(), true );
-}
-
-void SAL_CALL UndoManager::redo( Reference< frame::XModel >& xCurrentModel )
- throw (uno::RuntimeException)
-{
- OSL_ASSERT( m_apUndoStack.get() && m_apRedoStack.get());
- impl_undoRedo( xCurrentModel, m_apRedoStack.get(), m_apUndoStack.get(), false );
-}
-
-::sal_Bool SAL_CALL UndoManager::undoPossible()
- throw (uno::RuntimeException)
-{
- return ! m_apUndoStack->empty();
-}
-
-::sal_Bool SAL_CALL UndoManager::redoPossible()
- throw (uno::RuntimeException)
-{
- return ! m_apRedoStack->empty();
-}
-
-OUString SAL_CALL UndoManager::getCurrentUndoString()
- throw (uno::RuntimeException)
-{
- return m_apUndoStack->topUndoString();
-}
-
-OUString SAL_CALL UndoManager::getCurrentRedoString()
- throw (uno::RuntimeException)
-{
- return m_apRedoStack->topUndoString();
-}
-
-Sequence< OUString > SAL_CALL UndoManager::getAllUndoStrings()
- throw (uno::RuntimeException)
-{
- return m_apUndoStack->getUndoStrings();
-}
-
-Sequence< OUString > SAL_CALL UndoManager::getAllRedoStrings()
- throw (uno::RuntimeException)
-{
- return m_apRedoStack->getUndoStrings();
-}
-
-// ____ XUndoHelper ____
-Reference< frame::XModel > SAL_CALL UndoManager::getModelCloneForUndo(
- const Reference< frame::XModel >& xModelBeforeChange )
- throw (uno::RuntimeException)
-{
- return impl::UndoElement::cloneModel( xModelBeforeChange );
-}
-
-void SAL_CALL UndoManager::applyModelContent(
- Reference< frame::XModel >& xModelToChange,
- const Reference< frame::XModel >& xModelToCopyFrom )
- throw (uno::RuntimeException)
-{
- impl::UndoElement::applyModelContentToModel( xModelToChange, xModelToCopyFrom );
-}
-
-// ____ XUnoTunnel ____
-sal_Int64 UndoManager::getSomething( const Sequence< sal_Int8 >& rId )
- throw (uno::RuntimeException)
-{
- if ( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
- {
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
- }
- return 0;
-}
-
-const Sequence< sal_Int8 >& UndoManager::getUnoTunnelId()
-{
- static Sequence< sal_Int8 >* pSeq = 0;
- if( !pSeq )
- {
- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-UndoManager* UndoManager::getImplementation( const Reference< uno::XInterface > xObj )
-{
- UndoManager* pRet = NULL;
- Reference< lang::XUnoTunnel > xUT( xObj, uno::UNO_QUERY );
- if ( xUT.is() )
- {
- pRet = reinterpret_cast< UndoManager* >( sal::static_int_cast< sal_IntPtr >( xUT->getSomething( getUnoTunnelId() ) ) );
- }
- return pRet;
-}
-
-} // namespace chart
diff --git a/chart2/source/controller/main/makefile.mk b/chart2/source/controller/main/makefile.mk
index 729276d5bd0e..557d6cf6216f 100644
--- a/chart2/source/controller/main/makefile.mk
+++ b/chart2/source/controller/main/makefile.mk
@@ -72,12 +72,9 @@ SLOFILES = \
$(SLO)$/DrawCommandDispatch.obj \
$(SLO)$/ShapeController.obj \
$(SLO)$/ShapeToolbarController.obj \
- $(SLO)$/ImplUndoManager.obj \
- $(SLO)$/UndoManager.obj \
- $(SLO)$/UndoGuard.obj
-
-# $(SLO)$/CommonConverters.obj \
-# $(SLO)$/Scaling.obj \
+ $(SLO)$/UndoActions.obj \
+ $(SLO)$/UndoGuard.obj \
+ $(SLO)$/ChartModelClone.obj \
# --- Targets -----------------------------------------------------------------
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx
index 75e69436a784..33430807c3e2 100644
--- a/chart2/source/inc/AxisHelper.hxx
+++ b/chart2/source/inc/AxisHelper.hxx
@@ -29,10 +29,12 @@
#include "charttoolsdllapi.hxx"
#include "ReferenceSizeProvider.hxx"
+#include "ExplicitCategoriesProvider.hxx"
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <vector>
@@ -58,6 +60,15 @@ public:
static bool isLogarithmic( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XScaling >& xScaling );
+ static void checkDateAxis( ::com::sun::star::chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis );
+ static ::com::sun::star::chart2::ScaleData getDateCheckedScale( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
+
+ static sal_Int32 getExplicitNumberFormatKeyForAxis(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& xCorrespondingCoordinateSystem
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier
+ , bool bSearchForParallelAxisIfNothingIsFound );
+
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XAxis >
createAxis( sal_Int32 nDimensionIndex, bool bMainAxis
diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx
index fb087abf15fd..7dbf0459d870 100644
--- a/chart2/source/inc/ChartModelHelper.hxx
+++ b/chart2/source/inc/ChartModelHelper.hxx
@@ -31,7 +31,6 @@
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/data/XRangeHighlighter.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx
index 729cfc86bc52..67df6027d2d7 100644
--- a/chart2/source/inc/ChartTypeHelper.hxx
+++ b/chart2/source/inc/ChartTypeHelper.hxx
@@ -61,8 +61,9 @@ public:
static bool isSupportingStartingAngle( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
//starting value for bars or baseline for areas for example
static bool isSupportingBaseValue( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
- static bool shiftTicksAtXAxisPerDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+ static bool shiftCategoryPosAtXAxisPerDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
static bool isSupportingAxisPositioning( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
+ static bool isSupportingDateAxis( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
//returns sequence of ::com::sun::star::chart::DataLabelPlacement
static ::com::sun::star::uno::Sequence < sal_Int32 > getSupportedLabelPlacements(
diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx
index 13435741e63e..eec5b59dd582 100644
--- a/chart2/source/inc/CommonFunctors.hxx
+++ b/chart2/source/inc/CommonFunctors.hxx
@@ -67,18 +67,7 @@ struct OOO_DLLPUBLIC_CHARTTOOLS AnyToDouble : public ::std::unary_function< ::co
::rtl::math::setNan( & fResult );
::com::sun::star::uno::TypeClass eClass( rAny.getValueType().getTypeClass() );
- if( eClass == ::com::sun::star::uno::TypeClass_STRING )
- {
- rtl_math_ConversionStatus eConversionStatus;
- fResult = ::rtl::math::stringToDouble(
- * reinterpret_cast< const ::rtl::OUString * >( rAny.getValue() ),
- sal_Char( '.' ), sal_Char( ',' ),
- & eConversionStatus, NULL );
-
- if( eConversionStatus != rtl_math_ConversionStatus_Ok )
- ::rtl::math::setNan( & fResult );
- }
- else if( eClass == ::com::sun::star::uno::TypeClass_DOUBLE )
+ if( eClass == ::com::sun::star::uno::TypeClass_DOUBLE )
{
fResult = * reinterpret_cast< const double * >( rAny.getValue() );
}
diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx
index c7cda6189680..e4fc0ea2ecfc 100644
--- a/chart2/source/inc/DiagramHelper.hxx
+++ b/chart2/source/inc/DiagramHelper.hxx
@@ -38,6 +38,8 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <utility>
#include <vector>
@@ -240,6 +242,21 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem > & xCooSys );
+ static void switchToDateCategories(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+
+ static void switchToTextCategories(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+
+ static bool isSupportingDateAxis( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram );
+ static bool isDateNumberFormat( sal_Int32 nNumberFormat, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& xNumberFormats );
+ static sal_Int32 getDateNumberFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
+
+ static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
+
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartType >
getChartTypeByIndex( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/ExplicitCategoriesProvider.hxx b/chart2/source/inc/ExplicitCategoriesProvider.hxx
index 18d54eb6e2ad..f8d17c277036 100644
--- a/chart2/source/inc/ExplicitCategoriesProvider.hxx
+++ b/chart2/source/inc/ExplicitCategoriesProvider.hxx
@@ -58,6 +58,24 @@ public:
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > getStringsForLevel( sal_Int32 nIndex ) const = 0;
};
+struct DatePlusIndex
+{
+ DatePlusIndex()
+ : fValue(1.0)
+ , nIndex( -1 )
+ {
+ }
+
+ DatePlusIndex( const double& _fValue, sal_Int32 _nIndex )
+ : fValue(_fValue)
+ , nIndex( _nIndex )
+ {
+ }
+
+ double fValue;
+ sal_Int32 nIndex;
+};
+
class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider
{
public:
@@ -70,6 +88,9 @@ public:
void init();
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSequence > getOriginalCategories();
+
::com::sun::star::uno::Sequence< ::rtl::OUString > getSimpleCategories();
::std::vector< ComplexCategory > getCategoriesByLevel( sal_Int32 nLevel );
@@ -83,23 +104,37 @@ public:
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getExplicitSimpleCategories(
const SplitCategoriesProvider& rSplitCategoriesProvider );
+ static void convertCategoryAnysToText( ::com::sun::star::uno::Sequence< rtl::OUString >& rOutTexts
+ , const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rInAnys
+ , ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xChartModel );
+
bool hasComplexCategories() const;
sal_Int32 getCategoryLevelCount() const;
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> >& getSplitCategoriesList();
+ bool isDateAxis();
+ const std::vector< DatePlusIndex >& getDateCategories();
+
private: //member
- ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aExplicitCategories;
- ::std::vector< ::std::vector< ComplexCategory > > m_aComplexCats;
bool volatile m_bDirty;
-
::com::sun::star::uno::WeakReference<
- ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
+ ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
+ ::com::sun::star::uno::WeakReference<
+ ::com::sun::star::frame::XModel > m_xChartModel;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> m_xOriginalCategories;
+
+ bool m_bIsExplicitCategoriesInited;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aExplicitCategories;
+ ::std::vector< ::std::vector< ComplexCategory > > m_aComplexCats;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> > m_aSplitCategoriesList;
+
+ bool m_bIsDateAxis;
+ bool m_bIsAutoDate;
+ std::vector< DatePlusIndex > m_aDateCategories;
};
} // namespace chart
diff --git a/chart2/source/inc/InternalData.hxx b/chart2/source/inc/InternalData.hxx
index 6b6590cffdac..48a8ee86f6ab 100755
--- a/chart2/source/inc/InternalData.hxx
+++ b/chart2/source/inc/InternalData.hxx
@@ -53,11 +53,11 @@ public:
void setColumnValues( sal_Int32 nColumnIndex, const ::std::vector< double > & rNewData );
void setRowValues( sal_Int32 nRowIndex, const ::std::vector< double > & rNewData );
- void setComplexColumnLabel( sal_Int32 nColumnIndex, const ::std::vector< ::rtl::OUString >& rComplexLabel );
- void setComplexRowLabel( sal_Int32 nRowIndex, const ::std::vector< ::rtl::OUString >& rComplexLabel );
+ void setComplexColumnLabel( sal_Int32 nColumnIndex, const ::std::vector< ::com::sun::star::uno::Any >& rComplexLabel );
+ void setComplexRowLabel( sal_Int32 nRowIndex, const ::std::vector< ::com::sun::star::uno::Any >& rComplexLabel );
- ::std::vector< ::rtl::OUString > getComplexColumnLabel( sal_Int32 nColumnIndex ) const;
- ::std::vector< ::rtl::OUString > getComplexRowLabel( sal_Int32 nRowIndex ) const;
+ ::std::vector< ::com::sun::star::uno::Any > getComplexColumnLabel( sal_Int32 nColumnIndex ) const;
+ ::std::vector< ::com::sun::star::uno::Any > getComplexRowLabel( sal_Int32 nRowIndex ) const;
void swapRowWithNext( sal_Int32 nRowIndex );
void swapColumnWithNext( sal_Int32 nColumnIndex );
@@ -76,12 +76,12 @@ public:
sal_Int32 getColumnCount() const;
typedef ::std::valarray< double > tDataType;
- typedef ::std::vector< ::std::vector< ::rtl::OUString > > tVecVecString; //inner index is hierarchical level
+ typedef ::std::vector< ::std::vector< ::com::sun::star::uno::Any > > tVecVecAny; //inner index is hierarchical level
- void setComplexRowLabels( const tVecVecString& rNewRowLabels );
- tVecVecString getComplexRowLabels() const;
- void setComplexColumnLabels( const tVecVecString& rNewColumnLabels );
- tVecVecString getComplexColumnLabels() const;
+ void setComplexRowLabels( const tVecVecAny& rNewRowLabels );
+ tVecVecAny getComplexRowLabels() const;
+ void setComplexColumnLabels( const tVecVecAny& rNewColumnLabels );
+ tVecVecAny getComplexColumnLabels() const;
#if OSL_DEBUG_LEVEL > 2
void traceData() const;
@@ -99,9 +99,9 @@ private:
sal_Int32 m_nColumnCount;
sal_Int32 m_nRowCount;
- tDataType m_aData;
- tVecVecString m_aRowLabels;//outer index is row index, inner index is category level
- tVecVecString m_aColumnLabels;//outer index is column index
+ tDataType m_aData;
+ tVecVecAny m_aRowLabels;//outer index is row index, inner index is category level
+ tVecVecAny m_aColumnLabels;//outer index is column index
};
#endif
diff --git a/chart2/source/inc/InternalDataProvider.hxx b/chart2/source/inc/InternalDataProvider.hxx
index f5e12f87f505..e467a9746df4 100644
--- a/chart2/source/inc/InternalDataProvider.hxx
+++ b/chart2/source/inc/InternalDataProvider.hxx
@@ -30,7 +30,8 @@
#include "InternalData.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
+#include <com/sun/star/chart/XDateCategories.hpp>
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
@@ -38,7 +39,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <cppuhelper/implbase6.hxx>
+#include <cppuhelper/implbase7.hxx>
#include "ServiceMacros.hxx"
#include "CachedDataSequence.hxx"
@@ -52,10 +53,11 @@ namespace chart
namespace impl
{
-typedef ::cppu::WeakImplHelper6<
+typedef ::cppu::WeakImplHelper7<
::com::sun::star::chart2::XInternalDataProvider,
::com::sun::star::chart2::data::XRangeXMLConversion,
- ::com::sun::star::chart::XComplexDescriptionAccess,
+ ::com::sun::star::chart2::XAnyDescriptionAccess,
+ ::com::sun::star::chart::XDateCategories,
::com::sun::star::util::XCloneable,
::com::sun::star::lang::XInitialization,
::com::sun::star::lang::XServiceInfo >
@@ -149,7 +151,25 @@ public:
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
- // ____ XComplexDescriptionAccess ____
+ // ____ XDateCategories ____
+ virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getDateCategories() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDateCategories( const ::com::sun::star::uno::Sequence< double >& rDates ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XAnyDescriptionAccess ____
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyRowDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aRowDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyColumnDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyColumnDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aColumnDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XComplexDescriptionAccess (base of XAnyDescriptionAccess) ____
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL
getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setComplexRowDescriptions(
diff --git a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx b/chart2/source/inc/NumberFormatterWrapper.hxx
index 9f5f44107997..e4ef4b8600db 100644..100755
--- a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx
+++ b/chart2/source/inc/NumberFormatterWrapper.hxx
@@ -24,12 +24,12 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX
-#define _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX
+#ifndef _CHART2_TOOLS_NUMBERFORMATTERWRAPPER_HXX
+#define _CHART2_TOOLS_NUMBERFORMATTERWRAPPER_HXX
+#include "charttoolsdllapi.hxx"
#include <svl/zforlist.hxx>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include "chartviewdllapi.hxx"
//.............................................................................
namespace chart
@@ -41,7 +41,7 @@ namespace chart
*/
class FixedNumberFormatter;
-class OOO_DLLPUBLIC_CHARTVIEW NumberFormatterWrapper
+class OOO_DLLPUBLIC_CHARTTOOLS NumberFormatterWrapper
{
public:
NumberFormatterWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xSupplier );
@@ -52,6 +52,7 @@ public:
getNumberFormatsSupplier() { return m_xNumberFormatsSupplier; };
rtl::OUString getFormattedString( sal_Int32 nNumberFormatKey, double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const;
+ Date getNullDate() const;
private: //private member
::com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatsSupplier >
@@ -62,7 +63,7 @@ private: //private member
};
-class FixedNumberFormatter
+class OOO_DLLPUBLIC_CHARTTOOLS FixedNumberFormatter
{
public:
FixedNumberFormatter( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xSupplier
diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc
index 47ed75e80a9a..d7c490c1ca87 100644
--- a/chart2/source/inc/Strings.hrc
+++ b/chart2/source/inc/Strings.hrc
@@ -30,8 +30,8 @@
// this includes no link dependency
#include <svl/solar.hrc>
-//next free is 291
-//single free is: 134
+//next free is 293
+//single free: 139
//#define RID_APP_START 30000
////#define STR_NULL (RID_APP_START + 1)
@@ -165,6 +165,8 @@
#define STR_STEP_GT_ZERO (RID_APP_START + 102)
#define STR_BAD_LOGARITHM (RID_APP_START + 111)
#define STR_MIN_GREATER_MAX (RID_APP_START + 101)
+#define STR_INVALID_INTERVALS (RID_APP_START + 291)
+#define STR_INVALID_TIME_UNIT (RID_APP_START + 292)
//-----------------------------------------------------------------------------
//for range didalog
@@ -310,6 +312,7 @@
#define STR_ACTION_TOGGLE_GRID_HORZ (RID_APP_START + 86)
#define STR_ACTION_SCALE_TEXT (RID_APP_START + 93)
#define STR_ACTION_REARRANGE_CHART (RID_APP_START + 94)
+#define STR_ACTION_EDIT_TEXT (RID_APP_START + 95)
#define STR_TIP_CHOOSECOLOR (RID_APP_START + 233)
#define STR_TIP_LIGHTSOURCE_X (RID_APP_START + 234)
@@ -324,7 +327,6 @@
#define STR_TIP_DATAPOINT (RID_APP_START + 140)
#define STR_TIP_DATAPOINT_INDEX (RID_APP_START + 141)
#define STR_TIP_DATAPOINT_VALUES (RID_APP_START + 142)
-#define STR_TIP_CATEGORY_VALUE (RID_APP_START + 139)
//-----------------------------------------------------------------------------
//warning and info boxes
diff --git a/chart2/source/inc/UndoGuard.hxx b/chart2/source/inc/UndoGuard.hxx
deleted file mode 100644
index 864d5ccff994..000000000000
--- a/chart2/source/inc/UndoGuard.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART2_UNDOGUARD_HXX
-#define CHART2_UNDOGUARD_HXX
-
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
-
-// header for class OUString
-#include <rtl/ustring.hxx>
-
-namespace chart
-{
-/** Base Class for UndoGuard and UndoLiveUpdateGuard
-*/
-class UndoGuard_Base
-{
-public:
- explicit UndoGuard_Base( const rtl::OUString & rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoGuard_Base();
-
- void commitAction();
-
-protected:
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > m_xModel;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
-
- rtl::OUString m_aUndoString;
- bool m_bActionPosted;
-};
-
-/** This guard calls preAction at the given Model in the CTOR and
- cancelAction in the DTOR if no other method is called.
- If commitAction is called the destructor does nothin anymore.
- */
-class UndoGuard : public UndoGuard_Base
-{
-public:
- explicit UndoGuard( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoGuard();
-};
-
-/** This guard calls preAction at the given Model in the CTOR and
- cancelActionUndo in the DTOR if no other method is called.
- If commitAction is called the destructor does nothin anymore.
- */
-class UndoLiveUpdateGuard : public UndoGuard_Base
-{
-public:
- explicit UndoLiveUpdateGuard( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoLiveUpdateGuard();
-};
-
-/** Same as UndoLiveUpdateGuard but with additional storage of the chart's data.
- Only use this if the data has internal data.
- */
-class UndoLiveUpdateGuardWithData :
- public UndoGuard_Base
-{
-public:
- explicit UndoLiveUpdateGuardWithData( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoLiveUpdateGuardWithData();
-};
-
-class UndoGuardWithSelection : public UndoGuard_Base
-{
-public:
- explicit UndoGuardWithSelection( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoGuardWithSelection();
-};
-
-}
-// CHART2_UNDOGUARD_HXX
-#endif
diff --git a/chart2/source/inc/UndoManager.hxx b/chart2/source/inc/UndoManager.hxx
deleted file mode 100644
index a28a0d78c470..000000000000
--- a/chart2/source/inc/UndoManager.hxx
+++ /dev/null
@@ -1,180 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART2_UNDOMANAGER_HXX
-#define CHART2_UNDOMANAGER_HXX
-
-#include "ConfigItemListener.hxx"
-#include "MutexContainer.hxx"
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
-#include <com/sun/star/util/XModifyListener.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
-#include <com/sun/star/chart2/XUndoHelper.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-
-#include <cppuhelper/compbase4.hxx>
-#include <rtl/ustring.hxx>
-
-// for pair
-#include <utility>
-// for auto_ptr
-#include <memory>
-
-class SdrUndoAction;
-
-namespace com { namespace sun { namespace star {
-namespace frame {
- class XModel;
-}
-}}}
-
-namespace chart
-{
-// ----------------------------------------
-namespace impl
-{
-
-class UndoStepsConfigItem;
-class UndoElement;
-class UndoStack;
-class ModifyBroadcaster;
-
-typedef ::cppu::WeakComponentImplHelper4<
- ::com::sun::star::util::XModifyBroadcaster,
- ::com::sun::star::chart2::XUndoManager,
- ::com::sun::star::chart2::XUndoHelper,
- ::com::sun::star::lang::XUnoTunnel >
- UndoManager_Base;
-
-} // namespace impl
-// ----------------------------------------
-
-/** Manages undo by storing the entire XModel in the undo- and redo-buffers.
- Note, that therefore this should not be used for "big" XModels.
-
- A prerequisite for this to work is that the XModels added to the undo-
- redo-stacks support the css::util::XCloneable interface, which is
- implemented such that the entire model is cloned.
- */
-class UndoManager :
- public MutexContainer,
- public ConfigItemListener,
- public impl::UndoManager_Base
-{
-public:
- explicit UndoManager();
- virtual ~UndoManager();
-
- void addShapeUndoAction( SdrUndoAction* pAction );
-
- // ____ XUnoTunnel ____
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId )
- throw (::com::sun::star::uno::RuntimeException);
-
- static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
- static UndoManager* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xObj );
-
-protected:
- // ____ ConfigItemListener ____
- virtual void notify( const ::rtl::OUString & rPropertyName );
-
- // ____ util::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);
-
- // ____ chart2::XUndoManager ____
- virtual void SAL_CALL preAction( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelBeforeChange )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL preActionWithArguments(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelBeforeChange,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL postAction( const ::rtl::OUString& aUndoText )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelAction()
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelActionWithUndo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelToRestore )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL undo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xCurrentModel )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL redo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xCurrentModel )
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL undoPossible()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL redoPossible()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCurrentUndoString()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCurrentRedoString()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoStrings()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoStrings()
- throw (::com::sun::star::uno::RuntimeException);
-
- // ____ XUndoHelper ____
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModelCloneForUndo(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelBeforeChange )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL applyModelContent(
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelToChange,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelToCopyFrom )
- throw (::com::sun::star::uno::RuntimeException);
-
-private:
- void retrieveConfigUndoSteps();
- void fireModifyEvent();
- void impl_undoRedo(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xCurrentModel,
- impl::UndoStack * pStackToRemoveFrom,
- impl::UndoStack * pStackToAddTo,
- bool bUndo = true );
-
- ::std::auto_ptr< impl::UndoStack > m_apUndoStack;
- ::std::auto_ptr< impl::UndoStack > m_apRedoStack;
-
- impl::UndoElement * m_pLastRemeberedUndoElement;
-
- ::std::auto_ptr< impl::UndoStepsConfigItem > m_apUndoStepsConfigItem;
- sal_Int32 m_nMaxNumberOfUndos;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::util::XModifyBroadcaster > m_xModifyBroadcaster;
- // pointer is valid as long as m_xModifyBroadcaster.is()
- impl::ModifyBroadcaster * m_pModifyBroadcaster;
-};
-
-} // namespace chart
-
-// CHART2_UNDOMANAGER_HXX
-#endif
diff --git a/chart2/source/inc/chartview/ChartSfxItemIds.hxx b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
index fbcce70bd1d6..b6390ab12b22 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -27,13 +27,6 @@
#ifndef CHARTSFXITEMIDS_HXX
#define CHARTSFXITEMIDS_HXX
-#include <sfx2/sfxdefs.hxx>
-
-/*
-// header for SID_OBJ1_START
-#include <sfx2/sfxsids.hrc>
-*/
-
// ============================================================
// SCHATTR
// ============================================================
@@ -49,68 +42,23 @@
#define SCHATTR_DATADESCR_PLACEMENT (SCHATTR_DATADESCR_START + 5)
#define SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS (SCHATTR_DATADESCR_START + 6)
#define SCHATTR_DATADESCR_NO_PERCENTVALUE (SCHATTR_DATADESCR_START + 7) //percentage values should not be offered
-#define SCHATTR_DATADESCR_END SCHATTR_DATADESCR_NO_PERCENTVALUE
+#define SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_DATADESCR_START + 8)
+#define SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_DATADESCR_START + 9)
+#define SCHATTR_DATADESCR_END SCHATTR_PERCENT_NUMBERFORMAT_SOURCE
+//legend
#define SCHATTR_LEGEND_START (SCHATTR_DATADESCR_END + 1)
#define SCHATTR_LEGEND_POS SCHATTR_LEGEND_START
#define SCHATTR_LEGEND_END SCHATTR_LEGEND_POS
+//text
#define SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1)
-// #define SCHATTR_TEXT_ORIENT SCHATTR_TEXT_START
-// name changed:
-#define SCHATTR_TEXT_STACKED SCHATTR_TEXT_START
-#define SCHATTR_TEXT_ORDER (SCHATTR_TEXT_START + 1)
-#define SCHATTR_TEXT_END SCHATTR_TEXT_ORDER
-
-#define SCHATTR_Y_AXIS_START (SCHATTR_TEXT_END + 1)
-#define SCHATTR_Y_AXIS_AUTO_MIN SCHATTR_Y_AXIS_START
-#define SCHATTR_Y_AXIS_MIN (SCHATTR_Y_AXIS_START + 1)
-#define SCHATTR_Y_AXIS_AUTO_MAX (SCHATTR_Y_AXIS_START + 2)
-#define SCHATTR_Y_AXIS_MAX (SCHATTR_Y_AXIS_START + 3)
-#define SCHATTR_Y_AXIS_AUTO_STEP_MAIN (SCHATTR_Y_AXIS_START + 4)
-#define SCHATTR_Y_AXIS_STEP_MAIN (SCHATTR_Y_AXIS_START + 5)
-#define SCHATTR_Y_AXIS_AUTO_STEP_HELP (SCHATTR_Y_AXIS_START + 6)
-#define SCHATTR_Y_AXIS_STEP_HELP (SCHATTR_Y_AXIS_START + 7)
-#define SCHATTR_Y_AXIS_LOGARITHM (SCHATTR_Y_AXIS_START + 8)
-#define SCHATTR_Y_AXIS_AUTO_ORIGIN (SCHATTR_Y_AXIS_START + 9)
-#define SCHATTR_Y_AXIS_ORIGIN (SCHATTR_Y_AXIS_START + 10)
-#define SCHATTR_Y_AXIS_END SCHATTR_Y_AXIS_ORIGIN
-
-#define SCHATTR_X_AXIS_START (SCHATTR_Y_AXIS_END + 1)
-#define SCHATTR_X_AXIS_AUTO_MIN SCHATTR_X_AXIS_START
-#define SCHATTR_X_AXIS_MIN (SCHATTR_X_AXIS_START + 1)
-#define SCHATTR_X_AXIS_AUTO_MAX (SCHATTR_X_AXIS_START + 2)
-#define SCHATTR_X_AXIS_MAX (SCHATTR_X_AXIS_START + 3)
-#define SCHATTR_X_AXIS_AUTO_STEP_MAIN (SCHATTR_X_AXIS_START + 4)
-#define SCHATTR_X_AXIS_STEP_MAIN (SCHATTR_X_AXIS_START + 5)
-#define SCHATTR_X_AXIS_AUTO_STEP_HELP (SCHATTR_X_AXIS_START + 6)
-#define SCHATTR_X_AXIS_STEP_HELP (SCHATTR_X_AXIS_START + 7)
-#define SCHATTR_X_AXIS_LOGARITHM (SCHATTR_X_AXIS_START + 8)
-#define SCHATTR_X_AXIS_AUTO_ORIGIN (SCHATTR_X_AXIS_START + 9)
-#define SCHATTR_X_AXIS_ORIGIN (SCHATTR_X_AXIS_START + 10)
-#define SCHATTR_X_AXIS_END SCHATTR_X_AXIS_ORIGIN
+#define SCHATTR_TEXT_DEGREES SCHATTR_TEXT_START
+#define SCHATTR_TEXT_STACKED (SCHATTR_TEXT_START + 1)
+#define SCHATTR_TEXT_END SCHATTR_TEXT_STACKED
-#define SCHATTR_Z_AXIS_START (SCHATTR_X_AXIS_END + 1)
-#define SCHATTR_Z_AXIS_AUTO_MIN SCHATTR_Z_AXIS_START
-#define SCHATTR_Z_AXIS_MIN (SCHATTR_Z_AXIS_START + 1)
-#define SCHATTR_Z_AXIS_AUTO_MAX (SCHATTR_Z_AXIS_START + 2)
-#define SCHATTR_Z_AXIS_MAX (SCHATTR_Z_AXIS_START + 3)
-#define SCHATTR_Z_AXIS_AUTO_STEP_MAIN (SCHATTR_Z_AXIS_START + 4)
-#define SCHATTR_Z_AXIS_STEP_MAIN (SCHATTR_Z_AXIS_START + 5)
-#define SCHATTR_Z_AXIS_AUTO_STEP_HELP (SCHATTR_Z_AXIS_START + 6)
-#define SCHATTR_Z_AXIS_STEP_HELP (SCHATTR_Z_AXIS_START + 7)
-#define SCHATTR_Z_AXIS_LOGARITHM (SCHATTR_Z_AXIS_START + 8)
-#define SCHATTR_Z_AXIS_AUTO_ORIGIN (SCHATTR_Z_AXIS_START + 9)
-#define SCHATTR_Z_AXIS_ORIGIN (SCHATTR_Z_AXIS_START + 10)
-#define SCHATTR_Z_AXIS_END SCHATTR_Z_AXIS_ORIGIN
-
-// miscellaneous
-
-#define SCHATTR_AXISTYPE (SCHATTR_Z_AXIS_END + 1)
-#define SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_Z_AXIS_END + 2)
-#define SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_Z_AXIS_END + 3)
-
-#define SCHATTR_STAT_START (SCHATTR_PERCENT_NUMBERFORMAT_SOURCE + 1)
+// statistic
+#define SCHATTR_STAT_START (SCHATTR_TEXT_END + 1)
#define SCHATTR_STAT_AVERAGE SCHATTR_STAT_START
#define SCHATTR_STAT_KIND_ERROR (SCHATTR_STAT_START + 1)
#define SCHATTR_STAT_PERCENT (SCHATTR_STAT_START + 2)
@@ -122,16 +70,11 @@
#define SCHATTR_STAT_RANGE_NEG (SCHATTR_STAT_START + 8)
#define SCHATTR_STAT_END SCHATTR_STAT_RANGE_NEG
-#define SCHATTR_TEXT2_START ( SCHATTR_STAT_END + 1)
-#define SCHATTR_TEXT_DEGREES ( SCHATTR_TEXT2_START )
-#define SCHATTR_TEXT_OVERLAP (SCHATTR_TEXT2_START +1)
-#define SCHATTR_TEXT2_END ( SCHATTR_TEXT_OVERLAP )
-
// --------------------------------------------------------
// these attributes are for replacement of enum eChartStyle
// --------------------------------------------------------
-#define SCHATTR_STYLE_START ( SCHATTR_TEXT2_END +1 )
+#define SCHATTR_STYLE_START ( SCHATTR_STAT_END +1 )
// for whole chart
#define SCHATTR_STYLE_DEEP ( SCHATTR_STYLE_START )
@@ -155,35 +98,44 @@
#define SCHATTR_AXIS (SCHATTR_STYLE_END + 1)// see chtmodel.hxx defines CHART_AXIS_PRIMARY_X, etc.
//Ummappen:
#define SCHATTR_AXIS_START (SCHATTR_AXIS + 1)
-#define SCHATTR_AXIS_AUTO_MIN SCHATTR_AXIS_START
-#define SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 1)
-#define SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 2)
-#define SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 3)
-#define SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 4)
-#define SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 5)
-#define SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 6)
-// SCHATTR_AXIS_STEP_HELP: type changed from double to sal_Int32 !
-#define SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 7)
-#define SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 8)
-#define SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 9)
-#define SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 10)
-//Neu:
-#define SCHATTR_AXIS_TICKS (SCHATTR_AXIS_START + 11)
-#define SCHATTR_AXIS_NUMFMT (SCHATTR_AXIS_START + 12)
-#define SCHATTR_AXIS_NUMFMTPERCENT (SCHATTR_AXIS_START + 13)
-#define SCHATTR_AXIS_SHOWAXIS (SCHATTR_AXIS_START + 14)
-#define SCHATTR_AXIS_SHOWDESCR (SCHATTR_AXIS_START + 15)
-#define SCHATTR_AXIS_SHOWMAINGRID (SCHATTR_AXIS_START + 16)
-#define SCHATTR_AXIS_SHOWHELPGRID (SCHATTR_AXIS_START + 17)
-#define SCHATTR_AXIS_TOPDOWN (SCHATTR_AXIS_START + 18)
-#define SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_START + 19)
-#define SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 20)
-#define SCHATTR_AXIS_POSITION (SCHATTR_AXIS_START + 21)
-#define SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_START + 22)
-#define SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_START + 23)
-#define SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_START + 24)
-#define SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_START + 25)
-#define SCHATTR_AXIS_END SCHATTR_AXIS_MARK_POSITION
+//axis scale
+#define SCHATTR_AXISTYPE SCHATTR_AXIS_START
+#define SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 1)
+#define SCHATTR_AXIS_AUTO_MIN (SCHATTR_AXIS_START + 2)
+#define SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 3)
+#define SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 4)
+#define SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 5)
+#define SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 6)
+#define SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 7)
+#define SCHATTR_AXIS_MAIN_TIME_UNIT (SCHATTR_AXIS_START + 8)
+#define SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 9)
+#define SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 10)
+#define SCHATTR_AXIS_HELP_TIME_UNIT (SCHATTR_AXIS_START + 11)
+#define SCHATTR_AXIS_AUTO_TIME_RESOLUTION (SCHATTR_AXIS_START + 12)
+#define SCHATTR_AXIS_TIME_RESOLUTION (SCHATTR_AXIS_START + 13)
+#define SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 14)
+#define SCHATTR_AXIS_AUTO_DATEAXIS (SCHATTR_AXIS_START + 15)
+#define SCHATTR_AXIS_ALLOW_DATEAXIS (SCHATTR_AXIS_START + 16)
+#define SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 17)
+#define SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 18)
+//axis position
+#define SCHATTR_AXIS_POSITION_START (SCHATTR_AXIS_ORIGIN +1)
+#define SCHATTR_AXIS_TICKS SCHATTR_AXIS_POSITION_START
+#define SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_POSITION_START + 1)
+#define SCHATTR_AXIS_POSITION (SCHATTR_AXIS_POSITION_START + 2)
+#define SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_POSITION_START + 3)
+#define SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_POSITION_START + 4)
+#define SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_POSITION_START + 5)
+#define SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_POSITION_START + 6)
+//axis label
+#define SCHATTR_AXIS_LABEL_START (SCHATTR_AXIS_MARK_POSITION +1)
+#define SCHATTR_AXIS_SHOWDESCR SCHATTR_AXIS_LABEL_START
+#define SCHATTR_AXIS_LABEL_ORDER (SCHATTR_AXIS_LABEL_START + 1)
+#define SCHATTR_AXIS_LABEL_OVERLAP (SCHATTR_AXIS_LABEL_START + 2)
+#define SCHATTR_AXIS_LABEL_BREAK (SCHATTR_AXIS_LABEL_START + 3)
+#define SCHATTR_AXIS_LABEL_END SCHATTR_AXIS_LABEL_BREAK
+
+#define SCHATTR_AXIS_END SCHATTR_AXIS_LABEL_END
#define SCHATTR_SYMBOL_BRUSH (SCHATTR_AXIS_END + 1)
#define SCHATTR_STOCK_VOLUME (SCHATTR_AXIS_END + 2)
@@ -201,13 +153,12 @@
#define SCHATTR_SPLINE_ORDER (SCHATTR_CHARTTYPE_START + 4)
#define SCHATTR_SPLINE_RESOLUTION (SCHATTR_CHARTTYPE_START + 5)
#define SCHATTR_DIAGRAM_STYLE (SCHATTR_CHARTTYPE_START + 6)
-#define SCHATTR_TEXTBREAK (SCHATTR_CHARTTYPE_START + 7)
-#define SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 8)
-#define SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 9)
-#define SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 10)
-#define SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 11)
-#define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 12)
-#define SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 13)
+#define SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 7)
+#define SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 8)
+#define SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 9)
+#define SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 10)
+#define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 11)
+#define SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 12)
#define SCHATTR_CHARTTYPE_END SCHATTR_INCLUDE_HIDDEN_CELLS
@@ -236,9 +187,11 @@
#define CHAXIS_MARK_NONE 0
// values for SCHATTR_AXISTYPE items
-#define CHART_AXIS_X 0
-#define CHART_AXIS_Y 1
-#define CHART_AXIS_Z 2
+#define CHART_AXIS_REALNUMBER 0
+#define CHART_AXIS_PERCENT 1
+#define CHART_AXIS_CATEGORY 2
+#define CHART_AXIS_SERIES 3
+#define CHART_AXIS_DATE 4
// values for SCHATTR_STYLE_SHAPE items
#define CHART_SHAPE3D_IGNORE -2 //intern! (GetChartShapeStyle()!)
diff --git a/chart2/source/inc/chartview/ExplicitScaleValues.hxx b/chart2/source/inc/chartview/ExplicitScaleValues.hxx
new file mode 100644
index 000000000000..48c9ef942d03
--- /dev/null
+++ b/chart2/source/inc/chartview/ExplicitScaleValues.hxx
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_EXPLICITSCALEVALUES_HXX
+#define _CHART2_EXPLICITSCALEVALUES_HXX
+
+#include "chartviewdllapi.hxx"
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <com/sun/star/chart2/AxisOrientation.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/XScaling.hpp>
+#include <tools/date.hxx>
+#include <vector>
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+//-----------------------------------------------------------------------------
+/** This structure contains the explicit values for a scale like Minimum and Maximum.
+ See also ::com::sun::star::chart2::ScaleData.
+*/
+
+struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData
+{
+ ExplicitScaleData();
+
+ double Minimum;
+ double Maximum;
+ double Origin;
+
+ ::com::sun::star::chart2::AxisOrientation Orientation;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > Scaling;
+
+ sal_Int32 AxisType;//see ::com::sun::star::chart2::AxisType
+ bool ShiftedCategoryPosition;
+ sal_Int32 TimeResolution; //constant of type <type>::com::sun::star::chart::TimeUnit</type>
+ Date NullDate;
+};
+
+struct OOO_DLLPUBLIC_CHARTVIEW ExplicitSubIncrement
+{
+ ExplicitSubIncrement();
+
+ /** Numbers of intervals between two superior ticks. For an axis
+ this usually means, that <code>IntervalCount - 1</code>
+ sub-tick-marks are displayed between two superior ticks.
+
+ */
+ sal_Int32 IntervalCount;
+
+ /** If <TRUE/>, the distance between two sub-tick-marks on the
+ screen is always the same. If <FALSE/>, the distances may
+ differ depending on the <type>XScaling</type>.
+ */
+ bool PostEquidistant;
+};
+
+/** describes how tickmarks are positioned on the scale of an axis.
+*/
+struct OOO_DLLPUBLIC_CHARTVIEW ExplicitIncrementData
+{
+ ExplicitIncrementData();
+
+ /** the following two members are only for date-time axis
+ */
+ ::com::sun::star::chart::TimeInterval MajorTimeInterval;
+ ::com::sun::star::chart::TimeInterval MinorTimeInterval;
+
+ /** the other members are for *not* date-time axis
+ */
+
+ /** <member>Distance</member> describes the distance between two
+ neighboring main tickmarks on a <type>Scale</type> of an axis.
+ All neighboring main tickmarks have the same constant distance.
+
+ <p>If the Scale has a <type>XScaling</type> the <member>Distance</member>
+ may be measured in two different ways - that is - before or after the
+ scaling is applied.</p>
+
+ <p>On a logarithmic scale for example the distance between two main
+ tickmarks is typically measured after the scaling is applied:
+ Distance = log(tick2)-log(tick1)
+ ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ).
+ The resulting tickmarks will always look equidistant on the screen.
+ The other possibility is to have a Distance = tick2-tick1 measured constant
+ before a scaling is applied, which may lead to non equidistant tickmarks
+ on the screen.</p>
+
+ <p><member>PostEquidistant</member> rules wether the <member>Distance</member>
+ is meant to be a value before or after scaling.</p>
+ */
+ double Distance;
+
+ /**
+ <member>PostEquidistant</member> rules wether the member <member>Distance</member>
+ describes a distance before or after the scaling is applied.
+
+ <p>If <member>PostEquidistant</member> equals <TRUE/> <member>Distance</member>
+ is given in values after <type>XScaling</type> is applied, thus resulting
+ main tickmarks will always look equidistant on the screen.
+ If <member>PostEquidistant</member> equals <FALSE/> <member>Distance</member>
+ is given in values before <type>XScaling</type> is applied.</p>
+ */
+ bool PostEquidistant;
+
+ /** The <member>BaseValue</member> gives a starting point on the scale
+ to which all further main tickmarks are relatively positioned.
+
+ <p>The <member>BaseValue</member> is always a value on the scale before
+ a possible scaling is applied. If the given value is not valid in the
+ associated scaling the minimum of the scaling is assumed,
+ if there is no minimum any other obvious value will be assumed.</p>
+
+ <p>E.g.: assume a scale from 0 to 6 with identical scaling.
+ Further assume this Increment to have Distance==2 and PostEquidistant==false.
+ Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6;
+ Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3;
+ Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3;
+ And setting BaseValue to 2, -2, 4, -4 etc. in this example
+ leads to the same result as BaseValue=0.</p>
+ */
+ double BaseValue;
+
+ /** <member>SubIncrements</member> describes the positioning of further
+ sub tickmarks on the scale of an axis.
+
+ <p>The first SubIncrement in this sequence determines how the
+ distance between two neighboring main tickmarks is divided for positioning
+ of further sub tickmarks. Every following SubIncrement determines the
+ positions of subsequent tickmarks in relation to their parent tickmarks
+ iven by the preceding SubIncrement.</p>
+ */
+ ::std::vector< ExplicitSubIncrement > SubIncrements;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
index d10ee8d415fc..6e2fef8feb36 100644
--- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx
+++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
@@ -27,9 +27,9 @@
#ifndef _CHART2_EXPLICITVALUEPROVIDER_HXX
#define _CHART2_EXPLICITVALUEPROVIDER_HXX
+#include "ExplicitScaleValues.hxx"
+
#include <boost/shared_ptr.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
@@ -59,8 +59,8 @@ public:
*/
virtual sal_Bool getExplicitValuesForAxis(
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > xAxis
- , ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale
- , ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement )=0;
+ , ExplicitScaleData& rExplicitScale
+ , ExplicitIncrementData& rExplicitIncrement )=0;
/** for rotated objects the shape size and position differs from the visible rectangle
if bSnapRect is set to true you get the resulting visible position (left-top) and size
@@ -99,9 +99,6 @@ public:
, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
- SAL_DLLPRIVATE static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
- ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
-
static sal_Int32 getExplicitNumberFormatKeyForDataLabel(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesOrPointProp
, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries
diff --git a/chart2/source/inc/servicenames.hxx b/chart2/source/inc/servicenames.hxx
index d1af0edb3335..43de8c3485d8 100644
--- a/chart2/source/inc/servicenames.hxx
+++ b/chart2/source/inc/servicenames.hxx
@@ -62,8 +62,6 @@ namespace chart
#define CHART_RENDERER_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.ChartRenderer")
-#define CHART_UNDOMANAGER_SERVICE_NAME ::rtl::OUString::createFromAscii( "com.sun.star.chart2.UndoManager" )
-
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx
index fc672e29b24c..658cfb2b4d6e 100644
--- a/chart2/source/model/inc/Diagram.hxx
+++ b/chart2/source/model/inc/Diagram.hxx
@@ -31,11 +31,13 @@
#include "MutexContainer.hxx"
#include <cppuhelper/implbase8.hxx>
#include <comphelper/uno3.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart/X3DDefaultSetter.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
@@ -117,8 +119,6 @@ protected:
// throw (::com::sun::star::lang::IllegalArgumentException);
// ____ XDiagram ____
-// virtual ::rtl::OUString SAL_CALL getChartTypeTemplateServiceName()
-// throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > SAL_CALL getWall()
throw (::com::sun::star::uno::RuntimeException);
@@ -136,7 +136,10 @@ protected:
virtual void SAL_CALL setDefaultColorScheme(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme >& xColorScheme )
throw (::com::sun::star::uno::RuntimeException);
-
+ virtual void SAL_CALL setDiagramData(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xDataSource,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
+ throw (::com::sun::star::uno::RuntimeException);
// ____ XCoordinateSystemContainer ____
virtual void SAL_CALL addCoordinateSystem(
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 95bc1315ad51..0d3b45367019 100755
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -42,6 +42,7 @@
#include "PageBackground.hxx"
#include "CloneHelper.hxx"
#include "NameContainer.hxx"
+#include "UndoManager.hxx"
#include <com/sun/star/chart/ChartDataRowSource.hpp>
@@ -73,6 +74,7 @@
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
using ::rtl::OUString;
using ::osl::MutexGuard;
@@ -103,6 +105,7 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
, m_bModified( sal_False )
, m_nInLoad(0)
, m_bUpdateNotificationsPending(false)
+ , m_pUndoManager( NULL )
, m_aControllers( m_aModelMutex )
, m_nControllerLockCount(0)
, m_xContext( xContext )
@@ -114,14 +117,21 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) ), uno::UNO_QUERY)
{
OSL_TRACE( "ChartModel: CTOR called" );
- osl_incrementInterlockedCount(&m_refCount);
- ModifyListenerHelper::addListener( m_xPageBackground, this );
- m_xChartTypeManager.set( xContext->getServiceManager()->createInstanceWithContext(
- C2U( "com.sun.star.chart2.ChartTypeManager" ), m_xContext ), uno::UNO_QUERY );
- m_xUndoManager = Reference< chart2::XUndoManager >(
- this->createInstance( CHART_UNDOMANAGER_SERVICE_NAME ), uno::UNO_QUERY );
+ osl_incrementInterlockedCount(&m_refCount);
+ {
+ m_xOldModelAgg.set(
+ m_xContext->getServiceManager()->createInstanceWithContext(
+ CHART_CHARTAPIWRAPPER_SERVICE_NAME,
+ m_xContext ), uno::UNO_QUERY_THROW );
+ m_xOldModelAgg->setDelegator( *this );
+ }
+ {
+ ModifyListenerHelper::addListener( m_xPageBackground, this );
+ m_xChartTypeManager.set( xContext->getServiceManager()->createInstanceWithContext(
+ C2U( "com.sun.star.chart2.ChartTypeManager" ), m_xContext ), uno::UNO_QUERY );
+ }
osl_decrementInterlockedCount(&m_refCount);
}
@@ -145,33 +155,39 @@ ChartModel::ChartModel( const ChartModel & rOther )
, m_aGraphicObjectVector( rOther.m_aGraphicObjectVector )
, m_xDataProvider( rOther.m_xDataProvider )
, m_xInternalDataProvider( rOther.m_xInternalDataProvider )
- , m_xUndoManager( rOther.m_xUndoManager )
{
OSL_TRACE( "ChartModel: Copy-CTOR called" );
- osl_incrementInterlockedCount(&m_refCount);
-
- Reference< util::XModifyListener > xListener;
- Reference< chart2::XTitle > xNewTitle = CreateRefClone< Reference< chart2::XTitle > >()( rOther.m_xTitle );
- Reference< chart2::XDiagram > xNewDiagram = CreateRefClone< Reference< chart2::XDiagram > >()( rOther.m_xDiagram );
- Reference< beans::XPropertySet > xNewPageBackground = CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xPageBackground );
- Reference< chart2::XChartTypeManager > xChartTypeManager = CreateRefClone< Reference< chart2::XChartTypeManager > >()( rOther.m_xChartTypeManager );
- Reference< container::XNameAccess > xXMLNamespaceMap = CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xXMLNamespaceMap );
+ osl_incrementInterlockedCount(&m_refCount);
{
- MutexGuard aGuard( m_aModelMutex );
- xListener = this;
- m_xTitle = xNewTitle;
- m_xDiagram = xNewDiagram;
- m_xPageBackground = xNewPageBackground;
- m_xChartTypeManager = xChartTypeManager;
- m_xXMLNamespaceMap = xXMLNamespaceMap;
- }
+ m_xOldModelAgg.set(
+ m_xContext->getServiceManager()->createInstanceWithContext(
+ CHART_CHARTAPIWRAPPER_SERVICE_NAME,
+ m_xContext ), uno::UNO_QUERY_THROW );
+ m_xOldModelAgg->setDelegator( *this );
- ModifyListenerHelper::addListener( xNewTitle, xListener );
- ModifyListenerHelper::addListener( xNewDiagram, xListener );
- ModifyListenerHelper::addListener( xNewPageBackground, xListener );
- xListener.clear();
+ Reference< util::XModifyListener > xListener;
+ Reference< chart2::XTitle > xNewTitle = CreateRefClone< Reference< chart2::XTitle > >()( rOther.m_xTitle );
+ Reference< chart2::XDiagram > xNewDiagram = CreateRefClone< Reference< chart2::XDiagram > >()( rOther.m_xDiagram );
+ Reference< beans::XPropertySet > xNewPageBackground = CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xPageBackground );
+ Reference< chart2::XChartTypeManager > xChartTypeManager = CreateRefClone< Reference< chart2::XChartTypeManager > >()( rOther.m_xChartTypeManager );
+ Reference< container::XNameAccess > xXMLNamespaceMap = CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xXMLNamespaceMap );
+ {
+ MutexGuard aGuard( m_aModelMutex );
+ xListener = this;
+ m_xTitle = xNewTitle;
+ m_xDiagram = xNewDiagram;
+ m_xPageBackground = xNewPageBackground;
+ m_xChartTypeManager = xChartTypeManager;
+ m_xXMLNamespaceMap = xXMLNamespaceMap;
+ }
+
+ ModifyListenerHelper::addListener( xNewTitle, xListener );
+ ModifyListenerHelper::addListener( xNewDiagram, xListener );
+ ModifyListenerHelper::addListener( xNewPageBackground, xListener );
+ xListener.clear();
+ }
osl_decrementInterlockedCount(&m_refCount);
}
@@ -179,7 +195,7 @@ ChartModel::~ChartModel()
{
OSL_TRACE( "ChartModel: DTOR called" );
if( m_xOldModelAgg.is())
- m_xOldModelAgg->setDelegator( 0 );
+ m_xOldModelAgg->setDelegator( NULL );
}
void SAL_CALL ChartModel::initialize( const Sequence< Any >& /*rArguments*/ )
@@ -518,6 +534,8 @@ uno::Reference< uno::XInterface > SAL_CALL ChartModel::getCurrentSelection() thr
//-----------------------------------------------------------------
void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
{
+ Reference< XInterface > xKeepAlive( *this );
+
//This object should release all resources and references in the
//easiest possible manner
//This object must notify all registered listeners using the method
@@ -530,6 +548,9 @@ void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
//--release all resources and references
//// @todo
+ if ( m_xDiagram.is() )
+ ModifyListenerHelper::removeListener( m_xDiagram, this );
+
m_xDataProvider.clear();
m_xInternalDataProvider.clear();
m_xNumberFormatsSupplier.clear();
@@ -540,26 +561,17 @@ void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
DisposeHelper::DisposeAndClear( m_xPageBackground );
DisposeHelper::DisposeAndClear( m_xXMLNamespaceMap );
- // not owner of storage
-// if( m_xStorage.is())
-// {
-// Reference< lang::XComponent > xComp( m_xStorage, uno::UNO_QUERY );
-// if( xComp.is())
-// xComp->dispose();
-// }
m_xStorage.clear();
+ // just clear, don't dispose - we're not the owner
- if( m_xOldModelAgg.is())
- {
- m_xOldModelAgg->setDelegator( 0 );
- m_xOldModelAgg.clear();
- }
+ if ( m_pUndoManager.is() )
+ m_pUndoManager->disposing();
+ m_pUndoManager.clear();
+ // that's important, since the UndoManager implementation delegates its ref counting to ourself.
m_aControllers.disposeAndClear( lang::EventObject( static_cast< cppu::OWeakObject * >( this )));
m_xCurrentController.clear();
- m_xStorage.clear();
- m_xParent.clear();
DisposeHelper::DisposeAndClear( m_xRangeHighlighter );
OSL_TRACE( "ChartModel: dispose() called" );
}
@@ -689,6 +701,7 @@ uno::Sequence< uno::Type > SAL_CALL ChartModel::getTypes()
uno::Reference< document::XDocumentProperties > SAL_CALL
ChartModel::getDocumentProperties() throw (uno::RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aModelMutex );
if ( !m_xDocumentProperties.is() )
{
uno::Reference< document::XDocumentProperties > xDocProps(
@@ -700,6 +713,17 @@ uno::Reference< document::XDocumentProperties > SAL_CALL
}
//-----------------------------------------------------------------
+// document::XDocumentPropertiesSupplier
+//-----------------------------------------------------------------
+Reference< document::XUndoManager > SAL_CALL ChartModel::getUndoManager( ) throw (RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aModelMutex );
+ if ( !m_pUndoManager.is() )
+ m_pUndoManager.set( new UndoManager( *this, m_aModelMutex ) );
+ return m_pUndoManager.get();
+}
+
+//-----------------------------------------------------------------
// chart2::XChartDocument
//-----------------------------------------------------------------
@@ -875,28 +899,15 @@ void SAL_CALL ChartModel::setArguments( const Sequence< beans::PropertyValue >&
Reference< chart2::data::XDataSource > xDataSource( m_xDataProvider->createDataSource( aArguments ) );
if( xDataSource.is() )
{
- // set new data
- Reference< chart2::XChartTypeTemplate > xTemplate;
Reference< chart2::XDiagram > xDia( getFirstDiagram() );
- if( xDia.is())
- {
- // apply new data
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram(
- xDia, Reference< lang::XMultiServiceFactory >( m_xChartTypeManager, uno::UNO_QUERY ));
- xTemplate.set( aTemplateAndService.first );
- }
-
- if( !xTemplate.is())
- xTemplate.set( impl_createDefaultChartTypeTemplate() );
-
- if( xTemplate.is())
+ if( !xDia.is() )
{
- if( xDia.is())
- xTemplate->changeDiagramData( xDia, xDataSource, aArguments );
- else
+ Reference< chart2::XChartTypeTemplate > xTemplate( impl_createDefaultChartTypeTemplate() );
+ if( xTemplate.is())
setFirstDiagram( xTemplate->createDiagramByDataSource( xDataSource, aArguments ) );
}
+ else
+ xDia->setDiagramData( xDataSource, aArguments );
}
}
catch( lang::IllegalArgumentException & )
@@ -1001,18 +1012,6 @@ void SAL_CALL ChartModel::setTitleObject( const uno::Reference< chart2::XTitle >
setModified( sal_True );
}
-void ChartModel::impl_createOldModelAgg()
-{
- if( ! m_xOldModelAgg.is())
- {
- m_xOldModelAgg.set(
- m_xContext->getServiceManager()->createInstanceWithContext(
- CHART_CHARTAPIWRAPPER_SERVICE_NAME,
- m_xContext ), uno::UNO_QUERY_THROW );
- m_xOldModelAgg->setDelegator( static_cast< ::cppu::OWeakObject* >( this ));
- }
-}
-
// ____ XInterface (for old API wrapper) ____
uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
@@ -1024,7 +1023,6 @@ uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType )
// try old API wrapper
try
{
- impl_createOldModelAgg();
if( m_xOldModelAgg.is())
aResult = m_xOldModelAgg->queryAggregation( aType );
}
@@ -1263,7 +1261,6 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
}
else
{
- impl_createOldModelAgg();
if( m_xOldModelAgg.is() )
{
Any aAny = m_xOldModelAgg->queryAggregation( ::getCppuType((const uno::Reference< lang::XMultiServiceFactory >*)0) );
@@ -1291,7 +1288,6 @@ Sequence< OUString > SAL_CALL ChartModel::getAvailableServiceNames()
{
uno::Sequence< ::rtl::OUString > aResult;
- impl_createOldModelAgg();
if( m_xOldModelAgg.is())
{
Any aAny = m_xOldModelAgg->queryAggregation( ::getCppuType((const uno::Reference< lang::XMultiServiceFactory >*)0) );
@@ -1368,13 +1364,6 @@ void SAL_CALL ChartModel::setParent( const Reference< uno::XInterface >& Parent
m_xParent.set( Parent, uno::UNO_QUERY );
}
-// ____ XUndoManager ____
-Reference< chart2::XUndoManager > SAL_CALL ChartModel::getUndoManager()
- throw (uno::RuntimeException)
-{
- return m_xUndoManager;
-}
-
// ____ XDataSource ____
uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartModel::getDataSequences()
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index 190d4f597c94..2cec0ec9f73c 100755
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -35,6 +35,7 @@
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -46,7 +47,6 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/chart2/XUndoSupplier.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -69,6 +69,7 @@
#include "comphelper/implbase_var.hxx"
#endif
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <svtools/grfmgr.hxx>
@@ -78,8 +79,6 @@
class SvNumberFormatter;
//=============================================================================
-/** this is an example implementation for the service ::com::sun::star::document::OfficeDocument
-*/
namespace chart
{
@@ -112,13 +111,15 @@ typedef ::comphelper::WeakImplHelper21<
,::com::sun::star::container::XChild
,::com::sun::star::util::XModifyListener
,::com::sun::star::datatransfer::XTransferable
- ,::com::sun::star::chart2::XUndoSupplier
,::com::sun::star::document::XDocumentPropertiesSupplier
,::com::sun::star::chart2::data::XDataSource
+ ,::com::sun::star::document::XUndoManagerSupplier
>
ChartModel_Base;
}
+class UndoManager;
+
class ChartModel : public impl::ChartModel_Base
{
@@ -134,6 +135,7 @@ private:
::rtl::OUString m_aResource;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aMediaDescriptor;
::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > m_xDocumentProperties;
+ ::rtl::Reference< UndoManager > m_pUndoManager;
::cppu::OInterfaceContainerHelper m_aControllers;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > m_xCurrentController;
@@ -176,8 +178,6 @@ private:
bool m_bIsDisposed;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
m_xPageBackground;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager >
- m_xUndoManager;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xXMLNamespaceMap;
@@ -208,7 +208,6 @@ private:
void impl_killInternalData() throw( com::sun::star::util::CloseVetoException );
- void impl_createOldModelAgg();
void impl_store(
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue >& rMediaDescriptor,
@@ -439,6 +438,10 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > SAL_CALL
getDocumentProperties( ) throw (::com::sun::star::uno::RuntimeException);
+ // ____ document::XUndoManagerSupplier ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL
+ getUndoManager( ) throw (::com::sun::star::uno::RuntimeException);
+
//-----------------------------------------------------------------
// ::com::sun::star::chart2::XChartDocument
//-----------------------------------------------------------------
@@ -606,10 +609,6 @@ public:
throw (::com::sun::star::lang::NoSupportException,
::com::sun::star::uno::RuntimeException);
- // ____ XUndoSupplier ____
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > SAL_CALL getUndoManager()
- throw (::com::sun::star::uno::RuntimeException);
-
// ____ XDataSource ____ allows access to the curently used data and data ranges
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences()
throw (::com::sun::star::uno::RuntimeException);
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index aac706ab0c91..322e84e1bc11 100755
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -33,6 +33,7 @@
#include "Wall.hxx"
#include "UserDefinedProperties.hxx"
#include "ConfigColorScheme.hxx"
+#include "DiagramHelper.hxx"
#include "ContainerHelper.hxx"
#include "ThreeDHelper.hxx"
#include "CloneHelper.hxx"
@@ -427,6 +428,22 @@ void SAL_CALL Diagram::setDefaultColorScheme( const Reference< chart2::XColorSch
fireModifyEvent();
}
+void SAL_CALL Diagram::setDiagramData(
+ const Reference< chart2::data::XDataSource >& xDataSource,
+ const Sequence< beans::PropertyValue >& aArguments )
+ throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XMultiServiceFactory > xChartTypeManager( m_xContext->getServiceManager()->createInstanceWithContext(
+ C2U( "com.sun.star.chart2.ChartTypeManager" ), m_xContext ), uno::UNO_QUERY );
+ DiagramHelper::tTemplateWithServiceName aTemplateAndService = DiagramHelper::getTemplateForDiagram( this, xChartTypeManager );
+ uno::Reference< chart2::XChartTypeTemplate > xTemplate( aTemplateAndService.first );
+ if( !xTemplate.is() )
+ xTemplate.set( xChartTypeManager->createInstance( C2U("com.sun.star.chart2.template.Column") ), uno::UNO_QUERY );
+ if(!xTemplate.is())
+ return;
+ xTemplate->changeDiagramData( this, xDataSource, aArguments );
+}
+
// ____ XTitled ____
uno::Reference< chart2::XTitle > SAL_CALL Diagram::getTitleObject()
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/UndoManager.cxx b/chart2/source/model/main/UndoManager.cxx
new file mode 100755
index 000000000000..702dd2e5ab54
--- /dev/null
+++ b/chart2/source/model/main/UndoManager.cxx
@@ -0,0 +1,427 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_chart2.hxx"
+
+#include "UndoManager.hxx"
+#include "ChartViewHelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+/** === end UNO includes === **/
+
+#include <framework/undomanagerhelper.hxx>
+#include <svl/undo.hxx>
+#include <unotools/undoopt.hxx>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::document::XUndoManager;
+ using ::com::sun::star::document::EmptyUndoStackException;
+ using ::com::sun::star::document::UndoContextNotClosedException;
+ using ::com::sun::star::document::UndoFailedException;
+ using ::com::sun::star::util::InvalidStateException;
+ using ::com::sun::star::document::XUndoAction;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::document::XUndoManagerListener;
+ using ::com::sun::star::util::NotLockedException;
+ using ::com::sun::star::lang::NoSupportException;
+ using ::com::sun::star::util::XModifyListener;
+ using ::com::sun::star::frame::XModel;
+ /** === end UNO using === **/
+
+ namespace impl
+ {
+ //==============================================================================================================
+ //= UndoManager_Impl
+ //==============================================================================================================
+ class UndoManager_Impl : public ::framework::IUndoManagerImplementation
+ {
+ public:
+ UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ :m_rAntiImpl( i_antiImpl )
+ ,m_rParent( i_parent )
+ ,m_rMutex( i_mutex )
+ ,m_bDisposed( false )
+ ,m_aUndoManager()
+ ,m_aUndoHelper( *this )
+ {
+ m_aUndoManager.SetMaxUndoActionCount( (USHORT)SvtUndoOptions().GetUndoCount() );
+ }
+
+ virtual ~UndoManager_Impl()
+ {
+ }
+
+ // .........................................................................................................
+ // IUndoManagerImplementation
+ virtual ::osl::Mutex& getMutex();
+ virtual ::svl::IUndoManager& getImplUndoManager();
+ virtual Reference< XUndoManager > getThis();
+
+ // .........................................................................................................
+ // attribute access
+ ::cppu::OWeakObject& getParent() { return m_rParent; }
+ ::framework::UndoManagerHelper& getUndoHelper() { return m_aUndoHelper; }
+
+ // .........................................................................................................
+ // public interface
+
+ /// is called when the owner of the UndoManager is being disposed
+ void disposing();
+
+ /// checks whether we're already disposed, throws a DisposedException if so
+ void checkDisposed_lck();
+
+ private:
+ UndoManager& m_rAntiImpl;
+ ::cppu::OWeakObject& m_rParent;
+ ::osl::Mutex& m_rMutex;
+ bool m_bDisposed;
+
+ SfxUndoManager m_aUndoManager;
+ ::framework::UndoManagerHelper m_aUndoHelper;
+ };
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::osl::Mutex& UndoManager_Impl::getMutex()
+ {
+ return m_rMutex;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::svl::IUndoManager& UndoManager_Impl::getImplUndoManager()
+ {
+ return m_aUndoManager;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ Reference< XUndoManager > UndoManager_Impl::getThis()
+ {
+ return &m_rAntiImpl;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManager_Impl::disposing()
+ {
+ {
+ ::osl::MutexGuard aGuard( m_rMutex );
+ m_bDisposed = true;
+ }
+ m_aUndoHelper.disposing();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManager_Impl::checkDisposed_lck()
+ {
+ if ( m_bDisposed )
+ throw DisposedException( ::rtl::OUString(), getThis() );
+ }
+
+ //==============================================================================================================
+ //= UndoManagerMethodGuard
+ //==============================================================================================================
+ /** guard for public UNO methods of the UndoManager
+
+ The only purpose of this guard is to check for the instance being disposed already. Everything else,
+ in particular the IMutexGuard functionality required by the UndoManagerHelper class, is a dummy only,
+ as all involved classes (means we ourselves, the UndoManagerHelper, the SfxUndoManager, and the Undo actions
+ we create) are inherently thread-safe, thus need no external lock (in particular no SolarMutex!).
+ */
+ class UndoManagerMethodGuard : public ::framework::IMutexGuard
+ {
+ public:
+ UndoManagerMethodGuard( UndoManager_Impl& i_impl )
+ {
+ ::osl::MutexGuard aGuard( i_impl.getMutex() );
+ // throw if the instance is already disposed
+ i_impl.checkDisposed_lck();
+ }
+ virtual ~UndoManagerMethodGuard()
+ {
+ }
+
+ // IMutexGuard
+ virtual ::framework::IMutex& getGuardedMutex();
+
+ // IGuard
+ virtual void clear();
+ virtual void reset();
+ };
+
+ class DummyMutex : public ::framework::IMutex
+ {
+ public:
+ virtual void acquire() { }
+ virtual void release() { }
+ };
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::framework::IMutex& UndoManagerMethodGuard::getGuardedMutex()
+ {
+ static DummyMutex s_aDummyMutex;
+ return s_aDummyMutex;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManagerMethodGuard::clear()
+ {
+ // nothing to do. This interface implementation is a dummy.
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManagerMethodGuard::reset()
+ {
+ // nothing to do. This interface implementation is a dummy.
+ }
+ }
+
+ //==================================================================================================================
+ //= UndoManager
+ //==================================================================================================================
+ using impl::UndoManagerMethodGuard;
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ :m_pImpl( new impl::UndoManager_Impl( *this, i_parent, i_mutex ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManager::~UndoManager()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::acquire() throw ()
+ {
+ m_pImpl->getParent().acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::release() throw ()
+ {
+ m_pImpl->getParent().release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManager::disposing()
+ {
+ m_pImpl->disposing();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().enterUndoContext( i_title, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::enterHiddenUndoContext( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().enterHiddenUndoContext( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::leaveUndoContext( ) throw (InvalidStateException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().leaveUndoContext( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (IllegalArgumentException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().addUndoAction( i_action, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().undo( aGuard );
+
+ ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().redo( aGuard );
+
+ ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isUndoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().isUndoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isRedoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().isRedoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL UndoManager::getCurrentUndoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getCurrentUndoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL UndoManager::getCurrentRedoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getCurrentRedoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllUndoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getAllUndoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllRedoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getAllRedoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::clear( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().clear( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::clearRedo( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().clearRedo( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::reset( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().reset( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().addUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().removeUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::lock( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().lock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::unlock( ) throw (NotLockedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().unlock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isLocked( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().isLocked();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL UndoManager::getParent( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return *&m_pImpl->getParent();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ (void)i_parent;
+ throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addModifyListener( const Reference< XModifyListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().addModifyListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::removeModifyListener( const Reference< XModifyListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().removeModifyListener( i_listener );
+ }
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
diff --git a/chart2/source/model/main/UndoManager.hxx b/chart2/source/model/main/UndoManager.hxx
new file mode 100755
index 000000000000..07091207ebd0
--- /dev/null
+++ b/chart2/source/model/main/UndoManager.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 CHART2_UNDOMANAGER_HXX
+#define CHART2_UNDOMANAGER_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XUndoManager.hpp>
+#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/container/XChild.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ namespace impl
+ {
+ class UndoManager_Impl;
+ typedef ::cppu::ImplHelper2 < ::com::sun::star::document::XUndoManager
+ , ::com::sun::star::util::XModifyBroadcaster
+ > UndoManager_Base;
+ }
+
+ //==================================================================================================================
+ //= UndoManager
+ //==================================================================================================================
+ class UndoManager : public impl::UndoManager_Base
+ {
+ public:
+ UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex );
+ virtual ~UndoManager();
+
+ // XInterface
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XComponent equivalents
+ void disposing();
+
+ // XUndoManager
+ virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XLockable (base of XUndoManager)
+ virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XChild (base of XUndoManager)
+ 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);
+
+ // 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);
+
+ private:
+ ::boost::scoped_ptr< impl::UndoManager_Impl > m_pImpl;
+ };
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
+
+#endif // CHART2_UNDOMANAGER_HXX
diff --git a/chart2/source/model/main/makefile.mk b/chart2/source/model/main/makefile.mk
index 8e963dfa0f5c..5ca78bbdea25 100644
--- a/chart2/source/model/main/makefile.mk
+++ b/chart2/source/model/main/makefile.mk
@@ -60,6 +60,7 @@ SLOFILES= \
$(SLO)$/StockBar.obj \
$(SLO)$/Title.obj \
$(SLO)$/Wall.obj \
+ $(SLO)$/UndoManager.obj \
$(SLO)$/_serviceregistration_model.obj
# --- Targets -----------------------------------------------------------------
diff --git a/chart2/source/model/makefile.mk b/chart2/source/model/makefile.mk
index 52cc85c10904..25d4b1b2949a 100644
--- a/chart2/source/model/makefile.mk
+++ b/chart2/source/model/makefile.mk
@@ -79,7 +79,8 @@ SHL1STDLIBS= $(CHARTTOOLS) \
$(SVLLIB) \
$(SVTOOLLIB) \
$(SALLIB) \
- $(UCBHELPERLIB)
+ $(UCBHELPERLIB) \
+ $(FWELIB) \
#--------exports
diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx
index 1f26fff907e4..27fee7d35aff 100644..100755
--- a/chart2/source/model/template/BubbleDataInterpreter.cxx
+++ b/chart2/source/model/template/BubbleDataInterpreter.cxx
@@ -77,16 +77,17 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
Reference< data::XLabeledDataSequence > xCategories;
bool bHasCategories = HasCategories( aArguments, aData );
+ bool bUseCategoriesAsX = UseCategoriesAsX( aArguments );
- bool bHasXValues = false;
+ bool bSetXValues = false;
sal_Int32 nDataSeqCount = aData.getLength();
- bHasXValues = bHasCategories ? ( (nDataSeqCount-1) > 2 && (nDataSeqCount-1) % 2 != 0 )
+ bSetXValues = bHasCategories ? ( (nDataSeqCount-1) > 2 && (nDataSeqCount-1) % 2 != 0 )
:( nDataSeqCount > 2 && nDataSeqCount % 2 != 0 );
bool bCategoriesUsed = false;
bool bNextIsYValues = bHasCategories ? nDataSeqCount>2 : nDataSeqCount>1;
- for( sal_Int32 nDataIdx = 0; nDataIdx < aData.getLength(); ++nDataIdx )
+ for( sal_Int32 nDataIdx = 0; nDataIdx < nDataSeqCount; ++nDataIdx )
{
try
{
@@ -94,10 +95,17 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
{
xCategories.set( aData[nDataIdx] );
if( xCategories.is())
+ {
SetRole( xCategories->getValues(), C2U("categories"));
+ if( bUseCategoriesAsX )
+ {
+ bSetXValues = false;
+ bNextIsYValues = nDataSeqCount > 2;
+ }
+ }
bCategoriesUsed = true;
}
- else if( !xValuesX.is() && bHasXValues )
+ else if( !xValuesX.is() && bSetXValues )
{
xValuesX.set( aData[nDataIdx] );
if( xValuesX.is())
@@ -115,7 +123,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
aSizeValuesVector.push_back( aData[nDataIdx] );
if( aData[nDataIdx].is())
SetRole( aData[nDataIdx]->getValues(), C2U("values-size"));
- bNextIsYValues = true;
+ bNextIsYValues = (nDataSeqCount-(nDataIdx+1)) >= 2;//two or more left
}
}
catch( uno::Exception & ex )
@@ -132,26 +140,19 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
Reference< util::XCloneable > xCloneableX( xValuesX, uno::UNO_QUERY );
- for( size_t nCount = 0; nCount < aSizeValuesVector.size(); ++nCount, ++nSeriesIndex )
+ for( size_t nN = 0; nN < aSizeValuesVector.size(); ++nN, ++nSeriesIndex )
{
- sal_Int32 nDataSequenceCount = 2;
- if( xValuesX.is() )
- nDataSequenceCount = 3;
- else if( aYValuesVector.empty() )
- nDataSequenceCount = 1;
-
- Sequence< Reference< data::XLabeledDataSequence > > aNewData( nDataSequenceCount );
- sal_Int32 nDataIndex = 0;
+ vector< Reference< data::XLabeledDataSequence > > aNewData;
if( xValuesX.is() )
{
- if( nCount > 0 && xCloneableX.is() )
+ if( nN > 0 && xCloneableX.is() )
xClonedXValues.set( xCloneableX->createClone(), uno::UNO_QUERY );
- aNewData[nDataIndex++] = xClonedXValues;
+ aNewData.push_back( xClonedXValues );
}
- if( aYValuesVector.size() > nCount )
- aNewData[nDataIndex++] = aYValuesVector[nCount];
- if( aSizeValuesVector.size() > nCount )
- aNewData[nDataIndex++] = aSizeValuesVector[nCount];
+ if( aYValuesVector.size() > nN )
+ aNewData.push_back( aYValuesVector[nN] );
+ if( aSizeValuesVector.size() > nN )
+ aNewData.push_back( aSizeValuesVector[nN] );
Reference< XDataSeries > xSeries;
if( nSeriesIndex < aSeriesToReUse.getLength())
@@ -161,7 +162,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
OSL_ASSERT( xSeries.is() );
Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
OSL_ASSERT( xSink.is() );
- xSink->setData( aNewData );
+ xSink->setData( ContainerHelper::ContainerToSequence( aNewData ) );
aSeriesVec.push_back( xSeries );
}
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index c922de69a2c7..d089a88bb30b 100755
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -643,17 +643,30 @@ void ChartTypeTemplate::adaptScales(
sal_Int32 nDim( xCooSys->getDimension());
if( nDim > 0 )
{
- const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(0);
+ const sal_Int32 nDimensionX = 0;
+ const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionX);
for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI)
{
- Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,nI) );
+ Reference< XAxis > xAxis( xCooSys->getAxisByDimension(nDimensionX,nI) );
if( xAxis.is())
{
ScaleData aData( xAxis->getScaleData() );
aData.Categories = xCategories;
- aData.AxisType = bSupportsCategories ? AxisType::CATEGORY : AxisType::REALNUMBER;
- if( bSupportsCategories )
- AxisHelper::removeExplicitScaling( aData );
+ if(bSupportsCategories)
+ {
+
+ Reference< XChartType > xChartType( getChartTypeForNewSeries(Sequence< Reference< XChartType > >() ));
+ bool bSupportsDates = ::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, 2, nDimensionX );
+ if( aData.AxisType != AxisType::CATEGORY && ( aData.AxisType != AxisType::DATE || !bSupportsDates) )
+ {
+ aData.AxisType = AxisType::CATEGORY;
+ aData.AutoDateAxis = true;
+ AxisHelper::removeExplicitScaling( aData );
+ }
+ }
+ else
+ aData.AxisType = AxisType::REALNUMBER;
+
xAxis->setScaleData( aData );
}
}
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index b5aa13775e8e..686b02536d31 100755
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -390,6 +390,14 @@ bool DataInterpreter::HasCategories(
return bHasCategories;
}
+bool DataInterpreter::UseCategoriesAsX( const Sequence< beans::PropertyValue > & rArguments )
+{
+ bool bUseCategoriesAsX = true;
+ if( rArguments.getLength() > 0 )
+ GetProperty( rArguments, C2U(("UseCategoriesAsX"))) >>= bUseCategoriesAsX;
+ return bUseCategoriesAsX;
+}
+
// ------------------------------------------------------------
Sequence< OUString > DataInterpreter::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/DataInterpreter.hxx b/chart2/source/model/template/DataInterpreter.hxx
index a2d6201fc023..d0f2ee922059 100644..100755
--- a/chart2/source/model/template/DataInterpreter.hxx
+++ b/chart2/source/model/template/DataInterpreter.hxx
@@ -73,6 +73,10 @@ public:
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence > > & rData );
+ static bool UseCategoriesAsX(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & rArguments );
+
protected:
// ____ XDataInterpreter ____
virtual ::com::sun::star::chart2::InterpretedData SAL_CALL interpretDataSource(
diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx
index 839c0cbac510..965e3a058f58 100644..100755
--- a/chart2/source/model/template/XYDataInterpreter.cxx
+++ b/chart2/source/model/template/XYDataInterpreter.cxx
@@ -75,11 +75,12 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
vector< Reference< data::XLabeledDataSequence > > aSequencesVec;
Reference< data::XLabeledDataSequence > xCategories;
- // check for categories. If true, the the categories bet parked in the axis scale, but not used via setting the Axistype to Not CATEGORY
bool bHasCategories = HasCategories( aArguments, aData );
+ bool bUseCategoriesAsX = UseCategoriesAsX( aArguments );
// parse data
bool bCategoriesUsed = false;
+ bool bSetXValues = aData.getLength()>(bCategoriesUsed?2:1);
for( sal_Int32 nDataIdx= 0; nDataIdx < aData.getLength(); ++nDataIdx )
{
try
@@ -88,10 +89,14 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
{
xCategories.set( aData[nDataIdx] );
if( xCategories.is())
+ {
SetRole( xCategories->getValues(), C2U("categories"));
+ if( bUseCategoriesAsX )
+ bSetXValues = false;
+ }
bCategoriesUsed = true;
}
- else if( !xValuesX.is() && (aData.getLength()>(bCategoriesUsed?2:1)) )
+ else if( !xValuesX.is() && bSetXValues )
{
xValuesX.set( aData[nDataIdx] );
if( xValuesX.is())
@@ -123,22 +128,14 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
for( ;aSequencesVecIt != aSequencesVec.end(); ++aSequencesVecIt, ++nSeriesIndex )
{
- Sequence< Reference< data::XLabeledDataSequence > > aNewData(xValuesX.is()?2:1);
- if( aSequencesVecIt != aSequencesVec.begin() &&
- xCloneable.is() )
- {
- xClonedXValues.set( xCloneable->createClone(), uno::UNO_QUERY );
- }
+ vector< Reference< data::XLabeledDataSequence > > aNewData;
+ if( aSequencesVecIt != aSequencesVec.begin() && xCloneable.is() )
+ xClonedXValues.set( xCloneable->createClone(), uno::UNO_QUERY );
if( xValuesX.is() )
- {
- aNewData[0] = xClonedXValues;
- aNewData[1] = (*aSequencesVecIt);
- }
- else
- {
- aNewData[0] = (*aSequencesVecIt);
- }
+ aNewData.push_back( xClonedXValues );
+
+ aNewData.push_back( *aSequencesVecIt );
Reference< XDataSeries > xSeries;
if( nSeriesIndex < aSeriesToReUse.getLength())
@@ -148,7 +145,7 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
OSL_ASSERT( xSeries.is() );
Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
OSL_ASSERT( xSink.is() );
- xSink->setData( aNewData );
+ xSink->setData( ContainerHelper::ContainerToSequence( aNewData ) );
aSeriesVec.push_back( xSeries );
}
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index b5f7abfb8206..4fd21e2c3b8b 100755
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -38,7 +38,10 @@
#include "servicenames_coosystems.hxx"
#include "DataSeriesHelper.hxx"
#include "Scaling.hxx"
+#include "ChartModelHelper.hxx"
+#include "DataSourceHelper.hxx"
+#include <tools/debug.hxx>
#include <unotools/saveopt.hxx>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
@@ -50,6 +53,8 @@
// header for class OUStringBuffer
#include <rtl/ustrbuf.hxx>
+#include <rtl/math.hxx>
+
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
@@ -78,6 +83,8 @@ ScaleData AxisHelper::createDefaultScale()
{
ScaleData aScaleData;
aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+ aScaleData.AutoDateAxis = true;
+ aScaleData.ShiftedCategoryPosition = false;//this is adapted in the view code currently
Sequence< SubIncrement > aSubIncrements(1);
aSubIncrements[0] = SubIncrement();
aScaleData.IncrementData.SubIncrements = aSubIncrements;
@@ -89,6 +96,9 @@ void AxisHelper::removeExplicitScaling( ScaleData& rScaleData )
uno::Any aEmpty;
rScaleData.Minimum = rScaleData.Maximum = rScaleData.Origin = aEmpty;
rScaleData.Scaling = 0;
+ ScaleData aDefaultScale( createDefaultScale() );
+ rScaleData.IncrementData = aDefaultScale.IncrementData;
+ rScaleData.TimeIncrement = aDefaultScale.TimeIncrement;
}
bool AxisHelper::isLogarithmic( const Reference< XScaling >& xScaling )
@@ -100,6 +110,227 @@ bool AxisHelper::isLogarithmic( const Reference< XScaling >& xScaling )
return bReturn;
}
+chart2::ScaleData AxisHelper::getDateCheckedScale( const Reference< chart2::XAxis >& xAxis, const Reference< frame::XModel >& xChartModel )
+{
+ DBG_ASSERT(xChartModel.is(),"missing chart model");
+ ScaleData aScale = xAxis->getScaleData();
+ Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ if( aScale.AutoDateAxis && aScale.AxisType == AxisType::CATEGORY )
+ {
+ sal_Int32 nDimensionIndex=0; sal_Int32 nAxisIndex=0;
+ AxisHelper::getIndicesForAxis(xAxis, xCooSys, nDimensionIndex, nAxisIndex );
+ bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), 2, nDimensionIndex );
+ if( bChartTypeAllowsDateAxis )
+ aScale.AxisType = AxisType::DATE;
+ }
+ if( aScale.AxisType == AxisType::DATE )
+ {
+ ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys,xChartModel );
+ if( !aExplicitCategoriesProvider.isDateAxis() )
+ aScale.AxisType = AxisType::CATEGORY;
+ }
+ return aScale;
+}
+
+void AxisHelper::checkDateAxis( chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis )
+{
+ if( rScale.AutoDateAxis && rScale.AxisType == AxisType::CATEGORY && bChartTypeAllowsDateAxis )
+ {
+ rScale.AxisType = AxisType::DATE;
+ removeExplicitScaling( rScale );
+ }
+ if( rScale.AxisType == AxisType::DATE && (!pExplicitCategoriesProvider || !pExplicitCategoriesProvider->isDateAxis()) )
+ {
+ rScale.AxisType = AxisType::CATEGORY;
+ removeExplicitScaling( rScale );
+ }
+}
+
+sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
+ const Reference< chart2::XAxis >& xAxis
+ , const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
+ , const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
+ , bool bSearchForParallelAxisIfNothingIsFound )
+{
+ sal_Int32 nNumberFormatKey(0);
+ bool bNumberFormatKeyFoundViaAttachedData = false;
+ sal_Int32 nAxisIndex = 0;
+ sal_Int32 nDimensionIndex = 1;
+ AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex );
+ Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY );
+
+ Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
+ if( xProp.is() && !( xProp->getPropertyValue( C2U( "NumberFormat" ) ) >>= nNumberFormatKey ) )
+ {
+ bool bFormatSet = false;
+ //check wether we have a percent scale -> use percent format
+ if( xNumberFormatsSupplier.is() )
+ {
+ ScaleData aData = AxisHelper::getDateCheckedScale( xAxis, Reference< frame::XModel >( xNumberFormatsSupplier, uno::UNO_QUERY ) );
+ if( aData.AxisType==AxisType::PERCENT )
+ {
+ sal_Int32 nPercentFormat = DiagramHelper::getPercentNumberFormat( xNumberFormatsSupplier );
+ if( nPercentFormat != -1 )
+ {
+ nNumberFormatKey = nPercentFormat;
+ bFormatSet = true;
+ }
+ }
+ else if( aData.AxisType==AxisType::DATE )
+ {
+ if( aData.Categories.is() )
+ {
+ Reference< data::XDataSequence > xSeq( aData.Categories->getValues());
+ if( xSeq.is() && !( xChartDoc.is() && xChartDoc->hasInternalDataProvider()) )
+ nNumberFormatKey = xSeq->getNumberFormatKeyByIndex( -1 );
+ else
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ bFormatSet = true;
+ }
+ }
+ else if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() && nDimensionIndex == 0 ) //maybe date axis
+ {
+ Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram() );
+ if( DiagramHelper::isSupportingDateAxis( xDiagram ) )
+ {
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ }
+ else
+ {
+ Reference< data::XDataSource > xSource( DataSourceHelper::getUsedData( xChartDoc ) );
+ if( xSource.is() )
+ {
+ ::std::vector< Reference< chart2::data::XLabeledDataSequence > > aXValues(
+ DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), C2U("values-x"), true ) );
+ if( aXValues.empty() )
+ {
+ Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
+ if( xCategories.is() )
+ {
+ Reference< data::XDataSequence > xSeq( xCategories->getValues());
+ if( xSeq.is() )
+ {
+ bool bHasValidDoubles = false;
+ double fTest=0.0;
+ Sequence< uno::Any > aCats( xSeq->getData() );
+ sal_Int32 nCount = aCats.getLength();
+ for( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ if( (aCats[i]>>=fTest) && !::rtl::math::isNan(fTest) )
+ {
+ bHasValidDoubles=true;
+ break;
+ }
+ }
+ if( bHasValidDoubles )
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ }
+ }
+ }
+ }
+ }
+ bFormatSet = true;
+ }
+ }
+
+ if( !bFormatSet )
+ {
+ typedef ::std::map< sal_Int32, sal_Int32 > tNumberformatFrequency;
+ tNumberformatFrequency aKeyMap;
+
+ try
+ {
+ Reference< XChartTypeContainer > xCTCnt( xCorrespondingCoordinateSystem, uno::UNO_QUERY_THROW );
+ if( xCTCnt.is() )
+ {
+ ::rtl::OUString aRoleToMatch;
+ if( nDimensionIndex == 0 )
+ aRoleToMatch = C2U("values-x");
+ Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
+ for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
+ {
+ if( nDimensionIndex != 0 )
+ aRoleToMatch = ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( aChartTypes[nCTIdx] );
+ Reference< XDataSeriesContainer > xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW );
+ Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries());
+ for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aDataSeriesSeq.getLength(); ++nSeriesIdx )
+ {
+ Reference< chart2::XDataSeries > xDataSeries(aDataSeriesSeq[nSeriesIdx]);
+ Reference< data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY_THROW );
+
+ if( nDimensionIndex == 1 )
+ {
+ //only take those series into accoutn that are attached to this axis
+ sal_Int32 nAttachedAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
+ if( nAttachedAxisIndex != nAxisIndex )
+ continue;
+ }
+
+ Reference< data::XLabeledDataSequence > xLabeledSeq(
+ DataSeriesHelper::getDataSequenceByRole( xSource, aRoleToMatch ) );
+
+ if( !xLabeledSeq.is() && nDimensionIndex==0 )
+ {
+ ScaleData aData = xAxis->getScaleData();
+ xLabeledSeq = aData.Categories;
+ }
+
+ if( xLabeledSeq.is() )
+ {
+ Reference< data::XDataSequence > xSeq( xLabeledSeq->getValues());
+ if( xSeq.is() )
+ {
+ sal_Int32 nKey = xSeq->getNumberFormatKeyByIndex( -1 );
+ // initialize the value
+ if( aKeyMap.find( nKey ) == aKeyMap.end())
+ aKeyMap[ nKey ] = 0;
+ // increase frequency
+ aKeyMap[ nKey ] = (aKeyMap[ nKey ] + 1);
+ }
+ }
+ }
+ }
+ }
+ }
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ if( ! aKeyMap.empty())
+ {
+ sal_Int32 nMaxFreq = 0;
+ // find most frequent key
+ for( tNumberformatFrequency::const_iterator aIt = aKeyMap.begin();
+ aIt != aKeyMap.end(); ++aIt )
+ {
+ OSL_TRACE( "NumberFormatKey %d appears %d times", (*aIt).first, (*aIt).second );
+ // all values must at least be 1
+ if( (*aIt).second > nMaxFreq )
+ {
+ nNumberFormatKey = (*aIt).first;
+ bNumberFormatKeyFoundViaAttachedData = true;
+ nMaxFreq = (*aIt).second;
+ }
+ }
+ }
+
+ if( bSearchForParallelAxisIfNothingIsFound )
+ {
+ //no format is set to this axis and no data is set to this axis
+ //--> try to obtain the format from the parallel y-axis
+ if( !bNumberFormatKeyFoundViaAttachedData && nDimensionIndex == 1 )
+ {
+ sal_Int32 nParallelAxisIndex = (nAxisIndex==1) ?0 :1;
+ Reference< XAxis > xParallelAxis( AxisHelper::getAxis( 1, nParallelAxisIndex, xCorrespondingCoordinateSystem ) );
+ nNumberFormatKey = AxisHelper::getExplicitNumberFormatKeyForAxis( xParallelAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier, false );
+ }
+ }
+ }
+ }
+ return nNumberFormatKey;
+}
+
Reference< XAxis > AxisHelper::createAxis(
sal_Int32 nDimensionIndex
, sal_Int32 nAxisIndex // 0==main or 1==secondary axis
@@ -131,6 +362,7 @@ Reference< XAxis > AxisHelper::createAxis(
ScaleData aMainScale = xMainAxis->getScaleData();
aScale.AxisType = aMainScale.AxisType;
+ aScale.AutoDateAxis = aMainScale.AutoDateAxis;
aScale.Categories = aMainScale.Categories;
aScale.Orientation = aMainScale.Orientation;
diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx
index debb241e9604..83ab4a26315b 100755
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -415,13 +415,34 @@ bool ChartTypeHelper::isSupportingAxisPositioning( const uno::Reference< chart2:
return true;
}
-bool ChartTypeHelper::shiftTicksAtXAxisPerDefault( const uno::Reference< chart2::XChartType >& xChartType )
+bool ChartTypeHelper::isSupportingDateAxis( const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 /*nDimensionCount*/, sal_Int32 nDimensionIndex )
+{
+ if( nDimensionIndex!=0 )
+ return false;
+ if( xChartType.is() )
+ {
+ sal_Int32 nType = ChartTypeHelper::getAxisType( xChartType, nDimensionIndex );
+ if( nType != AxisType::CATEGORY )
+ return false;
+ rtl::OUString aChartTypeName = xChartType->getChartType();
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
+ return false;
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
+ return false;
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ return false;
+ }
+ return true;
+}
+
+bool ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( const uno::Reference< chart2::XChartType >& xChartType )
{
if(xChartType.is())
{
rtl::OUString aChartTypeName = xChartType->getChartType();
if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN)
- || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) )
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
return true;
}
return false;
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 0cc6ef4a4315..21fc16156397 100644..100755
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -461,25 +461,8 @@ void DataSourceHelper::setRangeSegmentation(
if( !xDataSource.is() )
return;
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateFactory );
-
- rtl::OUString aServiceName( aTemplateAndService.second );
- uno::Reference< chart2::XChartTypeTemplate > xTemplate = aTemplateAndService.first;
-
- if( !xTemplate.is() )
- {
- if( aServiceName.getLength() == 0 )
- aServiceName = C2U("com.sun.star.chart2.template.Column");
- xTemplate.set( xTemplateFactory->createInstance( aServiceName ), uno::UNO_QUERY );
- }
- if( !xTemplate.is() )
- return;
-
- // /-- locked controllers
ControllerLockGuard aCtrlLockGuard( xChartModel );
- xTemplate->changeDiagramData( xDiagram, xDataSource, aArguments );
- // \-- locked controllers
+ xDiagram->setDiagramData( xDataSource, aArguments );
}
Sequence< OUString > DataSourceHelper::getRangesFromLabeledDataSequence(
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index b3ae733c4067..d442797d8ce1 100755
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -42,10 +42,12 @@
#include "ChartModelHelper.hxx"
#include "RelativePositionHelper.hxx"
#include "ControllerLockGuard.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
@@ -57,10 +59,15 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+
#include <unotools/saveopt.hxx>
#include <rtl/math.hxx>
-
-#include <com/sun/star/util/XModifiable.hpp>
+#include <svl/zformat.hxx>
+// header for class Application
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -68,7 +75,9 @@ using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Any;
using ::rtl::OUString;
+using ::com::sun::star::chart2::XAnyDescriptionAccess;
namespace chart
{
@@ -864,7 +873,7 @@ bool DiagramHelper::isCategoryDiagram(
if( xAxis.is())
{
ScaleData aScaleData = xAxis->getScaleData();
- if( aScaleData.AxisType == AxisType::CATEGORY )
+ if( aScaleData.AxisType == AxisType::CATEGORY || aScaleData.AxisType == AxisType::DATE )
return true;
}
}
@@ -902,7 +911,7 @@ void DiagramHelper::setCategoriesToDiagram(
{
if( bCategoryAxis )
aScaleData.AxisType = AxisType::CATEGORY;
- else if( aScaleData.AxisType == AxisType::CATEGORY )
+ else if( aScaleData.AxisType == AxisType::CATEGORY || aScaleData.AxisType == AxisType::DATE )
aScaleData.AxisType = AxisType::REALNUMBER;
}
xCatAxis->setScaleData( aScaleData );
@@ -1018,6 +1027,203 @@ Sequence< rtl::OUString > DiagramHelper::getExplicitSimpleCategories(
return aRet;
}
+namespace
+{
+void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, const Reference< XAxis >& xAxis )
+{
+ if( !xAxis.is() )
+ return;
+ if( !xChartDoc.is() )
+ return;
+
+ ScaleData aScale( xAxis->getScaleData() );
+ if( xChartDoc->hasInternalDataProvider() )
+ {
+ //remove all content the is not of type double and remove multiple level
+ Reference< XAnyDescriptionAccess > xDataAccess( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+ if( xDataAccess.is() )
+ {
+ Sequence< Sequence< Any > > aAnyCategories( xDataAccess->getAnyRowDescriptions() );
+ double fTest = 0.0;
+ double fNan = 0.0;
+ ::rtl::math::setNan( & fNan );
+ sal_Int32 nN = aAnyCategories.getLength();
+ for( ; nN--; )
+ {
+ Sequence< Any >& rCat = aAnyCategories[nN];
+ if( rCat.getLength() > 1 )
+ rCat.realloc(1);
+ if( rCat.getLength() == 1 )
+ {
+ Any& rAny = rCat[0];
+ if( !(rAny>>=fTest) )
+ {
+ rAny = uno::makeAny(fNan);
+ }
+ }
+ }
+ xDataAccess->setAnyRowDescriptions( aAnyCategories );
+ }
+ //check the numberformat at the axis
+ Reference< beans::XPropertySet > xAxisProps( xAxis, uno::UNO_QUERY );
+ Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartDoc, uno::UNO_QUERY );
+ if( xAxisProps.is() && xNumberFormatsSupplier.is() )
+ {
+ sal_Int32 nNumberFormat = -1;
+ xAxisProps->getPropertyValue( C2U("NumberFormat") ) >>= nNumberFormat;
+
+ Reference< util::XNumberFormats > xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
+ {
+ Reference< beans::XPropertySet > xKeyProps;
+ try
+ {
+ xKeyProps = xNumberFormats->getByKey( nNumberFormat );
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ sal_Int32 nType = util::NumberFormat::UNDEFINED;
+ if( xKeyProps.is() )
+ xKeyProps->getPropertyValue( C2U("Type") ) >>= nType;
+ if( !( nType & util::NumberFormat::DATE ) )
+ {
+ //set a date format to the axis
+ sal_Bool bCreate = sal_True;
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE, rLocaleDataWrapper.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ xAxisProps->setPropertyValue( C2U("NumberFormat"), uno::makeAny(aKeySeq[0]) );
+ }
+ }
+ }
+ }
+ }
+ if( aScale.AxisType != chart2::AxisType::DATE )
+ AxisHelper::removeExplicitScaling( aScale );
+ aScale.AxisType = chart2::AxisType::DATE;
+ xAxis->setScaleData( aScale );
+}
+
+void lcl_switchToTextCategories( const Reference< XChartDocument >& xChartDoc, const Reference< XAxis >& xAxis )
+{
+ if( !xAxis.is() )
+ return;
+ if( !xChartDoc.is() )
+ return;
+ ScaleData aScale( xAxis->getScaleData() );
+ if( aScale.AxisType != chart2::AxisType::CATEGORY )
+ AxisHelper::removeExplicitScaling( aScale );
+ //todo migrate dates to text?
+ aScale.AxisType = chart2::AxisType::CATEGORY;
+ aScale.AutoDateAxis = false;
+ xAxis->setScaleData( aScale );
+}
+
+}
+
+void DiagramHelper::switchToDateCategories( const Reference< XChartDocument >& xChartDoc )
+{
+ Reference< frame::XModel > xChartModel( xChartDoc, uno::UNO_QUERY );
+ if(xChartModel.is())
+ {
+ ControllerLockGuard aCtrlLockGuard( xChartModel );
+
+ Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ if( xCooSys.is() )
+ {
+ Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) );
+ lcl_switchToDateCategories( xChartDoc, xAxis );
+ }
+ }
+}
+
+void DiagramHelper::switchToTextCategories( const Reference< XChartDocument >& xChartDoc )
+{
+ Reference< frame::XModel > xChartModel( xChartDoc, uno::UNO_QUERY );
+ if(xChartModel.is())
+ {
+ ControllerLockGuard aCtrlLockGuard( xChartModel );
+
+ Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ if( xCooSys.is() )
+ {
+ Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) );
+ lcl_switchToTextCategories( xChartDoc, xAxis );
+ }
+ }
+}
+
+bool DiagramHelper::isSupportingDateAxis( const Reference< chart2::XDiagram >& xDiagram )
+{
+ return ::chart::ChartTypeHelper::isSupportingDateAxis(
+ DiagramHelper::getChartTypeByIndex( xDiagram, 0 ), DiagramHelper::getDimension( xDiagram ), 0 );
+}
+
+bool DiagramHelper::isDateNumberFormat( sal_Int32 nNumberFormat, const Reference< util::XNumberFormats >& xNumberFormats )
+{
+ bool bIsDate = false;
+ if( !xNumberFormats.is() )
+ return bIsDate;
+
+ Reference< beans::XPropertySet > xKeyProps = xNumberFormats->getByKey( nNumberFormat );
+ if( xKeyProps.is() )
+ {
+ sal_Int32 nType = util::NumberFormat::UNDEFINED;
+ xKeyProps->getPropertyValue( C2U("Type") ) >>= nType;
+ bIsDate = nType & util::NumberFormat::DATE;
+ }
+ return bIsDate;
+}
+
+sal_Int32 DiagramHelper::getDateNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
+{
+ sal_Int32 nRet=-1;
+ Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
+ {
+ sal_Bool bCreate = sal_True;
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE,
+ rLocaleDataWrapper.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ nRet = aKeySeq[0];
+ }
+ }
+
+ //try to get a date format with full year display
+ NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
+ SvNumberFormatter* pNumFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
+ if( pNumFormatter )
+ {
+ const SvNumberformat* pFormat = pNumFormatter->GetEntry( nRet );
+ if( pFormat )
+ nRet = pNumFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, pFormat->GetLanguage() );
+ }
+ return nRet;
+}
+
+sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
+{
+ sal_Int32 nRet=-1;
+ Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
+ {
+ sal_Bool bCreate = sal_True;
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::PERCENT,
+ rLocaleDataWrapper.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ nRet = aKeySeq[0];
+ }
+ }
+ return nRet;
+}
+
Sequence< Reference< XChartType > >
DiagramHelper::getChartTypesFromDiagram(
const Reference< XDiagram > & xDiagram )
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index a59610b1fc3a..a0376aa95d46 100755
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -30,11 +30,18 @@
#include "ExplicitCategoriesProvider.hxx"
#include "DiagramHelper.hxx"
+#include "ChartTypeHelper.hxx"
+#include "AxisHelper.hxx"
#include "CommonConverters.hxx"
#include "DataSourceHelper.hxx"
#include "ChartModelHelper.hxx"
#include "ContainerHelper.hxx"
#include "macros.hxx"
+#include "NumberFormatterWrapper.hxx"
+
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
//.............................................................................
namespace chart
@@ -53,7 +60,11 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2:
, const uno::Reference< frame::XModel >& xChartModel )
: m_bDirty(true)
, m_xCooSysModel( xCooSysModel )
+ , m_xChartModel( xChartModel )
, m_xOriginalCategories()
+ , m_bIsExplicitCategoriesInited(false)
+ , m_bIsDateAxis(false)
+ , m_bIsAutoDate(false)
{
try
{
@@ -61,7 +72,12 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2:
{
uno::Reference< XAxis > xAxis( xCooSysModel->getAxisByDimension(0,0) );
if( xAxis.is() )
- m_xOriginalCategories = xAxis->getScaleData().Categories;
+ {
+ ScaleData aScale( xAxis->getScaleData() );
+ m_xOriginalCategories = aScale.Categories;
+ m_bIsAutoDate = (aScale.AutoDateAxis && aScale.AxisType==chart2::AxisType::CATEGORY);
+ m_bIsDateAxis = (aScale.AxisType == chart2::AxisType::DATE || m_bIsAutoDate);
+ }
}
if( m_xOriginalCategories.is() )
@@ -134,6 +150,13 @@ ExplicitCategoriesProvider::~ExplicitCategoriesProvider()
{
}
+Reference< chart2::data::XDataSequence > ExplicitCategoriesProvider::getOriginalCategories()
+{
+ if( m_xOriginalCategories.is() )
+ return m_xOriginalCategories->getValues();
+ return 0;
+}
+
const Sequence< Reference< data::XLabeledDataSequence> >& ExplicitCategoriesProvider::getSplitCategoriesList()
{
return m_aSplitCategoriesList;
@@ -167,30 +190,51 @@ std::vector<sal_Int32> lcl_getLimitingBorders( const std::vector< ComplexCategor
return aLimitingBorders;
}
-uno::Sequence< rtl::OUString > lcl_DataToStringSequence( const uno::Reference< data::XDataSequence >& xDataSequence )
+void ExplicitCategoriesProvider::convertCategoryAnysToText( uno::Sequence< rtl::OUString >& rOutTexts, const uno::Sequence< uno::Any >& rInAnys, Reference< frame::XModel > xChartModel )
{
- uno::Sequence< rtl::OUString > aStrings;
+ sal_Int32 nCount = rInAnys.getLength();
+ if(!nCount)
+ return;
+ rOutTexts.realloc(nCount);
+ Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
+ Reference< util::XNumberFormats > xNumberFormats;
+ if( xNumberFormatsSupplier.is() )
+ xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+
+ sal_Int32 nAxisNumberFormat = 0;
+ Reference< XCoordinateSystem > xCooSysModel( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ if( xCooSysModel.is() )
+ {
+ Reference< chart2::XAxis > xAxis( xCooSysModel->getAxisByDimension(0,0) );
+ nAxisNumberFormat = AxisHelper::getExplicitNumberFormatKeyForAxis(
+ xAxis, xCooSysModel, xNumberFormatsSupplier, false );
+ }
- OSL_ASSERT( xDataSequence.is());
- if( !xDataSequence.is() )
- return aStrings;
+ sal_Int32 nLabelColor;
+ bool bColorChanged = false;
+ NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
- uno::Reference< data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY );
- if( xTextualDataSequence.is() )
+ for(sal_Int32 nN=0;nN<nCount;nN++)
{
- aStrings = xTextualDataSequence->getTextualData();
- }
- else
- {
- uno::Sequence< uno::Any > aValues = xDataSequence->getData();
- aStrings.realloc(aValues.getLength());
-
- for(sal_Int32 nN=aValues.getLength();nN--;)
- aValues[nN] >>= aStrings[nN];
+ rtl::OUString aText;
+ uno::Any aAny = rInAnys[nN];
+ if( aAny.hasValue() )
+ {
+ double fDouble = 0;
+ if( aAny>>=fDouble )
+ {
+ if( !::rtl::math::isNan(fDouble) )
+ aText = aNumberFormatterWrapper.getFormattedString(
+ nAxisNumberFormat, fDouble, nLabelColor, bColorChanged );
+ }
+ else
+ {
+ aAny>>=aText;
+ }
+ }
+ rOutTexts[nN] = aText;
}
-
- return aStrings;
}
SplitCategoriesProvider::~SplitCategoriesProvider()
@@ -201,9 +245,13 @@ class SplitCategoriesProvider_ForLabeledDataSequences : public SplitCategoriesPr
{
public:
- explicit SplitCategoriesProvider_ForLabeledDataSequences( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::data::XLabeledDataSequence> >& rSplitCategoriesList )
+ explicit SplitCategoriesProvider_ForLabeledDataSequences(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XLabeledDataSequence> >& rSplitCategoriesList
+ , const Reference< frame::XModel >& xChartModel )
: m_rSplitCategoriesList( rSplitCategoriesList )
+ , m_xChartModel( xChartModel )
{}
virtual ~SplitCategoriesProvider_ForLabeledDataSequences()
{}
@@ -214,6 +262,8 @@ public:
private:
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> >& m_rSplitCategoriesList;
+
+ Reference< frame::XModel > m_xChartModel;
};
sal_Int32 SplitCategoriesProvider_ForLabeledDataSequences::getLevelCount() const
@@ -225,7 +275,11 @@ uno::Sequence< rtl::OUString > SplitCategoriesProvider_ForLabeledDataSequences::
uno::Sequence< rtl::OUString > aRet;
Reference< data::XLabeledDataSequence > xLabeledDataSequence( m_rSplitCategoriesList[nLevel] );
if( xLabeledDataSequence.is() )
- aRet = lcl_DataToStringSequence( xLabeledDataSequence->getValues() );
+ {
+ uno::Reference< data::XDataSequence > xDataSequence( xLabeledDataSequence->getValues() );
+ if( xDataSequence.is() )
+ ExplicitCategoriesProvider::convertCategoryAnysToText( aRet, xDataSequence->getData(), m_xChartModel );
+ }
return aRet;
}
@@ -362,23 +416,120 @@ Sequence< OUString > ExplicitCategoriesProvider::getExplicitSimpleCategories(
return lcl_getExplicitSimpleCategories( rSplitCategoriesProvider, aComplexCats );
}
+struct DatePlusIndexComparator
+{
+ inline bool operator() ( const DatePlusIndex& aFirst,
+ const DatePlusIndex& aSecond )
+ {
+ return ( aFirst.fValue < aSecond.fValue );
+ }
+};
+
+bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataSequence, std::vector< DatePlusIndex >& rDateCategories, bool bIsAutoDate, Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier )
+{
+ bool bOnlyDatesFound = true;
+ bool bAnyDataFound = false;
+
+ if( xDataSequence.is() )
+ {
+ uno::Sequence< uno::Any > aValues = xDataSequence->getData();
+ sal_Int32 nCount = aValues.getLength();
+ rDateCategories.reserve(nCount);
+ Reference< util::XNumberFormats > xNumberFormats;
+ if( xNumberFormatsSupplier.is() )
+ xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+
+ bool bOwnData = false;
+ bool bOwnDataAnddAxisHasAnyFormat = false;
+ bool bOwnDataAnddAxisHasDateFormat = false;
+ Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY );
+ Reference< XCoordinateSystem > xCooSysModel( ChartModelHelper::getFirstCoordinateSystem( Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ) );
+ if( xChartDoc.is() && xCooSysModel.is() )
+ {
+ if( xChartDoc->hasInternalDataProvider() )
+ {
+ bOwnData = true;
+ Reference< beans::XPropertySet > xAxisProps( xCooSysModel->getAxisByDimension(0,0), uno::UNO_QUERY );
+ sal_Int32 nAxisNumberFormat = 0;
+ if( xAxisProps.is() && (xAxisProps->getPropertyValue( C2U("NumberFormat") ) >>= nAxisNumberFormat) )
+ {
+ bOwnDataAnddAxisHasAnyFormat = true;
+ bOwnDataAnddAxisHasDateFormat = DiagramHelper::isDateNumberFormat( nAxisNumberFormat, xNumberFormats );
+ }
+ }
+ }
+
+ for(sal_Int32 nN=0;nN<nCount;nN++)
+ {
+ bool bIsDate = false;
+ if( bIsAutoDate )
+ {
+ if( bOwnData )
+ bIsDate = bOwnDataAnddAxisHasAnyFormat ? bOwnDataAnddAxisHasDateFormat : true;
+ else
+ bIsDate = DiagramHelper::isDateNumberFormat( xDataSequence->getNumberFormatKeyByIndex( nN ), xNumberFormats );
+ }
+ else
+ bIsDate = true;
+
+ bool bContainsEmptyString = false;
+ bool bContainsNan = false;
+ uno::Any aAny = aValues[nN];
+ if( aAny.hasValue() )
+ {
+ OUString aTest;
+ double fTest = 0;
+ if( (aAny>>=aTest) && !aTest.getLength() ) //empty String
+ bContainsEmptyString = true;
+ else if( (aAny>>=fTest) && ::rtl::math::isNan(fTest) )
+ bContainsNan = true;
+
+ if( !bContainsEmptyString && !bContainsNan )
+ bAnyDataFound = true;
+ }
+ DatePlusIndex aDatePlusIndex( 1.0, nN );
+ if( bIsDate && (aAny >>= aDatePlusIndex.fValue) )
+ rDateCategories.push_back( aDatePlusIndex );
+ else
+ {
+ if( aAny.hasValue() && !bContainsEmptyString )//empty string does not count as non date value!
+ bOnlyDatesFound=false;
+ ::rtl::math::setNan( &aDatePlusIndex.fValue );
+ rDateCategories.push_back( aDatePlusIndex );
+ }
+ }
+ ::std::sort( rDateCategories.begin(), rDateCategories.end(), DatePlusIndexComparator() );
+ }
+
+ return bAnyDataFound && bOnlyDatesFound;
+}
+
void ExplicitCategoriesProvider::init()
{
if( m_bDirty )
{
- m_aExplicitCategories.realloc(0);
m_aComplexCats.clear();//not one per index
+ m_aDateCategories.clear();
if( m_xOriginalCategories.is() )
{
if( !hasComplexCategories() )
- m_aExplicitCategories = DataSequenceToStringSequence(m_xOriginalCategories->getValues());
+ {
+ if(m_bIsDateAxis)
+ {
+ if( ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( m_xCooSysModel, 0 ), 2, 0 ) )
+ m_bIsDateAxis = lcl_fillDateCategories( m_xOriginalCategories->getValues(), m_aDateCategories, m_bIsAutoDate, Reference< util::XNumberFormatsSupplier >( m_xChartModel.get(), uno::UNO_QUERY ) );
+ else
+ m_bIsDateAxis = false;
+ }
+ }
else
- m_aExplicitCategories = lcl_getExplicitSimpleCategories(
- SplitCategoriesProvider_ForLabeledDataSequences( m_aSplitCategoriesList ), m_aComplexCats );
+ {
+ m_bIsDateAxis = false;
+ }
}
- if(!m_aExplicitCategories.getLength())
- m_aExplicitCategories = DiagramHelper::generateAutomaticCategoriesFromCooSys( m_xCooSysModel );
+ else
+ m_bIsDateAxis=false;
m_bDirty = false;
}
}
@@ -386,7 +537,28 @@ void ExplicitCategoriesProvider::init()
Sequence< ::rtl::OUString > ExplicitCategoriesProvider::getSimpleCategories()
{
- init();
+ if( !m_bIsExplicitCategoriesInited )
+ {
+ init();
+ m_aExplicitCategories.realloc(0);
+ if( m_xOriginalCategories.is() )
+ {
+ if( !hasComplexCategories() )
+ {
+ uno::Reference< data::XDataSequence > xDataSequence( m_xOriginalCategories->getValues() );
+ if( xDataSequence.is() )
+ ExplicitCategoriesProvider::convertCategoryAnysToText( m_aExplicitCategories, xDataSequence->getData(), m_xChartModel );
+ }
+ else
+ {
+ m_aExplicitCategories = lcl_getExplicitSimpleCategories(
+ SplitCategoriesProvider_ForLabeledDataSequences( m_aSplitCategoriesList, m_xChartModel ), m_aComplexCats );
+ }
+ }
+ if(!m_aExplicitCategories.getLength())
+ m_aExplicitCategories = DiagramHelper::generateAutomaticCategoriesFromCooSys( m_xCooSysModel );
+ m_bIsExplicitCategoriesInited = true;
+ }
return m_aExplicitCategories;
}
@@ -415,6 +587,18 @@ OUString ExplicitCategoriesProvider::getCategoryByIndex(
return OUString();
}
+bool ExplicitCategoriesProvider::isDateAxis()
+{
+ init();
+ return m_bIsDateAxis;
+}
+
+const std::vector< DatePlusIndex >& ExplicitCategoriesProvider::getDateCategories()
+{
+ init();
+ return m_aDateCategories;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index 65fc97a04b38..e9b0cf689768 100755
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -38,6 +38,7 @@
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
+using namespace ::com::sun::star;
using namespace ::std;
namespace chart
@@ -55,10 +56,10 @@ struct lcl_NumberedStringGenerator
m_nWildcardLength( rWildcard.getLength())
{
}
- vector< OUString > operator()()
+ vector< uno::Any > operator()()
{
- vector< OUString > aRet(1);
- aRet[0] = m_aStub.replaceAt( m_nStubStartIndex, m_nWildcardLength, OUString::valueOf( ++m_nCounter ));
+ vector< uno::Any > aRet(1);
+ aRet[0] = uno::makeAny( m_aStub.replaceAt( m_nStubStartIndex, m_nWildcardLength, OUString::valueOf( ++m_nCounter )) );
return aRet;
}
private:
@@ -113,12 +114,12 @@ void InternalData::createDefaultData()
m_aRowLabels.clear();
m_aRowLabels.reserve( m_nRowCount );
generate_n( back_inserter( m_aRowLabels ), m_nRowCount,
- lcl_NumberedStringGenerator( aRowName, C2U("%ROWNUMBER") ));
+ lcl_NumberedStringGenerator( aRowName, C2U("%ROWNUMBER") ));
m_aColumnLabels.clear();
m_aColumnLabels.reserve( m_nColumnCount );
generate_n( back_inserter( m_aColumnLabels ), m_nColumnCount,
- lcl_NumberedStringGenerator( aColName, C2U("%COLUMNNUMBER") ));
+ lcl_NumberedStringGenerator( aColName, C2U("%COLUMNNUMBER") ));
}
void InternalData::setData( const Sequence< Sequence< double > >& rDataInRows )
@@ -199,7 +200,7 @@ void InternalData::setRowValues( sal_Int32 nRowIndex, const vector< double > & r
m_aData[ ::std::slice( nRowIndex*m_nColumnCount, m_nColumnCount, 1 ) ]= aSlice;
}
-void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector< OUString >& rComplexLabel )
+void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector< uno::Any >& rComplexLabel )
{
if( nColumnIndex < 0 )
return;
@@ -208,10 +209,10 @@ void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector<
m_aColumnLabels.resize(nColumnIndex+1);
enlargeData( nColumnIndex+1, 0 );
}
-
m_aColumnLabels[nColumnIndex]=rComplexLabel;
}
-void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< OUString >& rComplexLabel )
+
+void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< uno::Any >& rComplexLabel )
{
if( nRowIndex < 0 )
return;
@@ -220,23 +221,22 @@ void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< OUStri
m_aRowLabels.resize(nRowIndex+1);
enlargeData( 0, nRowIndex+1 );
}
-
m_aRowLabels[nRowIndex] = rComplexLabel;
}
-vector< OUString > InternalData::getComplexColumnLabel( sal_Int32 nColumnIndex ) const
+vector< uno::Any > InternalData::getComplexColumnLabel( sal_Int32 nColumnIndex ) const
{
if( nColumnIndex < static_cast< sal_Int32 >( m_aColumnLabels.size() ) )
return m_aColumnLabels[nColumnIndex];
else
- return vector< OUString >();
+ return vector< uno::Any >();
}
-vector< OUString > InternalData::getComplexRowLabel( sal_Int32 nRowIndex ) const
+vector< uno::Any > InternalData::getComplexRowLabel( sal_Int32 nRowIndex ) const
{
if( nRowIndex < static_cast< sal_Int32 >( m_aRowLabels.size() ) )
return m_aRowLabels[nRowIndex];
else
- return vector< OUString >();
+ return vector< uno::Any >();
}
void InternalData::swapRowWithNext( sal_Int32 nRowIndex )
@@ -253,7 +253,7 @@ void InternalData::swapRowWithNext( sal_Int32 nRowIndex )
m_aData[nIndex2] = fTemp;
}
- vector< OUString > aTemp( m_aRowLabels[nRowIndex] );
+ vector< uno::Any > aTemp( m_aRowLabels[nRowIndex] );
m_aRowLabels[nRowIndex] = m_aRowLabels[nRowIndex + 1];
m_aRowLabels[nRowIndex + 1] = aTemp;
}
@@ -273,7 +273,7 @@ void InternalData::swapColumnWithNext( sal_Int32 nColumnIndex )
m_aData[nIndex2] = fTemp;
}
- vector< OUString > aTemp( m_aColumnLabels[nColumnIndex] );
+ vector< uno::Any > aTemp( m_aColumnLabels[nColumnIndex] );
m_aColumnLabels[nColumnIndex] = m_aColumnLabels[nColumnIndex + 1];
m_aColumnLabels[nColumnIndex + 1] = aTemp;
}
@@ -336,7 +336,7 @@ void InternalData::insertColumn( sal_Int32 nAfterIndex )
// labels
if( nAfterIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
- m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), vector< OUString >(1) );
+ m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), vector< uno::Any >(1) );
#if OSL_DEBUG_LEVEL > 2
traceData();
@@ -388,7 +388,7 @@ void InternalData::insertRow( sal_Int32 nAfterIndex )
// labels
if( nAfterIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
- m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, vector< OUString> (1));
+ m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, vector< uno::Any > (1));
#if OSL_DEBUG_LEVEL > 2
traceData();
@@ -481,7 +481,7 @@ sal_Int32 InternalData::getColumnCount() const
return m_nColumnCount;
}
-void InternalData::setComplexRowLabels( const vector< vector< OUString > >& rNewRowLabels )
+void InternalData::setComplexRowLabels( const vector< vector< uno::Any > >& rNewRowLabels )
{
m_aRowLabels = rNewRowLabels;
sal_Int32 nNewRowCount = static_cast< sal_Int32 >( m_aRowLabels.size() );
@@ -491,12 +491,12 @@ void InternalData::setComplexRowLabels( const vector< vector< OUString > >& rNew
enlargeData( 0, nNewRowCount );
}
-vector< vector< OUString > > InternalData::getComplexRowLabels() const
+vector< vector< uno::Any > > InternalData::getComplexRowLabels() const
{
return m_aRowLabels;
}
-void InternalData::setComplexColumnLabels( const vector< vector< OUString > >& rNewColumnLabels )
+void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& rNewColumnLabels )
{
m_aColumnLabels = rNewColumnLabels;
sal_Int32 nNewColumnCount = static_cast< sal_Int32 >( m_aColumnLabels.size() );
@@ -506,7 +506,7 @@ void InternalData::setComplexColumnLabels( const vector< vector< OUString > >& r
enlargeData( nNewColumnCount, 0 );
}
-vector< vector< OUString > > InternalData::getComplexColumnLabels() const
+vector< vector< uno::Any > > InternalData::getComplexColumnLabels() const
{
return m_aColumnLabels;
}
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 26b2db4fc253..2d51bd0f7acd 100755
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -93,6 +93,24 @@ static const ::rtl::OUString lcl_aCompleteRange(
typedef ::std::multimap< OUString, uno::WeakReference< chart2::data::XDataSequence > >
lcl_tSequenceMap;
+Sequence< OUString > lcl_AnyToStringSequence( const Sequence< uno::Any >& aAnySeq )
+{
+ Sequence< OUString > aResult;
+ aResult.realloc( aAnySeq.getLength() );
+ transform( aAnySeq.getConstArray(), aAnySeq.getConstArray() + aAnySeq.getLength(),
+ aResult.getArray(), CommonFunctors::AnyToString() );
+ return aResult;
+}
+
+Sequence< uno::Any > lcl_StringToAnySequence( const Sequence< OUString >& aStringSeq )
+{
+ Sequence< uno::Any > aResult;
+ aResult.realloc( aStringSeq.getLength() );
+ transform( aStringSeq.getConstArray(), aStringSeq.getConstArray() + aStringSeq.getLength(),
+ aResult.getArray(), CommonFunctors::makeAny< OUString >() );
+ return aResult;
+}
+
struct lcl_setModified : public ::std::unary_function< lcl_tSequenceMap, void >
{
void operator() ( const lcl_tSequenceMap::value_type & rMapEntry )
@@ -154,9 +172,9 @@ struct lcl_internalizeSeries : public ::std::unary_function< Reference< chart2::
if( xLabel.is() )
{
if( m_bDataInColumns )
- m_rInternalData.setComplexColumnLabel( nNewIndex, ContainerHelper::SequenceToVector( xLabel->getTextualData() ) );
+ m_rInternalData.setComplexColumnLabel( nNewIndex, ContainerHelper::SequenceToVector( lcl_StringToAnySequence( xLabel->getTextualData() ) ) );
else
- m_rInternalData.setComplexRowLabel( nNewIndex, ContainerHelper::SequenceToVector( xLabel->getTextualData() ) );
+ m_rInternalData.setComplexRowLabel( nNewIndex, ContainerHelper::SequenceToVector( lcl_StringToAnySequence( xLabel->getTextualData() ) ) );
if( m_bConnectToModel )
{
Reference< chart2::data::XDataSequence > xNewLabel(
@@ -187,37 +205,37 @@ private:
bool m_bDataInColumns;
};
-struct lcl_makeAnyFromLevelVector : public ::std::unary_function< vector< OUString >, uno::Any >
+struct lcl_copyFromLevel : public ::std::unary_function< vector< uno::Any >, uno::Any >
{
public:
- explicit lcl_makeAnyFromLevelVector( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_copyFromLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- uno::Any operator() ( const vector< OUString >& rVector )
+ uno::Any operator() ( const vector< uno::Any >& rVector )
{
- OUString aString;
+ uno::Any aRet;
if( m_nLevel < static_cast< sal_Int32 >(rVector.size()) )
- aString = rVector[m_nLevel];
- return uno::makeAny( aString );
+ aRet = rVector[m_nLevel];
+ return aRet;
}
private:
sal_Int32 m_nLevel;
};
-struct lcl_getStringFromLevelVector : public ::std::unary_function< vector< OUString >, OUString >
+struct lcl_getStringFromLevelVector : public ::std::unary_function< vector< uno::Any >, OUString >
{
public:
explicit lcl_getStringFromLevelVector( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- OUString operator() ( const vector< OUString >& rVector )
+ OUString operator() ( const vector< uno::Any >& rVector )
{
OUString aString;
if( m_nLevel < static_cast< sal_Int32 >(rVector.size()) )
- aString = rVector[m_nLevel];
+ aString = CommonFunctors::AnyToString()(rVector[m_nLevel]);
return aString;
}
@@ -226,19 +244,19 @@ private:
};
-struct lcl_setStringAtLevel : public ::std::binary_function< vector< OUString >, OUString, vector< OUString > >
+struct lcl_setAnyAtLevel : public ::std::binary_function< vector< uno::Any >, uno::Any, vector< uno::Any > >
{
public:
- explicit lcl_setStringAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_setAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- vector< OUString > operator() ( const vector< OUString >& rVector, const OUString& rNewText )
+ vector< uno::Any > operator() ( const vector< uno::Any >& rVector, const uno::Any& rNewValue )
{
- vector< OUString > aRet( rVector );
+ vector< uno::Any > aRet( rVector );
if( m_nLevel >= static_cast< sal_Int32 >(aRet.size()) )
aRet.resize( m_nLevel+1 );
- aRet[ m_nLevel ]=rNewText;
+ aRet[ m_nLevel ]=rNewValue;
return aRet;
}
@@ -246,41 +264,61 @@ private:
sal_Int32 m_nLevel;
};
-struct lcl_insertStringAtLevel : public ::std::unary_function< vector< OUString >, void >
+struct lcl_setAnyAtLevelFromStringSequence : public ::std::binary_function< vector< uno::Any >, OUString, vector< uno::Any > >
{
public:
- explicit lcl_insertStringAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_setAnyAtLevelFromStringSequence( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- void operator() ( vector< OUString >& rVector )
+ vector< uno::Any > operator() ( const vector< uno::Any >& rVector, const OUString& rNewValue )
+ {
+ vector< uno::Any > aRet( rVector );
+ if( m_nLevel >= static_cast< sal_Int32 >(aRet.size()) )
+ aRet.resize( m_nLevel+1 );
+ aRet[ m_nLevel ]=uno::makeAny(rNewValue);
+ return aRet;
+ }
+
+private:
+ sal_Int32 m_nLevel;
+};
+
+struct lcl_insertAnyAtLevel : public ::std::unary_function< vector< uno::Any >, void >
+{
+public:
+
+ explicit lcl_insertAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ {}
+
+ void operator() ( vector< uno::Any >& rVector )
{
if( m_nLevel > static_cast< sal_Int32 >(rVector.size()) )
rVector.resize( m_nLevel );
- vector< OUString >::iterator aIt( rVector.begin() );
+ vector< uno::Any >::iterator aIt( rVector.begin() );
for( sal_Int32 nN=0; aIt<rVector.end(); aIt++, nN++)
{
if( nN==m_nLevel )
break;
}
- rVector.insert( aIt, OUString() );
+ rVector.insert( aIt, uno::Any() );
}
private:
sal_Int32 m_nLevel;
};
-struct lcl_removeStringAtLevel : public ::std::unary_function< vector< OUString >, void >
+struct lcl_removeAnyAtLevel : public ::std::unary_function< vector< uno::Any >, void >
{
public:
- explicit lcl_removeStringAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_removeAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- void operator() ( vector< OUString >& rVector )
+ void operator() ( vector< uno::Any >& rVector )
{
- vector< OUString >::iterator aIt( rVector.begin() );
+ vector< uno::Any >::iterator aIt( rVector.begin() );
for( sal_Int32 nN=0; aIt<rVector.end(); aIt++, nN++)
{
if( nN==m_nLevel )
@@ -295,23 +333,6 @@ private:
sal_Int32 m_nLevel;
};
-vector< OUString > lcl_AnyToStringVector( const Sequence< uno::Any >& aAnySeq )
-{
- vector< OUString > aStringVec;
- transform( aAnySeq.getConstArray(), aAnySeq.getConstArray() + aAnySeq.getLength(),
- back_inserter( aStringVec ), CommonFunctors::AnyToString() );
- return aStringVec;
-}
-
-Sequence< OUString > lcl_AnyToStringSequence( const Sequence< uno::Any >& aAnySeq )
-{
- Sequence< OUString > aResult;
- aResult.realloc( aAnySeq.getLength() );
- transform( aAnySeq.getConstArray(), aAnySeq.getConstArray() + aAnySeq.getLength(),
- aResult.getArray(), CommonFunctors::AnyToString() );
- return aResult;
-}
-
} // anonymous namespace
// ================================================================================
@@ -341,9 +362,10 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum
// categories
{
- vector< vector< OUString > > aNewCategories;//inner count is level
+ vector< vector< uno::Any > > aNewCategories;//inner count is level
{
ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(xChartModel), xChartModel );
+
const Sequence< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() );
sal_Int32 nLevelCount = rSplitCategoriesList.getLength();
for( sal_Int32 nL = 0; nL<nLevelCount; nL++ )
@@ -351,18 +373,18 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum
Reference< chart2::data::XLabeledDataSequence > xLDS( rSplitCategoriesList[nL] );
if( !xLDS.is() )
continue;
- Reference< chart2::data::XTextualDataSequence > xSeq( xLDS->getValues(), uno::UNO_QUERY );
- Sequence< OUString > aStringSeq;
+ Sequence< uno::Any > aDataSeq;
+ Reference< chart2::data::XDataSequence > xSeq( xLDS->getValues() );
if( xSeq.is() )
- aStringSeq = xSeq->getTextualData(); // @todo: be able to deal with XDataSequence, too
- sal_Int32 nLength = aStringSeq.getLength();
+ aDataSeq = xSeq->getData();
+ sal_Int32 nLength = aDataSeq.getLength();
sal_Int32 nCatLength = static_cast< sal_Int32 >(aNewCategories.size());
if( nCatLength < nLength )
aNewCategories.resize( nLength );
else if( nLength < nCatLength )
- aStringSeq.realloc( nCatLength );
- transform( aNewCategories.begin(), aNewCategories.end(), aStringSeq.getConstArray(),
- aNewCategories.begin(), lcl_setStringAtLevel(nL) );
+ aDataSeq.realloc( nCatLength );
+ transform( aNewCategories.begin(), aNewCategories.end(), aDataSeq.getConstArray(),
+ aNewCategories.begin(), lcl_setAnyAtLevel(nL) );
}
if( !nLevelCount )
{
@@ -371,9 +393,9 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum
aNewCategories.reserve( nLength );
for( sal_Int32 nN=0; nN<nLength; nN++)
{
- vector< OUString > aStringVector(1);
- aStringVector[0] = aSimplecategories[nN];
- aNewCategories.push_back( aStringVector );
+ vector< uno::Any > aVector(1);
+ aVector[0] = uno::makeAny( aSimplecategories[nN] );
+ aNewCategories.push_back( aVector );
}
}
}
@@ -520,14 +542,14 @@ void InternalDataProvider::createDefaultData()
namespace
{
-sal_Int32 lcl_getInnerLevelCount( const vector< vector< OUString > >& rLabels )
+sal_Int32 lcl_getInnerLevelCount( const vector< vector< uno::Any > >& rLabels )
{
sal_Int32 nCount = 1;//minimum is 1!
- vector< vector< OUString > >::const_iterator aLevelIt( rLabels.begin() );
- vector< vector< OUString > >::const_iterator aLevelEnd( rLabels.end() );
+ vector< vector< uno::Any > >::const_iterator aLevelIt( rLabels.begin() );
+ vector< vector< uno::Any > >::const_iterator aLevelEnd( rLabels.end() );
for( ;aLevelIt!=aLevelEnd; ++aLevelIt )
{
- const vector< ::rtl::OUString >& rCurrentLevelLabels = *aLevelIt;
+ const vector< uno::Any >& rCurrentLevelLabels = *aLevelIt;
nCount = std::max<sal_Int32>( rCurrentLevelLabels.size(), nCount );
}
return nCount;
@@ -551,7 +573,7 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData
{
//return split complex categories if we have any:
::std::vector< Reference< chart2::data::XLabeledDataSequence > > aComplexCategories;
- vector< vector< OUString > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
if( bUseColumns==m_bDataInColumns )
{
sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
@@ -733,46 +755,48 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
if( aRange.match( lcl_aLabelRangePrefix ) )
{
sal_Int32 nIndex = aRange.copy( lcl_aLabelRangePrefix.getLength()).toInt32();
- vector< OUString > aComplexLabel = m_bDataInColumns
+ vector< uno::Any > aComplexLabel = m_bDataInColumns
? m_aInternalData.getComplexColumnLabel( nIndex )
: m_aInternalData.getComplexRowLabel( nIndex );
if( !aComplexLabel.empty() )
- {
- aResult.realloc( aComplexLabel.size() );
- transform( aComplexLabel.begin(), aComplexLabel.end(),
- aResult.getArray(), CommonFunctors::makeAny< OUString >());
- }
+ aResult = ContainerHelper::ContainerToSequence(aComplexLabel);
}
else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) )
{
sal_Int32 nPointIndex = aRange.copy( lcl_aCategoriesPointRangeNamePrefix.getLength() ).toInt32();
- vector< OUString > aComplexCategory = m_bDataInColumns
+ vector< uno::Any > aComplexCategory = m_bDataInColumns
? m_aInternalData.getComplexRowLabel( nPointIndex )
: m_aInternalData.getComplexColumnLabel( nPointIndex );
if( !aComplexCategory.empty() )
- {
- aResult.realloc( aComplexCategory.size() );
- transform( aComplexCategory.begin(), aComplexCategory.end(),
- aResult.getArray(), CommonFunctors::makeAny< OUString >());
- }
+ aResult = ContainerHelper::ContainerToSequence(aComplexCategory);
}
else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) )
{
sal_Int32 nLevel = aRange.copy( lcl_aCategoriesLevelRangeNamePrefix.getLength() ).toInt32();
- vector< vector< OUString > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
if( nLevel < lcl_getInnerLevelCount( aCategories ) )
{
aResult.realloc( aCategories.size() );
transform( aCategories.begin(), aCategories.end(),
- aResult.getArray(), lcl_makeAnyFromLevelVector(nLevel) );
+ aResult.getArray(), lcl_copyFromLevel(nLevel) );
}
}
else if( aRange.equals( lcl_aCategoriesRangeName ) )
{
- Sequence< OUString > aLabels = m_bDataInColumns ? this->getRowDescriptions() : this->getColumnDescriptions();
- aResult.realloc( aLabels.getLength() );
- transform( aLabels.getConstArray(), aLabels.getConstArray() + aLabels.getLength(),
- aResult.getArray(), CommonFunctors::makeAny< OUString >() );
+ vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
+ if( nLevelCount == 1 )
+ {
+ sal_Int32 nL=0;
+ aResult = this->getDataByRangeRepresentation( lcl_aCategoriesLevelRangeNamePrefix + OUString::valueOf( nL ) );
+ }
+ else
+ {
+ Sequence< OUString > aLabels = m_bDataInColumns ? this->getRowDescriptions() : this->getColumnDescriptions();
+ aResult.realloc( aLabels.getLength() );
+ transform( aLabels.getConstArray(), aLabels.getConstArray() + aLabels.getLength(),
+ aResult.getArray(), CommonFunctors::makeAny< OUString >() );
+ }
}
else
{
@@ -800,38 +824,36 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
const OUString& aRange, const Sequence< uno::Any >& aNewData )
throw (uno::RuntimeException)
{
+ vector< uno::Any > aNewVector( ContainerHelper::SequenceToVector(aNewData) );
if( aRange.match( lcl_aLabelRangePrefix ) )
{
- vector< OUString > aNewStrings( lcl_AnyToStringVector( aNewData ) );
sal_uInt32 nIndex = aRange.copy( lcl_aLabelRangePrefix.getLength()).toInt32();
if( m_bDataInColumns )
- m_aInternalData.setComplexColumnLabel( nIndex, aNewStrings );
+ m_aInternalData.setComplexColumnLabel( nIndex, aNewVector );
else
- m_aInternalData.setComplexRowLabel( nIndex, aNewStrings );
+ m_aInternalData.setComplexRowLabel( nIndex, aNewVector );
}
else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) )
{
- vector< OUString > aNewStrings( lcl_AnyToStringVector( aNewData ) );
sal_Int32 nPointIndex = aRange.copy( lcl_aCategoriesLevelRangeNamePrefix.getLength()).toInt32();
if( m_bDataInColumns )
- m_aInternalData.setComplexRowLabel( nPointIndex, aNewStrings );
+ m_aInternalData.setComplexRowLabel( nPointIndex, aNewVector );
else
- m_aInternalData.setComplexColumnLabel( nPointIndex, aNewStrings );
+ m_aInternalData.setComplexColumnLabel( nPointIndex, aNewVector );
}
else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) )
{
- vector< OUString > aNewStrings( lcl_AnyToStringVector( aNewData ) );
sal_Int32 nLevel = aRange.copy( lcl_aCategoriesLevelRangeNamePrefix.getLength()).toInt32();
- vector< vector< OUString > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
+ vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
//ensure equal length
- if( aNewStrings.size() > aComplexCategories.size() )
- aComplexCategories.resize( aNewStrings.size() );
- else if( aNewStrings.size() < aComplexCategories.size() )
- aNewStrings.resize( aComplexCategories.size() );
+ if( aNewVector.size() > aComplexCategories.size() )
+ aComplexCategories.resize( aNewVector.size() );
+ else if( aNewVector.size() < aComplexCategories.size() )
+ aNewVector.resize( aComplexCategories.size() );
- transform( aComplexCategories.begin(), aComplexCategories.end(), aNewStrings.begin(),
- aComplexCategories.begin(), lcl_setStringAtLevel(nLevel) );
+ transform( aComplexCategories.begin(), aComplexCategories.end(), aNewVector.begin(),
+ aComplexCategories.begin(), lcl_setAnyAtLevel(nLevel) );
if( m_bDataInColumns )
m_aInternalData.setComplexRowLabels( aComplexCategories );
@@ -840,10 +862,14 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
}
else if( aRange.equals( lcl_aCategoriesRangeName ) )
{
+ vector< vector< uno::Any > > aComplexCategories;
+ aComplexCategories.resize( aNewVector.size() );
+ transform( aComplexCategories.begin(), aComplexCategories.end(), aNewVector.begin(),
+ aComplexCategories.begin(), lcl_setAnyAtLevel(0) );
if( m_bDataInColumns )
- this->setRowDescriptions( lcl_AnyToStringSequence(aNewData) );
+ m_aInternalData.setComplexRowLabels( aComplexCategories );
else
- this->setColumnDescriptions( lcl_AnyToStringSequence(aNewData) );
+ m_aInternalData.setComplexColumnLabels( aComplexCategories );
}
else
{
@@ -908,8 +934,8 @@ void SAL_CALL InternalDataProvider::insertComplexCategoryLevel( sal_Int32 nLevel
OSL_ENSURE( nLevel> 0, "you can only insert category levels > 0" );//the first categories level cannot be deleted, check the calling code for error
if( nLevel>0 )
{
- vector< vector< OUString > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
- ::std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_insertStringAtLevel(nLevel) );
+ vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
+ ::std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_insertAnyAtLevel(nLevel) );
if( m_bDataInColumns )
m_aInternalData.setComplexRowLabels( aComplexCategories );
else
@@ -925,8 +951,8 @@ void SAL_CALL InternalDataProvider::deleteComplexCategoryLevel( sal_Int32 nLevel
OSL_ENSURE( nLevel>0, "you can only delete category levels > 0" );//the first categories level cannot be deleted, check the calling code for error
if( nLevel>0 )
{
- vector< vector< OUString > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
- ::std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_removeStringAtLevel(nLevel) );
+ vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
+ ::std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_removeAnyAtLevel(nLevel) );
if( m_bDataInColumns )
m_aInternalData.setComplexRowLabels( aComplexCategories );
else
@@ -1136,7 +1162,36 @@ OUString SAL_CALL InternalDataProvider::convertRangeFromXML( const OUString& aXM
namespace
{
-Sequence< Sequence< OUString > > lcl_convertComplexVectorToSequence( const vector< vector< OUString > >& rIn )
+
+template< class Type >
+Sequence< Sequence< Type > > lcl_convertVectorVectorToSequenceSequence( const vector< vector< Type > >& rIn )
+{
+ Sequence< Sequence< Type > > aRet;
+ sal_Int32 nOuterCount = rIn.size();
+ if( nOuterCount )
+ {
+ aRet.realloc(nOuterCount);
+ for( sal_Int32 nN=0; nN<nOuterCount; nN++)
+ aRet[nN]= ContainerHelper::ContainerToSequence( rIn[nN] );
+ }
+ return aRet;
+}
+
+template< class Type >
+vector< vector< Type > > lcl_convertSequenceSequenceToVectorVector( const Sequence< Sequence< Type > >& rIn )
+{
+ vector< vector< Type > > aRet;
+ sal_Int32 nOuterCount = rIn.getLength();
+ if( nOuterCount )
+ {
+ aRet.resize(nOuterCount);
+ for( sal_Int32 nN=0; nN<nOuterCount; nN++)
+ aRet[nN]= ContainerHelper::SequenceToVector( rIn[nN] );
+ }
+ return aRet;
+}
+
+Sequence< Sequence< OUString > > lcl_convertComplexAnyVectorToStringSequence( const vector< vector< uno::Any > >& rIn )
{
Sequence< Sequence< OUString > > aRet;
sal_Int32 nOuterCount = rIn.size();
@@ -1144,17 +1199,17 @@ Sequence< Sequence< OUString > > lcl_convertComplexVectorToSequence( const vecto
{
aRet.realloc(nOuterCount);
for( sal_Int32 nN=0; nN<nOuterCount; nN++)
- aRet[nN]=ContainerHelper::ContainerToSequence( rIn[nN] );
+ aRet[nN]= lcl_AnyToStringSequence( ContainerHelper::ContainerToSequence( rIn[nN] ) );
}
return aRet;
}
-vector< vector< OUString > > lcl_convertComplexSequenceToVector( const Sequence< Sequence< OUString > >& rIn )
+vector< vector< uno::Any > > lcl_convertComplexStringSequenceToAnyVector( const Sequence< Sequence< OUString > >& rIn )
{
- vector< vector< OUString > > aRet;
+ vector< vector< uno::Any > > aRet;
sal_Int32 nOuterCount = rIn.getLength();
for( sal_Int32 nN=0; nN<nOuterCount; nN++)
- aRet.push_back( ContainerHelper::SequenceToVector( rIn[nN] ) );
+ aRet.push_back( ContainerHelper::SequenceToVector( lcl_StringToAnySequence( rIn[nN] ) ) );
return aRet;
}
@@ -1162,7 +1217,7 @@ class SplitCategoriesProvider_ForComplexDescriptions : public SplitCategoriesPro
{
public:
- explicit SplitCategoriesProvider_ForComplexDescriptions( const ::std::vector< ::std::vector< ::rtl::OUString > >& rComplexDescriptions )
+ explicit SplitCategoriesProvider_ForComplexDescriptions( const ::std::vector< ::std::vector< uno::Any > >& rComplexDescriptions )
: m_rComplexDescriptions( rComplexDescriptions )
{}
virtual ~SplitCategoriesProvider_ForComplexDescriptions()
@@ -1172,7 +1227,7 @@ public:
virtual uno::Sequence< rtl::OUString > getStringsForLevel( sal_Int32 nIndex ) const;
private:
- const ::std::vector< ::std::vector< ::rtl::OUString > >& m_rComplexDescriptions;
+ const ::std::vector< ::std::vector< uno::Any > >& m_rComplexDescriptions;
};
sal_Int32 SplitCategoriesProvider_ForComplexDescriptions::getLevelCount() const
@@ -1193,22 +1248,78 @@ uno::Sequence< rtl::OUString > SplitCategoriesProvider_ForComplexDescriptions::g
}//anonymous namespace
+// ____ XDateCategories ____
+Sequence< double > SAL_CALL InternalDataProvider::getDateCategories() throw (uno::RuntimeException)
+{
+ double fNan = InternalDataProvider::getNotANumber();
+ double fValue = fNan;
+ vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ sal_Int32 nCount = aCategories.size();
+ Sequence< double > aDoubles( nCount );
+ vector< vector< uno::Any > >::iterator aIt( aCategories.begin() );
+ vector< vector< uno::Any > >::const_iterator aEnd( aCategories.end() );
+ for(sal_Int32 nN=0; nN<nCount && aIt!=aEnd; ++nN, ++aIt )
+ {
+ if( !( !aIt->empty() && ((*aIt)[0]>>=fValue) ) )
+ fValue = fNan;
+ aDoubles[nN]=fValue;
+ }
+ return aDoubles;
+}
+
+void SAL_CALL InternalDataProvider::setDateCategories( const Sequence< double >& rDates ) throw (uno::RuntimeException)
+{
+ sal_Int32 nCount = rDates.getLength();
+ vector< vector< uno::Any > > aNewCategories;
+ aNewCategories.reserve(nCount);
+ vector< uno::Any > aSingleLabel(1);
+
+ for(sal_Int32 nN=0; nN<nCount; ++nN )
+ {
+ aSingleLabel[0]=uno::makeAny(rDates[nN]);
+ aNewCategories.push_back(aSingleLabel);
+ }
+
+ if( m_bDataInColumns )
+ m_aInternalData.setComplexRowLabels( aNewCategories );
+ else
+ m_aInternalData.setComplexColumnLabels( aNewCategories );
+}
+
+// ____ XAnyDescriptionAccess ____
+Sequence< Sequence< uno::Any > > SAL_CALL InternalDataProvider::getAnyRowDescriptions() throw (uno::RuntimeException)
+{
+ return lcl_convertVectorVectorToSequenceSequence( m_aInternalData.getComplexRowLabels() );
+}
+void SAL_CALL InternalDataProvider::setAnyRowDescriptions( const Sequence< Sequence< uno::Any > >& aRowDescriptions ) throw (uno::RuntimeException)
+{
+ m_aInternalData.setComplexRowLabels( lcl_convertSequenceSequenceToVectorVector( aRowDescriptions ) );
+}
+Sequence< Sequence< uno::Any > > SAL_CALL InternalDataProvider::getAnyColumnDescriptions() throw (uno::RuntimeException)
+{
+ return lcl_convertVectorVectorToSequenceSequence( m_aInternalData.getComplexColumnLabels() );
+}
+void SAL_CALL InternalDataProvider::setAnyColumnDescriptions( const Sequence< Sequence< uno::Any > >& aColumnDescriptions ) throw (uno::RuntimeException)
+{
+ m_aInternalData.setComplexColumnLabels( lcl_convertSequenceSequenceToVectorVector( aColumnDescriptions ) );
+}
+
// ____ XComplexDescriptionAccess ____
Sequence< Sequence< OUString > > SAL_CALL InternalDataProvider::getComplexRowDescriptions() throw (uno::RuntimeException)
{
- return lcl_convertComplexVectorToSequence( m_aInternalData.getComplexRowLabels() );
+ return lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexRowLabels() );
}
void SAL_CALL InternalDataProvider::setComplexRowDescriptions( const Sequence< Sequence< ::rtl::OUString > >& aRowDescriptions ) throw (uno::RuntimeException)
{
- m_aInternalData.setComplexRowLabels( lcl_convertComplexSequenceToVector(aRowDescriptions) );
+ m_aInternalData.setComplexRowLabels( lcl_convertComplexStringSequenceToAnyVector(aRowDescriptions) );
}
Sequence< Sequence< ::rtl::OUString > > SAL_CALL InternalDataProvider::getComplexColumnDescriptions() throw (uno::RuntimeException)
{
- return lcl_convertComplexVectorToSequence( m_aInternalData.getComplexColumnLabels() );
+ return lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexColumnLabels() );
}
void SAL_CALL InternalDataProvider::setComplexColumnDescriptions( const Sequence< Sequence< ::rtl::OUString > >& aColumnDescriptions ) throw (uno::RuntimeException)
{
- m_aInternalData.setComplexColumnLabels( lcl_convertComplexSequenceToVector(aColumnDescriptions) );
+ m_aInternalData.setComplexColumnLabels( lcl_convertComplexStringSequenceToAnyVector(aColumnDescriptions) );
}
// ____ XChartDataArray ____
@@ -1227,25 +1338,25 @@ void SAL_CALL InternalDataProvider::setData( const Sequence< Sequence< double >
void SAL_CALL InternalDataProvider::setRowDescriptions( const Sequence< OUString >& aRowDescriptions )
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexDescriptions( aRowDescriptions.getLength() );
+ vector< vector< uno::Any > > aComplexDescriptions( aRowDescriptions.getLength() );
transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aRowDescriptions.getConstArray(),
- aComplexDescriptions.begin(), lcl_setStringAtLevel(0) );
+ aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) );
m_aInternalData.setComplexRowLabels( aComplexDescriptions );
}
void SAL_CALL InternalDataProvider::setColumnDescriptions( const Sequence< OUString >& aColumnDescriptions )
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexDescriptions( aColumnDescriptions.getLength() );
+ vector< vector< uno::Any > > aComplexDescriptions( aColumnDescriptions.getLength() );
transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aColumnDescriptions.getConstArray(),
- aComplexDescriptions.begin(), lcl_setStringAtLevel(0) );
+ aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) );
m_aInternalData.setComplexColumnLabels( aComplexDescriptions );
}
Sequence< OUString > SAL_CALL InternalDataProvider::getRowDescriptions()
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexLabels( m_aInternalData.getComplexRowLabels() );
+ vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexRowLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}
@@ -1253,7 +1364,7 @@ Sequence< OUString > SAL_CALL InternalDataProvider::getRowDescriptions()
Sequence< OUString > SAL_CALL InternalDataProvider::getColumnDescriptions()
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexLabels( m_aInternalData.getComplexColumnLabels() );
+ vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexColumnLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}
diff --git a/chart2/source/view/main/NumberFormatterWrapper.cxx b/chart2/source/tools/NumberFormatterWrapper.cxx
index 4e4cd342506c..829a64cc6617 100644..100755
--- a/chart2/source/view/main/NumberFormatterWrapper.cxx
+++ b/chart2/source/tools/NumberFormatterWrapper.cxx
@@ -27,7 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "macros.hxx"
#include <comphelper/processfactory.hxx>
// header for class SvNumberFormatsSupplierObj
@@ -100,6 +100,25 @@ SvNumberFormatter* NumberFormatterWrapper::getSvNumberFormatter() const
return m_pNumberFormatter;
}
+Date NumberFormatterWrapper::getNullDate() const
+{
+ USHORT nYear = 1899,nDay = 30,nMonth = 12;
+ Date aRet(nDay,nMonth,nYear);
+
+ util::DateTime aUtilDate;
+ if( m_aNullDate.hasValue() && (m_aNullDate >>= aUtilDate) )
+ {
+ aRet = Date(aUtilDate.Day,aUtilDate.Month,aUtilDate.Year);
+ }
+ else if( m_pNumberFormatter )
+ {
+ Date* pDate = m_pNumberFormatter->GetNullDate();
+ if( pDate )
+ aRet = *pDate;
+ }
+ return aRet;
+}
+
rtl::OUString NumberFormatterWrapper::getFormattedString(
sal_Int32 nNumberFormatKey, double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const
{
diff --git a/chart2/source/tools/ResId.cxx b/chart2/source/tools/ResId.cxx
index 0d6e35974aaa..b7d4c725d367 100644..100755
--- a/chart2/source/tools/ResId.cxx
+++ b/chart2/source/tools/ResId.cxx
@@ -41,7 +41,7 @@ SchResId::SchResId( sal_Int16 nId )
::rtl::OUString SchResId::getResString( sal_Int16 nId )
{
- return ::rtl::OUString( String( SchResId( nId )));
+ return String( SchResId( nId ));
}
} // namespace chart
diff --git a/chart2/source/tools/makefile.mk b/chart2/source/tools/makefile.mk
index fd92b894bfab..7554bd19cd38 100644
--- a/chart2/source/tools/makefile.mk
+++ b/chart2/source/tools/makefile.mk
@@ -70,6 +70,7 @@ SLOFILES= \
$(SLO)$/LinearRegressionCurveCalculator.obj \
$(SLO)$/LogarithmicRegressionCurveCalculator.obj \
$(SLO)$/MeanValueRegressionCurveCalculator.obj \
+ $(SLO)$/NumberFormatterWrapper.obj \
$(SLO)$/OPropertySet.obj \
$(SLO)$/WrappedPropertySet.obj \
$(SLO)$/WrappedProperty.obj \
diff --git a/chart2/source/view/axes/DateHelper.cxx b/chart2/source/view/axes/DateHelper.cxx
new file mode 100644
index 000000000000..45f958ab2898
--- /dev/null
+++ b/chart2/source/view/axes/DateHelper.cxx
@@ -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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "DateHelper.hxx"
+#include "DateScaling.hxx"
+#include <rtl/math.hxx>
+#include <com/sun/star/chart/TimeUnit.hpp>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+
+bool DateHelper::IsInSameYear( const Date& rD1, const Date& rD2 )
+{
+ return rD1.GetYear() == rD2.GetYear();
+}
+bool DateHelper::IsInSameMonth( const Date& rD1, const Date& rD2 )
+{
+ return (rD1.GetYear() == rD2.GetYear())
+ && (rD1.GetMonth() == rD2.GetMonth());
+}
+long DateHelper::GetMonthsBetweenDates( Date aD1, Date aD2 )
+{
+ Date aHelp = aD1;
+ long nSign = 1;
+ if( aD1 < aD2 )
+ {
+ aD1 = aD2;
+ aD2 = aHelp;
+ nSign = -1;
+ }
+
+ return nSign*( ( aD1.GetMonth() - aD2.GetMonth() )
+ + ( aD1.GetYear() - aD2.GetYear() )*12 );
+}
+
+Date DateHelper::GetDateSomeMonthsAway( const Date& rD, long nMonthDistance )
+{
+ Date aRet(rD);
+ long nMonth = rD.GetMonth()+nMonthDistance;
+ long nNewMonth = nMonth%12;
+ long nNewYear = rD.GetYear() + nMonth/12;
+ if( nMonth <= 0 || !nNewMonth )
+ nNewYear--;
+ if( nNewMonth <= 0 )
+ nNewMonth += 12;
+ aRet.SetMonth( USHORT(nNewMonth) );
+ aRet.SetYear( USHORT(nNewYear) );
+ while(!aRet.IsValid())
+ aRet--;
+ return aRet;
+}
+
+Date DateHelper::GetDateSomeYearsAway( const Date& rD, long nYearDistance )
+{
+ Date aRet(rD);
+ aRet.SetYear( static_cast<USHORT>(rD.GetYear()+nYearDistance) );
+ while(!aRet.IsValid())
+ aRet--;
+ return aRet;
+}
+
+bool DateHelper::IsLessThanOneMonthAway( const Date& rD1, const Date& rD2 )
+{
+ Date aDMin( DateHelper::GetDateSomeMonthsAway( rD1, -1 ) );
+ Date aDMax( DateHelper::GetDateSomeMonthsAway( rD1, 1 ) );
+
+ if( rD2 > aDMin && rD2 < aDMax )
+ return true;
+ return false;
+}
+
+bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 )
+{
+ Date aDMin( DateHelper::GetDateSomeYearsAway( rD1, -1 ) );
+ Date aDMax( DateHelper::GetDateSomeYearsAway( rD1, 1 ) );
+
+ if( rD2 > aDMin && rD2 < aDMax )
+ return true;
+ return false;
+}
+
+double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution )
+{
+ Date aDate(rNullDate); aDate += static_cast<long>(::rtl::math::approxFloor(fValue));
+ switch(TimeResolution)
+ {
+ case ::com::sun::star::chart::TimeUnit::DAY:
+ break;
+ case ::com::sun::star::chart::TimeUnit::YEAR:
+ aDate.SetMonth(1);
+ aDate.SetDay(1);
+ break;
+ case ::com::sun::star::chart::TimeUnit::MONTH:
+ default:
+ aDate.SetDay(1);
+ break;
+ }
+ return aDate - rNullDate;
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx
new file mode 100644
index 000000000000..6802fba67bd2
--- /dev/null
+++ b/chart2/source/view/axes/DateScaling.cxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_chart2.hxx"
+#include "DateScaling.hxx"
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <rtl/math.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+
+namespace
+{
+
+static const ::rtl::OUString lcl_aServiceName_DateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.DateScaling" ));
+static const ::rtl::OUString lcl_aServiceName_InverseDateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.InverseDateScaling" ));
+
+static const ::rtl::OUString lcl_aImplementationName_DateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.DateScaling" ));
+static const ::rtl::OUString lcl_aImplementationName_InverseDateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.InverseDateScaling" ));
+
+static const double lcl_fNumberOfMonths = 12.0;//todo: this needs to be offered by basic tools Date class if it should be more generic
+}
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using ::com::sun::star::chart::TimeUnit::DAY;
+using ::com::sun::star::chart::TimeUnit::MONTH;
+using ::com::sun::star::chart::TimeUnit::YEAR;
+
+DateScaling::DateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted )
+ : m_aNullDate( rNullDate )
+ , m_nTimeUnit( nTimeUnit )
+ , m_bShifted( bShifted )
+{
+}
+
+DateScaling::~DateScaling()
+{
+}
+
+double SAL_CALL DateScaling::doScaling( double value )
+ throw (uno::RuntimeException)
+{
+ double fResult(value);
+ if( ::rtl::math::isNan( value ) || ::rtl::math::isInf( value ) )
+ ::rtl::math::setNan( & fResult );
+ else
+ {
+ Date aDate(m_aNullDate);
+ aDate += static_cast<long>(::rtl::math::approxFloor(value));
+ switch( m_nTimeUnit )
+ {
+ case DAY:
+ fResult = value;
+ if(m_bShifted)
+ fResult+=0.5;
+ break;
+ case YEAR:
+ case MONTH:
+ default:
+ fResult = aDate.GetYear();
+ fResult *= lcl_fNumberOfMonths;//asssuming equal count of months in each year
+ fResult += aDate.GetMonth();
+
+ double fDayOfMonth = aDate.GetDay();
+ fDayOfMonth -= 1.0;
+ double fDaysInMonth = aDate.GetDaysInMonth();
+ fResult += fDayOfMonth/fDaysInMonth;
+ if(m_bShifted)
+ {
+ if( YEAR==m_nTimeUnit )
+ fResult += 0.5*lcl_fNumberOfMonths;
+ else
+ fResult += 0.5;
+ }
+ break;
+ }
+ }
+ return fResult;
+}
+
+uno::Reference< XScaling > SAL_CALL DateScaling::getInverseScaling()
+ throw (uno::RuntimeException)
+{
+ return new InverseDateScaling( m_aNullDate, m_nTimeUnit, m_bShifted );
+}
+
+::rtl::OUString SAL_CALL DateScaling::getServiceName()
+ throw (uno::RuntimeException)
+{
+ return lcl_aServiceName_DateScaling;
+}
+
+uno::Sequence< ::rtl::OUString > DateScaling::getSupportedServiceNames_Static()
+{
+ return uno::Sequence< ::rtl::OUString >( & lcl_aServiceName_DateScaling, 1 );
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( DateScaling, lcl_aServiceName_DateScaling )
+
+// ----------------------------------------
+
+InverseDateScaling::InverseDateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted )
+ : m_aNullDate( rNullDate )
+ , m_nTimeUnit( nTimeUnit )
+ , m_bShifted( bShifted )
+{
+}
+
+InverseDateScaling::~InverseDateScaling()
+{
+}
+
+double SAL_CALL InverseDateScaling::doScaling( double value )
+ throw (uno::RuntimeException)
+{
+ double fResult(value);
+ if( ::rtl::math::isNan( value ) || ::rtl::math::isInf( value ) )
+ ::rtl::math::setNan( & fResult );
+ else
+ {
+ switch( m_nTimeUnit )
+ {
+ case DAY:
+ if(m_bShifted)
+ value -= 0.5;
+ fResult = value;
+ break;
+ case YEAR:
+ case MONTH:
+ default:
+ //Date aDate(m_aNullDate);
+ if(m_bShifted)
+ {
+ if( YEAR==m_nTimeUnit )
+ value -= 0.5*lcl_fNumberOfMonths;
+ else
+ value -= 0.5;
+ }
+ Date aDate;
+ double fYear = ::rtl::math::approxFloor(value/lcl_fNumberOfMonths);
+ double fMonth = ::rtl::math::approxFloor(value-(fYear*lcl_fNumberOfMonths));
+ if( fMonth==0.0 )
+ {
+ fYear--;
+ fMonth=12.0;
+ }
+ aDate.SetYear( static_cast<USHORT>(fYear) );
+ aDate.SetMonth( static_cast<USHORT>(fMonth) );
+ aDate.SetDay( 1 );
+ double fMonthCount = (fYear*lcl_fNumberOfMonths)+fMonth;
+ double fDay = (value-fMonthCount)*aDate.GetDaysInMonth();
+ fDay += 1.0;
+ aDate.SetDay( static_cast<USHORT>(::rtl::math::round(fDay)) );
+ fResult = aDate - m_aNullDate;
+ break;
+ }
+ }
+ return fResult;
+}
+
+uno::Reference< XScaling > SAL_CALL InverseDateScaling::getInverseScaling()
+ throw (uno::RuntimeException)
+{
+ return new DateScaling( m_aNullDate, m_nTimeUnit, m_bShifted );
+}
+
+::rtl::OUString SAL_CALL InverseDateScaling::getServiceName()
+ throw (uno::RuntimeException)
+{
+ return lcl_aServiceName_InverseDateScaling;
+}
+
+uno::Sequence< ::rtl::OUString > InverseDateScaling::getSupportedServiceNames_Static()
+{
+ return uno::Sequence< ::rtl::OUString >( & lcl_aServiceName_InverseDateScaling, 1 );
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( InverseDateScaling, lcl_aServiceName_InverseDateScaling )
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/DateScaling.hxx b/chart2/source/view/axes/DateScaling.hxx
new file mode 100644
index 000000000000..5e550604a957
--- /dev/null
+++ b/chart2/source/view/axes/DateScaling.hxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_DATESCALING_HXX
+#define _CHART2_DATESCALING_HXX
+#include "ServiceMacros.hxx"
+#include <com/sun/star/chart2/XScaling.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XServiceName.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase3.hxx>
+#include <tools/date.hxx>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+//-----------------------------------------------------------------------------
+/**
+*/
+
+class DateScaling :
+ public ::cppu::WeakImplHelper3 <
+ ::com::sun::star::chart2::XScaling,
+ ::com::sun::star::lang::XServiceName,
+ ::com::sun::star::lang::XServiceInfo
+ >
+{
+public:
+ DateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted );
+ virtual ~DateScaling();
+
+ /// declare XServiceInfo methods
+ APPHELPER_XSERVICEINFO_DECL()
+
+ // ____ XScaling ____
+ virtual double SAL_CALL doScaling( double value )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling > SAL_CALL
+ getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XServiceName ____
+ virtual ::rtl::OUString SAL_CALL getServiceName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ const Date m_aNullDate;
+ const sal_Int32 m_nTimeUnit;
+ const bool m_bShifted;
+};
+
+class InverseDateScaling :
+ public ::cppu::WeakImplHelper3 <
+ ::com::sun::star::chart2::XScaling,
+ ::com::sun::star::lang::XServiceName,
+ ::com::sun::star::lang::XServiceInfo
+ >
+{
+public:
+ InverseDateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted );
+ virtual ~InverseDateScaling();
+
+ /// declare XServiceInfo methods
+ APPHELPER_XSERVICEINFO_DECL()
+
+ // ____ XScaling ____
+ virtual double SAL_CALL doScaling( double value )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling > SAL_CALL
+ getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XServiceName ____
+ virtual ::rtl::OUString SAL_CALL getServiceName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ const Date m_aNullDate;
+ const sal_Int32 m_nTimeUnit;
+ const bool m_bShifted;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
+
diff --git a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
index 88f99b493144..97523d38758f 100644
--- a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
+++ b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
@@ -29,6 +29,9 @@
#include "precompiled_chart2.hxx"
#include "MinimumAndMaximumSupplier.hxx"
+
+#include <com/sun/star/chart/TimeUnit.hpp>
+
#include <rtl/math.hxx>
#include <com/sun/star/awt/Size.hpp>
@@ -196,6 +199,24 @@ void MergedMinimumAndMaximumSupplier::clearMinimumAndMaximumSupplierList()
m_aMinimumAndMaximumSupplierList.clear();
}
+long MergedMinimumAndMaximumSupplier::calculateTimeResolutionOnXAxis()
+{
+ long nRet = ::com::sun::star::chart::TimeUnit::YEAR;
+ for( MinimumAndMaximumSupplierSet::iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
+ {
+ long nCurrent = (*aIt)->calculateTimeResolutionOnXAxis();
+ if(nRet>nCurrent)
+ nRet=nCurrent;
+ }
+ return nRet;
+}
+
+void MergedMinimumAndMaximumSupplier::setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate )
+{
+ for( MinimumAndMaximumSupplierSet::iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
+ (*aIt)->setTimeResolutionOnXAxis( nTimeResolution, rNullDate );
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index 890bf87df96e..075ad16347c2 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -29,8 +29,12 @@
#include "precompiled_chart2.hxx"
#include "ScaleAutomatism.hxx"
#include "macros.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks_Equidistant.hxx"
+#include "DateHelper.hxx"
+#include "DateScaling.hxx"
#include "AxisHelper.hxx"
+#include <com/sun/star/chart/TimeUnit.hpp>
+
#include <rtl/math.hxx>
#include <tools/debug.hxx>
@@ -40,6 +44,9 @@ namespace chart
//.............................................................................
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using ::com::sun::star::chart::TimeUnit::DAY;
+using ::com::sun::star::chart::TimeUnit::MONTH;
+using ::com::sun::star::chart::TimeUnit::YEAR;
const sal_Int32 MAXIMUM_MANUAL_INCREMENT_COUNT = 500;
const sal_Int32 MAXIMUM_AUTO_INCREMENT_COUNT = 10;
@@ -56,7 +63,42 @@ void lcl_ensureMaximumSubIncrementCount( sal_Int32& rnSubIntervalCount )
}//end anonymous namespace
-ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale )
+
+//.............................................................................
+
+ExplicitScaleData::ExplicitScaleData()
+ : Minimum(0.0)
+ , Maximum(10.0)
+ , Origin(0.0)
+ , Orientation(::com::sun::star::chart2::AxisOrientation_MATHEMATICAL)
+ , Scaling()
+ , AxisType(::com::sun::star::chart2::AxisType::REALNUMBER)
+ , ShiftedCategoryPosition(false)
+ , TimeResolution(::com::sun::star::chart::TimeUnit::DAY)
+ , NullDate(30,12,1899)
+{
+}
+
+ExplicitSubIncrement::ExplicitSubIncrement()
+ : IntervalCount(2)
+ , PostEquidistant(true)
+{
+}
+
+
+ExplicitIncrementData::ExplicitIncrementData()
+ : MajorTimeInterval(1,::com::sun::star::chart::TimeUnit::DAY)
+ , MinorTimeInterval(1,::com::sun::star::chart::TimeUnit::DAY)
+ , Distance(1.0)
+ , PostEquidistant(true)
+ , BaseValue(0.0)
+ , SubIncrements()
+{
+}
+
+//.............................................................................
+
+ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale, const Date& rNullDate )
: m_aSourceScale( rSourceScale )
, m_fValueMinimum( 0.0 )
, m_fValueMaximum( 0.0 )
@@ -65,6 +107,8 @@ ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale )
, m_bExpandIfValuesCloseToBorder( false )
, m_bExpandWideValuesToZero( false )
, m_bExpandNarrowValuesTowardZero( false )
+ , m_nTimeResolution(::com::sun::star::chart::TimeUnit::DAY)
+ , m_aNullDate(rNullDate)
{
::rtl::math::setNan( &m_fValueMinimum );
::rtl::math::setNan( &m_fValueMaximum );
@@ -111,14 +155,19 @@ void ScaleAutomatism::setMaximumAutoMainIncrementCount( sal_Int32 nMaximumAutoMa
m_nMaximumAutoMainIncrementCount = nMaximumAutoMainIncrementCount;
}
+void ScaleAutomatism::setAutomaticTimeResolution( sal_Int32 nTimeResolution )
+{
+ m_nTimeResolution = nTimeResolution;
+}
+
void ScaleAutomatism::calculateExplicitScaleAndIncrement(
ExplicitScaleData& rExplicitScale, ExplicitIncrementData& rExplicitIncrement ) const
{
// fill explicit scale
rExplicitScale.Orientation = m_aSourceScale.Orientation;
rExplicitScale.Scaling = m_aSourceScale.Scaling;
- rExplicitScale.Breaks = m_aSourceScale.Breaks;
rExplicitScale.AxisType = m_aSourceScale.AxisType;
+ rExplicitScale.NullDate = m_aNullDate;
bool bAutoMinimum = !(m_aSourceScale.Minimum >>= rExplicitScale.Minimum);
bool bAutoMaximum = !(m_aSourceScale.Maximum >>= rExplicitScale.Maximum);
@@ -130,7 +179,12 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
if( m_aSourceScale.AxisType==AxisType::PERCENT )
rExplicitScale.Minimum = 0.0;
else if( ::rtl::math::isNan( m_fValueMinimum ) )
- rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter????
+ {
+ if( m_aSourceScale.AxisType==AxisType::DATE )
+ rExplicitScale.Minimum = 36526.0; //1.1.2000
+ else
+ rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter????
+ }
else
rExplicitScale.Minimum = m_fValueMinimum;
}
@@ -141,7 +195,12 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
if( m_aSourceScale.AxisType==AxisType::PERCENT )
rExplicitScale.Maximum = 1.0;
else if( ::rtl::math::isNan( m_fValueMaximum ) )
- rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter????
+ {
+ if( m_aSourceScale.AxisType==AxisType::DATE )
+ rExplicitScale.Maximum = 40179.0; //1.1.2010
+ else
+ rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter????
+ }
else
rExplicitScale.Maximum = m_fValueMaximum;
}
@@ -149,14 +208,14 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
//---------------------------------------------------------------
//fill explicit increment
- rExplicitIncrement.ShiftedPosition = (m_aSourceScale.AxisType==AxisType::SERIES) ? true : false;
+ rExplicitScale.ShiftedCategoryPosition = m_aSourceScale.ShiftedCategoryPosition;
bool bIsLogarithm = false;
//minimum and maximum of the ExplicitScaleData may be changed if allowed
- if( m_aSourceScale.AxisType==AxisType::CATEGORY || m_aSourceScale.AxisType==AxisType::SERIES )
- {
+ if( m_aSourceScale.AxisType==AxisType::DATE )
+ calculateExplicitIncrementAndScaleForDateTimeAxis( rExplicitScale, rExplicitIncrement, bAutoMinimum, bAutoMaximum );
+ else if( m_aSourceScale.AxisType==AxisType::CATEGORY || m_aSourceScale.AxisType==AxisType::SERIES )
calculateExplicitIncrementAndScaleForCategory( rExplicitScale, rExplicitIncrement, bAutoMinimum, bAutoMaximum );
- }
else
{
bIsLogarithm = AxisHelper::isLogarithmic( rExplicitScale.Scaling );
@@ -186,6 +245,11 @@ ScaleData ScaleAutomatism::getScale() const
return m_aSourceScale;
}
+Date ScaleAutomatism::getNullDate() const
+{
+ return m_aNullDate;
+}
+
// private --------------------------------------------------------------------
void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
@@ -196,6 +260,9 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
// no scaling for categories
rExplicitScale.Scaling.clear();
+ if( rExplicitScale.ShiftedCategoryPosition )
+ rExplicitScale.Maximum += 1.0;
+
// ensure that at least one category is visible
if( rExplicitScale.Maximum <= rExplicitScale.Minimum )
rExplicitScale.Maximum = rExplicitScale.Minimum + 1.0;
@@ -207,9 +274,9 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
// automatic minimum and maximum
if( bAutoMinimum && m_bExpandBorderToIncrementRhythm )
- rExplicitScale.Minimum = TickmarkHelper::getMinimumAtIncrement( rExplicitScale.Minimum, rExplicitIncrement );
+ rExplicitScale.Minimum = EquidistantTickFactory::getMinimumAtIncrement( rExplicitScale.Minimum, rExplicitIncrement );
if( bAutoMaximum && m_bExpandBorderToIncrementRhythm )
- rExplicitScale.Maximum = TickmarkHelper::getMaximumAtIncrement( rExplicitScale.Maximum, rExplicitIncrement );
+ rExplicitScale.Maximum = EquidistantTickFactory::getMaximumAtIncrement( rExplicitScale.Maximum, rExplicitIncrement );
//prevent performace killover
double fDistanceCount = ::rtl::math::approxFloor( (rExplicitScale.Maximum-rExplicitScale.Minimum) / rExplicitIncrement.Distance );
@@ -223,29 +290,28 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
//---------------------------------------------------------------
//fill explicit sub increment
sal_Int32 nSubCount = m_aSourceScale.IncrementData.SubIncrements.getLength();
- rExplicitIncrement.SubIncrements.realloc(nSubCount);
for( sal_Int32 nN=0; nN<nSubCount; nN++ )
{
- const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
- ExplicitSubIncrement& rExplicitSubIncrement = rExplicitIncrement.SubIncrements[nN];
-
- if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount))
+ ExplicitSubIncrement aExplicitSubIncrement;
+ const SubIncrement& rSubIncrement= m_aSourceScale.IncrementData.SubIncrements[nN];
+ if(!(rSubIncrement.IntervalCount>>=aExplicitSubIncrement.IntervalCount))
{
//scaling dependent
//@todo autocalculate IntervalCount dependent on MainIncrement and scaling
- rExplicitSubIncrement.IntervalCount = 2;
+ aExplicitSubIncrement.IntervalCount = 2;
}
- lcl_ensureMaximumSubIncrementCount( rExplicitSubIncrement.IntervalCount );
- if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant))
+ lcl_ensureMaximumSubIncrementCount( aExplicitSubIncrement.IntervalCount );
+ if(!(rSubIncrement.PostEquidistant>>=aExplicitSubIncrement.PostEquidistant))
{
//scaling dependent
- rExplicitSubIncrement.PostEquidistant = sal_False;
+ aExplicitSubIncrement.PostEquidistant = sal_False;
}
+ rExplicitIncrement.SubIncrements.push_back(aExplicitSubIncrement);
}
}
-//@todo these method should become part of the scaling interface and implementation somehow
-//@todo problem with outparamters at api
+//-----------------------------------------------------------------------------------------
+
void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement,
@@ -412,7 +478,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
// round to entire multiples of the distance and add additional space
if( bAutoMinimum && m_bExpandBorderToIncrementRhythm )
{
- fAxisMinimum = TickmarkHelper::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
+ fAxisMinimum = EquidistantTickFactory::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
//ensure valid values after scaling #i100995#
if( !bAutoDistance )
@@ -428,7 +494,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
}
if( bAutoMaximum && m_bExpandBorderToIncrementRhythm )
{
- fAxisMaximum = TickmarkHelper::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
+ fAxisMaximum = EquidistantTickFactory::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
//ensure valid values after scaling #i100995#
if( !bAutoDistance )
@@ -488,27 +554,210 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
//---------------------------------------------------------------
//fill explicit sub increment
sal_Int32 nSubCount = m_aSourceScale.IncrementData.SubIncrements.getLength();
- rExplicitIncrement.SubIncrements.realloc(nSubCount);
for( sal_Int32 nN=0; nN<nSubCount; nN++ )
{
- const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
- ExplicitSubIncrement& rExplicitSubIncrement = rExplicitIncrement.SubIncrements[nN];
-
- if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount))
+ ExplicitSubIncrement aExplicitSubIncrement;
+ const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
+ if(!(rSubIncrement.IntervalCount>>=aExplicitSubIncrement.IntervalCount))
{
//scaling dependent
//@todo autocalculate IntervalCount dependent on MainIncrement and scaling
- rExplicitSubIncrement.IntervalCount = 9;
+ aExplicitSubIncrement.IntervalCount = 9;
}
- lcl_ensureMaximumSubIncrementCount( rExplicitSubIncrement.IntervalCount );
- if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant))
+ lcl_ensureMaximumSubIncrementCount( aExplicitSubIncrement.IntervalCount );
+ if(!(rSubIncrement.PostEquidistant>>=aExplicitSubIncrement.PostEquidistant))
{
//scaling dependent
- rExplicitSubIncrement.PostEquidistant = sal_False;
+ aExplicitSubIncrement.PostEquidistant = sal_False;
}
+ rExplicitIncrement.SubIncrements.push_back(aExplicitSubIncrement);
}
}
+//-----------------------------------------------------------------------------------------
+
+void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
+ bool bAutoMinimum, bool bAutoMaximum ) const
+{
+ Date aMinDate(m_aNullDate); aMinDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Minimum));
+ Date aMaxDate(m_aNullDate); aMaxDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Maximum));
+ rExplicitIncrement.PostEquidistant = sal_False;
+
+ if( aMinDate > aMaxDate )
+ {
+ std::swap(aMinDate,aMaxDate);
+ }
+
+ if( !(m_aSourceScale.TimeIncrement.TimeResolution >>= rExplicitScale.TimeResolution) )
+ rExplicitScale.TimeResolution = m_nTimeResolution;
+
+ rExplicitScale.Scaling = new DateScaling(m_aNullDate,rExplicitScale.TimeResolution,false);
+
+ // choose min and max suitable to time resolution
+ switch( rExplicitScale.TimeResolution )
+ {
+ case DAY:
+ if( rExplicitScale.ShiftedCategoryPosition )
+ aMaxDate++;//for explicit scales we need one interval more (maximum excluded)
+ break;
+ case MONTH:
+ aMinDate.SetDay(1);
+ aMaxDate.SetDay(1);
+ if( rExplicitScale.ShiftedCategoryPosition )
+ aMaxDate = DateHelper::GetDateSomeMonthsAway(aMaxDate,1);//for explicit scales we need one interval more (maximum excluded)
+ if( DateHelper::IsLessThanOneMonthAway( aMinDate, aMaxDate ) )
+ {
+ if( bAutoMaximum || !bAutoMinimum )
+ aMaxDate = DateHelper::GetDateSomeMonthsAway(aMinDate,1);
+ else
+ aMinDate = DateHelper::GetDateSomeMonthsAway(aMaxDate,-1);
+ }
+ break;
+ case YEAR:
+ aMinDate.SetDay(1);
+ aMinDate.SetMonth(1);
+ aMaxDate.SetDay(1);
+ aMaxDate.SetMonth(1);
+ if( rExplicitScale.ShiftedCategoryPosition )
+ aMaxDate = DateHelper::GetDateSomeYearsAway(aMaxDate,1);//for explicit scales we need one interval more (maximum excluded)
+ if( DateHelper::IsLessThanOneYearAway( aMinDate, aMaxDate ) )
+ {
+ if( bAutoMaximum || !bAutoMinimum )
+ aMaxDate = DateHelper::GetDateSomeYearsAway(aMinDate,1);
+ else
+ aMinDate = DateHelper::GetDateSomeYearsAway(aMaxDate,-1);
+ }
+ break;
+ }
+
+ // set the resulting limits (swap back to negative range if needed)
+ rExplicitScale.Minimum = aMinDate - m_aNullDate;
+ rExplicitScale.Maximum = aMaxDate - m_aNullDate;
+
+ bool bAutoMajor = !(m_aSourceScale.TimeIncrement.MajorTimeInterval >>= rExplicitIncrement.MajorTimeInterval);
+ bool bAutoMinor = !(m_aSourceScale.TimeIncrement.MinorTimeInterval >>= rExplicitIncrement.MinorTimeInterval);
+
+ sal_Int32 nMaxMainIncrementCount = bAutoMajor ?
+ m_nMaximumAutoMainIncrementCount : MAXIMUM_MANUAL_INCREMENT_COUNT;
+ if( nMaxMainIncrementCount > 1 )
+ nMaxMainIncrementCount--;
+
+
+ //choose major time interval:
+ long nDayCount = (aMaxDate-aMinDate);
+ long nMainIncrementCount = 1;
+ if( !bAutoMajor )
+ {
+ long nIntervalDayCount = rExplicitIncrement.MajorTimeInterval.Number;
+ if( rExplicitIncrement.MajorTimeInterval.TimeUnit < rExplicitScale.TimeResolution )
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = rExplicitScale.TimeResolution;
+ switch( rExplicitIncrement.MajorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ break;
+ case MONTH:
+ nIntervalDayCount*=31;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ case YEAR:
+ nIntervalDayCount*=365;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ }
+ nMainIncrementCount = nDayCount/nIntervalDayCount;
+ if( nMainIncrementCount > nMaxMainIncrementCount )
+ bAutoMajor = true;
+ }
+ if( bAutoMajor )
+ {
+ long nNumer = 1;
+ long nIntervalDays = nDayCount / nMaxMainIncrementCount;
+ double nDaysPerInterval = 1.0;
+ if( nIntervalDays>365 || YEAR==rExplicitScale.TimeResolution )
+ {
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = YEAR;
+ nDaysPerInterval = 365.0;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ }
+ else if( nIntervalDays>31 || MONTH==rExplicitScale.TimeResolution )
+ {
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = MONTH;
+ nDaysPerInterval = 31.0;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ }
+ else
+ {
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = DAY;
+ nDaysPerInterval = 1.0;
+ }
+
+ nNumer = static_cast<sal_Int32>( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) );
+ if(nNumer<=0)
+ nNumer=1;
+ rExplicitIncrement.MajorTimeInterval.Number = nNumer;
+ nMainIncrementCount = nDayCount/(nNumer*nDaysPerInterval);
+ }
+
+ //choose minor time interval:
+ if( !bAutoMinor )
+ {
+ if( rExplicitIncrement.MinorTimeInterval.TimeUnit > rExplicitIncrement.MajorTimeInterval.TimeUnit )
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = rExplicitIncrement.MajorTimeInterval.TimeUnit;
+ long nIntervalDayCount = rExplicitIncrement.MinorTimeInterval.Number;
+ switch( rExplicitIncrement.MinorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ break;
+ case MONTH:
+ nIntervalDayCount*=31;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ case YEAR:
+ nIntervalDayCount*=365;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ }
+ if( nDayCount/nIntervalDayCount > nMaxMainIncrementCount )
+ bAutoMinor = true;
+ }
+ if( bAutoMinor )
+ {
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = rExplicitIncrement.MajorTimeInterval.TimeUnit;
+ rExplicitIncrement.MinorTimeInterval.Number = 1;
+ if( nMainIncrementCount > 100 )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number;
+ else
+ {
+ if( rExplicitIncrement.MajorTimeInterval.Number >= 2 )
+ {
+ if( !(rExplicitIncrement.MajorTimeInterval.Number%2) )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number/2;
+ else if( !(rExplicitIncrement.MajorTimeInterval.Number%3) )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number/3;
+ else if( !(rExplicitIncrement.MajorTimeInterval.Number%5) )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number/5;
+ else if( rExplicitIncrement.MajorTimeInterval.Number > 50 )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number;
+ }
+ else
+ {
+ switch( rExplicitIncrement.MajorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ break;
+ case MONTH:
+ if( rExplicitScale.TimeResolution == DAY )
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = DAY;
+ break;
+ case YEAR:
+ if( rExplicitScale.TimeResolution <= MONTH )
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = MONTH;
+ break;
+ }
+ }
+ }
+ }
+
+}
+
+//-----------------------------------------------------------------------------------------
+
void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement,
@@ -692,7 +941,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
{
// round to entire multiples of the distance, based on the base value
if( m_bExpandBorderToIncrementRhythm )
- fAxisMinimum = TickmarkHelper::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
+ fAxisMinimum = EquidistantTickFactory::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
// additional space, if source minimum is to near at axis minimum
if( m_bExpandIfValuesCloseToBorder )
if( (fAxisMinimum != 0.0) && ((fAxisMaximum - fSourceMinimum) / (fAxisMaximum - fAxisMinimum) > 20.0 / 21.0) )
@@ -702,7 +951,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
{
// round to entire multiples of the distance, based on the base value
if( m_bExpandBorderToIncrementRhythm )
- fAxisMaximum = TickmarkHelper::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
+ fAxisMaximum = EquidistantTickFactory::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
// additional space, if source maximum is to near at axis maximum
if( m_bExpandIfValuesCloseToBorder )
if( (fAxisMaximum != 0.0) && ((fSourceMaximum - fAxisMinimum) / (fAxisMaximum - fAxisMinimum) > 20.0 / 21.0) )
@@ -734,24 +983,23 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
//---------------------------------------------------------------
//fill explicit sub increment
sal_Int32 nSubCount = m_aSourceScale.IncrementData.SubIncrements.getLength();
- rExplicitIncrement.SubIncrements.realloc(nSubCount);
for( sal_Int32 nN=0; nN<nSubCount; nN++ )
{
- const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
- ExplicitSubIncrement& rExplicitSubIncrement = rExplicitIncrement.SubIncrements[nN];
-
- if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount))
+ ExplicitSubIncrement aExplicitSubIncrement;
+ const SubIncrement& rSubIncrement= m_aSourceScale.IncrementData.SubIncrements[nN];
+ if(!(rSubIncrement.IntervalCount>>=aExplicitSubIncrement.IntervalCount))
{
//scaling dependent
//@todo autocalculate IntervalCount dependent on MainIncrement and scaling
- rExplicitSubIncrement.IntervalCount = 2;
+ aExplicitSubIncrement.IntervalCount = 2;
}
- lcl_ensureMaximumSubIncrementCount( rExplicitSubIncrement.IntervalCount );
- if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant))
+ lcl_ensureMaximumSubIncrementCount( aExplicitSubIncrement.IntervalCount );
+ if(!(rSubIncrement.PostEquidistant>>=aExplicitSubIncrement.PostEquidistant))
{
//scaling dependent
- rExplicitSubIncrement.PostEquidistant = sal_False;
+ aExplicitSubIncrement.PostEquidistant = sal_False;
}
+ rExplicitIncrement.SubIncrements.push_back(aExplicitSubIncrement);
}
}
diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx
new file mode 100644
index 000000000000..834fe66eb97b
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks.cxx
@@ -0,0 +1,333 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_chart2.hxx"
+#include "Tickmarks.hxx"
+#include "Tickmarks_Equidistant.hxx"
+#include "Tickmarks_Dates.hxx"
+#include "ViewDefines.hxx"
+#include <rtl/math.hxx>
+#include <tools/debug.hxx>
+#include <memory>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::rtl::math;
+using ::basegfx::B2DVector;
+
+TickInfo::TickInfo( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling >& xInverse )
+: fScaledTickValue( 0.0 )
+, xInverseScaling( xInverse )
+, aTickScreenPosition(0.0,0.0)
+, bPaintIt( true )
+, xTextShape( NULL )
+, nFactorForLimitedTextWidth(1)
+{
+}
+
+double TickInfo::getUnscaledTickValue() const
+{
+ if( xInverseScaling.is() )
+ return xInverseScaling->doScaling( fScaledTickValue );
+ else
+ return fScaledTickValue;
+}
+
+sal_Int32 TickInfo::getScreenDistanceBetweenTicks( const TickInfo& rOherTickInfo ) const
+{
+ //return the positive distance between the two first tickmarks in screen values
+
+ B2DVector aDistance = rOherTickInfo.aTickScreenPosition - aTickScreenPosition;
+ sal_Int32 nRet = static_cast<sal_Int32>(aDistance.getLength());
+ if(nRet<0)
+ nRet *= -1;
+ return nRet;
+}
+
+PureTickIter::PureTickIter( ::std::vector< TickInfo >& rTickInfoVector )
+ : m_rTickVector(rTickInfoVector)
+ , m_aTickIter(m_rTickVector.begin())
+{
+}
+PureTickIter::~PureTickIter()
+{
+}
+TickInfo* PureTickIter::firstInfo()
+{
+ m_aTickIter = m_rTickVector.begin();
+ if(m_aTickIter!=m_rTickVector.end())
+ return &*m_aTickIter;
+ return 0;
+}
+TickInfo* PureTickIter::nextInfo()
+{
+ if(m_aTickIter!=m_rTickVector.end())
+ {
+ m_aTickIter++;
+ if(m_aTickIter!=m_rTickVector.end())
+ return &*m_aTickIter;
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+TickFactory::TickFactory(
+ const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
+ : m_rScale( rScale )
+ , m_rIncrement( rIncrement )
+ , m_xInverseScaling(NULL)
+{
+ //@todo: make sure that the scale is valid for the scaling
+
+ if( m_rScale.Scaling.is() )
+ {
+ m_xInverseScaling = m_rScale.Scaling->getInverseScaling();
+ DBG_ASSERT( m_xInverseScaling.is(), "each Scaling needs to return a inverse Scaling" );
+ }
+
+ m_fScaledVisibleMin = m_rScale.Minimum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMin = m_rScale.Scaling->doScaling(m_fScaledVisibleMin);
+
+ m_fScaledVisibleMax = m_rScale.Maximum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMax = m_rScale.Scaling->doScaling(m_fScaledVisibleMax);
+}
+
+TickFactory::~TickFactory()
+{
+}
+
+bool TickFactory::isDateAxis() const
+{
+ return m_rScale.AxisType == AxisType::DATE;
+}
+
+void TickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ if( isDateAxis() )
+ DateTickFactory( m_rScale, m_rIncrement ).getAllTicks( rAllTickInfos );
+ else
+ EquidistantTickFactory( m_rScale, m_rIncrement ).getAllTicks( rAllTickInfos );
+}
+
+void TickFactory::getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ if( isDateAxis() )
+ DateTickFactory( m_rScale, m_rIncrement ).getAllTicksShifted( rAllTickInfos );
+ else
+ EquidistantTickFactory( m_rScale, m_rIncrement ).getAllTicksShifted( rAllTickInfos );
+}
+
+//-----------------------------------------------------------------------------
+// ___TickFactory_2D___
+//-----------------------------------------------------------------------------
+TickFactory_2D::TickFactory_2D(
+ const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement
+ //, double fStrech_SceneToScreen, double fOffset_SceneToScreen )
+ , const B2DVector& rStartScreenPos, const B2DVector& rEndScreenPos
+ , const B2DVector& rAxisLineToLabelLineShift )
+ : TickFactory( rScale, rIncrement )
+ , m_aAxisStartScreenPosition2D(rStartScreenPos)
+ , m_aAxisEndScreenPosition2D(rEndScreenPos)
+ , m_aAxisLineToLabelLineShift(rAxisLineToLabelLineShift)
+ , m_fStrech_LogicToScreen(1.0)
+ , m_fOffset_LogicToScreen(0.0)
+{
+ double fWidthY = m_fScaledVisibleMax - m_fScaledVisibleMin;
+ if( AxisOrientation_MATHEMATICAL==m_rScale.Orientation )
+ {
+ m_fStrech_LogicToScreen = 1.0/fWidthY;
+ m_fOffset_LogicToScreen = -m_fScaledVisibleMin;
+ }
+ else
+ {
+ B2DVector aSwap(m_aAxisStartScreenPosition2D);
+ m_aAxisStartScreenPosition2D = m_aAxisEndScreenPosition2D;
+ m_aAxisEndScreenPosition2D = aSwap;
+
+ m_fStrech_LogicToScreen = -1.0/fWidthY;
+ m_fOffset_LogicToScreen = -m_fScaledVisibleMax;
+ }
+}
+
+TickFactory_2D::~TickFactory_2D()
+{
+}
+
+bool TickFactory_2D::isHorizontalAxis() const
+{
+ return ( m_aAxisStartScreenPosition2D.getY() == m_aAxisEndScreenPosition2D.getY() );
+}
+bool TickFactory_2D::isVerticalAxis() const
+{
+ return ( m_aAxisStartScreenPosition2D.getX() == m_aAxisEndScreenPosition2D.getX() );
+}
+
+//static
+sal_Int32 TickFactory_2D::getTickScreenDistance( TickIter& rIter )
+{
+ //return the positive distance between the two first tickmarks in screen values
+ //if there are less than two tickmarks -1 is returned
+
+ const TickInfo* pFirstTickInfo = rIter.firstInfo();
+ const TickInfo* pSecondTickInfo = rIter.nextInfo();
+ if(!pSecondTickInfo || !pFirstTickInfo)
+ return -1;
+
+ return pFirstTickInfo->getScreenDistanceBetweenTicks( *pSecondTickInfo );
+}
+
+B2DVector TickFactory_2D::getTickScreenPosition2D( double fScaledLogicTickValue ) const
+{
+ B2DVector aRet(m_aAxisStartScreenPosition2D);
+ aRet += (m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D)
+ *((fScaledLogicTickValue+m_fOffset_LogicToScreen)*m_fStrech_LogicToScreen);
+ return aRet;
+}
+
+void TickFactory_2D::addPointSequenceForTickLine( drawing::PointSequenceSequence& rPoints
+ , sal_Int32 nSequenceIndex
+ , double fScaledLogicTickValue, double fInnerDirectionSign
+ , const TickmarkProperties& rTickmarkProperties
+ , bool bPlaceAtLabels ) const
+{
+ if( fInnerDirectionSign==0.0 )
+ fInnerDirectionSign = 1.0;
+
+ B2DVector aTickScreenPosition = this->getTickScreenPosition2D(fScaledLogicTickValue);
+ if( bPlaceAtLabels )
+ aTickScreenPosition += m_aAxisLineToLabelLineShift;
+
+ B2DVector aMainDirection = m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D;
+ aMainDirection.normalize();
+ B2DVector aOrthoDirection(-aMainDirection.getY(),aMainDirection.getX());
+ aOrthoDirection *= fInnerDirectionSign;
+ aOrthoDirection.normalize();
+
+ B2DVector aStart = aTickScreenPosition + aOrthoDirection*rTickmarkProperties.RelativePos;
+ B2DVector aEnd = aStart - aOrthoDirection*rTickmarkProperties.Length;
+
+ rPoints[nSequenceIndex].realloc(2);
+ rPoints[nSequenceIndex][0].X = static_cast<sal_Int32>(aStart.getX());
+ rPoints[nSequenceIndex][0].Y = static_cast<sal_Int32>(aStart.getY());
+ rPoints[nSequenceIndex][1].X = static_cast<sal_Int32>(aEnd.getX());
+ rPoints[nSequenceIndex][1].Y = static_cast<sal_Int32>(aEnd.getY());
+}
+
+B2DVector TickFactory_2D::getDistanceAxisTickToText( const AxisProperties& rAxisProperties, bool bIncludeFarAwayDistanceIfSo, bool bIncludeSpaceBetweenTickAndText ) const
+{
+ bool bFarAwayLabels = false;
+ if( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START == rAxisProperties.m_eLabelPos
+ || ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END == rAxisProperties.m_eLabelPos )
+ bFarAwayLabels = true;
+
+ double fInnerDirectionSign = rAxisProperties.m_fInnerDirectionSign;
+ if( fInnerDirectionSign==0.0 )
+ fInnerDirectionSign = 1.0;
+
+ B2DVector aMainDirection = m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D;
+ aMainDirection.normalize();
+ B2DVector aOrthoDirection(-aMainDirection.getY(),aMainDirection.getX());
+ aOrthoDirection *= fInnerDirectionSign;
+ aOrthoDirection.normalize();
+
+ B2DVector aStart(0,0), aEnd(0,0);
+ if( bFarAwayLabels )
+ {
+ TickmarkProperties aProps( AxisProperties::getBiggestTickmarkProperties() );
+ aStart = aOrthoDirection*aProps.RelativePos;
+ aEnd = aStart - aOrthoDirection*aProps.Length;
+ }
+ else
+ {
+ for( sal_Int32 nN=rAxisProperties.m_aTickmarkPropertiesList.size();nN--;)
+ {
+ const TickmarkProperties& rProps = rAxisProperties.m_aTickmarkPropertiesList[nN];
+ B2DVector aNewStart = aOrthoDirection*rProps.RelativePos;
+ B2DVector aNewEnd = aNewStart - aOrthoDirection*rProps.Length;
+ if(aNewStart.getLength()>aStart.getLength())
+ aStart=aNewStart;
+ if(aNewEnd.getLength()>aEnd.getLength())
+ aEnd=aNewEnd;
+ }
+ }
+
+ B2DVector aLabelDirection(aStart);
+ if( rAxisProperties.m_fInnerDirectionSign != rAxisProperties.m_fLabelDirectionSign )
+ aLabelDirection = aEnd;
+
+ B2DVector aOrthoLabelDirection(aOrthoDirection);
+ if( rAxisProperties.m_fInnerDirectionSign != rAxisProperties.m_fLabelDirectionSign )
+ aOrthoLabelDirection*=-1.0;
+ aOrthoLabelDirection.normalize();
+ if( bIncludeSpaceBetweenTickAndText )
+ aLabelDirection += aOrthoLabelDirection*AXIS2D_TICKLABELSPACING;
+ if( bFarAwayLabels && bIncludeFarAwayDistanceIfSo )
+ aLabelDirection += m_aAxisLineToLabelLineShift;
+ return aLabelDirection;
+}
+
+void TickFactory_2D::createPointSequenceForAxisMainLine( drawing::PointSequenceSequence& rPoints ) const
+{
+ rPoints[0].realloc(2);
+ rPoints[0][0].X = static_cast<sal_Int32>(m_aAxisStartScreenPosition2D.getX());
+ rPoints[0][0].Y = static_cast<sal_Int32>(m_aAxisStartScreenPosition2D.getY());
+ rPoints[0][1].X = static_cast<sal_Int32>(m_aAxisEndScreenPosition2D.getX());
+ rPoints[0][1].Y = static_cast<sal_Int32>(m_aAxisEndScreenPosition2D.getY());
+}
+
+void TickFactory_2D::updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ //get the transformed screen values for all tickmarks in rAllTickInfos
+ ::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = rAllTickInfos.begin();
+ const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = rAllTickInfos.end();
+ for( ; aDepthIter != aDepthEnd; aDepthIter++ )
+ {
+ ::std::vector< TickInfo >::iterator aTickIter = (*aDepthIter).begin();
+ const ::std::vector< TickInfo >::const_iterator aTickEnd = (*aDepthIter).end();
+ for( ; aTickIter != aTickEnd; aTickIter++ )
+ {
+ TickInfo& rTickInfo = (*aTickIter);
+ rTickInfo.aTickScreenPosition =
+ this->getTickScreenPosition2D( rTickInfo.fScaledTickValue );
+ }
+ }
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/Tickmarks.hxx b/chart2/source/view/axes/Tickmarks.hxx
new file mode 100644
index 000000000000..62fa5fef92d0
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks.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 _CHART2_TICKMARKS_HXX
+#define _CHART2_TICKMARKS_HXX
+
+#include "TickmarkProperties.hxx"
+#include "VAxisProperties.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
+#include <basegfx/vector/b2dvector.hxx>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/uno/Sequence.h>
+
+#include <vector>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+using ::basegfx::B2DVector;
+//-----------------------------------------------------------------------------
+/**
+*/
+
+struct TickInfo
+{
+ double fScaledTickValue;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling > xInverseScaling;
+
+ ::basegfx::B2DVector aTickScreenPosition;
+ bool bPaintIt;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > xTextShape;
+
+ rtl::OUString aText;//used only for complex categories so far
+ sal_Int32 nFactorForLimitedTextWidth;//categories in higher levels of complex categories can have more place than a single simple category
+
+//methods:
+ TickInfo( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling >& xInverseScaling );
+
+ double getUnscaledTickValue() const;
+ sal_Int32 getScreenDistanceBetweenTicks( const TickInfo& rOherTickInfo ) const;
+private:
+ TickInfo();
+};
+class TickIter
+{
+public:
+ virtual ~TickIter(){};
+ virtual TickInfo* firstInfo()=0;
+ virtual TickInfo* nextInfo()=0;
+};
+
+class PureTickIter : public TickIter
+{
+public:
+ PureTickIter( ::std::vector< TickInfo >& rTickInfoVector );
+ virtual ~PureTickIter();
+ virtual TickInfo* firstInfo();
+ virtual TickInfo* nextInfo();
+
+private:
+ ::std::vector< TickInfo >& m_rTickVector;
+ ::std::vector< TickInfo >::iterator m_aTickIter;
+};
+
+class TickFactory
+{
+public:
+ TickFactory(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement );
+ virtual ~TickFactory();
+
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& /*rAllTickInfos*/ ) const {}
+
+private: //methods
+ bool isDateAxis() const;
+
+protected: //member
+ ExplicitScaleData m_rScale;
+ ExplicitIncrementData m_rIncrement;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >
+ m_xInverseScaling;
+
+ //minimum and maximum of the visible range after scaling
+ double m_fScaledVisibleMin;
+ double m_fScaledVisibleMax;
+};
+
+class TickFactory_2D : public TickFactory
+{
+public:
+ TickFactory_2D(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement
+ , const ::basegfx::B2DVector& rStartScreenPos, const ::basegfx::B2DVector& rEndScreenPos
+ , const ::basegfx::B2DVector& rAxisLineToLabelLineShift );
+ //, double fStrech_SceneToScreen, double fOffset_SceneToScreen );
+ virtual ~TickFactory_2D();
+
+ static sal_Int32 getTickScreenDistance( TickIter& rIter );
+
+ void createPointSequenceForAxisMainLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints ) const;
+ void addPointSequenceForTickLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints
+ , sal_Int32 nSequenceIndex
+ , double fScaledLogicTickValue, double fInnerDirectionSign
+ , const TickmarkProperties& rTickmarkProperties, bool bPlaceAtLabels ) const;
+ ::basegfx::B2DVector getDistanceAxisTickToText( const AxisProperties& rAxisProperties
+ , bool bIncludeFarAwayDistanceIfSo = false
+ , bool bIncludeSpaceBetweenTickAndText = true ) const;
+
+ virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+
+ bool isHorizontalAxis() const;
+ bool isVerticalAxis() const;
+
+protected: //methods
+ ::basegfx::B2DVector getTickScreenPosition2D( double fScaledLogicTickValue ) const;
+
+private: //member
+ ::basegfx::B2DVector m_aAxisStartScreenPosition2D;
+ ::basegfx::B2DVector m_aAxisEndScreenPosition2D;
+
+ //labels might be posioned high or low on the border of the diagram far away from the axis
+ //add this vector to go from the axis line to the label line (border of the diagram)
+ ::basegfx::B2DVector m_aAxisLineToLabelLineShift;
+
+ double m_fStrech_LogicToScreen;
+ double m_fOffset_LogicToScreen;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/view/axes/Tickmarks_Dates.cxx b/chart2/source/view/axes/Tickmarks_Dates.cxx
new file mode 100644
index 000000000000..b5177fe307b8
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks_Dates.cxx
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_chart2.hxx"
+#include "Tickmarks_Dates.hxx"
+#include "DateScaling.hxx"
+#include <rtl/math.hxx>
+#include <tools/debug.hxx>
+#include "DateHelper.hxx"
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::rtl::math;
+using ::basegfx::B2DVector;
+using ::com::sun::star::chart::TimeUnit::DAY;
+using ::com::sun::star::chart::TimeUnit::MONTH;
+using ::com::sun::star::chart::TimeUnit::YEAR;
+
+DateTickFactory::DateTickFactory(
+ const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
+ : m_aScale( rScale )
+ , m_aIncrement( rIncrement )
+ , m_xInverseScaling(NULL)
+{
+ //@todo: make sure that the scale is valid for the scaling
+
+ if( m_aScale.Scaling.is() )
+ {
+ m_xInverseScaling = m_aScale.Scaling->getInverseScaling();
+ DBG_ASSERT( m_xInverseScaling.is(), "each Scaling needs to return a inverse Scaling" );
+ }
+
+ m_fScaledVisibleMin = m_aScale.Minimum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMin = m_aScale.Scaling->doScaling(m_fScaledVisibleMin);
+
+ m_fScaledVisibleMax = m_aScale.Maximum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMax = m_aScale.Scaling->doScaling(m_fScaledVisibleMax);
+}
+
+DateTickFactory::~DateTickFactory()
+{
+}
+
+void DateTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos, bool bShifted ) const
+{
+ rAllTickInfos.resize(2);
+ ::std::vector< TickInfo >& rMajorTicks = rAllTickInfos[0];
+ ::std::vector< TickInfo >& rMinorTicks = rAllTickInfos[1];
+ rMajorTicks.clear();
+ rMinorTicks.clear();
+
+ Date aNull(m_aScale.NullDate);
+
+ Date aDate = aNull + ::rtl::math::approxFloor(m_aScale.Minimum);
+ Date aMaxDate = aNull + ::rtl::math::approxFloor(m_aScale.Maximum);
+
+ uno::Reference< chart2::XScaling > xScaling(m_aScale.Scaling);
+ uno::Reference< chart2::XScaling > xInverseScaling(m_xInverseScaling);
+ if( bShifted )
+ {
+ xScaling = new DateScaling(aNull,m_aScale.TimeResolution,true/*bShifted*/);
+ xInverseScaling = xScaling->getInverseScaling();
+ }
+
+ //create major date tickinfos
+ while( aDate<= aMaxDate )
+ {
+ if( bShifted && aDate==aMaxDate )
+ break;
+
+ TickInfo aNewTick(xInverseScaling); aNewTick.fScaledTickValue = aDate - aNull;
+
+ if( xInverseScaling.is() )
+ aNewTick.fScaledTickValue = xScaling->doScaling(aNewTick.fScaledTickValue);
+ rMajorTicks.push_back( aNewTick );
+
+ if(m_aIncrement.MajorTimeInterval.Number<=0)
+ break;
+
+ //find next major date
+ switch( m_aIncrement.MajorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ aDate += m_aIncrement.MajorTimeInterval.Number;
+ break;
+ case YEAR:
+ aDate = DateHelper::GetDateSomeYearsAway( aDate, m_aIncrement.MajorTimeInterval.Number );
+ break;
+ case MONTH:
+ default:
+ aDate = DateHelper::GetDateSomeMonthsAway( aDate, m_aIncrement.MajorTimeInterval.Number );
+ break;
+ }
+ }
+
+ //create minor date tickinfos
+ aDate = aNull + ::rtl::math::approxFloor(m_aScale.Minimum);
+ while( aDate<= aMaxDate )
+ {
+ if( bShifted && aDate==aMaxDate )
+ break;
+
+ TickInfo aNewTick(xInverseScaling); aNewTick.fScaledTickValue = aDate - aNull;
+ if( xInverseScaling.is() )
+ aNewTick.fScaledTickValue = xScaling->doScaling(aNewTick.fScaledTickValue);
+ rMinorTicks.push_back( aNewTick );
+
+ if(m_aIncrement.MinorTimeInterval.Number<=0)
+ break;
+
+ //find next minor date
+ switch( m_aIncrement.MinorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ aDate += m_aIncrement.MinorTimeInterval.Number;
+ break;
+ case YEAR:
+ aDate = DateHelper::GetDateSomeYearsAway( aDate, m_aIncrement.MinorTimeInterval.Number );
+ break;
+ case MONTH:
+ default:
+ aDate = DateHelper::GetDateSomeMonthsAway( aDate, m_aIncrement.MinorTimeInterval.Number );
+ break;
+ }
+ }
+}
+
+void DateTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ getAllTicks( rAllTickInfos, false );
+}
+
+void DateTickFactory::getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ getAllTicks( rAllTickInfos, true );
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/Tickmarks_Dates.hxx b/chart2/source/view/axes/Tickmarks_Dates.hxx
new file mode 100644
index 000000000000..464e8b4ca24c
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks_Dates.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_TICKMARKS_DATES_HXX
+#define _CHART2_TICKMARKS_DATES_HXX
+
+#include "Tickmarks.hxx"
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+class DateTickFactory
+{
+public:
+ DateTickFactory(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement );
+ ~DateTickFactory();
+
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+
+private: //methods
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos, bool bShifted ) const;
+
+private: //member
+ ExplicitScaleData m_aScale;
+ ExplicitIncrementData m_aIncrement;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >
+ m_xInverseScaling;
+
+ //minimum and maximum of the visible range after scaling
+ double m_fScaledVisibleMin;
+ double m_fScaledVisibleMax;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/view/axes/Tickmarks_Equidistant.cxx b/chart2/source/view/axes/Tickmarks_Equidistant.cxx
new file mode 100644
index 000000000000..9344af1ffac9
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks_Equidistant.cxx
@@ -0,0 +1,671 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_chart2.hxx"
+#include "Tickmarks_Equidistant.hxx"
+#include "ViewDefines.hxx"
+#include <rtl/math.hxx>
+#include <tools/debug.hxx>
+#include <memory>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::rtl::math;
+using ::basegfx::B2DVector;
+
+//static
+double EquidistantTickFactory::getMinimumAtIncrement( double fMin, const ExplicitIncrementData& rIncrement )
+{
+ //the returned value will be <= fMin and on a Major Tick given by rIncrement
+ if(rIncrement.Distance<=0.0)
+ return fMin;
+
+ double fRet = rIncrement.BaseValue +
+ floor( approxSub( fMin, rIncrement.BaseValue )
+ / rIncrement.Distance)
+ *rIncrement.Distance;
+
+ if( fRet > fMin )
+ {
+ if( !approxEqual(fRet, fMin) )
+ fRet -= rIncrement.Distance;
+ }
+ return fRet;
+}
+//static
+double EquidistantTickFactory::getMaximumAtIncrement( double fMax, const ExplicitIncrementData& rIncrement )
+{
+ //the returned value will be >= fMax and on a Major Tick given by rIncrement
+ if(rIncrement.Distance<=0.0)
+ return fMax;
+
+ double fRet = rIncrement.BaseValue +
+ floor( approxSub( fMax, rIncrement.BaseValue )
+ / rIncrement.Distance)
+ *rIncrement.Distance;
+
+ if( fRet < fMax )
+ {
+ if( !approxEqual(fRet, fMax) )
+ fRet += rIncrement.Distance;
+ }
+ return fRet;
+}
+
+EquidistantTickFactory::EquidistantTickFactory(
+ const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
+ : m_rScale( rScale )
+ , m_rIncrement( rIncrement )
+ , m_xInverseScaling(NULL)
+ , m_pfCurrentValues(NULL)
+{
+ //@todo: make sure that the scale is valid for the scaling
+
+ m_pfCurrentValues = new double[getTickDepth()];
+
+ if( m_rScale.Scaling.is() )
+ {
+ m_xInverseScaling = m_rScale.Scaling->getInverseScaling();
+ DBG_ASSERT( m_xInverseScaling.is(), "each Scaling needs to return a inverse Scaling" );
+ }
+
+ double fMin = m_fScaledVisibleMin = m_rScale.Minimum;
+ if( m_xInverseScaling.is() )
+ {
+ m_fScaledVisibleMin = m_rScale.Scaling->doScaling(m_fScaledVisibleMin);
+ if(m_rIncrement.PostEquidistant )
+ fMin = m_fScaledVisibleMin;
+ }
+
+ double fMax = m_fScaledVisibleMax = m_rScale.Maximum;
+ if( m_xInverseScaling.is() )
+ {
+ m_fScaledVisibleMax = m_rScale.Scaling->doScaling(m_fScaledVisibleMax);
+ if(m_rIncrement.PostEquidistant )
+ fMax = m_fScaledVisibleMax;
+ }
+
+ //--
+ m_fOuterMajorTickBorderMin = EquidistantTickFactory::getMinimumAtIncrement( fMin, m_rIncrement );
+ m_fOuterMajorTickBorderMax = EquidistantTickFactory::getMaximumAtIncrement( fMax, m_rIncrement );
+ //--
+
+ m_fOuterMajorTickBorderMin_Scaled = m_fOuterMajorTickBorderMin;
+ m_fOuterMajorTickBorderMax_Scaled = m_fOuterMajorTickBorderMax;
+ if(!m_rIncrement.PostEquidistant && m_xInverseScaling.is() )
+ {
+ m_fOuterMajorTickBorderMin_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMin);
+ m_fOuterMajorTickBorderMax_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMax);
+
+ //check validity of new range: m_fOuterMajorTickBorderMin <-> m_fOuterMajorTickBorderMax
+ //it is assumed here, that the original range in the given Scale is valid
+ if( !rtl::math::isFinite(m_fOuterMajorTickBorderMin_Scaled) )
+ {
+ m_fOuterMajorTickBorderMin += m_rIncrement.Distance;
+ m_fOuterMajorTickBorderMin_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMin);
+ }
+ if( !rtl::math::isFinite(m_fOuterMajorTickBorderMax_Scaled) )
+ {
+ m_fOuterMajorTickBorderMax -= m_rIncrement.Distance;
+ m_fOuterMajorTickBorderMax_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMax);
+ }
+ }
+}
+
+EquidistantTickFactory::~EquidistantTickFactory()
+{
+ delete[] m_pfCurrentValues;
+}
+
+sal_Int32 EquidistantTickFactory::getTickDepth() const
+{
+ return static_cast<sal_Int32>(m_rIncrement.SubIncrements.size()) + 1;
+}
+
+void EquidistantTickFactory::addSubTicks( sal_Int32 nDepth, uno::Sequence< uno::Sequence< double > >& rParentTicks ) const
+{
+ EquidistantTickIter aIter( rParentTicks, m_rIncrement, 0, nDepth-1 );
+ double* pfNextParentTick = aIter.firstValue();
+ if(!pfNextParentTick)
+ return;
+ double fLastParentTick = *pfNextParentTick;
+ pfNextParentTick = aIter.nextValue();
+ if(!pfNextParentTick)
+ return;
+
+ sal_Int32 nMaxSubTickCount = this->getMaxTickCount( nDepth );
+ if(!nMaxSubTickCount)
+ return;
+
+ uno::Sequence< double > aSubTicks(nMaxSubTickCount);
+ sal_Int32 nRealSubTickCount = 0;
+ sal_Int32 nIntervalCount = m_rIncrement.SubIncrements[nDepth-1].IntervalCount;
+
+ double* pValue = NULL;
+ for(; pfNextParentTick; fLastParentTick=*pfNextParentTick, pfNextParentTick = aIter.nextValue())
+ {
+ for( sal_Int32 nPartTick = 1; nPartTick<nIntervalCount; nPartTick++ )
+ {
+ pValue = this->getMinorTick( nPartTick, nDepth
+ , fLastParentTick, *pfNextParentTick );
+ if(!pValue)
+ continue;
+
+ aSubTicks[nRealSubTickCount] = *pValue;
+ nRealSubTickCount++;
+ }
+ }
+
+ aSubTicks.realloc(nRealSubTickCount);
+ rParentTicks[nDepth] = aSubTicks;
+ if(static_cast<sal_Int32>(m_rIncrement.SubIncrements.size())>nDepth)
+ addSubTicks( nDepth+1, rParentTicks );
+}
+
+
+sal_Int32 EquidistantTickFactory::getMaxTickCount( sal_Int32 nDepth ) const
+{
+ //return the maximum amount of ticks
+ //possibly open intervals at the two ends of the region are handled as if they were completely visible
+ //(this is necessary for calculating the sub ticks at the borders correctly)
+
+ if( nDepth >= getTickDepth() )
+ return 0;
+ if( m_fOuterMajorTickBorderMax < m_fOuterMajorTickBorderMin )
+ return 0;
+ if( m_rIncrement.Distance<=0.0)
+ return 0;
+
+ double fSub;
+ if(m_rIncrement.PostEquidistant )
+ fSub = approxSub( m_fScaledVisibleMax, m_fScaledVisibleMin );
+ else
+ fSub = approxSub( m_rScale.Maximum, m_rScale.Minimum );
+
+ if (!isFinite(fSub))
+ return 0;
+
+ sal_Int32 nIntervalCount = static_cast<sal_Int32>( fSub / m_rIncrement.Distance );
+
+ nIntervalCount+=3;
+ for(sal_Int32 nN=0; nN<nDepth-1; nN++)
+ {
+ if( m_rIncrement.SubIncrements[nN].IntervalCount>1 )
+ nIntervalCount *= m_rIncrement.SubIncrements[nN].IntervalCount;
+ }
+
+ sal_Int32 nTickCount = nIntervalCount;
+ if(nDepth>0 && m_rIncrement.SubIncrements[nDepth-1].IntervalCount>1)
+ nTickCount = nIntervalCount * (m_rIncrement.SubIncrements[nDepth-1].IntervalCount-1);
+
+ return nTickCount;
+}
+
+double* EquidistantTickFactory::getMajorTick( sal_Int32 nTick ) const
+{
+ m_pfCurrentValues[0] = m_fOuterMajorTickBorderMin + nTick*m_rIncrement.Distance;
+
+ if(m_pfCurrentValues[0]>m_fOuterMajorTickBorderMax)
+ {
+ if( !approxEqual(m_pfCurrentValues[0],m_fOuterMajorTickBorderMax) )
+ return NULL;
+ }
+ if(m_pfCurrentValues[0]<m_fOuterMajorTickBorderMin)
+ {
+ if( !approxEqual(m_pfCurrentValues[0],m_fOuterMajorTickBorderMin) )
+ return NULL;
+ }
+
+ //return always the value after scaling
+ if(!m_rIncrement.PostEquidistant && m_xInverseScaling.is() )
+ m_pfCurrentValues[0] = m_rScale.Scaling->doScaling( m_pfCurrentValues[0] );
+
+ return &m_pfCurrentValues[0];
+}
+
+double* EquidistantTickFactory::getMinorTick( sal_Int32 nTick, sal_Int32 nDepth
+ , double fStartParentTick, double fNextParentTick ) const
+{
+ //check validity of arguments
+ {
+ //DBG_ASSERT( fStartParentTick < fNextParentTick, "fStartParentTick >= fNextParentTick");
+ if(fStartParentTick >= fNextParentTick)
+ return NULL;
+ if(nDepth>static_cast<sal_Int32>(m_rIncrement.SubIncrements.size()) || nDepth<=0)
+ return NULL;
+
+ //subticks are only calculated if they are laying between parent ticks:
+ if(nTick<=0)
+ return NULL;
+ if(nTick>=m_rIncrement.SubIncrements[nDepth-1].IntervalCount)
+ return NULL;
+ }
+
+ bool bPostEquidistant = m_rIncrement.SubIncrements[nDepth-1].PostEquidistant;
+
+ double fAdaptedStartParent = fStartParentTick;
+ double fAdaptedNextParent = fNextParentTick;
+
+ if( !bPostEquidistant && m_xInverseScaling.is() )
+ {
+ fAdaptedStartParent = m_xInverseScaling->doScaling(fStartParentTick);
+ fAdaptedNextParent = m_xInverseScaling->doScaling(fNextParentTick);
+ }
+
+ double fDistance = (fAdaptedNextParent - fAdaptedStartParent)/m_rIncrement.SubIncrements[nDepth-1].IntervalCount;
+
+ m_pfCurrentValues[nDepth] = fAdaptedStartParent + nTick*fDistance;
+
+ //return always the value after scaling
+ if(!bPostEquidistant && m_xInverseScaling.is() )
+ m_pfCurrentValues[nDepth] = m_rScale.Scaling->doScaling( m_pfCurrentValues[nDepth] );
+
+ if( !isWithinOuterBorder( m_pfCurrentValues[nDepth] ) )
+ return NULL;
+
+ return &m_pfCurrentValues[nDepth];
+}
+
+bool EquidistantTickFactory::isWithinOuterBorder( double fScaledValue ) const
+{
+ if(fScaledValue>m_fOuterMajorTickBorderMax_Scaled)
+ return false;
+ if(fScaledValue<m_fOuterMajorTickBorderMin_Scaled)
+ return false;
+
+ return true;
+}
+
+bool EquidistantTickFactory::isVisible( double fScaledValue ) const
+{
+ if(fScaledValue>m_fScaledVisibleMax)
+ {
+ if( !approxEqual(fScaledValue,m_fScaledVisibleMax) )
+ return false;
+ }
+ if(fScaledValue<m_fScaledVisibleMin)
+ {
+ if( !approxEqual(fScaledValue,m_fScaledVisibleMin) )
+ return false;
+ }
+ return true;
+}
+
+void EquidistantTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ uno::Sequence< uno::Sequence< double > > aAllTicks;
+
+ //create point sequences for each tick depth
+ sal_Int32 nDepthCount = this->getTickDepth();
+ sal_Int32 nMaxMajorTickCount = this->getMaxTickCount( 0 );
+
+ aAllTicks.realloc(nDepthCount);
+ aAllTicks[0].realloc(nMaxMajorTickCount);
+
+ sal_Int32 nRealMajorTickCount = 0;
+ double* pValue = NULL;
+ for( sal_Int32 nMajorTick=0; nMajorTick<nMaxMajorTickCount; nMajorTick++ )
+ {
+ pValue = this->getMajorTick( nMajorTick );
+ if(!pValue)
+ continue;
+ aAllTicks[0][nRealMajorTickCount] = *pValue;
+ nRealMajorTickCount++;
+ }
+ if(!nRealMajorTickCount)
+ return;
+ aAllTicks[0].realloc(nRealMajorTickCount);
+
+ if(nDepthCount>0)
+ this->addSubTicks( 1, aAllTicks );
+
+ //so far we have added all ticks between the outer major tick marks
+ //this was necessary to create sub ticks correctly
+ //now we reduce all ticks to the visible ones that lie between the real borders
+ sal_Int32 nDepth = 0;
+ sal_Int32 nTick = 0;
+ for( nDepth = 0; nDepth < nDepthCount; nDepth++)
+ {
+ sal_Int32 nInvisibleAtLowerBorder = 0;
+ sal_Int32 nInvisibleAtUpperBorder = 0;
+ //we need only to check all ticks within the first major interval at each border
+ sal_Int32 nCheckCount = 1;
+ for(sal_Int32 nN=0; nN<nDepth; nN++)
+ {
+ if( m_rIncrement.SubIncrements[nN].IntervalCount>1 )
+ nCheckCount *= m_rIncrement.SubIncrements[nN].IntervalCount;
+ }
+ uno::Sequence< double >& rTicks = aAllTicks[nDepth];
+ sal_Int32 nCount = rTicks.getLength();
+ //check lower border
+ for( nTick=0; nTick<nCheckCount && nTick<nCount; nTick++)
+ {
+ if( !isVisible( rTicks[nTick] ) )
+ nInvisibleAtLowerBorder++;
+ }
+ //check upper border
+ for( nTick=nCount-1; nTick>nCount-1-nCheckCount && nTick>=0; nTick--)
+ {
+ if( !isVisible( rTicks[nTick] ) )
+ nInvisibleAtUpperBorder++;
+ }
+ //resize sequence
+ if( !nInvisibleAtLowerBorder && !nInvisibleAtUpperBorder)
+ continue;
+ if( !nInvisibleAtLowerBorder )
+ rTicks.realloc(nCount-nInvisibleAtUpperBorder);
+ else
+ {
+ sal_Int32 nNewCount = nCount-nInvisibleAtUpperBorder-nInvisibleAtLowerBorder;
+ if(nNewCount<0)
+ nNewCount=0;
+
+ uno::Sequence< double > aOldTicks(rTicks);
+ rTicks.realloc(nNewCount);
+ for(nTick = 0; nTick<nNewCount; nTick++)
+ rTicks[nTick] = aOldTicks[nInvisibleAtLowerBorder+nTick];
+ }
+ }
+
+ //fill return value
+ rAllTickInfos.resize(aAllTicks.getLength());
+ for( nDepth=0 ;nDepth<aAllTicks.getLength(); nDepth++ )
+ {
+ sal_Int32 nCount = aAllTicks[nDepth].getLength();
+
+ ::std::vector< TickInfo >& rTickInfoVector = rAllTickInfos[nDepth];
+ rTickInfoVector.clear();
+ rTickInfoVector.reserve( nCount );
+ for(sal_Int32 nN = 0; nN<nCount; nN++)
+ {
+ TickInfo aTickInfo(m_xInverseScaling);
+ aTickInfo.fScaledTickValue = aAllTicks[nDepth][nN];
+ rTickInfoVector.push_back(aTickInfo);
+ }
+ }
+}
+
+void EquidistantTickFactory::getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ ExplicitIncrementData aShiftedIncrement( m_rIncrement );
+ aShiftedIncrement.BaseValue = m_rIncrement.BaseValue-m_rIncrement.Distance/2.0;
+ EquidistantTickFactory( m_rScale, aShiftedIncrement ).getAllTicks(rAllTickInfos);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+EquidistantTickIter::EquidistantTickIter( const uno::Sequence< uno::Sequence< double > >& rTicks
+ , const ExplicitIncrementData& rIncrement
+ , sal_Int32 nMinDepth, sal_Int32 nMaxDepth )
+ : m_pSimpleTicks(&rTicks)
+ , m_pInfoTicks(0)
+ , m_rIncrement(rIncrement)
+ , m_nMinDepth(0), m_nMaxDepth(0)
+ , m_nTickCount(0), m_pnPositions(NULL)
+ , m_pnPreParentCount(NULL), m_pbIntervalFinished(NULL)
+ , m_nCurrentDepth(-1), m_nCurrentPos(-1), m_fCurrentValue( 0.0 )
+{
+ initIter( nMinDepth, nMaxDepth );
+}
+
+EquidistantTickIter::EquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTicks
+ , const ExplicitIncrementData& rIncrement
+ , sal_Int32 nMinDepth, sal_Int32 nMaxDepth )
+ : m_pSimpleTicks(NULL)
+ , m_pInfoTicks(&rTicks)
+ , m_rIncrement(rIncrement)
+ , m_nMinDepth(0), m_nMaxDepth(0)
+ , m_nTickCount(0), m_pnPositions(NULL)
+ , m_pnPreParentCount(NULL), m_pbIntervalFinished(NULL)
+ , m_nCurrentDepth(-1), m_nCurrentPos(-1), m_fCurrentValue( 0.0 )
+{
+ initIter( nMinDepth, nMaxDepth );
+}
+
+void EquidistantTickIter::initIter( sal_Int32 /*nMinDepth*/, sal_Int32 nMaxDepth )
+{
+ m_nMaxDepth = nMaxDepth;
+ if(nMaxDepth<0 || m_nMaxDepth>getMaxDepth())
+ m_nMaxDepth=getMaxDepth();
+
+ sal_Int32 nDepth = 0;
+ for( nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ )
+ m_nTickCount += getTickCount(nDepth);
+
+ if(!m_nTickCount)
+ return;
+
+ m_pnPositions = new sal_Int32[m_nMaxDepth+1];
+
+ m_pnPreParentCount = new sal_Int32[m_nMaxDepth+1];
+ m_pbIntervalFinished = new bool[m_nMaxDepth+1];
+ m_pnPreParentCount[0] = 0;
+ m_pbIntervalFinished[0] = false;
+ double fParentValue = getTickValue(0,0);
+ for( nDepth = 1; nDepth<=m_nMaxDepth ;nDepth++ )
+ {
+ m_pbIntervalFinished[nDepth] = false;
+
+ sal_Int32 nPreParentCount = 0;
+ sal_Int32 nCount = getTickCount(nDepth);
+ for(sal_Int32 nN = 0; nN<nCount; nN++)
+ {
+ if(getTickValue(nDepth,nN) < fParentValue)
+ nPreParentCount++;
+ else
+ break;
+ }
+ m_pnPreParentCount[nDepth] = nPreParentCount;
+ if(nCount)
+ {
+ double fNextParentValue = getTickValue(nDepth,0);
+ if( fNextParentValue < fParentValue )
+ fParentValue = fNextParentValue;
+ }
+ }
+}
+
+EquidistantTickIter::~EquidistantTickIter()
+{
+ delete[] m_pnPositions;
+ delete[] m_pnPreParentCount;
+ delete[] m_pbIntervalFinished;
+}
+
+sal_Int32 EquidistantTickIter::getStartDepth() const
+{
+ //find the depth of the first visible tickmark:
+ //it is the depth of the smallest value
+ sal_Int32 nReturnDepth=0;
+ double fMinValue = DBL_MAX;
+ for(sal_Int32 nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ )
+ {
+ sal_Int32 nCount = getTickCount(nDepth);
+ if( !nCount )
+ continue;
+ double fThisValue = getTickValue(nDepth,0);
+ if(fThisValue<fMinValue)
+ {
+ nReturnDepth = nDepth;
+ fMinValue = fThisValue;
+ }
+ }
+ return nReturnDepth;
+}
+
+double* EquidistantTickIter::firstValue()
+{
+ if( gotoFirst() )
+ {
+ m_fCurrentValue = getTickValue(m_nCurrentDepth, m_pnPositions[m_nCurrentDepth]);
+ return &m_fCurrentValue;
+ }
+ return NULL;
+}
+
+TickInfo* EquidistantTickIter::firstInfo()
+{
+ if( m_pInfoTicks && gotoFirst() )
+ return &(*m_pInfoTicks)[m_nCurrentDepth][m_pnPositions[m_nCurrentDepth]];
+ return NULL;
+}
+
+sal_Int32 EquidistantTickIter::getIntervalCount( sal_Int32 nDepth )
+{
+ if(nDepth>static_cast<sal_Int32>(m_rIncrement.SubIncrements.size()) || nDepth<0)
+ return 0;
+
+ if(!nDepth)
+ return m_nTickCount;
+
+ return m_rIncrement.SubIncrements[nDepth-1].IntervalCount;
+}
+
+bool EquidistantTickIter::isAtLastPartTick()
+{
+ if(!m_nCurrentDepth)
+ return false;
+ sal_Int32 nIntervalCount = getIntervalCount( m_nCurrentDepth );
+ if(!nIntervalCount || nIntervalCount == 1)
+ return true;
+ if( m_pbIntervalFinished[m_nCurrentDepth] )
+ return false;
+ sal_Int32 nPos = m_pnPositions[m_nCurrentDepth]+1;
+ if(m_pnPreParentCount[m_nCurrentDepth])
+ nPos += nIntervalCount-1 - m_pnPreParentCount[m_nCurrentDepth];
+ bool bRet = nPos && nPos % (nIntervalCount-1) == 0;
+ if(!nPos && !m_pnPreParentCount[m_nCurrentDepth]
+ && m_pnPositions[m_nCurrentDepth-1]==-1 )
+ bRet = true;
+ return bRet;
+}
+
+bool EquidistantTickIter::gotoFirst()
+{
+ if( m_nMaxDepth<0 )
+ return false;
+ if( !m_nTickCount )
+ return false;
+
+ for(sal_Int32 nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ )
+ m_pnPositions[nDepth] = -1;
+
+ m_nCurrentPos = 0;
+ m_nCurrentDepth = getStartDepth();
+ m_pnPositions[m_nCurrentDepth] = 0;
+ return true;
+}
+
+bool EquidistantTickIter::gotoNext()
+{
+ if( m_nCurrentPos < 0 )
+ return false;
+ m_nCurrentPos++;
+
+ if( m_nCurrentPos >= m_nTickCount )
+ return false;
+
+ if( m_nCurrentDepth==m_nMaxDepth && isAtLastPartTick() )
+ {
+ do
+ {
+ m_pbIntervalFinished[m_nCurrentDepth] = true;
+ m_nCurrentDepth--;
+ }
+ while( m_nCurrentDepth && isAtLastPartTick() );
+ }
+ else if( m_nCurrentDepth<m_nMaxDepth )
+ {
+ do
+ {
+ m_nCurrentDepth++;
+ }
+ while( m_nCurrentDepth<m_nMaxDepth );
+ }
+ m_pbIntervalFinished[m_nCurrentDepth] = false;
+ m_pnPositions[m_nCurrentDepth] = m_pnPositions[m_nCurrentDepth]+1;
+ return true;
+}
+
+bool EquidistantTickIter::gotoIndex( sal_Int32 nTickIndex )
+{
+ if( nTickIndex < 0 )
+ return false;
+ if( nTickIndex >= m_nTickCount )
+ return false;
+
+ if( nTickIndex < m_nCurrentPos )
+ if( !gotoFirst() )
+ return false;
+
+ while( nTickIndex > m_nCurrentPos )
+ if( !gotoNext() )
+ return false;
+
+ return true;
+}
+
+sal_Int32 EquidistantTickIter::getCurrentIndex() const
+{
+ return m_nCurrentPos;
+}
+sal_Int32 EquidistantTickIter::getMaxIndex() const
+{
+ return m_nTickCount-1;
+}
+
+double* EquidistantTickIter::nextValue()
+{
+ if( gotoNext() )
+ {
+ m_fCurrentValue = getTickValue(m_nCurrentDepth, m_pnPositions[m_nCurrentDepth]);
+ return &m_fCurrentValue;
+ }
+ return NULL;
+}
+
+TickInfo* EquidistantTickIter::nextInfo()
+{
+ if( m_pInfoTicks && gotoNext() &&
+ static_cast< sal_Int32 >(
+ (*m_pInfoTicks)[m_nCurrentDepth].size()) > m_pnPositions[m_nCurrentDepth] )
+ {
+ return &(*m_pInfoTicks)[m_nCurrentDepth][m_pnPositions[m_nCurrentDepth]];
+ }
+ return NULL;
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/TickmarkHelper.hxx b/chart2/source/view/axes/Tickmarks_Equidistant.hxx
index 78fc2fe1c502..836a93d28db2 100644
--- a/chart2/source/view/axes/TickmarkHelper.hxx
+++ b/chart2/source/view/axes/Tickmarks_Equidistant.hxx
@@ -24,19 +24,10 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _CHART2_TICKMARKHELPER_HXX
-#define _CHART2_TICKMARKHELPER_HXX
+#ifndef _CHART2_TICKMARKS_EQUIDISTANT_HXX
+#define _CHART2_TICKMARKS_EQUIDISTANT_HXX
-#include "TickmarkProperties.hxx"
-#include "VAxisProperties.hxx"
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <basegfx/vector/b2dvector.hxx>
-#include <com/sun/star/drawing/PointSequenceSequence.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
-#include <com/sun/star/uno/Sequence.h>
-
-#include <vector>
+#include "Tickmarks.hxx"
//.............................................................................
namespace chart
@@ -48,57 +39,15 @@ using ::basegfx::B2DVector;
/**
*/
-struct TickInfo
-{
- double fScaledTickValue;
- double fUnscaledTickValue;
-
- ::basegfx::B2DVector aTickScreenPosition;
- bool bPaintIt;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > xTextShape;
-
- rtl::OUString aText;//used only for complex categories so far
- sal_Int32 nFactorForLimitedTextWidth;//categories in higher levels of complex categories can have more place than a single simple category
-
-//methods:
- TickInfo();
- void updateUnscaledValue( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XScaling >& xInverseScaling );
-
- sal_Int32 getScreenDistanceBetweenTicks( const TickInfo& rOherTickInfo ) const;
-};
-class TickIter
-{
-public:
- virtual ~TickIter(){};
- virtual TickInfo* firstInfo()=0;
- virtual TickInfo* nextInfo()=0;
-};
-
-class PureTickIter : public TickIter
-{
-public:
- PureTickIter( ::std::vector< TickInfo >& rTickInfoVector );
- virtual ~PureTickIter();
- virtual TickInfo* firstInfo();
- virtual TickInfo* nextInfo();
-
-private:
- ::std::vector< TickInfo >& m_rTickVector;
- ::std::vector< TickInfo >::iterator m_aTickIter;
-};
-
class EquidistantTickIter : public TickIter
{
public:
EquidistantTickIter( const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< double > >& rTicks
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ , const ExplicitIncrementData& rIncrement
, sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 );
EquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ , const ExplicitIncrementData& rIncrement
, sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 );
virtual ~EquidistantTickIter();
@@ -152,7 +101,7 @@ private: //member
const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< double > >* m_pSimpleTicks;
::std::vector< ::std::vector< TickInfo > >* m_pInfoTicks;
- const ::com::sun::star::chart2::ExplicitIncrementData& m_rIncrement;
+ const ExplicitIncrementData& m_rIncrement;
//iteration from m_nMinDepth to m_nMaxDepth
sal_Int32 m_nMinDepth;
sal_Int32 m_nMaxDepth;
@@ -166,24 +115,21 @@ private: //member
double m_fCurrentValue;
};
-class TickmarkHelper
+class EquidistantTickFactory
{
public:
- TickmarkHelper(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
- virtual ~TickmarkHelper();
+ EquidistantTickFactory(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement );
+ ~EquidistantTickFactory();
- virtual TickmarkHelper* createShiftedTickmarkHelper() const;
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
- void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
- void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ static double getMinimumAtIncrement( double fMin, const ExplicitIncrementData& rIncrement );
+ static double getMaximumAtIncrement( double fMax, const ExplicitIncrementData& rIncrement );
- //
- static double getMinimumAtIncrement( double fMin, const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
- static double getMaximumAtIncrement( double fMax, const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
-
-protected: //methods
+private: //methods
void addSubTicks( sal_Int32 nDepth,
::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< double > >& rParentTicks ) const;
@@ -192,82 +138,26 @@ protected: //methods
, double fStartParentTick, double fNextParentTick ) const;
sal_Int32 getMaxTickCount( sal_Int32 nDepth = 0 ) const;
sal_Int32 getTickDepth() const;
+
bool isVisible( double fValue ) const;
bool isWithinOuterBorder( double fScaledValue ) const; //all within the outer major tick marks
- virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& /*rAllTickInfos*/ ) const {}
-
-protected: //member
- ::com::sun::star::chart2::ExplicitScaleData m_rScale;
- ::com::sun::star::chart2::ExplicitIncrementData m_rIncrement;
-
+private: //member
+ ExplicitScaleData m_rScale;
+ ExplicitIncrementData m_rIncrement;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >
m_xInverseScaling;
+
+ //minimum and maximum of the visible range after scaling
+ double m_fScaledVisibleMin;
+ double m_fScaledVisibleMax;
+
double* m_pfCurrentValues;
//major-tick positions that may lay outside the visible range but complete partly visible intervals at the borders
double m_fOuterMajorTickBorderMin;
double m_fOuterMajorTickBorderMax;
double m_fOuterMajorTickBorderMin_Scaled;
double m_fOuterMajorTickBorderMax_Scaled;
-
- //minimum and maximum of the visible range after scaling
- double m_fScaledVisibleMin;
- double m_fScaledVisibleMax;
-};
-
-class TickmarkHelper_2D : public TickmarkHelper
-{
-public:
- TickmarkHelper_2D(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
- , const ::basegfx::B2DVector& rStartScreenPos, const ::basegfx::B2DVector& rEndScreenPos
- , const ::basegfx::B2DVector& rAxisLineToLabelLineShift );
- //, double fStrech_SceneToScreen, double fOffset_SceneToScreen );
- virtual ~TickmarkHelper_2D();
-
- virtual TickmarkHelper* createShiftedTickmarkHelper() const;
-
- static sal_Int32 getTickScreenDistance( TickIter& rIter );
-
- void createPointSequenceForAxisMainLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints ) const;
- void addPointSequenceForTickLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints
- , sal_Int32 nSequenceIndex
- , double fScaledLogicTickValue, double fInnerDirectionSign
- , const TickmarkProperties& rTickmarkProperties, bool bPlaceAtLabels ) const;
- ::basegfx::B2DVector getDistanceAxisTickToText( const AxisProperties& rAxisProperties
- , bool bIncludeFarAwayDistanceIfSo = false
- , bool bIncludeSpaceBetweenTickAndText = true ) const;
-
- virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
-
- bool isHorizontalAxis() const;
- bool isVerticalAxis() const;
-
-protected: //methods
- ::basegfx::B2DVector getTickScreenPosition2D( double fScaledLogicTickValue ) const;
-
-private: //member
- ::basegfx::B2DVector m_aAxisStartScreenPosition2D;
- ::basegfx::B2DVector m_aAxisEndScreenPosition2D;
-
- //labels might be posioned high or low on the border of the diagram far away from the axis
- //add this vector to go from the axis line to the label line (border of the diagram)
- ::basegfx::B2DVector m_aAxisLineToLabelLineShift;
-
- double m_fStrech_LogicToScreen;
- double m_fOffset_LogicToScreen;
-};
-
-class TickmarkHelper_3D : public TickmarkHelper
-{
-public:
- TickmarkHelper_3D(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
- virtual ~TickmarkHelper_3D();
-
- virtual TickmarkHelper* createShiftedTickmarkHelper() const;
};
//.............................................................................
diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx
index 0159fb20cad6..fb193ec93a95 100644
--- a/chart2/source/view/axes/VAxisBase.cxx
+++ b/chart2/source/view/axes/VAxisBase.cxx
@@ -31,7 +31,7 @@
#include "VAxisBase.hxx"
#include "ShapeFactory.hxx"
#include "CommonConverters.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "macros.hxx"
// header for define DBG_ASSERT
@@ -70,7 +70,7 @@ sal_Int32 VAxisBase::getDimensionCount()
return m_nDimension;
}
-void SAL_CALL VAxisBase::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
+void VAxisBase::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels )
{
m_aAxisLabelProperties.m_aFontReferenceSize = rFontReferenceSize;
@@ -106,6 +106,15 @@ void SAL_CALL VAxisBase::initAxisLabelProperties( const ::com::sun::star::awt::S
m_aAxisLabelProperties.eStaggering = SIDE_BY_SIDE;
}
+bool VAxisBase::isDateAxis() const
+{
+ return AxisType::DATE == m_aScale.AxisType;
+}
+bool VAxisBase::isComplexCategoryAxis() const
+{
+ return m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels;
+}
+
void VAxisBase::recordMaximumTextSize( const Reference< drawing::XShape >& xShape, double fRotationAngleDegree )
{
if( m_bRecordMaximumTextSize && xShape.is() )
@@ -130,7 +139,7 @@ void VAxisBase::setExrtaLinePositionAtOtherAxis( const double& fCrossingAt )
m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis = new double(fCrossingAt);
}
-sal_Bool SAL_CALL VAxisBase::isAnythingToDraw()
+sal_Bool VAxisBase::isAnythingToDraw()
{
if( !m_aAxisProperties.m_xAxisModel.is() )
return false;
@@ -150,7 +159,7 @@ sal_Bool SAL_CALL VAxisBase::isAnythingToDraw()
return true;
}
-void SAL_CALL VAxisBase::setExplicitScaleAndIncrement(
+void VAxisBase::setExplicitScaleAndIncrement(
const ExplicitScaleData& rScale
, const ExplicitIncrementData& rIncrement )
throw (uno::RuntimeException)
@@ -162,8 +171,11 @@ void SAL_CALL VAxisBase::setExplicitScaleAndIncrement(
void VAxisBase::createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos )
{
- std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() );
- apTickmarkHelper->getAllTicks( rAllTickInfos );
+ std::auto_ptr< TickFactory > apTickFactory( this->createTickFactory() );
+ if( m_aScale.ShiftedCategoryPosition )
+ apTickFactory->getAllTicksShifted( rAllTickInfos );
+ else
+ apTickFactory->getAllTicks( rAllTickInfos );
}
bool VAxisBase::prepareShapeCreation()
@@ -244,7 +256,7 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter )
for( TickInfo* pTickInfo = rIter.firstInfo()
; pTickInfo; pTickInfo = rIter.nextInfo() )
{
- pTickInfo->updateUnscaledValue( xInverseScaling );
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
}
}
diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx
index ba7e94b2070c..e51e2d8dbd9b 100644
--- a/chart2/source/view/axes/VAxisBase.hxx
+++ b/chart2/source/view/axes/VAxisBase.hxx
@@ -29,7 +29,7 @@
#include "VAxisOrGridBase.hxx"
#include "VAxisProperties.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
//.............................................................................
@@ -52,18 +52,18 @@ public:
sal_Int32 getDimensionCount();
- virtual void SAL_CALL createMaximumLabels()=0;
- virtual void SAL_CALL createLabels()=0;
- virtual void SAL_CALL updatePositions()=0;
+ virtual void createMaximumLabels()=0;
+ virtual void createLabels()=0;
+ virtual void updatePositions()=0;
- virtual sal_Bool SAL_CALL isAnythingToDraw();
- virtual void SAL_CALL initAxisLabelProperties(
+ virtual sal_Bool isAnythingToDraw();
+ virtual void initAxisLabelProperties(
const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels );
- virtual void SAL_CALL setExplicitScaleAndIncrement(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement )
+ virtual void setExplicitScaleAndIncrement(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement )
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
@@ -83,6 +83,9 @@ protected: //methods
::com::sun::star::drawing::XShape >& xShape
, double fRotationAngleDegree );
+ bool isDateAxis() const;
+ bool isComplexCategoryAxis() const;
+
protected: //member
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier;
AxisProperties m_aAxisProperties;
diff --git a/chart2/source/view/axes/VAxisOrGridBase.cxx b/chart2/source/view/axes/VAxisOrGridBase.cxx
index f2e2e90c1045..715da4972390 100644
--- a/chart2/source/view/axes/VAxisOrGridBase.cxx
+++ b/chart2/source/view/axes/VAxisOrGridBase.cxx
@@ -31,7 +31,7 @@
#include "VAxisOrGridBase.hxx"
#include "ShapeFactory.hxx"
#include "CommonConverters.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
// header for define DBG_ASSERT
#include <tools/debug.hxx>
@@ -57,7 +57,7 @@ VAxisOrGridBase::~VAxisOrGridBase()
{
}
-void SAL_CALL VAxisOrGridBase::setExplicitScaleAndIncrement(
+void VAxisOrGridBase::setExplicitScaleAndIncrement(
const ExplicitScaleData& rScale
, const ExplicitIncrementData& rIncrement )
throw (uno::RuntimeException)
@@ -79,18 +79,9 @@ void VAxisOrGridBase::set3DWallPositions( CuboidPlanePosition eLeftWallPos, Cubo
m_eBottomPos = eBottomPos;
}
-TickmarkHelper* VAxisOrGridBase::createTickmarkHelper()
+TickFactory* VAxisOrGridBase::createTickFactory()
{
- TickmarkHelper* pRet=NULL;
- if( 2==m_nDimension )
- {
- pRet = new TickmarkHelper( m_aScale, m_aIncrement );
- }
- else
- {
- pRet = new TickmarkHelper_3D( m_aScale, m_aIncrement );
- }
- return pRet;
+ return new TickFactory( m_aScale, m_aIncrement );
}
//.............................................................................
diff --git a/chart2/source/view/axes/VAxisOrGridBase.hxx b/chart2/source/view/axes/VAxisOrGridBase.hxx
index 35b32b2b1c03..9091aabf0dc5 100644
--- a/chart2/source/view/axes/VAxisOrGridBase.hxx
+++ b/chart2/source/view/axes/VAxisOrGridBase.hxx
@@ -29,9 +29,8 @@
#include "PlotterBase.hxx"
#include "ThreeDHelper.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -46,7 +45,7 @@ namespace chart
/**
*/
class ShapeFactory;
-class TickmarkHelper;
+class TickFactory;
class VAxisOrGridBase : public PlotterBase
{
@@ -55,22 +54,22 @@ public:
virtual ~VAxisOrGridBase();
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix );
- virtual void SAL_CALL setExplicitScaleAndIncrement(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement )
+ virtual void setExplicitScaleAndIncrement(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement )
throw (::com::sun::star::uno::RuntimeException);
void set3DWallPositions( CuboidPlanePosition eLeftWallPos, CuboidPlanePosition eBackWallPos, CuboidPlanePosition eBottomPos );
- virtual TickmarkHelper* createTickmarkHelper();
+ virtual TickFactory* createTickFactory();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
protected: //member
- ::com::sun::star::chart2::ExplicitScaleData m_aScale;
- ::com::sun::star::chart2::ExplicitIncrementData m_aIncrement;
- sal_Int32 m_nDimensionIndex;
+ ExplicitScaleData m_aScale;
+ ExplicitIncrementData m_aIncrement;
+ sal_Int32 m_nDimensionIndex;
- ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
+ ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
CuboidPlanePosition m_eLeftWallPos;
CuboidPlanePosition m_eBackWallPos;
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx
index 63c98141991b..9f710d926e0c 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -182,7 +182,6 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel
, m_pfExrtaLinePositionAtOtherAxis(NULL)
, m_bCrossingAxisHasReverseDirection(false)
, m_bCrossingAxisIsCategoryAxes(false)
- , m_bAxisBetweenCategories(false)
, m_fLabelDirectionSign(1.0)
, m_fInnerDirectionSign(1.0)
, m_aLabelAlignment(LABEL_ALIGN_RIGHT_TOP)
@@ -212,7 +211,6 @@ AxisProperties::AxisProperties( const AxisProperties& rAxisProperties )
, m_pfExrtaLinePositionAtOtherAxis( NULL )
, m_bCrossingAxisHasReverseDirection( rAxisProperties.m_bCrossingAxisHasReverseDirection )
, m_bCrossingAxisIsCategoryAxes( rAxisProperties.m_bCrossingAxisIsCategoryAxes )
- , m_bAxisBetweenCategories( rAxisProperties.m_bAxisBetweenCategories )
, m_fLabelDirectionSign( rAxisProperties.m_fLabelDirectionSign )
, m_fInnerDirectionSign( rAxisProperties.m_fInnerDirectionSign )
, m_aLabelAlignment( rAxisProperties.m_aLabelAlignment )
@@ -279,11 +277,7 @@ void AxisProperties::initAxisPositioning( const uno::Reference< beans::XProperty
xAxisProp->getPropertyValue(C2U( "CrossoverValue" )) >>= fValue;
if( m_bCrossingAxisIsCategoryAxes )
- {
fValue = ::rtl::math::round(fValue);
- if( m_bAxisBetweenCategories )
- fValue-=0.5;
- }
m_pfMainLinePositionAtOtherAxis = new double(fValue);
}
else if( ::com::sun::star::chart::ChartAxisPosition_ZERO == m_eCrossoverType )
@@ -317,8 +311,17 @@ void AxisProperties::init( bool bCartesian )
if( m_nDimensionIndex<2 )
initAxisPositioning( xProp );
+ ScaleData aScaleData = m_xAxisModel->getScaleData();
+ if( m_nDimensionIndex==0 )
+ AxisHelper::checkDateAxis( aScaleData, m_pExplicitCategoriesProvider, bCartesian );
+ m_nAxisType = aScaleData.AxisType;
+
if( bCartesian )
{
+ if( m_nDimensionIndex == 0 && m_nAxisType == AxisType::CATEGORY
+ && m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() )
+ m_bComplexCategories = true;
+
if( ::com::sun::star::chart::ChartAxisPosition_END == m_eCrossoverType )
m_fInnerDirectionSign = m_bCrossingAxisHasReverseDirection ? 1 : -1;
else
@@ -360,10 +363,6 @@ void AxisProperties::init( bool bCartesian )
//init display labels
xProp->getPropertyValue( C2U( "DisplayLabels" ) ) >>= m_bDisplayLabels;
- //init categories
- ScaleData aScaleData = m_xAxisModel->getScaleData();
- m_nAxisType = aScaleData.AxisType;
-
//init TickmarkProperties
xProp->getPropertyValue( C2U( "MajorTickmarks" ) ) >>= m_nMajorTickmarks;
xProp->getPropertyValue( C2U( "MinorTickmarks" ) ) >>= m_nMinorTickmarks;
diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx
index 5b6bfe98f777..69e0edb82730 100644
--- a/chart2/source/view/axes/VAxisProperties.hxx
+++ b/chart2/source/view/axes/VAxisProperties.hxx
@@ -111,7 +111,6 @@ struct AxisProperties
bool m_bCrossingAxisHasReverseDirection;
bool m_bCrossingAxisIsCategoryAxes;
- bool m_bAxisBetweenCategories;
//this direction is used to indicate in which direction the labels are to be drawn
double m_fLabelDirectionSign;
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index c17e56ce6bc5..5a3ee4b78500 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -36,11 +36,12 @@
#include "macros.hxx"
#include "ViewDefines.hxx"
#include "PropertyMapper.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "LabelPositionHelper.hxx"
#include "TrueGuard.hxx"
#include "BaseGFXHelper.hxx"
#include "AxisHelper.hxx"
+#include "Tickmarks_Equidistant.hxx"
#include <rtl/math.hxx>
#include <tools/color.hxx>
@@ -178,7 +179,7 @@ void removeShapesAtWrongRhythm( TickIter& rIter
}
}
-class EquidistantLabelIterator : public EquidistantTickIter
+class LabelIterator : public TickIter
{
//this Iterator iterates over existing text labels
@@ -192,39 +193,36 @@ class EquidistantLabelIterator : public EquidistantTickIter
//we iterate through all labels
public:
- EquidistantLabelIterator( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ LabelIterator( ::std::vector< TickInfo >& rTickInfoVector
, const AxisLabelStaggering eAxisLabelStaggering
- , bool bInnerLine
- , sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 );
+ , bool bInnerLine );
virtual TickInfo* firstInfo();
virtual TickInfo* nextInfo();
private: //methods
- EquidistantLabelIterator();
+ LabelIterator();
private: //member
+ PureTickIter m_aPureTickIter;
const AxisLabelStaggering m_eAxisLabelStaggering;
- bool m_bInnerLine;
+ bool m_bInnerLine;
};
-EquidistantLabelIterator::EquidistantLabelIterator( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+LabelIterator::LabelIterator( ::std::vector< TickInfo >& rTickInfoVector
, const AxisLabelStaggering eAxisLabelStaggering
- , bool bInnerLine
- , sal_Int32 nMinDepth, sal_Int32 nMaxDepth )
- : EquidistantTickIter( rTickInfos, rIncrement, nMinDepth, nMaxDepth )
+ , bool bInnerLine )
+ : m_aPureTickIter( rTickInfoVector )
, m_eAxisLabelStaggering(eAxisLabelStaggering)
, m_bInnerLine(bInnerLine)
{
}
-TickInfo* EquidistantLabelIterator::firstInfo()
+TickInfo* LabelIterator::firstInfo()
{
- TickInfo* pTickInfo = EquidistantTickIter::firstInfo();
+ TickInfo* pTickInfo = m_aPureTickIter.firstInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() )
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
if(!pTickInfo)
return NULL;
if( (STAGGER_EVEN==m_eAxisLabelStaggering && m_bInnerLine)
@@ -234,7 +232,7 @@ TickInfo* EquidistantLabelIterator::firstInfo()
{
//skip first label
do
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() );
}
if(!pTickInfo)
@@ -242,12 +240,12 @@ TickInfo* EquidistantLabelIterator::firstInfo()
return pTickInfo;
}
-TickInfo* EquidistantLabelIterator::nextInfo()
+TickInfo* LabelIterator::nextInfo()
{
TickInfo* pTickInfo = NULL;
//get next label
do
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() );
if( STAGGER_EVEN==m_eAxisLabelStaggering
@@ -255,7 +253,7 @@ TickInfo* EquidistantLabelIterator::nextInfo()
{
//skip one label
do
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() );
}
return pTickInfo;
@@ -362,64 +360,61 @@ bool lcl_hasWordBreak( const Reference< drawing::XShape >& rxShape )
return false;
}
-class MaxLabelEquidistantTickIter : public EquidistantTickIter
+class MaxLabelTickIter : public TickIter
{
//iterate over first two and last two labels and the longest label
public:
- MaxLabelEquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ MaxLabelTickIter( ::std::vector< TickInfo >& rTickInfoVector
, sal_Int32 nLongestLabelIndex );
- virtual ~MaxLabelEquidistantTickIter();
+ virtual ~MaxLabelTickIter();
- virtual TickInfo* nextInfo();
+ virtual TickInfo* firstInfo();
+ virtual TickInfo* nextInfo();
private:
- sal_Int32 m_nLongestLabelIndex;
+ ::std::vector< TickInfo >& m_rTickInfoVector;
+ ::std::vector< sal_Int32 > m_aValidIndices;
+ sal_Int32 m_nCurrentIndex;
};
-MaxLabelEquidistantTickIter::MaxLabelEquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+MaxLabelTickIter::MaxLabelTickIter( ::std::vector< TickInfo >& rTickInfoVector
, sal_Int32 nLongestLabelIndex )
- : EquidistantTickIter( rTickInfos, rIncrement, 0//nMinDepth
- , 0//nMaxDepth
- )
- , m_nLongestLabelIndex( nLongestLabelIndex )
+ : m_rTickInfoVector(rTickInfoVector)
+ , m_nCurrentIndex(0)
{
- sal_Int32 nMaxIndex = getMaxIndex();
-
- //ensure correct value:
- if( m_nLongestLabelIndex<0 || m_nLongestLabelIndex>nMaxIndex)
- m_nLongestLabelIndex = 0;
-
- //last label is checked anyhow
- if( m_nLongestLabelIndex==nMaxIndex )
- m_nLongestLabelIndex = 0;
- //label before last is checked anyhow
- if( m_nLongestLabelIndex+1==nMaxIndex )
- m_nLongestLabelIndex = 0;
+ sal_Int32 nMaxIndex = m_rTickInfoVector.size()-1;
+ if( nLongestLabelIndex<0 || nLongestLabelIndex>=nMaxIndex-1 )
+ nLongestLabelIndex = 0;
+
+ if( nMaxIndex>=0 )
+ m_aValidIndices.push_back(0);
+ if( nMaxIndex>=1 )
+ m_aValidIndices.push_back(1);
+ if( nLongestLabelIndex>1 )
+ m_aValidIndices.push_back(nLongestLabelIndex);
+ if( nMaxIndex > 2 )
+ m_aValidIndices.push_back(nMaxIndex-1);
+ if( nMaxIndex > 1 )
+ m_aValidIndices.push_back(nMaxIndex);
}
-MaxLabelEquidistantTickIter::~MaxLabelEquidistantTickIter()
+MaxLabelTickIter::~MaxLabelTickIter()
{
}
-TickInfo* MaxLabelEquidistantTickIter::nextInfo()
+TickInfo* MaxLabelTickIter::firstInfo()
{
- sal_Int32 nCurrentPos = getCurrentIndex();
- sal_Int32 nMaxIndex = getMaxIndex();
- if( nCurrentPos>0 )
- {
- if( m_nLongestLabelIndex>1 && nCurrentPos<m_nLongestLabelIndex )
- gotoIndex( m_nLongestLabelIndex-1 ) ;
- else
- {
- if( nMaxIndex>3 && nCurrentPos<nMaxIndex-1 )
- gotoIndex( nMaxIndex-2 );
- else if( nMaxIndex>2 && nCurrentPos<nMaxIndex )
- gotoIndex( nMaxIndex-1 );
- }
- }
+ m_nCurrentIndex = 0;
+ if( m_nCurrentIndex < static_cast<sal_Int32>(m_aValidIndices.size()) )
+ return &m_rTickInfoVector[m_aValidIndices[m_nCurrentIndex]];
+ return 0;
+}
- return EquidistantTickIter::nextInfo();
+TickInfo* MaxLabelTickIter::nextInfo()
+{
+ m_nCurrentIndex++;
+ if( m_nCurrentIndex>=0 && m_nCurrentIndex<static_cast<sal_Int32>(m_aValidIndices.size()) )
+ return &m_rTickInfoVector[m_aValidIndices[m_nCurrentIndex]];
+ return 0;
}
bool VCartesianAxis::isBreakOfLabelsAllowed( const AxisLabelProperties& rAxisLabelProperties
@@ -489,27 +484,27 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
std::vector< ComplexCategory >::const_iterator aEnd(aComplexCategories.end());
for(;aIt!=aEnd;++aIt)
{
- TickInfo aTickInfo;
+ TickInfo aTickInfo(0);
ComplexCategory aCat(*aIt);
sal_Int32 nCount = aCat.Count;
- if( nCatIndex + 0.5 + nCount >= m_aScale.Maximum )
+ if( nCatIndex + 1.0 + nCount >= m_aScale.Maximum )
{
- nCount = static_cast<sal_Int32>(m_aScale.Maximum - 0.5 - nCatIndex);
+ nCount = static_cast<sal_Int32>(m_aScale.Maximum - 1.0 - nCatIndex);
if( nCount <= 0 )
nCount = 1;
}
- aTickInfo.fScaledTickValue = nCatIndex + 0.5 + nCount/2.0;
+ aTickInfo.fScaledTickValue = nCatIndex + 1.0 + nCount/2.0;
aTickInfo.nFactorForLimitedTextWidth = nCount;
aTickInfo.aText = aCat.Text;
aTickInfoVector.push_back(aTickInfo);
nCatIndex += nCount;
- if( nCatIndex + 0.5 >= m_aScale.Maximum )
+ if( nCatIndex + 1.0 >= m_aScale.Maximum )
break;
}
rAllTickInfos.push_back(aTickInfoVector);
}
}
- else //bShiftedPosition==true
+ else //bShiftedPosition==false
{
rAllTickInfos.clear();
sal_Int32 nLevel=0;
@@ -523,19 +518,19 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
std::vector< ComplexCategory >::const_iterator aEnd(aComplexCategories.end());
for(;aIt!=aEnd;++aIt)
{
- TickInfo aTickInfo;
+ TickInfo aTickInfo(0);
ComplexCategory aCat(*aIt);
- aTickInfo.fScaledTickValue = nCatIndex + 0.5;
+ aTickInfo.fScaledTickValue = nCatIndex + 1.0;
aTickInfoVector.push_back(aTickInfo);
nCatIndex += aCat.Count;
- if( nCatIndex + 0.5 > m_aScale.Maximum )
+ if( nCatIndex + 1.0 > m_aScale.Maximum )
break;
}
//fill up with single ticks until maximum scale
- while( nCatIndex + 0.5 < m_aScale.Maximum )
+ while( nCatIndex + 1.0 < m_aScale.Maximum )
{
- TickInfo aTickInfo;
- aTickInfo.fScaledTickValue = nCatIndex + 0.5;
+ TickInfo aTickInfo(0);
+ aTickInfo.fScaledTickValue = nCatIndex + 1.0;
aTickInfoVector.push_back(aTickInfo);
nCatIndex ++;
if( nLevel>0 )
@@ -543,7 +538,7 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
}
//add an additional tick at the end
{
- TickInfo aTickInfo;
+ TickInfo aTickInfo(0);
aTickInfo.fScaledTickValue = m_aScale.Maximum;
aTickInfoVector.push_back(aTickInfo);
}
@@ -554,7 +549,7 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos )
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
createAllTickInfosFromComplexCategories( rAllTickInfos, false );
else
VAxisBase::createAllTickInfos(rAllTickInfos);
@@ -562,21 +557,13 @@ void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo
::std::auto_ptr< TickIter > VCartesianAxis::createLabelTickIterator( sal_Int32 nTextLevel )
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
- {
- if( nTextLevel>=0 && nTextLevel < static_cast< sal_Int32 >(m_aAllTickInfos.size()) )
- return ::std::auto_ptr< TickIter >( new PureTickIter( m_aAllTickInfos[nTextLevel] ) );
- }
- else
- {
- if(nTextLevel==0)
- return ::std::auto_ptr< TickIter >( new EquidistantTickIter( m_aAllTickInfos, m_aIncrement, 0, 0 ) );
- }
+ if( nTextLevel>=0 && nTextLevel < static_cast< sal_Int32 >(m_aAllTickInfos.size()) )
+ return ::std::auto_ptr< TickIter >( new PureTickIter( m_aAllTickInfos[nTextLevel] ) );
return ::std::auto_ptr< TickIter >();
}
::std::auto_ptr< TickIter > VCartesianAxis::createMaximumLabelTickIterator( sal_Int32 nTextLevel )
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() || isDateAxis() )
{
return createLabelTickIterator( nTextLevel ); //mmmm maybe todo: create less than all texts here
}
@@ -584,8 +571,11 @@ void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo
{
if(nTextLevel==0)
{
- sal_Int32 nLongestLabelIndex = m_bUseTextLabels ? this->getIndexOfLongestLabel( m_aTextLabels ) : 0;
- return ::std::auto_ptr< TickIter >( new MaxLabelEquidistantTickIter( m_aAllTickInfos, m_aIncrement, nLongestLabelIndex ) );
+ if( !m_aAllTickInfos.empty() )
+ {
+ sal_Int32 nLongestLabelIndex = m_bUseTextLabels ? this->getIndexOfLongestLabel( m_aTextLabels ) : 0;
+ return ::std::auto_ptr< TickIter >( new MaxLabelTickIter( m_aAllTickInfos[0], nLongestLabelIndex ) );
+ }
}
}
return ::std::auto_ptr< TickIter >();
@@ -594,7 +584,7 @@ void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo
sal_Int32 VCartesianAxis::getTextLevelCount() const
{
sal_Int32 nTextLevelCount = 1;
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
nTextLevelCount = m_aAxisProperties.m_pExplicitCategoriesProvider->getCategoryLevelCount();
return nTextLevelCount;
}
@@ -603,7 +593,7 @@ bool VCartesianAxis::createTextShapes(
const Reference< drawing::XShapes >& xTarget
, TickIter& rTickIter
, AxisLabelProperties& rAxisLabelProperties
- , TickmarkHelper_2D* pTickmarkHelper
+ , TickFactory_2D* pTickFactory
, sal_Int32 nScreenDistanceBetweenTicks )
{
//returns true if the text shapes have been created succesfully
@@ -617,10 +607,10 @@ bool VCartesianAxis::createTextShapes(
FixedNumberFormatter aFixedNumberFormatter(
m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey );
- const bool bIsHorizontalAxis = pTickmarkHelper->isHorizontalAxis();
- const bool bIsVerticalAxis = pTickmarkHelper->isVerticalAxis();
+ const bool bIsHorizontalAxis = pTickFactory->isHorizontalAxis();
+ const bool bIsVerticalAxis = pTickFactory->isVerticalAxis();
bool bIsStaggered = rAxisLabelProperties.getIsStaggered();
- B2DVector aTextToTickDistance( pTickmarkHelper->getDistanceAxisTickToText( m_aAxisProperties, true ) );
+ B2DVector aTextToTickDistance( pTickFactory->getDistanceAxisTickToText( m_aAxisProperties, true ) );
sal_Int32 nLimitedSpaceForText = -1;
if( isBreakOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis ) )
{
@@ -716,7 +706,7 @@ bool VCartesianAxis::createTextShapes(
}
}
- pTickInfo->updateUnscaledValue( xInverseScaling );
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
bool bHasExtraColor=false;
sal_Int32 nExtraColor=0;
@@ -724,7 +714,7 @@ bool VCartesianAxis::createTextShapes(
rtl::OUString aLabel;
if(pCategories)
{
- sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->fUnscaledTickValue) - 1; //first category (index 0) matches with real number 1.0
+ sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->getUnscaledTickValue()) - 1; //first category (index 0) matches with real number 1.0
if( nIndex>=0 && nIndex<pCategories->getLength() )
aLabel = (*pCategories)[nIndex];
}
@@ -733,7 +723,7 @@ bool VCartesianAxis::createTextShapes(
aLabel = pTickInfo->aText;
}
else
- aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->fUnscaledTickValue, nExtraColor, bHasExtraColor );
+ aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->getUnscaledTickValue(), nExtraColor, bHasExtraColor );
if(pColorAny)
*pColorAny = uno::makeAny(bHasExtraColor?nExtraColor:nColor);
@@ -1245,12 +1235,12 @@ void VCartesianAxis::get2DAxisMainLine( B2DVector& rStart, B2DVector& rEnd, doub
}
}
-TickmarkHelper* VCartesianAxis::createTickmarkHelper()
+TickFactory* VCartesianAxis::createTickFactory()
{
- return createTickmarkHelper2D();
+ return createTickFactory2D();
}
-TickmarkHelper_2D* VCartesianAxis::createTickmarkHelper2D()
+TickFactory_2D* VCartesianAxis::createTickFactory2D()
{
B2DVector aStart, aEnd;
this->get2DAxisMainLine( aStart, aEnd, this->getLogicValueWhereMainLineCrossesOtherAxis() );
@@ -1258,7 +1248,7 @@ TickmarkHelper_2D* VCartesianAxis::createTickmarkHelper2D()
B2DVector aLabelLineStart, aLabelLineEnd;
this->get2DAxisMainLine( aLabelLineStart, aLabelLineEnd, this->getLogicValueWhereLabelLineCrossesOtherAxis() );
- return new TickmarkHelper_2D( m_aScale, m_aIncrement, aStart, aEnd, aLabelLineStart-aStart );
+ return new TickFactory_2D( m_aScale, m_aIncrement, aStart, aEnd, aLabelLineStart-aStart );
}
void lcl_hideIdenticalScreenValues( TickIter& rTickIter )
@@ -1282,7 +1272,7 @@ void lcl_hideIdenticalScreenValues( TickIter& rTickIter )
//'hide' tickmarks with identical screen values in aAllTickInfos
void VCartesianAxis::hideIdenticalScreenValues( ::std::vector< ::std::vector< TickInfo > >& rTickInfos ) const
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() || isDateAxis() )
{
sal_Int32 nCount = rTickInfos.size();
for( sal_Int32 nN=0; nN<nCount; nN++ )
@@ -1328,12 +1318,12 @@ sal_Int32 VCartesianAxis::estimateMaximumAutoMainIncrementCount()
return nRet;
}
-void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabelProperties, TickmarkHelper_2D* pTickmarkHelper2D )
+void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabelProperties, TickFactory_2D* pTickFactory2D )
{
- if( !pTickmarkHelper2D )
+ if( !pTickFactory2D )
return;
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
{
sal_Int32 nTextLevelCount = getTextLevelCount();
B2DVector aCummulatedLabelsDistance(0,0);
@@ -1349,25 +1339,26 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel
fRotationAngleDegree = 0.0;
}
aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get()
- , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties )
+ , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties )
, fRotationAngleDegree );
}
}
}
else if( rAxisLabelProperties.getIsStaggered() )
{
- EquidistantLabelIterator aInnerIter( m_aAllTickInfos, m_aIncrement
- , rAxisLabelProperties.eStaggering, true, 0, 0 );
- EquidistantLabelIterator aOuterIter( m_aAllTickInfos, m_aIncrement
- , rAxisLabelProperties.eStaggering, false, 0, 0 );
-
- lcl_shiftLables( aOuterIter
- , lcl_getLabelsDistance( aInnerIter
- , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties ), 0.0 ) );
+ if( !m_aAllTickInfos.empty() )
+ {
+ LabelIterator aInnerIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, true );
+ LabelIterator aOuterIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, false );
+
+ lcl_shiftLables( aOuterIter
+ , lcl_getLabelsDistance( aInnerIter
+ , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties ), 0.0 ) );
+ }
}
}
-void SAL_CALL VCartesianAxis::createLabels()
+void VCartesianAxis::createLabels()
{
if( !prepareShapeCreation() )
return;
@@ -1376,14 +1367,14 @@ void SAL_CALL VCartesianAxis::createLabels()
//create labels
if( m_aAxisProperties.m_bDisplayLabels )
{
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
//get the transformed screen values for all tickmarks in aAllTickInfos
- pTickmarkHelper2D->updateScreenValues( m_aAllTickInfos );
+ pTickFactory2D->updateScreenValues( m_aAllTickInfos );
//-----------------------------------------
//'hide' tickmarks with identical screen values in aAllTickInfos
hideIdenticalScreenValues( m_aAllTickInfos );
@@ -1400,7 +1391,7 @@ void SAL_CALL VCartesianAxis::createLabels()
{
if(nTextLevel==0)
{
- nScreenDistanceBetweenTicks = TickmarkHelper_2D::getTickScreenDistance( *apTickIter.get() );
+ nScreenDistanceBetweenTicks = TickFactory_2D::getTickScreenDistance( *apTickIter.get() );
if( nTextLevelCount>1 )
nScreenDistanceBetweenTicks*=2; //the above used tick iter does contain also the sub ticks -> thus the given distance is only the half
}
@@ -1422,16 +1413,16 @@ void SAL_CALL VCartesianAxis::createLabels()
}
}
AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties;
- while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickmarkHelper2D, nScreenDistanceBetweenTicks ) )
+ while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickFactory2D, nScreenDistanceBetweenTicks ) )
{
};
}
}
- doStaggeringOfLabels( m_aAxisLabelProperties, pTickmarkHelper2D );
+ doStaggeringOfLabels( m_aAxisLabelProperties, pTickFactory2D );
}
}
-void SAL_CALL VCartesianAxis::createMaximumLabels()
+void VCartesianAxis::createMaximumLabels()
{
TrueGuard aRecordMaximumTextSize(m_bRecordMaximumTextSize);
@@ -1442,20 +1433,20 @@ void SAL_CALL VCartesianAxis::createMaximumLabels()
//create labels
if( m_aAxisProperties.m_bDisplayLabels )
{
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
//get the transformed screen values for all tickmarks in aAllTickInfos
- pTickmarkHelper2D->updateScreenValues( m_aAllTickInfos );
+ pTickFactory2D->updateScreenValues( m_aAllTickInfos );
//create tick mark text shapes
//@todo: iterate through all tick depth wich should be labeled
AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties );
- if( isAutoStaggeringOfLabelsAllowed( aAxisLabelProperties, pTickmarkHelper2D->isHorizontalAxis(), pTickmarkHelper2D->isVerticalAxis() ) )
+ if( isAutoStaggeringOfLabelsAllowed( aAxisLabelProperties, pTickFactory2D->isHorizontalAxis(), pTickFactory2D->isVerticalAxis() ) )
aAxisLabelProperties.eStaggering = STAGGER_EVEN;
aAxisLabelProperties.bOverlapAllowed = true;
aAxisLabelProperties.bLineBreakAllowed = false;
@@ -1465,29 +1456,29 @@ void SAL_CALL VCartesianAxis::createMaximumLabels()
::std::auto_ptr< TickIter > apTickIter = createMaximumLabelTickIterator( nTextLevel );
if(apTickIter.get())
{
- while( !createTextShapes( m_xTextTarget, *apTickIter.get(), aAxisLabelProperties, pTickmarkHelper2D, -1 ) )
+ while( !createTextShapes( m_xTextTarget, *apTickIter.get(), aAxisLabelProperties, pTickFactory2D, -1 ) )
{
};
}
}
- doStaggeringOfLabels( aAxisLabelProperties, pTickmarkHelper2D );
+ doStaggeringOfLabels( aAxisLabelProperties, pTickFactory2D );
}
}
-void SAL_CALL VCartesianAxis::updatePositions()
+void VCartesianAxis::updatePositions()
{
//-----------------------------------------
//update positions of labels
if( m_aAxisProperties.m_bDisplayLabels )
{
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
//update positions of all existing text shapes
- pTickmarkHelper2D->updateScreenValues( m_aAllTickInfos );
+ pTickFactory2D->updateScreenValues( m_aAllTickInfos );
::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = m_aAllTickInfos.begin();
const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = m_aAllTickInfos.end();
@@ -1501,7 +1492,7 @@ void SAL_CALL VCartesianAxis::updatePositions()
Reference< drawing::XShape > xShape2DText( rTickInfo.xTextShape );
if( xShape2DText.is() )
{
- B2DVector aTextToTickDistance( pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, true ) );
+ B2DVector aTextToTickDistance( pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, true ) );
B2DVector aTickScreenPos2D( rTickInfo.aTickScreenPosition );
aTickScreenPos2D += aTextToTickDistance;
awt::Point aAnchorScreenPosition2D(
@@ -1537,11 +1528,11 @@ void SAL_CALL VCartesianAxis::updatePositions()
}
}
- doStaggeringOfLabels( m_aAxisLabelProperties, pTickmarkHelper2D );
+ doStaggeringOfLabels( m_aAxisLabelProperties, pTickFactory2D );
}
}
-void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickmarkHelper_2D& rTickmarkHelper2D, bool bOnlyAtLabels )
+void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickFactory_2D& rTickFactory2D, bool bOnlyAtLabels )
{
sal_Int32 nPointCount = rTickInfos.size();
drawing::PointSequenceSequence aPoints(2*nPointCount);
@@ -1560,11 +1551,11 @@ void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickI
fInnerDirectionSign *= -1.0;
bTicksAtLabels = bTicksAtLabels || bOnlyAtLabels;
//add ticks at labels:
- rTickmarkHelper2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
+ rTickFactory2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
, fInnerDirectionSign , rTickmarkProperties, bTicksAtLabels );
//add ticks at axis (without lables):
if( !bOnlyAtLabels && m_aAxisProperties.m_eTickmarkPos == ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS )
- rTickmarkHelper2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
+ rTickFactory2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
, m_aAxisProperties.m_fInnerDirectionSign, rTickmarkProperties, !bTicksAtLabels );
}
aPoints.realloc(nN);
@@ -1572,14 +1563,14 @@ void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickI
, &rTickmarkProperties.aLineProperties );
}
-void SAL_CALL VCartesianAxis::createShapes()
+void VCartesianAxis::createShapes()
{
if( !prepareShapeCreation() )
return;
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
@@ -1588,16 +1579,16 @@ void SAL_CALL VCartesianAxis::createShapes()
{
//-----------------------------------------
//create extra long ticks to separate complex categories (create them only there where the labels are)
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
{
::std::vector< ::std::vector< TickInfo > > aComplexTickInfos;
createAllTickInfosFromComplexCategories( aComplexTickInfos, true );
- pTickmarkHelper2D->updateScreenValues( aComplexTickInfos );
+ pTickFactory2D->updateScreenValues( aComplexTickInfos );
hideIdenticalScreenValues( aComplexTickInfos );
::std::vector<TickmarkProperties> aTickmarkPropertiesList;
static bool bIncludeSpaceBetweenTickAndText = false;
- sal_Int32 nOffset = static_cast<sal_Int32>(pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false, bIncludeSpaceBetweenTickAndText ).getLength());
+ sal_Int32 nOffset = static_cast<sal_Int32>(pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false, bIncludeSpaceBetweenTickAndText ).getLength());
sal_Int32 nTextLevelCount = getTextLevelCount();
for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ )
{
@@ -1607,7 +1598,7 @@ void SAL_CALL VCartesianAxis::createShapes()
double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
if( nTextLevel>0 )
fRotationAngleDegree = 0.0;
- B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false ), fRotationAngleDegree ) );
+ B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false ), fRotationAngleDegree ) );
sal_Int32 nCurrentLength = static_cast<sal_Int32>(aLabelsDistance.getLength());
aTickmarkPropertiesList.push_back( m_aAxisProperties.makeTickmarkPropertiesForComplexCategories( nOffset + nCurrentLength, 0, nTextLevel ) );
nOffset += nCurrentLength;
@@ -1621,20 +1612,20 @@ void SAL_CALL VCartesianAxis::createShapes()
{
if(nDepth==0 && !m_aAxisProperties.m_nMajorTickmarks)
continue;
- createTickMarkLineShapes( *aDepthIter, aTickmarkPropertiesList[nDepth], *pTickmarkHelper2D, true /*bOnlyAtLabels*/ );
+ createTickMarkLineShapes( *aDepthIter, aTickmarkPropertiesList[nDepth], *pTickFactory2D, true /*bOnlyAtLabels*/ );
}
}
//-----------------------------------------
//create normal ticks for major and minor intervals
{
- ::std::vector< ::std::vector< TickInfo > > aAllShiftedTickInfos;
- if( m_aIncrement.ShiftedPosition || ( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels ) )
+ ::std::vector< ::std::vector< TickInfo > > aUnshiftedTickInfos;
+ if( m_aScale.ShiftedCategoryPosition )// if ShiftedCategoryPosition==true the tickmarks in m_aAllTickInfos are shifted
{
- pTickmarkHelper2D->getAllTicksShifted( aAllShiftedTickInfos );
- pTickmarkHelper2D->updateScreenValues( aAllShiftedTickInfos );
- hideIdenticalScreenValues( aAllShiftedTickInfos );
+ pTickFactory2D->getAllTicks( aUnshiftedTickInfos );
+ pTickFactory2D->updateScreenValues( aUnshiftedTickInfos );
+ hideIdenticalScreenValues( aUnshiftedTickInfos );
}
- ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos = m_aIncrement.ShiftedPosition ? aAllShiftedTickInfos : m_aAllTickInfos;
+ ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos = m_aScale.ShiftedCategoryPosition ? aUnshiftedTickInfos : m_aAllTickInfos;
::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = rAllTickInfos.begin();
const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = rAllTickInfos.end();
@@ -1643,14 +1634,14 @@ void SAL_CALL VCartesianAxis::createShapes()
sal_Int32 nTickmarkPropertiesCount = m_aAxisProperties.m_aTickmarkPropertiesList.size();
for( sal_Int32 nDepth=0; aDepthIter != aDepthEnd && nDepth < nTickmarkPropertiesCount; aDepthIter++, nDepth++ )
- createTickMarkLineShapes( *aDepthIter, m_aAxisProperties.m_aTickmarkPropertiesList[nDepth], *pTickmarkHelper2D, false /*bOnlyAtLabels*/ );
+ createTickMarkLineShapes( *aDepthIter, m_aAxisProperties.m_aTickmarkPropertiesList[nDepth], *pTickFactory2D, false /*bOnlyAtLabels*/ );
}
//-----------------------------------------
//create axis main lines
//it serves also as the handle shape for the axis selection
{
drawing::PointSequenceSequence aPoints(1);
- apTickmarkHelper2D->createPointSequenceForAxisMainLine( aPoints );
+ apTickFactory2D->createPointSequenceForAxisMainLine( aPoints );
Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D(
m_xGroupShape_Shapes, aPoints
, &m_aAxisProperties.m_aLineProperties );
diff --git a/chart2/source/view/axes/VCartesianAxis.hxx b/chart2/source/view/axes/VCartesianAxis.hxx
index 4fbcd2409196..d199a112bab1 100644
--- a/chart2/source/view/axes/VCartesianAxis.hxx
+++ b/chart2/source/view/axes/VCartesianAxis.hxx
@@ -55,20 +55,11 @@ public:
virtual ~VCartesianAxis();
- //-------------------------------------------------------------------------
- // partly chart2::XPlotter
- //-------------------------------------------------------------------------
-
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
- virtual void SAL_CALL createMaximumLabels();
- virtual void SAL_CALL createLabels();
- virtual void SAL_CALL updatePositions();
+ virtual void createMaximumLabels();
+ virtual void createLabels();
+ virtual void updatePositions();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
virtual void createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos );
@@ -79,7 +70,7 @@ public:
sal_Int32 getTextLevelCount() const;
//-------------------------------------------------------------------------
- virtual TickmarkHelper* createTickmarkHelper();
+ virtual TickFactory* createTickFactory();
//-------------------------------------------------------------------------
double getLogicValueWhereMainLineCrossesOtherAxis() const;
@@ -122,16 +113,16 @@ protected: //methods
::com::sun::star::drawing::XShapes >& xTarget
, TickIter& rTickIter
, AxisLabelProperties& rAxisLabelProperties
- , TickmarkHelper_2D* pTickmarkHelper
+ , TickFactory_2D* pTickFactory
, sal_Int32 nScreenDistanceBetweenTicks );
- void createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickmarkHelper_2D& rTickmarkHelper2D, bool bOnlyAtLabels );
+ void createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickFactory_2D& rTickFactory2D, bool bOnlyAtLabels );
- TickmarkHelper_2D* createTickmarkHelper2D();
+ TickFactory_2D* createTickFactory2D();
void hideIdenticalScreenValues( ::std::vector< ::std::vector< TickInfo > >& rTickInfos ) const;
void doStaggeringOfLabels( const AxisLabelProperties& rAxisLabelProperties
- , TickmarkHelper_2D* pTickmarkHelper2D );
+ , TickFactory_2D* pTickFactory2D );
bool isAutoStaggeringOfLabelsAllowed( const AxisLabelProperties& rAxisLabelProperties
, bool bIsHorizontalAxis, bool bIsVerticalAxis );
bool isBreakOfLabelsAllowed( const AxisLabelProperties& rAxisLabelProperties, bool bIsHorizontalAxis );
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
index a196397e0e9f..ca83850a88ff 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
@@ -151,11 +151,7 @@ void VCartesianCoordinateSystem::createVAxisList(
aAxisProperties.m_bCrossingAxisHasReverseDirection = (AxisOrientation_REVERSE==aCrossingScale.Orientation);
if( aCrossingScale.AxisType == AxisType::CATEGORY )
- {
aAxisProperties.m_bCrossingAxisIsCategoryAxes = true;
- aAxisProperties.m_bAxisBetweenCategories = ChartTypeHelper::shiftTicksAtXAxisPerDefault( AxisHelper::getChartTypeByIndex( m_xCooSysModel, 0 ) )
- || ( aAxisProperties.m_pExplicitCategoriesProvider && aAxisProperties.m_pExplicitCategoriesProvider->hasComplexCategories() );
- }
}
if( nDimensionIndex == 2 )
@@ -169,25 +165,12 @@ void VCartesianCoordinateSystem::createVAxisList(
aAxisProperties.init(true);
if(aAxisProperties.m_bDisplayLabels)
aAxisProperties.m_nNumberFormatKey = this->getNumberFormatKeyForAxis( xAxis, xNumberFormatsSupplier );
-
- if( nDimensionIndex == 0 && aAxisProperties.m_nAxisType == AxisType::CATEGORY
- && aAxisProperties.m_pExplicitCategoriesProvider )
- {
- if( aAxisProperties.m_pExplicitCategoriesProvider->hasComplexCategories() )
- aAxisProperties.m_bComplexCategories = true;
- }
//-------------------
::boost::shared_ptr< VAxisBase > apVAxis( new VCartesianAxis(aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount) );
tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex );
m_aAxisMap[aFullAxisIndex] = apVAxis;
apVAxis->set3DWallPositions( m_eLeftWallPos, m_eBackWallPos, m_eBottomPos );
- //apVAxis->setExplicitScaleAndIncrement( this->getExplicitScale( nDimensionIndex, nAxisIndex ), this->getExplicitIncrement( nDimensionIndex, nAxisIndex ) );
- //apVAxis->initPlotter(m_xLogicTargetForAxes,m_xFinalTarget,m_xShapeFactory
- // , this->createCIDForAxis( xAxis, nDimensionIndex, nAxisIndex ) );
- //if(2==nDimensionCount)
- // apVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
- //apVAxis->setScales( this->getExplicitScales(nDimensionIndex,nAxisIndex), bSwapXAndY );
apVAxis->initAxisLabelProperties(rFontReferenceSize,rMaximumSpaceForLabels);
}
}
diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx
index 18b8942b6787..ff93feefa228 100644
--- a/chart2/source/view/axes/VCartesianGrid.cxx
+++ b/chart2/source/view/axes/VCartesianGrid.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#include "VCartesianGrid.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "PlottingPositionHelper.hxx"
#include "ShapeFactory.hxx"
#include "ObjectIdentifier.hxx"
@@ -210,7 +210,7 @@ void VCartesianGrid::fillLinePropertiesFromGridModel( ::std::vector<VLinePropert
}
};
-void SAL_CALL VCartesianGrid::createShapes()
+void VCartesianGrid::createShapes()
{
if(!m_aGridPropertiesList.getLength())
return;
@@ -230,13 +230,10 @@ void SAL_CALL VCartesianGrid::createShapes()
//-----------------------------------------
//create all scaled tickmark values
- std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() );
- TickmarkHelper& aTickmarkHelper = *apTickmarkHelper.get();
+ std::auto_ptr< TickFactory > apTickFactory( this->createTickFactory() );
+ TickFactory& aTickFactory = *apTickFactory.get();
::std::vector< ::std::vector< TickInfo > > aAllTickInfos;
- if( m_aIncrement.ShiftedPosition )
- aTickmarkHelper.getAllTicksShifted( aAllTickInfos );
- else
- aTickmarkHelper.getAllTicks( aAllTickInfos );
+ aTickFactory.getAllTicks( aAllTickInfos );
//-----------------------------------------
//create tick mark line shapes
diff --git a/chart2/source/view/axes/VCartesianGrid.hxx b/chart2/source/view/axes/VCartesianGrid.hxx
index 274b543900e3..0a0f8b91716f 100644
--- a/chart2/source/view/axes/VCartesianGrid.hxx
+++ b/chart2/source/view/axes/VCartesianGrid.hxx
@@ -52,7 +52,7 @@ public:
);
virtual ~VCartesianGrid();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
static void fillLinePropertiesFromGridModel( ::std::vector<VLineProperties>& rLinePropertiesList
, const ::com::sun::star::uno::Sequence<
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx
index b61a58cd2238..42e6042d7e70 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -97,8 +97,8 @@ VCoordinateSystem::VCoordinateSystem( const Reference< XCoordinateSystem >& xCoo
{
if( !m_xCooSysModel.is() || m_xCooSysModel->getDimension()<3 )
{
- m_aExplicitScales[2].Minimum = -0.5;
- m_aExplicitScales[2].Maximum = 0.5;
+ m_aExplicitScales[2].Minimum = 1.0;
+ m_aExplicitScales[2].Maximum = 2.0;
m_aExplicitScales[2].Orientation = AxisOrientation_MATHEMATICAL;
}
}
@@ -106,7 +106,7 @@ VCoordinateSystem::~VCoordinateSystem()
{
}
-void SAL_CALL VCoordinateSystem::initPlottingTargets( const Reference< drawing::XShapes >& xLogicTarget
+void VCoordinateSystem::initPlottingTargets( const Reference< drawing::XShapes >& xLogicTarget
, const Reference< drawing::XShapes >& xFinalTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory
, Reference< drawing::XShapes >& xLogicTargetForSeriesBehindAxis )
@@ -270,9 +270,9 @@ ExplicitCategoriesProvider* VCoordinateSystem::getExplicitCategoriesProvider()
return m_apExplicitCategoriesProvider.get();
}
-Sequence< ExplicitScaleData > VCoordinateSystem::getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
+std::vector< ExplicitScaleData > VCoordinateSystem::getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
{
- Sequence< ExplicitScaleData > aRet(m_aExplicitScales);
+ std::vector< ExplicitScaleData > aRet(m_aExplicitScales);
impl_adjustDimensionAndIndex( nDimensionIndex, nAxisIndex );
aRet[nDimensionIndex]=this->getExplicitScale( nDimensionIndex, nAxisIndex );
@@ -280,9 +280,9 @@ Sequence< ExplicitScaleData > VCoordinateSystem::getExplicitScales( sal_Int32 nD
return aRet;
}
-Sequence< ExplicitIncrementData > VCoordinateSystem::getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
+std::vector< ExplicitIncrementData > VCoordinateSystem::getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
{
- Sequence< ExplicitIncrementData > aRet(m_aExplicitIncrements);
+ std::vector< ExplicitIncrementData > aRet(m_aExplicitIncrements);
impl_adjustDimensionAndIndex( nDimensionIndex, nAxisIndex );
aRet[nDimensionIndex]=this->getExplicitIncrement( nDimensionIndex, nAxisIndex );
@@ -381,6 +381,17 @@ void VCoordinateSystem::updateScalesAndIncrementsOnAxes()
void VCoordinateSystem::prepareScaleAutomatismForDimensionAndIndex( ScaleAutomatism& rScaleAutomatism, sal_Int32 nDimIndex, sal_Int32 nAxisIndex )
{
+ if( rScaleAutomatism.getScale().AxisType==AxisType::DATE && nDimIndex==0 )
+ {
+ sal_Int32 nTimeResolution = ::com::sun::star::chart::TimeUnit::MONTH;
+ if( !(rScaleAutomatism.getScale().TimeIncrement.TimeResolution >>= nTimeResolution) )
+ {
+ nTimeResolution = m_aMergedMinimumAndMaximumSupplier.calculateTimeResolutionOnXAxis();
+ rScaleAutomatism.setAutomaticTimeResolution( nTimeResolution );
+ }
+ m_aMergedMinimumAndMaximumSupplier.setTimeResolutionOnXAxis( nTimeResolution, rScaleAutomatism.getNullDate() );
+ }
+
double fMin = 0.0;
double fMax = 0.0;
::rtl::math::setInf(&fMin, false);
@@ -402,11 +413,6 @@ void VCoordinateSystem::prepareScaleAutomatismForDimensionAndIndex( ScaleAutomat
fMax = m_aMergedMinimumAndMaximumSupplier.getMaximumZ();
}
- this->prepareScaleAutomatism( rScaleAutomatism, fMin, fMax, nDimIndex, nAxisIndex );
-}
-
-void VCoordinateSystem::prepareScaleAutomatism( ScaleAutomatism& rScaleAutomatism, double fMin, double fMax, sal_Int32 nDimIndex, sal_Int32 nAxisIndex )
-{
//merge our values with those already contained in rScaleAutomatism
rScaleAutomatism.expandValueRange( fMin, fMax );
diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx
index 865a7848aa9a..c23d6b95629d 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.cxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.cxx
@@ -33,7 +33,7 @@
#include "VPolarGrid.hxx"
#include "ShapeFactory.hxx"
#include "macros.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "PolarLabelPositionHelper.hxx"
#include <tools/color.hxx>
@@ -120,17 +120,17 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
rtl::OUString aLabel;
if(pLabels)
{
- sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->fUnscaledTickValue) - 1; //first category (index 0) matches with real number 1.0
+ sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->getUnscaledTickValue()) - 1; //first category (index 0) matches with real number 1.0
if( nIndex>=0 && nIndex<pLabels->getLength() )
aLabel = (*pLabels)[nIndex];
}
else
- aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->fUnscaledTickValue, nExtraColor, bHasExtraColor );
+ aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->getUnscaledTickValue(), nExtraColor, bHasExtraColor );
if(pColorAny)
*pColorAny = uno::makeAny(bHasExtraColor?nExtraColor:nColor);
- double fLogicAngle = pTickInfo->fUnscaledTickValue;
+ double fLogicAngle = pTickInfo->getUnscaledTickValue();
LabelAlignment eLabelAlignment(LABEL_ALIGN_CENTER);
PolarLabelPositionHelper aPolarLabelPositionHelper(m_pPosHelper,nDimensionCount,xTarget,&aShapeFactory);
@@ -154,7 +154,7 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
return true;
}
-void SAL_CALL VPolarAngleAxis::createMaximumLabels()
+void VPolarAngleAxis::createMaximumLabels()
{
if( !prepareShapeCreation() )
return;
@@ -162,7 +162,7 @@ void SAL_CALL VPolarAngleAxis::createMaximumLabels()
createLabels();
}
-void SAL_CALL VPolarAngleAxis::updatePositions()
+void VPolarAngleAxis::updatePositions()
{
//todo: really only update the positions
@@ -172,19 +172,19 @@ void SAL_CALL VPolarAngleAxis::updatePositions()
createLabels();
}
-void SAL_CALL VPolarAngleAxis::createLabels()
+void VPolarAngleAxis::createLabels()
{
if( !prepareShapeCreation() )
return;
double fLogicRadius = m_pPosHelper->getOuterLogicRadius();
- double fLogicZ = -0.5;//as defined
+ double fLogicZ = 1.0;//as defined
if( m_aAxisProperties.m_bDisplayLabels )
{
//-----------------------------------------
//get the transformed screen values for all tickmarks in aAllTickInfos
- std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() );
+ std::auto_ptr< TickFactory > apTickFactory( this->createTickFactory() );
//create tick mark text shapes
//@todo: iterate through all tick depth wich should be labeled
@@ -207,13 +207,13 @@ void SAL_CALL VPolarAngleAxis::createLabels()
}
}
-void SAL_CALL VPolarAngleAxis::createShapes()
+void VPolarAngleAxis::createShapes()
{
if( !prepareShapeCreation() )
return;
double fLogicRadius = m_pPosHelper->getOuterLogicRadius();
- double fLogicZ = -0.5;//as defined
+ double fLogicZ = 1.0;//as defined
//-----------------------------------------
//create axis main lines
diff --git a/chart2/source/view/axes/VPolarAngleAxis.hxx b/chart2/source/view/axes/VPolarAngleAxis.hxx
index c03cf533e22c..011033faaefa 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.hxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.hxx
@@ -28,6 +28,7 @@
#define _CHART2_VPOLARANGLEAXIS_HXX
#include "VPolarAxis.hxx"
+#include "Tickmarks_Equidistant.hxx"
//.............................................................................
namespace chart
@@ -46,11 +47,11 @@ public:
, sal_Int32 nDimensionCount );
virtual ~VPolarAngleAxis();
- virtual void SAL_CALL createMaximumLabels();
- virtual void SAL_CALL createLabels();
- virtual void SAL_CALL updatePositions();
+ virtual void createMaximumLabels();
+ virtual void createLabels();
+ virtual void updatePositions();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
private: //methods
bool createTextShapes_ForAngleAxis(
diff --git a/chart2/source/view/axes/VPolarAxis.cxx b/chart2/source/view/axes/VPolarAxis.cxx
index 23908585ec3a..5f818da6c959 100644
--- a/chart2/source/view/axes/VPolarAxis.cxx
+++ b/chart2/source/view/axes/VPolarAxis.cxx
@@ -31,7 +31,7 @@
#include "VPolarAngleAxis.hxx"
#include "VPolarRadiusAxis.hxx"
#include "macros.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "ShapeFactory.hxx"
#include <memory>
@@ -68,12 +68,12 @@ VPolarAxis::~VPolarAxis()
m_pPosHelper = NULL;
}
-void VPolarAxis::setIncrements( const uno::Sequence< ExplicitIncrementData >& rIncrements )
+void VPolarAxis::setIncrements( const std::vector< ExplicitIncrementData >& rIncrements )
{
m_aIncrements = rIncrements;
}
-sal_Bool SAL_CALL VPolarAxis::isAnythingToDraw()
+sal_Bool VPolarAxis::isAnythingToDraw()
{
return ( 2==m_nDimension && VAxisBase::isAnythingToDraw() );
}
diff --git a/chart2/source/view/axes/VPolarAxis.hxx b/chart2/source/view/axes/VPolarAxis.hxx
index 8d4c14188258..a72b338416e2 100644
--- a/chart2/source/view/axes/VPolarAxis.hxx
+++ b/chart2/source/view/axes/VPolarAxis.hxx
@@ -47,10 +47,9 @@ public:
, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier
, sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount );
- void setIncrements( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData >& rIncrements );
+ void setIncrements( const std::vector< ExplicitIncrementData >& rIncrements );
- virtual sal_Bool SAL_CALL isAnythingToDraw();
+ virtual sal_Bool isAnythingToDraw();
virtual ~VPolarAxis();
@@ -61,8 +60,7 @@ protected:
protected: //member
PolarPlottingPositionHelper* m_pPosHelper;
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData > m_aIncrements;
+ ::std::vector< ExplicitIncrementData > m_aIncrements;
};
//.............................................................................
diff --git a/chart2/source/view/axes/VPolarCoordinateSystem.cxx b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
index 76e057a2b32d..5d13f5c46f66 100644
--- a/chart2/source/view/axes/VPolarCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
@@ -107,15 +107,6 @@ void VPolarCoordinateSystem::createVAxisList(
tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex );
m_aAxisMap[aFullAxisIndex] = apVAxis;
- //apVAxis->setExplicitScaleAndIncrement( this->getExplicitScale( nDimensionIndex, nAxisIndex ), this->getExplicitIncrement(nDimensionIndex, nAxisIndex) );
- //apVAxis->initPlotter(m_xLogicTargetForAxes,m_xFinalTarget,m_xShapeFactory
- // , this->createCIDForAxis( xAxis, nDimensionIndex, nAxisIndex ) );
- //VPolarAxis* pVPolarAxis = dynamic_cast< VPolarAxis* >( apVAxis.get() );
- //if( pVPolarAxis )
- // pVPolarAxis->setIncrements( this->getExplicitIncrements( nDimensionIndex, nAxisIndex ) );
- //if(2==nDimensionCount)
- // apVAxis->setTransformationSceneToScreen( m_aMatrixSceneToScreen );
- //apVAxis->setScales( this->getExplicitScales( nDimensionIndex, nAxisIndex ), bSwapXAndY );
apVAxis->initAxisLabelProperties(rFontReferenceSize,rMaximumSpaceForLabels);
}
}
diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx
index b2172244f920..30becdf4725d 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -29,12 +29,13 @@
#include "precompiled_chart2.hxx"
#include "VPolarGrid.hxx"
#include "VCartesianGrid.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "PlottingPositionHelper.hxx"
#include "ShapeFactory.hxx"
#include "ObjectIdentifier.hxx"
#include "macros.hxx"
#include "CommonConverters.hxx"
+#include "Tickmarks_Equidistant.hxx"
#include <com/sun/star/drawing/LineStyle.hpp>
#include <vector>
@@ -64,16 +65,16 @@ VPolarGrid::~VPolarGrid()
m_pPosHelper = NULL;
}
-void VPolarGrid::setIncrements( const uno::Sequence< ExplicitIncrementData >& rIncrements )
+void VPolarGrid::setIncrements( const std::vector< ExplicitIncrementData >& rIncrements )
{
m_aIncrements = rIncrements;
}
void VPolarGrid::getAllTickInfos( sal_Int32 nDimensionIndex, ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
{
- TickmarkHelper aTickmarkHelper(
+ TickFactory aTickFactory(
m_pPosHelper->getScales()[nDimensionIndex], m_aIncrements[nDimensionIndex] );
- aTickmarkHelper.getAllTicks( rAllTickInfos );
+ aTickFactory.getAllTicks( rAllTickInfos );
}
void VPolarGrid::createLinePointSequence_ForAngleAxis(
@@ -97,8 +98,8 @@ void VPolarGrid::createLinePointSequence_ForAngleAxis(
if(nTick>=rPoints[0].getLength())
rPoints[0].realloc(rPoints[0].getLength()+30);
- pTickInfo->updateUnscaledValue( xInverseScaling );
- double fLogicAngle = pTickInfo->fUnscaledTickValue;
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
+ double fLogicAngle = pTickInfo->getUnscaledTickValue();
drawing::Position3D aScenePosition3D( pPosHelper->transformAngleRadiusToScene( fLogicAngle, fLogicRadius, fLogicZ ) );
rPoints[0][nTick].X = static_cast<sal_Int32>(aScenePosition3D.PositionX);
@@ -129,7 +130,7 @@ void VPolarGrid::create2DAngleGrid( const Reference< drawing::XShapes >& xLogicT
double fLogicInnerRadius = m_pPosHelper->getInnerLogicRadius();
double fLogicOuterRadius = m_pPosHelper->getOuterLogicRadius();
- double fLogicZ = -0.5;//as defined
+ double fLogicZ = 1.0;//as defined
sal_Int32 nLinePropertiesCount = rLinePropertiesList.size();
::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = rAngleTickInfos.begin();
@@ -152,8 +153,8 @@ void VPolarGrid::create2DAngleGrid( const Reference< drawing::XShapes >& xLogicT
if( !rTickInfo.bPaintIt )
continue;
- rTickInfo.updateUnscaledValue( xInverseScaling );
- double fLogicAngle = rTickInfo.fUnscaledTickValue;
+ //xxxxx rTickInfo.updateUnscaledValue( xInverseScaling );
+ double fLogicAngle = rTickInfo.getUnscaledTickValue();
drawing::PointSequenceSequence aPoints(1);
aPoints[0].realloc(2);
@@ -219,9 +220,9 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
if( !rTickInfo.bPaintIt )
continue;
- rTickInfo.updateUnscaledValue( xInverseRadiusScaling );
- double fLogicRadius = rTickInfo.fUnscaledTickValue;
- double fLogicZ = -0.5;//as defined
+ //xxxxx rTickInfo.updateUnscaledValue( xInverseRadiusScaling );
+ double fLogicRadius = rTickInfo.getUnscaledTickValue();
+ double fLogicZ = 1.0;//as defined
drawing::PointSequenceSequence aPoints(1);
VPolarGrid::createLinePointSequence_ForAngleAxis( aPoints, rAngleTickInfos
@@ -237,7 +238,7 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
}
}
-void SAL_CALL VPolarGrid::createShapes()
+void VPolarGrid::createShapes()
{
DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"Axis is not proper initialized");
if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()))
diff --git a/chart2/source/view/axes/VPolarGrid.hxx b/chart2/source/view/axes/VPolarGrid.hxx
index 3289d6c88be8..1ea3bccc1f90 100644
--- a/chart2/source/view/axes/VPolarGrid.hxx
+++ b/chart2/source/view/axes/VPolarGrid.hxx
@@ -28,7 +28,7 @@
#define _CHART2_VPOLARGRID_HXX
#include "VAxisOrGridBase.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "VLineProperties.hxx"
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
@@ -55,16 +55,15 @@ public:
);
virtual ~VPolarGrid();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
- void setIncrements( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData >& rIncrements );
+ void setIncrements( const std::vector< ExplicitIncrementData >& rIncrements );
static void createLinePointSequence_ForAngleAxis(
::com::sun::star::drawing::PointSequenceSequence& rPoints
, ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
- , const ::com::sun::star::chart2::ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement
+ , const ExplicitScaleData& rScale
, PolarPlottingPositionHelper* pPosHelper
, double fLogicRadius, double fLogicZ );
@@ -73,8 +72,7 @@ private: //member
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > > m_aGridPropertiesList;//main grid, subgrid, subsubgrid etc
PolarPlottingPositionHelper* m_pPosHelper;
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData > m_aIncrements;
+ ::std::vector< ExplicitIncrementData > m_aIncrements;
void getAllTickInfos( sal_Int32 nDimensionIndex, ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
diff --git a/chart2/source/view/axes/VPolarRadiusAxis.cxx b/chart2/source/view/axes/VPolarRadiusAxis.cxx
index 2206d4d8f559..bc56b3824e6e 100644
--- a/chart2/source/view/axes/VPolarRadiusAxis.cxx
+++ b/chart2/source/view/axes/VPolarRadiusAxis.cxx
@@ -32,6 +32,7 @@
#include "VCartesianAxis.hxx"
#include "PlottingPositionHelper.hxx"
#include "CommonConverters.hxx"
+#include "Tickmarks_Equidistant.hxx"
#include <rtl/math.hxx>
//.............................................................................
@@ -70,7 +71,7 @@ void VPolarRadiusAxis::setTransformationSceneToScreen( const drawing::HomogenMat
m_apAxisWithLabels->setTransformationSceneToScreen( rMatrix );
}
-void SAL_CALL VPolarRadiusAxis::setExplicitScaleAndIncrement(
+void VPolarRadiusAxis::setExplicitScaleAndIncrement(
const ExplicitScaleData& rScale
, const ExplicitIncrementData& rIncrement )
throw (uno::RuntimeException)
@@ -79,7 +80,7 @@ void SAL_CALL VPolarRadiusAxis::setExplicitScaleAndIncrement(
m_apAxisWithLabels->setExplicitScaleAndIncrement( rScale, rIncrement );
}
-void SAL_CALL VPolarRadiusAxis::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
+void VPolarRadiusAxis::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
, const uno::Reference< drawing::XShapes >& xFinalTarget
, const uno::Reference< lang::XMultiServiceFactory >& xShapeFactory
, const rtl::OUString& rCID )
@@ -89,15 +90,13 @@ void SAL_CALL VPolarRadiusAxis::initPlotter( const uno::Reference< drawing::XSh
m_apAxisWithLabels->initPlotter( xLogicTarget, xFinalTarget, xShapeFactory, rCID );
}
-void SAL_CALL VPolarRadiusAxis::setScales( const uno::Sequence< ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (uno::RuntimeException)
+void VPolarRadiusAxis::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
VPolarAxis::setScales( rScales, bSwapXAndYAxis );
m_apAxisWithLabels->setScales( rScales, bSwapXAndYAxis );
}
-void SAL_CALL VPolarRadiusAxis::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
+void VPolarRadiusAxis::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels )
{
VPolarAxis::initAxisLabelProperties( rFontReferenceSize, rMaximumSpaceForLabels );
@@ -121,22 +120,22 @@ bool VPolarRadiusAxis::prepareShapeCreation()
return true;
}
-void SAL_CALL VPolarRadiusAxis::createMaximumLabels()
+void VPolarRadiusAxis::createMaximumLabels()
{
m_apAxisWithLabels->createMaximumLabels();
}
-void SAL_CALL VPolarRadiusAxis::updatePositions()
+void VPolarRadiusAxis::updatePositions()
{
m_apAxisWithLabels->updatePositions();
}
-void SAL_CALL VPolarRadiusAxis::createLabels()
+void VPolarRadiusAxis::createLabels()
{
m_apAxisWithLabels->createLabels();
}
-void SAL_CALL VPolarRadiusAxis::createShapes()
+void VPolarRadiusAxis::createShapes()
{
if( !prepareShapeCreation() )
return;
@@ -145,8 +144,8 @@ void SAL_CALL VPolarRadiusAxis::createShapes()
const ExplicitIncrementData& rAngleIncrement = m_aIncrements[0];
::std::vector< ::std::vector< TickInfo > > aAngleTickInfos;
- TickmarkHelper aAngleTickmarkHelper( rAngleScale, rAngleIncrement );
- aAngleTickmarkHelper.getAllTicks( aAngleTickInfos );
+ TickFactory aAngleTickFactory( rAngleScale, rAngleIncrement );
+ aAngleTickFactory.getAllTicks( aAngleTickInfos );
uno::Reference< XScaling > xInverseScaling( NULL );
if( rAngleScale.Scaling.is() )
@@ -165,8 +164,8 @@ void SAL_CALL VPolarRadiusAxis::createShapes()
continue;
}
- pTickInfo->updateUnscaledValue( xInverseScaling );
- aAxisProperties.m_pfMainLinePositionAtOtherAxis = new double( pTickInfo->fUnscaledTickValue );
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
+ aAxisProperties.m_pfMainLinePositionAtOtherAxis = new double( pTickInfo->getUnscaledTickValue() );
aAxisProperties.m_bDisplayLabels=false;
//-------------------
diff --git a/chart2/source/view/axes/VPolarRadiusAxis.hxx b/chart2/source/view/axes/VPolarRadiusAxis.hxx
index b5c5191e4c98..e1dbb8c1b1c0 100644
--- a/chart2/source/view/axes/VPolarRadiusAxis.hxx
+++ b/chart2/source/view/axes/VPolarRadiusAxis.hxx
@@ -50,7 +50,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~VPolarRadiusAxis();
- virtual void SAL_CALL initPlotter(
+ virtual void initPlotter(
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
@@ -62,28 +62,24 @@ public:
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix );
- virtual void SAL_CALL setScales(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (::com::sun::star::uno::RuntimeException);
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
- virtual void SAL_CALL setExplicitScaleAndIncrement(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement )
+ virtual void setExplicitScaleAndIncrement(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement )
throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL initAxisLabelProperties(
+ virtual void initAxisLabelProperties(
const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels );
virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
- virtual void SAL_CALL createMaximumLabels();
- virtual void SAL_CALL createLabels();
- virtual void SAL_CALL updatePositions();
+ virtual void createMaximumLabels();
+ virtual void createLabels();
+ virtual void updatePositions();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
protected: //methods
virtual bool prepareShapeCreation();
diff --git a/chart2/source/view/axes/makefile.mk b/chart2/source/view/axes/makefile.mk
index 96191a3a3a25..af88a61b6b37 100644
--- a/chart2/source/view/axes/makefile.mk
+++ b/chart2/source/view/axes/makefile.mk
@@ -47,7 +47,11 @@ ENABLE_EXCEPTIONS= TRUE
SLOFILES = \
$(SLO)$/VAxisOrGridBase.obj \
$(SLO)$/VAxisBase.obj \
- $(SLO)$/TickmarkHelper.obj \
+ $(SLO)$/DateHelper.obj \
+ $(SLO)$/DateScaling.obj \
+ $(SLO)$/Tickmarks.obj \
+ $(SLO)$/Tickmarks_Equidistant.obj \
+ $(SLO)$/Tickmarks_Dates.obj \
$(SLO)$/MinimumAndMaximumSupplier.obj \
$(SLO)$/ScaleAutomatism.obj \
$(SLO)$/VAxisProperties.obj \
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index fd1aaa81c3a0..06e09d60fcf1 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -43,6 +43,7 @@
#include "Clipping.hxx"
#include "Stripe.hxx"
#include "PolarLabelPositionHelper.hxx"
+#include "DateHelper.hxx"
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
@@ -96,6 +97,11 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
{
if( !m_pMainPosHelper )
m_pMainPosHelper = new PlottingPositionHelper();
+ if( m_pMainPosHelper )
+ {
+ m_pMainPosHelper->AllowShiftXAxisPos(true);
+ m_pMainPosHelper->AllowShiftZAxisPos(true);
+ }
PlotterBase::m_pPosHelper = m_pMainPosHelper;
VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper;
@@ -121,18 +127,12 @@ AreaChart::~AreaChart()
delete m_pMainPosHelper;
}
-double AreaChart::getMinimumX()
-{
- if( m_bCategoryXAxis && m_bIsPolarCooSys )//the angle axis in net charts needs a different autoscaling
- return 1.0;//first category (index 0) matches with real number 1.0
- return VSeriesPlotter::getMinimumX();
-}
-
double AreaChart::getMaximumX()
{
+ double fMax = VSeriesPlotter::getMaximumX();
if( m_bCategoryXAxis && m_bIsPolarCooSys )//the angle axis in net charts needs a different autoscaling
- return getPointCount()+1;
- return VSeriesPlotter::getMaximumX();
+ fMax += 1.0;
+ return fMax;
}
bool AreaChart::isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex )
@@ -183,18 +183,6 @@ APPHELPER_XSERVICEINFO_IMPL(AreaChart,CHART2_VIEW_AREACHART_SERVICE_IMPLEMENTATI
return aSNS;
}
*/
-/*
-//-----------------------------------------------------------------
-// chart2::XPlotter
-//-----------------------------------------------------------------
-
- ::rtl::OUString SAL_CALL AreaChart
-::getCoordinateSystemTypeID()
- throw (uno::RuntimeException)
-{
- return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
-}
-*/
drawing::Direction3D AreaChart::getPreferredDiagramAspectRatio() const
{
if( m_nKeepAspectRatio == 1 )
@@ -628,7 +616,7 @@ void AreaChart::createShapes()
//check necessary here that different Y axis can not be stacked in the same group? ... hm?
//update/create information for current group
- double fLogicZ = 0.5;//as defined
+ double fLogicZ = 1.0;//as defined
sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
@@ -729,6 +717,8 @@ void AreaChart::createShapes()
//collect data point information (logic coordinates, style ):
double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+ if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
+ fLogicX = DateHelper::RasterizeDateValue( fLogicX, m_aNullDate, m_nTimeResolution );
double fLogicY = (*aSeriesIter)->getYValue(nIndex);
if( m_bIsPolarCooSys && m_bArea &&
diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx
index 6924509a62a1..4b6ff3f45251 100644
--- a/chart2/source/view/charttypes/AreaChart.hxx
+++ b/chart2/source/view/charttypes/AreaChart.hxx
@@ -55,17 +55,7 @@ public:
);
virtual ~AreaChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
//-------------------
@@ -75,7 +65,6 @@ public:
//-------------------------------------------------------------------------
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
- virtual double getMinimumX();
virtual double getMaximumX();
virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex );
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 0d7ef403f87d..dbf01165bf79 100755..100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -40,6 +40,7 @@
#include "macros.hxx"
#include "AxisIndexDefines.hxx"
#include "Clipping.hxx"
+#include "DateHelper.hxx"
#include <com/sun/star/chart/DataLabelPlacement.hpp>
@@ -91,7 +92,6 @@ BarChart::~BarChart()
PlottingPositionHelper& BarChart::getPlottingPositionHelper( sal_Int32 nAxisIndex ) const
{
PlottingPositionHelper& rPosHelper = VSeriesPlotter::getPlottingPositionHelper( nAxisIndex );
-
BarPositionHelper* pBarPosHelper = dynamic_cast<BarPositionHelper*>(&rPosHelper);
if( pBarPosHelper && nAxisIndex >= 0 )
{
@@ -100,7 +100,6 @@ PlottingPositionHelper& BarChart::getPlottingPositionHelper( sal_Int32 nAxisInde
if( nAxisIndex < m_aGapwidthSequence.getLength() )
pBarPosHelper->setOuterDistance( m_aGapwidthSequence[nAxisIndex]/100.0 );
}
-
return rPosHelper;
}
@@ -118,7 +117,7 @@ drawing::Direction3D BarChart::getPreferredDiagramAspectRatio() const
if(!m_aZSlots.empty())
fXSlotCount = m_aZSlots.begin()->size();
- aRet.DirectionZ = aScale.DirectionZ/(aScale.DirectionX + aScale.DirectionX*(fXSlotCount-1.0)*pPosHelper->getSlotWidth());
+ aRet.DirectionZ = aScale.DirectionZ/(aScale.DirectionX + aScale.DirectionX*(fXSlotCount-1.0)*pPosHelper->getScaledSlotWidth());
}
else
return VSeriesPlotter::getPreferredDiagramAspectRatio();
@@ -146,54 +145,6 @@ bool BarChart::keepAspectRatio() const
return true;
}
-//-------------------------------------------------------------------------
-// MinimumAndMaximumSupplier
-//-------------------------------------------------------------------------
-
-double BarChart::getMinimumX()
-{
- if( m_bCategoryXAxis )
- return 0.5;//first category (index 0) matches with real number 1.0
- return VSeriesPlotter::getMinimumX();
-}
-double BarChart::getMaximumX()
-{
- if( m_bCategoryXAxis )
- {
- //return category count
- sal_Int32 nPointCount = getPointCount();
- return nPointCount+0.5;//first category (index 0) matches with real number 1.0
- }
- return VSeriesPlotter::getMaximumX();
-}
-
-//-----------------------------------------------------------------
-// lang::XServiceInfo
-//-----------------------------------------------------------------
-/*
-APPHELPER_XSERVICEINFO_IMPL(BarChart,CHART2_VIEW_BARCHART_SERVICE_IMPLEMENTATION_NAME)
-
- uno::Sequence< rtl::OUString > BarChart
-::getSupportedServiceNames_Static()
-{
- uno::Sequence< rtl::OUString > aSNS( 1 );
- aSNS.getArray()[ 0 ] = CHART2_VIEW_BARCHART_SERVICE_NAME;
- return aSNS;
-}
-*/
-/*
-//-----------------------------------------------------------------
-// chart2::XPlotter
-//-----------------------------------------------------------------
-
- ::rtl::OUString SAL_CALL BarChart
-::getCoordinateSystemTypeID()
- throw (uno::RuntimeException)
-{
- return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
-}
-*/
-
awt::Point BarChart::getLabelScreenPositionAndAlignment(
LabelAlignment& rAlignment, sal_Int32 nLabelPlacement
, double fScaledX, double fScaledLowerYValue, double fScaledUpperYValue, double fScaledZ
@@ -499,7 +450,7 @@ void BarChart::createShapes()
m_pShapeFactory->createGroup2D( m_xFinalTarget,rtl::OUString() ));
//check necessary here that different Y axis can not be stacked in the same group? ... hm?
- double fLogicZ = 0.0;//as defined
+ double fLogicZ = 1.0;//as defined
bool bDrawConnectionLines = false;
bool bDrawConnectionLinesInited = false;
@@ -514,12 +465,11 @@ void BarChart::createShapes()
sal_Int32 nCreatedPoints = 0;
//
- //(@todo maybe different iteration for breaks in axis ?)
- sal_Int32 nStartCategoryIndex = m_pMainPosHelper->getStartCategoryIndex(); // inclusive
- sal_Int32 nEndCategoryIndex = m_pMainPosHelper->getEndCategoryIndex(); //inclusive
+ sal_Int32 nStartIndex = 0;
+ sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
//=============================================================================
- //iterate through all shown categories
- for( sal_Int32 nCatIndex = nStartCategoryIndex; nCatIndex < nEndCategoryIndex; nCatIndex++ )
+ //iterate through all x values per indices
+ for( sal_Int32 nPointIndex = nStartIndex; nPointIndex < nEndIndex; nPointIndex++ )
{
::std::vector< ::std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
@@ -538,7 +488,7 @@ void BarChart::createShapes()
aLogicYSumMap[nAttachedAxisIndex]=0.0;
double fMinimumY = 0.0, fMaximumY = 0.0;
- aXSlotIter->calculateYMinAndMaxForCategory( nCatIndex
+ aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
, isSeperateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
if( !::rtl::math::isNan( fMaximumY ) && fMaximumY > 0)
@@ -574,14 +524,14 @@ void BarChart::createShapes()
//update/create information for current group
pPosHelper->updateSeriesCount( aZSlotIter->size() );
- double fLogicBaseWidth = pPosHelper->getSlotWidth();
+ double fLogicBaseWidth = pPosHelper->getScaledSlotWidth();
::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
// get distance from base value to maximum and minimum
double fMinimumY = 0.0, fMaximumY = 0.0;
- aXSlotIter->calculateYMinAndMaxForCategory( nCatIndex
+ aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
, isSeperateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
double fLogicPositiveYSum = 0.0;
@@ -633,7 +583,7 @@ void BarChart::createShapes()
bOnlyConnectionLinesForThisPoint = false;
- if(nCatIndex==nStartCategoryIndex)//do not create a regression line for each point
+ if(nPointIndex==nStartIndex)//do not create a regression line for each point
createRegressionCurvesShapes( **aSeriesIter, xRegressionCurveTarget, xRegressionCurveEquationTarget,
m_pPosHelper->maySkipPointsInRegressionCalculation());
@@ -658,8 +608,17 @@ void BarChart::createShapes()
getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
//collect data point information (logic coordinates, style ):
- double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getXValue( nCatIndex ), fSlotX );
- double fLogicBarHeight = (*aSeriesIter)->getYValue( nCatIndex );
+ double fUnscaledLogicX = (*aSeriesIter)->getXValue( nPointIndex );
+ fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
+ if(fUnscaledLogicX<pPosHelper->getLogicMinX())
+ continue;//point not visible
+ if(fUnscaledLogicX>pPosHelper->getLogicMaxX())
+ continue;//point not visible
+ if(pPosHelper->isStrongLowerRequested(0) && fUnscaledLogicX==pPosHelper->getLogicMaxX())
+ continue;//point not visible
+ double fLogicX = pPosHelper->getScaledSlotPos( fUnscaledLogicX, fSlotX );
+
+ double fLogicBarHeight = (*aSeriesIter)->getYValue( nPointIndex );
if( ::rtl::math::isNan( fLogicBarHeight )) //no value at this category
continue;
@@ -684,9 +643,9 @@ void BarChart::createShapes()
fNegativeLogicYForNextSeries += fLogicBarHeight;
if(m_nDimension==3)
- fLogicZ = nZ;
+ fLogicZ = nZ+0.5;
- drawing::Position3D aUnscaledLogicPosition( fLogicX, fUpperYValue, fLogicZ );
+ drawing::Position3D aUnscaledLogicPosition( fUnscaledLogicX, fUpperYValue, fLogicZ );
//@todo ... start an iteration over the different breaks of the axis
//each subsystem may add an additional shape to form the whole point
@@ -696,7 +655,7 @@ void BarChart::createShapes()
// uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY );
//as long as we do not iterate we do not need to create an additional group for each point
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes = xSeriesGroupShape_Shapes;
- uno::Reference< beans::XPropertySet > xDataPointProperties( (*aSeriesIter)->getPropertiesOfPoint( nCatIndex ) );
+ uno::Reference< beans::XPropertySet > xDataPointProperties( (*aSeriesIter)->getPropertiesOfPoint( nPointIndex ) );
sal_Int32 nGeometry3D = DataPointGeometry3D::CUBOID;
if(m_nDimension==3) try
{
@@ -763,7 +722,7 @@ void BarChart::createShapes()
//better performance for big data
FormerBarPoint aFormerPoint( aSeriesFormerPointMap[pSeries] );
pPosHelper->setCoordinateSystemResolution( m_aCoordinateSystemResolution );
- if( !pSeries->isAttributedDataPoint(nCatIndex)
+ if( !pSeries->isAttributedDataPoint(nPointIndex)
&&
pPosHelper->isSameForGivenResolution( aFormerPoint.m_fX, aFormerPoint.m_fUpperY, aFormerPoint.m_fZ
, fLogicX, fUpperYValue, fLogicZ )
@@ -883,20 +842,20 @@ void BarChart::createShapes()
//set name/classified ObjectID (CID)
ShapeFactory::setShapeName(xShape
, ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(),nCatIndex) );
+ (*aSeriesIter)->getPointCID_Stub(),nPointIndex) );
}
//create error bar
- createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nCatIndex, m_xLogicTarget );
+ createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nPointIndex, m_xLogicTarget, &fLogicX );
//------------
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nCatIndex) )
+ if( (**aSeriesIter).getDataPointLabelIfLabel(nPointIndex) )
{
double fLogicSum = aLogicYSumMap[nAttachedAxisIndex];
LabelAlignment eAlignment(LABEL_ALIGN_CENTER);
- sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nCatIndex, m_xChartTypeModel, m_nDimension, pPosHelper->isSwapXAndY() );
+ sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nPointIndex, m_xChartTypeModel, m_nDimension, pPosHelper->isSwapXAndY() );
double fLowerBarDepth = fLogicBarDepth;
double fUpperBarDepth = fLogicBarDepth;
@@ -921,7 +880,7 @@ void BarChart::createShapes()
if( m_nDimension == 3 )
nOffset = 260;
}
- this->createDataLabel( xTextTarget, **aSeriesIter, nCatIndex
+ this->createDataLabel( xTextTarget, **aSeriesIter, nPointIndex
, fLogicValueForLabeDisplay, fLogicSum, aScreenPosition2D, eAlignment, nOffset );
}
diff --git a/chart2/source/view/charttypes/BarChart.hxx b/chart2/source/view/charttypes/BarChart.hxx
index 403628f7fc43..c20c85168b5d 100644
--- a/chart2/source/view/charttypes/BarChart.hxx
+++ b/chart2/source/view/charttypes/BarChart.hxx
@@ -47,17 +47,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~BarChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
//-------------------
@@ -65,12 +55,6 @@ public:
virtual bool keepAspectRatio() const;
//-------------------------------------------------------------------------
- // MinimumAndMaximumSupplier
- //-------------------------------------------------------------------------
- virtual double getMinimumX();
- virtual double getMaximumX();
-
- //-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/BarPositionHelper.cxx b/chart2/source/view/charttypes/BarPositionHelper.cxx
index b1735e99de5d..45dab527da11 100644
--- a/chart2/source/view/charttypes/BarPositionHelper.cxx
+++ b/chart2/source/view/charttypes/BarPositionHelper.cxx
@@ -32,6 +32,8 @@
#include "Linear3DTransformation.hxx"
#include "ViewDefines.hxx"
#include "CommonConverters.hxx"
+#include "DateHelper.hxx"
+#include <com/sun/star/chart/TimeUnit.hpp>
//.............................................................................
namespace chart
@@ -43,6 +45,8 @@ using namespace ::com::sun::star::chart2;
BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
: CategoryPositionHelper( 1 )
{
+ AllowShiftXAxisPos(true);
+ AllowShiftZAxisPos(true);
}
BarPositionHelper::BarPositionHelper( const BarPositionHelper& rSource )
@@ -66,73 +70,22 @@ void BarPositionHelper::updateSeriesCount( double fSeriesCount )
m_fSeriesCount = fSeriesCount;
}
-uno::Reference< XTransformation > BarPositionHelper::getTransformationScaledLogicToScene() const
+double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX, double fSeriesNumber ) const
{
- //transformation from 2) to 4) //@todo 2) and 4) need a link to a document
+ if( m_bDateAxis )
+ fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
+ double fScaledLogicX(fUnscaledLogicX);
+ doLogicScaling(&fScaledLogicX,NULL,NULL);
+ fScaledLogicX = CategoryPositionHelper::getScaledSlotPos( fScaledLogicX, fSeriesNumber );
+ return fScaledLogicX;
- //we need to apply this transformation to each geometric object because of a bug/problem
- //of the old drawing layer (the UNO_NAME_3D_EXTRUDE_DEPTH is an integer value instead of an double )
-
- if( !m_xTransformationLogicToScene.is() )
- {
- ::basegfx::B3DHomMatrix aMatrix;
-
- double MinX = getLogicMinX();
- double MinY = getLogicMinY();
- double MinZ = getLogicMinZ();
- double MaxX = getLogicMaxX();
- double MaxY = getLogicMaxY();
- double MaxZ = getLogicMaxZ();
-
- AxisOrientation nXAxisOrientation = m_aScales[0].Orientation;
- AxisOrientation nYAxisOrientation = m_aScales[1].Orientation;
- AxisOrientation nZAxisOrientation = m_aScales[2].Orientation;
-
- //apply scaling
- //scaling of x axis is refused/ignored
- doLogicScaling( NULL, &MinY, &MinZ );
- doLogicScaling( NULL, &MaxY, &MaxZ);
-
- if(m_bSwapXAndY)
- {
- std::swap(MinX,MinY);
- std::swap(MaxX,MaxY);
- std::swap(nXAxisOrientation,nYAxisOrientation);
- }
-
- if( AxisOrientation_MATHEMATICAL==nXAxisOrientation )
- aMatrix.translate(-MinX,0.0,0.0);
- else
- aMatrix.translate(-MaxX,0.0,0.0);
- if( AxisOrientation_MATHEMATICAL==nYAxisOrientation )
- aMatrix.translate(0.0,-MinY,0.0);
- else
- aMatrix.translate(0.0,-MaxY,0.0);
- if( AxisOrientation_MATHEMATICAL==nZAxisOrientation )
- aMatrix.translate(0.0,0.0,-MaxZ);//z direction in draw is reverse mathematical direction
- else
- aMatrix.translate(0.0,0.0,-MinZ);
-
- double fWidthX = MaxX - MinX;
- double fWidthY = MaxY - MinY;
- double fWidthZ = MaxZ - MinZ;
-
- double fScaleDirectionX = AxisOrientation_MATHEMATICAL==nXAxisOrientation ? 1.0 : -1.0;
- double fScaleDirectionY = AxisOrientation_MATHEMATICAL==nYAxisOrientation ? 1.0 : -1.0;
- double fScaleDirectionZ = AxisOrientation_MATHEMATICAL==nZAxisOrientation ? -1.0 : 1.0;
-
- aMatrix.scale(fScaleDirectionX*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthX
- , fScaleDirectionY*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthY
- , fScaleDirectionZ*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthZ);
-
- //if(nDim==2)
- aMatrix = m_aMatrixScreenToScene*aMatrix;
-
- m_xTransformationLogicToScene = new Linear3DTransformation(B3DHomMatrixToHomogenMatrix( aMatrix ),m_bSwapXAndY);
- }
- return m_xTransformationLogicToScene;
}
+void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
+{
+ m_fScaledCategoryWidth = fScaledCategoryWidth;
+ CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth );
+}
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/view/charttypes/BarPositionHelper.hxx b/chart2/source/view/charttypes/BarPositionHelper.hxx
index 32899de62aef..3a905877bcb9 100644
--- a/chart2/source/view/charttypes/BarPositionHelper.hxx
+++ b/chart2/source/view/charttypes/BarPositionHelper.hxx
@@ -49,25 +49,10 @@ public:
virtual PlottingPositionHelper* clone() const;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >
- getTransformationScaledLogicToScene() const;
-
void updateSeriesCount( double fSeriesCount ); /*only enter the size of x stacked series*/
- sal_Int32 getStartCategoryIndex() const {
- //first category (index 0) matches with real number 1.0
- sal_Int32 nStart = static_cast<sal_Int32>(getLogicMinX() - 0.5);
- if( nStart < 0 )
- nStart = 0;
- return nStart;
- }
- sal_Int32 getEndCategoryIndex() const {
- //first category (index 0) matches with real number 1.0
- sal_Int32 nEnd = static_cast<sal_Int32>(getLogicMaxX() - 0.5);
- if( nEnd < 0 )
- nEnd = 0;
- return nEnd;
- }
+ virtual double getScaledSlotPos( double fCategoryX, double fSeriesNumber ) const;
+ virtual void setScaledCategoryWidth( double fScaledCategoryWidth );
};
//.............................................................................
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index c5454edcc6fd..0cbcff33bfcd 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -121,7 +121,7 @@ void BubbleChart::calculateMaximumLogicBubbleSize()
void BubbleChart::calculateBubbleSizeScalingFactor()
{
- double fLogicZ=0.5;
+ double fLogicZ=1.0;
drawing::Position3D aSceneMinPos( m_pMainPosHelper->transformLogicToScene( m_pMainPosHelper->getLogicMinX(),m_pMainPosHelper->getLogicMinY(),fLogicZ, false ) );
drawing::Position3D aSceneMaxPos( m_pMainPosHelper->transformLogicToScene( m_pMainPosHelper->getLogicMaxX(),m_pMainPosHelper->getLogicMaxY(),fLogicZ, false ) );
@@ -223,7 +223,7 @@ void BubbleChart::createShapes()
m_pShapeFactory->createGroup2D( m_xFinalTarget,rtl::OUString() ));
//update/create information for current group
- double fLogicZ = 0.5;//as defined
+ double fLogicZ = 1.0;//as defined
sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
diff --git a/chart2/source/view/charttypes/BubbleChart.hxx b/chart2/source/view/charttypes/BubbleChart.hxx
index 9c04ce8d3719..ed3d9e051cc4 100644
--- a/chart2/source/view/charttypes/BubbleChart.hxx
+++ b/chart2/source/view/charttypes/BubbleChart.hxx
@@ -46,11 +46,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~BubbleChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index ddfe50deed2f..61c49c61d4a0 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -30,8 +30,6 @@
#include "CandleStickChart.hxx"
#include "ShapeFactory.hxx"
-//#include "chartview/servicenames_charttypes.hxx"
-//#include "servicenames_coosystems.hxx"
#include "CommonConverters.hxx"
#include "ObjectIdentifier.hxx"
#include "LabelPositionHelper.hxx"
@@ -40,6 +38,7 @@
#include "VLegendSymbolFactory.hxx"
#include "FormattedStringHelper.hxx"
#include "DataSeriesHelper.hxx"
+#include "DateHelper.hxx"
#include <tools/debug.hxx>
#include <rtl/math.hxx>
#include <editeng/unoprnms.hxx>
@@ -76,22 +75,6 @@ CandleStickChart::~CandleStickChart()
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
-double CandleStickChart::getMinimumX()
-{
- if( m_bCategoryXAxis )
- return 0.5;//first category (index 0) matches with real number 1.0
- return VSeriesPlotter::getMinimumX();
-}
-double CandleStickChart::getMaximumX()
-{
- if( m_bCategoryXAxis )
- {
- //return category count
- sal_Int32 nPointCount = getPointCount();
- return nPointCount+0.5;//first category (index 0) matches with real number 1.0
- }
- return VSeriesPlotter::getMaximumX();
-}
bool CandleStickChart::isSeperateStackingForDifferentSigns( sal_Int32 /* nDimensionIndex */ )
{
return false;
@@ -120,18 +103,6 @@ APPHELPER_XSERVICEINFO_IMPL(CandleStickChart,CHART2_VIEW_CANDLESTICKCHART_SERVIC
return aSNS;
}
*/
-/*
-//-----------------------------------------------------------------
-// chart2::XPlotter
-//-----------------------------------------------------------------
-
- ::rtl::OUString SAL_CALL CandleStickChart
-::getCoordinateSystemTypeID()
- throw (uno::RuntimeException)
-{
- return CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME;
-}
-*/
drawing::Direction3D CandleStickChart::getPreferredDiagramAspectRatio() const
{
@@ -205,11 +176,12 @@ void CandleStickChart::createShapes()
}
//(@todo maybe different iteration for breaks in axis ?)
- sal_Int32 nStartCategoryIndex = m_pMainPosHelper->getStartCategoryIndex(); // inclusive
- sal_Int32 nEndCategoryIndex = m_pMainPosHelper->getEndCategoryIndex(); //inclusive
+ sal_Int32 nStartIndex = 0;
+ sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
+ double fLogicZ = 1.5;//as defined
//=============================================================================
- //iterate through all shown categories
- for( sal_Int32 nIndex = nStartCategoryIndex; nIndex < nEndCategoryIndex; nIndex++ )
+ //iterate through all x values per indices
+ for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
::std::vector< ::std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
@@ -247,28 +219,48 @@ void CandleStickChart::createShapes()
for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
{
//collect data point information (logic coordinates, style ):
- double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getXValue( nIndex ), fSlotX );
- double fY_First = (*aSeriesIter)->getY_First( nIndex );
- double fY_Last = (*aSeriesIter)->getY_Last( nIndex );
- double fY_Min = (*aSeriesIter)->getY_Min( nIndex );
- double fY_Max = (*aSeriesIter)->getY_Max( nIndex );
+ double fUnscaledX = (*aSeriesIter)->getXValue( nIndex );
+ if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
+ fUnscaledX = DateHelper::RasterizeDateValue( fUnscaledX, m_aNullDate, m_nTimeResolution );
+ if(fUnscaledX<pPosHelper->getLogicMinX() || fUnscaledX>pPosHelper->getLogicMaxX())
+ continue;//point not visible
+ double fScaledX = pPosHelper->getScaledSlotPos( fUnscaledX, fSlotX );
+
+ double fUnscaledY_First = (*aSeriesIter)->getY_First( nIndex );
+ double fUnscaledY_Last = (*aSeriesIter)->getY_Last( nIndex );
+ double fUnscaledY_Min = (*aSeriesIter)->getY_Min( nIndex );
+ double fUnscaledY_Max = (*aSeriesIter)->getY_Max( nIndex );
bool bBlack=false;
- if(fY_Last<=fY_First)
+ if(fUnscaledY_Last<=fUnscaledY_First)
{
- std::swap(fY_First,fY_Last);
+ std::swap(fUnscaledY_First,fUnscaledY_Last);
bBlack=true;
}
- if(fY_Max<fY_Min)
- std::swap(fY_Min,fY_Max);
+ if(fUnscaledY_Max<fUnscaledY_Min)
+ std::swap(fUnscaledY_Min,fUnscaledY_Max);
//transformation 3) -> 4)
- double fHalfWidth = pPosHelper->getSlotWidth()/2.0;
- drawing::Position3D aPosLeftFirst( pPosHelper->transformLogicToScene( fLogicX-fHalfWidth, fY_First ,0 ,true ) );
- drawing::Position3D aPosRightLast( pPosHelper->transformLogicToScene( fLogicX+fHalfWidth, fY_Last ,0 ,true ) );
- drawing::Position3D aPosMiddleFirst( pPosHelper->transformLogicToScene( fLogicX, fY_First ,0 ,true ) );
- drawing::Position3D aPosMiddleLast( pPosHelper->transformLogicToScene( fLogicX, fY_Last ,0 ,true ) );
- drawing::Position3D aPosMiddleMinimum( pPosHelper->transformLogicToScene( fLogicX, fY_Min ,0 ,true ) );
- drawing::Position3D aPosMiddleMaximum( pPosHelper->transformLogicToScene( fLogicX, fY_Max ,0 ,true ) );
+ double fHalfScaledWidth = pPosHelper->getScaledSlotWidth()/2.0;
+
+ double fScaledY_First(fUnscaledY_First);
+ double fScaledY_Last(fUnscaledY_Last);
+ double fScaledY_Min(fUnscaledY_Min);
+ double fScaledY_Max(fUnscaledY_Max);
+ pPosHelper->clipLogicValues( 0,&fScaledY_First,0 );
+ pPosHelper->clipLogicValues( 0,&fScaledY_Last,0 );
+ pPosHelper->clipLogicValues( 0,&fScaledY_Min,0 );
+ pPosHelper->clipLogicValues( 0,&fScaledY_Max,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_First,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_Last,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_Min,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_Max,0 );
+
+ drawing::Position3D aPosLeftFirst( pPosHelper->transformScaledLogicToScene( fScaledX-fHalfScaledWidth, fScaledY_First ,0 ,true ) );
+ drawing::Position3D aPosRightLast( pPosHelper->transformScaledLogicToScene( fScaledX+fHalfScaledWidth, fScaledY_Last ,0 ,true ) );
+ drawing::Position3D aPosMiddleFirst( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_First ,0 ,true ) );
+ drawing::Position3D aPosMiddleLast( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Last ,0 ,true ) );
+ drawing::Position3D aPosMiddleMinimum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Min ,0 ,true ) );
+ drawing::Position3D aPosMiddleMaximum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Max ,0 ,true ) );
uno::Reference< drawing::XShapes > xLossGainTarget( xGainTarget );
if(bBlack)
@@ -329,13 +321,13 @@ void CandleStickChart::createShapes()
drawing::PolyPolygonShape3D aPoly;
sal_Int32 nLineIndex = 0;
- if( bShowFirst && pPosHelper->isLogicVisible( fLogicX, fY_First ,0 )
+ if( bShowFirst && pPosHelper->isLogicVisible( fUnscaledX, fUnscaledY_First ,fLogicZ )
&& isValidPosition(aPosLeftFirst) && isValidPosition(aPosMiddleFirst) )
{
AddPointToPoly( aPoly, aPosLeftFirst, nLineIndex );
AddPointToPoly( aPoly, aPosMiddleFirst, nLineIndex++ );
}
- if( pPosHelper->isLogicVisible( fLogicX, fY_Last ,0 )
+ if( pPosHelper->isLogicVisible( fUnscaledX, fUnscaledY_Last ,fLogicZ )
&& isValidPosition(aPosMiddleLast) && isValidPosition(aPosRightLast) )
{
AddPointToPoly( aPoly, aPosMiddleLast, nLineIndex );
@@ -361,16 +353,16 @@ void CandleStickChart::createShapes()
{
if(isValidPosition(aPosMiddleFirst))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_First, 1.0, Position3DToAWTPoint(aPosMiddleFirst), LABEL_ALIGN_LEFT_BOTTOM );
+ , fUnscaledY_First, 1.0, Position3DToAWTPoint(aPosMiddleFirst), LABEL_ALIGN_LEFT_BOTTOM );
if(isValidPosition(aPosMiddleLast))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_Last, 1.0, Position3DToAWTPoint(aPosMiddleLast), LABEL_ALIGN_RIGHT_TOP );
+ , fUnscaledY_Last, 1.0, Position3DToAWTPoint(aPosMiddleLast), LABEL_ALIGN_RIGHT_TOP );
if(isValidPosition(aPosMiddleMinimum))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_Min, 1.0, Position3DToAWTPoint(aPosMiddleMinimum), LABEL_ALIGN_BOTTOM );
+ , fUnscaledY_Min, 1.0, Position3DToAWTPoint(aPosMiddleMinimum), LABEL_ALIGN_BOTTOM );
if(isValidPosition(aPosMiddleMaximum))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_Max, 1.0, Position3DToAWTPoint(aPosMiddleMaximum), LABEL_ALIGN_TOP );
+ , fUnscaledY_Max, 1.0, Position3DToAWTPoint(aPosMiddleMaximum), LABEL_ALIGN_TOP );
}
}//next series in x slot (next y slot)
}//next x slot
diff --git a/chart2/source/view/charttypes/CandleStickChart.hxx b/chart2/source/view/charttypes/CandleStickChart.hxx
index 60018dbe8621..6fbf980058e7 100644
--- a/chart2/source/view/charttypes/CandleStickChart.hxx
+++ b/chart2/source/view/charttypes/CandleStickChart.hxx
@@ -47,16 +47,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~CandleStickChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
virtual ::com::sun::star::drawing::Direction3D getPreferredDiagramAspectRatio() const;
@@ -64,8 +55,6 @@ public:
//-------------------------------------------------------------------------
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
- virtual double getMinimumX();
- virtual double getMaximumX();
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.cxx b/chart2/source/view/charttypes/CategoryPositionHelper.cxx
index d43fd0856e02..76f07168bdf2 100644
--- a/chart2/source/view/charttypes/CategoryPositionHelper.cxx
+++ b/chart2/source/view/charttypes/CategoryPositionHelper.cxx
@@ -57,7 +57,7 @@ CategoryPositionHelper::~CategoryPositionHelper()
{
}
-double CategoryPositionHelper::getSlotWidth() const
+double CategoryPositionHelper::getScaledSlotWidth() const
{
double fWidth = m_fCategoryWidth /
( m_fSeriesCount
@@ -66,14 +66,14 @@ double CategoryPositionHelper::getSlotWidth() const
return fWidth;
}
-double CategoryPositionHelper::getSlotPos( double fCategoryX, double fSeriesNumber ) const
+double CategoryPositionHelper::getScaledSlotPos( double fScaledXPos, double fSeriesNumber ) const
{
//the returned position is in the middle of the rect
//fSeriesNumber 0...n-1
- double fPos = fCategoryX - (m_fCategoryWidth/2.0)
- + (m_fOuterDistance/2.0 + fSeriesNumber*(1.0+m_fInnerDistance)) * getSlotWidth()
- + getSlotWidth()/2.0;
-
+ double fPos = fScaledXPos
+ - (m_fCategoryWidth/2.0)
+ + (m_fOuterDistance/2.0 + fSeriesNumber*(1.0+m_fInnerDistance)) * getScaledSlotWidth()
+ + getScaledSlotWidth()/2.0;
return fPos;
}
@@ -95,6 +95,11 @@ void CategoryPositionHelper::setOuterDistance( double fOuterDistance )
m_fOuterDistance = fOuterDistance;
}
+void CategoryPositionHelper::setCategoryWidth( double fCategoryWidth )
+{
+ m_fCategoryWidth = fCategoryWidth;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.hxx b/chart2/source/view/charttypes/CategoryPositionHelper.hxx
index 08cb1978faa1..c12d17d40b03 100644
--- a/chart2/source/view/charttypes/CategoryPositionHelper.hxx
+++ b/chart2/source/view/charttypes/CategoryPositionHelper.hxx
@@ -44,8 +44,9 @@ public:
CategoryPositionHelper( const CategoryPositionHelper& rSource );
virtual ~CategoryPositionHelper();
- double getSlotWidth() const;
- double getSlotPos( double fCategoryX, double fSeriesNumber ) const;
+ double getScaledSlotWidth() const;
+ virtual double getScaledSlotPos( double fCategoryX, double fSeriesNumber ) const;
+ virtual void setCategoryWidth( double fCategoryWidth );
//Distance between two neighboring bars in same category, seen relative to width of the bar
void setInnerDistance( double fInnerDistance );
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index eee13848b11b..abb30c2a67a9 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -159,11 +159,9 @@ PieChart::~PieChart()
//-----------------------------------------------------------------
-void SAL_CALL PieChart::setScales( const uno::Sequence< ExplicitScaleData >& rScales
- , sal_Bool /* bSwapXAndYAxis */ )
- throw (uno::RuntimeException)
+void PieChart::setScales( const std::vector< ExplicitScaleData >& rScales, bool /* bSwapXAndYAxis */ )
{
- DBG_ASSERT(m_nDimension<=rScales.getLength(),"Dimension of Plotter does not fit two dimension of given scale sequence");
+ DBG_ASSERT(m_nDimension<=static_cast<sal_Int32>(rScales.size()),"Dimension of Plotter does not fit two dimension of given scale sequence");
m_pPosHelper->setScales( rScales, true );
}
@@ -411,7 +409,7 @@ void PieChart::createShapes()
if( !bIsVisible )
continue;
- double fLogicZ = -0.5;//as defined
+ double fLogicZ = -1.0;//as defined
double fDepth = this->getTransformedDepth();
//=============================================================================
@@ -495,11 +493,11 @@ void PieChart::createShapes()
awt::Point aScreenPosition2D(
aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(eAlignment, nLabelPlacement
, fUnitCircleStartAngleDegree, fUnitCircleWidthAngleDegree
- , fUnitCircleInnerRadius, fUnitCircleOuterRadius, 0.0, 0 ));
+ , fUnitCircleInnerRadius, fUnitCircleOuterRadius, fLogicZ+0.5, 0 ));
PieLabelInfo aPieLabelInfo;
aPieLabelInfo.aFirstPosition = basegfx::B2IVector( aScreenPosition2D.X, aScreenPosition2D.Y );
- awt::Point aOrigin( aPolarPosHelper.transformSceneToScreenPosition( m_pPosHelper->transformUnitCircleToScene( 0.0, 0.0, 0.5 ) ) );
+ awt::Point aOrigin( aPolarPosHelper.transformSceneToScreenPosition( m_pPosHelper->transformUnitCircleToScene( 0.0, 0.0, fLogicZ+1.0 ) ) );
aPieLabelInfo.aOrigin = basegfx::B2IVector( aOrigin.X, aOrigin.Y );
//add a scaling independent Offset if requested
diff --git a/chart2/source/view/charttypes/PieChart.hxx b/chart2/source/view/charttypes/PieChart.hxx
index e6fedb05d52e..c306e2db256f 100644
--- a/chart2/source/view/charttypes/PieChart.hxx
+++ b/chart2/source/view/charttypes/PieChart.hxx
@@ -49,24 +49,10 @@ public:
, sal_Int32 nDimensionCount, bool bExcludingPositioning );
virtual ~PieChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
virtual void rearrangeLabelToAvoidOverlapIfRequested( const ::com::sun::star::awt::Size& rPageSize );
- virtual void SAL_CALL setScales(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (::com::sun::star::uno::RuntimeException);
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
//-------------------
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 4150fade8834..c37842e19888 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -43,7 +43,7 @@
#include "ChartTypeHelper.hxx"
#include "Clipping.hxx"
#include "servicenames_charttypes.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "ContainerHelper.hxx"
#include "DataSeriesHelper.hxx"
#include "RegressionCurveHelper.hxx"
@@ -52,6 +52,8 @@
#include "ResId.hxx"
#include "Strings.hrc"
#include "RelativePositionHelper.hxx"
+#include "DateHelper.hxx"
+#include "DiagramHelper.hxx"
//only for creation: @todo remove if all plotter are uno components and instanciated via servicefactory
#include "BarChart.hxx"
@@ -62,6 +64,7 @@
//
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
@@ -155,6 +158,8 @@ VSeriesPlotter::VSeriesPlotter( const uno::Reference<XChartType>& xChartTypeMode
, m_xChartTypeModelProps( uno::Reference< beans::XPropertySet >::query( xChartTypeModel ))
, m_aZSlots()
, m_bCategoryXAxis(bCategoryXAxis)
+ , m_nTimeResolution(::com::sun::star::chart::TimeUnit::DAY)
+ , m_aNullDate(30,12,1899)
, m_xColorScheme()
, m_pExplicitCategoriesProvider(0)
, m_bPointsWereSkipped(false)
@@ -201,7 +206,17 @@ void VSeriesPlotter::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32
return;
if(m_bCategoryXAxis)
- pSeries->setCategoryXAxis();
+ {
+ if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
+ pSeries->setXValues( m_pExplicitCategoriesProvider->getOriginalCategories() );
+ else
+ pSeries->setCategoryXAxis();
+ }
+ else
+ {
+ if( m_pExplicitCategoriesProvider )
+ pSeries->setXValuesIfNone( m_pExplicitCategoriesProvider->getOriginalCategories() );
+ }
if(zSlot<0 || zSlot>=static_cast<sal_Int32>(m_aZSlots.size()))
{
@@ -381,7 +396,7 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries& rDataSeries
nNumberFormatKey = rDataSeries.getExplicitNumberFormat(nPointIndex,bAsPercentage);
else if( bAsPercentage )
{
- sal_Int32 nPercentFormat = ExplicitValueProvider::getPercentNumberFormat( m_apNumberFormatterWrapper->getNumberFormatsSupplier() );
+ sal_Int32 nPercentFormat = DiagramHelper::getPercentNumberFormat( m_apNumberFormatterWrapper->getNumberFormatsSupplier() );
if( nPercentFormat != -1 )
nNumberFormatKey = nPercentFormat;
}
@@ -758,6 +773,17 @@ void lcl_AddErrorBottomLine( const drawing::Position3D& rPosition, ::basegfx::B2
return aMainDirection;
}
+drawing::Position3D lcl_transformMixedToScene( PlottingPositionHelper* pPosHelper
+ , double fX /*scaled*/, double fY /*unscaled*/, double fZ /*unscaled*/, bool bClip )
+{
+ if(!pPosHelper)
+ return drawing::Position3D(0,0,0);
+ pPosHelper->doLogicScaling( 0,&fY,&fZ );
+ if(bClip)
+ pPosHelper->clipScaledLogicValues( &fX,&fY,&fZ );
+ return pPosHelper->transformScaledLogicToScene( fX, fY, fZ, false );
+}
+
} // anonymous namespace
// virtual
@@ -768,6 +794,7 @@ void VSeriesPlotter::createErrorBar(
, const VDataSeries& rVDataSeries
, sal_Int32 nIndex
, bool bYError /* = true */
+ , double* pfScaledLogicX
)
{
if( !ChartTypeHelper::isSupportingStatisticProperties( m_xChartTypeModel, m_nDimension ) )
@@ -802,7 +829,13 @@ void VSeriesPlotter::createErrorBar(
const double fX = aUnscaledLogicPosition.PositionX;
const double fY = aUnscaledLogicPosition.PositionY;
const double fZ = aUnscaledLogicPosition.PositionZ;
- aMiddle = m_pPosHelper->transformLogicToScene( fX, fY, fZ, true );
+ double fScaledX = fX;
+ if( pfScaledLogicX )
+ fScaledX = *pfScaledLogicX;
+ else
+ m_pPosHelper->doLogicScaling( &fScaledX, 0, 0 );
+
+ aMiddle = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fY, fZ, true );
drawing::Position3D aNegative(aMiddle);
drawing::Position3D aPositive(aMiddle);
@@ -817,11 +850,16 @@ void VSeriesPlotter::createErrorBar(
double fLocalX = fX;
double fLocalY = fY;
if( bYError )
+ {
fLocalY+=fLength;
+ aPositive = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ, true );
+ }
else
+ {
fLocalX+=fLength;
+ aPositive = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
+ }
bCreatePositiveBorder = m_pPosHelper->isLogicVisible(fLocalX, fLocalY, fZ);
- aPositive = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
}
else
bShowPositive = false;
@@ -835,12 +873,16 @@ void VSeriesPlotter::createErrorBar(
double fLocalX = fX;
double fLocalY = fY;
if( bYError )
+ {
fLocalY-=fLength;
+ aNegative = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ, true );
+ }
else
+ {
fLocalX-=fLength;
-
+ aNegative = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
+ }
bCreateNegativeBorder = m_pPosHelper->isLogicVisible( fLocalX, fLocalY, fZ);
- aNegative = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
}
else
bShowNegative = false;
@@ -884,7 +926,8 @@ void VSeriesPlotter::createErrorBar(
// virtual
void VSeriesPlotter::createErrorBar_Y( const drawing::Position3D& rUnscaledLogicPosition
, VDataSeries& rVDataSeries, sal_Int32 nPointIndex
- , const uno::Reference< drawing::XShapes >& xTarget )
+ , const uno::Reference< drawing::XShapes >& xTarget
+ , double* pfScaledLogicX )
{
if(m_nDimension!=2)
return;
@@ -898,7 +941,8 @@ void VSeriesPlotter::createErrorBar_Y( const drawing::Position3D& rUnscaledLogic
createErrorBar( xErrorBarsGroup_Shapes
, rUnscaledLogicPosition, xErrorBarProp
, rVDataSeries, nPointIndex
- , true /* bYError */ );
+ , true /* bYError */
+ , pfScaledLogicX );
}
}
@@ -936,13 +980,13 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries
aRegressionPoly.SequenceZ[0].realloc(nRegressionPointCount);
sal_Int32 nRealPointCount=0;
- uno::Sequence< chart2::ExplicitScaleData > aScaleDataSeq( m_pPosHelper->getScales());
+ std::vector< ExplicitScaleData > aScales( m_pPosHelper->getScales());
uno::Reference< chart2::XScaling > xScalingX;
uno::Reference< chart2::XScaling > xScalingY;
- if( aScaleDataSeq.getLength() >= 2 )
+ if( aScales.size() >= 2 )
{
- xScalingX.set( aScaleDataSeq[0].Scaling );
- xScalingY.set( aScaleDataSeq[1].Scaling );
+ xScalingX.set( aScales[0].Scaling );
+ xScalingY.set( aScales[1].Scaling );
}
uno::Sequence< geometry::RealPoint2D > aCalculatedPoints(
@@ -1126,35 +1170,58 @@ void VSeriesPlotter::setMappedProperties(
PropertyMapper::setMappedProperties(xTargetProp,xSource,rMap,pOverwriteMap);
}
+void VSeriesPlotter::setTimeResolutionOnXAxis( long TimeResolution, const Date& rNullDate )
+{
+ m_nTimeResolution = TimeResolution;
+ m_aNullDate = rNullDate;
+}
+
//-------------------------------------------------------------------------
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
-
-double VSeriesPlotter::getMinimumX()
+long VSeriesPlotter::calculateTimeResolutionOnXAxis()
{
- if( m_bCategoryXAxis )
+ long nRet = ::com::sun::star::chart::TimeUnit::YEAR;
+ if( m_pExplicitCategoriesProvider )
{
- double fRet = 1.0;//first category (index 0) matches with real number 1.0
- if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() )
- fRet -= 0.5;
- return fRet;
+ const std::vector< DatePlusIndex >& rDateCategories = m_pExplicitCategoriesProvider->getDateCategories();
+ std::vector< DatePlusIndex >::const_iterator aIt = rDateCategories.begin(), aEnd = rDateCategories.end();
+ Date aNullDate(30,12,1899);
+ if( m_apNumberFormatterWrapper.get() )
+ aNullDate = m_apNumberFormatterWrapper->getNullDate();
+ if( aIt!=aEnd )
+ {
+ Date aPrevious(aNullDate); aPrevious+=rtl::math::approxFloor(aIt->fValue);
+ ++aIt;
+ for(;aIt!=aEnd;++aIt)
+ {
+ Date aCurrent(aNullDate); aCurrent+=rtl::math::approxFloor(aIt->fValue);
+ if( ::com::sun::star::chart::TimeUnit::YEAR == nRet )
+ {
+ if( DateHelper::IsInSameYear( aPrevious, aCurrent ) )
+ nRet = ::com::sun::star::chart::TimeUnit::MONTH;
+ }
+ if( ::com::sun::star::chart::TimeUnit::MONTH == nRet )
+ {
+ if( DateHelper::IsInSameMonth( aPrevious, aCurrent ) )
+ nRet = ::com::sun::star::chart::TimeUnit::DAY;
+ }
+ if( ::com::sun::star::chart::TimeUnit::DAY == nRet )
+ break;
+ aPrevious=aCurrent;
+ }
+ }
}
-
+ return nRet;
+}
+double VSeriesPlotter::getMinimumX()
+{
double fMinimum, fMaximum;
this->getMinimumAndMaximiumX( fMinimum, fMaximum );
return fMinimum;
}
double VSeriesPlotter::getMaximumX()
{
- if( m_bCategoryXAxis )
- {
- //return category count
- double fRet = getPointCount();//first category (index 0) matches with real number 1.0
- if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() )
- fRet += 0.5;
- return fRet;
- }
-
double fMinimum, fMaximum;
this->getMinimumAndMaximiumX( fMinimum, fMaximum );
return fMaximum;
@@ -1162,7 +1229,7 @@ double VSeriesPlotter::getMaximumX()
double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
{
- if( !m_bCategoryXAxis )
+ if( !m_bCategoryXAxis || ( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() ) )
{
double fMinY, fMaxY;
this->getMinimumAndMaximiumYInContinuousXRange( fMinY, fMaxY, fMinimumX, fMaximumX, nAxisIndex );
@@ -1196,7 +1263,7 @@ double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, s
double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
{
- if( !m_bCategoryXAxis )
+ if( !m_bCategoryXAxis || ( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() ) )
{
double fMinY, fMaxY;
this->getMinimumAndMaximiumYInContinuousXRange( fMinY, fMaxY, fMinimumX, fMaximumX, nAxisIndex );
@@ -1231,13 +1298,13 @@ double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, s
double VSeriesPlotter::getMinimumZ()
{
//this is the default for all charts without a meaningfull z axis
- return 0.5;
+ return 1.0;
}
double VSeriesPlotter::getMaximumZ()
{
- if( 3!=m_nDimension )
- return 0.5;
- return m_aZSlots.size()+0.5;
+ if( 3!=m_nDimension || !m_aZSlots.size() )
+ return getMinimumZ()+1;
+ return m_aZSlots.size();
}
namespace
@@ -1603,7 +1670,7 @@ double VSeriesPlotter::getTransformedDepth() const
return FIXED_SIZE_FOR_3D_CHART_VOLUME/(MaxZ-MinZ);
}
-void SAL_CALL VSeriesPlotter::addSecondaryValueScale( const ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
+void VSeriesPlotter::addSecondaryValueScale( const ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
throw (uno::RuntimeException)
{
if( nAxisIndex<1 )
@@ -1633,9 +1700,9 @@ PlottingPositionHelper& VSeriesPlotter::getPlottingPositionHelper( sal_Int32 nAx
}
}
if( !pRet )
- {
pRet = m_pMainPosHelper;
- }
+ if(pRet)
+ pRet->setTimeResolution( m_nTimeResolution, m_aNullDate );
return *pRet;
}
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index 4174226b6f62..0aad597d2475 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -49,11 +49,8 @@
#include <com/sun/star/lang/XTypeProvider.hpp>
// header for class SvxShape
#include <svx/unoshape.hxx>
-// header for GetSdrObjectFromXShape
-#include <svx/unoapi.hxx>
// header for class E3dScene
#include <svx/scene3d.hxx>
-#include <rtl/math.hxx>
#include <svx/e3dsceneupdater.hxx>
//.............................................................................
@@ -107,7 +104,7 @@ VDiagram::~VDiagram()
delete m_pShapeFactory;
}
-void SAL_CALL VDiagram::init(
+void VDiagram::init(
const uno::Reference< drawing::XShapes >& xLogicTarget
, const uno::Reference< drawing::XShapes >& xFinalTarget
, const uno::Reference< lang::XMultiServiceFactory >& xFactory )
diff --git a/chart2/source/view/inc/DateHelper.hxx b/chart2/source/view/inc/DateHelper.hxx
new file mode 100644
index 000000000000..c2352e246695
--- /dev/null
+++ b/chart2/source/view/inc/DateHelper.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 _CHART2_DATEHELPER_HXX
+#define _CHART2_DATEHELPER_HXX
+
+#include <com/sun/star/chart2/XScaling.hpp>
+#include <tools/date.hxx>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+//-----------------------------------------------------------------------------
+/**
+*/
+
+class DateHelper
+{
+public:
+ static bool IsInSameYear( const Date& rD1, const Date& rD2 );
+ static bool IsInSameMonth( const Date& rD1, const Date& rD2 );
+
+ static long GetMonthsBetweenDates( Date aD1, Date aD2 );
+ static Date GetDateSomeMonthsAway( const Date& rD, long nMonthDistance );
+ static Date GetDateSomeYearsAway( const Date& rD, long nYearDistance );
+ static bool IsLessThanOneMonthAway( const Date& rD1, const Date& rD2 );
+ static bool IsLessThanOneYearAway( const Date& rD1, const Date& rD2 );
+
+ static double RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution );
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
index 1e53d5c144c5..dee1fec8e67d 100644
--- a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
+++ b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
@@ -29,7 +29,7 @@
#define _CHART2_MINIMUMANDMAXIMUMSUPPLIER_HXX
#include <sal/types.h>
-
+#include <tools/date.hxx>
#include <set>
//.............................................................................
@@ -60,6 +60,10 @@ public:
virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ) = 0;
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) = 0;
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) = 0;
+
+ //return a constant out of ::com::sun::star::chart::TimeUnit that allows to display the smallest distance between occuring dates
+ virtual long calculateTimeResolutionOnXAxis() = 0;
+ virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) = 0;
};
class MergedMinimumAndMaximumSupplier : public MinimumAndMaximumSupplier
@@ -86,6 +90,9 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex );
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
+ virtual long calculateTimeResolutionOnXAxis();
+ virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate );
+
private:
typedef ::std::set< MinimumAndMaximumSupplier* > MinimumAndMaximumSupplierSet;
MinimumAndMaximumSupplierSet m_aMinimumAndMaximumSupplierList;
diff --git a/chart2/source/view/inc/PlotterBase.hxx b/chart2/source/view/inc/PlotterBase.hxx
index 63e276b19e44..7920845248e4 100644
--- a/chart2/source/view/inc/PlotterBase.hxx
+++ b/chart2/source/view/inc/PlotterBase.hxx
@@ -27,28 +27,18 @@
#ifndef _CHART2_PLOTTERBASE_HXX
#define _CHART2_PLOTTERBASE_HXX
+#include "chartview/ExplicitScaleValues.hxx"
+
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-/*
-#include <com/sun/star/lang/XComponent.hpp>
-*/
-
-//----
-#include <vector>
-
-//---- chart2
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XTransformation.hpp>
-/*
-#include <com/sun/star/chart2/XPlotter.hpp>
-*/
-//----
#include <cppuhelper/implbase1.hxx>
+#include <vector>
//.............................................................................
namespace chart
@@ -64,8 +54,7 @@ public:
PlotterBase( sal_Int32 nDimension );
virtual ~PlotterBase();
- // ___chart2::XPlotter___
- virtual void SAL_CALL initPlotter(
+ virtual void initPlotter(
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
@@ -75,21 +64,13 @@ public:
, const rtl::OUString& rCID
) throw (::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL setScales(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (::com::sun::star::uno::RuntimeException);
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix );
- virtual void SAL_CALL createShapes() = 0;
+ virtual void createShapes() = 0;
static bool isValidPosition( const ::com::sun::star::drawing::Position3D& rPos );
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx
index a1f16883b779..42c7a90a0116 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -28,9 +28,10 @@
#define _CHART2_PLOTTINGPOSITIONHELPER_HXX
#include "LabelAlignment.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
+
#include <basegfx/range/b2drectangle.hxx>
#include <rtl/math.hxx>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XTransformation.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
@@ -62,23 +63,22 @@ public:
virtual ~PlottingPositionHelper();
virtual PlottingPositionHelper* clone() const;
- virtual PlottingPositionHelper* createSecondaryPosHelper( const ::com::sun::star::chart2::ExplicitScaleData& rSecondaryScale );
+ virtual PlottingPositionHelper* createSecondaryPosHelper( const ExplicitScaleData& rSecondaryScale );
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix);
- virtual void setScales( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis );
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& getScales() const;
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
+ const ::std::vector< ExplicitScaleData >& getScales() const;
//better performance for big data
inline void setCoordinateSystemResolution( const ::com::sun::star::uno::Sequence< sal_Int32 >& rCoordinateSystemResolution );
inline bool isSameForGivenResolution( double fX, double fY, double fZ
, double fX2, double fY2, double fZ2 );
+ inline bool isStrongLowerRequested( sal_Int32 nDimensionIndex ) const;
inline bool isLogicVisible( double fX, double fY, double fZ ) const;
inline void doLogicScaling( double* pX, double* pY, double* pZ, bool bClip=false ) const;
+ inline void doUnshiftedLogicScaling( double* pX, double* pY, double* pZ, bool bClip=false ) const;
inline void clipLogicValues( double* pX, double* pY, double* pZ ) const;
void clipScaledLogicValues( double* pX, double* pY, double* pZ ) const;
inline bool clipYRange( double& rMin, double& rMax ) const;
@@ -123,10 +123,14 @@ public:
inline bool maySkipPointsInRegressionCalculation() const;
+ void setTimeResolution( long nTimeResolution, const Date& rNullDate );
+ virtual void setScaledCategoryWidth( double fScaledCategoryWidth );
+ void AllowShiftXAxisPos( bool bAllowShift );
+ void AllowShiftZAxisPos( bool bAllowShift );
+
protected: //member
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData > m_aScales;
- ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
+ ::std::vector< ExplicitScaleData > m_aScales;
+ ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
//this is calculated based on m_aScales and m_aMatrixScreenToScene
mutable ::com::sun::star::uno::Reference<
@@ -139,6 +143,14 @@ protected: //member
sal_Int32 m_nZResolution;
bool m_bMaySkipPointsInRegressionCalculation;
+
+ bool m_bDateAxis;
+ long m_nTimeResolution;
+ Date m_aNullDate;
+
+ double m_fScaledCategoryWidth;
+ bool m_bAllowShiftXAxisPos;
+ bool m_bAllowShiftZAxisPos;
};
//describes wich axis of the drawinglayer scene or sreen axis are the normal axis
@@ -163,9 +175,7 @@ public:
virtual PlottingPositionHelper* clone() const;
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix);
- virtual void setScales( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis );
+ virtual void setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
::basegfx::B3DHomMatrix getUnitCartesianToScene() const;
@@ -227,14 +237,14 @@ private:
bool PolarPlottingPositionHelper::isMathematicalOrientationAngle() const
{
- const ::com::sun::star::chart2::ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[1] : m_aScales[2];
+ const ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[1] : m_aScales[2];
if( ::com::sun::star::chart2::AxisOrientation_MATHEMATICAL==rScale.Orientation )
return true;
return false;
}
bool PolarPlottingPositionHelper::isMathematicalOrientationRadius() const
{
- const ::com::sun::star::chart2::ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[0] : m_aScales[1];
+ const ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[0] : m_aScales[1];
if( ::com::sun::star::chart2::AxisOrientation_MATHEMATICAL==rScale.Orientation )
return true;
return false;
@@ -283,12 +293,23 @@ bool PlottingPositionHelper::isSameForGivenResolution( double fX, double fY, dou
return (bSameX && bSameY && bSameZ);
}
+bool PlottingPositionHelper::isStrongLowerRequested( sal_Int32 nDimensionIndex ) const
+{
+ if( m_aScales.empty() )
+ return false;
+ if( 0==nDimensionIndex )
+ return m_bAllowShiftXAxisPos && m_aScales[nDimensionIndex].ShiftedCategoryPosition;
+ else if( 2==nDimensionIndex )
+ return m_bAllowShiftZAxisPos && m_aScales[nDimensionIndex].ShiftedCategoryPosition;
+ return false;
+}
+
bool PlottingPositionHelper::isLogicVisible(
double fX, double fY, double fZ ) const
{
- return fX >= m_aScales[0].Minimum && fX <= m_aScales[0].Maximum
+ return fX >= m_aScales[0].Minimum && ( isStrongLowerRequested(0) ? fX < m_aScales[0].Maximum : fX <= m_aScales[0].Maximum )
&& fY >= m_aScales[1].Minimum && fY <= m_aScales[1].Maximum
- && fZ >= m_aScales[2].Minimum && fZ <= m_aScales[2].Maximum;
+ && fZ >= m_aScales[2].Minimum && ( isStrongLowerRequested(2) ? fZ < m_aScales[2].Maximum : fZ <= m_aScales[2].Maximum );
}
void PlottingPositionHelper::doLogicScaling( double* pX, double* pY, double* pZ, bool bClip ) const
@@ -296,6 +317,29 @@ void PlottingPositionHelper::doLogicScaling( double* pX, double* pY, double* pZ,
if(bClip)
this->clipLogicValues( pX,pY,pZ );
+ if(pX)
+ {
+ if( m_aScales[0].Scaling.is())
+ *pX = m_aScales[0].Scaling->doScaling(*pX);
+ if( m_bAllowShiftXAxisPos && m_aScales[0].ShiftedCategoryPosition )
+ (*pX) += m_fScaledCategoryWidth/2.0;
+ }
+ if(pY && m_aScales[1].Scaling.is())
+ *pY = m_aScales[1].Scaling->doScaling(*pY);
+ if(pZ)
+ {
+ if( m_aScales[2].Scaling.is())
+ *pZ = m_aScales[2].Scaling->doScaling(*pZ);
+ if( m_bAllowShiftZAxisPos && m_aScales[2].ShiftedCategoryPosition)
+ (*pZ) += 0.5;
+ }
+}
+
+void PlottingPositionHelper::doUnshiftedLogicScaling( double* pX, double* pY, double* pZ, bool bClip ) const
+{
+ if(bClip)
+ this->clipLogicValues( pX,pY,pZ );
+
if(pX && m_aScales[0].Scaling.is())
*pX = m_aScales[0].Scaling->doScaling(*pX);
if(pY && m_aScales[1].Scaling.is())
diff --git a/chart2/source/view/inc/ScaleAutomatism.hxx b/chart2/source/view/inc/ScaleAutomatism.hxx
index 4440ad26ac5a..327027efcf39 100644
--- a/chart2/source/view/inc/ScaleAutomatism.hxx
+++ b/chart2/source/view/inc/ScaleAutomatism.hxx
@@ -27,10 +27,11 @@
#ifndef _CHART2_SCALEAUTOMATISM_HXX
#define _CHART2_SCALEAUTOMATISM_HXX
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
+#include "chartview/ExplicitScaleValues.hxx"
#include <com/sun/star/chart2/ScaleData.hpp>
+#include <tools/date.hxx>
+
//.............................................................................
namespace chart
{
@@ -44,7 +45,7 @@ class ScaleAutomatism
{
public:
explicit ScaleAutomatism(
- const ::com::sun::star::chart2::ScaleData& rSourceScale );
+ const ::com::sun::star::chart2::ScaleData& rSourceScale, const Date& rNullDate );
virtual ~ScaleAutomatism();
/** Expands own value range with the passed minimum and maximum. */
@@ -75,30 +76,41 @@ public:
of the axis and the font size of the axis caption text. */
void setMaximumAutoMainIncrementCount( sal_Int32 nMaximumAutoMainIncrementCount );
+ /** Sets the time resolution to be used in case it is not set explicitly within the scale
+ */
+ void setAutomaticTimeResolution( sal_Int32 nTimeResolution );
+
/** Fills the passed scale data and increment data according to the own settings. */
void calculateExplicitScaleAndIncrement(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement ) const;
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement ) const;
::com::sun::star::chart2::ScaleData getScale() const;
+ Date getNullDate() const;
private:
/** Fills the passed scale data and increment data for category scaling. */
void calculateExplicitIncrementAndScaleForCategory(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement,
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
bool bAutoMinimum, bool bAutoMaximum ) const;
/** Fills the passed scale data and increment data for logarithmic scaling. */
void calculateExplicitIncrementAndScaleForLogarithmic(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement,
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
bool bAutoMinimum, bool bAutoMaximum ) const;
/** Fills the passed scale data and increment data for linear scaling. */
void calculateExplicitIncrementAndScaleForLinear(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement,
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
+ bool bAutoMinimum, bool bAutoMaximum ) const;
+
+ /** Fills the passed scale data and increment data for date-time axis. */
+ void calculateExplicitIncrementAndScaleForDateTimeAxis(
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
bool bAutoMinimum, bool bAutoMaximum ) const;
private:
@@ -111,6 +123,9 @@ private:
bool m_bExpandIfValuesCloseToBorder; /// true = Expand if values are too close to the borders.
bool m_bExpandWideValuesToZero; /// true = Expand wide spread values to zero.
bool m_bExpandNarrowValuesTowardZero; /// true = Expand narrow range toward zero (add half of range).
+ sal_Int32 m_nTimeResolution;// a constant out of ::com::sun::star::chart::TimeUnit
+
+ Date m_aNullDate;
};
//.............................................................................
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx
index e884af865d6e..f4fd12547118 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -31,9 +31,8 @@
#include "ScaleAutomatism.hxx"
#include "ThreeDHelper.hxx"
#include "ExplicitCategoriesProvider.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include "comphelper/implementationreference.hxx"
#include <com/sun/star/awt/Rectangle.hpp>
@@ -63,7 +62,7 @@ public:
static VCoordinateSystem* createCoordinateSystem( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel );
- virtual void SAL_CALL initPlottingTargets(
+ virtual void initPlottingTargets(
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
@@ -83,16 +82,16 @@ public:
virtual ::com::sun::star::uno::Sequence< sal_Int32 > getCoordinateSystemResolution( const ::com::sun::star::awt::Size& rPageSize
, const ::com::sun::star::awt::Size& rPageResolution );
- ::com::sun::star::chart2::ExplicitScaleData getExplicitScale( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
- ::com::sun::star::chart2::ExplicitIncrementData getExplicitIncrement( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
+ ExplicitScaleData getExplicitScale( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
+ ExplicitIncrementData getExplicitIncrement( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
void setExplicitCategoriesProvider( ExplicitCategoriesProvider* /*takes ownership*/ );
ExplicitCategoriesProvider* getExplicitCategoriesProvider();
// returns a coplete scale set for a given dimension and index; for example if nDimensionIndex==1 and nAxisIndex==2 you get returned the secondary x axis, main y axis and main z axis
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData > getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
+ ::std::vector< ExplicitScaleData > getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
// returns a coplete increment set for a given dimension and index; for example if nDimensionIndex==1 and nAxisIndex==2 you get returned the secondary x axis, main y axis and main z axis
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitIncrementData > getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
+ ::std::vector< ExplicitIncrementData > getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
@@ -101,8 +100,8 @@ public:
void prepareScaleAutomatismForDimensionAndIndex( ScaleAutomatism& rScaleAutomatism, sal_Int32 nDimIndex, sal_Int32 nAxisIndex );
void setExplicitScaleAndIncrement( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
- , const ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement );
+ , const ExplicitScaleData& rExplicitScale
+ , const ExplicitIncrementData& rExplicitIncrement );
void set3DWallPositions( CuboidPlanePosition eLeftWallPos, CuboidPlanePosition eBackWallPos, CuboidPlanePosition eBottomPos );
@@ -143,8 +142,6 @@ protected: //methods
VAxisBase* getVAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
- void prepareScaleAutomatism( ScaleAutomatism& rScaleAutomatism, double fMin, double fMax, sal_Int32 nDimIndex, sal_Int32 nAxisIndex );
-
rtl::OUString createCIDForAxis( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XAxis >& xAxis
, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
@@ -194,11 +191,11 @@ protected: //member
tVAxisMap m_aAxisMap;
private:
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData > m_aExplicitScales;
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitIncrementData > m_aExplicitIncrements;
+ std::vector< ExplicitScaleData > m_aExplicitScales;
+ std::vector< ExplicitIncrementData > m_aExplicitIncrements;
- typedef std::map< tFullAxisIndex, ::com::sun::star::chart2::ExplicitScaleData > tFullExplicitScaleMap;
- typedef std::map< tFullAxisIndex, ::com::sun::star::chart2::ExplicitIncrementData > tFullExplicitIncrementMap;
+ typedef std::map< tFullAxisIndex, ExplicitScaleData > tFullExplicitScaleMap;
+ typedef std::map< tFullAxisIndex, ExplicitIncrementData > tFullExplicitIncrementMap;
tFullExplicitScaleMap m_aSecondaryExplicitScales;
tFullExplicitIncrementMap m_aSecondaryExplicitIncrements;
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index 93aba58dbec4..62d61cb17269 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -81,6 +81,10 @@ public:
getModel() const;
void setCategoryXAxis();
+ void setXValues( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSequence >& xValues );
+ void setXValuesIfNone( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSequence >& xValues );
void setParticle( const rtl::OUString& rSeriesParticle );
void setGlobalSeriesIndex( sal_Int32 nGlobalSeriesIndex );
void setPageReferenceSize( const ::com::sun::star::awt::Size & rPageRefSize );
diff --git a/chart2/source/view/inc/VDiagram.hxx b/chart2/source/view/inc/VDiagram.hxx
index 5df198c2f539..6bcef92111ef 100644
--- a/chart2/source/view/inc/VDiagram.hxx
+++ b/chart2/source/view/inc/VDiagram.hxx
@@ -56,7 +56,7 @@ public: //methods
, sal_Int32 nDimension=3, sal_Bool bPolar=sal_False );
virtual ~VDiagram();
- void SAL_CALL init( const ::com::sun::star::uno::Reference<
+ void init( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xFinalTarget
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index 6b6b06437542..8147c3443ec6 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -174,8 +174,7 @@ public:
)
*/
- virtual void SAL_CALL addSecondaryValueScale( const
- ::com::sun::star::chart2::ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
+ virtual void addSecondaryValueScale( const ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
throw (::com::sun::star::uno::RuntimeException);
//-------------------------------------------------------------------------
@@ -197,6 +196,9 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex );
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
+ virtual long calculateTimeResolutionOnXAxis();
+ virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate );
+
//------
void getMinimumAndMaximiumX( double& rfMinimum, double& rfMaximum ) const;
@@ -379,12 +381,14 @@ protected: //methods
, const VDataSeries& rVDataSeries
, sal_Int32 nIndex
, bool bVertical
+ , double* pfScaledLogicX
);
virtual void createErrorBar_Y( const ::com::sun::star::drawing::Position3D& rUnscaledLogicPosition
, VDataSeries& rVDataSeries, sal_Int32 nPointIndex
, const ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShapes >& xTarget );
+ ::com::sun::star::drawing::XShapes >& xTarget
+ , double* pfScaledLogicX=0 );
virtual void createRegressionCurvesShapes( VDataSeries& rVDataSeries
, const ::com::sun::star::uno::Reference<
@@ -425,6 +429,8 @@ protected: //member
::std::vector< ::std::vector< VDataSeriesGroup > > m_aZSlots;
bool m_bCategoryXAxis;//true->xvalues are indices (this would not be necessary if series for category chart wouldn't have x-values)
+ long m_nTimeResolution;
+ Date m_aNullDate;
::std::auto_ptr< NumberFormatterWrapper > m_apNumberFormatterWrapper;
AxesNumberFormats m_aAxesNumberFormats;//direct numberformats on axes, if empty ask the data series instead
@@ -439,7 +445,7 @@ protected: //member
bool m_bPointsWereSkipped;
private: //member
- typedef std::map< sal_Int32 , ::com::sun::star::chart2::ExplicitScaleData > tSecondaryValueScales;
+ typedef std::map< sal_Int32 , ExplicitScaleData > tSecondaryValueScales;
tSecondaryValueScales m_aSecondaryValueScales;
typedef std::map< sal_Int32 , PlottingPositionHelper* > tSecondaryPosHelperMap;
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index c997f9ee483d..fe83c0eea7e2 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -65,52 +65,17 @@ ChartItemPool::ChartItemPool():
SvULongs aTmp;
ppPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS,aTmp);
ppPoolDefaults[SCHATTR_DATADESCR_NO_PERCENTVALUE - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE);
+ ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE - SCHATTR_START] = new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
+ ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
+ //legend
ppPoolDefaults[SCHATTR_LEGEND_POS - SCHATTR_START] = new SvxChartLegendPosItem( CHLEGEND_RIGHT, SCHATTR_LEGEND_POS );
-// ppPoolDefaults[SCHATTR_TEXT_ORIENT - SCHATTR_START] = new SvxChartTextOrientItem;
+
+ //text
+ ppPoolDefaults[SCHATTR_TEXT_DEGREES - SCHATTR_START] = new SfxInt32Item(SCHATTR_TEXT_DEGREES, 0);
ppPoolDefaults[SCHATTR_TEXT_STACKED - SCHATTR_START] = new SfxBoolItem(SCHATTR_TEXT_STACKED,FALSE);
- ppPoolDefaults[SCHATTR_TEXT_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(CHTXTORDER_SIDEBYSIDE, SCHATTR_TEXT_ORDER);
-
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_MIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_MIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_MAX);
- ppPoolDefaults[SCHATTR_Y_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_MAX);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_STEP_HELP);
- ppPoolDefaults[SCHATTR_Y_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_STEP_HELP);
- ppPoolDefaults[SCHATTR_Y_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_LOGARITHM);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_ORIGIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_ORIGIN);
-
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_MIN);
- ppPoolDefaults[SCHATTR_X_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_MIN);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_MAX);
- ppPoolDefaults[SCHATTR_X_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_MAX);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_STEP_MAIN);
- ppPoolDefaults[SCHATTR_X_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_STEP_MAIN);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_STEP_HELP);
- ppPoolDefaults[SCHATTR_X_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_STEP_HELP);
- ppPoolDefaults[SCHATTR_X_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_LOGARITHM);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_ORIGIN);
- ppPoolDefaults[SCHATTR_X_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_ORIGIN);
-
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_MIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_MIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_MAX);
- ppPoolDefaults[SCHATTR_Z_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_MAX);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_STEP_HELP);
- ppPoolDefaults[SCHATTR_Z_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_STEP_HELP);
- ppPoolDefaults[SCHATTR_Z_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_LOGARITHM);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_ORIGIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_ORIGIN);
-
- ppPoolDefaults[SCHATTR_AXISTYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXISTYPE, CHART_AXIS_X);
- ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE - SCHATTR_START] = new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
- ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
+ //statistic
ppPoolDefaults[SCHATTR_STAT_AVERAGE - SCHATTR_START] = new SfxBoolItem (SCHATTR_STAT_AVERAGE);
ppPoolDefaults[SCHATTR_STAT_KIND_ERROR - SCHATTR_START] = new SvxChartKindErrorItem (CHERROR_NONE, SCHATTR_STAT_KIND_ERROR);
ppPoolDefaults[SCHATTR_STAT_PERCENT - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_PERCENT);
@@ -121,9 +86,6 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_STAT_RANGE_POS - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_POS, String());
ppPoolDefaults[SCHATTR_STAT_RANGE_NEG - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_NEG, String());
- ppPoolDefaults[SCHATTR_TEXT_DEGREES - SCHATTR_START] = new SfxInt32Item(SCHATTR_TEXT_DEGREES, 0);
- ppPoolDefaults[SCHATTR_TEXT_OVERLAP - SCHATTR_START] = new SfxBoolItem(SCHATTR_TEXT_OVERLAP,FALSE);
-
ppPoolDefaults[SCHATTR_STYLE_DEEP - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_DEEP, 0);
ppPoolDefaults[SCHATTR_STYLE_3D - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_3D, 0);
ppPoolDefaults[SCHATTR_STYLE_VERTICAL - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_VERTICAL, 0);
@@ -137,37 +99,43 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_AXIS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS,2); //2 = Y-Achse!!!
+ //axis scale
+ ppPoolDefaults[SCHATTR_AXISTYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXISTYPE, CHART_AXIS_REALNUMBER);
+ ppPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_REVERSE,0);
ppPoolDefaults[SCHATTR_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_MIN);
ppPoolDefaults[SCHATTR_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_MIN);
ppPoolDefaults[SCHATTR_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_MAX);
ppPoolDefaults[SCHATTR_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_MAX);
ppPoolDefaults[SCHATTR_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN);
ppPoolDefaults[SCHATTR_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_MAIN);
+ ppPoolDefaults[SCHATTR_AXIS_MAIN_TIME_UNIT - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT,2);
ppPoolDefaults[SCHATTR_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP);
-// ppPoolDefaults[SCHATTR_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_HELP);
- // type changed from double to sal_Int32
ppPoolDefaults[SCHATTR_AXIS_STEP_HELP - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_STEP_HELP,0);
+ ppPoolDefaults[SCHATTR_AXIS_HELP_TIME_UNIT - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT,2);
+ ppPoolDefaults[SCHATTR_AXIS_AUTO_TIME_RESOLUTION - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION);
+ ppPoolDefaults[SCHATTR_AXIS_TIME_RESOLUTION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION,2);
ppPoolDefaults[SCHATTR_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LOGARITHM);
+ ppPoolDefaults[SCHATTR_AXIS_AUTO_DATEAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS);
+ ppPoolDefaults[SCHATTR_AXIS_ALLOW_DATEAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_ALLOW_DATEAXIS);
ppPoolDefaults[SCHATTR_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN);
ppPoolDefaults[SCHATTR_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_ORIGIN);
+ //axis position
ppPoolDefaults[SCHATTR_AXIS_TICKS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_TICKS,CHAXIS_MARK_OUTER);
- ppPoolDefaults[SCHATTR_AXIS_NUMFMT - SCHATTR_START] = new SfxUInt32Item(SCHATTR_AXIS_NUMFMT,0);
- ppPoolDefaults[SCHATTR_AXIS_NUMFMTPERCENT - SCHATTR_START] = new SfxUInt32Item(SCHATTR_AXIS_NUMFMTPERCENT,11);
- ppPoolDefaults[SCHATTR_AXIS_SHOWAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWAXIS,0);
- ppPoolDefaults[SCHATTR_AXIS_SHOWDESCR - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR,0);
- ppPoolDefaults[SCHATTR_AXIS_SHOWMAINGRID - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWMAINGRID,0);
- ppPoolDefaults[SCHATTR_AXIS_SHOWHELPGRID - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWHELPGRID,0);
- ppPoolDefaults[SCHATTR_AXIS_TOPDOWN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_TOPDOWN,0);
ppPoolDefaults[SCHATTR_AXIS_HELPTICKS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_HELPTICKS,0);
- ppPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_REVERSE,0);
-
ppPoolDefaults[SCHATTR_AXIS_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_POSITION,0);
ppPoolDefaults[SCHATTR_AXIS_POSITION_VALUE - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_POSITION_VALUE);
ppPoolDefaults[SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT - SCHATTR_START] = new SfxUInt32Item(SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT,0);
ppPoolDefaults[SCHATTR_AXIS_LABEL_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_LABEL_POSITION,0);
ppPoolDefaults[SCHATTR_AXIS_MARK_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_MARK_POSITION,0);
+ //axis label
+ ppPoolDefaults[SCHATTR_AXIS_SHOWDESCR - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR,0);
+ ppPoolDefaults[SCHATTR_AXIS_LABEL_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(CHTXTORDER_SIDEBYSIDE, SCHATTR_AXIS_LABEL_ORDER);
+ ppPoolDefaults[SCHATTR_AXIS_LABEL_OVERLAP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_OVERLAP,FALSE);
+ ppPoolDefaults[SCHATTR_AXIS_LABEL_BREAK - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_BREAK, FALSE );
+
+ //--
ppPoolDefaults[SCHATTR_SYMBOL_BRUSH - SCHATTR_START] = new SvxBrushItem(SCHATTR_SYMBOL_BRUSH);
ppPoolDefaults[SCHATTR_STOCK_VOLUME - SCHATTR_START] = new SfxBoolItem(SCHATTR_STOCK_VOLUME,0);
ppPoolDefaults[SCHATTR_STOCK_UPDOWN - SCHATTR_START] = new SfxBoolItem(SCHATTR_STOCK_UPDOWN,0);
@@ -181,16 +149,16 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_SPLINE_ORDER - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_ORDER, 3 );
ppPoolDefaults[SCHATTR_SPLINE_RESOLUTION - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_RESOLUTION, 20 );
ppPoolDefaults[SCHATTR_DIAGRAM_STYLE - SCHATTR_START] = new SvxChartStyleItem( CHSTYLE_2D_COLUMN, SCHATTR_DIAGRAM_STYLE );
- ppPoolDefaults[SCHATTR_TEXTBREAK - SCHATTR_START] = new SfxBoolItem( SCHATTR_TEXTBREAK, FALSE );
ppPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, FALSE);
- ppPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE);
ppPoolDefaults[SCHATTR_STARTING_ANGLE - SCHATTR_START] = new SfxInt32Item( SCHATTR_STARTING_ANGLE, 90 );
ppPoolDefaults[SCHATTR_CLOCKWISE - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, FALSE );
ppPoolDefaults[SCHATTR_MISSING_VALUE_TREATMENT - SCHATTR_START] = new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0);
ppPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,aTmp);
+ ppPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE);
ppPoolDefaults[SCHATTR_AXIS_FOR_ALL_SERIES - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0);
+
ppPoolDefaults[SCHATTR_REGRESSION_TYPE - SCHATTR_START] = new SvxChartRegressItem (CHREGRESS_NONE, SCHATTR_REGRESSION_TYPE);
ppPoolDefaults[SCHATTR_REGRESSION_SHOW_EQUATION - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_EQUATION, 0);
ppPoolDefaults[SCHATTR_REGRESSION_SHOW_COEFF - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_COEFF, 0);
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 390c1890154e..72b40adfed88 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -31,6 +31,7 @@
#include "ChartView.hxx"
#include "chartview/DrawModelWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "ViewDefines.hxx"
#include "VDiagram.hxx"
#include "VTitle.hxx"
@@ -56,6 +57,7 @@
#include "ControllerLockGuard.hxx"
#include "BaseGFXHelper.hxx"
#include "DataSeriesHelper.hxx"
+#include "DateHelper.hxx"
#include <comphelper/scopeguard.hxx>
#include <boost/bind.hpp>
@@ -78,7 +80,6 @@
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
-#include <com/sun/star/chart2/ExplicitSubIncrement.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -472,7 +473,7 @@ private:
};
AxisUsage::AxisUsage()
- : aScaleAutomatism(AxisHelper::createDefaultScale())
+ : aScaleAutomatism(AxisHelper::createDefaultScale(),Date())
{
}
@@ -563,7 +564,7 @@ public:
~SeriesPlotterContainer();
void initializeCooSysAndSeriesPlotter( const uno::Reference< frame::XModel >& xChartModel );
- void initAxisUsageList();
+ void initAxisUsageList(const Date& rNullDate);
void doAutoScaling( const uno::Reference< frame::XModel >& xChartModel );
void updateScalesAndIncrementsOnAxes();
void setScalesFromCooSysToPlotter();
@@ -581,13 +582,15 @@ private:
std::vector< VCoordinateSystem* >& m_rVCooSysList;
::std::map< uno::Reference< XAxis >, AxisUsage > m_aAxisUsageList;
sal_Int32 m_nMaxAxisIndex;
- bool m_bChartTypeUsesShiftedXAxisTicksPerDefault;
+ bool m_bChartTypeUsesShiftedCategoryPositionPerDefault;
+ sal_Int32 m_nDefaultDateNumberFormat;
};
SeriesPlotterContainer::SeriesPlotterContainer( std::vector< VCoordinateSystem* >& rVCooSysList )
: m_rVCooSysList( rVCooSysList )
, m_nMaxAxisIndex(0)
- , m_bChartTypeUsesShiftedXAxisTicksPerDefault(false)
+ , m_bChartTypeUsesShiftedCategoryPositionPerDefault(false)
+ , m_nDefaultDateNumberFormat(0)
{
}
@@ -625,6 +628,10 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
return;
uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
+ uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
+ if( xChartDoc.is() && xChartDoc->hasInternalDataProvider()
+ && DiagramHelper::isSupportingDateAxis( xDiagram ) )
+ m_nDefaultDateNumberFormat=DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
if(!nDimensionCount)
@@ -682,7 +689,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
uno::Reference< XChartType > xChartType( aChartTypeList[nT] );
if(nT==0)
- m_bChartTypeUsesShiftedXAxisTicksPerDefault = ChartTypeHelper::shiftTicksAtXAxisPerDefault( xChartType );
+ m_bChartTypeUsesShiftedCategoryPositionPerDefault = ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( xChartType );
bool bExcludingPositioning = DiagramPositioningMode_EXCLUDING == DiagramHelper::getDiagramPositioningMode( xDiagram );
VSeriesPlotter* pPlotter = VSeriesPlotter::createSeriesPlotter( xChartType, nDimensionCount, bExcludingPositioning );
@@ -793,7 +800,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
}
}
-void SeriesPlotterContainer::initAxisUsageList()
+void SeriesPlotterContainer::initAxisUsageList(const Date& rNullDate)
{
m_aAxisUsageList.clear();
size_t nC;
@@ -803,8 +810,10 @@ void SeriesPlotterContainer::initAxisUsageList()
for(sal_Int32 nDimensionIndex=0; nDimensionIndex<3; nDimensionIndex++)
{
uno::Reference< XCoordinateSystem > xCooSys = pVCooSys->getModel();
- if( nDimensionIndex >= xCooSys->getDimension() )
+ sal_Int32 nDimensionCount = xCooSys->getDimension();
+ if( nDimensionIndex >= nDimensionCount )
continue;
+ bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), nDimensionCount, nDimensionIndex );
const sal_Int32 nMaximumAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
for(sal_Int32 nAxisIndex=0; nAxisIndex<=nMaximumAxisIndex; ++nAxisIndex)
{
@@ -813,7 +822,20 @@ void SeriesPlotterContainer::initAxisUsageList()
if( xAxis.is())
{
if(m_aAxisUsageList.find(xAxis)==m_aAxisUsageList.end())
- m_aAxisUsageList[xAxis].aScaleAutomatism = ScaleAutomatism(xAxis->getScaleData());
+ {
+ chart2::ScaleData aSourceScale = xAxis->getScaleData();
+ ExplicitCategoriesProvider* pExplicitCategoriesProvider = pVCooSys->getExplicitCategoriesProvider();
+ if( nDimensionIndex==0 )
+ AxisHelper::checkDateAxis( aSourceScale, pExplicitCategoriesProvider, bChartTypeAllowsDateAxis );
+ if( (aSourceScale.AxisType == AxisType::CATEGORY && m_bChartTypeUsesShiftedCategoryPositionPerDefault)
+ || (aSourceScale.AxisType==AxisType::CATEGORY && pExplicitCategoriesProvider && pExplicitCategoriesProvider->hasComplexCategories() )
+ || aSourceScale.AxisType == AxisType::DATE
+ || aSourceScale.AxisType == AxisType::SERIES )
+ aSourceScale.ShiftedCategoryPosition = true;
+ else
+ aSourceScale.ShiftedCategoryPosition = false;
+ m_aAxisUsageList[xAxis].aScaleAutomatism = ScaleAutomatism(aSourceScale,rNullDate);
+ }
AxisUsage& rAxisUsage = m_aAxisUsageList[xAxis];
rAxisUsage.addCoordinateSystem(pVCooSys,nDimensionIndex,nAxisIndex);
}
@@ -886,6 +908,11 @@ void SeriesPlotterContainer::setNumberFormatsFromAxes()
{
aAxesNumberFormats.setFormat( nNumberFormatKey, nDimensionIndex, nAxisIndex );
}
+ else if( nDimensionIndex==0 )
+ {
+ //provide a default date format for date axis with own data
+ aAxesNumberFormats.setFormat( m_nDefaultDateNumberFormat, nDimensionIndex, nAxisIndex );
+ }
}
}
catch( lang::IndexOutOfBoundsException& e )
@@ -936,13 +963,7 @@ void SeriesPlotterContainer::doAutoScaling( const uno::Reference< frame::XModel
rAxisUsage.aScaleAutomatism.calculateExplicitScaleAndIncrement( aExplicitScale, aExplicitIncrement );
for( nC=0; nC < aVCooSysList_X.size(); nC++)
- {
- ExplicitCategoriesProvider* pExplicitCategoriesProvider = aVCooSysList_X[nC]->getExplicitCategoriesProvider();
-
- if( m_bChartTypeUsesShiftedXAxisTicksPerDefault || (aExplicitScale.AxisType==AxisType::CATEGORY && pExplicitCategoriesProvider && pExplicitCategoriesProvider->hasComplexCategories() ) )
- aExplicitIncrement.ShiftedPosition = true;
aVCooSysList_X[nC]->setExplicitScaleAndIncrement( 0, nAxisIndex, aExplicitScale, aExplicitIncrement );
- }
for( nC=0; nC < aVCooSysList_Z.size(); nC++)
aVCooSysList_Z[nC]->setExplicitScaleAndIncrement( 2, nAxisIndex, aExplicitScale, aExplicitIncrement );
}
@@ -1027,7 +1048,6 @@ void SeriesPlotterContainer::AdaptScaleOfYAxisWithoutAttachedSeries( const uno::
aExplicitScaleDest.Orientation = aExplicitScaleSource.Orientation;
aExplicitScaleDest.Scaling = aExplicitScaleSource.Scaling;
- aExplicitScaleDest.Breaks = aExplicitScaleSource.Breaks;
aExplicitScaleDest.AxisType = aExplicitScaleSource.AxisType;
aExplicitIncrementDest.BaseValue = aExplicitIncrementSource.BaseValue;
@@ -1065,7 +1085,7 @@ void SeriesPlotterContainer::AdaptScaleOfYAxisWithoutAttachedSeries( const uno::
bAutoMinorInterval = !( aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() );
if( bAutoMinorInterval )
{
- if( aExplicitIncrementDest.SubIncrements.getLength() && aExplicitIncrementSource.SubIncrements.getLength() )
+ if( !aExplicitIncrementDest.SubIncrements.empty() && !aExplicitIncrementSource.SubIncrements.empty() )
aExplicitIncrementDest.SubIncrements[0].IntervalCount =
aExplicitIncrementSource.SubIncrements[0].IntervalCount;
}
@@ -1380,7 +1400,8 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( SeriesPlotterContainer&
// - prepare list of all axis and how they are used
- rSeriesPlotterContainer.initAxisUsageList();
+ Date aNullDate = NumberFormatterWrapper( uno::Reference< util::XNumberFormatsSupplier >( m_xChartModel, uno::UNO_QUERY ) ).getNullDate();
+ rSeriesPlotterContainer.initAxisUsageList(aNullDate);
rSeriesPlotterContainer.doAutoScaling( m_xChartModel );
rSeriesPlotterContainer.setScalesFromCooSysToPlotter();
rSeriesPlotterContainer.setNumberFormatsFromAxes();
@@ -1663,6 +1684,31 @@ sal_Bool ChartView::getExplicitValuesForAxis(
{
rExplicitScale = pVCooSys->getExplicitScale(nDimensionIndex,nAxisIndex);
rExplicitIncrement = pVCooSys->getExplicitIncrement(nDimensionIndex,nAxisIndex);
+ if( rExplicitScale.ShiftedCategoryPosition )
+ {
+ //remove 'one' from max
+ if( rExplicitScale.AxisType == ::com::sun::star::chart2::AxisType::DATE )
+ {
+ Date aMaxDate(rExplicitScale.NullDate); aMaxDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Maximum));
+ //for explicit scales with shifted categories we need one interval more
+ switch( rExplicitScale.TimeResolution )
+ {
+ case ::com::sun::star::chart::TimeUnit::DAY:
+ aMaxDate--;break;
+ case ::com::sun::star::chart::TimeUnit::MONTH:
+ aMaxDate = DateHelper::GetDateSomeMonthsAway(aMaxDate,-1);
+ break;
+ case ::com::sun::star::chart::TimeUnit::YEAR:
+ aMaxDate = DateHelper::GetDateSomeYearsAway(aMaxDate,-1);
+ break;
+ }
+ rExplicitScale.Maximum = aMaxDate - rExplicitScale.NullDate;
+ }
+ else if( rExplicitScale.AxisType == ::com::sun::star::chart2::AxisType::CATEGORY )
+ rExplicitScale.Maximum -= 1.0;
+ else if( rExplicitScale.AxisType == ::com::sun::star::chart2::AxisType::SERIES )
+ rExplicitScale.Maximum -= 1.0;
+ }
return sal_True;
}
return sal_False;
@@ -1791,166 +1837,15 @@ bool lcl_getPropertySwapXAndYAxis( const uno::Reference< XDiagram >& xDiagram )
}
-sal_Int32 lcl_getExplicitNumberFormatKeyForAxis(
- const Reference< chart2::XAxis >& xAxis
- , const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
- , const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
- , bool bSearchForParallelAxisIfNothingIsFound )
-{
- sal_Int32 nNumberFormatKey(0);
- Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
- if( xProp.is() && !( xProp->getPropertyValue( C2U( "NumberFormat" ) ) >>= nNumberFormatKey ) )
- {
- bool bPercentFormatSet = false;
- //check wether we have a percent scale -> use percent format
- if( xNumberFormatsSupplier.is() )
- {
- ScaleData aData = xAxis->getScaleData();
- if( aData.AxisType==AxisType::PERCENT )
- {
- sal_Int32 nPercentFormat = ExplicitValueProvider::getPercentNumberFormat( xNumberFormatsSupplier );
- if( nPercentFormat != -1 )
- {
- nNumberFormatKey = nPercentFormat;
- bPercentFormatSet = true;
- }
- }
- }
-
- if( !bPercentFormatSet )
- {
- typedef ::std::map< sal_Int32, sal_Int32 > tNumberformatFrequency;
- tNumberformatFrequency aKeyMap;
-
- bool bNumberFormatKeyFoundViaAttachedData = false;
- sal_Int32 nAxisIndex = 0;
- sal_Int32 nDimensionIndex = 1;
-
- try
- {
- Reference< XChartTypeContainer > xCTCnt( xCorrespondingCoordinateSystem, uno::UNO_QUERY_THROW );
- if( xCTCnt.is() )
- {
- AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex );
- ::rtl::OUString aRoleToMatch;
- if( nDimensionIndex == 0 )
- aRoleToMatch = C2U("values-x");
- Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
- for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
- {
- if( nDimensionIndex != 0 )
- aRoleToMatch = ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( aChartTypes[nCTIdx] );
- Reference< XDataSeriesContainer > xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW );
- Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries());
- for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aDataSeriesSeq.getLength(); ++nSeriesIdx )
- {
- Reference< chart2::XDataSeries > xDataSeries(aDataSeriesSeq[nSeriesIdx]);
- Reference< data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY_THROW );
-
- if( nDimensionIndex == 1 )
- {
- //only take those series into accoutn that are attached to this axis
- sal_Int32 nAttachedAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
- if( nAttachedAxisIndex != nAxisIndex )
- continue;
- }
-
- Sequence< Reference< data::XLabeledDataSequence > > aLabeledSeq( xSource->getDataSequences());
- for( sal_Int32 nLSeqIdx=0; nLSeqIdx<aLabeledSeq.getLength(); ++nLSeqIdx )
- {
- if(!aLabeledSeq[nLSeqIdx].is())
- continue;
- Reference< data::XDataSequence > xSeq( aLabeledSeq[nLSeqIdx]->getValues());
- if(!xSeq.is())
- continue;
- Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
- ::rtl::OUString aRole;
- bool bTakeIntoAccount =
- ( xSeqProp.is() && (aRoleToMatch.getLength() > 0) &&
- (xSeqProp->getPropertyValue(C2U("Role")) >>= aRole ) &&
- aRole.equals( aRoleToMatch ));
-
- if( bTakeIntoAccount )
- {
- sal_Int32 nKey = xSeq->getNumberFormatKeyByIndex( -1 );
- // initialize the value
- if( aKeyMap.find( nKey ) == aKeyMap.end())
- aKeyMap[ nKey ] = 0;
- // increase frequency
- aKeyMap[ nKey ] = (aKeyMap[ nKey ] + 1);
- }
- }
- }
- }
- }
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-
- if( ! aKeyMap.empty())
- {
- sal_Int32 nMaxFreq = 0;
- // find most frequent key
- for( tNumberformatFrequency::const_iterator aIt = aKeyMap.begin();
- aIt != aKeyMap.end(); ++aIt )
- {
- OSL_TRACE( "NumberFormatKey %d appears %d times", (*aIt).first, (*aIt).second );
- // all values must at least be 1
- if( (*aIt).second > nMaxFreq )
- {
- nNumberFormatKey = (*aIt).first;
- bNumberFormatKeyFoundViaAttachedData = true;
- nMaxFreq = (*aIt).second;
- }
- }
- }
-
- if( bSearchForParallelAxisIfNothingIsFound )
- {
- //no format is set to this axis and no data is set to this axis
- //--> try to obtain the format from the parallel y-axis
- if( !bNumberFormatKeyFoundViaAttachedData && nDimensionIndex == 1 )
- {
- sal_Int32 nParallelAxisIndex = (nAxisIndex==1) ?0 :1;
- Reference< XAxis > xParallelAxis( AxisHelper::getAxis( 1, nParallelAxisIndex, xCorrespondingCoordinateSystem ) );
- nNumberFormatKey = lcl_getExplicitNumberFormatKeyForAxis( xParallelAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier, false );
- }
- }
- }
- }
- return nNumberFormatKey;
-}
-
sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
const Reference< chart2::XAxis >& xAxis
, const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
, const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
- return lcl_getExplicitNumberFormatKeyForAxis( xAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier
+ return AxisHelper::getExplicitNumberFormatKeyForAxis( xAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier
, true /*bSearchForParallelAxisIfNothingIsFound*/ );
}
-sal_Int32 ExplicitValueProvider::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
-{
- sal_Int32 nRet=-1;
- Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
- if( xNumberFormats.is() )
- {
- sal_Bool bCreate = sal_True;
- const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
- Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::PERCENT,
- rLocaleDataWrapper.getLocale(), bCreate );
- if( aKeySeq.getLength() )
- {
- nRet = aKeySeq[0];
- }
- }
- return nRet;
-}
-
-
sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp,
const uno::Reference< XDataSeries >& xSeries,
@@ -2003,7 +1898,7 @@ sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabe
return nFormat;
if( !(xSeriesOrPointProp->getPropertyValue(C2U( "PercentageNumberFormat" )) >>= nFormat) )
{
- nFormat = ExplicitValueProvider::getPercentNumberFormat( xNumberFormatsSupplier );
+ nFormat = DiagramHelper::getPercentNumberFormat( xNumberFormatsSupplier );
}
if(nFormat<0)
nFormat=0;
diff --git a/chart2/source/view/main/ChartView.hxx b/chart2/source/view/main/ChartView.hxx
index 476adae03674..76c1ce5c4858 100644
--- a/chart2/source/view/main/ChartView.hxx
+++ b/chart2/source/view/main/ChartView.hxx
@@ -103,8 +103,8 @@ public:
// ___ExplicitValueProvider___
virtual sal_Bool getExplicitValuesForAxis(
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > xAxis
- , ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale
- , ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement );
+ , ExplicitScaleData& rExplicitScale
+ , ExplicitIncrementData& rExplicitIncrement );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
getShapeForCID( const rtl::OUString& rObjectCID );
diff --git a/chart2/source/view/main/PlotterBase.cxx b/chart2/source/view/main/PlotterBase.cxx
index 08f43dc7064d..8a71f45b4dbb 100644
--- a/chart2/source/view/main/PlotterBase.cxx
+++ b/chart2/source/view/main/PlotterBase.cxx
@@ -56,8 +56,7 @@ PlotterBase::PlotterBase( sal_Int32 nDimensionCount )
{
}
- void SAL_CALL PlotterBase
-::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
+void PlotterBase::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
, const uno::Reference< drawing::XShapes >& xFinalTarget
, const uno::Reference< lang::XMultiServiceFactory >& xShapeFactory
, const rtl::OUString& rCID )
@@ -77,11 +76,9 @@ PlotterBase::~PlotterBase()
delete m_pShapeFactory;
}
-void SAL_CALL PlotterBase::setScales( const uno::Sequence< ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (uno::RuntimeException)
+void PlotterBase::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
- DBG_ASSERT(m_nDimension<=rScales.getLength(),"Dimension of Plotter does not fit two dimension of given scale sequence");
+ DBG_ASSERT(m_nDimension<=static_cast<sal_Int32>(rScales.size()),"Dimension of Plotter does not fit two dimension of given scale sequence");
m_pPosHelper->setScales( rScales, bSwapXAndYAxis );
}
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index b5d39b2f898f..e257581d664b 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -32,12 +32,14 @@
#include "ViewDefines.hxx"
#include "Linear3DTransformation.hxx"
#include "VPolarTransformation.hxx"
-
#include "ShapeFactory.hxx"
#include "PropertyMapper.hxx"
+#include "DateHelper.hxx"
+
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/drawing/DoubleSequence.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/chart2/AxisType.hpp>
#include <rtl/math.hxx>
@@ -57,6 +59,12 @@ PlottingPositionHelper::PlottingPositionHelper()
, m_nYResolution( 1000 )
, m_nZResolution( 1000 )
, m_bMaySkipPointsInRegressionCalculation( true )
+ , m_bDateAxis(false)
+ , m_nTimeResolution( ::com::sun::star::chart::TimeUnit::DAY )
+ , m_aNullDate(30,12,1899)
+ , m_fScaledCategoryWidth(1.0)
+ , m_bAllowShiftXAxisPos(false)
+ , m_bAllowShiftZAxisPos(false)
{
}
PlottingPositionHelper::PlottingPositionHelper( const PlottingPositionHelper& rSource )
@@ -68,6 +76,12 @@ PlottingPositionHelper::PlottingPositionHelper( const PlottingPositionHelper& rS
, m_nYResolution( rSource.m_nYResolution )
, m_nZResolution( rSource.m_nZResolution )
, m_bMaySkipPointsInRegressionCalculation( rSource.m_bMaySkipPointsInRegressionCalculation )
+ , m_bDateAxis( rSource.m_bDateAxis )
+ , m_nTimeResolution( rSource.m_nTimeResolution )
+ , m_aNullDate( rSource.m_aNullDate )
+ , m_fScaledCategoryWidth( rSource.m_fScaledCategoryWidth )
+ , m_bAllowShiftXAxisPos( rSource.m_bAllowShiftXAxisPos )
+ , m_bAllowShiftZAxisPos( rSource.m_bAllowShiftZAxisPos )
{
}
@@ -95,13 +109,13 @@ void PlottingPositionHelper::setTransformationSceneToScreen( const drawing::Homo
m_xTransformationLogicToScene = NULL;
}
-void PlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleData >& rScales, sal_Bool bSwapXAndYAxis )
+void PlottingPositionHelper::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
m_aScales = rScales;
m_bSwapXAndY = bSwapXAndYAxis;
m_xTransformationLogicToScene = NULL;
}
-const uno::Sequence< ExplicitScaleData >& PlottingPositionHelper::getScales() const
+const std::vector< ExplicitScaleData >& PlottingPositionHelper::getScales() const
{
return m_aScales;
}
@@ -129,8 +143,8 @@ uno::Reference< XTransformation > PlottingPositionHelper::getTransformationScale
AxisOrientation nZAxisOrientation = m_aScales[2].Orientation;
//apply scaling
- doLogicScaling( &MinX, &MinY, &MinZ );
- doLogicScaling( &MaxX, &MaxY, &MaxZ);
+ doUnshiftedLogicScaling( &MinX, &MinY, &MinZ );
+ doUnshiftedLogicScaling( &MaxX, &MaxY, &MaxZ);
if(m_bSwapXAndY)
{
@@ -176,9 +190,9 @@ uno::Reference< XTransformation > PlottingPositionHelper::getTransformationScale
drawing::Position3D PlottingPositionHelper::transformLogicToScene(
double fX, double fY, double fZ, bool bClip ) const
{
- if(bClip)
- this->clipLogicValues( &fX,&fY,&fZ );
this->doLogicScaling( &fX,&fY,&fZ );
+ if(bClip)
+ this->clipScaledLogicValues( &fX,&fY,&fZ );
return this->transformScaledLogicToScene( fX, fY, fZ, false );
}
@@ -254,8 +268,8 @@ void PlottingPositionHelper::clipScaledLogicValues( double* pX, double* pY, doub
double MaxZ = getLogicMaxZ();
//apply scaling
- doLogicScaling( &MinX, &MinY, &MinZ );
- doLogicScaling( &MaxX, &MaxY, &MaxZ);
+ doUnshiftedLogicScaling( &MinX, &MinY, &MinZ );
+ doUnshiftedLogicScaling( &MaxX, &MaxY, &MaxZ);
if(pX)
{
@@ -291,8 +305,8 @@ basegfx::B2DRectangle PlottingPositionHelper::getScaledLogicClipDoubleRect() con
double MaxZ = getLogicMaxZ();
//apply scaling
- doLogicScaling( &MinX, &MinY, &MinZ );
- doLogicScaling( &MaxX, &MaxY, &MaxZ);
+ doUnshiftedLogicScaling( &MinX, &MinY, &MinZ );
+ doUnshiftedLogicScaling( &MaxX, &MaxY, &MaxZ);
basegfx::B2DRectangle aRet( MinX, MaxY, MaxX, MinY );
return aRet;
@@ -355,7 +369,7 @@ void PolarPlottingPositionHelper::setTransformationSceneToScreen( const drawing:
PlottingPositionHelper::setTransformationSceneToScreen( rMatrix);
m_aUnitCartesianToScene =impl_calculateMatrixUnitCartesianToScene( m_aMatrixScreenToScene );
}
-void PolarPlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleData >& rScales, sal_Bool bSwapXAndYAxis )
+void PolarPlottingPositionHelper::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
PlottingPositionHelper::setScales( rScales, bSwapXAndYAxis );
m_aUnitCartesianToScene =impl_calculateMatrixUnitCartesianToScene( m_aMatrixScreenToScene );
@@ -365,7 +379,7 @@ void PolarPlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleD
{
::basegfx::B3DHomMatrix aRet;
- if( !m_aScales.getLength() )
+ if( m_aScales.empty() )
return aRet;
double fTranslate =1.0;
@@ -640,6 +654,41 @@ double PlottingPositionHelper::getBaseValueY() const
return m_aScales[1].Origin;
}
+void PlottingPositionHelper::setTimeResolution( long nTimeResolution, const Date& rNullDate )
+{
+ m_nTimeResolution = nTimeResolution;
+ m_aNullDate = rNullDate;
+
+ //adapt category width
+ double fCategoryWidth = 1.0;
+ if( !m_aScales.empty() )
+ {
+ if( m_aScales[0].AxisType == ::com::sun::star::chart2::AxisType::DATE )
+ {
+ m_bDateAxis = true;
+ if( nTimeResolution == ::com::sun::star::chart::TimeUnit::YEAR )
+ {
+ const double fMonthCount = 12.0;//todo: this depends on the DateScaling and must be adjusted in case we use more generic calendars in future
+ fCategoryWidth = fMonthCount;
+ }
+ }
+ }
+ setScaledCategoryWidth(fCategoryWidth);
+}
+
+void PlottingPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
+{
+ m_fScaledCategoryWidth = fScaledCategoryWidth;
+}
+void PlottingPositionHelper::AllowShiftXAxisPos( bool bAllowShift )
+{
+ m_bAllowShiftXAxisPos = bAllowShift;
+}
+void PlottingPositionHelper::AllowShiftZAxisPos( bool bAllowShift )
+{
+ m_bAllowShiftZAxisPos = bAllowShift;
+}
+
/*
// ____ XTransformation ____
uno::Sequence< double > SAL_CALL PolarPlottingPositionHelper::transform(
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 8bb6a11b4baf..2b9512d4af2a 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -352,6 +352,22 @@ void VDataSeries::setCategoryXAxis()
m_bAllowPercentValueInDataLabel = true;
}
+void VDataSeries::setXValues( const Reference< chart2::data::XDataSequence >& xValues )
+{
+ m_aValues_X.clear();
+ m_aValues_X.init( xValues );
+ m_bAllowPercentValueInDataLabel = true;
+}
+
+void VDataSeries::setXValuesIfNone( const Reference< chart2::data::XDataSequence >& xValues )
+{
+ if( m_aValues_X.is() )
+ return;
+
+ m_aValues_X.init( xValues );
+ lcl_clearIfNoValuesButTextIsContained( m_aValues_X, xValues );
+}
+
void VDataSeries::setGlobalSeriesIndex( sal_Int32 nGlobalSeriesIndex )
{
m_nGlobalSeriesIndex = nGlobalSeriesIndex;
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index 9a011498991b..fbc74bad05a5 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -632,7 +632,7 @@ VLegend::VLegend(
// ----------------------------------------
-void SAL_CALL VLegend::init(
+void VLegend::init(
const Reference< drawing::XShapes >& xTargetPage,
const Reference< lang::XMultiServiceFactory >& xFactory,
const Reference< frame::XModel >& xModel )
diff --git a/chart2/source/view/main/VLegend.hxx b/chart2/source/view/main/VLegend.hxx
index 9587b50f71e7..4534a350f4f4 100644
--- a/chart2/source/view/main/VLegend.hxx
+++ b/chart2/source/view/main/VLegend.hxx
@@ -56,7 +56,7 @@ public:
::com::sun::star::uno::XComponentContext > & xContext,
const std::vector< LegendEntryProvider* >& rLegendEntryProviderList );
- void SAL_CALL init( const ::com::sun::star::uno::Reference<
+ void init( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTargetPage,
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory >& xFactory,
diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx
index f62142735b7c..c2aa01163b17 100644
--- a/chart2/source/view/main/VTitle.cxx
+++ b/chart2/source/view/main/VTitle.cxx
@@ -65,7 +65,7 @@ VTitle::~VTitle()
{
}
-void SAL_CALL VTitle::init(
+void VTitle::init(
const uno::Reference< drawing::XShapes >& xTargetPage
, const uno::Reference< lang::XMultiServiceFactory >& xFactory
, const rtl::OUString& rCID )
diff --git a/chart2/source/view/main/VTitle.hxx b/chart2/source/view/main/VTitle.hxx
index 8a6e7d6e4f16..e097ecd3bbcc 100644
--- a/chart2/source/view/main/VTitle.hxx
+++ b/chart2/source/view/main/VTitle.hxx
@@ -47,7 +47,7 @@ public:
::com::sun::star::chart2::XTitle > & xTitle );
virtual ~VTitle();
- void SAL_CALL init( const ::com::sun::star::uno::Reference<
+ void init( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTargetPage
, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
, const rtl::OUString& rCID );
diff --git a/chart2/source/view/main/makefile.mk b/chart2/source/view/main/makefile.mk
index ec9c99f2a898..8675930aa107 100644
--- a/chart2/source/view/main/makefile.mk
+++ b/chart2/source/view/main/makefile.mk
@@ -43,7 +43,6 @@ ENABLE_EXCEPTIONS= TRUE
SLOFILES = \
$(SLO)$/ChartItemPool.obj \
$(SLO)$/DrawModelWrapper.obj \
- $(SLO)$/NumberFormatterWrapper.obj \
$(SLO)$/PropertyMapper.obj \
$(SLO)$/Stripe.obj \
$(SLO)$/VLineProperties.obj \
diff --git a/comphelper/inc/comphelper/TypeGeneration.hxx b/comphelper/inc/comphelper/TypeGeneration.hxx
index 6660e560f4af..08401cb39944 100644
--- a/comphelper/inc/comphelper/TypeGeneration.hxx
+++ b/comphelper/inc/comphelper/TypeGeneration.hxx
@@ -115,6 +115,7 @@ namespace comphelper
CPPUTYPE_SEQNAMEDVALUE, //getCppuType( (Sequence<beans::NamedValue>*)0 )
CPPUTYPE_REFXGRAPHIC, //getCppuType( Reference< graphic::XGraphic >*)0)
CPPUTYPE_TABLEBORDERDISTANCES, //getCppuType( (table::TableBorderDistances*)0 )
+ CPPUTPYE_REFEMBEDDEDOBJECT, // XEmbeddedObject::static_type
CPPUTYPE_END
};
diff --git a/comphelper/inc/comphelper/asyncnotification.hxx b/comphelper/inc/comphelper/asyncnotification.hxx
index fc4dfcd48dd9..22d901728ef7 100644
--- a/comphelper/inc/comphelper/asyncnotification.hxx
+++ b/comphelper/inc/comphelper/asyncnotification.hxx
@@ -131,8 +131,9 @@ namespace comphelper
virtual oslInterlockedCount SAL_CALL acquire();
virtual oslInterlockedCount SAL_CALL release();
- /// creates (starts) the thread
using AsyncEventNotifier_TBASE::create;
+ using AsyncEventNotifier_TBASE::join;
+ using AsyncEventNotifier_TBASE::getIdentifier;
using AsyncEventNotifier_TBASE::operator new;
using AsyncEventNotifier_TBASE::operator delete;
diff --git a/comphelper/inc/comphelper/documentconstants.hxx b/comphelper/inc/comphelper/documentconstants.hxx
index 73b90d72cc8a..e53bb03ce773 100644
--- a/comphelper/inc/comphelper/documentconstants.hxx
+++ b/comphelper/inc/comphelper/documentconstants.hxx
@@ -136,7 +136,6 @@
#define SFX_FILTER_STARONEFILTER 0x00080000L
#define SFX_FILTER_PACKED 0x00100000L
-#define SFX_FILTER_SILENTEXPORT 0x00200000L
#define SFX_FILTER_BROWSERPREFERED 0x00400000L
diff --git a/comphelper/inc/comphelper/flagguard.hxx b/comphelper/inc/comphelper/flagguard.hxx
new file mode 100755
index 000000000000..4fc1f4e97833
--- /dev/null
+++ b/comphelper/inc/comphelper/flagguard.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef COMPHELPER_FLAGGUARD_HXX
+#define COMPHELPER_FLAGGUARD_HXX
+
+#include "comphelper/scopeguard.hxx"
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= FlagRestorationGuard
+ //==================================================================================================================
+ class COMPHELPER_DLLPUBLIC FlagRestorationGuard : public ScopeGuard
+ {
+ public:
+ FlagRestorationGuard( bool& i_flagRef, bool i_temporaryValue, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( RestoreFlag, ::boost::ref( i_flagRef ), !!i_flagRef ), i_excHandling )
+ {
+ i_flagRef = i_temporaryValue;
+ }
+
+ ~FlagRestorationGuard();
+
+ private:
+ static void RestoreFlag( bool& i_flagRef, bool i_originalValue )
+ {
+ i_flagRef = i_originalValue;
+ }
+ };
+
+ //==================================================================================================================
+ //= FlagGuard
+ //==================================================================================================================
+ class COMPHELPER_DLLPUBLIC FlagGuard : public ScopeGuard
+ {
+ public:
+ explicit FlagGuard( bool& i_flagRef, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
+ :ScopeGuard( ::boost::bind( ResetFlag, ::boost::ref( i_flagRef ) ), i_excHandling )
+ {
+ i_flagRef = true;
+ }
+
+ ~FlagGuard();
+
+ private:
+ static void ResetFlag( bool& i_flagRef )
+ {
+ i_flagRef = false;
+ }
+ };
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_FLAGGUARD_HXX
diff --git a/comphelper/inc/comphelper/scopeguard.hxx b/comphelper/inc/comphelper/scopeguard.hxx
index 1fdd179404a2..e9c8f7ecc625 100644
--- a/comphelper/inc/comphelper/scopeguard.hxx
+++ b/comphelper/inc/comphelper/scopeguard.hxx
@@ -67,21 +67,6 @@ private:
exc_handling const m_excHandling;
};
-class COMPHELPER_DLLPUBLIC FlagGuard : ScopeGuard
-{
-public:
- explicit FlagGuard( bool& i_flagRef, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
- :ScopeGuard( ::boost::bind( ResetFlag, ::boost::ref( i_flagRef ) ), i_excHandling )
- {
- }
-
-private:
- static void ResetFlag( bool& i_flagRef )
- {
- i_flagRef = false;
- }
-};
-
} // namespace comphelper
#endif // ! defined(INCLUDED_COMPHELPER_SCOPEGUARD_HXX)
diff --git a/comphelper/source/misc/scopeguard.cxx b/comphelper/source/misc/scopeguard.cxx
index 7ce478d8bea0..ccd5b618605b 100644
--- a/comphelper/source/misc/scopeguard.cxx
+++ b/comphelper/source/misc/scopeguard.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
-#include "comphelper/scopeguard.hxx"
+#include "comphelper/flagguard.hxx"
#include "osl/diagnose.h"
#include "com/sun/star/uno/Exception.hpp"
@@ -67,5 +67,13 @@ void ScopeGuard::dismiss()
m_func.clear();
}
+FlagGuard::~FlagGuard()
+{
+}
+
+FlagRestorationGuard::~FlagRestorationGuard()
+{
+}
+
} // namespace comphelper
diff --git a/comphelper/source/property/TypeGeneration.cxx b/comphelper/source/property/TypeGeneration.cxx
index bf880330ce75..649e50711d28 100644
--- a/comphelper/source/property/TypeGeneration.cxx
+++ b/comphelper/source/property/TypeGeneration.cxx
@@ -132,7 +132,8 @@
// --> OD 2004-08-09 #i28749#
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
// <--
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -230,6 +231,7 @@ namespace comphelper
case CPPUTYPE_SEQNAMEDVALUE: pType = &::getCppuType( (Sequence<beans::NamedValue>*)0 ); break;
case CPPUTYPE_REFXGRAPHIC: pType = &::getCppuType( (Reference< graphic::XGraphic >*)0); break;
case CPPUTYPE_TABLEBORDERDISTANCES: pType = &::getCppuType( (table::TableBorderDistances*)0 ); break;
+ case CPPUTPYE_REFEMBEDDEDOBJECT: pType = &embed::XEmbeddedObject::static_type(); break;
default:
OSL_ASSERT( "Unknown CPPU type" );
}
diff --git a/connectivity/inc/connectivity/PColumn.hxx b/connectivity/inc/connectivity/PColumn.hxx
index 547cc8fb9970..1e9dc8b560f1 100644
--- a/connectivity/inc/connectivity/PColumn.hxx
+++ b/connectivity/inc/connectivity/PColumn.hxx
@@ -125,15 +125,27 @@ namespace connectivity
class OOO_DLLPUBLIC_DBTOOLS OOrderColumn :
public OOrderColumn_BASE, public OOrderColumn_PROP
{
- sal_Bool m_bAscending;
- sal_Bool m_bOrder;
+ const sal_Bool m_bAscending;
+ const ::rtl::OUString m_sTableName;
+
protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
virtual ~OOrderColumn();
public:
- OOrderColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,sal_Bool _bCase,sal_Bool _bAscending);
+ OOrderColumn(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
+ const ::rtl::OUString& i_rOriginatingTableName,
+ sal_Bool _bCase,
+ sal_Bool _bAscending
+ );
+
+ OOrderColumn(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
+ sal_Bool _bCase,
+ sal_Bool _bAscending
+ );
virtual void construct();
diff --git a/connectivity/inc/connectivity/dbconversion.hxx b/connectivity/inc/connectivity/dbconversion.hxx
index 6a54a3e92d2d..75c491e505e6 100644
--- a/connectivity/inc/connectivity/dbconversion.hxx
+++ b/connectivity/inc/connectivity/dbconversion.hxx
@@ -98,17 +98,18 @@ namespace dbtools
const double& rValue,
sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException);
- static double getValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& xVariant, const ::com::sun::star::util::Date& rNullDate,
- sal_Int16 nKeyType);
+ static double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& xVariant, const ::com::sun::star::util::Date& rNullDate );
// get the columnvalue as string with a default format given by the column or a default format
// for the type
- static ::rtl::OUString getValue(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
+ static ::rtl::OUString getFormattedValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
const ::com::sun::star::lang::Locale& _rLocale,
const ::com::sun::star::util::Date& rNullDate);
- static ::rtl::OUString getValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _xColumn,
+ static ::rtl::OUString getFormattedValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _xColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
const ::com::sun::star::util::Date& rNullDate,
sal_Int32 nKey,
diff --git a/connectivity/inc/connectivity/virtualdbtools.hxx b/connectivity/inc/connectivity/virtualdbtools.hxx
index 70b17dcb37c9..1ad4c1d7d77d 100644
--- a/connectivity/inc/connectivity/virtualdbtools.hxx
+++ b/connectivity/inc/connectivity/virtualdbtools.hxx
@@ -256,17 +256,16 @@ namespace connectivity
virtual double getValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant,
- const ::com::sun::star::util::Date& rNullDate,
- sal_Int16 nKeyType) const = 0;
+ const ::com::sun::star::util::Date& rNullDate ) const = 0;
- virtual ::rtl::OUString getValue(
+ virtual ::rtl::OUString getFormattedValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
const ::com::sun::star::util::Date& _rNullDate,
sal_Int32 _nKey,
sal_Int16 _nKeyType) const = 0;
- virtual ::rtl::OUString getValue(
+ virtual ::rtl::OUString getFormattedValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter,
const ::com::sun::star::lang::Locale& _rLocale,
diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst
index 6d70bc71c97c..8d16197961fa 100644
--- a/connectivity/prj/build.lst
+++ b/connectivity/prj/build.lst
@@ -28,5 +28,5 @@ cn connectivity\source\parse nmake - all cn_parse cn_
cn connectivity\source\simpledbt nmake - all cn_simpledbt cn_cmtools cn_inc NULL
cn connectivity\source\dbtools nmake - all cn_dbtools cn_simpledbt cn_cmtools cn_parse cn_res cn_sdbcx cn_inc cn_res NULL
cn connectivity\qa\connectivity\tools nmake - all cn_qa_tools cn_inc NULL
+cn connectivity\qa nmake - all cn_qa cn_inc NULL
cn connectivity\util nmake - all cn_util cn_ado cn_mozab cn_kab cn_evoab2 cn_calc cn_odbc cn_mysql cn_jdbc cn_adabas cn_flat cn_dbase cn_hsqldb cn_macab NULL
-
diff --git a/connectivity/qa/drivers/dbase/DBaseDriverTest.java b/connectivity/qa/complex/connectivity/DBaseDriverTest.java
index 2e2920b4145b..5b9e456ab367 100644
--- a/connectivity/qa/drivers/dbase/DBaseDriverTest.java
+++ b/connectivity/qa/complex/connectivity/DBaseDriverTest.java
@@ -24,36 +24,18 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package qa.drivers.dbase;
+package complex.connectivity;
-import com.sun.star.sdbc.*;
+import complex.connectivity.dbase.DBaseDateFunctions;
+import complex.connectivity.dbase.DBaseStringFunctions;
+import complex.connectivity.dbase.DBaseSqlTests;
+import complex.connectivity.dbase.DBaseNumericFunctions;
import com.sun.star.lang.XMultiServiceFactory;
import complexlib.ComplexTestCase;
-import java.util.*;
-import java.io.*;
import share.LogWriter;
-//import complex.connectivity.DBaseStringFunctions;
-public class DBaseDriverTest extends ComplexTestCase
+public class DBaseDriverTest extends ComplexTestCase implements TestCase
{
-
- private static Properties props = new Properties();
- private XDriver m_xDiver;
- private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
-
- static
- {
- try
- {
- String propsFile = "test.properties";
- props.load(new FileInputStream(propsFile));
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- }
-
public String[] getTestMethodNames()
{
return new String[]
@@ -62,19 +44,21 @@ public class DBaseDriverTest extends ComplexTestCase
};
}
+ @Override
public String getTestObjectName()
{
return "DBaseDriverTest";
}
- public void assure2(String s, boolean b)
+ @Override
+ public void assure( final String i_message, final boolean i_condition )
{
- assure(s, b);
+ super.assure( i_message, i_condition );
}
public LogWriter getLog()
{
- return log;
+ return ComplexTestCase.log;
}
public void Functions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
diff --git a/connectivity/qa/complex/connectivity/FlatFileAccess.java b/connectivity/qa/complex/connectivity/FlatFileAccess.java
new file mode 100755
index 000000000000..3f0481684827
--- /dev/null
+++ b/connectivity/qa/complex/connectivity/FlatFileAccess.java
@@ -0,0 +1,237 @@
+package complex.connectivity;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.CommandType;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.util.Date;
+import complexlib.ComplexTestCase;
+import connectivity.tools.CsvDatabase;
+import connectivity.tools.RowSet;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+public class FlatFileAccess extends ComplexTestCase
+{
+ public FlatFileAccess()
+ {
+ super();
+ }
+
+ @Override
+ public String[] getTestMethodNames()
+ {
+ return new String[] {
+ "testBasicAccess",
+ "testCalendarFunctions",
+ "testSortingByFunction"
+ };
+ }
+
+ @Override
+ public String getTestObjectName()
+ {
+ return "FlatFileAccess";
+ }
+
+ public void before() throws Exception
+ {
+ m_database = new CsvDatabase( (XMultiServiceFactory)param.getMSF() );
+
+ // proper settings
+ final XPropertySet dataSourceSettings = m_database.getDataSource().geSettings();
+ dataSourceSettings.setPropertyValue( "Extension", "csv" );
+ dataSourceSettings.setPropertyValue( "HeaderLine", Boolean.TRUE );
+ dataSourceSettings.setPropertyValue( "FieldDelimiter", " " );
+ m_database.store();
+
+ // write the table(s) for our test
+ final String tableLocation = m_database.getTableFileLocation().getAbsolutePath();
+ final PrintWriter tableWriter = new PrintWriter( new FileOutputStream( tableLocation + File.separatorChar + "dates.csv", false ) );
+ tableWriter.println( "ID date" );
+ tableWriter.println( "1 2013-01-01" );
+ tableWriter.println( "2 2012-02-02" );
+ tableWriter.println( "3 2011-03-03" );
+ tableWriter.close();
+ }
+
+ public void after()
+ {
+ }
+
+ private class EqualityDate extends Date
+ {
+ EqualityDate( short i_day, short i_month, short i_year )
+ {
+ super( i_day, i_month, i_year );
+ }
+
+ EqualityDate( Date i_date )
+ {
+ super( i_date.Day, i_date.Month, i_date.Year );
+ }
+
+ @Override
+ public boolean equals( Object i_compare )
+ {
+ if ( !( i_compare instanceof Date ) )
+ return false;
+ return Day == ((Date)i_compare).Day
+ && Month == ((Date)i_compare).Month
+ && Year == ((Date)i_compare).Year;
+ }
+ }
+
+ /**
+ * ensures simple SELECTs from our table(s) work, and deliver the expected results
+ */
+ public void testBasicAccess()
+ {
+ testRowSetResults(
+ "SELECT * FROM \"dates\"",
+ new RowSetIntGetter(1),
+ new Integer[] { 1, 2, 3 },
+ "simple select", "wrong IDs"
+ );
+
+ testRowSetResults(
+ "SELECT * FROM \"dates\"",
+ new RowSetDateGetter( 2 ),
+ new EqualityDate[] { new EqualityDate( (short)1, (short)1, (short)2013 ),
+ new EqualityDate( (short)2, (short)2, (short)2012 ),
+ new EqualityDate( (short)3, (short)3, (short)2011 )
+ },
+ "simple select", "wrong dates"
+ );
+ testRowSetResults(
+ "SELECT \"date\", \"ID\" FROM \"dates\" ORDER BY \"ID\" DESC",
+ new RowSetIntGetter( 2 ),
+ new Integer[] { 3, 2, 1 },
+ "explicit column selection, sorted by IDs", "wrong IDs"
+ );
+ testRowSetResults(
+ "SELECT * FROM \"dates\" ORDER BY \"date\"",
+ new RowSetIntGetter( 1 ),
+ new Integer[] { 3, 2, 1 },
+ "sorted by date", "wrong IDs"
+ );
+ }
+
+ /**
+ * ensures the basic functionality for selecting calendar functions from a CSV table - this is a prerequisite for
+ * later tests.
+ */
+ public void testCalendarFunctions()
+ {
+ // simple check for proper results of the calendar functions (DATE/MONTH)
+ // The * at the first position is crucial here - there was code which wrongly calculated
+ // column positions of function columns when * was present in the statement
+ testRowSetResults(
+ "SELECT \"dates\".*, YEAR( \"date\" ) FROM \"dates\"",
+ new RowSetIntGetter( 3 ),
+ new Integer[] { 2013, 2012, 2011 },
+ "YEAR function", "wrong calculated years"
+ );
+ testRowSetResults(
+ "SELECT \"dates\".*, MONTH( \"date\" ) FROM \"dates\"",
+ new RowSetIntGetter( 3 ),
+ new Integer[] { 1, 2, 3 },
+ "MONTH function", "wrong calculated months"
+ );
+ }
+
+ /**
+ * ensures that sorting by a function column works
+ */
+ public void testSortingByFunction()
+ {
+ // most simple case: select a function, and sort by it
+ testRowSetResults(
+ "SELECT YEAR( \"date\" ) AS \"year\" FROM \"dates\" ORDER BY \"year\"",
+ new RowSetIntGetter(1),
+ new Integer[] { 2011, 2012, 2013 },
+ "single YEAR selection, sorted by years", "wrong calculated years"
+ );
+ // somewhat more "difficult" (this used to crash): Select all columns, plus a function, so the calculated
+ // column has a position greater than column count
+ testRowSetResults(
+ "SELECT \"dates\".*, YEAR( \"date\" ) AS \"year\" FROM \"dates\" ORDER BY \"year\" DESC",
+ new RowSetIntGetter(3),
+ new Integer[] { 2013, 2012, 2011 },
+ "extended YEAR selection, sorted by years", "wrong calculated years"
+ );
+ }
+
+ private interface RowSetValueGetter
+ {
+ public Object getValue( final RowSet i_rowSet ) throws SQLException;
+ }
+
+ private abstract class RowSetColumnValueGetter implements RowSetValueGetter
+ {
+ RowSetColumnValueGetter( final int i_columnIndex )
+ {
+ m_columnIndex = i_columnIndex;
+ }
+
+ protected final int m_columnIndex;
+ }
+
+ private class RowSetIntGetter extends RowSetColumnValueGetter
+ {
+ RowSetIntGetter( final int i_columnIndex )
+ {
+ super( i_columnIndex );
+ }
+
+ public Object getValue( final RowSet i_rowSet ) throws SQLException
+ {
+ return i_rowSet.getInt( m_columnIndex );
+ }
+ }
+
+ private class RowSetDateGetter extends RowSetColumnValueGetter
+ {
+ RowSetDateGetter( final int i_columnIndex )
+ {
+ super( i_columnIndex );
+ }
+
+ public Object getValue( final RowSet i_rowSet ) throws SQLException
+ {
+ return i_rowSet.getDate( m_columnIndex );
+ }
+ }
+
+ private <T> void testRowSetResults( String i_command, RowSetValueGetter i_getter,
+ T[] i_expectedValues, String i_context, String i_failureDesc )
+ {
+ RowSet rowSet = null;
+ try
+ {
+ rowSet = m_database.createRowSet( CommandType.COMMAND, i_command );
+ rowSet.execute();
+
+ List< T > values = new ArrayList< T >();
+ while ( rowSet.next() )
+ {
+ values.add( (T)i_getter.getValue( rowSet ) );
+ }
+ assureEquals( i_context + ": " + i_failureDesc, i_expectedValues, values.toArray(), true );
+ }
+ catch( final SQLException e )
+ {
+ failed( i_context + ": caught an exception: " + e.toString(), false );
+ }
+ finally
+ {
+ if ( rowSet != null )
+ rowSet.dispose();
+ }
+ }
+
+ private CsvDatabase m_database = null;
+}
diff --git a/connectivity/qa/drivers/hsqldb/DriverTest.java b/connectivity/qa/complex/connectivity/HsqlDriverTest.java
index d343a1309a05..28ad862c4a76 100644
--- a/connectivity/qa/drivers/hsqldb/DriverTest.java
+++ b/connectivity/qa/complex/connectivity/HsqlDriverTest.java
@@ -24,63 +24,50 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package qa.drivers.hsqldb;
+package complex.connectivity;
-import com.sun.star.awt.XWindow;
+import complex.connectivity.hsqldb.TestCacheSize;
import com.sun.star.frame.XModel;
-import com.sun.star.text.XTextDocument;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.util.XCloseable;
-import com.sun.star.sdbc.*;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.sdbc.XDataSource;
import com.sun.star.frame.XStorable;
import com.sun.star.lang.*;
import com.sun.star.document.XDocumentSubStorageSupplier;
import complexlib.ComplexTestCase;
-import java.io.PrintWriter;
-import util.utils;
-import java.util.*;
-import java.io.*;
-import org.hsqldb.jdbcDriver;
-import qa.drivers.hsqldb.DatabaseMetaData;
import org.hsqldb.lib.StopWatch;
-import com.sun.star.sdbc.*;
-import com.sun.star.container.XNameAccess;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.PropertyState;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.embed.XStorage;
+import com.sun.star.sdbc.XDataSource;
+import com.sun.star.sdbc.XDriver;
+import connectivity.tools.HsqlDatabase;
-public class DriverTest extends ComplexTestCase {
+public class HsqlDriverTest extends ComplexTestCase {
public String[] getTestMethodNames() {
return new String[] { "test" };
}
+ @Override
public String getTestObjectName() {
return "DriverTest";
}
public void assurePublic(String sMessage,boolean check){
- addResult(sMessage,check);
+ super.assure(sMessage,check);
}
public void test(){
- mThreadTimeOut = 10000000;
XDataSource ds = null;
System.gc();
try {
- XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.sdb.DatabaseContext"));
- ds = (XDataSource)UnoRuntime.queryInterface(XDataSource.class,xNameAccess.getByName("file:///g:/test.odb"));
+ HsqlDatabase database = new HsqlDatabase( (XMultiServiceFactory)param.getMSF() );
+ ds = database.getDataSource().getXDataSource();
} catch(Exception ex) {
- throw new RuntimeException("factory: unable to construct data source" );
+ throw new RuntimeException("factory: unable to construct data source" );
}
try{
@@ -141,7 +128,6 @@ public class DriverTest extends ComplexTestCase {
}catch(Exception e){}
}
public void test2(){
- mThreadTimeOut = 10000000;
System.gc();
com.sun.star.beans.PropertyValue[] info = null;
@@ -149,7 +135,7 @@ public class DriverTest extends ComplexTestCase {
try{
info = new com.sun.star.beans.PropertyValue[]{
new com.sun.star.beans.PropertyValue("JavaDriverClass",0,"org.hsqldb.jdbcDriver",PropertyState.DIRECT_VALUE)
- ,new com.sun.star.beans.PropertyValue("ParameterNameSubstitution",0,new Boolean(false),PropertyState.DIRECT_VALUE)
+ ,new com.sun.star.beans.PropertyValue("ParameterNameSubstitution",0, false,PropertyState.DIRECT_VALUE)
};
drv = (XDriver)UnoRuntime.queryInterface(XDriver.class,((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.comp.sdbc.JDBCDriver"));
TestCacheSize test = new TestCacheSize(((XMultiServiceFactory)param.getMSF()),info,drv);
diff --git a/connectivity/qa/drivers/jdbc/LongVarCharTest.java b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
index a5797b223b61..63a3e8f241bc 100644
--- a/connectivity/qa/drivers/jdbc/LongVarCharTest.java
+++ b/connectivity/qa/complex/connectivity/JdbcLongVarCharTest.java
@@ -40,7 +40,7 @@ import com.sun.star.sdbc.XRow;
import com.sun.star.uno.UnoRuntime;
import complexlib.ComplexTestCase;
-public class LongVarCharTest extends ComplexTestCase
+public class JdbcLongVarCharTest extends ComplexTestCase
{
public String[] getTestMethodNames()
@@ -51,6 +51,7 @@ public class LongVarCharTest extends ComplexTestCase
};
}
+ @Override
public String getTestObjectName()
{
return "LongVarCharTest";
diff --git a/connectivity/qa/complex/connectivity/SubTestCase.java b/connectivity/qa/complex/connectivity/SubTestCase.java
new file mode 100755
index 000000000000..1c2e685c5943
--- /dev/null
+++ b/connectivity/qa/complex/connectivity/SubTestCase.java
@@ -0,0 +1,23 @@
+package complex.connectivity;
+
+import share.LogWriter;
+
+public class SubTestCase implements TestCase
+{
+ protected SubTestCase( final TestCase i_parentTestCase )
+ {
+ m_parentTestCase = i_parentTestCase;
+ }
+
+ public void assure( String i_message, boolean i_condition )
+ {
+ m_parentTestCase.assure( i_message, i_condition );
+ }
+
+ public LogWriter getLog()
+ {
+ return m_parentTestCase.getLog();
+ }
+
+ private final TestCase m_parentTestCase;
+}
diff --git a/sfx2/inc/sfxbasic.hxx b/connectivity/qa/complex/connectivity/TestCase.java
index ff5f097500a5..bae5fcdcb4c4 100644..100755
--- a/sfx2/inc/sfxbasic.hxx
+++ b/connectivity/qa/complex/connectivity/TestCase.java
@@ -24,19 +24,12 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _SFXBASIC_HXX
-#define _SFXBASIC_HXX
+package complex.connectivity;
-class BasicManager;
-class SbMethod;
-
-//------------------------------------------------------------------
-
-SbMethod* SfxQueryMacro( BasicManager* pMgr, const String& rMacro );
-
-ErrCode SfxCallMacro( BasicManager* pMgr, const String& rMacro,
- SbxArray *pArgs = 0, SbxValue *pRet = 0 );
-
-
-#endif
+import share.LogWriter;
+public interface TestCase
+{
+ public void assure( final String i_message, final boolean i_condition );
+ public LogWriter getLog();
+}
diff --git a/connectivity/qa/drivers/dbase/DBaseDateFunctions.java b/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java
index b48ae2158359..9cfc6aaaf590 100644
--- a/connectivity/qa/drivers/dbase/DBaseDateFunctions.java
+++ b/connectivity/qa/complex/connectivity/dbase/DBaseDateFunctions.java
@@ -24,30 +24,26 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package qa.drivers.dbase;
+package complex.connectivity.dbase;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.sdbc.*;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
+import complex.connectivity.TestCase;
+import complex.connectivity.SubTestCase;
-public class DBaseDateFunctions
+public class DBaseDateFunctions extends SubTestCase
{
private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
private final XMultiServiceFactory m_xORB;
- private final DBaseDriverTest testcase;
- public DBaseDateFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase)
+ public DBaseDateFunctions(final XMultiServiceFactory _xORB, final TestCase i_testCase)
{
+ super( i_testCase );
m_xORB = _xORB;
- testcase = _testcase;
- }
-
- private void assure(final String s, final boolean b)
- {
- testcase.assure2(s, b);
}
public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
@@ -55,7 +51,7 @@ public class DBaseDateFunctions
final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- testcase.getLog().println("starting DateTime function test!");
+ getLog().println("starting DateTime function test!");
// set the properties needed to connect to a database
final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
xProp.setPropertyValue("DataSourceName", "Bibliography");
@@ -289,21 +285,21 @@ public class DBaseDateFunctions
{
final XRow row = execute(xRowRes, "CURDATE() ");
final com.sun.star.util.Date aDate = row.getDate(1);
- testcase.getLog().println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day + "'");
+ getLog().println("CURDATE() is '" + aDate.Year + "-" + aDate.Month + "-" + aDate.Day + "'");
}
private void curtime(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
{
final XRow row = execute(xRowRes, "CURTIME() ");
final com.sun.star.util.Time aTime = row.getTime(1);
- testcase.getLog().println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
+ getLog().println("CURTIME() is '" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
}
private void now(final XRowSet xRowRes) throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
{
final XRow row = execute(xRowRes, "NOW() ");
final com.sun.star.util.DateTime aTime = row.getTimestamp(1);
- testcase.getLog().println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'");
- testcase.getLog().println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
+ getLog().println("NOW() is '" + aTime.Year + "-" + aTime.Month + "-" + aTime.Day + "'");
+ getLog().println("'" + aTime.Hours + ":" + aTime.Minutes + ":" + aTime.Seconds + "'");
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java b/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java
index b3c8ff014a2f..f5aec94a3c23 100644
--- a/connectivity/qa/drivers/dbase/DBaseNumericFunctions.java
+++ b/connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions.java
@@ -24,30 +24,25 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package qa.drivers.dbase;
+package complex.connectivity.dbase;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.sdbc.*;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
+import complex.connectivity.SubTestCase;
+import complex.connectivity.TestCase;
-public class DBaseNumericFunctions
+public class DBaseNumericFunctions extends SubTestCase
{
-
private final String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
private final XMultiServiceFactory m_xORB;
- private final DBaseDriverTest testcase;
- public DBaseNumericFunctions(final XMultiServiceFactory _xORB, final DBaseDriverTest _testcase)
+ public DBaseNumericFunctions(final XMultiServiceFactory _xORB, final TestCase i_testCase)
{
+ super( i_testCase );
m_xORB = _xORB;
- testcase = _testcase;
- }
-
- private void assure(final String s, final boolean b)
- {
- testcase.assure2(s, b);
}
public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
@@ -55,7 +50,7 @@ public class DBaseNumericFunctions
final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- testcase.getLog().println("starting Numeric function test");
+ getLog().println("starting Numeric function test");
// set the properties needed to connect to a database
final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
xProp.setPropertyValue("DataSourceName", "Bibliography");
diff --git a/connectivity/qa/drivers/dbase/DBaseSqlTests.java b/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java
index c393c5a48356..1265e05e7bef 100755
--- a/connectivity/qa/drivers/dbase/DBaseSqlTests.java
+++ b/connectivity/qa/complex/connectivity/dbase/DBaseSqlTests.java
@@ -24,27 +24,23 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package qa.drivers.dbase;
+package complex.connectivity.dbase;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.sdbc.*;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
+import complex.connectivity.TestCase;
+import complex.connectivity.SubTestCase;
-public class DBaseSqlTests
+public class DBaseSqlTests extends SubTestCase
{
private final XMultiServiceFactory m_xORB;
- private final DBaseDriverTest testcase;
- public DBaseSqlTests(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase)
+ public DBaseSqlTests(final XMultiServiceFactory _xORB,final TestCase i_testCase)
{
+ super( i_testCase );
m_xORB = _xORB;
- testcase = _testcase;
- }
-
- private void assure(final String s,final boolean b)
- {
- testcase.assure2(s, b);
}
public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
@@ -52,7 +48,7 @@ public class DBaseSqlTests
final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- testcase.getLog().println("starting SQL test");
+ getLog().println("starting SQL test");
// set the properties needed to connect to a database
final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
xProp.setPropertyValue("DataSourceName", "Bibliography");
@@ -88,7 +84,7 @@ public class DBaseSqlTests
}
catch(SQLException e)
{
- testcase.getLog().println(sql + " Error: " + e.getMessage());
+ getLog().println(sql + " Error: " + e.getMessage());
}
}
diff --git a/connectivity/qa/drivers/dbase/DBaseStringFunctions.java b/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java
index 1d4ccf0a9b26..30b94484d53d 100644
--- a/connectivity/qa/drivers/dbase/DBaseStringFunctions.java
+++ b/connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions.java
@@ -24,28 +24,24 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package qa.drivers.dbase;
+package complex.connectivity.dbase;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.sdbc.*;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
+import complex.connectivity.SubTestCase;
+import complex.connectivity.TestCase;
-public class DBaseStringFunctions
+public class DBaseStringFunctions extends SubTestCase
{
private String where = "FROM \"biblio\" \"biblio\" where \"Identifier\" = 'BOR00'";
private final XMultiServiceFactory m_xORB;
- private final DBaseDriverTest testcase;
- public DBaseStringFunctions(final XMultiServiceFactory _xORB,final DBaseDriverTest _testcase)
+ public DBaseStringFunctions(final XMultiServiceFactory _xORB,final TestCase i_testCase)
{
+ super( i_testCase );
m_xORB = _xORB;
- testcase = _testcase;
- }
-
- private void assure(final String s,final boolean b)
- {
- testcase.assure2(s, b);
}
public void testFunctions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
@@ -53,7 +49,7 @@ public class DBaseStringFunctions
final XRowSet xRowRes = (XRowSet) UnoRuntime.queryInterface(XRowSet.class,
m_xORB.createInstance("com.sun.star.sdb.RowSet"));
- testcase.getLog().println("starting String function test");
+ getLog().println("starting String function test");
// set the properties needed to connect to a database
final XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xRowRes);
xProp.setPropertyValue("DataSourceName", "Bibliography");
diff --git a/connectivity/qa/drivers/hsqldb/DatabaseMetaData.java b/connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData.java
index ddc45a4e0ca1..a20bb992b4e3 100644
--- a/connectivity/qa/drivers/hsqldb/DatabaseMetaData.java
+++ b/connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData.java
@@ -8,21 +8,19 @@
*
* @author oj93728
*/
-package qa.drivers.hsqldb;
+package complex.connectivity.hsqldb;
+import complex.connectivity.HsqlDriverTest;
import java.sql.*;
-import com.sun.star.uno.UnoRuntime;
-import complexlib.ComplexTestCase;
import java.lang.reflect.Method;
-import qa.drivers.hsqldb.DriverTest;
public class DatabaseMetaData {
private java.sql.DatabaseMetaData m_xMD;
- private DriverTest m_TestCase;
+ private HsqlDriverTest m_TestCase;
/** Creates a new instance of DatabaseMetaData */
- public DatabaseMetaData(DriverTest _testCase,java.sql.DatabaseMetaData _xmd) {
+ public DatabaseMetaData(HsqlDriverTest _testCase,java.sql.DatabaseMetaData _xmd) {
m_TestCase = _testCase;
m_xMD = _xmd;
}
diff --git a/connectivity/qa/drivers/hsqldb/TestCacheSize.java b/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
index 4701905772b8..6c4db8bdeee7 100644
--- a/connectivity/qa/drivers/hsqldb/TestCacheSize.java
+++ b/connectivity/qa/complex/connectivity/hsqldb/TestCacheSize.java
@@ -29,24 +29,16 @@
*/
-package qa.drivers.hsqldb;
+package complex.connectivity.hsqldb;
-import java.io.*;
import org.hsqldb.lib.StopWatch;
-import org.hsqldb.lib.FileAccess;
import java.util.Random;
import com.sun.star.lang.*;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.PropertyState;
-import com.sun.star.container.XNameAccess;
import com.sun.star.sdbc.*;
-import com.sun.star.document.XDocumentSubStorageSupplier;
-import com.sun.star.embed.XStorage;
-import com.sun.star.frame.XStorable;
/**
* Test large cached tables by setting up a cached table of 100000 records
@@ -123,17 +115,17 @@ public class TestCacheSize {
XDriver drv;
com.sun.star.beans.PropertyValue[] info;
- TestCacheSize(XMultiServiceFactory _xmulti,com.sun.star.beans.PropertyValue[] _info,XDriver _drv){
+ public TestCacheSize(XMultiServiceFactory _xmulti,com.sun.star.beans.PropertyValue[] _info,XDriver _drv){
servicefactory = _xmulti;
drv = _drv;
info = _info;
}
- void setURL(String _url){
+ public void setURL(String _url){
url = _url;
}
- protected void setUp() {
+ public void setUp() {
user = "sa";
password = "";
@@ -406,9 +398,9 @@ public class TestCacheSize {
+ (i * 1000 / (sw.elapsedTime() + 1)));
}
- protected void tearDown() {}
+ public void tearDown() {}
- protected void checkResults() {
+ public void checkResults() {
try {
StopWatch sw = new StopWatch();
diff --git a/connectivity/qa/connectivity/tools/AbstractDatabase.java b/connectivity/qa/connectivity/tools/AbstractDatabase.java
index b47c7c7961da..65f550be5abf 100755
--- a/connectivity/qa/connectivity/tools/AbstractDatabase.java
+++ b/connectivity/qa/connectivity/tools/AbstractDatabase.java
@@ -47,18 +47,6 @@ import java.io.File;
*/
public abstract class AbstractDatabase implements DatabaseAccess
{
- // the service factory
-
- protected final XMultiServiceFactory m_orb;
- // the URL of the temporary file used for the database document
- protected String m_databaseDocumentFile;
- // the database document
- protected XOfficeDatabaseDocument m_databaseDocument;
- // the data source belonging to the database document
- protected DataSource m_dataSource;
- // the default connection
- protected Connection m_connection;
-
public AbstractDatabase(final XMultiServiceFactory orb) throws Exception
{
m_orb = orb;
@@ -75,7 +63,6 @@ public abstract class AbstractDatabase implements DatabaseAccess
*
* Multiple calls to this method return the same connection. The DbaseDatabase object keeps
* the ownership of the connection, so you don't need to (and should not) dispose/close it.
- *
*/
public Connection defaultConnection() throws SQLException
{
@@ -219,4 +206,15 @@ public abstract class AbstractDatabase implements DatabaseAccess
closeAndDelete();
super.finalize();
}
+
+ // the service factory
+ protected final XMultiServiceFactory m_orb;
+ // the URL of the temporary file used for the database document
+ protected String m_databaseDocumentFile;
+ // the database document
+ protected XOfficeDatabaseDocument m_databaseDocument;
+ // the data source belonging to the database document
+ protected DataSource m_dataSource;
+ // the default connection
+ protected Connection m_connection;
}
diff --git a/connectivity/qa/connectivity/tools/CsvDatabase.java b/connectivity/qa/connectivity/tools/CsvDatabase.java
new file mode 100755
index 000000000000..f9f16a718205
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/CsvDatabase.java
@@ -0,0 +1,18 @@
+package connectivity.tools;
+
+import com.sun.star.lang.XMultiServiceFactory;
+
+public class CsvDatabase extends FlatFileDatabase
+{
+ // --------------------------------------------------------------------------------------------------------
+ public CsvDatabase( final XMultiServiceFactory i_orb ) throws Exception
+ {
+ super( i_orb, "flat" );
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ protected CsvDatabase( final XMultiServiceFactory i_orb, final String i_existingDocumentURL ) throws Exception
+ {
+ super( i_orb, i_existingDocumentURL, "flat" );
+ }
+}
diff --git a/connectivity/qa/connectivity/tools/DataSource.java b/connectivity/qa/connectivity/tools/DataSource.java
index 221ada3cb487..5c06f7d69622 100644
--- a/connectivity/qa/connectivity/tools/DataSource.java
+++ b/connectivity/qa/connectivity/tools/DataSource.java
@@ -69,6 +69,14 @@ public class DataSource
return m_dataSource;
}
+ /**
+ * retrieves the data source's settings
+ */
+ public XPropertySet geSettings()
+ {
+ return UnoRuntime.queryInterface( XPropertySet.class, impl_getPropertyValue( "Settings" ) );
+ }
+
/** creates a query with a given name and SQL command
*/
public void createQuery(final String _name, final String _sqlCommand) throws ElementExistException, WrappedTargetException, com.sun.star.lang.IllegalArgumentException
@@ -121,25 +129,35 @@ public class DataSource
return suppQueries.getQueryDefinitions();
}
- /** returns the name of the data source
- *
- * If a data source is registered at the database context, the name is the registration
- * name. Otherwise, its the URL which the respective database document is based on.
- *
- * Note that the above definition is from the UNO API, not from this wrapper here.
+ /**
+ * retrieves a property value from the data source
+ * @param i_propertyName
+ * the name of the property whose value is to be returned.
*/
- public String getName()
+ private Object impl_getPropertyValue( final String i_propertyName )
{
- String name = null;
+ Object propertyValue = null;
try
{
final XPropertySet dataSourceProps = UnoRuntime.queryInterface( XPropertySet.class, m_dataSource );
- name = (String) dataSourceProps.getPropertyValue("Name");
+ propertyValue = dataSourceProps.getPropertyValue( i_propertyName );
}
catch (Exception ex)
{
Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex);
}
- return name;
+ return propertyValue;
+ }
+
+ /** returns the name of the data source
+ *
+ * If a data source is registered at the database context, the name is the registration
+ * name. Otherwise, its the URL which the respective database document is based on.
+ *
+ * Note that the above definition is from the UNO API, not from this wrapper here.
+ */
+ public String getName()
+ {
+ return (String)impl_getPropertyValue( "Name" );
}
};
diff --git a/connectivity/qa/connectivity/tools/DbaseDatabase.java b/connectivity/qa/connectivity/tools/DbaseDatabase.java
index ae40be4222aa..19a44132adf4 100755
--- a/connectivity/qa/connectivity/tools/DbaseDatabase.java
+++ b/connectivity/qa/connectivity/tools/DbaseDatabase.java
@@ -1,98 +1,18 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General 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 connectivity.tools;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.frame.XStorable;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.sdb.XOfficeDatabaseDocument;
-import com.sun.star.sdbc.SQLException;
-import com.sun.star.uno.UnoRuntime;
-import helper.URLHelper;
-import java.io.File;
-
-/**
- *
- * @author Ocke
- */
-public class DbaseDatabase extends AbstractDatabase
+public class DbaseDatabase extends FlatFileDatabase
{
// --------------------------------------------------------------------------------------------------------
-
- public DbaseDatabase(final XMultiServiceFactory orb) throws Exception
+ public DbaseDatabase( final XMultiServiceFactory i_orb ) throws Exception
{
- super(orb);
- createDBDocument();
+ super( i_orb, "dbase" );
}
// --------------------------------------------------------------------------------------------------------
- public DbaseDatabase(final XMultiServiceFactory orb, final String _existingDocumentURL) throws Exception
- {
- super(orb, _existingDocumentURL);
- }
-
- /** creates an empty database document in a temporary location
- */
- private void createDBDocument() throws Exception
- {
- final File documentFile = File.createTempFile("dbase", ".odb");
- if ( documentFile.exists() )
- documentFile.delete();
- final File subPath = new File(documentFile.getParent() + File.separator + documentFile.getName().replaceAll(".odb", "") + File.separator );
- subPath.mkdir();
- //subPath.deleteOnExit();
- m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
- final String path = URLHelper.getFileURLFromSystemPath(subPath.getPath());
-
- m_databaseDocument = (XOfficeDatabaseDocument) UnoRuntime.queryInterface(
- XOfficeDatabaseDocument.class, m_orb.createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
- m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
-
- final XPropertySet dsProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
- dsProperties.setPropertyValue("URL", "sdbc:dbase:" + path);
-
- final XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, m_databaseDocument);
- storable.storeAsURL(m_databaseDocumentFile, new PropertyValue[]
- {
- });
- }
-
- /** drops the table with a given name
-
- @param _name
- the name of the table to drop
- @param _ifExists
- TRUE if it should be dropped only when it exists.
- */
- public void dropTable(final String _name,final boolean _ifExists) throws SQLException
+ protected DbaseDatabase( final XMultiServiceFactory i_orb, final String i_existingDocumentURL ) throws Exception
{
- String dropStatement = "DROP TABLE \"" + _name;
- executeSQL(dropStatement);
+ super( i_orb, i_existingDocumentURL, "dbase" );
}
}
diff --git a/connectivity/qa/connectivity/tools/FlatFileDatabase.java b/connectivity/qa/connectivity/tools/FlatFileDatabase.java
new file mode 100755
index 000000000000..5385f1e119f6
--- /dev/null
+++ b/connectivity/qa/connectivity/tools/FlatFileDatabase.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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 connectivity.tools;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.uno.UnoRuntime;
+
+import helper.URLHelper;
+import java.io.File;
+
+class FlatFileDatabase extends AbstractDatabase
+{
+ // --------------------------------------------------------------------------------------------------------
+ protected FlatFileDatabase( final XMultiServiceFactory i_orb, final String i_urlSubScheme ) throws Exception
+ {
+ super(i_orb);
+ m_urlSubScheme = i_urlSubScheme;
+ createDBDocument();
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ protected FlatFileDatabase(final XMultiServiceFactory i_orb, final String i_existingDocumentURL,
+ final String i_urlSubScheme ) throws Exception
+ {
+ super( i_orb, i_existingDocumentURL );
+ m_urlSubScheme = i_urlSubScheme;
+
+ final XPropertySet dsProperties = UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
+ final String url = (String)dsProperties.getPropertyValue( "URL" );
+ final String expectedURLPrefix = "sdbc:" + m_urlSubScheme + ":";
+ if ( !url.startsWith( expectedURLPrefix ) )
+ throw new IllegalArgumentException( i_existingDocumentURL + " is of wrong type" );
+
+ final String location = url.substring( expectedURLPrefix.length() );
+ m_tableFileLocation = new File( location );
+ if ( m_tableFileLocation.isDirectory() )
+ throw new IllegalArgumentException( "unsupported table file location (must be a folder)" );
+ }
+
+ /**
+ * returns a {@link File} which represents the folder where the database's table files reside.
+ */
+ public File getTableFileLocation()
+ {
+ return m_tableFileLocation;
+ }
+
+ /** creates an empty database document in a temporary location
+ */
+ private void createDBDocument() throws Exception
+ {
+ final File documentFile = File.createTempFile( m_urlSubScheme, ".odb" );
+ if ( documentFile.exists() )
+ documentFile.delete();
+ m_tableFileLocation = new File(documentFile.getParent() + File.separator + documentFile.getName().replace(".odb", "") + File.separator );
+ m_tableFileLocation.mkdir();
+ //subPath.deleteOnExit();
+ m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath(documentFile);
+ final String path = URLHelper.getFileURLFromSystemPath( m_tableFileLocation.getPath() );
+
+ m_databaseDocument = UnoRuntime.queryInterface( XOfficeDatabaseDocument.class,
+ m_orb.createInstance("com.sun.star.sdb.OfficeDatabaseDocument"));
+ m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
+
+ final XPropertySet dsProperties = UnoRuntime.queryInterface(XPropertySet.class, m_databaseDocument.getDataSource());
+ dsProperties.setPropertyValue("URL", "sdbc:" + m_urlSubScheme + ":" + path);
+
+ final XStorable storable = UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
+ storable.storeAsURL( m_databaseDocumentFile, new PropertyValue[] { } );
+ }
+
+ /** drops the table with a given name
+
+ @param _name
+ the name of the table to drop
+ @param _ifExists
+ TRUE if it should be dropped only when it exists.
+ */
+ public void dropTable(final String _name,final boolean _ifExists) throws SQLException
+ {
+ String dropStatement = "DROP TABLE \"" + _name;
+ executeSQL(dropStatement);
+ }
+
+ final String m_urlSubScheme;
+ File m_tableFileLocation = null;
+}
diff --git a/connectivity/qa/connectivity/tools/RowSet.java b/connectivity/qa/connectivity/tools/RowSet.java
index a26456dcc746..31d0f237a1dd 100644
--- a/connectivity/qa/connectivity/tools/RowSet.java
+++ b/connectivity/qa/connectivity/tools/RowSet.java
@@ -31,6 +31,7 @@ import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XIndexAccess;
import com.sun.star.container.XNameAccess;
import com.sun.star.io.XInputStream;
+import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sdbc.SQLException;
import com.sun.star.sdbc.XArray;
@@ -48,7 +49,6 @@ import com.sun.star.util.Time;
public class RowSet implements XRowSet, XRow
{
- private XMultiServiceFactory m_orb;
private XRowSet m_rowSet;
private XRow m_row;
private XPropertySet m_rowSetProps;
@@ -57,14 +57,13 @@ public class RowSet implements XRowSet, XRow
{
try
{
- m_rowSetProps = (XPropertySet)UnoRuntime.queryInterface(
- XPropertySet.class, _orb.createInstance("com.sun.star.sdb.RowSet") );
+ m_rowSetProps = UnoRuntime.queryInterface( XPropertySet.class, _orb.createInstance( "com.sun.star.sdb.RowSet" ) );
m_rowSetProps.setPropertyValue( "DataSourceName", _dataSource );
m_rowSetProps.setPropertyValue( "CommandType", new Integer( _commandType ) );
m_rowSetProps.setPropertyValue( "Command", _command );
- m_rowSet = (XRowSet)UnoRuntime.queryInterface( XRowSet.class, m_rowSetProps );
- m_row = (XRow)UnoRuntime.queryInterface( XRow.class, m_rowSetProps );
+ m_rowSet = UnoRuntime.queryInterface( XRowSet.class, m_rowSetProps );
+ m_row = UnoRuntime.queryInterface( XRow.class, m_rowSetProps );
}
catch ( Exception e )
{
@@ -289,4 +288,12 @@ public class RowSet implements XRowSet, XRow
{
return m_row.getArray(i);
}
+
+ public void dispose()
+ {
+ if ( m_rowSet == null )
+ return;
+ XComponent rowSetComp = UnoRuntime.queryInterface( XComponent.class, m_rowSet );
+ rowSetComp.dispose();
+ }
};
diff --git a/connectivity/qa/connectivity/tools/makefile.mk b/connectivity/qa/connectivity/tools/makefile.mk
index 07490532a1b1..d77da7f1b945 100644
--- a/connectivity/qa/connectivity/tools/makefile.mk
+++ b/connectivity/qa/connectivity/tools/makefile.mk
@@ -42,15 +42,11 @@ all:
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunnerLight.jar
JAVAFILES := $(shell @$(FIND) . -name "*.java")
-JAVACLASSFILES := $(foreach,i,$(JAVAFILES) $(CLASSDIR)/$(PACKAGE)/$(i:d)$(i:b).class)
#----- make a jar from compiled files ------------------------------
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
# --- Targets ------------------------------------------------------
diff --git a/connectivity/qa/drivers/dbase/.nbattrs b/connectivity/qa/drivers/dbase/.nbattrs
deleted file mode 100644
index 1ea7ed0bd8e6..000000000000
--- a/connectivity/qa/drivers/dbase/.nbattrs
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd">
-<attributes version="1.0">
- <fileobject name="DBaseDriverTest.java">
- <attr name="class_dependency_complexlib.ComplexTestCase" stringvalue="DBaseDriverTest"/>
- </fileobject>
- <fileobject name="makefile.mk">
- <attr name="org.netbeans.modules.text.IsTextFile" boolvalue="true"/>
- </fileobject>
-</attributes>
diff --git a/connectivity/qa/drivers/dbase/test.properties b/connectivity/qa/drivers/dbase/test.properties
deleted file mode 100644
index c26879f480f3..000000000000
--- a/connectivity/qa/drivers/dbase/test.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-# x-no-translate
-Driver=org.openoffice.comp.drivers.MySQL.Driver
-user=testuser
-password=
-URL=sdbc:mysql:odbc:MYSQL fs-11110 TESTUSER
diff --git a/connectivity/qa/drivers/jdbc/makefile.mk b/connectivity/qa/makefile.mk
index e9f03ce1be3c..ee41cab63554 100644
--- a/connectivity/qa/drivers/jdbc/makefile.mk
+++ b/connectivity/qa/makefile.mk
@@ -25,42 +25,48 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = LongVarCharTest
+PRJ = ..
+TARGET = ConnectivityComplexTests
PRJNAME = connectivity
-PACKAGE = complex$/connectivity
+PACKAGE = complex/connectivity
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
-
#----- compile .java files -----------------------------------------
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES =\
- LongVarCharTest.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar hsqldb.jar
+JAVAFILES := $(shell @$(FIND) complex -name "*.java")
#----- make a jar from compiled files ------------------------------
-MAXLINELENGTH = 100000
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
+
+# --- Runner Settings ----------------------------------------------
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+# classpath and argument list
+RUNNER_CLASSPATH = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar"
+RUNNER_ARGS = org.openoffice.Runner -TestBase java_complex
# --- Targets ------------------------------------------------------
.IF "$(depend)" == ""
ALL : ALLTAR
+ @echo -----------------------------------------------------
+ @echo - do a 'dmake show_targets' to show available targets
+ @echo -----------------------------------------------------
.ELSE
ALL: ALLDEP
.ENDIF
.INCLUDE : target.mk
+show_targets:
+ +@$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//))
-run:
- java -cp $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar org.openoffice.Runner -TestBase java_complex -o complex.connectivity.$(TARGET)
+run: $(CLASSDIR)$/$(JARTARGET)
+ +$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce scenarios.sce
+run_%: $(CLASSDIR)$/$(JARTARGET)
+ +$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o complex.$(PRJNAME).$(@:s/run_//)
diff --git a/connectivity/qa/scenarios.sce b/connectivity/qa/scenarios.sce
new file mode 100644
index 000000000000..c085f11bd7d8
--- /dev/null
+++ b/connectivity/qa/scenarios.sce
@@ -0,0 +1,4 @@
+-o complex.connectivity.DBaseDriverTest
+-o complex.connectivity.HsqlDriverTest
+#-o complex.connectivity.JdbcLongVarCharTest
+-o complex.connectivity.FlatFileAccess
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 9f5be37f208f..a701b3b01570 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -43,6 +43,7 @@
#include "diagnose_ex.h"
#include <comphelper/numbers.hxx>
#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::connectivity;
@@ -365,56 +366,59 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant,
}
//------------------------------------------------------------------------------
-double DBTypeConversion::getValue(const Reference<XColumn>& xVariant,
- const Date& rNullDate,
- sal_Int16 nKeyType)
+double DBTypeConversion::getValue( const Reference< XColumn >& i_column, const Date& i_relativeToNullDate )
{
try
{
- switch (nKeyType & ~NumberFormat::DEFINED)
+ const Reference< XPropertySet > xProp( i_column, UNO_QUERY_THROW );
+
+ const sal_Int32 nColumnType = ::comphelper::getINT32( xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_TYPE ) ) );
+ switch ( nColumnType )
{
- case NumberFormat::DATE:
- return toDouble( xVariant->getDate(), rNullDate);
- case NumberFormat::DATETIME:
- return toDouble(xVariant->getTimestamp(),rNullDate);
- case NumberFormat::TIME:
- return toDouble(xVariant->getTime());
- default:
+ case DataType::DATE:
+ return toDouble( i_column->getDate(), i_relativeToNullDate );
+
+ case DataType::TIME:
+ return toDouble( i_column->getTime() );
+
+ case DataType::TIMESTAMP:
+ return toDouble( i_column->getTimestamp(), i_relativeToNullDate );
+
+ default:
{
- Reference<XPropertySet> xProp(xVariant,UNO_QUERY);
- if ( xProp.is()
- && xProp->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSIGNED))
- && !::comphelper::getBOOL(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSIGNED))) )
+ sal_Bool bIsSigned = sal_True;
+ OSL_VERIFY( xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_ISSIGNED ) ) >>= bIsSigned );
+ if ( !bIsSigned )
{
- switch (::comphelper::getINT32(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))))
+ switch ( nColumnType)
{
case DataType::TINYINT:
- return static_cast<double>(static_cast<sal_uInt8>(xVariant->getByte()));
+ return static_cast<double>(static_cast<sal_uInt8>(i_column->getByte()));
case DataType::SMALLINT:
- return static_cast<double>(static_cast<sal_uInt16>(xVariant->getShort()));
+ return static_cast<double>(static_cast<sal_uInt16>(i_column->getShort()));
case DataType::INTEGER:
- return static_cast<double>(static_cast<sal_uInt32>(xVariant->getInt()));
+ return static_cast<double>(static_cast<sal_uInt32>(i_column->getInt()));
case DataType::BIGINT:
- return static_cast<double>(static_cast<sal_uInt64>(xVariant->getLong()));
+ return static_cast<double>(static_cast<sal_uInt64>(i_column->getLong()));
}
}
-
- return xVariant->getDouble();
}
+ return i_column->getDouble();
}
}
- catch(const Exception& )
+ catch( const Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
return 0.0;
}
}
//------------------------------------------------------------------------------
-::rtl::OUString DBTypeConversion::getValue(const Reference< XPropertySet>& _xColumn,
+::rtl::OUString DBTypeConversion::getFormattedValue(const Reference< XPropertySet>& _xColumn,
const Reference<XNumberFormatter>& _xFormatter,
const ::com::sun::star::lang::Locale& _rLocale,
const Date& _rNullDate)
{
- OSL_ENSURE(_xColumn.is() && _xFormatter.is(), "DBTypeConversion::getValue: invalid arg !");
+ OSL_ENSURE(_xColumn.is() && _xFormatter.is(), "DBTypeConversion::getFormattedValue: invalid arg !");
if (!_xColumn.is() || !_xFormatter.is())
return ::rtl::OUString();
@@ -425,7 +429,7 @@ double DBTypeConversion::getValue(const Reference<XColumn>& xVariant,
}
catch (const Exception& )
{
- OSL_ENSURE(false, "DBTypeConversion::getValue: caught an exception while asking for the format key!");
+ OSL_ENSURE(false, "DBTypeConversion::getFormattedValue: caught an exception while asking for the format key!");
}
if (!nKey)
@@ -441,11 +445,11 @@ double DBTypeConversion::getValue(const Reference<XColumn>& xVariant,
sal_Int16 nKeyType = getNumberFormatType(_xFormatter, nKey) & ~NumberFormat::DEFINED;
- return DBTypeConversion::getValue(Reference< XColumn > (_xColumn, UNO_QUERY), _xFormatter, _rNullDate, nKey, nKeyType);
+ return DBTypeConversion::getFormattedValue(Reference< XColumn > (_xColumn, UNO_QUERY), _xFormatter, _rNullDate, nKey, nKeyType);
}
//------------------------------------------------------------------------------
-::rtl::OUString DBTypeConversion::getValue(const Reference<XColumn>& xVariant,
+::rtl::OUString DBTypeConversion::getFormattedValue(const Reference<XColumn>& xVariant,
const Reference<XNumberFormatter>& xFormatter,
const Date& rNullDate,
sal_Int32 nKey,
@@ -462,23 +466,20 @@ double DBTypeConversion::getValue(const Reference<XColumn>& xVariant,
case NumberFormat::DATETIME:
{
// get a value which represents the given date, relative to the given null date
- double fValue = getValue(xVariant, rNullDate, nKeyType);
+ double fValue = getValue( xVariant, rNullDate );
if ( !xVariant->wasNull() )
{
// get the null date of the formatter
Date aFormatterNullDate( rNullDate );
try
{
- Reference< XPropertySet > xFormatterSettings;
- Reference< XNumberFormatsSupplier > xSupplier( xFormatter->getNumberFormatsSupplier( ) );
- if ( xSupplier.is() )
- xFormatterSettings = xSupplier->getNumberFormatSettings();
- if ( xFormatterSettings.is() )
- xFormatterSettings->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NullDate" ) ) ) >>= aFormatterNullDate;
+ Reference< XNumberFormatsSupplier > xSupplier( xFormatter->getNumberFormatsSupplier(), UNO_SET_THROW );
+ Reference< XPropertySet > xFormatterSettings( xSupplier->getNumberFormatSettings(), UNO_SET_THROW );
+ OSL_VERIFY( xFormatterSettings->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NullDate" ) ) ) >>= aFormatterNullDate );
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "DBTypeConversion::getValue: caught an exception while retrieving the formatter's NullDate!" );
+ DBG_UNHANDLED_EXCEPTION();
}
// get a value which represents the given date, relative to the null date of the formatter
fValue -= toDays( rNullDate, aFormatterNullDate );
diff --git a/connectivity/source/commontools/TSkipDeletedSet.cxx b/connectivity/source/commontools/TSkipDeletedSet.cxx
index 2d144ab72941..ccef25db11e3 100644
--- a/connectivity/source/commontools/TSkipDeletedSet.cxx
+++ b/connectivity/source/commontools/TSkipDeletedSet.cxx
@@ -154,10 +154,15 @@ sal_Bool OSkipDeletedSet::skipDeleted(IResultSetHelper::Movement _eCursorPositio
bDone = sal_False;
}
- if(bDataFound && bDone )
+ if(bDataFound && bDone)
{
const sal_Int32 nDriverPos = m_pHelper->getDriverPos();
- if ( ::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),nDriverPos) == m_aBookmarksPositions.end() )
+ if ( m_bDeletedVisible )
+ {
+ if ( nDriverPos > (sal_Int32)m_aBookmarksPositions.size() )
+ m_aBookmarksPositions.push_back(nDriverPos);
+ }
+ else if ( ::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),nDriverPos) == m_aBookmarksPositions.end() )
m_aBookmarksPositions.push_back(nDriverPos);
/*sal_Int32 nDriverPos = m_pHelper->getDriverPos();
if(m_aBookmarks.find(nDriverPos) == m_aBookmarks.end())
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 05bcf997268f..a216864fd172 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -261,7 +261,7 @@ Reference< XDataSource> getDataSource_allowException(
const ::rtl::OUString& _rsTitleOrPath,
const Reference< XMultiServiceFactory >& _rxFactory )
{
- OSL_ENSURE( _rsTitleOrPath.getLength(), "getDataSource_allowException: invalid arg !" );
+ ENSURE_OR_RETURN( _rsTitleOrPath.getLength(), "getDataSource_allowException: invalid arg !", NULL );
Reference< XNameAccess> xDatabaseContext(
_rxFactory->createInstance(
@@ -281,8 +281,9 @@ Reference< XDataSource > getDataSource(
{
xDS = getDataSource_allowException( _rsTitleOrPath, _rxFactory );
}
- catch(Exception)
+ catch( const Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
}
return xDS;
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index d63c83524389..98a6e3c2ece9 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -328,7 +328,7 @@ namespace dbtools
{
if ( m_pData->m_bNumericField )
{
- sStringValue = DBTypeConversion::getValue(
+ sStringValue = DBTypeConversion::getFormattedValue(
m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType
);
}
diff --git a/connectivity/source/drivers/ado/ACatalog.cxx b/connectivity/source/drivers/ado/ACatalog.cxx
index d73ac4746fa3..4db595636eb4 100644
--- a/connectivity/source/drivers/ado/ACatalog.cxx
+++ b/connectivity/source/drivers/ado/ACatalog.cxx
@@ -81,7 +81,7 @@ void OCatalog::refreshTables()
if(m_pTables)
m_pTables->reFill(aVector);
else
- m_pTables = new OTables(this,m_aMutex,aVector,aTables,m_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ m_pTables = new OTables(this,m_aMutex,aVector,aTables,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
}
// -------------------------------------------------------------------------
void OCatalog::refreshViews()
@@ -94,7 +94,7 @@ void OCatalog::refreshViews()
if(m_pViews)
m_pViews->reFill(aVector);
else
- m_pViews = new OViews(this,m_aMutex,aVector,aViews,m_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ m_pViews = new OViews(this,m_aMutex,aVector,aViews,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
}
// -------------------------------------------------------------------------
void OCatalog::refreshGroups()
@@ -107,7 +107,7 @@ void OCatalog::refreshGroups()
if(m_pGroups)
m_pGroups->reFill(aVector);
else
- m_pGroups = new OGroups(this,m_aMutex,aVector,aGroups,m_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ m_pGroups = new OGroups(this,m_aMutex,aVector,aGroups,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
}
// -------------------------------------------------------------------------
void OCatalog::refreshUsers()
@@ -120,7 +120,7 @@ void OCatalog::refreshUsers()
if(m_pUsers)
m_pUsers->reFill(aVector);
else
- m_pUsers = new OUsers(this,m_aMutex,aVector,aUsers,m_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ m_pUsers = new OUsers(this,m_aMutex,aVector,aUsers,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx
index b2e383f53e0d..60140e9be93e 100644
--- a/connectivity/source/drivers/ado/AColumns.cxx
+++ b/connectivity/source/drivers/ado/AColumns.cxx
@@ -72,8 +72,14 @@ Reference< XPropertySet > OColumns::createDescriptor()
sdbcx::ObjectType OColumns::appendObject( const ::rtl::OUString&, const Reference< XPropertySet >& descriptor )
{
OAdoColumn* pColumn = NULL;
+ Reference< XPropertySet > xColumn;
if ( !getImplementation( pColumn, descriptor ) || pColumn == NULL )
- m_pConnection->throwGenericSQLException( STR_INVALID_COLUMN_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
+ {
+ // m_pConnection->throwGenericSQLException( STR_INVALID_COLUMN_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
+ pColumn = new OAdoColumn(isCaseSensitive(),m_pConnection);
+ xColumn = pColumn;
+ ::comphelper::copyProperties(descriptor,xColumn);
+ }
WpADOColumn aColumn = pColumn->getColumnImpl();
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx
index 20eb6910f849..5b89623c28d8 100644
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ b/connectivity/source/drivers/ado/ADriver.cxx
@@ -163,6 +163,37 @@ void ODriver::impl_checkURL_throw(const ::rtl::OUString& _sUrl)
Sequence< DriverPropertyInfo > SAL_CALL ODriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException)
{
impl_checkURL_throw(url);
+ if ( acceptsURL(url) )
+ {
+ ::std::vector< DriverPropertyInfo > aDriverInfo;
+
+ Sequence< ::rtl::OUString > aBooleanValues(2);
+ aBooleanValues[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );
+ aBooleanValues[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) );
+
+ aDriverInfo.push_back(DriverPropertyInfo(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreDriverPrivileges"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Ignore the privileges from the database driver."))
+ ,sal_False
+ ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) )
+ ,aBooleanValues)
+ );
+ aDriverInfo.push_back(DriverPropertyInfo(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EscapeDateTime"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Escape date time format."))
+ ,sal_False
+ ,::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) )
+ ,aBooleanValues)
+ );
+ aDriverInfo.push_back(DriverPropertyInfo(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TypeInfoSettings"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Defines how the type info of the database metadata should be manipulated."))
+ ,sal_False
+ ,::rtl::OUString( )
+ ,Sequence< ::rtl::OUString > ())
+ );
+ return Sequence< DriverPropertyInfo >(&aDriverInfo[0],aDriverInfo.size());
+ }
return Sequence< DriverPropertyInfo >();
}
// --------------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
index 50c29cf7ba2e..e95e1a676c12 100755
--- a/connectivity/source/drivers/ado/ado.xcu
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -164,6 +164,11 @@
<value>false</value>
</prop>
</node>
+ <node oor:name="TypeInfoSettings" oor:op="replace">
+ <prop oor:name="Value" oor:type="oor:string-list">
+ <value oor:separator=",">Column(2) = 16,Column(3) = 1</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
diff --git a/connectivity/source/drivers/ado/adoimp.cxx b/connectivity/source/drivers/ado/adoimp.cxx
index 1bc136a35662..b59f41a597fa 100644
--- a/connectivity/source/drivers/ado/adoimp.cxx
+++ b/connectivity/source/drivers/ado/adoimp.cxx
@@ -105,7 +105,7 @@ sal_Int32 ADOS::MapADOType2Jdbc(DataTypeEnum eType)
case adDBTime: nType = DataType::TIME; break;
case adDate:
case adDBTimeStamp: nType = DataType::TIMESTAMP; break;
- case adBoolean: nType = DataType::BIT; break;
+ case adBoolean: nType = DataType::BOOLEAN; break;
// case adArray: nType = DataType::ARRAY; break;
case adBinary: nType = DataType::BINARY; break;
case adGUID: nType = DataType::OBJECT; break;
@@ -151,6 +151,7 @@ DataTypeEnum ADOS::MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine)
case DataType::DATE: return isJetEngine(_nJetEngine) ? adDate : adDBDate; break;
case DataType::TIME: return adDBTime; break;
case DataType::TIMESTAMP: return isJetEngine(_nJetEngine) ? adDate : adDBTimeStamp; break;
+ case DataType::BOOLEAN:
case DataType::BIT: return adBoolean; break;
case DataType::BINARY: return adBinary; break;
case DataType::VARCHAR: return adVarWChar; break;
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index a4e5f35825f5..20214c18af75 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -470,8 +470,8 @@ void OCalcTable::fillColumns()
String aStrFieldName;
aStrFieldName.AssignAscii("Column");
::rtl::OUString aTypeName;
- ::comphelper::UStringMixEqual aCase(m_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers());
- const sal_Bool bStoresMixedCaseQuotedIdentifiers = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ ::comphelper::UStringMixEqual aCase(m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
+ const sal_Bool bStoresMixedCaseQuotedIdentifiers = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
for (sal_Int32 i = 0; i < m_nDataCols; i++)
{
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index c7e64beeef1a..e4d3eafc9071 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -67,7 +67,7 @@ using namespace com::sun::star::lang;
IMPLEMENT_SERVICE_INFO(ODbaseIndex,"com.sun.star.sdbcx.driver.dbase.Index","com.sun.star.sdbcx.Index");
// -------------------------------------------------------------------------
-ODbaseIndex::ODbaseIndex(ODbaseTable* _pTable) : OIndex(sal_True/*_pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers()*/)
+ODbaseIndex::ODbaseIndex(ODbaseTable* _pTable) : OIndex(sal_True/*_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers()*/)
,m_pFileStream(NULL)
,m_nCurNode(NODE_NOTFOUND)
,m_pTable(_pTable)
@@ -80,7 +80,7 @@ ODbaseIndex::ODbaseIndex(ODbaseTable* _pTable) : OIndex(sal_True/*_pTable->getCo
ODbaseIndex::ODbaseIndex( ODbaseTable* _pTable,
const NDXHeader& _rHeader,
const ::rtl::OUString& _rName)
- :OIndex(_rName,::rtl::OUString(),_rHeader.db_unique,sal_False,sal_False,sal_True) // _pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers()
+ :OIndex(_rName,::rtl::OUString(),_rHeader.db_unique,sal_False,sal_False,sal_True) // _pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers()
,m_pFileStream(NULL)
,m_aHeader(_rHeader)
,m_nCurNode(NODE_NOTFOUND)
diff --git a/connectivity/source/drivers/dbase/DIndexColumns.cxx b/connectivity/source/drivers/dbase/DIndexColumns.cxx
index 59682a38d8af..1ea40b7bc03f 100644
--- a/connectivity/source/drivers/dbase/DIndexColumns.cxx
+++ b/connectivity/source/drivers/dbase/DIndexColumns.cxx
@@ -69,7 +69,7 @@ sdbcx::ObjectType ODbaseIndexColumns::createObject(const ::rtl::OUString& _rName
,sal_False
,sal_False
,sal_False
- ,pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ ,pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
return xRet;
}
@@ -82,7 +82,7 @@ void ODbaseIndexColumns::impl_refresh() throw(RuntimeException)
// -------------------------------------------------------------------------
Reference< XPropertySet > ODbaseIndexColumns::createDescriptor()
{
- return new sdbcx::OIndexColumn(m_pIndex->getTable()->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ return new sdbcx::OIndexColumn(m_pIndex->getTable()->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
}
// -------------------------------------------------------------------------
sdbcx::ObjectType ODbaseIndexColumns::appendObject( const ::rtl::OUString& /*_rForName*/, const Reference< XPropertySet >& descriptor )
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 011d0e89ce7a..6adbfbbbf931 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -340,7 +340,7 @@ void ODbaseTable::fillColumns()
aStrFieldName.AssignAscii("Column");
::rtl::OUString aTypeName;
static const ::rtl::OUString sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- const sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ const sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
const bool bFoxPro = m_aHeader.db_typ == VisualFoxPro || m_aHeader.db_typ == VisualFoxProAuto || m_aHeader.db_typ == FoxProMemo;
sal_Int32 i = 0;
@@ -2208,7 +2208,7 @@ void ODbaseTable::alterColumn(sal_Int32 index,
if(xOldColumn.is())
xCopyColumn = xOldColumn->createDataDescriptor();
else
- xCopyColumn = new OColumn(getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ xCopyColumn = new OColumn(getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
::comphelper::copyProperties(descriptor,xCopyColumn);
@@ -2233,7 +2233,7 @@ void ODbaseTable::alterColumn(sal_Int32 index,
if(xColumn.is())
xCpy = xColumn->createDataDescriptor();
else
- xCpy = new OColumn(getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ xCpy = new OColumn(getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
::comphelper::copyProperties(xProp,xCpy);
xAppend->appendByDescriptor(xCpy);
}
@@ -2249,7 +2249,7 @@ void ODbaseTable::alterColumn(sal_Int32 index,
if(xColumn.is())
xCpy = xColumn->createDataDescriptor();
else
- xCpy = new OColumn(getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ xCpy = new OColumn(getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
::comphelper::copyProperties(xProp,xCpy);
xAppend->appendByDescriptor(xCpy);
}
@@ -2390,7 +2390,7 @@ void ODbaseTable::addColumn(const Reference< XPropertySet >& _xNewColumn)
pNewTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(::rtl::OUString(sTempName)));
{
Reference<XAppend> xAppend(pNewTable->getColumns(),UNO_QUERY);
- sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
// copy the structure
for(sal_Int32 i=0;i < m_pColumns->getCount();++i)
{
@@ -2463,7 +2463,7 @@ void ODbaseTable::dropColumn(sal_Int32 _nPos)
pNewTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),makeAny(::rtl::OUString(sTempName)));
{
Reference<XAppend> xAppend(pNewTable->getColumns(),UNO_QUERY);
- sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
// copy the structure
for(sal_Int32 i=0;i < m_pColumns->getCount();++i)
{
diff --git a/connectivity/source/drivers/evoab/LFolderList.cxx b/connectivity/source/drivers/evoab/LFolderList.cxx
index 1a42ef028c54..dfa347c12134 100644
--- a/connectivity/source/drivers/evoab/LFolderList.cxx
+++ b/connectivity/source/drivers/evoab/LFolderList.cxx
@@ -107,7 +107,7 @@ void OEvoabFolderList::fillColumns(const ::com::sun::star::lang::Locale& _aLocal
m_aPrecisions.reserve(nFieldCount);
m_aScales.reserve(nFieldCount);
- sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
// read description
sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
diff --git a/connectivity/source/drivers/evoab/LTable.cxx b/connectivity/source/drivers/evoab/LTable.cxx
index 6239765afe25..b35d1c9551eb 100644
--- a/connectivity/source/drivers/evoab/LTable.cxx
+++ b/connectivity/source/drivers/evoab/LTable.cxx
@@ -119,7 +119,7 @@ void OEvoabTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
m_aPrecisions.reserve(nFieldCount);
m_aScales.reserve(nFieldCount);
- sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
// read description
sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
@@ -674,7 +674,7 @@ sal_Bool OEvoabTable::setColumnAliases()
aColumnFinalName = aColumnReadName;
sColumnFinalName = aColumnFinalName;
- sal_Bool bCase = getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ sal_Bool bCase = getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers();
::rtl::OUString aTypeName;
aTypeName = ::rtl::OUString::createFromAscii("VARCHAR");
sdbcx::OColumn* pColumn = new sdbcx::OColumn(sColumnFinalName,aTypeName,::rtl::OUString(),
diff --git a/connectivity/source/drivers/file/FColumns.cxx b/connectivity/source/drivers/file/FColumns.cxx
index 3c3929a80c50..e92855db23fa 100644
--- a/connectivity/source/drivers/file/FColumns.cxx
+++ b/connectivity/source/drivers/file/FColumns.cxx
@@ -72,7 +72,7 @@ sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName)
sal_False,
sal_False,
sal_False,
- m_pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers());
+ m_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers());
xRet = pRet;
break;
}
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index c516b325ad9a..b2cb568eed4e 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -138,7 +138,7 @@ OResultSet::OResultSet(OStatement_Base* pStmt,OSQLParseTreeIterator& _aSQLIte
m_nResultSetConcurrency = isCount() ? ResultSetConcurrency::READ_ONLY : ResultSetConcurrency::UPDATABLE;
construct();
- m_aSkipDeletedSet.SetDeleted(m_bShowDeleted);
+ m_aSkipDeletedSet.SetDeletedVisible(m_bShowDeleted);
osl_decrementInterlockedCount( &m_refCount );
}
@@ -1692,7 +1692,7 @@ void OResultSet::setBoundedColumns(const OValueRefRow& _rRow,
::std::vector<sal_Int32>& _rColMapping)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::setBoundedColumns" );
- ::comphelper::UStringMixEqual aCase(_xMetaData->storesMixedCaseQuotedIdentifiers());
+ ::comphelper::UStringMixEqual aCase(_xMetaData->supportsMixedCaseQuotedIdentifiers());
Reference<XPropertySet> xTableColumn;
::rtl::OUString sTableColumnName, sSelectColumnRealName;
diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx
index 7bc28fd35b64..e317120da95c 100644
--- a/connectivity/source/drivers/file/FTable.cxx
+++ b/connectivity/source/drivers/file/FTable.cxx
@@ -50,7 +50,7 @@ using namespace ::com::sun::star::container;
DBG_NAME( file_OFileTable )
OFileTable::OFileTable(sdbcx::OCollection* _pTables,OConnection* _pConnection)
-: OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers())
+: OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
,m_pConnection(_pConnection)
,m_pFileStream(NULL)
,m_nFilePos(0)
@@ -72,7 +72,7 @@ OFileTable::OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection,
const ::rtl::OUString& _Description ,
const ::rtl::OUString& _SchemaName,
const ::rtl::OUString& _CatalogName
- ) : OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers(),
+ ) : OTable_TYPEDEF(_pTables,_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers(),
_Name,
_Type,
_Description,
diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx
index c9cec7b5ee10..428f813c2674 100644
--- a/connectivity/source/drivers/flat/EConnection.cxx
+++ b/connectivity/source/drivers/flat/EConnection.cxx
@@ -56,6 +56,7 @@ using namespace ::com::sun::star::lang;
// --------------------------------------------------------------------------------
OFlatConnection::OFlatConnection(ODriver* _pDriver) : OConnection(_pDriver)
+ ,m_nMaxRowsToScan(50)
,m_bHeaderLine(sal_True)
,m_cFieldDelimiter(';')
,m_cStringDelimiter('"')
@@ -108,10 +109,15 @@ void OFlatConnection::construct(const ::rtl::OUString& url,const Sequence< Prope
OSL_VERIFY( pBegin->Value >>= aVal );
m_cThousandDelimiter = aVal.toChar();
}
+ else if ( !pBegin->Name.compareToAscii("MaxRowScan") )
+ {
+ pBegin->Value >>= m_nMaxRowsToScan;
+ }
}
osl_decrementInterlockedCount( &m_refCount );
OConnection::construct(url,info);
+ m_bShowDeleted = sal_True; // we do not supported rows for this type
}
// --------------------------------------------------------------------------------
Reference< XDatabaseMetaData > SAL_CALL OFlatConnection::getMetaData( ) throw(SQLException, RuntimeException)
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 70be592405eb..c427675f15a0 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -113,11 +113,11 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
m_aScales.clear();
// reserve some space
m_aColumns->get().reserve(nFieldCount+1);
- m_aTypes.reserve(nFieldCount+1);
- m_aPrecisions.reserve(nFieldCount+1);
- m_aScales.reserve(nFieldCount+1);
+ m_aTypes.assign(nFieldCount+1,DataType::SQLNULL);
+ m_aPrecisions.assign(nFieldCount+1,-1);
+ m_aScales.assign(nFieldCount+1,-1);
- const sal_Bool bCase = m_pConnection->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ const sal_Bool bCase = m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers();
CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
// read description
const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
@@ -125,106 +125,186 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
String aColumnName;
::rtl::OUString aTypeName;
::comphelper::UStringMixEqual aCase(bCase);
- xub_StrLen nStartPosHeaderLine = 0; // use for eficient way to get the tokens
- xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
- xub_StrLen nStartPosFirstLine2 = 0;
- for (xub_StrLen i = 0; i < nFieldCount; i++)
+ ::std::vector<String> aColumnNames,m_aTypeNames;
+ m_aTypeNames.resize(nFieldCount);
+ const sal_Int32 nMaxRowsToScan = pConnection->getMaxRowsToScan();
+ sal_Int32 nRowCount = 0;
+ do
{
- if ( bHasHeaderLine )
+ xub_StrLen nStartPosHeaderLine = 0; // use for eficient way to get the tokens
+ xub_StrLen nStartPosFirstLine = 0; // use for eficient way to get the tokens
+ xub_StrLen nStartPosFirstLine2 = 0;
+ for (xub_StrLen i = 0; i < nFieldCount; i++)
{
- aHeaderLine.GetTokenSpecial(aColumnName,nStartPosHeaderLine,m_cFieldDelimiter,m_cStringDelimiter);
- if ( !aColumnName.Len() )
+ if ( nRowCount == 0)
{
- aColumnName = 'C';
- aColumnName += String::CreateFromInt32(i+1);
+ if ( bHasHeaderLine )
+ {
+ aHeaderLine.GetTokenSpecial(aColumnName,nStartPosHeaderLine,m_cFieldDelimiter,m_cStringDelimiter);
+ if ( !aColumnName.Len() )
+ {
+ aColumnName = 'C';
+ aColumnName += String::CreateFromInt32(i+1);
+ }
+ }
+ else
+ {
+ // no column name so ...
+ aColumnName = 'C';
+ aColumnName += String::CreateFromInt32(i+1);
+ }
+ aColumnNames.push_back(aColumnName);
}
+ impl_fillColumnInfo_nothrow(aFirstLine,nStartPosFirstLine,nStartPosFirstLine2,m_aTypes[i],m_aPrecisions[i],m_aScales[i],m_aTypeNames[i],cDecimalDelimiter,cThousandDelimiter,aCharClass);
}
- else
+ ++nRowCount;
+ }
+ while(nRowCount < nMaxRowsToScan && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding));
+
+ for (xub_StrLen i = 0; i < nFieldCount; i++)
+ {
+ // check if the columname already exists
+ String aAlias(aColumnNames[i]);
+ OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ sal_Int32 nExprCnt = 0;
+ while(aFind != m_aColumns->get().end())
{
- // no column name so ...
- aColumnName = 'C';
- aColumnName += String::CreateFromInt32(i+1);
+ (aAlias = aColumnNames[i]) += String::CreateFromInt32(++nExprCnt);
+ aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
}
- sal_Int32 eType;
- UINT16 nPrecision = 0;
- UINT16 nScale = 0;
- BOOL bNumeric = FALSE;
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,m_aTypeNames[i],::rtl::OUString(),::rtl::OUString(),
+ ColumnValue::NULLABLE,
+ m_aPrecisions[i],
+ m_aScales[i],
+ m_aTypes[i],
+ sal_False,
+ sal_False,
+ sal_False,
+ bCase);
+ Reference< XPropertySet> xCol = pColumn;
+ m_aColumns->get().push_back(xCol);
+ }
+ m_pFileStream->Seek(m_nStartRowFilePos);
+}
+void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,xub_StrLen& nStartPosFirstLine,xub_StrLen& nStartPosFirstLine2
+ ,sal_Int32& io_nType,sal_Int32& io_nPrecisions,sal_Int32& io_nScales,String& o_sTypeName
+ ,const sal_Unicode cDecimalDelimiter,const sal_Unicode cThousandDelimiter,const CharClass& aCharClass)
+{
+ if ( io_nType != DataType::VARCHAR )
+ {
+ BOOL bNumeric = io_nType == DataType::SQLNULL || io_nType == DataType::DOUBLE || io_nType == DataType::DECIMAL || io_nType == DataType::INTEGER;
ULONG nIndex = 0;
- // first without fielddelimiter
- String aField;
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
- if (aField.Len() == 0 ||
- (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
+ if ( bNumeric )
{
- bNumeric = FALSE;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- nStartPosFirstLine2 = nStartPosFirstLine;
- }
- else
- {
- String aField2;
- if ( m_cStringDelimiter != '\0' )
- aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
- else
- aField2 = aField;
-
- if (aField2.Len() == 0)
+ // first without fielddelimiter
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
+ if (aField.Len() == 0 ||
+ (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
{
bNumeric = FALSE;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ nStartPosFirstLine2 = nStartPosFirstLine;
}
else
{
- bNumeric = TRUE;
- xub_StrLen nDot = 0;
- xub_StrLen nDecimalDelCount = 0;
- for (xub_StrLen j = 0; j < aField2.Len(); j++)
- {
- const sal_Unicode c = aField2.GetChar(j);
- // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
- if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
- ( !cThousandDelimiter || c != cThousandDelimiter ) &&
- !aCharClass.isDigit(aField2,j) &&
- ( j != 0 || (c != '+' && c != '-' ) ) )
- {
- bNumeric = FALSE;
- break;
- }
- if (cDecimalDelimiter && c == cDecimalDelimiter)
- {
- nPrecision = 15; // we have an decimal value
- nScale = 2;
- ++nDecimalDelCount;
- } // if (cDecimalDelimiter && c == cDecimalDelimiter)
- if ( c == '.' )
- ++nDot;
- }
+ String aField2;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ aField2 = aField;
- if (nDecimalDelCount > 1 || nDot > 1 ) // if there is more than one dot it isn't a number
+ if (aField2.Len() == 0)
+ {
bNumeric = FALSE;
- if (bNumeric && cThousandDelimiter)
+ }
+ else
{
- // Ist der Trenner richtig angegeben?
- const String aValue = aField2.GetToken(0,cDecimalDelimiter);
- for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
+ bNumeric = TRUE;
+ xub_StrLen nDot = 0;
+ xub_StrLen nDecimalDelCount = 0;
+ xub_StrLen nSpaceCount = 0;
+ for (xub_StrLen j = 0; j < aField2.Len(); j++)
{
- const sal_Unicode c = aValue.GetChar(static_cast<sal_uInt16>(j));
- // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
- if (c == cThousandDelimiter && j)
+ const sal_Unicode c = aField2.GetChar(j);
+ if ( j == nSpaceCount && m_cFieldDelimiter != 32 && c == 32 )
+ {
+ ++nSpaceCount;
continue;
- else
+ }
+ // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ if ( ( !cDecimalDelimiter || c != cDecimalDelimiter ) &&
+ ( !cThousandDelimiter || c != cThousandDelimiter ) &&
+ !aCharClass.isDigit(aField2,j) &&
+ ( j != 0 || (c != '+' && c != '-' ) ) )
{
bNumeric = FALSE;
break;
}
+ if (cDecimalDelimiter && c == cDecimalDelimiter)
+ {
+ io_nPrecisions = 15; // we have an decimal value
+ io_nScales = 2;
+ ++nDecimalDelCount;
+ } // if (cDecimalDelimiter && c == cDecimalDelimiter)
+ if ( c == '.' )
+ ++nDot;
}
- }
- // jetzt koennte es noch ein Datumsfeld sein
- if (!bNumeric)
+ if (nDecimalDelCount > 1 || nDot > 1 ) // if there is more than one dot it isn't a number
+ bNumeric = FALSE;
+ if (bNumeric && cThousandDelimiter)
+ {
+ // Ist der Trenner richtig angegeben?
+ const String aValue = aField2.GetToken(0,cDecimalDelimiter);
+ for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
+ {
+ const sal_Unicode c = aValue.GetChar(static_cast<sal_uInt16>(j));
+ // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+ if (c == cThousandDelimiter && j)
+ continue;
+ else
+ {
+ bNumeric = FALSE;
+ break;
+ }
+ }
+ }
+
+ // jetzt koennte es noch ein Datumsfeld sein
+ if (!bNumeric)
+ {
+ try
+ {
+ nIndex = m_xNumberFormatter->detectNumberFormat(::com::sun::star::util::NumberFormat::ALL,aField2);
+ }
+ catch(Exception&)
+ {
+ }
+ }
+ }
+ }
+ }
+ else if ( io_nType == DataType::DATE || io_nType == DataType::TIMESTAMP || io_nType == DataType::TIME)
+ {
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
+ if (aField.Len() == 0 ||
+ (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
+ {
+ }
+ else
+ {
+ String aField2;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ aField2 = aField;
+ if (aField2.Len() )
{
try
{
@@ -242,87 +322,83 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
{
if (cDecimalDelimiter)
{
- if(nPrecision)
+ if(io_nPrecisions)
{
- eType = DataType::DECIMAL;
+ io_nType = DataType::DECIMAL;
static const ::rtl::OUString s_sDECIMAL(RTL_CONSTASCII_USTRINGPARAM("DECIMAL"));
- aTypeName = s_sDECIMAL;
+ o_sTypeName = s_sDECIMAL;
}
else
{
- eType = DataType::DOUBLE;
+ io_nType = DataType::DOUBLE;
static const ::rtl::OUString s_sDOUBLE(RTL_CONSTASCII_USTRINGPARAM("DOUBLE"));
- aTypeName = s_sDOUBLE;
+ o_sTypeName = s_sDOUBLE;
}
}
else
- eType = DataType::INTEGER;
+ {
+ io_nType = DataType::INTEGER;
+ io_nPrecisions = 0;
+ io_nScales = 0;
+ }
nFlags = ColumnSearch::BASIC;
}
else
{
-
switch (comphelper::getNumberFormatType(m_xNumberFormatter,nIndex))
{
case NUMBERFORMAT_DATE:
- eType = DataType::DATE;
+ io_nType = DataType::DATE;
{
static const ::rtl::OUString s_sDATE(RTL_CONSTASCII_USTRINGPARAM("DATE"));
- aTypeName = s_sDATE;
+ o_sTypeName = s_sDATE;
}
break;
case NUMBERFORMAT_DATETIME:
- eType = DataType::TIMESTAMP;
+ io_nType = DataType::TIMESTAMP;
{
static const ::rtl::OUString s_sTIMESTAMP(RTL_CONSTASCII_USTRINGPARAM("TIMESTAMP"));
- aTypeName = s_sTIMESTAMP;
+ o_sTypeName = s_sTIMESTAMP;
}
break;
case NUMBERFORMAT_TIME:
- eType = DataType::TIME;
+ io_nType = DataType::TIME;
{
static const ::rtl::OUString s_sTIME(RTL_CONSTASCII_USTRINGPARAM("TIME"));
- aTypeName = s_sTIME;
+ o_sTypeName = s_sTIME;
}
break;
default:
- eType = DataType::VARCHAR;
- nPrecision = 0; // nyi: Daten koennen aber laenger sein!
- nScale = 0;
+ io_nType = DataType::VARCHAR;
+ io_nPrecisions = 0; // nyi: Daten koennen aber laenger sein!
+ io_nScales = 0;
{
static const ::rtl::OUString s_sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
- aTypeName = s_sVARCHAR;
+ o_sTypeName = s_sVARCHAR;
}
};
nFlags |= ColumnSearch::CHAR;
}
-
- // check if the columname already exists
- String aAlias(aColumnName);
- OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
- sal_Int32 nExprCnt = 0;
- while(aFind != m_aColumns->get().end())
+ }
+ else
+ {
+ String aField;
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine,m_cFieldDelimiter,'\0');
+ if (aField.Len() == 0 ||
+ (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0)))
{
- (aAlias = aColumnName) += String::CreateFromInt32(++nExprCnt);
- aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase);
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
+ else
+ nStartPosFirstLine2 = nStartPosFirstLine;
+ }
+ else
+ {
+ String aField2;
+ if ( m_cStringDelimiter != '\0' )
+ aFirstLine.GetTokenSpecial(aField2,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter);
}
-
- sdbcx::OColumn* pColumn = new sdbcx::OColumn(aAlias,aTypeName,::rtl::OUString(),::rtl::OUString(),
- ColumnValue::NULLABLE,
- nPrecision,
- nScale,
- eType,
- sal_False,
- sal_False,
- sal_False,
- bCase);
- Reference< XPropertySet> xCol = pColumn;
- m_aColumns->get().push_back(xCol);
- m_aTypes.push_back(eType);
- m_aPrecisions.push_back(nPrecision);
- m_aScales.push_back(nScale);
}
- m_pFileStream->Seek(m_nStartRowFilePos);
}
// -------------------------------------------------------------------------
OFlatTable::OFlatTable(sdbcx::OCollection* _pTables,OFlatConnection* _pConnection,
diff --git a/connectivity/source/drivers/flat/flat.xcu b/connectivity/source/drivers/flat/flat.xcu
index d00d1f98c38c..a54394e853e8 100755
--- a/connectivity/source/drivers/flat/flat.xcu
+++ b/connectivity/source/drivers/flat/flat.xcu
@@ -75,8 +75,18 @@
<value>false</value>
</prop>
</node>
+ <node oor:name="MaxRowScan" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:int">
+ <value>100</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
+ <node oor:name="MaxRowScan" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index c7c85770419e..da55b60079b3 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -897,8 +897,8 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT
OSQLParseNode *pOptEscape;
const OSQLParseNode* pPart2 = parseTree->getChild(1);
pColumn = parseTree->getChild(0); // Match Item
- pAtom = pPart2->getChild(parseTree->count()-2); // Match String
- pOptEscape = pPart2->getChild(parseTree->count()-1); // Opt Escape Rule
+ pAtom = pPart2->getChild(pPart2->count()-2); // Match String
+ pOptEscape = pPart2->getChild(pPart2->count()-1); // Opt Escape Rule
const bool bNot = SQL_ISTOKEN(pPart2->getChild(0), NOT);
if (!(pAtom->getNodeType() == SQL_NODE_STRING ||
@@ -1374,7 +1374,7 @@ void OResultSet::setBoundedColumns(const OValueRow& _rRow,
const Reference<XDatabaseMetaData>& _xMetaData,
::std::vector<sal_Int32>& _rColMapping)
{
- ::comphelper::UStringMixEqual aCase(_xMetaData->storesMixedCaseQuotedIdentifiers());
+ ::comphelper::UStringMixEqual aCase(_xMetaData->supportsMixedCaseQuotedIdentifiers());
Reference<XPropertySet> xTableColumn;
::rtl::OUString sTableColumnName, sSelectColumnRealName;
diff --git a/connectivity/source/inc/TSkipDeletedSet.hxx b/connectivity/source/inc/TSkipDeletedSet.hxx
index bcd3fc23f1a6..c5d5d5b71dd6 100644
--- a/connectivity/source/inc/TSkipDeletedSet.hxx
+++ b/connectivity/source/inc/TSkipDeletedSet.hxx
@@ -98,7 +98,7 @@ namespace connectivity
@return the last position
*/
inline sal_Int32 getLastPosition() const { return m_aBookmarksPositions.size(); }
- inline void SetDeleted(bool _bDeletedVisible) { m_bDeletedVisible = _bDeletedVisible; }
+ inline void SetDeletedVisible(bool _bDeletedVisible) { m_bDeletedVisible = _bDeletedVisible; }
};
}
#endif // CONNECTIVITY_SKIPDELETEDSSET_HXX
diff --git a/connectivity/source/inc/dbase/DIndexColumns.hxx b/connectivity/source/inc/dbase/DIndexColumns.hxx
index be4f2577237e..6ccdb07c12f9 100644
--- a/connectivity/source/inc/dbase/DIndexColumns.hxx
+++ b/connectivity/source/inc/dbase/DIndexColumns.hxx
@@ -48,7 +48,7 @@ namespace connectivity
ODbaseIndexColumns( ODbaseIndex* _pIndex,
::osl::Mutex& _rMutex,
const TStringVector &_rVector)
- : sdbcx::OCollection(*_pIndex,_pIndex->getTable()->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
+ : sdbcx::OCollection(*_pIndex,_pIndex->getTable()->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
, m_pIndex(_pIndex)
{}
diff --git a/connectivity/source/inc/dbase/DIndexes.hxx b/connectivity/source/inc/dbase/DIndexes.hxx
index e07e0cb90cb3..7988bd0a2727 100644
--- a/connectivity/source/inc/dbase/DIndexes.hxx
+++ b/connectivity/source/inc/dbase/DIndexes.hxx
@@ -50,7 +50,7 @@ namespace connectivity
virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
public:
ODbaseIndexes(ODbaseTable* _pTable, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : ODbaseIndexes_BASE(*_pTable,_pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
+ const TStringVector &_rVector) : ODbaseIndexes_BASE(*_pTable,_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
, m_pTable(_pTable)
{}
diff --git a/connectivity/source/inc/file/FColumns.hxx b/connectivity/source/inc/file/FColumns.hxx
index 119ad228ad55..81214fbe603a 100644
--- a/connectivity/source/inc/file/FColumns.hxx
+++ b/connectivity/source/inc/file/FColumns.hxx
@@ -49,7 +49,7 @@ namespace connectivity
OColumns( OFileTable* _pTable,
::osl::Mutex& _rMutex,
const TStringVector &_rVector
- ) : sdbcx::OCollection(*_pTable,_pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
+ ) : sdbcx::OCollection(*_pTable,_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
,m_pTable(_pTable)
{}
};
diff --git a/connectivity/source/inc/file/FTables.hxx b/connectivity/source/inc/file/FTables.hxx
index 4a15985c248b..e5247652e895 100644
--- a/connectivity/source/inc/file/FTables.hxx
+++ b/connectivity/source/inc/file/FTables.hxx
@@ -46,7 +46,7 @@ namespace connectivity
virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
public:
OTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const TStringVector &_rVector) : sdbcx::OCollection(_rParent,_rMetaData->storesMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
+ const TStringVector &_rVector) : sdbcx::OCollection(_rParent,_rMetaData->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
,m_xMetaData(_rMetaData)
{}
diff --git a/connectivity/source/inc/flat/EConnection.hxx b/connectivity/source/inc/flat/EConnection.hxx
index 3b4fb7e558d6..becd4670f994 100644
--- a/connectivity/source/inc/flat/EConnection.hxx
+++ b/connectivity/source/inc/flat/EConnection.hxx
@@ -38,6 +38,7 @@ namespace connectivity
class OFlatConnection : public file::OConnection
{
private:
+ sal_Int32 m_nMaxRowsToScan;
sal_Bool m_bHeaderLine; // column names in first row
sal_Unicode m_cFieldDelimiter; // look at the name
sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter
@@ -55,6 +56,7 @@ namespace connectivity
inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; }
inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; }
inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;}
+ inline sal_Int32 getMaxRowsToScan() const { return m_nMaxRowsToScan;}
// XServiceInfo
DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/inc/flat/ETable.hxx b/connectivity/source/inc/flat/ETable.hxx
index 51d57376c5d2..ed3c40614217 100644
--- a/connectivity/source/inc/flat/ETable.hxx
+++ b/connectivity/source/inc/flat/ETable.hxx
@@ -33,6 +33,7 @@
#include "connectivity/CommonTools.hxx"
#include <tools/urlobj.hxx>
#include "file/quotedstring.hxx"
+#include <unotools/syslocale.hxx>
namespace connectivity
{
@@ -67,6 +68,9 @@ namespace connectivity
void fillColumns(const ::com::sun::star::lang::Locale& _aLocale);
BOOL CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo);
sal_Bool readLine(sal_Int32& _rnCurrentPos);
+ void impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,xub_StrLen& nStartPosFirstLine,xub_StrLen& nStartPosFirstLine2
+ ,sal_Int32& io_nType,sal_Int32& io_nPrecisions,sal_Int32& io_nScales,String& o_sTypeName
+ ,const sal_Unicode cDecimalDelimiter,const sal_Unicode cThousandDelimiter,const CharClass& aCharClass);
public:
virtual void refreshColumns();
diff --git a/connectivity/source/parse/PColumn.cxx b/connectivity/source/parse/PColumn.cxx
index 43e38f5a1674..10f4b5b4bdcf 100644
--- a/connectivity/source/parse/PColumn.cxx
+++ b/connectivity/source/parse/PColumn.cxx
@@ -28,12 +28,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
-#ifndef _CONNECTIVITY_SDBCX_COLUMN_HXX_
#include "connectivity/PColumn.hxx"
-#endif
#include "connectivity/dbtools.hxx"
#include "TConnection.hxx"
+
#include <comphelper/types.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::comphelper;
using namespace connectivity;
@@ -153,7 +153,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe
_rxResMetaData->getColumnType( _nColumnPos ),
_rxResMetaData->isAutoIncrement( _nColumnPos ),
_rxResMetaData->isCurrency( _nColumnPos ),
- _rxDBMetaData->storesMixedCaseQuotedIdentifiers()
+ _rxDBMetaData->supportsMixedCaseQuotedIdentifiers()
);
pColumn->setTableName( ::dbtools::composeTableName( _rxDBMetaData,
_rxResMetaData->getCatalogName( _nColumnPos ),
@@ -191,38 +191,85 @@ void OParseColumn::construct()
// -----------------------------------------------------------------------------
::cppu::IPropertyArrayHelper & SAL_CALL OParseColumn::getInfoHelper()
{
- OSL_ENSURE( !isNew(), "OParseColumn::OOrderColumn: a *new* OrderColumn?" );
+ OSL_ENSURE( !isNew(), "OParseColumn::getInfoHelper: a *new* ParseColumn?" );
return *OParseColumn_PROP::getArrayHelper();
}
+
// -----------------------------------------------------------------------------
-OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn
- ,sal_Bool _bCase
- ,sal_Bool _bAscending)
- : connectivity::sdbcx::OColumn( getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))
- , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME)))
- , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)))
- , getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)))
- , getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)))
- , getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT)))
- , sal_False
- , getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY)))
- , _bCase
- )
- , m_bAscending(_bAscending)
+namespace
+{
+ ::rtl::OUString lcl_getColumnTableName( const Reference< XPropertySet >& i_parseColumn )
+ {
+ ::rtl::OUString sColumnTableName;
+ try
+ {
+ OSL_VERIFY( i_parseColumn->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_TABLENAME ) ) >>= sColumnTableName );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sColumnTableName;
+ }
+}
+
+// -----------------------------------------------------------------------------
+OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn, const ::rtl::OUString& i_rOriginatingTableName,
+ sal_Bool _bCase, sal_Bool _bAscending )
+ : connectivity::sdbcx::OColumn(
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))),
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))),
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))),
+ getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))),
+ sal_False,
+ getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY))),
+ _bCase
+ )
+ ,m_bAscending(_bAscending)
+ ,m_sTableName( i_rOriginatingTableName )
{
construct();
}
+
+// -----------------------------------------------------------------------------
+OOrderColumn::OOrderColumn( const Reference<XPropertySet>& _xColumn, sal_Bool _bCase, sal_Bool _bAscending )
+ : connectivity::sdbcx::OColumn(
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME))),
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))),
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))),
+ getString(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DESCRIPTION))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))),
+ getINT32(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))),
+ getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))),
+ sal_False,
+ getBOOL(_xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISCURRENCY))),
+ _bCase
+ )
+ ,m_bAscending(_bAscending)
+ ,m_sTableName( lcl_getColumnTableName( _xColumn ) )
+{
+ construct();
+}
+
// -------------------------------------------------------------------------
OOrderColumn::~OOrderColumn()
{
}
+
// -------------------------------------------------------------------------
void OOrderColumn::construct()
{
- registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING),PROPERTY_ID_ISASCENDING,0,&m_bAscending, ::getCppuType(reinterpret_cast< sal_Bool*>(NULL)));
+ registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING), PROPERTY_ID_ISASCENDING,
+ PropertyAttribute::READONLY, const_cast< sal_Bool* >( &m_bAscending ), ::getCppuType( reinterpret_cast< sal_Bool* >( NULL ) ) );
+ registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TABLENAME), PROPERTY_ID_TABLENAME,
+ PropertyAttribute::READONLY, const_cast< ::rtl::OUString* >( &m_sTableName ), ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
}
// -----------------------------------------------------------------------------
::cppu::IPropertyArrayHelper* OOrderColumn::createArrayHelper() const
@@ -232,17 +279,14 @@ void OOrderColumn::construct()
// -----------------------------------------------------------------------------
::cppu::IPropertyArrayHelper & SAL_CALL OOrderColumn::getInfoHelper()
{
- OSL_ENSURE( !isNew(), "OOrderColumn::OOrderColumn: a *new* OrderColumn?" );
+ OSL_ENSURE( !isNew(), "OOrderColumn::getInfoHelper: a *new* OrderColumn?" );
return *OOrderColumn_PROP::getArrayHelper();
}
// -----------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OOrderColumn::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
{
::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
- if ( m_bOrder )
- aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.OrderColumn");
- else
- aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.GroupColumn");
+ aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.OrderColumn");
return aSupported;
}
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index e1d805e9a1e5..34ba49566383 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -93,7 +93,7 @@ namespace connectivity
OSL_PRECOND( m_xConnection.is(), "OSQLParseTreeIteratorImpl::OSQLParseTreeIteratorImpl: invalid connection!" );
m_xDatabaseMetaData = m_xConnection->getMetaData();
- m_bIsCaseSensitive = m_xDatabaseMetaData.is() && m_xDatabaseMetaData->storesMixedCaseQuotedIdentifiers();
+ m_bIsCaseSensitive = m_xDatabaseMetaData.is() && m_xDatabaseMetaData->supportsMixedCaseQuotedIdentifiers();
m_pTables.reset( new OSQLTables( m_bIsCaseSensitive ) );
m_pSubTables.reset( new OSQLTables( m_bIsCaseSensitive ) );
@@ -1910,12 +1910,12 @@ void OSQLParseTreeIterator::setOrderByColumnName(const ::rtl::OUString & rColumn
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "parse", "Ocke.Janssen@sun.com", "OSQLParseTreeIterator::setOrderByColumnName" );
Reference<XPropertySet> xColumn = findColumn( rColumnName, rTableRange, false );
if ( xColumn.is() )
- m_aOrderColumns->get().push_back(new OOrderColumn(xColumn,isCaseSensitive(),bAscending));
+ m_aOrderColumns->get().push_back(new OOrderColumn( xColumn, rTableRange, isCaseSensitive(), bAscending ) );
else
{
sal_Int32 nId = rColumnName.toInt32();
if ( nId > 0 && nId < static_cast<sal_Int32>(m_aSelectColumns->get().size()) )
- m_aOrderColumns->get().push_back(new OOrderColumn((m_aSelectColumns->get())[nId-1],isCaseSensitive(),bAscending));
+ m_aOrderColumns->get().push_back( new OOrderColumn( ( m_aSelectColumns->get() )[nId-1], isCaseSensitive(), bAscending ) );
}
#ifdef SQL_TEST_PARSETREEITERATOR
diff --git a/connectivity/source/simpledbt/staticdbtools_s.cxx b/connectivity/source/simpledbt/staticdbtools_s.cxx
index 17d052a35b6b..36f9478a3312 100644
--- a/connectivity/source/simpledbt/staticdbtools_s.cxx
+++ b/connectivity/source/simpledbt/staticdbtools_s.cxx
@@ -29,7 +29,7 @@
#include "precompiled_connectivity.hxx"
#include <connectivity/virtualdbtools.hxx>
#include "staticdbtools_s.hxx"
-#include <connectivity/dbconversion.hxx>
+#include "connectivity/dbconversion.hxx"
#include <connectivity/dbtools.hxx>
#include <com/sun/star/sdb/SQLContext.hpp>
@@ -61,23 +61,23 @@ namespace connectivity
}
//----------------------------------------------------------------
- double ODataAccessStaticTools::getValue(const Reference< XColumn>& _rxVariant, const Date& rNullDate, sal_Int16 nKeyType) const
+ double ODataAccessStaticTools::getValue(const Reference< XColumn>& _rxVariant, const Date& rNullDate ) const
{
- return ::dbtools::DBTypeConversion::getValue(_rxVariant, rNullDate, nKeyType);
+ return ::dbtools::DBTypeConversion::getValue( _rxVariant, rNullDate );
}
//----------------------------------------------------------------
- ::rtl::OUString ODataAccessStaticTools::getValue(const Reference< XColumn >& _rxColumn, const Reference< XNumberFormatter >& _rxFormatter,
+ ::rtl::OUString ODataAccessStaticTools::getFormattedValue(const Reference< XColumn >& _rxColumn, const Reference< XNumberFormatter >& _rxFormatter,
const Date& _rNullDate, sal_Int32 _nKey, sal_Int16 _nKeyType) const
{
- return ::dbtools::DBTypeConversion::getValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
+ return ::dbtools::DBTypeConversion::getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
}
//----------------------------------------------------------------
- ::rtl::OUString ODataAccessStaticTools::getValue( const Reference< XPropertySet>& _rxColumn, const Reference< XNumberFormatter>& _rxFormatter,
+ ::rtl::OUString ODataAccessStaticTools::getFormattedValue( const Reference< XPropertySet>& _rxColumn, const Reference< XNumberFormatter>& _rxFormatter,
const Locale& _rLocale, const Date& _rNullDate ) const
{
- return ::dbtools::DBTypeConversion::getValue( _rxColumn, _rxFormatter, _rLocale, _rNullDate );
+ return ::dbtools::DBTypeConversion::getFormattedValue( _rxColumn, _rxFormatter, _rLocale, _rNullDate );
}
//----------------------------------------------------------------
diff --git a/connectivity/source/simpledbt/staticdbtools_s.hxx b/connectivity/source/simpledbt/staticdbtools_s.hxx
index 6746ad7a0918..4836f6bf3d12 100644
--- a/connectivity/source/simpledbt/staticdbtools_s.hxx
+++ b/connectivity/source/simpledbt/staticdbtools_s.hxx
@@ -54,11 +54,10 @@ namespace connectivity
// ------------------------------------------------
virtual double getValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant,
- const ::com::sun::star::util::Date& rNullDate,
- sal_Int16 nKeyType) const;
+ const ::com::sun::star::util::Date& rNullDate ) const;
// ------------------------------------------------
- virtual ::rtl::OUString getValue(
+ virtual ::rtl::OUString getFormattedValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
const ::com::sun::star::util::Date& _rNullDate,
@@ -66,7 +65,7 @@ namespace connectivity
sal_Int16 _nKeyType) const;
// ------------------------------------------------
- virtual ::rtl::OUString getValue(
+ virtual ::rtl::OUString getFormattedValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter,
const ::com::sun::star::lang::Locale& _rLocale,
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 006d55a01de6..bab5826e54aa 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -682,10 +682,23 @@ namespace cppcanvas
case GRADIENT_AXIAL:
{
- basegfx::tools::createLinearODFGradientInfo(aGradInfo,
+ // Adapt the border so that it is suitable
+ // for the axial gradient. An axial
+ // gradient consists of two linear
+ // gradients. Each of those covers half
+ // of the total size. In order to
+ // compensate for the condensed display of
+ // the linear gradients, we have to
+ // enlarge the area taken up by the actual
+ // gradient (1-fBorder). After that we
+ // have to turn the result back into a
+ // border value, hence the second (left
+ // most 1-...
+ const double fAxialBorder (1-2*(1-fBorder));
+ basegfx::tools::createAxialODFGradientInfo(aGradInfo,
aBounds,
nSteps,
- fBorder,
+ fAxialBorder,
fRotation);
// map odf to svg gradient orientation - x
// instead of y direction
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 25ccabf2789b..6fc47499b003 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -36,7 +36,6 @@
#include <dialmgr.hxx>
#include <sfx2/msg.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/app.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/minfitem.hxx>
@@ -1442,9 +1441,6 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet )
const SfxPoolItem* pFontItem=0;
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_SPECIALCHAR, TRUE, &pFontItem ) )
m_pFontItem = PTR_CAST( SfxStringItem, pFontItem );
-
- if ( m_pStringItem )
- pGroupLBox->AddAndSelect( m_pStringItem, m_pFontItem );
}
}
diff --git a/cui/source/customize/acccfg.hrc b/cui/source/customize/acccfg.hrc
index be0771b83fc8..d358b757949c 100644
--- a/cui/source/customize/acccfg.hrc
+++ b/cui/source/customize/acccfg.hrc
@@ -63,7 +63,7 @@
#define STR_PDF_EXPORT_SEND 59
#define STR_RECHECK_DOCUMENT 60
#define IMG_INFO 61
-#define STR_BASICNAME 62
+ // FREE
#define BMP_COLLAPSED 63
#define BMP_EXPANDED 64
#define BMP_COLLAPSED_HC 65
diff --git a/cui/source/customize/acccfg.src b/cui/source/customize/acccfg.src
index de5d4b89f186..a03fa9c3eb00 100644
--- a/cui/source/customize/acccfg.src
+++ b/cui/source/customize/acccfg.src
@@ -271,10 +271,6 @@ Resource RID_SVXPAGE_CONFIGGROUPBOX
ImageBitmap = Bitmap { File = "imh30826.png"; };
MASKCOLOR
};
- String STR_BASICNAME
- {
- Text = "%PRODUCTNAME Basic" ;
- };
Image BMP_COLLAPSED
{
ImageBitmap = Bitmap
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 858564af4e40..4c46f5d0f259 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -54,7 +54,6 @@
#include <sfx2/msg.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/mnumgr.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/minfitem.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/request.hxx>
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index b85ec24adee2..ceb6b8f1e30e 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -59,7 +59,6 @@
#include <tools/urlobj.hxx>
#include "cuires.hrc"
#include <sfx2/app.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/minfitem.hxx>
#include <unotools/processfactory.hxx>
#include <comphelper/documentinfo.hxx>
@@ -350,16 +349,13 @@ void SfxConfigFunctionListBox_Impl::ClearAll()
{
SfxGroupInfo_Impl *pData = aArr[i];
- if ( pData->nKind == SFX_CFGFUNCTION_MACRO ||
- pData->nKind == SFX_CFGFUNCTION_SCRIPT )
+ if ( pData->nKind == SFX_CFGFUNCTION_SCRIPT )
{
- SfxMacroInfo *pInfo = (SfxMacroInfo*) pData->pObject;
- SFX_APP()->GetMacroConfig()->ReleaseSlotId( pInfo->GetSlotId() );
- delete pInfo;
+ String* pScriptURI = (String*)pData->pObject;
+ delete pScriptURI;
}
if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER
- || pData->nKind == SFX_CFGGROUP_DOCBASICMGR
)
{
XInterface* xi = static_cast<XInterface *>(pData->pObject);
@@ -376,21 +372,16 @@ void SfxConfigFunctionListBox_Impl::ClearAll()
Clear();
}
-SfxMacroInfo* SfxConfigFunctionListBox_Impl::GetMacroInfo()
-/* Beschreibung
- Gibt die MacroInfo des selektierten Entry zur"uck ( sofern vorhanden ).
-*/
+String SfxConfigFunctionListBox_Impl::GetSelectedScriptURI()
{
SvLBoxEntry *pEntry = FirstSelected();
if ( pEntry )
{
SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pData && ( pData->nKind == SFX_CFGFUNCTION_MACRO ||
- pData->nKind == SFX_CFGFUNCTION_SCRIPT ) )
- return (SfxMacroInfo*) pData->pObject;
+ if ( pData && ( pData->nKind == SFX_CFGFUNCTION_SCRIPT ) )
+ return *(String*)pData->pObject;
}
-
- return 0;
+ return String();
}
String SfxConfigFunctionListBox_Impl::GetCurCommand()
@@ -449,7 +440,6 @@ struct SvxConfigGroupBoxResource_Impl : public Resource
String m_sDlgMacros;
String m_aHumanAppName;
String m_aStrGroupStyles;
- String m_aScriptType;
Image m_collapsedImage;
Image m_collapsedImage_hc;
Image m_expandedImage;
@@ -474,7 +464,6 @@ SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() :
m_sDlgMacros(String(CUI_RES(STR_DLG_MACROS))),
m_aHumanAppName(String(CUI_RES(STR_HUMAN_APPNAME))),
m_aStrGroupStyles(String(CUI_RES(STR_GROUP_STYLES))),
- m_aScriptType(String(CUI_RES(STR_BASICNAME))),
m_collapsedImage(CUI_RES(BMP_COLLAPSED)),
m_collapsedImage_hc(CUI_RES(BMP_COLLAPSED_HC)),
m_expandedImage(CUI_RES(BMP_EXPANDED)),
@@ -486,42 +475,11 @@ SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() :
SfxConfigGroupListBox_Impl::SfxConfigGroupListBox_Impl(
Window* pParent, const ResId& rResId, ULONG nConfigMode )
: SvTreeListBox( pParent, rResId )
- , pImp(new SvxConfigGroupBoxResource_Impl()), pFunctionListBox(0), nMode( nConfigMode ), bShowSF( FALSE ), bShowBasic( TRUE ), pStylesInfo(0)
+ , pImp(new SvxConfigGroupBoxResource_Impl()), pFunctionListBox(0), nMode( nConfigMode ), pStylesInfo(0)
{
SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
SetNodeBitmaps( pImp->m_collapsedImage, pImp->m_expandedImage, BMP_COLOR_NORMAL );
SetNodeBitmaps( pImp->m_collapsedImage_hc, pImp->m_expandedImage_hc, BMP_COLOR_HIGHCONTRAST );
-
- // Check configuration to see whether only Basic macros,
- // only Scripting Framework scripts, or both should be listed
- Any value;
- sal_Bool tmp = false;
-
- value = ::utl::ConfigManager::GetConfigManager()->GetLocalProperty(
- ::rtl::OUString::createFromAscii(
- "Office.Scripting/ScriptDisplaySettings/ShowBasic" ) );
-
- value >>= tmp;
-
- if (tmp == sal_True) {
- bShowBasic = TRUE;
- }
- else {
- bShowBasic = FALSE;
- }
-
- value = ::utl::ConfigManager::GetConfigManager()->GetLocalProperty(
- ::rtl::OUString::createFromAscii(
- "Office.Scripting/ScriptDisplaySettings/ShowSF" ) );
-
- value >>= tmp;
-
- if (tmp == sal_True) {
- bShowSF = TRUE;
- }
- else {
- bShowSF = FALSE;
- }
}
@@ -537,7 +495,6 @@ void SfxConfigGroupListBox_Impl::ClearAll()
{
SfxGroupInfo_Impl *pData = aArr[i];
if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER
- || pData->nKind == SFX_CFGGROUP_DOCBASICMGR
)
{
XInterface* xi = static_cast<XInterface *>(pData->pObject);
@@ -553,31 +510,6 @@ void SfxConfigGroupListBox_Impl::ClearAll()
Clear();
}
-void SfxConfigGroupListBox_Impl::SetScriptType( const String& rScriptType )
-{
- pImp->m_aScriptType = rScriptType;
- ULONG nPos=0;
- SvLBoxEntry *pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ );
- while ( pEntry )
- {
- SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pInfo->nKind == SFX_CFGGROUP_BASICLIB && ( IsExpanded( pEntry ) || pInfo->bWasOpened ) )
- {
- Collapse( pEntry );
- SvLBoxEntry *pChild = FirstChild( pEntry );
- while (pChild)
- {
- GetModel()->Remove( pChild );
- pChild = FirstChild( pEntry );
- }
-
- Expand( pEntry );
- }
-
- pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ );
- }
-}
-
void SfxConfigGroupListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles)
{
pStylesInfo = pStyles;
@@ -596,18 +528,6 @@ String SfxConfigGroupListBox_Impl::GetGroup()
if ( pInfo->nKind == SFX_CFGGROUP_FUNCTION )
return GetEntryText( pEntry );
- if ( pInfo->nKind == SFX_CFGGROUP_BASICMGR )
- {
- BasicManager *pMgr = (BasicManager*) pInfo->pObject;
- return pMgr->GetName();
- }
-
- if ( pInfo->nKind == SFX_CFGGROUP_DOCBASICMGR )
- {
- Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) );
- return ::comphelper::DocumentInfo::getDocumentTitle( xDoc );
- }
-
pEntry = GetParent( pEntry );
}
@@ -615,27 +535,6 @@ String SfxConfigGroupListBox_Impl::GetGroup()
}
//-----------------------------------------------
-BasicManager* SfxConfigGroupListBox_Impl::GetBasicManager( const SvLBoxEntry& _rEntry )
-{
- BasicManager* pBasMgr = NULL;
-
- SfxGroupInfo_Impl* pInfo = (SfxGroupInfo_Impl*) _rEntry.GetUserData();
- switch ( pInfo->nKind )
- {
- case SFX_CFGGROUP_BASICMGR :
- pBasMgr = (BasicManager*) pInfo->pObject;
- break;
- case SFX_CFGGROUP_DOCBASICMGR :
- {
- Reference< XModel > xDoc( static_cast< XModel* >( pInfo->pObject ) );
- pBasMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc );
- }
- break;
- }
- return pBasMgr;
-}
-
-//-----------------------------------------------
void SfxConfigGroupListBox_Impl::InitModule()
{
try
@@ -758,253 +657,144 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul
InitStyles();
}
- /*
-
- // Verwendet wird der aktuelle Slotpool
- if ( nMode )
+ OSL_TRACE("** ** About to initialise SF Scripts");
+ // Add Scripting Framework entries
+ Reference< browse::XBrowseNode > rootNode;
+ Reference< XComponentContext > xCtx;
+ try
{
- pSlotPool = pPool ? pPool : &SFX_SLOTPOOL();
- for ( USHORT i=1; i<pSlotPool->GetGroupCount(); i++ )
- {
- // Gruppe anw"ahlen ( Gruppe 0 ist intern )
- String aName = pSlotPool->SeekGroup( i );
- const SfxSlot *pSfxSlot = pSlotPool->FirstSlot();
- if ( pSfxSlot )
- {
- // Check if all entries are not useable. Don't
- // insert a group without any useable function.
- sal_Bool bActiveEntries = sal_False;
- while ( pSfxSlot )
- {
- USHORT nId = pSfxSlot->GetSlotId();
- if ( pSfxSlot->GetMode() & nMode )
- {
- bActiveEntries = sal_True;
- break;
- }
-
- pSfxSlot = pSlotPool->NextSlot();
- }
-
- if ( bActiveEntries )
- {
- // Wenn Gruppe nicht leer
- SvLBoxEntry *pEntry = InsertEntry( aName, NULL );
- SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_FUNCTION, i );
- aArr.Insert( pInfo, aArr.Count() );
- pEntry->SetUserData( pInfo );
- }
- }
- }
+ Reference < beans::XPropertySet > xProps(
+ ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW );
+ Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName(
+ ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW );
+ rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) );
+ //rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROORGANIZER ) );
}
-*/
- SfxApplication *pSfxApp = SFX_APP();
- if ( bShowBasic )
+ catch( Exception& e )
{
- // Basics einsammeln
- pSfxApp->EnterBasicCall();
- String aMacroName(' ');
- aMacroName += pImp->m_sDlgMacros;
-
- // Zuerst AppBasic
- BasicManager *pAppBasicMgr = pSfxApp->GetBasicManager();
- BOOL bInsert = TRUE;
- /*
- if ( pArr )
- {
- bInsert = FALSE;
- for ( USHORT n=0; n<pArr->Count(); n++ )
- {
- if ( *(*pArr)[n] == pSfxApp->GetName() )
- {
- bInsert = TRUE;
- break;
- }
- }
- }
- */
-
- if ( bInsert )
- {
- pAppBasicMgr->SetName( pSfxApp->GetName() );
- if ( pAppBasicMgr->GetLibCount() )
- {
- // Nur einf"ugen, wenn Bibliotheken vorhanden
- String aAppBasTitle( pImp->m_aHumanAppName );
- aAppBasTitle += aMacroName;
- SvLBoxEntry *pEntry = InsertEntry( aAppBasTitle, 0 );
- SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMGR, 0, pAppBasicMgr );
- // aArr.Insert( pInfo, aArr.Count() );
- pEntry->SetUserData( pInfo );
- pEntry->EnableChildsOnDemand( TRUE );
- // Expand( pEntry );
- }
- }
-
- Reference< XModel > xDoc( lcl_getScriptableDocument_nothrow( m_xFrame ) );
- if ( xDoc.is() )
- {
- BasicManager* pBasicMgr = ::basic::BasicManagerRepository::getDocumentBasicManager( xDoc );
- if ( pBasicMgr != pAppBasicMgr && pBasicMgr->GetLibCount() )
- {
- String sDocTitle( ::comphelper::DocumentInfo::getDocumentTitle( xDoc ) );
- pBasicMgr->SetName( sDocTitle );
-
- // Nur einf"ugen, wenn eigenes Basic mit Bibliotheken
- SvLBoxEntry *pEntry = InsertEntry( sDocTitle.Append( aMacroName ), NULL );
- xDoc->acquire();
- SfxGroupInfo_Impl *pInfo =
- new SfxGroupInfo_Impl( SFX_CFGGROUP_DOCBASICMGR, 0, xDoc.get() );
- pEntry->SetUserData( pInfo );
- pEntry->EnableChildsOnDemand( TRUE );
- }
- }
-
- pSfxApp->LeaveBasicCall();
+ OSL_TRACE(" Caught some exception whilst retrieving browse nodes from factory... Exception: %s",
+ ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+ // TODO exception handling
}
- OSL_TRACE("** ** About to initialise SF Scripts");
- if ( bShowSF )
+
+ if ( rootNode.is() )
{
- OSL_TRACE("** ** bShowSF");
- // Add Scripting Framework entries
- Reference< browse::XBrowseNode > rootNode;
- Reference< XComponentContext > xCtx;
- try
+ if ( nMode )
{
- Reference < beans::XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW );
- Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName(
- ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW );
- rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) );
- //rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROORGANIZER ) );
+ //We call acquire on the XBrowseNode so that it does not
+ //get autodestructed and become invalid when accessed later.
+ rootNode->acquire();
+
+ SfxGroupInfo_Impl *pInfo =
+ new SfxGroupInfo_Impl( SFX_CFGGROUP_SCRIPTCONTAINER, 0,
+ static_cast<void *>(rootNode.get()));
+
+ String aTitle(pImp->m_sDlgMacros);
+ SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL );
+ pNewEntry->SetUserData( pInfo );
+ pNewEntry->EnableChildsOnDemand( TRUE );
+ aArr.Insert( pInfo, aArr.Count() );
}
- catch( Exception& e )
+ else
{
- OSL_TRACE(" Caught some exception whilst retrieving browse nodes from factory... Exception: %s",
- ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- // TODO exception handling
- }
-
+ //We are only showing scripts not slot APIs so skip
+ //Root node and show location nodes
+ try {
+ if ( rootNode->hasChildNodes() )
+ {
+ Sequence< Reference< browse::XBrowseNode > > children =
+ rootNode->getChildNodes();
+ BOOL bIsRootNode = FALSE;
- if ( rootNode.is() )
- {
- if ( nMode )
- {
- //We call acquire on the XBrowseNode so that it does not
- //get autodestructed and become invalid when accessed later.
- rootNode->acquire();
-
- SfxGroupInfo_Impl *pInfo =
- new SfxGroupInfo_Impl( SFX_CFGGROUP_SCRIPTCONTAINER, 0,
- static_cast<void *>(rootNode.get()));
-
- String aTitle(pImp->m_sDlgMacros);
- SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL );
- pNewEntry->SetUserData( pInfo );
- pNewEntry->EnableChildsOnDemand( TRUE );
- aArr.Insert( pInfo, aArr.Count() );
- }
- else
- {
- //We are only showing scripts not slot APIs so skip
- //Root node and show location nodes
- try {
- if ( rootNode->hasChildNodes() )
+ ::rtl::OUString user = ::rtl::OUString::createFromAscii("user");
+ ::rtl::OUString share = ::rtl::OUString::createFromAscii("share");
+ if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") ))
{
- Sequence< Reference< browse::XBrowseNode > > children =
- rootNode->getChildNodes();
- BOOL bIsRootNode = FALSE;
-
- ::rtl::OUString user = ::rtl::OUString::createFromAscii("user");
- ::rtl::OUString share = ::rtl::OUString::createFromAscii("share");
- if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") ))
- {
- bIsRootNode = TRUE;
- }
+ bIsRootNode = TRUE;
+ }
- //To mimic current starbasic behaviour we
- //need to make sure that only the current document
- //is displayed in the config tree. Tests below
- //set the bDisplay flag to FALSE if the current
- //node is a first level child of the Root and is NOT
- //either the current document, user or share
- ::rtl::OUString currentDocTitle;
- Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) );
- if ( xDocument.is() )
- {
- currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument );
- }
+ //To mimic current starbasic behaviour we
+ //need to make sure that only the current document
+ //is displayed in the config tree. Tests below
+ //set the bDisplay flag to FALSE if the current
+ //node is a first level child of the Root and is NOT
+ //either the current document, user or share
+ ::rtl::OUString currentDocTitle;
+ Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) );
+ if ( xDocument.is() )
+ {
+ currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument );
+ }
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
+ for ( sal_Int32 n = 0; n < children.getLength(); n++ )
+ {
+ Reference< browse::XBrowseNode >& theChild = children[n];
+ BOOL bDisplay = TRUE;
+ ::rtl::OUString uiName = theChild->getName();
+ if ( bIsRootNode )
{
- Reference< browse::XBrowseNode >& theChild = children[n];
- BOOL bDisplay = TRUE;
- ::rtl::OUString uiName = theChild->getName();
- if ( bIsRootNode )
+ if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) ||
+ theChild->getName().equals( currentDocTitle ) ) ) )
+ {
+ bDisplay=FALSE;
+ }
+ else
{
- if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) ||
- theChild->getName().equals( currentDocTitle ) ) ) )
+ if ( uiName.equals( user ) )
{
- bDisplay=FALSE;
+ uiName = pImp->m_sMyMacros;
}
- else
+ else if ( uiName.equals( share ) )
{
- if ( uiName.equals( user ) )
- {
- uiName = pImp->m_sMyMacros;
- }
- else if ( uiName.equals( share ) )
- {
- uiName = pImp->m_sProdMacros;
- }
+ uiName = pImp->m_sProdMacros;
}
}
- if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay )
- {
+ }
+ if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay )
+ {
// We call acquire on the XBrowseNode so that it does not
// get autodestructed and become invalid when accessed later.
- theChild->acquire();
+ theChild->acquire();
- SfxGroupInfo_Impl* pInfo =
- new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER,
- 0, static_cast<void *>( theChild.get()));
+ SfxGroupInfo_Impl* pInfo =
+ new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER,
+ 0, static_cast<void *>( theChild.get()));
- Image aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_NORMAL );
- SvLBoxEntry* pNewEntry =
- InsertEntry( uiName, NULL);
- SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
- aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_HIGHCONTRAST );
- SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
+ Image aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_NORMAL );
+ SvLBoxEntry* pNewEntry =
+ InsertEntry( uiName, NULL);
+ SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
+ SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL);
+ aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_HIGHCONTRAST );
+ SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
+ SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST);
- pNewEntry->SetUserData( pInfo );
- aArr.Insert( pInfo, aArr.Count() );
+ pNewEntry->SetUserData( pInfo );
+ aArr.Insert( pInfo, aArr.Count() );
- if ( children[n]->hasChildNodes() )
- {
- Sequence< Reference< browse::XBrowseNode > > grandchildren =
- children[n]->getChildNodes();
+ if ( children[n]->hasChildNodes() )
+ {
+ Sequence< Reference< browse::XBrowseNode > > grandchildren =
+ children[n]->getChildNodes();
- for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ )
+ for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ )
+ {
+ if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER )
{
- if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER )
- {
- pNewEntry->EnableChildsOnDemand( TRUE );
- m = grandchildren.getLength();
- }
+ pNewEntry->EnableChildsOnDemand( TRUE );
+ m = grandchildren.getLength();
}
}
}
}
}
}
- catch (RuntimeException&) {
- // do nothing, the entry will not be displayed in the UI
- }
+ }
+ catch (RuntimeException&) {
+ // do nothing, the entry will not be displayed in the UI
}
}
}
@@ -1020,14 +810,6 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMul
pEntry->EnableChildsOnDemand( TRUE );
}
-/* {
- String sSymbols( String::CreateFromAscii("Symbols") );
- SvLBoxEntry *pEntry = InsertEntry( sSymbols, 0 );
- SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_SPECIALCHARACTERS, 0, 0 ); // TODO last parameter should contain user data
- aArr.Insert( pInfo, aArr.Count() );
- pEntry->SetUserData( pInfo );
- } */
-
MakeVisible( GetEntry( 0,0 ) );
SetUpdateMode( TRUE );
}
@@ -1208,7 +990,6 @@ void SfxConfigGroupListBox_Impl::GroupSelected()
pFunctionListBox->SetUpdateMode(FALSE);
pFunctionListBox->ClearAll();
if ( pInfo->nKind != SFX_CFGGROUP_FUNCTION &&
- pInfo->nKind != SFX_CFGGROUP_BASICMOD &&
pInfo->nKind != SFX_CFGGROUP_SCRIPTCONTAINER &&
pInfo->nKind != SFX_CFGGROUP_STYLES )
{
@@ -1220,7 +1001,7 @@ void SfxConfigGroupListBox_Impl::GroupSelected()
{
case SFX_CFGGROUP_FUNCTION :
{
- USHORT nGroup = pInfo->nOrd;
+ USHORT nGroup = pInfo->nUniqueID;
css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider (m_xFrame, css::uno::UNO_QUERY_THROW);
css::uno::Sequence< css::frame::DispatchInformation > lCommands = xProvider->getConfigurableDispatchInformation(nGroup);
sal_Int32 c = lCommands.getLength();
@@ -1240,45 +1021,6 @@ void SfxConfigGroupListBox_Impl::GroupSelected()
break;
}
- case SFX_CFGGROUP_BASICMOD :
- {
- SvLBoxEntry *pLibEntry = GetParent( pEntry );
- SfxGroupInfo_Impl *pLibInfo =
- (SfxGroupInfo_Impl*) pLibEntry->GetUserData();
- SvLBoxEntry *pBasEntry = GetParent( pLibEntry );
- SfxGroupInfo_Impl *pBasInfo =
- (SfxGroupInfo_Impl*) pBasEntry->GetUserData();
-
- StarBASIC *pLib = (StarBASIC*) pLibInfo->pObject;
- Reference< XModel > xDoc;
- if ( pBasInfo->nKind == SFX_CFGGROUP_DOCBASICMGR )
- xDoc = static_cast< XModel* >( pBasInfo->pObject );
-
- SbModule *pMod = (SbModule*) pInfo->pObject;
- for ( USHORT nMeth=0; nMeth < pMod->GetMethods()->Count(); nMeth++ )
- {
- SbxMethod *pMeth = (SbxMethod*)pMod->GetMethods()->Get(nMeth);
- SfxMacroInfoPtr pInf = new SfxMacroInfo( !xDoc.is(),
- pLib->GetName(),
- pMod->GetName(),
- pMeth->GetName());
- if ( pMeth->GetInfo() )
- pInf->SetHelpText( pMeth->GetInfo()->GetComment() );
- USHORT nId = SFX_APP()->GetMacroConfig()->GetSlotId( pInf );
- if ( !nId )
- break; // Kein Slot mehr frei
-
- SvLBoxEntry* pFuncEntry =
- pFunctionListBox->InsertEntry( pMeth->GetName(), NULL );
- SfxGroupInfo_Impl *pGrpInfo =
- new SfxGroupInfo_Impl( SFX_CFGFUNCTION_MACRO, nId, pInf );
- pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() );
- pFuncEntry->SetUserData( pGrpInfo );
- }
-
- break;
- }
-
case SFX_CFGGROUP_SCRIPTCONTAINER:
{
if ( !GetChildCount( pEntry ) )
@@ -1308,13 +1050,8 @@ void SfxConfigGroupListBox_Impl::GroupSelected()
xPropSet->getPropertyValue( String::CreateFromAscii( "URI" ) );
value >>= uri;
- SfxMacroInfo* aInfo = new SfxMacroInfo( (String)uri );
- aInfo->SetHelpText( uri );
- SFX_APP()->GetMacroConfig()->GetSlotId( aInfo );
-
- SfxGroupInfo_Impl* pGrpInfo =
- new SfxGroupInfo_Impl(SFX_CFGFUNCTION_SCRIPT,
- aInfo->GetSlotId(), aInfo);
+ String* pScriptURI = new String( uri );
+ SfxGroupInfo_Impl* pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGFUNCTION_SCRIPT, 0, pScriptURI );
Image aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL );
SvLBoxEntry* pNewEntry =
@@ -1422,66 +1159,6 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry )
pInfo->bWasOpened = TRUE;
switch ( pInfo->nKind )
{
- case SFX_CFGGROUP_BASICMGR :
- case SFX_CFGGROUP_DOCBASICMGR :
- {
- if ( !GetChildCount( pEntry ) )
- {
- // Erstmaliges "Offnen
- BasicManager* pMgr( GetBasicManager( *pEntry ) );
-
- SvLBoxEntry *pLibEntry = 0;
- for ( USHORT nLib=0; nLib<pMgr->GetLibCount(); nLib++)
- {
- StarBASIC* pLib = pMgr->GetLib( nLib );
- pLibEntry = InsertEntry( pMgr->GetLibName( nLib ), pEntry );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICLIB, nLib, pLib );
- aArr.Insert( pGrpInfo, aArr.Count() );
- pLibEntry->SetUserData( pGrpInfo );
- pLibEntry->EnableChildsOnDemand( TRUE );
- }
- }
-
- break;
- }
-
- case SFX_CFGGROUP_BASICLIB :
- {
- if ( !GetChildCount( pEntry ) )
- {
- // Erstmaliges "Offnen
- StarBASIC *pLib = (StarBASIC*) pInfo->pObject;
- if ( !pLib )
- {
- // Lib mu\s nachgeladen werden
- SvLBoxEntry *pParent = GetParent( pEntry );
- BasicManager *pMgr( GetBasicManager( *pParent ) );
-
- if ( pMgr->LoadLib( pInfo->nOrd ) )
- pInfo->pObject = pLib = pMgr->GetLib( pInfo->nOrd );
- else
- break;
- }
-
- SvLBoxEntry *pModEntry = 0;
- for ( USHORT nMod=0; nMod<pLib->GetModules()->Count(); nMod++ )
- {
- SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod );
-
- BOOL bIsStarScript = FALSE; //pMod->ISA( SbJScriptModule );
- BOOL bWantsStarScript = pImp->m_aScriptType.EqualsAscii("StarScript");
- if ( bIsStarScript != bWantsStarScript )
- continue;
- pModEntry = InsertEntry( pMod->GetName(), pEntry );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMOD, 0, pMod );
- aArr.Insert( pGrpInfo, aArr.Count() );
- pModEntry->SetUserData( pGrpInfo );
- }
- }
-
- break;
- }
-
case SFX_CFGGROUP_SCRIPTCONTAINER:
{
if ( !GetChildCount( pEntry ) )
@@ -1604,25 +1281,6 @@ void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry )
}
}
-void SfxConfigGroupListBox_Impl::AddAndSelect( const SfxStringItem* , const SfxStringItem* )
-{
- /*
- if ( pText )
- {
- Select( GetEntry( GetEntryCount()-1) );
- SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry( pText->GetValue(), NULL );
- SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_SPECIALCHARACTERS, 0, 0 );
- String aCommand = String::CreateFromAscii(".uno:InsertSymbol?Symbols:string=");
- aCommand += pText->GetValue();
- pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() );
- pGrpInfo->sCommand = aCommand;
- pGrpInfo->sLabel = String::CreateFromAscii("Symbols: ");
- pGrpInfo->sLabel += pText->GetValue();
- pFuncEntry->SetUserData( pGrpInfo );
- }
- */
-}
-
void SfxConfigGroupListBox_Impl::SelectMacro( const SfxMacroInfoItem *pItem )
{
SelectMacro( pItem->GetBasicManager()->GetName(),
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index 8592dbaded5f..be7658957535 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -43,7 +43,6 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/evntconf.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/minfitem.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 9b5453553ef3..8b9bd789c48f 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -38,7 +38,6 @@
#include <tools/diagnose_ex.h>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/sfxdefs.hxx>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -212,7 +211,7 @@ void _HeaderTabListBox::Enable( bool bEnable, bool bChild )
// assign button ("Add Command") is enabled only if it is not read only
// delete button ("Remove Command") is enabled if a current binding exists
// and it is not read only
-void _SvxMacroTabPage::EnableButtons( const String& /*rLangName*/ )
+void _SvxMacroTabPage::EnableButtons()
{
const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected();
if ( pE )
@@ -592,7 +591,7 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents)
}
rListBox.SetUpdateMode( TRUE );
- EnableButtons( String() );
+ EnableButtons();
}
// select event handler on the listbox
@@ -610,7 +609,7 @@ IMPL_STATIC_LINK( _SvxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG )
return 0;
}
- pThis->EnableButtons( String() );
+ pThis->EnableButtons();
return 0;
}
@@ -736,7 +735,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
rListBox.MakeVisible( pE );
rListBox.SetUpdateMode( TRUE );
- pThis->EnableButtons( String() );
+ pThis->EnableButtons();
return 0;
}
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 3defe910f5a5..1bdd559d8f14 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -39,7 +39,6 @@
#include <sfx2/app.hxx>
#include <sfx2/msg.hxx>
#include <sfx2/msgpool.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/minfitem.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/dispatch.hxx>
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 4fde01da986e..c4adc9dc64c4 100755
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -88,14 +88,16 @@ struct SpellDialog_Impl
// -----------------------------------------------------------------------
//#define VENDOR_IMAGE_HEIGHT 44 //as specified
-#define SPELLUNDO_CHANGE_LANGUAGE (TEXTUNDO_USER + 1)
-#define SPELLUNDO_CHANGE_TEXTENGINE (TEXTUNDO_USER + 2)
-#define SPELLUNDO_CHANGE_NEXTERROR (TEXTUNDO_USER + 3)
-#define SPELLUNDO_CHANGE_ADD_TO_DICTIONARY (TEXTUNDO_USER + 4)
-#define SPELLUNDO_CHANGE_GROUP (TEXTUNDO_USER + 5) //undo list
-#define SPELLUNDO_MOVE_ERROREND (TEXTUNDO_USER + 6)
-#define SPELLUNDO_UNDO_EDIT_MODE (TEXTUNDO_USER + 7)
-#define SPELLUNDO_ADD_IGNORE_RULE (TEXTUNDO_USER + 8)
+#define SPELLUNDO_START 200
+
+#define SPELLUNDO_CHANGE_LANGUAGE (SPELLUNDO_START + 1)
+#define SPELLUNDO_CHANGE_TEXTENGINE (SPELLUNDO_START + 2)
+#define SPELLUNDO_CHANGE_NEXTERROR (SPELLUNDO_START + 3)
+#define SPELLUNDO_CHANGE_ADD_TO_DICTIONARY (SPELLUNDO_START + 4)
+#define SPELLUNDO_CHANGE_GROUP (SPELLUNDO_START + 5) //undo list
+#define SPELLUNDO_MOVE_ERROREND (SPELLUNDO_START + 6)
+#define SPELLUNDO_UNDO_EDIT_MODE (SPELLUNDO_START + 7)
+#define SPELLUNDO_ADD_IGNORE_RULE (SPELLUNDO_START + 8)
namespace svx{
class SpellUndoAction_Impl : public SfxUndoAction
@@ -628,7 +630,7 @@ IMPL_LINK( SpellDialog, ChangeHdl, Button *, EMPTYARG )
aSentenceED.ChangeMarkedWord(aString, GetSelectedLang_Impl());
SpellContinue_Impl();
bModified = false;
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
+ aSentenceED.UndoActionEnd();
}
if(!aChangePB.IsEnabled())
aIgnorePB.GrabFocus();
@@ -670,7 +672,7 @@ IMPL_LINK( SpellDialog, ChangeAllHdl, Button *, EMPTYARG )
aSentenceED.ChangeMarkedWord(aString, eLang);
SpellContinue_Impl();
bModified = false;
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
+ aSentenceED.UndoActionEnd();
return 1;
}
// -----------------------------------------------------------------------
@@ -715,7 +717,7 @@ IMPL_LINK( SpellDialog, IgnoreAllHdl, Button *, pButton )
SpellContinue_Impl();
bModified = false;
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
+ aSentenceED.UndoActionEnd();
return 1;
}
/*-- 06.11.2003 11:24:08---------------------------------------------------
@@ -1044,7 +1046,7 @@ IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton )
// go on
SpellContinue_Impl();
- aSentenceED.UndoActionEnd( SPELLUNDO_CHANGE_GROUP );
+ aSentenceED.UndoActionEnd();
return 0;
}
/*-------------------------------------------------------------------------
@@ -1755,7 +1757,7 @@ void SentenceEditWindow_Impl::ChangeMarkedWord(const String& rNewWord, LanguageT
TextSelection aSel(TextPaM(0, m_nErrorStart), TextPaM(0, m_nErrorEnd));
//Remove spell errror attribute
ExtTextEngine* pTextEngine = GetTextEngine();
- pTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ pTextEngine->UndoActionStart();
const TextCharAttrib* pErrorAttrib = pTextEngine->FindCharAttrib( TextPaM(0, m_nErrorStart), TEXTATTR_SPELL_ERROR );
DBG_ASSERT(pErrorAttrib, "no error attribute found");
// Reference <XSpellAlternatives> xAlternatives;
@@ -1808,7 +1810,7 @@ void SentenceEditWindow_Impl::ChangeMarkedWord(const String& rNewWord, LanguageT
if(pSpellErrorDescription)
SetAttrib( SpellErrorAttrib(*pSpellErrorDescription), 0, m_nErrorStart, m_nErrorEnd );
SetAttrib( SpellLanguageAttrib(eLanguage), 0, m_nErrorStart, m_nErrorEnd );
- pTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ pTextEngine->UndoActionEnd();
}
/* -----------------08.10.2003 13:18-----------------
@@ -2032,7 +2034,7 @@ svx::SpellPortions SentenceEditWindow_Impl::CreateSpellPortions( bool bSetIgnore
-----------------------------------------------------------------------*/
void SentenceEditWindow_Impl::Undo()
{
- SfxUndoManager& rUndoMgr = GetTextEngine()->GetUndoManager();
+ ::svl::IUndoManager& rUndoMgr = GetTextEngine()->GetUndoManager();
DBG_ASSERT(GetUndoActionCount(), "no undo actions available" );
if(!GetUndoActionCount())
return;
@@ -2060,7 +2062,7 @@ void SentenceEditWindow_Impl::ResetUndo()
-----------------------------------------------------------------------*/
void SentenceEditWindow_Impl::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg )
{
- SfxUndoManager& rUndoMgr = GetTextEngine()->GetUndoManager();
+ ::svl::IUndoManager& rUndoMgr = GetTextEngine()->GetUndoManager();
rUndoMgr.AddUndoAction(pAction, bTryMerg);
GetSpellDialog()->aUndoPB.Enable();
}
@@ -2082,9 +2084,9 @@ void SentenceEditWindow_Impl::UndoActionStart( USHORT nId )
/*-- 12.11.2003 12:12:38---------------------------------------------------
-----------------------------------------------------------------------*/
-void SentenceEditWindow_Impl::UndoActionEnd( USHORT nId )
+void SentenceEditWindow_Impl::UndoActionEnd()
{
- GetTextEngine()->UndoActionEnd(nId);
+ GetTextEngine()->UndoActionEnd();
}
/*-- 12.11.2003 12:12:38---------------------------------------------------
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 8d233b71e890..47a5c1d527e0 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -121,7 +121,7 @@ public:
void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE );
USHORT GetUndoActionCount();
void UndoActionStart( USHORT nId );
- void UndoActionEnd( USHORT nId );
+ void UndoActionEnd();
void MoveErrorEnd(long nOffset);
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 944fca908b8a..66238e7ac7f3 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -50,7 +50,6 @@ class SfxSlotPool;
class SfxStringItem;
class SfxFontItem;
class SfxMacroInfoItem;
-class SfxMacroInfo;
struct SfxStyleInfo_Impl;
struct SfxStylesInfo_Impl;
@@ -95,29 +94,27 @@ struct SfxStylesInfo_Impl
static ::rtl::OUString generateCommand(const ::rtl::OUString& sFamily, const ::rtl::OUString& sStyle);
};
-#define SFX_CFGGROUP_FUNCTION 1
-#define SFX_CFGGROUP_BASICMGR 2
-#define SFX_CFGGROUP_DOCBASICMGR 3
-#define SFX_CFGGROUP_BASICLIB 4
-#define SFX_CFGGROUP_BASICMOD 5
-#define SFX_CFGFUNCTION_MACRO 6
-#define SFX_CFGFUNCTION_SLOT 7
-#define SFX_CFGGROUP_SCRIPTCONTAINER 8
-#define SFX_CFGFUNCTION_SCRIPT 9
-#define SFX_CFGGROUP_STYLES 10
-#define SFX_CFGGROUP_SPECIALCHARACTERS 11
+#define SFX_CFGGROUP_FUNCTION 1
+#define SFX_CFGFUNCTION_SLOT 2
+#define SFX_CFGGROUP_SCRIPTCONTAINER 3
+#define SFX_CFGFUNCTION_SCRIPT 4
+#define SFX_CFGGROUP_STYLES 5
struct SfxGroupInfo_Impl
{
USHORT nKind;
- USHORT nOrd;
+ USHORT nUniqueID;
void* pObject;
BOOL bWasOpened;
String sCommand;
String sLabel;
SfxGroupInfo_Impl( USHORT n, USHORT nr, void* pObj = 0 ) :
- nKind( n ), nOrd( nr ), pObject( pObj ), bWasOpened(FALSE) {}
+ nKind( n ), nUniqueID( nr ), pObject( pObj ), bWasOpened(FALSE) {}
+};
+
+struct CuiMacroInfo
+{
};
typedef SfxGroupInfo_Impl* SfxGroupInfoPtr;
@@ -143,7 +140,7 @@ public:
String GetHelpText( SvLBoxEntry *pEntry );
String GetCurCommand();
String GetCurLabel();
- SfxMacroInfo* GetMacroInfo();
+ String GetSelectedScriptURI();
void FunctionSelected();
void SetStylesInfo(SfxStylesInfo_Impl* pStyles);
};
@@ -156,8 +153,6 @@ class SfxConfigGroupListBox_Impl : public SvTreeListBox
SfxConfigFunctionListBox_Impl* pFunctionListBox;
SfxGroupInfoArr_Impl aArr;
ULONG nMode;
- BOOL bShowSF; // show Scripting Framework scripts
- BOOL bShowBasic; // show Basic scripts
::rtl::OUString m_sModuleLongName;
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
@@ -198,11 +193,8 @@ public:
void Open( SvLBoxEntry*, BOOL );
void GroupSelected();
void SelectMacro( const SfxMacroInfoItem* );
- void AddAndSelect( const SfxStringItem*, const SfxStringItem* );
void SelectMacro( const String&, const String& );
String GetGroup();
- BasicManager* GetBasicManager( const SvLBoxEntry& _rEntry );
- void SetScriptType( const String& rScriptType );
void SetStylesInfo(SfxStylesInfo_Impl* pStyles);
};
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 45cf2fdbf79e..d2a5a5cb3326 100755..100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -41,9 +41,6 @@ class SvTabListBox;
class Edit;
class String;
-typedef SvStringsDtor* (*FNGetRangeHdl)( _SfxMacroTabPage*, const String& rLanguage );
-typedef SvStringsDtor* (*FNGetMacrosOfRangeHdl)( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
-
class SfxConfigGroupListBox_Impl;
class SfxConfigFunctionListBox_Impl;
class _HeaderTabListBox;
@@ -59,7 +56,6 @@ class _SfxMacroTabPage : public SfxTabPage
DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
- DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton * );
DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
protected:
@@ -70,7 +66,7 @@ protected:
void InitAndSetHandler();
void FillEvents();
void FillMacroList();
- void EnableButtons( const String& rLanguage );
+ void EnableButtons();
public:
@@ -82,7 +78,7 @@ public:
void SetMacroTbl( const SvxMacroTableDtor& rTbl );
void ClearMacroTbl();
- virtual void ScriptChanged( const String& rLanguage );
+ virtual void ScriptChanged();
virtual void PageCreated (SfxAllItemSet aSet);
// --------- Erben aus der Basis -------------
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index 0359a330c1f0..7943c3ff6727 100644
--- a/cui/source/inc/macropg.hxx
+++ b/cui/source/inc/macropg.hxx
@@ -90,7 +90,7 @@ protected:
_SvxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
- void EnableButtons( const String& rLanguage );
+ void EnableButtons();
::com::sun::star::uno::Any GetPropsByName( const ::rtl::OUString& eventName, EventsHash& eventsHash );
::std::pair< ::rtl::OUString, ::rtl::OUString > GetPairFromAny( ::com::sun::star::uno::Any aAny );
diff --git a/cui/source/options/optlingu.src b/cui/source/options/optlingu.src
index ace1f8e193bf..12192ad8ac4b 100644..100755
--- a/cui/source/options/optlingu.src
+++ b/cui/source/options/optlingu.src
@@ -354,11 +354,4 @@ QueryBox RID_SFXQB_DELDICT
DefButton = WB_DEF_NO ;
Message [ en-US ] = "Do you want to delete the dictionary?" ;
};
- // RID_SFXQB_DEL_IGNORELIST ----------------------------------------------
-QueryBox RID_SFXQB_DEL_IGNORELIST
-{
- Buttons = WB_YES_NO ;
- DefButton = WB_DEF_NO ;
- Message [ en-US ] = "Do you want to delete the ignore list?" ;
-};
// ******************************************************************* EOF
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index c18ebf6f2a68..db58ba5dc9cd 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -43,10 +43,11 @@
#include <svtools/svmedit.hxx>
#include "cfgutil.hxx"
#include <sfx2/app.hxx>
+#include <sfx2/evntconf.hxx>
#include <sfx2/objsh.hxx>
#include "macroass.hrc"
#include "cuires.hrc"
-#include <sfx2/macrconf.hxx>
+#include <vcl/fixed.hxx>
#include "headertablistbox.hxx"
using ::com::sun::star::uno::Reference;
@@ -63,7 +64,6 @@ public:
PushButton* pDeletePB;
String* pStrEvent;
String* pAssignedMacro;
- ListBox* pScriptTypeLB;
_HeaderTabListBox* pEventLB;
SfxConfigGroupListBox_Impl* pGroupLB;
FixedText* pFT_MacroLBLabel;
@@ -71,8 +71,6 @@ public:
FixedText* pMacroFT;
String* pMacroStr;
- FNGetRangeHdl fnGetRange;
- FNGetMacrosOfRangeHdl fnGetMacroOfRange;
BOOL bReadOnly;
Timer maFillGroupTimer;
@@ -84,15 +82,12 @@ _SfxMacroTabPage_Impl::_SfxMacroTabPage_Impl( void ) :
pDeletePB( NULL ),
pStrEvent( NULL ),
pAssignedMacro( NULL ),
- pScriptTypeLB( NULL ),
pEventLB( NULL ),
pGroupLB( NULL ),
pFT_MacroLBLabel( NULL ),
pMacroLB( NULL ),
pMacroFT( NULL ),
pMacroStr( NULL ),
- fnGetRange( NULL ),
- fnGetMacroOfRange( NULL ),
bReadOnly( FALSE ),
bGotEvents( FALSE )
{
@@ -104,7 +99,6 @@ _SfxMacroTabPage_Impl::~_SfxMacroTabPage_Impl()
delete pDeletePB;
delete pStrEvent;
delete pAssignedMacro;
- delete pScriptTypeLB;
delete pEventLB;
delete pGroupLB;
delete pMacroLB;
@@ -114,9 +108,6 @@ _SfxMacroTabPage_Impl::~_SfxMacroTabPage_Impl()
}
-SvStringsDtor* _ImpGetRangeHdl( _SfxMacroTabPage*, const String& rLanguage );
-SvStringsDtor* _ImpGetMacrosOfRangeHdl( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
-
static USHORT __FAR_DATA aPageRg[] = {
SID_ATTR_MACROITEM, SID_ATTR_MACROITEM,
0
@@ -139,7 +130,7 @@ static long nTabs[] =
#define LB_EVENTS_ITEMPOS 1
#define LB_MACROS_ITEMPOS 2
-String ConvertToUIName_Impl( SvxMacro *pMacro, const String& /*rLanguage*/ )
+String ConvertToUIName_Impl( SvxMacro *pMacro )
{
String aName( pMacro->GetMacName() );
String aEntry;
@@ -161,7 +152,7 @@ String ConvertToUIName_Impl( SvxMacro *pMacro, const String& /*rLanguage*/ )
return aName;
}
-void _SfxMacroTabPage::EnableButtons( const String& rLangName )
+void _SfxMacroTabPage::EnableButtons()
{
// Solange die Eventbox leer ist, nichts tun
const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected();
@@ -171,26 +162,14 @@ void _SfxMacroTabPage::EnableButtons( const String& rLangName )
const SvxMacro* pM = aTbl.Get( (USHORT)(ULONG) pE->GetUserData() );
mpImpl->pDeletePB->Enable( 0 != pM && !mpImpl->bReadOnly );
- // Bei gleichem ScriptType Zuweisung nur, wenn Macro sich
- // ge"andert hat; bei verschiedenem ScriptType, wenn Script nicht leer
String sEventMacro;
sEventMacro = ((SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS ))->GetText();
- if ( rLangName.EqualsAscii("JavaScript") )
- {
- DBG_ERROR( "_SfxMacroTabPage::EnableButtons(): this is not an up to date usage!" );
- }
- else
- {
- SfxMacroInfo* pInfo = mpImpl->pMacroLB->GetMacroInfo();
- String sSelMacro;
- if ( pInfo )
- sSelMacro = pInfo->GetMacroName();
- if( pM && rLangName != pM->GetLanguage() )
- mpImpl->pAssignPB->Enable( pInfo != 0 && !mpImpl->bReadOnly );
- else
- mpImpl->pAssignPB->Enable( pInfo && !mpImpl->bReadOnly && !sSelMacro.EqualsIgnoreCaseAscii( sEventMacro ) );
- }
+
+ String sScriptURI = mpImpl->pMacroLB->GetSelectedScriptURI();
+ mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly && !sScriptURI.EqualsIgnoreCaseAscii( sEventMacro ) );
}
+ else
+ mpImpl->pAssignPB->Enable( FALSE );
}
_SfxMacroTabPage::_SfxMacroTabPage( Window* pParent, const ResId& rResId, const SfxItemSet& rAttrSet )
@@ -198,8 +177,6 @@ _SfxMacroTabPage::_SfxMacroTabPage( Window* pParent, const ResId& rResId, const
{
mpImpl = new _SfxMacroTabPage_Impl;
- mpImpl->fnGetRange = &_ImpGetRangeHdl;
- mpImpl->fnGetMacroOfRange = &_ImpGetMacrosOfRangeHdl;
}
_SfxMacroTabPage::~_SfxMacroTabPage()
@@ -216,7 +193,7 @@ void _SfxMacroTabPage::AddEvent( const String & rEventName, USHORT nEventId )
SvxMacro* pM = aTbl.Get( nEventId );
if( pM )
{
- String sNew( ConvertToUIName_Impl( pM, mpImpl->pScriptTypeLB->GetSelectEntry() ) );
+ String sNew( ConvertToUIName_Impl( pM ) );
sTmp += sNew;
}
@@ -224,17 +201,16 @@ void _SfxMacroTabPage::AddEvent( const String & rEventName, USHORT nEventId )
pE->SetUserData( reinterpret_cast< void* >( sal::static_int_cast< sal_IntPtr >( nEventId )) );
}
-void _SfxMacroTabPage::ScriptChanged( const String& aLangName )
+void _SfxMacroTabPage::ScriptChanged()
{
// neue Bereiche und deren Funktionen besorgen
{
- mpImpl->pGroupLB->SetScriptType( aLangName );
mpImpl->pGroupLB->Show();
mpImpl->pMacroLB->Show();
mpImpl->pMacroFT->SetText( *mpImpl->pMacroStr );
}
- EnableButtons( aLangName );
+ EnableButtons();
}
BOOL _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet )
@@ -311,24 +287,8 @@ IMPL_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG )
return 0;
}
- USHORT nEventId = (USHORT)(ULONG)pE->GetUserData();
- String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry();
-
- const SvxMacro* pM = pThis->aTbl.Get( nEventId );
- if( pM )
- {
- if( aLanguage != pM->GetLanguage() )
- {
- pImpl->pScriptTypeLB->SelectEntry( pM->GetLanguage() );
- pThis->ScriptChanged( pM->GetLanguage() );
- }
- else
- {
- DBG_ASSERT( !aLanguage.EqualsAscii("JavaScript"), "_SfxMacroTabPage, SelectEvent_Impl(): outdated use!" );
- }
- }
-
- pThis->EnableButtons( aLanguage );
+ pThis->ScriptChanged();
+ pThis->EnableButtons();
return 0;
}
@@ -336,26 +296,14 @@ IMPL_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox*, EMPTYARG )
{
_SfxMacroTabPage_Impl* pImpl = pThis->mpImpl;
String sSel( pImpl->pGroupLB->GetGroup() );
- String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry();
- if( !aLanguage.EqualsAscii( "JavaScript" ) )
- {
- pImpl->pGroupLB->GroupSelected();
- SfxMacroInfo* pMacro = pImpl->pMacroLB->GetMacroInfo();
- String aLabelText;
- if( pMacro )
- {
- aLabelText = pImpl->maStaticMacroLBLabel;
- aLabelText += pMacro->GetModuleName();
- }
- else
- {
- // Wenn dort ein Macro drin ist, wurde es selektiert und der
- // AssignButton schon in SelectMacro richtig enabled
- pImpl->pAssignPB->Enable( FALSE );
- }
-
- pImpl->pFT_MacroLBLabel->SetText( aLabelText );
- }
+ pImpl->pGroupLB->GroupSelected();
+ const String sScriptURI = pImpl->pMacroLB->GetSelectedScriptURI();
+ String aLabelText;
+ if( sScriptURI.Len() > 0 )
+ aLabelText = pImpl->maStaticMacroLBLabel;
+ pImpl->pFT_MacroLBLabel->SetText( aLabelText );
+
+ pThis->EnableButtons();
return 0;
}
@@ -363,7 +311,7 @@ IMPL_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox*, EMPTYARG )
{
_SfxMacroTabPage_Impl* pImpl = pThis->mpImpl;
pImpl->pMacroLB->FunctionSelected();
- pThis->EnableButtons( pImpl->pScriptTypeLB->GetSelectEntry() );
+ pThis->EnableButtons();
return 0;
}
@@ -387,51 +335,31 @@ IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
SvxMacro *pRemoveMacro = pThis->aTbl.Remove( nEvent );
delete pRemoveMacro;
- String aLanguage = pImpl->pScriptTypeLB->GetSelectEntry();
- String sNew;
+ String sScriptURI;
if( bAssEnabled )
{
- String sGroup;
- String sMacro;
- String aEntryText( sNew );
- DBG_ASSERT( !aLanguage.EqualsAscii("JavaScript"), "_SfxMacroTabPage, AssignDeleteHdl_Impl(): outdated use!" );
-
- SfxMacroInfo* pMacro = pImpl->pMacroLB->GetMacroInfo();
- sMacro = pMacro->GetQualifiedName();
- sGroup = pImpl->pGroupLB->GetGroup();
- sNew = pMacro->GetMacroName();
-
- if( sMacro.CompareToAscii( "vnd.sun.star.script:", 20 ) == COMPARE_EQUAL )
+ sScriptURI = pImpl->pMacroLB->GetSelectedScriptURI();
+ if( sScriptURI.CompareToAscii( "vnd.sun.star.script:", 20 ) == COMPARE_EQUAL )
{
- OSL_TRACE("ASSIGN_DELETE: Its a script");
pThis->aTbl.Insert(
- nEvent, new SvxMacro( sMacro, String::CreateFromAscii("Script") ) );
+ nEvent, new SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_SF ) ) );
}
else
{
- OSL_TRACE("ASSIGN_DELETE: Its a basic macro");
- String sBasicName/*(SfxResId(STR_BASICNAME))*/;
- if ( aLanguage == sBasicName )
- pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, sGroup, STARBASIC ) );
- else
- pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, aLanguage ) );
+ OSL_ENSURE( false, "_SfxMacroTabPage::AssignDeleteHdl_Impl: this branch is *not* dead? (out of interest: tell fs, please!)" );
+ pThis->aTbl.Insert(
+ nEvent, new SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_STARBASIC ) ) );
}
}
pImpl->pEventLB->SetUpdateMode( FALSE );
- pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS );
+ pE->ReplaceItem( new SvLBoxString( pE, 0, sScriptURI ), LB_MACROS_ITEMPOS );
rListBox.GetModel()->InvalidateEntry( pE );
rListBox.Select( pE );
rListBox.MakeVisible( pE );
rListBox.SetUpdateMode( TRUE );
- pThis->EnableButtons( aLanguage );
- return 0;
-}
-
-IMPL_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton*, EMPTYARG )
-{
- pThis->ScriptChanged( pThis->mpImpl->pScriptTypeLB->GetSelectEntry() );
+ pThis->EnableButtons();
return 0;
}
@@ -469,8 +397,6 @@ void _SfxMacroTabPage::InitAndSetHandler()
mpImpl->pGroupLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectGroup_Impl ));
mpImpl->pMacroLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectMacro_Impl ));
- mpImpl->pScriptTypeLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, ChangeScriptHdl_Impl ));
-
rListBox.SetSelectionMode( SINGLE_SELECTION );
rListBox.SetTabs( &nTabs[0], MAP_APPFONT );
Size aSize( nTabs[ 2 ], 0 );
@@ -486,11 +412,6 @@ void _SfxMacroTabPage::InitAndSetHandler()
mpImpl->pGroupLB->Enable( TRUE );
mpImpl->pMacroLB->Enable( TRUE );
- mpImpl->pScriptTypeLB->SetDropDownLineCount( 3 );
- String sBasicName/*(SfxResId(STR_BASICNAME))*/;
- mpImpl->pScriptTypeLB->InsertEntry( sBasicName );
- mpImpl->pScriptTypeLB->SelectEntry( sBasicName );
-
mpImpl->pGroupLB->SetFunctionListBox( mpImpl->pMacroLB );
mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) );
@@ -500,29 +421,17 @@ void _SfxMacroTabPage::InitAndSetHandler()
void _SfxMacroTabPage::FillMacroList()
{
- String aLanguage = mpImpl->pScriptTypeLB->GetSelectEntry();
- if( ! aLanguage.EqualsAscii("JavaScript") )
- {
- // 2 Listboxen
- SvStringsDtor* pArr = (*mpImpl->fnGetRange)( this, String(/*SfxResId(STR_BASICNAME)*/) );
- if( pArr )
- {
- mpImpl->pGroupLB->Init(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >(),
- GetFrame(),
- ::rtl::OUString() );
-
- delete pArr;
- }
- }
+ mpImpl->pGroupLB->Init(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >(),
+ GetFrame(),
+ ::rtl::OUString() );
}
void _SfxMacroTabPage::FillEvents()
{
SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
- String aLanguage = mpImpl->pScriptTypeLB->GetSelectEntry();
ULONG nEntryCnt = rListBox.GetEntryCount();
// Events aus der Tabelle holen und die EventListBox entsprechen fuellen
@@ -538,7 +447,7 @@ void _SfxMacroTabPage::FillEvents()
String sNew;
USHORT nEventId = ( USHORT ) ( ULONG ) pE->GetUserData();
if( aTbl.IsKeyValid( nEventId ) )
- sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ), aLanguage );
+ sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ) );
if( sOld != sNew )
{
@@ -549,78 +458,6 @@ void _SfxMacroTabPage::FillEvents()
}
}
-SvStringsDtor* __EXPORT _ImpGetRangeHdl( _SfxMacroTabPage* /*pTbPg*/, const String& rLanguage )
-{
- SvStringsDtor* pNew = new SvStringsDtor;
- SfxApplication* pSfxApp = SFX_APP();
-
- if ( !rLanguage.EqualsAscii("JavaScript") )
- {
- pSfxApp->EnterBasicCall();
-
- // AppBasic einf"ugen
- String* pNewEntry = new String( pSfxApp->GetName() );
- pNew->Insert( pNewEntry, pNew->Count() );
-
- // Aktuelles Dokument
- SfxObjectShell* pDoc = SfxObjectShell::Current();
- if ( pDoc )
- {
- String aTitle = pDoc->GetTitle();
-
- // Hack f"ur Aufruf aus der Basic-IDE : das Basic ermitteln, das
- // gerade bearbeitet wird
-
- String aAppName(DEFINE_CONST_UNICODE("BASIC - "));
- USHORT nLen = aAppName.Len();
- if ( aTitle.CompareIgnoreCaseToAscii( aAppName, nLen ) == COMPARE_EQUAL )
- {
- // Basic-Namensprefix entfernen
- aTitle.Erase( 0, nLen );
- USHORT nIndex=0, nCount=aTitle.GetTokenCount('.');
- if ( nCount > 1 )
- {
- // Namen der Library entfernen
- aTitle.GetToken( nCount-2, '.', nIndex );
- aTitle.Erase( nIndex-1 );
- }
-
- // Wenn das App-Basic gerade in der Basic-IDE bearbeitet wird, kein
- // Dokument verwenden
- pDoc = SfxObjectShell::GetFirst();
- while( pDoc )
- {
- if ( aTitle == pDoc->GetTitle() )
- break;
- pDoc = SfxObjectShell::GetNext( *pDoc );
- }
- }
-
- if ( pDoc && pDoc->GetBasicManager() != SFX_APP()->GetBasicManager() &&
- pDoc->GetBasicManager()->GetLibCount() )
- {
- pNewEntry = new String( aTitle );
- pNew->Insert( pNewEntry, pNew->Count() );
- }
- }
-
- pSfxApp->LeaveBasicCall();
- }
-
- return pNew;
-}
-
-// besorgen der Funktionen eines Bereiches
-SvStringsDtor* __EXPORT _ImpGetMacrosOfRangeHdl(
- _SfxMacroTabPage* /*pTbPg*/,
- const String& /*rLanguage*/,
- const String& /*rRange*/ )
-{
- SvStringsDtor* pNew = new SvStringsDtor;
- return pNew;
-}
-
-
SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet )
: _SfxMacroTabPage( pParent, rResId, rSet )
{
@@ -629,8 +466,6 @@ SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Re
mpImpl->pEventLB = new _HeaderTabListBox( this, CUI_RES( LB_EVENT ) );
mpImpl->pAssignPB = new PushButton( this, CUI_RES( PB_ASSIGN ) );
mpImpl->pDeletePB = new PushButton( this, CUI_RES( PB_DELETE ) );
- mpImpl->pScriptTypeLB = new ListBox(this, CUI_RES( LB_SCRIPTTYPE ) );
- mpImpl->pScriptTypeLB->Hide();
mpImpl->pMacroFT = new FixedText( this, CUI_RES( FT_MACRO ) );
mpImpl->pGroupLB = new SfxConfigGroupListBox_Impl( this, CUI_RES( LB_GROUP ) );
mpImpl->pFT_MacroLBLabel = new FixedText( this, CUI_RES( FT_LABEL4LB_MACROS ) );
@@ -644,7 +479,7 @@ SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Re
InitAndSetHandler();
- ScriptChanged( String( /*SfxResId(STR_BASICNAME)*/ ) );
+ ScriptChanged();
}
SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
diff --git a/cui/source/tabpages/macroass.hrc b/cui/source/tabpages/macroass.hrc
index 614711e1981e..73292a7f1b0e 100644
--- a/cui/source/tabpages/macroass.hrc
+++ b/cui/source/tabpages/macroass.hrc
@@ -38,7 +38,7 @@
#define FT_MACRO 5
#define LB_GROUP 6
#define LB_MACROS 7
-#define LB_SCRIPTTYPE 8
+ // FREE
#define FT_LABEL4LB_MACROS 9
#define STR_JAVASCRIPT 10
#define STR_MACROS 11
diff --git a/cui/source/tabpages/macroass.src b/cui/source/tabpages/macroass.src
index 9a5bb519d460..05e81658b8a3 100644
--- a/cui/source/tabpages/macroass.src
+++ b/cui/source/tabpages/macroass.src
@@ -78,7 +78,7 @@ TabPage RID_SVXPAGE_EVENTASSIGN
Pos = MAP_APPFONT ( COL2 , ROW7 ) ;
Size = MAP_APPFONT ( WIDTH1 , RSC_CD_FIXEDTEXT_HEIGHT + HEIGHT_EXTRA7 ) ;
WordBreak = TRUE;
- Text [ en-US ] = "~Existing macros in:\n" ;
+ Text [ en-US ] = "~Existing macros\n" ;
};
Control LB_MACROS
{
@@ -107,17 +107,6 @@ TabPage RID_SVXPAGE_EVENTASSIGN
TabStop = TRUE ;
Text [ en-US ] = "~Remove" ;
};
- ListBox LB_SCRIPTTYPE
- {
- HelpID = "cui:ListBox:RID_SVXPAGE_EVENTASSIGN:LB_SCRIPTTYPE";
- Pos = MAP_APPFONT ( COL4 , ROW4 ) ;
- Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , 60 ) ;
- // en-US was missing
- Text [ en-US ] = "~Scripting Language" ;
- TabStop = TRUE ;
- Disable = FALSE ;
- DropDown = TRUE ;
- };
String STR_MACROS
{
Text [ en-US ] = "Macros" ;
diff --git a/cui/source/tabpages/page.h b/cui/source/tabpages/page.h
index 2bc5583fe859..9de1ee21d3e5 100644
--- a/cui/source/tabpages/page.h
+++ b/cui/source/tabpages/page.h
@@ -29,6 +29,11 @@
// define ----------------------------------------------------------------
+//!! the values of the following defines must correspond to the array position
+//!! of the respective paper size in the file i18npool/source/paper/paper.cxx
+//!! There are enums for them in i18npool/inc/i18npool/paper.hxx but unfortunately
+//!! the resource compiler does not understand enums, thus the enum values need
+//!! to be duplicated here for use in the src file.
#define PAPERSIZE_A0 0
#define PAPERSIZE_A1 1
#define PAPERSIZE_A2 2
@@ -66,6 +71,7 @@
#define PAPERSIZE_B4_JIS 34
#define PAPERSIZE_B5_JIS 35
#define PAPERSIZE_B6_JIS 36
+#define PAPERSIZE_A6 56
#endif
diff --git a/cui/source/tabpages/page.src b/cui/source/tabpages/page.src
index 5c919f1df17a..2618b0b9389a 100644
--- a/cui/source/tabpages/page.src
+++ b/cui/source/tabpages/page.src
@@ -389,6 +389,7 @@ StringArray RID_SVXSTRARY_PAPERSIZE_STD
{
ItemList [ en-US ] =
{
+ < "A6" ; PAPERSIZE_A6 ; > ;
< "A5" ; PAPERSIZE_A5 ; > ;
< "A4" ; PAPERSIZE_A4 ; > ;
< "A3" ; PAPERSIZE_A3 ; > ;
@@ -423,6 +424,7 @@ StringArray RID_SVXSTRARY_PAPERSIZE_DRAW
{
ItemList [ en-US ] =
{
+ < "A6" ; PAPERSIZE_A6 ; > ;
< "A5" ; PAPERSIZE_A5 ; > ;
< "A4" ; PAPERSIZE_A4 ; > ;
< "A3" ; PAPERSIZE_A3 ; > ;
diff --git a/dbaccess/inc/IEnvironment.hxx b/dbaccess/inc/IEnvironment.hxx
deleted file mode 100644
index bc6766c91ebb..000000000000
--- a/dbaccess/inc/IEnvironment.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef DBAUI_IENVIRONMENT_HXX
-#define DBAUI_IENVIRONMENT_HXX
-
-#include <com/sun/star/sdbc/SQLException.hpp>
-
-#include <connectivity/standardsqlstate.hxx>
-
-namespace dbtools
-{
- class SQLExceptionInfo;
-}
-
-namespace dbaui
-{
- // interface class for a generell environment
- class IEnvironment
- {
- public:
- /** appends an error in the current environment.
- */
- virtual void appendError(
- const ::rtl::OUString& _rErrorMessage,
- const ::dbtools::StandardSQLState _eSQLState = ::dbtools::SQL_GENERAL_ERROR,
- const sal_Int32 _nErrorCode = 1000
- ) = 0;
-
- /** clears the error state.
- */
- virtual void clearError() = 0;
-
- /** @retrun
- returns <TRUE/> when an error was set otherwise <FALSE/>
- */
- virtual sal_Bool hasError() const = 0;
-
- /** returns the current error
- */
- virtual const ::dbtools::SQLExceptionInfo& getError() const = 0;
-
- /** displays the current error, or does nothing if there is no current error
- */
- virtual void displayError() = 0;
-
- /** gives access to the currently used connection
- @return
- the currently used connection.
- */
- virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& getConnection() const = 0;
- };
-}
-#endif // DBAUI_IENVIRONMENT_HXX
diff --git a/dbaccess/inc/dataview.hxx b/dbaccess/inc/dataview.hxx
index ae93fa1d3284..fdb99014433a 100644
--- a/dbaccess/inc/dataview.hxx
+++ b/dbaccess/inc/dataview.hxx
@@ -27,17 +27,13 @@
#ifndef DBAUI_DATAVIEW_HXX
#define DBAUI_DATAVIEW_HXX
-#ifndef _SV_WINDOW_HXX
-#include <vcl/window.hxx>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include "dbaccessdllapi.h"
+
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#endif
-#ifndef INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX
#include <svtools/acceleratorexecute.hxx>
-#endif
+#include <vcl/fixed.hxx>
+
#include <memory>
-#include "dbaccessdllapi.h"
class FixedLine;
class SvtMiscOptions;
@@ -50,7 +46,7 @@ namespace dbaui
protected:
IController& m_rController; // the controller in where we resides in
- FixedLine* m_pSeparator; // our separator above the toolbox (may be NULL)
+ FixedLine m_aSeparator;
::std::auto_ptr< ::svt::AcceleratorExecute> m_pAccel;
public:
@@ -75,9 +71,6 @@ namespace dbaui
*/
virtual void resizeControls(const Size& /*_rDiff*/) { Resize(); }
- void enableSeparator( const sal_Bool _bEnable = sal_True );
- sal_Bool isSeparatorEnabled() const { return NULL != m_pSeparator; }
-
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xServiceFactory;}
// the default implementation simply calls resizeAll( GetSizePixel() )
diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc
index 6bbf59dfc7e4..29094bee1882 100644
--- a/dbaccess/inc/dbaccess_helpid.hrc
+++ b/dbaccess/inc/dbaccess_helpid.hrc
@@ -292,6 +292,7 @@
#define HID_DSADMIN_ADVANCED "DBACCESS_HID_DSADMIN_ADVANCED"
#define HID_DSADMIN_BOOLEANCOMPARISON "DBACCESS_HID_DSADMIN_BOOLEANCOMPARISON"
#define HID_DSADMIN_ORACLE_DATABASE "DBACCESS_HID_DSADMIN_ORACLE_DATABASE"
+#define HID_DSADMIN_MAXROWSCAN "DBACCESS_HID_DSADMIN_MAXROWSCAN"
#define UID_APP_VIEW "DBACCESS_UID_APP_VIEW"
#define HID_APP_TABLE_TREE "DBACCESS_HID_APP_TABLE_TREE"
diff --git a/dbaccess/inc/dbaundomanager.hxx b/dbaccess/inc/dbaundomanager.hxx
new file mode 100755
index 000000000000..1b8627f66326
--- /dev/null
+++ b/dbaccess/inc/dbaundomanager.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 DBACCESS_DBAUNDOMANAGER_HXX
+#define DBACCESS_DBAUNDOMANAGER_HXX
+
+#include "dbaccessdllapi.h"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XUndoManager.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+class SfxUndoManager;
+
+//......................................................................................................................
+namespace dbaui
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= UndoManager
+ //==================================================================================================================
+ struct UndoManager_Impl;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::document::XUndoManager > UndoManager_Base;
+ class DBACCESS_DLLPUBLIC UndoManager : public UndoManager_Base
+ {
+ public:
+ UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex );
+ virtual ~UndoManager();
+
+ SfxUndoManager& GetSfxUndoManager() const;
+
+ // XInterface
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XComponent equivalents
+ void disposing();
+
+ // XUndoManager
+ virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XLockable (base of XUndoManager)
+ virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XChild (base of XUndoManager)
+ 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);
+
+ private:
+ ::boost::scoped_ptr< UndoManager_Impl > m_pImpl;
+ };
+
+//......................................................................................................................
+} // namespace dbaui
+//......................................................................................................................
+
+#endif // DBACCESS_DBAUNDOMANAGER_HXX
diff --git a/dbaccess/inc/singledoccontroller.hxx b/dbaccess/inc/dbsubcomponentcontroller.hxx
index 5bda31fb4608..cd93a29df321 100644
--- a/dbaccess/inc/singledoccontroller.hxx
+++ b/dbaccess/inc/dbsubcomponentcontroller.hxx
@@ -25,11 +25,10 @@
*
************************************************************************/
-#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX
-#define DBAUI_SINGLEDOCCONTROLLER_HXX
+#ifndef DBAUI_SUBCOMPONENTCONTROLLER_HXX
+#define DBAUI_SUBCOMPONENTCONTROLLER_HXX
#include "genericcontroller.hxx"
-#include "IEnvironment.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/document/XScriptInvocationContext.hpp>
@@ -45,7 +44,6 @@
#include <comphelper/propertycontainer.hxx>
#include <connectivity/dbmetadata.hxx>
#include <cppuhelper/implbase2.hxx>
-#include <svl/undo.hxx>
#include <memory>
@@ -55,25 +53,20 @@ namespace dbaui
//........................................................................
//====================================================================
- //= OSingleDocumentController
+ //= DBSubComponentController
//====================================================================
- class OSingleDocumentController;
+ class DBSubComponentController;
typedef ::cppu::ImplInheritanceHelper2 < OGenericUnoController
, ::com::sun::star::document::XScriptInvocationContext
, ::com::sun::star::util::XModifiable
- > OSingleDocumentController_Base;
+ > DBSubComponentController_Base;
- struct OSingleDocumentControllerImpl;
- class DBACCESS_DLLPUBLIC OSingleDocumentController
- :public OSingleDocumentController_Base
- ,public IEnvironment
+ struct DBSubComponentController_Impl;
+ class DBACCESS_DLLPUBLIC DBSubComponentController : public DBSubComponentController_Base
{
private:
- ::std::auto_ptr<OSingleDocumentControllerImpl> m_pImpl;
-
- protected:
- SfxUndoManager m_aUndoManager;
+ ::std::auto_ptr<DBSubComponentController_Impl> m_pImpl;
private:
/** forces usage of a connection which we do not own
@@ -85,9 +78,7 @@ namespace dbaui
// OGenericUnoController - initialization
virtual void impl_initialize();
- // 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 FeatureState GetState(sal_uInt16 nId) const;
- // execute a feature
+ // OGenericUnoController
virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getPrivateModel() const;
@@ -101,14 +92,6 @@ namespace dbaui
sal_Bool isEditable() const;
void setEditable(sal_Bool _bEditable);
- // need for undo's and redo's
- SfxUndoManager* getUndoMgr();
-
- /** addUndoActionAndInvalidate adds an undo action to the undoManager,
- additionally invalidates the UNDO and REDO slot
- @param pAction the undo action to add
- */
- void addUndoActionAndInvalidate(SfxUndoAction *pAction);
// ----------------------------------------------------------------
// asking for connection-related stuff
@@ -131,10 +114,9 @@ namespace dbaui
*/
const ::dbtools::DatabaseMetaData& getSdbMetaData() const;
- // IEnvironment
/** appends an error in the current environment.
*/
- virtual void appendError(
+ void appendError(
const ::rtl::OUString& _rErrorMessage,
const ::dbtools::StandardSQLState _eSQLState = ::dbtools::SQL_GENERAL_ERROR,
const sal_Int32 _nErrorCode = 1000
@@ -142,20 +124,20 @@ namespace dbaui
/** clears the error state.
*/
- virtual void clearError();
+ void clearError();
/** @return
<TRUE/> when an error was set otherwise <FALSE/>
*/
- virtual sal_Bool hasError() const;
+ sal_Bool hasError() const;
/** returns the current error
*/
- virtual const ::dbtools::SQLExceptionInfo& getError() const;
+ const ::dbtools::SQLExceptionInfo& getError() const;
/** displays the current error, or does nothing if there is no current error
*/
- virtual void displayError();
+ void displayError();
/** shows an info box with the string conntection lost.
*/
@@ -165,7 +147,7 @@ namespace dbaui
@return
the currently used connection.
*/
- virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >&
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >&
getConnection() const;
/** returns the number formatter
@@ -191,8 +173,8 @@ namespace dbaui
virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException);
protected:
- OSingleDocumentController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB);
- virtual ~OSingleDocumentController();
+ DBSubComponentController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB);
+ virtual ~DBSubComponentController();
virtual void disconnect();
virtual void reconnect( sal_Bool _bUI );
@@ -203,9 +185,6 @@ namespace dbaui
*/
virtual void losingConnection( );
- // late construction
- virtual sal_Bool Construct(Window* pParent);
-
protected:
// XEventListener
virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
@@ -223,12 +202,12 @@ namespace dbaui
sal_Int32 getCurrentStartNumber() const;
private:
- OSingleDocumentController(); // never implemented
+ DBSubComponentController(); // never implemented
};
//........................................................................
} // namespace dbaui
//........................................................................
-#endif // DBAUI_SINGLEDOCCONTROLLER_HXX
+#endif // DBAUI_SUBCOMPONENTCONTROLLER_HXX
diff --git a/dbaccess/prj/build.lst b/dbaccess/prj/build.lst
index b90f631db60f..10227f111e60 100644
--- a/dbaccess/prj/build.lst
+++ b/dbaccess/prj/build.lst
@@ -1,4 +1,4 @@
-ba dbaccess : l10n BOOST:boost connectivity svx stoc qadevOOo xmlscript LIBXSLT:libxslt NULL
+ba dbaccess : l10n BOOST:boost connectivity svx stoc qadevOOo xmlscript LIBXSLT:libxslt test NULL
ba dbaccess usr1 - all ba_mkout NULL
ba dbaccess\inc nmake - all ba_inc NULL
ba dbaccess\source\ui\inc nmake - all ba_uiinc ba_inc NULL
@@ -8,7 +8,6 @@ ba dbaccess\source\core\recovery nmake - all ba_crecovery ba_inc NULL
ba dbaccess\source\core\misc nmake - all ba_cmisc ba_inc NULL
ba dbaccess\source\core\resource nmake - all ba_cres ba_inc NULL
ba dbaccess\source\filter\xml nmake - all ba_ffilter ba_shared ba_util ba_inc NULL
-ba dbaccess\source\filter\migration nmake - all ba_fmigration ba_shared ba_inc NULL
ba dbaccess\source\shared nmake - all ba_shared ba_cres ba_inc NULL
ba dbaccess\source\sdbtools\connection nmake - all ba_conntools ba_inc NULL
ba dbaccess\source\sdbtools\misc nmake - all ba_misctools ba_inc NULL
diff --git a/dbaccess/prj/d.lst b/dbaccess/prj/d.lst
index 4e1ab9c7f417..543714657d31 100644
--- a/dbaccess/prj/d.lst
+++ b/dbaccess/prj/d.lst
@@ -53,7 +53,6 @@ touch: ..\%__SRC%\misc\dbaccess.hid %_DEST%\bin%_EXT%\dba.hid
..\%__SRC%\misc\adabasui.component %_DEST%\xml%_EXT%\adabasui.component
..\%__SRC%\misc\dba.component %_DEST%\xml%_EXT%\dba.component
-..\%__SRC%\misc\dbacfg.component %_DEST%\xml%_EXT%\dbacfg.component
..\%__SRC%\misc\dbaxml.component %_DEST%\xml%_EXT%\dbaxml.component
..\%__SRC%\misc\dbmm.component %_DEST%\xml%_EXT%\dbmm.component
..\%__SRC%\misc\dbu.component %_DEST%\xml%_EXT%\dbu.component
diff --git a/dbaccess/qa/complex/dbaccess/ApplicationController.java b/dbaccess/qa/complex/dbaccess/ApplicationController.java
index bffc1ce97c4c..f8a57b8f6efb 100644
--- a/dbaccess/qa/complex/dbaccess/ApplicationController.java
+++ b/dbaccess/qa/complex/dbaccess/ApplicationController.java
@@ -27,35 +27,27 @@
package complex.dbaccess;
import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XNameAccess;
import com.sun.star.frame.FrameSearchFlag;
import com.sun.star.frame.XComponentLoader;
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.XOfficeDatabaseDocument;
import com.sun.star.sdb.application.XDatabaseDocumentUI;
import com.sun.star.sdbcx.XTablesSupplier;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XComponentContext;
import connectivity.tools.HsqlColumnDescriptor;
import connectivity.tools.HsqlDatabase;
import connectivity.tools.HsqlTableDescriptor;
-import helper.URLHelper;
-import java.io.File;
import java.io.IOException;
// ---------- junit imports -----------------
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.*;
// ------------------------------------------
@@ -74,16 +66,6 @@ public class ApplicationController extends TestCase
}
// --------------------------------------------------------------------------------------------------------
-
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "checkSaveAs"
-// };
-// }
-
- // --------------------------------------------------------------------------------------------------------
public String getTestObjectName()
{
return getClass().getName();
@@ -129,21 +111,26 @@ public class ApplicationController extends TestCase
}
// --------------------------------------------------------------------------------------------------------
- @Before public void before() throws java.lang.Exception
+ @Before
+ @Override
+ public void before() throws java.lang.Exception
{
super.before();
impl_switchToDocument(null);
}
// --------------------------------------------------------------------------------------------------------
- @After public void after() throws java.lang.Exception
+ @After
+ @Override
+ public void after() throws java.lang.Exception
{
impl_closeDocument();
super.after();
}
// --------------------------------------------------------------------------------------------------------
- @Test public void checkSaveAs() throws Exception, IOException, java.lang.Exception
+ @Test
+ public void checkSaveAs() throws Exception, IOException, java.lang.Exception
{
// issue 93737 describes the problem that when you save-as a database document, and do changes to it,
// then those changes are saved in the old document, actually
diff --git a/dbaccess/qa/complex/dbaccess/Beamer.java b/dbaccess/qa/complex/dbaccess/Beamer.java
index 2b77e21b9d60..6052c308dbdf 100644
--- a/dbaccess/qa/complex/dbaccess/Beamer.java
+++ b/dbaccess/qa/complex/dbaccess/Beamer.java
@@ -70,51 +70,10 @@ public class Beamer extends TestCase
super();
}
-// // --------------------------------------------------------------------------------------------------------
-// protected final XComponentContext getComponentContext()
-// {
-// XComponentContext context = null;
-// try
-// {
-// final XPropertySet orbProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, getORB());
-// context = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class,
-// orbProps.getPropertyValue("DefaultContext"));
-// }
-// catch (Exception ex)
-// {
-// failed("could not retrieve the ComponentContext");
-// }
-// return context;
-// }
// --------------------------------------------------------------------------------------------------------
-
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "testBeamer"
-// };
-// }
-
-// // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return getClass().getName();
-// }
-
- // --------------------------------------------------------------------------------------------------------
-// protected final XMultiServiceFactory getORB()
-// {
-// return (XMultiServiceFactory) param.getMSF();
-// }
-
- // --------------------------------------------------------------------------------------------------------
- private void impl_closeDocument()
- {
- }
-
- // --------------------------------------------------------------------------------------------------------
- @Before public void before() throws Exception, java.lang.Exception
+ @Before
+ @Override
+ public void before() throws Exception, java.lang.Exception
{
// load it into a frame
final Object object = getMSF().createInstance("com.sun.star.frame.Desktop");
@@ -125,18 +84,20 @@ public class Beamer extends TestCase
}
// --------------------------------------------------------------------------------------------------------
- @After public void after()
+ @After
+ @Override
+ public void after()
{
}
- // --------------------------------------------------------------------------------------------------------
- @Test public void testBeamer() throws Exception, IOException, java.lang.Exception
+ // --------------------------------------------------------------------------------------------------------
+ @Test
+ public void testBeamer() throws Exception, IOException, java.lang.Exception
{
final XController controller = docModel.getCurrentController();
final XFrame frame = controller.getFrame();
final XDispatchProvider dispatchP = UnoRuntime.queryInterface(XDispatchProvider.class, frame);
URL command = new URL();
- // command.Complete = ".component:DB/DataSourceBrowser";
command.Complete = ".uno:ViewDataSourceBrowser";
Object instance = getMSF().createInstance("com.sun.star.util.URLTransformer");
diff --git a/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java b/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java
index ff89c755a90f..aa74ea87a3f6 100644
--- a/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java
+++ b/dbaccess/qa/complex/dbaccess/CRMBasedTestCase.java
@@ -33,11 +33,7 @@ import java.util.logging.Logger;
// ---------- junit imports -----------------
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.*;
// ------------------------------------------
@@ -60,13 +56,17 @@ public abstract class CRMBasedTestCase extends TestCase
}
// --------------------------------------------------------------------------------------------------------
- @Before public void before()
+ @Before
+ @Override
+ public void before()
{
createTestCase();
}
// --------------------------------------------------------------------------------------------------------
- @After public void after()
+ @After
+ @Override
+ public void after()
{
try
{
diff --git a/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java b/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java
index 53527e356f78..7f88028f72c9 100755
--- a/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java
+++ b/dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler.java
@@ -30,6 +30,8 @@ import com.sun.star.lib.uno.helper.WeakBase;
import com.sun.star.task.XInteractionHandler;
import com.sun.star.task.XInteractionRequest;
+import static org.junit.Assert.*;
+
/**
*
* @author oj93728
@@ -37,14 +39,12 @@ import com.sun.star.task.XInteractionRequest;
class CopyTableInterActionHandler extends WeakBase
implements XInteractionHandler
{
- private final CopyTableWizard test;
- public CopyTableInterActionHandler(CopyTableWizard testCase)
+ CopyTableInterActionHandler()
{
- test = testCase;
}
public void handle(XInteractionRequest xRequest)
{
- test.assure(xRequest.toString());
+ fail( "interaction handler is not expected to be called" );
}
}
diff --git a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java
index 89fc56253ed0..1facca3d8497 100755
--- a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java
+++ b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java
@@ -48,11 +48,8 @@ import util.UITools;
// ---------- junit imports -----------------
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.*;
// ------------------------------------------
@@ -70,30 +67,18 @@ public class CopyTableWizard extends CRMBasedTestCase
}
// --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "copyTable", "copyTableDbase"
-// };
-// }
- // --------------------------------------------------------------------------------------------------------
-// @Override
-// public String getTestObjectName()
-// {
-// return getClass().getName();
-// }
-// --------------------------------------------------------------------------------------------------------
- // --------------------------------------------------------------------------------------------------------
-
- @After public void after()
+ @After
+ @Override
+ public void after()
{
dest.store();
super.after();
}
- @Before public void before()
+ @Before
+ @Override
+ public void before()
{
try
{
@@ -106,16 +91,14 @@ public class CopyTableWizard extends CRMBasedTestCase
fail("");
}
}
- // --------------------------------------------------------------------------------------------------------
-
-
+ // --------------------------------------------------------------------------------------------------------
class CopyThread implements Runnable
{
final XCopyTableWizard copyWizard;
- public CopyThread(final XCopyTableWizard copyWizard)
+ CopyThread(final XCopyTableWizard copyWizard)
{
this.copyWizard = copyWizard;
}
@@ -138,17 +121,19 @@ public class CopyTableWizard extends CRMBasedTestCase
return null;
}
- XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(XExtendedToolkit.class, toolKit);
+ XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolKit );
Object atw = tk.getActiveTopWindow();
- return (XWindow) UnoRuntime.queryInterface(XWindow.class, atw);
+ return UnoRuntime.queryInterface( XWindow.class, atw );
}
- @Test public void copyTable() throws Exception, IOException, java.lang.Exception
+ @Test
+ public void copyTable() throws Exception, IOException, java.lang.Exception
{
copyTable(source,source);
}
- @Test public void copyTableDbase() throws Exception, IOException, java.lang.Exception
+ @Test
+ public void copyTableDbase() throws Exception, IOException, java.lang.Exception
{
copyTable(source,dest);
}
@@ -167,15 +152,10 @@ public class CopyTableWizard extends CRMBasedTestCase
}
}
- public void assure(final String message)
- {
- fail(message);
- }
-
private void copyTable(final String tableName, final XConnection sourceConnection, final XConnection destConnection) throws Exception, IOException, java.lang.Exception
{
- final XInteractionHandler interAction = new CopyTableInterActionHandler(this);
+ final XInteractionHandler interAction = new CopyTableInterActionHandler();
final XComponentContext context = getComponentContext();
final XPropertySet sourceDescriptor = DataAccessDescriptorFactory.get(context).createDataAccessDescriptor();
sourceDescriptor.setPropertyValue("CommandType", CommandType.TABLE);
@@ -185,7 +165,8 @@ public class CopyTableWizard extends CRMBasedTestCase
final XPropertySet destDescriptor = DataAccessDescriptorFactory.get(context).createDataAccessDescriptor();
destDescriptor.setPropertyValue("ActiveConnection", destConnection);
- final XCopyTableWizard copyWizard = com.sun.star.sdb.application.CopyTableWizard.createWithInteractionHandler(context, sourceDescriptor, destDescriptor, interAction);
+ final XCopyTableWizard copyWizard = com.sun.star.sdb.application.CopyTableWizard.createWithInteractionHandler(
+ context, sourceDescriptor, destDescriptor, interAction);
copyWizard.setOperation((short) 0); // com.sun.star.sdb.application.CopyDefinitionAndData
Optional<String> auto = new Optional<String>();
@@ -219,7 +200,7 @@ public class CopyTableWizard extends CRMBasedTestCase
}
catch (java.lang.Exception exception)
{
- exception.printStackTrace();
+ exception.printStackTrace( System.err );
}
}
catch (com.sun.star.lang.IndexOutOfBoundsException indexOutOfBoundsException)
diff --git a/dbaccess/qa/complex/dbaccess/DataSource.java b/dbaccess/qa/complex/dbaccess/DataSource.java
index e8f8f7a41d77..ae5d131c1e20 100644
--- a/dbaccess/qa/complex/dbaccess/DataSource.java
+++ b/dbaccess/qa/complex/dbaccess/DataSource.java
@@ -27,23 +27,14 @@
package complex.dbaccess;
import com.sun.star.container.XNameAccess;
-import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XNamingService;
-// import complexlib.ComplexTestCase;
import connectivity.tools.CRMDatabase;
import connectivity.tools.HsqlDatabase;
-//import java.util.logging.Level;
-//import java.util.logging.Logger;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
@@ -55,21 +46,6 @@ public class DataSource extends TestCase
connectivity.tools.DataSource m_dataSource;
// --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "testRegistrationName"
-// };
-// }
-//
-// // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return "DataSource";
-// }
-
- // --------------------------------------------------------------------------------------------------------
private void createTestCase()
{
try
@@ -92,13 +68,8 @@ public class DataSource extends TestCase
}
// --------------------------------------------------------------------------------------------------------
-// private XMultiServiceFactory getFactory()
-// {
-// return (XMultiServiceFactory) param.getMSF();
-// }
-
- // --------------------------------------------------------------------------------------------------------
- @Test public void testRegistrationName()
+ @Test
+ public void testRegistrationName()
{
try
{
@@ -109,8 +80,8 @@ public class DataSource extends TestCase
assertEquals("pre-registered database has a wrong name!", dataSourceName, bibliography.getName());
// 2. register a newly created data source, and verify it has the proper name
dataSourceName = "someDataSource";
- final XNamingService dataSourceRegistrations = (XNamingService) UnoRuntime.queryInterface(
- XNamingService.class, getMSF().createInstance("com.sun.star.sdb.DatabaseContext"));
+ final XNamingService dataSourceRegistrations = UnoRuntime.queryInterface(
+ XNamingService.class, getMSF().createInstance( "com.sun.star.sdb.DatabaseContext" ) );
final XNameAccess existenceCheck = UnoRuntime.queryInterface( XNameAccess.class, dataSourceRegistrations );
if ( existenceCheck.hasByName( "someDataSource" ) )
dataSourceRegistrations.revokeObject( "someDataSource" );
diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
index 757ae2de22d5..d0c60eb9c4fb 100644
--- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
+++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
@@ -26,6 +26,8 @@
************************************************************************/
package complex.dbaccess;
+import com.sun.star.lang.NotInitializedException;
+import com.sun.star.frame.DoubleInitializationException;
import com.sun.star.awt.XTopWindow;
import com.sun.star.beans.PropertyState;
import com.sun.star.document.DocumentEvent;
@@ -83,11 +85,8 @@ import java.util.logging.Logger;
// ---------- junit imports -----------------
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.*;
// ------------------------------------------
@@ -253,25 +252,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
// ========================================================================================================
// --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "testLoadable",
-// "testDocumentRevenants",
-// "testDocumentEvents",
-// "testGlobalEvents"
-// };
-// }
-//
-// // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return "DatabaseDocument";
-// }
-
- // --------------------------------------------------------------------------------------------------------
- @Before public void before() throws java.lang.Exception
+ @Before
+ public void before() throws java.lang.Exception
{
super.before();
@@ -297,7 +279,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
}
// --------------------------------------------------------------------------------------------------------
- @After public void after() throws java.lang.Exception
+ @After
+ public void after() throws java.lang.Exception
{
try
{
@@ -326,7 +309,7 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
public Class unoInterfaceClass = null;
public String methodName = null;
- public UnoMethodDescriptor(Class _class, String _method)
+ UnoMethodDescriptor(Class _class, String _method)
{
unoInterfaceClass = _class;
methodName = _method;
@@ -351,8 +334,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
for (int i = 0; i < unsupportedMethods.length; ++i)
{
-// assureException( _document, unsupportedMethods[i].unoInterfaceClass,
-// unsupportedMethods[i].methodName, new Object[]{}, _isInitialized ? null : NotInitializedException.class );
+ assureException( _document, unsupportedMethods[i].unoInterfaceClass,
+ unsupportedMethods[i].methodName, new Object[]{}, _isInitialized ? null : NotInitializedException.class );
}
}
@@ -410,7 +393,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
}
// --------------------------------------------------------------------------------------------------------
- @Test public void testLoadable() throws Exception, IOException
+ @Test
+ public void testLoadable() throws Exception, IOException
{
XModel databaseDoc = impl_createEmptyEmbeddedHSQLDocument();
String documentURL = databaseDoc.getURL();
@@ -438,10 +422,10 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
impl_checkDocumentInitState(databaseDoc, true);
// and while we are here ... initilizing the same document again should not be possible
-// assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
-// DoubleInitializationException.class );
-// assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] },
-// DoubleInitializationException.class );
+ assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
+ DoubleInitializationException.class );
+ assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] },
+ DoubleInitializationException.class );
// ....................................................................
// 3. XLoadable::initNew
@@ -453,10 +437,10 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
impl_checkDocumentInitState(databaseDoc, true);
// same as above - initializing the document a second time must fail
-// assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
-// DoubleInitializationException.class );
-// assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] },
-// DoubleInitializationException.class );
+ assureException( databaseDoc, XLoadable.class, "initNew", new Object[0],
+ DoubleInitializationException.class );
+ assureException( databaseDoc, XLoadable.class, "load", new Object[] { new PropertyValue[0] },
+ DoubleInitializationException.class );
}
// --------------------------------------------------------------------------------------------------------
@@ -571,7 +555,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
* This method here tests some of those aspects of a document which should survive the death of one
* instance and re-creation as a revenant.
*/
- @Test public void testDocumentRevenants() throws Exception, IOException
+ @Test
+ public void testDocumentRevenants() throws Exception, IOException
{
// create an empty document
XModel databaseDoc = impl_createDocWithMacro( "Lib", "Module",
@@ -623,7 +608,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
}
// --------------------------------------------------------------------------------------------------------
- @Test public void testDocumentEvents() throws Exception, IOException
+ @Test
+ public void testDocumentEvents() throws Exception, IOException
{
// create an empty document
final String libName = "EventHandlers";
@@ -691,7 +677,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
}
// --------------------------------------------------------------------------------------------------------
- @Test public void testGlobalEvents() throws Exception, IOException
+ @Test
+ public void testGlobalEvents() throws Exception, IOException
{
XModel databaseDoc = impl_createEmptyEmbeddedHSQLDocument();
final XStorable storeDoc = UnoRuntime.queryInterface(XStorable.class, databaseDoc);
diff --git a/dbaccess/qa/complex/dbaccess/Parser.java b/dbaccess/qa/complex/dbaccess/Parser.java
index 3b6b0b92e3ed..588755a8c29c 100644
--- a/dbaccess/qa/complex/dbaccess/Parser.java
+++ b/dbaccess/qa/complex/dbaccess/Parser.java
@@ -37,34 +37,14 @@ import com.sun.star.uno.UnoRuntime;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
public class Parser extends CRMBasedTestCase
{
// --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames()
-// {
-// return new String[] {
-// "checkJoinSyntax",
-// "checkParameterTypes",
-// "checkWhere",
-// };
-// }
-
- // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return "Parser";
-// }
-
- // --------------------------------------------------------------------------------------------------------
+ @Override
protected void createTestCase()
{
try
@@ -79,7 +59,9 @@ public class Parser extends CRMBasedTestCase
}
}
- @Test public void checkWhere() throws Exception
+ // --------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkWhere() throws Exception
{
final XSingleSelectQueryComposer composer = createQueryComposer();
final String SELECT = "SELECT \"products\".\"Name\" FROM \"products\" WHERE ";
@@ -118,7 +100,8 @@ public class Parser extends CRMBasedTestCase
// --------------------------------------------------------------------------------------------------------
/** verifies that aliases for inner queries work as expected
*/
- @Test public void checkJoinSyntax() throws Exception
+ @Test
+ public void checkJoinSyntax() throws Exception
{
final XSingleSelectQueryComposer composer = createQueryComposer();
@@ -186,7 +169,8 @@ public class Parser extends CRMBasedTestCase
// --------------------------------------------------------------------------------------------------------
/** verifies that the parser properly recognizes the types of parameters
*/
- @Test public void checkParameterTypes() throws Exception
+ @Test
+ public void checkParameterTypes() throws Exception
{
impl_checkParameters(
"SELECT * FROM \"all orders\" " +
diff --git a/dbaccess/qa/complex/dbaccess/PropertyBag.java b/dbaccess/qa/complex/dbaccess/PropertyBag.java
index 4920f8fa0006..9f77559eab0b 100644
--- a/dbaccess/qa/complex/dbaccess/PropertyBag.java
+++ b/dbaccess/qa/complex/dbaccess/PropertyBag.java
@@ -29,18 +29,20 @@ package complex.dbaccess;
// import complexlib.ComplexTestCase;
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.PropertyState;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertyAccess;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertyContainer;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.beans.*;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
@@ -52,27 +54,20 @@ public class PropertyBag extends TestCase
private XPropertyAccess m_access;
private XMultiServiceFactory m_orb = null;
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "checkBasics",
-// "checkSequenceAccess",
-// "checkDynamicSet"
-// };
-// }
-
public String getTestObjectName()
{
return "PropertyBag";
}
- @Before public void before()
+ @Before
+ @Override
+ public void before()
{
m_orb = getMSF();
}
- @Test public void checkBasics()
+ @Test
+ public void checkBasics()
{
createEmptyBag();
System.out.println("testing the basics");
@@ -161,7 +156,8 @@ public class PropertyBag extends TestCase
}
}
- @Test public void checkSequenceAccess() throws com.sun.star.uno.Exception
+ @Test
+ public void checkSequenceAccess() throws com.sun.star.uno.Exception
{
System.out.println( "checking PropertySetAccess via sequences" );
createStandardBag( false );
@@ -218,7 +214,8 @@ public class PropertyBag extends TestCase
}
}
- @Test public void checkDynamicSet() throws com.sun.star.uno.Exception
+ @Test
+ public void checkDynamicSet() throws com.sun.star.uno.Exception
{
System.out.println( "checking proper dynamic of the set" );
createStandardBag( false );
diff --git a/dbaccess/qa/complex/dbaccess/Query.java b/dbaccess/qa/complex/dbaccess/Query.java
index 222a6668f705..e78f6859fb88 100644
--- a/dbaccess/qa/complex/dbaccess/Query.java
+++ b/dbaccess/qa/complex/dbaccess/Query.java
@@ -30,19 +30,13 @@ import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XIndexAccess;
import com.sun.star.container.XNameAccess;
import com.sun.star.container.XNamed;
-import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sdb.XQueriesSupplier;
import com.sun.star.sdbcx.XColumnsSupplier;
import com.sun.star.uno.UnoRuntime;
import connectivity.tools.CRMDatabase;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
@@ -51,19 +45,6 @@ public class Query extends TestCase {
connectivity.tools.HsqlDatabase m_database;
// --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames() {
-// return new String[]
-// {
-// "testQueryColumns"
-// };
-// }
-
- // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName() {
-// return "Query";
-// }
-
- // --------------------------------------------------------------------------------------------------------
private void createTestCase()
{
try
@@ -89,7 +70,8 @@ public class Query extends TestCase {
// }
// --------------------------------------------------------------------------------------------------------
- @Test public void testQueryColumns()
+ @Test
+ public void testQueryColumns()
{
createTestCase();
diff --git a/dbaccess/qa/complex/dbaccess/QueryInQuery.java b/dbaccess/qa/complex/dbaccess/QueryInQuery.java
index 0cb0789b782c..ad78eb37718b 100644
--- a/dbaccess/qa/complex/dbaccess/QueryInQuery.java
+++ b/dbaccess/qa/complex/dbaccess/QueryInQuery.java
@@ -38,37 +38,16 @@ import com.sun.star.sdbc.XStatement;
import com.sun.star.sdbc.XResultSet;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
public class QueryInQuery extends CRMBasedTestCase
{
private static final String QUERY_PRODUCTS = "query products";
-// // --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames()
-// {
-// return new String[] {
-// "executeSimpleSelect",
-// "executeAliasedSelect",
-// "checkNameCollisions",
-// "checkCyclicReferences",
-// "checkStatementQiQSupport"
-// };
-// }
-//
-// // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return "QueryInQuery";
-// }
// --------------------------------------------------------------------------------------------------------
+ @Override
protected void createTestCase()
{
try
@@ -113,7 +92,8 @@ public class QueryInQuery extends CRMBasedTestCase
// --------------------------------------------------------------------------------------------------------
/** executes a SQL statement simply selecting all columns from a query
*/
- @Test public void executeSimpleSelect() throws SQLException
+ @Test
+ public void executeSimpleSelect() throws SQLException
{
verifyEqualRowSetContent(
CommandType.COMMAND, "SELECT * FROM \"query products\"",
@@ -123,7 +103,8 @@ public class QueryInQuery extends CRMBasedTestCase
// --------------------------------------------------------------------------------------------------------
/** verifies that aliases for inner queries work as expected
*/
- @Test public void executeAliasedSelect() throws SQLException
+ @Test
+ public void executeAliasedSelect() throws SQLException
{
verifyEqualRowSetContent(
CommandType.COMMAND, "SELECT \"PROD\".\"ID\" FROM \"query products\" AS \"PROD\"",
@@ -136,7 +117,8 @@ public class QueryInQuery extends CRMBasedTestCase
// --------------------------------------------------------------------------------------------------------
/** verifies that aliases for inner queries work as expected
*/
- @Test public void checkNameCollisions()
+ @Test
+ public void checkNameCollisions()
{
// create a query with a name which is used by a table
boolean caughtExpected = false;
@@ -168,7 +150,8 @@ public class QueryInQuery extends CRMBasedTestCase
}
// --------------------------------------------------------------------------------------------------------
- @Test public void checkCyclicReferences() throws ElementExistException, WrappedTargetException, IllegalArgumentException
+ @Test
+ public void checkCyclicReferences() throws ElementExistException, WrappedTargetException, IllegalArgumentException
{
// some queries which create a cycle in the sub query tree
m_database.getDatabase().getDataSource().createQuery( "orders level 1", "SELECT * FROM \"orders level 0\"" );
@@ -186,7 +169,8 @@ public class QueryInQuery extends CRMBasedTestCase
}
// --------------------------------------------------------------------------------------------------------
- @Test public void checkStatementQiQSupport()
+ @Test
+ public void checkStatementQiQSupport()
{
try
{
diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java
index 7a11a96d9b00..7716f7f30512 100644
--- a/dbaccess/qa/complex/dbaccess/RowSet.java
+++ b/dbaccess/qa/complex/dbaccess/RowSet.java
@@ -32,7 +32,6 @@ import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XIndexAccess;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sdb.CommandType;
import com.sun.star.sdb.XParametersSupplier;
import com.sun.star.sdb.XResultSetAccess;
@@ -58,12 +57,7 @@ import java.lang.reflect.Method;
import java.util.Random;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
@@ -92,7 +86,7 @@ public class RowSet extends TestCase
XRow m_row;
int m_id;
- public ResultSetMovementStress(XResultSet _resultSet, int _id) throws java.lang.Exception
+ ResultSetMovementStress(XResultSet _resultSet, int _id) throws java.lang.Exception
{
m_resultSet = _resultSet;
m_row = UnoRuntime.queryInterface( XRow.class, m_resultSet );
@@ -123,27 +117,6 @@ public class RowSet extends TestCase
}
}
// --------------------------------------------------------------------------------------------------------
-
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "testRowSet",
-// "testRowSetEvents",
-// "testDeleteBehavior",
-// "testCloneMovesPlusDeletions",
-// "testCloneMovesPlusInsertions",
-// "testParameters"
-// };
-// }
-//
-// // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return "RowSet";
-// }
-//
- // --------------------------------------------------------------------------------------------------------
private void createTestCase(boolean _defaultRowSet)
{
if (m_database == null)
@@ -176,12 +149,6 @@ public class RowSet extends TestCase
}
// --------------------------------------------------------------------------------------------------------
-// private XMultiServiceFactory getFactory()
-// {
-// return (XMultiServiceFactory) param.getMSF();
-// }
-
- // --------------------------------------------------------------------------------------------------------
/** creates a com.sun.star.sdb.RowSet to use during the test
* @param command
* the command to use for the RowSet
@@ -239,7 +206,8 @@ public class RowSet extends TestCase
}
// --------------------------------------------------------------------------------------------------------
- @Test public void testRowSet() throws java.lang.Exception
+ @Test
+ public void testRowSet() throws java.lang.Exception
{
System.out.println("testing testRowSet");
@@ -415,7 +383,8 @@ public class RowSet extends TestCase
}
// --------------------------------------------------------------------------------------------------------
- @Test public void testRowSetEvents() throws java.lang.Exception
+ @Test
+ public void testRowSetEvents() throws java.lang.Exception
{
System.out.println("testing RowSet Events");
createTestCase(true);
@@ -632,7 +601,8 @@ public class RowSet extends TestCase
}
// --------------------------------------------------------------------------------------------------------
- @Test public void testDeleteBehavior() throws Exception
+ @Test
+ public void testDeleteBehavior() throws Exception
{
createTestCase(true);
@@ -765,8 +735,8 @@ public class RowSet extends TestCase
/** checks whether deletions on the main RowSet properly interfere (or don't interfere) with the movement
* on a clone of the RowSet
*/
- @SuppressWarnings("empty-statement")
- @Test public void testCloneMovesPlusDeletions() throws SQLException, UnknownPropertyException, WrappedTargetException
+ @Test
+ public void testCloneMovesPlusDeletions() throws SQLException, UnknownPropertyException, WrappedTargetException
{
createTestCase(true);
// ensure that all records are known
@@ -834,7 +804,8 @@ public class RowSet extends TestCase
/** checks whether insertions on the main RowSet properly interfere (or don't interfere) with the movement
* on a clone of the RowSet
*/
- @Test public void testCloneMovesPlusInsertions() throws SQLException, UnknownPropertyException, WrappedTargetException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException
+ @Test
+ public void testCloneMovesPlusInsertions() throws SQLException, UnknownPropertyException, WrappedTargetException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException
{
createTestCase(true);
// ensure that all records are known
@@ -1019,7 +990,8 @@ public class RowSet extends TestCase
// --------------------------------------------------------------------------------------------------------
/** checks the XParametersSupplier functionality of a RowSet
*/
- @Test public void testParameters()
+ @Test
+ public void testParameters()
{
createTestCase(false);
// use an own RowSet instance, not the one which is also used for the other cases
diff --git a/dbaccess/qa/complex/dbaccess/RowSetEventListener.java b/dbaccess/qa/complex/dbaccess/RowSetEventListener.java
index c4569986a5d7..2f1d642c19b3 100644
--- a/dbaccess/qa/complex/dbaccess/RowSetEventListener.java
+++ b/dbaccess/qa/complex/dbaccess/RowSetEventListener.java
@@ -33,7 +33,7 @@ import com.sun.star.sdb.RowChangeEvent;
import com.sun.star.lang.EventObject;
import com.sun.star.beans.XPropertyChangeListener;
-public class RowSetEventListener implements XRowSetApproveListener,XRowSetListener,XPropertyChangeListener
+public final class RowSetEventListener implements XRowSetApproveListener,XRowSetListener,XPropertyChangeListener
{
public static final int APPROVE_CURSOR_MOVE = 0;
public static final int APPROVE_ROW_CHANGE = 1;
diff --git a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
index ec77f084063e..89d107ed5bb1 100755
--- a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
+++ b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
@@ -26,23 +26,28 @@
************************************************************************/
package complex.dbaccess;
+import com.sun.star.beans.PropertyState;
+import com.sun.star.sdb.SQLFilterOperator;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertyContainer;
+import com.sun.star.beans.NamedValue;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.sdbcx.XTablesSupplier;
+import com.sun.star.sdb.XParametersSupplier;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.sdbcx.XColumnsSupplier;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sdb.CommandType;
+import com.sun.star.sdb.XSingleSelectQueryComposer;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.beans.*;
-import com.sun.star.sdbcx.*;
-import com.sun.star.sdb.*;
-import com.sun.star.container.*;
import com.sun.star.sdbc.DataType;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
@@ -58,32 +63,13 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
private final static String INNERPRODUCTSQUERY = "products (inner)";
// --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames()
-// {
-// return new String[]
-// {
-// "testSetCommand",
-// "testAttributes",
-// "testSubQueries",
-// "testParameters",
-// "testDisjunctiveNormalForm",
-// "testConditionByColumn"
-// };
-// }
-
-// // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return "SingleSelectQueryComposer";
-// }
-
- // --------------------------------------------------------------------------------------------------------
private void createQueries() throws Exception
{
m_database.getDatabase().getDataSource().createQuery(INNERPRODUCTSQUERY, "SELECT * FROM \"products\"");
}
// --------------------------------------------------------------------------------------------------------
+ @Override
protected void createTestCase()
{
try
@@ -141,7 +127,8 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
/** tests setCommand of the composer
*/
- @Test public void testSetCommand()
+ @Test
+ public void testSetCommand()
{
System.out.println("testing SingleSelectQueryComposer's setCommand");
@@ -166,7 +153,8 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
}
/** tests accessing attributes of the composer (order, filter, group by, having)
*/
- @Test public void testAttributes()
+ @Test
+ public void testAttributes()
{
System.out.println("testing SingleSelectQueryComposer's attributes (order, filter, group by, having)");
@@ -223,7 +211,8 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
/** test various sub query related features ("queries in queries")
*/
- @Test public void testSubQueries() throws Exception
+ @Test
+ public void testSubQueries() throws Exception
{
m_composer.setQuery("SELECT * from \"" + INNERPRODUCTSQUERY + "\"");
final XTablesSupplier suppTables = UnoRuntime.queryInterface(XTablesSupplier.class, m_composer);
@@ -239,7 +228,8 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
/** tests the XParametersSupplier functionality
*/
- @Test public void testParameters()
+ @Test
+ public void testParameters()
{
try
{
@@ -278,7 +268,8 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
}
}
- @Test public void testConditionByColumn()
+ @Test
+ public void testConditionByColumn()
{
try
{
@@ -337,7 +328,8 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
/** tests the disjunctive normal form functionality, aka the structured filter,
* of the composer
*/
- @Test public void testDisjunctiveNormalForm()
+ @Test
+ public void testDisjunctiveNormalForm()
{
// a simple case: WHERE clause simply is a combination of predicates knitted with AND
String query =
diff --git a/dbaccess/qa/complex/dbaccess/TestCase.java b/dbaccess/qa/complex/dbaccess/TestCase.java
index ba899a114205..f2cbdf988b38 100644
--- a/dbaccess/qa/complex/dbaccess/TestCase.java
+++ b/dbaccess/qa/complex/dbaccess/TestCase.java
@@ -26,6 +26,8 @@
************************************************************************/
package complex.dbaccess;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.frame.XComponentLoader;
@@ -41,11 +43,8 @@ import java.net.URI;
import java.net.URISyntaxException;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
@@ -54,12 +53,6 @@ import static org.junit.Assert.*;
public abstract class TestCase
{
// --------------------------------------------------------------------------------------------------------
-// protected final XMultiServiceFactory getORB()
-// {
-// return (XMultiServiceFactory)param.getMSF();
-// }
-
- // --------------------------------------------------------------------------------------------------------
protected final XComponentContext getComponentContext()
{
XComponentContext context = null;
@@ -130,31 +123,129 @@ public abstract class TestCase
}
// --------------------------------------------------------------------------------------------------------
-// protected void assureException( Object _object, Class _unoInterfaceClass, String _methodName, Object[] _methodArgs,
-// Class _expectedExceptionClass )
-// {
-// assureException( UnoRuntime.queryInterface( _unoInterfaceClass, _object ), _methodName,
-// _methodArgs, _expectedExceptionClass );
-// }
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param _message
+ * is the message to print when the check fails
+ * @param _object
+ * is the object to invoke the method on
+ * @param _methodName
+ * is the name of the method to invoke
+ * @param _methodArgs
+ * are the arguments to pass to the method.
+ * @param _argClasses
+ * are the classes to assume for the arguments of the methods
+ * @param _expectedExceptionClass
+ * is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ protected void assureException( final String _message, final Object _object, final String _methodName,
+ final Class[] _argClasses, final Object[] _methodArgs, final Class _expectedExceptionClass )
+ {
+ Class objectClass = _object.getClass();
+ boolean noExceptionAllowed = ( _expectedExceptionClass == null );
+ boolean caughtExpected = noExceptionAllowed ? true : false;
+ try
+ {
+ Method method = objectClass.getMethod( _methodName, _argClasses );
+ method.invoke(_object, _methodArgs );
+ }
+ catch ( InvocationTargetException e )
+ {
+ caughtExpected = noExceptionAllowed
+ ? false
+ : ( e.getTargetException().getClass().equals( _expectedExceptionClass ) );
+ }
+ catch( Exception e )
+ {
+ caughtExpected = false;
+ }
+
+ assertTrue( _message, caughtExpected );
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param _message is the message to print when the check fails
+ * @param _object is the object to invoke the method on
+ * @param _methodName is the name of the method to invoke
+ * @param _methodArgs are the arguments to pass to the method. Those implicitly define
+ * the classes of the arguments of the method which is called.
+ * @param _expectedExceptionClass is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ protected void assureException( final String _message, final Object _object, final String _methodName,
+ final Object[] _methodArgs, final Class _expectedExceptionClass )
+ {
+ Class[] argClasses = new Class[ _methodArgs.length ];
+ for ( int i=0; i<_methodArgs.length; ++i )
+ argClasses[i] = _methodArgs[i].getClass();
+ assureException( _message, _object, _methodName, argClasses, _methodArgs, _expectedExceptionClass );
+ }
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param _object is the object to invoke the method on
+ * @param _methodName is the name of the method to invoke
+ * @param _methodArgs are the arguments to pass to the method. Those implicitly define
+ * the classes of the arguments of the method which is called.
+ * @param _expectedExceptionClass is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ protected void assureException( final Object _object, final String _methodName, final Object[] _methodArgs,
+ final Class _expectedExceptionClass )
+ {
+ assureException(
+ "did not catch the expected exception (" +
+ ( ( _expectedExceptionClass == null ) ? "none" : _expectedExceptionClass.getName() ) +
+ ") while calling " + _object.getClass().getName() + "." + _methodName,
+ _object, _methodName, _methodArgs, _expectedExceptionClass );
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param _object is the object to invoke the method on
+ * @param _methodName is the name of the method to invoke
+ * @param _methodArgs are the arguments to pass to the method
+ * @param _argClasses are the classes to assume for the arguments of the methods
+ * @param _expectedExceptionClass is the class of the exception to be caught. If this is null,
+ * it means that <em>no</em> exception must be throw by invoking the method.
+ */
+ protected void assureException( final Object _object, final String _methodName, final Class[] _argClasses,
+ final Object[] _methodArgs, final Class _expectedExceptionClass )
+ {
+ assureException(
+ "did not catch the expected exception (" +
+ ( ( _expectedExceptionClass == null ) ? "none" : _expectedExceptionClass.getName() ) +
+ ") while calling " + _object.getClass().getName() + "." + _methodName,
+ _object, _methodName, _argClasses, _methodArgs, _expectedExceptionClass );
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ protected void assureException( Object _object, Class _unoInterfaceClass, String _methodName, Object[] _methodArgs,
+ Class _expectedExceptionClass )
+ {
+ assureException( UnoRuntime.queryInterface( _unoInterfaceClass, _object ), _methodName,
+ _methodArgs, _expectedExceptionClass );
+ }
+
+ // --------------------------------------------------------------------------------------------------------
protected 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()");
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
connection.setUp();
}
- @AfterClass public static void tearDownConnection()
- throws InterruptedException, com.sun.star.uno.Exception
+ // --------------------------------------------------------------------------------------------------------
+ @AfterClass
+ public static void tearDownConnection() throws InterruptedException, com.sun.star.uno.Exception
{
- System.out.println("tearDownConnection()");
connection.tearDown();
}
diff --git a/dbaccess/qa/complex/dbaccess/UISettings.java b/dbaccess/qa/complex/dbaccess/UISettings.java
index 8733f000f644..536d66025deb 100644
--- a/dbaccess/qa/complex/dbaccess/UISettings.java
+++ b/dbaccess/qa/complex/dbaccess/UISettings.java
@@ -38,36 +38,17 @@ import com.sun.star.util.XCloseable;
import connectivity.tools.CRMDatabase;
// ---------- junit imports -----------------
-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.*;
// ------------------------------------------
public class UISettings extends TestCase
{
// --------------------------------------------------------------------------------------------------------
-// public String[] getTestMethodNames()
-// {
-// return new String[] {
-// "checkTableFormattingPersistence",
-// "checkTransparentQueryColumnSettings"
-// };
-// }
-//
-// // --------------------------------------------------------------------------------------------------------
-// public String getTestObjectName()
-// {
-// return "UISettings";
-// }
-
- // --------------------------------------------------------------------------------------------------------
/** verifies that aliases for inner queries work as expected
*/
- @Test public void checkTableFormattingPersistence() throws java.lang.Exception
+ @Test
+ public void checkTableFormattingPersistence() throws java.lang.Exception
{
// create, load, and connect a DB doc
CRMDatabase database = new CRMDatabase( getMSF(), true );
@@ -107,7 +88,7 @@ public class UISettings extends TestCase
// verify the properties
assertEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) );
- assertEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue() );
+ assertEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue(), 0 );
assertEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) );
// close the doc
@@ -119,7 +100,8 @@ public class UISettings extends TestCase
* settings
* @throws java.lang.Exception
*/
- @Test public void checkTransparentQueryColumnSettings() throws java.lang.Exception
+ @Test
+ public void checkTransparentQueryColumnSettings() throws java.lang.Exception
{
// create, load, and connect a DB doc
CRMDatabase database = new CRMDatabase( getMSF(), true );
diff --git a/dbaccess/qa/complex/dbaccess/dbaccess.sce b/dbaccess/qa/complex/dbaccess/dbaccess.sce
deleted file mode 100644
index c5fa408ff273..000000000000
--- a/dbaccess/qa/complex/dbaccess/dbaccess.sce
+++ /dev/null
@@ -1,12 +0,0 @@
--o complex.dbaccess.SingleSelectQueryComposer
--o complex.dbaccess.RowSet
--o complex.dbaccess.PropertyBag
--o complex.dbaccess.Query
--o complex.dbaccess.QueryInQuery
--o complex.dbaccess.DatabaseDocument
--o complex.dbaccess.DataSource
--o complex.dbaccess.Parser
--o complex.dbaccess.ApplicationController
--o complex.dbaccess.CopyTableWizard
--o complex.dbaccess.UISettings
--o complex.dbaccess.Beamer
diff --git a/dbaccess/qa/complex/dbaccess/makefile.mk b/dbaccess/qa/complex/dbaccess/makefile.mk
index 4a3e0426fe1d..760f94a294fa 100755
--- a/dbaccess/qa/complex/dbaccess/makefile.mk
+++ b/dbaccess/qa/complex/dbaccess/makefile.mk
@@ -25,23 +25,36 @@
#
#*************************************************************************
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+.IF "$(OOO_JUNIT_JAR)" == ""
nothing .PHONY:
+ @echo -----------------------------------------------------
+ @echo - JUnit not available, not building anything
+ @echo -----------------------------------------------------
.ELSE
PRJ = ../../..
PRJNAME = dbaccess
TARGET = qa_complex_dbaccess
-
-.IF "$(OOO_JUNIT_JAR)" != ""
PACKAGE = complex/dbaccess
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = OOoRunner.jar ridl.jar test.jar juh.jar unoil.jar ConnectivityTools.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+
+#----- create a jar from compiled files ----------------------------
+
+JARTARGET = $(TARGET).jar
+
+#----- Java files --------------------------------------------------
+
# here store only Files which contain a @Test
JAVATESTFILES = \
ApplicationController.java \
Beamer.java \
- CRMBasedTestCase.java \
- CopyTableWizard.java \
DataSource.java \
DatabaseDocument.java \
Parser.java \
@@ -51,83 +64,39 @@ JAVATESTFILES = \
RowSet.java \
SingleSelectQueryComposer.java \
UISettings.java \
- TestCase.java
+ CopyTableWizard.java \
# put here all other files
JAVAFILES = $(JAVATESTFILES) \
+ CRMBasedTestCase.java \
CopyTableInterActionHandler.java \
DatabaseApplication.java \
FileHelper.java \
- RowSetEventListener.java
-
+ RowSetEventListener.java \
+ TestCase.java \
-JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar ConnectivityTools.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
# Sample how to debug
# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-.END
+# --- Targets ------------------------------------------------------
-.INCLUDE: settings.mk
.INCLUDE: target.mk
+
+ALL : ALLTAR
+
+# --- subsequent tests ---------------------------------------------
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" != ""
+
.INCLUDE: installationtest.mk
ALLTAR : javatest
-.END
+ # Sample how to debug
+ # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
+.END # "$(OOO_SUBSEQUENT_TESTS)" == ""
+
+.END # ELSE "$(OOO_JUNIT_JAR)" != ""
-#
-#
-# PRJ = ..$/..$/..
-# TARGET = DbaComplexTests
-# PRJNAME = $(TARGET)
-# PACKAGE = complex$/dbaccess
-#
-# # --- Settings -----------------------------------------------------
-# .INCLUDE: settings.mk
-#
-# .IF "$(SOLAR_JAVA)" == ""
-# all:
-# @echo "Java not available. Build skipped"
-#
-# .INCLUDE : target.mk
-# .ELSE
-#
-# #----- compile .java files -----------------------------------------
-#
-# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar ConnectivityTools.jar
-# JAVAFILES := $(shell @$(FIND) ./*.java)
-# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-#
-# #----- make a jar from compiled files ------------------------------
-#
-# MAXLINELENGTH = 100000
-#
-# JARCLASSDIRS = $(PACKAGE)
-# JARTARGET = $(TARGET).jar
-# JARCOMPRESS = TRUE
-#
-# RUNNER_ARGS = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex
-#
-# RUNNER_CALL = $(AUGMENT_LIBRARY_PATH) java
-#
-# # --- Targets ------------------------------------------------------
-#
-# .IF "$(depend)" == ""
-# ALL : ALLTAR
-# .ELSE
-# ALL: ALLDEP
-# .ENDIF
-#
-# .INCLUDE : target.mk
-#
-#
-# run: $(CLASSDIR)$/$(JARTARGET)
-# +$(RUNNER_CALL) $(RUNNER_ARGS) -sce dbaccess.sce
-#
-# run_%: $(CLASSDIR)$/$(JARTARGET)
-# +$(RUNNER_CALL) $(RUNNER_ARGS) -o complex.dbaccess.$(@:s/run_//)
-#
-# .ENDIF # "$(SOLAR_JAVA)" == ""
diff --git a/dbaccess/source/core/api/BookmarkSet.hxx b/dbaccess/source/core/api/BookmarkSet.hxx
index 36d3c90c7969..2bf9b4cfd0fa 100644
--- a/dbaccess/source/core/api/BookmarkSet.hxx
+++ b/dbaccess/source/core/api/BookmarkSet.hxx
@@ -44,7 +44,7 @@ namespace dbaccess
void updateColumn(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue);
public:
- OBookmarkSet()
+ OBookmarkSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows)
{}
~OBookmarkSet()
{
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index dd64e835adb4..783c93f56593 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -106,8 +106,9 @@ using namespace ::osl;
DBG_NAME(OCacheSet)
// -------------------------------------------------------------------------
-OCacheSet::OCacheSet()
- :m_bInserted(sal_False)
+OCacheSet::OCacheSet(sal_Int32 i_nMaxRows)
+ :m_nMaxRows(i_nMaxRows)
+ ,m_bInserted(sal_False)
,m_bUpdated(sal_False)
,m_bDeleted(sal_False)
{
diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx
index ef3503fa5e4e..70905c444610 100644
--- a/dbaccess/source/core/api/CacheSet.hxx
+++ b/dbaccess/source/core/api/CacheSet.hxx
@@ -83,11 +83,12 @@ namespace dbaccess
::com::sun::star::uno::Sequence<sal_Int32> m_aColumnTypes;
ORowSetRow m_aInsertRow;
::rtl::OUString m_aComposedTableName;
+ sal_Int32 m_nMaxRows;
sal_Bool m_bInserted;
sal_Bool m_bUpdated;
sal_Bool m_bDeleted;
- OCacheSet();
+ OCacheSet(sal_Int32 i_nMaxRows);
virtual ~OCacheSet();
void setParameter(sal_Int32 nPos
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index a2a324f11469..8df84766575c 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -153,8 +153,10 @@ OKeySet::OKeySet(const connectivity::OSQLTable& _xTable,
const Reference< XIndexAccess>& _xTableKeys,
const ::rtl::OUString& _rUpdateTableName, // this can be the alias or the full qualified name
const Reference< XSingleSelectQueryAnalyzer >& _xComposer,
- const ORowSetValueVector& _aParameterValueForCache)
- :m_aParameterValueForCache(_aParameterValueForCache)
+ const ORowSetValueVector& _aParameterValueForCache,
+ sal_Int32 i_nMaxRows)
+ :OCacheSet(i_nMaxRows)
+ ,m_aParameterValueForCache(_aParameterValueForCache)
,m_pKeyColumnNames(NULL)
,m_pColumnNames(NULL)
,m_pParameterNames(NULL)
@@ -191,7 +193,7 @@ OKeySet::~OKeySet()
void OKeySet::initColumns()
{
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- bool bCase = (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers()) ? true : false;
+ bool bCase = (xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()) ? true : false;
m_pKeyColumnNames.reset( new SelectColumnsMetaData(bCase) );
m_pColumnNames.reset( new SelectColumnsMetaData(bCase) );
m_pParameterNames.reset( new SelectColumnsMetaData(bCase) );
@@ -984,8 +986,8 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sa
SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end();
for(;aPosIter != aPosEnd;++aPosIter,++aIter)
{
+ impl_convertValue_throw(_rInsertRow,aPosIter->second);
*aIter = (_rInsertRow->get())[aPosIter->second.nPosition];
- impl_convertValue_throw(_rKeyRow,aPosIter->second);
aIter->setTypeKind(aPosIter->second.nType);
}
}
@@ -1382,7 +1384,7 @@ sal_Bool OKeySet::fetchRow()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::fetchRow" );
// fetch the next row and append on the keyset
sal_Bool bRet = sal_False;
- if ( !m_bRowCountFinal )
+ if ( !m_bRowCountFinal && (!m_nMaxRows || sal_Int32(m_aKeyMap.size()) < m_nMaxRows) )
bRet = m_xDriverSet->next();
if ( bRet )
{
diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx
index ecb56d7c88b4..597f659f1d94 100644
--- a/dbaccess/source/core/api/KeySet.hxx
+++ b/dbaccess/source/core/api/KeySet.hxx
@@ -159,7 +159,8 @@ namespace dbaccess
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>& _xTableKeys,
const ::rtl::OUString& _rUpdateTableName,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer,
- const ORowSetValueVector& _aParameterValueForCache);
+ const ORowSetValueVector& _aParameterValueForCache,
+ sal_Int32 i_nMaxRows);
// late ctor which can throw exceptions
virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter);
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx
index 837824751f0f..d984ca2c78c6 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -102,8 +102,9 @@ DBG_NAME(OptimisticSet)
OptimisticSet::OptimisticSet(const ::comphelper::ComponentContext& _rContext,
const Reference< XConnection>& i_xConnection,
const Reference< XSingleSelectQueryAnalyzer >& _xComposer,
- const ORowSetValueVector& _aParameterValueForCache)
- :OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache)
+ const ORowSetValueVector& _aParameterValueForCache,
+ sal_Int32 i_nMaxRows)
+ :OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows)
,m_aSqlParser( _rContext.getLegacyServiceFactory() )
,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY)->getTables(), m_aSqlParser, NULL )
,m_bResultSetChanged(false)
@@ -124,7 +125,7 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const ::
initColumns();
Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData();
- bool bCase = (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers()) ? true : false;
+ bool bCase = (xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()) ? true : false;
Reference<XColumnsSupplier> xQueryColSup(m_xComposer,UNO_QUERY);
const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns();
const Reference<XTablesSupplier> xTabSup(m_xComposer,UNO_QUERY);
diff --git a/dbaccess/source/core/api/OptimisticSet.hxx b/dbaccess/source/core/api/OptimisticSet.hxx
index ba0a04c8b773..da73eaeee8c5 100644
--- a/dbaccess/source/core/api/OptimisticSet.hxx
+++ b/dbaccess/source/core/api/OptimisticSet.hxx
@@ -79,7 +79,8 @@ namespace dbaccess
OptimisticSet(const ::comphelper::ComponentContext& _rContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& i_xConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer,
- const ORowSetValueVector& _aParameterValueForCache);
+ const ORowSetValueVector& _aParameterValueForCache,
+ sal_Int32 i_nMaxRows);
// late ctor which can throw exceptions
virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter);
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 829155709119..4118794d5b52 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -348,7 +348,7 @@ void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const
case PROPERTY_ID_FETCHSIZE:
if(m_pCache)
{
- m_pCache->setMaxRowSize(m_nFetchSize);
+ m_pCache->setFetchSize(m_nFetchSize);
fireRowcount();
}
break;
@@ -1078,7 +1078,7 @@ void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQL
positionCache( MOVE_NONE_REFRESH_ONLY );
ORowSetRow aOldValues;
- if ( !m_aCurrentRow.isNull() )
+ if ( !m_bModified && _bNotifyModified && !m_aCurrentRow.isNull() )
aOldValues = new ORowSetValueVector( m_aCurrentRow->getBody() );
m_pCache->cancelRowUpdates();
@@ -1088,11 +1088,13 @@ void ORowSet::implCancelRowUpdates( sal_Bool _bNotifyModified ) SAL_THROW( ( SQL
m_aCurrentRow.setBookmark(m_aBookmark);
// notification order
- // - column values
- ORowSetBase::firePropertyChange(aOldValues);
// IsModified
if( !m_bModified && _bNotifyModified )
+ {
+ // - column values
+ ORowSetBase::firePropertyChange(aOldValues);
fireProperty(PROPERTY_ID_ISMODIFIED,sal_False,sal_True);
+ }
}
// -------------------------------------------------------------------------
@@ -1661,6 +1663,8 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw()
try
{
xStatementProps->setPropertyValue( PROPERTY_USEBOOKMARKS, makeAny( sal_True ) );
+ xStatementProps->setPropertyValue( PROPERTY_MAXROWS, makeAny( m_nMaxRows ) );
+
setStatementResultSetType( xStatementProps, m_nResultSetType, m_nResultSetConcurrency );
}
catch ( const Exception& )
@@ -1817,13 +1821,13 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", "ORowSet::execute_NoApprove_NoNewConn: creating cache" );
- m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew,m_aParameterValueForCache,m_aFilter );
+ m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew,m_aParameterValueForCache,m_aFilter,m_nMaxRows );
if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY )
{
m_nPrivileges = Privilege::SELECT;
m_pCache->m_nPrivileges = Privilege::SELECT;
}
- m_pCache->setMaxRowSize(m_nFetchSize);
+ m_pCache->setFetchSize(m_nFetchSize);
m_aCurrentRow = m_pCache->createIterator(this);
m_aOldRow = m_pCache->registerOldRow();
}
@@ -2241,7 +2245,7 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw()
try
{
Reference<XDatabaseMetaData> xMeta = m_xActiveConnection->getMetaData();
- bCase = xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers();
+ bCase = xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers();
}
catch(SQLException&)
{
@@ -2769,9 +2773,9 @@ void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException)
// notification order:
if ( m_bModified && m_pCache )
- // - column values
implCancelRowUpdates( sal_False ); // do _not_ notify the IsModify - will do this ourself below
+ // - column values
ORowSetBase::refreshRow();
// - IsModified
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx
index 57157cf4f998..4cb218d628b6 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -1198,8 +1198,11 @@ void SAL_CALL ORowSetBase::refreshRow( ) throw(SQLException, RuntimeException)
if(!(m_bBeforeFirst || m_bAfterLast))
{
+ sal_Bool bWasNew = m_pCache->m_bNew || impl_rowDeleted();
+ ORowSetRow aOldValues = getOldRow(bWasNew);
positionCache( MOVE_NONE_REFRESH_ONLY );
m_pCache->refreshRow();
+ firePropertyChange(aOldValues);
}
}
// -------------------------------------------------------------------------
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index e4e468b13779..0ca34e11b66b 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -91,7 +91,8 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
sal_Bool& _bModified,
sal_Bool& _bNew,
const ORowSetValueVector& _aParameterValueForCache,
- const ::rtl::OUString& i_sRowSetFilter)
+ const ::rtl::OUString& i_sRowSetFilter,
+ sal_Int32 i_nMaxRows)
:m_xSet(_xRs)
,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY)->getMetaData())
,m_aContext( _rContext )
@@ -128,7 +129,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
xUp->cancelRowUpdates();
_xRs->beforeFirst();
m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE;
- m_pCacheSet = new WrappedResultSet();
+ m_pCacheSet = new WrappedResultSet(i_nMaxRows);
m_xCacheSet = m_pCacheSet;
m_pCacheSet->construct(_xRs,i_sRowSetFilter);
return;
@@ -175,7 +176,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
if ( aTableNames.getLength() > 1 && !_rUpdateTableName.getLength() && bNeedKeySet )
{// here we have a join or union and nobody told us which table to update, so we update them all
m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE;
- OptimisticSet* pCursor = new OptimisticSet(m_aContext,xConnection,_xAnalyzer,_aParameterValueForCache);
+ OptimisticSet* pCursor = new OptimisticSet(m_aContext,xConnection,_xAnalyzer,_aParameterValueForCache,i_nMaxRows);
m_pCacheSet = pCursor;
m_xCacheSet = m_pCacheSet;
try
@@ -237,7 +238,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
{
try
{
- m_pCacheSet = new OBookmarkSet();
+ m_pCacheSet = new OBookmarkSet(i_nMaxRows);
m_xCacheSet = m_pCacheSet;
m_pCacheSet->construct(_xRs,i_sRowSetFilter);
@@ -271,7 +272,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
// oj removed because keyset uses only the next// || (xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_RESULTSETTYPE) && comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) == ResultSetType::FORWARD_ONLY)
if(!bAllKeysFound )
{
- m_pCacheSet = new OStaticSet();
+ m_pCacheSet = new OStaticSet(i_nMaxRows);
m_xCacheSet = m_pCacheSet;
m_pCacheSet->construct(_xRs,i_sRowSetFilter);
m_nPrivileges = Privilege::SELECT;
@@ -308,7 +309,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
}
}
- OKeySet* pKeySet = new OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer,_aParameterValueForCache);
+ OKeySet* pKeySet = new OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer,_aParameterValueForCache,i_nMaxRows);
try
{
m_pCacheSet = pKeySet;
@@ -335,7 +336,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
if ( m_pCacheSet )
m_pCacheSet = NULL;
m_xCacheSet = NULL;
- m_pCacheSet = new OStaticSet();
+ m_pCacheSet = new OStaticSet(i_nMaxRows);
m_xCacheSet = m_pCacheSet;
m_pCacheSet->construct(_xRs,i_sRowSetFilter);
m_nPrivileges = Privilege::SELECT;
@@ -373,9 +374,8 @@ ORowSetCache::~ORowSetCache()
}
// -------------------------------------------------------------------------
-void ORowSetCache::setMaxRowSize(sal_Int32 _nSize)
+void ORowSetCache::setFetchSize(sal_Int32 _nSize)
{
-
if(_nSize == m_nFetchSize)
return;
diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx
index 76e1d7145752..bf9dc1500d56 100644
--- a/dbaccess/source/core/api/RowSetCache.hxx
+++ b/dbaccess/source/core/api/RowSetCache.hxx
@@ -202,7 +202,8 @@ namespace dbaccess
sal_Bool& _bModified,
sal_Bool& _bNew,
const ORowSetValueVector& _aParameterValueForCache,
- const ::rtl::OUString& i_sRowSetFilter);
+ const ::rtl::OUString& i_sRowSetFilter,
+ sal_Int32 i_nMaxRows);
~ORowSetCache();
@@ -211,7 +212,7 @@ namespace dbaccess
ORowSetCacheIterator createIterator(ORowSetBase* _pRowSet);
void deleteIterator(const ORowSetBase* _pRowSet);
// sets the size of the matrix
- void setMaxRowSize(sal_Int32 _nSize);
+ void setFetchSize(sal_Int32 _nSize);
TORowSetOldRowHelperRef registerOldRow();
void deregisterOldRow(const TORowSetOldRowHelperRef& _rRow);
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index 2f9a58c975b7..fa67a3d8cfdb 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -1088,7 +1088,7 @@ sal_Bool OSingleSelectQueryComposer::setANDCriteria( OSQLParseNode * pCondition,
}
else if (SQL_ISRULE(pCondition,test_for_null))
{
- if (SQL_ISTOKEN(pCondition->getChild(1)->getChild(2),NOT) )
+ if (SQL_ISTOKEN(pCondition->getChild(1)->getChild(1),NOT) )
aItem.Handle = SQLFilterOperator::NOT_SQLNULL;
else
aItem.Handle = SQLFilterOperator::SQLNULL;
diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx
index de768b6ceb8e..216ccf08eb5d 100644
--- a/dbaccess/source/core/api/StaticSet.cxx
+++ b/dbaccess/source/core/api/StaticSet.cxx
@@ -122,7 +122,7 @@ sal_Bool OStaticSet::fetchRow()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::fetchRow" );
sal_Bool bRet = sal_False;
- if ( !m_bEnd )
+ if ( !m_bEnd && (!m_nMaxRows || sal_Int32(m_aSet.size()) < m_nMaxRows) )
bRet = m_xDriverSet->next();
if ( bRet )
{
@@ -141,9 +141,10 @@ void OStaticSet::fillAllRows()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OStaticSet::fillAllRows" );
if(!m_bEnd)
{
+ sal_Int32 nColumnCount = m_xSetMetaData->getColumnCount();
while(m_xDriverSet->next())
{
- ORowSetRow pRow = new connectivity::ORowVector< connectivity::ORowSetValue >(m_xSetMetaData->getColumnCount());
+ ORowSetRow pRow = new connectivity::ORowVector< connectivity::ORowSetValue >(nColumnCount);
m_aSet.push_back(pRow);
m_aSetIter = m_aSet.end() - 1;
(pRow->get())[0] = getRow();
diff --git a/dbaccess/source/core/api/StaticSet.hxx b/dbaccess/source/core/api/StaticSet.hxx
index 676044cb61f9..19d0d3023402 100644
--- a/dbaccess/source/core/api/StaticSet.hxx
+++ b/dbaccess/source/core/api/StaticSet.hxx
@@ -44,8 +44,8 @@ namespace dbaccess
sal_Bool fetchRow();
void fillAllRows();
public:
- OStaticSet()
- : m_aSetIter(m_aSet.end())
+ OStaticSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows)
+ , m_aSetIter(m_aSet.end())
, m_bEnd(sal_False)
{
m_aSet.push_back(NULL); // this is the beforefirst record
diff --git a/dbaccess/source/core/api/WrappedResultSet.hxx b/dbaccess/source/core/api/WrappedResultSet.hxx
index 082811748e6a..34860e0da390 100644
--- a/dbaccess/source/core/api/WrappedResultSet.hxx
+++ b/dbaccess/source/core/api/WrappedResultSet.hxx
@@ -48,7 +48,7 @@ namespace dbaccess
void updateColumn(sal_Int32 nPos,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > _xParameter,const connectivity::ORowSetValue& _rValue);
public:
- WrappedResultSet()
+ WrappedResultSet(sal_Int32 i_nMaxRows) : OCacheSet(i_nMaxRows)
{}
~WrappedResultSet()
{
diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx
index f4cc3cf34714..75c56c65e0e3 100644
--- a/dbaccess/source/core/api/query.cxx
+++ b/dbaccess/source/core/api/query.cxx
@@ -228,7 +228,7 @@ void OQuery::rebuildColumns()
::vos::ORef< OSQLColumns > aParseColumns(
::connectivity::parse::OParseColumn::createColumnsForResultSet( xResultSetMeta, xDBMeta,xColumnDefinitions ) );
xColumns = OPrivateColumns::createWithIntrinsicNames(
- aParseColumns, xDBMeta->storesMixedCaseQuotedIdentifiers(), *this, m_aMutex );
+ aParseColumns, xDBMeta->supportsMixedCaseQuotedIdentifiers(), *this, m_aMutex );
if ( !xColumns.is() )
throw RuntimeException();
}
diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src
index dc7023ca6fba..dd1ca4c8a184 100644
--- a/dbaccess/source/core/resource/strings.src
+++ b/dbaccess/source/core/resource/strings.src
@@ -273,7 +273,7 @@ String RID_STR_ROW_ALREADY_DELETED
};
String RID_STR_UPDATE_FAILED
{
- Text [ en-US ] = "Current row could be updated.";
+ Text [ en-US ] = "Current row could not be updated.";
};
//-------------------------------------------------------------------------
String RID_STR_NO_INSERT_PRIVILEGE
diff --git a/dbaccess/source/filter/migration/cfgimport.cxx b/dbaccess/source/filter/migration/cfgimport.cxx
deleted file mode 100644
index 67e1bd3ec103..000000000000
--- a/dbaccess/source/filter/migration/cfgimport.cxx
+++ /dev/null
@@ -1,1260 +0,0 @@
- /*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_dbaccess.hxx"
-
-#include "cfgimport.hxx"
-
-#ifndef CFG_REGHELPER_HXX
-#include "cfg_reghelper.hxx"
-#endif
-#ifndef _SV_SVAPP_HXX
-#include <vcl/svapp.hxx>
-#endif
-#ifndef _COM_SUN_STAR_UNO_XNAMINGSERVICE_HPP_
-#include <com/sun/star/uno/XNamingService.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XQUERYDEFINITIONSSUPPLIER_HPP_
-#include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
-#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XDATADESCRIPTORFACTORY_HPP_
-#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
-#include <com/sun/star/frame/XModel.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XAPPEND_HPP_
-#include <com/sun/star/sdbcx/XAppend.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_
-#include <com/sun/star/frame/XStorable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_
-#include <com/sun/star/sdbc/XDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XOFFICEDATABASEDOCUMENT_HPP_
-#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XDOCUMENTDATASOURCE_HPP_
-#include <com/sun/star/sdb/XDocumentDataSource.hpp>
-#endif
-#ifndef _URLOBJ_HXX //autogen wg. INetURLObject
-#include <tools/urlobj.hxx>
-#endif
-#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
-#include <unotools/pathoptions.hxx>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
-#include <com/sun/star/frame/XComponentLoader.hpp>
-#endif
-#ifndef DBACCESS_SHARED_CFGSTRINGS_HRC
-#include "cfgstrings.hrc"
-#endif
-#ifndef _UNOTOOLS_UCBHELPER_HXX
-#include <unotools/ucbhelper.hxx>
-#endif
-#ifndef _COMPHELPER_TYPES_HXX_
-#include <comphelper/types.hxx>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
-#include <com/sun/star/container/XNameContainer.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
-#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef _SFX_DOCFILT_HACK_HXX
-#include <sfx2/docfilt.hxx>
-#endif
-#ifndef _COMPHELPER_STREAMSECTION_HXX_
-#include <comphelper/streamsection.hxx>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HPP_
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XOBJECTINPUTSTREAM_HPP_
-#include <com/sun/star/io/XObjectInputStream.hpp>
-#endif
-#ifndef _COMPHELPER_BASIC_IO_HXX_
-#include <comphelper/basicio.hxx>
-#endif
-#ifndef _COMPHELPER_SEQSTREAM_HXX
-#include <comphelper/seqstream.hxx>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XREPORTDOCUMENTSSUPPLIER_HPP_
-#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDB_XFORMDOCUMENTSSUPPLIER_HPP_
-#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYER_HPP_
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XLOADABLE_HPP_
-#include <com/sun/star/frame/XLoadable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_DOCUMENT_XTYPEDETECTION_HPP_
-#include <com/sun/star/document/XTypeDetection.hpp>
-#endif
-#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTSSUPPLIER_HPP_
-#include <com/sun/star/document/XEventsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_XCLOSEABLE_HPP_
-#include <com/sun/star/util/XCloseable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEREPLACE_HPP_
-#include <com/sun/star/container/XNameReplace.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FORM_FORMCOMPONENTTYPE_HPP_
-#include <com/sun/star/form/FormComponentType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGESUPPLIER_HPP_
-#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FORM_XFORMSSUPPLIER_HPP_
-#include <com/sun/star/form/XFormsSupplier.hpp>
-#endif
-#ifndef _TOOLS_DEBUG_HXX
-#include <tools/debug.hxx>
-#endif
-
-
-extern "C" void SAL_CALL createRegistryInfo_OCfgImport( )
-{
- static ::dbacfg::OMultiInstanceAutoRegistration< ::dbacfg::OCfgImport > aAutoRegistration;
-}
-
-#define DATASOURCES 1
-#define DATASOURCE 2
-#define DATASOURCESETTINGS 3
-#define TABLES 4
-#define QUERIES 5
-#define BOOKMARKS 6
-#define DATASOURCESETTING 7
-#define BOOKMARK 8
-#define QUERY 9
-#define TABLE 10
-#define DATASETTINGS 11
-#define COLUMNS 12
-#define COLUMN 13
-#define NO_PROP 14
-#define LOGINTIMEOUT 15
-
-//--------------------------------------------------------------------------
-using namespace dbacfg;
-// {
- using namespace ::com::sun::star::util;
- using namespace ::com::sun::star::sdb;
- using namespace ::com::sun::star::sdbcx;
- using namespace ::com::sun::star::frame;
- using namespace ::com::sun::star::document;
- using namespace ::com::sun::star::io;
- using namespace ::com::sun::star::form;
- using namespace ::com::sun::star::drawing;
- using namespace ::com::sun::star::container;
- using namespace ::com::sun::star::beans;
- using namespace ::com::sun::star::task;
- using namespace ::com::sun::star::configuration::backend;
- using namespace ::utl;
- using namespace ::comphelper;
-
- void LoadTableWindows(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps);
- void LoadTableWindowData(const Reference<XObjectInputStream>& _rxIn,PropertyValue* _pValue);
- void LoadTableFields(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps);
- void LoadTableFieldDesc(const Reference< XObjectInputStream>& _rxIn,PropertyValue& _rProperty);
- sal_Bool isDocumentReport(const Reference< XMultiServiceFactory >& _xORB,const ::rtl::OUString& _sDocumentLocation);
-// -------------
-// - OCfgImport -
-// -------------
-DBG_NAME(OCfgImport)
-
-OCfgImport::OCfgImport( const Reference< XMultiServiceFactory >& _rxMSF )
- :m_xORB( _rxMSF )
- ,m_bPropertyMayBeVoid(sal_True)
-{
- DBG_CTOR(OCfgImport,NULL);
-
-}
-
-// -----------------------------------------------------------------------------
-
-OCfgImport::~OCfgImport() throw()
-{
-
- DBG_DTOR(OCfgImport,NULL);
-}
-// -----------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO1_STATIC( OCfgImport, "com.sun.star.comp.sdb.DataSourceMigration", "com.sun.star.sdb.DataSourceMigration")
-// -----------------------------------------------------------------------------
-// XInitialization
-void SAL_CALL OCfgImport::initialize( const Sequence< Any >& _aArguments ) throw(Exception, RuntimeException)
-{
- const Any* pIter = _aArguments.getConstArray();
- const Any* pEnd = pIter + _aArguments.getLength();
- Sequence<NamedValue> aOldConfigValues;
- NamedValue aValue;
- for(;pIter != pEnd;++pIter)
- {
- *pIter >>= aValue;
- if ( aValue.Name.equalsAscii("OldConfiguration") && (aValue.Value >>= aOldConfigValues) )
- {
- const NamedValue* configValues = aOldConfigValues.getConstArray();
- const NamedValue* configValuesEnd = configValues + aOldConfigValues.getLength();
- for(;configValues != configValuesEnd;++configValues)
- {
- if ( configValues->Name.equalsAscii("org.openoffice.Office.DataAccess") )
- {
- configValues->Value >>= m_xLayer;
- break;
- }
- }
- break;
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-void LoadTableWindows(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps)
-{
- try
- {
- OStreamSection aSection(_rxIn.get());
-
- sal_Int32 nCount = 0;
- _rxIn >> nCount;
- if ( nCount > 0 )
- {
- PropertyValue *pViewIter = _rViewProps.getArray();
- PropertyValue *pEnd = pViewIter + _rViewProps.getLength();
- const static ::rtl::OUString s_sTables(RTL_CONSTASCII_USTRINGPARAM("Tables"));
- for (; pViewIter != pEnd && pViewIter->Name != s_sTables; ++pViewIter)
- ;
-
- if ( pViewIter == pEnd )
- {
- sal_Int32 nLen = _rViewProps.getLength();
- _rViewProps.realloc( nLen + 1 );
- pViewIter = _rViewProps.getArray() + nLen;
- pViewIter->Name = s_sTables;
- }
-
- Sequence<PropertyValue> aTables(nCount);
- PropertyValue *pIter = aTables.getArray();
-
-
- for(sal_Int32 i=0;i<nCount;++i,++pIter)
- {
- pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Table")) + ::rtl::OUString::valueOf(i+1);
- LoadTableWindowData(_rxIn,pIter);
- }
- }
- }
- catch(Exception&)
- {
- }
-}
-// -----------------------------------------------------------------------------
-void LoadTableWindowData(const Reference<XObjectInputStream>& _rxIn,PropertyValue* _pValue)
-{
- ::rtl::OUString sComposedName,aTableName,aWinName;
- sal_Int32 nX,nY,nWidth,nHeight;
- sal_Bool bShowAll;
-
- OStreamSection aSection(_rxIn.get());
- _rxIn >> sComposedName;
- _rxIn >> aTableName;
- _rxIn >> aWinName;
- _rxIn >> nX;
- _rxIn >> nY;
- _rxIn >> nWidth;
- _rxIn >> nHeight;
- _rxIn >> bShowAll;
-
- Sequence<PropertyValue> aWindow(8);
- sal_Int32 nPos = 0;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ComposedName"));
- aWindow[nPos++].Value <<= sComposedName;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableName"));
- aWindow[nPos++].Value <<= aTableName;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowName"));
- aWindow[nPos++].Value <<= aWinName;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowTop"));
- aWindow[nPos++].Value <<= nY;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowLeft"));
- aWindow[nPos++].Value <<= nX;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowWidth"));
- aWindow[nPos++].Value <<= nWidth;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WindowHeight"));
- aWindow[nPos++].Value <<= nHeight;
- aWindow[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowAll"));
- aWindow[nPos++].Value <<= bShowAll;
-
- _pValue->Value <<= aWindow;
-}
-// -----------------------------------------------------------------------------
-void LoadTableFields(const Reference< XObjectInputStream>& _rxIn,Sequence<PropertyValue>& _rViewProps)
-{
- LoadTableWindows(_rxIn,_rViewProps);
- OStreamSection aSection(_rxIn.get());
- PropertyValue *pIter = NULL;
- try
- {
- sal_Int32 nSplitPos,nVisibleRows;
- // some data
- _rxIn >> nSplitPos;
- _rxIn >> nVisibleRows;
-
- sal_Int32 nCount = 0;
- _rxIn >> nCount;
-
- sal_Int32 nLen = _rViewProps.getLength();
- _rViewProps.realloc( nLen + 2 + (nCount != 0 ? 1 : 0) );
- pIter = _rViewProps.getArray() + nLen;
-
- if ( nCount != 0 )
- {
- pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fields"));
-
- Sequence<PropertyValue> aFields(nCount);
- PropertyValue *pFieldsIter = aFields.getArray();
- // the fielddata
- for(sal_Int32 j=0;j<nCount;++j)
- {
- if ( aSection.available() )
- {
- pFieldsIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Field")) + ::rtl::OUString::valueOf(j+1);
- LoadTableFieldDesc(_rxIn,*pFieldsIter++);
- }
- }
- pIter->Value <<= aFields;
- ++pIter;
- }
-
- pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SplitterPosition"));
- pIter->Value <<= nSplitPos;
- ++pIter;
- pIter->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleRows"));
- pIter->Value <<= nVisibleRows;
- }
- catch(Exception&)
- {
- }
-}
-// -----------------------------------------------------------------------------
-void LoadTableFieldDesc(const Reference< XObjectInputStream>& _rxIn,PropertyValue& _rProperty)
-{
- ::rtl::OUString aTableName;
- ::rtl::OUString aAliasName; // table range
- ::rtl::OUString aFieldName; // column
- ::rtl::OUString aFieldAlias; // column alias
- ::rtl::OUString aDatabaseName; // qualifier or catalog
- ::rtl::OUString aFunctionName; // enth"alt den Funktionsnamen, nur wenn eFunctionType != FKT_NONE gesetzt
-
- sal_Int32 eDataType;
- sal_Int32 eFunctionType;
- sal_Int32 eFieldType;
- sal_Int32 eOrderDir;
- sal_Int32 nColWidth;
- sal_Bool bGroupBy;
- sal_Bool bVisible;
-
- OStreamSection aSection(_rxIn.get());
- _rxIn >> aTableName;
- _rxIn >> aAliasName;
- _rxIn >> aFieldName;
- _rxIn >> aFieldAlias;
- _rxIn >> aDatabaseName;
- _rxIn >> aFunctionName;
- _rxIn >> eDataType;
- _rxIn >> eFunctionType;
- _rxIn >> eFieldType;
- _rxIn >> eOrderDir;
- _rxIn >> nColWidth;
- _rxIn >> bGroupBy;
- _rxIn >> bVisible;
-
- Sequence<PropertyValue> aFieldDesc(13);
- sal_Int32 nPos = 0;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AliasName"));
- aFieldDesc[nPos++].Value <<= aAliasName;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableName"));
- aFieldDesc[nPos++].Value <<= aTableName;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldName"));
- aFieldDesc[nPos++].Value <<= aFieldName;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldAlias"));
- aFieldDesc[nPos++].Value <<= aFieldAlias;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DatabaseName"));
- aFieldDesc[nPos++].Value <<= aDatabaseName;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FunctionName"));
- aFieldDesc[nPos++].Value <<= aFunctionName;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataType"));
- aFieldDesc[nPos++].Value <<= eDataType;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FunctionType"));
- aFieldDesc[nPos++].Value <<= (sal_Int32)eFunctionType;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldType"));
- aFieldDesc[nPos++].Value <<= (sal_Int32)eFieldType;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OrderDir"));
- aFieldDesc[nPos++].Value <<= (sal_Int32)eOrderDir;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColWidth"));
- aFieldDesc[nPos++].Value <<= nColWidth;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GroupBy"));
- aFieldDesc[nPos++].Value <<= bGroupBy;
- aFieldDesc[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Visible"));
- aFieldDesc[nPos++].Value <<= bVisible;
-
- _rProperty.Value <<= aFieldDesc;
-}
-// -----------------------------------------------------------------------------
-void closeDocument(const Reference< XModel >& _xDocument)
-{
- Reference< XCloseable > xCloseable( _xDocument, UNO_QUERY );
- if ( xCloseable.is() )
- {
- try
- {
- xCloseable->close( sal_True );
- }
- catch( Exception& )
- {
- }
- }
-}
-// -----------------------------------------------------------------------------
-sal_Bool isDocumentReport(const Reference< XMultiServiceFactory >& _xORB,const ::rtl::OUString& _sDocumentLocation)
-{
- sal_Bool bReport = sal_False;
- try
- {
- Reference< XModel > xDocument(_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument"))),UNO_QUERY);
- if ( xDocument.is() )
- {
- Reference< XLoadable > xLoadable( xDocument, UNO_QUERY );
- if ( xLoadable.is() )
- {
- Sequence< PropertyValue > aMedDescr(4);
- sal_Int32 nPos = 0;
- aMedDescr[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate"));
- aMedDescr[nPos++].Value <<= sal_False;
- aMedDescr[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
- aMedDescr[nPos++].Value <<= sal_False;
- aMedDescr[nPos].Name = PROPERTY_URL;
- aMedDescr[nPos++].Value <<= _sDocumentLocation;
- aMedDescr[nPos].Name = ::rtl::OUString::createFromAscii( "ReadOnly" );
- aMedDescr[nPos++].Value <<= sal_True;
- Reference< XTypeDetection > xTypeDetection(_xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection")) ),UNO_QUERY );
-
- if ( !xTypeDetection.is() )
- throw RuntimeException(); // TODO
-
- // get TypeName
- ::rtl::OUString aTypeName = xTypeDetection->queryTypeByDescriptor( aMedDescr, sal_True );
- const PropertyValue* pIter = aMedDescr.getConstArray();
- const PropertyValue* pEnd = pIter + aMedDescr.getLength();
- for( ; pIter != pEnd && !pIter->Name.equalsAscii( "FilterName" ); ++pIter)
- ;
- if ( aTypeName.getLength() && pIter == pEnd )
- {
- Reference<XNameAccess> xNameAccess( xTypeDetection, UNO_QUERY );
- if ( xNameAccess.is() && xNameAccess->hasByName( aTypeName ) )
- {
- Sequence<PropertyValue> aTypes;
- xNameAccess->getByName(aTypeName) >>= aTypes;
- const PropertyValue* types = aTypes.getConstArray();
- const PropertyValue* typesEnd = types + aTypes.getLength();
- for( ; types != typesEnd && !types->Name.equalsAscii( "PreferredFilter" ) ; ++types)
- ;
- if ( types != typesEnd )
- {
- sal_Int32 nLen = aMedDescr.getLength();
- aMedDescr.realloc(nLen+1);
- aMedDescr[nLen].Value = types->Value;
- aMedDescr[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
- }
- }
- }
- try
- {
- xLoadable->load(aMedDescr);
-
- Reference< XEventsSupplier> xEventsSup(xDocument,UNO_QUERY);
- Reference< XNameReplace> xEvents = xEventsSup.is() ? xEventsSup->getEvents() : Reference< XNameReplace>();
- static const ::rtl::OUString s_sOnNew = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnNew"));
- if ( xEvents.is() && xEvents->hasByName(s_sOnNew) )
- {
- Sequence<PropertyValue> aEventDesc;
- if ( (xEvents->getByName(s_sOnNew) >>= aEventDesc ) && aEventDesc.getLength() )
- {
- ::rtl::OUString sScript;
- const PropertyValue* events = aEventDesc.getConstArray();
- const PropertyValue* eventsEnd = events + aEventDesc.getLength();
- for( ; events != eventsEnd && !events->Name.equalsAscii( "Script" ) ; ++events)
- ;
- if ( events != eventsEnd && (events->Value >>= sScript) )
- bReport = sScript.equalsAscii("service:com.sun.star.wizards.report.CallReportWizard?fill");
- }
- }
- if ( !bReport )
- {
- sal_Bool bForm = sal_False;
- Reference< XDrawPageSupplier> xDrawPageSup(xDocument,UNO_QUERY);
- Reference< XFormsSupplier> xFormsSup(xDrawPageSup.is() ? xDrawPageSup->getDrawPage() : Reference< XDrawPage>(),UNO_QUERY);
- Reference< XNameContainer> xForms(xFormsSup.is() ? xFormsSup->getForms() : Reference< XNameContainer>(),UNO_QUERY);
- Sequence< ::rtl::OUString> aSeq = xForms.is() ? xForms->getElementNames() : Sequence< ::rtl::OUString>();
- const ::rtl::OUString* elementNames = aSeq.getConstArray();
- const ::rtl::OUString* elementNamesEnd = elementNames + aSeq.getLength();
- for(;elementNames != elementNamesEnd && !bForm;++elementNames)
- {
- Reference< XNameContainer> xControls(xForms->getByName(*elementNames),UNO_QUERY);
- Sequence< ::rtl::OUString> aControlSeq = xControls.is() ? xControls->getElementNames() : Sequence< ::rtl::OUString>();
- const ::rtl::OUString* pControlIter = aControlSeq.getConstArray();
- const ::rtl::OUString* pControlEnd = pControlIter + aControlSeq.getLength();
- for(;pControlIter != pControlEnd && !bForm;++pControlIter)
- {
- Reference<XPropertySet> xProp(xControls->getByName(*pControlIter),UNO_QUERY);
- sal_Int16 nClassId = 0;
- const static ::rtl::OUString s_sClassId = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClassId"));
- if ( xProp.is()
- && xProp->getPropertySetInfo().is()
- && xProp->getPropertySetInfo()->hasPropertyByName(s_sClassId)
- && (xProp->getPropertyValue(s_sClassId) >>= nClassId) )
- {
- bForm = nClassId != FormComponentType::HIDDENCONTROL;
- }
- }
- }
- bReport = !bForm;
- }
- }
- catch( Exception& )
- {
- closeDocument(xDocument);
- }
- }
- closeDocument(xDocument);
- }
- }
- catch(Exception)
- {
- OSL_ENSURE(0,"isDocumentReport: catched exception!");
- }
- return bReport;
-}
-// -----------------------------------------------------------------------------
-void OCfgImport::createDataSource(const ::rtl::OUString& _sName)
-{
- SvtPathOptions aPathOptions;
- const String& rsWorkPath = aPathOptions.GetWorkPath();
-
- ::rtl::OUString sExtension;
- static const String s_sDatabaseType = String::CreateFromAscii("StarOffice XML (Base)");
- const SfxFilter* pFilter = SfxFilter::GetFilterByName( s_sDatabaseType);
- OSL_ENSURE(pFilter,"Filter: StarOffice XML (Base) could not be found!");
- if ( pFilter )
- {
- String aRet = pFilter->GetDefaultExtension();
- while( aRet.SearchAndReplaceAscii( "*.", String() ) != STRING_NOTFOUND ) ;
- sExtension = aRet;
- }
- // then look for which of them settings are stored in the configuration
- ::rtl::OUString sFileName;
- try
- {
- m_xModel.set(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"))),UNO_QUERY);
-
- if ( !m_xModel.is() )
- return;
-
- Reference<XOfficeDatabaseDocument> xOfficeDoc(m_xModel,UNO_QUERY);
- if ( xOfficeDoc.is() )
- m_xCurrentDS.set(xOfficeDoc->getDataSource(),UNO_QUERY);
-
-
- INetURLObject aURL(rsWorkPath,INetURLObject::WAS_ENCODED);
- aURL.insertName(_sName,false,INetURLObject::LAST_SEGMENT,true,INetURLObject::ENCODE_ALL);
- aURL.setExtension(sExtension);
-
- sFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
-
- sal_Int32 i = 0;
- // create unique name
- while ( UCBContentHelper::IsDocument(sFileName) )
- {
- sFileName = _sName + ::rtl::OUString::valueOf(++i);
- aURL.setName(sFileName,INetURLObject::LAST_SEGMENT,true,INetURLObject::ENCODE_ALL);
- aURL.setExtension(sExtension);
- sFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
- }
-
- Sequence< PropertyValue > aArgs(1);
- aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ) );
- aArgs[0].Value <<= sFileName;
-
- Reference< XLoadable > xLoad( m_xModel, UNO_QUERY_THROW );
- xLoad->load( aArgs );
- m_xModel->attachResource( sFileName, Sequence< PropertyValue >() );
- }
- catch(Exception&)
- {
- OSL_ENSURE(0,"Exception: convert");
- UCBContentHelper::Kill(sFileName);
- }
-}
-// -----------------------------------------------------------------------------
-void OCfgImport::createObject(sal_Bool _bQuery ,const ::rtl::OUString& _sName)
-{
- if ( !m_xCurrentObject.is() )
- {
- Sequence< Any > aArguments(1);
- PropertyValue aValue;
- // set as folder
- aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"));
- aValue.Value <<= _sName;
- aArguments[0] <<= aValue;
- m_xCurrentObject.set(m_xORB->createInstanceWithArguments(_bQuery ? SERVICE_SDB_COMMAND_DEFINITION : SERVICE_SDB_TABLEDEFINITION ,aArguments ),UNO_QUERY);
- }
-}
-// -----------------------------------------------------------------------------
-void OCfgImport::setProperties(sal_Int16 _eType)
-{
- if ( m_aValues[_eType].getLength() )
- {
- OSL_ENSURE(m_aProperties[_eType].getLength() == m_aValues[_eType].getLength(),"Count is not equal!");
- try
- {
- Reference< XMultiPropertySet > xFormMultiSet;
- if ( _eType == COLUMN )
- xFormMultiSet.set(m_xCurrentColumn,UNO_QUERY);
- else if ( _eType == TABLE || _eType == QUERY )
- xFormMultiSet.set(m_xCurrentObject,UNO_QUERY);
- else if ( _eType == DATASOURCE )
- xFormMultiSet.set(m_xCurrentDS,UNO_QUERY);
-
- if ( xFormMultiSet.is() )
- xFormMultiSet->setPropertyValues(m_aProperties[_eType], m_aValues[_eType]);
- }
- catch(const Exception& e)
- {
- throw WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property could not be set.")),*this,makeAny(e));
- }
- m_aValues[_eType] = Sequence< Any>();
- m_aProperties[_eType] = Sequence< ::rtl::OUString>();
- }
-}
-// -----------------------------------------------------------------------------
-Any SAL_CALL OCfgImport::execute( const Sequence< NamedValue >& /*Arguments*/ ) throw (IllegalArgumentException, Exception, RuntimeException)
-{
- m_xLayer->readData(this);
- return Any();
-}
-// -----------------------------------------------------------------------------
-// XLayerHandler
-void SAL_CALL OCfgImport::startLayer()
- throw(WrappedTargetException)
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::endLayer()
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::overrideNode(
- const ::rtl::OUString& aName,
- sal_Int16 aAttributes,
- sal_Bool /*bClear*/)
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
- addOrReplaceNode(aName,aAttributes);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::addOrReplaceNode(
- const ::rtl::OUString& aName,
- sal_Int16 /*aAttributes*/)
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
- if ( !m_aStack.empty() )
- {
- switch(m_aStack.top().second)
- {
- case DATASOURCES:
- m_sCurrentDataSourceName = aName;
- if ( m_sCurrentDataSourceName.equalsAscii("Bibliography") )
- {
- Reference< XNameAccess > xDatabaseContext(m_xORB->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY);
- if ( xDatabaseContext.is() && xDatabaseContext->hasByName(m_sCurrentDataSourceName) )
- {
- m_xCurrentDS.set(xDatabaseContext->getByName(m_sCurrentDataSourceName),UNO_QUERY);
- Reference<XDocumentDataSource> xDocumentDataSource(m_xCurrentDS,UNO_QUERY);
- if ( xDocumentDataSource.is() )
- m_xModel.set(xDocumentDataSource->getDatabaseDocument(),UNO_QUERY);
- }
- }
- if ( !m_xCurrentDS.is() )
- createDataSource(m_sCurrentDataSourceName);
-
- m_aStack.push(TElementStack::value_type(aName,DATASOURCE));
- break;
- case DATASOURCESETTINGS:
- {
- PropertyValue aValue;
- aValue.Name = aName;
- m_aDataSourceSettings.push_back(aValue);
- m_aStack.push(TElementStack::value_type(aName,DATASOURCESETTING));
- }
- break;
- case TABLES:
- m_aStack.push(TElementStack::value_type(aName,TABLE));
- createObject(sal_False,aName);
- break;
- case QUERIES:
- m_aStack.push(TElementStack::value_type(aName,QUERY));
- createObject(sal_True,aName);
- break;
- case COLUMNS:
- if ( !m_xCurrentColumn.is() )
- {
- Reference<XColumnsSupplier> xSupplier(m_xCurrentObject,UNO_QUERY);
- if ( xSupplier.is() )
- {
- Reference<XDataDescriptorFactory> xFact(xSupplier->getColumns(),UNO_QUERY);
-
- m_xCurrentColumn = ( xFact.is() ? xFact->createDataDescriptor() : Reference<XPropertySet>());
- if ( m_xCurrentColumn.is() )
- m_xCurrentColumn->setPropertyValue(PROPERTY_NAME,makeAny(aName));
- }
- }
- m_aStack.push(TElementStack::value_type(aName,COLUMN));
- break;
- case BOOKMARKS:
- m_aStack.push(TElementStack::value_type(aName,BOOKMARK));
- break;
- }
- }
- /*if ( aName.equalsAscii("org.openoffice.Office.DataAccess") )
- m_aStack.push(TElementStack::value_type(aName,0));
- else*/
- if ( aName.equalsAscii("DataSources") )
- m_aStack.push(TElementStack::value_type(aName,DATASOURCES));
- else if ( aName.equalsAscii("DataSourceSettings") )
- m_aStack.push(TElementStack::value_type(aName,DATASOURCESETTINGS));
- else if ( aName.equalsAscii("Tables") )
- m_aStack.push(TElementStack::value_type(aName,TABLES));
- else if ( aName.equalsAscii("Queries") )
- m_aStack.push(TElementStack::value_type(aName,QUERIES));
- else if ( aName == CONFIGKEY_DBLINK_BOOKMARKS )
- m_aStack.push(TElementStack::value_type(aName,BOOKMARKS));
- else if ( aName == CONFIGKEY_SETTINGS )
- m_aStack.push(TElementStack::value_type(aName,DATASETTINGS));
- else if ( aName.equalsAscii("Font") )
- m_aStack.push(TElementStack::value_type(aName,DATASETTINGS));
- else if ( aName == CONFIGKEY_QRYDESCR_COLUMNS )
- m_aStack.push(TElementStack::value_type(aName,COLUMNS));
- else if ( aName.equalsAscii("Font") )
- m_aStack.push(TElementStack::value_type(aName,DATASETTINGS));
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::addOrReplaceNodeFromTemplate(
- const ::rtl::OUString& /*aName*/,
- const TemplateIdentifier& /*aTemplate*/,
- sal_Int16 /*aAttributes*/ )
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::endNode()
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
- if ( !m_aStack.empty() )
- {
- sal_Int16 nElementType = m_aStack.top().second;
- ::rtl::OUString sName = m_aStack.top().first;
- m_aStack.pop();
-
- switch(nElementType)
- {
- case DATASOURCE:
- {
- setProperties(nElementType);
- Reference<XStorable> xStr(m_xModel,UNO_QUERY);
- if ( xStr.is() )
- {
- xStr->store();
- xStr = NULL;
- }
- // register the new datbase document
-
- if ( !m_sCurrentDataSourceName.equalsAscii("Bibliography") )
- {
- // create unique name
- Reference< XNameAccess > xDatabaseContext(m_xORB->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY);
- if ( xDatabaseContext.is() )
- {
- sal_Int32 i = 0;
- ::rtl::OUString sDataSourceName = m_sCurrentDataSourceName;
- while ( xDatabaseContext->hasByName( sDataSourceName ) )
- {
- sDataSourceName = m_sCurrentDataSourceName + ::rtl::OUString::valueOf(++i);
- }
- Reference< XNamingService>(xDatabaseContext,UNO_QUERY)->registerObject(sDataSourceName,m_xCurrentDS);
- }
- }
- ::comphelper::disposeComponent(m_xModel);
- m_xCurrentDS = NULL;
- }
- break;
- case DATASOURCESETTINGS:
- OSL_ENSURE(m_xCurrentDS.is(),"Data Source is NULL!");
- {
- PropertyValue* pSettings = m_aDataSourceSettings.empty() ? NULL : &m_aDataSourceSettings[0];
- m_xCurrentDS->setPropertyValue(PROPERTY_INFO,makeAny(Sequence< PropertyValue >(pSettings, m_aDataSourceSettings.size())));
- }
- break;
- case TABLE:
- {
- setProperties(nElementType);
- Reference<XTablesSupplier> xSupplier(m_xCurrentDS,UNO_QUERY);
- Reference<XNameContainer> xTables(xSupplier->getTables(),UNO_QUERY);
- ::rtl::OUString sTableName;
- m_xCurrentObject->getPropertyValue(PROPERTY_NAME) >>= sTableName;
- if ( !xTables->hasByName( sTableName ) )
- xTables->insertByName( sTableName, makeAny( m_xCurrentObject ) );
- m_xCurrentObject = NULL;
- }
- break;
- case QUERY:
- {
- setProperties(nElementType);
- Reference<XQueryDefinitionsSupplier> xQueriesSupplier(m_xCurrentDS,UNO_QUERY);
- Reference<XNameContainer> xQueries(xQueriesSupplier->getQueryDefinitions(),UNO_QUERY);
- xQueries->insertByName(sName,makeAny(m_xCurrentObject));
- m_xCurrentObject = NULL;
- }
- break;
- case BOOKMARK:
- try
- {
- if ( !UCBContentHelper::IsDocument(m_sDocumentLocation) )
- break;
-
- sal_Bool bForm = sal_True;
- bForm = !isDocumentReport(m_xORB,m_sDocumentLocation);
- Reference<XNameAccess> xNames;
- if ( bForm )
- {
- Reference<XFormDocumentsSupplier> xSup(m_xModel,UNO_QUERY);
- if ( xSup.is() )
- xNames = xSup->getFormDocuments();
- }
- else
- {
- Reference<XReportDocumentsSupplier> xSup(m_xModel,UNO_QUERY);
- if ( xSup.is() )
- xNames = xSup->getReportDocuments();
- }
-
- if ( xNames.is() && m_sBookmarkName.getLength() )
- {
- ::rtl::OUString sServiceName(SERVICE_SDB_DOCUMENTDEFINITION);
- Sequence< Any > aArguments(3);
- PropertyValue aValue;
- // set as folder
- aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"));
- aValue.Value <<= m_sBookmarkName;
- aArguments[0] <<= aValue;
- //parent
- aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent"));
- aValue.Value <<= xNames;
- aArguments[1] <<= aValue;
-
- aValue.Name = PROPERTY_URL;
- aValue.Value <<= m_sDocumentLocation;
- aArguments[2] <<= aValue;
-
- Reference<XMultiServiceFactory> xORB(xNames,UNO_QUERY);
- if ( xORB.is() )
- {
- Reference<XInterface> xComponent = xORB->createInstanceWithArguments(SERVICE_SDB_DOCUMENTDEFINITION,aArguments);
- Reference<XNameContainer> xNameContainer(xNames,UNO_QUERY);
- if ( xNameContainer.is() )
- xNameContainer->insertByName(m_sBookmarkName,makeAny(xComponent));
- }
- }
- }
- catch(Exception&)
- {
- OSL_ENSURE(0,"convertLinks: Exception catched!");
- }
- m_sBookmarkName = ::rtl::OUString();
- m_sDocumentLocation = ::rtl::OUString();
- break;
- case COLUMN:
- if ( m_xCurrentColumn.is() )
- {
- setProperties(nElementType);
- Reference<XColumnsSupplier> xSupplier(m_xCurrentObject,UNO_QUERY);
- Reference<XAppend> xAppend(xSupplier->getColumns(),UNO_QUERY);
- if ( xAppend.is() )
- xAppend->appendByDescriptor(m_xCurrentColumn);
- m_xCurrentColumn = NULL;
- }
- break;
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::dropNode(
- const ::rtl::OUString& /*aName*/ )
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::overrideProperty(
- const ::rtl::OUString& aName,
- sal_Int16 /*aAttributes*/,
- const Type& /*aType*/,
- sal_Bool /*bClear*/ )
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
- m_bPropertyMayBeVoid = sal_True;
- if ( !m_aStack.empty() )
- {
- switch(m_aStack.top().second)
- {
- case DATASOURCE:
- {
- m_bPropertyMayBeVoid = sal_False;
- ::rtl::OUString sProp;
- if ( aName == CONFIGKEY_DBLINK_CONNECTURL )
- sProp = PROPERTY_URL;
- else if ( aName == CONFIGKEY_DBLINK_USER )
- sProp = PROPERTY_USER;
- else if ( aName == CONFIGKEY_DBLINK_TABLEFILTER )
- sProp = PROPERTY_TABLEFILTER;
- else if ( aName == CONFIGKEY_DBLINK_TABLETYEFILTER )
- sProp = PROPERTY_TABLETYPEFILTER;
- else if ( aName == CONFIGKEY_DBLINK_PASSWORDREQUIRED )
- sProp = PROPERTY_ISPASSWORDREQUIRED;
- else if ( aName == CONFIGKEY_DBLINK_SUPPRESSVERSIONCL )
- sProp = PROPERTY_SUPPRESSVERSIONCL;
- else if ( aName == CONFIGKEY_LAYOUTINFORMATION )
- sProp = PROPERTY_LAYOUTINFORMATION;
-
- if ( sProp.getLength() )
- {
- if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() )
- m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>()));
- sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength();
- m_aProperties[m_aStack.top().second].realloc(nPos+1);
- m_aProperties[m_aStack.top().second][nPos] = sProp;
- }
- else if ( aName == CONFIGKEY_DBLINK_LOGINTIMEOUT )
- m_aStack.push(TElementStack::value_type(aName,LOGINTIMEOUT));
- else
- m_aStack.push(TElementStack::value_type(aName,NO_PROP));
- }
- break;
- case QUERY:
- {
- m_bPropertyMayBeVoid = sal_False;
- ::rtl::OUString sProp;
- if ( aName == CONFIGKEY_QRYDESCR_COMMAND )
- sProp = PROPERTY_COMMAND;
- else if ( aName == CONFIGKEY_QRYDESCR_ESCAPE_PROCESSING )
- sProp = PROPERTY_ESCAPE_PROCESSING;
- else if ( aName == CONFIGKEY_QRYDESCR_UPDATE_TABLENAME )
- sProp = PROPERTY_UPDATE_TABLENAME;
- else if ( aName == CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME )
- sProp = PROPERTY_UPDATE_SCHEMANAME;
- else if ( aName == CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME )
- sProp = PROPERTY_UPDATE_CATALOGNAME;
- else if ( aName == CONFIGKEY_LAYOUTINFORMATION )
- sProp = PROPERTY_LAYOUTINFORMATION;
-
- if ( sProp.getLength() )
- {
- if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() )
- m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>()));
- sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength();
- m_aProperties[m_aStack.top().second].realloc(nPos+1);
- m_aProperties[m_aStack.top().second][nPos] = sProp;
- }
- else
- m_aStack.push(TElementStack::value_type(aName,NO_PROP));
- }
- break;
- case DATASETTINGS:
- {
- m_bPropertyMayBeVoid = sal_False;
- ::rtl::OUString sProp;
- if ( aName == CONFIGKEY_DEFSET_FILTER ) sProp = PROPERTY_FILTER;
- else if ( aName == CONFIGKEY_DEFSET_FONT_NAME ) sProp = PROPERTY_FONTNAME;
- else if ( aName == CONFIGKEY_DEFSET_ORDER ) sProp = PROPERTY_ORDER;
- else if ( aName == CONFIGKEY_DEFSET_APPLYFILTER ) sProp = PROPERTY_APPLYFILTER;
- else if ( aName == CONFIGKEY_DEFSET_ROW_HEIGHT ) { m_bPropertyMayBeVoid = true; sProp = PROPERTY_ROW_HEIGHT; }
- else if ( aName == CONFIGKEY_DEFSET_TEXTCOLOR ) { m_bPropertyMayBeVoid = true; sProp = PROPERTY_TEXTCOLOR; }
- else if ( aName == CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR ) { m_bPropertyMayBeVoid = true; sProp = PROPERTY_TEXTLINECOLOR; }
- else if ( aName == CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS ) sProp = PROPERTY_TEXTEMPHASIS;
- else if ( aName == CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF ) sProp = PROPERTY_TEXTRELIEF;
- // font
- else if ( aName == CONFIGKEY_DEFSET_FONT_HEIGHT ) sProp = PROPERTY_FONTHEIGHT;
- else if ( aName == CONFIGKEY_DEFSET_FONT_WIDTH ) sProp = PROPERTY_FONTWIDTH;
- else if ( aName == CONFIGKEY_DEFSET_FONT_STYLENAME ) sProp = PROPERTY_FONTSTYLENAME;
- else if ( aName == CONFIGKEY_DEFSET_FONT_FAMILY ) sProp = PROPERTY_FONTFAMILY;
- else if ( aName == CONFIGKEY_DEFSET_FONT_CHARSET ) sProp = PROPERTY_FONTCHARSET;
- else if ( aName == CONFIGKEY_DEFSET_FONT_PITCH ) sProp = PROPERTY_FONTPITCH;
- else if ( aName == CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH ) sProp = PROPERTY_FONTCHARWIDTH;
- else if ( aName == CONFIGKEY_DEFSET_FONT_WEIGHT ) sProp = PROPERTY_FONTWEIGHT;
- else if ( aName == CONFIGKEY_DEFSET_FONT_UNDERLINE ) sProp = PROPERTY_FONTUNDERLINE;
- else if ( aName == CONFIGKEY_DEFSET_FONT_STRIKEOUT ) sProp = PROPERTY_FONTSTRIKEOUT;
- else if ( aName == CONFIGKEY_DEFSET_FONT_ORIENTATION ) sProp = PROPERTY_FONTORIENTATION;
- else if ( aName == CONFIGKEY_DEFSET_FONT_KERNING ) sProp = PROPERTY_FONTKERNING;
- else if ( aName == CONFIGKEY_DEFSET_FONT_WORDLINEMODE ) sProp = PROPERTY_FONTWORDLINEMODE;
- else if ( aName == CONFIGKEY_DEFSET_FONT_TYPE ) sProp = PROPERTY_FONTTYPE;
- else if ( aName == CONFIGKEY_DEFSET_FONT_SLANT ) sProp = PROPERTY_FONTSLANT;
-
- if ( sProp.getLength() )
- {
- if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() )
- m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>()));
- sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength();
- m_aProperties[m_aStack.top().second].realloc(nPos+1);
- m_aProperties[m_aStack.top().second][nPos] = sProp;
- }
- else
- m_aStack.push(TElementStack::value_type(aName,NO_PROP));
- }
- break;
- case COLUMN:
- {
- ::rtl::OUString sProp;
- m_bPropertyMayBeVoid = sal_False;
- if ( aName == CONFIGKEY_COLUMN_ALIGNMENT ) {
- m_bPropertyMayBeVoid = true;
- sProp = PROPERTY_ALIGN;
- } else if ( aName == CONFIGKEY_COLUMN_WIDTH ) {
- m_bPropertyMayBeVoid = true;
- sProp = PROPERTY_WIDTH;
- } else if ( aName == CONFIGKEY_COLUMN_RELPOSITION ) {
- m_bPropertyMayBeVoid = true;
- sProp = PROPERTY_RELATIVEPOSITION;
- } else if ( aName == CONFIGKEY_COLUMN_HIDDEN ) {
- sProp = PROPERTY_HIDDEN;
- } else if ( aName == CONFIGKEY_COLUMN_HELPTEXT ) {
- m_bPropertyMayBeVoid = true;
- sProp = PROPERTY_HELPTEXT;
- } else if ( aName == CONFIGKEY_COLUMN_CONTROLDEFAULT ) {
- m_bPropertyMayBeVoid = true;
- sProp = PROPERTY_CONTROLDEFAULT;
- } else if ( aName == CONFIGKEY_COLUMN_NUMBERFORMAT ) {
- m_bPropertyMayBeVoid = true;
- sProp = PROPERTY_NUMBERFORMAT;
- }
-
-
- if ( sProp.getLength() )
- {
- if ( m_aProperties.find(m_aStack.top().second) == m_aProperties.end() )
- m_aProperties.insert(::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< ::rtl::OUString>()));
- sal_Int32 nPos = m_aProperties[m_aStack.top().second].getLength();
- m_aProperties[m_aStack.top().second].realloc(nPos+1);
- m_aProperties[m_aStack.top().second][nPos] = sProp;
- }
- else
- m_aStack.push(TElementStack::value_type(aName,NO_PROP));
- }
- break;
- case BOOKMARK:
- break;
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::setPropertyValue(
- const Any& aValue )
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
- if ( !m_aStack.empty() )
- {
- switch(m_aStack.top().second)
- {
- case LOGINTIMEOUT:
- {
- Reference< ::com::sun::star::sdbc::XDataSource> xDataSource(m_xCurrentDS,UNO_QUERY);
- sal_Int32 nTimeOut = 0;
- aValue >>= nTimeOut;
- if ( xDataSource.is() && nTimeOut >= 0 )
- xDataSource->setLoginTimeout(nTimeOut);
- m_aStack.pop();
- }
- break;
- case DATASOURCESETTING:
- OSL_ENSURE(!m_aDataSourceSettings.empty(),"Settings are emtpy!");
- if ( aValue.hasValue() )
- m_aDataSourceSettings.rbegin()->Value = aValue;
- else
- m_aDataSourceSettings.pop_back();
- break;
- case BOOKMARK:
- aValue >>= m_sDocumentLocation;
- break;
- case NO_PROP:
- m_aStack.pop();
- break;
- default:
- OSL_ENSURE(m_aProperties[m_aStack.top().second].getLength(),"Properties are zero!");
- if ( m_aProperties[m_aStack.top().second].getLength() )
- {
- if ( m_aProperties[m_aStack.top().second][m_aProperties[m_aStack.top().second].getLength()-1] != PROPERTY_LAYOUTINFORMATION )
- {
- if ( !m_bPropertyMayBeVoid && !aValue.hasValue() )
- {
- m_aProperties[m_aStack.top().second].realloc(m_aProperties[m_aStack.top().second].getLength()-1);
- }
- else
- {
- if ( m_aValues.find(m_aStack.top().second) == m_aValues.end() )
- m_aValues.insert(::std::map< sal_Int16 ,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>()));
- sal_Int32 nPos = m_aValues[m_aStack.top().second].getLength();
- m_aValues[m_aStack.top().second].realloc(nPos+1);
- m_aValues[m_aStack.top().second][nPos] = aValue;
- }
- }
- else
- {
- try
- {
- Sequence< sal_Int8 > aInputSequence;
- aValue >>= aInputSequence;
- if ( m_aValues.find(m_aStack.top().second) == m_aValues.end() )
- m_aValues.insert(::std::map< sal_Int16 ,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>()));
- sal_Int32 nPos = m_aValues[m_aStack.top().second].getLength();
- m_aValues[m_aStack.top().second].realloc(nPos+1);
- Sequence< PropertyValue > aLayout;
- if ( aInputSequence.getLength() )
- {
- Reference< XInputStream> xInStreamHelper = new SequenceInputStream(aInputSequence);; // used for wrapping sequence to xinput
- Reference< XObjectInputStream> xInStream = Reference< XObjectInputStream >(m_xORB->createInstance(::rtl::OUString::createFromAscii("com.sun.star.io.ObjectInputStream")),UNO_QUERY);
- Reference< XInputStream> xMarkInStream = Reference< XInputStream >(m_xORB->createInstance(::rtl::OUString::createFromAscii("com.sun.star.io.MarkableInputStream")),UNO_QUERY);
- Reference< XActiveDataSink >(xMarkInStream,UNO_QUERY)->setInputStream(xInStreamHelper);
- Reference< XActiveDataSink > xInDataSource(xInStream, UNO_QUERY);
- OSL_ENSURE(xInDataSource.is(),"Couldn't create com.sun.star.io.ObjectInputStream!");
- xInDataSource->setInputStream(xMarkInStream);
-
- if ( DATASOURCE == m_aStack.top().second )
- LoadTableWindows(xInStream,aLayout);
- else if ( QUERY == m_aStack.top().second )
- LoadTableFields(xInStream,aLayout);
- }
- m_aValues[m_aStack.top().second][nPos] <<= aLayout;
- }
- catch(const Exception& e)
- {
- throw WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property could not be set.")),*this,makeAny(e));
- }
- }
- }
- break;
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::setPropertyValueForLocale(
- const Any& /*aValue*/,
- const ::rtl::OUString& /*aLocale*/ )
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::endProperty()
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::addProperty(
- const rtl::OUString& /*aName*/,
- sal_Int16 /*aAttributes*/,
- const Type& /*aType*/ )
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL OCfgImport::addPropertyWithValue(
- const rtl::OUString& /*aName*/,
- sal_Int16 /*aAttributes*/,
- const Any& /*aValue*/ )
- throw(
- MalformedDataException,
- WrappedTargetException )
-{
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// }// dbacfg
-// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/filter/migration/cfgimport.hxx b/dbaccess/source/filter/migration/cfgimport.hxx
deleted file mode 100644
index ff2926944dca..000000000000
--- a/dbaccess/source/filter/migration/cfgimport.hxx
+++ /dev/null
@@ -1,223 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CFG_CFGIMPORT_HXX
-#define CFG_CFGIMPORT_HXX
-
-#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
-#include <com/sun/star/lang/XInitialization.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
-#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
-#include <com/sun/star/frame/XModel.hpp>
-#endif
-#ifndef _COM_SUN_STAR_TASK_XJOB_HPP_
-#include <com/sun/star/task/XJob.hpp>
-#endif
-#ifndef _OSL_DIAGNOSE_H_
-#include <osl/diagnose.h>
-#endif
-#ifndef _DBASHARED_APITOOLS_HXX_
-#include "apitools.hxx"
-#endif
-#ifndef _COMPHELPER_STLTYPES_HXX_
-#include <comphelper/stl_types.hxx>
-#endif
-#ifndef _CPPUHELPER_IMPLBASE4_HXX_
-#include <cppuhelper/implbase4.hxx>
-#endif
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERHANDLER_HPP_
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYER_HPP_
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#endif
-
-#include <memory>
-#include <stack>
-
-namespace dbacfg
-{
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::frame;
-
-typedef ::cppu::WeakImplHelper4 < ::com::sun::star::lang::XServiceInfo
- , ::com::sun::star::lang::XInitialization
- , ::com::sun::star::task::XJob
- , ::com::sun::star::configuration::backend::XLayerHandler
- > OCfgImport_COMPBASE;
-// -------------
-// - OCfgImport -
-// -------------
-class OCfgImport : public OCfgImport_COMPBASE
-{
-private:
- typedef ::std::pair< ::rtl::OUString, sal_Int16> TElementType;
- typedef ::std::stack< TElementType > TElementStack;
- typedef ::std::vector< PropertyValue > TDataSourceSettings;
-
- Reference< XMultiServiceFactory > m_xORB;
- Reference< XMultiServiceFactory > m_xOldORB;
- Reference< ::com::sun::star::configuration::backend::XLayer> m_xLayer;
- Reference<XPropertySet> m_xCurrentDS;
- Reference<XModel> m_xModel;
- Reference<XPropertySet> m_xCurrentObject; /// can either be a query or a table
- Reference<XPropertySet> m_xCurrentColumn;
- ::std::map< sal_Int16 ,Sequence< ::rtl::OUString> > m_aProperties;
- ::std::map< sal_Int16 ,Sequence< Any> > m_aValues;
- ::rtl::OUString m_sCurrentDataSourceName;
- ::rtl::OUString m_sBookmarkName;
- ::rtl::OUString m_sDocumentLocation;
-
- TElementStack m_aStack;
- TDataSourceSettings m_aDataSourceSettings;
- sal_Bool m_bPropertyMayBeVoid;
-
- /** convert the old configuration settings into new database documents.
- */
- void convert();
- void createDataSource(const ::rtl::OUString& _sName);
- void createObject(sal_Bool _bQuery ,const ::rtl::OUString& _sName);
- void setProperties(sal_Int16 _eType);
-
-protected:
- virtual ~OCfgImport() throw();
-public:
-
- OCfgImport( const Reference< XMultiServiceFactory >& _rxMSF );
-
-
- // XServiceInfo
- DECLARE_SERVICE_INFO_STATIC( );
-
- inline Reference< XMultiServiceFactory > getORB() const { return m_xORB; }
-
- // lang::XInitialization
- virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException);
- // task::XJob
- virtual ::com::sun::star::uno::Any SAL_CALL execute( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XLayerHandler
- virtual void SAL_CALL startLayer()
- throw(::com::sun::star::lang::WrappedTargetException);
-
- virtual void SAL_CALL endLayer()
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL overrideNode(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- sal_Bool bClear)
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addOrReplaceNode(
- const rtl::OUString& aName,
- sal_Int16 aAttributes)
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addOrReplaceNodeFromTemplate(
- const rtl::OUString& aName,
- const ::com::sun::star::configuration::backend::TemplateIdentifier& aTemplate,
- sal_Int16 aAttributes )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL endNode()
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL dropNode(
- const rtl::OUString& aName )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL overrideProperty(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- const Type& aType,
- sal_Bool bClear )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL setPropertyValue(
- const Any& aValue )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL setPropertyValueForLocale(
- const Any& aValue,
- const rtl::OUString& aLocale )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL endProperty()
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addProperty(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- const Type& aType )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addPropertyWithValue(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- const Any& aValue )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-};
-// -----------------------------------------------------------------------------
-} // dbacfg
-// -----------------------------------------------------------------------------
-#endif // CFG_CFGIMPORT_HXX
diff --git a/dbaccess/source/filter/migration/cfgservices.cxx b/dbaccess/source/filter/migration/cfgservices.cxx
deleted file mode 100644
index 054f013eb51f..000000000000
--- a/dbaccess/source/filter/migration/cfgservices.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_dbaccess.hxx"
-
-#ifndef _CPPUHELPER_FACTORY_HXX_
-#include <cppuhelper/factory.hxx>
-#endif
-#ifndef _OSL_DIAGNOSE_H_
-#include <osl/diagnose.h>
-#endif
-#ifndef CFG_REGHELPER_HXX
-#include "cfg_reghelper.hxx"
-#endif
-
-
-/********************************************************************************************/
-
-using namespace ::dbacfg;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
-
-//***************************************************************************************
-//
-// registry functions
-extern "C" void SAL_CALL createRegistryInfo_OCfgImport();
-
-//***************************************************************************************
-extern "C" void SAL_CALL createRegistryInfo_dbacfg()
-{
- static sal_Bool bInit = sal_False;
- if (!bInit)
- {
- createRegistryInfo_OCfgImport();
- bInit = sal_True;
- }
-}
-
-//---------------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment **
- )
-{
- createRegistryInfo_dbacfg();
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-//---------------------------------------------------------------------------------------
-extern "C" void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- Reference< XInterface > xRet;
- if (pServiceManager && pImplementationName)
- {
- xRet = ::dbacfg::OModuleRegistration::getComponentFactory(
- ::rtl::OUString::createFromAscii(pImplementationName),
- static_cast< XMultiServiceFactory* >(pServiceManager));
- }
-
- if (xRet.is())
- xRet->acquire();
- return xRet.get();
-};
-
diff --git a/dbaccess/source/filter/migration/dbacfg.component b/dbaccess/source/filter/migration/dbacfg.component
deleted file mode 100644
index 65e92d0f5394..000000000000
--- a/dbaccess/source/filter/migration/dbacfg.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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.sdb.DataSourceMigration">
- <service name="com.sun.star.sdb.DataSourceMigration"/>
- </implementation>
-</component>
diff --git a/dbaccess/source/filter/migration/makefile.mk b/dbaccess/source/filter/migration/makefile.mk
deleted file mode 100644
index 3a8a37e07ac7..000000000000
--- a/dbaccess/source/filter/migration/makefile.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-PRJINC=$(PRJ)$/source
-PRJNAME=dbaccess
-TARGET=dbacfg
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files -------------------------------------
-
-SLOFILES= $(SLO)$/cfgimport.obj \
- $(SLO)$/cfgservices.obj
-
-# --- Library -----------------------------------
-LIB1TARGET=$(SLB)$/dba_cfg.lib
-LIB1FILES=\
- $(SLB)$/cfgshared.lib \
- $(SLB)$/$(TARGET).lib
-
-SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
-
-SHL1STDLIBS=\
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SFXLIB) \
- $(SVLLIB) \
- $(SALLIB)
-
-
-SHL1DEPN=
-SHL1LIBS=$(LIB1TARGET)
-SHL1IMPLIB= i$(SHL1TARGET)
-# SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME=$(SHL1TARGET)
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
-ALLTAR : $(MISC)/dbacfg.component
-
-$(MISC)/dbacfg.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- dbacfg.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt dbacfg.component
diff --git a/dbaccess/source/inc/cfgstrings.hrc b/dbaccess/source/inc/cfgstrings.hrc
deleted file mode 100644
index 82f46a60a96e..000000000000
--- a/dbaccess/source/inc/cfgstrings.hrc
+++ /dev/null
@@ -1,99 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef DBACCESS_SHARED_CFGSTRINGS_HRC
-#define DBACCESS_SHARED_CFGSTRINGS_HRC
-
-#ifndef _RTL_USTRING_HXX_
-#include <rtl/ustring.hxx>
-#endif
-
-namespace dbacfg
-{
-#define STRINGCONSTANTS_INCLUDED_INDIRECT
-#include "stringconstants.hrc"
-#undef STRINGCONSTANTS_INCLUDED_INDIRECT
-
- //============================================================
- //= configuration key names
- //============================================================
- // (we could use PROPERTY_* strings for this, but this would mean that
- // our configuration scheme would change if a property name changes for
- // any reason)
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_CONNECTURL);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_USER);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLEFILTER);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLETYEFILTER);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_LOGINTIMEOUT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_PASSWORDREQUIRED);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_SUPPRESSVERSIONCL);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_BOOKMARKS);
-
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COMMAND);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_ESCAPE_PROCESSING);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_TABLENAME);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COLUMNS);
-
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FILTER);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_APPLYFILTER);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ORDER);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ROW_HEIGHT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_TEXTCOLOR);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_NAME);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_HEIGHT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WIDTH);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STYLENAME);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_FAMILY);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARSET);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_PITCH);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WEIGHT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_SLANT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINE);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STRIKEOUT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ORIENTATION);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_KERNING);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WORDLINEMODE);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_TYPE);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF);
-
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_SETTINGS);
-
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_ALIGNMENT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_WIDTH);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_NUMBERFORMAT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_RELPOSITION);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HIDDEN);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_LAYOUTINFORMATION);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HELPTEXT);
- DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_CONTROLDEFAULT);
-}
-
-#endif // DBACCESS_SHARED_CFGSTRINGS_HRC
diff --git a/dbaccess/source/shared/cfgstrings.cxx b/dbaccess/source/shared/cfgstrings.cxx
deleted file mode 100644
index ee0bc9ff403e..000000000000
--- a/dbaccess/source/shared/cfgstrings.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_dbaccess.hxx"
-#include "cfgstrings.hrc"
-
-namespace dbacfg
-{
-#include "stringconstants.inc"
-
- //============================================================
- //= configuration key names
- //============================================================
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_CONNECTURL, "URL");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_USER, "User");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLEFILTER, "TableFilter");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLETYEFILTER, "TableTypeFilter");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_LOGINTIMEOUT, "LoginTimeout");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_PASSWORDREQUIRED, "IsPasswordRequired");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_SUPPRESSVERSIONCL, "SuppressVersionColumns");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_BOOKMARKS, "Bookmarks");
-
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COMMAND, "Command");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_ESCAPE_PROCESSING, "EscapeProcessing");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_TABLENAME, "UpdateTableName");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME, "UpdateSchemaName");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME, "UpdateCatalogName");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COLUMNS, "Columns");
-
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_SETTINGS, "Settings");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FILTER, "Filter");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_APPLYFILTER, "ApplyFilter");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ORDER, "Order");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ROW_HEIGHT, "RowHeight");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_LAYOUTINFORMATION, "LayoutInformation");
-
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_TEXTCOLOR, "TextColor");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_NAME, "Font/Name");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_HEIGHT, "Font/Height");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WIDTH, "Font/Width");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STYLENAME, "Font/StyleName");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_FAMILY, "Font/Family");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARSET, "Font/CharSet");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_PITCH, "Font/Pitch");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH, "Font/CharacterWidth");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WEIGHT, "Font/Weight");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_SLANT, "Font/Slant");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINE, "Font/UnderLine");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STRIKEOUT, "Font/Strikeout");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ORIENTATION, "Font/Orientation");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_KERNING, "Font/Kerning");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WORDLINEMODE, "Font/WordLineMode");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_TYPE, "Font/Type");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINECOLOR, "TextLineColor");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTEREMPHASIS, "CharacterEmphasis");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERRELIEF, "CharacterRelief");
-
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_ALIGNMENT, "Align");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_WIDTH, "Width");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_NUMBERFORMAT, "FormatKey");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_RELPOSITION, "Position");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HIDDEN, "Hidden");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HELPTEXT, "HelpText");
- IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_CONTROLDEFAULT, "ControlDefault");
-}
-
diff --git a/dbaccess/source/shared/makefile.mk b/dbaccess/source/shared/makefile.mk
index cbb3686c4a5c..5f75c13f9816 100644
--- a/dbaccess/source/shared/makefile.mk
+++ b/dbaccess/source/shared/makefile.mk
@@ -32,7 +32,6 @@ LIBTARGET=NO
TARGET=shared
LIB1TARGET=$(SLB)$/dbushared.lib
LIB2TARGET=$(SLB)$/fltshared.lib
-LIB3TARGET=$(SLB)$/cfgshared.lib
LIB4TARGET=$(SLB)$/sdbtshared.lib
#ENABLE_EXCEPTIONS=TRUE
@@ -46,12 +45,10 @@ LIB4TARGET=$(SLB)$/sdbtshared.lib
# --- Files -------------------------------------
EXCEPTIONSFILES= \
$(SLO)$/dbu_reghelper.obj \
- $(SLO)$/cfg_reghelper.obj \
$(SLO)$/flt_reghelper.obj
SLOFILES= \
$(EXCEPTIONSFILES) \
- $(SLO)$/cfgstrings.obj \
$(SLO)$/xmlstrings.obj \
$(SLO)$/dbustrings.obj
@@ -63,10 +60,6 @@ LIB2OBJFILES= \
$(SLO)$/flt_reghelper.obj \
$(SLO)$/xmlstrings.obj
-LIB3OBJFILES= \
- $(SLO)$/cfg_reghelper.obj \
- $(SLO)$/cfgstrings.obj
-
LIB4OBJFILES= \
$(SLO)$/sdbtstrings.obj
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 595d9b412851..f624853c8852 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -482,10 +482,6 @@ sal_Bool OApplicationController::Construct(Window* _pParent)
return sal_False;
}
- DBG_ASSERT( getView(), "OApplicationController::Construct: have no view!" );
- if ( getView() )
- getView()->enableSeparator( );
-
// now that we have a view we can create the clipboard listener
m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() );
m_aSystemClipboard.StartClipboardListening( );
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 6a2161b1c291..103267154da0 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -737,6 +737,26 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r
if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING)))
xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser;
+ {
+ const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY );
+ const Reference< XSingleSelectQueryAnalyzer > xAnalyzer( xRowSetProps->getPropertyValue( PROPERTY_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY );
+ if ( xAnalyzer.is() )
+ {
+ const Reference< XIndexAccess > xOrderColumns( xAnalyzer->getOrderColumns(), UNO_SET_THROW );
+ const sal_Int32 nOrderColumns( xOrderColumns->getCount() );
+ for ( sal_Int32 c=0; c<nOrderColumns; ++c )
+ {
+ const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW );
+ ::rtl::OUString sColumnName;
+ OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName);
+ ::rtl::OUString sTableName;
+ OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName);
+ (void)sColumnName;
+ (void)sTableName;
+ }
+ }
+ }
+
Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY );
if ( xWarnings.is() )
{
@@ -807,7 +827,8 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent)
m_xColumnsSupplier.set(m_xRowSet,UNO_QUERY);
m_xLoadable.set(m_xRowSet,UNO_QUERY);
- if (!InitializeForm(m_xRowSet))
+ Reference< XPropertySet > xFormProperties( m_xRowSet, UNO_QUERY );
+ if ( !InitializeForm( xFormProperties ) )
return sal_False;
m_xGridModel = CreateGridModel();
@@ -1205,34 +1226,16 @@ void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt) t
}
- // the filter or the sort criterias have changed ? -> update our parser
- if (evt.PropertyName.equals(PROPERTY_ACTIVECOMMAND))
- {
- // if (m_xParser.is())
- //DO_SAFE( m_xParser->setElementaryQuery(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new query to my parser !" );
- }
- else if (evt.PropertyName.equals(PROPERTY_FILTER))
+ if (evt.PropertyName.equals(PROPERTY_FILTER))
{
- // if ( m_xParser.is() && m_xParser->getFilter() != ::comphelper::getString(evt.NewValue))
- //{
- // DO_SAFE( m_xParser->setFilter(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" );
- //}
InvalidateFeature(ID_BROWSER_REMOVEFILTER);
}
else if (evt.PropertyName.equals(PROPERTY_HAVING_CLAUSE))
{
- //if ( m_xParser.is() && m_xParser->getHavingClause() != ::comphelper::getString(evt.NewValue))
- //{
- // DO_SAFE( m_xParser->setHavingClause(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" );
- //}
InvalidateFeature(ID_BROWSER_REMOVEFILTER);
}
else if (evt.PropertyName.equals(PROPERTY_ORDER))
{
- //if ( m_xParser.is() && m_xParser->getOrder() != ::comphelper::getString(evt.NewValue))
- //{
- // DO_SAFE( m_xParser->setOrder(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new order to my parser !" );
- //}
InvalidateFeature(ID_BROWSER_REMOVEFILTER);
}
@@ -1871,25 +1874,50 @@ void SbaXDataBrowserController::applyParserFilter(const ::rtl::OUString& _rOldFi
setCurrentColumnPosition(nPos);
}
+
//------------------------------------------------------------------------------
Reference< XSingleSelectQueryComposer > SbaXDataBrowserController::createParser_nothrow()
{
- Reference< XSingleSelectQueryComposer > xRet;
+ Reference< XSingleSelectQueryComposer > xComposer;
try
{
- Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY_THROW);
- const Reference<XMultiServiceFactory> xFactory(::dbtools::getConnection(getRowSet()),UNO_QUERY_THROW);
- xRet.set(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY_THROW);
- xRet->setElementaryQuery(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ACTIVECOMMAND)));
- xRet->setFilter(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_FILTER)));
- xRet->setHavingClause(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_HAVING_CLAUSE)));
- xRet->setOrder(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ORDER)));
+ const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
+ const Reference< XMultiServiceFactory > xFactory(
+ xRowSetProps->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ), UNO_QUERY_THROW );
+ xComposer.set( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW );
+
+ ::rtl::OUString sActiveCommand;
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sActiveCommand );
+ if ( sActiveCommand.getLength() > 0 )
+ {
+ xComposer->setElementaryQuery( sActiveCommand );
+ }
+ else
+ {
+ ::rtl::OUString sCommand;
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand );
+ sal_Int32 nCommandType = CommandType::COMMAND;
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND_TYPE ) >>= nCommandType );
+ xComposer->setCommand( sCommand, nCommandType );
+ }
+
+ ::rtl::OUString sFilter;
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_FILTER ) >>= sFilter );
+ xComposer->setFilter( sFilter );
+
+ ::rtl::OUString sHavingClause;
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_HAVING_CLAUSE ) >>= sHavingClause );
+ xComposer->setHavingClause( sHavingClause );
+
+ ::rtl::OUString sOrder;
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ORDER ) >>= sOrder );
+ xComposer->setOrder( sOrder );
}
- catch(Exception&)
+ catch ( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
- return xRet;
+ return xComposer;
}
//------------------------------------------------------------------------------
void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter)
@@ -1911,12 +1939,8 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter)
{
DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() );
String aFilter;
- if(!aDlg.Execute())
- {
- //m_xParser->setFilter(sOldVal);
- //m_xParser->setHavingClause(sOldHaving);
- return; // if so we don't need to actualize the grid
- }
+ if ( !aDlg.Execute() )
+ return; // if so we don't need to update the grid
aDlg.BuildWherePart();
}
else
@@ -1925,7 +1949,6 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter)
String aOrder;
if(!aDlg.Execute())
{
- //m_xParser->setOrder(sOldVal);
return; // if so we don't need to actualize the grid
}
aDlg.BuildOrderPart();
@@ -2707,22 +2730,7 @@ void SbaXDataBrowserController::initializeParser() const
{ // (only if the statement isn't native)
// (it is allowed to use the PROPERTY_ISPASSTHROUGH : _after_ loading a form it is valid)
xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser;
-/*
- const Reference<XMultiServiceFactory> xFactory(::dbtools::getConnection(getRowSet()),UNO_QUERY);
- if ( xFactory.is() )
- m_xParser.set(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY);
-*/
}
-/*
- // initialize the parser with the current sql-statement of the form
- if ( m_xParser.is() )
- {
- m_xParser->setElementaryQuery(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ACTIVECOMMAND)));
- m_xParser->setFilter(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_FILTER)));
- m_xParser->setHavingClause(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_HAVING_CLAUSE)));
- m_xParser->setOrder(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ORDER)));
- }
-*/
}
catch(Exception&)
{
@@ -2758,16 +2766,6 @@ void SbaXDataBrowserController::unloaded(const EventObject& /*aEvent*/) throw( R
// change as a reaction on that event. as we have no chance to be notified of this change (which is
// the one we're interested in) we give them time to do what they want to before invalidating our
// bound-field-dependent slots ....
- /*
- try
- {
- ::comphelper::disposeComponent(m_xParser);
- }
- catch(Exception&)
- {
- OSL_ENSURE(0,"Exception thrown by dispose");
- }
- */
}
//------------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx
index 382aac477727..8112250ad23e 100644
--- a/dbaccess/source/ui/browser/dataview.cxx
+++ b/dbaccess/source/ui/browser/dataview.cxx
@@ -44,9 +44,6 @@
#ifndef _SFXIMGMGR_HXX
#include <sfx2/imgmgr.hxx>
#endif
-#ifndef _SV_FIXED_HXX
-#include <vcl/fixed.hxx>
-#endif
#ifndef DBAUI_ICONTROLLER_HXX
#include "IController.hxx"
#endif
@@ -103,11 +100,12 @@ namespace dbaui
:Window(pParent,nStyle)
,m_xServiceFactory(_rFactory)
,m_rController( _rController )
- ,m_pSeparator( NULL )
+ ,m_aSeparator( this )
{
DBG_CTOR(ODataView,NULL);
m_rController.acquire();
m_pAccel.reset(::svt::AcceleratorExecute::createAcceleratorHelper());
+ m_aSeparator.Show();
}
// -------------------------------------------------------------------------
@@ -120,30 +118,10 @@ namespace dbaui
{
DBG_DTOR(ODataView,NULL);
- enableSeparator( sal_False );
m_rController.release();
}
// -------------------------------------------------------------------------
- void ODataView::enableSeparator( const sal_Bool _bEnable )
- {
- if ( _bEnable == isSeparatorEnabled() )
- // nothing to do
- return;
-
- if ( _bEnable )
- {
- m_pSeparator = new FixedLine( this );
- m_pSeparator->Show( );
- }
- else
- {
- ::std::auto_ptr<FixedLine> aTemp(m_pSeparator);
- m_pSeparator = NULL;
- }
- Resize();
- }
- // -------------------------------------------------------------------------
void ODataView::resizeDocumentView( Rectangle& /*_rPlayground*/ )
{
}
@@ -167,15 +145,10 @@ namespace dbaui
{
Rectangle aPlayground( _rPlayground );
- // position thew separator
- if ( m_pSeparator )
- {
- Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 );
-
- m_pSeparator->SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize );
-
- aPlayground.Top() += aSeparatorSize.Height() + 1;
- }
+ // position the separator
+ const Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 );
+ m_aSeparator.SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize );
+ aPlayground.Top() += aSeparatorSize.Height() + 1;
// position the controls of the document's view
resizeDocumentView( aPlayground );
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index 41200c7625ec..ba40583141ab 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -145,7 +145,7 @@ Reference< XRowSet > SbaExternalSourceBrowser::CreateForm()
}
//------------------------------------------------------------------------------
-sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XRowSet > & /*xForm*/)
+sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XPropertySet > & /*i_formProperties*/)
{
return sal_True;
}
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index b81b073a56bf..0c0190318c72 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -704,6 +704,18 @@ void OGenericUnoController::InvalidateFeature_Impl()
// -----------------------------------------------------------------------
void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, sal_Bool _bForceBroadcast )
{
+#if OSL_DEBUG_LEVEL > 0
+ if ( _nId != -1 )
+ {
+ SupportedFeatures::iterator aFeaturePos = ::std::find_if(
+ m_aSupportedFeatures.begin(),
+ m_aSupportedFeatures.end(),
+ ::std::bind2nd( CompareFeatureById(), _nId )
+ );
+ OSL_ENSURE( aFeaturePos != m_aSupportedFeatures.end(), "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" );
+ }
+#endif
+
FeatureListener aListener;
aListener.nId = _nId;
aListener.xListener = _xListener;
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index c65055c582fc..d15fb125f234 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -67,6 +67,7 @@
#include <com/sun/star/form/XForm.hpp>
#include <com/sun/star/form/XGridColumnFactory.hpp>
#include <com/sun/star/form/XLoadable.hpp>
+#include <com/sun/star/form/XReset.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
@@ -419,8 +420,146 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent)
return sal_True;
}
-// -------------------------------------------------------------------------
-sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star::sdbc::XRowSet > & _rxForm)
+// ---------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ // -----------------------------------------------------------------------------------------------------------------
+ struct SelectValueByName : public ::std::unary_function< ::rtl::OUString, Any >
+ {
+ const Any& operator()( ::rtl::OUString const& i_name ) const
+ {
+ return m_rCollection.get( i_name );
+ }
+
+ SelectValueByName( ::comphelper::NamedValueCollection const& i_collection )
+ :m_rCollection( i_collection )
+ {
+ }
+
+ ::comphelper::NamedValueCollection const& m_rCollection;
+ };
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow()
+{
+ try
+ {
+ Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
+ sal_Bool bEscapeProcessing = sal_False;
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ESCAPE_PROCESSING ) >>= bEscapeProcessing );
+ if ( !bEscapeProcessing )
+ // don't touch or interpret anything if escape processing is disabled
+ return;
+
+ Reference< XSingleSelectQueryComposer > xComposer( createParser_nothrow() );
+ if ( !xComposer.is() )
+ // can't do anything. Already reported via assertion in createParser_nothrow.
+ return;
+
+ // the tables participating in the statement
+ const Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW );
+ const Reference< XNameAccess > xTableNames( xSuppTables->getTables(), UNO_QUERY_THROW );
+
+ // the columns participating in the statement
+ const Reference< XColumnsSupplier > xSuppColumns( xComposer, UNO_QUERY_THROW );
+ const Reference< XNameAccess > xColumnNames( xSuppColumns->getColumns(), UNO_QUERY_THROW );
+
+ // .............................................................................................................
+ // check if the order columns apply to tables which really exist in the statement
+ const Reference< XIndexAccess > xOrderColumns( xComposer->getOrderColumns(), UNO_SET_THROW );
+ const sal_Int32 nOrderColumns( xOrderColumns->getCount() );
+ bool invalidColumn = false;
+ for ( sal_Int32 c=0; ( c < nOrderColumns ) && !invalidColumn; ++c )
+ {
+ const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW );
+ ::rtl::OUString sTableName;
+ OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName );
+ ::rtl::OUString sColumnName;
+ OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName );
+
+ if ( sTableName.getLength() == 0 )
+ {
+ if ( !xColumnNames->hasByName( sColumnName ) )
+ {
+ invalidColumn = true;
+ break;
+ }
+ }
+ else
+ {
+ if ( !xTableNames->hasByName( sTableName ) )
+ {
+ invalidColumn = true;
+ break;
+ }
+
+ const Reference< XColumnsSupplier > xSuppTableColumns( xTableNames->getByName( sTableName ), UNO_QUERY_THROW );
+ const Reference< XNameAccess > xTableColumnNames( xSuppTableColumns->getColumns(), UNO_QUERY_THROW );
+ if ( !xTableColumnNames->hasByName( sColumnName ) )
+ {
+ invalidColumn = true;
+ break;
+ }
+ }
+ }
+
+ if ( invalidColumn )
+ {
+ // reset the complete order statement at both the row set and the parser
+ const ::rtl::OUString sEmptyOrder;
+ xRowSetProps->setPropertyValue( PROPERTY_ORDER, makeAny( sEmptyOrder ) );
+ xComposer->setOrder( sEmptyOrder );
+ }
+
+ // .............................................................................................................
+ // check if the columns participating in the filter refer to existing tables
+ // TODO: there's no API at all for this. The method which comes nearest to what we need is
+ // "getStructuredFilter", but it returns pure column names only. That is, for a statement like
+ // "SELECT * FROM <table> WHERE <other_table>.<column> = <value>", it will return "<column>". But
+ // there's no API at all to retrieve the information about "<other_table>" - which is what would
+ // be needed here.
+ // That'd be a chance to replace getStructuredFilter with something more reasonable. This method
+ // has at least one other problem: For a clause like "<column> != <value>", it will return "<column>"
+ // as column name, "NOT_EQUAL" as operator, and "!= <value>" as value, effectively duplicating the
+ // information about the operator, and beding all clients to manually remove the "!=" from the value
+ // string.
+ // So, what really would be handy, is some
+ // XNormalizedFilter getNormalizedFilter();
+ // with
+ // interface XDisjunctiveFilterExpression
+ // {
+ // XConjunctiveFilterTerm getTerm( int index );
+ // }
+ // interface XConjunctiveFilterTerm
+ // {
+ // ComparisonPredicate getPredicate( int index );
+ // }
+ // struct ComparisonPredicate
+ // {
+ // XComparisonOperand Lhs;
+ // SQLFilterOperator Operator;
+ // XComparisonOperand Rhs;
+ // }
+ // interface XComparisonOperand
+ // {
+ // SQLFilterOperand Type;
+ // XPropertySet getColumn();
+ // string getLiteral();
+ // ...
+ // }
+ // enum SQLFilterOperand { Column, Literal, ... }
+ //
+ // ... or something like this ....
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_formProperties )
{
if(!m_pCurrentlyDisplayed)
return sal_True;
@@ -428,50 +567,46 @@ sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star:
// this method set all format settings from the orignal table or query
try
{
- // we send all properties at once, maybe the implementation is clever enough to handle one big PropertiesChanged
- // more effective than many small PropertyChanged ;)
- Sequence< ::rtl::OUString> aProperties(3);
- Sequence< Any> aValues(3);
-
DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData());
- OSL_ENSURE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" );
- OSL_ENSURE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" );
+ ENSURE_OR_RETURN_FALSE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" );
+ ENSURE_OR_RETURN_FALSE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" );
+
+ Reference< XPropertySetInfo > xPSI( pData->xObjectProperties->getPropertySetInfo(), UNO_SET_THROW );
+
+ ::comphelper::NamedValueCollection aPropertyValues;
- if ( pData->xObjectProperties.is() )
+ const ::rtl::OUString aTransferProperties[] =
{
- sal_Int32 nPos = 0;
- // is the filter intially applied ?
- aProperties.getArray()[nPos] = PROPERTY_APPLYFILTER;
- aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_APPLYFILTER);
+ PROPERTY_APPLYFILTER,
+ PROPERTY_FILTER,
+ PROPERTY_HAVING_CLAUSE,
+ PROPERTY_ORDER
+ };
+ for ( size_t i=0; i < sizeof( aTransferProperties ) / sizeof( aTransferProperties[0] ); ++i )
+ {
+ if ( !xPSI->hasPropertyByName( aTransferProperties[i] ) )
+ continue;
+ aPropertyValues.put( aTransferProperties[i], pData->xObjectProperties->getPropertyValue( aTransferProperties[i] ) );
+ }
- // the initial filter
- aProperties.getArray()[nPos] = PROPERTY_FILTER;
- aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_FILTER);
+ const ::std::vector< ::rtl::OUString > aNames( aPropertyValues.getNames() );
+ Sequence< ::rtl::OUString > aPropNames( aNames.size() );
+ ::std::copy( aNames.begin(), aNames.end(), aPropNames.getArray() );
- if ( pData->xObjectProperties->getPropertySetInfo()->hasPropertyByName(PROPERTY_HAVING_CLAUSE) )
- {
- aProperties.realloc(aProperties.getLength()+1);
- aValues.realloc(aValues.getLength()+1);
- // the initial having clause
- aProperties.getArray()[nPos] = PROPERTY_HAVING_CLAUSE;
- aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_HAVING_CLAUSE);
- }
+ Sequence< Any > aPropValues( aNames.size() );
+ ::std::transform( aNames.begin(), aNames.end(), aPropValues.getArray(), SelectValueByName( aPropertyValues ) );
- // the initial ordering
- aProperties.getArray()[nPos] = PROPERTY_ORDER;
- aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_ORDER);
+ Reference< XMultiPropertySet > xFormMultiSet( i_formProperties, UNO_QUERY_THROW );
+ xFormMultiSet->setPropertyValues( aPropNames, aPropValues );
- Reference< XMultiPropertySet > xFormMultiSet(_rxForm, UNO_QUERY);
- xFormMultiSet->setPropertyValues(aProperties, aValues);
- }
+ impl_sanitizeRowSetClauses_nothrow();
}
- catch(Exception&)
+ catch ( const Exception& )
{
- DBG_ERROR("SbaTableQueryBrowser::InitializeForm : something went wrong !");
+ DBG_UNHANDLED_EXCEPTION();
return sal_False;
}
-
return sal_True;
}
@@ -601,6 +736,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun::
::std::vector< NamedValue > aInitialValues;
::std::vector< ::rtl::OUString > aCopyProperties;
+ Any aDefault;
switch(nType)
{
@@ -617,6 +753,8 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun::
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TriState" ) ),
makeAny( sal_Bool( ColumnValue::NO_NULLS != nNullable ) )
) );
+ if ( ColumnValue::NO_NULLS == nNullable )
+ aDefault <<= (sal_Int16)STATE_NOCHECK;
}
break;
@@ -658,18 +796,17 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun::
Reference< XPropertySetInfo > xGridColPSI( xGridCol->getPropertySetInfo(), UNO_SET_THROW );
// calculate the default
- Any aDefault;
if ( xGridColPSI->hasPropertyByName( PROPERTY_CONTROLDEFAULT ) )
- aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT );
-
- // default value
- if ( nType == DataType::BIT || nType == DataType::BOOLEAN )
{
- if ( aDefault.hasValue() )
- aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK;
- else
- aDefault <<= ((sal_Int16)STATE_DONTKNOW);
-
+ aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT );
+ // default value
+ if ( nType == DataType::BIT || nType == DataType::BOOLEAN )
+ {
+ if ( aDefault.hasValue() )
+ aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK;
+ else
+ aDefault <<= ((sal_Int16)STATE_DONTKNOW);
+ }
}
if ( aDefault.hasValue() )
@@ -2293,77 +2430,82 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _r
sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rCommand,
const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing, const SharedConnection& _rxConnection)
{
- Reference<XPropertySet> xProp(getRowSet(),UNO_QUERY);
- if(xProp.is())
+ try
{
- Reference< ::com::sun::star::form::XLoadable > xLoadable(xProp,UNO_QUERY);
- try
+ Reference<XPropertySet> xProp( getRowSet(), UNO_QUERY_THROW );
+ Reference< XLoadable > xLoadable( xProp, UNO_QUERY_THROW );
+ // the values allowing the RowSet to re-execute
+ xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName));
+ if(_rxConnection.is())
+ xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _rxConnection.getTyped() ) );
+
+ // set this _before_ setting the connection, else the rowset would rebuild it ...
+ xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, makeAny(_nCommandType));
+ xProp->setPropertyValue(PROPERTY_COMMAND, makeAny(_rCommand));
+ xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing));
+ if ( m_bPreview )
{
- // the values allowing the RowSet to re-execute
- xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName));
- if(_rxConnection.is())
- xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _rxConnection.getTyped() ) );
-
- // set this _before_ setting the connection, else the rowset would rebuild it ...
- xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, makeAny(_nCommandType));
- xProp->setPropertyValue(PROPERTY_COMMAND, makeAny(_rCommand));
- xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing));
- if ( m_bPreview )
- {
- xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD));
- }
+ xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD));
+ }
- // the formatter depends on the data source we're working on, so rebuild it here ...
- initFormatter();
+ // the formatter depends on the data source we're working on, so rebuild it here ...
+ initFormatter();
- // switch the grid to design mode while loading
- getBrowserView()->getGridControl()->setDesignMode(sal_True);
- InitializeForm(getRowSet());
+ // switch the grid to design mode while loading
+ getBrowserView()->getGridControl()->setDesignMode(sal_True);
+ InitializeForm( xProp );
- sal_Bool bSuccess = sal_True;
+ sal_Bool bSuccess = sal_True;
+ {
{
- {
- Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY);
- // first we have to clear the grid
- clearGridColumns(xColContainer);
- }
- FormErrorHelper aHelper(this);
- // load the form
- bSuccess = reloadForm(xLoadable);
-
- // initialize the model
- InitializeGridModel(getFormComponent());
-
- if ( m_bPreview )
- initializePreviewMode();
-
- LoadFinished(sal_True);
+ Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY);
+ // first we have to clear the grid
+ clearGridColumns(xColContainer);
}
+ FormErrorHelper aHelper(this);
+ // load the form
+ bSuccess = reloadForm(xLoadable);
- InvalidateAll();
- return bSuccess;
- }
- catch( const SQLException& e )
- {
- Any aException( ::cppu::getCaughtException() );
- showError( SQLExceptionInfo( aException ) );
- }
- catch( const WrappedTargetException& e )
- {
- SQLException aSql;
- if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) )
- showError( SQLExceptionInfo( e.TargetException ) );
- else
+ // initialize the model
+ InitializeGridModel(getFormComponent());
+
+ Any aVal = xProp->getPropertyValue(PROPERTY_ISNEW);
+ if (aVal.hasValue() && ::comphelper::getBOOL(aVal))
{
- DBG_UNHANDLED_EXCEPTION();
+ // then set the default values and the parameters given from the parent
+ Reference< XReset> xReset(xProp, UNO_QUERY);
+ xReset->reset();
}
+
+ if ( m_bPreview )
+ initializePreviewMode();
+
+ LoadFinished(sal_True);
}
- catch(Exception&)
+
+ InvalidateAll();
+ return bSuccess;
+ }
+ catch( const SQLException& e )
+ {
+ Any aException( ::cppu::getCaughtException() );
+ showError( SQLExceptionInfo( aException ) );
+ }
+ catch( const WrappedTargetException& e )
+ {
+ SQLException aSql;
+ if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) )
+ showError( SQLExceptionInfo( e.TargetException ) );
+ else
{
DBG_UNHANDLED_EXCEPTION();
}
}
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
InvalidateAll();
return sal_False;
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index 89cdc855a0cd..69ed6bcd84f0 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -126,11 +126,11 @@ IMPL_LINK(OSqlEdit, OnUndoActionTimer, void*, EMPTYARG)
if(aText != m_strOrigText)
{
OJoinController& rController = m_pView->getContainerWindow()->getDesignView()->getController();
- SfxUndoManager* pUndoMgr = rController.getUndoMgr();
+ SfxUndoManager& rUndoMgr = rController.GetUndoManager();
OSqlEditUndoAct* pUndoAct = new OSqlEditUndoAct( this );
pUndoAct->SetOriginalText( m_strOrigText );
- pUndoMgr->AddUndoAction( pUndoAct );
+ rUndoMgr.AddUndoAction( pUndoAct );
rController.InvalidateFeature(SID_UNDO);
rController.InvalidateFeature(SID_REDO);
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index a2e82e50757d..1516c735f009 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -97,9 +97,12 @@ namespace dbaui
,m_pPrimaryKeySupport(NULL)
,m_pBooleanComparisonModeLabel( NULL )
,m_pBooleanComparisonMode( NULL )
+ ,m_pMaxRowScanLabel( NULL )
+ ,m_pMaxRowScan( NULL )
,m_aControlDependencies()
,m_aBooleanSettings()
,m_bHasBooleanComparisonMode( _rDSMeta.getFeatureSet().has( DSID_BOOLEANCOMPARISON ) )
+ ,m_bHasMaxRowScan( _rDSMeta.getFeatureSet().has( DSID_MAX_ROW_SCAN ) )
{
impl_initBooleanSettings();
@@ -164,6 +167,21 @@ namespace dbaui
m_pBooleanComparisonModeLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) );
m_pBooleanComparisonMode->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) );
}
+ // create the controls for the max row scan
+ if ( m_bHasMaxRowScan )
+ {
+ m_pMaxRowScanLabel = new FixedText( this, ModuleRes( FT_MAXROWSCAN ) );
+ m_pMaxRowScan = new NumericField( this, ModuleRes( NF_MAXROWSCAN ) );
+ m_pMaxRowScan->SetModifyHdl(getControlModifiedLink());
+ m_pMaxRowScan->SetUseThousandSep(sal_False);
+
+ Point aLabelPos( m_pMaxRowScanLabel->GetPosPixel() );
+ Point aControlPos( m_pMaxRowScan->GetPosPixel() );
+ long nMoveUp = aControlPos.Y() - aPos.Y();
+
+ m_pMaxRowScanLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) );
+ m_pMaxRowScan->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) );
+ }
FreeResource();
}
@@ -190,6 +208,8 @@ namespace dbaui
DELETEZ( m_pPrimaryKeySupport );
DELETEZ( m_pBooleanComparisonModeLabel );
DELETEZ( m_pBooleanComparisonMode );
+ DELETEZ( m_pMaxRowScanLabel );
+ DELETEZ( m_pMaxRowScan );
}
// -----------------------------------------------------------------------
@@ -230,6 +250,10 @@ namespace dbaui
{
_rControlList.push_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) );
}
+ if ( m_bHasMaxRowScan )
+ {
+ _rControlList.push_back( new ODisableWrapper< FixedText >( m_pMaxRowScanLabel ) );
+ }
}
// -----------------------------------------------------------------------
@@ -248,6 +272,8 @@ namespace dbaui
if ( m_bHasBooleanComparisonMode )
_rControlList.push_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) );
+ if ( m_bHasMaxRowScan )
+ _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pMaxRowScan));
}
// -----------------------------------------------------------------------
@@ -306,6 +332,12 @@ namespace dbaui
m_pBooleanComparisonMode->SelectEntryPos( static_cast< USHORT >( pBooleanComparison->GetValue() ) );
}
+ if ( m_bHasMaxRowScan )
+ {
+ SFX_ITEMSET_GET(_rSet, pMaxRowScan, SfxInt32Item, DSID_MAX_ROW_SCAN, sal_True);
+ m_pMaxRowScan->SetValue(pMaxRowScan->GetValue());
+ }
+
OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
}
@@ -334,6 +366,10 @@ namespace dbaui
bChangedSomething = sal_True;
}
}
+ if ( m_bHasMaxRowScan )
+ {
+ fillInt32(_rSet,m_pMaxRowScan,DSID_MAX_ROW_SCAN,bChangedSomething);
+ }
return bChangedSomething;
}
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hrc b/dbaccess/source/ui/dlg/advancedsettings.hrc
index 8abc5d8810d2..193fdf5f3853 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hrc
+++ b/dbaccess/source/ui/dlg/advancedsettings.hrc
@@ -69,7 +69,9 @@
#define FT_AUTOINCREMENTVALUE 1
#define FT_RETRIEVE_AUTO 2
#define FT_BOOLEANCOMPARISON 3
+#define FT_MAXROWSCAN 4
#define LB_BOOLEANCOMPARISON 1
+#define NF_MAXROWSCAN 1
#endif // DBAUI_ADVANCEDSETTINGS_HRC
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx
index 7e58f260f4e6..07620496b11f 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.hxx
@@ -37,6 +37,7 @@
#include <svtools/dialogcontrolling.hxx>
#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
#include <vector>
@@ -76,12 +77,16 @@ namespace dbaui
FixedText* m_pBooleanComparisonModeLabel;
ListBox* m_pBooleanComparisonMode;
+ FixedText* m_pMaxRowScanLabel;
+ NumericField* m_pMaxRowScan;
+
::svt::ControlDependencyManager
m_aControlDependencies;
BooleanSettingDescs m_aBooleanSettings;
bool m_bHasBooleanComparisonMode;
+ bool m_bHasMaxRowScan;
public:
virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs );
diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src
index 7a94c0dafb4c..9a2dc467d586 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.src
+++ b/dbaccess/source/ui/dlg/advancedsettings.src
@@ -249,6 +249,24 @@
WORKAROUND \
}; \
+#define AUTO_MAXROWSCAN(AUTO_Y) \
+ FixedText FT_MAXROWSCAN \
+ { \
+ Pos = MAP_APPFONT ( START_X , AUTO_Y + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) ; \
+ Size = MAP_APPFONT ( 100 , CHECKBOX_HEIGHT ); \
+ Text [ en-US ] = "Rows to scan column types"; \
+ }; \
+ NumericField NF_MAXROWSCAN \
+ { \
+ Pos = MAP_APPFONT ( START_X + 100, AUTO_Y ) ; \
+ Size = MAP_APPFONT ( 60 , EDIT_HEIGHT ) ; \
+ TabStop = TRUE ; \
+ NoThousandSep = TRUE; \
+ Border = TRUE; \
+ HelpId = HID_DSADMIN_MAXROWSCAN; \
+ }; \
+
+
//-------------------------------------------------------------------------
TabPage PAGE_GENERATED_VALUES
@@ -334,6 +352,7 @@ TabPage PAGE_ADVANCED_SETTINGS_SPECIAL
AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS )
AUTO_PRIMARY_KEY_SUPPORT( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS )
AUTO_BOOLEANCOMPARISON( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 )
+ AUTO_MAXROWSCAN( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 )
};
//-------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 1d5bb1cb167c..1c1b945854ed 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -410,6 +410,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
*pCounter++ = new SfxBoolItem(DSID_ESCAPE_DATETIME, sal_True);
*pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, String());
*pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT );
+ *pCounter++ = new SfxInt32Item(DSID_MAX_ROW_SCAN, 100);
// create the pool
static SfxItemInfo __READONLY_DATA aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] =
@@ -472,6 +473,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
{0,0},
{0,0},
{0,0},
+ {0,0},
{0,0}
};
diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx
index 41ee2458fa2f..8ff5fe99b727 100644
--- a/dbaccess/source/ui/inc/JoinController.hxx
+++ b/dbaccess/source/ui/inc/JoinController.hxx
@@ -27,26 +27,14 @@
#ifndef DBAUI_JOINCONTROLLER_HXX
#define DBAUI_JOINCONTROLLER_HXX
-#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX
#include "singledoccontroller.hxx"
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _DBAUI_MODULE_DBU_HXX_
#include "moduledbu.hxx"
-#endif
-#ifndef DBAUI_JOINTABLEVIEW_HXX
#include "JoinTableView.hxx"
-#endif
-#ifndef DBAUI_JOINDESIGNVIEW_HXX
#include "JoinDesignView.hxx"
-#endif
#include "TableConnectionData.hxx"
#include "TableWindowData.hxx"
-#ifndef _MEMORY_
#include <memory>
-#endif
#include <boost/shared_ptr.hpp>
namespace comphelper
diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx
index 3651c5632504..a1f1b8158c65 100644
--- a/dbaccess/source/ui/inc/TableController.hxx
+++ b/dbaccess/source/ui/inc/TableController.hxx
@@ -27,36 +27,16 @@
#ifndef DBUI_TABLECONTROLLER_HXX
#define DBUI_TABLECONTROLLER_HXX
-#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX
#include "singledoccontroller.hxx"
-#endif
-#ifndef _DBAUI_MODULE_DBU_HXX_
#include "moduledbu.hxx"
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
#include <com/sun/star/sdbc/XConnection.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XOBJECTOUTPUTSTREAM_HPP_
#include <com/sun/star/io/XObjectOutputStream.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XOBJECTINPUTSTREAM_HPP_
#include <com/sun/star/io/XObjectInputStream.hpp>
-#endif
-#ifndef DBAUI_TYPEINFO_HXX
#include "TypeInfo.hxx"
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
class FixedText;
namespace dbaui
@@ -129,9 +109,6 @@ namespace dbaui
virtual void impl_onModifyChanged();
- // const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();}
- // need for undo's and redo's
- SfxUndoManager* getUndoMgr();
inline ::std::vector< ::boost::shared_ptr<OTableRow> >* getRows() { return &m_vRowList; }
/// returns the postion of the the first empty row
diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx
index 962bc75bb7f9..23bae743b15a 100644
--- a/dbaccess/source/ui/inc/brwctrlr.hxx
+++ b/dbaccess/source/ui/inc/brwctrlr.hxx
@@ -254,7 +254,8 @@ namespace dbaui
// (probably this needs not to be overloaded, but you may return anything you want as long as it
// supports the ::com::sun::star::form::DatabaseForm service. For instance you may want to create an adapter here which
// is synchronized with a foreign ::com::sun::star::form::DatabaseForm you got elsewhere)
- virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm) = 0;
+ virtual sal_Bool InitializeForm(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ) = 0;
// called immediately after a successfull CreateForm
// do any initialization (data source etc.) here. the form should be fully functional after that.
// return sal_False if you didn't succeed (don't throw exceptions, they won't be caught)
@@ -325,8 +326,11 @@ namespace dbaui
/// loads or reloads the form
virtual sal_Bool reloadForm(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >& _rxLoadable);
- virtual sal_Bool preReloadForm(){ return sal_False; }
- virtual void postReloadForm(){}
+ virtual sal_Bool preReloadForm(){ return sal_False; }
+ virtual void postReloadForm(){}
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >
+ createParser_nothrow();
private:
void setCurrentModified( sal_Bool _bSet );
@@ -346,7 +350,6 @@ namespace dbaui
void addColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel);
void impl_checkForCannotSelectUnfiltered( const ::dbtools::SQLExceptionInfo& _rError );
- ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > createParser_nothrow();
// time to check the CUT/COPY/PASTE-slot-states
DECL_LINK( OnInvalidateClipboard, AutoTimer* );
diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx
index cb08be7812d5..6b87bee2a61a 100644
--- a/dbaccess/source/ui/inc/dsitems.hxx
+++ b/dbaccess/source/ui/inc/dsitems.hxx
@@ -92,6 +92,7 @@ typedef sal_Int32 ItemID;
#define DSID_ESCAPE_DATETIME 57
#define DSID_NAMED_PIPE 58
#define DSID_PRIMARY_KEY_SUPPORT 59
+#define DSID_MAX_ROW_SCAN 60
// don't forget to adjust DSID_LAST_ITEM_ID below!
@@ -99,7 +100,7 @@ typedef sal_Int32 ItemID;
//= item range. Adjust this if you introduce new items above
#define DSID_FIRST_ITEM_ID DSID_NAME
-#define DSID_LAST_ITEM_ID DSID_PRIMARY_KEY_SUPPORT
+#define DSID_LAST_ITEM_ID DSID_MAX_ROW_SCAN
#endif // _DBAUI_DATASOURCEITEMS_HXX_
diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx
index 551ba4fe40b7..87a93244cd3f 100644
--- a/dbaccess/source/ui/inc/dsmeta.hxx
+++ b/dbaccess/source/ui/inc/dsmeta.hxx
@@ -132,6 +132,7 @@ namespace dbaui
|| has( DSID_IGNORECURRENCY )
|| has( DSID_ESCAPE_DATETIME )
|| has( DSID_PRIMARY_KEY_SUPPORT )
+ || has( DSID_MAX_ROW_SCAN )
;
}
diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx
index d58cf65f6959..5fbdfed65953 100644
--- a/dbaccess/source/ui/inc/exsrcbrw.hxx
+++ b/dbaccess/source/ui/inc/exsrcbrw.hxx
@@ -96,7 +96,7 @@ namespace dbaui
~SbaExternalSourceBrowser();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > CreateForm();
- virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm);
+ virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties );
virtual sal_Bool LoadForm();
diff --git a/dbaccess/source/ui/inc/singledoccontroller.hxx b/dbaccess/source/ui/inc/singledoccontroller.hxx
new file mode 100755
index 000000000000..c738bd94e81c
--- /dev/null
+++ b/dbaccess/source/ui/inc/singledoccontroller.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 DBAUI_SINGLEDOCCONTROLLER_HXX
+#define DBAUI_SINGLEDOCCONTROLLER_HXX
+
+#include "dbsubcomponentcontroller.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase1.hxx>
+
+class SfxUndoAction;
+class SfxUndoManager;
+
+//......................................................................................................................
+namespace dbaui
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= OSingleDocumentController
+ //==================================================================================================================
+ struct OSingleDocumentController_Data;
+ typedef ::cppu::ImplInheritanceHelper1 < DBSubComponentController
+ , ::com::sun::star::document::XUndoManagerSupplier
+ > OSingleDocumentController_Base;
+ class OSingleDocumentController : public OSingleDocumentController_Base
+ {
+ protected:
+ OSingleDocumentController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB );
+ virtual ~OSingleDocumentController();
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ public:
+ /// need for undo's and redo's
+ SfxUndoManager& GetUndoManager() const;
+
+ /// complete clears the Undo/Redo stacks
+ void ClearUndoManager();
+
+ /** addUndoActionAndInvalidate adds an undo action to the undoManager,
+ additionally invalidates the UNDO and REDO slot
+ @param pAction the undo action to add
+ */
+ void addUndoActionAndInvalidate( SfxUndoAction* pAction );
+
+ // OGenericUnoController
+ virtual FeatureState GetState( sal_uInt16 nId ) const;
+ virtual void Execute( sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs );
+
+ // XUndoManagerSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ) 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 );
+
+ private:
+ ::std::auto_ptr< OSingleDocumentController_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace dbaui
+//......................................................................................................................
+
+#endif // DBAUI_SINGLEDOCCONTROLLER_HXX
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index 0448cef602e6..67e74bb862f7 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -265,7 +265,7 @@ namespace dbaui
protected:
// SbaXDataBrowserController overridables
- virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm);
+ virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties );
virtual sal_Bool InitializeGridModel(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > & xGrid);
virtual sal_Bool preReloadForm();
@@ -531,6 +531,10 @@ namespace dbaui
of the load process
*/
void initializePreviewMode();
+
+ /** checks whether the Order/Filter clauses set at our row set are valid, removes them if not so
+ */
+ void impl_sanitizeRowSetClauses_nothrow();
};
// .........................................................................
diff --git a/dbaccess/source/ui/misc/dbaundomanager.cxx b/dbaccess/source/ui/misc/dbaundomanager.cxx
new file mode 100755
index 000000000000..1e60a027a693
--- /dev/null
+++ b/dbaccess/source/ui/misc/dbaundomanager.cxx
@@ -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.
+ *
+ ************************************************************************/
+
+#include "precompiled_dbaccess.hxx"
+
+#include "dbaundomanager.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+/** === end UNO includes === **/
+
+#include <svl/undo.hxx>
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+#include <framework/undomanagerhelper.hxx>
+
+//......................................................................................................................
+namespace dbaui
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::document::XUndoManager;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::document::UndoContextNotClosedException;
+ using ::com::sun::star::document::UndoFailedException;
+ using ::com::sun::star::document::EmptyUndoStackException;
+ using ::com::sun::star::util::InvalidStateException;
+ using ::com::sun::star::document::XUndoAction;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::document::XUndoManagerListener;
+ using ::com::sun::star::util::NotLockedException;
+ using ::com::sun::star::lang::NoSupportException;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= UndoManager_Impl
+ //==================================================================================================================
+ struct UndoManager_Impl : public ::framework::IUndoManagerImplementation
+ {
+ UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ :rAntiImpl( i_antiImpl )
+ ,rParent( i_parent )
+ ,rMutex( i_mutex )
+ ,bDisposed( false )
+ ,aUndoManager()
+ ,aUndoHelper( *this )
+ {
+ }
+
+ virtual ~UndoManager_Impl()
+ {
+ }
+
+ UndoManager& rAntiImpl;
+ ::cppu::OWeakObject& rParent;
+ ::osl::Mutex& rMutex;
+ bool bDisposed;
+ SfxUndoManager aUndoManager;
+ ::framework::UndoManagerHelper aUndoHelper;
+
+ // IUndoManagerImplementation
+ virtual ::svl::IUndoManager& getImplUndoManager();
+ virtual Reference< XUndoManager > getThis();
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::svl::IUndoManager& UndoManager_Impl::getImplUndoManager()
+ {
+ return aUndoManager;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XUndoManager > UndoManager_Impl::getThis()
+ {
+ return static_cast< XUndoManager* >( &rAntiImpl );
+ }
+
+ //==============================================================================================================
+ //= OslMutexFacade
+ //==============================================================================================================
+ class OslMutexFacade : public ::framework::IMutex
+ {
+ public:
+ OslMutexFacade( ::osl::Mutex& i_mutex )
+ :m_rMutex( i_mutex )
+ {
+ }
+
+ virtual void acquire();
+ virtual void release();
+
+ private:
+ ::osl::Mutex& m_rMutex;
+ };
+
+ //--------------------------------------------------------------------------------------------------------------
+ void OslMutexFacade::acquire()
+ {
+ m_rMutex.acquire();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void OslMutexFacade::release()
+ {
+ m_rMutex.release();
+ }
+
+ //==============================================================================================================
+ //= UndoManagerMethodGuard
+ //==============================================================================================================
+ /** guard for public UNO methods of the UndoManager
+ */
+ class UndoManagerMethodGuard : public ::framework::IMutexGuard
+ {
+ public:
+ UndoManagerMethodGuard( UndoManager_Impl& i_impl )
+ :m_aGuard( i_impl.rMutex )
+ ,m_aMutexFacade( i_impl.rMutex )
+ {
+ // throw if the instance is already disposed
+ if ( i_impl.bDisposed )
+ throw DisposedException( ::rtl::OUString(), i_impl.getThis() );
+ }
+ virtual ~UndoManagerMethodGuard()
+ {
+ }
+
+ // IMutexGuard
+ virtual ::framework::IMutex& getGuardedMutex();
+
+ // IGuard
+ virtual void clear();
+ virtual void reset();
+
+ private:
+ ::osl::ResettableMutexGuard m_aGuard;
+ OslMutexFacade m_aMutexFacade;
+ };
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::framework::IMutex& UndoManagerMethodGuard::getGuardedMutex()
+ {
+ return m_aMutexFacade;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManagerMethodGuard::clear()
+ {
+ m_aGuard.clear();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManagerMethodGuard::reset()
+ {
+ m_aGuard.reset();
+ }
+
+ //==================================================================================================================
+ //= UndoManager
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ :m_pImpl( new UndoManager_Impl( *this, i_parent, i_mutex ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManager::~UndoManager()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SfxUndoManager& UndoManager::GetSfxUndoManager() const
+ {
+ return m_pImpl->aUndoManager;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::acquire( ) throw ()
+ {
+ m_pImpl->rParent.acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::release( ) throw ()
+ {
+ m_pImpl->rParent.release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManager::disposing()
+ {
+ {
+ ::osl::MutexGuard aGuard( m_pImpl->rMutex );
+ m_pImpl->bDisposed = true;
+ }
+ m_pImpl->aUndoHelper.disposing();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.enterUndoContext( i_title, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::enterHiddenUndoContext( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.enterHiddenUndoContext( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::leaveUndoContext( ) throw (InvalidStateException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.leaveUndoContext( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (IllegalArgumentException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.addUndoAction( i_action, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ // (all our UndoActions work directly on VCL code, usually, so ...)
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.undo( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ // (all our UndoActions work directly on VCL code, usually, so ...)
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.redo( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isUndoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->aUndoHelper.isUndoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isRedoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->aUndoHelper.isRedoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL UndoManager::getCurrentUndoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->aUndoHelper.getCurrentUndoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL UndoManager::getCurrentRedoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->aUndoHelper.getCurrentRedoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllUndoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->aUndoHelper.getAllUndoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllRedoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->aUndoHelper.getAllRedoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::clear( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.clear( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::clearRedo( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.clearRedo( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::reset( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.reset( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.addUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.removeUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::lock( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.lock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::unlock( ) throw (NotLockedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->aUndoHelper.unlock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isLocked( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->aUndoHelper.isLocked();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL UndoManager::getParent( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return *&m_pImpl->rParent;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException)
+ {
+ (void)i_parent;
+ throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() );
+ }
+
+//......................................................................................................................
+} // namespace dbaui
+//......................................................................................................................
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
new file mode 100644
index 000000000000..eb1b34710ff8
--- /dev/null
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -0,0 +1,672 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_dbaccess.hxx"
+
+#include "browserids.hxx"
+#include "commontypes.hxx"
+#include "dataview.hxx"
+#include "dbu_misc.hrc"
+#include "dbustrings.hrc"
+#include "moduledbu.hxx"
+#include "dbsubcomponentcontroller.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#include <com/sun/star/sdbc/XDataSource.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/sequence.hxx>
+#include <comphelper/types.hxx>
+#include <connectivity/dbexception.hxx>
+#include <connectivity/dbtools.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <toolkit/unohlp.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/msgbox.hxx>
+
+//........................................................................
+namespace dbaui
+{
+//........................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::util::XNumberFormatter;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::sdbc::XConnection;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::container::XChild;
+ using ::com::sun::star::sdbc::XDataSource;
+ using ::com::sun::star::util::XNumberFormatter;
+ using ::com::sun::star::util::XNumberFormatsSupplier;
+ using ::com::sun::star::frame::XFrame;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::sdbc::SQLException;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::beans::PropertyValue;
+ using ::com::sun::star::frame::XModel;
+ using ::com::sun::star::sdb::XOfficeDatabaseDocument;
+ using ::com::sun::star::awt::XWindow;
+ using ::com::sun::star::sdbc::XDatabaseMetaData;
+ using ::com::sun::star::sdb::XDocumentDataSource;
+ using ::com::sun::star::document::XEmbeddedScripts;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::frame::XUntitledNumbers;
+ using ::com::sun::star::beans::PropertyVetoException;
+ /** === end UNO using === **/
+
+ class DataSourceHolder
+ {
+ public:
+ DataSourceHolder()
+ {
+ }
+
+ DataSourceHolder( const Reference< XDataSource >& _rxDataSource )
+ {
+ m_xDataSource = _rxDataSource;
+ Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY );
+ if ( xDocDS.is() )
+ m_xDocument = xDocDS->getDatabaseDocument();
+
+ m_xDataSourceProps.set( m_xDataSource, UNO_QUERY );
+ }
+
+ const Reference< XDataSource >& getDataSource() const { return m_xDataSource; }
+ const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; }
+ const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; }
+
+ bool is() const { return m_xDataSource.is(); }
+
+ void clear()
+ {
+ m_xDataSource.clear();
+ m_xDocument.clear();
+ }
+
+ private:
+ Reference< XDataSource > m_xDataSource;
+ Reference< XPropertySet > m_xDataSourceProps;
+ Reference< XOfficeDatabaseDocument > m_xDocument;
+ };
+
+ struct DBSubComponentController_Impl
+ {
+ private:
+ ::boost::optional< bool > m_aDocScriptSupport;
+
+ public:
+ OModuleClient m_aModuleClient;
+ ::dbtools::SQLExceptionInfo m_aCurrentError;
+
+ ::cppu::OInterfaceContainerHelper
+ m_aModifyListeners;
+
+ // <properties>
+ SharedConnection m_xConnection;
+ ::dbtools::DatabaseMetaData m_aSdbMetaData;
+ // </properties>
+ ::rtl::OUString m_sDataSourceName; // the data source we're working for
+ DataSourceHolder m_aDataSource;
+ Reference< XModel > m_xDocument;
+ Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier
+ sal_Int32 m_nDocStartNumber;
+ sal_Bool m_bSuspended; // is true when the controller was already suspended
+ sal_Bool m_bEditable; // is the control readonly or not
+ sal_Bool m_bModified; // is the data modified
+ bool m_bNotAttached;
+
+ DBSubComponentController_Impl( ::osl::Mutex& i_rMutex )
+ :m_aDocScriptSupport()
+ ,m_aModifyListeners( i_rMutex )
+ ,m_nDocStartNumber(0)
+ ,m_bSuspended( sal_False )
+ ,m_bEditable(sal_True)
+ ,m_bModified(sal_False)
+ ,m_bNotAttached(true)
+ {
+ }
+
+ bool documentHasScriptSupport() const
+ {
+ OSL_PRECOND( !!m_aDocScriptSupport,
+ "DBSubComponentController_Impl::documentHasScriptSupport: not completely initialized, yet - don't know!?" );
+ return !!m_aDocScriptSupport && *m_aDocScriptSupport;
+ }
+
+ void setDocumentScriptSupport( const bool _bSupport )
+ {
+ OSL_PRECOND( !m_aDocScriptSupport,
+ "DBSubComponentController_Impl::setDocumentScriptSupport: already initialized!" );
+ m_aDocScriptSupport = ::boost::optional< bool >( _bSupport );
+ }
+ };
+
+ //====================================================================
+ //= DBSubComponentController
+ //====================================================================
+ //--------------------------------------------------------------------
+ DBSubComponentController::DBSubComponentController(const Reference< XMultiServiceFactory >& _rxORB)
+ :DBSubComponentController_Base( _rxORB )
+ ,m_pImpl( new DBSubComponentController_Impl( getMutex() ) )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ DBSubComponentController::~DBSubComponentController()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ void DBSubComponentController::impl_initialize()
+ {
+ OGenericUnoController::impl_initialize();
+
+ const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
+
+ Reference< XConnection > xConnection;
+ xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection );
+
+ if ( !xConnection.is() )
+ ::dbtools::isEmbeddedInDatabase( getModel(), xConnection );
+
+ if ( xConnection.is() )
+ initializeConnection( xConnection );
+
+ bool bShowError = true;
+ if ( !isConnected() )
+ {
+ reconnect( sal_False );
+ bShowError = false;
+ }
+ if ( !isConnected() )
+ {
+ if ( bShowError )
+ connectionLostMessage();
+ throw IllegalArgumentException();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ Any SAL_CALL DBSubComponentController::queryInterface(const Type& _rType) throw (RuntimeException)
+ {
+ if ( _rType.equals( XScriptInvocationContext::static_type() ) )
+ {
+ if ( m_pImpl->documentHasScriptSupport() )
+ return makeAny( Reference< XScriptInvocationContext >( this ) );
+ return Any();
+ }
+
+ return DBSubComponentController_Base::queryInterface( _rType );
+ }
+
+ //--------------------------------------------------------------------
+ Sequence< Type > SAL_CALL DBSubComponentController::getTypes( ) throw (RuntimeException)
+ {
+ Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() );
+ if ( !m_pImpl->documentHasScriptSupport() )
+ {
+ Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 );
+ ::std::remove_copy_if(
+ aTypes.getConstArray(),
+ aTypes.getConstArray() + aTypes.getLength(),
+ aStrippedTypes.getArray(),
+ ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() )
+ );
+ aTypes = aStrippedTypes;
+ }
+ return aTypes;
+ }
+
+ //--------------------------------------------------------------------
+ void DBSubComponentController::initializeConnection( const Reference< XConnection >& _rxForeignConn )
+ {
+ DBG_ASSERT( !isConnected(), "DBSubComponentController::initializeConnection: not to be called when already connected!" );
+ // usually this gets called from within initialize of derived classes ...
+ if ( isConnected() )
+ disconnect();
+
+ m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership );
+ m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection );
+ startConnectionListening( m_pImpl->m_xConnection );
+
+ // get the data source the connection belongs to
+ try
+ {
+ // determine our data source
+ OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: already a data source in this phase?" );
+ {
+ Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY );
+ Reference< XDataSource > xDS;
+ if ( xConnAsChild.is() )
+ xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY );
+
+ // (take the indirection through XDataSource to ensure we have a correct object ....)
+ m_pImpl->m_aDataSource = xDS;
+ }
+ OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: unable to obtain the data source object!" );
+
+ if ( m_pImpl->m_bNotAttached )
+ {
+ Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY );
+ m_pImpl->m_nDocStartNumber = 1;
+ if ( xUntitledProvider.is() )
+ m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) );
+ }
+
+ // determine the availability of script support in our document. Our own XScriptInvocationContext
+ // interface depends on this
+ m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() );
+
+ // get a number formatter
+ Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW );
+ xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName;
+ DBG_ASSERT( m_pImpl->m_sDataSourceName.getLength(), "DBSubComponentController::initializeConnection: invalid data source name!" );
+ Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection);
+ if(xSupplier.is())
+ {
+ m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB()
+ ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY);
+ m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier);
+ }
+ OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!");
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //--------------------------------------------------------------------
+ void DBSubComponentController::reconnect( sal_Bool _bUI )
+ {
+ OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!");
+
+ stopConnectionListening( m_pImpl->m_xConnection );
+ m_pImpl->m_aSdbMetaData.reset( NULL );
+ m_pImpl->m_xConnection.clear();
+
+ // reconnect
+ sal_Bool bReConnect = sal_True;
+ if ( _bUI )
+ {
+ QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) );
+ bReConnect = ( RET_YES == aQuery.Execute() );
+ }
+
+ // now really reconnect ...
+ if ( bReConnect )
+ {
+ m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership );
+ m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection );
+ }
+
+ // invalidate all slots
+ InvalidateAll();
+ }
+
+ //--------------------------------------------------------------------
+ void DBSubComponentController::disconnect()
+ {
+ stopConnectionListening(m_pImpl->m_xConnection);
+ m_pImpl->m_aSdbMetaData.reset( NULL );
+ m_pImpl->m_xConnection.clear();
+
+ InvalidateAll();
+ }
+
+ //--------------------------------------------------------------------
+ void DBSubComponentController::losingConnection()
+ {
+ // our connection was disposed so we need a new one
+ reconnect( sal_True );
+ InvalidateAll();
+ }
+
+ //--------------------------------------------------------------------
+ void SAL_CALL DBSubComponentController::disposing()
+ {
+ DBSubComponentController_Base::disposing();
+
+ disconnect();
+
+ attachFrame( Reference < XFrame >() );
+
+ m_pImpl->m_aDataSource.clear();
+ }
+
+ //--------------------------------------------------------------------
+ void SAL_CALL DBSubComponentController::disposing(const EventObject& _rSource) throw( RuntimeException )
+ {
+ if ( _rSource.Source == getConnection() )
+ {
+ if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect
+ && !getBroadcastHelper().bInDispose
+ && !getBroadcastHelper().bDisposed
+ && isConnected()
+ )
+ {
+ losingConnection();
+ }
+ else
+ {
+ m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership );
+ // this prevents the "disposeComponent" call in disconnect
+ disconnect();
+ }
+ }
+ else
+ DBSubComponentController_Base::disposing( _rSource );
+ }
+
+ //--------------------------------------------------------------------
+ void DBSubComponentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState,
+ const sal_Int32 _nErrorCode )
+ {
+ m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ),
+ _nErrorCode );
+ }
+ //--------------------------------------------------------------------
+ void DBSubComponentController::clearError()
+ {
+ m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo();
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool DBSubComponentController::hasError() const
+ {
+ return m_pImpl->m_aCurrentError.isValid();
+ }
+
+ //--------------------------------------------------------------------
+ const ::dbtools::SQLExceptionInfo& DBSubComponentController::getError() const
+ {
+ return m_pImpl->m_aCurrentError;
+ }
+
+ //--------------------------------------------------------------------
+ void DBSubComponentController::displayError()
+ {
+ showError( m_pImpl->m_aCurrentError );
+ }
+
+ //--------------------------------------------------------------------
+ sal_Bool SAL_CALL DBSubComponentController::suspend(sal_Bool bSuspend) throw( RuntimeException )
+ {
+ m_pImpl->m_bSuspended = bSuspend;
+ if ( !bSuspend && !isConnected() )
+ reconnect(sal_True);
+
+
+ return sal_True;
+ }
+
+ // -----------------------------------------------------------------------------
+ sal_Bool SAL_CALL DBSubComponentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException )
+ {
+ if ( !_rxModel.is() )
+ return sal_False;
+ if ( !DBSubComponentController_Base::attachModel( _rxModel ) )
+ return sal_False;
+
+ m_pImpl->m_bNotAttached = false;
+ if ( m_pImpl->m_nDocStartNumber == 1 )
+ releaseNumberForComponent();
+
+ Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY );
+ m_pImpl->m_nDocStartNumber = 1;
+ if ( xUntitledProvider.is() )
+ m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) );
+
+ return sal_True;
+ }
+
+ // -----------------------------------------------------------------------------
+ void DBSubComponentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs)
+ {
+ if ( _nId == ID_BROWSER_CLOSE )
+ {
+ closeTask();
+ return;
+ }
+
+ DBSubComponentController_Base::Execute( _nId, _rArgs );
+ InvalidateFeature( _nId );
+ }
+
+ // -----------------------------------------------------------------------------
+ ::rtl::OUString DBSubComponentController::getDataSourceName() const
+ {
+ ::rtl::OUString sName;
+ Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() );
+ if ( xDataSourceProps.is() )
+ xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName;
+ return sName;
+ }
+ // -----------------------------------------------------------------------------
+ void DBSubComponentController::connectionLostMessage() const
+ {
+ String aMessage(ModuleRes(RID_STR_CONNECTION_LOST));
+ Reference< XWindow > xWindow = getTopMostContainerWindow();
+ Window* pWin = NULL;
+ if ( xWindow.is() )
+ pWin = VCLUnoHelper::GetWindow(xWindow);
+ if ( !pWin )
+ pWin = getView()->Window::GetParent();
+
+ InfoBox(pWin, aMessage).Execute();
+ }
+ // -----------------------------------------------------------------------------
+ const Reference< XConnection >& DBSubComponentController::getConnection() const
+ {
+ return m_pImpl->m_xConnection;
+ }
+
+ // -----------------------------------------------------------------------------
+ sal_Bool DBSubComponentController::isReadOnly() const
+ {
+ return !m_pImpl->m_bEditable;
+ }
+
+ // -----------------------------------------------------------------------------
+ sal_Bool DBSubComponentController::isEditable() const
+ {
+ return m_pImpl->m_bEditable;
+ }
+
+ // -----------------------------------------------------------------------------
+ void DBSubComponentController::setEditable(sal_Bool _bEditable)
+ {
+ m_pImpl->m_bEditable = _bEditable;
+ }
+
+ // -----------------------------------------------------------------------------
+ const ::dbtools::DatabaseMetaData& DBSubComponentController::getSdbMetaData() const
+ {
+ return m_pImpl->m_aSdbMetaData;
+ }
+
+ // -----------------------------------------------------------------------------
+ sal_Bool DBSubComponentController::isConnected() const
+ {
+ return m_pImpl->m_xConnection.is();
+ }
+
+ // -----------------------------------------------------------------------------
+ Reference< XDatabaseMetaData > DBSubComponentController::getMetaData( ) const
+ {
+ Reference< XDatabaseMetaData > xMeta;
+ try
+ {
+ if ( isConnected() )
+ xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return xMeta;
+ }
+
+ // -----------------------------------------------------------------------------
+ const Reference< XPropertySet >& DBSubComponentController::getDataSource() const
+ {
+ return m_pImpl->m_aDataSource.getDataSourceProps();
+ }
+
+ // -----------------------------------------------------------------------------
+ sal_Bool DBSubComponentController::haveDataSource() const
+ {
+ return m_pImpl->m_aDataSource.is();
+ }
+
+ // -----------------------------------------------------------------------------
+ Reference< XModel > DBSubComponentController::getDatabaseDocument() const
+ {
+ return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY );
+ }
+
+ // -----------------------------------------------------------------------------
+ Reference< XNumberFormatter > DBSubComponentController::getNumberFormatter() const
+ {
+ return m_pImpl->m_xFormatter;
+ }
+
+ // -----------------------------------------------------------------------------
+ Reference< XModel > DBSubComponentController::getPrivateModel() const
+ {
+ return getDatabaseDocument();
+ }
+ // -----------------------------------------------------------------------------
+ // XTitle
+ ::rtl::OUString SAL_CALL DBSubComponentController::getTitle()
+ throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( getMutex() );
+ if ( m_bExternalTitle )
+ return impl_getTitleHelper_throw()->getTitle ();
+
+ ::rtl::OUStringBuffer sTitle;
+ Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY);
+ if ( xTitle.is() )
+ {
+ sTitle.append( xTitle->getTitle() );
+ sTitle.appendAscii(" : ");
+ }
+ sTitle.append( getPrivateTitle() );
+ return sTitle.makeStringAndClear();
+ }
+
+ // -----------------------------------------------------------------------------
+ sal_Int32 DBSubComponentController::getCurrentStartNumber() const
+ {
+ return m_pImpl->m_nDocStartNumber;
+ }
+
+ // -----------------------------------------------------------------------------
+ Reference< XEmbeddedScripts > SAL_CALL DBSubComponentController::getScriptContainer() throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( getMutex() );
+ if ( !m_pImpl->documentHasScriptSupport() )
+ return NULL;
+
+ return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW );
+ }
+
+ // -----------------------------------------------------------------------------
+ void SAL_CALL DBSubComponentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( getMutex() );
+ m_pImpl->m_aModifyListeners.addInterface( i_Listener );
+ }
+
+ // -----------------------------------------------------------------------------
+ void SAL_CALL DBSubComponentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( getMutex() );
+ m_pImpl->m_aModifyListeners.removeInterface( i_Listener );
+ }
+
+ // -----------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL DBSubComponentController::isModified( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( getMutex() );
+ return impl_isModified();
+ }
+
+ // -----------------------------------------------------------------------------
+ void SAL_CALL DBSubComponentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException)
+ {
+ ::osl::ClearableMutexGuard aGuard( getMutex() );
+
+ if ( m_pImpl->m_bModified == i_bModified )
+ return;
+
+ m_pImpl->m_bModified = i_bModified;
+ impl_onModifyChanged();
+
+ EventObject aEvent( *this );
+ aGuard.clear();
+ m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent );
+ }
+
+ // -----------------------------------------------------------------------------
+ sal_Bool DBSubComponentController::impl_isModified() const
+ {
+ return m_pImpl->m_bModified;
+ }
+
+ // -----------------------------------------------------------------------------
+ void DBSubComponentController::impl_onModifyChanged()
+ {
+ InvalidateFeature( ID_BROWSER_SAVEDOC );
+ if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) )
+ InvalidateFeature( ID_BROWSER_SAVEASDOC );
+ }
+
+//........................................................................
+} // namespace dbaui
+//........................................................................
+
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx
index 08b5ea49f2bd..052d013f47a4 100644
--- a/dbaccess/source/ui/misc/dsmeta.cxx
+++ b/dbaccess/source/ui/misc/dsmeta.cxx
@@ -93,6 +93,7 @@ namespace dbaui
{ DSID_IGNORECURRENCY, "IgnoreCurrency" },
{ DSID_ESCAPE_DATETIME, "EscapeDateTime" },
{ DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" },
+ { DSID_MAX_ROW_SCAN, "MaxRowScan" },
{ 0, NULL }
};
return s_aMappings;
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index 4d3472e623b7..553050f961e9 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -114,9 +114,6 @@
#ifndef _SB_SBUNO_HXX
#include <basic/sbuno.hxx>
#endif
-#ifndef _SFX_MACROCONF_HXX
-#include <sfx2/macrconf.hxx>
-#endif
#ifndef _EHDL_HXX
#include <svtools/ehdl.hxx>
#endif
diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk
index 7f9bbed56023..534d90e3995c 100644
--- a/dbaccess/source/ui/misc/makefile.mk
+++ b/dbaccess/source/ui/misc/makefile.mk
@@ -25,8 +25,8 @@
#
#*************************************************************************
-PRJ=..$/..$/..
-PRJINC=$(PRJ)$/source
+PRJ=../../..
+PRJINC=$(PRJ)/source
PRJNAME=dbaccess
TARGET=uimisc
@@ -35,50 +35,53 @@ ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
+.INCLUDE : $(PRJ)/util/makefile.pmk
# --- Files -------------------------------------
# ... resource files ............................
SRS1NAME=$(TARGET)
-SRC1FILES = \
- dbumiscres.src \
+SRC1FILES = \
+ dbumiscres.src \
WizardPages.src
# ... object files ............................
-SLOFILES= \
- $(SLO)$/asyncmodaldialog.obj \
- $(SLO)$/imageprovider.obj \
- $(SLO)$/singledoccontroller.obj \
- $(SLO)$/datasourceconnector.obj \
- $(SLO)$/linkeddocuments.obj \
- $(SLO)$/indexcollection.obj \
- $(SLO)$/UITools.obj \
- $(SLO)$/WCPage.obj \
- $(SLO)$/WCopyTable.obj \
- $(SLO)$/WTypeSelect.obj \
- $(SLO)$/TokenWriter.obj \
- $(SLO)$/HtmlReader.obj \
- $(SLO)$/RtfReader.obj \
- $(SLO)$/propertysetitem.obj \
- $(SLO)$/databaseobjectview.obj \
- $(SLO)$/DExport.obj \
- $(SLO)$/uiservices.obj \
- $(SLO)$/RowSetDrop.obj \
- $(SLO)$/TableCopyHelper.obj \
- $(SLO)$/moduledbu.obj \
- $(SLO)$/WColumnSelect.obj \
- $(SLO)$/WExtendPages.obj \
- $(SLO)$/WNameMatch.obj \
- $(SLO)$/ToolBoxHelper.obj \
- $(SLO)$/stringlistitem.obj \
- $(SLO)$/charsets.obj \
- $(SLO)$/defaultobjectnamecheck.obj \
- $(SLO)$/dsmeta.obj \
- $(SLO)$/controllerframe.obj \
- $(SLO)$/propertystorage.obj
+SLOFILES= \
+ $(SLO)/asyncmodaldialog.obj \
+ $(SLO)/imageprovider.obj \
+ $(SLO)/singledoccontroller.obj \
+ $(SLO)/dbsubcomponentcontroller.obj \
+ $(SLO)/datasourceconnector.obj \
+ $(SLO)/linkeddocuments.obj \
+ $(SLO)/indexcollection.obj \
+ $(SLO)/UITools.obj \
+ $(SLO)/WCPage.obj \
+ $(SLO)/WCopyTable.obj \
+ $(SLO)/WTypeSelect.obj \
+ $(SLO)/TokenWriter.obj \
+ $(SLO)/HtmlReader.obj \
+ $(SLO)/RtfReader.obj \
+ $(SLO)/propertysetitem.obj \
+ $(SLO)/databaseobjectview.obj \
+ $(SLO)/DExport.obj \
+ $(SLO)/uiservices.obj \
+ $(SLO)/RowSetDrop.obj \
+ $(SLO)/TableCopyHelper.obj \
+ $(SLO)/moduledbu.obj \
+ $(SLO)/WColumnSelect.obj \
+ $(SLO)/WExtendPages.obj \
+ $(SLO)/WNameMatch.obj \
+ $(SLO)/ToolBoxHelper.obj \
+ $(SLO)/stringlistitem.obj \
+ $(SLO)/charsets.obj \
+ $(SLO)/defaultobjectnamecheck.obj \
+ $(SLO)/dsmeta.obj \
+ $(SLO)/controllerframe.obj \
+ $(SLO)/propertystorage.obj \
+ $(SLO)/dbaundomanager.obj \
+
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx
index 87ddfa1f197b..2e8c002a2097 100644..100755
--- a/dbaccess/source/ui/misc/singledoccontroller.cxx
+++ b/dbaccess/source/ui/misc/singledoccontroller.cxx
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -25,725 +24,177 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
+#include "dbaundomanager.hxx"
+#include "singledoccontroller.hxx"
#include "browserids.hxx"
-#include "commontypes.hxx"
-#include "dataview.hxx"
#include "dbu_misc.hrc"
#include "dbustrings.hrc"
#include "moduledbu.hxx"
-#include "singledoccontroller.hxx"
-#include <com/sun/star/frame/XUntitledNumbers.hpp>
/** === begin UNO includes === **/
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/sdb/XDocumentDataSource.hpp>
-#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
-#include <com/sun/star/sdbc/XDataSource.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/frame/XUntitledNumbers.hpp>
/** === end UNO includes === **/
-#include <comphelper/sequence.hxx>
-#include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbtools.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <toolkit/unohlp.hxx>
-#include <tools/debug.hxx>
-#include <tools/diagnose_ex.h>
-#include <vcl/msgbox.hxx>
+#include <svl/undo.hxx>
+
+#include <boost/scoped_ptr.hpp>
-//........................................................................
+//......................................................................................................................
namespace dbaui
{
-//........................................................................
+//......................................................................................................................
/** === begin UNO using === **/
- using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Reference;
- using ::com::sun::star::beans::XPropertySet;
- using ::com::sun::star::util::XNumberFormatter;
- using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Type;
- using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::container::XChild;
- using ::com::sun::star::sdbc::XDataSource;
- using ::com::sun::star::util::XNumberFormatter;
- using ::com::sun::star::util::XNumberFormatsSupplier;
- using ::com::sun::star::frame::XFrame;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::sdbc::SQLException;
- using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::document::XUndoManager;
+ using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::beans::PropertyValue;
- using ::com::sun::star::frame::XModel;
- using ::com::sun::star::sdb::XOfficeDatabaseDocument;
- using ::com::sun::star::awt::XWindow;
- using ::com::sun::star::sdbc::XDatabaseMetaData;
- using ::com::sun::star::sdb::XDocumentDataSource;
- using ::com::sun::star::document::XEmbeddedScripts;
- using ::com::sun::star::lang::IllegalArgumentException;
- using ::com::sun::star::uno::UNO_SET_THROW;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::frame::XUntitledNumbers;
- using ::com::sun::star::beans::PropertyVetoException;
+ using ::com::sun::star::lang::EventObject;
/** === end UNO using === **/
- class DataSourceHolder
+ //==================================================================================================================
+ //= OSingleDocumentController_Data
+ //==================================================================================================================
+ struct OSingleDocumentController_Data
{
- public:
- DataSourceHolder()
- {
- }
+ ::boost::scoped_ptr< UndoManager > m_pUndoManager;
- DataSourceHolder( const Reference< XDataSource >& _rxDataSource )
+ OSingleDocumentController_Data( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ :m_pUndoManager( new UndoManager( i_parent, i_mutex ) )
{
- m_xDataSource = _rxDataSource;
- Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY );
- if ( xDocDS.is() )
- m_xDocument = xDocDS->getDatabaseDocument();
-
- m_xDataSourceProps.set( m_xDataSource, UNO_QUERY );
}
-
- const Reference< XDataSource >& getDataSource() const { return m_xDataSource; }
- const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; }
- const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; }
-
- bool is() const { return m_xDataSource.is(); }
-
- void clear()
- {
- m_xDataSource.clear();
- m_xDocument.clear();
- }
-
- private:
- Reference< XDataSource > m_xDataSource;
- Reference< XPropertySet > m_xDataSourceProps;
- Reference< XOfficeDatabaseDocument > m_xDocument;
};
- struct OSingleDocumentControllerImpl
- {
- private:
- ::boost::optional< bool > m_aDocScriptSupport;
-
- public:
- OModuleClient m_aModuleClient;
- ::dbtools::SQLExceptionInfo m_aCurrentError; // contains the current error which can be set through IEnvironment
-
- ::cppu::OInterfaceContainerHelper
- m_aModifyListeners;
-
- // <properties>
- SharedConnection m_xConnection;
- ::dbtools::DatabaseMetaData m_aSdbMetaData;
- // </properties>
- ::rtl::OUString m_sDataSourceName; // the data source we're working for
- DataSourceHolder m_aDataSource;
- Reference< XModel > m_xDocument;
- Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier
- sal_Int32 m_nDocStartNumber;
- sal_Bool m_bSuspended; // is true when the controller was already suspended
- sal_Bool m_bEditable; // is the control readonly or not
- sal_Bool m_bModified; // is the data modified
- bool m_bNotAttached;
-
- OSingleDocumentControllerImpl( ::osl::Mutex& i_rMutex )
- :m_aDocScriptSupport()
- ,m_aModifyListeners( i_rMutex )
- ,m_nDocStartNumber(0)
- ,m_bSuspended( sal_False )
- ,m_bEditable(sal_True)
- ,m_bModified(sal_False)
- ,m_bNotAttached(true)
- {
- }
-
- bool documentHasScriptSupport() const
- {
- OSL_PRECOND( !!m_aDocScriptSupport,
- "OSingleDocumentControllerImpl::documentHasScriptSupport: not completely initialized, yet - don't know!?" );
- return !!m_aDocScriptSupport && *m_aDocScriptSupport;
- }
-
- void setDocumentScriptSupport( const bool _bSupport )
- {
- OSL_PRECOND( !m_aDocScriptSupport,
- "OSingleDocumentControllerImpl::setDocumentScriptSupport: already initialized!" );
- m_aDocScriptSupport = ::boost::optional< bool >( _bSupport );
- }
- };
-
- //====================================================================
+ //==================================================================================================================
//= OSingleDocumentController
- //====================================================================
- //--------------------------------------------------------------------
- OSingleDocumentController::OSingleDocumentController(const Reference< XMultiServiceFactory >& _rxORB)
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ OSingleDocumentController::OSingleDocumentController( const Reference< XMultiServiceFactory >& _rxORB )
:OSingleDocumentController_Base( _rxORB )
- ,m_pImpl( new OSingleDocumentControllerImpl( getMutex() ) )
+ ,m_pData( new OSingleDocumentController_Data( *this, getMutex() ) )
{
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
OSingleDocumentController::~OSingleDocumentController()
{
}
- //--------------------------------------------------------------------
- void OSingleDocumentController::impl_initialize()
- {
- OGenericUnoController::impl_initialize();
-
- const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
-
- Reference< XConnection > xConnection;
- xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection );
-
- if ( !xConnection.is() )
- ::dbtools::isEmbeddedInDatabase( getModel(), xConnection );
-
- if ( xConnection.is() )
- initializeConnection( xConnection );
-
- bool bShowError = true;
- if ( !isConnected() )
- {
- reconnect( sal_False );
- bShowError = false;
- }
- if ( !isConnected() )
- {
- if ( bShowError )
- connectionLostMessage();
- throw IllegalArgumentException();
- }
- }
-
- //--------------------------------------------------------------------
- Any SAL_CALL OSingleDocumentController::queryInterface(const Type& _rType) throw (RuntimeException)
- {
- if ( _rType.equals( XScriptInvocationContext::static_type() ) )
- {
- if ( m_pImpl->documentHasScriptSupport() )
- return makeAny( Reference< XScriptInvocationContext >( this ) );
- return Any();
- }
-
- return OSingleDocumentController_Base::queryInterface( _rType );
- }
-
- //--------------------------------------------------------------------
- Sequence< Type > SAL_CALL OSingleDocumentController::getTypes( ) throw (RuntimeException)
- {
- Sequence< Type > aTypes( OSingleDocumentController_Base::getTypes() );
- if ( !m_pImpl->documentHasScriptSupport() )
- {
- Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 );
- ::std::remove_copy_if(
- aTypes.getConstArray(),
- aTypes.getConstArray() + aTypes.getLength(),
- aStrippedTypes.getArray(),
- ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() )
- );
- aTypes = aStrippedTypes;
- }
- return aTypes;
- }
-
- //--------------------------------------------------------------------
- void OSingleDocumentController::initializeConnection( const Reference< XConnection >& _rxForeignConn )
- {
- DBG_ASSERT( !isConnected(), "OSingleDocumentController::initializeConnection: not to be called when already connected!" );
- // usually this gets called from within initialize of derived classes ...
- if ( isConnected() )
- disconnect();
-
- m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership );
- m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection );
- startConnectionListening( m_pImpl->m_xConnection );
-
- // get the data source the connection belongs to
- try
- {
- // determine our data source
- OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: already a data source in this phase?" );
- {
- Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY );
- Reference< XDataSource > xDS;
- if ( xConnAsChild.is() )
- xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY );
-
- // (take the indirection through XDataSource to ensure we have a correct object ....)
- m_pImpl->m_aDataSource = xDS;
- }
- OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: unable to obtain the data source object!" );
-
- if ( m_pImpl->m_bNotAttached )
- {
- Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY );
- m_pImpl->m_nDocStartNumber = 1;
- if ( xUntitledProvider.is() )
- m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) );
- }
-
- // determine the availability of script support in our document. Our own XScriptInvocationContext
- // interface depends on this
- m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() );
-
- // get a number formatter
- Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW );
- xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName;
- DBG_ASSERT( m_pImpl->m_sDataSourceName.getLength(), "OSingleDocumentController::initializeConnection: invalid data source name!" );
- Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection);
- if(xSupplier.is())
- {
- m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB()
- ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY);
- m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier);
- }
- OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!");
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- //--------------------------------------------------------------------
- void OSingleDocumentController::reconnect( sal_Bool _bUI )
- {
- OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!");
-
- stopConnectionListening( m_pImpl->m_xConnection );
- m_pImpl->m_aSdbMetaData.reset( NULL );
- m_pImpl->m_xConnection.clear();
-
- // reconnect
- sal_Bool bReConnect = sal_True;
- if ( _bUI )
- {
- QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) );
- bReConnect = ( RET_YES == aQuery.Execute() );
- }
-
- // now really reconnect ...
- if ( bReConnect )
- {
- m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership );
- m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection );
- }
-
- // invalidate all slots
- InvalidateAll();
- }
-
- //--------------------------------------------------------------------
- void OSingleDocumentController::disconnect()
- {
- stopConnectionListening(m_pImpl->m_xConnection);
- m_pImpl->m_aSdbMetaData.reset( NULL );
- m_pImpl->m_xConnection.clear();
-
- InvalidateAll();
- }
-
- //--------------------------------------------------------------------
- void OSingleDocumentController::losingConnection()
- {
- // our connection was disposed so we need a new one
- reconnect( sal_True );
- }
-
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
void SAL_CALL OSingleDocumentController::disposing()
{
OSingleDocumentController_Base::disposing();
- m_aUndoManager.Clear();
-
- disconnect();
-
- attachFrame( Reference < XFrame >() );
-
- m_pImpl->m_aDataSource.clear();
- }
-
- //--------------------------------------------------------------------
- sal_Bool OSingleDocumentController::Construct(Window* _pParent)
- {
- DBG_ASSERT( getView(), "OSingleDocumentController::Construct: have no view!" );
- if ( getView() )
- getView()->enableSeparator( );
-
- return OSingleDocumentController_Base::Construct( _pParent );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL OSingleDocumentController::disposing(const EventObject& _rSource) throw( RuntimeException )
- {
- if ( _rSource.Source == getConnection() )
- {
- if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect
- && !getBroadcastHelper().bInDispose
- && !getBroadcastHelper().bDisposed
- && isConnected()
- )
- {
- losingConnection();
- }
- else
- {
- m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership );
- // this prevents the "disposeComponent" call in disconnect
- disconnect();
- }
- }
- else
- OSingleDocumentController_Base::disposing( _rSource );
- }
-
- //--------------------------------------------------------------------
- void OSingleDocumentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState,
- const sal_Int32 _nErrorCode )
- {
- m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ),
- _nErrorCode );
- }
- //--------------------------------------------------------------------
- void OSingleDocumentController::clearError()
- {
- m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo();
+ ClearUndoManager();
+ m_pData->m_pUndoManager->disposing();
}
- //--------------------------------------------------------------------
- sal_Bool OSingleDocumentController::hasError() const
+ // -----------------------------------------------------------------------------
+ void SAL_CALL OSingleDocumentController::disposing( const EventObject& i_event ) throw( RuntimeException )
{
- return m_pImpl->m_aCurrentError.isValid();
+ // simply disambiguate
+ OSingleDocumentController_Base::disposing( i_event );
}
- //--------------------------------------------------------------------
- const ::dbtools::SQLExceptionInfo& OSingleDocumentController::getError() const
+ // -----------------------------------------------------------------------------
+ void OSingleDocumentController::ClearUndoManager()
{
- return m_pImpl->m_aCurrentError;
+ GetUndoManager().Clear();
}
- //--------------------------------------------------------------------
- void OSingleDocumentController::displayError()
+ // -----------------------------------------------------------------------------
+ SfxUndoManager& OSingleDocumentController::GetUndoManager() const
{
- showError( m_pImpl->m_aCurrentError );
+ return m_pData->m_pUndoManager->GetSfxUndoManager();
}
- //--------------------------------------------------------------------
- sal_Bool SAL_CALL OSingleDocumentController::suspend(sal_Bool bSuspend) throw( RuntimeException )
+ // -----------------------------------------------------------------------------
+ void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction)
{
- m_pImpl->m_bSuspended = bSuspend;
- if ( !bSuspend && !isConnected() )
- reconnect(sal_True);
+ // add undo action
+ GetUndoManager().AddUndoAction( _pAction );
+ // when we add an undo action the controller was modified
+ setModified( sal_True );
- return sal_True;
+ // now inform me that or states changed
+ InvalidateFeature( ID_BROWSER_UNDO );
+ InvalidateFeature( ID_BROWSER_REDO );
}
// -----------------------------------------------------------------------------
- sal_Bool SAL_CALL OSingleDocumentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException )
+ Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager( ) throw (RuntimeException)
{
- if ( !_rxModel.is() )
- return sal_False;
- if ( !OSingleDocumentController_Base::attachModel( _rxModel ) )
- return sal_False;
-
- m_pImpl->m_bNotAttached = false;
- if ( m_pImpl->m_nDocStartNumber == 1 )
- releaseNumberForComponent();
-
- Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY );
- m_pImpl->m_nDocStartNumber = 1;
- if ( xUntitledProvider.is() )
- m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) );
-
- return sal_True;
+ return m_pData->m_pUndoManager.get();
}
// -----------------------------------------------------------------------------
FeatureState OSingleDocumentController::GetState(sal_uInt16 _nId) const
{
FeatureState aReturn;
- // (disabled automatically)
- aReturn.bEnabled = sal_True;
-
- switch (_nId)
+ switch ( _nId )
{
case ID_BROWSER_UNDO:
- aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetUndoActionCount() != 0;
+ aReturn.bEnabled = isEditable() && GetUndoManager().GetUndoActionCount() != 0;
if ( aReturn.bEnabled )
{
String sUndo(ModuleRes(STR_UNDO_COLON));
sUndo += String(RTL_CONSTASCII_USTRINGPARAM(" "));
- sUndo += m_aUndoManager.GetUndoActionComment();
+ sUndo += GetUndoManager().GetUndoActionComment();
aReturn.sTitle = sUndo;
}
break;
+
case ID_BROWSER_REDO:
- aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetRedoActionCount() != 0;
+ aReturn.bEnabled = isEditable() && GetUndoManager().GetRedoActionCount() != 0;
if ( aReturn.bEnabled )
{
String sRedo(ModuleRes(STR_REDO_COLON));
sRedo += String(RTL_CONSTASCII_USTRINGPARAM(" "));
- sRedo += m_aUndoManager.GetRedoActionComment();
+ sRedo += GetUndoManager().GetRedoActionComment();
aReturn.sTitle = sRedo;
}
break;
+
default:
aReturn = OSingleDocumentController_Base::GetState(_nId);
}
return aReturn;
}
// -----------------------------------------------------------------------------
- void OSingleDocumentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs)
+ void OSingleDocumentController::Execute( sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs )
{
- switch(_nId)
+ switch ( _nId )
{
- case ID_BROWSER_CLOSE:
- closeTask();
- return;
case ID_BROWSER_UNDO:
- m_aUndoManager.Undo();
- InvalidateFeature(ID_BROWSER_REDO);
+ GetUndoManager().Undo();
+ InvalidateFeature( ID_BROWSER_UNDO );
+ InvalidateFeature( ID_BROWSER_REDO );
break;
+
case ID_BROWSER_REDO:
- m_aUndoManager.Redo();
- InvalidateFeature(ID_BROWSER_UNDO);
+ GetUndoManager().Redo();
+ InvalidateFeature( ID_BROWSER_UNDO );
+ InvalidateFeature( ID_BROWSER_REDO );
break;
+
default:
OSingleDocumentController_Base::Execute( _nId, _rArgs );
break;
}
InvalidateFeature(_nId);
}
- // -----------------------------------------------------------------------------
- SfxUndoManager* OSingleDocumentController::getUndoMgr()
- {
- return &m_aUndoManager;
- }
- // -----------------------------------------------------------------------------
- void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction)
- {
- // add undo action
- m_aUndoManager.AddUndoAction(_pAction);
- // when we add an undo action the controller was modified
- setModified(sal_True);
- // now inform me that or states changed
- InvalidateFeature(ID_BROWSER_UNDO);
- InvalidateFeature(ID_BROWSER_REDO);
- }
-
- // -----------------------------------------------------------------------------
- ::rtl::OUString OSingleDocumentController::getDataSourceName() const
- {
- ::rtl::OUString sName;
- Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() );
- if ( xDataSourceProps.is() )
- xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName;
- return sName;
- }
- // -----------------------------------------------------------------------------
- void OSingleDocumentController::connectionLostMessage() const
- {
- String aMessage(ModuleRes(RID_STR_CONNECTION_LOST));
- Reference< XWindow > xWindow = getTopMostContainerWindow();
- Window* pWin = NULL;
- if ( xWindow.is() )
- pWin = VCLUnoHelper::GetWindow(xWindow);
- if ( !pWin )
- pWin = getView()->Window::GetParent();
-
- InfoBox(pWin, aMessage).Execute();
- }
- // -----------------------------------------------------------------------------
- const Reference< XConnection >& OSingleDocumentController::getConnection() const
- {
- return m_pImpl->m_xConnection;
- }
-
- // -----------------------------------------------------------------------------
- sal_Bool OSingleDocumentController::isReadOnly() const
- {
- return !m_pImpl->m_bEditable;
- }
-
- // -----------------------------------------------------------------------------
- sal_Bool OSingleDocumentController::isEditable() const
- {
- return m_pImpl->m_bEditable;
- }
-
- // -----------------------------------------------------------------------------
- void OSingleDocumentController::setEditable(sal_Bool _bEditable)
- {
- m_pImpl->m_bEditable = _bEditable;
- }
-
- // -----------------------------------------------------------------------------
- const ::dbtools::DatabaseMetaData& OSingleDocumentController::getSdbMetaData() const
- {
- return m_pImpl->m_aSdbMetaData;
- }
-
- // -----------------------------------------------------------------------------
- sal_Bool OSingleDocumentController::isConnected() const
- {
- return m_pImpl->m_xConnection.is();
- }
-
- // -----------------------------------------------------------------------------
- Reference< XDatabaseMetaData > OSingleDocumentController::getMetaData( ) const
- {
- Reference< XDatabaseMetaData > xMeta;
- try
- {
- if ( isConnected() )
- xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return xMeta;
- }
-
- // -----------------------------------------------------------------------------
- const Reference< XPropertySet >& OSingleDocumentController::getDataSource() const
- {
- return m_pImpl->m_aDataSource.getDataSourceProps();
- }
-
- // -----------------------------------------------------------------------------
- sal_Bool OSingleDocumentController::haveDataSource() const
- {
- return m_pImpl->m_aDataSource.is();
- }
-
- // -----------------------------------------------------------------------------
- Reference< XModel > OSingleDocumentController::getDatabaseDocument() const
- {
- return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY );
- }
-
- // -----------------------------------------------------------------------------
- Reference< XNumberFormatter > OSingleDocumentController::getNumberFormatter() const
- {
- return m_pImpl->m_xFormatter;
- }
-
- // -----------------------------------------------------------------------------
- Reference< XModel > OSingleDocumentController::getPrivateModel() const
- {
- return getDatabaseDocument();
- }
- // -----------------------------------------------------------------------------
- // XTitle
- ::rtl::OUString SAL_CALL OSingleDocumentController::getTitle()
- throw (RuntimeException)
- {
- ::osl::MutexGuard aGuard( getMutex() );
- if ( m_bExternalTitle )
- return impl_getTitleHelper_throw()->getTitle ();
-
- ::rtl::OUStringBuffer sTitle;
- Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY);
- if ( xTitle.is() )
- {
- sTitle.append( xTitle->getTitle() );
- sTitle.appendAscii(" : ");
- }
- sTitle.append( getPrivateTitle() );
- // There can be only one view with the same object
- //const sal_Int32 nCurrentView = getCurrentStartNumber();
- //if ( nCurrentView > 1 )
- //{
- // sTitle.appendAscii(" : ");
- // sTitle.append(nCurrentView);
- //}
-
- return sTitle.makeStringAndClear();
- }
- // -----------------------------------------------------------------------------
- sal_Int32 OSingleDocumentController::getCurrentStartNumber() const
- {
- return m_pImpl->m_nDocStartNumber;
- }
-
- // -----------------------------------------------------------------------------
- Reference< XEmbeddedScripts > SAL_CALL OSingleDocumentController::getScriptContainer() throw (RuntimeException)
- {
- ::osl::MutexGuard aGuard( getMutex() );
- if ( !m_pImpl->documentHasScriptSupport() )
- return NULL;
-
- return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW );
- }
-
- // -----------------------------------------------------------------------------
- void SAL_CALL OSingleDocumentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException)
- {
- ::osl::MutexGuard aGuard( getMutex() );
- m_pImpl->m_aModifyListeners.addInterface( i_Listener );
- }
-
- // -----------------------------------------------------------------------------
- void SAL_CALL OSingleDocumentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException)
- {
- ::osl::MutexGuard aGuard( getMutex() );
- m_pImpl->m_aModifyListeners.removeInterface( i_Listener );
- }
-
- // -----------------------------------------------------------------------------
- ::sal_Bool SAL_CALL OSingleDocumentController::isModified( ) throw (RuntimeException)
- {
- ::osl::MutexGuard aGuard( getMutex() );
- return impl_isModified();
- }
-
- // -----------------------------------------------------------------------------
- void SAL_CALL OSingleDocumentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException)
- {
- ::osl::ClearableMutexGuard aGuard( getMutex() );
-
- if ( m_pImpl->m_bModified == i_bModified )
- return;
-
- m_pImpl->m_bModified = i_bModified;
- impl_onModifyChanged();
-
- EventObject aEvent( *this );
- aGuard.clear();
- m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent );
- }
-
- // -----------------------------------------------------------------------------
- sal_Bool OSingleDocumentController::impl_isModified() const
- {
- return m_pImpl->m_bModified;
- }
-
- // -----------------------------------------------------------------------------
- void OSingleDocumentController::impl_onModifyChanged()
- {
- InvalidateFeature( ID_BROWSER_SAVEDOC );
- if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) )
- InvalidateFeature( ID_BROWSER_SAVEASDOC );
- }
-
-//........................................................................
-} // namespace dbaui
-//........................................................................
+//......................................................................................................................
+} // namespace dbaui
+//......................................................................................................................
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 0eb7c09f29e9..576fa52c1a21 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -1957,7 +1957,7 @@ namespace
pJoinType = pNode->getChild(2);
}
- if (SQL_ISRULE(pJoinType,join_type) && SQL_ISTOKEN(pJoinType->getChild(0),INNER))
+ if (SQL_ISRULE(pJoinType,join_type) && (!pJoinType->count() || SQL_ISTOKEN(pJoinType->getChild(0),INNER)))
{
eJoinType = INNER_JOIN;
}
@@ -2177,7 +2177,7 @@ namespace
while ( false );
// Durch das Neuerzeugen wurden wieder Undo-Actions in den Manager gestellt
- rController.getUndoMgr()->Clear();
+ rController.ClearUndoManager();
_pSelectionBrw->Invalidate();
return eErrorCode;
}
@@ -3234,7 +3234,7 @@ void OQueryDesignView::initByFieldDescriptions( const Sequence< PropertyValue >&
InsertField( pField, sal_True, sal_False );
}
- rController.getUndoMgr()->Clear();
+ rController.ClearUndoManager();
m_pSelectionBox->Invalidate();
}
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index c083392a9613..16052816f07a 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -847,8 +847,8 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin)
// mein Parent brauche ich, da es vom Loeschen erfahren soll
OQueryDesignView* pParent = static_cast<OQueryDesignView*>(getDesignView());
- SfxUndoManager* pUndoMgr = m_pView->getController().getUndoMgr();
- pUndoMgr->EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() );
+ SfxUndoManager& rUndoMgr = m_pView->getController().GetUndoManager();
+ rUndoMgr.EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() );
// Undo-Action anlegen
OQueryTabWinDelUndoAct* pUndoAction = new OQueryTabWinDelUndoAct(this);
@@ -861,7 +861,7 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin)
pParent->TableDeleted( static_cast< OQueryTableWindowData*>(pTabWin->GetData().get())->GetAliasName() );
m_pView->getController().addUndoActionAndInvalidate( pUndoAction );
- pUndoMgr->LeaveListAction();
+ rUndoMgr.LeaveListAction();
if (m_lnkTabWinsChangeHandler.IsSet())
{
diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
index ec3b22899225..5943485a7bb5 100644
--- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
+++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
@@ -299,7 +299,7 @@ bool OQueryViewSwitch::impl_postViewSwitch( const bool i_bGraphicalDesign, const
if ( pContainer )
pContainer->Resize();
- m_pDesignView->getController().getUndoMgr()->Clear();
+ m_pDesignView->getController().ClearUndoManager();
m_pDesignView->getController().InvalidateAll();
return i_bSuccess;
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 66b6eec9465c..223c00cfbd2a 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1021,7 +1021,7 @@ sal_Bool OSelectionBrowseBox::SaveModified()
strOldCellContents = pEntry->GetField();
bListAction = sal_True;
if ( !m_bInUndoMode )
- rController.getUndoMgr()->EnterListAction(String(),String());
+ rController.GetUndoManager().EnterListAction(String(),String());
USHORT nPos = m_pFieldCell->GetEntryPos(aFieldName);
String aAliasName = pEntry->GetAlias();
@@ -1050,7 +1050,7 @@ sal_Bool OSelectionBrowseBox::SaveModified()
{
sNewValue = aFieldName;
if ( !m_bInUndoMode )
- static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->LeaveListAction();
+ static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().LeaveListAction();
bListAction = sal_False;
}
else
@@ -1282,7 +1282,7 @@ sal_Bool OSelectionBrowseBox::SaveModified()
}
if ( bListAction && !m_bInUndoMode )
- static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->LeaveListAction();
+ static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().LeaveListAction();
return pEntry != NULL && !bError;
}
@@ -2644,7 +2644,7 @@ void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String
if ( !_bListAction )
{
_bListAction = sal_True;
- static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->EnterListAction(String(),String());
+ static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(String(),String());
}
appendUndoAction(_rOldValue,_rNewValue,_nRow);
}
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 06b6804fa9be..2659580a91b4 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -685,9 +685,9 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
break;
case SID_BROWSER_CLEAR_QUERY:
{
- getUndoMgr()->EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() );
+ GetUndoManager().EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() );
getContainer()->clear();
- getUndoMgr()->LeaveListAction();
+ GetUndoManager().LeaveListAction();
setStatement_fireEvent( ::rtl::OUString() );
if(m_bGraphicalDesign)
@@ -1037,7 +1037,7 @@ void OQueryController::impl_initialize()
}
}
- getUndoMgr()->Clear();
+ ClearUndoManager();
if ( ( m_bGraphicalDesign )
&& ( ( !m_sName.getLength() && !editingCommand() )
@@ -1789,7 +1789,7 @@ void OQueryController::reset()
{
impl_reset();
getContainer()->reset( NULL );
- getUndoMgr()->Clear();
+ ClearUndoManager();
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 99fe03a7004d..66dbc066324c 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -494,7 +494,7 @@ IMPL_LINK( ORelationController, OnThreadFinished, void*, /*NOTINTERESTEDIN*/ )
{
getView()->initialize(); // show the windows and fill with our informations
getView()->Invalidate(INVALIDATE_NOERASE);
- getUndoMgr()->Clear(); // clear all undo redo things
+ ClearUndoManager();
setModified(sal_False); // and we are not modified yet
if(m_vTableData.empty())
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 0c9d0cc1a456..dfbc022d4f7d 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -375,7 +375,7 @@ void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin )
OSQLWarningBox aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES );
if ( m_bInRemove || aDlg.Execute() == RET_YES )
{
- m_pView->getController().getUndoMgr()->Clear();
+ m_pView->getController().ClearUndoManager();
OJoinTableView::RemoveTabWin( pTabWin );
m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION);
@@ -383,30 +383,7 @@ void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin )
m_pView->getController().InvalidateFeature(ID_BROWSER_REDO);
}
}
-// -----------------------------------------------------------------------------
-//namespace
-//{
-// class OReleationAskDialog : public ButtonDialog
-// {
-// FixedImage m_aInfoImage;
-// FixedText m_aTitle;
-// FixedText m_aMessage;
-// public:
-// OReleationDialog(Window* _pParent) : ButtonDialog(_pParent,WB_HORZ | WB_STDDIALOG)
-// ,m_aInfoImage(this)
-// ,m_aTitle(this,WB_WORDBREAK | WB_LEFT)
-// ,m_aMessage(this,WB_WORDBREAK | WB_LEFT)
-// {
-// m_aMessage.SetText(ModuleRes(STR_QUERY_REL_EDIT_RELATION));
-// m_aMessage.Show();
-//
-// // Changed as per BugID 79541 Branding/Configuration
-// String sDialogTitle( lcl_getProductName() );
-// SetText( sDialogTitle.AppendAscii( " Base" ) );
-// m_aTitle.Show();
-// }
-// };
-//}
+
// -----------------------------------------------------------------------------
void ORelationTableView::lookForUiActivities()
{
@@ -469,7 +446,7 @@ void ORelationTableView::_elementRemoved( const container::ContainerEvent& _rEve
OTableWindow* pTableWindow = GetTabWindow(sName);
if ( pTableWindow )
{
- m_pView->getController().getUndoMgr()->Clear();
+ m_pView->getController().ClearUndoManager();
OJoinTableView::RemoveTabWin( pTableWindow );
m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION);
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 4d3cdb6652a9..693c7dbf585a 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -263,9 +263,9 @@ OTableEditorCtrl::OTableEditorCtrl(Window* pWindow)
}
//------------------------------------------------------------------------------
-SfxUndoManager* OTableEditorCtrl::GetUndoManager() const
+SfxUndoManager& OTableEditorCtrl::GetUndoManager() const
{
- return GetView()->getController().getUndoMgr();
+ return GetView()->getController().GetUndoManager();
}
//------------------------------------------------------------------------------
@@ -388,7 +388,7 @@ OTableEditorCtrl::~OTableEditorCtrl()
DBG_DTOR(OTableEditorCtrl,NULL);
//////////////////////////////////////////////////////////////////////
// Undo-Manager zuruecksetzen
- GetUndoManager()->Clear();
+ GetUndoManager().Clear();
//////////////////////////////////////////////////////////////////////
// Moegliche Events aus Queue entfernen
@@ -683,7 +683,7 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId)
// Wenn FieldDescr existiert, wurde Feld geloescht und alter Inhalt wird wiederhergestellt
if (pActFieldDescr)
{
- GetUndoManager()->AddUndoAction(new OTableEditorTypeSelUndoAct(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo()));
+ GetUndoManager().AddUndoAction(new OTableEditorTypeSelUndoAct(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo()));
SwitchType(TOTypeInfoSP());
pActFieldDescr = pActRow->GetActFieldDescr();
}
@@ -858,7 +858,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId )
default: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_ATTRIBUTE ) ); break;
}
- GetUndoManager()->EnterListAction( sActionDescription, String() );
+ GetUndoManager().EnterListAction( sActionDescription, String() );
if (!pActFieldDescr)
{
const OTypeInfoMap* pTypeInfoMap = GetView()->getController().getTypeInfo();
@@ -875,20 +875,20 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId )
nInvalidateTypeEvent = Application::PostUserEvent( LINK(this, OTableEditorCtrl, InvalidateFieldType) );
pActFieldDescr = pActRow->GetActFieldDescr();
pDescrWin->DisplayData( pActFieldDescr );
- GetUndoManager()->AddUndoAction( new OTableEditorTypeSelUndoAct(this, nRow, nColId+1, TOTypeInfoSP()) );
+ GetUndoManager().AddUndoAction( new OTableEditorTypeSelUndoAct(this, nRow, nColId+1, TOTypeInfoSP()) );
}
if( nColId != FIELD_TYPE )
- GetUndoManager()->AddUndoAction( new OTableDesignCellUndoAct(this, nRow, nColId) );
+ GetUndoManager().AddUndoAction( new OTableDesignCellUndoAct(this, nRow, nColId) );
else
{
- GetUndoManager()->AddUndoAction(new OTableEditorTypeSelUndoAct(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo()));
+ GetUndoManager().AddUndoAction(new OTableEditorTypeSelUndoAct(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo()));
resetType();
}
SaveData(nRow,nColId);
// SaveData could create a undo action as well
- GetUndoManager()->LeaveListAction();
+ GetUndoManager().LeaveListAction();
RowModified(nRow);
CellControllerRef xController(Controller());
if(xController.Is())
@@ -1051,7 +1051,7 @@ void OTableEditorCtrl::InsertRows( long nRow )
//////////////////////////////////////////////////////////////////////
// Undo-Action erzeugen
- GetUndoManager()->AddUndoAction( new OTableEditorInsUndoAct(this, nRow,vInsertedUndoRedoRows) );
+ GetUndoManager().AddUndoAction( new OTableEditorInsUndoAct(this, nRow,vInsertedUndoRedoRows) );
GetView()->getController().setModified( sal_True );
InvalidateFeatures();
}
@@ -1063,7 +1063,7 @@ void OTableEditorCtrl::DeleteRows()
OSL_ENSURE(GetView()->getController().isDropAllowed(),"Call of DeleteRows not valid here. Please check isDropAllowed!");
//////////////////////////////////////////////////////////////////////
// Undo-Action erzeugen
- GetUndoManager()->AddUndoAction( new OTableEditorDelUndoAct(this) );
+ GetUndoManager().AddUndoAction( new OTableEditorDelUndoAct(this) );
//////////////////////////////////////////////////////////////////////
@@ -1111,7 +1111,7 @@ void OTableEditorCtrl::InsertNewRows( long nRow )
long nInsertRows = GetSelectRowCount();
if( !nInsertRows )
nInsertRows = 1;
- GetUndoManager()->AddUndoAction( new OTableEditorInsNewUndoAct(this, nRow, nInsertRows) );
+ GetUndoManager().AddUndoAction( new OTableEditorInsNewUndoAct(this, nRow, nInsertRows) );
//////////////////////////////////////////////////////////////////////
// Zahl der selektierten Zeilen werden neu eingefuegt
for( long i=nRow; i<(nRow+nInsertRows); i++ )
@@ -1889,7 +1889,7 @@ void OTableEditorCtrl::SetPrimaryKey( sal_Bool bSet )
}
}
- GetUndoManager()->AddUndoAction( new OPrimKeyUndoAct(this, aDeletedPrimKeys, aInsertedPrimKeys) );
+ GetUndoManager().AddUndoAction( new OPrimKeyUndoAct(this, aDeletedPrimKeys, aInsertedPrimKeys) );
//////////////////////////////////////////////////////////////////////
// Handle-Spalte invalidieren
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx
index 2a7a36f3a051..edf941cf1f39 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx
@@ -148,7 +148,7 @@ namespace dbaui
virtual ~OTableEditorCtrl();
virtual BOOL CursorMoving(long nNewRow, USHORT nNewCol);
virtual void UpdateAll();
- SfxUndoManager* GetUndoManager() const;
+ SfxUndoManager& GetUndoManager() const;
void SetDescrWin( OTableFieldDescWin* pWin ){ pDescrWin = pWin; if (pDescrWin && pActRow) pDescrWin->DisplayData(pActRow->GetActFieldDescr()); }
BOOL SaveCurRow();
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index a848eb8de18c..fa8d1809b595 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -568,7 +568,7 @@ void OTableController::impl_initialize()
{
loadData(); // fill the column information form the table
getView()->initialize(); // show the windows and fill with our informations
- getUndoMgr()->Clear(); // clear all undo redo things
+ ClearUndoManager();
setModified(sal_False); // and we are not modified yet
}
catch( const Exception& )
@@ -666,11 +666,6 @@ void OTableController::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:EditDoc", ID_BROWSER_EDITDOC, CommandGroup::EDIT );
}
// -----------------------------------------------------------------------------
-SfxUndoManager* OTableController::getUndoMgr()
-{
- return &m_aUndoManager;
-}
-// -----------------------------------------------------------------------------
void OTableController::impl_onModifyChanged()
{
OSingleDocumentController::impl_onModifyChanged();
@@ -1521,7 +1516,7 @@ void OTableController::reSyncRows()
}
static_cast<OTableDesignView*>(getView())->reSync(); // show the windows and fill with our informations
- getUndoMgr()->Clear(); // clear all undo redo things
+ ClearUndoManager();
setModified(sal_False); // and we are not modified yet
}
// -----------------------------------------------------------------------------
@@ -1577,7 +1572,7 @@ void OTableController::reload()
{
loadData(); // fill the column information form the table
static_cast<OTableDesignView*>(getView())->reSync(); // show the windows and fill with our informations
- getUndoMgr()->Clear(); // clear all undo redo things
+ ClearUndoManager();
setModified(sal_False); // and we are not modified yet
static_cast<OTableDesignView*>(getView())->Invalidate();
}
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index be1cf5288b21..d3620aea4901 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1178,8 +1178,15 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
aSourceColTypes.reserve( nCount + 1 );
aSourceColTypes.push_back( -1 ); // just to avoid a everytime i-1 call
+ ::std::vector< sal_Int32 > aSourcePrec;
+ aSourcePrec.reserve( nCount + 1 );
+ aSourcePrec.push_back( -1 ); // just to avoid a everytime i-1 call
+
for ( sal_Int32 k=1; k <= nCount; ++k )
+ {
aSourceColTypes.push_back( xMeta->getColumnType( k ) );
+ aSourcePrec.push_back( xMeta->getPrecision( k ) );
+ }
// now create, fill and execute the prepared statement
Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnMapping ), UNO_SET_THROW );
@@ -1291,7 +1298,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
case DataType::LONGVARBINARY:
case DataType::BINARY:
case DataType::VARBINARY:
- case DataType::BIT:
aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes );
break;
@@ -1307,6 +1313,13 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp );
break;
+ case DataType::BIT:
+ if ( aSourcePrec[nSourceColumn] > 1 )
+ {
+ aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes );
+ break;
+ }
+ // run through
case DataType::BOOLEAN:
aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean );
break;
diff --git a/default_images/hicontrast/shared/spinner-16-01.png b/default_images/hicontrast/shared/spinner-16-01.png
new file mode 100755
index 000000000000..5018887da569
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-16-01.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-16-02.png b/default_images/hicontrast/shared/spinner-16-02.png
new file mode 100755
index 000000000000..082ec90f079b
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-16-02.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-16-03.png b/default_images/hicontrast/shared/spinner-16-03.png
new file mode 100755
index 000000000000..db6de0599497
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-16-03.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-16-04.png b/default_images/hicontrast/shared/spinner-16-04.png
new file mode 100755
index 000000000000..df295bc33c0d
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-16-04.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-16-05.png b/default_images/hicontrast/shared/spinner-16-05.png
new file mode 100755
index 000000000000..25f74e693995
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-16-05.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-16-06.png b/default_images/hicontrast/shared/spinner-16-06.png
new file mode 100755
index 000000000000..6a4daa3771f9
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-16-06.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-01.png b/default_images/hicontrast/shared/spinner-32-01.png
new file mode 100755
index 000000000000..c3596c19f276
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-01.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-02.png b/default_images/hicontrast/shared/spinner-32-02.png
new file mode 100755
index 000000000000..e2ca6b965d23
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-02.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-03.png b/default_images/hicontrast/shared/spinner-32-03.png
new file mode 100755
index 000000000000..6609d3a6d300
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-03.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-04.png b/default_images/hicontrast/shared/spinner-32-04.png
new file mode 100755
index 000000000000..e70a393be204
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-04.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-05.png b/default_images/hicontrast/shared/spinner-32-05.png
new file mode 100755
index 000000000000..63eb3e10375c
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-05.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-06.png b/default_images/hicontrast/shared/spinner-32-06.png
new file mode 100755
index 000000000000..c072e397cc00
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-06.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-07.png b/default_images/hicontrast/shared/spinner-32-07.png
new file mode 100755
index 000000000000..801ea3b36f9e
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-07.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-08.png b/default_images/hicontrast/shared/spinner-32-08.png
new file mode 100755
index 000000000000..60635b1e47e1
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-08.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-09.png b/default_images/hicontrast/shared/spinner-32-09.png
new file mode 100755
index 000000000000..0a4513daa636
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-09.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-10.png b/default_images/hicontrast/shared/spinner-32-10.png
new file mode 100755
index 000000000000..06fbd02faf7f
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-10.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-11.png b/default_images/hicontrast/shared/spinner-32-11.png
new file mode 100755
index 000000000000..89e14cd33786
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-11.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-32-12.png b/default_images/hicontrast/shared/spinner-32-12.png
new file mode 100755
index 000000000000..2ced9380408e
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-32-12.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-01.png b/default_images/hicontrast/shared/spinner-64-01.png
new file mode 100755
index 000000000000..483b7367c1c2
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-01.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-02.png b/default_images/hicontrast/shared/spinner-64-02.png
new file mode 100755
index 000000000000..fe069140e744
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-02.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-03.png b/default_images/hicontrast/shared/spinner-64-03.png
new file mode 100755
index 000000000000..a94d86434512
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-03.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-04.png b/default_images/hicontrast/shared/spinner-64-04.png
new file mode 100755
index 000000000000..4163edd66151
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-04.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-05.png b/default_images/hicontrast/shared/spinner-64-05.png
new file mode 100755
index 000000000000..9d3532381d7c
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-05.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-06.png b/default_images/hicontrast/shared/spinner-64-06.png
new file mode 100755
index 000000000000..cafb8c31b4bc
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-06.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-07.png b/default_images/hicontrast/shared/spinner-64-07.png
new file mode 100755
index 000000000000..e09b30f161c4
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-07.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-08.png b/default_images/hicontrast/shared/spinner-64-08.png
new file mode 100755
index 000000000000..53c4ccb7813e
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-08.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-09.png b/default_images/hicontrast/shared/spinner-64-09.png
new file mode 100755
index 000000000000..a104b14d41d9
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-09.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-10.png b/default_images/hicontrast/shared/spinner-64-10.png
new file mode 100755
index 000000000000..6edbb14c97c3
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-10.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-11.png b/default_images/hicontrast/shared/spinner-64-11.png
new file mode 100755
index 000000000000..1afe70992c8e
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-11.png
Binary files differ
diff --git a/default_images/hicontrast/shared/spinner-64-12.png b/default_images/hicontrast/shared/spinner-64-12.png
new file mode 100755
index 000000000000..a5473b7210a3
--- /dev/null
+++ b/default_images/hicontrast/shared/spinner-64-12.png
Binary files differ
diff --git a/default_images/shared/spinner-16-01.png b/default_images/shared/spinner-16-01.png
new file mode 100755
index 000000000000..16134fc7ef14
--- /dev/null
+++ b/default_images/shared/spinner-16-01.png
Binary files differ
diff --git a/default_images/shared/spinner-16-02.png b/default_images/shared/spinner-16-02.png
new file mode 100755
index 000000000000..b78f934d92ee
--- /dev/null
+++ b/default_images/shared/spinner-16-02.png
Binary files differ
diff --git a/default_images/shared/spinner-16-03.png b/default_images/shared/spinner-16-03.png
new file mode 100755
index 000000000000..c17dfdc03d1b
--- /dev/null
+++ b/default_images/shared/spinner-16-03.png
Binary files differ
diff --git a/default_images/shared/spinner-16-04.png b/default_images/shared/spinner-16-04.png
new file mode 100755
index 000000000000..c0c6a004afa5
--- /dev/null
+++ b/default_images/shared/spinner-16-04.png
Binary files differ
diff --git a/default_images/shared/spinner-16-05.png b/default_images/shared/spinner-16-05.png
new file mode 100755
index 000000000000..ebc7e3565f39
--- /dev/null
+++ b/default_images/shared/spinner-16-05.png
Binary files differ
diff --git a/default_images/shared/spinner-16-06.png b/default_images/shared/spinner-16-06.png
new file mode 100755
index 000000000000..3a2b29da9d78
--- /dev/null
+++ b/default_images/shared/spinner-16-06.png
Binary files differ
diff --git a/default_images/shared/spinner-32-01.png b/default_images/shared/spinner-32-01.png
new file mode 100755
index 000000000000..2c6b6937f8b2
--- /dev/null
+++ b/default_images/shared/spinner-32-01.png
Binary files differ
diff --git a/default_images/shared/spinner-32-02.png b/default_images/shared/spinner-32-02.png
new file mode 100755
index 000000000000..4662ddf54924
--- /dev/null
+++ b/default_images/shared/spinner-32-02.png
Binary files differ
diff --git a/default_images/shared/spinner-32-03.png b/default_images/shared/spinner-32-03.png
new file mode 100755
index 000000000000..8c1a0be53da5
--- /dev/null
+++ b/default_images/shared/spinner-32-03.png
Binary files differ
diff --git a/default_images/shared/spinner-32-04.png b/default_images/shared/spinner-32-04.png
new file mode 100755
index 000000000000..ba323f36244d
--- /dev/null
+++ b/default_images/shared/spinner-32-04.png
Binary files differ
diff --git a/default_images/shared/spinner-32-05.png b/default_images/shared/spinner-32-05.png
new file mode 100755
index 000000000000..f733dd17266c
--- /dev/null
+++ b/default_images/shared/spinner-32-05.png
Binary files differ
diff --git a/default_images/shared/spinner-32-06.png b/default_images/shared/spinner-32-06.png
new file mode 100755
index 000000000000..bbaebc36f565
--- /dev/null
+++ b/default_images/shared/spinner-32-06.png
Binary files differ
diff --git a/default_images/shared/spinner-32-07.png b/default_images/shared/spinner-32-07.png
new file mode 100755
index 000000000000..d005cb55b4eb
--- /dev/null
+++ b/default_images/shared/spinner-32-07.png
Binary files differ
diff --git a/default_images/shared/spinner-32-08.png b/default_images/shared/spinner-32-08.png
new file mode 100755
index 000000000000..bda1e7192809
--- /dev/null
+++ b/default_images/shared/spinner-32-08.png
Binary files differ
diff --git a/default_images/shared/spinner-32-09.png b/default_images/shared/spinner-32-09.png
new file mode 100755
index 000000000000..3e688421d95e
--- /dev/null
+++ b/default_images/shared/spinner-32-09.png
Binary files differ
diff --git a/default_images/shared/spinner-32-10.png b/default_images/shared/spinner-32-10.png
new file mode 100755
index 000000000000..d43e8866e10e
--- /dev/null
+++ b/default_images/shared/spinner-32-10.png
Binary files differ
diff --git a/default_images/shared/spinner-32-11.png b/default_images/shared/spinner-32-11.png
new file mode 100755
index 000000000000..d67c895a2c7d
--- /dev/null
+++ b/default_images/shared/spinner-32-11.png
Binary files differ
diff --git a/default_images/shared/spinner-32-12.png b/default_images/shared/spinner-32-12.png
new file mode 100755
index 000000000000..9c3c4a849c6f
--- /dev/null
+++ b/default_images/shared/spinner-32-12.png
Binary files differ
diff --git a/default_images/shared/spinner-64-01.png b/default_images/shared/spinner-64-01.png
new file mode 100755
index 000000000000..01afa46aac51
--- /dev/null
+++ b/default_images/shared/spinner-64-01.png
Binary files differ
diff --git a/default_images/shared/spinner-64-02.png b/default_images/shared/spinner-64-02.png
new file mode 100755
index 000000000000..16a19c20652b
--- /dev/null
+++ b/default_images/shared/spinner-64-02.png
Binary files differ
diff --git a/default_images/shared/spinner-64-03.png b/default_images/shared/spinner-64-03.png
new file mode 100755
index 000000000000..af37f8f9f42a
--- /dev/null
+++ b/default_images/shared/spinner-64-03.png
Binary files differ
diff --git a/default_images/shared/spinner-64-04.png b/default_images/shared/spinner-64-04.png
new file mode 100755
index 000000000000..02c14e6e8a4f
--- /dev/null
+++ b/default_images/shared/spinner-64-04.png
Binary files differ
diff --git a/default_images/shared/spinner-64-05.png b/default_images/shared/spinner-64-05.png
new file mode 100755
index 000000000000..97f975b09c0a
--- /dev/null
+++ b/default_images/shared/spinner-64-05.png
Binary files differ
diff --git a/default_images/shared/spinner-64-06.png b/default_images/shared/spinner-64-06.png
new file mode 100755
index 000000000000..c8e7944ed3eb
--- /dev/null
+++ b/default_images/shared/spinner-64-06.png
Binary files differ
diff --git a/default_images/shared/spinner-64-07.png b/default_images/shared/spinner-64-07.png
new file mode 100755
index 000000000000..c598e476366b
--- /dev/null
+++ b/default_images/shared/spinner-64-07.png
Binary files differ
diff --git a/default_images/shared/spinner-64-08.png b/default_images/shared/spinner-64-08.png
new file mode 100755
index 000000000000..73d54f2abcbd
--- /dev/null
+++ b/default_images/shared/spinner-64-08.png
Binary files differ
diff --git a/default_images/shared/spinner-64-09.png b/default_images/shared/spinner-64-09.png
new file mode 100755
index 000000000000..fafd367f0df3
--- /dev/null
+++ b/default_images/shared/spinner-64-09.png
Binary files differ
diff --git a/default_images/shared/spinner-64-10.png b/default_images/shared/spinner-64-10.png
new file mode 100755
index 000000000000..225598a28aec
--- /dev/null
+++ b/default_images/shared/spinner-64-10.png
Binary files differ
diff --git a/default_images/shared/spinner-64-11.png b/default_images/shared/spinner-64-11.png
new file mode 100755
index 000000000000..193b7b8e01ce
--- /dev/null
+++ b/default_images/shared/spinner-64-11.png
Binary files differ
diff --git a/default_images/shared/spinner-64-12.png b/default_images/shared/spinner-64-12.png
new file mode 100755
index 000000000000..6ca28736271d
--- /dev/null
+++ b/default_images/shared/spinner-64-12.png
Binary files differ
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index b1dbcdf861e9..ea0b66245988 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -43,7 +43,6 @@
#include "com/sun/star/awt/WindowAttribute.hpp"
#include "com/sun/star/awt/WindowClass.hpp"
#include "com/sun/star/awt/WindowDescriptor.hpp"
-#include "com/sun/star/awt/XThrobber.hpp"
#include "com/sun/star/awt/XToolkit.hpp"
#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/awt/XWindowPeer.hpp"
@@ -570,6 +569,7 @@ UpdateDialog::UpdateDialog(
ModalDialog(parent,DpGuiResId(RID_DLG_UPDATE)),
m_context(context),
m_checking(this, DpGuiResId(RID_DLG_UPDATE_CHECKING)),
+ m_throbber(this, DpGuiResId(RID_DLG_UPDATE_THROBBER)),
m_update(this, DpGuiResId(RID_DLG_UPDATE_UPDATE)),
m_updates(
*this, DpGuiResId(RID_DLG_UPDATE_UPDATES),
@@ -630,23 +630,6 @@ UpdateDialog::UpdateDialog(
} catch (uno::Exception & e) {
throw uno::RuntimeException(e.Message, e.Context);
}
- Control c(this, DpGuiResId(RID_DLG_UPDATE_THROBBER));
- Point pos(c.GetPosPixel());
- Size size(c.GetSizePixel());
- try {
- m_throbber = uno::Reference< awt::XThrobber >(
- toolkit->createWindow(
- awt::WindowDescriptor(
- awt::WindowClass_SIMPLE,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Throbber")),
- GetComponentInterface(), 0,
- awt::Rectangle(
- pos.X(), pos.Y(), size.Width(), size.Height()),
- awt::WindowAttribute::SHOW)),
- uno::UNO_QUERY_THROW);
- } catch (lang::IllegalArgumentException & e) {
- throw uno::RuntimeException(e.Message, e.Context);
- }
m_updates.SetSelectHdl(LINK(this, UpdateDialog, selectionHandler));
m_all.SetToggleHdl(LINK(this, UpdateDialog, allHandler));
m_ok.SetClickHdl(LINK(this, UpdateDialog, okHandler));
@@ -681,7 +664,7 @@ BOOL UpdateDialog::Close() {
}
short UpdateDialog::Execute() {
- m_throbber->start();
+ m_throbber.start();
m_thread->launch();
return ModalDialog::Execute();
}
@@ -880,9 +863,8 @@ void UpdateDialog::addSpecificError( UpdateDialog::SpecificError & data )
void UpdateDialog::checkingDone() {
m_checking.Hide();
- m_throbber->stop();
- uno::Reference< awt::XWindow >(
- m_throbber, uno::UNO_QUERY_THROW)->setVisible(false);
+ m_throbber.stop();
+ m_throbber.Hide();
if (m_updates.getItemCount() == 0)
{
clearDescription();
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index 54e645f195d8..cebcc65e26a8 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -46,6 +46,7 @@
#include "vcl/dialog.hxx"
#include "vcl/fixed.hxx"
#include <svtools/fixedhyper.hxx>
+#include <vcl/throbber.hxx>
#include "descedit.hxx"
#include "dp_gui_updatedata.hxx"
@@ -59,7 +60,6 @@ class ResId;
class Window;
namespace com { namespace sun { namespace star {
- namespace awt { class XThrobber; }
namespace deployment { class XExtensionManager;
class XPackage; }
namespace uno { class XComponentContext; }
@@ -184,7 +184,7 @@ private:
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
m_context;
FixedText m_checking;
- com::sun::star::uno::Reference< com::sun::star::awt::XThrobber > m_throbber;
+ Throbber m_throbber;
FixedText m_update;
UpdateDialog::CheckListBox m_updates;
CheckBox m_all;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.src b/desktop/source/deployment/gui/dp_gui_updatedialog.src
index 4da431733e31..90b764d811b2 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.src
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.src
@@ -60,11 +60,11 @@ ModalDialog RID_DLG_UPDATE {
Right = TRUE;
NoLabel = TRUE;
};
- Control RID_DLG_UPDATE_THROBBER {
+ FixedImage RID_DLG_UPDATE_THROBBER {
Pos = MAP_APPFONT(
RSC_SP_DLG_INNERBORDER_LEFT + LOCAL_WIDTH - RSC_CD_FIXEDTEXT_HEIGHT,
RSC_SP_DLG_INNERBORDER_TOP);
- Size = MAP_APPFONT(RSC_CD_FIXEDTEXT_HEIGHT, RSC_CD_FIXEDTEXT_HEIGHT);
+ Size = MAP_APPFONT(RSC_CD_FIXEDTEXT_HEIGHT, RSC_CD_FIXEDTEXT_HEIGHT + 1);
};
FixedText RID_DLG_UPDATE_UPDATE {
Disable = TRUE;
diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx
index 53ec488c2082..03352d33f7c6 100644
--- a/desktop/source/migration/pages.cxx
+++ b/desktop/source/migration/pages.cxx
@@ -339,14 +339,13 @@ void MigrationThread::onTerminated()
MigrationPage::MigrationPage(
svt::OWizardMachine* parent,
- const ResId& resid,
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber)
+ const ResId& resid, Throbber& i_throbber )
: OWizardPage(parent, resid)
, m_ftHead(this, WizardResId(FT_MIGRATION_HEADER))
, m_ftBody(this, WizardResId(FT_MIGRATION_BODY))
, m_cbMigration(this, WizardResId(CB_MIGRATION))
+ , m_rThrobber(i_throbber)
, m_bMigrationDone(sal_False)
- , m_xThrobber(xThrobber)
{
FreeResource();
_setBold(m_ftHead);
@@ -366,9 +365,8 @@ sal_Bool MigrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason
if ( pWizard )
pWizard->DisableButtonsWhileMigration();
- uno::Reference< awt::XWindow > xWin( m_xThrobber, uno::UNO_QUERY );
- xWin->setVisible( true );
- m_xThrobber->start();
+ m_rThrobber.Show();
+ m_rThrobber.start();
MigrationThread* pMigThread = new MigrationThread();
pMigThread->create();
@@ -377,10 +375,10 @@ sal_Bool MigrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason
Application::Reschedule();
}
- m_xThrobber->stop();
+ m_rThrobber.stop();
GetParent()->LeaveWait();
// Next state will enable buttons - so no EnableButtons necessary!
- xWin->setVisible( false );
+ m_rThrobber.Hide();
pMigThread->join();
delete pMigThread;
m_bMigrationDone = sal_True;
diff --git a/desktop/source/migration/pages.hxx b/desktop/source/migration/pages.hxx
index 776268eb475c..a89262e8ec5b 100644
--- a/desktop/source/migration/pages.hxx
+++ b/desktop/source/migration/pages.hxx
@@ -29,17 +29,15 @@
#define _PAGES_HXX_
#include <vcl/tabpage.hxx>
-#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/scrbar.hxx>
+#include <vcl/throbber.hxx>
#include <svtools/wizardmachine.hxx>
#include <svtools/svmedit.hxx>
#include <svl/lstner.hxx>
#include <svtools/xtextedt.hxx>
-#include <com/sun/star/awt/XThrobber.hpp>
-
namespace desktop
{
class WelcomePage : public svt::OWizardPage
@@ -120,11 +118,11 @@ class MigrationPage : public svt::OWizardPage
private:
FixedText m_ftHead;
FixedText m_ftBody;
- CheckBox m_cbMigration;
+ CheckBox m_cbMigration;
+ Throbber& m_rThrobber;
sal_Bool m_bMigrationDone;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber;
public:
- MigrationPage( svt::OWizardMachine* parent, const ResId& resid, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber );
+ MigrationPage( svt::OWizardMachine* parent, const ResId& resid, Throbber& i_throbber );
virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
protected:
diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx
index 5cc90577aaff..150a58ce2729 100644
--- a/desktop/source/migration/wizard.cxx
+++ b/desktop/source/migration/wizard.cxx
@@ -87,16 +87,6 @@ const FirstStartWizard::WizardState FirstStartWizard::STATE_USER = 3;
const FirstStartWizard::WizardState FirstStartWizard::STATE_UPDATE_CHECK = 4;
const FirstStartWizard::WizardState FirstStartWizard::STATE_REGISTRATION = 5;
-static uno::Reference< uno::XComponentContext > getComponentContext( const uno::Reference< lang::XMultiServiceFactory >& rFactory )
-{
- uno::Reference< uno::XComponentContext > rContext;
- uno::Reference< beans::XPropertySet > rPropSet( rFactory, uno::UNO_QUERY );
- uno::Any a = rPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) );
- a >>= rContext;
- return rContext;
-}
-
static sal_Int32 getBuildId()
{
::rtl::OUString aDefault;
@@ -139,54 +129,14 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep
,m_bLicenseNeedsAcceptance( bLicenseNeedsAcceptance )
,m_bLicenseWasAccepted(sal_False)
,m_bAutomaticUpdChk(sal_True)
+ ,m_aThrobber(this, WizardResId(CTRL_THROBBER))
,m_aLicensePath( rLicensePath )
{
+ FreeResource();
// ---
- // FreeResource();
// enableState(STATE_USER, sal_False);
// enableState(STATE_REGISTRATION, sal_False);
- try
- {
- Point pos(5, 210 );
- Size size(11, 11 );
-
- pos = LogicToPixel( pos, MAP_APPFONT );
- size = LogicToPixel( size, MAP_APPFONT );
-
- uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
- uno::Reference< awt::XToolkit > xToolkit(
- uno::Reference< lang::XMultiComponentFactory >(
- xFactory, uno::UNO_QUERY_THROW)->
- createInstanceWithContext(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")),
- getComponentContext(xFactory)),
- uno::UNO_QUERY_THROW);
-
- m_xThrobber = uno::Reference< awt::XThrobber >(
- xToolkit->createWindow(
- awt::WindowDescriptor(
- awt::WindowClass_SIMPLE,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Throbber")),
- GetComponentInterface(), 0,
- awt::Rectangle(
- pos.X(), pos.Y(), size.Width(), size.Height()),
- awt::WindowAttribute::SHOW)),
- uno::UNO_QUERY_THROW);
- }
- catch (uno::RuntimeException &)
- {
- throw;
- }
- catch (Exception& )
- {
- }
-
- uno::Reference< awt::XWindow > xThrobberWin( m_xThrobber, uno::UNO_QUERY );
- if ( xThrobberWin.is() )
- xThrobberWin->setVisible( false );
-
Size aTPSize(TP_WIDTH, TP_HEIGHT);
SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT));
@@ -352,7 +302,7 @@ TabPage* FirstStartWizard::createPage(WizardState _nState)
pTabPage = new LicensePage(this, WizardResId(TP_LICENSE), m_aLicensePath);
break;
case STATE_MIGRATION:
- pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_xThrobber );
+ pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_aThrobber);
break;
case STATE_USER:
pTabPage = new UserPage(this, WizardResId(TP_USER));
diff --git a/desktop/source/migration/wizard.hrc b/desktop/source/migration/wizard.hrc
index fdad97a8174b..8f35488c58b3 100644
--- a/desktop/source/migration/wizard.hrc
+++ b/desktop/source/migration/wizard.hrc
@@ -79,6 +79,7 @@
#define ED_USER_FATHER 18
#define ED_USER_INITIALS 19
#define TR_WAITING 20
+#define CTRL_THROBBER 21
// global strings
#define STR_STATE_WELCOME RID_FIRSTSTSTART_START+100
diff --git a/desktop/source/migration/wizard.hxx b/desktop/source/migration/wizard.hxx
index 3317880f8bd6..48045f6b035f 100644
--- a/desktop/source/migration/wizard.hxx
+++ b/desktop/source/migration/wizard.hxx
@@ -30,9 +30,8 @@
#include <rtl/ustring.hxx>
#include <svtools/roadmapwizard.hxx>
-#include <vcl/window.hxx>
+#include <vcl/throbber.hxx>
#include <tools/resid.hxx>
-#include <com/sun/star/awt/XThrobber.hpp>
namespace desktop
{
@@ -76,7 +75,7 @@ private:
sal_Bool m_bLicenseWasAccepted;
sal_Bool m_bAutomaticUpdChk;
Link m_lnkCancel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber;
+ Throbber m_aThrobber;
rtl::OUString m_aLicensePath;
diff --git a/desktop/source/migration/wizard.src b/desktop/source/migration/wizard.src
index e690e130c74f..78bd3a0e8197 100644
--- a/desktop/source/migration/wizard.src
+++ b/desktop/source/migration/wizard.src
@@ -42,6 +42,13 @@ ModalDialog DLG_FIRSTSTART_WIZARD
Closeable = TRUE ;
Hide = TRUE;
HelpID = HID_FIRSTSTART_DIALOG;
+
+ FixedImage CTRL_THROBBER
+ {
+ Pos = MAP_APPFONT( 5, 210 );
+ Size = MAP_APPFONT( 11, 11 );
+ Hide = TRUE;
+ };
};
String STR_STATE_WELCOME
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 0d2be85f9872..263cdeede4f8 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1379,6 +1379,7 @@ namespace drawinglayer
{
// need to handle PolyPolygonHatchPrimitive2D here to support XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END
const primitive2d::PolyPolygonHatchPrimitive2D& rHatchCandidate = static_cast< const primitive2d::PolyPolygonHatchPrimitive2D& >(rCandidate);
+ const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
@@ -1386,8 +1387,20 @@ namespace drawinglayer
while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
;
+ if(rFillHatchAttribute.isFillBackground())
+ {
+ // with fixing #i111954# (see below) the possible background
+ // fill of a hatched object was lost.Generate a background fill
+ // primitive and render it
+ const primitive2d::Primitive2DReference xBackground(
+ new primitive2d::PolyPolygonColorPrimitive2D(
+ aLocalPolyPolygon,
+ rHatchCandidate.getBackgroundColor()));
+
+ process(primitive2d::Primitive2DSequence(&xBackground, 1));
+ }
+
SvtGraphicFill* pSvtGraphicFill = 0;
- const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
aLocalPolyPolygon.transform(maCurrentTransformation);
if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 84f4802e7b44..642c290f4853 100755
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -33,7 +33,6 @@ class EditView;
class OutputDevice;
class EditUndo;
class SvxFont;
-class SfxUndoManager;
class SfxItemPool;
class SfxStyleSheet;
class String;
@@ -83,6 +82,9 @@ namespace svx{
struct SpellPortion;
typedef std::vector<SpellPortion> SpellPortions;
}
+namespace svl{
+class IUndoManager;
+}
namespace basegfx { class B2DPolyPolygon; }
#include <rsc/rscsfx.hxx>
@@ -268,7 +270,8 @@ public:
void ShowParagraph( USHORT nParagraph, BOOL bShow = TRUE );
BOOL IsParagraphVisible( USHORT nParagraph );
- SfxUndoManager& GetUndoManager();
+ ::svl::IUndoManager&
+ GetUndoManager();
void UndoActionStart( USHORT nId );
void UndoActionEnd( USHORT nId );
BOOL IsInUndo();
diff --git a/editeng/inc/editeng/editund2.hxx b/editeng/inc/editeng/editund2.hxx
index 4d037a72c9b9..14091ea3e1a7 100644
--- a/editeng/inc/editeng/editund2.hxx
+++ b/editeng/inc/editeng/editund2.hxx
@@ -33,7 +33,7 @@
class ImpEditEngine;
-class EDITENG_DLLPUBLIC EditUndoManager : public SfxUndoManager
+class EDITENG_DLLPRIVATE EditUndoManager : public SfxUndoManager
{
using SfxUndoManager::Undo;
using SfxUndoManager::Redo;
@@ -43,8 +43,8 @@ private:
public:
EditUndoManager( ImpEditEngine* pImpEE );
- virtual BOOL Undo( USHORT nCount=1 );
- virtual BOOL Redo( USHORT nCount=1 );
+ virtual BOOL Undo();
+ virtual BOOL Redo();
};
// -----------------------------------------------------------------------
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index d167d2a30f8f..900ee69af2d5 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -74,10 +74,15 @@ class SfxItemSet;
class SvxNumBulletItem;
class SvxNumberFormat;
class SvxLRSpaceItem;
-class SfxUndoManager;
class EditEngine;
class SvKeyValueIterator;
class SvxForbiddenCharactersTable;
+
+namespace svl
+{
+ class IUndoManager;
+}
+
#include <com/sun/star/uno/Reference.h>
#include <vos/ref.hxx>
@@ -938,7 +943,8 @@ public:
// nFormat muss ein Wert aus dem enum EETextFormat sein (wg.CLOOKS)
ULONG Read( SvStream& rInput, const String& rBaseURL, USHORT, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
- SfxUndoManager& GetUndoManager();
+ ::svl::IUndoManager&
+ GetUndoManager();
void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 1b61a405dc18..74527ec2b86f 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -145,7 +145,7 @@ sal_Bool EditEngine::IsInUndo()
return pImpEditEngine->IsInUndo();
}
-SfxUndoManager& EditEngine::GetUndoManager()
+::svl::IUndoManager& EditEngine::GetUndoManager()
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->GetUndoManager();
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index 054971c240fd..f2f28642209c 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -74,7 +74,7 @@ EditUndoManager::EditUndoManager( ImpEditEngine* p )
pImpEE = p;
}
-BOOL __EXPORT EditUndoManager::Undo( USHORT nCount )
+BOOL __EXPORT EditUndoManager::Undo()
{
if ( GetUndoActionCount() == 0 )
return FALSE;
@@ -95,7 +95,7 @@ BOOL __EXPORT EditUndoManager::Undo( USHORT nCount )
pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen
pImpEE->SetUndoMode( TRUE );
- BOOL bDone = SfxUndoManager::Undo( nCount );
+ BOOL bDone = SfxUndoManager::Undo();
pImpEE->SetUndoMode( FALSE );
EditSelection aNewSel( pImpEE->GetActiveView()->GetImpEditView()->GetEditSelection() );
@@ -109,7 +109,7 @@ BOOL __EXPORT EditUndoManager::Undo( USHORT nCount )
return bDone;
}
-BOOL __EXPORT EditUndoManager::Redo( USHORT nCount )
+BOOL __EXPORT EditUndoManager::Redo()
{
if ( GetRedoActionCount() == 0 )
return FALSE;
@@ -130,7 +130,7 @@ BOOL __EXPORT EditUndoManager::Redo( USHORT nCount )
pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen
pImpEE->SetUndoMode( TRUE );
- BOOL bDone = SfxUndoManager::Redo( nCount );
+ BOOL bDone = SfxUndoManager::Redo();
pImpEE->SetUndoMode( FALSE );
EditSelection aNewSel( pImpEE->GetActiveView()->GetImpEditView()->GetEditSelection() );
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index 2efbb60b6c0f..d03f6bc40cea 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -310,7 +310,7 @@ BOOL ImpEditEngine::Undo( EditView* pView )
if ( HasUndoManager() && GetUndoManager().GetUndoActionCount() )
{
SetActiveView( pView );
- GetUndoManager().Undo( 1 );
+ GetUndoManager().Undo();
return TRUE;
}
return FALSE;
@@ -321,7 +321,7 @@ BOOL ImpEditEngine::Redo( EditView* pView )
if ( HasUndoManager() && GetUndoManager().GetRedoActionCount() )
{
SetActiveView( pView );
- GetUndoManager().Redo( 0 );
+ GetUndoManager().Redo();
return TRUE;
}
return FALSE;
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 328a762fec54..19b5b67e28d4 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1227,7 +1227,7 @@ void Outliner::ImpFilterIndents( ULONG nFirstPara, ULONG nLastPara )
pEditEngine->SetUpdateMode( bUpdate );
}
-SfxUndoManager& Outliner::GetUndoManager()
+::svl::IUndoManager& Outliner::GetUndoManager()
{
DBG_CHKTHIS(Outliner,0);
return pEditEngine->GetUndoManager();
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 2a56a0acb52a..a459c0ad9bd3 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -235,7 +235,10 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
if ( nNextState == embed::EmbedStates::INPLACE_ACTIVE )
{
if ( !m_xClientSite.is() )
- throw embed::WrongStateException(); //TODO: client site is not set!
+ throw embed::WrongStateException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "client site not set, yet" ) ),
+ *this
+ );
uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
if ( xInplaceClient.is() && xInplaceClient->canInplaceActivate() )
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 7ad5d944ce43..97c954c95fa6 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -1418,7 +1418,7 @@ namespace pcr
if ( aDescriptor.PrimaryButtonId.getLength() )
aDescriptor.HasPrimaryButton = sal_True;
- if ( aDescriptor.SecondaryButtonId )
+ if ( aDescriptor.SecondaryButtonId.getLength() )
aDescriptor.HasSecondaryButton = sal_True;
bool bIsDataProperty = ( nPropertyUIFlags & PROP_FLAG_DATA_PROPERTY ) != 0;
diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx
index 8419569bd949..8419569bd949 100755..100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx
index 581c6d81c6fa..ab6260bd804b 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -49,7 +49,7 @@
#include "com/sun/star/awt/XControl.hpp"
#include "com/sun/star/awt/XControlContainer.hpp"
#include "com/sun/star/awt/XMessageBox.hpp"
-#include "com/sun/star/awt/XThrobber.hpp"
+#include "com/sun/star/awt/XAnimation.hpp"
#include "com/sun/star/awt/XTopWindow.hpp"
#include "com/sun/star/awt/XVclWindowPeer.hpp"
#include "com/sun/star/awt/XVclContainer.hpp"
@@ -759,14 +759,14 @@ void UpdateHandler::loadStrings()
void UpdateHandler::startThrobber( bool bStart )
{
uno::Reference< awt::XControlContainer > xContainer( mxUpdDlg, uno::UNO_QUERY );
- uno::Reference< awt::XThrobber > xThrobber( xContainer->getControl( CTRL_THROBBER ), uno::UNO_QUERY );
+ uno::Reference< awt::XAnimation > xThrobber( xContainer->getControl( CTRL_THROBBER ), uno::UNO_QUERY );
if ( xThrobber.is() )
{
if ( bStart )
- xThrobber->start();
+ xThrobber->startAnimation();
else
- xThrobber->stop();
+ xThrobber->stopAnimation();
}
uno::Reference< awt::XWindow > xWindow( xContainer->getControl( CTRL_THROBBER ), uno::UNO_QUERY );
@@ -1084,8 +1084,8 @@ bool UpdateHandler::showOverwriteWarning() const
#define EDIT_WIDTH ( DIALOG_WIDTH - 2 * DIALOG_BORDER )
#define BOX1_BTN_X ( DIALOG_BORDER + EDIT_WIDTH - BUTTON_WIDTH - INNER_BORDER )
#define BOX1_BTN_Y ( DIALOG_BORDER + LABEL_HEIGHT + INNER_BORDER)
-#define THROBBER_WIDTH 14
-#define THROBBER_HEIGHT 14
+#define THROBBER_WIDTH 16
+#define THROBBER_HEIGHT 16
#define THROBBER_X_POS ( DIALOG_BORDER + 8 )
#define THROBBER_Y_POS ( DIALOG_BORDER + 23 )
#define BUTTON_BAR_HEIGHT 24
@@ -1372,7 +1372,7 @@ void UpdateHandler::createDialog()
{ // @see awt/UnoControlThrobberModel.idl
uno::Sequence< beans::NamedValue > aProps;
- insertControlModel( xControlModel, UNISTRING("com.sun.star.awt.UnoThrobberControlModel"), CTRL_THROBBER,
+ insertControlModel( xControlModel, UNISTRING("com.sun.star.awt.SpinningProgressControlModel"), CTRL_THROBBER,
awt::Rectangle( THROBBER_X_POS, THROBBER_Y_POS, THROBBER_WIDTH, THROBBER_HEIGHT),
aProps );
}
diff --git a/filter/source/config/cache/constant.hxx b/filter/source/config/cache/constant.hxx
index 244a78864228..36ea008f5414 100644
--- a/filter/source/config/cache/constant.hxx
+++ b/filter/source/config/cache/constant.hxx
@@ -133,7 +133,6 @@ extern rtl::OUString pFilterStrings[];
#define FLAGNAME_PASSWORDTOMODIFY _FILTER_CONFIG_FROM_ASCII_("PASSWORDTOMODIFY" )
#define FLAGNAME_PREFERRED _FILTER_CONFIG_FROM_ASCII_("PREFERRED" )
#define FLAGNAME_READONLY _FILTER_CONFIG_FROM_ASCII_("READONLY" )
-#define FLAGNAME_SILENTEXPORT _FILTER_CONFIG_FROM_ASCII_("SILENTEXPORT" )
#define FLAGNAME_SUPPORTSSELECTION _FILTER_CONFIG_FROM_ASCII_("SUPPORTSSELECTION")
#define FLAGNAME_TEMPLATE _FILTER_CONFIG_FROM_ASCII_("TEMPLATE" )
#define FLAGNAME_TEMPLATEPATH _FILTER_CONFIG_FROM_ASCII_("TEMPLATEPATH" )
@@ -159,7 +158,6 @@ extern rtl::OUString pFilterStrings[];
#define FLAGVAL_CONSULTSERVICE 0x00040000 // 262144
#define FLAGVAL_3RDPARTYFILTER 0x00080000 // 524288
#define FLAGVAL_PACKED 0x00100000 // 1048576
-#define FLAGVAL_SILENTEXPORT 0x00200000 // 2097152
#define FLAGVAL_BROWSERPREFERRED 0x00400000 // 4194304
#define FLAGVAL_COMBINED 0x00800000 // 8388608
#define FLAGVAL_ENCRYPTION 0x01000000 // 16777216
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index d4435e2182f1..bae26e2c2d91 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -2110,7 +2110,6 @@ css::uno::Sequence< ::rtl::OUString > FilterCache::impl_convertFlagField2FlagNam
if ((nFlags & FLAGVAL_PASSWORDTOMODIFY ) == FLAGVAL_PASSWORDTOMODIFY ) lFlagNames.push_back(FLAGNAME_PASSWORDTOMODIFY );
if ((nFlags & FLAGVAL_PREFERRED ) == FLAGVAL_PREFERRED ) lFlagNames.push_back(FLAGNAME_PREFERRED );
if ((nFlags & FLAGVAL_READONLY ) == FLAGVAL_READONLY ) lFlagNames.push_back(FLAGNAME_READONLY );
- if ((nFlags & FLAGVAL_SILENTEXPORT ) == FLAGVAL_SILENTEXPORT ) lFlagNames.push_back(FLAGNAME_SILENTEXPORT );
if ((nFlags & FLAGVAL_SUPPORTSSELECTION) == FLAGVAL_SUPPORTSSELECTION) lFlagNames.push_back(FLAGNAME_SUPPORTSSELECTION);
if ((nFlags & FLAGVAL_TEMPLATE ) == FLAGVAL_TEMPLATE ) lFlagNames.push_back(FLAGNAME_TEMPLATE );
if ((nFlags & FLAGVAL_TEMPLATEPATH ) == FLAGVAL_TEMPLATEPATH ) lFlagNames.push_back(FLAGNAME_TEMPLATEPATH );
@@ -2222,11 +2221,6 @@ sal_Int32 FilterCache::impl_convertFlagNames2FlagField(const css::uno::Sequence<
nField |= FLAGVAL_READONLY;
continue;
}
- if (pNames[i].equals(FLAGNAME_SILENTEXPORT))
- {
- nField |= FLAGVAL_SILENTEXPORT;
- continue;
- }
if (pNames[i].equals(FLAGNAME_SUPPORTSSELECTION))
{
nField |= FLAGVAL_SUPPORTSSELECTION;
diff --git a/filter/source/config/fragments/filters/StarCalc_3_0.xcu b/filter/source/config/fragments/filters/StarCalc_3_0.xcu
index fc96b7d6cd99..59d1682d5e91 100644
--- a/filter/source/config/fragments/filters/StarCalc_3_0.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_3_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 3.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu
index 1dce482b0fdf..d71f4625baa8 100644
--- a/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 3.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_4_0.xcu b/filter/source/config/fragments/filters/StarCalc_4_0.xcu
index c12d34b3ee8e..8ce6a5224426 100644
--- a/filter/source/config/fragments/filters/StarCalc_4_0.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_4_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 4.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu
index b27b0cd4fcc1..caa58a176d00 100644
--- a/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 4.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_5_0.xcu b/filter/source/config/fragments/filters/StarCalc_5_0.xcu
index 7378d4d7a405..4f9838bb5e95 100644
--- a/filter/source/config/fragments/filters/StarCalc_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu
index edefd738acfa..ad43c3b0e1c9 100644
--- a/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 5.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarChart_3_0.xcu b/filter/source/config/fragments/filters/StarChart_3_0.xcu
index ca7c4ab13867..fa756883f332 100644
--- a/filter/source/config/fragments/filters/StarChart_3_0.xcu
+++ b/filter/source/config/fragments/filters/StarChart_3_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarChart 3.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarChart_4_0.xcu b/filter/source/config/fragments/filters/StarChart_4_0.xcu
index d6b909ed2537..ed5e69c88ade 100644
--- a/filter/source/config/fragments/filters/StarChart_4_0.xcu
+++ b/filter/source/config/fragments/filters/StarChart_4_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarChart 4.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarChart_5_0.xcu b/filter/source/config/fragments/filters/StarChart_5_0.xcu
index 8f095aef9c79..43326bd6e82a 100644
--- a/filter/source/config/fragments/filters/StarChart_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarChart_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarChart 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0.xcu b/filter/source/config/fragments/filters/StarDraw_3_0.xcu
index e4c22be3a3ee..3f9ca691236d 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu
index ab1dd6f0ad23..ce8eda7943b0 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu
index f255fb901937..f44f7da0dac8 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0 Vorlage (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu
index b0ce586e9ee9..1dcce8b34680 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0 (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0.xcu b/filter/source/config/fragments/filters/StarDraw_5_0.xcu
index da5376827a41..ef5075ef066e 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu
index 298ab1215761..7168ce984f8f 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu
index 8261bc648b93..2956522f2e67 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0 Vorlage (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu
index a76ebfc3f3c2..67d03c77af17 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0 (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_4_0.xcu b/filter/source/config/fragments/filters/StarImpress_4_0.xcu
index b8bd8c51bbb0..ef28390774b5 100644
--- a/filter/source/config/fragments/filters/StarImpress_4_0.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_4_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 4.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu
index 68ad61d1270e..b4d73953bd00 100644
--- a/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 4.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_5_0.xcu b/filter/source/config/fragments/filters/StarImpress_5_0.xcu
index 544b9187d1f2..1c1377cf3ab7 100644
--- a/filter/source/config/fragments/filters/StarImpress_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu
index c73995cca8c6..9da35f9745e4 100644
--- a/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 5.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarMath_5_0.xcu b/filter/source/config/fragments/filters/StarMath_5_0.xcu
index e583d4bf32ec..6d52188d81dd 100644
--- a/filter/source/config/fragments/filters/StarMath_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarMath_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarMath 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>0</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_3_0.xcu b/filter/source/config/fragments/filters/StarWriter_3_0.xcu
index 6942622a7a14..30d52dde4fa8 100644
--- a/filter/source/config/fragments/filters/StarWriter_3_0.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_3_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 3.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW3</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_3_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarWriter_3_0_Vorlage_Template.xcu
index 7902ef2181b8..af6c79baaf6c 100644
--- a/filter/source/config/fragments/filters/StarWriter_3_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_3_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 3.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW3V</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_GlobalDocument_.xcu b/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_GlobalDocument_.xcu
index 4c5b0aa89af8..aedeb92e6a51 100644
--- a/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_GlobalDocument_.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_GlobalDocument_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 3.0 (StarWriter/GlobalDocument)" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW3</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_Web_.xcu b/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_Web_.xcu
index a68affbce5ea..fd33dc7a4cf0 100644
--- a/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_Web_.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_3_0__StarWriter_Web_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 3.0 (StarWriter/Web)" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW3</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_4_0.xcu b/filter/source/config/fragments/filters/StarWriter_4_0.xcu
index 5c23ef96809c..a5ba428c58ad 100644
--- a/filter/source/config/fragments/filters/StarWriter_4_0.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_4_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 4.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW4</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_4_0_GlobalDocument.xcu b/filter/source/config/fragments/filters/StarWriter_4_0_GlobalDocument.xcu
index 3992a973d896..9c0058b832d7 100644
--- a/filter/source/config/fragments/filters/StarWriter_4_0_GlobalDocument.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_4_0_GlobalDocument.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 4.0/GlobalDocument" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW4</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_4_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarWriter_4_0_Vorlage_Template.xcu
index 16feb8df0b3d..70efeb98a308 100644
--- a/filter/source/config/fragments/filters/StarWriter_4_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_4_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 4.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW4V</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_GlobalDocument_.xcu b/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_GlobalDocument_.xcu
index 9eff3b736f14..437a26106391 100644
--- a/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_GlobalDocument_.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_GlobalDocument_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 4.0 (StarWriter/GlobalDocument)" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW4</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_Web_.xcu b/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_Web_.xcu
index 04f97b796b6c..1a44d99564d0 100644
--- a/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_Web_.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_4_0__StarWriter_Web_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 4.0 (StarWriter/Web)" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW4</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_5_0.xcu b/filter/source/config/fragments/filters/StarWriter_5_0.xcu
index 4556fc72d8c8..cdd8241af507 100644
--- a/filter/source/config/fragments/filters/StarWriter_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW5</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_5_0_GlobalDocument.xcu b/filter/source/config/fragments/filters/StarWriter_5_0_GlobalDocument.xcu
index 3604d7c828b8..1149f621b878 100644
--- a/filter/source/config/fragments/filters/StarWriter_5_0_GlobalDocument.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_5_0_GlobalDocument.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 5.0/GlobalDocument" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW5</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_5_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarWriter_5_0_Vorlage_Template.xcu
index c33a323126cc..b249680af26b 100644
--- a/filter/source/config/fragments/filters/StarWriter_5_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_5_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 5.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW5V</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_GlobalDocument_.xcu b/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_GlobalDocument_.xcu
index c5bef5aead6e..fb99f014220e 100644
--- a/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_GlobalDocument_.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_GlobalDocument_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 5.0 (StarWriter/GlobalDocument)" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW5</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_Web_.xcu b/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_Web_.xcu
index 35cf7c56746d..076f95990b7a 100644
--- a/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_Web_.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_5_0__StarWriter_Web_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter 5.0 (StarWriter/Web)" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>TEMPLATE ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW5</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_Web_4_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarWriter_Web_4_0_Vorlage_Template.xcu
index 51367423c493..33a0a82f44eb 100644
--- a/filter/source/config/fragments/filters/StarWriter_Web_4_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_Web_4_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter/Web 4.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW4VWEB</value></prop>
diff --git a/filter/source/config/fragments/filters/StarWriter_Web_5_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarWriter_Web_5_0_Vorlage_Template.xcu
index 2f696b08defa..efdc14034980 100644
--- a/filter/source/config/fragments/filters/StarWriter_Web_5_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarWriter_Web_5_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarWriter/Web 5.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>CSW5VWEB</value></prop>
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx
index 38b97a025b16..3f9cd0abfe30 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/filter/source/graphicfilter/itga/itga.cxx
@@ -338,6 +338,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -360,6 +363,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -387,6 +393,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -407,6 +416,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -440,6 +452,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -457,6 +472,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -483,6 +501,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -500,6 +521,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -528,6 +552,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
@@ -548,6 +575,9 @@ BOOL TGAReader::ImplReadBody()
nXCount = 0;
nY += nYAdd;
nYCount++;
+
+ if( nYCount >= mpFileHeader->nImageHeight )
+ return false; // invalid picture
}
}
}
diff --git a/filter/source/msfilter/svxmsbas.cxx b/filter/source/msfilter/svxmsbas.cxx
index d17af3b2681b..498349320025 100644
--- a/filter/source/msfilter/svxmsbas.cxx
+++ b/filter/source/msfilter/svxmsbas.cxx
@@ -114,7 +114,6 @@ bool SvxImportMSVBasic::ImportForms_Impl(const String& rStorageName,
return false;
bool bRet = true;
- SFX_APP()->EnterBasicCall();
try
{
Reference<XMultiServiceFactory> xSF(comphelper::getProcessServiceFactory());
@@ -192,7 +191,6 @@ bool SvxImportMSVBasic::ImportForms_Impl(const String& rStorageName,
DBG_ERRORFILE( "SvxImportMSVBasic::ImportForms_Impl - any exception caught" );
//bRet = false;
}
- SFX_APP()->LeaveBasicCall();
return bRet;
}
@@ -248,7 +246,6 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
VBA_Impl aVBA( *xRoot, bAsComment );
if( aVBA.Open(rStorageName,rSubStorageName) )
{
- SFX_APP()->EnterBasicCall();
Reference<XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer();
DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
@@ -492,7 +489,6 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
}
bRet = true;
}
- SFX_APP()->LeaveBasicCall();
}
return bRet;
}
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 382dd12eeb83..a7f8fdb2b569 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -819,7 +819,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
pPDFExtOutDevData->SetIsReduceImageResolution( mbReduceImageResolution );
pPDFExtOutDevData->SetIsExportNamedDestinations( mbExportBmkToDest );
- Sequence< PropertyValue > aRenderOptions( 5 );
+ Sequence< PropertyValue > aRenderOptions( 6 );
aRenderOptions[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) );
aRenderOptions[ 0 ].Value <<= Reference< awt::XDevice >( pXDevice );
aRenderOptions[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) );
@@ -831,12 +831,8 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
aRenderOptions[ 3 ].Value <<= sal_False;
aRenderOptions[ 4 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) );
aRenderOptions[ 4 ].Value <<= mbSkipEmptyPages;
- #if 0
- // #i113919# writer has to begun "PageRange" for itself changing its renderer count
- // we should unify this behavior but not for OOo 3.3
aRenderOptions[ 5 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) );
aRenderOptions[ 5 ].Value <<= aPageRange;
- #endif
if( aPageRange.getLength() || !aSelection.hasValue() )
{
diff --git a/forms/qa/makefile.mk b/forms/qa/makefile.mk
index afafcca427aa..693183d47e2d 100644
--- a/forms/qa/makefile.mk
+++ b/forms/qa/makefile.mk
@@ -37,15 +37,10 @@ PRJNAME = forms
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar ConnectivityTools.jar
JAVAFILES := $(shell @$(FIND) org -name "*.java") \
$(shell @$(FIND) integration -name "*.java")
-JAVACLASSFILES := $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(i:d)$/$(i:b).class)
#----- make a jar from compiled files ------------------------------
-MAXLINELENGTH = 100000
-
-#JARCLASSDIRS =
JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
# --- Runner Settings ----------------------------------------------
@@ -66,14 +61,11 @@ ALL: ALLDEP
.INCLUDE : target.mk
-test:
- echo $(SOLARBINDIR)
-
-show_targets:
+show_targets: $(CLASSDIR)$/$(JARTARGET)
+@$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//))
-run:
- +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce forms_all.sce
+run: $(CLASSDIR)$/$(JARTARGET)
+ +$(COPY) integration$/forms$/*.props $(CLASSDIR) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -sce forms_all.sce
-run_%:
- +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o integration.$(PRJNAME).$(@:s/run_//)
+run_%: $(CLASSDIR)$/$(JARTARGET)
+ +$(COPY) integration$/forms$/*.props $(CLASSDIR) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o integration.$(PRJNAME).$(@:s/run_//)
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index 654a2e5a19b4..63195bf74af0 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -1199,7 +1199,7 @@ Any OFormattedModel::translateControlValueToExternalValue( ) const
Any OFormattedModel::translateDbColumnToControlValue()
{
if ( m_bNumeric )
- m_aSaveValue <<= DBTypeConversion::getValue( m_xColumn, m_aNullDate, m_nKeyType ); // #100056# OJ
+ m_aSaveValue <<= DBTypeConversion::getValue( m_xColumn, m_aNullDate ); // #100056# OJ
else
m_aSaveValue <<= m_xColumn->getString();
diff --git a/framework/Library_fwe.mk b/framework/Library_fwe.mk
index 013fe5bbf56c..86abf25f4f95 100644
--- a/framework/Library_fwe.mk
+++ b/framework/Library_fwe.mk
@@ -77,6 +77,8 @@ $(eval $(call gb_Library_add_exception_objects,fwe,\
framework/source/fwe/helper/imageproducer \
framework/source/fwe/helper/propertysetcontainer \
framework/source/fwe/helper/titlehelper \
+ framework/source/fwe/helper/documentundoguard \
+ framework/source/fwe/helper/undomanagerhelper \
framework/source/fwe/helper/uiconfigelementwrapperbase \
framework/source/fwe/helper/uielementwrapperbase \
framework/source/fwe/interaction/preventduplicateinteraction \
diff --git a/framework/Package_inc.mk b/framework/Package_inc.mk
index adefc3ccbd56..9db346cf1acf 100644
--- a/framework/Package_inc.mk
+++ b/framework/Package_inc.mk
@@ -34,6 +34,10 @@ $(eval $(call gb_Package_add_file,framework_inc,inc/framework/bmkmenu.hxx,framew
$(eval $(call gb_Package_add_file,framework_inc,inc/framework/configimporter.hxx,framework/configimporter.hxx))
$(eval $(call gb_Package_add_file,framework_inc,inc/framework/eventsconfiguration.hxx,framework/eventsconfiguration.hxx))
$(eval $(call gb_Package_add_file,framework_inc,inc/framework/framelistanalyzer.hxx,framework/framelistanalyzer.hxx))
+$(eval $(call gb_Package_add_file,framework_inc,inc/framework/documentundoguard.hxx,framework/documentundoguard.hxx))
+$(eval $(call gb_Package_add_file,framework_inc,inc/framework/undomanagerhelper.hxx,framework/undomanagerhelper.hxx))
+$(eval $(call gb_Package_add_file,framework_inc,inc/framework/imutex.hxx,framework/imutex.hxx))
+$(eval $(call gb_Package_add_file,framework_inc,inc/framework/iguard.hxx,framework/iguard.hxx))
$(eval $(call gb_Package_add_file,framework_inc,inc/framework/imageproducer.hxx,framework/imageproducer.hxx))
$(eval $(call gb_Package_add_file,framework_inc,inc/framework/imagesconfiguration.hxx,framework/imagesconfiguration.hxx))
$(eval $(call gb_Package_add_file,framework_inc,inc/framework/interaction.hxx,framework/interaction.hxx))
diff --git a/framework/inc/framework/documentundoguard.hxx b/framework/inc/framework/documentundoguard.hxx
new file mode 100755
index 000000000000..da2976e895e1
--- /dev/null
+++ b/framework/inc/framework/documentundoguard.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 FRAMEWORK_DOCUMENTUNDOGUARD_HXX
+#define FRAMEWORK_DOCUMENTUNDOGUARD_HXX
+
+#include "framework/fwedllapi.h"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/uno/XInterface.hpp>
+/** === end UNO includes === **/
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace framework
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= DocumentUndoGuard
+ //==================================================================================================================
+ struct DocumentUndoGuard_Data;
+ /** a helper class guarding the Undo manager of a document
+
+ This class guards, within a given scope, the Undo Manager of a document (or another component supporting
+ the XUndoManagerSupplier interface). When entering the scope (i.e. when the <code>DocumentUndoGuard</code>
+ instances is constructed), the current state of the undo contexts of the undo manager is examined.
+ Upon leaving the scope (i.e. when the <code>DocumentUndoGuard</code> is destructed), the guard will execute
+ as many calls to <member scope="com::sun::star::document">XUndoManager::leaveUndoContext</member> as are
+ necessary to restore the manager's initial state.
+ */
+ class FWE_DLLPUBLIC DocumentUndoGuard
+ {
+ public:
+ DocumentUndoGuard( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_undoSupplierComponent );
+ ~DocumentUndoGuard();
+
+ private:
+ ::boost::scoped_ptr< DocumentUndoGuard_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace framework
+//......................................................................................................................
+
+#endif // FRAMEWORK_DOCUMENTUNDOGUARD_HXX
diff --git a/framework/inc/framework/iguard.hxx b/framework/inc/framework/iguard.hxx
new file mode 100755
index 000000000000..7c00858b208d
--- /dev/null
+++ b/framework/inc/framework/iguard.hxx
@@ -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.
+ *
+ ************************************************************************/
+
+#ifndef __FRAMEWORK_THREADHELP_IGUARD_H_
+#define __FRAMEWORK_THREADHELP_IGUARD_H_
+
+//_________________________________________________________________________________________________________________
+// includes
+//_________________________________________________________________________________________________________________
+
+#include <sal/types.h>
+
+//_________________________________________________________________________________________________________________
+// namespace
+//_________________________________________________________________________________________________________________
+
+namespace framework{
+
+//_________________________________________________________________________________________________________________
+// declarations
+//_________________________________________________________________________________________________________________
+
+/*-************************************************************************************************************//**
+ @descr interface for guarding a lock
+*//*-*************************************************************************************************************/
+class SAL_NO_VTABLE IGuard
+{
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------------------------------------------
+ public:
+
+ /** clears the lock. If the guard does not currently hold the lock, nothing happens.
+ */
+ virtual void clear() = 0;
+
+ /** attempts to re-establishes the lock, blocking until the attempt is successful.
+ */
+ virtual void reset() = 0;
+
+}; // class IGuard
+
+} // namespace framework
+
+#endif // #ifndef __FRAMEWORK_THREADHELP_IGUARD_H_
diff --git a/framework/inc/threadhelp/imutex.h b/framework/inc/framework/imutex.hxx
index 70784c312b87..5466edc4cf76 100644
--- a/framework/inc/threadhelp/imutex.h
+++ b/framework/inc/framework/imutex.hxx
@@ -32,6 +32,8 @@
// includes
//_________________________________________________________________________________________________________________
+#include <sal/types.h>
+
//_________________________________________________________________________________________________________________
// namespace
//_________________________________________________________________________________________________________________
@@ -45,7 +47,7 @@ namespace framework{
/*-************************************************************************************************************//**
@descr We need this interface to support using of different mutex implementations in a generic way.
*//*-*************************************************************************************************************/
-class IMutex
+class SAL_NO_VTABLE IMutex
{
//-------------------------------------------------------------------------------------------------------------
// public methods
diff --git a/framework/inc/framework/undomanagerhelper.hxx b/framework/inc/framework/undomanagerhelper.hxx
new file mode 100755
index 000000000000..9cd7266b33c8
--- /dev/null
+++ b/framework/inc/framework/undomanagerhelper.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 FRAMEWORK_UNDOMANAGERHELPER_HXX
+#define FRAMEWORK_UNDOMANAGERHELPER_HXX
+
+#include "framework/fwedllapi.h"
+#include "framework/iguard.hxx"
+#include "framework/imutex.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XUndoManager.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+/** === end UNO includes === **/
+
+#include <boost/scoped_ptr.hpp>
+
+namespace svl
+{
+ class IUndoManager;
+}
+
+//......................................................................................................................
+namespace framework
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= IMutexGuard
+ //==================================================================================================================
+ class SAL_NO_VTABLE IMutexGuard : public IGuard
+ {
+ public:
+ /** returns the mutex guarded by the instance.
+
+ Even if the guard currently has not a lock on the mutex, this method must succeed.
+ */
+ virtual IMutex& getGuardedMutex() = 0;
+ };
+
+ //==================================================================================================================
+ //= IUndoManagerImplementation
+ //==================================================================================================================
+ class SAL_NO_VTABLE IUndoManagerImplementation
+ {
+ public:
+ /** returns the IUndoManager interface to the actual Undo stack
+
+ @throws com::sun::star::lang::DisposedException
+ when the instance is already disposed, and no IUndoManager can be provided
+
+ @throws com::sun::star::lang::NotInitializedException
+ when the instance is not initialized, yet, and no IUndoManager can be provided
+ */
+ virtual ::svl::IUndoManager& getImplUndoManager() = 0;
+
+ /** provides access to an UNO interface for the XUndoManager implementation. Used when throwing exceptions.
+ */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager >
+ getThis() = 0;
+ };
+
+ //==================================================================================================================
+ //= UndoManagerHelper
+ //==================================================================================================================
+ class UndoManagerHelper_Impl;
+ /** helper class for implementing an XUndoManager
+
+ Several of the methods of the class take an IMutexGuard instance. It is assumed that this guard has a lock on
+ its mutext at the moment the method is entered. The lock will be released before any notifications to the
+ registered XUndoManagerListeners happen.
+
+ The following locking strategy is used for this mutex:
+ <ul><li>Any notifications to the registered XUndoManagerListeners are after the guard has been cleared. i.e.
+ without the mutex being locked.</p>
+ <li>Any calls into the <code>IUndoManager</code> implementation is made without the mutex being locked.
+ Note that this implies that the <code>IUndoManager</code> implementation must be thread-safe in itself
+ (which is true for the default implementation, SfxUndoManager).</li>
+ <li>An exception to the previous item are the <member>IUndoManager::Undo</member> and
+ <member>IUndoManager::Redo</member> methods: They're called with the given external mutex being
+ locked.</li>
+ </ul>
+
+ The reason for the exception for IUndoManager::Undo and IUndoManager::Redo is that those are expected to
+ modify the actual document which the UndoManager works for. And as long as our documents are not thread-safe,
+ and as long as we do not re-fit <strong>all</strong> existing SfxUndoImplementations to <em>not</em> expect
+ the dreaded SolarMutex being locked when they're called, the above behavior is a compromise between "how it should
+ be" and "how it can realistically be".
+ */
+ class FWE_DLLPUBLIC UndoManagerHelper
+ {
+ public:
+ UndoManagerHelper( IUndoManagerImplementation& i_undoManagerImpl );
+ ~UndoManagerHelper();
+
+ // life time control
+ void disposing();
+
+ // XUndoManager equivalents
+ void enterUndoContext( const ::rtl::OUString& i_title, IMutexGuard& i_instanceLock );
+ void enterHiddenUndoContext( IMutexGuard& i_instanceLock );
+ void leaveUndoContext( IMutexGuard& i_instanceLock );
+ void addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action, IMutexGuard& i_instanceLock );
+ void undo( IMutexGuard& i_instanceLock );
+ void redo( IMutexGuard& i_instanceLock );
+ ::sal_Bool isUndoPossible() const;
+ ::sal_Bool isRedoPossible() const;
+ ::rtl::OUString getCurrentUndoActionTitle() const;
+ ::rtl::OUString getCurrentRedoActionTitle() const;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString >
+ getAllUndoActionTitles() const;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString >
+ getAllRedoActionTitles() const;
+ void clear( IMutexGuard& i_instanceLock );
+ void clearRedo( IMutexGuard& i_instanceLock );
+ void reset( IMutexGuard& i_instanceLock );
+ void addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener );
+ void removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener );
+
+ // XLockable, base of XUndoManager, equivalents
+ void lock();
+ void unlock();
+ ::sal_Bool isLocked();
+
+ // XModifyBroadcaster equivalents
+ void addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& i_listener );
+ void removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& i_listener );
+
+ private:
+ ::boost::scoped_ptr< UndoManagerHelper_Impl > m_pImpl;
+ };
+
+//......................................................................................................................
+} // namespace framework
+//......................................................................................................................
+
+#endif // FRAMEWORK_UNDOMANAGERHELPER_HXX
diff --git a/framework/inc/threadhelp/lockhelper.hxx b/framework/inc/threadhelp/lockhelper.hxx
index d6ebae6d4b9c..0210ad975c29 100644
--- a/framework/inc/threadhelp/lockhelper.hxx
+++ b/framework/inc/threadhelp/lockhelper.hxx
@@ -33,7 +33,7 @@
//_________________________________________________________________________________________________________________
#include <threadhelp/inoncopyable.h>
-#include <threadhelp/imutex.h>
+#include <framework/imutex.hxx>
#include <threadhelp/irwlock.h>
#include <threadhelp/fairrwlock.hxx>
diff --git a/framework/inc/threadhelp/resetableguard.hxx b/framework/inc/threadhelp/resetableguard.hxx
index 58830189e052..3b88294a80e3 100644
--- a/framework/inc/threadhelp/resetableguard.hxx
+++ b/framework/inc/threadhelp/resetableguard.hxx
@@ -33,7 +33,7 @@
//_________________________________________________________________________________________________________________
#include <threadhelp/inoncopyable.h>
-#include <threadhelp/imutex.h>
+#include <framework/imutex.hxx>
//#ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
//#include <threadhelp/threadhelpbase.hxx>
diff --git a/framework/source/fwe/helper/documentundoguard.cxx b/framework/source/fwe/helper/documentundoguard.cxx
new file mode 100755
index 000000000000..91265cf45170
--- /dev/null
+++ b/framework/source/fwe/helper/documentundoguard.cxx
@@ -0,0 +1,271 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_framework.hxx"
+
+#include "framework/documentundoguard.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/ref.hxx>
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace framework
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::document::XUndoManagerSupplier;
+ using ::com::sun::star::document::XUndoManager;
+ using ::com::sun::star::document::XUndoManagerListener;
+ using ::com::sun::star::document::UndoManagerEvent;
+ using ::com::sun::star::lang::EventObject;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= UndoManagerContextListener
+ //==================================================================================================================
+ typedef ::cppu::WeakImplHelper1 < XUndoManagerListener
+ > UndoManagerContextListener_Base;
+ class UndoManagerContextListener : public UndoManagerContextListener_Base
+ {
+ public:
+ UndoManagerContextListener( const Reference< XUndoManager >& i_undoManager )
+ :m_xUndoManager( i_undoManager, UNO_QUERY_THROW )
+ ,m_nRelativeContextDepth( 0 )
+ ,m_documentDisposed( false )
+ {
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ m_xUndoManager->addUndoManagerListener( this );
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+
+ UndoManagerContextListener()
+ {
+ }
+
+ void finish()
+ {
+ OSL_ENSURE( m_nRelativeContextDepth >= 0, "UndoManagerContextListener: more contexts left than entered?" );
+
+ if ( m_documentDisposed )
+ return;
+
+ // work with a copy of m_nRelativeContextDepth, to be independent from possible bugs in the
+ // listener notifications (where it would be decremented with every leaveUndoContext)
+ sal_Int32 nDepth = m_nRelativeContextDepth;
+ while ( nDepth-- > 0 )
+ {
+ m_xUndoManager->leaveUndoContext();
+ }
+ m_xUndoManager->removeUndoManagerListener( this );
+ }
+
+ // XUndoManagerListener
+ virtual void SAL_CALL undoActionAdded( const UndoManagerEvent& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL actionUndone( const UndoManagerEvent& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL actionRedone( const UndoManagerEvent& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL allActionsCleared( const EventObject& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL redoActionsCleared( const EventObject& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL resetAll( const EventObject& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL enteredContext( const UndoManagerEvent& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL enteredHiddenContext( const UndoManagerEvent& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL leftContext( const UndoManagerEvent& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL leftHiddenContext( const UndoManagerEvent& i_event ) throw (RuntimeException);
+ virtual void SAL_CALL cancelledContext( const UndoManagerEvent& i_event ) throw (RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const EventObject& i_event ) throw (RuntimeException);
+
+ private:
+ Reference< XUndoManager > const m_xUndoManager;
+ oslInterlockedCount m_nRelativeContextDepth;
+ bool m_documentDisposed;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::undoActionAdded( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ // not interested in
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::actionUndone( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ // not interested in
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::actionRedone( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ // not interested in
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::allActionsCleared( const EventObject& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ // not interested in
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::redoActionsCleared( const EventObject& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ // not interested in
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::resetAll( const EventObject& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ m_nRelativeContextDepth = 0;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::enteredContext( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ osl_incrementInterlockedCount( &m_nRelativeContextDepth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::enteredHiddenContext( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ osl_incrementInterlockedCount( &m_nRelativeContextDepth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::leftContext( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ osl_decrementInterlockedCount( &m_nRelativeContextDepth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::leftHiddenContext( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ osl_decrementInterlockedCount( &m_nRelativeContextDepth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::cancelledContext( const UndoManagerEvent& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ osl_decrementInterlockedCount( &m_nRelativeContextDepth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManagerContextListener::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ (void)i_event;
+ m_documentDisposed = true;
+ }
+
+ //==================================================================================================================
+ //= DocumentUndoGuard_Data
+ //==================================================================================================================
+ struct DocumentUndoGuard_Data
+ {
+ Reference< XUndoManager > xUndoManager;
+ ::rtl::Reference< UndoManagerContextListener > pContextListener;
+ };
+
+ namespace
+ {
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_init( DocumentUndoGuard_Data& i_data, const Reference< XInterface >& i_undoSupplierComponent )
+ {
+ try
+ {
+ Reference< XUndoManagerSupplier > xUndoSupplier( i_undoSupplierComponent, UNO_QUERY );
+ if ( xUndoSupplier.is() )
+ i_data.xUndoManager.set( xUndoSupplier->getUndoManager(), UNO_QUERY_THROW );
+
+ if ( i_data.xUndoManager.is() )
+ i_data.pContextListener.set( new UndoManagerContextListener( i_data.xUndoManager ) );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_restore( DocumentUndoGuard_Data& i_data )
+ {
+ try
+ {
+ if ( i_data.pContextListener.is() )
+ i_data.pContextListener->finish();
+ i_data.pContextListener.clear();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ //==================================================================================================================
+ //= DocumentUndoGuard
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DocumentUndoGuard::DocumentUndoGuard( const Reference< XInterface >& i_undoSupplierComponent )
+ :m_pData( new DocumentUndoGuard_Data )
+ {
+ lcl_init( *m_pData, i_undoSupplierComponent );
+ }
+
+ DocumentUndoGuard::~DocumentUndoGuard()
+ {
+ lcl_restore( *m_pData );
+ }
+
+//......................................................................................................................
+} // namespace framework
+//......................................................................................................................
diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx b/framework/source/fwe/helper/undomanagerhelper.cxx
new file mode 100755
index 000000000000..a37451339234
--- /dev/null
+++ b/framework/source/fwe/helper/undomanagerhelper.cxx
@@ -0,0 +1,1165 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_framework.hxx"
+
+#include "framework/undomanagerhelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/XComponent.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/exc_hlp.hxx>
+#include <comphelper/flagguard.hxx>
+#include <comphelper/asyncnotification.hxx>
+#include <svl/undo.hxx>
+#include <tools/diagnose_ex.h>
+#include <osl/conditn.hxx>
+
+#include <stack>
+#include <queue>
+#include <boost/function.hpp>
+
+//......................................................................................................................
+namespace framework
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::document::XUndoManagerListener;
+ using ::com::sun::star::document::UndoManagerEvent;
+ using ::com::sun::star::document::EmptyUndoStackException;
+ using ::com::sun::star::document::UndoContextNotClosedException;
+ using ::com::sun::star::document::UndoFailedException;
+ using ::com::sun::star::util::NotLockedException;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::document::XUndoAction;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::document::XUndoManager;
+ using ::com::sun::star::util::InvalidStateException;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::util::XModifyListener;
+ /** === end UNO using === **/
+ using ::svl::IUndoManager;
+
+ //==================================================================================================================
+ //= UndoActionWrapper
+ //==================================================================================================================
+ class UndoActionWrapper : public SfxUndoAction
+ {
+ public:
+ UndoActionWrapper(
+ Reference< XUndoAction > const& i_undoAction
+ );
+ virtual ~UndoActionWrapper();
+
+ virtual String GetComment() const;
+ virtual void Undo();
+ virtual void Redo();
+ virtual BOOL CanRepeat(SfxRepeatTarget&) const;
+
+ private:
+ const Reference< XUndoAction > m_xUndoAction;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoActionWrapper::UndoActionWrapper( Reference< XUndoAction > const& i_undoAction )
+ :SfxUndoAction()
+ ,m_xUndoAction( i_undoAction )
+ {
+ ENSURE_OR_THROW( m_xUndoAction.is(), "illegal undo action" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoActionWrapper::~UndoActionWrapper()
+ {
+ try
+ {
+ Reference< XComponent > xComponent( m_xUndoAction, UNO_QUERY );
+ if ( xComponent.is() )
+ xComponent->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String UndoActionWrapper::GetComment() const
+ {
+ String sComment;
+ try
+ {
+ sComment = m_xUndoAction->getTitle();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sComment;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoActionWrapper::Undo()
+ {
+ m_xUndoAction->undo();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoActionWrapper::Redo()
+ {
+ m_xUndoAction->redo();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ BOOL UndoActionWrapper::CanRepeat(SfxRepeatTarget&) const
+ {
+ return FALSE;
+ }
+
+ //==================================================================================================================
+ //= UndoManagerRequest
+ //==================================================================================================================
+ class UndoManagerRequest : public ::comphelper::AnyEvent
+ {
+ public:
+ UndoManagerRequest( ::boost::function0< void > const& i_request )
+ :m_request( i_request )
+ ,m_caughtException()
+ ,m_finishCondition()
+ {
+ m_finishCondition.reset();
+ }
+
+ void execute()
+ {
+ try
+ {
+ m_request();
+ }
+ catch( const Exception& )
+ {
+ m_caughtException = ::cppu::getCaughtException();
+ }
+ m_finishCondition.set();
+ }
+
+ void wait()
+ {
+ m_finishCondition.wait();
+ if ( m_caughtException.hasValue() )
+ ::cppu::throwException( m_caughtException );
+ }
+
+ void cancel( const Reference< XInterface >& i_context )
+ {
+ m_caughtException <<= RuntimeException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Concurrency error: an ealier operation on the stack failed." ) ),
+ i_context
+ );
+ m_finishCondition.set();
+ }
+
+ protected:
+ ~UndoManagerRequest()
+ {
+ }
+
+ private:
+ ::boost::function0< void > m_request;
+ Any m_caughtException;
+ ::osl::Condition m_finishCondition;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+
+ //==================================================================================================================
+ //= UndoManagerHelper_Impl
+ //==================================================================================================================
+ class UndoManagerHelper_Impl : public SfxUndoListener
+ {
+ private:
+ ::osl::Mutex m_aMutex;
+ ::osl::Mutex m_aQueueMutex;
+ bool m_disposed;
+ bool m_bAPIActionRunning;
+ bool m_bProcessingEvents;
+ ::cppu::OInterfaceContainerHelper m_aUndoListeners;
+ ::cppu::OInterfaceContainerHelper m_aModifyListeners;
+ IUndoManagerImplementation& m_rUndoManagerImplementation;
+ UndoManagerHelper& m_rAntiImpl;
+ ::std::stack< bool > m_aContextVisibilities;
+#if OSL_DEBUG_LEVEL > 0
+ ::std::stack< bool > m_aContextAPIFlags;
+#endif
+ ::std::queue< ::rtl::Reference< UndoManagerRequest > >
+ m_aEventQueue;
+
+ public:
+ ::osl::Mutex& getMutex() { return m_aMutex; }
+
+ public:
+ UndoManagerHelper_Impl( UndoManagerHelper& i_antiImpl, IUndoManagerImplementation& i_undoManagerImpl )
+ :m_aMutex()
+ ,m_aQueueMutex()
+ ,m_disposed( false )
+ ,m_bAPIActionRunning( false )
+ ,m_bProcessingEvents( false )
+ ,m_aUndoListeners( m_aMutex )
+ ,m_aModifyListeners( m_aMutex )
+ ,m_rUndoManagerImplementation( i_undoManagerImpl )
+ ,m_rAntiImpl( i_antiImpl )
+ {
+ getUndoManager().AddUndoListener( *this );
+ }
+
+ virtual ~UndoManagerHelper_Impl()
+ {
+ }
+
+ //..............................................................................................................
+ IUndoManager& getUndoManager() const
+ {
+ return m_rUndoManagerImplementation.getImplUndoManager();
+ }
+
+ //..............................................................................................................
+ Reference< XUndoManager > getXUndoManager() const
+ {
+ return m_rUndoManagerImplementation.getThis();
+ }
+
+ // SfxUndoListener
+ virtual void actionUndone( const String& i_actionComment );
+ virtual void actionRedone( const String& i_actionComment );
+ virtual void undoActionAdded( const String& i_actionComment );
+ virtual void cleared();
+ virtual void clearedRedo();
+ virtual void resetAll();
+ virtual void listActionEntered( const String& i_comment );
+ virtual void listActionLeft( const String& i_comment );
+ virtual void listActionLeftAndMerged();
+ virtual void listActionCancelled();
+ virtual void undoManagerDying();
+
+ // public operations
+ void disposing();
+
+ void enterUndoContext( const ::rtl::OUString& i_title, const bool i_hidden, IMutexGuard& i_instanceLock );
+ void leaveUndoContext( IMutexGuard& i_instanceLock );
+ void addUndoAction( const Reference< XUndoAction >& i_action, IMutexGuard& i_instanceLock );
+ void undo( IMutexGuard& i_instanceLock );
+ void redo( IMutexGuard& i_instanceLock );
+ void clear( IMutexGuard& i_instanceLock );
+ void clearRedo( IMutexGuard& i_instanceLock );
+ void reset( IMutexGuard& i_instanceLock );
+
+ void addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener )
+ {
+ m_aUndoListeners.addInterface( i_listener );
+ }
+
+ void removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener )
+ {
+ m_aUndoListeners.removeInterface( i_listener );
+ }
+
+ void addModifyListener( const Reference< XModifyListener >& i_listener )
+ {
+ m_aModifyListeners.addInterface( i_listener );
+ }
+
+ void removeModifyListener( const Reference< XModifyListener >& i_listener )
+ {
+ m_aModifyListeners.removeInterface( i_listener );
+ }
+
+ UndoManagerEvent
+ buildEvent( ::rtl::OUString const& i_title ) const;
+
+ void impl_notifyModified();
+ void notify( ::rtl::OUString const& i_title,
+ void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const UndoManagerEvent& )
+ );
+ void notify( void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const UndoManagerEvent& ) )
+ {
+ notify( ::rtl::OUString(), i_notificationMethod );
+ }
+
+ void notify( void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const EventObject& ) );
+
+ private:
+ /// adds a function to be called to the request processor's queue
+ void impl_processRequest( ::boost::function0< void > const& i_request, IMutexGuard& i_instanceLock );
+
+ /// impl-versions of the XUndoManager API.
+ void impl_enterUndoContext( const ::rtl::OUString& i_title, const bool i_hidden );
+ void impl_leaveUndoContext();
+ void impl_addUndoAction( const Reference< XUndoAction >& i_action );
+ void impl_doUndoRedo( IMutexGuard& i_externalLock, const bool i_undo );
+ void impl_clear();
+ void impl_clearRedo();
+ void impl_reset();
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::disposing()
+ {
+ EventObject aEvent;
+ aEvent.Source = getXUndoManager();
+ m_aUndoListeners.disposeAndClear( aEvent );
+ m_aModifyListeners.disposeAndClear( aEvent );
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ getUndoManager().RemoveUndoListener( *this );
+
+ m_disposed = true;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManagerEvent UndoManagerHelper_Impl::buildEvent( ::rtl::OUString const& i_title ) const
+ {
+ UndoManagerEvent aEvent;
+ aEvent.Source = getXUndoManager();
+ aEvent.UndoActionTitle = i_title;
+ aEvent.UndoContextDepth = getUndoManager().GetListActionDepth();
+ return aEvent;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_notifyModified()
+ {
+ const EventObject aEvent( getXUndoManager() );
+ m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::notify( ::rtl::OUString const& i_title,
+ void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const UndoManagerEvent& ) )
+ {
+ const UndoManagerEvent aEvent( buildEvent( i_title ) );
+
+ // TODO: this notification method here is used by UndoManagerHelper_Impl, to multiplex the notifications we
+ // receive from the IUndoManager. Those notitications are sent with a locked SolarMutex, which means
+ // we're doing the multiplexing here with a locked SM, too. Which is Bad (TM).
+ // Fixing this properly would require outsourcing all the notifications into an own thread - which might lead
+ // to problems of its own, since clients might expect synchronous notifications.
+
+ m_aUndoListeners.notifyEach( i_notificationMethod, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::notify( void ( SAL_CALL XUndoManagerListener::*i_notificationMethod )( const EventObject& ) )
+ {
+ const EventObject aEvent( getXUndoManager() );
+
+ // TODO: the same comment as in the other notify, regarding SM locking applies here ...
+
+ m_aUndoListeners.notifyEach( i_notificationMethod, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::enterUndoContext( const ::rtl::OUString& i_title, const bool i_hidden, IMutexGuard& i_instanceLock )
+ {
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_enterUndoContext,
+ this,
+ ::boost::cref( i_title ),
+ i_hidden
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::leaveUndoContext( IMutexGuard& i_instanceLock )
+ {
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_leaveUndoContext,
+ this
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::addUndoAction( const Reference< XUndoAction >& i_action, IMutexGuard& i_instanceLock )
+ {
+ if ( !i_action.is() )
+ throw IllegalArgumentException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "illegal undo action object" ) ),
+ getXUndoManager(),
+ 1
+ );
+
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_addUndoAction,
+ this,
+ ::boost::ref( i_action )
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::clear( IMutexGuard& i_instanceLock )
+ {
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_clear,
+ this
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::clearRedo( IMutexGuard& i_instanceLock )
+ {
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_clearRedo,
+ this
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::reset( IMutexGuard& i_instanceLock )
+ {
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_reset,
+ this
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_processRequest( ::boost::function0< void > const& i_request, IMutexGuard& i_instanceLock )
+ {
+ // create the request, and add it to our queue
+ ::rtl::Reference< UndoManagerRequest > pRequest( new UndoManagerRequest( i_request ) );
+ {
+ ::osl::MutexGuard aQueueGuard( m_aQueueMutex );
+ m_aEventQueue.push( pRequest );
+ }
+
+ i_instanceLock.clear();
+
+ if ( m_bProcessingEvents )
+ {
+ // another thread is processing the event queue currently => it will also process the event which we just added
+ pRequest->wait();
+ return;
+ }
+
+ m_bProcessingEvents = true;
+ do
+ {
+ pRequest.clear();
+ {
+ ::osl::MutexGuard aQueueGuard( m_aQueueMutex );
+ if ( m_aEventQueue.empty() )
+ {
+ // reset the flag before releasing the queue mutex, otherwise it's possible that another thread
+ // could add an event after we release the mutex, but before we reset the flag. If then this other
+ // thread checks the flag before be reset it, this thread's event would starve.
+ m_bProcessingEvents = false;
+ return;
+ }
+ pRequest = m_aEventQueue.front();
+ m_aEventQueue.pop();
+ }
+ try
+ {
+ pRequest->execute();
+ pRequest->wait();
+ }
+ catch( ... )
+ {
+ {
+ // no chance to process further requests, if the current one failed
+ // => discard them
+ ::osl::MutexGuard aQueueGuard( m_aQueueMutex );
+ while ( !m_aEventQueue.empty() )
+ {
+ pRequest = m_aEventQueue.front();
+ m_aEventQueue.pop();
+ pRequest->cancel( getXUndoManager() );
+ }
+ m_bProcessingEvents = false;
+ }
+ // re-throw the error
+ throw;
+ }
+ }
+ while ( true );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_enterUndoContext( const ::rtl::OUString& i_title, const bool i_hidden )
+ {
+ // SYNCHRONIZED --->
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ IUndoManager& rUndoManager = getUndoManager();
+ if ( !rUndoManager.IsUndoEnabled() )
+ // ignore this request if the manager is locked
+ return;
+
+ if ( i_hidden && ( rUndoManager.GetUndoActionCount( IUndoManager::CurrentLevel ) == 0 ) )
+ throw EmptyUndoStackException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "can't enter a hidden context without a previous Undo action" ) ),
+ m_rUndoManagerImplementation.getThis()
+ );
+
+ {
+ ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
+ rUndoManager.EnterListAction( i_title, ::rtl::OUString() );
+ }
+
+ m_aContextVisibilities.push( i_hidden );
+
+ const UndoManagerEvent aEvent( buildEvent( i_title ) );
+ aGuard.clear();
+ // <--- SYNCHRONIZED
+
+ m_aUndoListeners.notifyEach( i_hidden ? &XUndoManagerListener::enteredHiddenContext : &XUndoManagerListener::enteredContext, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_leaveUndoContext()
+ {
+ // SYNCHRONIZED --->
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ IUndoManager& rUndoManager = getUndoManager();
+ if ( !rUndoManager.IsUndoEnabled() )
+ // ignore this request if the manager is locked
+ return;
+
+ if ( !rUndoManager.IsInListAction() )
+ throw InvalidStateException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no active undo context" ) ),
+ getXUndoManager()
+ );
+
+ size_t nContextElements = 0;
+
+ const bool isHiddenContext = m_aContextVisibilities.top();;
+ m_aContextVisibilities.pop();
+
+ const bool bHadRedoActions = ( rUndoManager.GetRedoActionCount( IUndoManager::TopLevel ) > 0 );
+ {
+ ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
+ if ( isHiddenContext )
+ nContextElements = rUndoManager.LeaveAndMergeListAction();
+ else
+ nContextElements = rUndoManager.LeaveListAction();
+ }
+ const bool bHasRedoActions = ( rUndoManager.GetRedoActionCount( IUndoManager::TopLevel ) > 0 );
+
+ // prepare notification
+ void ( SAL_CALL XUndoManagerListener::*notificationMethod )( const UndoManagerEvent& ) = NULL;
+
+ UndoManagerEvent aContextEvent( buildEvent( ::rtl::OUString() ) );
+ const EventObject aClearedEvent( getXUndoManager() );
+ if ( nContextElements == 0 )
+ {
+ notificationMethod = &XUndoManagerListener::cancelledContext;
+ }
+ else if ( isHiddenContext )
+ {
+ notificationMethod = &XUndoManagerListener::leftHiddenContext;
+ }
+ else
+ {
+ aContextEvent.UndoActionTitle = rUndoManager.GetUndoActionComment( 0, IUndoManager::CurrentLevel );
+ notificationMethod = &XUndoManagerListener::leftContext;
+ }
+
+ aGuard.clear();
+ // <--- SYNCHRONIZED
+
+ if ( bHadRedoActions && !bHasRedoActions )
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::redoActionsCleared, aClearedEvent );
+ m_aUndoListeners.notifyEach( notificationMethod, aContextEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_doUndoRedo( IMutexGuard& i_externalLock, const bool i_undo )
+ {
+ ::osl::Guard< ::framework::IMutex > aExternalGuard( i_externalLock.getGuardedMutex() );
+ // note that this assumes that the mutex has been released in the thread which added the
+ // Undo/Redo request, so we can successfully acquire it
+
+ // SYNCHRONIZED --->
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ IUndoManager& rUndoManager = getUndoManager();
+ if ( rUndoManager.IsInListAction() )
+ throw UndoContextNotClosedException( ::rtl::OUString(), getXUndoManager() );
+
+ const size_t nElements = i_undo
+ ? rUndoManager.GetUndoActionCount( IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionCount( IUndoManager::TopLevel );
+ if ( nElements == 0 )
+ throw EmptyUndoStackException( ::rtl::OUString::createFromAscii( "stack is empty" ), getXUndoManager() );
+
+ aGuard.clear();
+ // <--- SYNCHRONIZED
+
+ try
+ {
+ if ( i_undo )
+ rUndoManager.Undo();
+ else
+ rUndoManager.Redo();
+ }
+ catch( const RuntimeException& ) { /* allowed to leave here */ throw; }
+ catch( const UndoFailedException& ) { /* allowed to leave here */ throw; }
+ catch( const Exception& )
+ {
+ // not allowed to leave
+ const Any aError( ::cppu::getCaughtException() );
+ throw UndoFailedException( ::rtl::OUString(), getXUndoManager(), aError );
+ }
+
+ // note that in opposite to all of the other methods, we do *not* have our mutex locked when calling
+ // into the IUndoManager implementation. This ensures that an actual XUndoAction::undo/redo is also
+ // called without our mutex being locked.
+ // As a consequence, we do not set m_bAPIActionRunning here. Instead, our actionUndone/actionRedone methods
+ // *always* multiplex the event to our XUndoManagerListeners, not only when m_bAPIActionRunning is FALSE (This
+ // again is different from all other SfxUndoListener methods).
+ // So, we do not need to do this notification here ourself.
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_addUndoAction( const Reference< XUndoAction >& i_action )
+ {
+ // SYNCHRONIZED --->
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ IUndoManager& rUndoManager = getUndoManager();
+ if ( !rUndoManager.IsUndoEnabled() )
+ // ignore the request if the manager is locked
+ return;
+
+ const UndoManagerEvent aEventAdd( buildEvent( i_action->getTitle() ) );
+ const EventObject aEventClear( getXUndoManager() );
+
+ const bool bHadRedoActions = ( rUndoManager.GetRedoActionCount( IUndoManager::CurrentLevel ) > 0 );
+ {
+ ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
+ rUndoManager.AddUndoAction( new UndoActionWrapper( i_action ) );
+ }
+ const bool bHasRedoActions = ( rUndoManager.GetRedoActionCount( IUndoManager::CurrentLevel ) > 0 );
+
+ aGuard.clear();
+ // <--- SYNCHRONIZED
+
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::undoActionAdded, aEventAdd );
+ if ( bHadRedoActions && !bHasRedoActions )
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::redoActionsCleared, aEventClear );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_clear()
+ {
+ // SYNCHRONIZED --->
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ IUndoManager& rUndoManager = getUndoManager();
+ if ( rUndoManager.IsInListAction() )
+ throw UndoContextNotClosedException( ::rtl::OUString(), getXUndoManager() );
+
+ {
+ ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
+ rUndoManager.Clear();
+ }
+
+ const EventObject aEvent( getXUndoManager() );
+ aGuard.clear();
+ // <--- SYNCHRONIZED
+
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::allActionsCleared, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_clearRedo()
+ {
+ // SYNCHRONIZED --->
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ IUndoManager& rUndoManager = getUndoManager();
+ if ( rUndoManager.IsInListAction() )
+ throw UndoContextNotClosedException( ::rtl::OUString(), getXUndoManager() );
+
+ {
+ ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
+ rUndoManager.ClearRedo();
+ }
+
+ const EventObject aEvent( getXUndoManager() );
+ aGuard.clear();
+ // <--- SYNCHRONIZED
+
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::redoActionsCleared, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::impl_reset()
+ {
+ // SYNCHRONIZED --->
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ IUndoManager& rUndoManager = getUndoManager();
+ {
+ ::comphelper::FlagGuard aNotificationGuard( m_bAPIActionRunning );
+ rUndoManager.Reset();
+ }
+
+ const EventObject aEvent( getXUndoManager() );
+ aGuard.clear();
+ // <--- SYNCHRONIZED
+
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::resetAll, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::actionUndone( const String& i_actionComment )
+ {
+ UndoManagerEvent aEvent;
+ aEvent.Source = getXUndoManager();
+ aEvent.UndoActionTitle = i_actionComment;
+ aEvent.UndoContextDepth = 0; // Undo can happen on level 0 only
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::actionUndone, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::actionRedone( const String& i_actionComment )
+ {
+ UndoManagerEvent aEvent;
+ aEvent.Source = getXUndoManager();
+ aEvent.UndoActionTitle = i_actionComment;
+ aEvent.UndoContextDepth = 0; // Redo can happen on level 0 only
+ m_aUndoListeners.notifyEach( &XUndoManagerListener::actionRedone, aEvent );
+ impl_notifyModified();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::undoActionAdded( const String& i_actionComment )
+ {
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( i_actionComment, &XUndoManagerListener::undoActionAdded );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::cleared()
+ {
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( &XUndoManagerListener::allActionsCleared );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::clearedRedo()
+ {
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( &XUndoManagerListener::redoActionsCleared );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::resetAll()
+ {
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( &XUndoManagerListener::resetAll );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::listActionEntered( const String& i_comment )
+ {
+#if OSL_DEBUG_LEVEL > 0
+ m_aContextAPIFlags.push( m_bAPIActionRunning );
+#endif
+
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( i_comment, &XUndoManagerListener::enteredContext );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::listActionLeft( const String& i_comment )
+ {
+#if OSL_DEBUG_LEVEL > 0
+ const bool bCurrentContextIsAPIContext = m_aContextAPIFlags.top();
+ m_aContextAPIFlags.pop();
+ OSL_ENSURE( bCurrentContextIsAPIContext == m_bAPIActionRunning, "UndoManagerHelper_Impl::listActionLeft: API and non-API contexts interwoven!" );
+#endif
+
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( i_comment, &XUndoManagerListener::leftContext );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::listActionLeftAndMerged()
+ {
+#if OSL_DEBUG_LEVEL > 0
+ const bool bCurrentContextIsAPIContext = m_aContextAPIFlags.top();
+ m_aContextAPIFlags.pop();
+ OSL_ENSURE( bCurrentContextIsAPIContext == m_bAPIActionRunning, "UndoManagerHelper_Impl::listActionLeftAndMerged: API and non-API contexts interwoven!" );
+#endif
+
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( &XUndoManagerListener::leftHiddenContext );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::listActionCancelled()
+ {
+#if OSL_DEBUG_LEVEL > 0
+ const bool bCurrentContextIsAPIContext = m_aContextAPIFlags.top();
+ m_aContextAPIFlags.pop();
+ OSL_ENSURE( bCurrentContextIsAPIContext == m_bAPIActionRunning, "UndoManagerHelper_Impl::listActionCancelled: API and non-API contexts interwoven!" );
+#endif
+
+ if ( m_bAPIActionRunning )
+ return;
+
+ notify( &XUndoManagerListener::cancelledContext );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::undoManagerDying()
+ {
+ // TODO: do we need to care? Or is this the responsibility of our owner?
+ }
+
+ //==================================================================================================================
+ //= UndoManagerHelper
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManagerHelper::UndoManagerHelper( IUndoManagerImplementation& i_undoManagerImpl )
+ :m_pImpl( new UndoManagerHelper_Impl( *this, i_undoManagerImpl ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManagerHelper::~UndoManagerHelper()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::disposing()
+ {
+ m_pImpl->disposing();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::enterUndoContext( const ::rtl::OUString& i_title, IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->enterUndoContext( i_title, false, i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::enterHiddenUndoContext( IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->enterUndoContext( ::rtl::OUString(), true, i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::leaveUndoContext( IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->leaveUndoContext( i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::undo( IMutexGuard& i_instanceLock )
+ {
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_doUndoRedo,
+ this,
+ ::boost::ref( i_instanceLock ),
+ true
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper_Impl::redo( IMutexGuard& i_instanceLock )
+ {
+ impl_processRequest(
+ ::boost::bind(
+ &UndoManagerHelper_Impl::impl_doUndoRedo,
+ this,
+ ::boost::ref( i_instanceLock ),
+ false
+ ),
+ i_instanceLock
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::addUndoAction( const Reference< XUndoAction >& i_action, IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->addUndoAction( i_action, i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::undo( IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->undo( i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::redo( IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->redo( i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool UndoManagerHelper::isUndoPossible() const
+ {
+ // SYNCHRONIZED --->
+ ::osl::MutexGuard aGuard( m_pImpl->getMutex() );
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ if ( rUndoManager.IsInListAction() )
+ return sal_False;
+ return rUndoManager.GetUndoActionCount( IUndoManager::TopLevel ) > 0;
+ // <--- SYNCHRONIZED
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool UndoManagerHelper::isRedoPossible() const
+ {
+ // SYNCHRONIZED --->
+ ::osl::MutexGuard aGuard( m_pImpl->getMutex() );
+ const IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ if ( rUndoManager.IsInListAction() )
+ return sal_False;
+ return rUndoManager.GetRedoActionCount( IUndoManager::TopLevel ) > 0;
+ // <--- SYNCHRONIZED
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ //..............................................................................................................
+ ::rtl::OUString lcl_getCurrentActionTitle( UndoManagerHelper_Impl& i_impl, const bool i_undo )
+ {
+ // SYNCHRONIZED --->
+ ::osl::MutexGuard aGuard( i_impl.getMutex() );
+
+ const IUndoManager& rUndoManager = i_impl.getUndoManager();
+ const size_t nActionCount = i_undo
+ ? rUndoManager.GetUndoActionCount( IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionCount( IUndoManager::TopLevel );
+ if ( nActionCount == 0 )
+ throw EmptyUndoStackException(
+ i_undo ? ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no action on the undo stack" ) )
+ : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no action on the redo stack" ) ),
+ i_impl.getXUndoManager()
+ );
+ return i_undo
+ ? rUndoManager.GetUndoActionComment( 0, IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionComment( 0, IUndoManager::TopLevel );
+ // <--- SYNCHRONIZED
+ }
+
+ //..............................................................................................................
+ Sequence< ::rtl::OUString > lcl_getAllActionTitles( UndoManagerHelper_Impl& i_impl, const bool i_undo )
+ {
+ // SYNCHRONIZED --->
+ ::osl::MutexGuard aGuard( i_impl.getMutex() );
+
+ const IUndoManager& rUndoManager = i_impl.getUndoManager();
+ const size_t nCount = i_undo
+ ? rUndoManager.GetUndoActionCount( IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionCount( IUndoManager::TopLevel );
+
+ Sequence< ::rtl::OUString > aTitles( nCount );
+ for ( size_t i=0; i<nCount; ++i )
+ {
+ aTitles[i] = i_undo
+ ? rUndoManager.GetUndoActionComment( i, IUndoManager::TopLevel )
+ : rUndoManager.GetRedoActionComment( i, IUndoManager::TopLevel );
+ }
+ return aTitles;
+ // <--- SYNCHRONIZED
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString UndoManagerHelper::getCurrentUndoActionTitle() const
+ {
+ return lcl_getCurrentActionTitle( *m_pImpl, true );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString UndoManagerHelper::getCurrentRedoActionTitle() const
+ {
+ return lcl_getCurrentActionTitle( *m_pImpl, false );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > UndoManagerHelper::getAllUndoActionTitles() const
+ {
+ return lcl_getAllActionTitles( *m_pImpl, true );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > UndoManagerHelper::getAllRedoActionTitles() const
+ {
+ return lcl_getAllActionTitles( *m_pImpl, false );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::clear( IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->clear( i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::clearRedo( IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->clearRedo( i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::reset( IMutexGuard& i_instanceLock )
+ {
+ m_pImpl->reset( i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::lock()
+ {
+ // SYNCHRONIZED --->
+ ::osl::MutexGuard aGuard( m_pImpl->getMutex() );
+
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ rUndoManager.EnableUndo( false );
+ // <--- SYNCHRONIZED
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::unlock()
+ {
+ // SYNCHRONIZED --->
+ ::osl::MutexGuard aGuard( m_pImpl->getMutex() );
+
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ if ( rUndoManager.IsUndoEnabled() )
+ throw NotLockedException( ::rtl::OUString::createFromAscii( "Undo manager is not locked" ), m_pImpl->getXUndoManager() );
+ rUndoManager.EnableUndo( true );
+ // <--- SYNCHRONIZED
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool UndoManagerHelper::isLocked()
+ {
+ // SYNCHRONIZED --->
+ ::osl::MutexGuard aGuard( m_pImpl->getMutex() );
+
+ IUndoManager& rUndoManager = m_pImpl->getUndoManager();
+ return !rUndoManager.IsUndoEnabled();
+ // <--- SYNCHRONIZED
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener )
+ {
+ if ( i_listener.is() )
+ m_pImpl->addUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener )
+ {
+ if ( i_listener.is() )
+ m_pImpl->removeUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::addModifyListener( const Reference< XModifyListener >& i_listener )
+ {
+ if ( i_listener.is() )
+ m_pImpl->addModifyListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManagerHelper::removeModifyListener( const Reference< XModifyListener >& i_listener )
+ {
+ if ( i_listener.is() )
+ m_pImpl->removeModifyListener( i_listener );
+ }
+
+//......................................................................................................................
+} // namespace framework
+//......................................................................................................................
diff --git a/hyphen/hyphen-2.4.patch b/hyphen/hyphen-2.4.patch
deleted file mode 100644
index 33947f550a88..000000000000
--- a/hyphen/hyphen-2.4.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-diff -u misc/hyphen-2.4/csutil.c misc/build/hyphen-2.4/csutil.c
---- misc/hyphen-2.4/csutil.c 2003-06-01 02:04:00.000000000 +0200
-+++ misc/build/hyphen-2.4/csutil.c 2008-06-04 10:03:40.000000000 +0200
-@@ -3493,7 +3493,7 @@
- };
-
-
--struct enc_entry encds[] = {
-+static struct enc_entry encds[] = {
- {"ISO8859-1",iso1_tbl},
- {"ISO8859-2",iso2_tbl},
- {"ISO8859-3",iso3_tbl},
-Common subdirectories: misc/hyphen-2.4/doc and misc/build/hyphen-2.4/doc
-diff -u misc/hyphen-2.4/hyphen.c misc/build/hyphen-2.4/hyphen.c
---- misc/hyphen-2.4/hyphen.c 2008-05-01 02:18:15.000000000 +0200
-+++ misc/build/hyphen-2.4/hyphen.c 2008-06-04 10:06:57.000000000 +0200
-@@ -326,7 +326,7 @@
- } else {
- hnj_strchomp(repl + 1);
- replindex = 0;
-- replcut = strlen(buf);
-+ replcut = (signed char) strlen(buf);
- }
- repl = hnj_strdup(repl + 1);
- }
-@@ -359,10 +359,10 @@
- if ((((unsigned char) word[pc]) >> 6) != 2) pu++;
- if ((ps < 0) && (replindex == pu)) {
- ps = replindex;
-- replindex = pc;
-+ replindex = (signed char) pc;
- }
- if ((ps >= 0) && ((pu - ps) == replcut)) {
-- replcut = (pc - replindex);
-+ replcut = (signed char) (pc - replindex);
- break;
- }
- }
-@@ -379,7 +379,7 @@
- dict[k]->states[state_num].repl = repl;
- dict[k]->states[state_num].replindex = replindex;
- if (!replcut) {
-- dict[k]->states[state_num].replcut = strlen(word);
-+ dict[k]->states[state_num].replcut = (signed char) strlen(word);
- } else {
- dict[k]->states[state_num].replcut = replcut;
- }
-@@ -702,7 +702,7 @@
- prep_word[j++] = '.';
- prep_word[j] = '\0';
-
-- for (i = 0; i < j; i++)
-+ for (i = 0; i < word_size + 5; i++)
- hyphens[i] = '0';
-
- #ifdef VERBOSE
-@@ -941,13 +941,13 @@
- int hnj_hyphen_norm(const char *word, int word_size, char * hyphens,
- char *** rep, int ** pos, int ** cut)
- {
-+ int i, j, k;
- if ((((unsigned char) word[0]) >> 6) == 2) {
- fprintf(stderr, "error - bad, non UTF-8 input: %s\n", word);
- return 1;
- }
-
- /* calculate UTF-8 character positions */
-- int i, j, k;
- for (i = 0, j = -1; i < word_size; i++) {
- /* beginning of an UTF-8 character (not '10' start bits) */
- if ((((unsigned char) word[i]) >> 6) != 2) j++;
-diff -u misc/hyphen-2.4/Makefile.am misc/build/hyphen-2.4/Makefile.am
---- misc/hyphen-2.4/Makefile.am 2008-04-30 12:33:44.000000000 +0200
-+++ misc/build/hyphen-2.4/Makefile.am 2008-06-04 11:33:23.000000000 +0200
-@@ -24,12 +24,12 @@
-
- hyphen.us3:
- cp -f $(srcdir)/hyphen.tex hyphen.us
-- patch < $(srcdir)/hyphen.patch
-+ $(GNUPATCH) < $(srcdir)/hyphen.patch
- $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
- cat hyphen.us hyphen.us2 >hyphen.us3
-
--hyph_en_US.dic: hyphen.us3
-- perl $(srcdir)/substrings.pl hyphen.us3 hyph_en_US.dic ISO8859-1 2 3 >/dev/null
-+hyph_en_US.dic:
-+ @echo "hyph_en_US.txt distributed with Hyphen library"
-
- clean-local:
- rm -rf hyphen.us* hyph_en_US.dic
-diff -u misc/hyphen-2.4/Makefile.in misc/build/hyphen-2.4/Makefile.in
---- misc/hyphen-2.4/Makefile.in 2008-04-30 14:29:57.000000000 +0200
-+++ misc/build/hyphen-2.4/Makefile.in 2008-06-04 11:33:44.000000000 +0200
-@@ -795,12 +795,12 @@
-
- hyphen.us3:
- cp -f $(srcdir)/hyphen.tex hyphen.us
-- patch < $(srcdir)/hyphen.patch
-+ $(GNUPATCH) < $(srcdir)/hyphen.patch
- $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
- cat hyphen.us hyphen.us2 >hyphen.us3
-
--hyph_en_US.dic: hyphen.us3
-- perl $(srcdir)/substrings.pl hyphen.us3 hyph_en_US.dic ISO8859-1 2 3 >/dev/null
-+hyph_en_US.dic:
-+ @echo "hyph_en_US.txt distributed with Hyphen library"
-
- clean-local:
- rm -rf hyphen.us* hyph_en_US.dic
-diff -u misc/hyphen-2.4/makefile.mk misc/build/hyphen-2.4/makefile.mk
---- misc/hyphen-2.4/makefile.mk 2008-06-04 10:43:21.000000000 +0200
-+++ misc/build/hyphen-2.4/makefile.mk 2008-06-04 12:40:46.000000000 +0200
-@@ -1 +1,54 @@
--dummy
-+#*************************************************************************
-+#
-+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+#
-+# Copyright 2000, 2010 Oracle and/or its affiliates.
-+#
-+# OpenOffice.org - a multi-platform office productivity suite
-+#
-+# This file is part of OpenOffice.org.
-+#
-+# OpenOffice.org is free software: you can redistribute it and/or modify
-+# it under the terms of the GNU Lesser General Public License version 3
-+# only, as published by the Free Software Foundation.
-+#
-+# OpenOffice.org is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU Lesser General Public License version 3 for more details
-+# (a copy is included in the LICENSE file that accompanied this code).
-+#
-+# You should have received a copy of the GNU Lesser General 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 = hyphen
-+TARGET = hyphen
-+CFLAGSCALL=gsd
-+
-+USE_DEFFILE=TRUE
-+EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-+UWINAPILIB=
-+
-+.INCLUDE : settings.mk
-+
-+# --- Files --------------------------------------------------------
-+
-+# !! not to be compiled because those belong to a stand alone programs: !!
-+# $(SLO)$/createfp.obj\
-+# $(SLO)$/testtextcat.obj
-+
-+SLOFILES= \
-+ $(SLO)$/hyphen.obj\
-+ $(SLO)$/hnjalloc.obj
-+
-+# --- Targets ------------------------------------------------------
-+
-+ALL: ALLTAR
-+
-+.INCLUDE : target.mk
-Common subdirectories: misc/hyphen-2.4/tests and misc/build/hyphen-2.4/tests
diff --git a/hyphen/hyphen-2.7.1-read-charset.patch b/hyphen/hyphen-2.7.1-read-charset.patch
new file mode 100644
index 000000000000..e846955517bc
--- /dev/null
+++ b/hyphen/hyphen-2.7.1-read-charset.patch
@@ -0,0 +1,20 @@
+--- misc/hyphen-2.7.1/hyphen.c 2010-12-01 01:47:22.000000000 +0100
++++ misc/build/hyphen-2.7.1/hyphen.c 2011-01-18 16:26:50.953125000 +0100
+@@ -291,13 +291,10 @@
+ /* read in character set info */
+ if (k == 0) {
+ for (i=0;i<MAX_NAME;i++) dict[k]->cset[i]= 0;
+- if (fgets(dict[k]->cset, sizeof(dict[k]->cset),f) != NULL) {
+- for (i=0;i<MAX_NAME;i++)
+- if ((dict[k]->cset[i] == '\r') || (dict[k]->cset[i] == '\n'))
+- dict[k]->cset[i] = 0;
+- } else {
+- dict[k]->cset[0] = 0;
+- }
++ fgets(dict[k]->cset, sizeof(dict[k]->cset),f);
++ for (i=0;i<MAX_NAME;i++)
++ if ((dict[k]->cset[i] == '\r') || (dict[k]->cset[i] == '\n'))
++ dict[k]->cset[i] = 0;
+ dict[k]->utf8 = (strcmp(dict[k]->cset, "UTF-8") == 0);
+ } else {
+ strcpy(dict[k]->cset, dict[0]->cset);
diff --git a/hyphen/hyphen-2.7.1.patch b/hyphen/hyphen-2.7.1.patch
new file mode 100644
index 000000000000..0e8eafa8f9c2
--- /dev/null
+++ b/hyphen/hyphen-2.7.1.patch
@@ -0,0 +1,72 @@
+--- misc/hyphen-2.7.1/Makefile.am 2010-07-19 11:23:17.000000000 +0200
++++ misc/build/hyphen-2.7.1/Makefile.am 2010-12-02 10:15:44.390625000 +0100
+@@ -25,14 +25,13 @@
+
+ hyphen.us3:
+ cp -f $(srcdir)/hyphen.tex hyphen.us
+- patch < $(srcdir)/hyphen.patch
++ $(GNUPATCH) < $(srcdir)/hyphen.patch
+ $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
+ cat hyphen.us hyphen.us2 | $(AWK) -f $(srcdir)/lig.awk >hyphen.us3
+ cat $(srcdir)/ligpatch.txt >>hyphen.us3
+
+-hyph_en_US.dic: hyphen.us3
+- perl $(srcdir)/substrings.pl hyphen.us3 hyphen.us4 UTF-8 2 3 >/dev/null
+- cat hyphen.us4 | $(SED) -f $(srcdir)/ooopatch.sed >hyph_en_US.dic
++hyph_en_US.dic:
++ @echo "hyph_en_US.txt distributed with Hyphen library"
+
+ clean-local:
+ rm -rf hyphen.us* hyph_en_US.dic
+--- misc/hyphen-2.7.1/Makefile.in 2010-12-01 02:31:29.000000000 +0100
++++ misc/build/hyphen-2.7.1/Makefile.in 2010-12-02 10:17:16.546875000 +0100
+@@ -940,14 +940,13 @@
+
+ hyphen.us3:
+ cp -f $(srcdir)/hyphen.tex hyphen.us
+- patch < $(srcdir)/hyphen.patch
++ $(GNUPATCH) < $(srcdir)/hyphen.patch
+ $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
+ cat hyphen.us hyphen.us2 | $(AWK) -f $(srcdir)/lig.awk >hyphen.us3
+ cat $(srcdir)/ligpatch.txt >>hyphen.us3
+
+-hyph_en_US.dic: hyphen.us3
+- perl $(srcdir)/substrings.pl hyphen.us3 hyphen.us4 UTF-8 2 3 >/dev/null
+- cat hyphen.us4 | $(SED) -f $(srcdir)/ooopatch.sed >hyph_en_US.dic
++hyph_en_US.dic:
++ @echo "hyph_en_US.txt distributed with Hyphen library"
+
+ clean-local:
+ rm -rf hyphen.us* hyph_en_US.dic
+--- misc/hyphen-2.7.1/makefile.mk 2010-12-02 10:35:40.265625000 +0100
++++ misc/build/hyphen-2.7.1/makefile.mk 2010-12-02 10:25:45.750000000 +0100
+@@ -1 +1,28 @@
+-dummy
++PRJ = ..$/..$/..$/..
++
++PRJNAME = hyphen
++TARGET = hyphen
++CFLAGSCALL=gsd
++
++USE_DEFFILE=TRUE
++EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
++UWINAPILIB=
++
++.INCLUDE : settings.mk
++
++# --- Files --------------------------------------------------------
++
++# !! not to be compiled because those belong to a stand alone programs: !!
++# $(SLO)$/createfp.obj\
++# $(SLO)$/testtextcat.obj
++
++SLOFILES= \
++ $(SLO)$/hyphen.obj\
++ $(SLO)$/hnjalloc.obj
++
++# --- Targets ------------------------------------------------------
++
++ALL: ALLTAR
++
++.INCLUDE : target.mk
++
diff --git a/hyphen/makefile.mk b/hyphen/makefile.mk
index b733398c3c8d..94c1592df21e 100644
--- a/hyphen/makefile.mk
+++ b/hyphen/makefile.mk
@@ -36,12 +36,14 @@ TARGET=hyphen
# --- Files --------------------------------------------------------
-TARFILE_NAME=hyphen-2.4
-TARFILE_MD5=d0b5af6e408b8d2958f3d83b5244f5e8
+TARFILE_NAME=hyphen-2.7.1
+TARFILE_MD5=48a9f787f43a09c0a9b7b00cd1fddbbf
ADDITIONAL_FILES += makefile.mk
-PATCH_FILES=hyphen-2.4.patch
+PATCH_FILES= \
+ hyphen-2.7.1.patch \
+ hyphen-2.7.1-read-charset.patch
.IF "$(GUI)"=="UNX"
CONFIGURE_DIR=$(BUILD_DIR)
diff --git a/hyphen/prj/d.lst b/hyphen/prj/d.lst
index 0223cc608198..4b7ff0b35e2e 100644
--- a/hyphen/prj/d.lst
+++ b/hyphen/prj/d.lst
@@ -1,5 +1,5 @@
..\%__SRC%\slb\hyphen.lib %_DEST%\lib%_EXT%\hyphen.lib
..\%__SRC%\inc\hyphen.h %_DEST%\inc%_EXT%\hyphen.h
-..\%__SRC%\misc\build\hyphen-2.4\.libs\libhyphen.a %_DEST%\lib%_EXT%\libhyphen.a
-..\%__SRC%\misc\build\hyphen-2.4\hyph_en_US.dic %_DEST%\bin%_EXT%\hyph_en_US.dic
+..\%__SRC%\misc\build\hyphen-2.7.1\.libs\libhyphen.a %_DEST%\lib%_EXT%\libhyphen.a
+..\%__SRC%\misc\build\hyphen-2.7.1\hyph_en_US.dic %_DEST%\bin%_EXT%\hyph_en_US.dic
diff --git a/i18npool/inc/i18npool/paper.hxx b/i18npool/inc/i18npool/paper.hxx
index 76aebbe473d5..f0a7d76931b7 100644
--- a/i18npool/inc/i18npool/paper.hxx
+++ b/i18npool/inc/i18npool/paper.hxx
@@ -34,6 +34,10 @@
#include <rtl/string.hxx>
#include <com/sun/star/lang/Locale.hpp>
+//!! WARNING: be aware of cui/source/tabpages/page.h where someone had the broken idea
+//!! of duplicating the values of this enum in order to use those defines within
+//!! src files.
+//!! Thus don't reorder the enum values here without changing the code there as well.
enum Paper
{
PAPER_A0,
@@ -116,6 +120,9 @@ enum Paper
PAPER_ARCHE
};
+// defined for 'equal size' test with the implementation array
+#define NUM_PAPER_ENTRIES (PAPER_ARCHE - PAPER_A0 + 1)
+
// ---------
// - Paper -
// ---------
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index d22203d100c7..19b175d4bd83 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -448,6 +448,10 @@ typedef struct {
sal_Int16 script;
} UBlock2Script;
+// for a list of the UBLOCK_... values see:
+// http://icu-project.org/apiref/icu4c/uchar_8h.html
+// where enum UBlockCode is defined.
+// See also http://www.unicode.org/charts/ for general reference
static UBlock2Script scriptList[] = {
{UBLOCK_NO_BLOCK, UBLOCK_NO_BLOCK, ScriptType::WEAK},
{UBLOCK_BASIC_LATIN, UBLOCK_ARMENIAN, ScriptType::LATIN},
diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx
index e94efa6e06c5..0d9235747fd6 100644
--- a/i18npool/source/paper/paper.cxx
+++ b/i18npool/source/paper/paper.cxx
@@ -27,6 +27,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_i18npool.hxx"
+
+#include <osl/diagnose.h>
#include <sal/config.h>
#include <rtl/ustring.hxx>
#include <rtl/string.hxx>
@@ -129,7 +131,6 @@ static PageDesc aDinTab[] =
{ MM2MM100( 227 ), MM2MM100( 356 ), "SuperA", NULL },
{ MM2MM100( 305 ), MM2MM100( 487 ), "SuperB", NULL },
{ IN2MM100( 8.5 ), IN2MM100( 12.69 ), "LetterPlus", NULL },
- { IN2MM100( 8.5 ), IN2MM100( 12.69 ), "LetterPlus", NULL },
{ MM2MM100( 210 ), MM2MM100( 330 ), "A4Plus", NULL },
{ MM2MM100( 200 ), MM2MM100( 148 ), "DoublePostcard", NULL },
{ MM2MM100( 105 ), MM2MM100( 148 ), "A6", NULL },
@@ -385,6 +386,9 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
PaperInfo::PaperInfo(Paper eType) : m_eType(eType)
{
+ OSL_ENSURE( sizeof(aDinTab) / sizeof(aDinTab[0]) == NUM_PAPER_ENTRIES,
+ "mismatch between array entries and enum values" );
+
m_nPaperWidth = aDinTab[m_eType].m_nWidth;
m_nPaperHeight = aDinTab[m_eType].m_nHeight;
}
diff --git a/l10ntools/source/filter/utils/Cache.java b/l10ntools/source/filter/utils/Cache.java
index f4120b2140cc..d1d4766398d2 100644
--- a/l10ntools/source/filter/utils/Cache.java
+++ b/l10ntools/source/filter/utils/Cache.java
@@ -159,7 +159,6 @@ public class Cache
private static final java.lang.String FLAGNAME_PACKED = "PACKED";
private static final java.lang.String FLAGNAME_PREFERRED = "PREFERRED";
private static final java.lang.String FLAGNAME_READONLY = "READONLY";
- private static final java.lang.String FLAGNAME_SILENTEXPORT = "SILENTEXPORT";
private static final java.lang.String FLAGNAME_TEMPLATE = "TEMPLATE";
private static final java.lang.String FLAGNAME_TEMPLATEPATH = "TEMPLATEPATH";
private static final java.lang.String FLAGNAME_USESOPTIONS = "USESOPTIONS";
@@ -185,7 +184,6 @@ public class Cache
private static final int FLAGVAL_PACKED = 0x00100000; // 1048576
private static final int FLAGVAL_PREFERRED = 0x10000000; // 268435456
private static final int FLAGVAL_READONLY = 0x00010000; // 65536
- private static final int FLAGVAL_SILENTEXPORT = 0x00200000; // 2097152
private static final int FLAGVAL_TEMPLATE = 0x00000004; // 4
private static final int FLAGVAL_TEMPLATEPATH = 0x00000010; // 16
private static final int FLAGVAL_USESOPTIONS = 0x00000080; // 128
@@ -1358,9 +1356,6 @@ public class Cache
if (sFlagName.equals(FLAGNAME_READONLY))
nFlags |= FLAGVAL_READONLY;
else
- if (sFlagName.equals(FLAGNAME_SILENTEXPORT))
- nFlags |= FLAGVAL_SILENTEXPORT;
- else
if (sFlagName.equals(FLAGNAME_TEMPLATE))
nFlags |= FLAGVAL_TEMPLATE;
else
@@ -1455,9 +1450,6 @@ public class Cache
if((field & FLAGVAL_PACKED) == FLAGVAL_PACKED)
lFlags.add(FLAGNAME_PACKED);
- if((field & FLAGVAL_SILENTEXPORT) == FLAGVAL_SILENTEXPORT)
- lFlags.add(FLAGNAME_SILENTEXPORT);
-
if((field & FLAGVAL_BROWSERPREFERRED) == FLAGVAL_BROWSERPREFERRED)
lFlags.add(FLAGNAME_BROWSERPREFERRED);
diff --git a/libtextcat/data/new_fingerprints/fpdb.conf b/libtextcat/data/new_fingerprints/fpdb.conf
index df56f9e270ef..329184d514d1 100644
--- a/libtextcat/data/new_fingerprints/fpdb.conf
+++ b/libtextcat/data/new_fingerprints/fpdb.conf
@@ -68,7 +68,8 @@ russian.lm ru--utf8
sanskrit.lm sa--utf8
scots.lm sco--utf8
scots_gaelic.lm gd--utf8
-serbian_ascii.lm sh-YU-utf8
+serbian.lm sr--utf-8
+serbian-latin.lm sh--utf-8
slovak_ascii.lm sk-SK-utf8
slovenian.lm sl--utf8
spanish.lm es--utf8
diff --git a/libtextcat/data/new_fingerprints/lm/serbian-latin.lm b/libtextcat/data/new_fingerprints/lm/serbian-latin.lm
new file mode 100644
index 000000000000..0a028311a030
--- /dev/null
+++ b/libtextcat/data/new_fingerprints/lm/serbian-latin.lm
@@ -0,0 +1,400 @@
+_ 56298
+a 17374
+i 15500
+e 13745
+o 13087
+n 9704
+r 8535
+s 7383
+t 6692
+j 6664
+u 6390
+k 6060
+a_ 5221
+v 5177
+l 5082
+d 4923
+e_ 4729
+m 4663
+p 4121
+i_ 3992
+_s 2964
+je 2847
+g 2703
+z 2575
+u_ 2521
+_p 2491
+ra 2430
+_i 2355
+na 2337
+. 2169
+, 2142
+,_ 2134
+._ 2112
+st 2091
+o_ 2004
+ni 1971
+b 1933
+ko 1894
+je_ 1700
+an 1671
+ij 1628
+no 1559
+č 1550
+_n 1522
+_u 1516
+re 1465
+ti 1409
+_o 1368
+en 1365
+_k 1353
+_j 1346
+_d 1341
+ja 1325
+li 1314
+ta 1309
+pr 1303
+c 1287
+ka 1269
+_je 1233
+po 1224
+ne 1221
+_i_ 1220
+ri 1198
+va 1197
+ov 1151
+od 1146
+la 1139
+sk 1132
+m_ 1124
+_pr 1120
+os 1086
+in 1060
+š 1053
+ve 1048
+oj 1035
+ma 1029
+om 1027
+og 1024
+im 1006
+av 1002
+al 982
+me 976
+vi 971
+_po 966
+_na 963
+na_ 944
+da 928
+ro 905
+nj 900
+ik 891
+_je_ 889
+to 884
+ad 881
+ar 873
+h 862
+or 858
+se 840
+_m 836
+te 819
+is 816
+_u_ 810
+aj 809
+ed 800
+_t 791
+et 772
+at 740
+vo 735
+ju 731
+gr 723
+di 722
+lo 722
+za 709
+il 709
+ak 707
+_r 704
+ja_ 703
+ji 700
+ne_ 694
+_ko 691
+ki 689
+er 681
+ci 680
+ć 673
+_se 670
+_v 664
+ž 663
+el 662
+on 658
+_z 656
+S 638
+iz 635
+bi 622
+ek 616
+_S 612
+su 607
+gra 606
+sa 603
+a, 601
+a,_ 598
+_b 598
+ih 597
+om_ 591
+_g 588
+ost 587
+ije 586
+d_ 579
+tr 574
+se_ 567
+ija 561
+de 559
+em 552
+_se_ 552
+le 549
+a. 548
+lj 548
+a._ 542
+do 540
+_su 533
+zi 529
+ič 525
+sta 520
+h_ 520
+ke 517
+ih_ 511
+f 507
+go 505
+ol 504
+dn 498
+sti 496
+ka_ 493
+_. 489
+_._ 473
+rad 472
+_a 468
+g_ 463
+ic 461
+as 461
+_za 461
+it 456
+koj 454
+ob 448
+iv 442
+da_ 442
+az 441
+su_ 436
+ku 433
+ma_ 430
+mo 429
+ju_ 429
+_sa 427
+ke_ 421
+ni_ 421
+ist 421
+og_ 418
+_od 417
+am 416
+anj 412
+đ 407
+_su_ 407
+ru 400
+nje 398
+sl 397
+ok 392
+op 391
+_koj 391
+_na_ 389
+tn 388
+ji_ 384
+e, 383
+_do 381
+e,_ 380
+ima 379
+ač 378
+nos 378
+vn 377
+B 377
+_ka 373
+ti_ 372
+li_ 370
+eo 370
+pre 367
+_iz 364
+P 361
+sko 361
+io 360
+n_ 360
+" 356
+vr 354
+_st 354
+mi 352
+čk 351
+ao 350
+im_ 347
+es 346
+_B 346
+ev 344
+ski 343
+ez 343
+j_ 341
+ije_ 341
+ig 339
+_ra 338
+ko_ 336
+tv 336
+grad 335
+no_ 335
+la_ 334
+_P 333
+_da 333
+št 332
+od_ 330
+- 326
+dr 323
+va_ 322
+tu 320
+_l 316
+pro 315
+ori 315
+N 314
+ika 311
+ija_ 311
+sto 309
+e. 307
+ir 303
+e._ 302
+_pro 301
+_pre 300
+ki_ 300
+ot 299
+_N 297
+sv 294
+pe 291
+ns 291
+sn 291
+met 290
+t_ 289
+pri 289
+ba 288
+ili 288
+pa 288
+ut 287
+ao_ 286
+oji 285
+_ne 285
+če 284
+ova 283
+kom 282
+um 281
+ičk 279
+nost 279
+k_ 279
+si 279
+ada 278
+van 278
+cij 276
+Sr 276
+lik 275
+_Sr 275
+nt 275
+ogr 274
+ug 274
+_ve 274
+ran 273
+br 273
+ani 272
+ine 272
+ac 271
+edn 271
+red 268
+_bi 266
+_pri 266
+ud 266
+ogra 265
+nja 265
+odi 264
+_f 263
+_re 262
+ga 258
+ati 258
+zn 257
+ovi 255
+rij 254
+_sv 254
+ako 252
+nu 252
+nij 251
+ana 251
+ča 251
+rav 250
+din 248
+kr 247
+iš 247
+či 245
+up 245
+ce 245
+ta_ 244
+rv 244
+men 244
+un 243
+rb 243
+aju 241
+ava 241
+ra_ 241
+etn 239
+oj_ 239
+ln 238
+T 238
+pos 237
+eni 237
+M 234
+_go 233
+_od_ 232
+du 231
+ali 231
+ini 229
+ima_ 229
+_da_ 228
+nov 227
+_te 227
+ps 225
+_e 225
+Srb 223
+ca 223
+_M 223
+_Srb 222
+ara 222
+_mo 221
+Be 221
+_de 221
+i. 220
+bij 220
+K 220
+jed 219
+sa_ 219
+oji_ 218
+čn 218
+_ob 218
+pi 218
+ur 218
+eogr 217
+ove 217
+avi 217
+tno 217
+eog 217
+eogra 217
+stv 216
+zv 216
+_Be 216
+i._ 216
+nik 215
+bo 214
+_koji 214
+nic 214
+koji 214
+_pos 214
+_K 213
+ume 213
+za_ 211
+i, 211
+i,_ 211
diff --git a/libtextcat/data/new_fingerprints/lm/serbian.lm b/libtextcat/data/new_fingerprints/lm/serbian.lm
new file mode 100644
index 000000000000..55b590608018
--- /dev/null
+++ b/libtextcat/data/new_fingerprints/lm/serbian.lm
@@ -0,0 +1,400 @@
+_ 56294
+а 17374
+и 15500
+е 13745
+о 13087
+н 8809
+р 8535
+с 7383
+т 6692
+у 6390
+к 6060
+а_ 5221
+ј 5197
+в 5177
+д 4882
+е_ 4729
+м 4663
+л 4534
+п 4121
+и_ 3992
+_с 2964
+г 2703
+з 2575
+у_ 2521
+_п 2491
+ра 2430
+_и 2355
+на 2337
+је 2281
+. 2169
+, 2142
+,_ 2134
+._ 2112
+ст 2091
+о_ 2004
+ни 1971
+б 1933
+ко 1894
+иј 1628
+но 1559
+ч 1550
+_у 1516
+је_ 1465
+ре 1465
+_н 1437
+ти 1409
+_о 1368
+_к 1353
+_ј 1346
+_д 1315
+ли 1314
+та 1309
+пр 1303
+ц 1287
+ка 1269
+ан 1260
+_је 1233
+по 1224
+не 1221
+_и_ 1220
+ен 1198
+ри 1198
+ва 1197
+ов 1151
+од 1146
+ла 1139
+ск 1132
+м_ 1124
+_пр 1120
+ос 1086
+ш 1053
+ве 1048
+ој 1035
+ма 1029
+ом 1027
+ин 1025
+ог 1024
+им 1006
+ав 1002
+ме 976
+ви 971
+_по 966
+_на 963
+на_ 944
+да 928
+ја 906
+ро 905
+њ 895
+ал 893
+ик 891
+_је_ 889
+то 884
+ад 876
+ар 873
+х 862
+ор 858
+се 840
+_м 836
+те 819
+ис 816
+_у_ 810
+ај 809
+ед 800
+_т 791
+ет 772
+ат 740
+во 735
+гр 723
+ди 722
+ло 722
+за 709
+ак 707
+_р 704
+не_ 694
+_ко 691
+ки 689
+ер 681
+ил 681
+ци 680
+ћ 673
+_се 670
+_в 664
+_з 656
+он 651
+С 638
+из 635
+би 622
+ж 617
+ек 616
+_С 612
+ел 611
+су 607
+гра 606
+са 603
+а, 601
+а,_ 598
+_б 598
+их 597
+ом_ 591
+_г 588
+ост 587
+ије 586
+д_ 579
+тр 574
+се_ 567
+ија 561
+де 559
+_се_ 552
+ем 552
+ле 549
+а. 548
+љ 548
+а._ 542
+до 540
+_су 533
+ју 529
+зи 529
+ји 525
+ич 525
+ста 520
+х_ 520
+ке 517
+их_ 511
+ф 507
+го 505
+сти 496
+ка_ 493
+_. 489
+_._ 473
+_а 468
+рад 467
+ја_ 467
+г_ 463
+иц 461
+ас 461
+_за 461
+ит 456
+кој 454
+об 448
+да_ 442
+ив 442
+аз 441
+су_ 436
+ку 433
+ма_ 430
+мо 429
+_са 427
+ке_ 421
+ол 421
+ни_ 421
+ист 421
+дн 421
+ог_ 418
+_од 417
+ам 416
+ањ 411
+ђ 407
+_су_ 407
+ру 400
+ње 398
+сл 397
+ок 392
+оп 391
+_кој 391
+_на_ 389
+е, 383
+тн 381
+_до 381
+е,_ 380
+има 379
+нос 378
+ач 378
+вн 377
+Б 377
+_ка 373
+ти_ 372
+ео 370
+ли_ 370
+пре 367
+_из 364
+ско 361
+ио 360
+н_ 360
+П 359
+ју_ 359
+" 356
+вр 354
+_ст 354
+ји_ 354
+ми 352
+чк 351
+ао 350
+им_ 347
+_Б 346
+ес 346
+ев 344
+ски 343
+ез 343
+ије_ 341
+иг 339
+_ра 338
+тв 336
+ко_ 336
+град 335
+но_ 335
+ла_ 334
+_да 333
+_П 333
+шт 332
+од_ 330
+- 326
+ј_ 326
+др 323
+ва_ 322
+ту 320
+ори 315
+про 315
+ија_ 311
+ика 311
+сто 309
+е. 307
+ир 303
+е._ 302
+_про 301
+_пре 300
+ки_ 300
+от 299
+Н 296
+св 294
+пе 291
+сн 291
+нс 291
+мет 290
+т_ 289
+при 289
+ба 288
+па 288
+или 288
+ут 287
+ао_ 286
+оји 285
+_не 285
+че 284
+ова 283
+ком 282
+ум 281
+_Н 280
+си 279
+ичк 279
+ност 279
+к_ 279
+ада 278
+Ср 276
+циј 276
+лик 275
+_Ср 275
+нт 275
+огр 274
+_ве 274
+уг 274
+бр 273
+ани 272
+ине 272
+ац 271
+ред 268
+_би 266
+_при 266
+уд 265
+ња 265
+огра 265
+оди 264
+_ф 263
+_ре 262
+_л 259
+ати 258
+га 258
+зн 257
+ови 255
+риј 254
+_св 254
+ну 252
+ако 252
+ча 251
+ниј 251
+ана 251
+рав 250
+иш 247
+кр 247
+чи 245
+уп 245
+це 245
+дин 244
+та_ 244
+рв 244
+рб 243
+ра_ 241
+ају 241
+ава 241
+ун 240
+ој_ 239
+Т 238
+лн 238
+пос 237
+ени 237
+етн 234
+М 234
+_го 233
+_од_ 232
+али 231
+ду 231
+ини 229
+има_ 229
+_да_ 228
+_те 227
+нов 227
+пс 225
+_е 225
+_М 223
+Срб 223
+ца 223
+_Срб 222
+ара 222
+ран 221
+_мо 221
+Бе 221
+_де 221
+биј 220
+и. 220
+јед 219
+К 219
+едн 219
+са_ 219
+пи 218
+оји_ 218
+ур 218
+_об 218
+ове 217
+чн 217
+тно 217
+ави 217
+еогр 217
+еогра 217
+еог 217
+и._ 216
+ств 216
+зв 216
+_Бе 216
+ник 215
+_који 214
+ниц 214
+бо 214
+који 214
+_пос 214
+уме 213
+_К 212
+за_ 211
+и,_ 211
+и, 211
+тра 209
+сп 209
diff --git a/libtextcat/data/new_fingerprints/lm/serbian_ascii.lm b/libtextcat/data/new_fingerprints/lm/serbian_ascii.lm
deleted file mode 100644
index 9471be6eabd5..000000000000
--- a/libtextcat/data/new_fingerprints/lm/serbian_ascii.lm
+++ /dev/null
@@ -1,400 +0,0 @@
-_ 34122
-a 9113
-o 8135
-i 7736
-e 7535
-n 5207
-s 4860
-j 3995
-t 3797
-r 3660
-u 3224
-l 3065
-d 3061
-e_ 2941
-v 2786
-a_ 2746
-k 2701
-m 2492
-o_ 2328
-y 2238
-p 2151
-_s 2148
-i_ 2094
-je 1887
-c 1854
-z 1731
-_n 1437
-_p 1432
-g 1418
-b 1368
-u_ 1333
-je_ 1237
-, 1226
-,_ 1214
-_i 1130
-st 1105
-na 1076
-. 1056
-_d 1033
-._ 1030
-_j 967
-ra 934
-ko 908
-ni 900
-cy 893
-sy 875
-_je 871
-_o 824
-ta 799
-no 780
-_u 777
-re 766
-_b 764
-_k 763
-da 760
-ne 754
-li 750
-ti 745
-se 722
-po 713
-to 713
-_je_ 696
-an 688
-ja 683
-pr 665
-va 651
-lo 634
-_z 626
-m_ 625
-is 625
-il 622
-ov 621
-la 621
-_m 615
-bi 604
-_t 603
-_po 594
-en 586
-_se 578
-os 578
-in 576
-od 576
-ka 552
-ve 548
-ij 538
-_pr 536
-al 536
-vo 535
-om 530
-_i_ 525
-nj 515
-ed 509
-_na 507
-na_ 503
-og 499
-oj 498
-ma 493
-_bi 492
-on 489
-ak 482
-im 481
-ye 481
-ro 480
-vi 473
-sa 469
-ri 464
-da_ 451
-av 450
-at 449
-se_ 447
-es 446
-h 443
-ao 441
-ji 437
-yi 436
-_da 433
-ad 432
-_se_ 430
-lj 428
-zy 426
-za 426
-_ne 425
-de 422
-tr 417
-cj 415
-_u_ 414
-_c 412
-le 402
-_v 397
-ar 390
-_g 390
-ic 384
-n_ 382
-ju 379
-lo_ 377
-aj 376
-_ko 369
-ao_ 366
-ek 361
-_da_ 359
-et 356
-go 354
-iz 346
-_za 345
-_r 344
-or 342
-mo 341
-el 340
-as 339
-ik 336
-te 332
-_sa 329
-d_ 323
-am 320
-me 318
-sto 317
-di 315
-ec 311
-ol 310
-a,_ 307
-a, 307
-_ni 302
-ya 296
-do 295
-yt 294
-su 292
-syt 289
-li_ 288
-sta 286
-ije 284
-ko_ 277
-ti_ 277
-la_ 277
-ga 276
-bil 275
-no_ 274
-a. 273
-nu 272
-a._ 271
-ne_ 271
-om_ 268
-_cy 266
-_na_ 263
-_bil 263
-sv 263
-ru 259
-to_ 256
-_od 253
-cyi 253
-nje 251
-it 251
-pa 250
-az 248
-e,_ 245
-e, 245
-ob 244
-dn 243
-ac 242
-ost 242
-k_ 240
-iv 239
-io 238
-_su 238
-_iz 237
-ilo 235
-_sv 234
-_ka 233
-koj 231
-mi 229
-im_ 229
-ije_ 227
-g_ 226
-em 223
-su_ 223
-ih 223
-ji_ 221
-kr 220
-ut 220
-_koj 220
-V 218
-_st 218
-ye_ 217
-_l 214
-_V 213
-ovo 211
-j_ 210
-uc 208
-ja_ 208
-h_ 207
-nij 206
-sk 206
-ot 203
-io_ 203
-gl 203
-_do 201
-ok 200
-ns 199
-ilo_ 199
-er 197
-ih_ 195
-pre 193
-ci 193
-og_ 193
-ki 192
-sl 191
-t_ 189
-ni_ 189
-_a 189
-vr 188
-ati 187
-_su_ 186
-nije 181
-pro 181
-be 180
-yn 179
-cye 178
-ju_ 178
-ku 177
-isy 177
-ta_ 174
-sye 172
-_tr 172
-O 172
-jen 172
-_to 171
-pi 168
-_pre 168
-S 168
-ima 167
-nije_ 167
-_mo 166
-eg 166
-e._ 164
-za_ 164
-e. 164
-_pro 164
-gov 163
-N 162
-dr 162
-ako 162
-tv 162
-_S 160
-P 159
-ma_ 159
-_on 159
-sp 158
-nst 158
-anj 158
-dj 157
-oc 157
-_sy 156
-ev 155
-ce 155
-lik 154
-_nij 153
-_N 152
-ist 151
-_P 151
-_nije 151
-- 151
-ba 150
-jed 150
-sti 150
-ova 149
-_is 148
-id 148
-ton 148
-ke 147
-pos 147
-od_ 147
-osy 146
-Vi 146
-ila 145
-ins 145
-bo 145
-_Vi 145
-ir 144
-_za_ 144
-oz 144
-ecj 144
-cje 143
-on_ 143
-zn 142
-_O 141
-us 141
-i, 141
-i,_ 141
-mu 140
-inst 140
-cya 140
-oji 139
-esy 139
-icy 139
-lja 138
-_go 138
-i. 138
-_re 137
-_bilo 137
-edn 137
-acy 137
-rat 137
-bilo 137
-ali 136
-ecy 136
-ija 135
-pri 135
-ad_ 135
-lic 135
-i._ 135
-Vins 134
-Vin 134
-ston 134
-Vinst 134
-ga_ 134
-nston 134
-insto 134
-nsto 134
-_Vins 133
-_Vin 133
-zi 132
-ran 131
-le_ 130
-ili 130
-bilo_ 130
-_pos 129
-ila_ 129
-est 128
-_ve 128
-tre 128
-zye 127
-_nj 127
-si 126
-f 126
-alo 125
-ako_ 125
-tra 125
-sa_ 125
-pu 124
-ud 124
-z_ 124
-_ra 124
-iti 124
-_de 124
-odi 123
-T 123
--_ 122
-o,_ 121
-o, 121
-du 121
-rs 121
-B 120
-ka_ 119
-red 119
-_od_ 118
-an_ 118
-nu_ 118
-iko 117
-dno 117
-_pa 117
-s_ 116
diff --git a/libxml2/libxml2-xpath.patch b/libxml2/libxml2-xpath.patch
index e02982f16efe..107de91ed862 100644
--- a/libxml2/libxml2-xpath.patch
+++ b/libxml2/libxml2-xpath.patch
@@ -1,6 +1,6 @@
---- misc/libxml2-2.7.6/xpath.c
-+++ misc/build/libxml2-2.7.6/xpath.c
-@@ -8104,9 +8104,17 @@
+--- misc/libxml2-2.7.6/xpath.c 2009-09-24 17:32:00.000000000 +0200
++++ misc/build/libxml2-2.7.6/xpath.c 2011-01-03 17:21:08.788256100 +0100
+@@ -8106,9 +8106,17 @@
xmlNodePtr
xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
@@ -21,7 +21,7 @@
if (cur == NULL) return(NULL) ; /* ERROR */
if (cur->next != NULL) return(cur->next) ;
do {
-@@ -8160,8 +8168,13 @@
+@@ -8162,8 +8170,13 @@
xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, xmlNodePtr cur)
{
if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
@@ -36,7 +36,7 @@
if (cur == NULL)
return (NULL);
if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
-@@ -8205,8 +8218,8 @@
+@@ -8207,8 +8220,8 @@
cur = ctxt->context->node;
if (cur == NULL)
return (NULL);
@@ -47,3 +47,24 @@
ctxt->ancestor = cur->parent;
}
if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
+@@ -11737,11 +11750,16 @@
+
+ if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
+ xmlXPathObjectPtr tmp;
+- /* pop the result */
++ /* pop the result if any */
+ tmp = valuePop(ctxt);
+- xmlXPathReleaseObject(xpctxt, tmp);
+- /* then pop off contextObj, which will be freed later */
+- valuePop(ctxt);
++ if (tmp != contextObj) {
++ /*
++ * Free up the result
++ * then pop off contextObj, which will be freed later
++ */
++ xmlXPathReleaseObject(xpctxt, tmp);
++ valuePop(ctxt);
++ }
+ goto evaluation_error;
+ }
+
diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx
index 16874c4ff830..9c02a976fcbd 100644
--- a/linguistic/source/misc2.cxx
+++ b/linguistic/source/misc2.cxx
@@ -249,7 +249,10 @@ String GetWritableDictionaryURL( const String &rDicName )
aURLObj.Append( rDicName, INetURLObject::ENCODE_ALL );
DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL");
- return aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI );
+ // NO_DECODE preserves the escape sequences that might be included in aDirName
+ // depending on the characters used in the path string. (Needed when comparing
+ // the dictionary URL with GetDictionaryWriteablePath in DicList::createDictionary.)
+ return aURLObj.GetMainURL( INetURLObject::NO_DECODE );
}
diff --git a/neon/makefile.mk b/neon/makefile.mk
index d296db7a3f98..c92a84936f46 100644
--- a/neon/makefile.mk
+++ b/neon/makefile.mk
@@ -46,10 +46,10 @@ TARGET=so_neon
@echo "neon disabled...."
.ENDIF
-NEON_NAME=neon-0.29.3
+NEON_NAME=neon-0.29.5
TARFILE_NAME=$(NEON_NAME)
-TARFILE_MD5=ba1015b59c112d44d7797b62fe7bee51
+TARFILE_MD5=ff369e69ef0f0143beb5626164e87ae2
PATCH_FILES=neon.patch
.IF "$(GUI)"=="WNT"
diff --git a/neon/neon.patch b/neon/neon.patch
index 3d4e5019e0b7..51ec3a8d6d0b 100644
--- a/neon/neon.patch
+++ b/neon/neon.patch
@@ -1,5 +1,5 @@
---- misc/neon-0.29.3/src/config.h 2010-03-23 14:47:43.000000000 +0100
-+++ misc/build/neon-0.29.3/src/config.h 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/config.h 2010-12-07 15:53:32.000000000 +0100
++++ misc/build/neon-0.29.5/src/config.h 2010-12-07 13:44:29.000000000 +0100
@@ -1 +1,488 @@
-dummy
+
@@ -304,7 +304,7 @@
+#define NEON_IS_LIBRARY 1
+
+/* Define to be the neon version string */
-+#define NEON_VERSION "0.29.3"
++#define NEON_VERSION "0.29.5"
+
+/* Define to enable debugging */
+/* #undef NE_DEBUGGING */
@@ -363,7 +363,7 @@
+#define NE_VERSION_MINOR (29)
+
+/* Define to be neon library patch version */
-+#define NE_VERSION_PATCH (3)
++#define NE_VERSION_PATCH (5)
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "neon@webdav.org"
@@ -372,13 +372,13 @@
+#define PACKAGE_NAME "neon"
+
+/* Define to the full name and version of this package. */
-+#define PACKAGE_STRING "neon 0.29.3"
++#define PACKAGE_STRING "neon 0.29.5"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "neon"
+
+/* Define to the version of this package. */
-+#define PACKAGE_VERSION "0.29.3"
++#define PACKAGE_VERSION "0.29.5"
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
@@ -490,8 +490,8 @@
+#else
+#define HAVE_NTLM 1
+#endif
---- misc/neon-0.29.3/src/makefile.mk 2010-03-23 14:47:43.000000000 +0100
-+++ misc/build/neon-0.29.3/src/makefile.mk 2010-03-23 14:45:21.000000000 +0100
+--- misc/neon-0.29.5/src/makefile.mk 2010-12-07 15:53:32.000000000 +0100
++++ misc/build/neon-0.29.5/src/makefile.mk 2010-12-07 13:44:29.000000000 +0100
@@ -1 +1,102 @@
-dummy
+PRJ=..$/..$/..$/..$/..
@@ -596,46 +596,71 @@
+# --- Targets ------------------------------------------------------
+DEF1NAME=$(SHL1TARGET)
+.INCLUDE : target.mk
---- misc/neon-0.29.3/src/ne_auth.c 2009-12-30 22:29:30.000000000 +0100
-+++ misc/build/neon-0.29.3/src/ne_auth.c 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_auth.c 2010-10-14 17:00:53.000000000 +0200
++++ misc/build/neon-0.29.5/src/ne_auth.c 2010-12-07 15:39:56.000000000 +0100
@@ -367,7 +367,7 @@
static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt,
struct auth_challenge *chall, char *pwbuf)
{
- if (chall->handler->creds(chall->handler->userdata, sess->realm,
-+ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm,
++ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm,
chall->handler->attempt++, sess->username, pwbuf) == 0) {
return 0;
} else {
-@@ -617,6 +617,7 @@
- int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0;
+@@ -610,10 +610,12 @@
+ return NULL;
+ }
+
+-static int continue_sspi(auth_session *sess, int ntlm, const char *hdr)
++static int continue_sspi(auth_session *sess, int ntlm, const char *hdr,
++ int attempt, struct auth_challenge *parms, ne_buffer **errmsg)
+ {
int status;
char *response = NULL;
+ char password[NE_ABUFSIZ];
NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n");
-@@ -633,8 +634,17 @@
+@@ -630,8 +632,17 @@
return status;
}
}
-+
-+ /* Authentification needs more than one http request.
-+ * As long as authentification in progress use the existing credentials.
-+ * Otherwise get new credentials.*/
-+ if (!parms->opaque)
-+ if (get_credentials(sess, errmsg, attempt, parms, password)) {
-+ /* Failed to get credentials */
-+ return -1;
-+ }
-
-- status = ne_sspi_authenticate(sess->sspi_context, parms->opaque, &response);
-+ status = ne_sspi_authenticate(sess->sspi_context, parms->opaque, &response, sess->username, password);
+-
+- status = ne_sspi_authenticate(sess->sspi_context, hdr, &response);
++
++ /* Authentification needs more than one http request.
++ * As long as authentification in progress use the existing credentials.
++ * Otherwise get new credentials.*/
++ if (!hdr)
++ if (get_credentials(sess, errmsg, attempt, parms, password)) {
++ /* Failed to get credentials */
++ return -1;
++ }
++
++ status = ne_sspi_authenticate(sess->sspi_context, hdr, &response, sess->username, password);
if (status) {
return status;
}
---- misc/neon-0.29.3/src/ne_auth.h 2009-09-01 22:13:12.000000000 +0200
-+++ misc/build/neon-0.29.3/src/ne_auth.h 2010-03-23 12:19:50.000000000 +0100
+@@ -651,7 +662,7 @@
+ {
+ int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0;
+
+- return continue_sspi(sess, ntlm, parms->opaque);
++ return continue_sspi(sess, ntlm, parms->opaque, attempt, parms, errmsg);
+ }
+
+ static int verify_sspi(struct auth_request *req, auth_session *sess,
+@@ -674,7 +685,7 @@
+ return NE_OK;
+ }
+
+- return continue_sspi(sess, ntlm, ptr);
++ return continue_sspi(sess, ntlm, ptr, 0, NULL, NULL);
+ }
+
+ #endif
+--- misc/neon-0.29.5/src/ne_auth.h 2009-09-01 22:13:12.000000000 +0200
++++ misc/build/neon-0.29.5/src/ne_auth.h 2010-12-07 13:44:30.000000000 +0100
@@ -47,8 +47,8 @@
* Hint: if you just wish to attempt authentication just once (even if
* the user gets the username/password wrong), have the callback
@@ -647,8 +672,8 @@
/* Set callbacks to provide credentials for server and proxy
* authentication, using the default set of authentication protocols.
---- misc/neon-0.29.3/src/ne_defs.h 2009-09-02 16:04:43.000000000 +0200
-+++ misc/build/neon-0.29.3/src/ne_defs.h 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_defs.h 2010-01-11 23:57:34.000000000 +0100
++++ misc/build/neon-0.29.5/src/ne_defs.h 2010-12-07 13:44:30.000000000 +0100
@@ -41,7 +41,7 @@
#endif
@@ -658,8 +683,8 @@
#define ssize_t int
#endif
---- misc/neon-0.29.3/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100
-+++ misc/build/neon-0.29.3/src/ne_locks.c 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100
++++ misc/build/neon-0.29.5/src/ne_locks.c 2010-12-07 13:44:30.000000000 +0100
@@ -579,6 +579,23 @@
const char *token = ne_get_response_header(ctx->req, "Lock-Token");
/* at the root element; retrieve the Lock-Token header,
@@ -726,8 +751,8 @@
ctx->found = 1;
}
}
---- misc/neon-0.29.3/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100
-+++ misc/build/neon-0.29.3/src/ne_locks.h 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100
++++ misc/build/neon-0.29.5/src/ne_locks.h 2010-12-07 13:44:30.000000000 +0100
@@ -22,6 +22,10 @@
#ifndef NE_LOCKS_H
#define NE_LOCKS_H
@@ -739,8 +764,8 @@
#include "ne_request.h" /* for ne_session + ne_request */
#include "ne_uri.h" /* for ne_uri */
---- misc/neon-0.29.3/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200
-+++ misc/build/neon-0.29.3/src/ne_sspi.c 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200
++++ misc/build/neon-0.29.5/src/ne_sspi.c 2010-12-07 13:44:31.000000000 +0100
@@ -206,6 +206,45 @@
}
@@ -826,8 +851,8 @@
securityStatus =
initializeSecurityContext(&sspiContext->credentials, NULL,
---- misc/neon-0.29.3/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100
-+++ misc/build/neon-0.29.3/src/ne_sspi.h 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100
++++ misc/build/neon-0.29.5/src/ne_sspi.h 2010-12-07 13:44:31.000000000 +0100
@@ -41,7 +41,7 @@
int ne_sspi_clear_context(void *context);
@@ -837,8 +862,8 @@
#endif /* HAVE_SSPI */
---- misc/neon-0.29.3/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100
-+++ misc/build/neon-0.29.3/src/ne_uri.c 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100
++++ misc/build/neon-0.29.5/src/ne_uri.c 2010-12-07 13:44:31.000000000 +0100
@@ -42,7 +42,7 @@
#include "ne_alloc.h"
#include "ne_uri.h"
@@ -884,8 +909,8 @@
/* 3x */ DG, DG, DG, DG, DG, DG, DG, DG, DG, DG, CL, SD, OT, SD, OT, QU,
/* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL,
/* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US,
---- misc/neon-0.29.3/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100
-+++ misc/build/neon-0.29.3/src/ne_utils.c 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100
++++ misc/build/neon-0.29.5/src/ne_utils.c 2010-12-07 13:44:31.000000000 +0100
@@ -118,6 +118,9 @@
#ifdef HAVE_GNUTLS
", GNU TLS " LIBGNUTLS_VERSION
@@ -915,8 +940,8 @@
return 1;
#endif /* NE_HAVE_* */
default:
---- misc/neon-0.29.3/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200
-+++ misc/build/neon-0.29.3/src/ne_utils.h 2010-03-23 12:19:50.000000000 +0100
+--- misc/neon-0.29.5/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200
++++ misc/build/neon-0.29.5/src/ne_utils.h 2010-12-07 13:44:31.000000000 +0100
@@ -54,6 +54,7 @@
#define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */
#define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */
diff --git a/neon/neon_exports_unix.patch b/neon/neon_exports_unix.patch
index f5c2ce8afea3..d162a145d707 100644
--- a/neon/neon_exports_unix.patch
+++ b/neon/neon_exports_unix.patch
@@ -1,5 +1,5 @@
---- misc/neon-0.29.3/src/exports.map 2009-09-29 10:28:13.531250000 +0200
-+++ misc/build/neon-0.29.3/src/exports.map 2009-09-21 12:16:53.453125000 +0200
+--- misc/neon-0.29.5/src/exports.map 2009-09-29 10:28:13.531250000 +0200
++++ misc/build/neon-0.29.5/src/exports.map 2009-09-21 12:16:53.453125000 +0200
@@ -0,0 +1,288 @@
+UDK_3_0_0 {
+ global:
diff --git a/neon/neon_exports_win.patch b/neon/neon_exports_win.patch
index 85d73da2b41d..40f130e66da3 100644
--- a/neon/neon_exports_win.patch
+++ b/neon/neon_exports_win.patch
@@ -1,5 +1,5 @@
---- misc/neon-0.29.3/src/exports.map 2009-09-29 10:28:13.531250000 +0200
-+++ misc/build/neon-0.29.3/src/exports.map 2009-09-21 12:16:53.453125000 +0200
+--- misc/neon-0.29.5/src/exports.map 2009-09-29 10:28:13.531250000 +0200
++++ misc/build/neon-0.29.5/src/exports.map 2009-09-21 12:16:53.453125000 +0200
@@ -0,0 +1,294 @@
+UDK_3_0_0 {
+ global:
diff --git a/neon/version.mk b/neon/version.mk
index 418999ff1452..0bac1cd47f05 100644
--- a/neon/version.mk
+++ b/neon/version.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -30,7 +30,7 @@ NEON_MAJOR=0
# the minor
NEON_MINOR=29
# the micro
-NEON_MICRO=3
+NEON_MICRO=5
# concat
NEON_VERSION=$(NEON_MAJOR)$(NEON_MINOR)$(NEON_MICRO)
diff --git a/odk/examples/DevelopersGuide/Database/CodeSamples.java b/odk/examples/DevelopersGuide/Database/CodeSamples.java
index 79b3405a4602..994e6e4f9b3d 100644
--- a/odk/examples/DevelopersGuide/Database/CodeSamples.java
+++ b/odk/examples/DevelopersGuide/Database/CodeSamples.java
@@ -151,33 +151,6 @@ public class CodeSamples
if(xDriverManager != null)
{
// first create the needed url
- String adabasURL = "sdbc:adabas::MYDB0";
- // second create the necessary properties
- com.sun.star.beans.PropertyValue [] adabasProps = new com.sun.star.beans.PropertyValue[]
- {
- new com.sun.star.beans.PropertyValue("user",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE),
- new com.sun.star.beans.PropertyValue("password",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE)
- };
- // now create a connection to adabas
- con = xDriverManager.getConnectionWithInfo(adabasURL,adabasProps);
- }
- return con;
- }
-
- // uses the driver manager to create a new connection and dispose it.
- public static XConnection openToJDBC() throws com.sun.star.uno.Exception
- {
- XConnection con = null;
- // create the DriverManager
- Object driverManager =
- xMCF.createInstanceWithContext("com.sun.star.sdbc.DriverManager",
- xContext);
- // query for the interface
- com.sun.star.sdbc.XDriverManager xDriverManager;
- xDriverManager = (XDriverManager)UnoRuntime.queryInterface(XDriverManager.class,driverManager);
- if(xDriverManager != null)
- {
- // first create the needed url
String url = "jdbc:mysql://localhost:3306/TestTables";
// second create the necessary properties
com.sun.star.beans.PropertyValue [] props = new com.sun.star.beans.PropertyValue[]
@@ -186,7 +159,7 @@ public class CodeSamples
new com.sun.star.beans.PropertyValue("password",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE),
new com.sun.star.beans.PropertyValue("JavaDriverClass",0,"org.gjt.mm.mysql.Driver",com.sun.star.beans.PropertyState.DIRECT_VALUE)
};
- // now create a connection to adabas
+ // now create a connection to mysql
con = xDriverManager.getConnectionWithInfo(url,props);
}
return con;
@@ -198,7 +171,7 @@ public class CodeSamples
XConnection con = null;
// create the Driver with the implementation name
Object aDriver =
- xMCF.createInstanceWithContext("com.sun.star.comp.sdbcx.adabas.ODriver",
+ xMCF.createInstanceWithContext("org.openoffice.comp.drivers.MySQL.Driver",
xContext);
// query for the interface
com.sun.star.sdbc.XDriver xDriver;
@@ -206,15 +179,16 @@ public class CodeSamples
if(xDriver != null)
{
// first create the needed url
- String adabasURL = "sdbc:adabas::MYDB0";
+ String url = "jdbc:mysql://localhost:3306/TestTables";
// second create the necessary properties
- com.sun.star.beans.PropertyValue [] adabasProps = new com.sun.star.beans.PropertyValue[]
+ com.sun.star.beans.PropertyValue [] props = new com.sun.star.beans.PropertyValue[]
{
new com.sun.star.beans.PropertyValue("user",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE),
- new com.sun.star.beans.PropertyValue("password",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE)
+ new com.sun.star.beans.PropertyValue("password",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE),
+ new com.sun.star.beans.PropertyValue("JavaDriverClass",0,"org.gjt.mm.mysql.Driver",com.sun.star.beans.PropertyState.DIRECT_VALUE)
};
- // now create a connection to adabas
- con = xDriver.connect(adabasURL,adabasProps);
+ // now create a connection to mysql
+ con = xDriver.connect(url,props);
}
return con;
}
diff --git a/offapi/com/sun/star/awt/AnimatedImagesControl.idl b/offapi/com/sun/star/awt/AnimatedImagesControl.idl
new file mode 100755
index 000000000000..90f8b3a356e8
--- /dev/null
+++ b/offapi/com/sun/star/awt/AnimatedImagesControl.idl
@@ -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 __com_sun_star_awt_AnimatedImagesControl_idl__
+#define __com_sun_star_awt_AnimatedImagesControl_idl__
+
+#include <com/sun/star/awt/UnoControl.idl>
+
+//======================================================================================================================
+
+module com { module sun { module star { module awt {
+
+interface XAnimation;
+
+//======================================================================================================================
+
+/** is the default control used for an <type>AnimatedImagesControlModel</type>, displayed a series of
+ images.
+
+ @since OOo 3.4
+ */
+service AnimatedImagesControl
+{
+ service com::sun::star::awt::UnoControl;
+
+ interface XAnimation;
+};
+
+//======================================================================================================================
+
+}; }; }; };
+
+//======================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/AnimatedImagesControlModel.idl b/offapi/com/sun/star/awt/AnimatedImagesControlModel.idl
new file mode 100755
index 000000000000..2bc1260775c9
--- /dev/null
+++ b/offapi/com/sun/star/awt/AnimatedImagesControlModel.idl
@@ -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 __com_sun_star_awt_AnimatedImagesControlModel_idl__
+#define __com_sun_star_awt_AnimatedImagesControlModel_idl__
+
+#include <com/sun/star/awt/UnoControlModel.idl>
+
+//======================================================================================================================
+
+module com { module sun { module star { module awt {
+
+interface XAnimatedImages;
+
+//======================================================================================================================
+
+/** describes the model for a control displaying a series of images
+
+ @since OOo 3.4
+ */
+service AnimatedImagesControlModel
+{
+ service com::sun::star::awt::UnoControlModel;
+
+ interface XAnimatedImages;
+};
+
+//======================================================================================================================
+
+}; }; }; };
+
+//======================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/SpinningProgressControlModel.idl b/offapi/com/sun/star/awt/SpinningProgressControlModel.idl
new file mode 100755
index 000000000000..a75417d41cc3
--- /dev/null
+++ b/offapi/com/sun/star/awt/SpinningProgressControlModel.idl
@@ -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 __com_sun_star_awt_SpinningProgressControlModel_idl__
+#define __com_sun_star_awt_SpinningProgressControlModel_idl__
+
+#include <com/sun/star/awt/AnimatedImagesControlModel.idl>
+
+//======================================================================================================================
+
+module com { module sun { module star { module awt {
+
+//======================================================================================================================
+
+/** is a specialization of the <type>AnimatedImagesControlModel</type> which provides standard image sets
+ for displaying a non-procentual progress.
+
+ <p>Three image sets are provided, of size 16x16, 32x32, and 64x64 pixels.</p>
+ */
+service SpinningProgressControlModel
+{
+ service AnimatedImagesControlModel;
+};
+
+//======================================================================================================================
+
+}; }; }; };
+
+//======================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl b/offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl
new file mode 100644
index 000000000000..a91065f72d66
--- /dev/null
+++ b/offapi/com/sun/star/awt/UnoControlDialogModelProvider.idl
@@ -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 __com_sun_star_awt_UnoControlDialogModelProvider_idl__
+#define __com_sun_star_awt_UnoControlDialogModelProvider_idl__
+
+#include <com/sun/star/container/XNameContainer.idl>
+#include <com/sun/star/beans/XPropertySet.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt {
+
+//=============================================================================
+
+/** specifies a service to load a dialog model and allows to access the control models inside
+
+ @since OOo 3.3.0
+ */
+service UnoControlDialogModelProvider : com::sun::star::container::XNameContainer
+{
+ /** Creates a new dialog model
+ */
+ create([in] string URL)raises ( com::sun::star::lang::IllegalArgumentException );
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/UnoControlSimpleAnimation.idl b/offapi/com/sun/star/awt/UnoControlSimpleAnimation.idl
index cf45f0aea0f0..b00ec8740521 100644..100755
--- a/offapi/com/sun/star/awt/UnoControlSimpleAnimation.idl
+++ b/offapi/com/sun/star/awt/UnoControlSimpleAnimation.idl
@@ -42,17 +42,14 @@
//=============================================================================
-/** specifies a simple animation control.
-
- <p>The model of an <type>UnoControlSimpleAnimation</type> control must support
- the <type>UnoControlSimpleAnimationModel</type> service.</p>
-
+/**
@since OOo 2.2
+ @deprecated
+ You should use <type>AnimatedImagesControl</type>.
*/
published service UnoControlSimpleAnimation
{
service com::sun::star::awt::UnoControl;
-
interface com::sun::star::awt::XSimpleAnimation;
};
diff --git a/offapi/com/sun/star/awt/UnoControlSimpleAnimationModel.idl b/offapi/com/sun/star/awt/UnoControlSimpleAnimationModel.idl
index ca301483263f..1f96099fee63 100644..100755
--- a/offapi/com/sun/star/awt/UnoControlSimpleAnimationModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlSimpleAnimationModel.idl
@@ -38,36 +38,16 @@
//=============================================================================
-/** specifies the standard model of an <type>UnoControlSimpleAnimation</type>.
-
- <p>The simple animation control displays a sequence of images.</p>
-
- <p> </p>
-
- @see UnoControlScrollBarModel
+/**
@since OOo 2.2
+ @deprecated
+ You should use <type>AnimatedImagesControlModel</type>.
*/
published service UnoControlSimpleAnimationModel
{
service com::sun::star::awt::UnoControlModel;
-
- //-------------------------------------------------------------------------
-
- /** specifies the time in milliseconds between two animation steps.
-
- <pre>This is the minimum time, the actual value might be longer due to
- system load. The default value will be 100 ms.</pre>
- */
[property] long StepTime;
-
- //-------------------------------------------------------------------------
-
- /** specifies whether the animation will restart again after displaying the last
- image.
-
- <p>The default is FALSE.</p>
- */
[property] boolean AutoRepeat;
};
diff --git a/offapi/com/sun/star/awt/UnoControlThrobber.idl b/offapi/com/sun/star/awt/UnoControlThrobber.idl
index f5194075019a..85b5d8b850f7 100644
--- a/offapi/com/sun/star/awt/UnoControlThrobber.idl
+++ b/offapi/com/sun/star/awt/UnoControlThrobber.idl
@@ -42,17 +42,14 @@
//=============================================================================
-/** specifies a simple animation control.
-
- <p>The model of an <type>UnoControlThrobber</type> control must support
- the <type>UnoControlThrobberModel</type> service.</p>
-
+/**
@since OOo 2.2
+ @deprecatd
+ You should use <type>AnimatedImagesControl</type>.
*/
published service UnoControlThrobber
{
service com::sun::star::awt::UnoControl;
-
interface com::sun::star::awt::XThrobber;
};
diff --git a/offapi/com/sun/star/awt/UnoControlThrobberModel.idl b/offapi/com/sun/star/awt/UnoControlThrobberModel.idl
index f2eacad5b76b..060ff105c119 100644
--- a/offapi/com/sun/star/awt/UnoControlThrobberModel.idl
+++ b/offapi/com/sun/star/awt/UnoControlThrobberModel.idl
@@ -38,14 +38,10 @@
//=============================================================================
-/** specifies the standard model of an <type>UnoControlThrobber</type>.
-
- <p>The simple animation control displays a sequence of images.</p>
-
- <p> </p>
-
- @see UnoControlScrollBarModel
+/**
@since OOo 2.2
+ @deprecatd
+ You should use <type>SpinningAnimationControlModel</type>.
*/
published service UnoControlThrobberModel
diff --git a/offapi/com/sun/star/awt/XAnimatedImages.idl b/offapi/com/sun/star/awt/XAnimatedImages.idl
new file mode 100755
index 000000000000..a03d08c965f1
--- /dev/null
+++ b/offapi/com/sun/star/awt/XAnimatedImages.idl
@@ -0,0 +1,176 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_awt_XAnimatedImages_idl__
+#define __com_sun_star_awt_XAnimatedImages_idl__
+
+#include <com/sun/star/container/XContainerListener.idl>
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+#include <com/sun/star/container/XContainer.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+
+//======================================================================================================================
+
+module com { module sun { module star { module awt {
+
+//======================================================================================================================
+
+/** allows administrating a set of images, to be displayed as animated seres.
+
+ <p>Components implementing this interface maintain a variable number of image sets. Components displaying
+ those images will choose the best-fitting image set depending on the available space, and possibly other
+ restrictions.</p>
+
+ @since OOo 3.4
+ */
+interface XAnimatedImages
+{
+ /** specifies the time in milliseconds between two animation steps.
+
+ <p>This is the minimum time, the actual value might be longer due to
+ system load. The default value will be 100 ms.</p>
+ */
+ [attribute] long StepTime;
+
+ /** specifies whether the animation should start over with the first image of the image series when the last image
+ has been played.
+
+ <p>The default value for this attribute is <TRUE/>.</p>
+ */
+ [attribute] boolean AutoRepeat;
+
+ /** controls the way the images are scaled up or down, when the available space is larger or smaller
+ than what is needed for them.
+
+ <p>Allowed values are those from the <type>ImageScaleMode</type> constants group.</p>
+ */
+ [attribute] short ScaleMode
+ {
+ set raises (::com::sun::star::lang::IllegalArgumentException);
+ };
+
+ /** returns the number of images sets maintained by the component.
+ */
+ long
+ getImageSetCount();
+
+ /** returns the URLs of the image set with the given index
+
+ @param i_index
+ the index of the set those image URLs are to be retrieved. Must be greater than or equal to <code>0</code>,
+ and smaller than the value returned by <member>getImageSetCount</member>.
+
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the <code>i_index</code> is not a valid index.
+ */
+ sequence< string >
+ getImageSet
+ (
+ [in] long i_index
+ )
+ raises
+ (
+ ::com::sun::star::lang::IndexOutOfBoundsException
+ );
+
+ /** sets the URLs of the image set with the given index
+
+ @param i_index
+ the index at which a new image set should be inserted. Must be greater than or equal to <code>0</code>,
+ and smaller than or equal to the value returned by <member>getImageSetCount</member>.
+ @param i_imageURLs
+ the URLs for the images for the given set. Will be resolved using a <type scope="com::sun::star::graphic">GraphicProvider</type>.
+
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the <code>i_index</code> is not a valid index.
+ */
+ void
+ insertImageSet
+ (
+ [in] long i_index,
+ [in] sequence< string > i_imageURLs
+ )
+ raises
+ (
+ ::com::sun::star::lang::IndexOutOfBoundsException
+ );
+
+ /** replaces the image set given by index with a new one
+
+ @param i_index
+ the index of the set those image URLs are to be replaced. Must be greater than or equal to <code>0</code>,
+ and smaller than the value returned by <member>getImageSetCount</member>.
+
+ @param i_imageURLs
+ the URLs for the images for the given set. Will be resolved using a <type scope="com::sun::star::graphic">GraphicProvider</type>.
+
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the <code>i_index</code> is not a valid index.
+ */
+ void
+ replaceImageSet
+ (
+ [in] long i_index,
+ [in] sequence< string > i_imageURLs
+ )
+ raises
+ (
+ ::com::sun::star::lang::IndexOutOfBoundsException
+ );
+
+
+ /** removes the image set with the given index
+
+ @param i_index
+ the index of the set to remove. Must be greater than or equal to <code>0</code>,
+ and smaller than the value returned by <member>getImageSetCount</member>.
+
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the <code>i_index</code> is not a valid index.
+ */
+ void
+ removeImageSet
+ (
+ [in] long i_index
+ )
+ raises
+ (
+ ::com::sun::star::lang::IndexOutOfBoundsException
+ );
+
+
+ /** allows other components to observer the insertion, removal, and replacement of image sets
+ */
+ interface ::com::sun::star::container::XContainer;
+};
+
+//======================================================================================================================
+
+}; }; }; };
+
+//======================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/XAnimation.idl b/offapi/com/sun/star/awt/XAnimation.idl
new file mode 100755
index 000000000000..e1e8f6023a7d
--- /dev/null
+++ b/offapi/com/sun/star/awt/XAnimation.idl
@@ -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 __com_sun_star_awt_XAnimation_idl__
+#define __com_sun_star_awt_XAnimation_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+
+//======================================================================================================================
+
+module com { module sun { module star { module awt {
+
+//======================================================================================================================
+
+/** allows controlling an animation.
+
+ @since OOo 3.4
+ */
+interface XAnimation
+{
+ /** starts the animation
+ */
+ void startAnimation();
+
+ /** stops the animation
+ */
+ void stopAnimation();
+
+ /** determines whether the animation is currently running
+ */
+ boolean isAnimationRunning();
+};
+
+//======================================================================================================================
+
+}; }; }; };
+
+//======================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/XSimpleAnimation.idl b/offapi/com/sun/star/awt/XSimpleAnimation.idl
index 1cfd758590b9..bff9eeeb5a90 100644..100755
--- a/offapi/com/sun/star/awt/XSimpleAnimation.idl
+++ b/offapi/com/sun/star/awt/XSimpleAnimation.idl
@@ -41,28 +41,15 @@
//=============================================================================
-/** Controls the animation control.
+/**
+ @deprecated
+ You should use <type>XAnimation</type>, <type>AnimatedImagesControl</type>, and <type>AnimatedImagesControlModel</type>.
*/
published interface XSimpleAnimation: com::sun::star::uno::XInterface
{
- //-------------------------------------------------------------------------
-
- /** starts the animation of the control.
- */
void start();
-
- //-------------------------------------------------------------------------
-
- /** stops the animation of the control.
- */
void stop();
-
- //-------------------------------------------------------------------------
-
- /** The list of images to be displayed.
- */
void setImageList( [in] sequence < com::sun::star::graphic::XGraphic > ImageList );
-
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/XThrobber.idl b/offapi/com/sun/star/awt/XThrobber.idl
index 0a4ac133524a..04dc6887cbe9 100644
--- a/offapi/com/sun/star/awt/XThrobber.idl
+++ b/offapi/com/sun/star/awt/XThrobber.idl
@@ -41,20 +41,13 @@
//=============================================================================
-/** Controls the animation control.
+/**
+ @deprecatd
+ You should use <type>XAnimation</type>, <type>AnimatedImagesControl</type>, and <type>AnimatedImagesControlModel</type>.
*/
published interface XThrobber: com::sun::star::uno::XInterface
{
- //-------------------------------------------------------------------------
-
- /** starts the animation of the control.
- */
void start();
-
- //-------------------------------------------------------------------------
-
- /** stops the animation of the control.
- */
void stop();
};
diff --git a/offapi/com/sun/star/awt/makefile.mk b/offapi/com/sun/star/awt/makefile.mk
index a6357703500c..c2397d81bf44 100644
--- a/offapi/com/sun/star/awt/makefile.mk
+++ b/offapi/com/sun/star/awt/makefile.mk
@@ -161,6 +161,7 @@ IDLFILES=\
UnoControlDialog.idl\
UnoControlDialogElement.idl\
UnoControlDialogModel.idl\
+ UnoControlDialogModelProvider.idl\
UnoControlEdit.idl\
UnoControlEditModel.idl\
UnoControlFileControl.idl\
@@ -334,7 +335,12 @@ IDLFILES=\
XPopupMenuExtended.idl \
XItemList.idl \
XItemListListener.idl \
- ItemListEvent.idl
+ ItemListEvent.idl \
+ AnimatedImagesControl.idl \
+ AnimatedImagesControlModel.idl \
+ XAnimatedImages.idl \
+ XAnimation.idl \
+ SpinningProgressControlModel.idl
# ------------------------------------------------------------------
diff --git a/dbaccess/source/inc/cfg_reghelper.hxx b/offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl
index 157b6eaa72de..ef678395fe06 100644
--- a/dbaccess/source/inc/cfg_reghelper.hxx
+++ b/offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl
@@ -24,37 +24,33 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef __com_sun_star_awt_tab_TabPageActivationEvent_idl__
+#define __com_sun_star_awt_tab_TabPageActivationEvent_idl__
-#ifndef CFG_REGHELPER_HXX
-#define CFG_REGHELPER_HXX
-
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
-#include <com/sun/star/uno/Sequence.hxx>
-#endif
-#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#endif
-#ifndef _RTL_USTRING_HXX_
-#include <rtl/ustring.hxx>
-#endif
-#ifndef _CPPUHELPER_FACTORY_HXX_
-#include <cppuhelper/factory.hxx>
+#ifndef __com_sun_star_lang_EventObject_idl__
+#include <com/sun/star/lang/EventObject.idl>
#endif
-namespace dbacfg
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** An event used by a <type>XTabPageContainer</type> to notify changes in tab page activation.
+
+ @since OOo 3.4
+ */
+struct TabPageActivatedEvent: com::sun::star::lang::EventObject
{
+ /** Contains the ID of the tab page
+ */
+ short TabPageID;
- #define _REGISTRATIONHELPER_INCLUDED_INDIRECTLY_
- #include "registrationhelper.hxx"
- #undef _REGISTRATIONHELPER_INCLUDED_INDIRECTLY_
+};
-}
+//=============================================================================
-#endif // CFG_REGHELPER_HXX
+}; }; }; }; };
+#endif
diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPage.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPage.idl
new file mode 100644
index 000000000000..6244b18e0c77
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/UnoControlTabPage.idl
@@ -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 __com_sun_star_awt_tab_UnoControlTabPage_idl__
+#define __com_sun_star_awt_tab_UnoControlTabPage_idl__
+
+#include <com/sun/star/awt/UnoControlContainer.idl>
+#include <com/sun/star/awt/tab/XTabPage.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** specifies a TabPage control.
+
+ @since OOo 3.4
+*/
+
+service UnoControlTabPage
+{
+ service com::sun::star::awt::UnoControlContainer;
+
+ interface XTabPage;
+
+};
+
+//=============================================================================
+
+ }; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl
new file mode 100644
index 000000000000..488ce4b5354a
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl
@@ -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 __com_sun_star_awt_tab_UnoControlTabPageContainer_idl__
+#define __com_sun_star_awt_tab_UnoControlTabPageContainer_idl__
+
+#include <com/sun/star/awt/UnoControl.idl>
+#include <com/sun/star/awt/tab/XTabPageContainer.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** specifies a TabPageContainer control.
+
+ @since OOo 3.4
+ */
+service UnoControlTabPageContainer
+{
+ service com::sun::star::awt::UnoControl;
+
+ interface com::sun::star::awt::tab::XTabPageContainer;
+
+};
+
+//=============================================================================
+
+ }; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl
new file mode 100644
index 000000000000..b97b7881b416
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl
@@ -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 __com_sun_star_awt_tab_UnoControlTabPageContainerModel_idl__
+#define __com_sun_star_awt_tab_UnoControlTabPageContainerModel_idl__
+
+#include <com/sun/star/awt/UnoControlModel.idl>
+#include <com/sun/star/awt/tab/XTabPageContainerModel.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** specifies a model for a UnoControlTabPageContainer control.
+
+ @since OOo 3.4
+ */
+service UnoControlTabPageContainerModel
+{
+ service com::sun::star::awt::UnoControlModel;
+
+ interface com::sun::star::awt::tab::XTabPageContainerModel;
+
+};
+
+//=============================================================================
+
+ }; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl
new file mode 100644
index 000000000000..3508e33260c7
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl
@@ -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 __com_sun_star_awt_tab_UnoControlTabPageModel_idl__
+#define __com_sun_star_awt_tab_UnoControlTabPageModel_idl__
+
+#include <com/sun/star/awt/tab/XTabPageModel.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** specifies the standard model of a XTabPageModel.
+ @since OOo 3.4
+ */
+service UnoControlTabPageModel : XTabPageModel
+{
+ /** Creates a new XTabPageModel with a given ID.
+ */
+ create([in] short tabPageID);
+
+ /** Creates a new XTabPageModel with a given ID and a url which is used to load teh tab page model.
+ */
+ load([in] short tabPageID,[in] string url);
+};
+
+//=============================================================================
+
+}; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/XTabPage.idl b/offapi/com/sun/star/awt/tab/XTabPage.idl
new file mode 100644
index 000000000000..616820071f5b
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/XTabPage.idl
@@ -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.
+ *
+ ************************************************************************/
+#ifndef __com_sun_star_awt_tab_XTabPage_idl__
+#define __com_sun_star_awt_tab_XTabPage_idl__
+
+#include <com/sun/star/awt/tab/XTabPageModel.idl>
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** An interface to a control that displays a tab page.
+
+ @see UnoControlTabPage
+
+ @since OOo 3.4
+ */
+interface XTabPage
+{
+
+};
+
+//=============================================================================
+
+}; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/XTabPageContainer.idl b/offapi/com/sun/star/awt/tab/XTabPageContainer.idl
new file mode 100644
index 000000000000..e62cf4c365c1
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/XTabPageContainer.idl
@@ -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 __com_sun_star_awt_tab_XTabPageContainer_idl__
+#define __com_sun_star_awt_tab_XTabPageContainer_idl__
+
+#include <com/sun/star/awt/tab/XTabPageContainerListener.idl>
+#include <com/sun/star/awt/tab/XTabPage.idl>
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** An interface to a control that displays tab pages.
+
+ @see UnoControlTabPageContainer
+
+ @since OOo 3.4
+ */
+interface XTabPageContainer
+{
+ /** Returns the number of tab pages.
+ @returns
+ the number of tab pages.
+ */
+ long getTabPageCount();
+
+ //-------------------------------------------------------------------------
+
+ /** Checks whether a tab page is activated.
+ @param
+ the tab page to be checked.
+ @returns
+ <TRUE/> if tab page is activated, else <FALSE/>.
+ */
+ boolean isTabPageActive([in] short tabPageIndex);
+
+ //-------------------------------------------------------------------------
+
+ /** Returns tab page for the given index.
+ @param
+ tabPageIndex - index of the tab page in the IndexContainer.
+ @returns
+ tab page which has tabPageIndex.
+ */
+ XTabPage getTabPage([in] short tabPageIndex);
+
+ //-------------------------------------------------------------------------
+
+ /** Returns tab page for the given ID.
+ @param
+ tabPageID - ID of the tab page.
+ @returns
+ tab page which has tabPageID.
+ */
+ XTabPage getTabPageByID([in] short tabPageID);
+
+ //-------------------------------------------------------------------------
+
+ /** Adds a listener for the <type>TabPageActivedEvent</type> posted after
+ the tab page was activated.
+ @param listener
+ the listener to add.
+ */
+ [oneway] void addTabPageListener( [in] XTabPageContainerListener listener);
+
+ //-------------------------------------------------------------------------
+
+ /** Removes a listener previously added with <method>addTabPageListener()</method>.
+ @param listener
+ the listener to remove.
+ */
+ [oneway] void removeTabPageListener( [in] XTabPageContainerListener listener);
+
+ //-------------------------------------------------------------------------
+ /** Specifies the ID of the current active tab page.
+ */
+ [attribute] short ActiveTabPageID;
+};
+
+//=============================================================================
+
+}; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl b/offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl
new file mode 100644
index 000000000000..f46951231513
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl
@@ -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 __com_sun_star_awt_tab_XTabPageContainerListener_idl__
+#define __com_sun_star_awt_tab_XTabPageContainerListener_idl__
+
+#include <com/sun/star/lang/XEventListener.idl>
+#include <com/sun/star/awt/tab/TabPageActivatedEvent.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** An instance of this interface is used by the <type>XTabPageContainer</type> to
+ get notifications about changes in activation of tab pages.
+
+ @since OOo 3.4
+ */
+interface XTabPageContainerListener: com::sun::star::lang::XEventListener
+{
+ //-------------------------------------------------------------------------
+ /** Invoked after a tab page was activated.
+ */
+ [oneway] void tabPageActivated( [in] TabPageActivatedEvent tabPageActivatedEvent);
+
+};
+
+//=============================================================================
+
+}; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl b/offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl
new file mode 100644
index 000000000000..cc815209a01d
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl
@@ -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 __com_sun_star_awt_tab_XTabPageContainerModel_idl__
+#define __com_sun_star_awt_tab_XTabPageContainerModel_idl__
+
+#include <com/sun/star/container/XIndexContainer.idl>
+#include <com/sun/star/container/XContainer.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** specifies an interface for a UnoControlTabPageContainerModel.
+
+ @since OOo 3.4
+ */
+interface XTabPageContainerModel
+{
+ interface com::sun::star::container::XIndexContainer;
+ interface com::sun::star::container::XContainer;
+};
+
+//=============================================================================
+
+ }; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/tab/XTabPageModel.idl b/offapi/com/sun/star/awt/tab/XTabPageModel.idl
new file mode 100644
index 000000000000..15fae422bb17
--- /dev/null
+++ b/offapi/com/sun/star/awt/tab/XTabPageModel.idl
@@ -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 __com_sun_star_awt_tab_XTabPageModel_idl__
+#define __com_sun_star_awt_tab_XTabPageModel_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/lang/XMultiServiceFactory.idl>
+#include <com/sun/star/container/XContainer.idl>
+#include <com/sun/star/container/XNameContainer.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module tab {
+
+//=============================================================================
+
+/** specifies an XTabPageModel interface.
+
+ @since OOo 3.4
+*/
+
+interface XTabPageModel
+{
+ //interface com::sun::star::lang::XMultiServiceFactory;
+
+ //interface com::sun::star::container::XNameContainer;
+
+ //interface com::sun::star::container::XContainer;
+
+ /**ID for tab page.
+ */
+ [attribute, readonly] short TabPageID;
+ //-------------------------------------------------------------------------
+
+ /** determines whether a tab page is enabled or disabled.
+ */
+ [attribute] boolean Enabled;
+
+ //-------------------------------------------------------------------------
+
+ /** specifies the text that is displayed in the tab bar of the tab page.
+ */
+ [attribute] string Title;
+
+ //-------------------------------------------------------------------------
+
+ /** specifies a URL that references a graphic that should be displayed in the tab bar.
+ */
+ [attribute] string ImageURL;
+
+ //-------------------------------------------------------------------------
+
+ /** specifies a tooltip text that should be displayed in the tab bar.
+ */
+ [attribute] string Tooltip;
+};
+
+
+//=============================================================================
+
+ }; }; }; }; };
+
+#endif
diff --git a/connectivity/qa/connectivity/makefile.mk b/offapi/com/sun/star/awt/tab/makefile.mk
index 785f20692da3..39d1e66f7643 100644
--- a/connectivity/qa/connectivity/makefile.mk
+++ b/offapi/com/sun/star/awt/tab/makefile.mk
@@ -25,41 +25,30 @@
#
#*************************************************************************
-PRJ = ..$/..
-TARGET = GeneralTest
-PRJNAME = connectivity
-PACKAGE = complex$/connectivity
+PRJ=..$/..$/..$/..$/..
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES =\
- $(TARGET).java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
+PRJNAME=api
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+TARGET=cssawttab
+PACKAGE=com$/sun$/star$/awt$/tab
-# --- Targets ------------------------------------------------------
+# --- Settings -----------------------------------------------------
-.IF "$(depend)" == ""
-ALL : ALLTAR
-.ELSE
-ALL: ALLDEP
-.ENDIF
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# ------------------------------------------------------------------------
+IDLFILES=\
+ TabPageActivatedEvent.idl\
+ XTabPageContainerListener.idl\
+ XTabPageModel.idl\
+ XTabPage.idl\
+ XTabPageContainerModel.idl\
+ XTabPageContainer.idl\
+ UnoControlTabPage.idl\
+ UnoControlTabPageModel.idl\
+ UnoControlTabPageContainer.idl\
+ UnoControlTabPageContainerModel.idl
+# ------------------------------------------------------------------
.INCLUDE : target.mk
-
-
-run:
- java -cp $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar org.openoffice.Runner -TestBase java_complex -o complex.connectivity.$(TARGET)
-
+.INCLUDE : $(PRJ)$/util$/target.pmk
diff --git a/offapi/com/sun/star/chart/ChartAxis.idl b/offapi/com/sun/star/chart/ChartAxis.idl
index 4e564d848b9d..20a6722af5d8 100644
--- a/offapi/com/sun/star/chart/ChartAxis.idl
+++ b/offapi/com/sun/star/chart/ChartAxis.idl
@@ -55,6 +55,18 @@
#include <com/sun/star/chart/ChartAxisMarkPosition.idl>
#endif
+#ifndef __com_sun_star_chart_ChartAxisType_idl__
+#include <com/sun/star/chart/ChartAxisType.idl>
+#endif
+
+#ifndef __com_sun_star_chart_TimeIncrement_idl__
+#include <com/sun/star/chart/TimeIncrement.idl>
+#endif
+
+#ifndef __com_sun_star_chart_XAxis_idl__
+#include <com/sun/star/chart/XAxis.idl>
+#endif
+
#ifndef _com_sun_star_xml_UserDefinedAttributeSupplier_idl_
#include <com/sun/star/xml/UserDefinedAttributeSupplier.idl>
#endif
@@ -72,8 +84,6 @@
*/
published service ChartAxis
{
-
-
/** set the properties for the entire axis line as well as for the
tick marks.
*/
@@ -83,14 +93,19 @@ published service ChartAxis
*/
service com::sun::star::style::CharacterProperties;
- /** If a <type>ChartAxis</type> may be stored as XML element, this
- service should be supported in order to preserve unparsed XML
- attributes.
+ /** If a <type>ChartAxis</type> may be stored as XML element, this
+ service should be supported in order to preserve unparsed XML
+ attributes.
@since OOo 1.1.2
*/
[optional] service com::sun::star::xml::UserDefinedAttributeSupplier;
+ /** Access to the sub elements of an axis like title and grids.
+ @since OOo 3.4
+ */
+ [optional] interface com::sun::star::chart::XAxis;
+
interface com::sun::star::beans::XPropertySet;
//-------------------------------------------------------------------------
@@ -169,6 +184,20 @@ published service ChartAxis
//-------------------------------------------------------------------------
+ /** determines which type of axis this is, e.g. a date-axis or a category-axis @see ChartAxisType
+ @since OOo 3.4
+ */
+ [optional, property] long AxisType;
+
+ //-------------------------------------------------------------------------
+
+ /** if the current axis is a date-axis the intervals are choosen as given with TimeIncrement
+ @since OOo 3.4
+ */
+ [optional, maybevoid, property] TimeIncrement TimeIncrement;
+
+ //-------------------------------------------------------------------------
+
/** Determines if the axis orientation is mathematical or reversed.
*/
[optional, property] boolean ReverseDirection;
diff --git a/offapi/com/sun/star/chart2/XUndoSupplier.idl b/offapi/com/sun/star/chart/ChartAxisType.idl
index 901ca49ad74f..e705424115e8 100644
--- a/offapi/com/sun/star/chart2/XUndoSupplier.idl
+++ b/offapi/com/sun/star/chart/ChartAxisType.idl
@@ -24,10 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef com_sun_star_chart2_XUndoSupplier_idl
-#define com_sun_star_chart2_XUndoSupplier_idl
-
-#include <com/sun/star/chart2/XUndoManager.idl>
+#ifndef com_sun_star_chart_ChartAxisType_idl
+#define com_sun_star_chart_ChartAxisType_idl
module com
{
@@ -35,23 +33,25 @@ module sun
{
module star
{
-module chart2
+module chart
{
-
-/** An interface for providing an UndoManager based on frame::XModel
- objects.
- */
-interface XUndoSupplier : ::com::sun::star::uno::XInterface
+/** @since OOo 3.4
+*/
+published constants ChartAxisType
{
- /** @return an undo manager that allows doing undo and redo of a
- frame::XModel based object
+ /** the type of the axis is choosen automatically dependent on the chart type, the dimension and the underlying data
+ */
+ const long AUTOMATIC = 0;
+
+ /** the axis represent discrete category texts if chart type and the dimension allows
+ */
+ const long CATEGORY = 1;
+
+ /** the axis shows dates if the given data and chart type and the dimension allows
*/
- XUndoManager getUndoManager();
+ const long DATE = 2;
};
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
+}; }; }; };
#endif
diff --git a/offapi/com/sun/star/chart/Diagram.idl b/offapi/com/sun/star/chart/Diagram.idl
index b57fc88f3804..854baadb38cc 100644
--- a/offapi/com/sun/star/chart/Diagram.idl
+++ b/offapi/com/sun/star/chart/Diagram.idl
@@ -31,6 +31,10 @@
#include <com/sun/star/chart/XDiagram.idl>
#endif
+#ifndef __com_sun_star_chart_XAxisSupplier_idl__
+#include <com/sun/star/chart/XAxisSupplier.idl>
+#endif
+
#ifndef __com_sun_star_chart_XDiagramPositioning_idl__
#include <com/sun/star/chart/XDiagramPositioning.idl>
#endif
@@ -72,8 +76,12 @@ published service Diagram
interface com::sun::star::chart::XDiagram;
- /** Provides access to the titles of the secondary X axis and Y axis.
+ /** Provides easier access to the differnet axes and their sub elements.
+ @since OOo 3.4
+ */
+ [optional] interface com::sun::star::chart::XAxisSupplier;
+ /** Provides access to the titles of the secondary X axis and Y axis.
@since OOo 3.0
*/
[optional] interface com::sun::star::chart::XSecondAxisTitleSupplier;
diff --git a/offapi/com/sun/star/chart/TimeIncrement.idl b/offapi/com/sun/star/chart/TimeIncrement.idl
new file mode 100644
index 000000000000..3eba8d903c63
--- /dev/null
+++ b/offapi/com/sun/star/chart/TimeIncrement.idl
@@ -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 com_sun_star_chart_TimeIncrement_idl
+#define com_sun_star_chart_TimeIncrement_idl
+
+#include <com/sun/star/chart/TimeInterval.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module chart {
+
+//=============================================================================
+
+/** A TimeIncrement describes how tickmarks are positioned on the scale of a date-time axis.
+@since OOo 3.4
+*/
+published struct TimeIncrement
+{
+ /** if the any contains a struct of type <type>::com::sun::star::chart::TimeInterval</type>
+ this is used as a fixed distance value for the major tickmarks. Otherwise, if the any is empty or contains an
+ incompatible type, the distance between major tickmarks is calculated automatically by the application.
+ */
+ any MajorTimeInterval;
+
+ /** if the any contains a struct of type <type>::com::sun::star::chart::TimeInterval</type>
+ this is used as a fixed distance value for the minor tickmarks. Otherwise, if the any is empty or contains an
+ incompatible type, the distance between minor tickmarks is calculated automatically by the application.
+ */
+ any MinorTimeInterval;
+
+ /** if the any contains a constant of type <type>::com::sun::star::chart::TimeUnit</type>
+ this is the smallest time unit that is displayed on the date-time axis.
+ Otherwise, if the any is empty or contains an incompatible type,
+ the resolution is choosen automatically by the application.
+ */
+ any TimeResolution;
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/chart/TimeInterval.idl b/offapi/com/sun/star/chart/TimeInterval.idl
new file mode 100644
index 000000000000..c1280f815655
--- /dev/null
+++ b/offapi/com/sun/star/chart/TimeInterval.idl
@@ -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 com_sun_star_chart_TimeInterval_idl
+#define com_sun_star_chart_TimeInterval_idl
+
+#include <com/sun/star/chart/TimeUnit.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module chart {
+
+//=============================================================================
+
+/** Describes an interval on a date-axis
+@since OOo 3.4
+*/
+published struct TimeInterval
+{
+ /** specifies the number of units
+ */
+ long Number;
+
+ /** specifies a unit for the interval
+ <p>is a value out of the constant group <type>::com::sun::star::chart::TimeUnit</type>.</p>
+ */
+ long TimeUnit;
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/chart2/Break.idl b/offapi/com/sun/star/chart/TimeUnit.idl
index b5dbe80d2933..37cbd55d1a94 100644
--- a/offapi/com/sun/star/chart2/Break.idl
+++ b/offapi/com/sun/star/chart/TimeUnit.idl
@@ -24,19 +24,23 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef com_sun_star_chart2_Break_idl
-#define com_sun_star_chart2_Break_idl
+#ifndef __com_sun_star_chart_TimeUnit_idl__
+#define __com_sun_star_chart_TimeUnit_idl__
//=============================================================================
-module com { module sun { module star { module chart2 {
+ module com { module sun { module star { module chart {
//=============================================================================
-struct Break
+/** Specifies a unit for intervals on a date-time axis
+@since OOo 3.4
+ */
+published constants TimeUnit
{
- double Min;
- double Max;
+ const long DAY = 0;
+ const long MONTH = 1;
+ const long YEAR = 2;
};
//=============================================================================
diff --git a/offapi/com/sun/star/chart/XAxis.idl b/offapi/com/sun/star/chart/XAxis.idl
new file mode 100755
index 000000000000..763e2f45412b
--- /dev/null
+++ b/offapi/com/sun/star/chart/XAxis.idl
@@ -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 com_sun_star_chart_XAxis_idl
+#define com_sun_star_chart_XAxis_idl
+
+#ifndef __com_sun_star_beans_XPropertySet_idl__
+#include <com/sun/star/beans/XPropertySet.idl>
+#endif
+
+module com { module sun { module star { module chart {
+
+/** Allows easier access to the different subelements of an axis.
+@since OOo 3.4
+*/
+
+interface XAxis : ::com::sun::star::uno::XInterface
+{
+ /** @returns
+ the title of the axis. The returned object supports the properties described in service <type>ChartTitle</type>.
+ */
+ com::sun::star::beans::XPropertySet getAxisTitle();
+
+ /** @returns
+ the properties of the major grid of the axis. The returned object supports service <type>ChartGrid</type>.
+ */
+ com::sun::star::beans::XPropertySet getMajorGrid();
+
+ /** @returns
+ the properties of the minor grid of the axis. The returned object supports service <type>ChartGrid</type>.
+ */
+ com::sun::star::beans::XPropertySet getMinorGrid();
+};
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/chart/XAxisSupplier.idl b/offapi/com/sun/star/chart/XAxisSupplier.idl
new file mode 100755
index 000000000000..cf2bde2e310d
--- /dev/null
+++ b/offapi/com/sun/star/chart/XAxisSupplier.idl
@@ -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 com_sun_star_chart_XAxisSupplier_idl
+#define com_sun_star_chart_XAxisSupplier_idl
+
+#ifndef __com_sun_star_chart_XAxis_idl__
+#include <com/sun/star/chart/XAxis.idl>
+#endif
+
+module com { module sun { module star { module chart {
+
+/** Easier access to the different axes within a chart.
+@since OOo 3.4
+*/
+
+interface XAxisSupplier : ::com::sun::star::uno::XInterface
+{
+ /** @returns
+ the primary axis of the specified dimension. The returned object supports service <type>ChartAxis</type>.
+
+ @param nDimensionIndex
+ Parameter nDimensionIndex says wether it is a x, y or z-axis (0 for x).
+ */
+ com::sun::star::chart::XAxis getAxis( [in] long nDimensionIndex );
+
+ /** @returns
+ the secondary axis of the specified dimension. The returned object supports service <type>ChartAxis</type>.
+
+ @param nDimensionIndex
+ Parameter nDimensionIndex says wether it is a x, y or z-axis (0 for x).
+ */
+ com::sun::star::chart::XAxis getSecondaryAxis( [in] long nDimensionIndex );
+};
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/chart/XChartDocument.idl b/offapi/com/sun/star/chart/XChartDocument.idl
index 14322c6edf4a..1ffd268be59d 100644
--- a/offapi/com/sun/star/chart/XChartDocument.idl
+++ b/offapi/com/sun/star/chart/XChartDocument.idl
@@ -144,9 +144,12 @@ published interface XChartDocument: com::sun::star::frame::XModel
<p>Since OOo 3.3 the returned object also supports interface <type>XComplexDescriptionAccess</type>
which can be used to access complex hierarchical axis descriptions.</p>
+ <p>Since OOo 3.4 the returned object also supports interface <type>XDateCategories</type>.</p>
+
@see XChartData
@see XChartDataArray
@see XComplexDescriptionAccess
+ @see XDateCategories
*/
com::sun::star::chart::XChartData getData();
@@ -159,12 +162,16 @@ published interface XChartDocument: com::sun::star::frame::XModel
<p>Since OOo 3.3 if the given object might support interface <type>XComplexDescriptionAccess</type>
which allows to set complex hierarchical axis descriptions.</p>
+ <p>Since OOo 3.4 if the given object might support interface <type>XDateCategories</type>
+ which allows to set date values as x values for category charts.</p>
+
<p>The given data is copied before it is applied to the chart.
So changing xData after this call will have no effect on the chart.</p>
@see XChartData
@see XChartDataArray
@see XComplexDescriptionAccess
+ @see XDateCategories
@param xData
the object that provides the new data.
diff --git a/offapi/com/sun/star/chart/XDateCategories.idl b/offapi/com/sun/star/chart/XDateCategories.idl
new file mode 100755
index 000000000000..868670cb9c6f
--- /dev/null
+++ b/offapi/com/sun/star/chart/XDateCategories.idl
@@ -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 __com_sun_star_chart_XDateCategories_idl__
+#define __com_sun_star_chart_XDateCategories_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+
+//=============================================================================
+
+ module com { module sun { module star { module chart {
+
+//=============================================================================
+
+/** Allows to set date values as categories.
+
+<p>Can be obtained from interface <type>XChartDocument</type> via method getData().</p>
+
+@since OOo 3.4
+*/
+
+published interface XDateCategories
+{
+ //-------------------------------------------------------------------------
+
+ /** sets dates as categories
+
+ @param rDates
+ a sequence of sequences of doubles representing dates.
+ */
+ void setDateCategories( [in] sequence< double > rDates );
+
+ //-------------------------------------------------------------------------
+
+ /** retrieves the date values if the category x-axis id a date axis
+
+ @returns
+ a sequence of doubles representing dates.
+ */
+ sequence< double > getDateCategories();
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/chart/makefile.mk b/offapi/com/sun/star/chart/makefile.mk
index fdbf07173c5e..7c9d53e12eed 100644
--- a/offapi/com/sun/star/chart/makefile.mk
+++ b/offapi/com/sun/star/chart/makefile.mk
@@ -52,6 +52,7 @@ IDLFILES=\
ChartAxisPosition.idl\
ChartAxisLabelPosition.idl\
ChartAxisMarkPosition.idl\
+ ChartAxisType.idl\
ChartAxisXSupplier.idl\
ChartAxisYSupplier.idl\
ChartAxisZSupplier.idl\
@@ -84,6 +85,7 @@ IDLFILES=\
ChartTwoAxisXSupplier.idl\
ChartTwoAxisYSupplier.idl\
DataLabelPlacement.idl\
+ TimeIncrement.idl \
Diagram.idl\
Dim3DDiagram.idl\
DonutDiagram.idl\
@@ -94,8 +96,12 @@ IDLFILES=\
PieDiagram.idl\
StackableDiagram.idl\
StockDiagram.idl\
+ TimeUnit.idl\
+ TimeInterval.idl\
X3DDefaultSetter.idl\
X3DDisplay.idl\
+ XAxis.idl\
+ XAxisSupplier.idl\
XAxisXSupplier.idl\
XAxisYSupplier.idl\
XAxisZSupplier.idl\
@@ -104,6 +110,7 @@ IDLFILES=\
XChartDataChangeEventListener.idl\
XChartDocument.idl\
XComplexDescriptionAccess.idl\
+ XDateCategories.idl\
XDiagram.idl\
XDiagramPositioning.idl\
XStatisticDisplay.idl\
diff --git a/offapi/com/sun/star/chart2/AxisType.idl b/offapi/com/sun/star/chart2/AxisType.idl
index 16d977c34801..47cebc96388e 100644
--- a/offapi/com/sun/star/chart2/AxisType.idl
+++ b/offapi/com/sun/star/chart2/AxisType.idl
@@ -50,6 +50,9 @@ constants AxisType
/** the axis shows the series names (z axis)
*/
const long SERIES = 3;
+ /** the axis shows dates
+ */
+ const long DATE = 4;
};
} ; // chart2
diff --git a/offapi/com/sun/star/chart2/ExplicitIncrementData.idl b/offapi/com/sun/star/chart2/ExplicitIncrementData.idl
deleted file mode 100644
index 48f01c7560c4..000000000000
--- a/offapi/com/sun/star/chart2/ExplicitIncrementData.idl
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef com_sun_star_chart2_ExplicitIncrementData_idl
-#define com_sun_star_chart2_ExplicitIncrementData_idl
-
-#include <com/sun/star/chart2/ExplicitSubIncrement.idl>
-
-//=============================================================================
-
-module com { module sun { module star { module chart2 {
-
-//=============================================================================
-
-/** An Increment describes how tickmarks are positioned on the scale of an axis.
-
-@see <type>Axis</type>
-@see <type>Grid</type>
-@see <type>Scale</type>
-@see <type>XScaling</type>
-*/
-struct ExplicitIncrementData
-{
- /** <member>Distance</member> describes the distance between two
- neighboring main tickmarks on a <type>Scale</type> of an axis.
- All neighboring main tickmarks have the same constant distance.
-
- <p>If the Scale has a <type>XScaling</type> the <member>Distance</member>
- may be measured in two different ways - that is - before or after the
- scaling is applied.</p>
-
- <p>On a logarithmic scale for example the distance between two main
- tickmarks is typically measured after the scaling is applied:
- Distance = log(tick2)-log(tick1)
- ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ).
- The resulting tickmarks will always look equidistant on the screen.
- The other possibility is to have a Distance = tick2-tick1 measured constant
- before a scaling is applied, which may lead to non equidistant tickmarks
- on the screen.</p>
-
- <p><member>PostEquidistant</member> rules wether the <member>Distance</member>
- is meant to be a value before or after scaling.</p>
- */
- double Distance;
-
- /**
- <member>PostEquidistant</member> rules wether the member <member>Distance</member>
- describes a distance before or after the scaling is applied.
-
- <p>If <member>PostEquidistant</member> equals <TRUE/> <member>Distance</member>
- is given in values after <type>XScaling</type> is applied, thus resulting
- main tickmarks will always look equidistant on the screen.
- If <member>PostEquidistant</member> equals <FALSE/> <member>Distance</member>
- is given in values before <type>XScaling</type> is applied.</p>
- */
- boolean PostEquidistant;
-
- /** The <member>BaseValue</member> gives a starting point on the scale
- to which all further main tickmarks are relatively positioned.
-
- <p>The <member>BaseValue</member> is always a value on the scale before
- a possible scaling is applied. If the given value is not valid in the
- associated scaling the minimum of the scaling is assumed,
- if there is no minimum any other obvious value will be assumed.</p>
-
- <p>E.g.: assume a scale from 0 to 6 with identical scaling.
- Further assume this Increment to have Distance==2 and PostEquidistant==false.
- Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6;
- Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3;
- Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3;
- And setting BaseValue to 2, -2, 4, -4 etc. in this example
- leads to the same result as BaseValue=0.</p>
- */
- double BaseValue;
-
- /** <member>SubIncrements</member> describes the positioning of further
- sub tickmarks on the scale of an axis.
-
- <p>The first SubIncrement in this sequence determines how the
- distance between two neighboring main tickmarks is divided for positioning
- of further sub tickmarks. Every following SubIncrement determines the
- positions of subsequent tickmarks in relation to their parent tickmarks
- iven by the preceding SubIncrement.</p>
- */
- sequence< ::com::sun::star::chart2::ExplicitSubIncrement > SubIncrements;
-
- /** If ShiftedPosition is false all ticks are set at the positions as described above.
- E.g. having tickmarks for whole numbers 1, 2 and 3 the ticks are exactly placed on positions for the values 1, 2 and 3.
- In contrast it is possible to have the tickmarks shifted thus they are placed between the indicated values.
- So if ShiftedPosition is set to true the tickmarks in the example are placed at 0.5 1.5 2.5 and 3.5.
- */
- boolean ShiftedPosition;
-};
-
-//=============================================================================
-
-}; }; }; };
-
-#endif
diff --git a/offapi/com/sun/star/chart2/ExplicitScaleData.idl b/offapi/com/sun/star/chart2/ExplicitScaleData.idl
deleted file mode 100644
index 7639a4d33378..000000000000
--- a/offapi/com/sun/star/chart2/ExplicitScaleData.idl
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef com_sun_star_chart2_ExplicitScaleData_idl
-#define com_sun_star_chart2_ExplicitScaleData_idl
-
-#ifndef com_sun_star_chart2_Break_idl
-#include <com/sun/star/chart2/Break.idl>
-#endif
-
-#ifndef com_sun_star_chart2_XScaling_idl
-#include <com/sun/star/chart2/XScaling.idl>
-#endif
-
-#ifndef com_sun_star_chart2_AxisOrientation_idl
-#include <com/sun/star/chart2/AxisOrientation.idl>
-#endif
-
-//=============================================================================
-
-module com { module sun { module star { module chart2 {
-
-//=============================================================================
-
-/** This structure contains the explicit values for a scale like Minimum and Maximum.
- In contrast these values may also be implicit (automatically
- calculated) as indicated within the structure <type>ScaleData</type>.
- */
-struct ExplicitScaleData
-{
- double Minimum;
- double Maximum;
- double Origin;
-
- AxisOrientation Orientation;
-
- XScaling Scaling;
-
- sequence< Break > Breaks;
-
- long AxisType;
-};
-
-//=============================================================================
-
-}; }; }; };
-
-#endif
diff --git a/offapi/com/sun/star/chart2/ExplicitSubIncrement.idl b/offapi/com/sun/star/chart2/ExplicitSubIncrement.idl
deleted file mode 100644
index c1af626c5db1..000000000000
--- a/offapi/com/sun/star/chart2/ExplicitSubIncrement.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef com_sun_star_chart2_ExplicitSubIncrement_idl
-#define com_sun_star_chart2_ExplicitSubIncrement_idl
-
-//=============================================================================
-
-module com { module sun { module star { module chart2 {
-
-//=============================================================================
-
-struct ExplicitSubIncrement
-{
- /** Numbers of intervals between two superior ticks. For an axis
- this usually means, that <code>IntervalCount - 1</code>
- sub-tick-marks are displayed between two superior ticks.
-
- */
- long IntervalCount;
-
- /** If <TRUE/>, the distance between two sub-tick-marks on the
- screen is always the same. If <FALSE/>, the distances may
- differ depending on the <type>XScaling</type>.
- */
- boolean PostEquidistant;
-};
-
-//=============================================================================
-
-}; }; }; };
-
-#endif
diff --git a/offapi/com/sun/star/chart2/IncrementData.idl b/offapi/com/sun/star/chart2/IncrementData.idl
index f487c26e576d..ffd595807ce9 100644
--- a/offapi/com/sun/star/chart2/IncrementData.idl
+++ b/offapi/com/sun/star/chart2/IncrementData.idl
@@ -23,8 +23,6 @@ struct IncrementData
incompatible type, the Distance is meant to be calculated
automatically by the view component representing the model
containing this increment.
-
- @see <type>ExplicitIncrementData</type>
*/
any Distance;
@@ -45,8 +43,6 @@ struct IncrementData
incompatible type, the BaseValue is meant to be calculated
automatically by the view component representing the model
containing this increment.
-
- @see <type>ExplicitIncrementData</type>
*/
any BaseValue;
diff --git a/offapi/com/sun/star/chart2/ScaleData.idl b/offapi/com/sun/star/chart2/ScaleData.idl
index addd66e10320..9bb51005e206 100644
--- a/offapi/com/sun/star/chart2/ScaleData.idl
+++ b/offapi/com/sun/star/chart2/ScaleData.idl
@@ -1,29 +1,12 @@
#ifndef com_sun_star_chart2_ScaleData_idl
#define com_sun_star_chart2_ScaleData_idl
-#ifndef com_sun_star_chart2_Break_idl
-#include <com/sun/star/chart2/Break.idl>
-#endif
-
-#ifndef com_sun_star_chart2_XScaling_idl
#include <com/sun/star/chart2/XScaling.idl>
-#endif
-
-#ifndef com_sun_star_chart2_AxisOrientation_idl
#include <com/sun/star/chart2/AxisOrientation.idl>
-#endif
-
-#ifndef com_sun_star_chart2_data_XLabeledDataSequence_idl
#include <com/sun/star/chart2/data/XLabeledDataSequence.idl>
-#endif
-
-#ifndef com_sun_star_chart2_AxisType_idl
#include <com/sun/star/chart2/AxisType.idl>
-#endif
-
-#ifndef com_sun_star_chart_IncrementData_idl
#include <com/sun/star/chart2/IncrementData.idl>
-#endif
+#include <com/sun/star/chart/TimeIncrement.idl>
//=============================================================================
@@ -76,8 +59,6 @@ struct ScaleData
XScaling Scaling;
- sequence< Break > Breaks;
-
data::XLabeledDataSequence Categories;
/** describes the type of the axis.
@@ -87,7 +68,22 @@ struct ScaleData
*/
long AxisType;
+ /** if true an AxisType CATEGORY is interpreted as DATE if the underlying data given in Categories are dates
+ */
+ boolean AutoDateAxis;
+
+ /** describes wether data points on category or date axis are placed between tickmarks or not
+ if true the maximum on the scale will be expanded for one interval
+ */
+ boolean ShiftedCategoryPosition;
+
+ /** increment data to be used for not date-time axis
+ */
IncrementData IncrementData;
+
+ /** increment data to be used in case of date-time axis
+ */
+ ::com::sun::star::chart::TimeIncrement TimeIncrement;
};
//=============================================================================
diff --git a/offapi/com/sun/star/chart2/StandardDiagramCreationParameters.idl b/offapi/com/sun/star/chart2/StandardDiagramCreationParameters.idl
index e5bc31759ace..6733715f1703 100644
--- a/offapi/com/sun/star/chart2/StandardDiagramCreationParameters.idl
+++ b/offapi/com/sun/star/chart2/StandardDiagramCreationParameters.idl
@@ -49,6 +49,11 @@ service StandardDiagramCreationParameters
a data-source is used as categories.
*/
[optional, property] boolean HasCategories;
+
+ /** If categories are given they should be used as x values also if a chart type requires x values.
+ Default is true.
+ */
+ [optional, property] boolean UseCategoriesAsX;
};
} ; // chart2
diff --git a/offapi/com/sun/star/chart2/SubIncrement.idl b/offapi/com/sun/star/chart2/SubIncrement.idl
index f076db0eef92..b886f2c531fb 100644
--- a/offapi/com/sun/star/chart2/SubIncrement.idl
+++ b/offapi/com/sun/star/chart2/SubIncrement.idl
@@ -11,15 +11,11 @@ struct SubIncrement
{
/** should contain nothing for <em>auto</em>, or an integer value
for an explicit interval count.
-
- @see <type>ExplicitSubIncrement</type>
*/
any IntervalCount;
/** should contain nothing for <em>auto</em>, or a boolean value
for an explicit setting.
-
- @see <type>ExplicitSubIncrement</type>
*/
any PostEquidistant;
};
diff --git a/offapi/com/sun/star/chart2/XAnyDescriptionAccess.idl b/offapi/com/sun/star/chart2/XAnyDescriptionAccess.idl
new file mode 100755
index 000000000000..ca455c401264
--- /dev/null
+++ b/offapi/com/sun/star/chart2/XAnyDescriptionAccess.idl
@@ -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 __com_sun_star_chart2_XAnyDescriptionAccess_idl__
+#define __com_sun_star_chart2_XAnyDescriptionAccess_idl__
+
+#ifndef __com_sun_star_chart_XComplexDescriptionAccess_idl__
+#include <com/sun/star/chart/XComplexDescriptionAccess.idl>
+#endif
+
+//=============================================================================
+
+ module com { module sun { module star { module chart2 {
+
+//=============================================================================
+
+/** Offers any access to column and row descriptions.
+This allows to set date values as categories.
+
+<p>Can be obtained from interface <type>XChartDocument</type> via method getData().</p>
+
+@since OOo 3.4
+*/
+
+interface XAnyDescriptionAccess : ::com::sun::star::chart::XComplexDescriptionAccess
+{
+ //-------------------------------------------------------------------------
+
+ /** retrieves the descriptions for all rows.
+
+ @returns
+ a sequence of sequences of anys representing the descriptions
+ of all rows. The outer index represents different rows.
+ The inner index represents the different levels (usually there is only one).
+ The any might be strings for category text axis or doubles for date axis.
+ */
+ sequence< sequence< any > > getAnyRowDescriptions();
+
+ //-------------------------------------------------------------------------
+
+ /** sets the descriptions for all rows.
+
+ @param rRowDescriptions
+ a sequence of sequences of anys representing the descriptions of all
+ rows. The outer index represents different rows.
+ The inner index represents the different levels (usually there is only one).
+ The any might be strings for category text axis or doubles for date axis.
+ */
+ void setAnyRowDescriptions( [in] sequence< sequence< any > > rRowDescriptions );
+
+ //-------------------------------------------------------------------------
+
+ /** retrieves the descriptions for all columns.
+
+ @returns
+ a sequence of sequences of anys representing the descriptions
+ of all columns. The outer index represents different columns.
+ The inner index represents the different levels (usually there is only one).
+ The any might be strings for category text axis or doubles for date axis.
+ */
+ sequence< sequence< any > > getAnyColumnDescriptions();
+
+ //-------------------------------------------------------------------------
+
+ /** sets the descriptions for all columns.
+
+ @param rColumnDescriptions
+ a sequence of sequences of anys which represent the descriptions of
+ all columns. The outer index represents different columns.
+ The inner index represents the different levels (usually there is only one).
+ The any might be strings for category text axis or doubles for date axis.
+ */
+ void setAnyColumnDescriptions( [in] sequence< sequence< any > > rColumnDescriptions );
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/chart2/XAxis.idl b/offapi/com/sun/star/chart2/XAxis.idl
index 9a116c1a3bd4..55a9089da0cf 100644
--- a/offapi/com/sun/star/chart2/XAxis.idl
+++ b/offapi/com/sun/star/chart2/XAxis.idl
@@ -1,3 +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.
+ *
+ ************************************************************************/
#ifndef com_sun_star_chart_XAxis_idl
#define com_sun_star_chart_XAxis_idl
diff --git a/offapi/com/sun/star/chart2/XCoordinateSystem.idl b/offapi/com/sun/star/chart2/XCoordinateSystem.idl
index 689abba33cf4..0756321cdbed 100644
--- a/offapi/com/sun/star/chart2/XCoordinateSystem.idl
+++ b/offapi/com/sun/star/chart2/XCoordinateSystem.idl
@@ -1,3 +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.
+ *
+ ************************************************************************/
#ifndef com_sun_star_chart2_XCoordinateSystem_idl
#define com_sun_star_chart2_XCoordinateSystem_idl
diff --git a/offapi/com/sun/star/chart2/XDiagram.idl b/offapi/com/sun/star/chart2/XDiagram.idl
index 3836489b7aed..23b256e63349 100644
--- a/offapi/com/sun/star/chart2/XDiagram.idl
+++ b/offapi/com/sun/star/chart2/XDiagram.idl
@@ -32,9 +32,10 @@
#endif
#include <com/sun/star/beans/XPropertySet.idl>
-
+#include <com/sun/star/beans/PropertyValue.idl>
#include <com/sun/star/chart2/XLegend.idl>
#include <com/sun/star/chart2/XColorScheme.idl>
+#include <com/sun/star/chart2/data/XDataSource.idl>
#include <com/sun/star/chart2/data/XLabeledDataSequence.idl>
module com
@@ -48,11 +49,6 @@ module chart2
interface XDiagram : ::com::sun::star::uno::XInterface
{
- /** gets the component that creates a new diagram or modifies
- an existing diagram according to its rules.
- */
-// string getChartTypeTemplateServiceName();
-
/** returns the property set that determines the visual appearance
of the wall.
@@ -87,6 +83,25 @@ interface XDiagram : ::com::sun::star::uno::XInterface
colors for data series (or data points) in the diagram.
*/
void setDefaultColorScheme( [in] XColorScheme xColorScheme );
+
+ /** sets new data to the diagram.
+
+ @param xDataSource
+ This data source will be interpreted in a chart-type
+ specific way and the <type>DataSeries</type> found in
+ <code>xDiagram</code> will be adapted to the new data.
+ Missing data series will be created and unused ones will
+ be deleted.
+
+ @param aArguments
+ Arguments tells how to slice the given data.
+
+ <p>For standard parameters that may be used, see the
+ service <type>StandardDiagramCreationParameters</type>.
+ </p>
+ */
+ void setDiagramData( [in] data::XDataSource xDataSource,
+ [in] sequence< com::sun::star::beans::PropertyValue > aArguments );
};
} ; // chart2
diff --git a/offapi/com/sun/star/chart2/XPlotter.idl b/offapi/com/sun/star/chart2/XPlotter.idl
deleted file mode 100644
index dfa77e09c38e..000000000000
--- a/offapi/com/sun/star/chart2/XPlotter.idl
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef com_sun_star_chart2_XPlotter_idl
-#define com_sun_star_chart2_XPlotter_idl
-
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-#ifndef __com_sun_star_drawing_XShapes_idl__
-#include <com/sun/star/drawing/XShapes.idl>
-#endif
-
-#ifndef _com_sun_star_drawing_XShapeGrouper_idl_
-#include <com/sun/star/drawing/XShapeGrouper.idl>
-#endif
-
-#ifndef _com_sun_star_lang_xmultiservicefactory_idl_
-#include <com/sun/star/lang/XMultiServiceFactory.idl>
-#endif
-
-#ifndef com_sun_star_chart2_CoordinateSystemTypeID_idl
-#include <com/sun/star/chart2/CoordinateSystemTypeID.idl>
-#endif
-
-#ifndef com_sun_star_chart2_ScaleData_idl
-#include <com/sun/star/chart2/ScaleData.idl>
-#endif
-
-#ifndef com_sun_star_chart2_XTransformation_idl
-#include <com/sun/star/chart2/XTransformation.idl>
-#endif
-
-//=============================================================================
-
-module com { module sun { module star { module chart2 {
-
-//=============================================================================
-
-/** The main task of a Plotter is to create grafic objects which have a certain
- logic place within a coordinate system. For example the bars of a barchart
- are such grafic objects. The created grafic objects need to be of type
- com::sun::star::drawing::Shape.
-
- <p>
- Within the chart application we differentiatebetween two 'types' of shapes
- which can be created by a Plotter.
- The first type are shapes which are completely defined by coordinates
- in the logic coordinate system and will be positioned within this logic
- coordinate system. Those shapes are called 'logic shapes'
- or 'logically placed shapes'. For example a rectangle of a bar chart
- is a 'logic shape'.
- </p>
-
- <p>
- The second type of shapes are those who can not or should not
- be placed in the logic coordinate system. For example consider a three
- dimensional bar chart with text labels for each data point. You probably
- would not like to place the text shapes as three dimensional objects within
- the logic coordinate system, rather you would like to position the texts as
- two dimensional objects on the two dimensional final page. Those shapes are
- called 'illogic shapes' in contrast to 'logic shapes'.
- 'Illogic shapes' are always two dimensional and placed on the documents page.
- </p>
-
- <p>
- For each type of shapes the Plotter gets one Target where it can add
- or remove shapes.
- </p>
-
- <p> A Plotter is not allowed to set the property 'Transformation' on a
- shape as this will be done elsewhere.
- </p>
-*/
-
-//@ todo ? should this be a XComponent?
-interface XPlotter : ::com::sun::star::uno::XInterface
-{
- //-------------------------------------------------------------------------
- /** Each Plotter implicit uses a certain type of logic coordinate
- system for interpreting data as coordinates.
- For example a bar-chart uses a cartesian coordinate system for
- interpreting x- and y-values from a spreadsheet as cartesian
- coordinates. In contrast the pie chart assumes a polar coordinate
- system.
- The type of this implicit used source coordinate system has to be
- returned here.
- The returned type of an implementation never changes.
- */
- CoordinateSystemTypeID getCoordinateSystemTypeID();
-
- //-------------------------------------------------------------------------
- /** For each type of shapes ('logic' or 'illogic') there exists one
- container. The Plotter will create shapes and then add (or remove)
- them from these containers.
-
- <p>
- The lifetime of the container has to be handled by the calling object. The
- calling object must assure that the container will exist longer than the
- XPlotter Object.
- </p>
- ...
- */
- void init( [in] com::sun::star::drawing::XShapes xLogicTarget
- , [in] com::sun::star::drawing::XShapes xFinalTarget
- , [in] com::sun::star::lang::XMultiServiceFactory xFactory );
-
- //-------------------------------------------------------------------------
- /** For each dimension of the 'logic source coordinate system' the
- XPlotter object needs a Scale to decide which shapes
- need to be created and maybe logically clipped. The XPlotter object
- becomes the new owner of the given scales and directions and needs to keep
- them alive. Nobody else will change them.
- Pay attention that a 'Scale' can have several breaks.
- */
- void setScales( [in] sequence< ScaleData > rScales);
-
- //-------------------------------------------------------------------------
- /**
- */
- void setTransformation( [in] XTransformation xTransformationToLogicTarget
- , [in] XTransformation xTransformationToFinalPage );
-};
-
-//=============================================================================
-
-}; }; }; };
-
-#endif
-
diff --git a/offapi/com/sun/star/chart2/XUndoHelper.idl b/offapi/com/sun/star/chart2/XUndoHelper.idl
deleted file mode 100644
index 6c782564e04f..000000000000
--- a/offapi/com/sun/star/chart2/XUndoHelper.idl
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef com_sun_star_chart2_XUndoHelper_idl
-#define com_sun_star_chart2_XUndoHelper_idl
-
-#include <com/sun/star/uno/XInterface.idl>
-#include <com/sun/star/frame/XModel.idl>
-// #include <com/sun/star/beans/PropertyValue.idl>
-
-module com
-{
-module sun
-{
-module star
-{
-module chart2
-{
-
-/** An interface for storing frame::XModel objects for container undo.
- */
-interface XUndoHelper : ::com::sun::star::uno::XInterface
-{
- /** call this before you change the xCurrentModel
-
- @return a clone of the current model that can later be used to
- restore the state of a changed model
- */
- ::com::sun::star::frame::XModel getModelCloneForUndo(
- [in] ::com::sun::star::frame::XModel xModelBeforeChange );
-
- /** call this before you change the xCurrentModel. You can pass
- parameters to refine the information that is cloned.
-
- @return a clone of the current model that can later be used to
- restore the state of a changed model using the same
- arguments in applyModelContentWithArguments.
- */
-// ::com::sun::star::frame::XModel getModelCloneForUndoWithArguments(
-// [in] ::com::sun::star::frame::XModel xModelBeforeChange,
-// [in] sequence< ::com::sun::star::beans::PropertyValue > aArguments );
-
- /** apply the content of xModelToCopyFrom to the XModel in xModelToChange
- */
- void applyModelContent( [inout] ::com::sun::star::frame::XModel xModelToChange,
- [in] ::com::sun::star::frame::XModel xModelToCopyFrom );
-
- /** apply the content of xModelToCopyFrom to the XModel in
- xModelToChange. You can pass parameters to refine the
- information that is applied.
-
- <p>Note that xModelToCopyFrom should have been created with
- getModelCloneForUndoWithArguments using the same arguments as
- are passed here.</p>
- */
-// void applyModelContentWithArguments(
-// [inout] ::com::sun::star::frame::XModel xModelToChange,
-// [in] ::com::sun::star::frame::XModel xModelToCopyFrom,
-// [in] sequence< ::com::sun::star::beans::PropertyValue > aArguments );
-};
-
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
-
-#endif
diff --git a/offapi/com/sun/star/chart2/XUndoManager.idl b/offapi/com/sun/star/chart2/XUndoManager.idl
deleted file mode 100644
index 2d0ca4bd4977..000000000000
--- a/offapi/com/sun/star/chart2/XUndoManager.idl
+++ /dev/null
@@ -1,111 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef com_sun_star_chart2_XUndoManager_idl
-#define com_sun_star_chart2_XUndoManager_idl
-
-#include <com/sun/star/uno/XInterface.idl>
-#include <com/sun/star/frame/XModel.idl>
-#include <com/sun/star/beans/PropertyValue.idl>
-
-module com
-{
-module sun
-{
-module star
-{
-module chart2
-{
-
-/** An interface for undo functionality based on passing frame::XModel
- objects.
- */
-interface XUndoManager : ::com::sun::star::uno::XInterface
-{
- /** call this before you change the xCurrentModel
- */
- void preAction( [in] ::com::sun::star::frame::XModel xModelBeforeChange );
-
- /** call this before you change the xCurrentModel. You can pass
- parameters to refine the undo action.
- */
- void preActionWithArguments( [in] ::com::sun::star::frame::XModel xModelBeforeChange,
- [in] sequence< ::com::sun::star::beans::PropertyValue > aArguments );
-
- /** call this after you successfully did changes to your current model
- */
- void postAction( [in] string aUndoText );
- /** call this if you aborted the current action.
- */
- void cancelAction();
-
- /** same as cancelAction() but restores the given model to the
- state set in preAction. This is useful for cancellation in
- live-preview dialogs.
- */
- void cancelActionWithUndo( [inout] ::com::sun::star::frame::XModel xModelToRestore );
-
- /** give the current model to be put into the redo-stack
- */
- void undo( [inout] ::com::sun::star::frame::XModel xCurrentModel );
-
- /** give the current model to be put into the undo-stack
- */
- void redo( [inout] ::com::sun::star::frame::XModel xCurrentModel );
-
- /** @return <TRUE/> if the undo stack is not empty, i.e. a call to undo() will succeed
- */
- boolean undoPossible();
-
- /** @return <TRUE/> if the redo stack is not empty, i.e. a call to redo() will succeed
- */
- boolean redoPossible();
-
- /** Retrieves the undo string for the most recent undo step
- */
- string getCurrentUndoString();
-
- /** Retrieves the redo string for the most recent undo step
- */
- string getCurrentRedoString();
-
- /** Retrieves the undo strings of all stored undo actions in
- chronological order starting with the most recent.
- */
- sequence< string > getAllUndoStrings();
-
- /** Retrieves the redo strings of all stored undo actions in
- chronological order starting with the most recent.
- */
- sequence< string > getAllRedoStrings();
-};
-
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
-
-#endif
diff --git a/offapi/com/sun/star/chart2/makefile.mk b/offapi/com/sun/star/chart2/makefile.mk
index dcce7e71d4d2..60cc8393e193 100644
--- a/offapi/com/sun/star/chart2/makefile.mk
+++ b/offapi/com/sun/star/chart2/makefile.mk
@@ -41,14 +41,10 @@ PRJNAME=offapi
IDLFILES= \
AxisType.idl \
AxisOrientation.idl \
- Break.idl \
CoordinateSystemTypeID.idl \
CurveStyle.idl \
DataPointGeometry3D.idl \
DataPointLabel.idl \
- ExplicitIncrementData.idl \
- ExplicitScaleData.idl \
- ExplicitSubIncrement.idl \
FillBitmap.idl \
IncrementData.idl \
InterpretedData.idl \
@@ -67,6 +63,7 @@ IDLFILES= \
TickmarkStyle.idl \
TransparencyStyle.idl \
ViewLegendEntry.idl \
+ XAnyDescriptionAccess.idl\
XAxis.idl \
XCoordinateSystem.idl \
XCoordinateSystemContainer.idl \
@@ -91,7 +88,6 @@ IDLFILES= \
XLegend.idl \
XLegendEntry.idl \
XLegendSymbolProvider.idl \
- XPlotter.idl \
XRegressionCurve.idl \
XRegressionCurveCalculator.idl \
XRegressionCurveContainer.idl \
@@ -101,9 +97,6 @@ IDLFILES= \
XTitle.idl \
XTitled.idl \
XTransformation.idl \
- XUndoManager.idl \
- XUndoSupplier.idl \
- XUndoHelper.idl
# --- Targets ------------------------------------------------------
diff --git a/offapi/com/sun/star/document/EmptyUndoStackException.idl b/offapi/com/sun/star/document/EmptyUndoStackException.idl
new file mode 100755
index 000000000000..e003d6af71b9
--- /dev/null
+++ b/offapi/com/sun/star/document/EmptyUndoStackException.idl
@@ -0,0 +1,51 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_document_EmptyUndoStackException_idl__
+#define __com_sun_star_document_EmptyUndoStackException_idl__
+
+#include <com/sun/star/util/InvalidStateException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+//==================================================================================================================
+
+/** is raised when an operation is attemption at an XUndoManager which requires a non-empty stack
+ of undo actions, and this requirement is not fullfilled.
+ */
+exception EmptyUndoStackException : ::com::sun::star::util::InvalidStateException
+{
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/OfficeDocument.idl b/offapi/com/sun/star/document/OfficeDocument.idl
index 4a3418e4da64..8467d206ff38 100644
--- a/offapi/com/sun/star/document/OfficeDocument.idl
+++ b/offapi/com/sun/star/document/OfficeDocument.idl
@@ -27,53 +27,19 @@
#ifndef __com_sun_star_document_OfficeDocument_idl__
#define __com_sun_star_document_OfficeDocument_idl__
-#ifndef __com_sun_star_frame_XModel_idl__
#include <com/sun/star/frame/XModel.idl>
-#endif
-
-#ifndef __com_sun_star_util_XModifiable_idl__
#include <com/sun/star/util/XModifiable.idl>
-#endif
-
-#ifndef __com_sun_star_frame_XStorable_idl__
#include <com/sun/star/frame/XStorable.idl>
-#endif
-
-#ifndef __com_sun_star_view_XPrintable_idl__
#include <com/sun/star/view/XPrintable.idl>
-#endif
-
-#ifndef __com_sun_star_view_XPrintJobBroadcaster_idl__
#include <com/sun/star/view/XPrintJobBroadcaster.idl>
-#endif
-
-#ifndef __com_sun_star_document_XEventBroadcaster_idl__
#include <com/sun/star/document/XEventBroadcaster.idl>
-#endif
-
-#ifndef __com_sun_star_document_XEventsSupplier_idl__
#include <com/sun/star/document/XEventsSupplier.idl>
-#endif
-
-#ifndef __com_sun_star_document_XDocumentInfoSupplier_idl__
#include <com/sun/star/document/XDocumentInfoSupplier.idl>
-#endif
-
-#ifndef __com_sun_star_document_XViewDataSupplier_idl__
#include <com/sun/star/document/XViewDataSupplier.idl>
-#endif
-
-#ifndef __com_sun_star_document_XDocumentEventBroadcaster_idl__
#include <com/sun/star/document/XDocumentEventBroadcaster.idl>
-#endif
-
-#ifndef __com_sun_star_document_XEmbeddedScripts_idl__
#include <com/sun/star/document/XEmbeddedScripts.idl>
-#endif
-
-#ifndef __com_sun_star_document_XDocumentPropertiesSupplier_idl__
#include <com/sun/star/document/XDocumentPropertiesSupplier.idl>
-#endif
+#include <com/sun/star/document/XUndoManagerSupplier.idl>
//=============================================================================
@@ -192,6 +158,10 @@ published service OfficeDocument
*/
[optional] interface XDocumentPropertiesSupplier;
+ /** provides access to the document's undo manager.
+ */
+ [optional] interface XUndoManagerSupplier;
+
//-------------------------------------------------------------------------
/** controls the focus behaviour of the form controls in the document
diff --git a/offapi/com/sun/star/document/UndoContextNotClosedException.idl b/offapi/com/sun/star/document/UndoContextNotClosedException.idl
new file mode 100755
index 000000000000..4f7d746bad1a
--- /dev/null
+++ b/offapi/com/sun/star/document/UndoContextNotClosedException.idl
@@ -0,0 +1,51 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_document_UndoContextNotClosedException_idl__
+#define __com_sun_star_document_UndoContextNotClosedException_idl__
+
+#include <com/sun/star/util/InvalidStateException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+//==================================================================================================================
+
+/** is thrown when an operation is attempted at an <type>XUndoManager</type> which requires all undo
+ contexts to be closed, but this requirement is not fullfilled.
+ */
+exception UndoContextNotClosedException : ::com::sun::star::util::InvalidStateException
+{
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/UndoFailedException.idl b/offapi/com/sun/star/document/UndoFailedException.idl
new file mode 100755
index 000000000000..4489ac5a0e0d
--- /dev/null
+++ b/offapi/com/sun/star/document/UndoFailedException.idl
@@ -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 __com_sun_star_document_UndoFailedException_idl__
+#define __com_sun_star_document_UndoFailedException_idl__
+
+#include <com/sun/star/uno/Exception.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+//==================================================================================================================
+
+/** thrown when reverting to re-applying an undoable action fails.
+
+ @see XUndoAction::undo
+ @see XUndoManager::undo
+ */
+exception UndoFailedException : ::com::sun::star::uno::Exception
+{
+ /** describes the reason why the operation failed. Usually, this member will carry an exception.
+ */
+ any Reason;
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/UndoManagerEvent.idl b/offapi/com/sun/star/document/UndoManagerEvent.idl
new file mode 100755
index 000000000000..e587669e4fbd
--- /dev/null
+++ b/offapi/com/sun/star/document/UndoManagerEvent.idl
@@ -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 __com_sun_star_document_UndoManagerEvent_idl__
+#define __com_sun_star_document_UndoManagerEvent_idl__
+
+#include <com/sun/star/lang/EventObject.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+//==================================================================================================================
+
+/** is an event sent by an <type>XUndoManager</type> implementation when the Undo/Redo stacks of the manager are
+ modified.
+ @see XUndoManager
+ @see XUndoManagerListener
+ @see XUndoAction
+ */
+struct UndoManagerEvent : ::com::sun::star::lang::EventObject
+{
+ /** the title of the undo action which is described by the event
+ @see XUndoAction::Title
+ */
+ string UndoActionTitle;
+
+ /** denotes the number of Undo contexts which are open, and not yet closed, at the time the event is fired.
+ @see XUndoManager::enterUndoContext
+ */
+ long UndoContextDepth;
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/XUndoAction.idl b/offapi/com/sun/star/document/XUndoAction.idl
new file mode 100755
index 000000000000..b47550a3f52f
--- /dev/null
+++ b/offapi/com/sun/star/document/XUndoAction.idl
@@ -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 __com_sun_star_document_XUndoAction_idl__
+#define __com_sun_star_document_XUndoAction_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/document/UndoFailedException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+//==================================================================================================================
+
+/** represents a single (undoable) action on a document
+ */
+interface XUndoAction
+{
+ /** reverts the action represented by the instance
+
+ @throws UndoFailedException
+ if reverting the action failed. In this case, the caller should assume that this is a permanent failure,
+ and take appropriate action, such as discarding the <code>XUndoAction</code> instance, and any possibly
+ depending instances.
+ */
+ void undo()
+ raises ( ::com::sun::star::document::UndoFailedException
+ );
+
+ /** repeats the action represented by the instance, after it had previously been reverted.
+
+ @throws UndoFailedException
+ if repeating the action failed. In this case, the caller should assume that this is a permanent failure,
+ and take appropriate action, such as discarding the <code>XUndoAction</code> instance, and any possibly
+ depending instances.
+ */
+ void redo()
+ raises ( ::com::sun::star::document::UndoFailedException
+ );
+
+ /** is the human-readable, localized description of the action.
+ */
+ [attribute, readonly] string Title;
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/XUndoManager.idl b/offapi/com/sun/star/document/XUndoManager.idl
new file mode 100755
index 000000000000..be43ca899b94
--- /dev/null
+++ b/offapi/com/sun/star/document/XUndoManager.idl
@@ -0,0 +1,337 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_document_XUndoManager_idl__
+#define __com_sun_star_document_XUndoManager_idl__
+
+#include <com/sun/star/document/EmptyUndoStackException.idl>
+#include <com/sun/star/document/UndoContextNotClosedException.idl>
+#include <com/sun/star/document/UndoFailedException.idl>
+#include <com/sun/star/util/InvalidStateException.idl>
+#include <com/sun/star/util/XLockable.idl>
+#include <com/sun/star/container/XChild.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+#include <com/sun/star/lang/WrappedTargetException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+interface XUndoAction;
+interface XUndoManagerListener;
+
+//==================================================================================================================
+
+/** provides access to the undo/redo stacks of a document
+
+ <h3>Undo</h3>
+ <p>Changes to a document usually result in recording of information how to undo those changes, if desired. A so-called
+ undo action records the information how to undo a single change. Undo actions are maintained in a stack, so that
+ the changes they represent can be undo in the reverse order they have originally been applied.</p>
+
+ <h3>Redo</h3>
+ <p>Additionally, the Undo manager manages a Redo stack: Actions which are undone are moved from the Undo to the Redo
+ stack, so it is possible to re-apply the changes to the document.</p>
+
+ <h3>Undo contexts</h3>
+ <p>For collecting multiple changes in a single undo action, so-called Undo contexts are provided. When an Undo
+ context is entered, all subsequently added Undo actions are not pushed onto the undo stack directly, but considered
+ a sub action of the Undo context. Once the Undo context is left, a single undo action is pushed onto the undo stack,
+ which comprises all those single Undo actions.<br/>
+ Undo contexts can be arbitrarily nested.</p>
+
+ <h3>Hidden Undo actions</h3>
+ <p>Hidden Undo actions are those which in no observable way contribute to the undo stack. That is,
+ any method retrieving information about the stack will behave as if the undo action does not exist. Nonetheless,
+ calling <member>undo</member> respectively <member>redo</member> will include those actions.<br/>
+ Hidden Undo actions can be created by calling <member>enterHiddenUndoContext</member>, following by
+ <member>leaveUndoContext</member>.</p>
+
+ <a name="locking"></a>
+ <h3>Locking</h3>
+ <p>An Undo manager can be locked and unlocked, using the <member>XLockable::lock</member> and
+ <member>XLockable::unlock</member> methods. When it is locked, then every attempt to add an undo action, or to
+ enter or leave an Undo context, will be silently ignored.</p>
+ */
+interface XUndoManager
+{
+ /** allows <a href="#locking">locking</a> the undo manager.
+ */
+ interface ::com::sun::star::util::XLockable;
+
+ /** allows accessing the component, usually a document, which the undo manager works for.
+
+ <p><member scope="com::sun::star::container">XChild::setParent</member> is not supported, and will throw
+ an <type scope="com::sun::star::lang">NoSupportException</type>.</p>
+ */
+ interface ::com::sun::star::container::XChild;
+
+ /** enters a new undo context.
+
+ <p>A new undo action will be added to the undo stack, with the title given as <code>i_title</code>. As long
+ as the context is not left, every undo action added to the stack will be treated as sub action. This means
+ it will not be directly accessible at the Undo manager, not appear in any user interface, and cannot be
+ separately undone or re-done.</p>
+
+ <p>Each call to <code>enterUndoContext</code> must be paired by a call to <member>leaveUndoContext</member>,
+ otherwise, the document's undo stack is left in an inconsistent state.</p>
+
+ <p>Undo contexts can be nested, i.e. it is legitimate to call <code>enterUndoContext</code> and
+ <member>enterHiddenUndoContext</member> multiple times without calling <member>leaveUndoContext</member> inbetween.</p>
+
+ @see leaveUndoContext
+ */
+ void enterUndoContext(
+ [in] string i_title
+ );
+
+ /** enters a new undo context, creating a hidden undo action.
+
+ <p>A hidden undo action does not, in any visible way, contribute to the undo stack. This means
+ that
+ <ul><li>Calling <member>undo</member> when the top-element is a hidden undo action will transparently
+ undo this action, and also undo the new top element of the stack.</li>
+ <li>Calling <member>redo</member> when the top-element is a hidden action will transparently
+ redo this action, and also redo the new top element of the stack.</li>
+ <li>In any user interface presenting the current Undo or Redo actions to the user, a hidden
+ action will not be listed.</p>
+ </ul>
+
+ <p>A new undo action will be added to the undo stack. As long as the context is not left, every undo action
+ added to the stack will be treated as sub action. This means it will not be directly accessible at the undo
+ manager, not appear in any user interface, and cannot be separately undone or re-done.</p>
+
+ <p>Each call to <code>enterHiddenUndoContext</code> must be paired by a call to <member>leaveUndoContext</member>,
+ otherwise, the document's undo stack is left in an inconsistent state.</p>
+
+ <p>Undo contexts can be nested, i.e. it is legitimate to call <member>enterUndoContext</member> and
+ <code>enterHiddenUndoContext</code> multiple times without calling <member>leaveUndoContext</member> inbetween.</p>
+
+ @throws EmptyUndoStackException
+ if the undo stack is currently empty, in which case it is impossible to push a hidden undo action onto
+ it.
+
+ @see enterUndoContext
+ @see leaveUndoContext
+ */
+ void enterHiddenUndoContext()
+ raises( EmptyUndoStackException );
+
+ /** leaves the undo context previously opened via <member>enterUndoContext</member> respectively
+ <member>enterHiddenUndoContext</member>.
+
+ <p>If no undo action has been added since the context has been opened, the context is not only left,
+ but silently removed, and does not contribute to the undo stack at all. In this case, possible
+ listeners will be notified via <member>XUndoManagerListener::cancelledContext</member>.</p>
+
+ <p>Otherwise, the undo context will be closed, and added to the Undo stack; the redo stack will be cleared,
+ and listeners will be notified via <member>XUndoManagerListener::leftContext</member> resp.
+ <member>XUndoManagerListener::leftHiddenContext</member></p>
+
+ @throws ::com::sun::star::util::InvalidStateException
+ if no undo context is currently open.
+
+ @see enterUndoContext
+ @see enterHiddenUndoContext
+ */
+ void leaveUndoContext()
+ raises( ::com::sun::star::util::InvalidStateException );
+
+ /** adds the given undo action to the undo stack.
+
+ <p>The redo stack is cleared when a new action is pushed onto the undo stack.</p>
+
+ <p>The Undo manager takes ownership of any actions pushed onto the undo stack. This means that if the
+ action is finally removed from the Undo manager's control (e.g. by calling <member>clear</member> resp.
+ <member>clearRedo</member>), it will be disposed, as long as it supports the <member scope="com::sun::star::lang">XComponent</member>
+ interface.</p>
+
+ <p>If the Undo manager is <a href="#locking">locked</a> at the moment the method is called, the call will be ignored, and the undo action
+ will immediately be disposed, if applicable.</p>
+
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given undo action is <NULL/>.
+ */
+ void addUndoAction(
+ [in] XUndoAction i_action
+ )
+ raises( ::com::sun::star::lang::IllegalArgumentException );
+
+ /** reverts the most recent action on the document.
+
+ <p>Effectively, invoking this method will
+ <ul><li>invoke <member>XUndoAction::undo</member> on the top-most action of the undo stack</li>
+ <li>move this undo action from the undo stack to the redo stack</li>
+ </ul></p>
+
+ @throws EmptyUndoStackException
+ if the undo stack is currently empty
+
+ @throws UndoContextNotClosedException
+ if there currently is an open undo context
+
+ @throws UndoFailedException
+ if the invocation of <member>XUndoAction::undo</member> raised this exception. In this case, the undo stack
+ of the undo manager will have been cleared.
+
+ @see redo
+ @see enterUndoContext
+ */
+ void undo()
+ raises( ::com::sun::star::document::EmptyUndoStackException,
+ ::com::sun::star::document::UndoContextNotClosedException,
+ ::com::sun::star::document::UndoFailedException );
+
+ /** replays the action on the document which has most recently been undone
+
+ <p>Effectively, invoking this method will
+ <ul><li>invoke <member>XUndoAction::redo</member> on the top-most action of the redo stack</li>
+ <li>move this action from the redo stack to the undo stack</li>
+ </ul></p>
+
+ @throws EmptyUndoStackException
+ when the Redo stack is currently empty
+
+ @throws UndoContextNotClosedException
+ if there currently is an open undo context
+
+ @throws UndoFailedException
+ if the invocation of <member>XUndoAction::redo</member> raised this exception. In this case, the redo stack
+ of the undo manager will have been cleared.
+
+ @see undo
+ */
+ void redo()
+ raises( ::com::sun::star::document::EmptyUndoStackException,
+ ::com::sun::star::document::UndoContextNotClosedException,
+ ::com::sun::star::document::UndoFailedException );
+
+ /** determines whether <member>undo</member> can reasonably be expected to succeed.
+
+ @return
+ <FALSE/> if and only if the undo stack is currently empty, or there is an open and not-yet-closed
+ undo context.
+ */
+ boolean isUndoPossible();
+
+ /** determines whether <member>redo</member> can reasonably be expected to succeed.
+
+ @return
+ <FALSE/> if and only if the redo stack is currently empty, or there is an open and not-yet-closed
+ undo context.
+ */
+ boolean isRedoPossible();
+
+ /** returns the title of the top-most action on the undo stack
+
+ @throws EmptyUndoStackException
+ when the undo stack is currently empty
+
+ @see XUndoAction::Title
+ */
+ string getCurrentUndoActionTitle()
+ raises( ::com::sun::star::document::EmptyUndoStackException );
+
+ /** returns the title of the top-most action on the Redo stack
+
+ @throws EmptyUndoStackException
+ when the Redo stack is currently empty
+ @see XUndoAction::Title
+ */
+ string getCurrentRedoActionTitle()
+ raises( ::com::sun::star::document::EmptyUndoStackException );
+
+ /** returns the titles of all actions currently on the undo stack, from top to bottom
+ @see XUndoAction::Title
+ */
+ sequence< string >
+ getAllUndoActionTitles();
+
+ /** returns the titles of all actions currently on the Redo stack, from top to bottom
+
+ @see XUndoAction::Title
+ */
+ sequence< string >
+ getAllRedoActionTitles();
+
+ /** clears the undo and the redo stack.
+
+ <p>All actions will be removed from both the Undo and the Redo stack. Actions which implement the
+ <type scope="com::sun::star::lang">XComponent</type> interface will be disposed.</p>
+
+ @throws UndoContextNotClosedException
+ if the method is invoked while an undo context is still open
+ */
+ void clear()
+ raises( ::com::sun::star::document::UndoContextNotClosedException );
+
+ /** clears the redo stack.
+
+ <p>All actions will be removed from the Redo stack. Actions which implement the <type scope="com::sun::star::lang">XComponent</type>
+ interface will be disposed.</p>
+
+ @throws UndoContextNotClosedException
+ if the method is invoked while an undo context is still open
+ */
+ void clearRedo()
+ raises( ::com::sun::star::document::UndoContextNotClosedException );
+
+ /** resets the Undo manager
+
+ <p>In particular, this method will
+ <ul><li>remove all locks from the undo manager</li>
+ <li>close all open undo contexts</li>
+ <li>clear the undo stack</li>
+ <li>clear the redo stack</li>
+ </ul></p>
+
+ <p>Note that possible listeners will not get notifications for the single parts of the reset, i.e. there
+ will be no single <member>XUndoManagerListener::allActionsCleared</member>,
+ <member>XUndoManagerListener::leftContext</member>, etc., notifications. Instead, listeners will be
+ notified of the reset by calling their <member>XUndoManagerListener::resetAll</member> method.</p>
+ */
+ void reset();
+
+ /** adds a listener to be notified of changes in the Undo/Redo stacks.
+ */
+ void addUndoManagerListener(
+ [in] XUndoManagerListener i_listener
+ );
+
+ /** removes a previously added listener
+ */
+ void removeUndoManagerListener(
+ [in] XUndoManagerListener i_listener
+ );
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/XUndoManagerListener.idl b/offapi/com/sun/star/document/XUndoManagerListener.idl
new file mode 100755
index 000000000000..783e8e7014d8
--- /dev/null
+++ b/offapi/com/sun/star/document/XUndoManagerListener.idl
@@ -0,0 +1,144 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_document_XUndoManagerListener_idl__
+#define __com_sun_star_document_XUndoManagerListener_idl__
+
+#include <com/sun/star/document/UndoManagerEvent.idl>
+#include <com/sun/star/lang/XEventListener.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+//==================================================================================================================
+
+/** implemented by components which want to be notified of changes in the Undo/Redo stacks of an Undo manager.
+
+ @see XUndoManager
+ */
+interface XUndoManagerListener : ::com::sun::star::lang::XEventListener
+{
+ /** is called when an undo action is added to the undo stack.
+
+ <p>Note that the action must not necessarily be the new top element of the stack: In case there's an
+ open Undo context, <member>UndoManagerEvent::UndoContextDepth</member> will be greater <code>0</code>,
+ and the newly added action will be subordinate of the context action.</p>
+
+ @see XUndoManager::addUndoAction
+ */
+ void undoActionAdded( [in] UndoManagerEvent i_event );
+
+ /** is called when the top-most action of the undo stack has been undone.
+
+ @see XUndoManager::undo
+ */
+ void actionUndone( [in] UndoManagerEvent i_event );
+
+ /** is called when the top-most action of the Redo stack has been re-applied.
+
+ @see XUndoManager::redo
+ */
+ void actionRedone( [in] UndoManagerEvent i_event );
+
+ /** is called when both the Undo and the Redo stack have been cleared from all Undo actions.
+
+ @see XUndoManager::clear
+ */
+ void allActionsCleared( [in] ::com::sun::star::lang::EventObject i_event );
+
+ /** is called when the the Redo stack has been cleared.
+
+ @see XUndoManager::clearRedo
+ */
+ void redoActionsCleared( [in] ::com::sun::star::lang::EventObject i_event );
+
+ /** called when the complete undo manager has been reset
+ */
+ void resetAll( [in] ::com::sun::star::lang::EventObject i_event );
+
+ /** is called when a new Undo context has been entered.
+
+ <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and
+ <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the
+ one just entered.</p>
+
+ @see XUndoManager::enterUndoContext
+ */
+ void enteredContext( [in] UndoManagerEvent i_event );
+
+ /** is called when a new hidden Undo context has been entered.
+
+ <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and
+ <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, including the
+ one just entered.</p>
+
+ @see XUndoManager::enterUndoContext
+ */
+ void enteredHiddenContext( [in] UndoManagerEvent i_event );
+
+ /** is called when an Undo context has been left.
+
+ <p><member>UndoManagerEvent::UndoActionTitle</member> carries the title of the Undo context, and
+ <member>UndoManagerEvent::UndoContextDepth</member> the number of open Undo contexts, exluding the
+ one just left.</p>
+
+ @see XUndoManager::leaveUndoContext
+ @see leftHiddenUndocontext
+ @see cancelledContext
+ */
+ void leftContext( [in] UndoManagerEvent i_event );
+
+ /** is calledn when a hidden Undo context has been left.
+
+ <p><member>UndoManagerEvent::UndoActionTitle</member> is empty, as hidden Undo contexts don't have
+ a title.</p>
+
+ @see XUndoManager::leaveHiddenUndoContext
+ @see leftContext
+ @see cancelledContext
+ */
+ void leftHiddenContext( [in] UndoManagerEvent i_event );
+
+ /** is called when an Undo context has been left, but no actions have been added within this context.
+
+ <p>In such a case, the context which has just been left will not contribute to the undo stack, but instead
+ be silently removed. Consequently, the <member>UndoManagerEvent::UndoActionTitle</member> is empty.</p>
+
+ @see XUndoManager::leaveUndoContext
+ @see leftContext
+ @see leftHiddenContext
+ */
+ void cancelledContext( [in] UndoManagerEvent i_event );
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/XUndoManagerSupplier.idl b/offapi/com/sun/star/document/XUndoManagerSupplier.idl
new file mode 100755
index 000000000000..88a082259413
--- /dev/null
+++ b/offapi/com/sun/star/document/XUndoManagerSupplier.idl
@@ -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 __com_sun_star_document_XUndoManagerSupplier_idl__
+#define __com_sun_star_document_XUndoManagerSupplier_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module document {
+
+interface XUndoManager;
+
+//==================================================================================================================
+
+/** provides access to an XUndoManager.
+ */
+interface XUndoManagerSupplier
+{
+ /** returns the Undo manager associated with the component.
+ */
+ XUndoManager getUndoManager();
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/document/makefile.mk b/offapi/com/sun/star/document/makefile.mk
index 48394a65008c..1521e6b9513c 100644
--- a/offapi/com/sun/star/document/makefile.mk
+++ b/offapi/com/sun/star/document/makefile.mk
@@ -114,7 +114,15 @@ IDLFILES=\
XDocumentRevisionListPersistence.idl\
DocumentRevisionListPersistence.idl \
XDocumentLanguages.idl \
- XCodeNameQuery.idl
+ XCodeNameQuery.idl \
+ XUndoAction.idl \
+ XUndoManager.idl \
+ XUndoManagerListener.idl \
+ XUndoManagerSupplier.idl \
+ UndoManagerEvent.idl \
+ EmptyUndoStackException.idl \
+ UndoContextNotClosedException.idl \
+ UndoFailedException.idl \
# ------------------------------------------------------------------
diff --git a/offapi/com/sun/star/linguistic2/XLanguageGuessing.idl b/offapi/com/sun/star/linguistic2/XLanguageGuessing.idl
index b6b618d5a01e..5535c6e98569 100644
--- a/offapi/com/sun/star/linguistic2/XLanguageGuessing.idl
+++ b/offapi/com/sun/star/linguistic2/XLanguageGuessing.idl
@@ -81,6 +81,7 @@ module com { module sun { module star { module linguistic2 {
<li>ka : Georgian</li>
<li>ko : Korean</li>
<li>la : Latin</li>
+ <li>lb : Luxembourgish (added with OOo 3.3)</li>
<li>lt : Lithuanian</li>
<li>lv : Latvian</li>
<li>mr : Marathi</li>
@@ -96,10 +97,11 @@ module com { module sun { module star { module linguistic2 {
<li>ru : Russian</li>
<li>sa : Sanskrit</li>
<li>sco : Scots</li>
- <li>sh-YU : Serbian (written with latin characters)</li>
+ <li>sh : Serbian (written with latin characters)</li>
<li>sk-SK : Slovak (written with latin characters)</li>
<li>sl : Slovenian</li>
<li>sq : Albanian</li>
+ <li>sr : Serbian (written with cyrillic characters) (added with OOo 3.4)</li>
<li>sv : Swedish</li>
<li>sw : Swahili</li>
<li>ta : Tamil</li>
diff --git a/offapi/com/sun/star/util/DiskFullException.idl b/offapi/com/sun/star/util/DiskFullException.idl
index 385a5d1f590a..43eda08302a2 100644
--- a/offapi/com/sun/star/util/DiskFullException.idl
+++ b/offapi/com/sun/star/util/DiskFullException.idl
@@ -38,7 +38,7 @@ module com { module sun { module star { module util {
//=============================================================================
-/** is thrown when a disk full error occurs.
+/** @deprecated
*/
published exception DiskFullException: com::sun::star::util::FileIOException
{
diff --git a/offapi/com/sun/star/util/FileIOException.idl b/offapi/com/sun/star/util/FileIOException.idl
index 2b1d2ae31400..804c18094704 100644
--- a/offapi/com/sun/star/util/FileIOException.idl
+++ b/offapi/com/sun/star/util/FileIOException.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module util {
//=============================================================================
-/** thrown when file I/O error occurs.
+/** @deprecated
*/
published exception FileIOException: com::sun::star::uno::Exception
{
@@ -48,3 +48,4 @@ published exception FileIOException: com::sun::star::uno::Exception
}; }; }; };
#endif
+
diff --git a/offapi/com/sun/star/util/NotLockedException.idl b/offapi/com/sun/star/util/NotLockedException.idl
new file mode 100755
index 000000000000..b0917e0bdca6
--- /dev/null
+++ b/offapi/com/sun/star/util/NotLockedException.idl
@@ -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 __com_sun_star_util_NotLockedException_idl__
+#define __com_sun_star_util_NotLockedException_idl__
+
+#include <com/sun/star/util/InvalidStateException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module util {
+
+//==================================================================================================================
+
+/** is raised when attempt is made to unlock a lockable component which actually is not locked.
+ */
+exception NotLockedException : ::com::sun::star::util::InvalidStateException
+{
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/util/XBroadcaster.idl b/offapi/com/sun/star/util/XBroadcaster.idl
index feb09fe6124f..a622fcef7b98 100644
--- a/offapi/com/sun/star/util/XBroadcaster.idl
+++ b/offapi/com/sun/star/util/XBroadcaster.idl
@@ -50,7 +50,7 @@ interface XBroadcaster: com::sun::star::uno::XInterface
<member>XBroadcaster::unlockBroadcasts()</member> may be
nested and even overlapping, but they must be in pairs. While
there is at least one lock remaining, no broadcasts are
- send to registered listeners.
+ sent to registered listeners.
</p>
*/
[oneway] void lockBroadcasts();
@@ -64,10 +64,10 @@ interface XBroadcaster: com::sun::star::uno::XInterface
<member>XBroadcaster::unlockBroadcasts()</member> may be
nested and even overlapping, but they must be in pairs. While
there is at least one lock remaining, no broadcasts are
- send to registered listeners.
+ sent to registered listeners.
</p>
- <p> Pending broadcasts will be send immediately after the last
+ <p> Pending broadcasts will be sent immediately after the last
call to <member>XBroadcaster::lockBroadcast()</member> is matched
by a call to <member>XBroadcaster::unlockBroadcasts()</member>.
An implementation can decide to broadcast all pending notification in
diff --git a/offapi/com/sun/star/util/XLockable.idl b/offapi/com/sun/star/util/XLockable.idl
new file mode 100755
index 000000000000..e3da8025a034
--- /dev/null
+++ b/offapi/com/sun/star/util/XLockable.idl
@@ -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 __com_sun_star_util_XLockable_idl__
+#define __com_sun_star_util_XLockable_idl__
+
+#include <com/sun/star/util/NotLockedException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module util {
+
+//==================================================================================================================
+
+/** allows locking a component
+
+ <p><code>lock</code> and <code>unlock</code> calls can be nested. However, they must be in
+ pairs. As long as there has been one more call to <code>lock</code> than to <code>unlock</code>, the
+ component is considered locked, which is reflected by <member>isLocked</member> returning <TRUE/>.</p>
+ */
+interface XLockable
+{
+ /** locks</a> the component
+
+ @see unlock
+ @see isLocked
+ */
+ void lock();
+
+ /** unlocks the component
+
+ @throws NotLockedException
+ if the component is not currently locked.
+
+ @see lock
+ @see isLocked
+ */
+ void unlock()
+ raises ( NotLockedException
+ );
+
+ /** determines whether the component is currently locked.
+
+ @see lock
+ @see unlock
+ */
+ boolean isLocked();
+};
+
+//==================================================================================================================
+
+}; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/util/makefile.mk b/offapi/com/sun/star/util/makefile.mk
index aa0374296ddb..87dc2d078037 100644
--- a/offapi/com/sun/star/util/makefile.mk
+++ b/offapi/com/sun/star/util/makefile.mk
@@ -145,6 +145,8 @@ IDLFILES=\
UriAbbreviation.idl\
XJobManager.idl\
JobManager.idl\
+ XLockable.idl\
+ NotLockedException.idl\
# ------------------------------------------------------------------
diff --git a/offapi/prj/build.lst b/offapi/prj/build.lst
index bc6dda566031..e5c9a72f312f 100644
--- a/offapi/prj/build.lst
+++ b/offapi/prj/build.lst
@@ -9,6 +9,7 @@ oa offapi\com\sun\star\accessibility nmake - all oa_accessibility oa_awt N
oa offapi\com\sun\star\awt nmake - all oa_awt NULL
oa offapi\com\sun\star\awt\tree nmake - all oa_awttree NULL
oa offapi\com\sun\star\awt\grid nmake - all oa_awtgrid NULL
+oa offapi\com\sun\star\awt\tab nmake - all oa_awttab NULL
oa offapi\com\sun\star\chart nmake - all oa_chart NULL
oa offapi\com\sun\star\chart2 nmake - all oa_chart2 NULL
oa offapi\com\sun\star\chart2\data nmake - all oa_chart2_data NULL
@@ -106,4 +107,4 @@ oa offapi\com\sun\star\rendering nmake - all oa_rendering oa_geometry NU
oa offapi\com\sun\star\rdf nmake - all oa_rdf oa_datatransfer oa_text NULL
oa offapi\com\sun\star\office nmake - all oa_office oa_text NULL
oa offapi\drafts\com\sun\star\form nmake - all oa_drafts_form NULL
-oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_drafts_form oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_script_vba oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement oa_office oa_prestextfield oa_starme NULL
+oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_awttab oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_drafts_form oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement oa_office oa_prestextfield oa_starme NULL
diff --git a/offapi/prj/d.lst b/offapi/prj/d.lst
index 764521f3e944..a271a7159130 100644
--- a/offapi/prj/d.lst
+++ b/offapi/prj/d.lst
@@ -13,6 +13,7 @@ mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\auth
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\awt
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\awt\tree
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\awt\grid
+mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\awt\tab
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\chart
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\chart2
mkdir: %COMMON_DEST%\idl%_EXT%\com\sun\star\chart2\data
@@ -130,6 +131,7 @@ mkdir: %COMMON_DEST%\idl%_EXT%\drafts\com\sun\star\form
..\com\sun\star\awt\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\awt
..\com\sun\star\awt\tree\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\awt\tree
..\com\sun\star\awt\grid\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\awt\grid
+..\com\sun\star\awt\tab\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\awt\tab
..\com\sun\star\chart\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\chart
..\com\sun\star\chart2\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\chart2
..\com\sun\star\chart2\data\*.idl %COMMON_DEST%\idl%_EXT%\com\sun\star\chart2\data
diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk
index 016180d7765c..dd91e2d99456 100644
--- a/offapi/util/makefile.mk
+++ b/offapi/util/makefile.mk
@@ -42,6 +42,7 @@ UNOIDLDBFILES= \
$(UCR)$/cssawt.db \
$(UCR)$/cssawttree.db \
$(UCR)$/cssawtgrid.db \
+ $(UCR)$/cssawttab.db \
$(UCR)$/csschart.db \
$(UCR)$/csschart2.db \
$(UCR)$/csschart2data.db \
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
index 4ed9be5a3d27..07a717f31442 100644..100755
--- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu
@@ -42,9 +42,6 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Import Formula...</value>
</prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
</node>
<node oor:name=".uno:FitInWindow" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
@@ -111,7 +108,7 @@
</node>
<node oor:name=".uno:View100" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">1</value>
+ <value xml:lang="en-US">Zoom 100%</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
@@ -119,7 +116,7 @@
</node>
<node oor:name=".uno:View200" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">2</value>
+ <value xml:lang="en-US">Zoom 200%</value>
</prop>
</node>
<node oor:name=".uno:ZoomIn" oor:op="replace">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Math.xcs b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
index 31f6e00a230a..13a566dc6746 100644..100755
--- a/officecfg/registry/schema/org/openoffice/Office/Math.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Math.xcs
@@ -316,6 +316,20 @@
<value>100</value>
</prop>
</group>
+ <group oor:name="LoadSave">
+ <info>
+ <desc>Contains settings related to load and save operations.</desc>
+ </info>
+ <prop oor:name="IsSaveOnlyUsedSymbols" oor:type="xs:boolean">
+ <!-- UIHints: - Tools/Options - OpenOffice Maths - Settings -->
+ <info>
+ <author>TL</author>
+ <desc>When set only symbols used in the current formula will be saved. Otherwise all user defined symbols will be saved in each formula.</desc>
+ <label>Save only used symbols.</label>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
<group oor:name="Misc">
<info>
<desc>Contains miscellaneous settings.</desc>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Scripting.xcs b/officecfg/registry/schema/org/openoffice/Office/Scripting.xcs
index b77cb00f8cac..90acb2a110bf 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Scripting.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Scripting.xcs
@@ -48,28 +48,5 @@
<desc>Lists the registered Scripting Framework runtimes.</desc>
</info>
</set>
- <group oor:name="ScriptDisplaySettings">
- <info>
- <desc> Specifies display settings for assignment dialogs </desc>
- </info>
- <prop oor:name="ShowBasic" oor:type="xs:boolean">
- <info>
- <desc>Show Basic scripts in assignment dialogs</desc>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="ShowSF" oor:type="xs:boolean">
- <info>
- <desc>Show Scripting Framework scripts in assignment dialogs</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="UseNewToolsConfigure" oor:type="xs:boolean">
- <info>
- <desc>Use New Tools Configure dialog</desc>
- </info>
- <value>true</value>
- </prop>
- </group>
</component>
</oor:component-schema>
diff --git a/offuh/prj/d.lst b/offuh/prj/d.lst
index 486c08f1c655..464dfca14075 100644
--- a/offuh/prj/d.lst
+++ b/offuh/prj/d.lst
@@ -8,6 +8,7 @@ mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\accessibility
mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\awt
mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\tree
mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\grid
+mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\tab
mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\beans
mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\bridge
mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\bridge\oleautomation
@@ -159,6 +160,8 @@ mkdir: %_DEST%\inc%_EXT%\offuh\msforms
..\%__SRC%\inc\offuh\com\sun\star\awt\tree\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\tree\*.hpp
..\%__SRC%\inc\offuh\com\sun\star\awt\grid\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\grid\*.hdl
..\%__SRC%\inc\offuh\com\sun\star\awt\grid\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\grid\*.hpp
+..\%__SRC%\inc\offuh\com\sun\star\awt\tab\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\tab\*.hdl
+..\%__SRC%\inc\offuh\com\sun\star\awt\tab\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\awt\tab\*.hpp
..\%__SRC%\inc\offuh\com\sun\star\beans\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\beans\*.hdl
..\%__SRC%\inc\offuh\com\sun\star\beans\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\beans\*.hpp
..\%__SRC%\inc\offuh\com\sun\star\bridge\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\bridge\*.hdl
diff --git a/oox/inc/oox/drawingml/chart/axismodel.hxx b/oox/inc/oox/drawingml/chart/axismodel.hxx
index 23dc96037427..0ce24d6ff515 100644
--- a/oox/inc/oox/drawingml/chart/axismodel.hxx
+++ b/oox/inc/oox/drawingml/chart/axismodel.hxx
@@ -77,9 +77,9 @@ struct AxisModel
OptValue< double > mofLogBase; /// Logarithmic base for logarithmic axes.
OptValue< double > mofMax; /// Maximum axis value.
OptValue< double > mofMin; /// Minimum axis value.
+ OptValue< sal_Int32 > monBaseTimeUnit; /// Base time unit shown on a date axis.
sal_Int32 mnAxisId; /// Unique axis identifier.
sal_Int32 mnAxisPos; /// Position of the axis (top/bottom/left/right).
- sal_Int32 mnBaseTimeUnit; /// Base time unit shown on a date axis.
sal_Int32 mnCrossAxisId; /// Identifier of a crossing axis.
sal_Int32 mnCrossBetween; /// This value axis crosses between or inside category.
sal_Int32 mnCrossMode; /// Mode this axis crosses another axis (min, max, auto).
@@ -94,7 +94,7 @@ struct AxisModel
sal_Int32 mnTickLabelSkip; /// Number of tick mark labels to skip.
sal_Int32 mnTickMarkSkip; /// Number of tick marks to skip.
sal_Int32 mnTypeId; /// Type identifier of this axis.
- bool mbAuto; /// True = automatic axis settings.
+ bool mbAuto; /// True = automatic selection of text/date axis type.
bool mbDeleted; /// True = axis has been deleted manually.
bool mbNoMultiLevel; /// True = no multi-level categories supported.
diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx
index 9c0a57a83c04..5552a5e5ce52 100644
--- a/oox/inc/oox/xls/biffhelper.hxx
+++ b/oox/inc/oox/xls/biffhelper.hxx
@@ -303,6 +303,7 @@ const sal_uInt16 BIFF_ID_CHCHART = 0x1002;
const sal_uInt16 BIFF_ID_CHCHART3D = 0x103A;
const sal_uInt16 BIFF_ID_CHCHARTLINE = 0x101C;
const sal_uInt16 BIFF_ID_CHDATAFORMAT = 0x1006;
+const sal_uInt16 BIFF_ID_CHDATERANGE = 0x1062;
const sal_uInt16 BIFF_ID_CHDEFAULTTEXT = 0x1024;
const sal_uInt16 BIFF_ID_CHDROPBAR = 0x103D;
const sal_uInt16 BIFF_ID_CHECKCOMPAT = 0x088C;
@@ -327,7 +328,6 @@ const sal_uInt16 BIFF_ID_CHFRTEXTPROPS = 0x08A5;
const sal_uInt16 BIFF_ID_CHFRUNITPROPS = 0x0857;
const sal_uInt16 BIFF_ID_CHFRWRAPPER = 0x0851;
const sal_uInt16 BIFF_ID_CHLABELRANGE = 0x1020;
-const sal_uInt16 BIFF_ID_CHLABELRANGE2 = 0x1062;
const sal_uInt16 BIFF_ID_CHLEGEND = 0x1015;
const sal_uInt16 BIFF_ID_CHLINE = 0x1018;
const sal_uInt16 BIFF_ID_CHLINEFORMAT = 0x1007;
diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx
index cfcdd3ff0754..e590bf1c64cb 100644
--- a/oox/source/drawingml/chart/axiscontext.cxx
+++ b/oox/source/drawingml/chart/axiscontext.cxx
@@ -237,7 +237,7 @@ ContextHandlerRef DateAxisContext::onCreateContext( sal_Int32 nElement, const At
mrModel.mbAuto = rAttribs.getBool( XML_val, false );
return 0;
case C_TOKEN( baseTimeUnit ):
- mrModel.mnBaseTimeUnit = rAttribs.getToken( XML_val, XML_days );
+ mrModel.monBaseTimeUnit = rAttribs.getToken( XML_val, XML_days );
return 0;
case C_TOKEN( lblOffset ):
mrModel.mnLabelOffset = rAttribs.getInteger( XML_val, 100 );
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index 028fc3d19eb1..18dc00b9d866 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -31,6 +31,8 @@
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
@@ -57,23 +59,35 @@ using ::rtl::OUString;
namespace {
-template< typename Type >
-inline void lclSetValueOrClearAny( Any& orAny, const OptValue< Type >& roValue )
+inline void lclSetValueOrClearAny( Any& orAny, const OptValue< double >& rofValue )
{
- if( roValue.has() ) orAny <<= roValue.get(); else orAny.clear();
+ if( rofValue.has() ) orAny <<= rofValue.get(); else orAny.clear();
}
-void lclSetScaledValueOrClearAny( Any& orAny, const OptValue< double >& rofValue, const Reference< XScaling >& rxScaling )
+bool lclIsLogarithmicScale( const AxisModel& rAxisModel )
{
- if( rofValue.has() && rxScaling.is() )
- orAny <<= rxScaling->doScaling( rofValue.get() );
- else
- lclSetValueOrClearAny( orAny, rofValue );
+ return rAxisModel.mofLogBase.has() && (2.0 <= rAxisModel.mofLogBase.get()) && (rAxisModel.mofLogBase.get() <= 1000.0);
}
-bool lclIsLogarithmicScale( const AxisModel& rAxisModel )
+sal_Int32 lclGetApiTimeUnit( sal_Int32 nTimeUnit )
{
- return rAxisModel.mofLogBase.has() && (2.0 <= rAxisModel.mofLogBase.get()) && (rAxisModel.mofLogBase.get() <= 1000.0);
+ using namespace ::com::sun::star::chart;
+ switch( nTimeUnit )
+ {
+ case XML_days: return TimeUnit::DAY;
+ case XML_months: return TimeUnit::MONTH;
+ case XML_years: return TimeUnit::YEAR;
+ default: OSL_ENSURE( false, "lclGetApiTimeUnit - unexpected time unit" );
+ }
+ return TimeUnit::DAY;
+}
+
+void lclConvertTimeInterval( Any& orInterval, const OptValue< double >& rofUnit, sal_Int32 nTimeUnit )
+{
+ if( rofUnit.has() && (1.0 <= rofUnit.get()) && (rofUnit.get() <= SAL_MAX_INT32) )
+ orInterval <<= ::com::sun::star::chart::TimeInterval( static_cast< sal_Int32 >( rofUnit.get() ), lclGetApiTimeUnit( nTimeUnit ) );
+ else
+ orInterval.clear();
}
::com::sun::star::chart::ChartAxisLabelPosition lclGetLabelPosition( sal_Int32 nToken )
@@ -175,8 +189,13 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
if( rTypeInfo.mbCategoryAxis )
{
OSL_ENSURE( (mrModel.mnTypeId == C_TOKEN( catAx )) || (mrModel.mnTypeId == C_TOKEN( dateAx )),
- "AxisConverter::convertFromModel - unexpected axis model type (must: c:catAx or c:dateEx)" );
- aScaleData.AxisType = cssc2::AxisType::CATEGORY;
+ "AxisConverter::convertFromModel - unexpected axis model type (must: c:catAx or c:dateAx)" );
+ bool bDateAxis = mrModel.mnTypeId == C_TOKEN( dateAx );
+ /* Chart2 requires axis type CATEGORY for automatic
+ category/date axis (even if it is a date axis
+ currently). */
+ aScaleData.AxisType = (bDateAxis && !mrModel.mbAuto) ? cssc2::AxisType::DATE : cssc2::AxisType::CATEGORY;
+ aScaleData.AutoDateAxis = mrModel.mbAuto;
aScaleData.Categories = rTypeGroup.createCategorySequence();
}
else
@@ -202,14 +221,37 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
{
case cssc2::AxisType::CATEGORY:
case cssc2::AxisType::SERIES:
+ case cssc2::AxisType::DATE:
{
- // do not overlap text unless all labels are visible
- aAxisProp.setProperty( PROP_TextOverlap, mrModel.mnTickLabelSkip == 1 );
- // do not break text into several lines
- aAxisProp.setProperty( PROP_TextBreak, false );
- // do not stagger labels in two lines
- aAxisProp.setProperty( PROP_ArrangeOrder, cssc::ChartAxisArrangeOrderType_SIDE_BY_SIDE );
- //! TODO #i58731# show n-th category
+ /* Determine date axis type from XML type identifier, and not
+ via aScaleData.AxisType, as this value sticks to CATEGORY
+ for automatic category/date axes). */
+ if( mrModel.mnTypeId == C_TOKEN( dateAx ) )
+ {
+ // scaling algorithm
+ aScaleData.Scaling.set( createInstance( CREATE_OUSTRING( "com.sun.star.chart2.LinearScaling" ) ), UNO_QUERY );
+ // min/max
+ lclSetValueOrClearAny( aScaleData.Minimum, mrModel.mofMin );
+ lclSetValueOrClearAny( aScaleData.Maximum, mrModel.mofMax );
+ // major/minor increment
+ lclConvertTimeInterval( aScaleData.TimeIncrement.MajorTimeInterval, mrModel.mofMajorUnit, mrModel.mnMajorTimeUnit );
+ lclConvertTimeInterval( aScaleData.TimeIncrement.MinorTimeInterval, mrModel.mofMinorUnit, mrModel.mnMinorTimeUnit );
+ // base time unit
+ if( mrModel.monBaseTimeUnit.has() )
+ aScaleData.TimeIncrement.TimeResolution <<= lclGetApiTimeUnit( mrModel.monBaseTimeUnit.get() );
+ else
+ aScaleData.TimeIncrement.TimeResolution.clear();
+ }
+ else
+ {
+ // do not overlap text unless all labels are visible
+ aAxisProp.setProperty( PROP_TextOverlap, mrModel.mnTickLabelSkip == 1 );
+ // do not break text into several lines
+ aAxisProp.setProperty( PROP_TextBreak, false );
+ // do not stagger labels in two lines
+ aAxisProp.setProperty( PROP_ArrangeOrder, cssc::ChartAxisArrangeOrderType_SIDE_BY_SIDE );
+ //! TODO #i58731# show n-th category
+ }
}
break;
case cssc2::AxisType::REALNUMBER:
@@ -226,26 +268,25 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
lclSetValueOrClearAny( aScaleData.Maximum, mrModel.mofMax );
// major increment
IncrementData& rIncrementData = aScaleData.IncrementData;
- lclSetScaledValueOrClearAny( rIncrementData.Distance, mrModel.mofMajorUnit, aScaleData.Scaling );
+ if( mrModel.mofMajorUnit.has() && aScaleData.Scaling.is() )
+ rIncrementData.Distance <<= aScaleData.Scaling->doScaling( mrModel.mofMajorUnit.get() );
+ else
+ lclSetValueOrClearAny( rIncrementData.Distance, mrModel.mofMajorUnit );
// minor increment
Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements;
rSubIncrementSeq.realloc( 1 );
Any& rIntervalCount = rSubIncrementSeq[ 0 ].IntervalCount;
+ rIntervalCount.clear();
if( bLogScale )
{
if( mrModel.mofMinorUnit.has() )
rIntervalCount <<= sal_Int32( 9 );
}
- else
+ else if( mrModel.mofMajorUnit.has() && mrModel.mofMinorUnit.has() && (0.0 < mrModel.mofMinorUnit.get()) && (mrModel.mofMinorUnit.get() <= mrModel.mofMajorUnit.get()) )
{
- OptValue< sal_Int32 > onCount;
- if( mrModel.mofMajorUnit.has() && mrModel.mofMinorUnit.has() && (0.0 < mrModel.mofMinorUnit.get()) && (mrModel.mofMinorUnit.get() <= mrModel.mofMajorUnit.get()) )
- {
- double fCount = mrModel.mofMajorUnit.get() / mrModel.mofMinorUnit.get() + 0.5;
- if( (1.0 <= fCount) && (fCount < 1001.0) )
- onCount = static_cast< sal_Int32 >( fCount );
- }
- lclSetValueOrClearAny( rIntervalCount, onCount );
+ double fCount = mrModel.mofMajorUnit.get() / mrModel.mofMinorUnit.get() + 0.5;
+ if( (1.0 <= fCount) && (fCount < 1001.0) )
+ rIntervalCount <<= static_cast< sal_Int32 >( fCount );
}
}
break;
diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx
index 8736e8f6dcd5..c1bec6c1e1be 100644
--- a/oox/source/drawingml/chart/axismodel.cxx
+++ b/oox/source/drawingml/chart/axismodel.cxx
@@ -48,7 +48,6 @@ AxisDispUnitsModel::~AxisDispUnitsModel()
AxisModel::AxisModel( sal_Int32 nTypeId ) :
mnAxisId( -1 ),
mnAxisPos( XML_TOKEN_INVALID ),
- mnBaseTimeUnit( XML_days ),
mnCrossAxisId( -1 ),
mnCrossBetween( XML_between ),
mnCrossMode( XML_autoZero ),
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index 4e9156b5cc03..546ad186e7ab 100644
--- a/oox/source/dump/biffdumper.cxx
+++ b/oox/source/dump/biffdumper.cxx
@@ -1755,6 +1755,18 @@ void WorkbookStreamObject::implDumpRecordBody()
if( eBiff >= BIFF5 ) dumpHex< sal_uInt16 >( "flags", "CHDATAFORMAT-FLAGS" );
break;
+ case BIFF_ID_CHDATERANGE:
+ dumpDec< sal_uInt16 >( "minimum-date" );
+ dumpDec< sal_uInt16 >( "maximum-date" );
+ dumpDec< sal_uInt16 >( "major-unit-value" );
+ dumpDec< sal_uInt16 >( "major-unit", "CHDATERANGE-UNIT" );
+ dumpDec< sal_uInt16 >( "minor-unit-value" );
+ dumpDec< sal_uInt16 >( "minor-unit", "CHDATERANGE-UNIT" );
+ dumpDec< sal_uInt16 >( "base-unit", "CHDATERANGE-UNIT" );
+ dumpDec< sal_uInt16 >( "axis-crossing-date" );
+ dumpHex< sal_uInt16 >( "flags", "CHDATERANGE-FLAGS" );
+ break;
+
case BIFF_ID_CHECKCOMPAT:
dumpFrHeader( true, true );
dumpBool< sal_uInt32 >( "check-compatibility" );
@@ -1884,18 +1896,6 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpHex< sal_uInt16 >( "flags", "CHLABELRANGE-FLAGS" );
break;
- case BIFF_ID_CHLABELRANGE2:
- dumpDec< sal_uInt16 >( "minimum-categ" );
- dumpDec< sal_uInt16 >( "maximum-categ" );
- dumpDec< sal_uInt16 >( "major-unit-value" );
- dumpDec< sal_uInt16 >( "major-unit" );
- dumpDec< sal_uInt16 >( "minor-unit-value" );
- dumpDec< sal_uInt16 >( "minor-unit" );
- dumpDec< sal_uInt16 >( "base-unit" );
- dumpDec< sal_uInt16 >( "axis-crossing-date" );
- dumpHex< sal_uInt16 >( "flags", "CHLABELRANGE2-FLAGS" );
- break;
-
case BIFF_ID_CHLEGEND:
dumpRect< sal_Int32 >( "position", (eBiff <= BIFF4) ? "CONV-TWIP-TO-CM" : "" );
dumpDec< sal_uInt8 >( "docked-pos", "CHLEGEND-DOCKPOS" );
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index f32ed89334f8..2e25ff81c890 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -397,7 +397,7 @@ multilist=RECORD-NAMES-BIFF8
0x08A0=,,,FORCEFULLCALC,CHFRSHAPEPROPS,CHFRTEXTPROPS,,CHFRPLOTAREALAYOUT
# chart records
0x1058=,,,,,,,CH3DDATAFORMAT
- 0x1060=CHFONTBASE,CHPIEEXT,CHLABELRANGE2,CHDATATABLE,CHPLOTGROWTH,CHSERINDEX,CHESCHERFORMAT,CHPIEEXTSETT
+ 0x1060=CHFONTBASE,CHPIEEXT,CHDATERANGE,CHDATATABLE,CHPLOTGROWTH,CHSERINDEX,CHESCHERFORMAT,CHPIEEXTSETT
end
# simple records -------------------------------------------------------------
@@ -821,6 +821,21 @@ flagslist=CHDATAFORMAT-FLAGS
0x0001=excel4-colors
end
+# CHDATERANGE ----------------------------------------------------------------
+
+shortlist=CHDATERANGE-UNIT,0,days,months,years
+
+flagslist=CHDATERANGE-FLAGS
+ 0x0001=auto-minimum
+ 0x0002=auto-maximum
+ 0x0004=auto-major
+ 0x0008=auto-minor
+ 0x0010=date-axis
+ 0x0020=auto-base
+ 0x0040=auto-axis-cross
+ 0x0080=auto-date
+end
+
# CHFRAME --------------------------------------------------------------------
shortlist=CHFRAME-FORMAT,0,standard,,,,shadow
@@ -977,19 +992,6 @@ flagslist=CHLABELRANGE-FLAGS
0x0004=reverse-order
end
-# CHLABELRANGE2 --------------------------------------------------------------
-
-flagslist=CHLABELRANGE2-FLAGS
- 0x0001=auto-minimum
- 0x0002=auto-maximum
- 0x0004=auto-major
- 0x0008=auto-minor
- 0x0010=date-axis
- 0x0020=auto-base
- 0x0040=auto-axis-cross
- 0x0080=auto-date
-end
-
# CHLEGEND -------------------------------------------------------------------
shortlist=CHLEGEND-DOCKPOS,0,bottom,top-right,top,right,left,,,manual
diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx
index 8145e7c4e5ce..fecad5ab40e7 100644
--- a/oox/source/helper/zipstorage.cxx
+++ b/oox/source/helper/zipstorage.cxx
@@ -69,8 +69,10 @@ ZipStorage::ZipStorage(
TODO: #i105410# switch to 'OFOPXMLFormat' and use its
implementation of relations handling. */
+
mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
- ZIP_STORAGE_FORMAT_STRING, rxInStream, rxFactory, sal_True );
+ ZIP_STORAGE_FORMAT_STRING, rxInStream, rxFactory,
+ sal_False /* DEV300_m80: Was sal_True, but DOCX and others did not load */ );
}
catch( Exception& )
{
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index f01b7ce06f4b..dcd5669897e3 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -836,13 +836,18 @@ sal_Int32 ZipFile::recover()
aGrabber.seek( 0 );
- for( sal_Int32 nGenPos = 0; aGrabber.readBytes( aBuffer, 32000 ) && aBuffer.getLength() > 30; )
+ const sal_Int32 nToRead = 32000;
+ for( sal_Int32 nGenPos = 0; aGrabber.readBytes( aBuffer, nToRead ) && aBuffer.getLength() > 16; )
{
const sal_Int8 *pBuffer = aBuffer.getConstArray();
sal_Int32 nBufSize = aBuffer.getLength();
sal_Int32 nPos = 0;
- while( nPos < nBufSize - 16 )
+ // the buffer should contain at least one header,
+ // or if it is end of the file, at least the postheader with sizes and hash
+ while( nPos < nBufSize - 30
+ || ( aBuffer.getLength() < nToRead && nPos < nBufSize - 16 ) )
+
{
if ( nPos < nBufSize - 30 && pBuffer[nPos] == 'P' && pBuffer[nPos+1] == 'K' && pBuffer[nPos+2] == 3 && pBuffer[nPos+3] == 4 )
{
diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk
index 3ca8a15296b4..53aff94912ca 100644
--- a/postprocess/packcomponents/makefile.mk
+++ b/postprocess/packcomponents/makefile.mk
@@ -76,7 +76,6 @@ my_components = \
ctl \
date \
dba \
- dbacfg \
dbase \
dbaxml \
dbmm \
diff --git a/postprocess/rebase/coffbase.txt b/postprocess/rebase/coffbase.txt
index 16be8531d383..27999d2c4cbb 100755
--- a/postprocess/rebase/coffbase.txt
+++ b/postprocess/rebase/coffbase.txt
@@ -55,7 +55,6 @@ cppuhelper3msc.dll 0x00000000656c0000 0x00070000
ctlmi.dll 0x0000000065680000 0x00030000
cuimi.dll 0x00000000654a0000 0x001d0000
datemi.dll 0x0000000065470000 0x00020000
-dbacfgmi.dll 0x0000000065440000 0x00020000
dbami.dll 0x00000000652e0000 0x00150000
dbasemi.dll 0x0000000065280000 0x00050000
dbaxmlmi.dll 0x0000000065230000 0x00040000
diff --git a/pyuno/demo/pyunoenv.tcsh b/pyuno/demo/pyunoenv.tcsh
index 1a831996325f..038cf2ddb45b 100644
--- a/pyuno/demo/pyunoenv.tcsh
+++ b/pyuno/demo/pyunoenv.tcsh
@@ -17,7 +17,12 @@ if( ! $?LD_LIBRARY_PATH ) then
setenv LD_LIBRARY_PATH
endif
-setenv PYTHONPATH .:$OOOHOME/program:$OOOHOME/program/pydemo:$OOOHOME/program/python/lib:$PYTHONPATH
+if( "$PYTHONPATH" != "" ) then
+ setenv PYTHONPATH $OOOHOME/program:$OOOHOME/program/pydemo:$OOOHOME/program/python/lib:$PYTHONPATH
+else
+ setenv PYTHONPATH $OOOHOME/program:$OOOHOME/program/pydemo:$OOOHOME/program/python/lib
+endif
+
setenv LD_LIBRARY_PATH $OOOHOME/program:$LD_LIBRARY_PATH
if( $?PYTHONHOME ) then
diff --git a/qadevOOo/runner/complexlib/Assurance.java b/qadevOOo/runner/complexlib/Assurance.java
index 665980d792ab..980ede95f052 100644
--- a/qadevOOo/runner/complexlib/Assurance.java
+++ b/qadevOOo/runner/complexlib/Assurance.java
@@ -75,7 +75,7 @@ public class Assurance
* @param actual specifies the actual boolean value
*/
protected void assureEquals( boolean expected, boolean actual ) {
- assureEquals( "Equality test failed", new Boolean( expected ), new Boolean( actual ), false );
+ assureEquals( "Equality test failed", expected, new Boolean( actual ), false );
}
/**
@@ -85,7 +85,7 @@ public class Assurance
* @param actual specifies the actual boolean value
*/
protected void assureEquals( String message, boolean expected, boolean actual ) {
- assureEquals( message, new Boolean( expected ), new Boolean( actual ), false );
+ assureEquals( message, expected, actual, false );
}
/**
@@ -240,6 +240,27 @@ public class Assurance
assureEquals( message, expected, actual, false );
}
+ /**
+ * assures the two given sequences are of equal length, and have equal content
+ */
+ public <T> void assureEquals( String i_message, T[] i_expected, T[] i_actual, boolean i_continue )
+ {
+ if ( i_expected.length != i_actual.length )
+ failed( i_message + ": expected element count: " + i_expected.length + ", actual element count: " + i_actual.length );
+ for ( int i=0; i<i_expected.length; ++i )
+ {
+ assureEquals( i_message + ": mismatch at element pos " + i, i_expected[i], i_actual[i], i_continue );
+ }
+ }
+
+ /**
+ * assures the two given sequences are of equal length, and have equal content
+ */
+ public <T> void assureEquals( String i_message, T[] i_expected, T[] i_actual )
+ {
+ assureEquals( i_message, i_expected, i_actual, false );
+ }
+
/** invokes a given method on a given object, and assures a certain exception is caught
* @param _message is the message to print when the check fails
* @param _object is the object to invoke the method on
diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportData.java b/reportbuilder/java/com/sun/star/report/SDBCReportData.java
index 769657aa6bf5..a759b1712fe9 100644
--- a/reportbuilder/java/com/sun/star/report/SDBCReportData.java
+++ b/reportbuilder/java/com/sun/star/report/SDBCReportData.java
@@ -47,7 +47,6 @@ import com.sun.star.util.Time;
import java.sql.Timestamp;
-
public class SDBCReportData implements DataSource
{
@@ -349,7 +348,7 @@ public class SDBCReportData implements DataSource
private Object convertObject(final int type, final Object obj)
{
- final Object ret;
+ Object ret;
switch (type)
{
case DataType.DATE:
@@ -365,7 +364,14 @@ public class SDBCReportData implements DataSource
case DataType.NUMERIC:
if (!(obj instanceof Any))
{
- ret = new java.math.BigDecimal((String) obj);
+ try
+ {
+ ret = new java.math.BigDecimal(String.valueOf(obj));
+ }
+ catch (NumberFormatException ex)
+ {
+ ret = obj;
+ }
}
else
{
diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk b/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
index 008f50518ff1..9ba0c026c224 100644
--- a/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
+++ b/reportbuilder/java/com/sun/star/report/function/metadata/makefile.mk
@@ -50,18 +50,20 @@ JAVAFILES := AuthorFunction.java \
MetaDataFunctionCategory.java
# PROPERTYFILES := $(shell @$(FIND) . -name "*.properties")
-PROPERTYFILES := $(CLASSDIR)$/$(PACKAGE)$/category.properties \
- $(CLASSDIR)$/$(PACKAGE)$/category_en_US.properties \
- $(CLASSDIR)$/$(PACKAGE)$/Author-Function.properties \
- $(CLASSDIR)$/$(PACKAGE)$/Author-Function_en_US.properties \
- $(CLASSDIR)$/$(PACKAGE)$/Title-Function.properties \
- $(CLASSDIR)$/$(PACKAGE)$/Title-Function_en_US.properties
+PROPERTYFILES:=$(CLASSDIR)$/$(PACKAGE)$/category.properties \
+ $(CLASSDIR)$/$(PACKAGE)$/Title-Function.properties\
+ $(CLASSDIR)$/$(PACKAGE)$/category_en_US.properties \
+ $(CLASSDIR)$/$(PACKAGE)$/Author-Function.properties \
+ $(CLASSDIR)$/$(PACKAGE)$/Author-Function_en_US.properties \
+ $(CLASSDIR)$/$(PACKAGE)$/Title-Function_en_US.properties
+L10NPROPERTYFILES = $(PROPERTYFILES)
+ALLTAR : $(PROPERTYFILES)
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
-ALLTAR : $(PROPERTYFILES)
-
-$(CLASSDIR)$/$(PACKAGE)$/%.properties : %.properties
+.IF "$(WITH_LANG)"==""
+$(CLASSDIR)/$(PACKAGE)/%.properties : %.properties
@@-$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
+ $(COMMAND_ECHO)$(COPY) $< $@
+.ENDIF
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
index b41252a17089..cdc8eae1b73b 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
@@ -41,6 +41,18 @@ import com.sun.star.report.pentaho.model.OfficeStyles;
import com.sun.star.report.pentaho.model.OfficeStylesCollection;
import com.sun.star.report.pentaho.styles.LengthCalculator;
import com.sun.star.report.pentaho.styles.StyleMapper;
+import com.sun.org.apache.xerces.internal.parsers.DOMParser;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
import java.awt.Image;
@@ -54,6 +66,7 @@ import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
@@ -137,7 +150,6 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
public static final String FAILED = "Failed";
public static final String VERTICAL_POS = "vertical-pos";
private static final String ZERO_CM = "0cm";
-
/** the verison of the ODF specification to which generated documents
* shall conform. */
public static final String ODF_VERSION = "1.2";
@@ -381,7 +393,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS);
rootAttributes.addNamespaceDeclaration("grddl", OfficeNamespaces.GRDDL_NS);
rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version",
- ODF_VERSION);
+ ODF_VERSION);
this.rootXmlWriter.writeXmlDeclaration("UTF-8");
this.rootXmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "document-content", rootAttributes, XmlWriterSupport.OPEN);
@@ -1037,6 +1049,53 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
getXmlWriter().writeCloseTag();
}
+ public void copyMeta()
+ {
+ // now copy the meta.xml
+ if (getInputRepository().isReadable("meta.xml"))
+ {
+ InputStream inputStream = null;
+ try
+ {
+ inputStream = getInputRepository().createInputStream("meta.xml");
+ DOMParser dOMParser = new DOMParser();
+ dOMParser.parse(new InputSource(inputStream));
+ Document document = dOMParser.getDocument();
+ NodeList nl = document.getElementsByTagName("document-meta/meta/generator");
+ Node node = document.getFirstChild().getFirstChild().getFirstChild().getFirstChild();
+ String creator = node.getNodeValue();
+ node.setNodeValue(creator + "/report_builder");
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+
+ final OutputStream outputMetaStream = getOutputRepository().createOutputStream("meta.xml", "text/xml");
+ StreamResult result = new StreamResult(outputMetaStream);
+ DOMSource source = new DOMSource(document);
+ transformer.transform(source, result);
+
+ //IOUtils.getInstance().copyStreams(inputStream, outputMetaStream);
+ outputMetaStream.flush();
+ outputMetaStream.close();
+ }
+ catch (java.lang.Exception ex)
+ {
+ } finally
+ {
+ if (inputStream != null)
+ {
+ try
+ {
+ inputStream.close();
+ }
+ catch (IOException ex)
+ {
+ Logger.getLogger(OfficeDocumentReportTarget.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ }
+ }
+ }
+
public void endReport(final ReportStructureRoot report)
throws DataSourceException, ReportProcessingException
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java
index f76d43bb807a..2013b1c492ff 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java
@@ -261,26 +261,6 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget
throws DataSourceException, ReportProcessingException
{
super.endReport(report);
- try
- {
- // now copy the meta.xml
- if (getInputRepository().isReadable("meta.xml"))
- {
- final InputStream inputStream = getInputRepository().createInputStream("meta.xml");
- try
- {
- final OutputStream outputMetaStream = getOutputRepository().createOutputStream("meta.xml", "text/xml");
- IOUtils.getInstance().copyStreams(inputStream, outputMetaStream);
- outputMetaStream.close();
- } finally
- {
- inputStream.close();
- }
- }
- }
- catch (IOException ioe)
- {
- throw new ReportProcessingException("Failed to write settings document", ioe);
- }
+ copyMeta();
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
index d2c4ebd96e3c..baa43e687ccb 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
@@ -845,6 +845,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
setElementBoundaryCollectionPass(false);
resetTableCounter();
columnCounter = 0;
+ copyMeta();
}
private boolean isElementBoundaryCollectionPass()
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
index 9f3746086b87..a66f3e8b6c4d 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
@@ -26,6 +26,7 @@
************************************************************************/
package com.sun.star.report.pentaho.output.text;
+
import com.sun.star.report.DataSourceFactory;
import com.sun.star.report.ImageService;
import com.sun.star.report.InputRepository;
@@ -45,7 +46,7 @@ import com.sun.star.report.pentaho.output.StyleUtilities;
import com.sun.star.report.pentaho.styles.LengthCalculator;
import java.io.IOException;
-import java.io.InputStream;
+
import java.io.OutputStream;
import java.io.OutputStreamWriter;
@@ -53,6 +54,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
+
import org.jfree.layouting.input.style.values.CSSNumericValue;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataSourceException;
@@ -67,7 +69,6 @@ import org.jfree.report.util.AttributeNameGenerator;
import org.jfree.report.util.IntegerCache;
import org.pentaho.reporting.libraries.base.util.FastStack;
-import org.pentaho.reporting.libraries.base.util.IOUtils;
import org.pentaho.reporting.libraries.base.util.ObjectUtilities;
import org.pentaho.reporting.libraries.resourceloader.ResourceKey;
import org.pentaho.reporting.libraries.resourceloader.ResourceManager;
@@ -1270,7 +1271,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget
rootAttributes.addNamespaceDeclaration("config", OfficeNamespaces.CONFIG);
rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS);
rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version",
- OfficeDocumentReportTarget.ODF_VERSION);
+ OfficeDocumentReportTarget.ODF_VERSION);
final OutputStream outputStream = getOutputRepository().createOutputStream("settings.xml", "text/xml");
final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), createTagDescription());
xmlWriter.setAlwaysAddNamespace(true);
@@ -1291,20 +1292,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget
xmlWriter.writeCloseTag();
xmlWriter.close();
- // now copy the meta.xml
- if (getInputRepository().isReadable("meta.xml"))
- {
- final InputStream inputStream = getInputRepository().createInputStream("meta.xml");
- try
- {
- final OutputStream outputMetaStream = getOutputRepository().createOutputStream("meta.xml", "text/xml");
- IOUtils.getInstance().copyStreams(inputStream, outputMetaStream);
- outputMetaStream.close();
- } finally
- {
- inputStream.close();
- }
- }
+ copyMeta();
}
catch (IOException ioe)
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xml b/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xml
index 11ca5fcd8ae4..fa350df051ce 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xml
+++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xml
@@ -27,142 +27,746 @@
-->
<style-mapper-definition
xmlns="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper">
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="p"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- attribute-name="style-name"
- style-family="paragraph"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="p"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- attribute-name="class-names"
- style-family="paragraph"
- type="styleNameRefs"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="list"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- attribute-name="style-name"
- style-family="paragraph"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="section"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="a"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="text"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="alphabetical-index"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="alphabetical-index-entry-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="bibliography"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="bibliography-entry-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="h"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="illustration-index"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="illustration-index-entry-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-bibliography"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-chapter"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-link-end"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-link-start"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-page-number"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-span"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-tab-stop"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-entry-text"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-source-style"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-title"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="index-title-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="linenumbering-configuration"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="text"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="list"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="list"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="list-level-style-bullet"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="text"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="list-level-style-number"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="numbered-paragraph"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="list"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="object-index"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
attribute-name="style-name"
style-family="section"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="span"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- attribute-name="style-name"
- style-family="text"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="span"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- attribute-name="class-names"
- style-family="text"
- type="styleNameRefs"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="ruby"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- attribute-name="style-name"
- style-family="ruby"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- element-name="ruby-text"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
- attribute-name="style-name"
- style-family="paragraph"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- element-name="table"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- attribute-name="style-name"
- style-family="table"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- element-name="table-column"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- attribute-name="style-name"
- style-family="table-column"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- element-name="table-row"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- attribute-name="style-name"
- style-family="table-row"
- type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
- element-name="table-cell"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="object-index-entry-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="outline-level-style"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="character"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="p"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="p"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="class-names"
+ style-family="paragraph"
+ type="styleNameRefs"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="ruby"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="ruby"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="ruby-text"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="section"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="span"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="text"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="span"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="class-names"
+ style-family="text"
+ type="styleNameRefs"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="table-index"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="table-index-entry-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="table-of-content"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="table-of-content-entry-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="user-index"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="user-index-entry-template"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="background"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="body"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="covered-table-cell"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="even-columns"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="even-rows"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="first-column"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="first-row"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="last-column"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="last-row"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="odd-columns"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="odd-rows"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table-cell"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table-column"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-column"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table-row"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-row"
+ type="styleNameRef"/>
+
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="cube"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="extrude"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="rotate"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="scene"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="sphere"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="caption"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="circle"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="connector"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="control"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="custom-shape"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="ellipse"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="frame"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="g"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="line"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="measure"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="page"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="page-thumbnail"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="path"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
attribute-name="style-name"
- style-family="table-cell"
+ style-family="graphic"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
- element-name="custom-shape"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="polygon"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="polyline"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="rect"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
attribute-name="style-name"
style-family="graphic"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
- element-name="frame"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="regular-polygon"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+ element-name="annotation"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ element-name="notes"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
attribute-name="style-name"
style-family="graphic"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="chart"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ element-name="handout-master"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ element-name="master-page"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="cube"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="extrude"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="rotate"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="scene"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ element-name="sphere"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="caption"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="circle"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="connector"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="custom-shape"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="ellipse"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="frame"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="g"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="line"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="measure"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="page-thumbnail"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="path"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
attribute-name="style-name"
- style-family="chart"
+ style-family="presentation"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="title"
- attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="polygon"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="polyline"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="rect"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
attribute-name="style-name"
- style-family="chart"
+ style-family="presentation"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="regular-polygon"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+ element-name="annotation"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ attribute-name="style-name"
+ style-family="presentation"
+ type="styleNameRef"/>
+
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
element-name="axis"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
attribute-name="style-name"
style-family="chart"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="series"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="chart"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
attribute-name="style-name"
style-family="chart"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="wall"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="data-label"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
attribute-name="style-name"
style-family="chart"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="floor"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="data-point"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
attribute-name="style-name"
style-family="chart"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="legend"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="equation"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
attribute-name="style-name"
style-family="chart"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="plot-area"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="error-indicator"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
attribute-name="style-name"
style-family="chart"
type="styleNameRef"/>
- <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
- element-name="grid"
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="floor"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="footer"
attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
attribute-name="style-name"
style-family="chart"
type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="grid"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="legend"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="mean-value"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="plot-area"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="regression-curve"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="series"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="stock-gain-marker"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="stock-loss-marker"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="stock-range-line"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="subtitle"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="title"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ element-name="wall"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ attribute-name="style-name"
+ style-family="chart"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ element-name="drop-cap"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ attribute-name="style-name"
+ style-family="text"
+ type="styleNameRef"/>
</style-mapper-definition>
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index d932110bc5f3..68a16e609b77 100644..100755
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -29,25 +29,36 @@
#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 "ReportHelperDefines.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+#include <com/sun/star/frame/XModule.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/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/report/XReportDefinition.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>
+/** === end UNO includes === **/
+
#include <comphelper/embeddedobjectcontainer.hxx>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/propertysetmixin.hxx>
#include <svx/unomod.hxx>
-#include "ReportHelperDefines.hxx"
+#if !defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13
+#include <comphelper/implbase_var.hxx>
+#endif
+
#include <boost/shared_ptr.hpp>
@@ -62,32 +73,37 @@ namespace comphelper
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;
+ typedef ::comphelper::WeakComponentImplHelper13 < ::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
+ , ::com::sun::star::document::XUndoManagerSupplier
+ , 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
+ class REPORTDESIGN_DLLPUBLIC OReportDefinition :public ::cppu::BaseMutex
+ ,public ReportDefinitionBase
+ ,public ReportDefinitionPropertySet
+ ,public ::comphelper::IEmbeddedHelper
{
+ private:
::boost::shared_ptr<OReportComponentProperties> m_aProps;
::boost::shared_ptr<OReportDefinitionImpl> m_pImpl;
+
private:
OReportDefinition(const OReportDefinition&);
OReportDefinition& operator=(const OReportDefinition&);
@@ -380,6 +396,9 @@ namespace reportdesign
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);
+ // XUndoManagerSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ) 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;
diff --git a/reportdesign/inc/RptModel.hxx b/reportdesign/inc/RptModel.hxx
index 872938426259..da0b92186ace 100644
--- a/reportdesign/inc/RptModel.hxx
+++ b/reportdesign/inc/RptModel.hxx
@@ -35,7 +35,7 @@
class Window;
namespace dbaui
{
- class OSingleDocumentController;
+ class DBSubComponentController;
}
namespace reportdesign
{
@@ -56,7 +56,7 @@ class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
private:
OXUndoEnvironment* m_pUndoEnv;
- ::dbaui::OSingleDocumentController* m_pController;
+ ::dbaui::DBSubComponentController* m_pController;
::reportdesign::OReportDefinition* m_pReportDefinition;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
@@ -79,8 +79,8 @@ public:
OXUndoEnvironment& GetUndoEnv();
void SetModified(sal_Bool _bModified);
- inline dbaui::OSingleDocumentController* getController() const { return m_pController; }
- inline void attachController( dbaui::OSingleDocumentController& _rController ) { m_pController = &_rController; }
+ inline dbaui::DBSubComponentController* getController() const { return m_pController; }
+ inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
void detachController();
OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
index 180fa616cf39..cda3a2d6b4a2 100644
--- a/reportdesign/inc/UndoActions.hxx
+++ b/reportdesign/inc/UndoActions.hxx
@@ -28,8 +28,9 @@
#define RPTUI_UNDOACTIONS_HXX
#include "dllapi.h"
-#include <svx/svdundo.hxx>
-#include <tools/string.hxx>
+
+#include "RptModel.hxx"
+
/** === begin UNO includes === **/
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -43,13 +44,16 @@
#include <com/sun/star/report/XReportComponent.hpp>
#include <com/sun/star/report/XReportDefinition.hpp>
#include <com/sun/star/report/XGroup.hpp>
+#include <com/sun/star/document/XUndoManager.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 <svx/svdundo.hxx>
+#include <tools/string.hxx>
#include <functional>
#include <memory>
@@ -119,23 +123,51 @@ namespace rptui
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
+ //==================================================================================================================
+ //= UndoContext
+ //==================================================================================================================
+ class UndoContext
{
+ public:
+ UndoContext( SfxUndoManager& i_undoManager, const ::rtl::OUString& i_undoTitle )
+ :m_rUndoManager( i_undoManager )
+ {
+ m_rUndoManager.EnterListAction( i_undoTitle, String() );
+ }
+
+ ~UndoContext()
+ {
+ m_rUndoManager.LeaveListAction();
+ }
+
private:
- SfxUndoManager& m_rManager;
+ SfxUndoManager& m_rUndoManager;
+ };
+ //==================================================================================================================
+ //= UndoSuppressor
+ //==================================================================================================================
+ class UndoSuppressor
+ {
public:
- UndoManagerListAction( SfxUndoManager& _rManager, const String& _rListActionComment )
- :m_rManager( _rManager )
+ UndoSuppressor( SfxUndoManager& i_undoManager )
+ :m_rUndoManager( i_undoManager )
{
- m_rManager.EnterListAction( _rListActionComment, String() );
+ m_rUndoManager.EnableUndo( false );
}
- ~UndoManagerListAction()
+
+ ~UndoSuppressor()
{
- m_rManager.LeaveListAction();
+ m_rUndoManager.EnableUndo( true );
}
+
+ private:
+ SfxUndoManager& m_rUndoManager;
};
+ //==================================================================================================================
+ //= OCommentUndoAction
+ //==================================================================================================================
class REPORTDESIGN_DLLPUBLIC OCommentUndoAction : public SdrUndoAction
{
protected:
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 2cf848dc0c84..6b8414ad60a3 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -24,18 +24,66 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#include "ReportDefinition.hxx"
+
+#include "FixedLine.hxx"
+#include "FixedText.hxx"
+#include "FormattedField.hxx"
+#include "Functions.hxx"
+#include "Groups.hxx"
+#include "ImageControl.hxx"
+#include "ReportComponent.hxx"
+#include "ReportHelperImpl.hxx"
+#include "RptDef.hxx"
+#include "RptModel.hxx"
+#include "Section.hxx"
+#include "Shape.hxx"
+#include "Tools.hxx"
+#include "UndoEnv.hxx"
+#include "core_resource.hrc"
+#include "core_resource.hxx"
+#include "corestrings.hrc"
+
+/** === begin UNO includes === **/
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
+#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
+#include <com/sun/star/document/EventObject.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/embed/Aspects.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/XEmbedPersist.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.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/sdb/XOfficeDatabaseDocument.hpp>
+#include <com/sun/star/style/GraphicLocation.hpp>
+#include <com/sun/star/style/NumberingType.hpp>
+#include <com/sun/star/style/PageStyleLayout.hpp>
+#include <com/sun/star/style/XStyle.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/task/ErrorCodeIOException.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/xml/AttributeData.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+/** === end UNO includes === **/
+
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/documentconstants.hxx>
#include <comphelper/genericpropertyset.hxx>
@@ -44,83 +92,41 @@
#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/propertystatecontainer.hxx>
#include <comphelper/seqstream.hxx>
+#include <comphelper/sequence.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 <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <dbaccess/dbaundomanager.hxx>
#include <editeng/paperinf.hxx>
+#include <framework/titlehelper.hxx>
+#include <osl/thread.hxx>
+#include <svl/itempool.hxx>
+#include <svl/undo.hxx>
#include <svx/svdlayer.hxx>
+#include <svx/unofill.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>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <unotools/moduleoptions.hxx>
+#include <unotools/saveopt.hxx>
+#include <unotools/streamwrap.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/virdev.hxx>
+#include <vos/mutex.hxx>
+
+#include <boost/bind.hpp>
+#include <boost/mem_fn.hpp>
+#include <boost/utility.hpp>
#define MAP_LEN(x) x, sizeof(x) - 1
#define MAP_CHAR_LEN(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(x))
@@ -607,6 +613,7 @@ struct OReportDefinitionImpl
::boost::shared_ptr< ::comphelper::EmbeddedObjectContainer>
m_pObjectContainer;
::boost::shared_ptr<rptui::OReportModel> m_pReportModel;
+ ::rtl::Reference< ::dbaui::UndoManager > m_pUndoManager;
::rtl::OUString m_sCaption;
::rtl::OUString m_sCommand;
::rtl::OUString m_sFilter;
@@ -623,6 +630,7 @@ struct OReportDefinitionImpl
sal_Bool m_bModified;
sal_Bool m_bEscapeProcessing;
sal_Bool m_bSetModifiedEnabled;
+
OReportDefinitionImpl(::osl::Mutex& _aMutex)
:m_aStorageChangeListeners(_aMutex)
,m_aCloseListener(_aMutex)
@@ -746,7 +754,6 @@ OReportDefinition::~OReportDefinition()
}
// -----------------------------------------------------------------------------
IMPLEMENT_FORWARD_REFCOUNT( OReportDefinition, ReportDefinitionBase )
-//IMPLEMENT_FORWARD_XINTERFACE2(OReportDefinition,ReportDefinitionBase,ReportDefinitionPropertySet)
void OReportDefinition::init()
{
try
@@ -764,7 +771,7 @@ void OReportDefinition::init()
pCreatorThread->createSuspended();
pCreatorThread->setPriority(osl_Thread_PriorityBelowNormal);
pCreatorThread->resume();
- } // for ( ; pIter != pEnd; ++pIter )
+ }
}
m_pImpl->m_pReportModel.reset(new OReportModel(this));
@@ -775,6 +782,9 @@ void OReportDefinition::init()
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_pUndoManager = new ::dbaui::UndoManager( *this, m_aMutex );
+ m_pImpl->m_pReportModel->SetSdrUndoManager( &m_pImpl->m_pUndoManager->GetSfxUndoManager() );
+
m_pImpl->m_xFunctions = new OFunctions(this,m_aProps->m_xContext);
if ( !m_pImpl->m_xStorage.is() )
m_pImpl->m_xStorage = ::comphelper::OStorageHelper::GetTemporaryStorage();
@@ -789,9 +799,9 @@ void OReportDefinition::init()
}
m_pImpl->m_pObjectContainer.reset( new comphelper::EmbeddedObjectContainer(m_pImpl->m_xStorage , static_cast<cppu::OWeakObject*>(this) ) );
}
- catch(uno::Exception)
+ catch ( const uno::Exception& )
{
- OSL_ENSURE(0,"Error!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
// -----------------------------------------------------------------------------
@@ -1296,10 +1306,21 @@ void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (u
::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
::osl::MutexGuard aGuard(m_aMutex);
- ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
::comphelper::MediaDescriptor aDescriptor( _aArguments );
- fillArgs(aDescriptor);
- m_pImpl->m_pReportModel->SetModified(sal_False);
+
+ m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( false );
+ try
+ {
+ fillArgs(aDescriptor);
+ m_pImpl->m_pReportModel->SetModified(sal_False);
+ }
+ catch ( ... )
+ {
+ m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true );
+ throw;
+ }
+ m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true );
return sal_True;
}
// -----------------------------------------------------------------------------
@@ -1842,7 +1863,6 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue
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
@@ -2931,8 +2951,15 @@ uno::Sequence< datatransfer::DataFlavor > SAL_CALL OReportDefinition::getTransfe
{
return aFlavor.MimeType.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")));
}
+
// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
+uno::Reference< document::XUndoManager > SAL_CALL OReportDefinition::getUndoManager( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_pImpl->m_pUndoManager.get();
+}
+
+
// =============================================================================
}// namespace reportdesign
// =============================================================================
diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx
index 7327456c7940..05b9d8d39499 100644
--- a/reportdesign/source/core/sdr/RptModel.cxx
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -28,7 +28,7 @@
#include "RptModel.hxx"
#include "RptPage.hxx"
-#include <dbaccess/singledoccontroller.hxx>
+#include <dbaccess/dbsubcomponentcontroller.hxx>
#include <tools/debug.hxx>
#include <unotools/pathoptions.hxx>
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 7d1cdbc6db30..4b3db47c4078 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -37,7 +37,7 @@
#include <toolkit/helper/convert.hxx>
#include "RptPage.hxx"
#include "corestrings.hrc"
-#include <dbaccess/singledoccontroller.hxx>
+#include <dbaccess/dbsubcomponentcontroller.hxx>
#include "ModuleHelper.hxx"
#include <RptResId.hrc>
diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx
index d58fe62e974d..6ebebd30a61a 100644
--- a/reportdesign/source/core/sdr/UndoActions.cxx
+++ b/reportdesign/source/core/sdr/UndoActions.cxx
@@ -52,7 +52,7 @@
#include <tools/diagnose_ex.h>
#include <comphelper/stl_types.hxx>
#include <vcl/svapp.hxx>
-#include <dbaccess/singledoccontroller.hxx>
+#include <dbaccess/dbsubcomponentcontroller.hxx>
#include <svx/unoshape.hxx>
#include <vos/mutex.hxx>
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index f4dd0a7f8645..091dad4b8ad4 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -54,7 +54,7 @@
#include <comphelper/stl_types.hxx>
#include <comphelper/componentcontext.hxx>
#include <vcl/svapp.hxx>
-#include <dbaccess/singledoccontroller.hxx>
+#include <dbaccess/dbsubcomponentcontroller.hxx>
#include <svx/unoshape.hxx>
#include <vos/mutex.hxx>
@@ -262,7 +262,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv
if (!xSet.is())
return;
- dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController();
+ dbaui::DBSubComponentController* pController = m_pImpl->m_rModel.getController();
if ( !pController )
return;
@@ -380,7 +380,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv
if ( pUndo == NULL )
pUndo = new ORptUndoPropertyAction( m_pImpl->m_rModel, _rEvent );
- pController->addUndoActionAndInvalidate(pUndo);
+ m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( pUndo );
pController->InvalidateAll();
}
// -----------------------------------------------------------------------------
@@ -439,12 +439,9 @@ void SAL_CALL OXUndoEnvironment::elementInserted(const ContainerEvent& evt) thro
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));
+ m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction(
+ new OUndoContainerAction( m_pImpl->m_rModel, rptui::Inserted, xContainer.get(),
+ xIface, RID_STR_UNDO_ADDFUNCTION ) );
}
}
}
@@ -510,12 +507,8 @@ void SAL_CALL OXUndoEnvironment::elementRemoved(const ContainerEvent& evt) throw
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));
+ m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( new OUndoContainerAction(
+ m_pImpl->m_rModel, rptui::Removed, xFunctions.get(), xIface, RID_STR_UNDO_ADDFUNCTION ) );
}
}
}
diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx
index e4817bbe9f44..f5fba8129d54 100644
--- a/reportdesign/source/core/sdr/formatnormalizer.cxx
+++ b/reportdesign/source/core/sdr/formatnormalizer.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/util/XNumberFormatTypes.hpp>
/** === end UNO includes === **/
-#include <dbaccess/singledoccontroller.hxx>
+#include <dbaccess/dbsubcomponentcontroller.hxx>
#include <unotools/syslocale.hxx>
#include <connectivity/statementcomposer.hxx>
#include <connectivity/dbtools.hxx>
@@ -186,7 +186,7 @@ namespace rptui
if ( !m_xReportDefinition.is() )
return false;
- ::dbaui::OSingleDocumentController* pController( m_rModel.getController() );
+ ::dbaui::DBSubComponentController* pController( m_rModel.getController() );
OSL_ENSURE( pController, "FormatNormalizer::impl_ensureUpToDateFieldList_nothrow: no controller? how can *this* happen?!" );
if ( !pController )
return false;
diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx
index d3617749d10b..3bf5cc9c37da 100644
--- a/reportdesign/source/ui/dlg/CondFormat.cxx
+++ b/reportdesign/source/ui/dlg/CondFormat.cxx
@@ -465,8 +465,8 @@ namespace rptui
short nRet = ModalDialog::Execute();
if ( nRet == RET_OK )
{
- String sUndoAction( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) );
- UndoManagerListAction aListAction(*m_rController.getUndoMgr(),sUndoAction);
+ const String sUndoAction( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) );
+ const UndoContext aUndoContext( m_rController.getUndoManager(), sUndoAction );
try
{
sal_Int32 j(0), i(0);;
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index d4ea5fa17a48..b471d271b867 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -316,8 +316,8 @@ void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups
m_bIgnoreEvent = true;
{
sal_Int32 nRow = _nRow;
- String sUndoAction(ModuleRes(RID_STR_UNDO_MOVE_GROUP));
- UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction);
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_MOVE_GROUP));
+ const UndoContext aUndoContext( m_pParent->m_pController->getUndoManager(), sUndoAction );
uno::Reference< report::XGroups> xGroups = m_pParent->getGroups();
const uno::Any* pIter = _aGroups.getConstArray();
@@ -455,7 +455,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow)
{
bAppend = sal_True;
String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
- m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+ m_pParent->m_pController->getUndoManager().EnterListAction( sUndoAction, String() );
xGroup = m_pParent->getGroups()->createGroup();
xGroup->setHeaderOn(sal_True);
@@ -499,7 +499,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow)
::rptui::adjustSectionName(xGroup,nPos);
if ( bAppend )
- m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+ m_pParent->m_pController->getUndoManager().LeaveListAction();
}
if ( Controller() )
@@ -824,7 +824,7 @@ void OFieldExpressionControl::DeleteRows()
{
bFirstTime = false;
String sUndoAction(ModuleRes(RID_STR_UNDO_REMOVE_SELECTION));
- m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+ m_pParent->m_pController->getUndoManager().EnterListAction( sUndoAction, String() );
}
sal_Int32 nGroupPos = m_aGroupPositions[nIndex];
@@ -844,7 +844,7 @@ void OFieldExpressionControl::DeleteRows()
} // while( nIndex >= 0 )
if ( !bFirstTime )
- m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+ m_pParent->m_pController->getUndoManager().LeaveListAction();
m_nDataPos = GetCurRow();
InvalidateStatusCell( nOldDataPos );
@@ -930,8 +930,8 @@ void OFieldExpressionControl::InsertRows( long nRow )
{
m_bIgnoreEvent = false;
{
- String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
- UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction);
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
+ const UndoContext aUndoContext( m_pParent->m_pController->getUndoManager(), sUndoAction );
uno::Reference<report::XGroups> xGroups = m_pParent->getGroups();
sal_Int32 nGroupPos = 0;
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index af61f3b6d514..506fa4abd90b 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -31,7 +31,7 @@
#include "uistrings.hrc"
#include "ReportController.hxx"
#include "UITools.hxx"
-#include "Undo.hxx"
+#include "RptUndo.hxx"
#include "reportformula.hxx"
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/report/XReportDefinition.hpp>
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index 6694c81c999b..5777635cc476 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -27,48 +27,52 @@
#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 "DesignView.hxx"
+#include "ModuleHelper.hxx"
+#include "ReportControllerObserver.hxx"
+#include "RptDef.hxx"
+
+/** === begin UNO includes === **/
#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/beans/XPropertySet.hpp>
+#include <com/sun/star/embed/XVisualObject.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/io/XObjectInputStream.hpp>
+#include <com/sun/star/io/XObjectOutputStream.hpp>
#include <com/sun/star/report/XReportControlModel.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
#include <com/sun/star/report/XReportEngine.hpp>
#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XModeSelector.hpp>
+#include <com/sun/star/util/XNumberFormatter.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"
+/** === end UNO includes === **/
-#include <comphelper/uno3.hxx>
#include <comphelper/implementationreference.hxx>
#include <comphelper/proparrhlp.hxx>
#include <comphelper/propertystatecontainer.hxx>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/implbase5.hxx>
+#include <dbaccess/dbsubcomponentcontroller.hxx>
+#include <svl/lstner.hxx>
+#include <svtools/transfer.hxx>
+#include <svx/svdedtv.hxx>
+#include <svx/zoomitem.hxx>
-#include "RptDef.hxx"
-#include "DesignView.hxx"
-#include <functional>
+#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
-#include <com/sun/star/util/XModeSelector.hpp>
-#include "ReportControllerObserver.hxx"
+#include <functional>
class TransferableHelper;
class TransferableClipboardListener;
class VclWindowEvent;
+class SfxUndoManager;
namespace rptui
{
class OGroupsSortingDialog;
@@ -78,7 +82,7 @@ namespace rptui
class OAddFieldWindow;
class OSectionWindow;
- typedef ::dbaui::OSingleDocumentController OReportController_BASE;
+ typedef ::dbaui::DBSubComponentController OReportController_BASE;
typedef ::cppu::ImplHelper5 < ::com::sun::star::container::XContainerListener
, ::com::sun::star::beans::XPropertyChangeListener
, ::com::sun::star::view::XSelectionSupplier
@@ -91,6 +95,7 @@ namespace rptui
,public SfxListener
,public ::comphelper::OPropertyStateContainer
,public ::comphelper::OPropertyArrayUsageHelper < OReportController_BASE >
+ ,public ::boost::noncopyable
{
private:
OModuleClient m_aModuleClient;
@@ -107,9 +112,9 @@ namespace rptui
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::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;
@@ -215,15 +220,20 @@ namespace rptui
void executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun);
void alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false);
+
+ // open the help agent of report designer at start time
+ void doOpenHelpAgent();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame();
+
/** 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:
+ 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
@@ -292,14 +302,11 @@ namespace rptui
*/
void impl_zoom_nothrow();
- private:
- OReportController(OReportController const&);
- OReportController& operator =(OReportController const&);
- public:
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame();
+ virtual void impl_onModifyChanged();
- // open the help agent of report designer at start time
- void doOpenHelpAgent();
+ virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager );
+ virtual void impl_initialize( );
+ bool isUiVisible() const;
/** 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.
@@ -333,16 +340,15 @@ namespace rptui
// 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);
+ private:
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*);
@@ -352,12 +358,6 @@ namespace rptui
// 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
@@ -455,7 +455,7 @@ namespace rptui
*
* \return
*/
- ::boost::shared_ptr<rptui::OReportModel> getSdrModel();
+ ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const;
inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; }
inline sal_Int16 getZoomValue() const { return m_nZoomValue; }
@@ -477,10 +477,9 @@ namespace rptui
::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;
+ SfxUndoManager& getUndoManager() const;
+ void clearUndoManager() const;
+ void addUndoAction( SfxUndoAction* i_pAction );
};
}
#endif // RPTUI_REPORTCONTROLLER_HXX
diff --git a/reportdesign/source/ui/inc/Undo.hxx b/reportdesign/source/ui/inc/RptUndo.hxx
index 479872b06573..479872b06573 100644
--- a/reportdesign/source/ui/inc/Undo.hxx
+++ b/reportdesign/source/ui/inc/RptUndo.hxx
diff --git a/reportdesign/source/ui/misc/Undo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx
index d944dc2aee20..312946139a0a 100644
--- a/reportdesign/source/ui/misc/Undo.cxx
+++ b/reportdesign/source/ui/misc/RptUndo.cxx
@@ -26,21 +26,16 @@
************************************************************************/
#include "precompiled_reportdesign.hxx"
-#include "Undo.hxx"
-#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "RptUndo.hxx"
#include "uistrings.hrc"
-#endif
-#ifndef _RPTUI_SLOTID_HRC_
#include "rptui_slotid.hrc"
-#endif
-#ifndef RPTUI_TOOLS_HXX
#include "UITools.hxx"
-#endif
+#include "UndoEnv.hxx"
+
#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>
diff --git a/reportdesign/source/ui/misc/makefile.mk b/reportdesign/source/ui/misc/makefile.mk
index b12bafdc7760..494b68023d62 100644
--- a/reportdesign/source/ui/misc/makefile.mk
+++ b/reportdesign/source/ui/misc/makefile.mk
@@ -44,7 +44,7 @@ VISIBILITY_HIDDEN=TRUE
# ... object files ............................
EXCEPTIONSFILES= \
- $(SLO)$/Undo.obj \
+ $(SLO)$/RptUndo.obj \
$(SLO)$/ColorListener.obj \
$(SLO)$/UITools.obj \
$(SLO)$/rptuiservices.obj \
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index 339e136c2fec..8f703ab57f4f 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -248,7 +248,12 @@ long ODesignView::PreNotify( NotifyEvent& rNEvt )
switch(rNEvt.GetType())
{
case EVENT_KEYINPUT:
- //if ( nRet != 1L )
+ if ( (m_pPropWin && m_pPropWin->HasChildPathFocus()) )
+ return 0L;
+ if ( (m_pAddField && m_pAddField->HasChildPathFocus()) )
+ return 0L;
+ if ( (m_pReportExplorer && m_pReportExplorer->HasChildPathFocus()) )
+ return 0L;
{
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
if ( handleKeyEvent(*pKeyEvent) )
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 4ed0e3cd2842..fc0a01dd715c 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -99,6 +99,7 @@
#include <com/sun/star/sdb/SQLContext.hpp>
#include <com/sun/star/sdbc/SQLWarning.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
@@ -117,7 +118,7 @@
#include <svx/zoomitem.hxx>
#include <svx/zoomslideritem.hxx>
#include <editeng/brshitem.hxx>
-#include <svx/flagsdef.hxx> //CHINA001
+#include <svx/flagsdef.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svxdlg.hxx>
#include <svx/zoom_def.hxx>
@@ -126,7 +127,7 @@
#include "DesignView.hxx"
#include "ModuleHelper.hxx"
#include "RptObject.hxx"
-#include "Undo.hxx"
+#include "RptUndo.hxx"
#include "uistrings.hrc"
#include "RptDef.hxx"
#include "ReportSection.hxx"
@@ -137,7 +138,7 @@
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
-#include <svl/aeitem.hxx> //CHINA001
+#include <svl/aeitem.hxx>
#include <svtools/cliplistener.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/viewoptions.hxx>
@@ -152,10 +153,12 @@
#include <toolkit/helper/vclunohelper.hxx>
#include "UndoEnv.hxx"
#include "InsertFunctions.hxx"
+#include "ReportControllerObserver.hxx"
#include <boost/mem_fn.hpp>
#include <boost/bind.hpp>
#include <boost/utility.hpp>
+#include <boost/scoped_ptr.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <unotools/confignode.hxx>
@@ -163,7 +166,7 @@
#include <ReportControllerObserver.hxx>
-#define MAX_ROWS_FOR_PREVIEW 50
+#define MAX_ROWS_FOR_PREVIEW 20
using namespace ::com::sun::star;
using namespace uno;
@@ -245,14 +248,16 @@ void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs,
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);
@@ -372,14 +377,15 @@ void OReportController::disposing()
pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow )
pSectionWindow->getReportSection().deactivateOle();
- getUndoMgr()->Clear(); // clear all undo redo things
+ clearUndoManager();
if ( m_aReportModel )
listen(false);
m_pReportControllerObserver->Clear();
m_pReportControllerObserver->release();
}
- catch(uno::Exception&)
+ catch ( const uno::Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -391,7 +397,6 @@ void OReportController::disposing()
OReportController_BASE::disposing();
- // disconnect();
try
{
m_xReportDefinition.clear();
@@ -457,8 +462,20 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
break;
case SID_REDO:
case SID_UNDO:
- aReturn = OReportController_BASE::GetState(_nId);
- aReturn.bEnabled = aReturn.bEnabled;
+ {
+ size_t ( SfxUndoManager::*retrieveCount )( bool const ) const =
+ ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionCount : &SfxUndoManager::GetRedoActionCount;
+
+ SfxUndoManager& rUndoManager( getUndoManager() );
+ aReturn.bEnabled = ( rUndoManager.*retrieveCount )( ::svl::IUndoManager::TopLevel ) > 0;
+ if ( aReturn.bEnabled )
+ {
+ // TODO: add "Undo/Redo: prefix"
+ String ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const =
+ ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment;
+ aReturn.sTitle = (rUndoManager.*retrieveComment)( 0, ::svl::IUndoManager::TopLevel );
+ }
+ }
break;
case SID_OBJECT_RESIZING:
case SID_OBJECT_SMALLESTWIDTH:
@@ -563,7 +580,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_EXPAND_SECTION:
case SID_NEXT_MARK:
case SID_PREV_MARK:
- aReturn.bEnabled = isEditable();
+ aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent(_nId);
break;
case SID_SELECT:
case SID_SELECT_REPORT:
@@ -1024,10 +1041,12 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
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 );
+ BOOL ( SfxUndoManager::*doXDo )() =
+ ( _nId == SID_UNDO ) ? &SfxUndoManager::Undo : &SfxUndoManager::Redo;
+
+ SfxUndoManager& rUndoManager( getUndoManager() );
+ (rUndoManager.*doXDo)();
InvalidateAll();
updateFloater();
}
@@ -1165,7 +1184,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
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);
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
xFunctions->removeByIndex(nIndex);
select(uno::makeAny(xFunctions->getParent()));
InvalidateFeature( SID_SAVEDOC );
@@ -1192,14 +1211,6 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
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);
@@ -1452,19 +1463,16 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
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;
+
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT));
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
+
::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);
}
@@ -1528,32 +1536,37 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
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)
+
+ if ( !aControlsFormats.empty() )
{
- uno::Reference< report::XReportControlFormat > xFormat(*aIter,uno::UNO_QUERY);
- if ( xFormat.is() )
+ const String sUndoAction( ModuleRes( RID_STR_UNDO_CHANGEFONT ) );
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
+
+ ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin();
+ for(; aIter != aControlsFormats.end();++aIter)
{
- if ( !pListAction.get() )
+ uno::Reference< report::XReportControlFormat > xFormat( *aIter, uno::UNO_QUERY );
+ if ( !xFormat.is() )
+ continue;
+
+ if ( aSettings.getLength() == 0 )
{
- const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT));
- pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction));
- rptui::openCharDialog(xFormat,xWindow,aSettings);
- } // if ( !pListAction.get() )
+ ::rptui::openCharDialog( xFormat, xWindow, aSettings );
+ if ( aSettings.getLength() == 0 )
+ break;
+ }
+
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;
@@ -1674,10 +1687,14 @@ void OReportController::impl_initialize( )
{
//m_sName = m_xReportDefinition->getName();
getView()->initialize(); // show the windows and fill with our informations
- getUndoMgr()->Clear(); // clear all undo redo things
- getSdrModel();
+
+ m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition);
if ( !m_aReportModel )
- throw Exception();
+ throw RuntimeException();
+ m_aReportModel->attachController( *this );
+
+ clearUndoManager();
+ UndoSuppressor aSuppressUndo( getUndoManager() );
::comphelper::NamedValueCollection aArgs(getModel()->getArgs());
setMode(aArgs.getOrDefault("Mode", rtl::OUString::createFromAscii("normal")));
@@ -1829,7 +1846,7 @@ sal_Bool SAL_CALL OReportController::suspend(sal_Bool /*_bSuspend*/) throw( Runt
// -----------------------------------------------------------------------------
void OReportController::describeSupportedFeatures()
{
- OSingleDocumentController::describeSupportedFeatures();
+ DBSubComponentController::describeSupportedFeatures();
implDescribeSupportedFeature( ".uno:TextDocument", SID_RPT_TEXTDOCUMENT, CommandGroup::APPLICATION );
implDescribeSupportedFeature( ".uno:Spreadsheet", SID_RPT_SPREADSHEET, CommandGroup::APPLICATION );
@@ -2092,18 +2109,13 @@ void OReportController::describeSupportedFeatures()
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();
+ DBSubComponentController::impl_onModifyChanged();
}
catch(uno::Exception)
{
@@ -2111,14 +2123,6 @@ void OReportController::impl_onModifyChanged()
}
}
// -----------------------------------------------------------------------------
-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() )
@@ -2305,6 +2309,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven
// -----------------------------------------------------------------------------
void SAL_CALL OReportController::disposing( const lang::EventObject& Source ) throw(uno::RuntimeException)
{
+ // simply disambiguate
OReportController_BASE::disposing(Source);
}
@@ -2376,13 +2381,6 @@ 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);
@@ -2483,7 +2481,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
{
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);
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
const SfxPoolItem* pItem = NULL;
if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_SIZE,sal_True,&pItem))
{
@@ -2534,13 +2532,24 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
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();
+
+ uno::Reference< report::XReportDefinition > xReportDefinition( xModel, UNO_QUERY );
+ if ( !xReportDefinition.is() )
+ return sal_False;
+
+ uno::Reference< document::XUndoManagerSupplier > xTestSuppUndo( xModel, UNO_QUERY );
+ if ( !xTestSuppUndo.is() )
+ return sal_False;
+
+ m_xReportDefinition = xReportDefinition;
+ return sal_True;
}
+
// -----------------------------------------------------------------------------
void OReportController::openSortingAndGroupingDialog()
{
@@ -2597,7 +2606,7 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi
void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun)
{
const String sUndoAction = String((ModuleRes(_nUndoStrId)));
- UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
_pMemfun( getDesignView() );
InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
@@ -2606,7 +2615,7 @@ void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::me
void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection)
{
const String sUndoAction = String((ModuleRes(_nUndoStrId)));
- UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection);
InvalidateFeature( SID_SAVEDOC );
InvalidateFeature( SID_UNDO );
@@ -2691,7 +2700,7 @@ void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference<report:
if ( _xSection.is() )
{
const String sUndoAction = String((ModuleRes(_nUndoStrId)));
- UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
if (_nSid == SID_SECTION_SHRINK)
{
@@ -3051,17 +3060,8 @@ void OReportController::insertGraphic()
}
}
// -----------------------------------------------------------------------------
-::boost::shared_ptr<rptui::OReportModel> OReportController::getSdrModel()
+::boost::shared_ptr<rptui::OReportModel> OReportController::getSdrModel() const
{
- 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;
}
// -----------------------------------------------------------------------------
@@ -3265,7 +3265,7 @@ void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs)
getDesignView()->unmarkAllObjects(NULL);
const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL));
- UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
SequenceAsHashMap aMap(_aArgs);
aMap.createItemIfMissing(PROPERTY_FORMATKEY,aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYDATE,sal_Int32(0)));
@@ -3293,7 +3293,7 @@ void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs
getDesignView()->unmarkAllObjects(NULL);
const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL));
- UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
if ( !m_xReportDefinition->getPageHeaderOn() )
{
@@ -3337,7 +3337,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
}
uno::Reference<report::XSection> xCurrentSection = getDesignView()->getCurrentSection();
- UndoManagerListAction aUndo( *getUndoMgr(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) );
+ UndoContext aUndoContext( getUndoManager(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) );
try
{
@@ -3805,19 +3805,21 @@ void OReportController::switchReportSection(const sal_Int16 _nId)
{
const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn();
+
+ ::boost::scoped_ptr< UndoContext > pUndoContext;
if ( SID_REPORTHEADERFOOTER == _nId )
{
const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
- getUndoMgr()->EnterListAction( sUndoAction, String() );
+ pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) );
- addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO
+ addUndoAction(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
+ addUndoAction(new OReportSectionUndo(*(m_aReportModel),SID_REPORTFOOTER_WITHOUT_UNDO
,::std::mem_fun(&OReportHelper::getReportFooter)
,m_xReportDefinition
,bSwitchOn ? Inserted : Removed
@@ -3840,7 +3842,7 @@ void OReportController::switchReportSection(const sal_Int16 _nId)
}
if ( SID_REPORTHEADERFOOTER == _nId )
- getUndoMgr()->LeaveListAction();
+ pUndoContext.reset();
getView()->Resize();
}
}
@@ -3853,12 +3855,13 @@ void OReportController::switchPageSection(const sal_Int16 _nId)
const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn();
+ ::boost::scoped_ptr< UndoContext > pUndoContext;
if ( SID_PAGEHEADERFOOTER == _nId )
{
const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
- getUndoMgr()->EnterListAction( sUndoAction, String() );
+ pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) );
- addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel
+ addUndoAction(new OReportSectionUndo(*m_aReportModel
,SID_PAGEHEADER_WITHOUT_UNDO
,::std::mem_fun(&OReportHelper::getPageHeader)
,m_xReportDefinition
@@ -3866,7 +3869,7 @@ void OReportController::switchPageSection(const sal_Int16 _nId)
,0
));
- addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel
+ addUndoAction(new OReportSectionUndo(*m_aReportModel
,SID_PAGEFOOTER_WITHOUT_UNDO
,::std::mem_fun(&OReportHelper::getPageFooter)
,m_xReportDefinition
@@ -3888,7 +3891,7 @@ void OReportController::switchPageSection(const sal_Int16 _nId)
break;
}
if ( SID_PAGEHEADERFOOTER == _nId )
- getUndoMgr()->LeaveListAction();
+ pUndoContext.reset();
getView()->Resize();
}
}
@@ -3914,7 +3917,7 @@ void OReportController::modifyGroup(const bool _bAppend, const Sequence< Propert
rUndoEnv.AddElement( xGroup->getFunctions() );
}
- addUndoActionAndInvalidate( new OGroupUndo(
+ addUndoAction( new OGroupUndo(
*m_aReportModel,
_bAppend ? RID_STR_UNDO_APPEND_GROUP : RID_STR_UNDO_REMOVE_GROUP,
_bAppend ? Inserted : Removed,
@@ -3948,7 +3951,7 @@ void OReportController::createGroupSection(const bool _bUndo,const bool _bHeader
{
const OXUndoEnvironment::OUndoEnvLock aLock(m_aReportModel->GetUndoEnv());
if ( _bUndo )
- addUndoActionAndInvalidate(new OGroupSectionUndo(*m_aReportModel
+ addUndoAction(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
@@ -4203,23 +4206,21 @@ sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const un
// -----------------------------------------------------------------------------
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();
+
+ const String sUndoAction = String( ModuleRes( _nUndoResId ) );
+ UndoContext aUndoContext( getUndoManager(), sUndoAction );
+
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();
}
// -----------------------------------------------------------------------------
@@ -4388,4 +4389,33 @@ uno::Reference< container::XNameAccess > OReportController::getColumns() const
}
return sLabel;
}
+
+// -----------------------------------------------------------------------------
+SfxUndoManager& OReportController::getUndoManager() const
+{
+ DBG_TESTSOLARMUTEX();
+ // this is expected to be called during UI actions, so the SM is assumed to be locked
+
+ ::boost::shared_ptr< OReportModel > pReportModel( getSdrModel() );
+ ENSURE_OR_THROW( !!pReportModel, "no access to our model" );
+
+ SfxUndoManager* pUndoManager( pReportModel->GetSdrUndoManager() );
+ ENSURE_OR_THROW( pUndoManager != NULL, "no access to our model's UndoManager" );
+
+ return *pUndoManager;
+}
+
+// -----------------------------------------------------------------------------
+void OReportController::clearUndoManager() const
+{
+ getUndoManager().Clear();
+}
+
// -----------------------------------------------------------------------------
+void OReportController::addUndoAction( SfxUndoAction* i_pAction )
+{
+ getUndoManager().AddUndoAction( i_pAction );
+
+ InvalidateFeature( SID_UNDO );
+ InvalidateFeature( SID_REDO );
+}
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 26ce8c13c2a6..063986f140b4 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -329,15 +329,14 @@ void OSectionWindow::zoom(const Fraction& _aZoom)
//-----------------------------------------------------------------------------
IMPL_LINK( OSectionWindow, StartSplitHdl, Splitter*, )
{
- const String sEmpty(ModuleRes(RID_STR_UNDO_CHANGE_SIZE));
- getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->EnterListAction(sEmpty,String());
+ const String sUndoAction( ModuleRes( RID_STR_UNDO_CHANGE_SIZE ) );
+ getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction( sUndoAction, String() );
return 0L;
}
//------------------------------------------------------------------------------
IMPL_LINK( OSectionWindow, EndSplitHdl, Splitter*, )
{
- getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->LeaveListAction();
- /*getViewsWindow()->Resize();*/
+ getViewsWindow()->getView()->getReportView()->getController().getUndoManager().LeaveListAction();
return 0L;
}
//-----------------------------------------------------------------------------
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index bcd50236aab3..2de8db6c25f0 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1329,7 +1329,7 @@ void OViewsWindow::EndDragObj_removeInvisibleObjects()
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);
+ const UndoContext aUndoContext( getView()->getReportView()->getController().getUndoManager(), sUndoAction );
Point aNewPos = _aPnt;
OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aNewPos);
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 8fe7425bf759..a840572b97dd 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -919,13 +919,29 @@ public:
USHORT GetErrCode( const ScAddress& ) const;
/** Shrink a range to only include data area.
+
This is not the actually used area within the
selection, but the bounds of the sheet's data area
- instead. */
+ instead.
+
+ @returns TRUE if the area passed intersected the data
+ area, FALSE if not, in which case the values
+ obtained may be out of bounds, not in order or
+ unmodified. TRUE does not mean that there
+ actually is any data within the selection.
+ */
bool ShrinkToDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const;
- /** Shrink a range to only include used data area. */
- bool ShrinkToUsedDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
+ /** Shrink a range to only include used data area.
+
+ @param o_bShrunk
+ Out parameter, TRUE if area was shrunk, FALSE if not.
+
+ @returns TRUE if there is any data, FALSE if not.
+ */
+ bool ShrinkToUsedDataArea( bool& o_bShrunk,
+ SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
+ SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
SC_DLLPUBLIC void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld, bool bOnlyDown ) const;
diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx
index 7dd9903f82a1..eed492c6e6c2 100644
--- a/sc/inc/drwlayer.hxx
+++ b/sc/inc/drwlayer.hxx
@@ -159,7 +159,7 @@ public:
void WidthChanged( SCTAB nTab, SCCOL nCol, long nDifTwips );
void HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips );
- BOOL HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow );
+ BOOL HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, bool bIncludeNotes = true );
void DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
SCCOL nCol2,SCROW nRow2 );
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 63cefe22626a..02fd917d2db9 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -86,6 +86,17 @@ class ScFlatBoolRowSegments;
class ScFlatBoolColSegments;
+struct ScShowRowsEntry
+{
+ SCROW mnRow1;
+ SCROW mnRow2;
+ bool mbShow;
+
+ ScShowRowsEntry( SCROW nR1, SCROW nR2, bool bS ) :
+ mnRow1(nR1), mnRow2(nR2), mbShow(bS) {}
+};
+
+
class ScTable
{
private:
@@ -417,7 +428,8 @@ public:
void GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow,
BOOL bIncludeOld, bool bOnlyDown ) const;
- bool ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
+ bool ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow,
+ SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow, ScDirection eDir );
@@ -657,7 +669,7 @@ public:
void DBShowRow(SCROW nRow, bool bShow);
void ShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
- void DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
+ void DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow, bool bSetFlags); // if bSetFlags=false, no SetRowHidden/SetRowFiltered
void SetColFlags( SCCOL nCol, BYTE nNewFlags );
void SetRowFlags( SCROW nRow, BYTE nNewFlags );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 3711b1b68603..e77056b9446a 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -698,12 +698,15 @@ bool ScDocument::ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow
return true; // success!
}
-bool ScDocument::ShrinkToUsedDataArea( SCTAB nTab, SCCOL& rStartCol,
+bool ScDocument::ShrinkToUsedDataArea( bool& o_bShrunk, SCTAB nTab, SCCOL& rStartCol,
SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const
{
if (!ValidTab(nTab) || !pTab[nTab])
+ {
+ o_bShrunk = false;
return false;
- return pTab[nTab]->ShrinkToUsedDataArea( rStartCol, rStartRow, rEndCol, rEndRow, bColumnsOnly);
+ }
+ return pTab[nTab]->ShrinkToUsedDataArea( o_bShrunk, rStartCol, rStartRow, rEndCol, rEndRow, bColumnsOnly);
}
// zusammenhaengender Bereich
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 4df709768279..b4e1cc71dc3d 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1137,7 +1137,7 @@ void ScDrawLayer::HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips )
MoveAreaTwips( nTab, aRect, Point( 0,nDifTwips ), aTopLeft );
}
-BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow )
+BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, bool bIncludeNotes )
{
DBG_ASSERT( pDoc, "ScDrawLayer::HasObjectsInRows without document" );
if ( !pDoc )
@@ -1178,7 +1178,9 @@ BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow )
while ( pObject && !bFound )
{
aObjRect = pObject->GetSnapRect(); //! GetLogicRect ?
- if (aTestRect.IsInside(aObjRect.TopLeft()) || aTestRect.IsInside(aObjRect.BottomLeft()))
+ // #i116164# note captions are handled separately, don't have to be included for each single row height change
+ if ( (aTestRect.IsInside(aObjRect.TopLeft()) || aTestRect.IsInside(aObjRect.BottomLeft())) &&
+ (bIncludeNotes || !IsNoteCaption(pObject)) )
bFound = TRUE;
pObject = aIter.Next();
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 151478324ef7..439c8d9635a5 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -742,18 +742,28 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S
}
-bool ScTable::ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow,
+bool ScTable::ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow,
SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const
{
- bool bRet = false;
- bool bChanged;
+ o_bShrunk = false;
+
+ PutInOrder( rStartCol, rEndCol);
+ PutInOrder( rStartRow, rEndRow);
+ if (rStartCol < 0)
+ rStartCol = 0, o_bShrunk = true;
+ if (rStartRow < 0)
+ rStartRow = 0, o_bShrunk = true;
+ if (rEndCol > MAXCOL)
+ rEndCol = MAXCOL, o_bShrunk = true;
+ if (rEndRow > MAXROW)
+ rEndRow = MAXROW, o_bShrunk = true;
+ bool bChanged;
do
{
bChanged = false;
- bool bCont = true;
- while (rEndCol > 0 && bCont && rStartCol < rEndCol)
+ while (rStartCol < rEndCol)
{
if (aCol[rEndCol].IsEmptyBlock( rStartRow, rEndRow))
{
@@ -761,11 +771,10 @@ bool ScTable::ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow,
bChanged = true;
}
else
- bCont = false;
+ break; // while
}
- bCont = true;
- while (rStartCol < MAXCOL && bCont && rStartCol < rEndCol)
+ while (rStartCol < rEndCol)
{
if (aCol[rStartCol].IsEmptyBlock( rStartRow, rEndRow))
{
@@ -773,12 +782,12 @@ bool ScTable::ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow,
bChanged = true;
}
else
- bCont = false;
+ break; // while
}
if (!bColumnsOnly)
{
- if (rStartRow < MAXROW && rStartRow < rEndRow)
+ if (rStartRow < rEndRow)
{
bool bFound = false;
for (SCCOL i=rStartCol; i<=rEndCol && !bFound; i++)
@@ -791,7 +800,7 @@ bool ScTable::ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow,
}
}
- if (rEndRow > 0 && rStartRow < rEndRow)
+ if (rStartRow < rEndRow)
{
bool bFound = false;
for (SCCOL i=rStartCol; i<=rEndCol && !bFound; i++)
@@ -806,9 +815,12 @@ bool ScTable::ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow,
}
if (bChanged)
- bRet = true;
+ o_bShrunk = true;
} while( bChanged );
- return bRet;
+
+ return rStartCol != rEndCol || (bColumnsOnly ?
+ !aCol[rStartCol].IsEmptyBlock( rStartRow, rEndRow) :
+ (rStartRow != rEndRow || aCol[rStartCol].HasDataAt( rStartRow)));
}
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 9bb22b68d2ad..9eaaf6c070e7 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -774,6 +774,9 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
pDestTab->pRowFlags->CopyFrom(*pRowFlags, nRow1, nRow2);
// Hidden flags.
+ // #i116164# Collect information first, then apply the changes,
+ // so RowHidden doesn't rebuild the tree for each row range.
+ std::vector<ScShowRowsEntry> aEntries;
for (SCROW i = nRow1; i <= nRow2; ++i)
{
SCROW nThisLastRow, nDestLastRow;
@@ -786,7 +789,8 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
// the last row shouldn't exceed the upper bound the caller specified.
nLastRow = nRow2;
- pDestTab->SetRowHidden(i, nLastRow, bThisHidden);
+ //pDestTab->SetRowHidden(i, nLastRow, bThisHidden);
+ aEntries.push_back(ScShowRowsEntry(i, nLastRow, !bThisHidden));
bool bThisHiddenChange = (bThisHidden != bDestHidden);
if (bThisHiddenChange && pCharts)
@@ -802,6 +806,19 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
i = nLastRow;
}
+ std::vector<ScShowRowsEntry>::const_iterator aEnd = aEntries.end();
+ std::vector<ScShowRowsEntry>::const_iterator aIter = aEntries.begin();
+ if ( aIter != aEnd )
+ {
+ pDestTab->mpHiddenRows->setInsertFromBack(true); // important for undo document
+ while (aIter != aEnd)
+ {
+ pDestTab->SetRowHidden(aIter->mnRow1, aIter->mnRow2, !aIter->mbShow);
+ ++aIter;
+ }
+ pDestTab->mpHiddenRows->setInsertFromBack(false);
+ }
+
// Filtered flags.
for (SCROW i = nRow1; i <= nRow2; ++i)
{
@@ -1135,10 +1152,16 @@ ScBaseCell* ScTable::GetCell( SCCOL nCol, SCROW nRow ) const
void ScTable::GetFirstDataPos(SCCOL& rCol, SCROW& rRow) const
{
rCol = 0;
- rRow = 0;
+ rRow = MAXROW+1;
while (aCol[rCol].IsEmptyData() && rCol < MAXCOL)
++rCol;
- rRow = aCol[rCol].GetFirstDataPos();
+ SCCOL nCol = rCol;
+ while (nCol <= MAXCOL && rRow > 0)
+ {
+ if (!aCol[nCol].IsEmptyData())
+ rRow = ::std::min( rRow, aCol[nCol].GetFirstDataPos());
+ ++nCol;
+ }
}
void ScTable::GetLastDataPos(SCCOL& rCol, SCROW& rRow) const
@@ -1148,11 +1171,8 @@ void ScTable::GetLastDataPos(SCCOL& rCol, SCROW& rRow) const
while (aCol[rCol].IsEmptyData() && (rCol > 0))
rCol--;
SCCOL nCol = rCol;
- while ((SCsCOL)nCol >= 0)
- {
- rRow = Max(rRow, aCol[nCol].GetLastDataPos());
- nCol--;
- }
+ while (nCol >= 0 && rRow < MAXROW)
+ rRow = ::std::max( rRow, aCol[nCol--].GetLastDataPos());
}
@@ -2625,10 +2645,10 @@ void ScTable::DBShowRow(SCROW nRow, bool bShow)
}
-void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
+void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow, bool bSetFlags)
{
+ // #i116164# IncRecalcLevel/DecRecalcLevel is in ScTable::Query
SCROW nStartRow = nRow1;
- IncRecalcLevel();
InitializeNoteCaptions();
while (nStartRow <= nRow2)
{
@@ -2638,7 +2658,7 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
nEndRow = nRow2;
BOOL bChanged = ( bWasVis != bShow );
- if ( bChanged )
+ if ( bChanged && bSetFlags )
{
ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
if (pDrawLayer)
@@ -2651,8 +2671,13 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
}
}
- SetRowHidden(nStartRow, nEndRow, !bShow);
- SetRowFiltered(nStartRow, nEndRow, !bShow);
+ // #i116164# Directly modify the flags only if there are drawing objects within the area.
+ // Otherwise, all modifications are made together in ScTable::Query, so the tree isn't constantly rebuilt.
+ if ( bSetFlags )
+ {
+ SetRowHidden(nStartRow, nEndRow, !bShow);
+ SetRowFiltered(nStartRow, nEndRow, !bShow);
+ }
if ( bChanged )
{
@@ -2669,8 +2694,6 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
// to be done here.
if (pOutlineTable)
UpdateOutlineRow( nRow1, nRow2, bShow );
-
- DecRecalcLevel();
}
@@ -2679,6 +2702,14 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
SCROW nStartRow = nRow1;
IncRecalcLevel();
InitializeNoteCaptions();
+
+ // #i116164# if there are no drawing objects within the row range, a single HeightChanged call is enough
+ ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
+ bool bHasObjects = pDrawLayer && pDrawLayer->HasObjectsInRows( nTab, nRow1, nRow2, false );
+ long nOldHeight = 0;
+ if ( pDrawLayer && !bHasObjects )
+ nOldHeight = static_cast<long>(GetRowHeight(nRow1, nRow2));
+
while (nStartRow <= nRow2)
{
SCROW nEndRow = -1;
@@ -2687,9 +2718,8 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
nEndRow = nRow2;
BOOL bChanged = ( bWasVis != bShow );
- if ( bChanged )
+ if ( bChanged && bHasObjects )
{
- ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
if (pDrawLayer)
{
long nHeight = static_cast<long>(mpRowHeights->getSumValue(nStartRow, nEndRow));
@@ -2700,9 +2730,14 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
}
}
- SetRowHidden(nStartRow, nEndRow, !bShow);
- if (bShow)
- SetRowFiltered(nStartRow, nEndRow, false);
+ // #i116164# Directly modify the flags only if there are drawing objects within the area.
+ // Otherwise, all rows are modified together after the loop, so the tree isn't constantly rebuilt.
+ if ( bHasObjects )
+ {
+ SetRowHidden(nStartRow, nEndRow, !bShow);
+ if (bShow)
+ SetRowFiltered(nStartRow, nEndRow, false);
+ }
if ( bChanged )
{
@@ -2715,6 +2750,25 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
nStartRow = nEndRow + 1;
}
+
+ if ( !bHasObjects )
+ {
+ // #i116164# set the flags for the whole range at once
+ SetRowHidden(nRow1, nRow2, !bShow);
+ if (bShow)
+ SetRowFiltered(nRow1, nRow2, false);
+
+ if ( pDrawLayer )
+ {
+ // if there are no objects in the range, a single HeightChanged call is enough
+ long nNewHeight = 0;
+ if ( bShow )
+ nNewHeight = static_cast<long>(GetRowHeight(nRow1, nRow2));
+ if ( nNewHeight != nOldHeight )
+ pDrawLayer->HeightChanged( nTab, nRow1, nNewHeight - nOldHeight );
+ }
+ }
+
DecRecalcLevel();
}
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index bd6a2c92c442..8828d8ab2449 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -59,6 +59,8 @@
#include "cellform.hxx"
#include "postit.hxx"
#include "queryparam.hxx"
+#include "segmenttree.hxx"
+#include "drwlayer.hxx"
#include <vector>
@@ -1489,6 +1491,14 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub)
aParam.nDestCol, aParam.nDestRow, aParam.nDestTab );
}
+ if (aParam.bInplace)
+ IncRecalcLevel(); // #i116164# once for all entries
+
+ // #i116164# If there are no drawing objects within the area, call SetRowHidden/SetRowFiltered for all rows at the end
+ std::vector<ScShowRowsEntry> aEntries;
+ ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
+ bool bHasObjects = pDrawLayer && pDrawLayer->HasObjectsInRows( nTab, aParam.nRow1 + nHeader, aParam.nRow2, false );
+
for (SCROW j=aParam.nRow1 + nHeader; j<=aParam.nRow2; j++)
{
BOOL bResult; // Filterergebnis
@@ -1544,7 +1554,11 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub)
else
{
if (bStarted)
- DBShowRows(nOldStart,nOldEnd, bOldResult);
+ {
+ DBShowRows(nOldStart,nOldEnd, bOldResult, bHasObjects);
+ if (!bHasObjects)
+ aEntries.push_back(ScShowRowsEntry(nOldStart, nOldEnd, bOldResult));
+ }
nOldStart = nOldEnd = j;
bOldResult = bResult;
}
@@ -1563,7 +1577,58 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub)
}
if (aParam.bInplace && bStarted)
- DBShowRows(nOldStart,nOldEnd, bOldResult);
+ {
+ DBShowRows(nOldStart,nOldEnd, bOldResult, bHasObjects);
+ if (!bHasObjects)
+ aEntries.push_back(ScShowRowsEntry(nOldStart, nOldEnd, bOldResult));
+ }
+
+ // #i116164# execute the collected SetRowHidden/SetRowFiltered calls
+ if (!bHasObjects)
+ {
+ std::vector<ScShowRowsEntry>::const_iterator aEnd = aEntries.end();
+ std::vector<ScShowRowsEntry>::const_iterator aIter = aEntries.begin();
+ if ( aIter != aEnd )
+ {
+ // do only one HeightChanged call with the final difference in heights
+ long nOldHeight = 0;
+ if ( pDrawLayer )
+ nOldHeight = static_cast<long>(GetRowHeight(aParam.nRow1 + nHeader, aParam.nRow2));
+
+ // clear the range first instead of many changes in the middle of the filled array
+ SetRowHidden(aParam.nRow1 + nHeader, aParam.nRow2, false);
+ SetRowFiltered(aParam.nRow1 + nHeader, aParam.nRow2, false);
+
+ // insert from back, in case the filter range is large
+ mpHiddenRows->setInsertFromBack(true);
+ mpFilteredRows->setInsertFromBack(true);
+
+ while (aIter != aEnd)
+ {
+ if (!aIter->mbShow)
+ {
+ SCROW nStartRow = aIter->mnRow1;
+ SCROW nEndRow = aIter->mnRow2;
+ SetRowHidden(nStartRow, nEndRow, true);
+ SetRowFiltered(nStartRow, nEndRow, true);
+ }
+ ++aIter;
+ }
+
+ mpHiddenRows->setInsertFromBack(false);
+ mpFilteredRows->setInsertFromBack(false);
+
+ if ( pDrawLayer )
+ {
+ // if there are no objects in the filtered range, a single HeightChanged call is enough
+ long nNewHeight = static_cast<long>(GetRowHeight(aParam.nRow1 + nHeader, aParam.nRow2));
+ pDrawLayer->HeightChanged( nTab, aParam.nRow1 + nHeader, nNewHeight - nOldHeight );
+ }
+ }
+ }
+
+ if (aParam.bInplace)
+ DecRecalcLevel();
delete[] pSpecial;
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 2239b1d0f773..a68867f29e01 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -288,8 +288,6 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
BOOL bDone = FALSE;
BOOL bRet = FALSE; // Standard: kein Abbruch
- SfxApplication* pSfxApp = SFX_APP();
- pSfxApp->EnterBasicCall(); // Dok-Basic anlegen etc.
// Wenn das Dok waehrend eines Basic-Calls geladen wurde,
// ist das Sbx-Objekt evtl. nicht angelegt (?)
@@ -368,7 +366,7 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
if ( pCell )
pDocument->LockTable( rPos.Tab() );
SbxVariableRef refRes = new SbxVariable;
- ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, NULL, refPar, refRes );
+ ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, refPar, refRes );
if ( pCell )
pDocument->UnlockTable( rPos.Tab() );
@@ -380,7 +378,6 @@ BOOL ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
bRet = TRUE;
bDone = TRUE;
}
- pSfxApp->LeaveBasicCall();
if ( !bDone && !pCell ) // Makro nicht gefunden (nur bei Eingabe)
{
diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index 58ee1b06f7f7..53c3ae266f89 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -36,6 +36,22 @@
#include "document.hxx"
#include "rechead.hxx"
+namespace
+{
+ bool lcl_hasValueDataButNoDates( ScDocument* pDocument, SCCOL nCol, SCROW nRow, SCTAB nTab )
+ {
+ bool bReturn = false;
+ if (pDocument->HasValueData( nCol, nRow, nTab ))
+ {
+ //treat dates like text #i25706#
+ sal_uInt32 nNumberFormat = pDocument->GetNumberFormat( ScAddress( nCol, nRow, nTab ) );
+ short nType = pDocument->GetFormatTable()->GetType(nNumberFormat);
+ bool bIsDate = (nType & NUMBERFORMAT_DATE);
+ bReturn = !bIsDate;
+ }
+ return bReturn;
+ }
+}
ScChartPositioner::ScChartPositioner( ScDocument* pDoc, SCTAB nTab,
SCCOL nStartColP, SCROW nStartRowP, SCCOL nEndColP, SCROW nEndRowP) :
@@ -290,12 +306,12 @@ void ScChartPositioner::CheckColRowHeaders()
{
for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++)
{
- if (pDocument->HasValueData( iCol, nRow1, nTab1 ))
+ if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 ))
bColStrings = FALSE;
}
for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++)
{
- if (pDocument->HasValueData( nCol1, iRow, nTab1 ))
+ if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 ))
bRowStrings = FALSE;
}
}
@@ -315,7 +331,7 @@ void ScChartPositioner::CheckColRowHeaders()
if ( nCol1 <= nCol2 )
for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++)
{
- if (pDocument->HasValueData( nCol1, iRow, nTab1 ))
+ if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 ))
bRowStrings = FALSE;
}
}
@@ -324,7 +340,7 @@ void ScChartPositioner::CheckColRowHeaders()
if ( nRow1 <= nRow2 )
for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++)
{
- if (pDocument->HasValueData( iCol, nRow1, nTab1 ))
+ if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 ))
bColStrings = FALSE;
}
}
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 828c9ae64c7d..1015e94180f3 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2925,7 +2925,6 @@ BOOL ScCompiler::IsMacro( const String& rName )
SfxObjectShell* pDocSh = pDoc->GetDocumentShell();
SfxApplication* pSfxApp = SFX_APP();
- pSfxApp->EnterBasicCall(); // initialize document's BASIC
if( pDocSh )//XXX
pObj = pDocSh->GetBasic();
@@ -2942,7 +2941,6 @@ BOOL ScCompiler::IsMacro( const String& rName )
SbxMethod* pMeth = (SbxMethod*) pObj->Find( aName, SbxCLASS_METHOD );
if( !pMeth )
{
- pSfxApp->LeaveBasicCall();
return FALSE;
}
// It really should be a BASIC function!
@@ -2950,14 +2948,12 @@ BOOL ScCompiler::IsMacro( const String& rName )
|| ( pMeth->IsFixed() && pMeth->GetType() == SbxEMPTY )
|| !pMeth->ISA(SbMethod) )
{
- pSfxApp->LeaveBasicCall();
return FALSE;
}
ScRawToken aToken;
aToken.SetExternal( aName.GetBuffer() );
aToken.eOp = ocMacro;
pRawToken = aToken.Clone();
- pSfxApp->LeaveBasicCall();
return TRUE;
}
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 47cde7186067..899e2cd17e25 100755
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2707,9 +2707,6 @@ void ScInterpreter::ScMacro()
// keine Sicherheitsabfrage mehr vorneweg (nur CheckMacroWarn), das passiert im CallBasic
- SfxApplication* pSfxApp = SFX_APP();
- pSfxApp->EnterBasicCall(); // Dok-Basic anlegen etc.
-
// Wenn das Dok waehrend eines Basic-Calls geladen wurde,
// ist das Sbx-Objekt evtl. nicht angelegt (?)
// pDocSh->GetSbxObject();
@@ -2722,7 +2719,6 @@ void ScInterpreter::ScMacro()
if( !pVar || pVar->GetType() == SbxVOID || !pVar->ISA(SbMethod) )
{
PushError( errNoMacro );
- pSfxApp->LeaveBasicCall();
return;
}
@@ -2841,7 +2837,7 @@ void ScInterpreter::ScMacro()
pDok->LockTable( aPos.Tab() );
SbxVariableRef refRes = new SbxVariable;
pDok->IncMacroInterpretLevel();
- ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, NULL, refPar, refRes );
+ ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, refPar, refRes );
pDok->DecMacroInterpretLevel();
pDok->UnlockTable( aPos.Tab() );
@@ -2914,8 +2910,6 @@ void ScInterpreter::ScMacro()
else
PushString( refRes->GetString() );
}
-
- pSfxApp->LeaveBasicCall();
}
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index b6b136da4b1e..0d04255f0141 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -39,6 +39,9 @@
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <com/sun/star/chart/XAxisSupplier.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -169,6 +172,56 @@ bool lclIsAutoAnyOrGetScaledValue( double& rfValue, const Any& rAny, bool bLogSc
return bIsAuto;
}
+sal_uInt16 lclGetTimeValue( const XclExpRoot& rRoot, double fSerialDate, sal_uInt16 nTimeUnit )
+{
+ DateTime aDateTime = rRoot.GetDateTimeFromDouble( fSerialDate );
+ switch( nTimeUnit )
+ {
+ case EXC_CHDATERANGE_DAYS:
+ return ::limit_cast< sal_uInt16, double >( fSerialDate, 0, SAL_MAX_UINT16 );
+ case EXC_CHDATERANGE_MONTHS:
+ return ::limit_cast< sal_uInt16, sal_uInt16 >( 12 * (aDateTime.GetYear() - rRoot.GetBaseYear()) + aDateTime.GetMonth() - 1, 0, SAL_MAX_INT16 );
+ case EXC_CHDATERANGE_YEARS:
+ return ::limit_cast< sal_uInt16, sal_uInt16 >( aDateTime.GetYear() - rRoot.GetBaseYear(), 0, SAL_MAX_INT16 );
+ default:
+ OSL_ENSURE( false, "lclGetTimeValue - unexpected time unit" );
+ }
+ return ::limit_cast< sal_uInt16, double >( fSerialDate, 0, SAL_MAX_UINT16 );
+}
+
+bool lclConvertTimeValue( const XclExpRoot& rRoot, sal_uInt16& rnValue, const Any& rAny, sal_uInt16 nTimeUnit )
+{
+ double fSerialDate = 0;
+ bool bAuto = lclIsAutoAnyOrGetValue( fSerialDate, rAny );
+ if( !bAuto )
+ rnValue = lclGetTimeValue( rRoot, fSerialDate, nTimeUnit );
+ return bAuto;
+}
+
+sal_uInt16 lclGetTimeUnit( sal_Int32 nApiTimeUnit )
+{
+ switch( nApiTimeUnit )
+ {
+ case cssc::TimeUnit::DAY: return EXC_CHDATERANGE_DAYS;
+ case cssc::TimeUnit::MONTH: return EXC_CHDATERANGE_MONTHS;
+ case cssc::TimeUnit::YEAR: return EXC_CHDATERANGE_YEARS;
+ default: OSL_ENSURE( false, "lclGetTimeUnit - unexpected time unit" );
+ }
+ return EXC_CHDATERANGE_DAYS;
+}
+
+bool lclConvertTimeInterval( sal_uInt16 rnValue, sal_uInt16& rnTimeUnit, const Any& rAny )
+{
+ cssc::TimeInterval aInterval;
+ bool bAuto = lclIsAutoAnyOrGetValue( aInterval, rAny );
+ if( !bAuto )
+ {
+ rnValue = ::limit_cast< sal_uInt16, sal_Int32 >( aInterval.Number, 1, SAL_MAX_UINT16 );
+ rnTimeUnit = lclGetTimeUnit( aInterval.TimeUnit );
+ }
+ return bAuto;
+}
+
} // namespace
// Common =====================================================================
@@ -1269,7 +1322,7 @@ bool XclExpChText::ConvertDataLabel( const ScfPropertySet& rPropSet,
sal_uInt16 nLabelPos = EXC_CHTEXT_POS_AUTO;
if( rPropSet.GetProperty( nPlacement, EXC_CHPROP_LABELPLACEMENT ) )
{
- using namespace ::com::sun::star::chart::DataLabelPlacement;
+ using namespace cssc::DataLabelPlacement;
if( nPlacement == rTypeInfo.mnDefaultLabelPos )
{
nLabelPos = EXC_CHTEXT_POS_DEFAULT;
@@ -1489,7 +1542,7 @@ void XclExpCh3dDataFormat::Convert( const ScfPropertySet& rPropSet )
sal_Int32 nApiType(0);
if( rPropSet.GetProperty( nApiType, EXC_CHPROP_GEOMETRY3D ) )
{
- using namespace ::com::sun::star::chart2::DataPointGeometry3D;
+ using namespace cssc2::DataPointGeometry3D;
switch( nApiType )
{
case CUBOID:
@@ -2246,7 +2299,7 @@ void XclExpChLegend::Convert( const ScfPropertySet& rPropSet )
used by this property (in the RelativePosition.Anchor member)
it cannot be used to calculate the position easily. For this,
the Chart1 API will be used instead. */
- Reference< ::com::sun::star::chart::XChartDocument > xChart1Doc( GetChartDocument(), UNO_QUERY_THROW );
+ Reference< cssc::XChartDocument > xChart1Doc( GetChartDocument(), UNO_QUERY_THROW );
Reference< XShape > xChart1Legend( xChart1Doc->getLegend(), UNO_SET_THROW );
// coordinates in CHLEGEND record written but not used by Excel
mxFramePos.reset( new XclExpChFramePos( EXC_CHFRAMEPOS_CHARTSIZE, EXC_CHFRAMEPOS_PARENT ) );
@@ -2348,9 +2401,9 @@ void XclExpChTypeGroup::ConvertType(
// spline - TODO: get from single series (#i66858#)
ScfPropertySet aTypeProp( xChartType );
- ::com::sun::star::chart2::CurveStyle eCurveStyle;
+ cssc2::CurveStyle eCurveStyle;
bool bSpline = aTypeProp.GetProperty( eCurveStyle, EXC_CHPROP_CURVESTYLE ) &&
- (eCurveStyle != ::com::sun::star::chart2::CurveStyle_LINES);
+ (eCurveStyle != cssc2::CurveStyle_LINES);
// extended type info
maTypeInfo.Set( maType.GetTypeInfo(), b3dChart, bSpline );
@@ -2546,16 +2599,53 @@ XclExpChLabelRange::XclExpChLabelRange( const XclExpChRoot& rRoot ) :
{
}
-void XclExpChLabelRange::Convert( const ScaleData& rScaleData, bool bMirrorOrient )
+void XclExpChLabelRange::Convert( const ScaleData& rScaleData, const ScfPropertySet& rChart1Axis, bool bMirrorOrient )
{
+ /* Base time unit (using the property 'ExplicitTimeIncrement' from the old
+ chart API allows to detect axis type (date axis, if property exists),
+ and to receive the base time unit currently used in case the base time
+ unit is set to 'automatic'. */
+ cssc::TimeIncrement aTimeIncrement;
+ if( rChart1Axis.GetProperty( aTimeIncrement, EXC_CHPROP_EXPTIMEINCREMENT ) )
+ {
+ // property exists -> this is a date axis currently
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_DATEAXIS );
+
+ // automatic base time unit, if the UNO Any 'rScaleData.TimeIncrement.TimeResolution' does not contain a valid value...
+ bool bAutoBase = !rScaleData.TimeIncrement.TimeResolution.has< cssc::TimeIncrement >();
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOBASE, bAutoBase );
+
+ // ...but get the current base time unit from the property of the old chart API
+ sal_Int32 nApiTimeUnit = 0;
+ bool bValidBaseUnit = aTimeIncrement.TimeResolution >>= nApiTimeUnit;
+ DBG_ASSERT( bValidBaseUnit, "XclExpChLabelRange::Convert - cannot ghet base time unit" );
+ maDateData.mnBaseUnit = bValidBaseUnit ? lclGetTimeUnit( nApiTimeUnit ) : EXC_CHDATERANGE_DAYS;
+
+ /* Min/max values depend on base time unit, they specify the number of
+ days, months, or years starting from null date. */
+ bool bAutoMin = lclConvertTimeValue( GetRoot(), maDateData.mnMinDate, rScaleData.Minimum, maDateData.mnBaseUnit );
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMIN, bAutoMin );
+ bool bAutoMax = lclConvertTimeValue( GetRoot(), maDateData.mnMaxDate, rScaleData.Maximum, maDateData.mnBaseUnit );
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMAX, bAutoMax );
+ }
+
+ // automatic axis type detection
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTODATE, rScaleData.AutoDateAxis );
+
+ // increment
+ bool bAutoMajor = lclConvertTimeInterval( maDateData.mnMajorStep, maDateData.mnMajorUnit, rScaleData.TimeIncrement.MajorTimeInterval );
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMAJOR, bAutoMajor );
+ bool bAutoMinor = lclConvertTimeInterval( maDateData.mnMinorStep, maDateData.mnMinorUnit, rScaleData.TimeIncrement.MinorTimeInterval );
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMINOR, bAutoMinor );
+
// origin
double fOrigin = 0.0;
if( !lclIsAutoAnyOrGetValue( fOrigin, rScaleData.Origin ) )
- maData.mnCross = limit_cast< sal_uInt16 >( fOrigin, 1, 31999 );
+ maLabelData.mnCross = limit_cast< sal_uInt16 >( fOrigin, 1, 31999 );
// reverse order
- if( (rScaleData.Orientation == ::com::sun::star::chart2::AxisOrientation_REVERSE) != bMirrorOrient )
- ::set_flag( maData.mnFlags, EXC_CHLABELRANGE_REVERSE );
+ if( (rScaleData.Orientation == cssc2::AxisOrientation_REVERSE) != bMirrorOrient )
+ ::set_flag( maLabelData.mnFlags, EXC_CHLABELRANGE_REVERSE );
}
void XclExpChLabelRange::ConvertAxisPosition( const ScfPropertySet& rPropSet )
@@ -2564,19 +2654,55 @@ void XclExpChLabelRange::ConvertAxisPosition( const ScfPropertySet& rPropSet )
rPropSet.GetProperty( eAxisPos, EXC_CHPROP_CROSSOVERPOSITION );
double fCrossingPos = 1.0;
rPropSet.GetProperty( fCrossingPos, EXC_CHPROP_CROSSOVERVALUE );
+
+ bool bDateAxis = ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_DATEAXIS );
switch( eAxisPos )
{
- case cssc::ChartAxisPosition_ZERO: maData.mnCross = 1; break;
- case cssc::ChartAxisPosition_START: maData.mnCross = 1; break;
- case cssc::ChartAxisPosition_END: ::set_flag( maData.mnFlags, EXC_CHLABELRANGE_MAXCROSS ); break;
- case cssc::ChartAxisPosition_VALUE: maData.mnCross = limit_cast< sal_uInt16 >( fCrossingPos, 1, 31999 ); break;
- default: maData.mnCross = 1;
+ case cssc::ChartAxisPosition_ZERO:
+ case cssc::ChartAxisPosition_START:
+ maLabelData.mnCross = 1;
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOCROSS );
+ break;
+ case cssc::ChartAxisPosition_END:
+ ::set_flag( maLabelData.mnFlags, EXC_CHLABELRANGE_MAXCROSS );
+ break;
+ case cssc::ChartAxisPosition_VALUE:
+ maLabelData.mnCross = limit_cast< sal_uInt16 >( fCrossingPos, 1, 31999 );
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOCROSS, false );
+ if( bDateAxis )
+ maDateData.mnCross = lclGetTimeValue( GetRoot(), fCrossingPos, maDateData.mnBaseUnit );
+ break;
+ default:
+ maLabelData.mnCross = 1;
+ ::set_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOCROSS );
+ }
+}
+
+void XclExpChLabelRange::Save( XclExpStream& rStrm )
+{
+ // the CHLABELRANGE record
+ XclExpRecord::Save( rStrm );
+
+ // the CHDATERANGE record with date axis settings (BIFF8 only)
+ if( GetBiff() == EXC_BIFF8 )
+ {
+ rStrm.StartRecord( EXC_ID_CHDATERANGE, 18 );
+ rStrm << maDateData.mnMinDate
+ << maDateData.mnMaxDate
+ << maDateData.mnMajorStep
+ << maDateData.mnMajorUnit
+ << maDateData.mnMinorStep
+ << maDateData.mnMinorUnit
+ << maDateData.mnBaseUnit
+ << maDateData.mnCross
+ << maDateData.mnFlags;
+ rStrm.EndRecord();
}
}
void XclExpChLabelRange::WriteBody( XclExpStream& rStrm )
{
- rStrm << maData.mnCross << maData.mnLabelFreq << maData.mnTickFreq << maData.mnFlags;
+ rStrm << maLabelData.mnCross << maLabelData.mnLabelFreq << maLabelData.mnTickFreq << maLabelData.mnFlags;
}
// ----------------------------------------------------------------------------
@@ -2661,7 +2787,7 @@ namespace {
sal_uInt8 lclGetXclTickPos( sal_Int32 nApiTickmarks )
{
- using namespace ::com::sun::star::chart2::TickmarkStyle;
+ using namespace cssc2::TickmarkStyle;
sal_uInt8 nXclTickPos = 0;
::set_flag( nXclTickPos, EXC_CHTICK_INSIDE, ::get_flag( nApiTickmarks, INNER ) );
::set_flag( nXclTickPos, EXC_CHTICK_OUTSIDE, ::get_flag( nApiTickmarks, OUTER ) );
@@ -2764,6 +2890,30 @@ Reference< XAxis > lclGetApiAxis( Reference< XCoordinateSystem > xCoordSystem,
return xAxis;
}
+Reference< cssc::XAxis > lclGetApiChart1Axis( Reference< XChartDocument > xChartDoc,
+ sal_Int32 nApiAxisDim, sal_Int32 nApiAxesSetIdx )
+{
+ Reference< cssc::XAxis > xChart1Axis;
+ try
+ {
+ Reference< cssc::XChartDocument > xChart1Doc( xChartDoc, UNO_QUERY_THROW );
+ Reference< cssc::XAxisSupplier > xChart1AxisSupp( xChart1Doc->getDiagram(), UNO_QUERY_THROW );
+ switch( nApiAxesSetIdx )
+ {
+ case EXC_CHART_AXESSET_PRIMARY:
+ xChart1Axis = xChart1AxisSupp->getAxis( nApiAxisDim );
+ break;
+ case EXC_CHART_AXESSET_SECONDARY:
+ xChart1Axis = xChart1AxisSupp->getSecondaryAxis( nApiAxisDim );
+ break;
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ return xChart1Axis;
+}
+
} // namespace
XclExpChAxis::XclExpChAxis( const XclExpChRoot& rRoot, sal_uInt16 nAxisType ) :
@@ -2786,7 +2936,8 @@ void XclExpChAxis::SetRotation( sal_uInt16 nRotation )
mxTick->SetRotation( nRotation );
}
-void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossingAxis, const XclChExtTypeInfo& rTypeInfo )
+void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossingAxis,
+ Reference< cssc::XAxis > xChart1Axis, const XclChExtTypeInfo& rTypeInfo )
{
ScfPropertySet aAxisProp( xAxis );
bool bCategoryAxis = ((GetAxisType() == EXC_CHAXIS_X) && rTypeInfo.mbCategoryAxis) || (GetAxisType() == EXC_CHAXIS_Z);
@@ -2806,8 +2957,11 @@ void XclExpChAxis::Convert( Reference< XAxis > xAxis, Reference< XAxis > xCrossi
mxLabelRange.reset( new XclExpChLabelRange( GetChRoot() ) );
mxLabelRange->SetTicksBetweenCateg( rTypeInfo.mbTicksBetweenCateg );
if( xAxis.is() )
+ {
+ ScfPropertySet aChart1AxisProp( xChart1Axis );
// #i71684# radar charts have reversed rotation direction
- mxLabelRange->Convert( xAxis->getScaleData(), (GetAxisType() == EXC_CHAXIS_X) && (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_RADAR) );
+ mxLabelRange->Convert( xAxis->getScaleData(), aChart1AxisProp, (GetAxisType() == EXC_CHAXIS_X) && (rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_RADAR) );
+ }
// get position of crossing axis on this axis from passed axis object
if( aCrossingProp.Is() )
mxLabelRange->ConvertAxisPosition( aCrossingProp );
@@ -2935,7 +3089,7 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
bool b3dChart = xCoordSystem.is() && (xCoordSystem->getDimension() == 3);
// percent charts
- namespace ApiAxisType = ::com::sun::star::chart2::AxisType;
+ namespace ApiAxisType = cssc2::AxisType;
Reference< XAxis > xApiYAxis = lclGetApiAxis( xCoordSystem, EXC_CHART_AXIS_Y, nApiAxesSetIdx );
bool bPercent = xApiYAxis.is() && (xApiYAxis->getScaleData().AxisType == ApiAxisType::PERCENT);
@@ -3042,8 +3196,8 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16
// inner and outer plot area position and size
try
{
- Reference< ::com::sun::star::chart::XChartDocument > xChart1Doc( GetChartDocument(), UNO_QUERY_THROW );
- Reference< ::com::sun::star::chart::XDiagramPositioning > xPositioning( xChart1Doc->getDiagram(), UNO_QUERY_THROW );
+ Reference< cssc::XChartDocument > xChart1Doc( GetChartDocument(), UNO_QUERY_THROW );
+ Reference< cssc::XDiagramPositioning > xPositioning( xChart1Doc->getDiagram(), UNO_QUERY_THROW );
// set manual flag in chart data
if( !xPositioning->isAutomaticDiagramPositioning() )
GetChartData().SetManualPlotArea();
@@ -3110,7 +3264,8 @@ void XclExpChAxesSet::ConvertAxis(
sal_Int32 nApiAxesSetIdx = GetApiAxesSetIndex();
Reference< XAxis > xAxis = lclGetApiAxis( xCoordSystem, nApiAxisDim, nApiAxesSetIdx );
Reference< XAxis > xCrossingAxis = lclGetApiAxis( xCoordSystem, nCrossingAxisDim, nApiAxesSetIdx );
- rxChAxis->Convert( xAxis, xCrossingAxis, rTypeInfo );
+ Reference< cssc::XAxis > xChart1Axis = lclGetApiChart1Axis( GetChartDocument(), nApiAxisDim, nApiAxesSetIdx );
+ rxChAxis->Convert( xAxis, xCrossingAxis, xChart1Axis, rTypeInfo );
// create and convert axis title
Reference< XTitled > xTitled( xAxis, UNO_QUERY );
@@ -3173,7 +3328,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
sal_Int32 nMissingValues = 0;
if( aDiaProp.GetProperty( nMissingValues, EXC_CHPROP_MISSINGVALUETREATMENT ) )
{
- using namespace ::com::sun::star::chart::MissingValueTreatment;
+ using namespace cssc::MissingValueTreatment;
switch( nMissingValues )
{
case LEAVE_GAP: maProps.mnEmptyMode = EXC_CHPROPS_EMPTY_SKIP; break;
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 7cbd74a836d2..8a5084be8bfc 100755..100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -43,6 +43,8 @@
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -147,13 +149,12 @@ XclImpStream& operator>>( XclImpStream& rStrm, XclChRectangle& rRect )
return rStrm >> rRect.mnX >> rRect.mnY >> rRect.mnWidth >> rRect.mnHeight;
}
-template< typename Type >
-void lclSetValueOrClearAny( Any& rAny, const Type& rValue, bool bClear )
+inline void lclSetValueOrClearAny( Any& rAny, double fValue, bool bClear )
{
if( bClear )
rAny.clear();
else
- rAny <<= rValue;
+ rAny <<= fValue;
}
void lclSetExpValueOrClearAny( Any& rAny, double fValue, bool bLogScale, bool bClear )
@@ -163,6 +164,50 @@ void lclSetExpValueOrClearAny( Any& rAny, double fValue, bool bLogScale, bool bC
lclSetValueOrClearAny( rAny, fValue, bClear );
}
+double lclGetSerialDay( const XclImpRoot& rRoot, sal_uInt16 nValue, sal_uInt16 nTimeUnit )
+{
+ switch( nTimeUnit )
+ {
+ case EXC_CHDATERANGE_DAYS:
+ return nValue;
+ case EXC_CHDATERANGE_MONTHS:
+ return rRoot.GetDoubleFromDateTime( Date( 1, static_cast< sal_uInt16 >( 1 + nValue % 12 ), static_cast< USHORT >( rRoot.GetBaseYear() + nValue / 12 ) ) );
+ case EXC_CHDATERANGE_YEARS:
+ return rRoot.GetDoubleFromDateTime( Date( 1, 1, static_cast< sal_uInt16 >( rRoot.GetBaseYear() + nValue ) ) );
+ default:
+ OSL_ENSURE( false, "lclGetSerialDay - unexpected time unit" );
+ }
+ return nValue;
+}
+
+void lclConvertTimeValue( const XclImpRoot& rRoot, Any& rAny, sal_uInt16 nValue, bool bAuto, sal_uInt16 nTimeUnit )
+{
+ if( bAuto )
+ rAny.clear();
+ else
+ rAny <<= lclGetSerialDay( rRoot, nValue, nTimeUnit );
+}
+
+sal_Int32 lclGetApiTimeUnit( sal_uInt16 nTimeUnit )
+{
+ switch( nTimeUnit )
+ {
+ case EXC_CHDATERANGE_DAYS: return cssc::TimeUnit::DAY;
+ case EXC_CHDATERANGE_MONTHS: return cssc::TimeUnit::MONTH;
+ case EXC_CHDATERANGE_YEARS: return cssc::TimeUnit::YEAR;
+ default: OSL_ENSURE( false, "lclGetApiTimeUnit - unexpected time unit" );
+ }
+ return cssc::TimeUnit::DAY;
+}
+
+void lclConvertTimeInterval( Any& rInterval, sal_uInt16 nValue, bool bAuto, sal_uInt16 nTimeUnit )
+{
+ if( bAuto || (nValue == 0) )
+ rInterval.clear();
+ else
+ rInterval <<= cssc::TimeInterval( nValue, lclGetApiTimeUnit( nTimeUnit ) );
+}
+
} // namespace
// Common =====================================================================
@@ -2828,20 +2873,60 @@ XclImpChLabelRange::XclImpChLabelRange( const XclImpChRoot& rRoot ) :
void XclImpChLabelRange::ReadChLabelRange( XclImpStream& rStrm )
{
- rStrm >> maData.mnCross >> maData.mnLabelFreq >> maData.mnTickFreq >> maData.mnFlags;
+ rStrm >> maLabelData.mnCross >> maLabelData.mnLabelFreq >> maLabelData.mnTickFreq >> maLabelData.mnFlags;
+}
+
+void XclImpChLabelRange::ReadChDateRange( XclImpStream& rStrm )
+{
+ rStrm >> maDateData.mnMinDate
+ >> maDateData.mnMaxDate
+ >> maDateData.mnMajorStep
+ >> maDateData.mnMajorUnit
+ >> maDateData.mnMinorStep
+ >> maDateData.mnMinorUnit
+ >> maDateData.mnBaseUnit
+ >> maDateData.mnCross
+ >> maDateData.mnFlags;
}
void XclImpChLabelRange::Convert( ScfPropertySet& rPropSet, ScaleData& rScaleData, bool bMirrorOrient ) const
{
- // do not overlap text unless all labels are visible
- rPropSet.SetBoolProperty( EXC_CHPROP_TEXTOVERLAP, maData.mnLabelFreq == 1 );
- // do not break text into several lines unless all labels are visible
- rPropSet.SetBoolProperty( EXC_CHPROP_TEXTBREAK, maData.mnLabelFreq == 1 );
- // do not stagger labels in two lines
- rPropSet.SetProperty( EXC_CHPROP_ARRANGEORDER, cssc::ChartAxisArrangeOrderType_SIDE_BY_SIDE );
+ // automatic axis type detection
+ rScaleData.AutoDateAxis = ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTODATE );
+
+ // the flag EXC_CHDATERANGE_DATEAXIS specifies whether this is a date axis
+ if( ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_DATEAXIS ) )
+ {
+ /* Chart2 requires axis type CATEGORY for automatic category/date axis
+ (even if it is a date axis currently). */
+ rScaleData.AxisType = rScaleData.AutoDateAxis ? cssc2::AxisType::CATEGORY : cssc2::AxisType::DATE;
+ rScaleData.Scaling.set( ScfApiHelper::CreateInstance( SERVICE_CHART2_LINEARSCALING ), UNO_QUERY );
+ /* Min/max values depend on base time unit, they specify the number of
+ days, months, or years starting from null date. */
+ lclConvertTimeValue( GetRoot(), rScaleData.Minimum, maDateData.mnMinDate, ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMIN ), maDateData.mnBaseUnit );
+ lclConvertTimeValue( GetRoot(), rScaleData.Maximum, maDateData.mnMaxDate, ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMAX ), maDateData.mnBaseUnit );
+ // increment
+ cssc::TimeIncrement& rTimeIncrement = rScaleData.TimeIncrement;
+ lclConvertTimeInterval( rTimeIncrement.MajorTimeInterval, maDateData.mnMajorStep, ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMAJOR ), maDateData.mnMajorUnit );
+ lclConvertTimeInterval( rTimeIncrement.MinorTimeInterval, maDateData.mnMinorStep, ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOMINOR ), maDateData.mnMinorUnit );
+ // base unit
+ if( ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOBASE ) )
+ rTimeIncrement.TimeResolution.clear();
+ else
+ rTimeIncrement.TimeResolution <<= lclGetApiTimeUnit( maDateData.mnBaseUnit );
+ }
+ else
+ {
+ // do not overlap text unless all labels are visible
+ rPropSet.SetBoolProperty( EXC_CHPROP_TEXTOVERLAP, maLabelData.mnLabelFreq == 1 );
+ // do not break text into several lines unless all labels are visible
+ rPropSet.SetBoolProperty( EXC_CHPROP_TEXTBREAK, maLabelData.mnLabelFreq == 1 );
+ // do not stagger labels in two lines
+ rPropSet.SetProperty( EXC_CHPROP_ARRANGEORDER, cssc::ChartAxisArrangeOrderType_SIDE_BY_SIDE );
+ }
// reverse order
- bool bReverse = ::get_flag( maData.mnFlags, EXC_CHLABELRANGE_REVERSE ) != bMirrorOrient;
+ bool bReverse = ::get_flag( maLabelData.mnFlags, EXC_CHLABELRANGE_REVERSE ) != bMirrorOrient;
rScaleData.Orientation = bReverse ? cssc2::AxisOrientation_REVERSE : cssc2::AxisOrientation_MATHEMATICAL;
//! TODO #i58731# show n-th category
@@ -2853,13 +2938,29 @@ void XclImpChLabelRange::ConvertAxisPosition( ScfPropertySet& rPropSet, bool b3d
does not move the Y axis in 3D charts, regardless of actual settings.
But: the Y axis has to be moved to "end", if the X axis is mirrored,
to keep it at the left end of the chart. */
- bool bMaxCross = ::get_flag( maData.mnFlags, b3dChart ? EXC_CHLABELRANGE_REVERSE : EXC_CHLABELRANGE_MAXCROSS );
+ bool bMaxCross = ::get_flag( maLabelData.mnFlags, b3dChart ? EXC_CHLABELRANGE_REVERSE : EXC_CHLABELRANGE_MAXCROSS );
cssc::ChartAxisPosition eAxisPos = bMaxCross ? cssc::ChartAxisPosition_END : cssc::ChartAxisPosition_VALUE;
rPropSet.SetProperty( EXC_CHPROP_CROSSOVERPOSITION, eAxisPos );
- // crossing position
- double fCrossingPos = b3dChart ? 1.0 : maData.mnCross;
- rPropSet.SetProperty( EXC_CHPROP_CROSSOVERVALUE, fCrossingPos );
+ // crossing position (depending on axis type text/date)
+ if( ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_DATEAXIS ) )
+ {
+ bool bAutoCross = ::get_flag( maDateData.mnFlags, EXC_CHDATERANGE_AUTOCROSS );
+ /* Crossing position value depends on base time unit, it specifies the
+ number of days, months, or years from null date. Note that Excel
+ 2007/2010 write broken BIFF8 files, they always stores the number
+ of days cregardless of the base time unit (and they are reading it
+ the same way, thus wrongly displaying files written by Excel
+ 97-2003). This filter sticks to the correct behaviour of Excel
+ 97-2003. */
+ double fCrossingPos = bAutoCross ? 1.0 : lclGetSerialDay( GetRoot(), maDateData.mnCross, maDateData.mnBaseUnit );
+ rPropSet.SetProperty( EXC_CHPROP_CROSSOVERVALUE, fCrossingPos );
+ }
+ else
+ {
+ double fCrossingPos = b3dChart ? 1.0 : maLabelData.mnCross;
+ rPropSet.SetProperty( EXC_CHPROP_CROSSOVERVALUE, fCrossingPos );
+ }
}
// ----------------------------------------------------------------------------
@@ -2900,6 +3001,7 @@ void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) co
Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements;
rSubIncrementSeq.realloc( 1 );
Any& rIntervalCount = rSubIncrementSeq[ 0 ].IntervalCount;
+ rIntervalCount.clear();
if( bLogScale )
{
if( !bAutoMinor )
@@ -2907,14 +3009,12 @@ void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) co
}
else
{
- sal_Int32 nCount = 0;
if( !bAutoMajor && !bAutoMinor && (0.0 < maData.mfMinorStep) && (maData.mfMinorStep <= maData.mfMajorStep) )
{
double fCount = maData.mfMajorStep / maData.mfMinorStep + 0.5;
- if( fCount < 1001.0 )
- nCount = static_cast< sal_Int32 >( fCount );
+ if( (1.0 <= fCount) && (fCount < 1001.0) )
+ rIntervalCount <<= static_cast< sal_Int32 >( fCount );
}
- lclSetValueOrClearAny( rIntervalCount, nCount, nCount == 0 );
}
// reverse order
@@ -3035,6 +3135,11 @@ void XclImpChAxis::ReadSubRecord( XclImpStream& rStrm )
mxLabelRange.reset( new XclImpChLabelRange( GetChRoot() ) );
mxLabelRange->ReadChLabelRange( rStrm );
break;
+ case EXC_ID_CHDATERANGE:
+ if( !mxLabelRange )
+ mxLabelRange.reset( new XclImpChLabelRange( GetChRoot() ) );
+ mxLabelRange->ReadChDateRange( rStrm );
+ break;
case EXC_ID_CHVALUERANGE:
mxValueRange.reset( new XclImpChValueRange( GetChRoot() ) );
mxValueRange->ReadChValueRange( rStrm );
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 10a0657c7899..5f89b7933449 100755
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -329,6 +329,24 @@ XclChLabelRange::XclChLabelRange() :
// ----------------------------------------------------------------------------
+XclChDateRange::XclChDateRange() :
+ mnMinDate( 0 ),
+ mnMaxDate( 0 ),
+ mnMajorStep( 0 ),
+ mnMajorUnit( EXC_CHDATERANGE_DAYS ),
+ mnMinorStep( 0 ),
+ mnMinorUnit( EXC_CHDATERANGE_DAYS ),
+ mnBaseUnit( EXC_CHDATERANGE_DAYS ),
+ mnCross( 0 ),
+ mnFlags( EXC_CHDATERANGE_AUTOMIN | EXC_CHDATERANGE_AUTOMAX |
+ EXC_CHDATERANGE_AUTOMAJOR | EXC_CHDATERANGE_AUTOMINOR |
+ EXC_CHDATERANGE_AUTOBASE | EXC_CHDATERANGE_AUTOCROSS |
+ EXC_CHDATERANGE_AUTODATE )
+{
+}
+
+// ----------------------------------------------------------------------------
+
XclChValueRange::XclChValueRange() :
mfMin( 0.0 ),
mfMax( 0.0 ),
@@ -336,7 +354,8 @@ XclChValueRange::XclChValueRange() :
mfMinorStep( 0.0 ),
mfCross( 0.0 ),
mnFlags( EXC_CHVALUERANGE_AUTOMIN | EXC_CHVALUERANGE_AUTOMAX |
- EXC_CHVALUERANGE_AUTOMAJOR | EXC_CHVALUERANGE_AUTOMINOR | EXC_CHVALUERANGE_AUTOCROSS | EXC_CHVALUERANGE_BIT8 )
+ EXC_CHVALUERANGE_AUTOMAJOR | EXC_CHVALUERANGE_AUTOMINOR |
+ EXC_CHVALUERANGE_AUTOCROSS | EXC_CHVALUERANGE_BIT8 )
{
}
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index c6d6c5b9246a..d8dbcabfe4df 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -326,6 +326,12 @@ DateTime XclRoot::GetNullDate() const
return *GetFormatter().GetNullDate();
}
+sal_uInt16 XclRoot::GetBaseYear() const
+{
+ // return 1904 for 1904-01-01, and 1900 for 1899-12-30
+ return (GetNullDate().GetYear() == 1904) ? 1904 : 1900;
+}
+
double XclRoot::GetDoubleFromDateTime( const DateTime& rDateTime ) const
{
double fValue = rDateTime - GetNullDate();
diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx
index 5bb75e029210..5178d6d99968 100644
--- a/sc/source/filter/inc/xechart.hxx
+++ b/sc/source/filter/inc/xechart.hxx
@@ -47,6 +47,10 @@ namespace com { namespace sun { namespace star {
{
class XModel;
}
+ namespace chart
+ {
+ class XAxis;
+ }
namespace chart2
{
struct ScaleData;
@@ -1011,18 +1015,21 @@ public:
explicit XclExpChLabelRange( const XclExpChRoot& rRoot );
/** Converts category axis scaling settings. */
- void Convert( const ::com::sun::star::chart2::ScaleData& rScaleData, bool bMirrorOrient );
+ void Convert( const ::com::sun::star::chart2::ScaleData& rScaleData,
+ const ScfPropertySet& rChart1Axis, bool bMirrorOrient );
/** Converts position settings of a crossing axis at this axis. */
void ConvertAxisPosition( const ScfPropertySet& rPropSet );
/** Sets flag for tickmark position between categories or on categories. */
inline void SetTicksBetweenCateg( bool bTicksBetween )
- { ::set_flag( maData.mnFlags, EXC_CHLABELRANGE_BETWEEN, bTicksBetween ); }
+ { ::set_flag( maLabelData.mnFlags, EXC_CHLABELRANGE_BETWEEN, bTicksBetween ); }
private:
+ virtual void Save( XclExpStream& rStrm );
virtual void WriteBody( XclExpStream& rStrm );
private:
- XclChLabelRange maData; /// Contents of the CHLABELRANGE record.
+ XclChLabelRange maLabelData; /// Contents of the CHLABELRANGE record.
+ XclChDateRange maDateData; /// Contents of the CHDATERANGE record.
};
typedef ScfRef< XclExpChLabelRange > XclExpChLabelRangeRef;
@@ -1085,6 +1092,7 @@ class XclExpChAxis : public XclExpChGroupBase, public XclExpChFontBase
public:
typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram > XDiagramRef;
typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > XAxisRef;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::chart::XAxis > XChart1AxisRef;
public:
explicit XclExpChAxis( const XclExpChRoot& rRoot, sal_uInt16 nAxisType );
@@ -1095,7 +1103,8 @@ public:
virtual void SetRotation( sal_uInt16 nRotation );
/** Converts formatting and scaling settings from the passed axis. */
- void Convert( XAxisRef xAxis, XAxisRef xCrossingAxis, const XclChExtTypeInfo& rTypeInfo );
+ void Convert( XAxisRef xAxis, XAxisRef xCrossingAxis,
+ XChart1AxisRef xChart1Axis, const XclChExtTypeInfo& rTypeInfo );
/** Converts and writes 3D wall/floor properties from the passed diagram. */
void ConvertWall( XDiagramRef xDiagram );
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index d8289b3b671b..0fbde9db0905 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -1134,13 +1134,16 @@ public:
explicit XclImpChLabelRange( const XclImpChRoot& rRoot );
/** Reads the CHLABELRANGE record (category axis scaling properties). */
void ReadChLabelRange( XclImpStream& rStrm );
+ /** Reads the CHDATERANGE record (date axis scaling properties). */
+ void ReadChDateRange( XclImpStream& rStrm );
/** Converts category axis scaling settings. */
void Convert( ScfPropertySet& rPropSet, ScaleData& rScaleData, bool bMirrorOrient ) const;
/** Converts position settings of this axis at a crossing axis. */
void ConvertAxisPosition( ScfPropertySet& rPropSet, bool b3dChart ) const;
private:
- XclChLabelRange maData; /// Contents of the CHLABELRANGE record.
+ XclChLabelRange maLabelData; /// Contents of the CHLABELRANGE record.
+ XclChDateRange maDateData; /// Contents of the CHDATERANGE record.
};
typedef ScfRef< XclImpChLabelRange > XclImpChLabelRangeRef;
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 13eda8619cc0..68186a238847 100755
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -101,6 +101,7 @@ class XclRoot;
#define EXC_CHPROP_ERRORBARX CREATE_OUSTRING( "ErrorBarX" )
#define EXC_CHPROP_ERRORBARY CREATE_OUSTRING( "ErrorBarY" )
#define EXC_CHPROP_EXPANSION CREATE_OUSTRING( "Expansion" )
+#define EXC_CHPROP_EXPTIMEINCREMENT CREATE_OUSTRING( "ExplicitTimeIncrement" )
#define EXC_CHPROP_FILLBITMAPMODE CREATE_OUSTRING( "FillBitmapMode" )
#define EXC_CHPROP_FILLSTYLE CREATE_OUSTRING( "FillStyle" )
#define EXC_CHPROP_GAPWIDTHSEQ CREATE_OUSTRING( "GapwidthSequence" )
@@ -721,6 +722,23 @@ const sal_uInt8 EXC_CH3DDATAFORMAT_TRUNC = 2; /// Shart top, trunc
const sal_uInt16 EXC_ID_CHPIEEXT = 0x1061;
+// (0x1062) CHDATERANGE -------------------------------------------------------
+
+const sal_uInt16 EXC_ID_CHDATERANGE = 0x1062;
+
+const sal_uInt16 EXC_CHDATERANGE_AUTOMIN = 0x0001;
+const sal_uInt16 EXC_CHDATERANGE_AUTOMAX = 0x0002;
+const sal_uInt16 EXC_CHDATERANGE_AUTOMAJOR = 0x0004;
+const sal_uInt16 EXC_CHDATERANGE_AUTOMINOR = 0x0008;
+const sal_uInt16 EXC_CHDATERANGE_DATEAXIS = 0x0010;
+const sal_uInt16 EXC_CHDATERANGE_AUTOBASE = 0x0020;
+const sal_uInt16 EXC_CHDATERANGE_AUTOCROSS = 0x0040; /// Other axis crosses at own maximum.
+const sal_uInt16 EXC_CHDATERANGE_AUTODATE = 0x0080; /// Recognize date/text automatically.
+
+const sal_uInt16 EXC_CHDATERANGE_DAYS = 0;
+const sal_uInt16 EXC_CHDATERANGE_MONTHS = 1;
+const sal_uInt16 EXC_CHDATERANGE_YEARS = 2;
+
// (0x1066) CHESCHERFORMAT ----------------------------------------------------
const sal_uInt16 EXC_ID_CHESCHERFORMAT = 0x1066;
@@ -1054,6 +1072,23 @@ struct XclChLabelRange
// ----------------------------------------------------------------------------
+struct XclChDateRange
+{
+ sal_uInt16 mnMinDate; /// Minimum value on axis.
+ sal_uInt16 mnMaxDate; /// Maximum value on axis.
+ sal_uInt16 mnMajorStep; /// Distance for major grid lines.
+ sal_uInt16 mnMajorUnit; /// Time unit for major step.
+ sal_uInt16 mnMinorStep; /// Distance for minor grid lines.
+ sal_uInt16 mnMinorUnit; /// Time unit for minor step.
+ sal_uInt16 mnBaseUnit; /// Time unit for axis values.
+ sal_uInt16 mnCross; /// Crossing position of other axis.
+ sal_uInt16 mnFlags; /// Additional flags.
+
+ explicit XclChDateRange();
+};
+
+// ----------------------------------------------------------------------------
+
struct XclChValueRange
{
double mfMin; /// Minimum value on axis.
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index 44ded449cd76..af42efcdb426 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -239,6 +239,8 @@ public:
SvNumberFormatter& GetFormatter() const;
/** Returns the null date of the current number formatter. */
DateTime GetNullDate() const;
+ /** Returns the base year depending on the current null date (1900 or 1904). */
+ sal_uInt16 GetBaseYear() const;
/** Converts a date/time value to a floating-point value. */
double GetDoubleFromDateTime( const DateTime& rDateTime ) const;
/** Converts a floating-point value to a date/time value. */
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index 341445431cc8..a2ce08890c30 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -171,6 +171,7 @@ void ScXMLTableRowContext::EndElement()
sal_Int32 nSheet = rXMLImport.GetTables().GetCurrentSheet();
sal_Int32 nCurrentRow(rXMLImport.GetTables().GetCurrentRow());
uno::Reference<sheet::XSpreadsheet> xSheet(rXMLImport.GetTables().GetCurrentXSheet());
+ ScDocument* pDoc = rXMLImport.GetDocument();
if(xSheet.is())
{
sal_Int32 nFirstRow(nCurrentRow - nRepeatedRows + 1);
@@ -218,10 +219,18 @@ void ScXMLTableRowContext::EndElement()
bVisible = sal_False;
bFiltered = sal_True;
}
- if (!bVisible)
- xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)), uno::makeAny(bVisible));
- if (bFiltered)
- xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)), uno::makeAny(bFiltered));
+
+ // #i116164# call SetRowHidden/SetRowFiltered directly, so the tree doesn't have to be rebuilt
+ // to compare with existing hidden flags.
+ if (!bVisible && pDoc)
+ pDoc->SetRowHidden((SCROW)nFirstRow, (SCROW)nCurrentRow, (SCTAB)nSheet, true);
+ if (bFiltered && pDoc)
+ pDoc->SetRowFiltered((SCROW)nFirstRow, (SCROW)nCurrentRow, (SCTAB)nSheet, true);
+
+ //if (!bVisible)
+ // xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)), uno::makeAny(bVisible));
+ //if (bFiltered)
+ // xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)), uno::makeAny(bFiltered));
}
}
}
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index f7a02e1577f7..56cfb98afc9c 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -58,7 +58,6 @@
#include <vcl/status.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/printer.hxx>
#include <editeng/langitem.hxx>
#include <svtools/colorcfg.hxx>
@@ -391,20 +390,14 @@ void ScModule::Execute( SfxRequest& rReq )
{
String aMacroName =
String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Template.Samples.ShowStyles"));
- SfxApplication* pApp = SFX_APP();
- pApp->EnterBasicCall();
- pApp->GetMacroConfig()->Call( NULL, aMacroName, pApp->GetBasicManager() );
- pApp->LeaveBasicCall();
+ SfxApplication::CallAppBasic( aMacroName );
}
break;
case SID_EURO_CONVERTER:
{
String aMacroName =
String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Euro.ConvertRun.Main"));
- SfxApplication* pApp = SFX_APP();
- pApp->EnterBasicCall();
- pApp->GetMacroConfig()->Call( NULL, aMacroName, pApp->GetBasicManager() );
- pApp->LeaveBasicCall();
+ SfxApplication::CallAppBasic( aMacroName );
}
break;
case SID_AUTOSPELL_CHECK:
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 50d95fbd677d..5e4a9c97808a 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1137,7 +1137,7 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const String& rNoteText, con
if (aTester.IsEditable())
{
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
- SfxUndoManager* pUndoMgr = (pDrawLayer && rDoc.IsUndoEnabled()) ? rDocShell.GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoMgr = (pDrawLayer && rDoc.IsUndoEnabled()) ? rDocShell.GetUndoManager() : 0;
ScNoteData aOldData;
ScPostIt* pOldNote = rDoc.ReleaseNote( rPos );
@@ -1741,8 +1741,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
}
rDocShell.GetUndoManager()->LeaveListAction();
- SfxUndoManager* pMgr = rDocShell.GetUndoManager();
- pMgr->RemoveLastUndoAction();
+ rDocShell.GetUndoManager()->RemoveLastUndoAction();
delete pRefUndoDoc;
delete pUndoData;
@@ -2618,7 +2617,6 @@ script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule )
void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String& sSource )
{
- SFX_APP()->EnterBasicCall();
SfxObjectShell& rDocSh = *rDoc.GetDocumentShell();
uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.GetBasicContainer();
DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
@@ -2662,12 +2660,10 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String
}
}
- SFX_APP()->LeaveBasicCall();
}
void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName )
{
- SFX_APP()->EnterBasicCall();
uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.GetBasicContainer();
DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
@@ -2689,7 +2685,6 @@ void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName )
xVBAModuleInfo->removeModuleInfo( sModuleName );
}
- SFX_APP()->LeaveBasicCall();
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 901363785cc9..5d9af06a7d65 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2581,7 +2581,7 @@ __EXPORT ScDocShell::~ScDocShell()
//------------------------------------------------------------------
-SfxUndoManager* __EXPORT ScDocShell::GetUndoManager()
+::svl::IUndoManager* __EXPORT ScDocShell::GetUndoManager()
{
return aDocument.GetUndoManager();
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 5de8b17b0598..dee4c3060578 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -108,6 +108,7 @@ using namespace ::com::sun::star;
#include "chgviset.hxx"
#include "reffact.hxx"
#include "chartlis.hxx"
+#include "chartpos.hxx"
#include "waitoff.hxx"
#include "tablink.hxx" // ScDocumentLoader statics
#include "drwlayer.hxx"
@@ -377,19 +378,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
BOOL bOk = TRUE;
if ( !bAddRange && ( !bColInit || !bRowInit ) )
{
- // Spalten/Zeilenkoepfe testen wie in chartarr
+ ScChartPositioner aChartPositioner( &aDocument, nTab, nCol1,nRow1, nCol2,nRow2 );
if (!bColInit)
- {
- for (SCCOL i=nCol1; i<=nCol2 && bColHeaders; i++)
- if (aDocument.HasValueData( i, nRow1, nTab ))
- bColHeaders = FALSE;
- }
+ bColHeaders = aChartPositioner.HasColHeaders();
if (!bRowInit)
- {
- for (SCROW i=nRow1; i<=nRow2 && bRowHeaders; i++)
- if (aDocument.HasValueData( nCol1, i, nTab ))
- bRowHeaders = FALSE;
- }
+ bRowHeaders = aChartPositioner.HasRowHeaders();
//CHINA001 ScColRowLabelDlg aDlg( pParent, bRowHeaders, bColHeaders );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 7fa31246275a..ba39316768b7 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -1392,7 +1392,8 @@ static ScTokenArray* lcl_convertToTokenArray(ScDocument* pSrcDoc, ScRange& rRang
// Only loop within the data area.
SCCOL nDataCol1 = nCol1, nDataCol2 = nCol2;
SCROW nDataRow1 = nRow1, nDataRow2 = nRow2;
- if (!pSrcDoc->ShrinkToDataArea(nTab, nDataCol1, nDataRow1, nDataCol2, nDataRow2))
+ bool bShrunk;
+ if (!pSrcDoc->ShrinkToUsedDataArea( bShrunk, nTab, nDataCol1, nDataRow1, nDataCol2, nDataRow2, false))
// no data within specified range.
continue;
@@ -1708,8 +1709,8 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
SCCOL nDataCol1 = 0, nDataCol2 = MAXCOL;
SCROW nDataRow1 = 0, nDataRow2 = MAXROW;
- pSrcDoc->ShrinkToDataArea(nTab, nDataCol1, nDataRow1, nDataCol2, nDataRow2);
- if (rCell.Col() < nDataCol1 || nDataCol2 < rCell.Col() || rCell.Row() < nDataRow1 || nDataRow2 < rCell.Row())
+ bool bData = pSrcDoc->ShrinkToDataArea(nTab, nDataCol1, nDataRow1, nDataCol2, nDataRow2);
+ if (!bData || rCell.Col() < nDataCol1 || nDataCol2 < rCell.Col() || rCell.Row() < nDataRow1 || nDataRow2 < rCell.Row())
{
// requested cell is outside the data area. Don't even bother caching
// this data, but add it to the cached range to prevent accessing the
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 7da571fc05a7..fc3ceadd3a92 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -68,7 +68,7 @@ ScDrawShell::ScDrawShell( ScViewData* pData ) :
pViewData( pData )
{
SetPool( &pViewData->GetScDrawView()->GetModel()->GetItemPool() );
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index a5159d8a8043..df1c82b17c40 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -127,7 +127,7 @@ ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) :
SetPool( pViewData->GetScDrawView()->GetDefaultAttr().GetPool() );
// UndoManager wird beim Umschalten in den Edit-Modus umgesetzt...
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 534e68705fa8..1800dc53a744 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -85,7 +85,7 @@ void FuText::StopEditMode(BOOL /*bTextDirection*/)
}
ScDocShell* pDocShell = rViewData.GetDocShell();
- SfxUndoManager* pUndoMgr = rDoc.IsUndoEnabled() ? pDocShell->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoMgr = rDoc.IsUndoEnabled() ? pDocShell->GetUndoManager() : 0;
bool bNewNote = false;
if( pNote && pUndoMgr )
{
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index fe94db107be0..132652891959 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -187,7 +187,8 @@ public:
virtual void Activate();
virtual void Deactivate();
- virtual SfxUndoManager* GetUndoManager();
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
virtual void FillClass( SvGlobalName * pClassName,
sal_uInt32 * pFormat,
@@ -325,6 +326,8 @@ public:
void PostPaintGridAll();
void PostPaintExtras();
+ bool IsPaintLocked() const { return pPaintLockData != NULL; }
+
void PostDataChanged();
void UpdatePaintExt( USHORT& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index c3316092d044..69832218f172 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -346,7 +346,7 @@ public:
BOOL IsDrawTextShell() const;
BOOL IsAuditShell() const;
- void SetDrawTextUndo( SfxUndoManager* pUndoMgr );
+ void SetDrawTextUndo( ::svl::IUndoManager* pUndoMgr );
void FillFieldData( ScHeaderFieldData& rData );
diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx
index 6f2bb3572832..ea7885b2859b 100644
--- a/sc/source/ui/inc/undobase.hxx
+++ b/sc/source/ui/inc/undobase.hxx
@@ -31,6 +31,7 @@
#include <svl/undo.hxx>
#include "global.hxx"
#include "address.hxx"
+#include "docsh.hxx"
class ScDocument;
class ScDocShell;
@@ -53,6 +54,10 @@ protected:
ScDocShell* pDocShell;
SfxUndoAction* pDetectiveUndo;
+ bool IsPaintLocked() const { return pDocShell->IsPaintLocked(); }
+
+ bool SetViewMarkData( const ScMarkData& rMarkData );
+
void BeginUndo();
void EndUndo();
void BeginRedo();
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index fffb76ebd061..793b416fbee4 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -66,6 +66,19 @@ __EXPORT ScSimpleUndo::~ScSimpleUndo()
delete pDetectiveUndo;
}
+bool ScSimpleUndo::SetViewMarkData( const ScMarkData& rMarkData )
+{
+ if ( IsPaintLocked() )
+ return false;
+
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if ( !pViewShell )
+ return false;
+
+ pViewShell->SetMarkData( rMarkData );
+ return true;
+}
+
BOOL __EXPORT ScSimpleUndo::Merge( SfxUndoAction *pNextAction )
{
// Zu jeder Undo-Action kann eine SdrUndoGroup fuer das Aktualisieren
@@ -253,6 +266,9 @@ BOOL ScBlockUndo::AdjustHeight()
void ScBlockUndo::ShowBlock()
{
+ if ( IsPaintLocked() )
+ return;
+
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 3fb2c74a9954..556cd3c82d93 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1600,10 +1600,8 @@ String __EXPORT ScUndoSelectionStyle::GetComment() const
void ScUndoSelectionStyle::DoChange( const BOOL bUndo )
{
ScDocument* pDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
ScRange aWorkRange( aRange );
if ( pDoc->HasAttrib( aWorkRange, HASATTR_MERGED ) ) // zusammengefasste Zellen?
@@ -1635,6 +1633,7 @@ void ScUndoSelectionStyle::DoChange( const BOOL bUndo )
pDocShell->UpdatePaintExt( nExtFlags, aWorkRange );
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if ( !( (pViewShell) && pViewShell->AdjustBlockHeight() ) )
/*A*/ pDocShell->PostPaint( aWorkRange, PAINT_GRID | PAINT_EXTRAS, nExtFlags );
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 2ab03eb71923..a7ddfaf6f23f 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -113,18 +113,13 @@ void __EXPORT ScUndoWidthOrHeight::Undo()
BeginUndo();
ScDocument* pDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
SCCOLROW nPaintStart = nStart > 0 ? nStart-1 : static_cast<SCCOLROW>(0);
if (eMode==SC_SIZE_OPTIMAL)
{
- if (pViewShell)
- {
- pViewShell->SetMarkData( aMarkData );
-
+ if ( SetViewMarkData( aMarkData ) )
nPaintStart = 0; // paint all, because of changed selection
- }
}
//! outlines from all tables?
@@ -155,6 +150,7 @@ void __EXPORT ScUndoWidthOrHeight::Undo()
DoSdrUndoAction( pDrawUndo, pDoc );
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
pViewShell->UpdateScrollBars();
@@ -171,19 +167,14 @@ void __EXPORT ScUndoWidthOrHeight::Redo()
{
BeginRedo();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
-
BOOL bPaintAll = FALSE;
if (eMode==SC_SIZE_OPTIMAL)
{
- if (pViewShell)
- {
- pViewShell->SetMarkData( aMarkData );
-
+ if ( SetViewMarkData( aMarkData ) )
bPaintAll = TRUE; // paint all, because of changed selection
- }
}
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
@@ -192,7 +183,8 @@ void __EXPORT ScUndoWidthOrHeight::Redo()
}
// SetWidthOrHeight aendert aktuelle Tabelle !
- pViewShell->SetWidthOrHeight( bWidth, nRangeCnt, pRanges, eMode, nNewSize, FALSE, TRUE, &aMarkData );
+ if ( pViewShell )
+ pViewShell->SetWidthOrHeight( bWidth, nRangeCnt, pRanges, eMode, nNewSize, FALSE, TRUE, &aMarkData );
// paint grid if selection was changed directly at the MarkData
if (bPaintAll)
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 506afeac138e..6a9c7e12af23 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -147,10 +147,8 @@ void ScUndoDeleteContents::SetChangeTrack()
void ScUndoDeleteContents::DoChange( const BOOL bUndo )
{
ScDocument* pDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
USHORT nExtFlags = 0;
@@ -195,6 +193,7 @@ void ScUndoDeleteContents::DoChange( const BOOL bUndo )
SetChangeTrack();
}
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if ( !( (pViewShell) && pViewShell->AdjustRowHeight(
aRange.aStart.Row(), aRange.aEnd.Row() ) ) )
/*A*/ pDocShell->PostPaint( aRange, PAINT_GRID | PAINT_EXTRAS, nExtFlags );
@@ -341,10 +340,8 @@ void ScUndoFillTable::SetChangeTrack()
void ScUndoFillTable::DoChange( const BOOL bUndo )
{
ScDocument* pDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
if (bUndo) // nur Undo
{
@@ -379,6 +376,7 @@ void ScUndoFillTable::DoChange( const BOOL bUndo )
// CellContentChanged kommt mit der Markierung
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
SCTAB nTab = pViewShell->GetViewData()->GetTabNo();
@@ -485,10 +483,8 @@ String __EXPORT ScUndoSelectionAttr::GetComment() const
void ScUndoSelectionAttr::DoChange( const BOOL bUndo )
{
ScDocument* pDoc = pDocShell->GetDocument();
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
ScRange aEffRange( aRange );
if ( pDoc->HasAttrib( aEffRange, HASATTR_MERGED ) ) // zusammengefasste Zellen?
@@ -515,6 +511,7 @@ void ScUndoSelectionAttr::DoChange( const BOOL bUndo )
pDoc->ApplySelectionFrame( aMarkData, pLineOuter, pLineInner );
}
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if ( !( (pViewShell) && pViewShell->AdjustBlockHeight() ) )
/*A*/ pDocShell->PostPaint( aEffRange, PAINT_GRID | PAINT_EXTRAS, nExtFlags );
@@ -1165,8 +1162,7 @@ void __EXPORT ScUndoReplace::Undo()
DBG_ASSERT(pSearchItem->GetCommand() == SVX_SEARCHCMD_REPLACE_ALL,
"ScUndoReplace:: Falscher Modus");
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
//! markierte Tabellen
//! Bereich merken ?
@@ -1243,7 +1239,7 @@ void __EXPORT ScUndoReplace::Redo()
{
if (pViewShell)
{
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
pViewShell->SearchAndReplace( pSearchItem, FALSE, TRUE );
}
@@ -1466,9 +1462,7 @@ void ScUndoConversion::DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPo
ScDocument* pDoc = pDocShell->GetDocument();
ShowTable( rCursorPos.Tab() );
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
SCTAB nTabCount = pDoc->GetTableCount();
// Undo/Redo-doc has only selected tables
@@ -1575,9 +1569,7 @@ void ScUndoRefConversion::DoChange( ScDocument* pRefDoc)
ShowTable(aRange);
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
ScRange aCopyRange = aRange;
SCTAB nTabCount = pDoc->GetTableCount();
@@ -1586,6 +1578,7 @@ void ScUndoRefConversion::DoChange( ScDocument* pRefDoc)
pRefDoc->CopyToDocument( aCopyRange, nFlags, bMulti, pDoc, &aMarkData );
pDocShell->PostPaint( aRange, PAINT_GRID);
pDocShell->PostDataChanged();
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
pViewShell->CellContentChanged();
}
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index d9acc34bf28c..c6cce0bee4bd 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -891,9 +891,7 @@ void ScUndoMakeScenario::Undo()
void ScUndoMakeScenario::Redo()
{
- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- if (pViewShell)
- pViewShell->SetMarkData( aMarkData );
+ SetViewMarkData( aMarkData );
RedoSdrUndoAction( pDrawUndo ); // Draw Redo first
@@ -905,6 +903,7 @@ void ScUndoMakeScenario::Redo()
bDrawIsInUndo = FALSE;
pDocShell->SetInUndo( FALSE );
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
pViewShell->SetTabNo( nDestTab, TRUE );
diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx
index 168975cdda3a..9cd32381c8a5 100644
--- a/sc/source/ui/undo/undoutil.cxx
+++ b/sc/source/ui/undo/undoutil.cxx
@@ -43,10 +43,13 @@
#include "globstr.hrc"
#include "global.hxx"
-void ScUndoUtil::MarkSimpleBlock( ScDocShell* /* pDocShell */,
+void ScUndoUtil::MarkSimpleBlock( ScDocShell* pDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ )
{
+ if ( pDocShell->IsPaintLocked() )
+ return;
+
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 30d4bd4d39a0..290b34a949ca 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -481,7 +481,6 @@ void SAL_CALL
ScVbaApplication::wait( double time ) throw (uno::RuntimeException)
{
StarBASIC* pBasic = SFX_APP()->GetBasic();
- SFX_APP()->EnterBasicCall();
SbxArrayRef aArgs = new SbxArray;
SbxVariableRef aRef = new SbxVariable;
aRef->PutDouble( time );
@@ -495,8 +494,6 @@ ScVbaApplication::wait( double time ) throw (uno::RuntimeException)
// forces a broadcast
SbxVariableRef pNew = new SbxMethod( *((SbxMethod*)pMeth));
}
- SFX_APP()->LeaveBasicCall();
-
}
uno::Any SAL_CALL
@@ -1164,7 +1161,6 @@ uno::Any SAL_CALL
ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeException )
{
StarBASIC* pBasic = SFX_APP()->GetBasic();
- SFX_APP()->EnterBasicCall();
SbMethod* pMeth = (SbMethod*)pBasic->GetRtl()->Find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FuncCaller") ), SbxCLASS_METHOD );
uno::Any aRet;
if ( pMeth )
@@ -1175,7 +1171,6 @@ ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeExcep
OSL_TRACE("pNew has type %d and string value %s", pNew->GetType(), rtl::OUStringToOString( pNew->GetString(), RTL_TEXTENCODING_UTF8 ).getStr() );
aRet = sbxToUnoValue( pNew );
}
- SFX_APP()->LeaveBasicCall();
return aRet;
}
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 2c80c154759d..ea081b6f2fa6 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -68,7 +68,7 @@ ScAuditingShell::ScAuditingShell(ScViewData* pData) :
nFunction( SID_FILL_ADD_PRED )
{
SetPool( &pViewData->GetViewShell()->GetPool() );
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 1e5a6b9da4ae..f2a277b987df 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -159,7 +159,10 @@ ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode, ScGetDBSelection e
ScDocument* pDoc = pDocSh->GetDocument();
SCCOL nCol1 = aRange.aStart.Col(), nCol2 = aRange.aEnd.Col();
SCROW nRow1 = aRange.aStart.Row(), nRow2 = aRange.aEnd.Row();
- if (pDoc->ShrinkToUsedDataArea( aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly))
+ bool bShrunk;
+ pDoc->ShrinkToUsedDataArea( bShrunk, aRange.aStart.Tab(),
+ nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly);
+ if (bShrunk)
{
aRange.aStart.SetCol(nCol1);
aRange.aEnd.SetCol(nCol2);
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index dbdeae1ae0b1..1ac653f88b70 100755..100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -2187,7 +2187,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
pInsDoc->GetCellArea( nNewTab, nEndCol, nEndRow );
pInsDoc->SetClipArea( ScRange( 0, 0, nNewTab, nEndCol, nEndRow, nNewTab ) );
- SfxUndoManager* pMgr = GetViewData()->GetDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = GetViewData()->GetDocShell()->GetUndoManager();
String aUndo = ScGlobal::GetRscString( STR_UNDO_DOOUTLINE );
pMgr->EnterListAction( aUndo, aUndo );
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 3307398b5ef8..1d748246a1d6 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -763,7 +763,7 @@ void ScDrawView::DeleteMarked()
(void)pCaptObj; // prevent 'unused variable' compiler warning in pro builds
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
ScDocShell* pDocShell = pViewData ? pViewData->GetDocShell() : 0;
- SfxUndoManager* pUndoMgr = pDocShell ? pDocShell->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoMgr = pDocShell ? pDocShell->GetUndoManager() : 0;
bool bUndo = pDrawLayer && pDocShell && pUndoMgr && pDoc->IsUndoEnabled();
// remove the cell note from document, we are its owner now
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 848a0a3c7636..269017804c3c 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1174,7 +1174,7 @@ void ScEditShell::GetUndoState(SfxItemSet &rSet)
EditView* pTopView = pHdl->GetTopView();
if (pTopView)
{
- SfxUndoManager& rTopMgr = pTopView->GetEditEngine()->GetUndoManager();
+ ::svl::IUndoManager& rTopMgr = pTopView->GetEditEngine()->GetUndoManager();
if ( rTopMgr.GetUndoActionCount() == 0 )
rSet.DisableItem( SID_UNDO );
if ( rTopMgr.GetRedoActionCount() == 0 )
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 3ff7222178f3..377ebed987f2 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -161,7 +161,7 @@ ScFormatShell::ScFormatShell(ScViewData* pData) :
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
SetPool( &pTabViewShell->GetPool() );
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 0f07b8772254..d7f0be025574 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1884,7 +1884,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
if (nMouseStatus == SC_GM_WATERUNDO) // Undo im Giesskannenmodus
{
- SfxUndoManager* pMgr = pViewData->GetDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetDocShell()->GetUndoManager();
if ( pMgr->GetUndoActionCount() && pMgr->GetUndoActionId() == STR_UNDO_APPLYCELLSTYLE )
pMgr->Undo();
else
diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx
index 0e792b2bb279..d5e3450f3e5a 100644
--- a/sc/source/ui/view/pgbrksh.cxx
+++ b/sc/source/ui/view/pgbrksh.cxx
@@ -67,7 +67,7 @@ ScPageBreakShell::ScPageBreakShell( ScTabViewShell* pViewSh ) :
{
SetPool( &pViewSh->GetPool() );
ScViewData* pViewData = pViewSh->GetViewData();
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index a65f86ffed2c..b7f2e2234438 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -76,7 +76,7 @@ ScPivotShell::ScPivotShell( ScTabViewShell* pViewSh ) :
{
SetPool( &pViewSh->GetPool() );
ScViewData* pViewData = pViewSh->GetViewData();
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 4596880b7fb6..f23ed39b34c5 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1116,7 +1116,7 @@ BOOL ScTabViewShell::IsAuditShell() const
return ( pAuditingShell && ( GetMySubShell() == pAuditingShell ) );
}
-void ScTabViewShell::SetDrawTextUndo( SfxUndoManager* pNewUndoMgr )
+void ScTabViewShell::SetDrawTextUndo( ::svl::IUndoManager* pNewUndoMgr )
{
// Default: Undo-Manager der DocShell
if (!pNewUndoMgr)
@@ -1640,7 +1640,7 @@ void ScTabViewShell::Construct( BYTE nForceDesignMode )
MakeDrawView( nForceDesignMode );
ViewOptionsHasChanged(FALSE); // legt auch evtl. DrawView an
- SfxUndoManager* pMgr = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pDocSh->GetUndoManager();
SetUndoManager( pMgr );
pFormShell->SetUndoManager( pMgr );
if ( !pDoc->IsUndoEnabled() )
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 7734f3e24ff8..9700fe3dca3f 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -34,7 +34,6 @@
#define _ZFORLIST_DECLARE_TABLE
#include "scitems.hxx"
-#include <svl/slstitm.hxx>
#include <svl/stritem.hxx>
#include <svl/whiter.hxx>
#include <svl/zformat.hxx>
@@ -738,92 +737,6 @@ void __EXPORT ScTabViewShell::GetSaveState( SfxItemSet& rSet )
//------------------------------------------------------------------
-void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
-{
- SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
- SfxUndoManager* pUndoManager = pSh->GetUndoManager();
-
- const SfxItemSet* pReqArgs = rReq.GetArgs();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
-
- USHORT nSlot = rReq.GetSlot();
- switch ( nSlot )
- {
- case SID_UNDO:
- case SID_REDO:
- if ( pUndoManager )
- {
- BOOL bIsUndo = ( nSlot == SID_UNDO );
-
- USHORT nCount = 1;
- const SfxPoolItem* pItem;
- if ( pReqArgs && pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
- nCount = ((const SfxUInt16Item*)pItem)->GetValue();
-
- // lock paint for more than one cell undo action (not for editing within a cell)
- BOOL bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() );
- if ( bLockPaint )
- pDocSh->LockPaint();
-
- for (USHORT i=0; i<nCount; i++)
- {
- if ( bIsUndo )
- pUndoManager->Undo(0);
- else
- pUndoManager->Redo(0);
- }
-
- if ( bLockPaint )
- pDocSh->UnlockPaint();
-
- GetViewFrame()->GetBindings().InvalidateAll(sal_False);
- }
- break;
-// default:
-// GetViewFrame()->ExecuteSlot( rReq );
- }
-}
-
-void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
-{
- SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
- SfxUndoManager* pUndoManager = pSh->GetUndoManager();
-
- SfxWhichIter aIter(rSet);
- USHORT nWhich = aIter.FirstWhich();
- while ( nWhich )
- {
- switch (nWhich)
- {
- case SID_GETUNDOSTRINGS:
- case SID_GETREDOSTRINGS:
- {
- SfxStringListItem aStrLst( nWhich );
- if ( pUndoManager )
- {
- List* pList = aStrLst.GetList();
- BOOL bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
- USHORT nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
- for (USHORT i=0; i<nCount; i++)
- pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
- pUndoManager->GetRedoActionComment(i) ),
- LIST_APPEND );
- }
- rSet.Put( aStrLst );
- }
- break;
- default:
- // get state from sfx view frame
- GetViewFrame()->GetSlotState( nWhich, NULL, &rSet );
- }
-
- nWhich = aIter.NextWhich();
- }
-}
-
-
-//------------------------------------------------------------------
-
void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq )
{
ScViewOptions aViewOptions = GetViewData()->GetOptions();
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index c6d9b004b9ba..b13707a8378b 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -61,9 +61,11 @@
#include <sfx2/viewfrm.hxx>
#include <svtools/soerr.hxx>
#include <svl/rectitem.hxx>
+#include <svl/slstitm.hxx>
#include <svl/whiter.hxx>
#include <unotools/moduleoptions.hxx>
#include <sot/exchange.hxx>
+#include <tools/diagnose_ex.h>
#include "tabvwsh.hxx"
#include "globstr.hrc"
@@ -487,5 +489,98 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
}
+//------------------------------------------------------------------
+
+void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
+{
+ SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ ::svl::IUndoManager* pUndoManager = pSh->GetUndoManager();
+
+ const SfxItemSet* pReqArgs = rReq.GetArgs();
+ ScDocShell* pDocSh = GetViewData()->GetDocShell();
+
+ USHORT nSlot = rReq.GetSlot();
+ switch ( nSlot )
+ {
+ case SID_UNDO:
+ case SID_REDO:
+ if ( pUndoManager )
+ {
+ BOOL bIsUndo = ( nSlot == SID_UNDO );
+
+ USHORT nCount = 1;
+ const SfxPoolItem* pItem;
+ if ( pReqArgs && pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
+ nCount = ((const SfxUInt16Item*)pItem)->GetValue();
+
+ // lock paint for more than one cell undo action (not for editing within a cell)
+ BOOL bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() );
+ if ( bLockPaint )
+ pDocSh->LockPaint();
+
+ try
+ {
+ for (USHORT i=0; i<nCount; i++)
+ {
+ if ( bIsUndo )
+ pUndoManager->Undo();
+ else
+ pUndoManager->Redo();
+ }
+ }
+ catch ( const uno::Exception& )
+ {
+ // no need to handle. By definition, the UndoManager handled this by clearing the
+ // Undo/Redo stacks
+ }
+
+ if ( bLockPaint )
+ pDocSh->UnlockPaint();
+
+ GetViewFrame()->GetBindings().InvalidateAll(sal_False);
+ }
+ break;
+// default:
+// GetViewFrame()->ExecuteSlot( rReq );
+ }
+}
+
+void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
+{
+ SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ ::svl::IUndoManager* pUndoManager = pSh->GetUndoManager();
+
+ SfxWhichIter aIter(rSet);
+ USHORT nWhich = aIter.FirstWhich();
+ while ( nWhich )
+ {
+ switch (nWhich)
+ {
+ case SID_GETUNDOSTRINGS:
+ case SID_GETREDOSTRINGS:
+ {
+ SfxStringListItem aStrLst( nWhich );
+ if ( pUndoManager )
+ {
+ List* pList = aStrLst.GetList();
+ BOOL bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
+ size_t nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
+ for (size_t i=0; i<nCount; i++)
+ pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
+ pUndoManager->GetRedoActionComment(i) ),
+ LIST_APPEND );
+ }
+ rSet.Put( aStrLst );
+ }
+ break;
+ default:
+ // get state from sfx view frame
+ GetViewFrame()->GetSlotState( nWhich, NULL, &rSet );
+ }
+
+ nWhich = aIter.NextWhich();
+ }
+}
+
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index c0af39226c3f..6034ac81ecba 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -97,7 +97,9 @@ String __EXPORT ScTabViewShell::GetSelectionText( BOOL bWholeWord )
SCROW nRow1, nRow2;
SCTAB nTab1, nTab2;
aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
- if (pDoc->ShrinkToUsedDataArea( nTab1, nCol1, nRow1, nCol2, nRow2, false))
+ bool bShrunk;
+ pDoc->ShrinkToUsedDataArea( bShrunk, nTab1, nCol1, nRow1, nCol2, nRow2, false);
+ if (bShrunk)
{
aRange.aStart.SetCol( nCol1 );
aRange.aStart.SetRow( nRow1 );
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 37c1b0ab1e84..b192182a26aa 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -675,7 +675,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
// handle several sheets
- SfxUndoManager* pUndoManager = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = pDocSh->GetUndoManager();
String aUndo = ScGlobal::GetRscString( STR_UNDO_TAB_RTL );
pUndoManager->EnterListAction( aUndo, aUndo );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index f7a126c2dac8..0dc77a19121c 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1009,7 +1009,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
ScDocument* pDoc = GetViewData()->GetDocument();
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScMarkData& rMark = GetViewData()->GetMarkData();
- SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
const BOOL bRecord(pDoc->IsUndoEnabled());
ScDocShellModificator aModificator( *pDocSh );
@@ -1635,7 +1635,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
if (pDoc->IsUndoEnabled())
{
- SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
String aUndo = ScGlobal::GetRscString(
pClipDoc->IsCutMode() ? STR_UNDO_CUT : STR_UNDO_COPY);
pUndoMgr->EnterListAction(aUndo, aUndo);
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 228f70ee1391..c3db2df825f3 100755
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -236,8 +236,6 @@ STD_LIB_FILE( gid_File_Lib_Sdbt, sdbt)
STD_LIB_FILE( gid_File_Lib_Dbmm, dbmm)
-STD_LIB_FILE( gid_File_Lib_Dbacfg, dbacfg)
-
STD_LIB_FILE( gid_File_Lib_Dbase2, dbase )
STD_LIB_FILE( gid_File_Lib_Dbfile , file)
diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp
index 972c371ce489..6987791c3acf 100644
--- a/scp2/source/ooo/file_ooo.scp
+++ b/scp2/source/ooo/file_ooo.scp
@@ -926,9 +926,16 @@ File gid_File_Lm_Scots_Gaelic
Styles = (PACKED);
End
-File gid_File_Lm_Serbian_Ascii
+File gid_File_Lm_Serbian
TXT_FILE_BODY;
- Name = "serbian_ascii.lm";
+ Name = "serbian.lm";
+ Dir = gid_Dir_Share_Fingerprint;
+ Styles = (PACKED);
+End
+
+File gid_File_Lm_Serbian_Latin
+ TXT_FILE_BODY;
+ Name = "serbian-latin.lm";
Dir = gid_Dir_Share_Fingerprint;
Styles = (PACKED);
End
diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp
index e1bc26118011..3810b3126334 100644
--- a/scp2/source/ooo/module_hidden_ooo.scp
+++ b/scp2/source/ooo/module_hidden_ooo.scp
@@ -168,7 +168,6 @@ Module gid_Module_Root_Files_4
gid_File_Lib_Sdbt,
gid_File_Lib_Dbmm,
gid_File_Lib_Dba,
- gid_File_Lib_Dbacfg,
gid_File_Lib_Dbase2,
gid_File_Lib_Dbaxml,
gid_File_Lib_Dbt,
@@ -594,7 +593,8 @@ Module gid_Module_Root_Files_6
gid_File_Lm_Sanskrit,
gid_File_Lm_Scots,
gid_File_Lm_Scots_Gaelic,
- gid_File_Lm_Serbian_Ascii,
+ gid_File_Lm_Serbian,
+ gid_File_Lm_Serbian_Latin,
gid_File_Lm_Slovak_Ascii,
gid_File_Lm_Slovenian,
gid_File_Lm_Spanish,
diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx
new file mode 100644
index 000000000000..fe8da6e511d7
--- /dev/null
+++ b/scripting/source/dlgprov/DialogModelProvider.cxx
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_scripting.hxx"
+
+#include "DialogModelProvider.hxx"
+#include "dlgprov.hxx"
+#include <com/sun/star/resource/XStringResourceManager.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+
+
+// component helper namespace
+namespace comp_DialogModelProvider {
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star;
+using namespace awt;
+using namespace lang;
+using namespace uno;
+using namespace script;
+using namespace beans;
+
+
+// component and service helper functions:
+::rtl::OUString SAL_CALL _getImplementationName();
+css::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames();
+css::uno::Reference< css::uno::XInterface > SAL_CALL _create( css::uno::Reference< css::uno::XComponentContext > const & context );
+
+} // closing component helper namespace
+
+
+
+/// anonymous implementation namespace
+namespace dlgprov {
+
+namespace css = ::com::sun::star;
+using namespace ::com::sun::star;
+using namespace awt;
+using namespace lang;
+using namespace uno;
+using namespace script;
+using namespace beans;
+
+
+DialogModelProvider::DialogModelProvider(Reference< XComponentContext > const & context) :
+ m_xContext(context)
+{}
+
+// lang::XInitialization:
+void SAL_CALL DialogModelProvider::initialize(const css::uno::Sequence< uno::Any > & aArguments) throw (css::uno::RuntimeException, css::uno::Exception)
+{
+ if ( aArguments.getLength() == 1 )
+ {
+ ::rtl::OUString sURL;
+ if ( !( aArguments[ 0 ] >>= sURL ))
+ throw css::lang::IllegalArgumentException();
+ // Try any other URL with SimpleFileAccess
+ Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< ucb::XSimpleFileAccess > xSFI =
+ Reference< ucb::XSimpleFileAccess >( xSMgr->createInstanceWithContext
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), m_xContext ), UNO_QUERY );
+
+ try
+ {
+ Reference< io::XInputStream > xInput = xSFI->openFileRead( sURL );
+ Reference< resource::XStringResourceManager > xStringResourceManager;
+ if ( xInput.is() )
+ {
+ xStringResourceManager = dlgprov::lcl_getStringResourceManager(m_xContext,sURL);
+ Any aDialogSourceURLAny;
+ aDialogSourceURLAny <<= sURL;
+
+ m_xDialogModel.set( dlgprov::lcl_createDialogModel( m_xContext,xInput , xStringResourceManager, aDialogSourceURLAny ), UNO_QUERY_THROW);
+ m_xDialogModelProp.set(m_xDialogModel, UNO_QUERY_THROW);
+ }
+ }
+ catch( Exception& )
+ {}
+ //m_sURL = sURL;
+ }
+}
+
+// container::XElementAccess:
+uno::Type SAL_CALL DialogModelProvider::getElementType() throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->getElementType();
+}
+
+::sal_Bool SAL_CALL DialogModelProvider::hasElements() throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->hasElements();
+}
+
+// container::XNameAccess:
+uno::Any SAL_CALL DialogModelProvider::getByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException)
+{
+ return m_xDialogModel->getByName(aName);
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL DialogModelProvider::getElementNames() throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->getElementNames();
+}
+
+::sal_Bool SAL_CALL DialogModelProvider::hasByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException)
+{
+ return m_xDialogModel->hasByName(aName);
+}
+
+// container::XNameReplace:
+void SAL_CALL DialogModelProvider::replaceByName(const ::rtl::OUString & aName, const uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException)
+{
+ m_xDialogModel->replaceByName(aName,aElement);
+}
+
+// container::XNameContainer:
+void SAL_CALL DialogModelProvider::insertByName(const ::rtl::OUString & aName, const uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException)
+{
+ m_xDialogModel->insertByName(aName,aElement);
+}
+
+void SAL_CALL DialogModelProvider::removeByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException)
+{
+ m_xDialogModel->removeByName(aName);
+}
+uno::Reference< beans::XPropertySetInfo > SAL_CALL DialogModelProvider::getPropertySetInfo( ) throw (uno::RuntimeException)
+{
+ return m_xDialogModelProp->getPropertySetInfo();
+}
+void SAL_CALL DialogModelProvider::setPropertyValue( const ::rtl::OUString&, const uno::Any& ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+uno::Any SAL_CALL DialogModelProvider::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return m_xDialogModelProp->getPropertyValue(PropertyName);
+}
+void SAL_CALL DialogModelProvider::addPropertyChangeListener( const ::rtl::OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+void SAL_CALL DialogModelProvider::removePropertyChangeListener( const ::rtl::OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+void SAL_CALL DialogModelProvider::addVetoableChangeListener( const ::rtl::OUString& , const uno::Reference< beans::XVetoableChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+void SAL_CALL DialogModelProvider::removeVetoableChangeListener( const ::rtl::OUString& ,const uno::Reference< beans::XVetoableChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+
+// com.sun.star.uno.XServiceInfo:
+::rtl::OUString SAL_CALL DialogModelProvider::getImplementationName() throw (css::uno::RuntimeException)
+{
+ return comp_DialogModelProvider::_getImplementationName();
+}
+
+::sal_Bool SAL_CALL DialogModelProvider::supportsService(::rtl::OUString const & serviceName) throw (css::uno::RuntimeException)
+{
+ css::uno::Sequence< ::rtl::OUString > serviceNames = comp_DialogModelProvider::_getSupportedServiceNames();
+ for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
+ if (serviceNames[i] == serviceName)
+ return sal_True;
+ }
+ return sal_False;
+}
+
+css::uno::Sequence< ::rtl::OUString > SAL_CALL DialogModelProvider::getSupportedServiceNames() throw (css::uno::RuntimeException)
+{
+ return comp_DialogModelProvider::_getSupportedServiceNames();
+}
+
+} // closing anonymous implementation namespace
+
diff --git a/scripting/source/dlgprov/DialogModelProvider.hxx b/scripting/source/dlgprov/DialogModelProvider.hxx
new file mode 100644
index 000000000000..bc74dfe661dd
--- /dev/null
+++ b/scripting/source/dlgprov/DialogModelProvider.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.
+ *
+ ************************************************************************/
+#include "sal/config.h"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase4.hxx"
+#include "com/sun/star/lang/XInitialization.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+
+/// anonymous implementation namespace
+namespace dlgprov{
+
+namespace css = ::com::sun::star;
+
+class DialogModelProvider:
+ public ::cppu::WeakImplHelper4<
+ css::lang::XInitialization,
+ css::container::XNameContainer,
+ css::beans::XPropertySet,
+ css::lang::XServiceInfo>
+{
+public:
+ explicit DialogModelProvider(css::uno::Reference< css::uno::XComponentContext > const & context);
+private:
+ // ::com::sun::star::lang::XInitialization:
+ virtual void SAL_CALL initialize(const css::uno::Sequence< ::com::sun::star::uno::Any > & aArguments) throw (css::uno::RuntimeException, css::uno::Exception);
+
+ // ::com::sun::star::container::XElementAccess:
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameAccess:
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException);
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasByName(const ::rtl::OUString & aName) throw (css::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameReplace:
+ virtual void SAL_CALL replaceByName(const ::rtl::OUString & aName, const ::com::sun::star::uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException);
+
+ // ::com::sun::star::container::XNameContainer:
+ virtual void SAL_CALL insertByName(const ::rtl::OUString & aName, const ::com::sun::star::uno::Any & aElement) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException);
+ virtual void SAL_CALL removeByName(const ::rtl::OUString & Name) throw (css::uno::RuntimeException, css::container::NoSuchElementException, css::lang::WrappedTargetException);
+
+ // ::com::sun::star::lang::XServiceInfo:
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException);
+
+ 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);
+
+private:
+ DialogModelProvider(const DialogModelProvider &); // not defined
+ DialogModelProvider& operator=(const DialogModelProvider &); // not defined
+
+ // destructor is private and will be called indirectly by the release call virtual ~DialogModelProvider() {}
+
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ css::uno::Reference< css::container::XNameContainer> m_xDialogModel;
+ css::uno::Reference< css::beans::XPropertySet> m_xDialogModelProp;
+};
+} // closing anonymous implementation namespace
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index ffa128381d39..8a577ab03e1c 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_scripting.hxx"
+#include "DialogModelProvider.hxx"
#include "dlgprov.hxx"
#include "dlgevtatt.hxx"
#include <com/sun/star/awt/XControlContainer.hpp>
@@ -60,20 +61,103 @@
#include <util/MiscUtils.hxx>
using namespace ::com::sun::star;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::script;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::document;
+using namespace awt;
+using namespace lang;
+using namespace uno;
+using namespace script;
+using namespace beans;
+using namespace document;
using namespace ::sf_misc;
+// component helper namespace
+namespace comp_DialogModelProvider
+{
+
+ ::rtl::OUString SAL_CALL _getImplementationName()
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogModelProvider"));
+ }
+
+ uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames()
+ {
+ uno::Sequence< ::rtl::OUString > s(1);
+ s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDialogModelProvider"));
+ return s;
+ }
+
+ uno::Reference< uno::XInterface > SAL_CALL _create(const uno::Reference< uno::XComponentContext > & context) SAL_THROW((uno::Exception))
+ {
+ return static_cast< ::cppu::OWeakObject * >(new dlgprov::DialogModelProvider(context));
+ }
+} // closing component helper namespace
//.........................................................................
namespace dlgprov
{
//.........................................................................
static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAscii( "ResourceResolver" );
+
+ Reference< resource::XStringResourceManager > lcl_getStringResourceManager(const Reference< XComponentContext >& i_xContext,const ::rtl::OUString& i_sURL)
+ {
+ INetURLObject aInetObj( i_sURL );
+ ::rtl::OUString aDlgName = aInetObj.GetBase();
+ aInetObj.removeSegment();
+ ::rtl::OUString aDlgLocation = aInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ bool bReadOnly = true;
+ ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
+ ::rtl::OUString aComment;
+
+ Sequence<Any> aArgs( 6 );
+ aArgs[0] <<= aDlgLocation;
+ aArgs[1] <<= bReadOnly;
+ aArgs[2] <<= aLocale;
+ aArgs[3] <<= aDlgName;
+ aArgs[4] <<= aComment;
+
+ Reference< task::XInteractionHandler > xDummyHandler;
+ aArgs[5] <<= xDummyHandler;
+ Reference< XMultiComponentFactory > xSMgr_( i_xContext->getServiceManager(), UNO_QUERY_THROW );
+ // TODO: Ctor
+ Reference< resource::XStringResourceManager > xStringResourceManager( xSMgr_->createInstanceWithContext
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.resource.StringResourceWithLocation" ),
+ i_xContext ), UNO_QUERY );
+ if( xStringResourceManager.is() )
+ {
+ Reference< XInitialization > xInit( xStringResourceManager, UNO_QUERY );
+ if( xInit.is() )
+ xInit->initialize( aArgs );
+ }
+ return xStringResourceManager;
+ }
+ Reference< container::XNameContainer > lcl_createControlModel(const Reference< XComponentContext >& i_xContext)
+ {
+ Reference< XMultiComponentFactory > xSMgr_( i_xContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< container::XNameContainer > xControlModel( xSMgr_->createInstanceWithContext( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ), i_xContext ), UNO_QUERY_THROW );
+ return xControlModel;
+ }
+ Reference< container::XNameContainer > lcl_createDialogModel( const Reference< XComponentContext >& i_xContext,
+ const Reference< io::XInputStream >& xInput,
+ const Reference< resource::XStringResourceManager >& xStringResourceManager,
+ const Any &aDialogSourceURL) throw ( Exception )
+ {
+ Reference< container::XNameContainer > xDialogModel( lcl_createControlModel(i_xContext) );
+
+ ::rtl::OUString aDlgSrcUrlPropName( RTL_CONSTASCII_USTRINGPARAM( "DialogSourceURL" ) );
+ Reference< beans::XPropertySet > xDlgPropSet( xDialogModel, UNO_QUERY );
+ xDlgPropSet->setPropertyValue( aDlgSrcUrlPropName, aDialogSourceURL );
+
+ ::xmlscript::importDialogModel( xInput, xDialogModel, i_xContext );
+ // Set resource property
+ if( xStringResourceManager.is() )
+ {
+ Reference< beans::XPropertySet > xDlgPSet( xDialogModel, UNO_QUERY );
+ Any aStringResourceManagerAny;
+ aStringResourceManagerAny <<= xStringResourceManager;
+ xDlgPSet->setPropertyValue( aResourceResolverPropName, aStringResourceManagerAny );
+ }
+
+ return xDialogModel;
+ }
// =============================================================================
// component operations
// =============================================================================
@@ -173,9 +257,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
Reference< container::XNameContainer > DialogProviderImpl::createControlModel() throw ( Exception )
{
- Reference< XMultiComponentFactory > xSMgr_( m_xContext->getServiceManager(), UNO_QUERY_THROW );
- Reference< container::XNameContainer > xControlModel( xSMgr_->createInstanceWithContext( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ), m_xContext ), UNO_QUERY_THROW );
- return xControlModel;
+ return lcl_createControlModel(m_xContext);
}
Reference< container::XNameContainer > DialogProviderImpl::createDialogModel(
@@ -183,23 +265,9 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
const Reference< resource::XStringResourceManager >& xStringResourceManager,
const Any &aDialogSourceURL) throw ( Exception )
{
- Reference< container::XNameContainer > xDialogModel( createControlModel() );
-
- ::rtl::OUString aDlgSrcUrlPropName( RTL_CONSTASCII_USTRINGPARAM( "DialogSourceURL" ) );
- Reference< beans::XPropertySet > xDlgPropSet( xDialogModel, UNO_QUERY );
- xDlgPropSet->setPropertyValue( aDlgSrcUrlPropName, aDialogSourceURL );
- ::xmlscript::importDialogModel( xInput, xDialogModel, m_xContext );
- // Set resource property
- if( xStringResourceManager.is() )
- {
- Reference< beans::XPropertySet > xDlgPSet( xDialogModel, UNO_QUERY );
- Any aStringResourceManagerAny;
- aStringResourceManagerAny <<= xStringResourceManager;
- xDlgPSet->setPropertyValue( aResourceResolverPropName, aStringResourceManagerAny );
- }
- return xDialogModel;
+ return lcl_createDialogModel(m_xContext,xInput,xStringResourceManager,aDialogSourceURL);
}
Reference< XControlModel > DialogProviderImpl::createDialogModelForBasic() throw ( Exception )
@@ -280,8 +348,8 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
bSingleDialog = true;
// Try any other URL with SimpleFileAccess
- Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSFI =
- Reference< ::com::sun::star::ucb::XSimpleFileAccess >( xSMgr->createInstanceWithContext
+ Reference< ucb::XSimpleFileAccess > xSFI =
+ Reference< ucb::XSimpleFileAccess >( xSMgr->createInstanceWithContext
( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), m_xContext ), UNO_QUERY );
try
@@ -412,34 +480,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
Reference< resource::XStringResourceManager > xStringResourceManager;
if( bSingleDialog )
{
- INetURLObject aInetObj( aURL );
- ::rtl::OUString aDlgName = aInetObj.GetBase();
- aInetObj.removeSegment();
- ::rtl::OUString aDlgLocation = aInetObj.GetMainURL( INetURLObject::NO_DECODE );
- bool bReadOnly = true;
- ::com::sun ::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- ::rtl::OUString aComment;
-
- Sequence<Any> aArgs( 6 );
- aArgs[0] <<= aDlgLocation;
- aArgs[1] <<= bReadOnly;
- aArgs[2] <<= aLocale;
- aArgs[3] <<= aDlgName;
- aArgs[4] <<= aComment;
-
- Reference< task::XInteractionHandler > xDummyHandler;
- aArgs[5] <<= xDummyHandler;
- Reference< XMultiComponentFactory > xSMgr_( m_xContext->getServiceManager(), UNO_QUERY_THROW );
- // TODO: Ctor
- xStringResourceManager = Reference< resource::XStringResourceManager >( xSMgr_->createInstanceWithContext
- ( ::rtl::OUString::createFromAscii( "com.sun.star.resource.StringResourceWithLocation" ),
- m_xContext ), UNO_QUERY );
- if( xStringResourceManager.is() )
- {
- Reference< XInitialization > xInit( xStringResourceManager, UNO_QUERY );
- if( xInit.is() )
- xInit->initialize( aArgs );
- }
+ xStringResourceManager = lcl_getStringResourceManager(m_xContext,aURL);
}
else if( xDialogLib.is() )
{
@@ -794,7 +835,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
Reference< XWindow > DialogProviderImpl::createContainerWindow(
const ::rtl::OUString& URL, const ::rtl::OUString& WindowType,
const Reference< XWindowPeer >& xParent, const Reference< XInterface >& xHandler )
- throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+ throw (lang::IllegalArgumentException, RuntimeException)
{
(void)WindowType; // for future use
if( !xParent.is() )
@@ -824,11 +865,8 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs
static struct ::cppu::ImplementationEntry s_component_entries [] =
{
- {
- create_DialogProviderImpl, getImplementationName_DialogProviderImpl,
- getSupportedServiceNames_DialogProviderImpl, ::cppu::createSingleComponentFactory,
- 0, 0
- },
+ {create_DialogProviderImpl, getImplementationName_DialogProviderImpl,getSupportedServiceNames_DialogProviderImpl, ::cppu::createSingleComponentFactory,0, 0},
+ { &comp_DialogModelProvider::_create,&comp_DialogModelProvider::_getImplementationName,&comp_DialogModelProvider::_getSupportedServiceNames,&::cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
diff --git a/scripting/source/dlgprov/dlgprov.hxx b/scripting/source/dlgprov/dlgprov.hxx
index bc15831d2ff1..cbe3727b045e 100644
--- a/scripting/source/dlgprov/dlgprov.hxx
+++ b/scripting/source/dlgprov/dlgprov.hxx
@@ -61,6 +61,13 @@ namespace dlgprov
// =============================================================================
// class DialogProviderImpl
// =============================================================================
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > lcl_createControlModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext);
+ ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager > lcl_getStringResourceManager(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext,const ::rtl::OUString& i_sURL);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > lcl_createDialogModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_xContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager >& xStringResourceManager,
+ const ::com::sun::star::uno::Any &aDialogSourceURL) throw ( ::com::sun::star::uno::Exception );
typedef ::cppu::WeakImplHelper4<
::com::sun::star::lang::XServiceInfo,
diff --git a/scripting/source/dlgprov/makefile.mk b/scripting/source/dlgprov/makefile.mk
index 111dca58edc2..c3a99aa81aff 100644
--- a/scripting/source/dlgprov/makefile.mk
+++ b/scripting/source/dlgprov/makefile.mk
@@ -41,6 +41,7 @@ DLLPRE =
SLOFILES= \
$(SLO)$/dlgprov.obj \
+ $(SLO)$/DialogModelProvider.obj \
$(SLO)$/dlgevtatt.obj
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
diff --git a/scripting/source/inc/util/util.hxx b/scripting/source/inc/util/util.hxx
index 27e5c19ccc91..a07d66452e0d 100644
--- a/scripting/source/inc/util/util.hxx
+++ b/scripting/source/inc/util/util.hxx
@@ -29,21 +29,6 @@
#ifndef _COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
#define _COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
-#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
-
#define OUSTR(x) ::rtl::OUString( ::rtl::OUString::createFromAscii(x) )
-namespace scripting_util
-{
- inline void validateXRef(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRef, const sal_Char* Msg) throw (::com::sun::star::uno::RuntimeException)
- {
- OSL_ENSURE( xRef.is(), Msg );
-
- if(!xRef.is())
- {
- throw ::com::sun::star::uno::RuntimeException(OUSTR(Msg), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >());
- }
- }
-}
#endif //_COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_
diff --git a/scripting/source/protocolhandler/makefile.mk b/scripting/source/protocolhandler/makefile.mk
index ec69c00b209d..5a2e92bbbac3 100644
--- a/scripting/source/protocolhandler/makefile.mk
+++ b/scripting/source/protocolhandler/makefile.mk
@@ -45,6 +45,7 @@ SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1STDLIBS= \
$(SFXLIB) \
+ $(FWELIB) \
$(CPPULIB) \
$(CPPUHELPERLIB) \
$(VCLLIB) \
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 4e81426d7d53..e9d12be12b5e 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -49,10 +49,12 @@
#include <sfx2/frame.hxx>
#include <sfx2/sfxdlg.hxx>
#include <vcl/abstdlg.hxx>
+#include <tools/diagnose_ex.h>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <util/util.hxx>
+#include <framework/documentundoguard.hxx>
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/uri/XUriReference.hpp"
@@ -69,7 +71,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::script::provider;
using namespace ::com::sun::star::document;
-using namespace ::scripting_util;
namespace scripting_protocolhandler
{
@@ -97,8 +98,7 @@ void SAL_CALL ScriptProtocolHandler::initialize(
throw RuntimeException( temp, Reference< XInterface >() );
}
- validateXRef( m_xFactory,
- "ScriptProtocolHandler::initialize: No Service Manager available" );
+ ENSURE_OR_THROW( m_xFactory.is(), "ScriptProtocolHandler::initialize: No Service Manager available" );
m_bInitialised = true;
}
@@ -162,7 +162,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
{
try
{
- bool bIsDocumentScript = ( aURL.Complete.indexOf( ::rtl::OUString::createFromAscii( "document" ) ) !=-1 );
+ bool bIsDocumentScript = ( aURL.Complete.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "document" ) ) !=-1 );
// TODO: isn't this somewhat strange? This should be a test for a location=document parameter, shouldn't it?
if ( bIsDocumentScript )
@@ -182,7 +182,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
Reference< provider::XScript > xFunc =
m_xScriptProvider->getScript( aURL.Complete );
- validateXRef( xFunc,
+ ENSURE_OR_THROW( xFunc.is(),
"ScriptProtocolHandler::dispatchWithNotification: validate xFunc - unable to obtain XScript interface" );
@@ -207,6 +207,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
}
}
+ // attempt to protect the document against the script tampering with its Undo Context
+ ::std::auto_ptr< ::framework::DocumentUndoGuard > pUndoGuard;
+ if ( bIsDocumentScript )
+ pUndoGuard.reset( new ::framework::DocumentUndoGuard( m_xScriptInvocation ) );
+
bSuccess = sal_False;
while ( !bSuccess )
{
@@ -248,16 +253,6 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
bCaughtException = TRUE;
}
-#ifdef _DEBUG
- catch ( ... )
- {
- ::rtl::OUString reason = ::rtl::OUString::createFromAscii(
- "ScriptProtocolHandler::dispatch: caught unknown exception" );
-
- invokeResult <<= reason;
- }
-#endif
-
}
else
{
@@ -358,13 +353,11 @@ ScriptProtocolHandler::getScriptInvocation()
return m_xScriptInvocation.is();
}
-void
-ScriptProtocolHandler::createScriptProvider()
+void ScriptProtocolHandler::createScriptProvider()
{
if ( m_xScriptProvider.is() )
- {
return;
- }
+
try
{
// first, ask the component supporting the XScriptInvocationContext interface
@@ -397,6 +390,7 @@ ScriptProtocolHandler::createScriptProvider()
m_xScriptProvider = xSPS->getScriptProvider();
}
+ // if nothing of this is successful, use the master script provider
if ( !m_xScriptProvider.is() )
{
Reference< XPropertySet > xProps( m_xFactory, UNO_QUERY_THROW );
@@ -430,15 +424,6 @@ ScriptProtocolHandler::createScriptProvider()
::rtl::OUString temp = OUSTR( "ScriptProtocolHandler::createScriptProvider: " );
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
-#ifdef _DEBUG
- catch ( ... )
- {
- throw RuntimeException(
- OUSTR( "ScriptProtocolHandler::createScriptProvider: UnknownException: " ),
- Reference< XInterface > () );
- }
-#endif
-
}
ScriptProtocolHandler::ScriptProtocolHandler(
diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx
index 3c6206d8d051..bbabbb21405c 100644
--- a/scripting/source/provider/ActiveMSPList.cxx
+++ b/scripting/source/provider/ActiveMSPList.cxx
@@ -49,7 +49,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::script;
-using namespace ::scripting_util;
using namespace ::sf_misc;
namespace func_provider
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 94ea78f80c73..33d371e3d51b 100755
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -33,6 +33,8 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/factory.hxx>
+#include <tools/diagnose_ex.h>
+
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
@@ -60,7 +62,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::document;
using namespace ::sf_misc;
-using namespace ::scripting_util;
namespace func_provider
{
@@ -95,10 +96,9 @@ MasterScriptProvider::MasterScriptProvider( const Reference< XComponentContext >
m_xContext( xContext ), m_bIsValid( false ), m_bInitialised( false ),
m_bIsPkgMSP( false ), m_pPCache( 0 )
{
- validateXRef( m_xContext, "MasterScriptProvider::MasterScriptProvider: No context available\n" );
+ ENSURE_OR_THROW( m_xContext.is(), "MasterScriptProvider::MasterScriptProvider: No context available\n" );
m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "MasterScriptProvider::MasterScriptProvider: No service manager available\n" );
+ ENSURE_OR_THROW( m_xMgr.is(), "MasterScriptProvider::MasterScriptProvider: No service manager available\n" );
m_bIsValid = true;
}
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index 5d3350f635e3..bea38a67a8f1 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -29,6 +29,7 @@
#include "precompiled_scripting.hxx"
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/factory.hxx>
+#include <tools/diagnose_ex.h>
#include <util/scriptingconstants.hxx>
#include <util/util.hxx>
@@ -39,7 +40,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::script;
-using namespace ::scripting_util;
namespace func_provider
{
@@ -51,7 +51,7 @@ ProviderCache::ProviderCache( const Reference< XComponentContext >& xContext, co
// will use createContentEnumeration
m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr, "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
+ ENSURE_OR_THROW( m_xMgr.is(), "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
populateCache();
}
@@ -64,7 +64,7 @@ ProviderCache::ProviderCache( const Reference< XComponentContext >& xContext, co
// will use createContentEnumeration
m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr, "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
+ ENSURE_OR_THROW( m_xMgr.is(), "ProviderCache::ProviderCache() failed to obtain ServiceManager" );
populateCache();
}
@@ -163,14 +163,8 @@ ProviderCache::populateCache() throw ( RuntimeException )
while ( xEnum->hasMoreElements() )
{
- Reference< lang::XSingleComponentFactory > factory;
- if ( sal_False == ( xEnum->nextElement() >>= factory ) )
- {
- throw new RuntimeException( ::rtl::OUString::createFromAscii( " error extracting XSingleComponentFactory from Content enumeration. " ), Reference< XInterface >() );
- }
- validateXRef( factory, "ProviderCache::populateCache() invalid factory" );
+ Reference< lang::XSingleComponentFactory > factory( xEnum->nextElement(), UNO_QUERY_THROW );
Reference< lang::XServiceInfo > xServiceInfo( factory, UNO_QUERY_THROW );
- validateXRef( xServiceInfo, "ProviderCache::populateCache() failed to get XServiceInfo from factory" );
Sequence< ::rtl::OUString > serviceNames = xServiceInfo->getSupportedServiceNames();
@@ -207,9 +201,8 @@ ProviderCache::createProvider( ProviderDetails& details ) throw ( RuntimeExcepti
{
try
{
- details.provider = Reference< provider::XScriptProvider >(
+ details.provider.set(
details.factory->createInstanceWithArgumentsAndContext( m_Sctx, m_xContext ), UNO_QUERY_THROW );
- validateXRef( details.provider, "ProviderCache::createProvider, failed to create provider");
}
catch ( RuntimeException& e )
{
diff --git a/scripting/source/provider/ScriptImpl.cxx b/scripting/source/provider/ScriptImpl.cxx
index f5b93a802138..08d548e3461c 100644
--- a/scripting/source/provider/ScriptImpl.cxx
+++ b/scripting/source/provider/ScriptImpl.cxx
@@ -46,15 +46,11 @@ ScriptImpl::ScriptImpl(
const Reference< runtime::XScriptInvocation > & runtimeMgr,
const ::rtl::OUString& scriptURI )
throw ( RuntimeException ) :
- m_XScriptingContext( scriptingContext ),
- m_RunTimeManager( runtimeMgr ),
+ m_XScriptingContext( scriptingContext, UNO_SET_THROW ),
+ m_RunTimeManager( runtimeMgr, UNO_SET_THROW ),
m_ScriptURI( scriptURI )
{
OSL_TRACE( "<!constucting a ScriptImpl>\n" );
- validateXRef( m_XScriptingContext,
- "ScriptImpl::ScriptImpl: No XScriptingContext\n" );
- validateXRef( m_RunTimeManager,
- "ScriptImpl::ScriptImpl: No XScriptInvocation\n" );
}
//*************************************************************************
diff --git a/scripting/source/provider/ScriptingContext.cxx b/scripting/source/provider/ScriptingContext.cxx
index 08a27a19562f..0394bd3653d1 100755
--- a/scripting/source/provider/ScriptingContext.cxx
+++ b/scripting/source/provider/ScriptingContext.cxx
@@ -55,13 +55,10 @@ namespace func_provider
//*************************************************************************
ScriptingContext::ScriptingContext( const Reference< XComponentContext > & xContext ) : //ScriptingContextImpl_BASE( GetMutex()),
OPropertyContainer( GetBroadcastHelper() ),
- m_xContext( xContext )
+ m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptingContext ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptingContext::ScriptingContext: No context available\n" );
-
Any nullAny;
scripting_constants::ScriptingConstantsPool& scriptingConstantsPool =
diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
index 48b960c6c9aa..8dafab0e8d4c 100644
--- a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
+++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx
@@ -70,13 +70,11 @@ static ::std::vector< sal_Int32 >* m_pSearchIDs = NULL;
//*************************************************************************
ScriptNameResolverImpl::ScriptNameResolverImpl(
const Reference< XComponentContext > & xContext ) :
- m_xContext( xContext )
+ m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptNameResolverImpl ctor called >\n" );
validateXRef( m_xContext, "ScriptNameResolverImpl::ScriptNameResolverImpl: invalid context" );
- m_xMultiComFac = m_xContext->getServiceManager();
-
- validateXRef( m_xMultiComFac, "ScriptNameResolverImpl::ScriptNameResolverImpl: invalid XMultiComponentFactory " );
+ m_xMultiComFac.set( m_xContext->getServiceManager(), UNO_SET_THROW );
if( !m_pSearchIDs )
{
@@ -220,11 +218,13 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
OUString temp = OUSTR( "ScriptNameResolverImpl::resolve: " );
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
- Reference< XInterface > xInterface = m_xMultiComFac->createInstanceWithContext(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.ucb.SimpleFileAccess" ), m_xContext );
- validateXRef( xInterface,
- "ScriptProvider::initialise: cannot get SimpleFileAccess Service\n" );
+ Reference< XInterface > xInterface(
+ m_xMultiComFac->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
+ m_xContext
+ ),
+ UNO_SET_THROW
+ );
Reference < ucb::XSimpleFileAccess > xSimpleFileAccess = Reference <
ucb::XSimpleFileAccess > ( xInterface, UNO_QUERY_THROW );
@@ -236,15 +236,8 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
try
{
// need to get the ScriptStorageManager
- Any a = m_xContext->getValueByName(
- scriptingConstantsPool.SCRIPTSTORAGEMANAGER_SERVICE );
- if ( sal_False == ( a >>= xScriptStorageMgr ) )
- {
- OUString temp = OUSTR( "ScriptNameResolverImpl::resolve: failed to get ScriptStorageManager" );
- throw RuntimeException( temp, Reference< XInterface >() );
- // need to throw
- }
- validateXRef( xScriptStorageMgr, "Cannot get ScriptStorageManager" );
+ xScriptStorageMgr.set( m_xContext->getValueByName(
+ scriptingConstantsPool.SCRIPTSTORAGEMANAGER_SERVICE ), UNO_QUERY_THROW );
filesysScriptStorageID =
xScriptStorageMgr->createScriptStorageWithURI(
xSimpleFileAccess, filesysURL );
@@ -364,20 +357,12 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
if( filesysScriptStorageID > 2 )
{
// get the filesys storage and dispose of it
- Reference< XInterface > xScriptStorage =
- xScriptStorageMgr->getScriptStorage( filesysScriptStorageID );
- validateXRef( xScriptStorage,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Storage service" );
+ Reference< XInterface > xScriptStorage( xScriptStorageMgr->getScriptStorage( filesysScriptStorageID ), UNO_SET_THROW );
Reference< storage::XScriptInfoAccess > xScriptInfoAccess = Reference<
storage::XScriptInfoAccess > ( xScriptStorage, UNO_QUERY_THROW );
- validateXRef( xScriptInfoAccess,
- "ScriptNameResolverImpl::resolveURIFromStorageID: cannot get XScriptInfoAccess" );
Sequence< Reference< storage::XScriptInfo > > results =
xScriptInfoAccess->getAllImplementations( );
- Reference < lang::XEventListener > xEL_ScriptStorageMgr =
- Reference< lang::XEventListener >
- ( xScriptStorageMgr ,UNO_QUERY_THROW );
- validateXRef( xEL_ScriptStorageMgr, "ScriptNameResolverImpl::resolve: can't get ScriptStorageManager XEventListener interface when trying to dispose of filesystem storage" );
+ Reference < lang::XEventListener > xEL_ScriptStorageMgr(( xScriptStorageMgr ,UNO_QUERY_THROW );
lang::EventObject event( results[ 0 ] );
xEL_ScriptStorageMgr->disposing( event );
}
@@ -447,9 +432,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept
throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() );
}
}
- Reference< storage::XScriptInfoAccess > storage = getStorageInstance( sid, permissionURI );
- validateXRef( storage,
- "ScriptNameResolverImpl::resolveURIFromStorageID: cannot get XScriptInfoAccess" );
+ Reference< storage::XScriptInfoAccess > storage( getStorageInstance( sid, permissionURI ), UNO_SET_THROW );
Sequence< Reference< storage::XScriptInfo > > results =
storage->getImplementations( scriptURI );
@@ -516,22 +499,10 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec
Reference< storage::XScriptInfoAccess > xScriptInfoAccess;
try
{
- Reference< XInterface > xInterface;
-
- Any a = m_xContext->getValueByName(
- OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) );
- if ( sal_False == ( a >>= xInterface ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptNameResolverImpl::getStorageInstance: could not obtain ScriptStorageManager singleton" ),
- Reference< XInterface >() );
- }
- validateXRef( xInterface,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Storage service" );
+ Reference< XInterface > xInterface( m_xContext->getValueByName(
+ OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) ), UNO_QUERY_THROW );
// check that we have permissions for this storage
Reference< dcsssf::security::XScriptSecurity > xScriptSecurity( xInterface, UNO_QUERY_THROW );
- validateXRef( xScriptSecurity,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Security service" );
scripting_constants::ScriptingConstantsPool& scriptingConstantsPool =
scripting_constants::ScriptingConstantsPool::instance();
// if we dealing with a document storage (ie. not user or share
@@ -546,14 +517,8 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec
OSL_TRACE( "ScriptNameResolverImpl::getStorageInstance: got execute permission for ID=%d", sid );
}
Reference< storage::XScriptStorageManager > xScriptStorageManager( xInterface, UNO_QUERY_THROW );
- validateXRef( xScriptStorageManager,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Storage Manager service" );
- Reference< XInterface > xScriptStorage =
- xScriptStorageManager->getScriptStorage( sid );
- validateXRef( xScriptStorage,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Storage service" );
- xScriptInfoAccess = Reference<
- storage::XScriptInfoAccess > ( xScriptStorage, UNO_QUERY_THROW );
+ Reference< XInterface > xScriptStorage( ScriptStorageManager->getScriptStorage( sid ), UNO_SET_THROW );
+ xScriptInfoAccess.set( xScriptStorage, UNO_QUERY_THROW );
}
catch ( lang::IllegalArgumentException & e )
{
diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
index 4780d58acc88..79a44bebce7d 100755
--- a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
+++ b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx
@@ -37,6 +37,7 @@
#include <util/scriptingconstants.hxx>
#include <cppuhelper/implementationentry.hxx>
+#include <tools/diagnose_ex.h>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
@@ -68,14 +69,10 @@ static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceNam
// ScriptRuntimeManager Constructor
ScriptRuntimeManager::ScriptRuntimeManager(
const Reference< XComponentContext > & xContext ) :
- m_xContext( xContext )
+ m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptRuntimeManager ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptRuntimeManager::ScriptRuntimeManager: invalid context" );
- m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "ScriptRuntimeManager::ScriptRuntimeManager: cannot get ServiceManager" );
+ m_xMgr.set( m_xContext->getServiceManager(), UNO_SET_THROW );
s_moduleCount.modCnt.acquire( &s_moduleCount.modCnt );
// test
//scripting_securitymgr::ScriptSecurityManager ssm(xContext);
@@ -106,22 +103,12 @@ throw( RuntimeException )
Reference< storage::XScriptInfo > sinfo =
Reference< storage::XScriptInfo >( scriptInfo, UNO_QUERY_THROW );
- OUStringBuffer *buf = new OUStringBuffer(80);
- buf->appendAscii("/singletons/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeFor");
- buf->append(sinfo->getLanguage());
+ OUStringBuffer* buf( 80 );
+ buf.appendAscii("/singletons/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeFor");
+ buf.append(sinfo->getLanguage());
- Any a = m_xContext->getValueByName(buf->makeStringAndClear());
-
- if ( sal_False == ( a >>= xInterface ) )
- {
- throw RuntimeException(
- sinfo->getLanguage().concat( OUSTR( " runtime support is not installed for this language" ) ),
- Reference< XInterface >() );
- }
- validateXRef( xInterface,
- "ScriptRuntimeManager::GetScriptRuntime: cannot get appropriate ScriptRuntime Service"
- );
- xScriptInvocation = Reference< runtime::XScriptInvocation >( xInterface, UNO_QUERY_THROW );
+ xInterface.set( m_xContext->getValueByName( buf.makeStringAndClear() ), UNO_QUERY_THROW );
+ xScriptInvocation.set( xInterface, UNO_QUERY_THROW );
}
catch ( Exception & e )
{
@@ -143,13 +130,14 @@ throw( RuntimeException )
try
{
- Reference< XInterface > xInterface = m_xMgr->createInstanceWithContext(
- OUString::createFromAscii(
- "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" ),
- m_xContext );
- validateXRef( xInterface,
- "ScriptRuntimeManager::GetScriptRuntime: cannot get instance of DefaultScriptNameResolver" );
- xScriptNameResolver = Reference< runtime::XScriptNameResolver >( xInterface, UNO_QUERY_THROW );
+ Reference< XInterface > xInterface(
+ m_xMgr->createInstanceWithContext(
+ OUString::createFromAscii("drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" ),
+ m_xContext
+ ),
+ UNO_SET_THROW
+ );
+ xScriptNameResolver.set( xInterface, UNO_QUERY_THROW );
}
catch ( Exception & e )
{
@@ -182,9 +170,8 @@ Any SAL_CALL ScriptRuntimeManager::invoke(
try
{
- Reference< storage::XScriptInfo > resolvedScript = resolve( scriptURI,
- resolvedCtx );
- validateXRef( resolvedScript, "ScriptRuntimeManager::invoke: No resolvedURI" );
+ Reference< storage::XScriptInfo > resolvedScript = resolve( scriptURI, resolvedCtx );
+ ENSURE_OR_THROW( resolvedScript.is(), "ScriptRuntimeManager::invoke: No resolvedURI" );
Reference< beans::XPropertySet > xPropSetResolvedCtx;
if ( sal_False == ( resolvedCtx >>= xPropSetResolvedCtx ) )
@@ -216,7 +203,7 @@ Any SAL_CALL ScriptRuntimeManager::invoke(
Reference< runtime::XScriptInvocation > xScriptInvocation =
getScriptRuntime( resolvedScript );
- validateXRef( xScriptInvocation,
+ ENSURE_OR_THROW( xScriptInvocation.is(),
"ScriptRuntimeManager::invoke: cannot get instance of language specific runtime." );
// the scriptURI is currently passed to the language-dept runtime but
@@ -232,13 +219,7 @@ Any SAL_CALL ScriptRuntimeManager::invoke(
{
Any a = m_xContext->getValueByName(
scriptingConstantsPool.SCRIPTSTORAGEMANAGER_SERVICE );
- Reference < lang::XEventListener > xEL_ScriptStorageManager;
- if ( sal_False == ( a >>= xEL_ScriptStorageManager ) )
- {
- throw RuntimeException( OUSTR( "ScriptRuntimeManager::invoke: can't get ScriptStorageManager XEventListener interface when trying to dispose of filesystem storage" ),
- Reference< XInterface > () );
- }
- validateXRef( xEL_ScriptStorageManager, "Cannot get XEventListener from ScriptStorageManager" );
+ Reference < lang::XEventListener > xEL_ScriptStorageManager( a, UNO_QUERY_THROW );
lang::EventObject event(resolvedScript);
xEL_ScriptStorageManager->disposing( event );
}
@@ -310,7 +291,7 @@ throw( lang::IllegalArgumentException, script::CannotConvertException, RuntimeEx
Reference< storage::XScriptInfo > resolvedURI;
Reference< runtime::XScriptNameResolver > xScriptNameResolver = getScriptNameResolver();
- validateXRef( xScriptNameResolver,
+ ENSURE_OR_THROW( xScriptNameResolver.is(),
"ScriptRuntimeManager::resolve: No ScriptNameResolver" );
try
diff --git a/scripting/source/runtimemgr/StorageBridge.cxx b/scripting/source/runtimemgr/StorageBridge.cxx
index d1915afba9e5..1e15cf808870 100644
--- a/scripting/source/runtimemgr/StorageBridge.cxx
+++ b/scripting/source/runtimemgr/StorageBridge.cxx
@@ -54,9 +54,8 @@ const int STORAGEPROXY = 0;
//*************************************************************************
// StorageBridge Constructor
StorageBridge::StorageBridge( const Reference< XComponentContext >& xContext,
- sal_Int32 sid ) : m_xContext( xContext ), m_sid( sid )
+ sal_Int32 sid ) : m_xContext( xContext, UNO_SET_THROW ), m_sid( sid )
{
- validateXRef( m_xContext, "StorageBridge::StorageBridge: invalid context" );
try
{
initStorage();
@@ -74,31 +73,12 @@ StorageBridge::initStorage() throw ( ::com::sun::star::uno::RuntimeException )
{
try
{
- Reference< lang::XMultiComponentFactory > xMultiComFac =
- m_xContext->getServiceManager();
- validateXRef( xMultiComFac,
- "StorageBridge::StorageBridge: cannot get multicomponentfactory from multiservice factory" );
- Reference< XInterface > temp;
-
- Any a = m_xContext->getValueByName(
- OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) );
- if ( sal_False == ( a >>= temp ) )
- {
- throw RuntimeException(
- OUSTR( "StorageBridge::StorageBridge: could not obtain ScriptStorageManager singleton" ),
- Reference< XInterface >() );
- }
- validateXRef( temp,
- "StorageBridge::StorageBridge: cannot get Storage service" );
+ Reference< lang::XMultiComponentFactory > xMultiComFac( m_xContext->getServiceManager(), UNO_SET_THROW );
+ Reference< XInterface > temp( m_xContext->getValueByName(
+ OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) ), UNO_QUERY_THROW );
Reference< storage::XScriptStorageManager > xScriptStorageManager( temp, UNO_QUERY_THROW );
- validateXRef( xScriptStorageManager,
- "StorageBridge::StorageBridge: cannot get Script Storage Manager service" );
- Reference< XInterface > xScriptStorage =
- xScriptStorageManager->getScriptStorage( m_sid );
- validateXRef( xScriptStorage,
- "StorageBridge::StorageBridge: cannot get Script Storage service" );
- m_xScriptInfoAccess =
- Reference< storage::XScriptInfoAccess > ( xScriptStorage, UNO_QUERY_THROW );
+ Reference< XInterface > xScriptStorage( xScriptStorageManager->getScriptStorage( m_sid ), UNO_SET_THROW );
+ m_xScriptInfoAccess.set( xScriptStorage, UNO_QUERY_THROW );
}
catch ( RuntimeException & re )
{
diff --git a/scripting/source/storage/ScriptMetadataImporter.cxx b/scripting/source/storage/ScriptMetadataImporter.cxx
index 64dd87b2546b..96faf6e9c1f4 100644
--- a/scripting/source/storage/ScriptMetadataImporter.cxx
+++ b/scripting/source/storage/ScriptMetadataImporter.cxx
@@ -38,7 +38,7 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <rtl/string.h>
-
+#include <tools/diagnose_ex.h>
#include <util/util.hxx>
@@ -82,31 +82,14 @@ void ScriptMetadataImporter::parseMetaData(
ms_parcelURI = parcelURI;
//Get the parser service
- validateXRef( m_xContext,
+ ENSURE_OR_THROW( m_xContext.is(),
"ScriptMetadataImporter::parseMetaData: No context available" );
- Reference< lang::XMultiComponentFactory > xMgr =
- m_xContext->getServiceManager();
-
- validateXRef( xMgr,
- "ScriptMetadataImporter::parseMetaData: No service manager available" );
-
- Reference< XInterface > xInterface = xMgr->createInstanceWithContext(
- OUString::createFromAscii( "com.sun.star.xml.sax.Parser" ), m_xContext );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
- validateXRef( xInterface, "ScriptMetadataImporter::parseMetaData: cannot get SAX Parser" );
- Reference< xml::sax::XParser > xParser;
- try
- {
- xParser.set( xInterface ,UNO_QUERY_THROW );
- }
- catch (RuntimeException & re )
- {
- OUString msg = OUString::createFromAscii(
- "ScriptMetadata:Importer::parserMetaData cannot get XParser" );
- msg.concat( re.Message );
- throw RuntimeException( msg, Reference< XInterface > () );
- }
+ Reference< xml::sax::XParser > xParser(
+ xMgr->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.sax.Parser" ), m_xContext ),
+ UNO_QUERY_THROW );
// xxx todo: error handler, entity resolver omitted
// This class is the document handler for the parser
diff --git a/scripting/source/storage/ScriptSecurityManager.cxx b/scripting/source/storage/ScriptSecurityManager.cxx
index 3fde4e466974..fbe6f41b4663 100755
--- a/scripting/source/storage/ScriptSecurityManager.cxx
+++ b/scripting/source/storage/ScriptSecurityManager.cxx
@@ -47,7 +47,7 @@
#include "ScriptSecurityManager.hxx"
#include <util/util.hxx>
#include <util/scriptingconstants.hxx>
-
+#include <tools/diagnose_ex.h>
using namespace ::rtl;
using namespace ::osl;
@@ -85,28 +85,15 @@ static const int ADD_TO_PATH = 2;
// ScriptSecurityManager Constructor
ScriptSecurityManager::ScriptSecurityManager(
const Reference< XComponentContext > & xContext ) throw ( RuntimeException )
- : m_xContext( xContext)
+ : m_xContext( xContext, UNO_SET_THROW )
{
OSL_TRACE( "< ScriptSecurityManager ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptSecurityManager::ScriptSecurityManager: invalid context" );
// get the service manager from the context
- Reference< lang::XMultiComponentFactory > xMgr = m_xContext->getServiceManager();
- validateXRef( xMgr,
- "ScriptSecurityManager::ScriptSecurityManager: cannot get ServiceManager" );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
// create an instance of the ConfigurationProvider
- Reference< XInterface > xInterface = xMgr->createInstanceWithContext(
- s_configProv, m_xContext );
- validateXRef( xInterface,
- "ScriptSecurityManager::ScriptSecurityManager: cannot get ConfigurationProvider" );
- // create an instance of the ConfigurationAccess for accessing the
- // scripting security settings
- m_xConfigProvFactory = Reference < lang::XMultiServiceFactory > ( xInterface, UNO_QUERY );
- validateXRef( m_xConfigProvFactory,
- "ScriptSecurityManager::ScriptSecurityManager: cannot get XMultiServiceFactory interface from ConfigurationProvider" );
-
+ m_xConfigProvFactory.set( xMgr->createInstanceWithContext( s_configProv, m_xContext ), UNO_QUERY_THROW );
}
void ScriptSecurityManager::addScriptStorage( rtl::OUString scriptStorageURL,
@@ -131,35 +118,6 @@ throw ( RuntimeException )
//need to check if storage has any scripts
try
{
- /* need to replace this with something better, now logical names are
- * gone
-
- Reference< XInterface > xInterface;
- Any a = m_xContext->getValueByName(
- OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) );
- if ( sal_False == ( a >>= xInterface ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager::addScriptStorage: could not obtain ScriptStorageManager singleton" ),
- Reference< XInterface >() );
- }
- validateXRef( xInterface,
- "ScriptSecurityManager::addScriptStorage: cannot get Storage service" );
- Reference< storage::XScriptStorageManager > xScriptStorageManager(
- xInterface, UNO_QUERY_THROW );
- Reference< XInterface > xScriptStorage =
- xScriptStorageManager->getScriptStorage( storageID );
- validateXRef( xScriptStorage,
- "ScriptNameResolverImpl::getStorageInstance: cannot get Script Storage service" );
- Reference< storage::XScriptInfoAccess > xScriptInfoAccess =
- Reference< storage::XScriptInfoAccess > ( xScriptStorage,
- UNO_QUERY_THROW );
- Sequence< ::rtl::OUString > logicalNames = xScriptInfoAccess->getScriptLogicalNames();
- if( !logicalNames.getLength() ) // we have no logical names
- {
- return;
- } */
-
// we have some scripts so read config & decide on that basis
// Setup flags: m_runMacroSetting, m_warning, m_confirmationRequired,
readConfiguration();
@@ -317,17 +275,12 @@ throw ( RuntimeException )
short result;
try
{
- Reference< lang::XMultiComponentFactory > xMgr = m_xContext->getServiceManager();
- validateXRef( xMgr,
- "ScriptSecurityManager::executeDialog: cannot get ServiceManager" );
- Reference< XInterface > xInterface =
- xMgr->createInstanceWithArgumentsAndContext( s_securityDialog,
- aArgs, m_xContext );
- validateXRef( xInterface, "ScriptSecurityManager::executeDialog: Can't create SecurityDialog" );
- Reference< awt::XDialog > xDialog( xInterface, UNO_QUERY_THROW );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
+ Reference< awt::XDialog > xDialog(
+ xMgr->createInstanceWithArgumentsAndContext( s_securityDialog, aArgs, m_xContext ),
+ UNO_QUERY_THROW );
result = xDialog->execute();
- Reference< lang::XComponent > xComponent( xInterface, UNO_QUERY_THROW );
- validateXRef( xInterface, "ScriptSecurityManager::executeDialog: Can't get XComponent to dispose dialog" );
+ Reference< lang::XComponent > xComponent( xDialog, UNO_QUERY_THROW );
xComponent->dispose();
}
catch ( RuntimeException & rte )
@@ -410,31 +363,20 @@ void ScriptSecurityManager::removePermissionSettings ( ::rtl::OUString & scriptS
void ScriptSecurityManager::readConfiguration()
throw ( RuntimeException)
{
- Reference< XInterface > xInterface;
try
{
- beans::PropertyValue configPath;
- configPath.Name = ::rtl::OUString::createFromAscii( "nodepath" );
- configPath.Value <<= ::rtl::OUString::createFromAscii( "org.openoffice.Office.Common/Security/Scripting" );
- Sequence < Any > aargs( 1 );
- aargs[ 0 ] <<= configPath;
- validateXRef( m_xConfigProvFactory,
- "ScriptSecurityManager::readConfiguration: ConfigProviderFactory no longer valid!" );
- xInterface = m_xConfigProvFactory->createInstanceWithArguments( s_configAccess,
- aargs );
- validateXRef( xInterface,
- "ScriptSecurityManager::readConfiguration: cannot get ConfigurationAccess" );
- // get the XPropertySet interface from the ConfigurationAccess service
- Reference < beans::XPropertySet > xPropSet( xInterface, UNO_QUERY );
- Any value;
-
- value=xPropSet->getPropertyValue( OUSTR( "Confirmation" ) );
- if ( sal_False == ( value >>= m_confirmationRequired ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get Confirmation setting" ),
- Reference< XInterface > () );
- }
+ beans::PropertyValue configPath;
+ configPath.Name = ::rtl::OUString::createFromAscii( "nodepath" );
+ configPath.Value <<= ::rtl::OUString::createFromAscii( "org.openoffice.Office.Common/Security/Scripting" );
+ Sequence < Any > aargs( 1 );
+ aargs[ 0 ] <<= configPath;
+ ENSURE_OR_THROW( m_xConfigProvFactory.is(),
+ "ScriptSecurityManager::readConfiguration: ConfigProviderFactory no longer valid!" );
+ // get the XPropertySet interface from the ConfigurationAccess service
+ Reference < beans::XPropertySet > xPropSet( m_xConfigProvFactory->createInstanceWithArguments( s_configAccess, aargs ), UNO_QUERY_THROW );
+
+ m_confirmationRequired = sal_True;
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "Confirmation" ) ) >>= m_confirmationRequired );
if ( m_confirmationRequired == sal_True )
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: confirmation is true" );
@@ -443,13 +385,10 @@ void ScriptSecurityManager::readConfiguration()
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: confirmation is false" );
}
- value=xPropSet->getPropertyValue( OUSTR( "Warning" ) );
- if ( sal_False == ( value >>= m_warning ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get Warning setting" ),
- Reference< XInterface > () );
- }
+
+ m_warning = true;
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "Warning" ) ) >>= m_warning );
+
if ( m_warning == sal_True )
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: warning is true" );
@@ -458,21 +397,13 @@ void ScriptSecurityManager::readConfiguration()
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration: warning is false" );
}
- value=xPropSet->getPropertyValue( OUSTR( "OfficeBasic" ) );
- if ( sal_False == ( value >>= m_runMacroSetting ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get OfficeBasic setting" ),
- Reference< XInterface > () );
- }
+
+ m_runMacroSetting = sal_True;
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "OfficeBasic" ) ) >>= m_runMacroSetting );
OSL_TRACE( "ScriptSecurityManager:readConfiguration: OfficeBasic = %d", m_runMacroSetting );
- value=xPropSet->getPropertyValue( OUSTR( "SecureURL" ) );
- if ( sal_False == ( value >>= m_secureURL ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptSecurityManager:readConfiguration: can't get SecureURL setting" ),
- Reference< XInterface > () );
- }
+
+ m_secureURL = ::rtl::OUString();
+ OSL_VERIFY( xPropSet->getPropertyValue( OUSTR( "SecureURL" ) ) >>= m_secureURL );
}
catch ( beans::UnknownPropertyException & upe )
{
@@ -508,18 +439,14 @@ void ScriptSecurityManager::readConfiguration()
int length = m_secureURL.getLength();
// PathSubstitution needed to interpret variables found in config
- Reference< lang::XMultiComponentFactory > xMgr = m_xContext->getServiceManager();
- validateXRef( xMgr,
- "ScriptSecurityManager::readConfiguration: cannot get XMultiComponentFactory" );
- xInterface = xMgr->createInstanceWithContext(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.util.PathSubstitution"), m_xContext);
- validateXRef( xInterface,
- "ScriptSecurityManager::readConfiguration: cannot get ConfigurationProvider" );
+ Reference< lang::XMultiComponentFactory > xMgr( m_xContext->getServiceManager(), UNO_SET_THROW );
+ Reference< XInterface > xInterface = );
Reference< util::XStringSubstitution > xStringSubstitution(
- xInterface, UNO_QUERY);
- validateXRef( xStringSubstitution,
- "ScriptSecurityManager::readConfiguration: cannot get ConfigurationProvider" );
+ xMgr->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii( "com.sun.star.util.PathSubstitution" ), m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
for( int i = 0; i < length; i++ )
{
OSL_TRACE( "ScriptSecurityManager:readConfiguration path = %s",
@@ -552,16 +479,9 @@ throw ( RuntimeException )
configPath.Value <<= ::rtl::OUString::createFromAscii( "org.openoffice.Office.Common/Security/Scripting" );
Sequence < Any > aargs( 1 );
aargs[ 0 ] <<= configPath;
- Reference< XInterface > xInterface = m_xConfigProvFactory->createInstanceWithArguments( s_configUpdate,
- aargs );
- validateXRef( xInterface,
- "ScriptSecurityManager::addToSecurePaths: ScriptSecurityManager: cannot get ConfigurationUpdateAccess" );
- Reference < container::XNameReplace > xNameReplace( xInterface, UNO_QUERY );
- validateXRef( xNameReplace,
- "ScriptSecurityManager::addToSecurePaths: ScriptSecurityManager: cannot get XNameReplace" );
- Reference < util::XChangesBatch > xChangesBatch( xInterface, UNO_QUERY );
- validateXRef( xChangesBatch,
- "ScriptSecurityManager::addToSecurePaths: cannot get XChangesBatch" );
+ Reference < container::XNameReplace > xNameReplace(
+ m_xConfigProvFactory->createInstanceWithArguments( s_configUpdate, aargs ), UNO_QUERY_THROW );
+ Reference < util::XChangesBatch > xChangesBatch( xNameReplace, UNO_QUERY_THROW );
OSL_TRACE( "--->ScriptSecurityManager::addToSecurePaths: after if stuff" );
Reference < beans::XPropertySet > xPropSet( xInterface, UNO_QUERY );
diff --git a/scripting/source/storage/ScriptStorage.cxx b/scripting/source/storage/ScriptStorage.cxx
index 7315e9d35dd5..e4ea5f231f47 100644
--- a/scripting/source/storage/ScriptStorage.cxx
+++ b/scripting/source/storage/ScriptStorage.cxx
@@ -84,16 +84,11 @@ const sal_uInt16 NUMBER_STORAGE_INITIALIZE_ARGS = 3;
ScriptStorage::ScriptStorage( const Reference <
XComponentContext > & xContext )
throw ( RuntimeException )
- : m_xContext( xContext ), m_bInitialised( false )
+ : m_xContext( xContext, UNO_SET_THROW ), m_bInitialised( false )
{
OSL_TRACE( "< ScriptStorage ctor called >\n" );
- validateXRef( m_xContext,
- "ScriptStorage::ScriptStorage : cannot get component context" );
-
- m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "ScriptStorage::ScriptStorage : cannot get service manager" );
+ m_xMgr.set( m_xContext->getServiceManager(), UNO_SET_THROW );
if( !mh_scriptLangs )
{
@@ -101,47 +96,30 @@ throw ( RuntimeException )
if( !mh_scriptLangs )
{
mh_scriptLangs = new ScriptLanguages_hash();
- Reference< XInterface > xInterface =
- m_xMgr->createInstanceWithContext(
- OUString::createFromAscii(
- "com.sun.star.configuration.ConfigurationProvider" )
- , m_xContext );
- validateXRef( xInterface,
- "ScriptStorage::ScriptStorage: cannot get ConfigurationProvider" );
+ Reference< lang::XMultiServiceFactory > xConfigProvFactory(
+ m_xMgr->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" ), m_xContext ),
+ UNO_QUERY_THROW );
// create an instance of the ConfigurationAccess for accessing the
// scripting runtime settings
- Reference< lang::XMultiServiceFactory > xConfigProvFactory =
- Reference < lang::XMultiServiceFactory >
- ( xInterface, UNO_QUERY_THROW );
- validateXRef( xConfigProvFactory,
- "ScriptStorage::ScriptStorage: cannot get XMultiServiceFactory interface from ConfigurationProvider" );
beans::PropertyValue configPath;
configPath.Name = ::rtl::OUString::createFromAscii( "nodepath" );
configPath.Value <<= ::rtl::OUString::createFromAscii( "org.openoffice.Office.Scripting/ScriptRuntimes" );
Sequence < Any > aargs( 1 );
aargs[ 0 ] <<= configPath;
- xInterface = xConfigProvFactory->createInstanceWithArguments(
- OUString::createFromAscii(
- "com.sun.star.configuration.ConfigurationAccess"),
- aargs );
- validateXRef( xInterface,
- "ScriptStorage::ScriptStorage: cannot get ConfigurationAccess" );
- Reference< container::XNameAccess > xNameAccess =
- Reference < container::XNameAccess > ( xInterface,
- UNO_QUERY_THROW );
- validateXRef( xNameAccess,
- "ScriptStorage::ScriptStorage: cannot get ConfigurationAccess" );
+ Reference< container::XNameAccess > xNameAccess(
+ xConfigProvFactory->createInstanceWithArguments(
+ OUString::createFromAscii( "com.sun.star.configuration.ConfigurationAccess" ),
+ aargs
+ ),
+ UNO_QUERY_THROW );
+
Sequence< OUString > names = xNameAccess->getElementNames();
for( int i = 0 ; i < names.getLength() ; i++ )
{
OSL_TRACE( "Getting propertyset for Lang=%s",
::rtl::OUStringToOString( names[i], RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- Reference< beans::XPropertySet > xPropSet =
- Reference< beans::XPropertySet >( xNameAccess->getByName(names[i]),
- UNO_QUERY_THROW );
- validateXRef( xPropSet,
- "ScriptStorage::ScriptStorage: cannot get XPropertySet for name" );
+ Reference< beans::XPropertySet > xPropSet( xNameAccess->getByName( names[i] ), UNO_QUERY_THROW );
Any aProp = xPropSet->getPropertyValue(
OUString::createFromAscii( "SupportedFileExtensions") );
Sequence< OUString > extns;
@@ -285,9 +263,7 @@ throw ( RuntimeException, Exception )
OUString xStringUri(m_stringUri);
ScriptMetadataImporter* SMI = new ScriptMetadataImporter( m_xContext );
- Reference< xml::sax::XExtendedDocumentHandler > xSMI( SMI );
-
- validateXRef( xSMI, "ScriptStorage::create: failed to obtain valid XExtendedDocumentHandler" );
+ Reference< xml::sax::XExtendedDocumentHandler > xSMI( SMI, UNO_SET_THROW );
xStringUri = xStringUri.concat( ::rtl::OUString::createFromAscii(
SCRIPT_DIR ) );
@@ -587,15 +563,14 @@ throw ( RuntimeException )
"/parcel.xml" ) ),
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- Reference< XInterface > xInterface =
+ xHandler.set(
m_xMgr->createInstanceWithContext(
- OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ),
- m_xContext );
- validateXRef( xInterface, "ScriptStorage::save: cannot get sax.Writer" );
- xHandler = Reference<xml::sax::XExtendedDocumentHandler>(
- xInterface, UNO_QUERY_THROW );
- xSource = Reference< io::XActiveDataSource >(
- xHandler, UNO_QUERY_THROW );
+ OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ),
+ m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
+ xSource.set( xHandler, UNO_QUERY_THROW );
xSource->setOutputStream( xOS );
writeMetadataHeader( xHandler );
diff --git a/scripting/source/storage/ScriptStorageManager.cxx b/scripting/source/storage/ScriptStorageManager.cxx
index 77ca5a45dd15..424f2752bc47 100644
--- a/scripting/source/storage/ScriptStorageManager.cxx
+++ b/scripting/source/storage/ScriptStorageManager.cxx
@@ -45,6 +45,7 @@
#include "ScriptStorageManager.hxx"
#include <util/util.hxx>
#include <util/scriptingconstants.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -70,32 +71,19 @@ static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceNam
// ScriptStorageManager Constructor
ScriptStorageManager::ScriptStorageManager( const Reference<
XComponentContext > & xContext ) SAL_THROW ( ( RuntimeException ) )
- : m_xContext( xContext ), m_count( 0 ), m_securityMgr( xContext )
+ : m_xContext( xContext, UNO_SET_THROW ), m_count( 0 ), m_securityMgr( xContext )
{
OSL_TRACE( "< ScriptStorageManager ctor called >\n" );
//s_moduleCount.modCnt.acquire( &s_moduleCount.modCnt );
- validateXRef( m_xContext,
- "ScriptStorageManager::ScriptStorageManager : cannot get component context" );
-
- m_xMgr = m_xContext->getServiceManager();
- validateXRef( m_xMgr,
- "ScriptStorageManager::ScriptStorageManager : cannot get service manager" );
+ m_xMgr.set( m_xContext->getServiceManager(), UNO_SET_THROW );
try
{
// obtain the macro expander singleton to use in determining the
// location of the application script storage
- Any aAny = m_xContext->getValueByName( OUString::createFromAscii(
- "/singletons/com.sun.star.util.theMacroExpander" ) );
- Reference< util::XMacroExpander > xME;
- if ( sal_False == ( aAny >>= xME ) )
- {
- throw RuntimeException(
- OUSTR( "ScriptStorageManager::ScriptStorageManager: can't get XMacroExpander" ),
- Reference< XInterface >() );
- }
- validateXRef( xME, "ScriptStorageManager constructor: can't get MacroExpander" );
+ Reference< util::XMacroExpander > xME( m_xContext->getValueByName( OUString::createFromAscii(
+ "/singletons/com.sun.star.util.theMacroExpander" ) ), UNO_QUERY_THROW );
OUString base = OUString::createFromAscii(
SAL_CONFIGFILE( "${$BRAND_BASE_DIR/program/bootstrap" ) );
@@ -126,12 +114,13 @@ SAL_THROW ( ( RuntimeException ) )
{
try
{
- Reference< XInterface > xInterface =
+ Reference< ucb::XSimpleFileAccess > xSFA(
m_xMgr->createInstanceWithContext(
- OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), m_xContext );
- validateXRef( xInterface,
- "ScriptStorageManager constructor: can't get SimpleFileAccess XInterface" );
- Reference< ucb::XSimpleFileAccess > xSFA( xInterface, UNO_QUERY_THROW );
+ OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
+ m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
setupAnyStorage( xSFA, xME->expandMacros( storageStr ), appStr );
}
@@ -168,13 +157,14 @@ SAL_THROW ( ( RuntimeException ) )
::rtl::OUStringToOString( storageStr,
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
- Reference< XInterface > xInterface =
+ Reference< XInterface > xInterface(
m_xMgr->createInstanceWithArgumentsAndContext(
- OUString::createFromAscii(
- "drafts.com.sun.star.script.framework.storage.ScriptStorage" ),
- aArgs, m_xContext );
-
- validateXRef( xInterface, "ScriptStorageManager:: setupAnyStorage: Can't create ScriptStorage for share" );
+ OUString::createFromAscii( "drafts.com.sun.star.script.framework.storage.ScriptStorage" ),
+ aArgs,
+ m_xContext
+ ),
+ UNO_QUERY_THROW
+ );
// and place it in the hash_map. Increment the counter
m_ScriptStorageMap[ m_count++ ] = xInterface;
@@ -215,8 +205,7 @@ ScriptStorageManager::createScriptStorage(
throw ( RuntimeException )
{
OSL_TRACE( "** ==> ScriptStorageManager in createScriptingStorage\n" );
- validateXRef( xSFA,
- "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
+ ENSURE_OR_THROW( xSFA.is(), "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
return setupAnyStorage( xSFA, ::rtl::OUString::createFromAscii( "" ),
::rtl::OUString::createFromAscii( "" ) );
@@ -229,7 +218,7 @@ ScriptStorageManager::createScriptStorageWithURI(
throw ( RuntimeException )
{
OSL_TRACE( "** ==> ScriptStorageManager in createScriptingStorageWithURI\n" );
- validateXRef( xSFA, "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
+ ENSURE_OR_THROW( xSFA.is(), "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" );
// related to issue 11866
// warning dialog gets launched when adding binding to script in doc
@@ -313,7 +302,7 @@ throw( RuntimeException )
OUSTR( "ScriptStorageManager::getScriptStorage: invalid storage ID" ),
Reference< XInterface >() );
}
- validateXRef( itr->second,
+ ENSURE_OR_THROW( itr->second.is(),
"ScriptStorageManager::getScriptStorage: Cannot get ScriptStorage from ScriptStorageHash" );
return itr->second;
}
diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx
index b2e40c1e7442..708a05390f12 100644..100755
--- a/sd/inc/undo/undomanager.hxx
+++ b/sd/inc/undo/undomanager.hxx
@@ -40,31 +40,21 @@ public:
UndoManager( USHORT nMaxUndoActionCount = 20 );
virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0);
- virtual void LeaveListAction();
virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE );
- bool isInListAction() const { return mnListLevel != 0; }
- bool isInUndo() const { return maIsInUndoLock.isLocked(); }
-
- virtual BOOL Undo( USHORT nCount=1 );
- virtual BOOL Redo( USHORT nCount=1 );
-
/** Set or reset the undo manager linked with the called undo manager.
*/
- void SetLinkedUndoManager (SfxUndoManager* pLinkedUndoManager);
+ void SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager);
private:
using SfxUndoManager::Undo;
using SfxUndoManager::Redo;
- int mnListLevel;
- ScopeLock maIsInUndoLock;
-
/** Used when the outline view is visible as a last resort to
synchronize the undo managers.
*/
- SfxUndoManager* mpLinkedUndoManager;
+ ::svl::IUndoManager* mpLinkedUndoManager;
/** Call ClearRedo() at the linked undo manager, when present.
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 025700a790fc..43e44ce1e70f 100755
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -535,7 +535,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage(
|* den Seiten transferieren, sonst verlieren die Textobjekte
|* beim Transfer den Bezug zur Vorlage
\*************************************************************************/
- SfxUndoManager* pUndoMgr = NULL;
+ ::svl::IUndoManager* pUndoMgr = NULL;
if( mpDocSh )
{
pUndoMgr = mpDocSh->GetUndoManager();
@@ -1356,7 +1356,7 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo)
void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, BOOL bOnlyDuplicatePages, BOOL bUndo)
{
::sd::View* pView = NULL;
- SfxUndoManager* pUndoMgr = NULL;
+ ::svl::IUndoManager* pUndoMgr = NULL;
if( bUndo && !IsUndoEnabled() )
bUndo = FALSE;
@@ -1525,7 +1525,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum,
if( mpDocSh )
mpDocSh->SetWaitCursor( TRUE );
- SfxUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
const bool bUndo = IsUndoEnabled();
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index e045437d37b1..c52cd24270ee 100755
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -251,8 +251,8 @@ void SdPage::EnsureMasterPageDefaultBackground()
*/
SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rectangle& rRect, BOOL /* bInsert */ )
{
- sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
- const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted();
+ ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
SdrObject* pSdrObj = NULL;
@@ -716,10 +716,10 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang
{
if( pObj->GetUserCall() )
{
- sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
- const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted();
+ ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
/*
- DBG_ASSERT( bUndo || (pUndoManager && pUndoManager->isInUndo()),
+ DBG_ASSERT( bUndo || (pUndoManager && pUndoManager->IsDoing()),
"SdPage::Changed(), model change without undo!?" );
*/
if( bUndo )
@@ -767,8 +767,8 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang
void SdPage::CreateTitleAndLayout(BOOL bInit, BOOL bCreate )
{
- sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
- const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted();
+ ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
SdPage* pMasterPage = this;
@@ -1554,8 +1554,8 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, BOOL bInit, BOOL bCreate )
const bool bSwitchLayout = eLayout != GetAutoLayout();
- sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
- const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted();
+ ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
meAutoLayout = eLayout;
@@ -2112,8 +2112,8 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
if( !pModel || !pSourceObj )
return pSourceObj;
- sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
- const bool bUndo = pUndoManager && pUndoManager->isInListAction() && rPage.IsInserted();
+ ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && rPage.IsInserted();
SdrObject* pNewObj = pSourceObj;
if((eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() == OBJ_TEXT) )
@@ -2252,8 +2252,8 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
*/
SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind, bool bVertical, Rectangle aRect, bool bInit )
{
- sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
- const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted();
+ ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
if (!pObj && bInit)
{
diff --git a/sd/source/core/undo/undomanager.cxx b/sd/source/core/undo/undomanager.cxx
index f3fe9b11c2bd..6ee11d03e392 100644..100755
--- a/sd/source/core/undo/undomanager.cxx
+++ b/sd/source/core/undo/undomanager.cxx
@@ -34,40 +34,22 @@ using namespace sd;
UndoManager::UndoManager( USHORT nMaxUndoActionCount /* = 20 */ )
: SfxUndoManager( nMaxUndoActionCount )
-, mnListLevel( 0 )
, mpLinkedUndoManager(NULL)
{
}
void UndoManager::EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId /* =0 */)
{
- if( !isInUndo() )
+ if( !IsDoing() )
{
ClearLinkedRedoActions();
- mnListLevel++;
SfxUndoManager::EnterListAction( rComment, rRepeatComment, nId );
}
}
-void UndoManager::LeaveListAction()
-{
- if( !isInUndo() )
- {
- SfxUndoManager::LeaveListAction();
- if( mnListLevel )
- {
- mnListLevel--;
- }
- else
- {
- DBG_ERROR("sd::UndoManager::LeaveListAction(), no open list action!" );
- }
- }
-}
-
void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALSE */ )
{
- if( !isInUndo() )
+ if( !IsDoing() )
{
ClearLinkedRedoActions();
SfxUndoManager::AddUndoAction( pAction, bTryMerg );
@@ -79,22 +61,7 @@ void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALS
}
-BOOL UndoManager::Undo( USHORT nCount )
-{
- ScopeLockGuard aGuard( maIsInUndoLock );
- return SfxUndoManager::Undo( nCount );
-}
-
-BOOL UndoManager::Redo( USHORT nCount )
-{
- ScopeLockGuard aGuard( maIsInUndoLock );
- return SfxUndoManager::Redo( nCount );
-}
-
-
-
-
-void UndoManager::SetLinkedUndoManager (SfxUndoManager* pLinkedUndoManager)
+void UndoManager::SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager)
{
mpLinkedUndoManager = pLinkedUndoManager;
}
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 9cdbc2f0cfba..2d70316c1432 100755
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -289,7 +289,7 @@ CustomAnimationPane::~CustomAnimationPane()
void CustomAnimationPane::addUndo()
{
- SfxUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager();
if( pManager )
{
SdPage* pPage = SdPage::getImplementation( mxCurrentPage );
@@ -2461,7 +2461,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
CustomAnimationEffectPtr pEffect = xTag->getEffect();
if( (pPathObj != 0) && pEffect.get() != 0 )
{
- SfxUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager();
if( pManager )
{
SdPage* pPage = SdPage::getImplementation( mxCurrentPage );
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index fe34f0138db2..88b30ab658e3 100755
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -265,9 +265,9 @@ void lcl_CreateUndoForPages(
const ::sd::slidesorter::SharedPageSelection& rpPages,
::sd::ViewShellBase& rBase )
{
- ::sd::DrawDocShell* pDocSh = rBase.GetDocShell();
- SfxUndoManager* pManager = pDocSh->GetUndoManager();
- SdDrawDocument* pDoc = pDocSh->GetDoc();
+ ::sd::DrawDocShell* pDocSh = rBase.GetDocShell();
+ ::svl::IUndoManager* pManager = pDocSh->GetUndoManager();
+ SdDrawDocument* pDoc = pDocSh->GetDoc();
if( pManager && pDocSh && pDoc )
{
String aComment( SdResId(STR_UNDO_SLIDE_PARAMS) );
diff --git a/sd/source/ui/app/app.img b/sd/source/ui/app/app.img
deleted file mode 100644
index a435b84b8887..000000000000
--- a/sd/source/ui/app/app.img
+++ /dev/null
@@ -1,120 +0,0 @@
-File = "sc05410.bmp";Identifier = SID_HELPMENU;
-File = "sc05500.bmp";Identifier = SID_NEW_DOCUMENT;File = "sco043.bmp
-File = "sc05501.bmp";Identifier = SID_OPENDOC;File = "sco044.bmp
-File = "sc05504.bmp";Identifier = SID_PRINTDOC;File = "sco051.bmp
-File = "sc05505.bmp";Identifier = SID_SAVEDOC;File = "sco046.bmp
-File = "sc05539.bmp";Identifier = SID_TEMPLATE;
-File = "sc05561.bmp";Identifier = SID_INSERT_OBJECT;
-File = "sc05700.bmp";Identifier = SID_REDO;
-File = "sc05701.bmp";Identifier = SID_UNDO;
-File = "sc05710.bmp";Identifier = SID_CUT;File = "sco058.bmp
-File = "sc05711.bmp";Identifier = SID_COPY;File = "sco059.bmp
-File = "sc05712.bmp";Identifier = SID_PASTE;File = "sco060.bmp
-
-File = "sc10008.bmp";Identifier = SID_ATTR_CHAR_POSTURE;
-File = "sc10009.bmp";Identifier = SID_ATTR_CHAR_WEIGHT;
-File = "sc10012.bmp";Identifier = SID_ATTR_CHAR_CONTOUR;
-File = "sc10014.bmp";Identifier = SID_ATTR_CHAR_UNDERLINE;
-File = "sc10028.bmp";Identifier = SID_TEXT_ADJUST_LEFT;
-File = "sc10029.bmp";Identifier = SID_TEXT_ADJUST_RIGHT;
-File = "sc10030.bmp";Identifier = SID_TEXT_ADJUST_CENTER;
-File = "sc10031.bmp";Identifier = SID_TEXT_ADJUST_BLOCK;
-File = "sc10034.bmp";Identifier = SID_TEXT_LINESPACING_1;
-File = "sc10035.bmp";Identifier = SID_TEXT_LINESPACING_2;
-File = "sc10036.bmp";Identifier = SID_TEXT_LINESPACING_3;
-File = "sc10087.bmp";Identifier = SID_TRANSFORM;
-File = "sc10102.bmp";Identifier = SID_TOOL_LINE;File = "sco207.bmp
-File = "sc10104.bmp";Identifier = SID_TOOL_RECT;File = "sco209.bmp
-File = "sc10110.bmp";Identifier = SID_TOOL_ELLIPSE;File = "sco215.bmp
-File = "sc10113.bmp";Identifier = SID_TOOL_PIE;File = "sco220.bmp
-File = "sc10114.bmp";Identifier = SID_TOOL_ARC;File = "sco217.bmp
-File = "sc10116.bmp";Identifier = SID_TOOL_CIRCLECUT;File = "sco221.bmp
-File = "sc10117.bmp";Identifier = SID_TOOL_POLYGON;File = "sco222.bmp
-File = "sc10118.bmp";Identifier = SID_TOOL_BEZIER;File = "sco223.bmp
-File = "sc10119.bmp";Identifier = SID_BEZIER_INSERT;
-File = "sc10120.bmp";Identifier = SID_BEZIER_DELETE;
-File = "sc10121.bmp";Identifier = SID_BEZIER_MOVE;
-File = "sc10122.bmp";Identifier = SID_BEZIER_CLOSE;
-// wurde durch sc20014.bmp ersetzt:
-// File = "sc10123.bmp";Identifier = SID_BEZIER_SMOOTH;
-File = "sc10126.bmp";Identifier = SID_EDIT_POINTS;
-File = "sc10127.bmp";Identifier = SID_BEZIER_CUTLINE;
-File = "sc10129.bmp";Identifier = SID_TOOL_ROTATE;
-File = "sc10130.bmp";Identifier = SID_ALIGNMENT;
-File = "sc10131.bmp";Identifier = SID_LEFT;File = "sco231.bmp
-File = "sc10132.bmp";Identifier = SID_CENTER;File = "sco232.bmp
-File = "sc10133.bmp";Identifier = SID_RIGHT;File = "sco233.bmp
-File = "sc10134.bmp";Identifier = SID_UP;File = "sco234.bmp
-File = "sc10135.bmp";Identifier = SID_MIDDLE;File = "sco235.bmp
-File = "sc10136.bmp";Identifier = SID_DOWN;File = "sco236.bmp
-File = "sc10140.bmp";Identifier = SID_INSERTDIAGRAM;File = "sco246.bmp
-File = "sc10141.bmp";Identifier = SID_ATTR_TABLE;
-File = "sc10142.bmp";Identifier = SID_AREA;
-File = "sc10143.bmp";Identifier = SID_LINE;
-File = "sc10144.bmp";Identifier = SID_TOOL_CONTROLS;File = "sco270.bmp
-File = "sc10145.bmp";Identifier = SID_DIALOG_TESTMODE;File = "sco274.bmp
-File = "sc10146.bmp";Identifier = SID_INSERT_PUSHBUTTON;File = "sco271.bmp
-File = "sc10147.bmp";Identifier = SID_INSERT_RADIOBUTTON;File = "sco272.bmp
-File = "sc10148.bmp";Identifier = SID_INSERT_CHECKBOX;File = "sco273.bmp
-File = "sc10150.bmp";Identifier = SID_OUTLINE_UP;File = "sco290.bmp
-File = "sc10151.bmp";Identifier = SID_OUTLINE_DOWN;File = "sco291.bmp
-File = "sc10152.bmp";Identifier = SID_OUTLINE_LEFT;File = "sco292.bmp
-File = "sc10153.bmp";Identifier = SID_OUTLINE_RIGHT;File = "sco293.bmp
-File = "sc10154.bmp";Identifier = SID_OUTLINE_FORMAT;File = "sco204.bmp
-File = "sc10155.bmp";Identifier = SID_OUTLINE_TITLE;File = "sco295.bmp
-File = "sc10156.bmp";Identifier = SID_OUTLINE_BULLET;File = "sco296.bmp
-File = "sc10157.bmp";Identifier = SID_PRESENTATION;File = "sco238.bmp
-File = "sc10159.bmp";Identifier = SID_REHEARSE_TIMINGS;File = "sco239.bmp
-File = "sc10160.bmp";Identifier = SID_DIA;File = "sco240.bmp
-File = "sc10161.bmp";Identifier = SID_HIDE_SLIDE;File = "sco241.bmp
-File = "sc10162.bmp";Identifier = SID_CHOOSE_POLYGON;File = "sco242.bmp
-File = "sc10163.bmp";Identifier = SID_SHOW_BROWSER;File = "sco275.bmp
-File = "sc10188.bmp";Identifier = SID_INSERT_FIXEDTEXT;File = "sco276.bmp
-File = "sc10189.bmp";Identifier = SID_INSERT_GROUPBOX;File = "sco277.bmp
-File = "sc10191.bmp";Identifier = SID_INSERT_LISTBOX;File = "sco278.bmp
-File = "sc10192.bmp";Identifier = SID_INSERT_COMBOBOX;File = "sco279.bmp
-File = "sc10231.bmp";Identifier = SID_OUTLINE_COLLAPSE;
-File = "sc10232.bmp";Identifier = SID_OUTLINE_EXPAND_ALL;
-File = "sc10233.bmp";Identifier = SID_OUTLINE_EXPAND;
-File = "sc10240.bmp";Identifier = SID_INSERT_FRAME;
-File = "sc10241.bmp";Identifier = SID_INSERT_GRAPHIC;
-File = "sc10242.bmp";Identifier = SID_AUTOFORMAT;
-File = "sc10243.bmp";Identifier = SID_SPELLING;
-File = "sc10244.bmp";Identifier = SID_INSERT_DRAW;
-File = "sc10700.bmp";Identifier = SID_TOOL_SELECT;File = "sco200.bmp
-File = "sc10701.bmp";Identifier = SID_TOOL_ZOOM;File = "sco201.bmp
-File = "sc10702.bmp";Identifier = SID_ZOOM_PLUS;File = "sco202.bmp
-File = "sc10703.bmp";Identifier = SID_ZOOM_MINUS;File = "sco203.bmp
-File = "sc10704.bmp";Identifier = SID_ZOOM_100_PERCENT;File = "sco204.bmp
-File = "sc10705.bmp";Identifier = SID_ZOOM_PAGE;File = "sco205.bmp
-File = "sc10706.bmp";Identifier = SID_ZOOM_OBJECTS;File = "sco206.bmp
-File = "sc10724.bmp";Identifier = SID_TOOL_TEXT;File = "sco224.bmp
-
-File = "sc20000.bmp";Identifier = SID_ATTR_CHAR_COLOR;File = "charcol.bmp";
-File = "sc20001.bmp";Identifier = SID_TOOL_CONNECTOR;File = "sco298.bmp";
-
-// Controller
-File = "sc20002.bmp";Identifier = SID_TEMPLATE_APPLY;
-File = "sc20003.bmp";Identifier = SID_ATTR_LINE_STYLE;
-File = "sc20004.bmp";Identifier = SID_ATTR_LINE_WIDTH;
-File = "sc20005.bmp";Identifier = SID_ATTR_LINE_COLOR;
-File = "sc20006.bmp";Identifier = SID_ATTR_FILL_STYLE;
-File = "sc20007.bmp";Identifier = SID_DIA_EFFECT;
-File = "sc20008.bmp";Identifier = SID_DIA_SPEED;
-File = "sc20009.bmp";Identifier = SID_DIA_AUTO;
-File = "sc20010.bmp";Identifier = SID_DIA_TIME;
-File = "sc20011.bmp";Identifier = SID_ATTR_FONT;
-File = "sc20012.bmp";Identifier = SID_ATTR_FONTHEIGHT;
-
-// Bezier-Toolbar
-File = "sc20013.bmp";Identifier = SID_BEZIER_EDGE;
-File = "sc20014.bmp";Identifier = SID_BEZIER_SMOOTH;
-File = "sc20015.bmp";Identifier = SID_BEZIER_SYMMTR;
-File = "sc20016.bmp";Identifier = SID_BEZIER_CONVERT;
-
-// Standardleiste
-File = "sc20020.bmp";Identifier = SID_INSERTPAGE;
-File = "sc20094.bmp";Identifier = SID_MODIFYPAGE;
-File = "sc20170.bmp";Identifier = SID_PRESENTATION_LAYOUT;
-
-// Basic-IDE ...
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 29425a3bda71..cd5977772bfe 100755
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -317,7 +317,7 @@ void LayerTabBar::EndRenaming()
DBG_ASSERT( pDrView, "Rename layer undo action is only working with a SdDrawView" );
if( pDrView )
{
- SfxUndoManager* pManager = pDoc->GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pManager = pDoc->GetDocSh()->GetUndoManager();
SdLayerModifyUndoAction* pAction = new SdLayerModifyUndoAction(
pDoc,
pLayer,
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 82ca4d05b996..4645b3540f04 100755
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -1556,7 +1556,7 @@ void AssistentDlgImpl::UpdatePreview( BOOL bDocPreview )
{
SfxObjectShell* pShell = xDocShell;
DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
- SfxUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL;
+ ::svl::IUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL;
if(pUndoMgr)
pUndoMgr->Undo();
mbUserDataDirty = TRUE;
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 78b1b9434ad0..9714d8599374 100755
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -462,7 +462,7 @@ void DrawDocShell::Deactivate( BOOL )
|*
\************************************************************************/
-SfxUndoManager* DrawDocShell::GetUndoManager()
+::svl::IUndoManager* DrawDocShell::GetUndoManager()
{
return mpUndoManager;
}
@@ -600,7 +600,7 @@ void DrawDocShell::ClearUndoBuffer()
pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
}
- SfxUndoManager* pUndoManager = GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = GetUndoManager();
if(pUndoManager && pUndoManager->GetUndoActionCount())
pUndoManager->Clear();
}
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index 92b1450624e1..92aa2d3cc9f3 100644..100755
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -146,7 +146,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
pOV->InsertText( aEmptyStr );
// prepare undo
- SfxUndoManager& rUndoMgr = pOL->GetUndoManager();
+ ::svl::IUndoManager& rUndoMgr = pOL->GetUndoManager();
rUndoMgr.EnterListAction(String(SdResId(STR_UNDO_INSERT_SPECCHAR)),
aEmptyStr );
@@ -276,7 +276,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
SfxItemSet aOldSet( mpDoc->GetPool(), EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, 0 );
aOldSet.Put( pOV->GetAttribs() );
- SfxUndoManager& rUndoMgr = pOL->GetUndoManager();
+ ::svl::IUndoManager& rUndoMgr = pOL->GetUndoManager();
rUndoMgr.EnterListAction(String(SdResId(STR_UNDO_INSERT_SPECCHAR)),
aEmptyStr );
pOV->InsertText(aChars, TRUE);
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index b348d6533930..980176b20b19 100644..100755
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -94,7 +94,7 @@ FunctionReference FuObjectAnimationParameters::Create( ViewShell* pViewSh, ::sd:
void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
{
- SfxUndoManager* pUndoMgr = mpViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = mpViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager();
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
ULONG nCount = rMarkList.GetMarkCount();
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index d4e2fcd8083f..fdbad8a3df22 100755
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -414,7 +414,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
else if( bSetToAllPages )
{
String aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
- SfxUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
pUndoMgr->EnterListAction(aComment, aComment);
SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
pUndoGroup->SetComment(aComment);
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index 4ad4b0d09392..b3f626f62137 100755
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -49,6 +49,7 @@ class SfxPrinter;
struct SdrDocumentStreamInfo;
struct SpellCallbackInfo;
class AbstractSvxNameDialog;
+class SfxUndoManager;
namespace sd {
@@ -100,7 +101,8 @@ public:
virtual Rectangle GetVisArea(USHORT nAspect) const;
virtual void Draw(OutputDevice*, const JobSetup& rSetup, USHORT nAspect = ASPECT_CONTENT);
- virtual SfxUndoManager* GetUndoManager();
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
virtual Printer* GetDocumentPrinter();
virtual void OnDocumentPrinterChanged(Printer* pNewPrinter);
virtual SfxStyleSheetBasePool* GetStyleSheetPool();
diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx
index 2b03cd636d0f..de1e1ebae006 100755
--- a/sd/source/ui/inc/SlideSorterViewShell.hxx
+++ b/sd/source/ui/inc/SlideSorterViewShell.hxx
@@ -192,7 +192,7 @@ protected:
/** This method is overloaded to handle a missing tool bar correctly.
This is the case when the slide sorter is not the main view shell.
*/
- virtual SfxUndoManager* ImpGetUndoManager (void) const;
+ virtual ::svl::IUndoManager* ImpGetUndoManager (void) const;
private:
::boost::shared_ptr<SlideSorter> mpSlideSorter;
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index e6e6b401cb57..195e323f579d 100755
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -534,7 +534,7 @@ protected:
::std::auto_ptr<Implementation> mpImpl;
// #96090# Support methods for centralized UNDO/REDO
- virtual SfxUndoManager* ImpGetUndoManager (void) const;
+ virtual ::svl::IUndoManager* ImpGetUndoManager (void) const;
void ImpGetUndoStrings(SfxItemSet &rSet) const;
void ImpGetRedoStrings(SfxItemSet &rSet) const;
void ImpSidUndo(BOOL bDrawViewShell, SfxRequest& rReq);
diff --git a/sd/source/ui/inc/unmodpg.hxx b/sd/source/ui/inc/unmodpg.hxx
index 185dc90b24bf..9a811b445f42 100644..100755
--- a/sd/source/ui/inc/unmodpg.hxx
+++ b/sd/source/ui/inc/unmodpg.hxx
@@ -36,9 +36,6 @@ class SdPage;
class ModifyPageUndoAction : public SdUndoAction
{
- // #67720#
- SfxUndoManager* mpManager;
-
SdPage* mpPage;
String maOldName;
String maNewName;
@@ -54,7 +51,6 @@ class ModifyPageUndoAction : public SdUndoAction
public:
TYPEINFO();
ModifyPageUndoAction(
- SfxUndoManager* pManager, // #67720#
SdDrawDocument* pTheDoc,
SdPage* pThePage,
String aTheNewName,
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 0ab4b9e3bdc3..9fb7fbed87e6 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -969,7 +969,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( USHORT nPageId, const String & r
SdPage* pPageToRename = NULL;
PageKind ePageKind = mrSlideSorter.GetModel().GetPageType();
- SfxUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager();
if( mrSlideSorter.GetModel().GetEditMode() == EM_PAGE )
{
@@ -989,7 +989,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( USHORT nPageId, const String & r
// (#67720#)
ModifyPageUndoAction* pAction = new ModifyPageUndoAction(
- pManager, pDocument, pUndoPage, rName, pUndoPage->GetAutoLayout(),
+ pDocument, pUndoPage, rName, pUndoPage->GetAutoLayout(),
aVisibleLayers.IsSet( nBackground ),
aVisibleLayers.IsSet( nBgObj ));
pManager->AddUndoAction( pAction );
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index f8e7e13cdd2b..b1bcc7050a77 100755
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -321,7 +321,7 @@ bool SlideSorterViewShell::RelocateToParentWindow (::Window* pParentWindow)
-SfxUndoManager* SlideSorterViewShell::ImpGetUndoManager (void) const
+::svl::IUndoManager* SlideSorterViewShell::ImpGetUndoManager (void) const
{
SfxShell* pObjectBar = GetViewShellBase().GetViewShellManager()->GetTopShell();
if (pObjectBar != NULL)
diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
index c5919b7aa7ee..f7d470e56333 100755
--- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
+++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
@@ -290,7 +290,7 @@ void DocumentHelper::ProvideStyles (
// Add an undo action for the copied style sheets.
if( !aCreatedStyles.empty() )
{
- SfxUndoManager* pUndoManager = rTargetDocument.GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = rTargetDocument.GetDocSh()->GetUndoManager();
if (pUndoManager != NULL)
{
SdMoveStyleSheetsUndoAction* pMovStyles =
@@ -341,7 +341,7 @@ void DocumentHelper::AssignMasterPageToPageList (
if (aCleanedList.size() == 0)
break;
- SfxUndoManager* pUndoMgr = rTargetDocument.GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = rTargetDocument.GetDocSh()->GetUndoManager();
if( pUndoMgr )
pUndoMgr->EnterListAction(String(SdResId(STR_UNDO_SET_PRESLAYOUT)), String());
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx
index fdd7c530137f..2a574fa087ef 100755
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -212,7 +212,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
SdPage* pUndoPage =
bHandoutMode ? pHandoutMPage : pCurrentPage;
- SfxUndoManager* pUndoManager = mrViewShell.GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = mrViewShell.GetDocSh()->GetUndoManager();
DBG_ASSERT(pUndoManager, "No UNDO MANAGER ?!?");
if( pUndoManager )
@@ -220,7 +220,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
String aComment( SdResId(STR_UNDO_MODIFY_PAGE) );
pUndoManager->EnterListAction(aComment, aComment);
ModifyPageUndoAction* pAction = new ModifyPageUndoAction(
- pUndoManager, pDocument, pUndoPage, aNewName, aNewAutoLayout, bBVisible, bBObjsVisible);
+ pDocument, pUndoPage, aNewName, aNewAutoLayout, bBVisible, bBObjsVisible);
pUndoManager->AddUndoAction(pAction);
// Clear the selection because the selectec object may be removed as
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index c1ffcb884cd1..2335a6ec838f 100755
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -915,7 +915,7 @@ void ViewShellManager::Implementation::UpdateShellStack (void)
// Remember the undo manager from the top-most shell on the stack.
SfxShell* pTopMostShell = mrBase.GetSubShell(0);
- SfxUndoManager* pUndoManager = (pTopMostShell!=NULL)
+ ::svl::IUndoManager* pUndoManager = (pTopMostShell!=NULL)
? pTopMostShell->GetUndoManager()
: NULL;
@@ -1015,7 +1015,7 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe
// Remember the undo manager from the top-most shell on the stack.
SfxShell* pTopMostShell = mrBase.GetSubShell(0);
- SfxUndoManager* pUndoManager = (pTopMostShell!=NULL)
+ ::svl::IUndoManager* pUndoManager = (pTopMostShell!=NULL)
? pTopMostShell->GetUndoManager()
: NULL;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 7aaba7d9c4fa..092dce05a196 100755
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -151,7 +151,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( rReq.GetArgs() )
{
BOOL bMergeUndo = FALSE;
- SfxUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
// Anpassungen Start/EndWidth #63083#
if(nSId == SID_ATTR_LINE_WIDTH)
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index d7cc1fc1d84a..b9f6ec9a4a96 100755
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -356,7 +356,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
break;
}
- SfxUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager();
SdLayerModifyUndoAction* pAction = new SdLayerModifyUndoAction(
GetDoc(),
pLayer,
@@ -748,9 +748,9 @@ bool DrawViewShell::RenameSlide( USHORT nPageId, const String & rName )
SetOfByte aVisibleLayers = mpActualPage->TRG_GetMasterPageVisibleLayers();
// (#67720#)
- SfxUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager();
+ ::svl::IUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager();
ModifyPageUndoAction* pAction = new ModifyPageUndoAction(
- pManager, GetDoc(), pUndoPage, rName, pUndoPage->GetAutoLayout(),
+ GetDoc(), pUndoPage, rName, pUndoPage->GetAutoLayout(),
aVisibleLayers.IsSet( nBackground ),
aVisibleLayers.IsSet( nBgObj ));
pManager->AddUndoAction( pAction );
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index dfad4b34c6f2..ee2ac158bffa 100755
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1451,7 +1451,7 @@ SdPage* OutlineView::GetActualPage()
SdPage* pCurrent = GetPageForParagraph(static_cast<Paragraph*>(pSelList->First()) );
DBG_ASSERT( pCurrent ||
- (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->isInUndo()) ||
+ (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->IsDoing()) ||
maDragAndDropModelGuard.get(),
"sd::OutlineView::GetActualPage(), no current page?" );
if( pCurrent )
@@ -1783,7 +1783,7 @@ void OutlineView::EndModelChange()
{
UpdateDocument();
- SfxUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager();
+ ::svl::IUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager();
bool bHasUndoActions = pDocUndoMgr->GetUndoActionCount() != 0;
@@ -1801,6 +1801,9 @@ void OutlineView::EndModelChange()
if( bHasUndoActions && mpOutliner->GetEditEngine().HasTriedMergeOnLastAddUndo() )
TryToMergeUndoActions();
+
+ mpOutlineViewShell->Invalidate( SID_UNDO );
+ mpOutlineViewShell->Invalidate( SID_REDO );
}
/** updates all changes in the outliner model to the draw model */
@@ -1838,7 +1841,7 @@ void OutlineView::UpdateDocument()
/** merge edit engine undo actions if possible */
void OutlineView::TryToMergeUndoActions()
{
- SfxUndoManager& rOutlineUndo = mpOutliner->GetUndoManager();
+ ::svl::IUndoManager& rOutlineUndo = mpOutliner->GetUndoManager();
if( rOutlineUndo.GetUndoActionCount() > 1 )
{
SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction* >( rOutlineUndo.GetUndoAction(0) );
@@ -1846,11 +1849,11 @@ void OutlineView::TryToMergeUndoActions()
if( pListAction && pPrevListAction )
{
// find the top EditUndo action in the top undo action list
- USHORT nAction = pListAction->aUndoActions.Count();
+ size_t nAction = pListAction->aUndoActions.size();
EditUndo* pEditUndo = 0;
while( !pEditUndo && nAction )
{
- pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction]);
+ pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction].pAction);
}
USHORT nEditPos = nAction; // we need this later to remove the merged undo actions
@@ -1858,7 +1861,7 @@ void OutlineView::TryToMergeUndoActions()
// make sure it is the only EditUndo action in the top undo list
while( pEditUndo && nAction )
{
- if( dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction]) )
+ if( dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction].pAction) )
pEditUndo = 0;
}
@@ -1867,10 +1870,10 @@ void OutlineView::TryToMergeUndoActions()
{
// yes, see if we can merge it with the prev undo list
- nAction = pPrevListAction->aUndoActions.Count();
+ nAction = pPrevListAction->aUndoActions.size();
EditUndo* pPrevEditUndo = 0;
while( !pPrevEditUndo && nAction )
- pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->aUndoActions[--nAction]);
+ pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->aUndoActions[--nAction].pAction);
if( pPrevEditUndo && pPrevEditUndo->Merge( pEditUndo ) )
{
@@ -1878,22 +1881,23 @@ void OutlineView::TryToMergeUndoActions()
// the top EditUndo of the previous undo list
// first remove the merged undo action
- DBG_ASSERT( pListAction->aUndoActions[nEditPos] == pEditUndo, "sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" );
+ DBG_ASSERT( pListAction->aUndoActions[nEditPos].pAction == pEditUndo,
+ "sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" );
pListAction->aUndoActions.Remove(nEditPos);
delete pEditUndo;
// now check if we also can merge the draw undo actions
- SfxUndoManager* pDocUndoManager = mpDocSh->GetUndoManager();
- if( pDocUndoManager && ( pListAction->aUndoActions.Count() == 1 ))
+ ::svl::IUndoManager* pDocUndoManager = mpDocSh->GetUndoManager();
+ if( pDocUndoManager && ( pListAction->aUndoActions.size() == 1 ))
{
- SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions[0] );
+ SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions[0].pAction );
SfxLinkUndoAction* pPrevLinkAction = 0;
if( pLinkAction )
{
- nAction = pPrevListAction->aUndoActions.Count();
+ nAction = pPrevListAction->aUndoActions.size();
while( !pPrevLinkAction && nAction )
- pPrevLinkAction = dynamic_cast< SfxLinkUndoAction* >(pPrevListAction->aUndoActions[--nAction]);
+ pPrevLinkAction = dynamic_cast< SfxLinkUndoAction* >(pPrevListAction->aUndoActions[--nAction].pAction);
}
if( pLinkAction && pPrevLinkAction &&
@@ -1905,15 +1909,15 @@ void OutlineView::TryToMergeUndoActions()
if( pSourceList && pDestinationList )
{
- USHORT nCount = pSourceList->aUndoActions.Count();
- USHORT nDestAction = pDestinationList->aUndoActions.Count();
+ USHORT nCount = pSourceList->aUndoActions.size();
+ USHORT nDestAction = pDestinationList->aUndoActions.size();
while( nCount-- )
{
- const SfxUndoAction* pTemp = pSourceList->aUndoActions.GetObject(0);
+ SfxUndoAction* pTemp = pSourceList->aUndoActions[0].pAction;
pSourceList->aUndoActions.Remove(0);
pDestinationList->aUndoActions.Insert( pTemp, nDestAction++ );
}
- pDestinationList->nCurUndoAction = pDestinationList->aUndoActions.Count();
+ pDestinationList->nCurUndoAction = pDestinationList->aUndoActions.size();
pListAction->aUndoActions.Remove(0);
delete pLinkAction;
@@ -1923,21 +1927,21 @@ void OutlineView::TryToMergeUndoActions()
}
}
- if( pListAction->aUndoActions.Count() )
+ if ( !pListAction->aUndoActions.empty() )
{
// now we have to move all remaining doc undo actions from the top undo
// list to the previous undo list and remove the top undo list
- USHORT nCount = pListAction->aUndoActions.Count();
- USHORT nDestAction = pPrevListAction->aUndoActions.Count();
+ size_t nCount = pListAction->aUndoActions.size();
+ size_t nDestAction = pPrevListAction->aUndoActions.size();
while( nCount-- )
{
- const SfxUndoAction* pTemp = pListAction->aUndoActions.GetObject(0);
+ SfxUndoAction* pTemp = pListAction->aUndoActions[0].pAction;
pListAction->aUndoActions.Remove(0);
if( pTemp )
pPrevListAction->aUndoActions.Insert( pTemp, nDestAction++ );
}
- pPrevListAction->nCurUndoAction = pPrevListAction->aUndoActions.Count();
+ pPrevListAction->nCurUndoAction = pPrevListAction->aUndoActions.size();
}
rOutlineUndo.RemoveLastUndoAction();
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 3aed9c6c0d9c..36d55213ab78 100755
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -1167,7 +1167,7 @@ bool View::isRecordingUndo() const
if( mpDoc && mpDoc->IsUndoEnabled() )
{
sd::UndoManager* pUndoManager = mpDoc ? mpDoc->GetUndoManager() : 0;
- return pUndoManager && pUndoManager->isInListAction();
+ return pUndoManager && pUndoManager->IsInListAction();
}
else
{
diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx
index 5a7f9830895e..66e5c7a506e5 100644..100755
--- a/sd/source/ui/view/unmodpg.cxx
+++ b/sd/source/ui/view/unmodpg.cxx
@@ -56,15 +56,13 @@ TYPEINIT1(ModifyPageUndoAction, SdUndoAction);
\************************************************************************/
ModifyPageUndoAction::ModifyPageUndoAction(
- SfxUndoManager* pTheManager, // #67720#
SdDrawDocument* pTheDoc,
SdPage* pThePage,
String aTheNewName,
AutoLayout eTheNewAutoLayout,
BOOL bTheNewBckgrndVisible,
BOOL bTheNewBckgrndObjsVisible)
-: SdUndoAction(pTheDoc),
- mpManager(pTheManager)
+: SdUndoAction(pTheDoc)
{
DBG_ASSERT(pThePage, "Undo ohne Seite ???");
diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx
index 363ff91edf36..ab4b9e6732f5 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -151,7 +151,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
// #96090#
if(SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_UNDO))
{
- SfxUndoManager* pUndoManager = ImpGetUndoManager();
+ ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
sal_Bool bActivate(FALSE);
if(pUndoManager)
@@ -179,7 +179,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
// #96090#
if(SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_REDO))
{
- SfxUndoManager* pUndoManager = ImpGetUndoManager();
+ ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
sal_Bool bActivate(FALSE);
if(pUndoManager)
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 7885d07e5f2c..7f142ded077e 100755
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -85,6 +85,7 @@
#include <svx/extrusionbar.hxx>
#include <svx/fontworkbar.hxx>
#include <svx/svdoutl.hxx>
+#include <tools/diagnose_ex.h>
// #96090#
#include <svl/slstitm.hxx>
@@ -1040,7 +1041,7 @@ void ViewShell::UpdatePreview (SdPage*, BOOL )
// usefull is still done.
}
-SfxUndoManager* ViewShell::ImpGetUndoManager (void) const
+::svl::IUndoManager* ViewShell::ImpGetUndoManager (void) const
{
const ViewShell* pMainViewShell = GetViewShellBase().GetMainViewShell().get();
@@ -1081,7 +1082,7 @@ SfxUndoManager* ViewShell::ImpGetUndoManager (void) const
void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const
{
- SfxUndoManager* pUndoManager = ImpGetUndoManager();
+ ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
if(pUndoManager)
{
sal_uInt16 nCount(pUndoManager->GetUndoActionCount());
@@ -1116,7 +1117,7 @@ void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const
void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
{
- SfxUndoManager* pUndoManager = ImpGetUndoManager();
+ ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
if(pUndoManager)
{
sal_uInt16 nCount(pUndoManager->GetRedoActionCount());
@@ -1151,7 +1152,7 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
void ViewShell::ImpSidUndo(BOOL, SfxRequest& rReq)
{
- SfxUndoManager* pUndoManager = ImpGetUndoManager();
+ ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
sal_uInt16 nNumber(1);
const SfxItemSet* pReqArgs = rReq.GetArgs();
@@ -1166,11 +1167,19 @@ void ViewShell::ImpSidUndo(BOOL, SfxRequest& rReq)
sal_uInt16 nCount(pUndoManager->GetUndoActionCount());
if(nCount >= nNumber)
{
- // #94637# when UndoStack is cleared by ModifyPageUndoAction
- // the nCount may have changed, so test GetUndoActionCount()
- while(nNumber-- && pUndoManager->GetUndoActionCount())
+ try
{
- pUndoManager->Undo();
+ // #94637# when UndoStack is cleared by ModifyPageUndoAction
+ // the nCount may have changed, so test GetUndoActionCount()
+ while(nNumber-- && pUndoManager->GetUndoActionCount())
+ {
+ pUndoManager->Undo();
+ }
+ }
+ catch( const Exception& e )
+ {
+ // no need to handle. By definition, the UndoManager handled this by clearing the
+ // Undo/Redo stacks
}
}
@@ -1192,7 +1201,7 @@ void ViewShell::ImpSidUndo(BOOL, SfxRequest& rReq)
void ViewShell::ImpSidRedo(BOOL, SfxRequest& rReq)
{
- SfxUndoManager* pUndoManager = ImpGetUndoManager();
+ ::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
sal_uInt16 nNumber(1);
const SfxItemSet* pReqArgs = rReq.GetArgs();
@@ -1207,11 +1216,19 @@ void ViewShell::ImpSidRedo(BOOL, SfxRequest& rReq)
sal_uInt16 nCount(pUndoManager->GetRedoActionCount());
if(nCount >= nNumber)
{
- // #94637# when UndoStack is cleared by ModifyPageRedoAction
- // the nCount may have changed, so test GetRedoActionCount()
- while(nNumber-- && pUndoManager->GetRedoActionCount())
+ try
+ {
+ // #94637# when UndoStack is cleared by ModifyPageRedoAction
+ // the nCount may have changed, so test GetRedoActionCount()
+ while(nNumber-- && pUndoManager->GetRedoActionCount())
+ {
+ pUndoManager->Redo();
+ }
+ }
+ catch( const Exception& e )
{
- pUndoManager->Redo();
+ // no need to handle. By definition, the UndoManager handled this by clearing the
+ // Undo/Redo stacks
}
}
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 3c3ebe85294e..fb4d1a51857e 100755
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -137,7 +137,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/control/bindings \
sfx2/source/control/ctrlitem \
sfx2/source/control/dispatch \
- sfx2/source/control/macrconf \
sfx2/source/control/macro \
sfx2/source/control/minfitem \
sfx2/source/control/msg \
@@ -215,6 +214,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/doc/plugin \
sfx2/source/doc/printhelper \
sfx2/source/doc/querytemplate \
+ sfx2/source/doc/docundomanager \
sfx2/source/doc/sfxbasemodel \
sfx2/source/doc/sfxmodelfactory \
sfx2/source/doc/syspath \
diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk
index 6ad8b0209c4e..85ce4143323c 100644
--- a/sfx2/Package_inc.mk
+++ b/sfx2/Package_inc.mk
@@ -81,7 +81,6 @@ $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/layout.hxx,sfx2/layout.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/linkmgr.hxx,sfx2/linkmgr.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/linksrc.hxx,sfx2/linksrc.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/lnkbase.hxx,sfx2/lnkbase.hxx))
-$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/macrconf.hxx,sfx2/macrconf.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/mailmodelapi.hxx,sfx2/mailmodelapi.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/mgetempl.hxx,sfx2/mgetempl.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/mieclip.hxx,sfx2/mieclip.hxx))
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 980eec04cfa6..964b684fdb21 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -31,6 +31,7 @@
#include "sfx2/dllapi.h"
#include "sal/types.h"
#include <tools/solar.h>
+#include <tools/errcode.hxx>
#include <svl/smplhint.hxx>
#include <svl/poolitem.hxx>
#include <vcl/image.hxx>
@@ -98,6 +99,8 @@ struct SfxStbCtrlFactory;
struct SfxTbxCtrlFactory;
class SimpleResMgr;
class ModalDialog;
+class SbxArray;
+class SbxValue;
namespace sfx2
{
@@ -218,17 +221,18 @@ public:
// members
SfxFilterMatcher& GetFilterMatcher();
- SfxMacroConfig* GetMacroConfig() const;
SfxProgress* GetProgress() const;
const String& GetLastSaveDirectory() const;
USHORT GetFreeIndex();
void ReleaseIndex(USHORT i);
- SfxEventConfiguration* GetEventConfig() const;
// Basic/Scripting
static sal_Bool IsXScriptURL( const String& rScriptURL );
static ::rtl::OUString ChooseScript();
static void MacroOrganizer( INT16 nTabId );
+ static ErrCode CallBasic( const String&, BasicManager*, SbxArray *pArgs, SbxValue *pRet );
+ static ErrCode CallAppBasic( const String& i_macroName, SbxArray* i_args = NULL, SbxValue* i_ret = NULL )
+ { return CallBasic( i_macroName, SfxApplication::GetOrCreate()->GetBasicManager(), i_args, i_ret ); }
BasicManager* GetBasicManager();
com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
GetDialogContainer();
@@ -237,9 +241,6 @@ public:
StarBASIC* GetBasic();
USHORT SaveBasicManager() const;
USHORT SaveBasicAndDialogContainer() const;
- void EnterBasicCall();
- FASTBOOL IsInBasicCall() const;
- void LeaveBasicCall();
void RegisterBasicConstants( const char *pPrefix,
const SfxConstant *pConsts,
USHORT nCount );
@@ -293,8 +294,6 @@ public:
SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
SAL_DLLPRIVATE void PropExec_Impl(SfxRequest &);
SAL_DLLPRIVATE void PropState_Impl(SfxItemSet &);
- SAL_DLLPRIVATE void MacroExec_Impl(SfxRequest &);
- SAL_DLLPRIVATE void MacroState_Impl(SfxItemSet &);
SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &);
SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
SAL_DLLPRIVATE void OfaExec_Impl(SfxRequest &);
@@ -303,7 +302,6 @@ public:
SAL_DLLPRIVATE void SetProgress_Impl(SfxProgress *);
SAL_DLLPRIVATE const String& GetLastDir_Impl() const;
SAL_DLLPRIVATE void SetLastDir_Impl( const String & );
- SAL_DLLPRIVATE void PlayMacro_Impl( SfxRequest &rReq, StarBASIC *pBas );
SAL_DLLPRIVATE void EnterAsynchronCall_Impl();
SAL_DLLPRIVATE FASTBOOL IsInAsynchronCall_Impl() const;
diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx
index 8d99d6efd9f4..4a1bacf089d1 100644
--- a/sfx2/inc/sfx2/dispatch.hxx
+++ b/sfx2/inc/sfx2/dispatch.hxx
@@ -211,9 +211,6 @@ public:
Window *pWin, const Point *pPosPixel,
const SfxPoolItem *pArg1, ... );
- void EnterAction( const String& rName );
- void LeaveAction();
-
BOOL IsAppDispatcher() const;
BOOL IsFlushed() const;
void Flush();
diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx
index 17080ec2d51e..5b41d3a32935 100644
--- a/sfx2/inc/sfx2/evntconf.hxx
+++ b/sfx2/inc/sfx2/evntconf.hxx
@@ -45,10 +45,6 @@
#define ITEMID_MACRO SID_ATTR_MACROITEM
#include <svl/macitem.hxx>
-class SfxMacroInfo;
-class SfxMacroInfoArr_Impl;
-class SfxEventConfigItem_Impl;
-class SfxEventInfoArr_Impl;
class SfxObjectShell;
class SvxMacroTableDtor;
diff --git a/sfx2/inc/sfx2/macrconf.hxx b/sfx2/inc/sfx2/macrconf.hxx
deleted file mode 100644
index 6b50ddf3497a..000000000000
--- a/sfx2/inc/sfx2/macrconf.hxx
+++ /dev/null
@@ -1,155 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SFX_MACROCONF_HXX
-#define _SFX_MACROCONF_HXX
-
-#include "sal/config.h"
-#include "sfx2/dllapi.h"
-#include "sal/types.h"
-#include <tools/errcode.hxx>
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx> // SvUShorts
-#include <sfx2/evntconf.hxx>
-
-class SfxMacroInfo;
-class SfxSlot;
-class SfxMacroInfoItem;
-class SfxObjectShell;
-class BasicManager;
-struct SfxMacroConfig_Impl;
-class SbMethod;
-class SbxValue;
-class SbxObject;
-class SbxArray;
-class SvStream;
-class SvxMacro;
-
-typedef SfxMacroInfo* SfxMacroInfoPtr;
-//#if 0 // _SOLAR__PRIVATE
-SV_DECL_PTRARR(SfxMacroInfoArr_Impl, SfxMacroInfoPtr, 5, 5)
-//#else
-//class SfxMacroInfoArr_Impl;
-//#endif
-
-class SFX2_DLLPUBLIC SfxMacroInfo
-{
-friend class SfxMacroConfig;
-friend class SfxEventConfiguration;
-friend SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo);
-friend SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo);
-
- String* pHelpText;
- sal_uInt16 nRefCnt;
- sal_Bool bAppBasic;
- String aLibName;
- String aModuleName;
- String aMethodName;
- sal_uInt16 nSlotId;
- SfxSlot* pSlot;
-
-public:
- SfxMacroInfo( const String& rURL );
- SfxMacroInfo( bool _bAppBasic = true );
- SfxMacroInfo( bool _bAppBasic, const String& rQualifiedName );
- SfxMacroInfo(SfxMacroInfo& rOther);
- SfxMacroInfo(bool _bAppBasic, const String& rLibName,
- const String& rModuleName, const String& rMethodName);
- ~SfxMacroInfo();
- sal_Bool operator==(const SfxMacroInfo& rOther) const;
- int Load (SvStream&);
- int Store (SvStream&);
- String GetMacroName() const;
- String GetQualifiedName() const;
- String GetFullQualifiedName() const;
- BasicManager* GetBasicManager() const;
- String GetBasicName() const;
- String GetHelpText() const;
- sal_Bool IsAppMacro() const
- { return bAppBasic; }
- const String& GetModuleName() const
- { return aModuleName; }
- const String& GetLibName() const
- { return aLibName; }
- const String& GetMethodName() const
- { return aMethodName; }
- sal_uInt16 GetSlotId() const
- { return nSlotId; }
- SfxSlot* GetSlot() const
- { return pSlot; }
-
- sal_Bool Compare( const SvxMacro& ) const;
- void SetHelpText( const String& rText );
- String GetURL() const;
-};
-
-//ASDBG obsolete >= 582
-//ASDBG class ::com::sun::star::uno::Reference< ::com::sun::star::script::XEngine > ;
-//ASDBG class ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ;
-
-class SFX2_DLLPUBLIC SfxMacroConfig
-{
-friend class SfxEventConfiguration;
-
- SAL_DLLPRIVATE static SfxMacroConfig* pMacroConfig;
-
- SfxMacroConfig_Impl* pImp;
- SvUShorts aIdArray;
-
-public:
- SfxMacroConfig();
- ~SfxMacroConfig();
-
- static SfxMacroConfig* GetOrCreate();
-
- static String RequestHelp( sal_uInt16 nId );
- static sal_Bool IsMacroSlot( sal_uInt16 nId );
- static sal_Bool IsBasic( SbxObject*, const String&, BasicManager* );
- static ErrCode Call( SbxObject*, const String&, BasicManager*,
- SbxArray *pArgs=NULL, SbxValue *pRet=NULL );
-//ASDBG obsolete >= 582
-//ASDBG static void CallStarScript( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XEngine > & rxEngine, const String & rCode,
-//ASDBG const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rSource, void *pArgs, void *pRet );
- static SbMethod* GetMethod_Impl( const String&, BasicManager* );
-
- sal_uInt16 GetSlotId(SfxMacroInfoPtr);
- void ReleaseSlotId(sal_uInt16 nId);
- void RegisterSlotId(sal_uInt16 nId);
- SfxMacroInfo* GetMacroInfo(sal_uInt16 nId) const;
- sal_Bool ExecuteMacro(sal_uInt16 nId, const String& rArgs ) const;
- sal_Bool ExecuteMacro( SfxObjectShell*, const SvxMacro*, const String& ) const;
- sal_Bool CheckMacro(sal_uInt16 nId) const;
- sal_Bool CheckMacro( SfxObjectShell*, const SvxMacro* ) const;
-
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE static void Release_Impl();
- SAL_DLLPRIVATE const SfxMacroInfo* GetMacroInfo_Impl( const SvxMacro *pMacro ) const;
- DECL_DLLPRIVATE_LINK( CallbackHdl_Impl, SfxMacroConfig*);
- DECL_DLLPRIVATE_LINK( EventHdl_Impl, SfxMacroInfo*);
-//#endif
-};
-
-#endif
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 3e696369c7a3..e8afa44ae91f 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -73,7 +73,6 @@ class BasicManager;
class SfxMedium;
class SfxObjectFactory;
class SfxDocumentInfoDialog;
-class SfxEventConfigItem_Impl;
class SfxStyleSheetBasePool;
class INote;
class SfxStyleSheetPool;
@@ -190,12 +189,6 @@ in fremde Objekte integriert werden k"onnen.
----------------------------------------------------------------------*/
-enum SfxTitleQuery
-{
- SFX_TITLE_QUERY_SAVE_NAME_PROPOSAL
-};
-
-
class SfxToolBoxConfig;
struct TransferableObjectDescriptor;
@@ -363,36 +356,11 @@ public:
sal_uInt16 GetScriptingSignatureState();
void SignScriptingContent();
- virtual String QueryTitle( SfxTitleQuery ) const;
virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog(
Window *pParent, const SfxItemSet& );
- sal_Bool IsBasic( const String & rCode, SbxObject * pVCtrl = NULL );
ErrCode CallBasic( const String& rMacro, const String& rBasicName,
- SbxObject* pVCtrl, SbxArray* pArgs = 0, SbxValue* pRet = 0 );
- ErrCode Call( const String & rCode, sal_Bool bIsBasicReturn, SbxObject * pVCtrl = NULL );
-
- ErrCode CallScript(
- const String & rScriptType, const String & rCode, const void* pArgs = NULL, void* pRet = NULL );
-
- /** calls a StarBasic script without magic
- @param _rMacroName
- specifies the name of the method to execute
- @param _rLocation
- specifies the location of the script to execute. Allowed values are "application" and "document".
- @param _pArguments
- This is a pointer to a Sequence< Any >. All elements of the Sequence are wrapped into Basic objects
- and passed as arguments to the method specified by <arg>_rMacroName</arg>
- @param _pReturn
- If not <NULL/>, the Any pointed to by this argument contains the return value of the (synchronous) call
- to the StarBasic macro
- */
- ErrCode CallStarBasicScript(
- const String& _rMacroName,
- const String& _rLocation,
- const void* _pArguments = NULL,
- void* _pReturn = NULL
- );
+ SbxArray* pArgs = 0, SbxValue* pRet = 0 );
ErrCode CallXScript(
const String& rScriptURL,
@@ -787,7 +755,6 @@ public:
SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl();
// configuration items
- SAL_DLLPRIVATE SfxEventConfigItem_Impl* GetEventConfig_Impl( sal_Bool bForce=sal_False );
SAL_DLLPRIVATE SfxToolBoxConfig* GetToolBoxConfig_Impl();
SAL_DLLPRIVATE sal_uInt16 ImplGetSignatureState( sal_Bool bScriptingContent = FALSE );
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index 44c00cc93018..dfc2dec2f5ff 100644..100755
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -222,7 +222,6 @@
#define RID_BUILDVERSION (RID_SFX_START+5)
#define RID_DOCALREADYLOADED_DLG (RID_SFX_START+1)
-#define RID_CANTLOADDOC_DLG (RID_SFX_START+2)
#define TP_DOCINFODESC (RID_SFX_START+3)
#define TP_DOCINFODOC (RID_SFX_START+4)
@@ -313,16 +312,8 @@
// ------------------------------------------------------------------------
-#define BMP_COLS 21
-#define BMP_SFX_SMALL 1
-#define BMP_SFX_LARGE 2
-
#define RID_SFX_GLOBALS 1000
-#define BMP_SFX_COLOR (RID_SFX_GLOBALS + 1)
-#define BMP_SFX_MONO (RID_SFX_GLOBALS + 2)
-#define SFX_MSG_RES (RID_SFX_GLOBALS + 3)
-
// =========================================================================
#define RID_OPTIONS_START (SID_LIB_START + 2000)
@@ -330,24 +321,6 @@
// ResId's ------------------------------------------------------------------
-#define RID_SFXLANG_BEGIN (RID_OPTIONS_START + 0)
-#define RID_SFXLANG_NO (RID_SFXLANG_BEGIN + 0)
-#define RID_SFXLANG_GERMAN (RID_SFXLANG_BEGIN + 1)
-#define RID_SFXLANG_SWISS_GERMAN (RID_SFXLANG_BEGIN + 2)
-#define RID_SFXLANG_US_ENGLISH (RID_SFXLANG_BEGIN + 3)
-#define RID_SFXLANG_UK_ENGLISH (RID_SFXLANG_BEGIN + 4)
-#define RID_SFXLANG_FRENCH (RID_SFXLANG_BEGIN + 5)
-#define RID_SFXLANG_ITALIAN (RID_SFXLANG_BEGIN + 6)
-#define RID_SFXLANG_CAST_SPANISH (RID_SFXLANG_BEGIN + 7)
-#define RID_SFXLANG_PORTUGUESE (RID_SFXLANG_BEGIN + 8)
-#define RID_SFXLANG_DANISH (RID_SFXLANG_BEGIN + 9)
-#define RID_SFXLANG_DUTCH (RID_SFXLANG_BEGIN + 10)
-#define RID_SFXLANG_SWEDISH (RID_SFXLANG_BEGIN + 11)
-#define RID_SFXLANG_FINNISH (RID_SFXLANG_BEGIN + 12)
-#define RID_SFXLANG_NORWEG_BOKMAL (RID_SFXLANG_BEGIN + 13)
-#define RID_SFXLANG_NORWEG_NYNORSK (RID_SFXLANG_BEGIN + 14)
-#define RID_SFXLANG_ALL (RID_SFXLANG_BEGIN + 15)
-
#define RID_SFXPAGE_SAVE (RID_OPTIONS_START + 0)
#define RID_SFXPAGE_GENERAL (RID_OPTIONS_START + 1)
#define RID_SFXPAGE_SPELL (RID_OPTIONS_START + 2)
@@ -356,10 +329,7 @@
#define RID_SFXQB_DELDICT (RID_OPTIONS_START + 5)
#define RID_SFXPAGE_PATH (RID_OPTIONS_START + 6)
#define RID_SFXPAGE_LINGU (RID_OPTIONS_START + 7)
-#define RID_SFXPAGE_INET (RID_OPTIONS_START + 8)
-#define RID_SFXQB_DEL_IGNORELIST (RID_OPTIONS_START + 9)
#define RID_SFXQB_SET_LANGUAGE (RID_OPTIONS_START + 10)
-#define RID_ITEMLIST_LINGU (RID_OPTIONS_START + 11)
#define RID_SFXPAGE_PRINTOPTIONS (RID_OPTIONS_START + 12)
#define RID_STR_NEW_TASK (RID_SFX_DOC_START+ 76)
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index d0978ebc1e5f..017486d251de 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -44,6 +44,7 @@
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentRecovery.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
@@ -97,9 +98,9 @@
#include <com/sun/star/task/XInteractionHandler.hpp>
//________________________________________________________________________________________________________
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_31)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_31
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 31
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_32
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 32
#include <comphelper/implbase_var.hxx>
#endif
@@ -238,11 +239,12 @@ namespace sfx { namespace intern {
SfxListener
*/
-typedef ::comphelper::WeakImplHelper31 < XCHILD
+typedef ::comphelper::WeakImplHelper32 < XCHILD
, XDOCUMENTINFOSUPPLIER
, ::com::sun::star::document::XDocumentPropertiesSupplier
, ::com::sun::star::rdf::XDocumentMetadataAccess
, ::com::sun::star::document::XDocumentRecovery
+ , ::com::sun::star::document::XUndoManagerSupplier
, XEVENTBROADCASTER
, XDOCUMENTEVENTBROADCASTER
, XEVENTLISTENER
@@ -1320,6 +1322,9 @@ public:
::com::sun::star::io::IOException,
::com::sun::star::lang::WrappedTargetException );
+ // css.document.XUndoManagerSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ) throw (::com::sun::star::uno::RuntimeException);
+
//____________________________________________________________________________________________________
// ::com::sun::star::rdf::XNode:
@@ -1484,22 +1489,11 @@ public:
SfxObjectShell* GetObjectShell() const ;
SAL_DLLPRIVATE SfxObjectShell* impl_getObjectShell() const ;
- /**___________________________________________________________________________________________________
- @short -
- @descr -
-
- @seealso -
-
- @param -
-
- @return -
-
- @onerror -
- */
-
SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ;
sal_Bool IsInitialized() const;
+ sal_Bool IsDisposed() const { return impl_isDisposed(); }
void MethodEntryCheck( const bool i_mustBeInitialized ) const;
+ ::osl::Mutex& getMutex() const { return m_aMutex; }
::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL setViewData( const ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess >& aData ) throw (::com::sun::star::uno::RuntimeException);
@@ -1575,6 +1569,44 @@ private:
} ; // class SfxBaseModel
+/** base class for sub components of an SfxBaseModel, which share their ref count and lifetime with the SfxBaseModel
+*/
+class SFX2_DLLPUBLIC SfxModelSubComponent
+{
+public:
+ /** checks whether the instance is alive, i.e. properly initialized, and not yet disposed
+ */
+ void MethodEntryCheck()
+ {
+ m_rModel.MethodEntryCheck( true );
+ }
+
+ // called when the SfxBaseModel which the component is superordinate of is being disposed
+ virtual void disposing();
+
+protected:
+ SfxModelSubComponent( SfxBaseModel& i_model )
+ :m_rModel( i_model )
+ {
+ }
+ virtual ~SfxModelSubComponent();
+
+ // helpers for implementing XInterface - delegates ref counting to the SfxBaseModel
+ void acquire() { m_rModel.acquire(); }
+ void release() { m_rModel.release(); }
+
+ bool isDisposed() const { return m_rModel.IsDisposed(); }
+
+protected:
+ const SfxBaseModel& getBaseModel() const { return m_rModel; }
+ SfxBaseModel& getBaseModel() { return m_rModel; }
+
+ ::osl::Mutex& getMutex() { return m_rModel.getMutex(); }
+
+private:
+ SfxBaseModel& m_rModel;
+};
+
class SFX2_DLLPUBLIC SfxModelGuard
{
public:
@@ -1591,17 +1623,27 @@ public:
{
i_rModel.MethodEntryCheck( i_eState != E_INITIALIZING );
}
+ SfxModelGuard( SfxModelSubComponent& i_rSubComponent )
+ :m_aGuard( Application::GetSolarMutex() )
+ {
+ i_rSubComponent.MethodEntryCheck();
+ }
~SfxModelGuard()
{
}
+ void reset()
+ {
+ m_aGuard.reset();
+ }
+
void clear()
{
m_aGuard.clear();
}
private:
- ::vos::OClearableGuard m_aGuard;
+ ::osl::ResettableGuard< ::vos::IMutex > m_aGuard;
};
#undef css
diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h
index bdf27baac7b3..035f2f187bb8 100644..100755
--- a/sfx2/inc/sfx2/sfxcommands.h
+++ b/sfx2/inc/sfx2/sfxcommands.h
@@ -1,345 +1,342 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SFX2_SFXCOMMANDS_HRC
-#define SFX2_SFXCOMMANDS_HRC
-
-#define CMD_SID_VIEWSHELL0 ".uno:_SwitchViewShell0"
-#define CMD_SID_VIEWSHELL1 ".uno:_SwitchViewShell1"
-#define CMD_SID_VIEWSHELL2 ".uno:_SwitchViewShell2"
-#define CMD_SID_VIEWSHELL3 ".uno:_SwitchViewShell3"
-#define CMD_SID_VIEWSHELL4 ".uno:_SwitchViewShell4"
-#define CMD_SID_ABOUT ".uno:About"
-#define CMD_SID_ACTIVATE ".uno:Activate"
-#define CMD_SID_HELPBALLOONS ".uno:ActiveHelp"
-#define CMD_SID_STYLE_FAMILY ".uno:ActualStyleFamily"
-#define CMD_SID_NEWDOC ".uno:NewDoc"
-#define CMD_SID_CREATELINK ".uno:AddBookmark"
-#define CMD_SID_NEWDOCDIRECT ".uno:AddDirect"
-#define CMD_SID_TEMPLATE_ADDRESSBOKSOURCE ".uno:AddressBookSource"
-#define CMD_SID_BASICIDE_ADDWATCH ".uno:AddWatch"
-#define CMD_SID_DOCINFO_AUTHOR ".uno:Author"
-#define CMD_SID_AUTOHIDE ".uno:AutoHide"
-#define CMD_SID_AUTOPILOTMENU ".uno:AutoPilotMenu"
-#define CMD_SID_GALLERY_BG_BRUSH ".uno:BackgroundImage"
-#define CMD_SID_BACKSPACE ".uno:Backspace"
-#define CMD_SID_BASICBREAK ".uno:BasicBreak"
-#define CMD_SID_BASICIDE_APPEAR ".uno:BasicIDEAppear"
-#define CMD_SID_BASICSTEPINTO ".uno:BasicStepInto"
-#define CMD_SID_BASICSTEPOUT ".uno:BasicStepOut"
-#define CMD_SID_BASICSTEPOVER ".uno:BasicStepOver"
-#define CMD_SID_BASICSTOP ".uno:BasicStop"
-#define CMD_SID_BROWSER ".uno:Beamer"
-#define CMD_SID_BASICIDE_BRKPNTSCHANGED ".uno:BreakPointsChanged"
-#define CMD_SID_BROWSE_BACKWARD ".uno:BrowseBackward"
-#define CMD_SID_BROWSE_FORWARD ".uno:BrowseForward"
-#define CMD_SID_BROWSER_MODE ".uno:BrowseView"
-#define CMD_SID_BUILD_VERSION ".uno:BuildVersion"
-#define CMD_SID_CAPTION ".uno:Caption"
-#define CMD_SID_STYLE_FAMILY1 ".uno:CharStyle"
-#define CMD_SID_CHECK_KEY ".uno:CheckKey"
-#define CMD_SID_BASICIDE_CHOOSEMACRO ".uno:ChooseMacro"
-#define CMD_SID_CLEARHISTORY ".uno:ClearHistory"
-#define CMD_SID_CLOSEWINS ".uno:CloseWins"
-#define CMD_SID_CLOSEDOCS ".uno:CloseDocs"
-#define CMD_SID_CLOSEDOC ".uno:CloseDoc"
-#define CMD_SID_CLOSEWIN ".uno:CloseWin"
-#define CMD_SID_CLOSING ".uno:Closing"
-#define CMD_SID_DOCINFO_COMMENTS ".uno:Comments"
-#define CMD_SID_OFFICE_COMMERCIAL_USE ".uno:CommercialUse"
-#define CMD_SID_DOCUMENT_COMPARE ".uno:CompareDocuments"
-#define CMD_SID_BASICCOMPILE ".uno:CompileBasic"
-#define CMD_SID_CONFIG ".uno:ConfigureDialog"
-#define CMD_SID_CONTEXT ".uno:Context"
-#define CMD_SID_COPY ".uno:Copy"
-#define CMD_SID_CRASH ".uno:Crash"
-#define CMD_SID_BASICIDE_CREATEMACRO ".uno:CreateMacro"
-#define CMD_SID_CURRENT_URL ".uno:CurrentURL"
-#define CMD_SID_CURSORENDOFSCREEN ".uno:CursorEndOfScreen"
-#define CMD_SID_CURSORTOPOFSCREEN ".uno:CursorTopOfScreen"
-#define CMD_SID_OFFICE_CUSTOMERNUMBER ".uno:CustomerNumber"
-#define CMD_SID_CUT ".uno:Cut"
-#define CMD_SID_DEFAULTFILEPATH ".uno:DefaultFilePath"
-#define CMD_SID_DEFAULTFILENAME ".uno:DefaultFileName"
-#define CMD_SID_DELETE ".uno:Delete"
-#define CMD_SID_BASICIDE_DELETECURRENT ".uno:DeleteCurrent"
-#define CMD_SID_STYLE_DELETE ".uno:DeleteStyle"
-#define CMD_SID_STYLE_DESIGNER ".uno:DesignerDialog"
-#define CMD_SID_STYLE_DRAGHIERARCHIE ".uno:DragHierarchy"
-#define CMD_SID_EDITDOC ".uno:EditDoc"
-#define CMD_SID_BASICIDE_EDITMACRO ".uno:EditMacro"
-#define CMD_SID_STYLE_EDIT ".uno:EditStyle"
-#define CMD_FID_SEARCH_NOW ".uno:ExecuteSearch"
-#define CMD_SID_EXTENDEDHELP ".uno:ExtendedHelp"
-#define CMD_SID_FILE_NAME ".uno:FileName"
-#define CMD_SID_FOCUSURLBOX ".uno:FocusUrlBox"
-#define CMD_SID_FORMATMENU ".uno:FormatMenu"
-#define CMD_SID_STYLE_FAMILY3 ".uno:FrameStyle"
-#define CMD_SID_FRAMETITLE ".uno:FrameTitle"
-#define CMD_SID_PROGFILENAME ".uno:FullName"
-#define CMD_SID_DOCFULLNAME ".uno:FullName"
-#define CMD_SID_WIN_FULLSCREEN ".uno:FullScreen"
-#define CMD_SID_FILLFRAME ".uno:GetFrameWindow"
-#define CMD_SID_CURSORDOWN ".uno:GoDown"
-#define CMD_SID_CURSORPAGEDOWN ".uno:GoDownBlock"
-#define CMD_SID_CURSORPAGEDOWN_SEL ".uno:GoDownBlockSel"
-#define CMD_SID_CURSORDOWN_SEL ".uno:GoDownSel"
-#define CMD_SID_CURSORLEFT ".uno:GoLeft"
-#define CMD_SID_CURSORPAGELEFT ".uno:GoLeftBlock"
-#define CMD_SID_CURSORPAGELEFT_SEL ".uno:GoLeftBlockSel"
-#define CMD_SID_CURSORLEFT_SEL ".uno:GoLeftSel"
-#define CMD_SID_CURSORRIGHT ".uno:GoRight"
-#define CMD_SID_CURSORRIGHT_SEL ".uno:GoRightSel"
-#define CMD_SID_CURSORENDOFFILE ".uno:GoToEndOfData"
-#define CMD_SID_CURSORENDOFFILE_SEL ".uno:GoToEndOfDataSel"
-#define CMD_SID_CURSOREND ".uno:GoToEndOfRow"
-#define CMD_SID_CURSOREND_SEL ".uno:GoToEndOfRowSel"
-#define CMD_SID_CURSORTOPOFFILE ".uno:GoToStart"
-#define CMD_SID_CURSORHOME ".uno:GoToStartOfRow"
-#define CMD_SID_CURSORHOME_SEL ".uno:GoToStartOfRowSel"
-#define CMD_SID_CURSORTOPOFFILE_SEL ".uno:GoToStartSel"
-#define CMD_SID_CURSORUP ".uno:GoUp"
-#define CMD_SID_CURSORPAGEUP ".uno:GoUpBlock"
-#define CMD_SID_CURSORPAGEUP_SEL ".uno:GoUpBlockSel"
-#define CMD_SID_CURSORUP_SEL ".uno:GoUpSel"
-#define CMD_SID_HELP_ANNOTATE ".uno:HelpAnnotate"
-#define CMD_SID_HELP_BOOKMARK ".uno:HelpBookmark"
-#define CMD_SID_HELP_HELPFILEBOX ".uno:HelpChooseFile"
-#define CMD_SID_HELP_DOWNLOAD ".uno:HelpDownload"
-#define CMD_SID_HELP_PI ".uno:HelperDialog"
-#define CMD_SID_HELPINDEX ".uno:HelpIndex"
-#define CMD_SID_HELPMENU ".uno:HelpMenu"
-#define CMD_SID_HELPONHELP ".uno:HelpOnHelp"
-#define CMD_SID_HELP_SEARCH ".uno:HelpSearch"
-#define CMD_SID_HELPTIPS ".uno:HelpTip"
-#define CMD_SID_HELP_ZOOMIN ".uno:HelpZoomIn"
-#define CMD_SID_HELP_ZOOMOUT ".uno:HelpZoomOut"
-#define CMD_SID_BASICIDE_HIDECURPAGE ".uno:HideCurPage"
-#define CMD_SID_HYPERLINK_DIALOG ".uno:HyperlinkDialog"
-#define CMD_SID_INSERTDOC ".uno:InsertDoc"
-#define CMD_SID_HYPERLINK_INSERT ".uno:InsertHyperlink"
-#define CMD_SID_INSERT_FLOATINGFRAME ".uno:InsertObjectFloatingFrame"
-#define CMD_SID_INTERNET_ONLINE ".uno:InternetOnline"
-#define CMD_SID_INTERNET_SEARCH ".uno:InternetSearch"
-#define CMD_SID_DOC_LOADING ".uno:IsLoading"
-#define CMD_SID_IMG_LOADING ".uno:IsLoadingImages"
-#define CMD_SID_PRINTOUT ".uno:IsPrinting"
-#define CMD_SID_JUMPTOMARK ".uno:JumpToMark"
-#define CMD_SID_DOCINFO_KEYWORDS ".uno:Keywords"
-#define CMD_SID_BASICIDE_LIBLOADED ".uno:LibLoaded"
-#define CMD_SID_BASICIDE_LIBREMOVED ".uno:LibRemoved"
-#define CMD_SID_BASICIDE_LIBSELECTED ".uno:LibSelect"
-#define CMD_SID_BASICIDE_LIBSELECTOR ".uno:LibSelector"
-#define CMD_SID_OFFICE_PLK ".uno:LicenceKey"
-#define CMD_SID_CONFIGACCEL ".uno:LoadAccel"
-#define CMD_SID_BASICLOAD ".uno:LoadBasic"
-#define CMD_SID_LOADCONFIG ".uno:LoadConfiguration"
-#define CMD_SID_CONFIGEVENT ".uno:LoadEvents"
-#define CMD_SID_CONFIGMENU ".uno:LoadMenu"
-#define CMD_SID_CONFIGSTATUSBAR ".uno:LoadStatusBar"
-#define CMD_SID_TOOLBOXOPTIONS ".uno:LoadToolBox"
-#define CMD_SID_LOGOUT ".uno:Logout"
-#define CMD_SID_SCRIPTORGANIZER ".uno:ScriptOrganizer"
-#define CMD_SID_MACROORGANIZER ".uno:MacroOrganizer"
-#define CMD_SID_RUNMACRO ".uno:RunMacro"
-#define CMD_SID_BASICCHOOSER ".uno:MacroDialog"
-#define CMD_SID_MAIL_NOTIFY ".uno:MailReceipt"
-#define CMD_SID_MAIL_CHILDWIN ".uno:MailWindow"
-#define CMD_SID_BASICIDE_MATCHGROUP ".uno:MatchGroup"
-#define CMD_SID_TOGGLE_MENUBAR ".uno:MenuBarVisible"
-#define CMD_SID_DOCUMENT_MERGE ".uno:MergeDocuments"
-#define CMD_SID_ATTR_METRIC ".uno:MetricUnit"
-#define CMD_SID_MODIFIED ".uno:Modified"
-#define CMD_SID_DOC_MODIFIED ".uno:ModifiedStatus"
-#define CMD_SID_BASICIDE_MODULEDLG ".uno:ModuleDialog"
-#define CMD_SID_BASICIDE_NAMECHANGEDONTAB ".uno:NameChangedOnTab"
-#define CMD_SID_NAVIGATOR ".uno:Navigator"
-#define CMD_SID_RESTORE_EDITING_VIEW ".uno:RestoreEditingView"
-#define CMD_SID_BASICIDE_NEWDIALOG ".uno:NewDialog"
-#define CMD_SID_BASICIDE_NEWMODULE ".uno:NewModule"
-#define CMD_SID_CREATE_BASICOBJECT ".uno:NewObject"
-#define CMD_SID_STYLE_NEW ".uno:NewStyle"
-#define CMD_SID_NEWWINDOW ".uno:NewWindow"
-#define CMD_SID_BASICIDE_OBJCAT ".uno:ObjectCatalog"
-#define CMD_SID_OBJECT ".uno:ObjectMenue"
-#define CMD_SID_OLD_PALK ".uno:OldPALK"
-#define CMD_SID_OPENDOC ".uno:Open"
-#define CMD_SID_WEBHTML ".uno:WebHtml"
-#define CMD_SID_OPENHYPERLINK ".uno:OpenHyperlink"
-#define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle"
-#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate"
-#define CMD_SID_OPENURL ".uno:OpenUrl"
-#define CMD_SID_OPTIONS ".uno:Options"
-#define CMD_SID_ORGANIZER ".uno:Organizer"
-#define CMD_SID_STYLE_FAMILY4 ".uno:PageStyle"
-#define CMD_SID_STYLE_FAMILY2 ".uno:ParaStyle"
-#define CMD_SID_PARTWIN ".uno:PartWindow"
-#define CMD_SID_PASTE ".uno:Paste"
-#define CMD_SID_CLIPBOARD_FORMAT_ITEMS ".uno:ClipboardFormatItems"
-#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial"
-#define CMD_SID_DOCPATH ".uno:DocPath"
-#define CMD_SID_PICKLIST ".uno:PickList"
-#define CMD_SID_PLAYMACRO ".uno:PlayMacro"
-#define CMD_SID_PLUGINS_ACTIVE ".uno:PlugInsActive"
-#define CMD_SID_PRINTDOC ".uno:Print"
-#define CMD_SID_PRINTDOCDIRECT ".uno:PrintDefault"
-#define CMD_SID_PRINTER_NAME ".uno:Printer"
-#define CMD_SID_SETUPPRINTER ".uno:PrinterSetup"
-#define CMD_SID_PRINTPREVIEW ".uno:PrintPreview"
-#define CMD_SID_OFFICE_PRIVATE_USE ".uno:PrivateUse"
-#define CMD_SID_DOCINFO ".uno:SetDocumentProperties"
-#define CMD_SID_QUITAPP ".uno:Quit"
-#define CMD_SID_DOC_READONLY ".uno:ReadOnly"
-#define CMD_SID_RECORDMACRO ".uno:MacroRecorder"
-#define CMD_SID_STOP_RECORDING ".uno:StopRecording"
-#define CMD_SID_RECORDING_FLOATWINDOW ".uno:MacroRecordingFloat"
-#define CMD_SID_REDO ".uno:Redo"
-#define CMD_SID_DELETE_BASICOBJECT ".uno:ReleaseObject"
-#define CMD_SID_RELOAD ".uno:Reload"
-#define CMD_SID_BASICIDE_REMOVEWATCH ".uno:RemoveWatch"
-#define CMD_SID_BASICIDE_RENAMECURRENT ".uno:RenameCurrent"
-#define CMD_SID_REPAINT ".uno:Repaint"
-#define CMD_SID_REPEAT ".uno:RepeatAction"
-#define CMD_SID_RUBY_DIALOG ".uno:RubyDialog"
-#define CMD_SID_BASICRUN ".uno:RunBasic"
-#define CMD_SID_STARTSW ".uno:RunStarWriter"
-#define CMD_SID_SAVEDOC ".uno:Save"
-#define CMD_SID_SAVEDOCS ".uno:SaveAll"
-#define CMD_SID_SAVEASDOC ".uno:SaveAs"
-#define CMD_SID_DOCTEMPLATE ".uno:SaveAsTemplate"
-#define CMD_SID_BASICSAVEAS ".uno:SaveBasicAs"
-#define CMD_SID_EXPORT_DIALOG ".uno:ExportDialog"
-#define CMD_SID_IMPORT_DIALOG ".uno:ImportDialog"
-#define CMD_SID_SAVECONFIG ".uno:SaveConfiguration"
-#define CMD_SID_DOC_SAVED ".uno:Saved"
-#define CMD_SID_BASICIDE_SBXDELETED ".uno:SbxDeleted"
-#define CMD_SID_BASICIDE_SBXINSERTED ".uno:SbxInserted"
-#define CMD_SID_BASICIDE_SBXRENAMED ".uno:SbxRenamed"
-#define CMD_SID_MAIL_SCROLLBODY_PAGEDOWN ".uno:ScrollBodyPageDown"
-#define CMD_SID_SEARCH_DLG ".uno:SearchDialog"
-#define CMD_SID_SEARCH_OPTIONS ".uno:SearchOptions"
-#define CMD_SID_SEARCH_ITEM ".uno:SearchProperties"
-#define CMD_SID_SELECTALL ".uno:SelectAll"
-#define CMD_FN_FAX ".uno:SendFax"
-#define CMD_SID_MAIL_SENDDOC ".uno:SendMail"
-#define CMD_SID_MAIL_SENDDOCASPDF ".uno:SendMailDocAsPDF"
-#define CMD_SID_MAIL_SENDDOCASFORMAT ".uno:SendMailDocAsFormat"
-#define CMD_SID_MAIL_SENDDOCASMS ".uno:SendMailDocAsMS"
-#define CMD_SID_MAIL_SENDDOCASOOO ".uno:SendMailDocAsOOo"
-#define CMD_SID_SETOPTIONS ".uno:SetOptions"
-#define CMD_SID_OFFICE_PALK ".uno:SetPALK"
-#define CMD_SID_SHOW_BROWSER ".uno:ShowBrowser"
-#define CMD_SID_SHOWPOPUPS ".uno:ShowPopups"
-#define CMD_SID_BASICIDE_SHOWSBX ".uno:ShowSbx"
-#define CMD_SID_SOURCEVIEW ".uno:SourceView"
-#define CMD_SID_ONLINE_REGISTRATION_DLG ".uno:StartRegistrationDialog"
-#define CMD_SID_STATUSBARTEXT ".uno:StatusBar"
-#define CMD_SID_TOGGLESTATUSBAR ".uno:StatusBarVisible"
-#define CMD_SID_BASICIDE_STAT_DATE ".uno:StatusGetDate"
-#define CMD_SID_BASICIDE_STAT_POS ".uno:StatusGetPosition"
-#define CMD_SID_BASICIDE_STAT_TITLE ".uno:StatusGetTitle"
-#define CMD_SID_BASICIDE_STOREALLMODULESOURCES ".uno:StoreAllModuleSources"
-#define CMD_SID_BASICIDE_STOREMODULESOURCE ".uno:StoreModuleSource"
-#define CMD_SID_STYLE_APPLY ".uno:StyleApplyState"
-#define CMD_SID_STYLE_CATALOG ".uno:StyleCatalog"
-#define CMD_SID_STYLE_NEW_BY_EXAMPLE ".uno:StyleNewByExample"
-#define CMD_SID_STYLE_UPDATE_BY_EXAMPLE ".uno:StyleUpdateByExample"
-#define CMD_SID_STYLE_WATERCAN ".uno:StyleWatercanMode"
-#define CMD_SID_VIEWSHELL ".uno:SwitchViewShell"
-#define CMD_SID_TASKBAR ".uno:TaskBarVisible"
-#define CMD_SID_STYLE_FAMILY5 ".uno:ListStyle"
-#define CMD_SID_TIPWINDOW ".uno:TipsDialog"
-#define CMD_SID_DOCTITLE ".uno:Title"
-#define CMD_SID_TITLE ".uno:Title"
-#define CMD_SID_BASICIDE_TOGGLEBRKPNT ".uno:ToggleBreakPoint"
-#define CMD_SID_BASICIDE_SHOWWINDOW ".uno:BasicIDEShowWindow"
-#define CMD_SID_EDITMACRO ".uno:ToolsMacroEdit"
-#define CMD_SID_UNDO ".uno:Undo"
-#define CMD_SID_FORMATPAINTBRUSH ".uno:FormatPaintbrush"
-#define CMD_SID_ATTR_UNDO_COUNT ".uno:UndoCount"
-#define CMD_SID_BASICIDE_UPDATEALLMODULESOURCES ".uno:UpdateAllModuleSources"
-#define CMD_SID_BASICIDE_UPDATEMODULESOURCE ".uno:UpdateModuleSource"
-#define CMD_SID_BASICIDE_MANAGEBRKPNTS ".uno:ManageBreakPoints"
-#define CMD_SID_BASICIDE_TOGGLEBRKPNTENABLED ".uno:ToggleBreakPointEnabled"
-#define CMD_SID_UPDATE_VERSION ".uno:UpdateVersion"
-#define CMD_SID_VERSION ".uno:VersionDialog"
-#define CMD_SID_SIGNATURE ".uno:Signature"
-#define CMD_SID_MACRO_SIGNATURE ".uno:MacroSignature"
-#define CMD_SID_VERSION_VISIBLE ".uno:VersionVisible"
-#define CMD_SID_VIEW_DATA_SOURCE_BROWSER ".uno:ViewDataSourceBrowser"
-#define CMD_SID_WIN_VISIBLE ".uno:WinVisible"
-#define CMD_SID_MDIWINDOWLIST ".uno:WindowList"
-#define CMD_SID_ZOOM_IN ".uno:ZoomMinus"
-#define CMD_SID_ZOOM ".uno:Zooming"
-#define CMD_SID_ZOOM_NEXT ".uno:ZoomNext"
-#define CMD_SID_ZOOM_OUT ".uno:ZoomPlus"
-#define CMD_SID_ZOOM_PREV ".uno:ZoomPrevious"
-#define CMD_SID_ZOOM_TOOLBOX ".uno:ZoomToolBox"
-#define CMD_SID_EXPORTDOC ".uno:ExportTo"
-#define CMD_SID_EXPORTDOCASPDF ".uno:ExportToPDF"
-#define CMD_SID_DIRECTEXPORTDOCASPDF ".uno:ExportDirectToPDF"
-#define CMD_SID_IMAGE_ORIENTATION ".uno:ImageOrientation"
-#define CMD_SID_SAVE_VERSION_ON_CLOSE ".uno:SaveVersionOnClose"
-#define CMD_SID_ADDONS ".uno:Addons"
-#define CMD_SID_SHOW_IME_STATUS_WINDOW ".uno:ShowImeStatusWindow"
-#define CMD_SID_UPDATE_CONFIG ".uno:UpdateConfiguration"
-#define CMD_SID_HELP_SUPPORTPAGE ".uno:HelpSupport"
-#define CMD_SID_HELP_TUTORIALS ".uno:HelpTutorials"
-#define CMD_SID_ADDONHELP ".uno:AddonHelp"
-#define CMD_SID_FORMATMENUSTATE ".uno:FormatMenuState"
-#define CMD_SID_INET_DLG ".uno:InternetDialog"
-#define CMD_SID_ONLINE_REGISTRATION ".uno:OnlineRegistrationDlg"
-#define CMD_SID_OFFICE_CHECK_PLZ ".uno:CheckPLZ"
-#define CMD_SID_ADDRESS_DATA_SOURCE ".uno:AutoPilotAddressDataSource"
-#define CMD_FN_BUSINESS_CARD ".uno:InsertBusinessCard"
-#define CMD_FN_LABEL ".uno:InsertLabels"
-#define CMD_FN_XFORMS_INIT ".uno:NewXForms"
-#define CMD_SID_SD_AUTOPILOT ".uno:AutoPilotPresentations"
-#define CMD_SID_NEWSD ".uno:NewPresentation"
-#define CMD_SID_COMP_BIBLIOGRAPHY ".uno:BibliographyComponent"
-#define CMD_SID_MINIMIZED ".uno:Minimized"
-#define CMD_SID_AUTO_CORRECT_DLG ".uno:AutoCorrectDlg"
-#define CMD_SID_OPTIONS_TREEDIALOG ".uno:OptionsTreeDialog"
-#define CMD_SID_TERMINATE_INPLACEACTIVATION ".uno:TerminateInplaceActivation"
-#define CMD_SID_RECENTFILELIST ".uno:RecentFileList"
-#define CMD_SID_AVAILABLE_TOOLBARS ".uno:AvailableToolbars"
-#define CMD_SID_AVMEDIA_PLAYER ".uno:AVMediaPlayer"
-#define CMD_SID_INSERT_AVMEDIA ".uno:InsertAVMedia"
-#define CMD_SID_MORE_DICTIONARIES ".uno:MoreDictionaries"
-#define CMD_SID_ACTIVATE_STYLE_APPLY ".uno:ActivateStyleApply"
-#define CMD_SID_DOCKWIN_0 ".uno:DockingWindow0"
-#define CMD_SID_DOCKWIN_1 ".uno:DockingWindow1"
-#define CMD_SID_DOCKWIN_2 ".uno:DockingWindow2"
-#define CMD_SID_DOCKWIN_3 ".uno:DockingWindow3"
-#define CMD_SID_DOCKWIN_4 ".uno:DockingWindow4"
-#define CMD_SID_DOCKWIN_5 ".uno:DockingWindow5"
-#define CMD_SID_DOCKWIN_6 ".uno:DockingWindow6"
-#define CMD_SID_DOCKWIN_7 ".uno:DockingWindow7"
-#define CMD_SID_DOCKWIN_8 ".uno:DockingWindow8"
-#define CMD_SID_DOCKWIN_9 ".uno:DockingWindow9"
-#define CMD_SID_PASTE_UNFORMATTED ".uno:PasteUnformatted"
-
-#endif
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef SFX2_SFXCOMMANDS_HRC
+#define SFX2_SFXCOMMANDS_HRC
+
+#define CMD_SID_VIEWSHELL0 ".uno:_SwitchViewShell0"
+#define CMD_SID_VIEWSHELL1 ".uno:_SwitchViewShell1"
+#define CMD_SID_VIEWSHELL2 ".uno:_SwitchViewShell2"
+#define CMD_SID_VIEWSHELL3 ".uno:_SwitchViewShell3"
+#define CMD_SID_VIEWSHELL4 ".uno:_SwitchViewShell4"
+#define CMD_SID_ABOUT ".uno:About"
+#define CMD_SID_ACTIVATE ".uno:Activate"
+#define CMD_SID_HELPBALLOONS ".uno:ActiveHelp"
+#define CMD_SID_STYLE_FAMILY ".uno:ActualStyleFamily"
+#define CMD_SID_NEWDOC ".uno:NewDoc"
+#define CMD_SID_CREATELINK ".uno:AddBookmark"
+#define CMD_SID_NEWDOCDIRECT ".uno:AddDirect"
+#define CMD_SID_TEMPLATE_ADDRESSBOKSOURCE ".uno:AddressBookSource"
+#define CMD_SID_BASICIDE_ADDWATCH ".uno:AddWatch"
+#define CMD_SID_DOCINFO_AUTHOR ".uno:Author"
+#define CMD_SID_AUTOHIDE ".uno:AutoHide"
+#define CMD_SID_AUTOPILOTMENU ".uno:AutoPilotMenu"
+#define CMD_SID_GALLERY_BG_BRUSH ".uno:BackgroundImage"
+#define CMD_SID_BACKSPACE ".uno:Backspace"
+#define CMD_SID_BASICBREAK ".uno:BasicBreak"
+#define CMD_SID_BASICIDE_APPEAR ".uno:BasicIDEAppear"
+#define CMD_SID_BASICSTEPINTO ".uno:BasicStepInto"
+#define CMD_SID_BASICSTEPOUT ".uno:BasicStepOut"
+#define CMD_SID_BASICSTEPOVER ".uno:BasicStepOver"
+#define CMD_SID_BASICSTOP ".uno:BasicStop"
+#define CMD_SID_BROWSER ".uno:Beamer"
+#define CMD_SID_BASICIDE_BRKPNTSCHANGED ".uno:BreakPointsChanged"
+#define CMD_SID_BROWSE_BACKWARD ".uno:BrowseBackward"
+#define CMD_SID_BROWSE_FORWARD ".uno:BrowseForward"
+#define CMD_SID_BROWSER_MODE ".uno:BrowseView"
+#define CMD_SID_BUILD_VERSION ".uno:BuildVersion"
+#define CMD_SID_CAPTION ".uno:Caption"
+#define CMD_SID_STYLE_FAMILY1 ".uno:CharStyle"
+#define CMD_SID_CHECK_KEY ".uno:CheckKey"
+#define CMD_SID_BASICIDE_CHOOSEMACRO ".uno:ChooseMacro"
+#define CMD_SID_CLEARHISTORY ".uno:ClearHistory"
+#define CMD_SID_CLOSEWINS ".uno:CloseWins"
+#define CMD_SID_CLOSEDOCS ".uno:CloseDocs"
+#define CMD_SID_CLOSEDOC ".uno:CloseDoc"
+#define CMD_SID_CLOSEWIN ".uno:CloseWin"
+#define CMD_SID_CLOSING ".uno:Closing"
+#define CMD_SID_DOCINFO_COMMENTS ".uno:Comments"
+#define CMD_SID_OFFICE_COMMERCIAL_USE ".uno:CommercialUse"
+#define CMD_SID_DOCUMENT_COMPARE ".uno:CompareDocuments"
+#define CMD_SID_BASICCOMPILE ".uno:CompileBasic"
+#define CMD_SID_CONFIG ".uno:ConfigureDialog"
+#define CMD_SID_CONTEXT ".uno:Context"
+#define CMD_SID_COPY ".uno:Copy"
+#define CMD_SID_CRASH ".uno:Crash"
+#define CMD_SID_BASICIDE_CREATEMACRO ".uno:CreateMacro"
+#define CMD_SID_CURRENT_URL ".uno:CurrentURL"
+#define CMD_SID_CURSORENDOFSCREEN ".uno:CursorEndOfScreen"
+#define CMD_SID_CURSORTOPOFSCREEN ".uno:CursorTopOfScreen"
+#define CMD_SID_OFFICE_CUSTOMERNUMBER ".uno:CustomerNumber"
+#define CMD_SID_CUT ".uno:Cut"
+#define CMD_SID_DEFAULTFILEPATH ".uno:DefaultFilePath"
+#define CMD_SID_DEFAULTFILENAME ".uno:DefaultFileName"
+#define CMD_SID_DELETE ".uno:Delete"
+#define CMD_SID_BASICIDE_DELETECURRENT ".uno:DeleteCurrent"
+#define CMD_SID_STYLE_DELETE ".uno:DeleteStyle"
+#define CMD_SID_STYLE_DESIGNER ".uno:DesignerDialog"
+#define CMD_SID_STYLE_DRAGHIERARCHIE ".uno:DragHierarchy"
+#define CMD_SID_EDITDOC ".uno:EditDoc"
+#define CMD_SID_BASICIDE_EDITMACRO ".uno:EditMacro"
+#define CMD_SID_STYLE_EDIT ".uno:EditStyle"
+#define CMD_FID_SEARCH_NOW ".uno:ExecuteSearch"
+#define CMD_SID_EXTENDEDHELP ".uno:ExtendedHelp"
+#define CMD_SID_FILE_NAME ".uno:FileName"
+#define CMD_SID_FOCUSURLBOX ".uno:FocusUrlBox"
+#define CMD_SID_FORMATMENU ".uno:FormatMenu"
+#define CMD_SID_STYLE_FAMILY3 ".uno:FrameStyle"
+#define CMD_SID_FRAMETITLE ".uno:FrameTitle"
+#define CMD_SID_PROGFILENAME ".uno:FullName"
+#define CMD_SID_DOCFULLNAME ".uno:FullName"
+#define CMD_SID_WIN_FULLSCREEN ".uno:FullScreen"
+#define CMD_SID_FILLFRAME ".uno:GetFrameWindow"
+#define CMD_SID_CURSORDOWN ".uno:GoDown"
+#define CMD_SID_CURSORPAGEDOWN ".uno:GoDownBlock"
+#define CMD_SID_CURSORPAGEDOWN_SEL ".uno:GoDownBlockSel"
+#define CMD_SID_CURSORDOWN_SEL ".uno:GoDownSel"
+#define CMD_SID_CURSORLEFT ".uno:GoLeft"
+#define CMD_SID_CURSORPAGELEFT ".uno:GoLeftBlock"
+#define CMD_SID_CURSORPAGELEFT_SEL ".uno:GoLeftBlockSel"
+#define CMD_SID_CURSORLEFT_SEL ".uno:GoLeftSel"
+#define CMD_SID_CURSORRIGHT ".uno:GoRight"
+#define CMD_SID_CURSORRIGHT_SEL ".uno:GoRightSel"
+#define CMD_SID_CURSORENDOFFILE ".uno:GoToEndOfData"
+#define CMD_SID_CURSORENDOFFILE_SEL ".uno:GoToEndOfDataSel"
+#define CMD_SID_CURSOREND ".uno:GoToEndOfRow"
+#define CMD_SID_CURSOREND_SEL ".uno:GoToEndOfRowSel"
+#define CMD_SID_CURSORTOPOFFILE ".uno:GoToStart"
+#define CMD_SID_CURSORHOME ".uno:GoToStartOfRow"
+#define CMD_SID_CURSORHOME_SEL ".uno:GoToStartOfRowSel"
+#define CMD_SID_CURSORTOPOFFILE_SEL ".uno:GoToStartSel"
+#define CMD_SID_CURSORUP ".uno:GoUp"
+#define CMD_SID_CURSORPAGEUP ".uno:GoUpBlock"
+#define CMD_SID_CURSORPAGEUP_SEL ".uno:GoUpBlockSel"
+#define CMD_SID_CURSORUP_SEL ".uno:GoUpSel"
+#define CMD_SID_HELP_ANNOTATE ".uno:HelpAnnotate"
+#define CMD_SID_HELP_BOOKMARK ".uno:HelpBookmark"
+#define CMD_SID_HELP_HELPFILEBOX ".uno:HelpChooseFile"
+#define CMD_SID_HELP_DOWNLOAD ".uno:HelpDownload"
+#define CMD_SID_HELP_PI ".uno:HelperDialog"
+#define CMD_SID_HELPINDEX ".uno:HelpIndex"
+#define CMD_SID_HELPMENU ".uno:HelpMenu"
+#define CMD_SID_HELPONHELP ".uno:HelpOnHelp"
+#define CMD_SID_HELP_SEARCH ".uno:HelpSearch"
+#define CMD_SID_HELPTIPS ".uno:HelpTip"
+#define CMD_SID_HELP_ZOOMIN ".uno:HelpZoomIn"
+#define CMD_SID_HELP_ZOOMOUT ".uno:HelpZoomOut"
+#define CMD_SID_BASICIDE_HIDECURPAGE ".uno:HideCurPage"
+#define CMD_SID_HYPERLINK_DIALOG ".uno:HyperlinkDialog"
+#define CMD_SID_INSERTDOC ".uno:InsertDoc"
+#define CMD_SID_HYPERLINK_INSERT ".uno:InsertHyperlink"
+#define CMD_SID_INSERT_FLOATINGFRAME ".uno:InsertObjectFloatingFrame"
+#define CMD_SID_INTERNET_ONLINE ".uno:InternetOnline"
+#define CMD_SID_INTERNET_SEARCH ".uno:InternetSearch"
+#define CMD_SID_DOC_LOADING ".uno:IsLoading"
+#define CMD_SID_IMG_LOADING ".uno:IsLoadingImages"
+#define CMD_SID_PRINTOUT ".uno:IsPrinting"
+#define CMD_SID_JUMPTOMARK ".uno:JumpToMark"
+#define CMD_SID_DOCINFO_KEYWORDS ".uno:Keywords"
+#define CMD_SID_BASICIDE_LIBLOADED ".uno:LibLoaded"
+#define CMD_SID_BASICIDE_LIBREMOVED ".uno:LibRemoved"
+#define CMD_SID_BASICIDE_LIBSELECTED ".uno:LibSelect"
+#define CMD_SID_BASICIDE_LIBSELECTOR ".uno:LibSelector"
+#define CMD_SID_OFFICE_PLK ".uno:LicenceKey"
+#define CMD_SID_CONFIGACCEL ".uno:LoadAccel"
+#define CMD_SID_BASICLOAD ".uno:LoadBasic"
+#define CMD_SID_LOADCONFIG ".uno:LoadConfiguration"
+#define CMD_SID_CONFIGEVENT ".uno:LoadEvents"
+#define CMD_SID_CONFIGMENU ".uno:LoadMenu"
+#define CMD_SID_CONFIGSTATUSBAR ".uno:LoadStatusBar"
+#define CMD_SID_TOOLBOXOPTIONS ".uno:LoadToolBox"
+#define CMD_SID_LOGOUT ".uno:Logout"
+#define CMD_SID_SCRIPTORGANIZER ".uno:ScriptOrganizer"
+#define CMD_SID_MACROORGANIZER ".uno:MacroOrganizer"
+#define CMD_SID_RUNMACRO ".uno:RunMacro"
+#define CMD_SID_BASICCHOOSER ".uno:MacroDialog"
+#define CMD_SID_MAIL_NOTIFY ".uno:MailReceipt"
+#define CMD_SID_MAIL_CHILDWIN ".uno:MailWindow"
+#define CMD_SID_BASICIDE_MATCHGROUP ".uno:MatchGroup"
+#define CMD_SID_TOGGLE_MENUBAR ".uno:MenuBarVisible"
+#define CMD_SID_DOCUMENT_MERGE ".uno:MergeDocuments"
+#define CMD_SID_ATTR_METRIC ".uno:MetricUnit"
+#define CMD_SID_MODIFIED ".uno:Modified"
+#define CMD_SID_DOC_MODIFIED ".uno:ModifiedStatus"
+#define CMD_SID_BASICIDE_MODULEDLG ".uno:ModuleDialog"
+#define CMD_SID_BASICIDE_NAMECHANGEDONTAB ".uno:NameChangedOnTab"
+#define CMD_SID_NAVIGATOR ".uno:Navigator"
+#define CMD_SID_RESTORE_EDITING_VIEW ".uno:RestoreEditingView"
+#define CMD_SID_BASICIDE_NEWDIALOG ".uno:NewDialog"
+#define CMD_SID_BASICIDE_NEWMODULE ".uno:NewModule"
+#define CMD_SID_CREATE_BASICOBJECT ".uno:NewObject"
+#define CMD_SID_STYLE_NEW ".uno:NewStyle"
+#define CMD_SID_NEWWINDOW ".uno:NewWindow"
+#define CMD_SID_BASICIDE_OBJCAT ".uno:ObjectCatalog"
+#define CMD_SID_OBJECT ".uno:ObjectMenue"
+#define CMD_SID_OLD_PALK ".uno:OldPALK"
+#define CMD_SID_OPENDOC ".uno:Open"
+#define CMD_SID_WEBHTML ".uno:WebHtml"
+#define CMD_SID_OPENHYPERLINK ".uno:OpenHyperlink"
+#define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle"
+#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate"
+#define CMD_SID_OPENURL ".uno:OpenUrl"
+#define CMD_SID_OPTIONS ".uno:Options"
+#define CMD_SID_ORGANIZER ".uno:Organizer"
+#define CMD_SID_STYLE_FAMILY4 ".uno:PageStyle"
+#define CMD_SID_STYLE_FAMILY2 ".uno:ParaStyle"
+#define CMD_SID_PARTWIN ".uno:PartWindow"
+#define CMD_SID_PASTE ".uno:Paste"
+#define CMD_SID_CLIPBOARD_FORMAT_ITEMS ".uno:ClipboardFormatItems"
+#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial"
+#define CMD_SID_DOCPATH ".uno:DocPath"
+#define CMD_SID_PICKLIST ".uno:PickList"
+#define CMD_SID_PLUGINS_ACTIVE ".uno:PlugInsActive"
+#define CMD_SID_PRINTDOC ".uno:Print"
+#define CMD_SID_PRINTDOCDIRECT ".uno:PrintDefault"
+#define CMD_SID_PRINTER_NAME ".uno:Printer"
+#define CMD_SID_SETUPPRINTER ".uno:PrinterSetup"
+#define CMD_SID_PRINTPREVIEW ".uno:PrintPreview"
+#define CMD_SID_OFFICE_PRIVATE_USE ".uno:PrivateUse"
+#define CMD_SID_DOCINFO ".uno:SetDocumentProperties"
+#define CMD_SID_QUITAPP ".uno:Quit"
+#define CMD_SID_DOC_READONLY ".uno:ReadOnly"
+#define CMD_SID_RECORDMACRO ".uno:MacroRecorder"
+#define CMD_SID_STOP_RECORDING ".uno:StopRecording"
+#define CMD_SID_RECORDING_FLOATWINDOW ".uno:MacroRecordingFloat"
+#define CMD_SID_REDO ".uno:Redo"
+#define CMD_SID_DELETE_BASICOBJECT ".uno:ReleaseObject"
+#define CMD_SID_RELOAD ".uno:Reload"
+#define CMD_SID_BASICIDE_REMOVEWATCH ".uno:RemoveWatch"
+#define CMD_SID_BASICIDE_RENAMECURRENT ".uno:RenameCurrent"
+#define CMD_SID_REPAINT ".uno:Repaint"
+#define CMD_SID_REPEAT ".uno:RepeatAction"
+#define CMD_SID_RUBY_DIALOG ".uno:RubyDialog"
+#define CMD_SID_BASICRUN ".uno:RunBasic"
+#define CMD_SID_SAVEDOC ".uno:Save"
+#define CMD_SID_SAVEDOCS ".uno:SaveAll"
+#define CMD_SID_SAVEASDOC ".uno:SaveAs"
+#define CMD_SID_DOCTEMPLATE ".uno:SaveAsTemplate"
+#define CMD_SID_BASICSAVEAS ".uno:SaveBasicAs"
+#define CMD_SID_EXPORT_DIALOG ".uno:ExportDialog"
+#define CMD_SID_IMPORT_DIALOG ".uno:ImportDialog"
+#define CMD_SID_SAVECONFIG ".uno:SaveConfiguration"
+#define CMD_SID_DOC_SAVED ".uno:Saved"
+#define CMD_SID_BASICIDE_SBXDELETED ".uno:SbxDeleted"
+#define CMD_SID_BASICIDE_SBXINSERTED ".uno:SbxInserted"
+#define CMD_SID_BASICIDE_SBXRENAMED ".uno:SbxRenamed"
+#define CMD_SID_MAIL_SCROLLBODY_PAGEDOWN ".uno:ScrollBodyPageDown"
+#define CMD_SID_SEARCH_DLG ".uno:SearchDialog"
+#define CMD_SID_SEARCH_OPTIONS ".uno:SearchOptions"
+#define CMD_SID_SEARCH_ITEM ".uno:SearchProperties"
+#define CMD_SID_SELECTALL ".uno:SelectAll"
+#define CMD_FN_FAX ".uno:SendFax"
+#define CMD_SID_MAIL_SENDDOC ".uno:SendMail"
+#define CMD_SID_MAIL_SENDDOCASPDF ".uno:SendMailDocAsPDF"
+#define CMD_SID_MAIL_SENDDOCASFORMAT ".uno:SendMailDocAsFormat"
+#define CMD_SID_MAIL_SENDDOCASMS ".uno:SendMailDocAsMS"
+#define CMD_SID_MAIL_SENDDOCASOOO ".uno:SendMailDocAsOOo"
+#define CMD_SID_SETOPTIONS ".uno:SetOptions"
+#define CMD_SID_OFFICE_PALK ".uno:SetPALK"
+#define CMD_SID_SHOW_BROWSER ".uno:ShowBrowser"
+#define CMD_SID_SHOWPOPUPS ".uno:ShowPopups"
+#define CMD_SID_BASICIDE_SHOWSBX ".uno:ShowSbx"
+#define CMD_SID_SOURCEVIEW ".uno:SourceView"
+#define CMD_SID_ONLINE_REGISTRATION_DLG ".uno:StartRegistrationDialog"
+#define CMD_SID_STATUSBARTEXT ".uno:StatusBar"
+#define CMD_SID_TOGGLESTATUSBAR ".uno:StatusBarVisible"
+#define CMD_SID_BASICIDE_STAT_DATE ".uno:StatusGetDate"
+#define CMD_SID_BASICIDE_STAT_POS ".uno:StatusGetPosition"
+#define CMD_SID_BASICIDE_STAT_TITLE ".uno:StatusGetTitle"
+#define CMD_SID_BASICIDE_STOREALLMODULESOURCES ".uno:StoreAllModuleSources"
+#define CMD_SID_BASICIDE_STOREMODULESOURCE ".uno:StoreModuleSource"
+#define CMD_SID_STYLE_APPLY ".uno:StyleApplyState"
+#define CMD_SID_STYLE_CATALOG ".uno:StyleCatalog"
+#define CMD_SID_STYLE_NEW_BY_EXAMPLE ".uno:StyleNewByExample"
+#define CMD_SID_STYLE_UPDATE_BY_EXAMPLE ".uno:StyleUpdateByExample"
+#define CMD_SID_STYLE_WATERCAN ".uno:StyleWatercanMode"
+#define CMD_SID_VIEWSHELL ".uno:SwitchViewShell"
+#define CMD_SID_TASKBAR ".uno:TaskBarVisible"
+#define CMD_SID_STYLE_FAMILY5 ".uno:ListStyle"
+#define CMD_SID_TIPWINDOW ".uno:TipsDialog"
+#define CMD_SID_DOCTITLE ".uno:Title"
+#define CMD_SID_TITLE ".uno:Title"
+#define CMD_SID_BASICIDE_TOGGLEBRKPNT ".uno:ToggleBreakPoint"
+#define CMD_SID_BASICIDE_SHOWWINDOW ".uno:BasicIDEShowWindow"
+#define CMD_SID_UNDO ".uno:Undo"
+#define CMD_SID_FORMATPAINTBRUSH ".uno:FormatPaintbrush"
+#define CMD_SID_ATTR_UNDO_COUNT ".uno:UndoCount"
+#define CMD_SID_BASICIDE_UPDATEALLMODULESOURCES ".uno:UpdateAllModuleSources"
+#define CMD_SID_BASICIDE_UPDATEMODULESOURCE ".uno:UpdateModuleSource"
+#define CMD_SID_BASICIDE_MANAGEBRKPNTS ".uno:ManageBreakPoints"
+#define CMD_SID_BASICIDE_TOGGLEBRKPNTENABLED ".uno:ToggleBreakPointEnabled"
+#define CMD_SID_UPDATE_VERSION ".uno:UpdateVersion"
+#define CMD_SID_VERSION ".uno:VersionDialog"
+#define CMD_SID_SIGNATURE ".uno:Signature"
+#define CMD_SID_MACRO_SIGNATURE ".uno:MacroSignature"
+#define CMD_SID_VERSION_VISIBLE ".uno:VersionVisible"
+#define CMD_SID_VIEW_DATA_SOURCE_BROWSER ".uno:ViewDataSourceBrowser"
+#define CMD_SID_WIN_VISIBLE ".uno:WinVisible"
+#define CMD_SID_MDIWINDOWLIST ".uno:WindowList"
+#define CMD_SID_ZOOM_IN ".uno:ZoomMinus"
+#define CMD_SID_ZOOM ".uno:Zooming"
+#define CMD_SID_ZOOM_NEXT ".uno:ZoomNext"
+#define CMD_SID_ZOOM_OUT ".uno:ZoomPlus"
+#define CMD_SID_ZOOM_PREV ".uno:ZoomPrevious"
+#define CMD_SID_ZOOM_TOOLBOX ".uno:ZoomToolBox"
+#define CMD_SID_EXPORTDOC ".uno:ExportTo"
+#define CMD_SID_EXPORTDOCASPDF ".uno:ExportToPDF"
+#define CMD_SID_DIRECTEXPORTDOCASPDF ".uno:ExportDirectToPDF"
+#define CMD_SID_IMAGE_ORIENTATION ".uno:ImageOrientation"
+#define CMD_SID_SAVE_VERSION_ON_CLOSE ".uno:SaveVersionOnClose"
+#define CMD_SID_ADDONS ".uno:Addons"
+#define CMD_SID_SHOW_IME_STATUS_WINDOW ".uno:ShowImeStatusWindow"
+#define CMD_SID_UPDATE_CONFIG ".uno:UpdateConfiguration"
+#define CMD_SID_HELP_SUPPORTPAGE ".uno:HelpSupport"
+#define CMD_SID_HELP_TUTORIALS ".uno:HelpTutorials"
+#define CMD_SID_ADDONHELP ".uno:AddonHelp"
+#define CMD_SID_FORMATMENUSTATE ".uno:FormatMenuState"
+#define CMD_SID_INET_DLG ".uno:InternetDialog"
+#define CMD_SID_ONLINE_REGISTRATION ".uno:OnlineRegistrationDlg"
+#define CMD_SID_OFFICE_CHECK_PLZ ".uno:CheckPLZ"
+#define CMD_SID_ADDRESS_DATA_SOURCE ".uno:AutoPilotAddressDataSource"
+#define CMD_FN_BUSINESS_CARD ".uno:InsertBusinessCard"
+#define CMD_FN_LABEL ".uno:InsertLabels"
+#define CMD_FN_XFORMS_INIT ".uno:NewXForms"
+#define CMD_SID_SD_AUTOPILOT ".uno:AutoPilotPresentations"
+#define CMD_SID_NEWSD ".uno:NewPresentation"
+#define CMD_SID_COMP_BIBLIOGRAPHY ".uno:BibliographyComponent"
+#define CMD_SID_MINIMIZED ".uno:Minimized"
+#define CMD_SID_AUTO_CORRECT_DLG ".uno:AutoCorrectDlg"
+#define CMD_SID_OPTIONS_TREEDIALOG ".uno:OptionsTreeDialog"
+#define CMD_SID_TERMINATE_INPLACEACTIVATION ".uno:TerminateInplaceActivation"
+#define CMD_SID_RECENTFILELIST ".uno:RecentFileList"
+#define CMD_SID_AVAILABLE_TOOLBARS ".uno:AvailableToolbars"
+#define CMD_SID_AVMEDIA_PLAYER ".uno:AVMediaPlayer"
+#define CMD_SID_INSERT_AVMEDIA ".uno:InsertAVMedia"
+#define CMD_SID_MORE_DICTIONARIES ".uno:MoreDictionaries"
+#define CMD_SID_ACTIVATE_STYLE_APPLY ".uno:ActivateStyleApply"
+#define CMD_SID_DOCKWIN_0 ".uno:DockingWindow0"
+#define CMD_SID_DOCKWIN_1 ".uno:DockingWindow1"
+#define CMD_SID_DOCKWIN_2 ".uno:DockingWindow2"
+#define CMD_SID_DOCKWIN_3 ".uno:DockingWindow3"
+#define CMD_SID_DOCKWIN_4 ".uno:DockingWindow4"
+#define CMD_SID_DOCKWIN_5 ".uno:DockingWindow5"
+#define CMD_SID_DOCKWIN_6 ".uno:DockingWindow6"
+#define CMD_SID_DOCKWIN_7 ".uno:DockingWindow7"
+#define CMD_SID_DOCKWIN_8 ".uno:DockingWindow8"
+#define CMD_SID_DOCKWIN_9 ".uno:DockingWindow9"
+#define CMD_SID_PASTE_UNFORMATTED ".uno:PasteUnformatted"
+
+#endif
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 561a41b04387..17d47097fb46 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -522,41 +522,29 @@
#define SID_CURSORTOPOFSCREEN (SID_SFX_START + 744)
#define SID_CURSORHOME (SID_SFX_START + 745)
#define SID_CURSOREND (SID_SFX_START + 746)
-#define SID_SCROLLDOWN (SID_SFX_START + 751)
-#define SID_SCROLLUP (SID_SFX_START + 752)
#define SID_FORMATMENU (SID_SFX_START + 780)
#define SID_OBJECTMENU0 SID_FORMATMENU
#define SID_OBJECTMENU1 (SID_SFX_START + 781)
#define SID_OBJECTMENU2 (SID_SFX_START + 782)
#define SID_OBJECTMENU3 (SID_SFX_START + 783)
#define SID_OBJECTMENU_LAST SID_OBJECTMENU3
-#define SID_EDITMENU (SID_SFX_START + 790)
#define SID_FORMATMENUSTATE (SID_SFX_START + 791)
// default-ids for macros
#define SID_RECORDING_FLOATWINDOW (SID_SFX_START + 800)
#define SID_RECORDMACRO (SID_SFX_START + 1669)
-#define SID_PLAYMACRO (SID_SFX_START + 801)
-#define SID_EDITMACRO (SID_SFX_START + 802)
-#define SID_MACROLIBMANAGER (SID_SFX_START + 803)
-#define SID_LOADMACROLIB (SID_SFX_START + 804)
-#define SID_RELEASEMACROLIB (SID_SFX_START + 805)
-#define SID_BASICNAME (SID_SFX_START + 806)
-#define SID_LIBNAME (SID_SFX_START + 807)
-#define SID_MODULENAME (SID_SFX_START + 808)
-#define SID_STATEMENT (SID_SFX_START + 810)
+ // FREE: SID_SFX_START + 801
+ // FREE: SID_SFX_START + 802
+ // FREE: SID_SFX_START + 803
+ // FREE: SID_SFX_START + 804
+ // FREE: SID_SFX_START + 805
+ // FREE: SID_SFX_START + 806
+ // FREE: SID_SFX_START + 807
+ // FREE: SID_SFX_START + 808
+ // FREE: SID_SFX_START + 809
+ // FREE: SID_SFX_START + 810
#define SID_ASYNCHRON (SID_SFX_START + 811)
-#define SID_START_APP (SID_SFX_START + 820)
-#define SID_START_BEGIN (SID_SFX_START + 821)
-#define SID_STARTSW SID_START_BEGIN
-#define SID_STARTSC (SID_START_BEGIN + 1)
-#define SID_STARTSD (SID_START_BEGIN + 2)
-#define SID_STARTSIM (SID_START_BEGIN + 3)
-#define SID_STARTSCH (SID_START_BEGIN + 4)
-#define SID_STARTSMA (SID_START_BEGIN + 5)
-#define SID_START_END SID_STARTSMA
-
// default-ids for configuration
#define SID_RESTOREMENU (SID_SFX_START + 901)
#define SID_RESTOREACCELS (SID_SFX_START + 902)
@@ -622,11 +610,9 @@
#define SID_OBJECTRESIZE (SID_SFX_START + 1000)
#define SID_INSERT_TEXT (SID_SFX_START + 1001)
-#define SID_MACRO_START (SID_SFX_START + 1002)
-#define SID_MACRO_END (SID_SFX_START + 1100)
-#define SID_EVENTCONFIG (SID_MACRO_END + 1)
-#define SID_VERB_START (SID_MACRO_END + 2)
-#define SID_VERB_END (SID_MACRO_END + 21)
+#define SID_EVENTCONFIG (SID_SFX_START + 1101)
+#define SID_VERB_START (SID_SFX_START + 1100)
+#define SID_VERB_END (SID_SFX_START + 1121)
#define SID_BROWSER_TASK (SID_MACRO_END + 22)
diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx
index 314c16fdbf1f..4d93a7b422aa 100644
--- a/sfx2/inc/sfx2/shell.hxx
+++ b/sfx2/inc/sfx2/shell.hxx
@@ -65,12 +65,16 @@ class SfxShellSubObject;
class SfxDispatcher;
class SfxViewFrame;
class SfxSlot;
-class SfxUndoManager;
class SfxRepeatTarget;
class SbxVariable;
class SbxBase;
class SfxBindings;
+namespace svl
+{
+ class IUndoManager;
+}
+
//====================================================================
enum SfxInterfaceId
@@ -162,7 +166,7 @@ class SFX2_DLLPUBLIC SfxShell: public SfxBroadcaster
SfxShell_Impl* pImp;
SfxItemPool* pPool;
- SfxUndoManager* pUndoMgr;
+ ::svl::IUndoManager* pUndoMgr;
private:
SfxShell( const SfxShell & ); // n.i.
@@ -212,8 +216,9 @@ public:
inline SfxItemPool& GetPool() const;
inline void SetPool( SfxItemPool *pNewPool ) ;
- virtual SfxUndoManager* GetUndoManager();
- void SetUndoManager( SfxUndoManager *pNewUndoMgr );
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
+ void SetUndoManager( ::svl::IUndoManager *pNewUndoMgr );
SfxRepeatTarget* GetRepeatTarget() const;
void SetRepeatTarget( SfxRepeatTarget *pTarget );
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 70e7b08319e5..5a032af30050 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -214,6 +214,7 @@ public:
virtual String GetSelectionText( BOOL bCompleteWords = FALSE );
virtual BOOL HasSelection( BOOL bText = TRUE ) const;
virtual SdrView* GetDrawView() const;
+
void SetSubShell( SfxShell *pShell );
SfxShell* GetSubShell() const { return pSubShell; }
void AddSubShell( SfxShell& rShell );
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index 76f87fa844c8..dc0b094ac4fb 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -1,12 +1,5 @@
-sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL
-sf sfx2 usr1 - all sf_mkout NULL
-sf sfx2\prj nmake - all sf_prj NULL
-sf sfx2\qa\cppunit nmake - all sf_qa_cppunit NULL
-sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL
-
-# fails on unxsoli4
-# sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL
-
-# sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_qa_complex_framework_dochelper NULL
-# sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL
-
+sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt test NULL
+sf sfx2 usr1 - all sf_mkout NULL
+sf sfx2\prj nmake - all sf_prj NULL
+sf sfx2\qa\cppunit nmake - all sf_qa_cppunit NULL
+sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL
diff --git a/sfx2/qa/complex/docinfo/DocumentProperties.java b/sfx2/qa/complex/sfx2/DocumentInfo.java
index 0c4eb44c4a35..ca7ae8b1dda0 100644
--- a/sfx2/qa/complex/docinfo/DocumentProperties.java
+++ b/sfx2/qa/complex/sfx2/DocumentInfo.java
@@ -24,9 +24,9 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.docinfo;
+package complex.sfx2;
-import com.sun.star.beans.*;
+import com.sun.star.beans.PropertyAttribute;
import com.sun.star.beans.Property;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertyContainer;
@@ -49,22 +49,17 @@ import util.WriterTools;
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.*;
-public class DocumentProperties
+public class DocumentInfo
{
-
XMultiServiceFactory m_xMSF = null;
XTextDocument xTextDoc = null;
XTextDocument xTextDocSecond = null;
-// public String[] getTestMethodNames() {
-// return new String[] {"checkDocInfo", "cleanup"};
-// }
@Test public void checkDocInfo()
{
m_xMSF = getMSF();
@@ -349,14 +344,18 @@ public class DocumentProperties
// setup and close connections
@BeforeClass public static void setUpConnection() throws Exception
{
- System.out.println("setUpConnection()");
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "starting class: " + DocumentInfo.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.setUp();
}
@AfterClass public static void tearDownConnection()
throws InterruptedException, com.sun.star.uno.Exception
{
- System.out.println("tearDownConnection()");
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "finishing class: " + DocumentInfo.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.tearDown();
}
private static final OfficeConnection connection = new OfficeConnection();
diff --git a/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
index 3f61cb21b3dd..d145b9028473 100644
--- a/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java
+++ b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java
@@ -25,9 +25,27 @@
*
************************************************************************/
-package complex.framework;
+package complex.sfx2;
// import complexlib.ComplexTestCase;
+import com.sun.star.beans.Pair;
+import com.sun.star.rdf.Literal;
+import com.sun.star.rdf.XLiteral;
+import com.sun.star.rdf.XNamedGraph;
+import com.sun.star.rdf.BlankNode;
+import com.sun.star.rdf.XQuerySelectResult;
+import com.sun.star.rdf.XNode;
+import com.sun.star.rdf.XDocumentRepository;
+import com.sun.star.rdf.XMetadatable;
+import com.sun.star.rdf.Statement;
+import com.sun.star.rdf.FileFormat;
+import com.sun.star.rdf.URIs;
+import com.sun.star.rdf.URI;
+import com.sun.star.rdf.XDocumentMetadataAccess;
+import com.sun.star.rdf.XRepositorySupplier;
+import com.sun.star.rdf.XRepository;
+import com.sun.star.rdf.XBlankNode;
+import com.sun.star.rdf.XURI;
import helper.StreamSimulator;
import com.sun.star.uno.UnoRuntime;
@@ -41,7 +59,6 @@ import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.WrappedTargetRuntimeException;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.Pair;
import com.sun.star.beans.StringPair;
import com.sun.star.container.XEnumerationAccess;
import com.sun.star.container.XEnumeration;
@@ -51,7 +68,7 @@ import com.sun.star.frame.XStorable;
import com.sun.star.text.XTextDocument;
import com.sun.star.text.XTextRange;
import com.sun.star.text.XText;
-import com.sun.star.rdf.*;
+import complex.sfx2.tools.TestDocument;
import lib.TestParameters;
@@ -73,7 +90,7 @@ import static org.junit.Assert.*;
*
* @author mst
*/
-public class DocumentMetadataAccessTest
+public class DocumentMetadataAccess
{
XMultiServiceFactory xMSF;
XComponentContext xContext;
@@ -196,22 +213,22 @@ public class DocumentMetadataAccessTest
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "Hidden";
- loadProps[0].Value = new Boolean(true);
+ loadProps[0].Value = true;
xComp = util.DesktopTools.openNewDoc(xMSF, "swriter", loadProps);
XTextDocument xText = UnoRuntime.queryInterface(XTextDocument.class, xComp);
- XRepositorySupplier xRS = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
- assertNotNull("xRS null", xRS);
- XDocumentMetadataAccess xDMA = UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xRS);
- assertNotNull("xDMA null", xDMA);
- xRep = xRS.getRDFRepository();
+ XRepositorySupplier xRepoSupplier = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
+ assertNotNull("xRS null", xRepoSupplier);
+ XDocumentMetadataAccess xDocMDAccess = UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xRepoSupplier);
+ assertNotNull("xDMA null", xDocMDAccess);
+ xRep = xRepoSupplier.getRDFRepository();
assertNotNull("xRep null", xRep);
System.out.println("...done");
System.out.println("Checking that new repository is initialized...");
- XURI xBaseURI = (XURI) xDMA;
+ XURI xBaseURI = (XURI) xDocMDAccess;
String baseURI = xBaseURI.getStringValue();
assertNotNull("new: baseURI", xBaseURI );
assertTrue("new: baseURI", !xBaseURI.getStringValue().equals(""));
@@ -235,79 +252,79 @@ public class DocumentMetadataAccessTest
XMetadatable xM = (XMetadatable) xTR;
try {
- xDMA.getElementByURI(null);
+ xDocMDAccess.getElementByURI(null);
fail("getElementByURI: null allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.getMetadataGraphsWithType(null);
+ xDocMDAccess.getMetadataGraphsWithType(null);
fail("getMetadataGraphsWithType: null URI allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("", new XURI[0]);
+ xDocMDAccess.addMetadataFile("", new XURI[0]);
fail("addMetadataFile: empty filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("/foo", new XURI[0]);
+ xDocMDAccess.addMetadataFile("/foo", new XURI[0]);
fail("addMetadataFile: absolute filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("fo\"o", new XURI[0]);
+ xDocMDAccess.addMetadataFile("fo\"o", new XURI[0]);
fail("addMetadataFile: invalid filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("../foo", new XURI[0]);
+ xDocMDAccess.addMetadataFile("../foo", new XURI[0]);
fail("addMetadataFile: filename with .. allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("foo/../../bar", new XURI[0]);
+ xDocMDAccess.addMetadataFile("foo/../../bar", new XURI[0]);
fail("addMetadataFile: filename with nest .. allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("foo/././bar", new XURI[0]);
+ xDocMDAccess.addMetadataFile("foo/././bar", new XURI[0]);
fail("addMetadataFile: filename with nest . allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("content.xml", new XURI[0]);
+ xDocMDAccess.addMetadataFile("content.xml", new XURI[0]);
fail("addMetadataFile: content.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("styles.xml", new XURI[0]);
+ xDocMDAccess.addMetadataFile("styles.xml", new XURI[0]);
fail("addMetadataFile: styles.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("meta.xml", new XURI[0]);
+ xDocMDAccess.addMetadataFile("meta.xml", new XURI[0]);
fail("addMetadataFile: meta.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addMetadataFile("settings.xml", new XURI[0]);
+ xDocMDAccess.addMetadataFile("settings.xml", new XURI[0]);
fail("addMetadataFile: settings.xml allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.importMetadataFile(FileFormat.RDF_XML, null, "foo",
+ xDocMDAccess.importMetadataFile(FileFormat.RDF_XML, null, "foo",
foo, new XURI[0]);
fail("importMetadataFile: null stream allowed");
} catch (IllegalArgumentException e) {
@@ -317,7 +334,7 @@ public class DocumentMetadataAccessTest
final String sEmptyRDF = TestDocument.getUrl("empty.rdf");
try {
XInputStream xFooIn = new StreamSimulator(sEmptyRDF, true, param);
- xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "",
+ xDocMDAccess.importMetadataFile(FileFormat.RDF_XML, xFooIn, "",
foo, new XURI[0]);
fail("importMetadataFile: empty filename allowed");
} catch (IllegalArgumentException e) {
@@ -326,7 +343,7 @@ public class DocumentMetadataAccessTest
try {
XInputStream xFooIn =
new StreamSimulator(sEmptyRDF, true, param);
- xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "meta.xml",
+ xDocMDAccess.importMetadataFile(FileFormat.RDF_XML, xFooIn, "meta.xml",
foo, new XURI[0]);
fail("importMetadataFile: meta.xml filename allowed");
} catch (IllegalArgumentException e) {
@@ -335,7 +352,7 @@ public class DocumentMetadataAccessTest
try {
XInputStream xFooIn =
new StreamSimulator(sEmptyRDF, true, param);
- xDMA.importMetadataFile(FileFormat.RDF_XML,
+ xDocMDAccess.importMetadataFile(FileFormat.RDF_XML,
xFooIn, "foo", null, new XURI[0]);
fail("importMetadataFile: null base URI allowed");
} catch (IllegalArgumentException e) {
@@ -344,62 +361,62 @@ public class DocumentMetadataAccessTest
try {
XInputStream xFooIn =
new StreamSimulator(sEmptyRDF, true, param);
- xDMA.importMetadataFile(FileFormat.RDF_XML,
+ xDocMDAccess.importMetadataFile(FileFormat.RDF_XML,
xFooIn, "foo", rdf_type, new XURI[0]);
fail("importMetadataFile: non-absolute base URI allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.removeMetadataFile(null);
+ xDocMDAccess.removeMetadataFile(null);
fail("removeMetadataFile: null URI allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addContentOrStylesFile("");
+ xDocMDAccess.addContentOrStylesFile("");
fail("addContentOrStylesFile: empty filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addContentOrStylesFile("/content.xml");
+ xDocMDAccess.addContentOrStylesFile("/content.xml");
fail("addContentOrStylesFile: absolute filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.addContentOrStylesFile("foo.rdf");
+ xDocMDAccess.addContentOrStylesFile("foo.rdf");
fail("addContentOrStylesFile: invalid filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.removeContentOrStylesFile("");
+ xDocMDAccess.removeContentOrStylesFile("");
fail("removeContentOrStylesFile: empty filename allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.loadMetadataFromStorage(null, foo, null);
+ xDocMDAccess.loadMetadataFromStorage(null, foo, null);
fail("loadMetadataFromStorage: null storage allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.storeMetadataToStorage(null/*, base*/);
+ xDocMDAccess.storeMetadataToStorage(null/*, base*/);
fail("storeMetadataToStorage: null storage allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.loadMetadataFromMedium(new PropertyValue[0]);
+ xDocMDAccess.loadMetadataFromMedium(new PropertyValue[0]);
fail("loadMetadataFromMedium: empty medium allowed");
} catch (IllegalArgumentException e) {
// ignore
}
try {
- xDMA.storeMetadataToMedium(new PropertyValue[0]);
+ xDocMDAccess.storeMetadataToMedium(new PropertyValue[0]);
fail("storeMetadataToMedium: empty medium allowed");
} catch (IllegalArgumentException e) {
// ignore
@@ -409,26 +426,26 @@ public class DocumentMetadataAccessTest
System.out.println("Checking file addition/removal...");
- xDMA.removeContentOrStylesFile(contentPath);
+ xDocMDAccess.removeContentOrStylesFile(contentPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
assertTrue("removeContentOrStylesFile (content)",
eq(xStmtsEnum, new Statement[] {
manifestStmts[0], manifestStmts[2], manifestStmts[4]
}));
- xDMA.addContentOrStylesFile(contentPath);
+ xDocMDAccess.addContentOrStylesFile(contentPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
assertTrue("addContentOrStylesFile (content)",
eq(xStmtsEnum, manifestStmts));
- xDMA.removeContentOrStylesFile(stylesPath);
+ xDocMDAccess.removeContentOrStylesFile(stylesPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
assertTrue("removeContentOrStylesFile (styles)",
eq(xStmtsEnum, new Statement[] {
manifestStmts[0], manifestStmts[1], manifestStmts[3]
}));
- xDMA.addContentOrStylesFile(stylesPath);
+ xDocMDAccess.addContentOrStylesFile(stylesPath);
xStmtsEnum = xManifest.getStatements(null, null, null);
assertTrue("addContentOrStylesFile (styles)",
eq(xStmtsEnum, manifestStmts));
@@ -441,19 +458,19 @@ public class DocumentMetadataAccessTest
new Statement(xFoo, rdf_type, pkg_MetadataFile, manifest);
Statement xM_FooTypeBar =
new Statement(xFoo, rdf_type, bar, manifest);
- xDMA.addMetadataFile(fooPath, new XURI[] { bar });
+ xDocMDAccess.addMetadataFile(fooPath, new XURI[] { bar });
xStmtsEnum = xManifest.getStatements(null, null, null);
assertTrue("addMetadataFile",
eq(xStmtsEnum, merge(manifestStmts, new Statement[] {
xM_BaseHaspartFoo, xM_FooTypeMetadata, xM_FooTypeBar
})));
- XURI[] graphsBar = xDMA.getMetadataGraphsWithType(bar);
+ XURI[] graphsBar = xDocMDAccess.getMetadataGraphsWithType(bar);
assertTrue("getMetadataGraphsWithType",
graphsBar.length == 1 && eq(graphsBar[0], xFoo));
- xDMA.removeMetadataFile(xFoo);
+ xDocMDAccess.removeMetadataFile(xFoo);
xStmtsEnum = xManifest.getStatements(null, null, null);
assertTrue("removeMetadataFile",
eq(xStmtsEnum, manifestStmts));
@@ -468,7 +485,7 @@ public class DocumentMetadataAccessTest
XURI uri;
XMetadatable xMeta;
- xMeta = xDMA.getElementByURI(xMeta1);
+ xMeta = xDocMDAccess.getElementByURI(xMeta1);
assertTrue("getElementByURI: null", null != xMeta);
String XmlId = xMeta.getMetadataReference().Second;
String XmlId1 = xMeta1.getMetadataReference().Second;
@@ -483,7 +500,7 @@ public class DocumentMetadataAccessTest
fooBarPath);
Statement[] metadataStmts = getMetadataFileStmts(xBaseURI,
fooBarPath);
- xDMA.addMetadataFile(fooBarPath, new XURI[0]);
+ xDocMDAccess.addMetadataFile(fooBarPath, new XURI[0]);
xStmtsEnum = xRep.getStatements(null, null, null);
assertTrue("addMetadataFile",
eq(xStmtsEnum, merge(manifestStmts, metadataStmts )));
@@ -520,15 +537,15 @@ public class DocumentMetadataAccessTest
xStmtsEnum = xRep.getStatements(null, null, null);
XURI[] graphs = xRep.getGraphNames();
- xDMA.storeMetadataToMedium(args);
+ xDocMDAccess.storeMetadataToMedium(args);
// this should re-init
- xDMA.loadMetadataFromMedium(argsEmptyNoContent);
- xRep = xRS.getRDFRepository();
+ xDocMDAccess.loadMetadataFromMedium(argsEmptyNoContent);
+ xRep = xRepoSupplier.getRDFRepository();
assertTrue("xRep null", null != xRep);
assertTrue("baseURI still tdoc?",
- !baseURI.equals(xDMA.getStringValue()));
- Statement[] manifestStmts2 = getManifestStmts((XURI) xDMA);
+ !baseURI.equals(xDocMDAccess.getStringValue()));
+ Statement[] manifestStmts2 = getManifestStmts((XURI) xDocMDAccess);
xStmtsEnum = xRep.getStatements(null, null, null);
// there is no content or styles file in here, so we have just
// the package stmt
@@ -536,29 +553,29 @@ public class DocumentMetadataAccessTest
eq(xStmtsEnum, new Statement[] { manifestStmts2[0] }));
// this should re-init
- xDMA.loadMetadataFromMedium(argsEmpty);
- xRep = xRS.getRDFRepository();
+ xDocMDAccess.loadMetadataFromMedium(argsEmpty);
+ xRep = xRepoSupplier.getRDFRepository();
assertTrue("xRep null", null != xRep);
assertTrue("baseURI still tdoc?",
- !baseURI.equals(xDMA.getStringValue()));
- Statement[] manifestStmts3 = getManifestStmts((XURI) xDMA);
+ !baseURI.equals(xDocMDAccess.getStringValue()));
+ Statement[] manifestStmts3 = getManifestStmts((XURI) xDocMDAccess);
xStmtsEnum = xRep.getStatements(null, null, null);
assertTrue("loadMetadataFromMedium (no metadata)",
eq(xStmtsEnum, manifestStmts3));
- xDMA.loadMetadataFromMedium(args);
- xRep = xRS.getRDFRepository();
+ xDocMDAccess.loadMetadataFromMedium(args);
+ xRep = xRepoSupplier.getRDFRepository();
assertTrue("xRep null", null != xRep);
- Statement[] manifestStmts4 = getManifestStmts((XURI) xDMA);
- Statement[] metadataStmts4 = getMetadataFileStmts((XURI) xDMA,
+ Statement[] manifestStmts4 = getManifestStmts((XURI) xDocMDAccess);
+ Statement[] metadataStmts4 = getMetadataFileStmts((XURI) xDocMDAccess,
fooBarPath);
xStmtsEnum = xRep.getStatements(null, null, null);
assertTrue("some graph(s) not reloaded",
graphs.length == xRep.getGraphNames().length);
- XURI xFoobar4 = URI.createNS(xContext, xDMA.getStringValue(),
+ XURI xFoobar4 = URI.createNS(xContext, xDocMDAccess.getStringValue(),
fooBarPath);
Statement xFoobar_FooBarFoo4 =
new Statement(foo, bar, foo, xFoobar4);
@@ -572,7 +589,7 @@ public class DocumentMetadataAccessTest
String f = tempDir + "TESTPARA.odt";
- XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xRS);
+ XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xRepoSupplier);
xStor.storeToURL(f, new PropertyValue[0]);
@@ -656,17 +673,17 @@ public class DocumentMetadataAccessTest
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "Hidden";
- loadProps[0].Value = new Boolean(true);
+ loadProps[0].Value = true;
xComp = util.DesktopTools.loadDoc(xMSF, file, loadProps);
- XRepositorySupplier xRS = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
- assertTrue("xRS null", null != xRS);
+ XRepositorySupplier xRepoSupplier = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp);
+ assertTrue("xRS null", null != xRepoSupplier);
- XDocumentRepository xRep = UnoRuntime.queryInterface(XDocumentRepository.class, xRS.getRDFRepository());
- assertTrue("xRep null", null != xRep);
+ XDocumentRepository xDocRepository = UnoRuntime.queryInterface(XDocumentRepository.class, xRepoSupplier.getRDFRepository());
+ assertTrue("xRep null", null != xDocRepository);
XTextDocument xTextDoc = UnoRuntime.queryInterface(XTextDocument.class, xComp);
@@ -684,7 +701,7 @@ public class DocumentMetadataAccessTest
Statement x_FooBarLit1 = new Statement(foo, bar, mkLit("1"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 1",
!result.Second &&
eq(result.First, new Statement[] {
@@ -693,7 +710,7 @@ public class DocumentMetadataAccessTest
Statement x_FooBarLit2 = new Statement(foo, bar, mkLit("2"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 2",
!result.Second &&
eq(result.First, new Statement[] {
@@ -703,7 +720,7 @@ public class DocumentMetadataAccessTest
Statement x_BlankBarLit3 =
new Statement(blank1, bar, mkLit("3"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 3",
!result.Second &&
eq(result.First, new Statement[] {
@@ -714,7 +731,7 @@ public class DocumentMetadataAccessTest
Statement x_BlankBarLit4 =
new Statement(blank2, bar, mkLit("4"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 4",
!result.Second &&
eq(result.First, new Statement[] {
@@ -725,7 +742,7 @@ public class DocumentMetadataAccessTest
Statement x_BlankBarLit5 =
new Statement(blank1, bar, mkLit("5"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 5",
!result.Second &&
eq(result.First, new Statement[] {
@@ -741,7 +758,7 @@ public class DocumentMetadataAccessTest
Statement x_FooBarLit6 = new Statement(foo, bar, mkLit("6"), null);
Statement x_FooBazLit6 = new Statement(foo, baz, mkLit("6"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 6",
!result.Second &&
eq(result.First, new Statement[] {
@@ -752,7 +769,7 @@ public class DocumentMetadataAccessTest
Statement x_FooBazLit7 = new Statement(foo, baz, mkLit("7"), null);
Statement x_FooFooLit7 = new Statement(foo, foo, mkLit("7"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 7",
!result.Second &&
eq(result.First, new Statement[] {
@@ -765,7 +782,7 @@ public class DocumentMetadataAccessTest
Statement x_FooBarLittype = new Statement(foo, bar, lit_type, null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 8",
result.Second &&
eq(result.First, new Statement[] {
@@ -773,7 +790,7 @@ public class DocumentMetadataAccessTest
}));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 9",
result.Second &&
eq(result.First, new Statement[] {
@@ -781,7 +798,7 @@ public class DocumentMetadataAccessTest
}));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 10",
result.Second &&
eq(result.First, new Statement[] {
@@ -791,7 +808,7 @@ public class DocumentMetadataAccessTest
Statement x_FooBarLit11
= new Statement(foo, bar, mkLit("11", bar), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 11",
!result.Second &&
eq(result.First, new Statement[] {
@@ -802,7 +819,7 @@ public class DocumentMetadataAccessTest
Statement x_FileBarLit12 =
new Statement(xFile, bar, mkLit("12"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 12",
!result.Second &&
eq(result.First, new Statement[] {
@@ -810,7 +827,7 @@ public class DocumentMetadataAccessTest
}));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 13",
result.Second &&
eq(result.First, new Statement[] {
@@ -820,7 +837,7 @@ public class DocumentMetadataAccessTest
Statement x_FooLabelLit14 =
new Statement(foo, rdfs_label, mkLit("14"), null);
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 14",
result.Second &&
eq(result.First, new Statement[] {
@@ -828,33 +845,33 @@ public class DocumentMetadataAccessTest
}));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 15", eq(result.First, new Statement[] { } ));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 16", eq(result.First, new Statement[] { } ));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 17", eq(result.First, new Statement[] { } ));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 18", eq(result.First, new Statement[] { } ));
xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 19", eq(result.First, new Statement[] { } ));
xPara = UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 20", eq(result.First, new Statement[] { } ));
xPara = UnoRuntime.queryInterface(
XMetadatable.class, xEnum.nextElement());
- result = xRep.getStatementRDFa(xPara);
+ result = xDocRepository.getStatementRDFa(xPara);
assertTrue("RDFa: 21", eq(result.First, new Statement[] { } ));
System.out.println("...done");
@@ -889,7 +906,7 @@ public class DocumentMetadataAccessTest
public void report(Exception e) {
System.out.println("Exception occurred:");
- e.printStackTrace();
+ e.printStackTrace(System.out);
report2(e);
fail();
}
@@ -1275,14 +1292,18 @@ public class DocumentMetadataAccessTest
// setup and close connections
@BeforeClass public static void setUpConnection() throws Exception {
- System.out.println("setUpConnection()");
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "starting class: " + DocumentMetadataAccess.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.setUp();
}
@AfterClass public static void tearDownConnection()
throws InterruptedException, com.sun.star.uno.Exception
{
- System.out.println("tearDownConnection() DocumentMetadataAccessTest");
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "finishing class: " + DocumentMetadataAccess.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.tearDown();
}
diff --git a/sfx2/qa/complex/framework/DocumentPropertiesTest.java b/sfx2/qa/complex/sfx2/DocumentProperties.java
index 20a0746c8322..01ccaa21619b 100644
--- a/sfx2/qa/complex/framework/DocumentPropertiesTest.java
+++ b/sfx2/qa/complex/sfx2/DocumentProperties.java
@@ -25,9 +25,10 @@
*
************************************************************************/
-package complex.framework;
+package complex.sfx2;
+import complex.sfx2.tools.TestDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.lang.XInitialization;
@@ -53,7 +54,6 @@ import com.sun.star.document.XDocumentProperties;
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;
@@ -66,12 +66,8 @@ import static org.junit.Assert.*;
*
* @author mst
*/
-public class DocumentPropertiesTest
+public class DocumentProperties
{
-// public String[] getTestMethodNames () {
-// return new String[] { "check", "cleanup" };
-// }
-
@After public void cleanup() {
// nothing to do
}
@@ -80,7 +76,7 @@ public class DocumentPropertiesTest
class Listener implements XModifyListener {
private boolean m_Called;
- public Listener() {
+ Listener() {
m_Called = false;
}
@@ -235,8 +231,7 @@ public class DocumentPropertiesTest
new NamedValue("PageCount", new Integer(1))));
XPropertyContainer udpc = xDP.getUserDefinedProperties();
- XPropertySet udps = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, udpc);
+ XPropertySet udps = UnoRuntime.queryInterface( XPropertySet.class, udpc );
assertTrue("UserDefined 1", "Dies ist ein wichtiger Hinweis"
.equals(udps.getPropertyValue("Hinweis")));
assertTrue("UserDefined 2", ("Kann Spuren von N"
@@ -366,8 +361,7 @@ public class DocumentPropertiesTest
dur.Seconds = 555;
dur.MilliSeconds = 444;
- udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE,
- new Boolean(b));
+ udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE, b);
udpc.addProperty("FrobDuration", PropertyAttribute.REMOVEABLE, dur);
udpc.addProperty("FrobDuration2", PropertyAttribute.REMOVEABLE, t);
udpc.addProperty("FrobEndDate", PropertyAttribute.REMOVEABLE, date);
@@ -433,8 +427,7 @@ public class DocumentPropertiesTest
System.out.println("Checking user-defined meta-data from stored file...");
udpc = xDP.getUserDefinedProperties();
- udps = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, udpc);
+ udps = UnoRuntime.queryInterface( XPropertySet.class, udpc );
assertTrue("UserDefined bool", new Boolean(b).equals(
udps.getPropertyValue("Frobnicate")));
@@ -467,8 +460,7 @@ public class DocumentPropertiesTest
System.out.println("Checking notification listener interface...");
Listener listener = new Listener();
- XModifyBroadcaster xMB = (XModifyBroadcaster)
- UnoRuntime.queryInterface(XModifyBroadcaster.class, xDP);
+ XModifyBroadcaster xMB = UnoRuntime.queryInterface( XModifyBroadcaster.class, xDP );
xMB.addModifyListener(listener);
xDP.setAuthor("not me");
assertTrue("Listener Author", listener.reset());
@@ -542,20 +534,24 @@ public class DocumentPropertiesTest
private XMultiServiceFactory getMSF()
{
- final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ 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()");
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "starting class: " + DocumentProperties.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.setUp();
}
@AfterClass public static void tearDownConnection()
throws InterruptedException, com.sun.star.uno.Exception
{
- System.out.println("tearDownConnection() DocumentPropertiesTest");
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "finishing class: " + DocumentProperties.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.tearDown();
}
diff --git a/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java b/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java
index c6dc073095b1..41bd66ccb5b9 100644
--- a/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java
+++ b/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java
@@ -24,7 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.framework;
+package complex.sfx2;
import com.sun.star.awt.XWindow;
import com.sun.star.document.XEventBroadcaster;
@@ -33,7 +33,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sheet.XSpreadsheetDocument;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
-import complex.framework.DocHelper.WriterHelper;
+import complex.sfx2.tools.WriterHelper;
import java.util.ArrayList;
@@ -53,7 +53,7 @@ import static org.junit.Assert.*;
* it will add an XEventListener and verify the Events
* raised when opening/changing and closing Office Documents
*/
-public class CheckGlobalEventBroadcaster_writer1 {
+public class GlobalEventBroadcaster {
XMultiServiceFactory m_xMSF = null;
XEventBroadcaster m_xEventBroadcaster = null;
ArrayList notifyEvents = new ArrayList();
@@ -61,12 +61,6 @@ public class CheckGlobalEventBroadcaster_writer1 {
XSpreadsheetDocument xSheetDoc;
XEventListener m_xEventListener = new EventListenerImpl();
-// public String[] getTestMethodNames() {
-// return new String[] {
-// "initialize", "checkWriter", "cleanup"
-// };
-// }
-
@Before public void initialize() {
m_xMSF = getMSF();
System.out.println("check wether there is a valid MultiServiceFactory");
@@ -79,7 +73,6 @@ public class CheckGlobalEventBroadcaster_writer1 {
"Create an instance of com.sun.star.frame.GlobalEventBroadcaster");
Object GlobalEventBroadcaster = null;
- Object dispatcher = null;
try {
GlobalEventBroadcaster = m_xMSF.createInstance(
@@ -116,7 +109,6 @@ public class CheckGlobalEventBroadcaster_writer1 {
WriterHelper wHelper = new WriterHelper(m_xMSF);
String[] expected;
- boolean locRes = true;
System.out.println("opening an empty writer doc");
notifyEvents.clear();
{
diff --git a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java b/sfx2/qa/complex/sfx2/StandaloneDocumentInfo.java
index 29fcaba8cb7a..1e9cbb1f4738 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java
+++ b/sfx2/qa/complex/sfx2/StandaloneDocumentInfo.java
@@ -24,10 +24,12 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.standalonedocumentinfo;
+package complex.sfx2;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
+import complex.sfx2.standalonedocinfo.StandaloneDocumentInfoTest;
+import complex.sfx2.standalonedocinfo.Test01;
import org.junit.After;
import org.junit.AfterClass;
@@ -40,18 +42,9 @@ import static org.junit.Assert.*;
/* Document here
*/
-public class StandaloneDocumentInfoUnitTest {
+public class StandaloneDocumentInfo {
private XMultiServiceFactory m_xMSF = null;
-// public String[] getTestMethodNames() {
-// return new String[] {
-// "ExecuteTest01"};
-// }
-
-// public String[] getTestObjectNames() {
-// return new String[] {"StandaloneDocumentInfoUnitTest"};
-// }
-
@Before public void before() {
try {
m_xMSF = getMSF();
@@ -82,15 +75,20 @@ public class StandaloneDocumentInfoUnitTest {
}
// setup and close connections
- @BeforeClass public static void setUpConnection() throws Exception {
- System.out.println("setUpConnection()");
+ @BeforeClass public static void setUpConnection() throws Exception
+ {
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "starting class: " + StandaloneDocumentInfo.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.setUp();
}
@AfterClass public static void tearDownConnection()
throws InterruptedException, com.sun.star.uno.Exception
{
- System.out.println("tearDownConnection()");
+ System.out.println( "------------------------------------------------------------" );
+ System.out.println( "finishing class: " + StandaloneDocumentInfo.class.getName() );
+ System.out.println( "------------------------------------------------------------" );
connection.tearDown();
}
diff --git a/sfx2/qa/complex/sfx2/UndoManager.java b/sfx2/qa/complex/sfx2/UndoManager.java
new file mode 100755
index 000000000000..ab1b9de910b8
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/UndoManager.java
@@ -0,0 +1,1464 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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.sfx2;
+
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleAction;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.container.XChild;
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.container.XNameReplace;
+import com.sun.star.container.XSet;
+import com.sun.star.document.EmptyUndoStackException;
+import com.sun.star.document.UndoContextNotClosedException;
+import com.sun.star.document.UndoFailedException;
+import com.sun.star.document.UndoManagerEvent;
+import com.sun.star.document.XEmbeddedScripts;
+import com.sun.star.document.XEventsSupplier;
+import com.sun.star.document.XUndoAction;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import com.sun.star.lang.XEventListener;
+import java.lang.reflect.InvocationTargetException;
+import org.openoffice.test.tools.OfficeDocument;
+import com.sun.star.document.XUndoManagerSupplier;
+import com.sun.star.document.XUndoManager;
+import com.sun.star.document.XUndoManagerListener;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XSingleComponentFactory;
+import com.sun.star.lang.XTypeProvider;
+import com.sun.star.script.ScriptEventDescriptor;
+import com.sun.star.script.XEventAttacherManager;
+import com.sun.star.script.XLibraryContainer;
+import com.sun.star.task.XJob;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.util.InvalidStateException;
+import com.sun.star.util.NotLockedException;
+import com.sun.star.view.XControlAccess;
+import complex.sfx2.undo.CalcDocumentTest;
+import complex.sfx2.undo.ChartDocumentTest;
+import complex.sfx2.undo.DocumentTest;
+import complex.sfx2.undo.DrawDocumentTest;
+import complex.sfx2.undo.ImpressDocumentTest;
+import complex.sfx2.undo.WriterDocumentTest;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Stack;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.openoffice.test.OfficeConnection;
+import org.openoffice.test.tools.DocumentType;
+import org.openoffice.test.tools.SpreadsheetDocument;
+
+/**
+ * Unit test for the UndoManager API
+ *
+ * @author frank.schoenheit@oracle.com
+ */
+public class UndoManager
+{
+ // -----------------------------------------------------------------------------------------------------------------
+ @Before
+ public void beforeTest() throws com.sun.star.uno.Exception
+ {
+ m_currentTestCase = null;
+ m_currentDocument = null;
+ m_undoListener = null;
+
+ // at our service factory, insert a new factory for our CallbackComponent
+ // this will allow the Basic code in our test documents to call back into this test case
+ // here, by just instantiating this service
+ final XSet globalFactory = UnoRuntime.queryInterface( XSet.class, getORB() );
+ m_callbackFactory = new CallbackComponentFactory();
+ globalFactory.insert( m_callbackFactory );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkWriterUndo() throws Exception
+ {
+ m_currentTestCase = new WriterDocumentTest( getORB() );
+ impl_checkUndo();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkCalcUndo() throws Exception
+ {
+ m_currentTestCase = new CalcDocumentTest( getORB() );
+ impl_checkUndo();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkDrawUndo() throws Exception
+ {
+ m_currentTestCase = new DrawDocumentTest( getORB() );
+ impl_checkUndo();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkImpressUndo() throws Exception
+ {
+ m_currentTestCase = new ImpressDocumentTest( getORB() );
+ impl_checkUndo();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkChartUndo() throws Exception
+ {
+ m_currentTestCase = new ChartDocumentTest( getORB() );
+ impl_checkUndo();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkBrokenScripts() throws com.sun.star.uno.Exception, InterruptedException
+ {
+ System.out.println( "testing: broken scripts" );
+
+ m_currentDocument = OfficeDocument.blankDocument( getORB(), DocumentType.CALC );
+ m_undoListener = new UndoListener();
+ getUndoManager().addUndoManagerListener( m_undoListener );
+
+ impl_setupBrokenBasicScript();
+ final String scriptURI = "vnd.sun.star.script:default.callbacks.brokenScript?language=Basic&location=document";
+
+ // .............................................................................................................
+ // scenario 1: Pressing a button which is bound to execute the script
+ // (This is one of the many cases where SfxObjectShell::CallXScript is invoked)
+
+ // set up the button
+ final XPropertySet buttonModel = impl_setupButton();
+ buttonModel.setPropertyValue( "Label", "exec broken script" );
+ impl_assignScript( buttonModel, "XActionListener", "actionPerformed",
+ scriptURI );
+
+ // switch the doc's view to form alive mode (so the button will actually work)
+ m_currentDocument.getCurrentView().dispatch( ".uno:SwitchControlDesignMode" );
+
+ // click the button
+ m_callbackCalled = false;
+ impl_clickButton( buttonModel );
+ // the macro is executed asynchronously by the button, so wait at most 2 seconds for the callback to be
+ // triggered
+ impl_waitFor( m_callbackCondition, 2000 );
+ // check the callback has actually been called
+ assertTrue( "clicking the test button did not work as expected - basic script not called", m_callbackCalled );
+
+ // again, since the script is executed asynchronously, we might arrive here while its execution
+ // is not completely finished. Give OOo another (at most) 2 seconds to finish it.
+ m_undoListener.waitForAllContextsClosed( 20000 );
+ // assure that the Undo Context Depth of the doc is still "0": The Basic script entered such a
+ // context, and didn't close it (thus it is broken), but the application framework should have
+ // auto-closed the context after the macro finished.
+ assertEquals( "undo context was not auto-closed as expected", 0, m_undoListener.getCurrentUndoContextDepth() );
+
+ // .............................................................................................................
+ // scenario 2: dispatching the script URL. Technically, this is equivalent to configuring the
+ // script into a menu or toolbar, and selecting the respective menu/toolbar item
+ m_callbackCalled = false;
+ m_currentDocument.getCurrentView().dispatch( scriptURI );
+ assertTrue( "dispatching the Script URL did not work as expected - basic script not called", m_callbackCalled );
+ // same as above: The script didn't close the context, but the OOo framework should have
+ assertEquals( "undo context was not auto-closed as expected", 0, m_undoListener.getCurrentUndoContextDepth() );
+
+ // .............................................................................................................
+ // scenario 3: assigning the script to some document event, and triggering this event
+ final XEventsSupplier eventSupplier = UnoRuntime.queryInterface( XEventsSupplier.class, m_currentDocument.getDocument() );
+ final XNameReplace events = UnoRuntime.queryInterface( XNameReplace.class, eventSupplier.getEvents() );
+ final NamedValue[] scriptDescriptor = new NamedValue[] {
+ new NamedValue( "EventType", "Script" ),
+ new NamedValue( "Script", scriptURI )
+ };
+ events.replaceByName( "OnViewCreated", scriptDescriptor );
+
+ // The below doesn't work: event notification is broken in m96, see http://www.openoffice.org/issues/show_bug.cgi?id=116313
+/* m_callbackCalled = false;
+ m_currentDocument.getCurrentView().dispatch( ".uno:NewWindow" );
+ assertTrue( "triggering an event did not work as expected - basic script not called", m_callbackCalled );
+ // same as above: The script didn't close the context, but the OOo framework should have
+ assertEquals( "undo context was not auto-closed as expected", 0, m_undoListener.getCurrentUndoContextDepth() );
+ */
+
+ // .............................................................................................................
+ // scenario 4: let the script enter an Undo context, but not close it, as usual.
+ // Additionally, let the script close the document - the OOo framework code which cares for
+ // auto-closing of Undo contexts should survive this, ideally ...
+ m_closeAfterCallback = true;
+ m_callbackCalled = false;
+ m_currentDocument.getCurrentView().dispatch( scriptURI );
+ assertTrue( m_callbackCalled );
+ assertTrue( "The Basic script should have closed the document.", m_undoListener.isDisposed() );
+ m_currentDocument = null;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void checkSerialization() throws com.sun.star.uno.Exception, InterruptedException
+ {
+ System.out.println( "testing: request serialization" );
+
+ m_currentDocument = OfficeDocument.blankDocument( getORB(), DocumentType.CALC );
+ final XUndoManager undoManager = getUndoManager();
+
+ final int threadCount = 10;
+ final int actionsPerThread = 10;
+ final int actionCount = threadCount * actionsPerThread;
+
+ // add some actions to the UndoManager, each knowing its position on the stack
+ final Object lock = new Object();
+ final Integer actionsUndone[] = new Integer[] { 0 };
+ for ( int i=actionCount; i>0; )
+ undoManager.addUndoAction( new CountingUndoAction( --i, lock, actionsUndone ) );
+
+ // some concurrent threads which undo the actions
+ Thread[] threads = new Thread[threadCount];
+ for ( int i=0; i<threadCount; ++i )
+ {
+ threads[i] = new Thread()
+ {
+ @Override
+ public void run()
+ {
+ for ( int j=0; j<actionsPerThread; ++j )
+ {
+ try { undoManager.undo(); }
+ catch ( final Exception e )
+ {
+ fail( "Those dummy actions are not expected to fail." );
+ return;
+ }
+ }
+ }
+ };
+ }
+
+ // start the threads
+ for ( int i=0; i<threadCount; ++i )
+ threads[i].start();
+
+ // wait for them to be finished
+ for ( int i=0; i<threadCount; ++i )
+ threads[i].join();
+
+ // ensure all actions have been undone
+ assertEquals( "not all actions have been undone", actionCount, actionsUndone[0].intValue() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @After
+ public void afterTest()
+ {
+ if ( m_currentTestCase != null )
+ m_currentTestCase.closeDocument();
+ else if ( m_currentDocument != null )
+ m_currentDocument.close();
+ m_currentTestCase = null;
+ m_currentDocument = null;
+ m_callbackFactory.dispose();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ /**
+ * returns the undo manager belonging to a given document
+ * @return
+ */
+ private XUndoManager getUndoManager()
+ {
+ final XUndoManagerSupplier suppUndo = UnoRuntime.queryInterface( XUndoManagerSupplier.class, m_currentDocument.getDocument() );
+ final XUndoManager undoManager = suppUndo.getUndoManager();
+ assertTrue( UnoRuntime.areSame( undoManager.getParent(), m_currentDocument.getDocument() ) );
+ return undoManager;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_waitFor( final Object i_condition, final int i_milliSeconds ) throws InterruptedException
+ {
+ synchronized( i_condition )
+ {
+ i_condition.wait( i_milliSeconds );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_setupBrokenBasicScript()
+ {
+ try
+ {
+ final XEmbeddedScripts embeddedScripts = UnoRuntime.queryInterface( XEmbeddedScripts.class, m_currentDocument.getDocument() );
+ final XLibraryContainer basicLibs = embeddedScripts.getBasicLibraries();
+ final XNameContainer basicLib = basicLibs.createLibrary( "default" );
+
+ final String brokenScriptCode =
+ "Option Explicit\n" +
+ "\n" +
+ "Sub brokenScript\n" +
+ " Dim callback as Object\n" +
+ " ThisComponent.UndoManager.enterUndoContext( \"" + getCallbackUndoContextTitle() + "\" )\n" +
+ "\n" +
+ " callback = createUnoService( \"" + getCallbackComponentServiceName() + "\" )\n" +
+ " Dim emptyArgs() as new com.sun.star.beans.NamedValue\n" +
+ " Dim result as String\n" +
+ " result = callback.execute( emptyArgs() )\n" +
+ " If result = \"close\" Then\n" +
+ " ThisComponent.close( TRUE )\n" +
+ " End If\n" +
+ "End Sub\n" +
+ "\n";
+
+ basicLib.insertByName( "callbacks", brokenScriptCode );
+ }
+ catch( com.sun.star.uno.Exception e )
+ {
+ fail( "caught an exception while setting up the script: " + e.toString() );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private XPropertySet impl_setupButton() throws com.sun.star.uno.Exception
+ {
+ // let the document create a shape
+ final XMultiServiceFactory docAsFactory = UnoRuntime.queryInterface( XMultiServiceFactory.class,
+ m_currentDocument.getDocument() );
+ final XControlShape xShape = UnoRuntime.queryInterface( XControlShape.class,
+ docAsFactory.createInstance( "com.sun.star.drawing.ControlShape" ) );
+
+ // position and size of the shape
+ xShape.setSize( new Size( 28 * 100, 10 * 100 ) );
+ xShape.setPosition( new Point( 10 * 100, 10 * 100 ) );
+
+ // create the form component (the model of a form control)
+ final String sQualifiedComponentName = "com.sun.star.form.component.CommandButton";
+ final XControlModel controlModel = UnoRuntime.queryInterface( XControlModel.class,
+ getORB().createInstance( sQualifiedComponentName ) );
+
+ // knitt both
+ xShape.setControl( controlModel );
+
+ // add the shape to the shapes collection of the document
+ SpreadsheetDocument spreadsheetDoc = (SpreadsheetDocument)m_currentDocument;
+ final XDrawPageSupplier suppDrawPage = UnoRuntime.queryInterface( XDrawPageSupplier.class,
+ spreadsheetDoc.getSheet( 0 ) );
+ final XDrawPage insertIntoPage = suppDrawPage.getDrawPage();
+
+ final XShapes sheetShapes = UnoRuntime.queryInterface( XShapes.class, insertIntoPage );
+ sheetShapes.add( xShape );
+
+ return UnoRuntime.queryInterface( XPropertySet.class, controlModel );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assignScript( final XPropertySet i_controlModel, final String i_interfaceName,
+ final String i_interfaceMethod, final String i_scriptURI )
+ {
+ try
+ {
+ final XChild modelAsChild = UnoRuntime.queryInterface( XChild.class, i_controlModel );
+ final XIndexContainer parentForm = UnoRuntime.queryInterface( XIndexContainer.class, modelAsChild.getParent() );
+
+ final XEventAttacherManager manager = UnoRuntime.queryInterface( XEventAttacherManager.class, parentForm );
+
+ int containerPosition = -1;
+ for ( int i = 0; i < parentForm.getCount(); ++i )
+ {
+ final XPropertySet child = UnoRuntime.queryInterface( XPropertySet.class, parentForm.getByIndex( i ) );
+ if ( UnoRuntime.areSame( child, i_controlModel ) )
+ {
+ containerPosition = i;
+ break;
+ }
+ }
+ assertFalse( "could not find the given control model within its parent", containerPosition == -1 );
+ manager.registerScriptEvent( containerPosition, new ScriptEventDescriptor(
+ i_interfaceName,
+ i_interfaceMethod,
+ "",
+ "Script",
+ i_scriptURI
+ ) );
+ }
+ catch( com.sun.star.uno.Exception e )
+ {
+ fail( "caught an exception while assigning the script event to the button: " + e.toString() );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_clickButton( final XPropertySet i_buttonModel ) throws NoSuchElementException, IndexOutOfBoundsException
+ {
+ final XControlAccess controlAccess = UnoRuntime.queryInterface( XControlAccess.class,
+ m_currentDocument.getCurrentView().getController() );
+ final XControl control = controlAccess.getControl( UnoRuntime.queryInterface( XControlModel.class, i_buttonModel ) );
+ final XAccessible accessible = UnoRuntime.queryInterface( XAccessible.class, control );
+ final XAccessibleAction controlActions = UnoRuntime.queryInterface( XAccessibleAction.class, accessible.getAccessibleContext() );
+ for ( int i=0; i<controlActions.getAccessibleActionCount(); ++i )
+ {
+ if ( controlActions.getAccessibleActionDescription(i).equals( "click" ) )
+ {
+ controlActions.doAccessibleAction(i);
+ return;
+ }
+ }
+ fail( "did not find the accessible action named 'click'" );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static class UndoListener implements XUndoManagerListener
+ {
+ public void undoActionAdded( UndoManagerEvent i_event )
+ {
+ assertFalse( "|undoActionAdded| called after document was disposed", m_isDisposed );
+
+ ++m_undoActionsAdded;
+ m_mostRecentlyAddedAction = i_event.UndoActionTitle;
+ }
+
+ public void actionUndone( UndoManagerEvent i_event )
+ {
+ assertFalse( "|actionUndone| called after document was disposed", m_isDisposed );
+
+ ++m_undoCount;
+ m_mostRecentlyUndone = i_event.UndoActionTitle;
+ }
+
+ public void actionRedone( UndoManagerEvent i_event )
+ {
+ assertFalse( "|actionRedone| called after document was disposed", m_isDisposed );
+
+ ++m_redoCount;
+ }
+
+ public void allActionsCleared( EventObject eo )
+ {
+ assertFalse( "|allActionsCleared| called after document was disposed", m_isDisposed );
+
+ m_wasCleared = true;
+ }
+
+ public void redoActionsCleared( EventObject eo )
+ {
+ assertFalse( "|redoActionsCleared| called after document was disposed", m_isDisposed );
+
+ m_redoWasCleared = true;
+ }
+
+ public void resetAll( EventObject i_event )
+ {
+ assertFalse( "|resetAll| called after document was disposed", m_isDisposed );
+
+ m_managerWasReset = true;
+ m_activeUndoContexts.clear();
+ }
+
+ public void enteredContext( UndoManagerEvent i_event )
+ {
+ assertFalse( "|enteredContext| called after document was disposed", m_isDisposed );
+
+ m_activeUndoContexts.push( i_event.UndoActionTitle );
+ assertEquals( "different opinions on the context nesting level (after entering)",
+ m_activeUndoContexts.size(), i_event.UndoContextDepth );
+ }
+
+ public void enteredHiddenContext( UndoManagerEvent i_event )
+ {
+ assertFalse( "|enteredHiddenContext| called after document was disposed", m_isDisposed );
+
+ m_activeUndoContexts.push( i_event.UndoActionTitle );
+ assertEquals( "different opinions on the context nesting level (after entering hidden)",
+ m_activeUndoContexts.size(), i_event.UndoContextDepth );
+ }
+
+ public void leftContext( UndoManagerEvent i_event )
+ {
+ assertFalse( "|leftContext| called after document was disposed", m_isDisposed );
+
+ assertEquals( "nested undo context descriptions do not match", m_activeUndoContexts.pop(), i_event.UndoActionTitle );
+ assertEquals( "different opinions on the context nesting level (after leaving)",
+ m_activeUndoContexts.size(), i_event.UndoContextDepth );
+ m_leftContext = true;
+ impl_notifyContextDepth();
+ }
+
+ public void leftHiddenContext( UndoManagerEvent i_event )
+ {
+ assertFalse( "|leftHiddenContext| called after document was disposed", m_isDisposed );
+ assertEquals( "|leftHiddenContext| is not expected to notify an action title", 0, i_event.UndoActionTitle.length() );
+
+ m_activeUndoContexts.pop();
+ assertEquals( "different opinions on the context nesting level (after leaving)",
+ m_activeUndoContexts.size(), i_event.UndoContextDepth );
+ m_leftHiddenContext = true;
+ impl_notifyContextDepth();
+ }
+
+ public void cancelledContext( UndoManagerEvent i_event )
+ {
+ assertFalse( "|cancelledContext| called after document was disposed", m_isDisposed );
+ assertEquals( "|cancelledContext| is not expected to notify an action title", 0, i_event.UndoActionTitle.length() );
+
+ m_activeUndoContexts.pop();
+ assertEquals( "different opinions on the context nesting level (after cancelling)",
+ m_activeUndoContexts.size(), i_event.UndoContextDepth );
+ m_cancelledContext = true;
+ impl_notifyContextDepth();
+ }
+
+ public void disposing( EventObject i_event )
+ {
+ m_isDisposed = true;
+ }
+
+ public void waitForAllContextsClosed( final int i_milliSeconds ) throws InterruptedException
+ {
+ synchronized ( m_allContextsClosedCondition )
+ {
+ if ( m_activeUndoContexts.empty() )
+ return;
+ m_allContextsClosedCondition.wait( i_milliSeconds );
+ }
+ }
+
+ private void impl_notifyContextDepth()
+ {
+ synchronized ( m_allContextsClosedCondition )
+ {
+ if ( m_activeUndoContexts.empty() )
+ {
+ m_allContextsClosedCondition.notifyAll();
+ }
+ }
+ }
+
+ private int getUndoActionsAdded() { return m_undoActionsAdded; }
+ private int getUndoActionCount() { return m_undoCount; }
+ private int getRedoActionCount() { return m_redoCount; }
+ private String getCurrentUndoContextTitle() { return m_activeUndoContexts.peek(); }
+ private String getMostRecentlyAddedActionTitle() { return m_mostRecentlyAddedAction; };
+ private String getMostRecentlyUndoneTitle() { return m_mostRecentlyUndone; }
+ private int getCurrentUndoContextDepth() { return m_activeUndoContexts.size(); }
+ private boolean isDisposed() { return m_isDisposed; }
+ private boolean wasContextLeft() { return m_leftContext; }
+ private boolean wasHiddenContextLeft() { return m_leftHiddenContext; }
+ private boolean hasContextBeenCancelled() { return m_cancelledContext; }
+ private boolean wereStacksCleared() { return m_wasCleared; }
+ private boolean wasRedoStackCleared() { return m_redoWasCleared; }
+ private boolean wasManagerReset() { return m_managerWasReset; }
+
+ void reset()
+ {
+ m_undoActionsAdded = m_undoCount = m_redoCount = 0;
+ m_activeUndoContexts.clear();
+ m_mostRecentlyAddedAction = m_mostRecentlyUndone = null;
+ // m_isDisposed is not cleared, intentionally
+ m_leftContext = m_leftHiddenContext = m_cancelledContext = m_wasCleared = m_redoWasCleared = m_managerWasReset = false;
+ }
+
+ private int m_undoActionsAdded = 0;
+ private int m_undoCount = 0;
+ private int m_redoCount = 0;
+ private boolean m_isDisposed = false;
+ private boolean m_leftContext = false;
+ private boolean m_leftHiddenContext = false;
+ private boolean m_cancelledContext = false;
+ private boolean m_wasCleared = false;
+ private boolean m_redoWasCleared = false;
+ private boolean m_managerWasReset = false;
+ private Stack< String >
+ m_activeUndoContexts = new Stack<String>();
+ private String m_mostRecentlyAddedAction = null;
+ private String m_mostRecentlyUndone = null;
+ private final Object m_allContextsClosedCondition = new Object();
+ };
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_checkUndo() throws Exception
+ {
+ System.out.println( "testing: " + m_currentTestCase.getDocumentDescription() );
+ m_currentDocument = m_currentTestCase.getDocument();
+ m_currentTestCase.initializeDocument();
+ m_currentTestCase.verifyInitialDocumentState();
+
+ final XUndoManager undoManager = getUndoManager();
+ undoManager.clear();
+ assertFalse( "clearing the Undo manager should result in the impossibility to undo anything", undoManager.isUndoPossible() );
+ assertFalse( "clearing the Undo manager should result in the impossibility to redo anything", undoManager.isRedoPossible() );
+
+ m_undoListener = new UndoListener();
+ undoManager.addUndoManagerListener( m_undoListener );
+
+ impl_testSingleModification( undoManager );
+ impl_testMultipleModifications( undoManager );
+ impl_testCustomUndoActions( undoManager );
+ impl_testLocking( undoManager );
+ impl_testNestedContexts( undoManager );
+ impl_testErrorHandling( undoManager );
+ impl_testContextHandling( undoManager );
+ impl_testStackHandling( undoManager );
+ impl_testClearance( undoManager );
+ impl_testHiddenContexts( undoManager );
+
+ // close the document, ensure the Undo manager listener gets notified
+ m_currentTestCase.closeDocument();
+ m_currentTestCase = null;
+ m_currentDocument = null;
+ assertTrue( "document is closed, but the UndoManagerListener has not been notified of the disposal", m_undoListener.isDisposed() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testSingleModification( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ m_currentTestCase.doSingleModification();
+ m_currentTestCase.verifySingleModificationDocumentState();
+
+ // undo the modification, ensure the listener got the proper notifications
+ assertEquals( "We did not yet do a undo!", 0, m_undoListener.getUndoActionCount() );
+ i_undoManager.undo();
+ assertEquals( "A simple undo does not result in the proper Undo count.",
+ 1, m_undoListener.getUndoActionCount() );
+
+ // verify the document is in its initial state, again
+ m_currentTestCase.verifyInitialDocumentState();
+
+ // redo the modification, ensure the listener got the proper notifications
+ assertEquals( "did not yet do a redo!", 0, m_undoListener.getRedoActionCount() );
+ i_undoManager.redo();
+ assertEquals( "did a redo, but got no notification of it!", 1, m_undoListener.getRedoActionCount() );
+ // ensure the document is in the proper state, again
+ m_currentTestCase.verifySingleModificationDocumentState();
+
+ // now do an Undo via the UI (aka the dispatch API), and see if this works, and notifies the listener as
+ // expected
+ m_currentTestCase.getDocument().getCurrentView().dispatch( ".uno:Undo" );
+ m_currentTestCase.verifyInitialDocumentState();
+ assertEquals( "UI-Undo does not notify the listener", 2, m_undoListener.getUndoActionCount() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testMultipleModifications( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ m_undoListener.reset();
+ assertEquals( "unexpected initial undo context depth", 0, m_undoListener.getCurrentUndoContextDepth() );
+ i_undoManager.enterUndoContext( "Batch Changes" );
+ assertEquals( "unexpected undo context depth after entering a context",
+ 1, m_undoListener.getCurrentUndoContextDepth() );
+ assertEquals( "entering an Undo context has not been notified properly",
+ "Batch Changes", m_undoListener.getCurrentUndoContextTitle() );
+
+ final int modifications = m_currentTestCase.doMultipleModifications();
+ assertEquals( "unexpected number of undo actions while doing batch changes to the document",
+ modifications, m_undoListener.getUndoActionsAdded() );
+ assertEquals( "seems the document operations touched the undo context depth",
+ 1, m_undoListener.getCurrentUndoContextDepth() );
+
+ i_undoManager.leaveUndoContext();
+ assertEquals( "unexpected undo context depth after leaving the last context",
+ 0, m_undoListener.getCurrentUndoContextDepth() );
+ assertEquals( "no Undo done, yet - still the listener has been notified of an Undo action",
+ 0, m_undoListener.getUndoActionCount() );
+
+ i_undoManager.undo();
+ assertEquals( "Just did an undo - the listener should have been notified", 1, m_undoListener.getUndoActionCount() );
+ m_currentTestCase.verifyInitialDocumentState();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testCustomUndoActions( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ i_undoManager.clear();
+ m_undoListener.reset();
+ assertFalse( "undo stack not empty after clearing the undo manager", i_undoManager.isUndoPossible() );
+ assertFalse( "redo stack not empty after clearing the undo manager", i_undoManager.isRedoPossible() );
+ assertArrayEquals( ">0 descriptions for an empty undo stack?",
+ new String[0], i_undoManager.getAllUndoActionTitles() );
+ assertArrayEquals( ">0 descriptions for an empty redo stack?",
+ new String[0], i_undoManager.getAllRedoActionTitles() );
+
+ // add two actions, one directly, one within a context
+ final CustomUndoAction action1 = new CustomUndoAction( "UndoAction1" );
+ i_undoManager.addUndoAction( action1 );
+ assertEquals( "Adding an undo action not observed by the listener", 1, m_undoListener.getUndoActionsAdded() );
+ assertEquals( "Adding an undo action did not notify the proper title",
+ action1.getTitle(), m_undoListener.getMostRecentlyAddedActionTitle() );
+ final String contextTitle = "Undo Context";
+ i_undoManager.enterUndoContext( contextTitle );
+ final CustomUndoAction action2 = new CustomUndoAction( "UndoAction2" );
+ i_undoManager.addUndoAction( action2 );
+ assertEquals( "Adding an undo action not observed by the listener",
+ 2, m_undoListener.getUndoActionsAdded() );
+ assertEquals( "Adding an undo action did not notify the proper title",
+ action2.getTitle(), m_undoListener.getMostRecentlyAddedActionTitle() );
+ i_undoManager.leaveUndoContext();
+
+ // see if the manager has proper descriptions
+ assertArrayEquals( "unexpected Redo descriptions after adding two actions",
+ new String[0], i_undoManager.getAllRedoActionTitles() );
+ assertArrayEquals( "unexpected Undo descriptions after adding two actions",
+ new String[]{contextTitle, action1.getTitle()}, i_undoManager.getAllUndoActionTitles() );
+
+ // undo one action
+ i_undoManager.undo();
+ assertEquals( "improper action title notified during programmatic Undo",
+ contextTitle, m_undoListener.getMostRecentlyUndoneTitle() );
+ assertTrue( "nested custom undo action has not been undone as expected", action2.undoCalled() );
+ assertFalse( "nested custom undo action has not been undone as expected", action1.undoCalled() );
+ assertArrayEquals( "unexpected Redo descriptions after undoing a nested custom action",
+ new String[]{contextTitle}, i_undoManager.getAllRedoActionTitles() );
+ assertArrayEquals( "unexpected Undo descriptions after undoing a nested custom action",
+ new String[]{action1.getTitle()}, i_undoManager.getAllUndoActionTitles() );
+
+ // undo the second action, via UI dispatches
+ m_currentTestCase.getDocument().getCurrentView().dispatch( ".uno:Undo" );
+ assertEquals( "improper action title notified during UI Undo", action1.getTitle(), m_undoListener.getMostRecentlyUndoneTitle() );
+ assertTrue( "nested custom undo action has not been undone as expected", action1.undoCalled() );
+ assertArrayEquals( "unexpected Redo descriptions after undoing the second custom action",
+ new String[]{action1.getTitle(), contextTitle}, i_undoManager.getAllRedoActionTitles() );
+ assertArrayEquals( "unexpected Undo descriptions after undoing the second custom action",
+ new String[0], i_undoManager.getAllUndoActionTitles() );
+
+ // check the actions are disposed when the stacks are cleared
+ i_undoManager.clear();
+ assertTrue( action1.disposed() && action2.disposed() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testLocking( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ i_undoManager.reset();
+ m_undoListener.reset();
+
+ // implicit Undo actions, triggered by changes to the document
+ assertFalse( "unexpected initial locking state", i_undoManager.isLocked() );
+ i_undoManager.lock();
+ assertTrue( "just locked the manager, why does it lie?", i_undoManager.isLocked() );
+ m_currentTestCase.doSingleModification();
+ assertEquals( "when the Undo manager is locked, no implicit additions should happen",
+ 0, m_undoListener.getUndoActionsAdded() );
+ i_undoManager.unlock();
+ assertEquals( "unlock is not expected to add collected actions - they should be discarded",
+ 0, m_undoListener.getUndoActionsAdded() );
+ assertFalse( "just unlocked the manager, why does it lie?", i_undoManager.isLocked() );
+
+ // explicit Undo actions
+ i_undoManager.lock();
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.unlock();
+ assertEquals( "explicit Undo actions are expected to be ignored when the manager is locked",
+ 0, m_undoListener.getUndoActionsAdded() );
+
+ // Undo contexts while being locked
+ i_undoManager.lock();
+ i_undoManager.enterUndoContext( "Dummy Context" );
+ i_undoManager.enterHiddenUndoContext();
+ assertEquals( "entering Undo contexts should be ignored when the manager is locked", 0, m_undoListener.getCurrentUndoContextDepth() );
+ i_undoManager.leaveUndoContext();
+ i_undoManager.leaveUndoContext();
+ i_undoManager.unlock();
+
+ // |unlock| error handling
+ assertFalse( "internal error: manager should not be locked at this point in time", i_undoManager.isLocked() );
+ boolean caughtExpected = false;
+ try { i_undoManager.unlock(); } catch ( final NotLockedException e ) { caughtExpected = true; }
+ assertTrue( "unlocking the manager when it is not locked should throw", caughtExpected );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testContextHandling( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ // .............................................................................................................
+ // part I: non-empty contexts
+ i_undoManager.reset();
+ m_undoListener.reset();
+
+ // put one action on the undo and one on the redo stack, as precondition for the following tests
+ final XUndoAction undoAction1 = new CustomUndoAction( "Undo Action 1" );
+ i_undoManager.addUndoAction( undoAction1 );
+ final XUndoAction undoAction2 = new CustomUndoAction( "Undo Action 2" );
+ i_undoManager.addUndoAction( undoAction2 );
+ i_undoManager.undo();
+ assertTrue( "precondition for context handling tests not met (1)", i_undoManager.isUndoPossible() );
+ assertTrue( "precondition for context handling tests not met (2)", i_undoManager.isRedoPossible() );
+ assertArrayEquals( new String[] { undoAction1.getTitle() }, i_undoManager.getAllUndoActionTitles() );
+ assertArrayEquals( new String[] { undoAction2.getTitle() }, i_undoManager.getAllRedoActionTitles() );
+
+ final String[] expectedRedoActionComments = new String[] { undoAction2.getTitle() };
+ assertArrayEquals( expectedRedoActionComments, i_undoManager.getAllRedoActionTitles() );
+
+ // enter a context
+ i_undoManager.enterUndoContext( "Undo Context" );
+ // this should not (yet) touch the redo stack
+ assertArrayEquals( expectedRedoActionComments, i_undoManager.getAllRedoActionTitles() );
+ assertEquals( "unexpected undo context depth after entering a context", 1, m_undoListener.getCurrentUndoContextDepth() );
+ // add a single action
+ XUndoAction undoAction3 = new CustomUndoAction( "Undo Action 3" );
+ i_undoManager.addUndoAction( undoAction3 );
+ // still, the redo stack should be untouched - added at a lower level does not affect it at all
+ assertArrayEquals( expectedRedoActionComments, i_undoManager.getAllRedoActionTitles() );
+
+ // while the context is open, its title should already contribute to the stack, ...
+ assertEquals( "Undo Context", i_undoManager.getCurrentUndoActionTitle() );
+ // ... getAllUndo/RedoActionTitles should operate on the top level, not on the level defined by the open
+ // context, ...
+ assertArrayEquals( new String[] { "Undo Context", undoAction1.getTitle() },
+ i_undoManager.getAllUndoActionTitles() );
+ // ... but Undo and Redo should be impossible as long as the context is open
+ assertFalse( i_undoManager.isUndoPossible() );
+ assertFalse( i_undoManager.isRedoPossible() );
+
+ // leave the context, check the listener has been notified properly, and the notified context depth is correct
+ i_undoManager.leaveUndoContext();
+ assertTrue( m_undoListener.wasContextLeft() );
+ assertFalse( m_undoListener.wasHiddenContextLeft() );
+ assertFalse( m_undoListener.hasContextBeenCancelled() );
+ assertEquals( "unexpected undo context depth leaving a non-empty context", 0, m_undoListener.getCurrentUndoContextDepth() );
+ // leaving a non-empty context should have cleare the redo stack
+ assertArrayEquals( new String[0], i_undoManager.getAllRedoActionTitles() );
+ assertTrue( m_undoListener.wasRedoStackCleared() );
+
+ // .............................................................................................................
+ // part II: empty contexts
+ i_undoManager.reset();
+ m_undoListener.reset();
+
+ // enter a context, leave it immediately without adding an action to it
+ i_undoManager.enterUndoContext( "Undo Context" );
+ i_undoManager.leaveUndoContext();
+ assertFalse( m_undoListener.wasContextLeft() );
+ assertFalse( m_undoListener.wasHiddenContextLeft() );
+ assertTrue( m_undoListener.hasContextBeenCancelled() );
+ assertFalse( "leaving an empty context should silently remove it, and not contribute to the stack",
+ i_undoManager.isUndoPossible() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testNestedContexts( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ i_undoManager.reset();
+ m_undoListener.reset();
+ i_undoManager.enterUndoContext( "context 1" );
+ i_undoManager.enterUndoContext( "context 1.1" );
+ final CustomUndoAction action1 = new CustomUndoAction( "action 1.1.1" );
+ i_undoManager.addUndoAction( action1 );
+ i_undoManager.enterUndoContext( "context 1.1.2" );
+ final CustomUndoAction action2 = new CustomUndoAction( "action 1.1.2.1" );
+ i_undoManager.addUndoAction( action2 );
+ i_undoManager.leaveUndoContext();
+ final CustomUndoAction action3 = new CustomUndoAction( "action 1.1.3" );
+ i_undoManager.addUndoAction( action3 );
+ i_undoManager.leaveUndoContext();
+ i_undoManager.leaveUndoContext();
+ final CustomUndoAction action4 = new CustomUndoAction( "action 1.2" );
+ i_undoManager.addUndoAction( action4 );
+
+ i_undoManager.undo();
+ assertEquals( "undoing a single action notifies a wrong title", action4.getTitle(), m_undoListener.getMostRecentlyUndoneTitle() );
+ assertTrue( "custom Undo not called", action4.undoCalled() );
+ assertFalse( "too many custom Undos called", action1.undoCalled() || action2.undoCalled() || action3.undoCalled() );
+ i_undoManager.undo();
+ assertTrue( "nested actions not properly undone", action1.undoCalled() && action2.undoCalled() && action3.undoCalled() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testErrorHandling( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ i_undoManager.reset();
+ m_undoListener.reset();
+
+ // try retrieving the comments for the current Undo/Redo - this should fail
+ boolean caughtExpected = false;
+ try { i_undoManager.getCurrentUndoActionTitle(); }
+ catch( final EmptyUndoStackException e ) { caughtExpected = true; }
+ assertTrue( "trying the title of the current Undo action is expected to fail for an empty stack", caughtExpected );
+
+ caughtExpected = false;
+ try { i_undoManager.getCurrentRedoActionTitle(); }
+ catch( final EmptyUndoStackException e ) { caughtExpected = true; }
+ assertTrue( "trying the title of the current Redo action is expected to fail for an empty stack", caughtExpected );
+
+ caughtExpected = false;
+ try { i_undoManager.undo(); } catch ( final EmptyUndoStackException e ) { caughtExpected = true; }
+ assertTrue( "undo should throw if no Undo action is on the stack", caughtExpected );
+
+ caughtExpected = false;
+ try { i_undoManager.redo(); } catch ( final EmptyUndoStackException e ) { caughtExpected = true; }
+ assertTrue( "redo should throw if no Redo action is on the stack", caughtExpected );
+
+ caughtExpected = false;
+ try { i_undoManager.leaveUndoContext(); } catch ( final InvalidStateException e ) { caughtExpected = true; }
+ assertTrue( "leaveUndoContext should throw if no context is currently open", caughtExpected );
+
+ caughtExpected = false;
+ try { i_undoManager.addUndoAction( null ); } catch ( com.sun.star.lang.IllegalArgumentException e ) { caughtExpected = true; }
+ assertTrue( "adding a NULL action should be rejected", caughtExpected );
+
+ i_undoManager.reset();
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.undo();
+ i_undoManager.enterUndoContext( "Undo Context" );
+ // those methods should fail when a context is open:
+ final String[] methodNames = new String[] { "undo", "redo", "clear", "clearRedo" };
+ for ( int i=0; i<methodNames.length; ++i )
+ {
+ caughtExpected = false;
+ try
+ {
+ Method method = i_undoManager.getClass().getMethod( methodNames[i], new Class[0] );
+ method.invoke( i_undoManager, new Object[0] );
+ }
+ catch ( IllegalAccessException ex ) { }
+ catch ( IllegalArgumentException ex ) { }
+ catch ( InvocationTargetException ex )
+ {
+ Throwable targetException = ex.getTargetException();
+ caughtExpected = ( targetException instanceof UndoContextNotClosedException );
+ }
+ catch ( NoSuchMethodException ex ) { }
+ catch ( SecurityException ex ) { }
+
+ assertTrue( methodNames[i] + " should be rejected when there is an open context", caughtExpected );
+ }
+ i_undoManager.leaveUndoContext();
+
+ // try Undo actions which fail in their Undo/Redo
+ for ( int i=0; i<4; ++i )
+ {
+ final boolean undo = ( i < 2 );
+ final boolean doByAPI = ( i % 2 ) == 0;
+
+ i_undoManager.reset();
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.addUndoAction( new FailingUndoAction( undo ? FAIL_UNDO : FAIL_REDO ) );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.undo();
+ if ( !undo )
+ i_undoManager.undo();
+ // assert preconditions for the below test
+ assertTrue( i_undoManager.isUndoPossible() );
+ assertTrue( i_undoManager.isRedoPossible() );
+
+ boolean caughtUndoFailed = false;
+ try
+ {
+ if ( undo )
+ if ( doByAPI )
+ i_undoManager.undo();
+ else
+ m_currentTestCase.getDocument().getCurrentView().dispatch( ".uno:Undo" );
+ else
+ if ( doByAPI )
+ i_undoManager.redo();
+ else
+ m_currentTestCase.getDocument().getCurrentView().dispatch( ".uno:Redo" );
+ }
+ catch ( UndoFailedException e )
+ {
+ caughtUndoFailed = true;
+ }
+ if ( doByAPI )
+ assertTrue( "Exceptions in XUndoAction.undo should be propagated at the API", caughtUndoFailed );
+ else
+ assertFalse( "Undo/Redo by UI should not let escape Exceptions", caughtUndoFailed );
+ if ( undo )
+ {
+ assertFalse( "a failing Undo should clear the Undo stack", i_undoManager.isUndoPossible() );
+ assertTrue( "a failing Undo should /not/ clear the Redo stack", i_undoManager.isRedoPossible() );
+ }
+ else
+ {
+ assertTrue( "a failing Redo should /not/ clear the Undo stack", i_undoManager.isUndoPossible() );
+ assertFalse( "a failing Redo should clear the Redo stack", i_undoManager.isRedoPossible() );
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testStackHandling( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ i_undoManager.reset();
+ m_undoListener.reset();
+
+ assertFalse( i_undoManager.isUndoPossible() );
+ assertFalse( i_undoManager.isRedoPossible() );
+
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ assertTrue( i_undoManager.isUndoPossible() );
+ assertFalse( i_undoManager.isRedoPossible() );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ assertTrue( i_undoManager.isUndoPossible() );
+ assertFalse( i_undoManager.isRedoPossible() );
+ i_undoManager.undo();
+ assertTrue( i_undoManager.isUndoPossible() );
+ assertTrue( i_undoManager.isRedoPossible() );
+ i_undoManager.undo();
+ assertFalse( i_undoManager.isUndoPossible() );
+ assertTrue( i_undoManager.isRedoPossible() );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ assertTrue( i_undoManager.isUndoPossible() );
+ assertFalse( "adding a new action should have cleared the Redo stack", i_undoManager.isRedoPossible() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testClearance( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ i_undoManager.reset();
+ m_undoListener.reset();
+
+ // add an action, clear the stack, verify the listener has been called
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ assertFalse( "clearance listener unexpectedly called", m_undoListener.wereStacksCleared() );
+ assertFalse( "redo-clearance listener unexpectedly called", m_undoListener.wasRedoStackCleared() );
+ i_undoManager.clear();
+ assertTrue( "clearance listener not called as expected", m_undoListener.wereStacksCleared() );
+ assertFalse( "redo-clearance listener unexpectedly called (2)", m_undoListener.wasRedoStackCleared() );
+
+ // ensure the listener is also called if the stack is actually empty at the moment of the call
+ m_undoListener.reset();
+ assertFalse( i_undoManager.isUndoPossible() );
+ i_undoManager.clear();
+ assertTrue( "clearance listener is also expected to be called if the stack was empty before", m_undoListener.wereStacksCleared() );
+
+ // ensure the proper listeners are called for clearRedo
+ m_undoListener.reset();
+ i_undoManager.clearRedo();
+ assertFalse( m_undoListener.wereStacksCleared() );
+ assertTrue( m_undoListener.wasRedoStackCleared() );
+
+ // ensure the redo listener is also called upon implicit redo stack clearance
+ m_undoListener.reset();
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.undo();
+ assertTrue( i_undoManager.isUndoPossible() );
+ assertTrue( i_undoManager.isRedoPossible() );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ assertFalse( i_undoManager.isRedoPossible() );
+ assertTrue( "implicit clearance of the Redo stack does not notify listeners", m_undoListener.wasRedoStackCleared() );
+
+ // test resetting the manager
+ m_undoListener.reset();
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.undo();
+ assertTrue( i_undoManager.isUndoPossible() );
+ assertTrue( i_undoManager.isRedoPossible() );
+ i_undoManager.reset();
+ assertFalse( i_undoManager.isUndoPossible() );
+ assertFalse( i_undoManager.isRedoPossible() );
+ assertTrue( "|reset| does not properly notify", m_undoListener.wasManagerReset() );
+
+ // resetting the manager, with open undo contexts
+ m_undoListener.reset();
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.enterUndoContext( "Undo Context" );
+ i_undoManager.addUndoAction( new CustomUndoAction() );
+ i_undoManager.enterHiddenUndoContext();
+ i_undoManager.reset();
+ assertTrue( "|reset| while contexts are open does not properly notify", m_undoListener.wasManagerReset() );
+ // verify the manager really has the proper context depth now
+ i_undoManager.enterUndoContext( "Undo Context" );
+ assertEquals( "seems that |reset| did not really close the open contexts", 1, m_undoListener.getCurrentUndoContextDepth() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_testHiddenContexts( final XUndoManager i_undoManager ) throws com.sun.star.uno.Exception
+ {
+ i_undoManager.reset();
+ m_undoListener.reset();
+ assertFalse( "precondition for testing hidden undo contexts not met", i_undoManager.isUndoPossible() );
+
+ // entering a hidden context should be rejected if the stack is empty
+ boolean caughtExpected = false;
+ try { i_undoManager.enterHiddenUndoContext(); }
+ catch ( final EmptyUndoStackException e ) { caughtExpected = true; }
+ assertTrue( "entering hidden contexts should be denied on an empty stack", caughtExpected );
+
+ // but it should be allowed if the context is not empty
+ final CustomUndoAction undoAction0 = new CustomUndoAction( "Step 0" );
+ i_undoManager.addUndoAction( undoAction0 );
+ final CustomUndoAction undoAction1 = new CustomUndoAction( "Step 1" );
+ i_undoManager.addUndoAction( undoAction1 );
+ i_undoManager.enterHiddenUndoContext();
+ final CustomUndoAction hiddenUndoAction = new CustomUndoAction( "hidden context action" );
+ i_undoManager.addUndoAction( hiddenUndoAction );
+ i_undoManager.leaveUndoContext();
+ assertFalse( "leaving a hidden should not call |leftUndocontext|", m_undoListener.wasContextLeft() );
+ assertTrue( "leaving a hidden does not call |leftHiddenUndocontext|", m_undoListener.wasHiddenContextLeft() );
+ assertFalse( "leaving a non-empty hidden context claims to have cancelled it", m_undoListener.hasContextBeenCancelled() );
+ assertEquals( "leaving a hidden context is not properly notified", 0, m_undoListener.getCurrentUndoContextDepth() );
+ assertArrayEquals( "unexpected Undo stack after leaving a hidden context",
+ new String[] { undoAction1.getTitle(), undoAction0.getTitle() },
+ i_undoManager.getAllUndoActionTitles() );
+
+ // and then calling |undo| once should not only undo everything in the hidden context, but also
+ // the previous action - but not more
+ i_undoManager.undo();
+ assertTrue( "Undo after leaving a hidden context does not actually undo the context actions",
+ hiddenUndoAction.undoCalled() );
+ assertTrue( "Undo after leaving a hidden context does not undo the predecessor action",
+ undoAction1.undoCalled() );
+ assertFalse( "Undo after leaving a hidden context undoes too much",
+ undoAction0.undoCalled() );
+
+ // leaving an empty hidden context should call the proper notification method
+ m_undoListener.reset();
+ i_undoManager.enterHiddenUndoContext();
+ i_undoManager.leaveUndoContext();
+ assertFalse( m_undoListener.wasContextLeft() );
+ assertFalse( m_undoListener.wasHiddenContextLeft() );
+ assertTrue( m_undoListener.hasContextBeenCancelled() );
+
+ // nesting hidden and normal contexts
+ m_undoListener.reset();
+ i_undoManager.reset();
+ final CustomUndoAction action0 = new CustomUndoAction( "action 0" );
+ i_undoManager.addUndoAction( action0 );
+ i_undoManager.enterUndoContext( "context 1" );
+ final CustomUndoAction action1 = new CustomUndoAction( "action 1" );
+ i_undoManager.addUndoAction( action1 );
+ i_undoManager.enterHiddenUndoContext();
+ final CustomUndoAction action2 = new CustomUndoAction( "action 2" );
+ i_undoManager.addUndoAction( action2 );
+ i_undoManager.enterUndoContext( "context 2" );
+ // is entering a hidden context rejected even at the nesting level > 0 (the above test was for nesting level == 0)?
+ caughtExpected = false;
+ try { i_undoManager.enterHiddenUndoContext(); }
+ catch( final EmptyUndoStackException e ) { caughtExpected = true; }
+ assertTrue( "at a nesting level > 0, denied hidden contexts does not work as expected", caughtExpected );
+ final CustomUndoAction action3 = new CustomUndoAction( "action 3" );
+ i_undoManager.addUndoAction( action3 );
+ i_undoManager.enterHiddenUndoContext();
+ assertEquals( "mixed hidden/normal context do are not properly notified", 4, m_undoListener.getCurrentUndoContextDepth() );
+ i_undoManager.leaveUndoContext();
+ assertTrue( "the left context was empty - why wasn't 'cancelled' notified?", m_undoListener.hasContextBeenCancelled() );
+ assertFalse( m_undoListener.wasContextLeft() );
+ assertFalse( m_undoListener.wasHiddenContextLeft() );
+ i_undoManager.leaveUndoContext();
+ i_undoManager.leaveUndoContext();
+ i_undoManager.leaveUndoContext();
+ i_undoManager.undo();
+ assertFalse( "one action too much has been undone", action0.undoCalled() );
+ assertTrue( action1.undoCalled() );
+ assertTrue( action2.undoCalled() );
+ assertTrue( action3.undoCalled() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private XComponentContext getContext()
+ {
+ return m_connection.getComponentContext();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private XMultiServiceFactory getORB()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, getContext().getServiceManager() );
+ return xMSF1;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println( "--------------------------------------------------------------------------------" );
+ System.out.println( "starting class: " + UndoManager.class.getName() );
+ System.out.println( "connecting ..." );
+ m_connection.setUp();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @AfterClass
+ public static void tearDownConnection() throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println();
+ System.out.println( "tearing down connection" );
+ m_connection.tearDown();
+ System.out.println( "finished class: " + UndoManager.class.getName() );
+ System.out.println( "--------------------------------------------------------------------------------" );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static class CustomUndoAction implements XUndoAction, XComponent
+ {
+ CustomUndoAction()
+ {
+ m_title = "Custom Undo Action";
+ }
+
+ CustomUndoAction( final String i_title )
+ {
+ m_title = i_title;
+ }
+
+ public String getTitle()
+ {
+ return m_title;
+ }
+
+ public void undo() throws UndoFailedException
+ {
+ m_undoCalled = true;
+ }
+
+ public void redo() throws UndoFailedException
+ {
+ m_redoCalled = true;
+ }
+
+ public void dispose()
+ {
+ m_disposed = true;
+ }
+
+ public void addEventListener( XEventListener xl )
+ {
+ fail( "addEventListener is not expected to be called in the course of this test" );
+ }
+
+ public void removeEventListener( XEventListener xl )
+ {
+ fail( "removeEventListener is not expected to be called in the course of this test" );
+ }
+
+ boolean undoCalled() { return m_undoCalled; }
+ boolean redoCalled() { return m_redoCalled; }
+ boolean disposed() { return m_disposed; }
+
+ private final String m_title;
+ private boolean m_undoCalled = false;
+ private boolean m_redoCalled = false;
+ private boolean m_disposed = false;
+ }
+
+ private static short FAIL_UNDO = 1;
+ private static short FAIL_REDO = 2;
+
+ private static class FailingUndoAction implements XUndoAction
+ {
+ FailingUndoAction( final short i_failWhich )
+ {
+ m_failWhich = i_failWhich;
+ }
+
+ public String getTitle()
+ {
+ return "failing undo";
+ }
+
+ public void undo() throws UndoFailedException
+ {
+ if ( m_failWhich != FAIL_REDO )
+ impl_throw();
+ }
+
+ public void redo() throws UndoFailedException
+ {
+ if ( m_failWhich != FAIL_UNDO )
+ impl_throw();
+ }
+
+ private void impl_throw() throws UndoFailedException
+ {
+ throw new UndoFailedException();
+ }
+
+ private final short m_failWhich;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static class CountingUndoAction implements XUndoAction
+ {
+ CountingUndoAction( final int i_expectedOrder, final Object i_lock, final Integer[] i_actionsUndoneCounter )
+ {
+ m_expectedOrder = i_expectedOrder;
+ m_lock = i_lock;
+ m_actionsUndoneCounter = i_actionsUndoneCounter;
+ }
+
+ public String getTitle()
+ {
+ return "Counting Undo Action";
+ }
+
+ public void undo() throws UndoFailedException
+ {
+ synchronized( m_lock )
+ {
+ assertEquals( "Undo action called out of order", m_expectedOrder, m_actionsUndoneCounter[0].intValue() );
+ ++m_actionsUndoneCounter[0];
+ }
+ }
+
+ public void redo() throws UndoFailedException
+ {
+ fail( "CountingUndoAction.redo is not expected to be called in this test." );
+ }
+ private final int m_expectedOrder;
+ private final Object m_lock;
+ private Integer[] m_actionsUndoneCounter;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static String getCallbackUndoContextTitle()
+ {
+ return "Some Unfinished Undo Context";
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static String getCallbackComponentServiceName()
+ {
+ return "org.openoffice.complex.sfx2.Callback";
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ /**
+ * a factory for a callback component which, at OOo runtime, is inserted into OOo's "component repository"
+ */
+ private class CallbackComponentFactory implements XSingleComponentFactory, XServiceInfo, XComponent
+ {
+ public Object createInstanceWithContext( XComponentContext i_context ) throws com.sun.star.uno.Exception
+ {
+ return new CallbackComponent();
+ }
+
+ public Object createInstanceWithArgumentsAndContext( Object[] i_arguments, XComponentContext i_context ) throws com.sun.star.uno.Exception
+ {
+ return createInstanceWithContext( i_context );
+ }
+
+ public String getImplementationName()
+ {
+ return "org.openoffice.complex.sfx2.CallbackComponent";
+ }
+
+ public boolean supportsService( String i_serviceName )
+ {
+ return i_serviceName.equals( getCallbackComponentServiceName() );
+ }
+
+ public String[] getSupportedServiceNames()
+ {
+ return new String[] { getCallbackComponentServiceName() };
+ }
+
+ public void dispose()
+ {
+ final EventObject event = new EventObject( this );
+
+ final ArrayList eventListenersCopy = (ArrayList)m_eventListeners.clone();
+ final Iterator iter = eventListenersCopy.iterator();
+ while ( iter.hasNext() )
+ {
+ ((XEventListener)iter.next()).disposing( event );
+ }
+ }
+
+ public void addEventListener( XEventListener i_listener )
+ {
+ if ( i_listener != null )
+ m_eventListeners.add( i_listener );
+ }
+
+ public void removeEventListener( XEventListener i_listener )
+ {
+ m_eventListeners.remove( i_listener );
+ }
+
+ private final ArrayList m_eventListeners = new ArrayList();
+ };
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private class CallbackComponent implements XJob, XTypeProvider
+ {
+ CallbackComponent()
+ {
+ }
+
+ public Object execute( NamedValue[] i_parameters ) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception
+ {
+ // this method is called from within the Basic script which is to check whether the OOo framework
+ // properly cleans up unfinished Undo contexts. It is called immediately after the context has been
+ // entered, so verify the expected Undo manager state.
+ assertEquals( getCallbackUndoContextTitle(), m_undoListener.getCurrentUndoContextTitle() );
+ assertEquals( 1, m_undoListener.getCurrentUndoContextDepth() );
+
+ synchronized( m_callbackCondition )
+ {
+ m_callbackCalled = true;
+ m_callbackCondition.notifyAll();
+ }
+ return m_closeAfterCallback ? "close" : "";
+ }
+
+ public Type[] getTypes()
+ {
+ final Class interfaces[] = getClass().getInterfaces();
+ Type types[] = new Type[ interfaces.length ];
+ for ( int i = 0; i < interfaces.length; ++i )
+ types[i] = new Type(interfaces[i]);
+ return types;
+ }
+
+ public byte[] getImplementationId()
+ {
+ return getClass().toString().getBytes();
+ }
+ }
+
+ private static final OfficeConnection m_connection = new OfficeConnection();
+ private DocumentTest m_currentTestCase;
+ private OfficeDocument m_currentDocument;
+ private UndoListener m_undoListener;
+ private CallbackComponentFactory m_callbackFactory = null;
+ private boolean m_callbackCalled = false;
+ private boolean m_closeAfterCallback = false;
+ private final Object m_callbackCondition = new Object();
+}
diff --git a/connectivity/qa/drivers/dbase/makefile.mk b/sfx2/qa/complex/sfx2/makefile.mk
index d71670d67458..20b170fba3b4 100644
--- a/connectivity/qa/drivers/dbase/makefile.mk
+++ b/sfx2/qa/complex/sfx2/makefile.mk
@@ -25,40 +25,60 @@
#
#*************************************************************************
-PRJ = ..$/..$/..
-TARGET = DBaseDriverTest
-PRJNAME = connectivity
-PACKAGE = qa$/drivers$/dbase
+.IF "$(OOO_JUNIT_JAR)" == ""
+nothing .PHONY:
+ @echo -----------------------------------------------------
+ @echo - JUnit not available, not building anything
+ @echo -----------------------------------------------------
+.ELSE # IF "$(OOO_JUNIT_JAR)" != ""
+
+PRJ = ../../..
+PRJNAME = sfx2
+TARGET = qa_complex
+PACKAGE = complex/sfx2
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
-
#----- compile .java files -----------------------------------------
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES =\
- DBaseDateFunctions.java\
- DBaseDriverTest.java\
- DBaseNumericFunctions.java\
- DBaseStringFunctions.java\
- DBaseSqlTests.java
-
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
+JARFILES = OOoRunnerLight.jar ridl.jar test.jar test-tools.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+JAVAFILES = $(shell @$(FIND) . -name "*.java") \
-MAXLINELENGTH = 100000
+#----- create a jar from compiled files ----------------------------
-JARCLASSDIRS = $(PACKAGE)
JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
+
+#----- JUnit tests class -------------------------------------------
+
+JAVATESTFILES = \
+ DocumentInfo.java \
+ DocumentProperties.java \
+ StandaloneDocumentInfo.java \
+ DocumentMetadataAccess.java \
+ UndoManager.java \
+
+# disabled: #i115674#
+# GlobalEventBroadcaster.java \
# --- Targets ------------------------------------------------------
-.INCLUDE : target.mk
+.INCLUDE: target.mk
+
+ALL : ALLTAR
+
+# --- subsequent tests ---------------------------------------------
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" != ""
+
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+ # Sample how to debug
+ # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-run: $(CLASSDIR)$/$(JARTARGET)
- java -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar" org.openoffice.Runner -TestBase java_complex -o qa.drivers.dbase.$(TARGET)
+.END # "$(OOO_SUBSEQUENT_TESTS)" == ""
+.END # ELSE "$(OOO_JUNIT_JAR)" != ""
diff --git a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoTest.java b/sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest.java
index f5512bf9723b..d255f3d16822 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoTest.java
+++ b/sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest.java
@@ -24,7 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.standalonedocumentinfo;
+package complex.sfx2.standalonedocinfo;
public interface StandaloneDocumentInfoTest {
boolean test();
diff --git a/sfx2/qa/complex/standalonedocumentinfo/Test01.java b/sfx2/qa/complex/sfx2/standalonedocinfo/Test01.java
index 2f9a6266b4e2..bf54bb4ca90b 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/Test01.java
+++ b/sfx2/qa/complex/sfx2/standalonedocinfo/Test01.java
@@ -24,8 +24,10 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.standalonedocumentinfo;
+package complex.sfx2.standalonedocinfo;
+import complex.sfx2.standalonedocinfo.TestHelper;
+import complex.sfx2.standalonedocinfo.StandaloneDocumentInfoTest;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.document.XStandaloneDocumentInfo;
import com.sun.star.io.XTempFile;
diff --git a/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java b/sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper.java
index f6d63e1b7793..a650ce9bb2e4 100644
--- a/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java
+++ b/sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper.java
@@ -24,7 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.standalonedocumentinfo;
+package complex.sfx2.standalonedocinfo;
public class TestHelper {
diff --git a/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt b/sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt
index 831a8f451dfd..831a8f451dfd 100644
--- a/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt
+++ b/sfx2/qa/complex/sfx2/testdocuments/CUSTOM.odt
Binary files differ
diff --git a/sfx2/qa/complex/framework/testdocuments/TEST.odt b/sfx2/qa/complex/sfx2/testdocuments/TEST.odt
index 7c6f0b60f7b0..7c6f0b60f7b0 100644
--- a/sfx2/qa/complex/framework/testdocuments/TEST.odt
+++ b/sfx2/qa/complex/sfx2/testdocuments/TEST.odt
Binary files differ
diff --git a/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt
index d59739142df6..d59739142df6 100644
--- a/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt
+++ b/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt
Binary files differ
diff --git a/sfx2/qa/complex/framework/testdocuments/empty.rdf b/sfx2/qa/complex/sfx2/testdocuments/empty.rdf
index af62bab39dfa..af62bab39dfa 100644
--- a/sfx2/qa/complex/framework/testdocuments/empty.rdf
+++ b/sfx2/qa/complex/sfx2/testdocuments/empty.rdf
diff --git a/sfx2/qa/complex/framework/DialogThread.java b/sfx2/qa/complex/sfx2/tools/DialogThread.java
index 7151ccbb292d..e67e65f218db 100644
--- a/sfx2/qa/complex/framework/DialogThread.java
+++ b/sfx2/qa/complex/sfx2/tools/DialogThread.java
@@ -24,7 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.framework.DocHelper;
+package complex.sfx2.tools;
import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.XController;
@@ -37,9 +37,6 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.URL;
import com.sun.star.util.XURLTransformer;
-import java.lang.Thread;
-
-
/**
* This class opens a given dialog in a separate Thread by dispatching an url
*
@@ -55,21 +52,17 @@ public class DialogThread extends Thread {
this.m_url = url;
}
+ @Override
public void run() {
- XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
- m_xDoc);
+ XModel aModel = UnoRuntime.queryInterface( XModel.class, m_xDoc );
XController xController = aModel.getCurrentController();
//Opening Dialog
try {
- XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(
- XDispatchProvider.class,
- xController.getFrame());
- XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface(
- XURLTransformer.class,
- m_xMSF.createInstance(
- "com.sun.star.util.URLTransformer"));
+ XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController.getFrame() );
+ XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class,
+ m_xMSF.createInstance( "com.sun.star.util.URLTransformer" ) );
// Because it's an in/out parameter
// we must use an array of URL objects.
diff --git a/sfx2/qa/complex/framework/TestDocument.java b/sfx2/qa/complex/sfx2/tools/TestDocument.java
index 8cc6ef7756b1..120dca978bba 100644
--- a/sfx2/qa/complex/framework/TestDocument.java
+++ b/sfx2/qa/complex/sfx2/tools/TestDocument.java
@@ -25,12 +25,12 @@
*
************************************************************************/
-package complex.framework;
+package complex.sfx2.tools;
import java.io.File;
import org.openoffice.test.OfficeFileUrl;
-final class TestDocument {
+public final class TestDocument {
public static String getUrl(String name) {
return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
}
diff --git a/sfx2/qa/complex/framework/WriterHelper.java b/sfx2/qa/complex/sfx2/tools/WriterHelper.java
index d3f19703bb9d..4767028572bb 100644
--- a/sfx2/qa/complex/framework/WriterHelper.java
+++ b/sfx2/qa/complex/sfx2/tools/WriterHelper.java
@@ -24,7 +24,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.framework.DocHelper;
+package complex.sfx2.tools;
import com.sun.star.accessibility.AccessibleRole;
import com.sun.star.accessibility.XAccessible;
@@ -40,7 +40,6 @@ import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XCloseable;
-import complex.framework.DocHelper.DialogThread;
import java.io.PrintWriter;
import util.AccessibilityTools;
@@ -104,13 +103,12 @@ public class WriterHelper {
if (createButton.length() > 1) {
XExtendedToolkit tk = getToolkit();
- AccessibilityTools at = new AccessibilityTools();
Object atw = tk.getActiveTopWindow();
XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
- XAccessible xRoot = at.getAccessibleObject(xWindow);
- XAccessibleContext buttonContext = at.getAccessibleObjectForRole(
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
+ XAccessibleContext buttonContext = AccessibilityTools.getAccessibleObjectForRole(
xRoot,
AccessibleRole.PUSH_BUTTON,
createButton);
@@ -154,28 +152,26 @@ public class WriterHelper {
public XTextDocument DocByAutopilot(XMultiServiceFactory msf,
int[] indexes, boolean destroyLocal,
String bName) {
- XTextDocument xLocalDoc = WriterTools.createTextDoc(m_xMSF);
+ XTextDocument xTextDoc = WriterTools.createTextDoc(m_xMSF);
Object toolkit = null;
try {
toolkit = msf.createInstance("com.sun.star.awt.Toolkit");
} catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ e.printStackTrace( System.err );
}
XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit);
shortWait();
- AccessibilityTools at = new AccessibilityTools();
-
Object atw = tk.getActiveTopWindow();
XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
- XAccessible xRoot = at.getAccessibleObject(xWindow);
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
- XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot,
+ XAccessibleContext ARoot = AccessibilityTools.getAccessibleObjectForRole(xRoot,
AccessibleRole.MENU_BAR);
XAccessibleSelection sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot);
@@ -196,11 +192,11 @@ public class WriterHelper {
xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
- xRoot = at.getAccessibleObject(xWindow);
+ xRoot = AccessibilityTools.getAccessibleObject(xWindow);
//at.printAccessibleTree(new PrintWriter(System.out),xRoot);
- XAccessibleAction action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, bName));
+ XAccessibleAction action = UnoRuntime.queryInterface(XAccessibleAction.class, AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, bName));
try {
action.doAccessibleAction(0);
@@ -213,11 +209,11 @@ public class WriterHelper {
xWindow = UnoRuntime.queryInterface(XWindow.class, atw);
- xRoot = at.getAccessibleObject(xWindow);
+ xRoot = AccessibilityTools.getAccessibleObject(xWindow);
- at.printAccessibleTree(new PrintWriter(System.out),xRoot);
+ AccessibilityTools.printAccessibleTree(new PrintWriter(System.out),xRoot);
- action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Yes"));
+ action = UnoRuntime.queryInterface(XAccessibleAction.class, AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Yes"));
try {
if (action != null) action.doAccessibleAction(0);
@@ -231,7 +227,7 @@ public class WriterHelper {
XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent());
if (destroyLocal) {
- closeDoc(xLocalDoc);
+ closeDoc(xTextDoc);
}
return returnDoc;
@@ -259,7 +255,7 @@ public class WriterHelper {
toolkit = m_xMSF.createInstance("com.sun.star.awt.Toolkit");
} catch (com.sun.star.uno.Exception e) {
System.out.println("Couldn't get toolkit");
- e.printStackTrace();
+ e.printStackTrace( System.err );
}
XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit);
@@ -277,7 +273,7 @@ public class WriterHelper {
desk = m_xMSF.createInstance("com.sun.star.frame.Desktop");
} catch (com.sun.star.uno.Exception e) {
System.out.println("Couldn't get desktop");
- e.printStackTrace();
+ e.printStackTrace( System.err );
}
XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, desk);
diff --git a/sfx2/qa/complex/sfx2/undo/CalcDocumentTest.java b/sfx2/qa/complex/sfx2/undo/CalcDocumentTest.java
new file mode 100755
index 000000000000..34825fdbada9
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/undo/CalcDocumentTest.java
@@ -0,0 +1,96 @@
+package complex.sfx2.undo;
+
+import org.openoffice.test.tools.SpreadsheetDocument;
+import com.sun.star.table.XCellRange;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.UnoRuntime;
+import org.openoffice.test.tools.DocumentType;
+import static org.junit.Assert.*;
+
+/**
+ * implements the {@link DocumentTest} interface on top of a spreadsheet document
+ * @author frank.schoenheit@oracle.com
+ */
+public class CalcDocumentTest extends DocumentTestBase
+{
+ public CalcDocumentTest( final XMultiServiceFactory i_orb ) throws Exception
+ {
+ super( i_orb, DocumentType.CALC );
+ }
+
+ public String getDocumentDescription()
+ {
+ return "spreadsheet document";
+ }
+
+ public void initializeDocument() throws com.sun.star.uno.Exception
+ {
+ final XCell cellA1 = getCellA1();
+ cellA1.setValue( INIT_VALUE );
+ assertEquals( "initializing the cell value didn't work", cellA1.getValue(), INIT_VALUE, 0 );
+
+ XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
+ ((SpreadsheetDocument)m_document).getSheet(0) );
+
+ for ( int i=0; i<12; ++i )
+ {
+ XCell cell = range.getCellByPosition( 1, i );
+ cell.setFormula( "" );
+ }
+ }
+
+ public void doSingleModification() throws com.sun.star.uno.Exception
+ {
+ final XCell cellA1 = getCellA1();
+ assertEquals( "initial cell value not as expected", INIT_VALUE, cellA1.getValue(), 0 );
+ cellA1.setValue( MODIFIED_VALUE );
+ assertEquals( "modified cell value not as expected", MODIFIED_VALUE, cellA1.getValue(), 0 );
+ }
+
+ public void verifyInitialDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XCell cellA1 = getCellA1();
+ assertEquals( "cell A1 doesn't have its initial value", INIT_VALUE, cellA1.getValue(), 0 );
+
+ XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
+ ((SpreadsheetDocument)m_document).getSheet(0) );
+ for ( int i=0; i<12; ++i )
+ {
+ final XCell cell = range.getCellByPosition( 1, i );
+ assertEquals( "Cell B" + (i+1) + " not having its initial value (an empty string)", "", cell.getFormula() );
+ }
+ }
+
+ public void verifySingleModificationDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XCell cellA1 = getCellA1();
+ assertEquals( "cell A1 doesn't have the value which we gave it", MODIFIED_VALUE, cellA1.getValue(), 0 );
+ }
+
+ public int doMultipleModifications() throws com.sun.star.uno.Exception
+ {
+ XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
+ ((SpreadsheetDocument)m_document).getSheet(0) );
+
+ final String[] months = new String[] {
+ "January", "February", "March", "April", "May", "June", "July", "August",
+ "September", "October", "November", "December" };
+ for ( int i=0; i<12; ++i )
+ {
+ final XCell cell = range.getCellByPosition( 1, i );
+ cell.setFormula( months[i] );
+ }
+ return 12;
+ }
+
+ private XCell getCellA1() throws com.sun.star.uno.Exception
+ {
+ XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
+ ((SpreadsheetDocument)m_document).getSheet(0) );
+ return range.getCellByPosition( 0, 0 );
+ }
+
+ private static final double INIT_VALUE = 100.0;
+ private static final double MODIFIED_VALUE = 200.0;
+}
diff --git a/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java b/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
new file mode 100755
index 000000000000..7c8421ec6e5b
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/undo/ChartDocumentTest.java
@@ -0,0 +1,277 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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.sfx2.undo;
+
+import com.sun.star.chart2.XAxis;
+import com.sun.star.chart2.XCoordinateSystem;
+import com.sun.star.chart2.XCoordinateSystemContainer;
+import com.sun.star.awt.Size;
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.chart2.XChartDocument;
+import com.sun.star.chart2.XDiagram;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.document.UndoFailedException;
+import com.sun.star.document.XUndoAction;
+import com.sun.star.document.XUndoManager;
+import com.sun.star.document.XUndoManagerSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.embed.EmbedStates;
+import com.sun.star.embed.EmbedVerbs;
+import com.sun.star.embed.VerbDescriptor;
+import com.sun.star.embed.WrongStateException;
+import com.sun.star.embed.XEmbeddedObject;
+import com.sun.star.embed.XStateChangeBroadcaster;
+import com.sun.star.embed.XStateChangeListener;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.view.XSelectionSupplier;
+import org.openoffice.test.tools.DocumentType;
+import org.openoffice.test.tools.OfficeDocument;
+import static org.junit.Assert.*;
+
+/**
+ * @author frank.schoenheit@oracle.com
+ */
+public class ChartDocumentTest implements DocumentTest
+{
+ public ChartDocumentTest( final XMultiServiceFactory i_orb ) throws com.sun.star.uno.Exception, InterruptedException
+ {
+ m_textDocument = OfficeDocument.blankDocument( i_orb, DocumentType.WRITER );
+
+ // create a OLE shape in the document
+ final XMultiServiceFactory factory = UnoRuntime.queryInterface( XMultiServiceFactory.class, m_textDocument.getDocument() );
+ final String shapeServiceName = "com.sun.star.text.TextEmbeddedObject";
+ final XPropertySet shapeProps = UnoRuntime.queryInterface( XPropertySet.class, factory.createInstance( shapeServiceName ) );
+ shapeProps.setPropertyValue("CLSID", "12dcae26-281f-416f-a234-c3086127382e");
+
+ final XShape shape = UnoRuntime.queryInterface( XShape.class, shapeProps );
+ shape.setSize( new Size( 16000, 9000 ) );
+
+ final XTextContent chartTextContent = UnoRuntime.queryInterface( XTextContent.class, shapeProps );
+
+ final XSelectionSupplier selSupplier = UnoRuntime.queryInterface( XSelectionSupplier.class,
+ m_textDocument.getCurrentView().getController() );
+ final Object selection = selSupplier.getSelection();
+ final XTextRange textRange = getAssociatedTextRange( selection );
+ if ( textRange == null )
+ throw new RuntimeException( "can't locate a text range" );
+
+ // insert the chart
+ textRange.getText().insertTextContent(textRange, chartTextContent, false);
+
+ // retrieve the chart model
+ XChartDocument chartDoc = UnoRuntime.queryInterface( XChartDocument.class, shapeProps.getPropertyValue( "Model" ) );
+ m_chartDocument = new OfficeDocument( i_orb, chartDoc );
+
+ // actually activate the object
+ final XEmbeddedObject embeddedChart = UnoRuntime.queryInterface( XEmbeddedObject.class,
+ shapeProps.getPropertyValue( "EmbeddedObject" ) );
+ embeddedChart.doVerb( EmbedVerbs.MS_OLEVERB_SHOW );
+
+ final int state = embeddedChart.getCurrentState();
+ if ( state != EmbedStates.UI_ACTIVE )
+ fail( "unable to activate the embedded chart" );
+ }
+
+ public String getDocumentDescription()
+ {
+ return "chart document";
+ }
+
+ public void initializeDocument() throws com.sun.star.uno.Exception
+ {
+ final XPropertySet wallProperties = impl_getWallProperties();
+ wallProperties.setPropertyValue( "FillStyle", com.sun.star.drawing.FillStyle.SOLID );
+ wallProperties.setPropertyValue( "FillColor", 0x00FFFFFF );
+ }
+
+ public void closeDocument()
+ {
+ m_textDocument.close();
+ }
+
+ private XPropertySet impl_getWallProperties()
+ {
+ final XChartDocument chartDoc = UnoRuntime.queryInterface( XChartDocument.class, m_chartDocument.getDocument() );
+ final XDiagram diagram = chartDoc.getFirstDiagram();
+ final XPropertySet wallProperties = diagram.getWall();
+ return wallProperties;
+ }
+
+ private XPropertySet impl_getYAxisProperties()
+ {
+ XPropertySet axisProperties = null;
+ try
+ {
+ final XChartDocument chartDoc = UnoRuntime.queryInterface( XChartDocument.class, m_chartDocument.getDocument() );
+ final XDiagram diagram = chartDoc.getFirstDiagram();
+ final XCoordinateSystemContainer coordContainer = UnoRuntime.queryInterface( XCoordinateSystemContainer.class, diagram );
+ final XCoordinateSystem[] coordSystems = coordContainer.getCoordinateSystems();
+ final XCoordinateSystem coordSystem = coordSystems[0];
+ final XAxis primaryYAxis = coordSystem.getAxisByDimension( 1, 0 );
+ axisProperties = UnoRuntime.queryInterface( XPropertySet.class, primaryYAxis );
+ }
+ catch ( Exception ex )
+ {
+ fail( "internal error: could not retrieve primary Y axis properties" );
+ }
+ return axisProperties;
+ }
+
+ private XUndoManager impl_getUndoManager()
+ {
+ final XUndoManagerSupplier undoManagerSupp = UnoRuntime.queryInterface( XUndoManagerSupplier.class, m_chartDocument.getDocument() );
+ final XUndoManager undoManager = undoManagerSupp.getUndoManager();
+ return undoManager;
+ }
+
+ public void doSingleModification() throws com.sun.star.uno.Exception
+ {
+ final XPropertySet wallProperties = impl_getWallProperties();
+
+ // simulate an Undo action, as long as the chart implementation doesn't add Undo actions itself
+ final XUndoManager undoManager = impl_getUndoManager();
+ undoManager.addUndoAction( new PropertyUndoAction( wallProperties, "FillColor", 0xCCFF44 ) );
+ // (the UndoAction will actually set the property value)
+ }
+
+ public void verifyInitialDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XPropertySet wallProperties = impl_getWallProperties();
+ assertEquals( 0x00FFFFFF, ((Integer)wallProperties.getPropertyValue( "FillColor" )).intValue() );
+ }
+
+ public void verifySingleModificationDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XPropertySet wallProperties = impl_getWallProperties();
+ assertEquals( 0xCCFF44, ((Integer)wallProperties.getPropertyValue( "FillColor" )).intValue() );
+ }
+
+ public int doMultipleModifications() throws com.sun.star.uno.Exception
+ {
+ final XPropertySet axisProperties = impl_getYAxisProperties();
+
+ final XUndoManager undoManager = impl_getUndoManager();
+ undoManager.addUndoAction( new PropertyUndoAction( axisProperties, "LineWidth", 300 ) );
+ undoManager.addUndoAction( new PropertyUndoAction( axisProperties, "LineColor", 0x000000 ) );
+
+ return 2;
+ }
+
+ public OfficeDocument getDocument()
+ {
+ return m_chartDocument;
+ }
+
+ private XTextRange getAssociatedTextRange( final Object i_object ) throws WrappedTargetException, IndexOutOfBoundsException
+ {
+ // possible cases:
+ // 1. a container of other objects - e.g. selection of 0 to n text portions, or 1 to n drawing objects
+ final XIndexAccess indexer = UnoRuntime.queryInterface( XIndexAccess.class, i_object );
+ if ((indexer != null) && indexer.getCount() > 0) {
+ final int count = indexer.getCount();
+ for (int i = 0; i < count; ++i) {
+ final XTextRange range = getAssociatedTextRange( indexer.getByIndex(i) );
+ if (range != null) {
+ return range;
+ }
+ }
+ }
+ // 2. another TextContent, having an anchor we can use
+ final XTextContent textContent = UnoRuntime.queryInterface(XTextContent.class, i_object);
+ if (textContent != null) {
+ final XTextRange range = textContent.getAnchor();
+ if (range != null) {
+ return range;
+ }
+ }
+
+ // an object which supports XTextRange directly
+ final XTextRange range = UnoRuntime.queryInterface(XTextRange.class, i_object);
+ if (range != null) {
+ return range;
+ }
+
+ return null;
+ }
+
+ private static class PropertyUndoAction implements XUndoAction
+ {
+ PropertyUndoAction( final XPropertySet i_component, final String i_propertyName, final Object i_newValue ) throws com.sun.star.uno.Exception
+ {
+ m_component = i_component;
+ m_propertyName = i_propertyName;
+ m_newValue = i_newValue;
+
+ m_oldValue = i_component.getPropertyValue( m_propertyName );
+ i_component.setPropertyValue( m_propertyName, m_newValue );
+ }
+
+ public String getTitle()
+ {
+ return "some dummy Undo Action";
+ }
+
+ public void undo() throws UndoFailedException
+ {
+ try
+ {
+ m_component.setPropertyValue( m_propertyName, m_oldValue );
+ }
+ catch ( com.sun.star.uno.Exception ex )
+ {
+ throw new UndoFailedException( "", this, ex );
+ }
+ }
+
+ public void redo() throws UndoFailedException
+ {
+ try
+ {
+ m_component.setPropertyValue( m_propertyName, m_newValue );
+ }
+ catch ( com.sun.star.uno.Exception ex )
+ {
+ throw new UndoFailedException( "", this, ex );
+ }
+ }
+
+ private final XPropertySet m_component;
+ private final String m_propertyName;
+ private final Object m_oldValue;
+ private final Object m_newValue;
+ }
+
+ private final OfficeDocument m_textDocument;
+ private final OfficeDocument m_chartDocument;
+}
diff --git a/sfx2/qa/complex/sfx2/undo/DocumentTest.java b/sfx2/qa/complex/sfx2/undo/DocumentTest.java
new file mode 100755
index 000000000000..d6de90884673
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/undo/DocumentTest.java
@@ -0,0 +1,61 @@
+package complex.sfx2.undo;
+
+import org.openoffice.test.tools.OfficeDocument;
+
+/**
+ * wrapper around an OfficeDocument, for running a standardized test procedure (related do Undo functionality)
+ * on the document.
+ *
+ * @author frank.schoenheit@oracle.com
+ */
+public interface DocumentTest
+{
+ /**
+ * returns a human-readable description for the document/type which the tests operates on
+ */
+ public String getDocumentDescription();
+
+ /**
+ * initializes the document to a state where the subsequent tests can be ran
+ */
+ public void initializeDocument() throws com.sun.star.uno.Exception;
+
+ /**
+ * closes the document which the test is based on
+ */
+ public void closeDocument();
+
+ /**
+ * does a simple modification to the document, which results in one Undo action being auto-generated
+ * by the OOo implementation
+ */
+ public void doSingleModification() throws com.sun.star.uno.Exception;
+
+ /**
+ * verifies the document is in the same state as after {@link #initializeDocument}
+ */
+ public void verifyInitialDocumentState() throws com.sun.star.uno.Exception;
+
+ /**
+ * verifies the document is in the state as expected after {@link #doSingleModification}
+ * @throws com.sun.star.uno.Exception
+ */
+ public void verifySingleModificationDocumentState() throws com.sun.star.uno.Exception;
+
+ /**
+ * does multiple modifications do the document, which would normally result in multiple Undo actions.
+ *
+ * The test framework will encapsulate the call into an {@link XUndoManager.enterUndoContext()} and
+ * {@link XUndoManager.leaveUndoContext()} call.
+ *
+ * @return
+ * the number of modifications done to the document. The caller assumes (and asserts) that the number
+ * of actions on the Undo stack equals this number.
+ */
+ public int doMultipleModifications() throws com.sun.star.uno.Exception;
+
+ /**
+ * returns the document which the test operates on
+ */
+ public OfficeDocument getDocument();
+}
diff --git a/sfx2/qa/complex/sfx2/undo/DocumentTestBase.java b/sfx2/qa/complex/sfx2/undo/DocumentTestBase.java
new file mode 100755
index 000000000000..11adc80c2e85
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/undo/DocumentTestBase.java
@@ -0,0 +1,29 @@
+package complex.sfx2.undo;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import org.openoffice.test.tools.DocumentType;
+import org.openoffice.test.tools.OfficeDocument;
+
+/**
+ * @author frank.schoenheit@oracle.com
+ */
+abstract class DocumentTestBase implements DocumentTest
+{
+ DocumentTestBase( final XMultiServiceFactory i_orb, final DocumentType i_docType ) throws Exception
+ {
+ m_document = OfficeDocument.blankDocument( i_orb, i_docType );
+ }
+
+ public OfficeDocument getDocument()
+ {
+ return m_document;
+ }
+
+ public void closeDocument()
+ {
+ m_document.close();
+ }
+
+ protected final OfficeDocument m_document;
+}
diff --git a/dbaccess/source/shared/cfg_reghelper.cxx b/sfx2/qa/complex/sfx2/undo/DrawDocumentTest.java
index 38766a6a1b24..d98e1372dea5 100644..100755
--- a/dbaccess/source/shared/cfg_reghelper.cxx
+++ b/sfx2/qa/complex/sfx2/undo/DrawDocumentTest.java
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -23,27 +22,25 @@
* <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_dbaccess.hxx"
+ *************************************************************************/
-#ifndef CFG_REGHELPER_HXX
-#include "cfg_reghelper.hxx"
-#endif
+package complex.sfx2.undo;
-#ifndef _OSL_DIAGNOSE_H_
-#include <osl/diagnose.h>
-#endif
-#ifndef _COMPHELPER_SEQUENCE_HXX_
-#include <comphelper/sequence.hxx>
-#endif
+import com.sun.star.lang.XMultiServiceFactory;
+import org.openoffice.test.tools.DocumentType;
-namespace dbacfg
+/**
+ * @author frank.schoenheit@oracle.com
+ */
+public class DrawDocumentTest extends DrawingOrPresentationDocumentTest
{
+ public DrawDocumentTest( XMultiServiceFactory i_orb ) throws com.sun.star.uno.Exception
+ {
+ super( i_orb, DocumentType.DRAWING );
+ }
- #define _REGISTRATIONHELPER_CXX_INCLUDED_INDIRECTLY_
- #include "registrationhelper.cxx"
- #undef _REGISTRATIONHELPER_CXX_INCLUDED_INDIRECTLY_
-
+ public String getDocumentDescription()
+ {
+ return "drawing document";
+ }
}
diff --git a/sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java b/sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java
new file mode 100755
index 000000000000..916e1908e93d
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/undo/DrawingOrPresentationDocumentTest.java
@@ -0,0 +1,196 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package complex.sfx2.undo;
+
+import com.sun.star.awt.Rectangle;
+import com.sun.star.document.XUndoManager;
+import com.sun.star.document.XUndoManagerSupplier;
+import com.sun.star.document.XUndoAction;
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.CircleKind;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import org.openoffice.test.tools.DocumentType;
+import static org.junit.Assert.*;
+
+/**
+ * implements the {@link DocumentTest} interface on top of a drawing document
+ * @author frank.schoenheit@oracle.com
+ */
+public abstract class DrawingOrPresentationDocumentTest extends DocumentTestBase
+{
+ public DrawingOrPresentationDocumentTest( XMultiServiceFactory i_orb, final DocumentType i_docType ) throws com.sun.star.uno.Exception
+ {
+ super( i_orb, i_docType );
+ }
+
+ public void initializeDocument() throws com.sun.star.uno.Exception
+ {
+ // remove all shapes - Impress has two default shapes in a new doc; just get rid of them
+ final XShapes firstPageShapes = getFirstPageShapes();
+ while ( firstPageShapes.getCount() > 0 )
+ firstPageShapes.remove( UnoRuntime.queryInterface( XShape.class, firstPageShapes.getByIndex( 0 ) ) );
+ }
+
+ public void doSingleModification() throws com.sun.star.uno.Exception
+ {
+ // add a simple centered shape to the first page
+ Rectangle pagePlayground = impl_getFirstPagePlayground();
+ impl_createCircleShape(
+ ( pagePlayground.X + ( pagePlayground.Width - BIG_CIRCLE_SIZE ) / 2 ),
+ ( pagePlayground.Y + ( pagePlayground.Height - BIG_CIRCLE_SIZE ) / 2 ),
+ BIG_CIRCLE_SIZE,
+ FILL_COLOR
+ );
+ }
+
+ public void verifyInitialDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XShapes firstPageShapes = getFirstPageShapes();
+ assertEquals( "there should be no shapes at all", 0, firstPageShapes.getCount() );
+ }
+
+ public void verifySingleModificationDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XShapes firstPageShapes = getFirstPageShapes();
+ assertEquals( "there should be one shape, not more, not less", 1, firstPageShapes.getCount() );
+
+ final Object shape = firstPageShapes.getByIndex(0);
+ verifyShapeGeometry( shape, BIG_CIRCLE_SIZE, BIG_CIRCLE_SIZE );
+ final XPropertySet shapeProps = UnoRuntime.queryInterface( XPropertySet.class, shape );
+ assertEquals( "wrong circle tpye", CIRCLE_TYPE.getValue(), ((CircleKind)shapeProps.getPropertyValue( "CircleKind" )).getValue() );
+ //assertEquals( "wrong circle fill color", FILL_COLOR, ((Integer)shapeProps.getPropertyValue( "FillColor" )).intValue() );
+ // disable this particular check: A bug in the drawing layer API restores the FillColor to its
+ // default value upon re-insertion. This is issue #i115080#
+ }
+
+ public int doMultipleModifications() throws com.sun.star.uno.Exception
+ {
+ // add a simple centered shape to the first page
+ Rectangle pagePlayground = impl_getFirstPagePlayground();
+ impl_createCircleShape(
+ pagePlayground.X,
+ pagePlayground.Y,
+ SMALL_CIRCLE_SIZE,
+ ALTERNATE_FILL_COLOR
+ );
+ impl_createCircleShape(
+ pagePlayground.X + pagePlayground.Width - SMALL_CIRCLE_SIZE,
+ pagePlayground.Y,
+ SMALL_CIRCLE_SIZE,
+ ALTERNATE_FILL_COLOR
+ );
+ impl_createCircleShape(
+ pagePlayground.X,
+ pagePlayground.Y + pagePlayground.Height - SMALL_CIRCLE_SIZE,
+ SMALL_CIRCLE_SIZE,
+ ALTERNATE_FILL_COLOR
+ );
+ impl_createCircleShape(
+ pagePlayground.X + pagePlayground.Width - SMALL_CIRCLE_SIZE,
+ pagePlayground.Y + pagePlayground.Height - SMALL_CIRCLE_SIZE,
+ SMALL_CIRCLE_SIZE,
+ ALTERNATE_FILL_COLOR
+ );
+ return 4;
+ }
+
+ private void impl_createCircleShape( final int i_x, final int i_y, final int i_size, final int i_color ) throws com.sun.star.uno.Exception
+ {
+ final XPropertySet shapeProps = getDocument().createInstance( "com.sun.star.drawing.EllipseShape", XPropertySet.class );
+ shapeProps.setPropertyValue( "CircleKind", CIRCLE_TYPE );
+ shapeProps.setPropertyValue( "FillColor", i_color );
+
+ final XShape shape = UnoRuntime.queryInterface( XShape.class, shapeProps );
+ final Size shapeSize = new Size( i_size, i_size );
+ shape.setSize( shapeSize );
+ final Point shapePos = new Point( i_x, i_y );
+ shape.setPosition( shapePos );
+
+ final XShapes pageShapes = UnoRuntime.queryInterface( XShapes.class, getFirstPageShapes() );
+ pageShapes.add( shape );
+
+ // Sadly, Draw/Impress currently do not create Undo actions for programmatic changes to the document.
+ // Which renders the test here slightly useless ... unless we fake the Undo actions ourself.
+ final XUndoManagerSupplier suppUndoManager = UnoRuntime.queryInterface( XUndoManagerSupplier.class, getDocument().getDocument() );
+ final XUndoManager undoManager = suppUndoManager.getUndoManager();
+ undoManager.addUndoAction( new ShapeInsertionUndoAction( shape, pageShapes ) );
+ }
+
+ private Rectangle impl_getFirstPagePlayground() throws com.sun.star.uno.Exception
+ {
+ final XShapes firstPageShapes = getFirstPageShapes();
+ final XPropertySet firstPageProps = UnoRuntime.queryInterface( XPropertySet.class, firstPageShapes );
+ final int pageWidth = ((Integer)firstPageProps.getPropertyValue( "Width" )).intValue();
+ final int pageHeight = ((Integer)firstPageProps.getPropertyValue( "Height" )).intValue();
+ final int borderLeft = ((Integer)firstPageProps.getPropertyValue( "BorderLeft" )).intValue();
+ final int borderTop = ((Integer)firstPageProps.getPropertyValue( "BorderTop" )).intValue();
+ final int borderRight = ((Integer)firstPageProps.getPropertyValue( "BorderRight" )).intValue();
+ final int borderBottom = ((Integer)firstPageProps.getPropertyValue( "BorderBottom" )).intValue();
+ return new Rectangle( borderLeft, borderTop, pageWidth - borderLeft - borderRight, pageHeight - borderTop - borderBottom );
+ }
+
+ /**
+ * returns the XShapes interface of the first page of our drawing document
+ */
+ private XShapes getFirstPageShapes() throws com.sun.star.uno.Exception
+ {
+ final XDrawPagesSupplier suppPages = UnoRuntime.queryInterface( XDrawPagesSupplier.class, getDocument().getDocument() );
+ final XDrawPages pages = suppPages.getDrawPages();
+ return UnoRuntime.queryInterface( XShapes.class, pages.getByIndex( 0 ) );
+ }
+
+ /**
+ * verifies the given shape has the given size
+ */
+ private void verifyShapeGeometry( final Object i_shapeObject, final int i_expectedWidth, final int i_expectedHeight )
+ throws com.sun.star.uno.Exception
+ {
+ final XShape shape = UnoRuntime.queryInterface( XShape.class, i_shapeObject );
+ final Size shapeSize = shape.getSize();
+ assertEquals( "unexpected shape width", i_expectedWidth, shapeSize.Width );
+ assertEquals( "unexpected shape height", i_expectedHeight, shapeSize.Height );
+ }
+
+ private static class ShapeInsertionUndoAction implements XUndoAction
+ {
+ ShapeInsertionUndoAction( final XShape i_shape, final XShapes i_shapeCollection )
+ {
+ m_shape = i_shape;
+ m_shapeCollection = i_shapeCollection;
+ }
+
+ public String getTitle()
+ {
+ return "insert shape";
+ }
+
+ public void undo()
+ {
+ m_shapeCollection.remove( m_shape );
+ }
+
+ public void redo()
+ {
+ m_shapeCollection.add( m_shape );
+ }
+
+ private final XShape m_shape;
+ private final XShapes m_shapeCollection;
+ }
+
+ private static CircleKind CIRCLE_TYPE = CircleKind.FULL;
+ private static int FILL_COLOR = 0xCC2244;
+ private static int ALTERNATE_FILL_COLOR = 0x44CC22;
+ private static int BIG_CIRCLE_SIZE = 5000;
+ private static int SMALL_CIRCLE_SIZE = 2000;
+}
diff --git a/sfx2/qa/complex/sfx2/undo/ImpressDocumentTest.java b/sfx2/qa/complex/sfx2/undo/ImpressDocumentTest.java
new file mode 100755
index 000000000000..c15fc760e0c3
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/undo/ImpressDocumentTest.java
@@ -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.
+ *
+ *************************************************************************/
+
+package complex.sfx2.undo;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import org.openoffice.test.tools.DocumentType;
+
+/**
+ * @author frank.schoenheit@oracle.com
+ */
+public class ImpressDocumentTest extends DrawingOrPresentationDocumentTest
+{
+ public ImpressDocumentTest( XMultiServiceFactory i_orb ) throws com.sun.star.uno.Exception
+ {
+ super( i_orb, DocumentType.PRESENTATION );
+ }
+
+ public String getDocumentDescription()
+ {
+ return "presentation document";
+ }
+}
diff --git a/sfx2/qa/complex/sfx2/undo/WriterDocumentTest.java b/sfx2/qa/complex/sfx2/undo/WriterDocumentTest.java
new file mode 100755
index 000000000000..702fb85ebb11
--- /dev/null
+++ b/sfx2/qa/complex/sfx2/undo/WriterDocumentTest.java
@@ -0,0 +1,104 @@
+package complex.sfx2.undo;
+
+import com.sun.star.text.XTextRange;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextTable;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import org.openoffice.test.tools.DocumentType;
+import static org.junit.Assert.*;
+
+/**
+ * implements the {@link DocumentTest} interface on top of a spreadsheet document
+ * @author frank.schoenheit@oracle.com
+ */
+public class WriterDocumentTest extends DocumentTestBase
+{
+ public WriterDocumentTest( final XMultiServiceFactory i_orb ) throws com.sun.star.uno.Exception
+ {
+ super( i_orb, DocumentType.WRITER );
+ }
+
+ public String getDocumentDescription()
+ {
+ return "text document";
+ }
+
+ public void initializeDocument() throws com.sun.star.uno.Exception
+ {
+ // TODO?
+ }
+
+ public void doSingleModification() throws com.sun.star.uno.Exception
+ {
+ final XTextDocument textDoc = UnoRuntime.queryInterface( XTextDocument.class, getDocument().getDocument() );
+ final XText docText = textDoc.getText();
+ docText.setString( s_blindText );
+ }
+
+ public void verifyInitialDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XTextDocument textDoc = UnoRuntime.queryInterface( XTextDocument.class, getDocument().getDocument() );
+ final XText docText = textDoc.getText();
+ assertEquals( "document should be empty", "", docText.getString() );
+ }
+
+ public void verifySingleModificationDocumentState() throws com.sun.star.uno.Exception
+ {
+ final XTextDocument textDoc = UnoRuntime.queryInterface( XTextDocument.class, getDocument().getDocument() );
+ final XText docText = textDoc.getText();
+ assertEquals( "blind text not found", s_blindText, docText.getString() );
+ }
+
+ public int doMultipleModifications() throws com.sun.star.uno.Exception
+ {
+ final XTextDocument textDoc = UnoRuntime.queryInterface( XTextDocument.class, getDocument().getDocument() );
+ final XText docText = textDoc.getText();
+
+ int expectedUndoActions = 0;
+
+ // create a cursor
+ final XTextCursor cursor = docText.createTextCursor();
+
+ // create a table
+ final XTextTable textTable = UnoRuntime.queryInterface( XTextTable.class,
+ getDocument().createInstance( "com.sun.star.text.TextTable" ) );
+ textTable.initialize( 3, 3 );
+ final XPropertySet tableProps = UnoRuntime.queryInterface( XPropertySet.class, textTable );
+ tableProps.setPropertyValue( "BackColor", 0xCCFF44 );
+
+ // insert the table into the doc
+ docText.insertTextContent( cursor, textTable, false );
+ ++expectedUndoActions; //FIXME this will create 2 actions! currently the event is sent for every individual action; should it be sent for top-level actions only? how many internal actions are created is an implementation detail!
+ ++expectedUndoActions;
+
+ // write some content into the center cell
+ final XCellRange cellRange = UnoRuntime.queryInterface( XCellRange.class, textTable );
+ final XCell centerCell = cellRange.getCellByPosition( 1, 1 );
+ final XTextRange cellText = UnoRuntime.queryInterface( XTextRange.class, centerCell );
+ cellText.setString( "Undo Manager API Test" );
+ ++expectedUndoActions;
+
+ // give it another color
+ final XPropertySet cellProps = UnoRuntime.queryInterface( XPropertySet.class, centerCell );
+ cellProps.setPropertyValue( "BackColor", 0x44CCFF );
+ ++expectedUndoActions;
+
+ return expectedUndoActions;
+ }
+
+ private static final String s_blindText =
+ "Lorem ipsum dolor. Sit amet penatibus. A cum turpis. Aenean ac eu. " +
+ "Ligula est urna nulla vestibulum ullamcorper. Nec sit in amet tincidunt mus. " +
+ "Tellus sagittis mi. Suscipit cursus in vestibulum in eros ipsum felis cursus lectus " +
+ "nunc quis condimentum in risus nec wisi aenean luctus hendrerit magna habitasse commodo orci. " +
+ "Nisl etiam quis. Vestibulum justo eleifend aliquet luctus sed turpis volutpat ullamcorper " +
+ "aliquam penatibus sagittis pede tincidunt egestas. Nibh massa lectus. Sem mattis purus morbi " +
+ "scelerisque turpis donec urna phasellus. Quis at lacus. Viverra mauris mollis. " +
+ "Dolor tincidunt condimentum.";
+}
diff --git a/sfx2/qa/complex/tests.sce b/sfx2/qa/complex/tests.sce
deleted file mode 100644
index c38852927ede..000000000000
--- a/sfx2/qa/complex/tests.sce
+++ /dev/null
@@ -1,3 +0,0 @@
--o complex.framework.DocumentMetaData
--o complex.framework.DocumentMetadataAccessTest
-#-o complex.framework.CheckGlobalEventBroadcaster_writer1
diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi
index d16239535193..0e4a302d9d13 100644
--- a/sfx2/sdi/docslots.sdi
+++ b/sfx2/sdi/docslots.sdi
@@ -171,11 +171,6 @@ interface OfficeDocument : Document
[
StateMethod = StateProps_Impl ;
]
- SID_PLAYMACRO // ole(no) api(final/play/norec)
- [
- ExecMethod = ExecProps_Impl ;
- StateMethod = StateProps_Impl ;
- ]
SID_VERSION
[
ExecMethod = ExecFile_Impl;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index aadd57185880..a9c5ca6e7330 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4635,31 +4635,6 @@ SfxVoidItem PickList SID_PICKLIST
]
//--------------------------------------------------------------------------
-SfxBoolItem PlayMacro SID_PLAYMACRO
-(SfxStringItem Statement SID_STATEMENT,SfxBoolItem Asynchron SID_ASYNCHRON)
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- NoRecord;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_MACRO;
-]
-
-//--------------------------------------------------------------------------
SfxBoolItem PlugInsActive SID_PLUGINS_ACTIVE
[
@@ -5238,31 +5213,6 @@ SfxVoidItem RunBasic SID_BASICRUN
]
//--------------------------------------------------------------------------
-SfxVoidItem RunStarWriter SID_STARTSW
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_APPLICATION;
-]
-
-//--------------------------------------------------------------------------
SfxBoolItem Save SID_SAVEDOC
(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR)
[
@@ -6570,31 +6520,6 @@ SfxVoidItem BasicIDEShowWindow SID_BASICIDE_SHOWWINDOW
]
//--------------------------------------------------------------------------
-SfxVoidItem ToolsMacroEdit SID_EDITMACRO
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = TRUE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_MACRO;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem Undo SID_UNDO
( SfxUInt16Item Undo SID_UNDO )
[
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index eb9307ad7538..303586762ac2 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -41,6 +41,8 @@
#include <tools/simplerm.hxx>
#include <tools/config.hxx>
#include <basic/basrdll.hxx>
+#include <basic/sbmeth.hxx>
+#include <basic/sbmod.hxx>
#include <svtools/asynclink.hxx>
#include <svl/stritem.hxx>
#include <vcl/sound.hxx>
@@ -831,3 +833,7 @@ void SfxApplication::MacroOrganizer( INT16 nTabId )
pSymbol( nTabId );
}
+ErrCode SfxApplication::CallBasic( const String& rCode, BasicManager* pMgr, SbxArray* pArgs, SbxValue* pRet )
+{
+ return pMgr->ExecuteMacro( rCode, pArgs, pRet);
+}
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
index dca172269443..ff01fd358d4d 100644
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/source/appl/app.hrc
@@ -32,11 +32,6 @@
// #defines *****************************************************************
#define ACC_IBM (RID_SFX_APP_START+2)
-#define MSG_ERR_WRITE_CFG (RID_SFX_APP_START+2)
-#define MSG_ERR_READ_CFG (RID_SFX_APP_START+3)
-#define MSG_ERR_OPEN_CFG (RID_SFX_APP_START+4)
-#define MSG_ERR_FILETYPE_CFG (RID_SFX_APP_START+5)
-#define MSG_ERR_VERSION_CFG (RID_SFX_APP_START+6)
#define MSG_ERR_NO_WEBBROWSER_FOUND (RID_SFX_APP_START+7)
// Note: no longer in use
@@ -45,101 +40,22 @@
#define MSG_ISPRINTING_QUERYABORT (RID_SFX_APP_START+9)
#define MSG_CANT_QUIT (RID_SFX_APP_START+10)
#define STR_ISMODIFIED (RID_SFX_APP_START+11)
-#define STR_AUTOSAVE (RID_SFX_APP_START+12)
-#define STR_MAIL (RID_SFX_APP_START+13)
-#define MSG_ERR_WRITE_SBL (RID_SFX_APP_START+14)
-#define MSG_IS_SERVER (RID_SFX_APP_START+15)
-
-#define STR_RESEXCEPTION (RID_SFX_APP_START+21)
-#define STR_SYSRESEXCEPTION (RID_SFX_APP_START+22)
-#define STR_DOUBLEEXCEPTION (RID_SFX_APP_START+23)
-#define STR_RESWARNING (RID_SFX_APP_START+24)
-#define STR_ERR_NOTEMPLATE (RID_SFX_APP_START+27)
-#define STR_RECOVER_TITLE (RID_SFX_APP_START+28)
-#define STR_RECOVER_QUERY (RID_SFX_APP_START+29)
-#define STR_RECOVER_PREPARED (RID_SFX_APP_START+30)
-#define MSG_ERR_SOINIT (RID_SFX_APP_START+31)
-
-#define MSG_IOERR_FILE_NOT_FOUND (RID_SFX_APP_START+32)
-#define MSG_IOERR_PATH_NOT_FOUND (RID_SFX_APP_START+33)
-#define MSG_IOERR_TOO_MANY_OPEN_FILES (RID_SFX_APP_START+34)
-#define MSG_IOERR_ACCESS_DENIED (RID_SFX_APP_START+35)
-#define MSG_IOERR_INVALID_ACCESS (RID_SFX_APP_START+36)
-#define MSG_IOERR_INVALID_HANDLE (RID_SFX_APP_START+37)
-#define MSG_IOERR_CANNOT_MAKE (RID_SFX_APP_START+38)
-#define MSG_IOERR_SHARING (RID_SFX_APP_START+39)
-#define MSG_IOERR_INVALID_PARAMETER (RID_SFX_APP_START+40)
-#define MSG_IOERR_GENERAL (RID_SFX_APP_START+41)
#define RID_FULLSCREENTOOLBOX (RID_SFX_APP_START+42)
#define RID_RECORDINGTOOLBOX (RID_SFX_APP_START+43)
#define RID_ENVTOOLBOX (RID_SFX_APP_START+44)
#define STR_QUITAPP (RID_SFX_APP_START+59)
-#define STR_EXITANDRETURN (RID_SFX_APP_START+60)
-#define STR_ERR_NOFILE (RID_SFX_APP_START+61)
-#define STR_EXTHELPSTATUS (RID_SFX_APP_START+62)
-
-#define STR_ADDRESS_NAME (RID_SFX_APP_START+65)
#define RID_STR_HLPFILENOTEXIST (RID_SFX_APP_START+68)
-#define RID_STR_HLPAPPNOTSTARTED (RID_SFX_APP_START+69)
-
-#define STR_NODOUBLE (RID_SFX_APP_START+75)
-#define STR_NOPRINTER (RID_SFX_APP_START+76)
-
-#define MSG_SIGNAL (RID_SFX_APP_START+77)
#define RID_STR_HELP (RID_SFX_APP_START+79)
#define RID_STR_NOAUTOSTARTHELPAGENT (RID_SFX_APP_START+80)
#define RID_HELPBAR (RID_SFX_APP_START+81)
#define RID_SPECIALCONFIG_ERROR (RID_SFX_APP_START+82)
-#define STR_MEMINFO_HEADER (RID_SFX_APP_START+84)
-#define STR_MEMINFO_FOOTER (RID_SFX_APP_START+85)
-#define STR_MEMINFO_OBJINFO (RID_SFX_APP_START+86)
-
-#define RID_PLUGIN (RID_SFX_APP_START+87)
-
-#define RID_WARN_POST_MAILTO (RID_SFX_APP_START+88)
-
-#define RID_STR_NOWELCOMESCREEN (RID_SFX_APP_START+91)
-
-// --> PB 2004-08-20 #i33095#
-/* obsolete
-#define STR_EDITOBJECT (RID_SFX_APP_START+92)
-#define STR_OPENOBJECT (RID_SFX_APP_START+93)
-*/
-
-#define STR_CORRUPT_INSTALLATION (RID_SFX_APP_START+94)
-#define IDS_SBERR_STOREREF (RID_SFX_APP_START+97)
-
#define CONFIG_PATH_START (RID_SFX_APP_START+98)
-#define STR_KEY_ADDINS_PATH (CONFIG_PATH_START+0)
-#define STR_KEY_AUTOCORRECT_DIR (CONFIG_PATH_START+1)
-#define STR_KEY_GLOSSARY_PATH (CONFIG_PATH_START+2)
-#define STR_KEY_BACKUP_PATH (CONFIG_PATH_START+3)
-#define STR_KEY_BASIC_PATH (CONFIG_PATH_START+4)
-#define STR_KEY_BITMAP_PATH (CONFIG_PATH_START+5)
-#define STR_KEY_CONFIG_DIR (CONFIG_PATH_START+6)
-#define STR_KEY_DICTIONARY_PATH (CONFIG_PATH_START+7)
-#define STR_KEY_FAVORITES_DIR (CONFIG_PATH_START+8)
-#define STR_KEY_FILTER_PATH (CONFIG_PATH_START+9)
-#define STR_KEY_GALLERY_DIR (CONFIG_PATH_START+10)
-#define STR_KEY_GRAPHICS_PATH (CONFIG_PATH_START+11)
-#define STR_KEY_HELP_DIR (CONFIG_PATH_START+12)
-#define STR_KEY_LINGUISTIC_DIR (CONFIG_PATH_START+13)
-#define STR_KEY_MODULES_PATH (CONFIG_PATH_START+14)
-#define STR_KEY_PALETTE_PATH (CONFIG_PATH_START+15)
-#define STR_KEY_PLUGINS_PATH (CONFIG_PATH_START+16)
-#define STR_KEY_STORAGE_DIR (CONFIG_PATH_START+17)
-#define STR_KEY_TEMP_PATH (CONFIG_PATH_START+18)
-#define STR_KEY_TEMPLATE_PATH (CONFIG_PATH_START+19)
-#define STR_KEY_USERCONFIG_PATH (CONFIG_PATH_START+20)
-#define STR_KEY_USERDICTIONARY_DIR (CONFIG_PATH_START+21)
-#define STR_KEY_WORK_PATH (CONFIG_PATH_START+22)
-
#define WIN_HELPINDEX (RID_SFX_APP_START+99)
#define TP_HELP_CONTENT (RID_SFX_APP_START+100)
#define TP_HELP_INDEX (RID_SFX_APP_START+101)
@@ -168,11 +84,6 @@
#define IMG_HELP_CONTENT_DOC_HC (RID_SFX_APP_START+125) // image
-#define IMG_MISSING_1 (RID_SFX_APP_START+126) // image
-#define IMG_MISSING_2 (RID_SFX_APP_START+127) // image
-#define IMG_MISSING_3 (RID_SFX_APP_START+128) // image
-#define IMG_MISSING_4 (RID_SFX_APP_START+129) // image
-
#define STR_HELP_WINDOW_TITLE (RID_SFX_APP_START+125) // string
#define STR_HELP_BUTTON_INDEX_ON (RID_SFX_APP_START+126)
@@ -236,8 +147,6 @@
#define RID_SECURITY_WARNING_HYPERLINK (RID_SFX_APP_START + 180)
#define RID_SECURITY_WARNING_TITLE (RID_SFX_APP_START + 181)
-#define RID_INVALID_URL_MSG (RID_SFX_APP_START + 182)
-#define RID_INVALID_URL_TITLE (RID_SFX_APP_START + 183)
#define RID_DESKTOP (RID_SFX_APP_START + 184)
// #define RID_XMLSEC_WARNING_BROKENSIGNATURE (RID_SFX_APP_START + 185)
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index f8a387bba79b..fa5a1fc1c335 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -75,60 +75,6 @@ InfoBox RID_DOCALREADYLOADED_DLG
Message [ en-US ] = "Document already open." ;
};
-ErrorBox RID_CANTLOADDOC_DLG
-{
- Message [ en-US ] = "Cannot open document." ;
-};
-
-ErrorBox MSG_ERR_READ_CFG
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "Error reading configuration file." ;
-};
-
-ErrorBox MSG_ERR_WRITE_CFG
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "Error writing configuration file." ;
-};
-
-ErrorBox MSG_ERR_OPEN_CFG
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "Error opening configuration file." ;
-};
-
-ErrorBox MSG_ERR_FILETYPE_CFG
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "File is not a configuration file." ;
-};
-
-ErrorBox MSG_ERR_VERSION_CFG
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "Configuration file contains the wrong version." ;
-};
-
-ErrorBox MSG_ERR_WRITE_SBL
-{
- BUTTONS = WB_OK ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "Error recording BASIC library in\n'@'." ;
-};
-
-ErrorBox MSG_SIGNAL
-{
- BUTTONS = WB_YES_NO ;
- DEFBUTTON = WB_DEF_YES ;
- Message [ en-US ] = "An unexpected program error has occurred.\n\nDo you want to try to save your changes in all open documents before the program is terminated?" ;
-};
-
ErrorBox MSG_ERR_NO_WEBBROWSER_FOUND
{
BUTTONS = WB_OK ;
@@ -141,89 +87,6 @@ Resource SID_UNKNOWN
String 1 "-" ;
};
-Resource BMP_SFX_COLOR
-{
- ExtraData =
- {
- SID_NEWDOC; // 043
- SID_OPENDOC; // 044
- SID_CLOSEDOC; // 045
- SID_RELOAD; // 046
- SID_SAVEASDOC; // 047
- SID_PRINTDOC; // 051
- SID_SETUPPRINTER; // 053
- SID_QUITAPP; // 054
- SID_UNDO; // 055
- SID_REDO; // 056
- SID_REPEAT; // 057
- SID_CUT; // 058
- SID_COPY; // 059
- SID_PASTE; // 060
- SID_DELETE; // 061
- SID_SELECTALL; // 062
- SID_SAVEDOC; // 063 vormals 046
- SID_EXITANDRETURN; // 064 vormals 054
- SID_RECORDMACRO; // 095
- SID_EDITMACRO; // 096
- SID_HELPMENU; // 098
- SID_CONFIG; // 123
- SID_CONFIGTOOLBOX; // 124
- 0;
- };
- Bitmap BMP_SFX_SMALL { File = "sco.bmp" ; };
- Bitmap BMP_SFX_LARGE { File = "lco.bmp" ; };
-};
-
-Resource BMP_SFX_MONO
-{
- ExtraData =
- {
- SID_NEWDOC; // 043
- SID_OPENDOC; // 044
- SID_CLOSEDOC; // 045
- SID_RELOAD; // 046
- SID_SAVEASDOC; // 047
- SID_PRINTDOC; // 051
- SID_SETUPPRINTER; // 053
- SID_QUITAPP; // 054
- SID_UNDO; // 055
- SID_REDO; // 056
- SID_REPEAT; // 057
- SID_CUT; // 058
- SID_COPY; // 059
- SID_PASTE; // 060
- SID_DELETE; // 061
- SID_SELECTALL; // 062
- SID_SAVEDOC; // 063 vormals 046
- SID_EXITANDRETURN; // 064 vormals 054
- SID_RECORDMACRO; // 095
- SID_EDITMACRO; // 096
- SID_HELPMENU; // 098
- SID_CONFIG; // 123
- SID_CONFIGTOOLBOX; // 124
- 0;
- };
- Bitmap BMP_SFX_SMALL { File = "smo.bmp" ; };
- Bitmap BMP_SFX_LARGE { File = "lmo.bmp" ; };
-};
-
-WarningBox RID_WARN_POST_MAILTO
-{
- BUTTONS = WB_OK_CANCEL ;
- DEFBUTTON = WB_DEF_OK ;
- Message [ en-US ] = "A form is to be sent by e-mail.\nThis means that the receiver will get to see your e-mail address." ;
-};
-
-String STR_RECOVER_TITLE
-{
- Text [ en-US ] = "File Recovery" ;
-};
-
-String STR_RECOVER_QUERY
-{
- Text [ en-US ] = "Should the file \"$1\" be restored?" ;
-};
-
String GID_INTERN
{
Text [ en-US ] = "Internal" ;
@@ -354,155 +217,16 @@ String GID_CONTROLS
Text [ en-US ] = "Controls" ;
};
-TabDialog SID_OPTIONS
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 244 , 155 ) ;
- Text [ en-US ] = "Options" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- TabControl 1
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 3 , 15 ) ;
- Size = MAP_APPFONT ( 221 , 130 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = RID_SFXPAGE_GENERAL ;
- Text [ en-US ] = "General" ;
- PageResID = 256 ;
- };
- PageItem
- {
- Identifier = RID_SFXPAGE_SAVE ;
- Text [ en-US ] = "Save" ;
- PageResID = 257 ;
- };
- PageItem
- {
- Identifier = RID_SFXPAGE_PATH ;
- Text [ en-US ] = "Paths" ;
- PageResID = 258 ;
- };
- PageItem
- {
- Identifier = RID_SFXPAGE_SPELL ;
- Text [ en-US ] = "Spellcheck" ;
- PageResID = 259 ;
- };
- };
- };
-};
-
InfoBox MSG_CANT_QUIT
{
Message [ en-US ] = "The application cannot be terminated at the moment.\nPlease wait until all print jobs and/or\nOLE actions have finished and close all dialogs." ;
};
-QueryBox MSG_IS_SERVER
-{
- Buttons = WB_YES_NO ;
- DefButton = WB_DEF_NO ;
- Message [ en-US ] = "This application is as object or print server active.\nDo you want to terminate anyway?" ;
-};
-
-String STR_NODOUBLE
-{
- Text [ en-US ] = "%PRODUCTNAME cannot be started more than once." ;
-};
-
-String STR_NOPRINTER
-{
- Text [ en-US ] = "Some %PRODUCTNAME functions will not work properly without a printer driver.\nPlease install a printer driver." ;
-};
-
String STR_ISMODIFIED
{
Text [ en-US ] = "Do you want to save the changes to %1?" ;
};
-String STR_AUTOSAVE
-{
- Text [ en-US ] = "AutoSave" ;
-};
-
-String STR_RESWARNING
-{
- Text [ en-US ] = "Limited system resources. Please quit other applications or close some windows before continuing." ;
-};
-String STR_RESEXCEPTION
-{
- Text [ en-US ] = "There are files missing. Please check application setup." ;
-};
-
-String STR_DOUBLEEXCEPTION
-{
- Text [ en-US ] = "Another error occurred during the save recovery.\nPossibly, the data could not be entirely saved." ;
-};
-
-String STR_SYSRESEXCEPTION
-{
- Text [ en-US ] = "System resources exhausted. Please restart the application." ;
-};
-
-ErrorBox MSG_ERR_SOINIT
-{
- Message [ en-US ] = "Error initializing object-system." ;
-};
-
-String MSG_IOERR_FILE_NOT_FOUND
-{
- Text [ en-US ] = "The file $(FILE) doesn't exist." ;
-};
-
-String MSG_IOERR_PATH_NOT_FOUND
-{
- Text [ en-US ] = "The path to file $(FILE) doesn't exist." ;
-};
-
-String MSG_IOERR_TOO_MANY_OPEN_FILES
-{
- Text [ en-US ] = "The file $(FILE) could not be opened,\nbecause too many files are open.\nPlease close some files and try again." ;
-};
-
-String MSG_IOERR_ACCESS_DENIED
-{
- Text [ en-US ] = "The file $(FILE) could not be opened due to missing access rights." ;
-};
-
-String MSG_IOERR_INVALID_ACCESS
-{
- Text [ en-US ] = "The file $(FILE) could not be accessed." ;
-};
-
-String MSG_IOERR_INVALID_HANDLE
-{
- Text [ en-US ] = "The file $(FILE) could not be opened due to an invalid file handle." ;
-};
-
-String MSG_IOERR_CANNOT_MAKE
-{
- Text [ en-US ] = "The file $(FILE) could not be created." ;
-};
-
-String MSG_IOERR_SHARING
-{
- Text [ en-US ] = "Error by shared access to $(FILE)." ;
-};
-
-String MSG_IOERR_INVALID_PARAMETER
-{
- Text [ en-US ] = "" ;
-};
-
-String MSG_IOERR_GENERAL
-{
- Text [ en-US ] = "General I/O error accessing $(FILE)." ;
-};
-
String RID_FULLSCREENTOOLBOX
{
Text = "" ;
@@ -538,41 +262,11 @@ ToolBox RID_FULLSCREENTOOLBOX
};
};
-String STR_ERR_NOTEMPLATE
-{
- Text [ en-US ] = "The selected template has an incorrect format" ;
-};
-
-String STR_ERR_NOFILE
-{
- Text [ en-US ] = "Can't open file $." ;
-};
-
String STR_QUITAPP
{
Text [ en-US ] = "E~xit" ;
};
-String STR_EXITANDRETURN
-{
- Text [ en-US ] = "E~xit & return to " ;
-};
-
-String STR_EXTHELPSTATUS
-{
- Text [ en-US ] = "Select a command or click to select a theme." ;
-};
-
-String STR_MAIL
-{
- Text [ en-US ] = "Mail" ;
-};
-
-String STR_ADDRESS_NAME
-{
- Text [ en-US ] = "Addresses" ;
-};
-
String RID_STR_HELP
{
Text [ en-US ] = "Help" ;
@@ -583,11 +277,6 @@ String RID_STR_NOAUTOSTARTHELPAGENT
Text [ en-US ] = "No automatic start at 'XX'" ;
};
-String RID_STR_NOWELCOMESCREEN
-{
- Text [ en-US ] = "Don't display tips" ;
-};
-
String RID_HELPBAR
{
Text [ en-US ] = "Help Bar" ;
@@ -653,11 +342,6 @@ String RID_STR_HLPFILENOTEXIST
Text [ en-US ] = "The help file for this topic is not installed." ;
};
-String RID_STR_HLPAPPNOTSTARTED
-{
- Text [ en-US ] = "The help system could not be started" ;
-};
-
//----------------------------------------------------------------------------
String RID_ENVTOOLBOX
@@ -670,129 +354,6 @@ String RID_SPECIALCONFIG_ERROR
Text [ en-US ] = "An error has occurred in the special configuration.\nPlease contact your administrator." ;
};
-String STR_MEMINFO_HEADER
-{
-};
-
-String STR_MEMINFO_FOOTER
-{
- Text = "</table>" ;
-};
-
-String STR_MEMINFO_OBJINFO
-{
- Text = "<tr><td >$(VISIBLE)</td><td>$(CACHED)</td><td>$(EXPIRE)</td><td>$(JSDIRTY)</td><td>$(JSEXEC)</td><td>$(FORBID)</td><td>$(FACTORY)</td><td>$(URL)</td><td>$(ORIGURL)</td><td>$(POSTSTRING)</td></tr>" ;
-};
-
-String RID_PLUGIN
-{
- Text [ en-US ] = "Enable plug-ins" ;
-};
-
-String STR_CORRUPT_INSTALLATION
-{
- Text [ en-US ] = "Important program components could not be initialized correctly.\nPlease start the setup program with the option /Repair." ;
-};
-
-String IDS_SBERR_STOREREF
-{
- Text [ en-US ] = "Reference will not be saved: " ;
-};
-
-String STR_KEY_CONFIG_DIR
-{
- Text [ en-US ] = "Configuration" ;
-};
-String STR_KEY_WORK_PATH
-{
- Text [ en-US ] = "My Documents" ;
-};
-String STR_KEY_GRAPHICS_PATH
-{
- Text [ en-US ] = "Graphics" ;
-};
-String STR_KEY_BITMAP_PATH
-{
- Text [ en-US ] = "Icons" ;
-};
-String STR_KEY_BASIC_PATH
-{
- Text = "BASIC" ;
-};
-
-String STR_KEY_PALETTE_PATH
-{
- Text [ en-US ] = "Palettes" ;
-};
-String STR_KEY_BACKUP_PATH
-{
- Text [ en-US ] = "Backups" ;
-};
-String STR_KEY_MODULES_PATH
-{
- Text [ en-US ] = "Modules" ;
-};
-String STR_KEY_TEMPLATE_PATH
-{
- Text [ en-US ] = "Templates" ;
-};
-String STR_KEY_GLOSSARY_PATH
-{
- Text [ en-US ] = "AutoText" ;
-};
-String STR_KEY_DICTIONARY_PATH
-{
- Text [ en-US ] = "Dictionaries" ;
-};
-String STR_KEY_HELP_DIR
-{
- Text [ en-US ] = "Help" ;
-};
-String STR_KEY_GALLERY_DIR
-{
- Text [ en-US ] = "Gallery" ;
-};
-
-String STR_KEY_STORAGE_DIR
-{
- Text [ en-US ] = "Message Storage" ;
-};
-String STR_KEY_TEMP_PATH
-{
- Text [ en-US ] = "Temporary files" ;
-};
-String STR_KEY_PLUGINS_PATH
-{
- Text [ en-US ] = "Plug-ins" ;
-};
-String STR_KEY_FAVORITES_DIR
-{
- Text [ en-US ] = "Folder Bookmarks" ;
-};
-String STR_KEY_FILTER_PATH
-{
- Text [ en-US ] = "Filters" ;
-};
-String STR_KEY_ADDINS_PATH
-{
- Text [ en-US ] = "Add-ins" ;
-};
-String STR_KEY_USERCONFIG_PATH
-{
- Text [ en-US ] = "User Configuration" ;
-};
-String STR_KEY_USERDICTIONARY_DIR
-{
- Text [ en-US ] = "User-defined dictionaries" ;
-};
-String STR_KEY_AUTOCORRECT_DIR
-{
- Text [ en-US ] = "AutoCorrect" ;
-};
-String STR_KEY_LINGUISTIC_DIR
-{
- Text [ en-US ] = "Writing aids" ;
-};
String STR_QUICKSTART_EXIT
{
Text [ en-US ] = "Exit Quickstarter" ;
@@ -867,17 +428,6 @@ String RID_SECURITY_WARNING_TITLE
Text [ en-US ] = "Security Warning" ;
};
-ErrorBox RID_INVALID_URL_MSG
-{
- Buttons = WB_OK ;
- Message [ en-US ] = "The URL is not valid." ;
-};
-
-String RID_INVALID_URL_TITLE
-{
- Text = "%PRODUCTNAME %PRODUCTVERSION" ;
-};
-
String RID_DESKTOP
{
Text = "%PRODUCTNAME" ;
@@ -910,26 +460,6 @@ String RID_XMLSEC_DOCUMENTSIGNED
Text [ en-US ] = " (Signed)" ;
};
-Image IMG_MISSING_1
-{
- ImageBitmap = Bitmap { File = "sc05539.bmp" ; };
-};
-
-Image IMG_MISSING_2
-{
- ImageBitmap = Bitmap { File = "sc05700.bmp" ; };
-};
-
-Image IMG_MISSING_3
-{
- ImageBitmap = Bitmap { File = "sc06302.bmp" ; };
-};
-
-Image IMG_MISSING_4
-{
- ImageBitmap = Bitmap { File = "sn064.bmp" ; };
-};
-
String STR_STANDARD
{
Text [ en-US ] = "Standard" ;
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 7e775cbbb502..3dfe8c6a855b 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -73,7 +73,6 @@
#include "sfx2/minfitem.hxx"
#include "app.hrc"
#include <sfx2/evntconf.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/request.hxx>
#include <sfx2/dinfdlg.hxx>
#include "appdata.hxx"
@@ -257,12 +256,6 @@ SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject,
BasicManager* SfxApplication::GetBasicManager()
{
-// DBG_ASSERT( pAppData_Impl->nBasicCallLevel != 0,
-// "unnecessary call to GetBasicManager() - inefficient!" );
- if ( pAppData_Impl->nBasicCallLevel == 0 )
- // sicherheitshalber
- EnterBasicCall();
-
return BasicManagerRepository::getApplicationBasicManager( true );
}
@@ -291,106 +284,6 @@ StarBASIC* SfxApplication::GetBasic()
return GetBasicManager()->GetLib(0);
}
-//--------------------------------------------------------------------
-
-FASTBOOL SfxApplication::IsInBasicCall() const
-{
- return 0 != pAppData_Impl->nBasicCallLevel;
-}
-
-//--------------------------------------------------------------------
-
-void SfxApplication::EnterBasicCall()
-{
- if ( 1 == ++pAppData_Impl->nBasicCallLevel )
- {
- DBG_TRACE( "SfxShellObject: BASIC-on-demand" );
-
- // das kann l"anger dauern, da Progress nicht geht, wenigstens Sanduhr
-//(mba)/task SfxWaitCursor aWait;
-
- // zuerst das BASIC laden
- GetBasic();
-/*
- // als erstes SfxShellObject das SbxObject der SfxApplication erzeugen
- SbxObject *pSbx = GetSbxObject();
- DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject for SfxApplication" );
-
- // die SbxObjects aller Module erzeugen
- SfxModuleArr_Impl& rArr = GetModules_Impl();
- for ( sal_uInt16 n = 0; n < rArr.Count(); ++n )
- {
- SfxModule *pMod = rArr.GetObject(n);
- if ( pMod->IsLoaded() )
- {
- pSbx = pMod->GetSbxObject();
- DBG_ASSERT( pSbx, "SfxModule: can't create SbxObject" );
- }
- }
-
- // die SbxObjects aller Tasks erzeugen
- for ( SfxTask *pTask = SfxTask::GetFirst(); pTask; pTask = SfxTask::GetNext( *pTask ) )
- pTask->GetSbxObject();
-
- // die SbxObjects aller SfxObjectShells erzeugen (ggf. Frame-los!)
- for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst( NULL, sal_False );
- pObjSh;
- pObjSh = SfxObjectShell::GetNext(*pObjSh, NULL, sal_False) )
- {
- // kein IP-Object oder wenn doch dann initialisiert?
- SvStorageRef aStorage;
- if ( !pObjSh->IsHandsOff() )
- aStorage = pObjSh->GetStorage();
- if ( !pObjSh->GetInPlaceObject() || aStorage.Is() )
- {
- DBG( DbgOutf( "SfxShellObject: BASIC-on-demand for %s",
- pObjSh->SfxShell::GetName().GetBuffer() ) );
- pSbx = pObjSh->GetSbxObject();
- DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" );
- }
- }
-
- // die SbxObjects der SfxShells auf den Stacks der Frames erzeugen
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,sal_False);
- pFrame;
- pFrame = SfxViewFrame::GetNext(*pFrame,0,0,sal_False) )
- {
- // den Dispatcher des Frames rausholen
- SfxDispatcher *pDispat = pFrame->GetDispatcher();
- pDispat->Flush();
-
- // "uber alle SfxShells auf dem Stack des Dispatchers iterieren
- // Frame selbst wird ausgespart, da er indirekt angezogen wird,
- // sofern er ein Dokument enth"alt.
- for ( sal_uInt16 nStackIdx = pDispat->GetShellLevel(*pFrame);
- 0 != nStackIdx;
- --nStackIdx )
- {
- DBG( DbgOutf( "SfxShellObject: BASIC-on-demand for level %u", nStackIdx-1 ); )
- pSbx = pDispat->GetShell(nStackIdx - 1)->GetSbxObject();
- DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" );
- }
-
- if ( !pFrame->GetObjectShell() )
- {
- DBG( DbgOutf( "SfxShellObject: BASIC-on-demand for empty frame" ); )
- pSbx = pFrame->GetSbxObject();
- DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" );
- }
- }
-*/
- // Factories anmelden
-// SbxBase::AddFactory( new SfxSbxObjectFactory_Impl );
- }
-}
-
-//--------------------------------------------------------------------
-
-void SfxApplication::LeaveBasicCall()
-{
- --pAppData_Impl->nBasicCallLevel;
-}
-
//-------------------------------------------------------------------------
void SfxApplication::PropExec_Impl( SfxRequest &rReq )
{
@@ -445,10 +338,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
break;
}
- case SID_PLAYMACRO:
- PlayMacro_Impl( rReq, GetBasic() );
- break;
-
case SID_OFFICE_PRIVATE_USE:
case SID_OFFICE_COMMERCIAL_USE:
{
@@ -523,68 +412,3 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet )
}
}
-//--------------------------------------------------------------------
-void SfxApplication::MacroExec_Impl( SfxRequest& rReq )
-{
- DBG_MEMTEST();
- if ( SfxMacroConfig::IsMacroSlot( rReq.GetSlot() ) )
- {
- // SlotId referenzieren, damit nicht im Execute der Slot abgeschossen
- // werden kann
- GetMacroConfig()->RegisterSlotId(rReq.GetSlot());
- SFX_REQUEST_ARG(rReq, pArgs, SfxStringItem,
- rReq.GetSlot(), sal_False);
- String aArgs;
- if( pArgs ) aArgs = pArgs->GetValue();
- if ( GetMacroConfig()->ExecuteMacro(rReq.GetSlot(), aArgs ) )
- rReq.Done();
- GetMacroConfig()->ReleaseSlotId(rReq.GetSlot());
- }
-}
-
-//--------------------------------------------------------------------
-void SfxApplication::MacroState_Impl( SfxItemSet& )
-{
- DBG_MEMTEST();
-}
-
-//-------------------------------------------------------------------------
-
-void SfxApplication::PlayMacro_Impl( SfxRequest &rReq, StarBASIC *pBasic )
-{
- EnterBasicCall();
- sal_Bool bOK = sal_False;
-
- // Makro und asynch-Flag
- SFX_REQUEST_ARG(rReq,pMacro,SfxStringItem,SID_STATEMENT,sal_False);
- SFX_REQUEST_ARG(rReq,pAsynch,SfxBoolItem,SID_ASYNCHRON,sal_False);
-
- if ( pAsynch && pAsynch->GetValue() )
- {
- // asynchron ausf"uhren
- GetDispatcher_Impl()->Execute( SID_PLAYMACRO, SFX_CALLMODE_ASYNCHRON, pMacro, 0L );
- rReq.Done();
- }
- else if ( pMacro )
- {
- // Statement aufbereiten
- DBG_ASSERT( pBasic, "no BASIC found" ) ;
- String aStatement( '[' );
- aStatement += pMacro->GetValue();
- aStatement += ']';
-
- // P"aventiv den Request abschlie\sen, da er ggf. zerst"ort wird
- rReq.Done();
- rReq.ReleaseArgs();
-
- // Statement ausf"uhren
- pBasic->Execute( aStatement );
- bOK = 0 == SbxBase::GetError();
- SbxBase::ResetError();
- }
-
- LeaveBasicCall();
- rReq.SetReturnValue(SfxBoolItem(0,bOK));
-}
-
-
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index c876db373d35..e94635063727 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -88,7 +88,6 @@
#include <sfx2/evntconf.hxx>
#include "appdata.hxx"
#include "workwin.hxx"
-#include <sfx2/macrconf.hxx>
#include "helper.hxx" // SfxContentHelper::...
#include "app.hrc"
#include "sfx2/sfxresid.hxx"
@@ -718,7 +717,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
pSh;
++nIdx, pSh = pDispat->GetShell(nIdx) )
{
- SfxUndoManager *pShUndoMgr = pSh->GetUndoManager();
+ ::svl::IUndoManager *pShUndoMgr = pSh->GetUndoManager();
if ( pShUndoMgr )
pShUndoMgr->SetMaxUndoActionCount( nUndoCount );
}
@@ -987,26 +986,9 @@ BOOL SfxApplication::SaveAll_Impl(BOOL bPrompt, BOOL bAutoSave)
//--------------------------------------------------------------------
-SfxMacroConfig* SfxApplication::GetMacroConfig() const
-{
- return SfxMacroConfig::GetOrCreate();
-}
-
-//--------------------------------------------------------------------
-SfxEventConfiguration* SfxApplication::GetEventConfig() const
-{
- if (!pAppData_Impl->pEventConfig)
- pAppData_Impl->pEventConfig = new SfxEventConfiguration;
- return pAppData_Impl->pEventConfig;
-}
-
-//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, FASTBOOL bSynchron )
{
- //DBG_ASSERT(pAppData_Impl->pEventConfig,"Keine Events angemeldet!");
-
SfxObjectShell *pDoc = rEventHint.GetObjShell();
if ( pDoc && ( pDoc->IsPreview() || !pDoc->Get_Impl()->bInitialized ) )
return;
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 32b56717293c..ce0dda051886 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -102,7 +102,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) :
pAppDispatch(NULL),
pTemplates( 0 ),
pPool(0),
- pEventConfig(0),
pDisabledSlotList( 0 ),
pSecureURLs(0),
pSaveOptions( 0 ),
@@ -112,7 +111,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* ) :
pTemplateCommon( 0 ),
nDocModalMode(0),
nAutoTabPageId(0),
- nBasicCallLevel(0),
nRescheduleLocks(0),
nInReschedule(0),
nAsynchronCalls(0),
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 808731f8bba8..55a8764ac0c5 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -38,6 +38,7 @@
#include <sfx2/linkmgr.hxx>
#include <tools/urlobj.hxx>
+#include <tools/diagnose_ex.h>
#include <unotools/pathoptions.hxx>
#ifndef GCC
#endif
@@ -197,11 +198,9 @@ long SfxApplication::DdeExecute
else
{
// alle anderen per BASIC
- EnterBasicCall();
StarBASIC* pBasic = GetBasic();
- DBG_ASSERT( pBasic, "Wo ist mein Basic???" );
+ ENSURE_OR_RETURN( pBasic, "where's my basic?", 0 );
SbxVariable* pRet = pBasic->Execute( rCmd );
- LeaveBasicCall();
if( !pRet )
{
SbxBase::ResetError();
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 2aa19901d87c..a3d25de8ee61 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -74,7 +74,6 @@
#include <sfx2/docfac.hxx>
#include <sfx2/evntconf.hxx>
#include "intro.hxx"
-#include <sfx2/macrconf.hxx>
#include <sfx2/mnumgr.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/progress.hxx>
@@ -86,7 +85,7 @@
#include <sfx2/fcontnr.hxx>
#include "helper.hxx" // SfxContentHelper::Kill()
#include "sfxpicklist.hxx"
-#include <tools/svlibrary.hxx>
+#include <tools/svlibrary.hxx>
#ifdef UNX
#define stricmp(a,b) strcmp(a,b)
@@ -213,7 +212,7 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont)
{
bDetermineFunction = true;
- static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "cui" ) ) );
+ static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "cui" ) ) );
oslModule handleMod = osl_loadModuleRelative(
&thisModule, aLibName.pData, 0 );
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index e7d0fd70bf58..2a5456989aa7 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -44,6 +44,7 @@
#include "app.hrc"
#include <sfx2/app.hxx>
+#include <sfx2/evntconf.hxx>
#include <sfx2/unoctitm.hxx>
#include "appdata.hxx"
#include <sfx2/viewsh.hxx>
@@ -52,7 +53,6 @@
#include "arrdecl.hxx"
#include "sfx2/sfxresid.hxx"
#include <sfx2/event.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/mnumgr.hxx>
#include <sfx2/templdlg.hxx>
#include <sfx2/msgpool.hxx>
@@ -149,8 +149,6 @@ void SfxApplication::Deinitialize()
delete pAppData_Impl->pLabelResMgr;
DELETEX(pAppData_Impl->pSlotPool);
- DELETEX(pAppData_Impl->pEventConfig);
- SfxMacroConfig::Release_Impl();
DELETEX(pAppData_Impl->pFactArr);
DELETEX(pAppData_Impl->pInitLinkList);
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index c1858c5b33fb..d90e68d6c764 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -107,7 +107,6 @@
#include <sfx2/new.hxx>
#include <sfx2/templdlg.hxx>
#include "sfxtypes.hxx"
-#include "sfxbasic.hxx"
#include <sfx2/tabdlg.hxx>
#include "arrdecl.hxx"
#include "fltfnc.hxx"
@@ -118,7 +117,6 @@
#include "arrdecl.hxx"
#include <sfx2/childwin.hxx>
#include "appdata.hxx"
-#include <sfx2/macrconf.hxx>
#include "sfx2/minfitem.hxx"
#include <sfx2/event.hxx>
#include <sfx2/module.hxx>
@@ -129,7 +127,7 @@
#include <sfx2/dialogs.hrc>
#include "sorgitm.hxx"
#include "sfx2/sfxhelp.hxx"
-#include <tools/svlibrary.hxx>
+#include <tools/svlibrary.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
@@ -746,7 +744,7 @@ extern "C" { static void SAL_CALL thisModule() {} }
::rtl::OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, BOOL bChooseOnly, const ::rtl::OUString& rMacroDesc = ::rtl::OUString() )
{
// get basctl dllname
- static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
+ static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
// load module
oslModule handleMod = osl_loadModuleRelative(
@@ -766,7 +764,7 @@ extern "C" { static void SAL_CALL thisModule() {} }
void MacroOrganizer( INT16 nTabId )
{
// get basctl dllname
- static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
+ static ::rtl::OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "basctl" ) ) );
// load module
oslModule handleMod = osl_loadModuleRelative(
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 60b684d7385f..9d2025d1e23e 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -94,6 +94,7 @@
#include <tools/cachestr.hxx>
#include <osl/mutex.hxx>
#include <comphelper/sequence.hxx>
+#include <framework/documentundoguard.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/interaction.hxx>
@@ -116,7 +117,6 @@ using namespace ::com::sun::star::io;
#include <sfx2/fcontnr.hxx>
#include "frmload.hxx"
#include <sfx2/frame.hxx>
-#include "sfxbasic.hxx"
#include <sfx2/objsh.hxx>
#include <sfx2/objuno.hxx>
#include <sfx2/unoctitm.hxx>
@@ -1770,12 +1770,9 @@ void SAL_CALL SfxMacroLoader::removeStatusListener(
{
}
-// -----------------------------------------------------------------------
ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::uno::Any& rRetval, SfxObjectShell* pSh )
throw ( ::com::sun::star::uno::RuntimeException )
{
- SfxApplication* pApp = SFX_APP();
- pApp->EnterBasicCall();
SfxObjectShell* pCurrent = pSh;
if ( !pCurrent )
// all not full qualified names use the BASIC of the given or current document
@@ -1821,18 +1818,21 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::
if ( pBasMgr )
{
- if ( pSh && pDoc )
+ const bool bIsAppBasic = ( pBasMgr == pAppMgr );
+ const bool bIsDocBasic = ( pBasMgr != pAppMgr );
+
+ if ( pDoc )
{
- // security check for macros from document basic if an SFX context (pSh) is given
+ // security check for macros from document basic if an SFX doc is given
if ( !pDoc->AdjustMacroMode( String() ) )
// check forbids execution
return ERRCODE_IO_ACCESSDENIED;
}
- else if ( pSh && pSh->GetMedium() )
+ else if ( pDoc && pDoc->GetMedium() )
{
- pSh->AdjustMacroMode( String() );
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False);
+ pDoc->AdjustMacroMode( String() );
+ SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False);
if ( pUpdateDocItem && pMacroExecModeItem
&& pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE
&& pMacroExecModeItem->GetValue() == document::MacroExecMode::NEVER_EXECUTE )
@@ -1849,79 +1849,49 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::
aQualifiedMethod.Erase( nArgsPos - nHashPos - 1 );
}
- SbxMethod *pMethod = SfxQueryMacro( pBasMgr, aQualifiedMethod );
- if ( pMethod )
+ if ( pBasMgr->HasMacro( aQualifiedMethod ) )
{
- // arguments must be quoted
- String aQuotedArgs;
- if ( aArgs.Len()<2 || aArgs.GetBuffer()[1] == '\"')
- // no args or already quoted args
- aQuotedArgs = aArgs;
- else
+ Any aOldThisComponent;
+ const bool bSetDocMacroMode = ( pDoc != NULL ) && bIsDocBasic;
+ const bool bSetGlobalThisComponent = ( pDoc != NULL ) && bIsAppBasic;
+ if ( bSetDocMacroMode )
{
- // quote parameters
- aArgs.Erase(0,1);
- aArgs.Erase( aArgs.Len()-1,1);
-
- aQuotedArgs = '(';
-
- sal_uInt16 nCount = aArgs.GetTokenCount(',');
- for ( sal_uInt16 n=0; n<nCount; n++ )
- {
- aQuotedArgs += '\"';
- aQuotedArgs += aArgs.GetToken( n, ',' );
- aQuotedArgs += '\"';
- if ( n<nCount-1 )
- aQuotedArgs += ',';
- }
-
- aQuotedArgs += ')';
+ // mark document: it executes an own macro, so it's in a modal mode
+ pDoc->SetMacroMode_Impl( TRUE );
}
- Any aOldThisComponent;
- if ( pSh )
+ if ( bSetGlobalThisComponent )
{
- if ( pBasMgr != pAppMgr )
- // mark document: it executes an own macro, so it's in a modal mode
- pSh->SetMacroMode_Impl( TRUE );
- if ( pBasMgr == pAppMgr )
- {
- // document is executed via AppBASIC, adjust ThisComponent variable
- aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pSh->GetModel() ) );
- }
+ // document is executed via AppBASIC, adjust ThisComponent variable
+ aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pDoc->GetModel() ) );
}
- // add quoted arguments and do the call
- String aCall( '[' );
- aCall += pMethod->GetName();
- aCall += aQuotedArgs;
- aCall += ']';
-
// just to let the shell be alive
- SfxObjectShellRef rSh = pSh;
+ SfxObjectShellRef xKeepDocAlive = pDoc;
- // execute function using its Sbx parent,
- //SbxVariable* pRet = pMethod->GetParent()->Execute( aCall );
- //rRetval = sbxToUnoValue( pRet );
-
- SbxVariable* pRet = pMethod->GetParent()->Execute( aCall );
- if ( pRet )
{
- USHORT nFlags = pRet->GetFlags();
- pRet->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST );
- rRetval = sbxToUnoValue( pRet );
- pRet->SetFlags( nFlags );
+ // attempt to protect the document against the script tampering with its Undo Context
+ ::std::auto_ptr< ::framework::DocumentUndoGuard > pUndoGuard;
+ if ( bIsDocBasic )
+ pUndoGuard.reset( new ::framework::DocumentUndoGuard( pDoc->GetModel() ) );
+
+ // execute the method
+ SbxVariableRef retValRef = new SbxVariable;
+ nErr = pBasMgr->ExecuteMacro( aQualifiedMethod, aArgs, retValRef );
+ if ( nErr == ERRCODE_NONE )
+ rRetval = sbxToUnoValue( retValRef );
}
- nErr = SbxBase::GetError();
- if ( ( pBasMgr == pAppMgr ) && pSh )
+ if ( bSetGlobalThisComponent )
{
pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent );
}
- if ( pSh && pSh->GetModel().is() )
- // remove flag for modal mode
- pSh->SetMacroMode_Impl( FALSE );
+ if ( bSetDocMacroMode )
+ {
+ // remove flag for modal mode
+ pDoc->SetMacroMode_Impl( FALSE );
+ }
}
else
nErr = ERRCODE_BASIC_PROC_UNDEFINED;
@@ -1940,7 +1910,6 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::
nErr = SbxBase::GetError();
}
- pApp->LeaveBasicCall();
SbxBase::ResetError();
return nErr;
}
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 12f824ea4255..06e17e232041 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -111,7 +111,6 @@ using namespace ::vos;
#include <unotools/syslocale.hxx>
#include "sfx2/sfxhelp.hxx"
-#include "sfxbasic.hxx"
#include <sfx2/docfilt.hxx>
#include <sfx2/docfac.hxx>
#include "sfxtypes.hxx"
@@ -590,37 +589,6 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
if( STRING_NOTFOUND != aFlags.Search( 'H' ) )
bHidden = sal_True;
}
-/*
- if ( ( !pFilter || nErr == ERRCODE_SFX_CONSULTUSER ) && !bAPI && !bHidden )
- {
- if ( !pFilter )
- pFilter = pOldFilter;
-
- String aTmpName;
- if ( pFilter )
- aTmpName = pFilter->GetUIName();
-
- SfxFilterMatcher *pMatcher;
- if( bPlugIn && pFilter )
- pMatcher = new SfxFilterMatcher( (SfxFilterContainer *) pFilter->GetFilterContainer() );
- else
- pMatcher = (SfxFilterMatcher*) this;
-
- SfxFilterDialog *pDlg = new SfxFilterDialog( 0, &rMedium, *pMatcher, pFilter ? &aTmpName: 0, 0 );
- const sal_Bool bOk = RET_OK == pDlg->Execute();
- if (bOk)
- pFilter = pMatcher->GetFilter4UIName( pDlg->GetSelectEntry());
-
- if( bPlugIn && pFilter )
- delete pMatcher;
- delete pDlg;
-
- if ( !bOk)
- nErr = ERRCODE_ABORT;
- else
- nErr = ERRCODE_NONE;
- }
-*/
*ppFilter = pFilter;
if ( bHidden || (bAPI && nErr == ERRCODE_SFX_CONSULTUSER) )
@@ -773,22 +741,6 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF
const SfxFilter* SfxFilterMatcher::GetFilter4ClipBoardId( sal_uInt32 nId, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
{
- /*
- if ( pImpl->pList )
- {
- sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count();
- for( sal_uInt16 n = 0; n < nCount; n++ )
- {
- const SfxFilter* pFilter = pImpl->pList->GetObject( n );
- SfxFilterFlags nFlags = pFilter->GetFilterFlags();
- if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetFormat() == nId )
- return pFilter;
- }
-
- return 0;
- }
- */
-
if (nId == 0)
return 0;
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 59c56cc291a7..2ab7b1c9602b 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -42,7 +42,7 @@
#include <framework/eventsconfiguration.hxx>
#include <comphelper/processfactory.hxx>
#include <sfx2/evntconf.hxx>
-#include <sfx2/macrconf.hxx>
+
#include <sfx2/docfile.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 40f6346de8ee..cf04de2cb3a4 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -64,7 +64,6 @@
#include <sfx2/objface.hxx>
#include "sfxtypes.hxx"
#include "workwin.hxx"
-#include <sfx2/macrconf.hxx>
#include <sfx2/unoctitm.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/sfxuno.hxx>
@@ -1118,13 +1117,7 @@ void SfxBindings::Release( SfxControllerItem& rItem )
delete (*pImp->pCaches)[nPos];
pImp->pCaches->Remove(nPos, 1);
#endif
- if ( SfxMacroConfig::IsMacroSlot( nId ) )
- {
- delete (*pImp->pCaches)[nPos];
- pImp->pCaches->Remove(nPos, 1);
- }
- else
- pImp->bCtrlReleased = sal_True;
+ pImp->bCtrlReleased = sal_True;
}
}
@@ -1474,7 +1467,7 @@ SfxItemSet* SfxBindings::CreateSet_Impl
rFound.Insert( pFound );
USHORT nSlot = pRealSlot->GetSlotId();
- if ( !SfxMacroConfig::IsMacroSlot( nSlot ) && !(nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) )
+ if ( !(nSlot >= SID_VERB_START && nSlot <= SID_VERB_END) )
{
pInterface = pInterface->GetRealInterfaceForSlot( pRealSlot );
DBG_ASSERT (pInterface,"Slot in angegebener Shell nicht gefunden!");
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index c08d713547a0..ddf3422744cb 100755
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -69,7 +69,6 @@
#include "slotserv.hxx"
#include <sfx2/ipclient.hxx>
#include "sfxtypes.hxx"
-#include <sfx2/macrconf.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/childwin.hxx>
@@ -159,7 +158,6 @@ struct SfxDispatcher_Impl
SfxObjectBars_Impl aObjBars[SFX_OBJECTBAR_MAX];
SfxObjectBars_Impl aFixedObjBars[SFX_OBJECTBAR_MAX];
SvULongs aChildWins;
- sal_uInt16 nActionLevel; // in EnterAction
sal_uInt32 nEventId; // EventId UserEvent
sal_Bool bUILocked; // Update abgeklemmt (!zappeln)
sal_Bool bNoUI; // UI nur vom Parent Dispatcher
@@ -367,7 +365,6 @@ void SfxDispatcher::Construct_Impl( SfxDispatcher* pParent )
pImp->pParent = pParent;
pImp->bInvalidateOnUnlock = sal_False;
- pImp->nActionLevel = 0;
for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
pImp->aObjBars[n].nResId = 0;
@@ -488,9 +485,6 @@ void SfxDispatcher::Pop
DBG_MEMTEST();
DBG_ASSERT( rShell.GetInterface(),
"pushing SfxShell without previous RegisterInterface()" );
- DBG_ASSERT( pImp->nActionLevel == 0, "Push or Pop within Action" );
-// DBG_ASSERT( SFX_APP()->IsInAsynchronCall_Impl(),
-// "Dispatcher Push/Pop in synchron-call-stack" );
bool bDelete = (nMode & SFX_SHELL_POP_DELETE) == SFX_SHELL_POP_DELETE;
bool bUntil = (nMode & SFX_SHELL_POP_UNTIL) == SFX_SHELL_POP_UNTIL;
@@ -1029,10 +1023,6 @@ void SfxDispatcher::_Execute
if ( IsLocked( rSlot.GetSlotId() ) )
return;
- sal_uInt16 nSlot = rSlot.GetSlotId();
- if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
- SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot );
-
if ( (eCallMode & SFX_CALLMODE_ASYNCHRON) ||
( !(eCallMode & SFX_CALLMODE_SYNCHRON) &&
rSlot.IsMode(SFX_SLOT_ASYNCHRON) ) )
@@ -1618,38 +1608,6 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq )
return 0;
}
//--------------------------------------------------------------------
-void SfxDispatcher::EnterAction( const String& rName )
-
-// marks the beginning of a block of actions
-
-{
- DBG_MEMTEST();
- Flush();
- DBG_ASSERT( pImp->aStack.Count() > 0, "EnterAction on empty dispatcher stack" );
- if ( ++pImp->nActionLevel == 1 )
- {
- SfxUndoManager *pUndoMgr = GetShell(0)->GetUndoManager();
- if ( pUndoMgr )
- pUndoMgr->EnterListAction( rName, rName HACK(RepeatComment), 0 HACK(ID) );
- }
-}
-//--------------------------------------------------------------------
-void SfxDispatcher::LeaveAction()
-
-// marks the end of a block of actions
-
-{
- DBG_MEMTEST();
- DBG_ASSERT( pImp->nActionLevel > 0, "EnterAction without LeaveAction" );
- if ( --pImp->nActionLevel == 0 )
- {
- SfxUndoManager *pUndoMgr = GetShell(0)->GetUndoManager();
- if ( pUndoMgr )
- pUndoMgr->LeaveListAction();
- }
-}
-
-//--------------------------------------------------------------------
void SfxDispatcher::SetMenu_Impl()
{
if ( pImp->pFrame )
@@ -2298,7 +2256,6 @@ sal_Bool SfxDispatcher::_FindServer
SFX_STACK(SfxDispatcher::_FindServer);
// Dispatcher gelockt? (SID_HELP_PI trotzdem durchlassen)
- SfxApplication *pSfxApp = SFX_APP();
if ( IsLocked(nSlot) )
{
pImp->bInvalidateOnUnlock = sal_True;
@@ -2318,25 +2275,8 @@ sal_Bool SfxDispatcher::_FindServer
}
}
- // Makro-Slot?
- if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
- {
- const SfxMacroInfo* pInfo = pSfxApp->GetMacroConfig()->GetMacroInfo(nSlot);
- if ( pInfo )
- {
- const SfxSlot* pSlot = pInfo->GetSlot();
- if ( pSlot )
- {
- rServer.SetShellLevel(nTotCount-1);
- rServer.SetSlot( pSlot );
- return sal_True;
- }
- }
-
- return sal_False;
- }
// Verb-Slot?
- else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END)
+ if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END)
{
for ( sal_uInt16 nShell = 0;; ++nShell )
{
@@ -2474,10 +2414,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot )
nTotCount = nTotCount + pImp->aStack.Count();
}
- if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
- // Makro-Slot?
- return sal_True;
- else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END)
+ if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END)
{
// Verb-Slot?
for ( sal_uInt16 nShell = 0;; ++nShell )
@@ -2658,10 +2595,6 @@ const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr )
{
Flush();
- sal_uInt16 nSlot = pSlot->GetSlotId();
- if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
- SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot );
-
if ( pSlot->IsMode(SFX_SLOT_ASYNCHRON) )
//! ignoriert rSvr
{
diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx
deleted file mode 100644
index 079c7180ac1a..000000000000
--- a/sfx2/source/control/macrconf.cxx
+++ /dev/null
@@ -1,874 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-#include <basic/sbstar.hxx>
-#include <basic/basmgr.hxx>
-#ifndef _SBX_HXX //autogen
-#include <basic/sbx.hxx>
-#endif
-#include <svl/intitem.hxx>
-#include <basic/sbmeth.hxx>
-#include <basic/sbmod.hxx>
-#ifndef _BASIC_SBUNO_HXX
-#include <basic/sbuno.hxx>
-#endif
-
-#include <osl/mutex.hxx>
-
-#include <com/sun/star/script/XEngine.hpp>
-#include <com/sun/star/document/MacroExecMode.hpp>
-
-#ifndef GCC
-#endif
-
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif
-#include <unotools/intlwrapper.hxx>
-
-#include <sfx2/msgpool.hxx>
-#include <sfx2/macrconf.hxx>
-#include "sfxbasic.hxx"
-#include <sfx2/sfx.hrc>
-#include <sfx2/app.hxx>
-#include <sfx2/objsh.hxx>
-#include <sfx2/dispatch.hxx>
-#include "sfx2/minfitem.hxx"
-#include "sfx2/imgmgr.hxx"
-#include <sfx2/evntconf.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/genlink.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <appdata.hxx>
-#include "objshimp.hxx"
-#include <sfx2/request.hxx>
-
-static const sal_uInt16 nCompatVersion = 2;
-static const sal_uInt16 nVersion = 3;
-
-// Static member
-SfxMacroConfig* SfxMacroConfig::pMacroConfig = NULL;
-
-SfxMacroConfig* SfxMacroConfig::GetOrCreate()
-{
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pMacroConfig )
- pMacroConfig = new SfxMacroConfig;
- return pMacroConfig;
-}
-
-void SfxMacroConfig::Release_Impl()
-{
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- DELETEZ( pMacroConfig );
-}
-
-//==========================================================================
-
-struct SfxMacroConfig_Impl
-{
- SfxMacroInfoArr_Impl aArr;
- sal_uInt32 nEventId;
- sal_Bool bWaitingForCallback;
-
- SfxMacroConfig_Impl()
- : nEventId( 0 )
- , bWaitingForCallback( sal_False )
- {}
-};
-
-//==========================================================================
-
-SbMethod* SfxQueryMacro_Impl( BasicManager* pMgr , const String& rMacro,
- const String &rLibName, const String& rModule )
-{
- IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
- const CollatorWrapper* pCollator = aIntlWrapper.getCollator();
- sal_uInt16 nLibCount = pMgr->GetLibCount();
- for ( sal_uInt16 nLib = 0; nLib < nLibCount; ++nLib )
- {
- if ( COMPARE_EQUAL == pCollator->compareString( pMgr->GetLibName( nLib ), rLibName ) )
- {
- StarBASIC* pLib = pMgr->GetLib( nLib );
- if( !pLib )
- {
- pMgr->LoadLib( nLib );
- pLib = pMgr->GetLib( nLib );
- }
-
- if( pLib )
- {
- sal_uInt16 nModCount = pLib->GetModules()->Count();
- for( sal_uInt16 nMod = 0; nMod < nModCount; ++nMod )
- {
- SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod );
- if ( pMod && COMPARE_EQUAL == pCollator->compareString( pMod->GetName(), rModule ) )
- {
- SbMethod* pMethod = (SbMethod*)pMod->Find( rMacro, SbxCLASS_METHOD );
- if( pMethod )
- return pMethod;
- }
- }
- }
- }
- }
- return 0;
-}
-
-SbMethod* SfxQueryMacro( BasicManager* pMgr , const String& rMacro )
-{
- sal_uInt16 nLast = 0;
- String aMacro = rMacro;
- String aLibName = aMacro.GetToken( 0, '.', nLast );
- String aModule = aMacro.GetToken( 0, '.', nLast );
- aMacro.Erase( 0, nLast );
-
- return SfxQueryMacro_Impl( pMgr, aMacro, aLibName, aModule );
-}
-
-ErrCode SfxCallMacro( BasicManager* pMgr, const String& rCode,
- SbxArray *pArgs, SbxValue *pRet )
-{
- ErrCode nErr;
- SfxApplication *pApp = SFX_APP();
- pApp->EnterBasicCall();
- SbMethod* pMethod = SfxQueryMacro( pMgr, rCode );
- if ( pMethod )
- {
- if ( pArgs )
- pMethod->SetParameters( pArgs );
- nErr = pMethod->Call( pRet );
- }
- else
- nErr = ERRCODE_BASIC_PROC_UNDEFINED;
-
- pApp->LeaveBasicCall();
- return nErr;
-}
-
-//==========================================================================
-
-SfxMacroInfo::SfxMacroInfo( const String& rURL ) :
- pHelpText(0),
- nRefCnt(0),
- bAppBasic(TRUE),
- nSlotId(0),
- pSlot(0)
-{
- if ( rURL.CompareToAscii( "macro:", 6 ) == COMPARE_EQUAL )
- {
- String aTmp = rURL.Copy( 6 );
- if ( aTmp.GetTokenCount('/') > 3 )
- {
- // 'macro:///lib.mod.proc(args)' => Macro via App-BASIC-Mgr
- // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr
- if ( aTmp.CompareToAscii("///", 3 ) != COMPARE_EQUAL )
- bAppBasic = FALSE;
- aTmp = rURL.GetToken( 3, '/' );
- if ( aTmp.GetTokenCount('.') == 3 )
- {
- aLibName = aTmp.GetToken( 0, '.' );
- aModuleName = aTmp.GetToken( 1, '.' );
- aMethodName = aTmp.GetToken( 2, '.' );
-
- // Remove arguments to be compatible
- aMethodName.SearchAndReplaceAscii( "()", String(), sal::static_int_cast< xub_StrLen >(std::max( aMethodName.Len()-2, 0 )));
- }
- }
-
- DBG_ASSERT( aLibName.Len() && aModuleName.Len() && aMethodName.Len(), "Wrong macro URL!" );
- }
- else
- aMethodName = rURL;
-}
-
-SfxMacroInfo::SfxMacroInfo( bool _bAppBasic ) :
- pHelpText(0),
- nRefCnt(0),
- bAppBasic(_bAppBasic),
- nSlotId(0),
- pSlot(0)
-{}
-
-//==========================================================================
-
-SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rLibName,
- const String& rModuleName, const String& rMethodName) :
- pHelpText(0),
- nRefCnt(0),
- bAppBasic(_bAppBasic),
- aLibName(rLibName),
- aModuleName(rModuleName),
- aMethodName(rMethodName),
- nSlotId(0),
- pSlot(0)
-{
-}
-
-//==========================================================================
-
-SfxMacroInfo::SfxMacroInfo(bool _bAppBasic, const String& rQualifiedName )
-: pHelpText(0),
- nRefCnt(0),
- bAppBasic(_bAppBasic),
- nSlotId(0),
- pSlot(0)
-{
- sal_uInt16 nCount = rQualifiedName.GetTokenCount('.');
- aMethodName = rQualifiedName.GetToken( nCount-1, '.' );
- if ( nCount > 1 )
- aModuleName = rQualifiedName.GetToken( nCount-2, '.' );
- if ( nCount > 2 )
- aLibName = rQualifiedName.GetToken( 0, '.' );
-}
-
-//==========================================================================
-
-SfxMacroInfo::SfxMacroInfo(SfxMacroInfo& rOther) :
- pHelpText(0),
- nRefCnt(0),
- bAppBasic(rOther.bAppBasic),
- aLibName(rOther.aLibName),
- aModuleName(rOther.aModuleName),
- aMethodName(rOther.aMethodName),
- nSlotId(rOther.nSlotId),
- pSlot(0)
-{}
-
-//==========================================================================
-
-SfxMacroInfo::~SfxMacroInfo()
-{
- delete pSlot;
- delete pHelpText;
-}
-
-//==========================================================================
-
-sal_Bool SfxMacroInfo::operator==(const SfxMacroInfo& rOther) const
-{
- if ( GetQualifiedName() == rOther.GetQualifiedName() &&
- bAppBasic == rOther.bAppBasic )
- return sal_True;
- else
- return sal_False;
-}
-
-//==========================================================================
-
-String SfxMacroInfo::GetMacroName() const
-{
- String aMacroName = aMethodName;
- aMacroName += '(';
- aMacroName += aLibName;
- aMacroName += '.';
- aMacroName += aModuleName;
- aMacroName += ')';
- return aMacroName;
-}
-
-//==========================================================================
-
-String SfxMacroInfo::GetQualifiedName() const
-{
- String aMacroName;
- if( aMacroName.Len() || aLibName.Len() )
- {
- // Altes Format
- aMacroName = aLibName;
- aMacroName += '.';
- aMacroName += aModuleName;
- aMacroName += '.';
- }
-
- // Wg. ::com::sun::star::script::JavaScript kein Zerlegen des Strings mehr
- aMacroName += aMethodName;
- return aMacroName;
-}
-
-String SfxMacroInfo::GetFullQualifiedName() const
-{
- // Liefert nur Unsinn, wenn f"ur ein ::com::sun::star::script::JavaScript aufgerufen !
- String aRet;
- if ( bAppBasic )
- aRet = SFX_APP()->GetName();
- aRet += '.';
- aRet += GetQualifiedName();
- return aRet;
-}
-
-String SfxMacroInfo::GetURL() const
-{
- if ( !aLibName.Len() )
- return aMethodName;
-
- // 'macro:///lib.mod.proc(args)' => Macro via App-BASIC-Mgr
- // 'macro://[docname|.]/lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr
- // 'macro://obj.method(args)' => Object via App-BASIC-Mgr
- String aURL( String::CreateFromAscii("macro://") );
- if ( !bAppBasic )
- aURL += '.';
- aURL += '/';
- aURL += aLibName;
- aURL += '.';
- aURL += aModuleName;
- aURL += '.';
- aURL += aMethodName;
- aURL += String::CreateFromAscii("()");
-
- return aURL;
-}
-
-//==========================================================================
-
-BasicManager* SfxMacroInfo::GetBasicManager() const
-{
- if (bAppBasic)
- {
- return SFX_APP()->GetBasicManager();
- }
- else
- {
- SfxObjectShell *pCurrDocShell = SfxObjectShell::Current();
- return pCurrDocShell ? pCurrDocShell->GetBasicManager() :
- SFX_APP()->GetBasicManager();
- }
-}
-
-//==========================================================================
-
-String SfxMacroInfo::GetBasicName() const
-{
- if (bAppBasic)
- {
- return SFX_APP()->GetName();
- }
- else
- {
- SfxObjectShell *pCurrDocShell = SfxObjectShell::Current();
- if ( pCurrDocShell )
- return pCurrDocShell->GetTitle();
- else
- return SFX_APP()->GetName();
- }
-}
-
-String SfxMacroInfo::GetHelpText() const
-{
- if ( pHelpText )
- return *pHelpText;
- return String();
-}
-
-String SfxMacroConfig::RequestHelp( sal_uInt16 nId )
-{
- SfxMacroInfo *pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo( nId );
- if ( !pInfo )
- return String();
-
- if ( !pInfo->pHelpText )
- {
- SbMethod *pMethod =
- SfxQueryMacro_Impl( pInfo->GetBasicManager(), pInfo->aMethodName,
- pInfo->aLibName, pInfo->aModuleName );
- if ( pMethod && pMethod->GetInfo() )
- pInfo->pHelpText = new String( pMethod->GetInfo()->GetComment() );
- }
-
- return pInfo->GetHelpText();
-}
-
-void SfxMacroInfo::SetHelpText( const String& rName )
-{
- if ( !pHelpText )
- pHelpText = new String;
- *pHelpText = rName;
-}
-
-//==========================================================================
-
-SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo)
-{
- sal_uInt16 nAppBasic, nFileVersion;
- String aDocName;
-
- rStream >> nFileVersion;
- if ( nVersion < nCompatVersion )
- {
- // In der 1.Version ohne Versionskennung
- nAppBasic = nVersion;
- nFileVersion = 1;
- rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
- }
- else
- {
- String aInput;
- rStream >> nAppBasic;
- rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8); // Vorsicht: kann bei AppName Unsinn sein!
- rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.ReadByteString(aInput,RTL_TEXTENCODING_UTF8);
-
- if ( nFileVersion == nCompatVersion )
- rInfo.aMethodName = aInput;
- else
- {
- sal_uInt16 nCount = aInput.GetTokenCount('.');
- rInfo.aMethodName = aInput.GetToken( nCount-1, '.' );
- if ( nCount > 1 )
- rInfo.aModuleName = aInput.GetToken( nCount-2, '.' );
- if ( nCount > 2 )
- rInfo.aLibName = aInput.GetToken( 0, '.' );
- }
- }
-
- rInfo.bAppBasic = (sal_Bool) nAppBasic;
- return rStream;
-}
-
-int SfxMacroInfo::Load( SvStream& rStream )
-{
- rStream >> (*this);
- nSlotId = SFX_APP()->GetMacroConfig()->GetSlotId(this);
- return 0;
-}
-
-//==========================================================================
-
-SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo)
-{
- if ( rInfo.bAppBasic )
- {
- rStream << nVersion
- << (sal_uInt16) rInfo.bAppBasic;
- rStream.WriteByteString(rInfo.GetBasicName(),RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
- }
- else
- {
- rStream << nVersion
- << (sal_uInt16) rInfo.bAppBasic;
- rStream.WriteByteString(SFX_APP()->GetName(),RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
- rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
- }
-
- return rStream;
-}
-
-sal_Bool SfxMacroInfo::Compare( const SvxMacro& rMacro ) const
-{
- String aName = rMacro.GetLibName();
- aName += '.';
- aName += rMacro.GetMacName();
- if ( GetFullQualifiedName() == aName )
- return sal_True;
- return sal_False;
-}
-
-//==========================================================================
-
-SfxMacroConfig::SfxMacroConfig()
-{
- pImp = new SfxMacroConfig_Impl;
-}
-
-//==========================================================================
-
-SfxMacroConfig::~SfxMacroConfig()
-{
- if ( pImp->nEventId )
- Application::RemoveUserEvent( pImp->nEventId );
- delete pImp;
-}
-
-//==========================================================================
-
-SFX_STATE_STUB( SfxApplication, MacroState_Impl )
-SFX_EXEC_STUB( SfxApplication, MacroExec_Impl )
-
-sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo)
-{
- sal_uInt16 nCount = pImp->aArr.Count(); // Macro suchen
- sal_uInt16 i;
- for (i=0; i<nCount; i++)
- if ((*(pImp->aArr)[i]) == (*pInfo))
- break;
-
- if (i == nCount)
- { // Macro noch unbekannt
- nCount = aIdArray.Count();
- sal_uInt16 n;
- for (n=0; n<nCount; n++) // freie SlotId suchen
- if (aIdArray[n] > SID_MACRO_START + n)
- break;
-
- sal_uInt16 nNewSlotId = SID_MACRO_START + n;
- if ( nNewSlotId > SID_MACRO_END )
- return 0;
- aIdArray.Insert( SID_MACRO_START + n, n );
-
- SfxSlot *pNewSlot = new SfxSlot;
- pNewSlot->nSlotId = SID_MACRO_START + n;
- pNewSlot->nGroupId = 0;
- pNewSlot->nFlags = SFX_SLOT_ASYNCHRON;
- pNewSlot->nMasterSlotId = 0;
- pNewSlot->nValue = 0;
- pNewSlot->fnExec = SFX_STUB_PTR(SfxApplication,MacroExec_Impl);
- pNewSlot->fnState = SFX_STUB_PTR(SfxApplication,MacroState_Impl);
- pNewSlot->pType = 0; HACK(SFX_TYPE(SfxVoidItem))
- pNewSlot->pName = pNewSlot->pMethodName = U2S(pInfo->aMethodName).getStr();
- pNewSlot->pLinkedSlot = 0;
- pNewSlot->nArgDefCount = 0;
- pNewSlot->pFirstArgDef = 0;
- pNewSlot->pUnoName = 0;
-
- if (nCount)
- {
- SfxSlot *pSlot = (pImp->aArr)[0]->pSlot;
- pNewSlot->pNextSlot = pSlot->pNextSlot;
- pSlot->pNextSlot = pNewSlot;
- }
- else
- pNewSlot->pNextSlot = pNewSlot;
-
- // Macro uebernehmen
- SfxMacroInfoPtr pNewInfo = new SfxMacroInfo(*pInfo);
- pNewInfo->nSlotId = SID_MACRO_START + n;
- pImp->aArr.Insert(pNewInfo,n);
- pNewInfo->pSlot = pNewSlot;
- pInfo->nSlotId = pNewInfo->nSlotId;
- pNewInfo->nRefCnt++;
- }
- else
- {
- pInfo->nSlotId = (pImp->aArr)[i]->nSlotId;
- (pImp->aArr)[i]->nRefCnt++;
- }
-
- return pInfo->nSlotId;
-}
-
-//==========================================================================
-
-void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId)
-{
- DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!");
-
- sal_uInt16 nCount = pImp->aArr.Count();
- for (sal_uInt16 i=0; i<nCount; i++)
- {
- SfxMacroInfo *pInfo = (pImp->aArr)[i];
- if (pInfo->nSlotId == nId)
- {
- pInfo->nRefCnt--;
- if (pInfo->nRefCnt == 0)
- {
- // Slot wird nicht mehr referenziert, also holen
- SfxSlot *pSlot = pInfo->pSlot;
-
- // Slot aus der Verkettung rausnehmen
- while (pSlot->pNextSlot != pInfo->pSlot)
- pSlot = (SfxSlot*) pSlot->pNextSlot;
- pSlot->pNextSlot = pInfo->pSlot->pNextSlot;
-
- // Slot selbst kurz schlie\sen
- pSlot = pInfo->pSlot;
- pSlot->pNextSlot = pSlot;
-
- // MacroInfo aus Array entfernen, damit sie kein Unheil
- // anrichten kann
- pImp->aArr.Remove(i);
-
- // SlotId wieder freigeben
- sal_uInt16 nIdCount = aIdArray.Count();
- for (sal_uInt16 n=0; n<nIdCount; n++)
- {
- if (aIdArray[n] == nId)
- {
- aIdArray.Remove(n);
- break;
- }
- }
-
- // Sofern nicht die Applikation heruntergefahren wird, mu\s
- // der Slot asynchron gel"oscht werden, falls er in seinem
- // eigenen Execute abgeschossen wird!
- if ( !SFX_APP()->Get_Impl()->bInQuit )
- pImp->nEventId = Application::PostUserEvent( LINK(this, SfxMacroConfig, EventHdl_Impl), pInfo );
- else
- EventHdl_Impl( pInfo );
- }
- return;
- }
- }
-
- DBG_ERROR("Macro-SlotId nicht gefunden!");
-}
-
-//==========================================================================
-
-void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId)
-{
- DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!");
-
- sal_uInt16 nCount = pImp->aArr.Count();
- for (sal_uInt16 i=0; i<nCount; i++)
- {
- if ((pImp->aArr)[i]->nSlotId == nId)
- {
- (pImp->aArr)[i]->nRefCnt++;
- return;
- }
- }
-
- DBG_ERROR("Macro-SlotId nicht gefunden!");
-}
-
-//==========================================================================
-
-SfxMacroInfo* SfxMacroConfig::GetMacroInfo(sal_uInt16 nId) const
-{
- sal_uInt16 nCount = pImp->aArr.Count();
- for (sal_uInt16 i=0; i<nCount; i++)
- if ((pImp->aArr)[i]->nSlotId == nId)
- return (pImp->aArr)[i];
-
- return 0;
-}
-
-//==========================================================================
-
-const SfxMacroInfo* SfxMacroConfig::GetMacroInfo_Impl( const SvxMacro *pMacro ) const
-{
- sal_uInt16 nCount = pImp->aArr.Count();
- for (sal_uInt16 i=0; i<nCount; i++)
- if ((pImp->aArr)[i]->Compare(*pMacro) )
- return (pImp->aArr)[i];
- return 0;
-}
-
-//==========================================================================
-
-sal_Bool SfxMacroConfig::ExecuteMacro( sal_uInt16 nId, const String& rArgs ) const
-{
- const SfxMacroInfo* pInfo = GetMacroInfo( nId );
- if ( !pInfo )
- return sal_False;
-
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- SvxMacro aMacro( pInfo->GetQualifiedName(), pInfo->GetBasicName(), STARBASIC );
- sal_Bool bRet = ExecuteMacro( pSh, &aMacro, rArgs );
-
- // Release, da im Dispatcher-Execute ein Register gemacht wurde
- ((SfxMacroConfig*)this)->ReleaseSlotId( nId );
- return bRet;
-}
-
-sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMacro, const String& /*rArgs*/ ) const
-{
- SfxApplication *pApp = SFX_APP();
-
- // Name des Macros oder Scripts bzw. ScriptCode
- String aCode( pMacro->GetMacName() );
- ErrCode nErr = ERRCODE_NONE;
-
- // Ist es ein Basic-Macro ?
- ScriptType eSType = pMacro->GetScriptType();
- sal_Bool bIsBasic = eSType == STARBASIC;
- sal_Bool bIsStarScript = ( eSType == EXTENDED_STYPE && pMacro->GetLibName().SearchAscii( "StarScript" ) != STRING_NOTFOUND );
- sal_Bool bIsBasicLibBased = bIsBasic || bIsStarScript || !pSh;
-
- if ( bIsBasicLibBased )
- {
- pApp->EnterBasicCall();
- BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
- if( bIsBasic )
- {
- // BasicManager von Document?
- BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
-
- // Da leider der Name zwischendurch h"aufig gewechselt hat ...
- if( SFX_APP()->GetName() == pMacro->GetLibName() ||
- pMacro->GetLibName().EqualsAscii("StarDesktop") )
- pMgr = pAppMgr;
- else if ( pMgr == pAppMgr )
- pMgr = NULL;
-
- if ( pSh && pMgr && pMgr != pAppMgr )
- {
- if ( !pSh->AdjustMacroMode( String() ) )
- return sal_False;
- }
-
- if ( pSh && pMgr && pMgr == pAppMgr )
- {
- ::com::sun::star::uno::Any aOldThisComponent = pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pSh->GetModel() ) );
- nErr = Call( 0, aCode, pMgr );
- pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent );
- }
- else if ( pMgr )
- nErr = Call( 0, aCode, pMgr );
- else
- nErr = SbxERR_NO_METHOD;
-
- }
-
- pApp->LeaveBasicCall();
- }
- else
- {
- nErr = SbxERR_NO_METHOD;
- }
-
- return ( nErr == ERRCODE_NONE );
-}
-
-sal_Bool SfxMacroConfig::CheckMacro( SfxObjectShell *pSh, const SvxMacro* pMacro ) const
-{
- SfxApplication *pApp = SFX_APP();
-
- // Name des Macros oder Scripts bzw. ScriptCode
- String aCode( pMacro->GetMacName() );
- ErrCode nErr = ERRCODE_NONE;
-
- // BasicManager von Document oder Application
- pApp->EnterBasicCall();
- BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
- BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
-
- // Da leider der Name zwischendurch h"aufig gewechselt hat ...
- if( SFX_APP()->GetName() == pMacro->GetLibName() ||
- pMacro->GetLibName().EqualsAscii("StarDesktop") )
- pMgr = pAppMgr;
- else if ( pMgr == pAppMgr )
- pMgr = NULL;
-
- if ( !pMgr || !SfxQueryMacro( pMgr, aCode ) )
- nErr = SbxERR_NO_METHOD;
- pApp->LeaveBasicCall();
- return ( nErr == ERRCODE_NONE );
-}
-
-//==========================================================================
-
-sal_Bool SfxMacroConfig::CheckMacro( sal_uInt16 nId ) const
-{
- const SfxMacroInfo* pInfo = GetMacroInfo( nId );
- if ( !pInfo )
- return sal_False;
-
- // Basic nur initialisieren, wenn default nicht ::com::sun::star::script::JavaScript; dann mu\s
- // in IsBasic() sowieso das Basic angelegt werden
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- SfxApplication *pApp = SFX_APP();
- pApp->EnterBasicCall();
-
- // BasicManager von Document oder Application
- BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
- BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
-
- if( SFX_APP()->GetName() == pInfo->GetBasicName() )
- pMgr = SFX_APP()->GetBasicManager();
- else if ( pMgr == pAppMgr )
- pMgr = NULL;
-
- String aFull( pInfo->GetQualifiedName() );
- sal_Bool bIsBasic = pMgr ? IsBasic( 0, aFull, pMgr ) : sal_False;
- pApp->LeaveBasicCall();
- return bIsBasic;
-}
-
-//==========================================================================
-
-IMPL_LINK( SfxMacroConfig, CallbackHdl_Impl, SfxMacroConfig*, pConfig )
-{
- (void)pConfig; // unused
- pImp->bWaitingForCallback = sal_False;
- return 0;
-}
-
-IMPL_LINK( SfxMacroConfig, EventHdl_Impl, SfxMacroInfo*, pInfo )
-{
- delete pInfo;
- pImp->nEventId = 0;
- return 0;
-}
-
-sal_Bool SfxMacroConfig::IsBasic(
- SbxObject* /*pVCtrl*/,
- const String& rCode,
- BasicManager* pMgr )
-{
- sal_Bool bFound;
- SFX_APP()->EnterBasicCall();
- bFound = SfxQueryMacro( pMgr, rCode ) != 0;
- SFX_APP()->LeaveBasicCall();
- return bFound;
-}
-
-ErrCode SfxMacroConfig::Call(
- SbxObject* /*pVCtrl*/,
- const String& rCode,
- BasicManager* pMgr,
- SbxArray *pArgs,
- SbxValue *pRet )
-{
- SfxApplication *pApp = SFX_APP();
- pApp->EnterBasicCall();
- SbMethod* pMethod = SfxQueryMacro( pMgr, rCode );
- ErrCode nErr = 0;
- if( pMethod )
- {
- if ( pArgs )
- pMethod->SetParameters( pArgs );
- nErr = pMethod->Call( pRet );
- }
- else
- nErr = ERRCODE_BASIC_PROC_UNDEFINED;
-
- pApp->LeaveBasicCall();
- return nErr;
-}
-
-
-sal_Bool SfxMacroConfig::IsMacroSlot( sal_uInt16 nId )
-{
- return ( nId >= SID_MACRO_START && nId <= SID_MACRO_END );
-}
-
-
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx
index 10359ba20f73..9d3661ef1bc1 100644
--- a/sfx2/source/control/msgpool.cxx
+++ b/sfx2/source/control/msgpool.cxx
@@ -40,7 +40,6 @@
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include "sfxtypes.hxx"
-#include <sfx2/macrconf.hxx>
#include "sfx2/sfxresid.hxx"
#include "arrdecl.hxx"
#include <sfx2/module.hxx>
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index f3df5dc36d0c..d1605754680a 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -46,7 +46,6 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
-#include "sfxbasic.hxx"
#include <sfx2/objface.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewsh.hxx>
@@ -55,7 +54,6 @@
#include <sfx2/request.hxx>
#include <sfx2/mnumgr.hxx>
#include "statcach.hxx"
-#include <sfx2/macrconf.hxx>
#include <sfx2/msgpool.hxx>
//====================================================================
@@ -483,7 +481,7 @@ SfxBroadcaster* SfxShell::GetBroadcaster()
//--------------------------------------------------------------------
-SfxUndoManager* SfxShell::GetUndoManager()
+::svl::IUndoManager* SfxShell::GetUndoManager()
/* [Beschreibung]
@@ -501,7 +499,7 @@ SfxUndoManager* SfxShell::GetUndoManager()
//--------------------------------------------------------------------
-void SfxShell::SetUndoManager( SfxUndoManager *pNewUndoMgr )
+void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
/* [Beschreibung]
@@ -517,6 +515,12 @@ void SfxShell::SetUndoManager( SfxUndoManager *pNewUndoMgr )
*/
{
+ OSL_ENSURE( ( pUndoMgr == NULL ) || ( pNewUndoMgr == NULL ) || ( pUndoMgr == pNewUndoMgr ),
+ "SfxShell::SetUndoManager: exchanging one non-NULL manager with another non-NULL manager? Suspicious!" );
+ // there's at least one client of our UndoManager - the DocumentUndoManager at the SfxBaseModel - which
+ // caches the UndoManager, and registers itself as listener. If exchanging non-NULL UndoManagers is really
+ // a supported scenario (/me thinks it is not), then we would need to notify all such clients instances.
+
pUndoMgr = pNewUndoMgr;
if ( pUndoMgr )
pUndoMgr->SetMaxUndoActionCount( (USHORT) SvtUndoOptions().GetUndoCount() );
@@ -947,13 +951,6 @@ const SfxPoolItem* SfxShell::ExecuteSlot
pSlot = GetVerbSlot_Impl(nSlot);
if ( !pSlot )
pSlot = pIF->GetSlot(nSlot);
- if ( !pSlot && SfxMacroConfig::IsMacroSlot( nSlot ) )
- {
- SfxMacroInfo* pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo(nSlot);
- if ( pInfo )
- pSlot = pInfo->GetSlot();
- }
-
DBG_ASSERT( pSlot, "slot not supported" );
SfxExecFunc pFunc = pSlot->GetExecFnc();
@@ -1022,13 +1019,6 @@ const SfxPoolItem* SfxShell::GetSlotState
pSlot = GetVerbSlot_Impl(nSlotId);
if ( !pSlot )
pSlot = pIF->GetSlot(nSlotId);
- if ( !pSlot && SfxMacroConfig::IsMacroSlot( nSlotId ) )
- {
- SfxMacroInfo* pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo(nSlotId);
- if ( pInfo )
- pSlot = pInfo->GetSlot();
- }
-
if ( pSlot )
// ggf. auf Which-Id mappen
nSlotId = pSlot->GetWhich( rPool );
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc
index 7e8fd688af52..c3cbf01cfc9a 100644
--- a/sfx2/source/doc/doc.hrc
+++ b/sfx2/source/doc/doc.hrc
@@ -146,11 +146,6 @@
#define RID_CNT_STR_WAITING (RID_SFX_DOC_START+ 83)
#define STR_OBJECT (RID_SFX_DOC_START+ 84)
-#define STR_EDITOBJECT (RID_SFX_DOC_START+ 85)
-// --> PB 2004-08-20 #i33095#
-/* obsolete
-#define STR_OPENOBJECT (RID_SFX_DOC_START+ 86)
-*/
#define DLOAD_URL 1
#define DLOAD_STATUS 2
diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src
index 497d4ccd7c97..bbf3ccb33253 100644
--- a/sfx2/source/doc/doc.src
+++ b/sfx2/source/doc/doc.src
@@ -371,19 +371,6 @@ String STR_OBJECT
Text [ en-US ] = "Object" ;
};
-String STR_EDITOBJECT
-{
- Text [ en-US ] = "~Edit";
-};
-
-// --> PB 2004-08-20 #i33095#
-/* obsolete
-String STR_OPENOBJECT
-{
- Text [ en-US ] = "~Open";
-};
-*/
-
QueryBox DLG_MACROQUERY
{
Buttons = WB_OK_CANCEL;
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 8644e79f611d..a84f4a718dc3 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -31,6 +31,7 @@
#include "doctemplates.hxx"
#include <vos/mutex.hxx>
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
@@ -42,6 +43,7 @@
#include <comphelper/sequenceashashmap.hxx>
#include <unotools/pathoptions.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
@@ -59,7 +61,6 @@
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
#include <svtools/templatefoldercache.hxx>
#include <unotools/configmgr.hxx>
@@ -2876,11 +2877,35 @@ void SfxURLRelocator_Impl::initOfficeInstDirs()
}
// -----------------------------------------------------------------------
+void SfxURLRelocator_Impl::implExpandURL( ::rtl::OUString& io_url )
+{
+ const INetURLObject aParser( io_url );
+ if ( aParser.GetProtocol() != INET_PROT_VND_SUN_STAR_EXPAND )
+ return;
+
+ io_url = aParser.GetURLPath( INetURLObject::DECODE_WITH_CHARSET );
+ try
+ {
+ if ( !mxMacroExpander.is() )
+ {
+ ::comphelper::ComponentContext aContext( mxFactory );
+ mxMacroExpander.set( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY_THROW );
+ }
+ io_url = mxMacroExpander->expandMacros( io_url );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// -----------------------------------------------------------------------
void SfxURLRelocator_Impl::makeRelocatableURL( rtl::OUString & rURL )
{
if ( rURL.getLength() > 0 )
{
initOfficeInstDirs();
+ implExpandURL( rURL );
rURL = mxOfficeInstDirs->makeRelocatableURL( rURL );
}
}
@@ -2891,6 +2916,7 @@ void SfxURLRelocator_Impl::makeAbsoluteURL( rtl::OUString & rURL )
if ( rURL.getLength() > 0 )
{
initOfficeInstDirs();
+ implExpandURL( rURL );
rURL = mxOfficeInstDirs->makeAbsoluteURL( rURL );
}
}
diff --git a/sfx2/source/doc/docundomanager.cxx b/sfx2/source/doc/docundomanager.cxx
new file mode 100755
index 000000000000..8fa7dd29ac39
--- /dev/null
+++ b/sfx2/source/doc/docundomanager.cxx
@@ -0,0 +1,457 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_sfx2.hxx"
+
+#include "docundomanager.hxx"
+#include "sfx2/sfxbasemodel.hxx"
+#include "sfx2/objsh.hxx"
+#include "sfx2/viewfrm.hxx"
+#include "sfx2/viewsh.hxx"
+#include "sfx2/bindings.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/XComponent.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/anytostring.hxx>
+#include <comphelper/flagguard.hxx>
+#include <svl/undo.hxx>
+#include <tools/diagnose_ex.h>
+#include <framework/undomanagerhelper.hxx>
+
+#include <boost/noncopyable.hpp>
+#include <stack>
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::util::InvalidStateException;
+ using ::com::sun::star::document::EmptyUndoStackException;
+ using ::com::sun::star::util::NotLockedException;
+ using ::com::sun::star::document::UndoContextNotClosedException;
+ using ::com::sun::star::document::XUndoAction;
+ using ::com::sun::star::document::XUndoManagerSupplier;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::lang::NotInitializedException;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::document::UndoManagerEvent;
+ using ::com::sun::star::document::XUndoManagerListener;
+ using ::com::sun::star::document::UndoFailedException;
+ using ::com::sun::star::document::XUndoManager;
+ using ::com::sun::star::lang::NoSupportException;
+ using ::com::sun::star::frame::XModel;
+ /** === end UNO using === **/
+
+ using ::svl::IUndoManager;
+
+ //==================================================================================================================
+ //= DocumentUndoManager_Impl
+ //==================================================================================================================
+ struct DocumentUndoManager_Impl : public ::framework::IUndoManagerImplementation
+ {
+ DocumentUndoManager& rAntiImpl;
+ IUndoManager* pUndoManager;
+ ::framework::UndoManagerHelper aUndoHelper;
+
+ DocumentUndoManager_Impl( DocumentUndoManager& i_antiImpl )
+ :rAntiImpl( i_antiImpl )
+ ,pUndoManager( impl_retrieveUndoManager( i_antiImpl.getBaseModel() ) )
+ // do this *before* the construction of aUndoHelper (which actually means: put pUndoManager before
+ // aUndoHelper in the member list)!
+ ,aUndoHelper( *this )
+ {
+ }
+
+ const SfxObjectShell* getObjectShell() const { return rAntiImpl.getBaseModel().GetObjectShell(); }
+ SfxObjectShell* getObjectShell() { return rAntiImpl.getBaseModel().GetObjectShell(); }
+
+ // IUndoManagerImplementation
+ virtual ::svl::IUndoManager& getImplUndoManager();
+ virtual Reference< XUndoManager > getThis();
+
+ void disposing()
+ {
+ aUndoHelper.disposing();
+ ENSURE_OR_RETURN_VOID( pUndoManager, "DocumentUndoManager_Impl::disposing: already disposed!" );
+ pUndoManager = NULL;
+ }
+
+ void invalidateXDo_nolck();
+
+ private:
+ static IUndoManager* impl_retrieveUndoManager( SfxBaseModel& i_baseModel )
+ {
+ IUndoManager* pUndoManager( NULL );
+ SfxObjectShell* pObjectShell = i_baseModel.GetObjectShell();
+ if ( pObjectShell != NULL )
+ pUndoManager = pObjectShell->GetUndoManager();
+ if ( !pUndoManager )
+ throw NotInitializedException( ::rtl::OUString(), *&i_baseModel );
+ return pUndoManager;
+ }
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::svl::IUndoManager& DocumentUndoManager_Impl::getImplUndoManager()
+ {
+ ENSURE_OR_THROW( pUndoManager != NULL, "DocumentUndoManager_Impl::getImplUndoManager: no access to the doc's UndoManager implementation!" );
+
+#if OSL_DEBUG_LEVEL > 0
+ // in a non-product build, assert if the current UndoManager at the shell is not the same we obtained
+ // (and cached) at construction time
+ SfxObjectShell* pObjectShell = rAntiImpl.getBaseModel().GetObjectShell();
+ OSL_ENSURE( ( pObjectShell != NULL ) && ( pUndoManager == pObjectShell->GetUndoManager() ),
+ "DocumentUndoManager_Impl::getImplUndoManager: the UndoManager changed meanwhile - what about our listener?" );
+#endif
+
+ return *pUndoManager;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XUndoManager > DocumentUndoManager_Impl::getThis()
+ {
+ return static_cast< XUndoManager* >( &rAntiImpl );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void DocumentUndoManager_Impl::invalidateXDo_nolck()
+ {
+ SfxModelGuard aGuard( rAntiImpl );
+
+ const SfxObjectShell* pDocShell = getObjectShell();
+ ENSURE_OR_THROW( pDocShell != NULL, "lcl_invalidateUndo: no access to the doc shell!" );
+ SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst( pDocShell );
+ while ( pViewFrame )
+ {
+ pViewFrame->GetBindings().Invalidate( SID_UNDO );
+ pViewFrame->GetBindings().Invalidate( SID_REDO );
+ pViewFrame = SfxViewFrame::GetNext( *pViewFrame, pDocShell );
+ }
+ }
+
+ //==================================================================================================================
+ //= SolarMutexFacade
+ //==================================================================================================================
+ /** a facade for the SolarMutex, implementing ::framework::IMutex (as opposed to ::vos::IMutex)
+ */
+ class SolarMutexFacade : public ::framework::IMutex
+ {
+ public:
+ SolarMutexFacade()
+ {
+ }
+
+ virtual void acquire()
+ {
+ Application::GetSolarMutex().acquire();
+ }
+
+ virtual void release()
+ {
+ Application::GetSolarMutex().release();
+ }
+ };
+
+ //==================================================================================================================
+ //= UndoManagerGuard
+ //==================================================================================================================
+ class UndoManagerGuard :public ::framework::IMutexGuard
+ ,public ::boost::noncopyable
+ {
+ public:
+ UndoManagerGuard( DocumentUndoManager& i_undoManager )
+ :m_guard( i_undoManager )
+ ,m_solarMutexFacade()
+ {
+ }
+
+ ~UndoManagerGuard()
+ {
+ }
+
+ virtual void reset()
+ {
+ m_guard.reset();
+ }
+
+ virtual void clear()
+ {
+ m_guard.clear();
+ }
+
+ virtual ::framework::IMutex& getGuardedMutex()
+ {
+ // note that this means that we *know* that SfxModelGuard also locks the SolarMutex (nothing more, nothing less).
+ // If this ever changes, we need to adjust this code here, too.
+ return m_solarMutexFacade;
+ }
+
+ private:
+ SfxModelGuard m_guard;
+ SolarMutexFacade m_solarMutexFacade;
+ };
+
+ //==================================================================================================================
+ //= DocumentUndoManager
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DocumentUndoManager::DocumentUndoManager( SfxBaseModel& i_document )
+ :SfxModelSubComponent( i_document )
+ ,m_pImpl( new DocumentUndoManager_Impl( *this ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ DocumentUndoManager::~DocumentUndoManager()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void DocumentUndoManager::disposing()
+ {
+ m_pImpl->disposing();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DocumentUndoManager::isInContext() const
+ {
+ // No mutex locking within this method, no disposal check - this is the responsibility of the owner.
+ return m_pImpl->getImplUndoManager().IsInListAction();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::acquire( ) throw ()
+ {
+ SfxModelSubComponent::acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::release( ) throw ()
+ {
+ SfxModelSubComponent::release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.enterUndoContext( i_title, aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::enterHiddenUndoContext( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.enterHiddenUndoContext( aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::leaveUndoContext( ) throw (InvalidStateException, RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.leaveUndoContext( aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (RuntimeException, IllegalArgumentException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.addUndoAction( i_action, aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.undo( aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.redo( aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL DocumentUndoManager::isUndoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.isUndoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL DocumentUndoManager::isRedoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.isRedoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DocumentUndoManager::getCurrentUndoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.getCurrentUndoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DocumentUndoManager::getCurrentRedoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.getCurrentRedoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL DocumentUndoManager::getAllUndoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.getAllUndoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL DocumentUndoManager::getAllRedoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.getAllRedoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::clear( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.clear( aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::clearRedo( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.clearRedo( aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::reset() throw (RuntimeException)
+ {
+ // SYNCHRONIZED --->
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.reset( aGuard );
+ // <--- SYNCHRONIZED
+ m_pImpl->invalidateXDo_nolck();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::lock( ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.lock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::unlock( ) throw (RuntimeException, NotLockedException)
+ {
+ UndoManagerGuard aGuard( *this );
+ m_pImpl->aUndoHelper.unlock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL DocumentUndoManager::isLocked( ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.isLocked();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.addUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return m_pImpl->aUndoHelper.removeUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL DocumentUndoManager::getParent( ) throw (RuntimeException)
+ {
+ UndoManagerGuard aGuard( *this );
+ return static_cast< XModel* >( &getBaseModel() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DocumentUndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException)
+ {
+ (void)i_parent;
+ throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() );
+ }
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index bceb7477a61e..2ccf5fa7a849 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -747,7 +747,7 @@ sal_Int8 ModelData_Impl::CheckFilter( const ::rtl::OUString& aFilterName )
return STATUS_SAVEAS_STANDARDNAME;
}
else if ( ( !( nFiltFlags & SFX_FILTER_OWN ) || ( nFiltFlags & SFX_FILTER_ALIEN ) )
- && !( nFiltFlags & SFX_FILTER_SILENTEXPORT ) && aDefFiltPropsHM.size()
+ && aDefFiltPropsHM.size()
&& ( nDefFiltFlags & SFX_FILTER_EXPORT ) && !( nDefFiltFlags & SFX_FILTER_INTERNAL ))
{
// the default filter is acceptable and the old filter is alian one
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 71c7e0e78383..3b27db855e39 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -118,6 +118,7 @@ using namespace ::com::sun::star::container;
#include <rtl/bootstrap.hxx>
#include <vcl/svapp.hxx>
#include <framework/interaction.hxx>
+#include <framework/documentundoguard.hxx>
#include <comphelper/interaction.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/documentconstants.hxx>
@@ -141,7 +142,6 @@ using namespace ::com::sun::star::container;
#include <sfx2/ctrlitem.hxx>
#include "arrdecl.hxx"
#include <sfx2/module.hxx>
-#include <sfx2/macrconf.hxx>
#include <sfx2/docfac.hxx>
#include "helper.hxx"
#include "doc.hrc"
@@ -1652,15 +1652,8 @@ SfxModule* SfxObjectShell::GetModule() const
return GetFactory().GetModule();
}
-sal_Bool SfxObjectShell::IsBasic(
- const String & rCode, SbxObject * pVCtrl )
-{
- if( !rCode.Len() ) return sal_False;
- return SfxMacroConfig::IsBasic( pVCtrl, rCode, GetBasicManager() );
-}
-
ErrCode SfxObjectShell::CallBasic( const String& rMacro,
- const String& rBasic, SbxObject* pVCtrl, SbxArray* pArgs,
+ const String& rBasic, SbxArray* pArgs,
SbxValue* pRet )
{
SfxApplication* pApp = SFX_APP();
@@ -1670,23 +1663,13 @@ ErrCode SfxObjectShell::CallBasic( const String& rMacro,
return ERRCODE_IO_ACCESSDENIED;
}
- pApp->EnterBasicCall();
BasicManager *pMgr = GetBasicManager();
if( pApp->GetName() == rBasic )
pMgr = pApp->GetBasicManager();
- ErrCode nRet = SfxMacroConfig::Call( pVCtrl, rMacro, pMgr, pArgs, pRet );
- pApp->LeaveBasicCall();
+ ErrCode nRet = SfxApplication::CallBasic( rMacro, pMgr, pArgs, pRet );
return nRet;
}
-ErrCode SfxObjectShell::Call( const String & rCode, sal_Bool bIsBasicReturn, SbxObject * pVCtrl )
-{
- ErrCode nErr = ERRCODE_NONE;
- if ( bIsBasicReturn )
- CallBasic( rCode, String(), pVCtrl );
- return nErr;
-}
-
namespace
{
static bool lcl_isScriptAccessAllowed_nothrow( const Reference< XInterface >& _rxScriptContext )
@@ -1740,9 +1723,11 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
xScriptProvider.set( xScriptProviderFactory->createScriptProvider( makeAny( _rxScriptContext ) ), UNO_SET_THROW );
}
+ // ry to protect the invocation context's undo manager (if present), just in case the script tampers with it
+ ::framework::DocumentUndoGuard aUndoGuard( _rxScriptContext.get() );
+
// obtain the script, and execute it
Reference< provider::XScript > xScript( xScriptProvider->getScript( _rScriptURL ), UNO_QUERY_THROW );
-
aRet = xScript->invoke( aParams, aOutParamIndex, aOutParam );
}
catch ( const uno::Exception& )
@@ -1782,118 +1767,6 @@ ErrCode SfxObjectShell::CallXScript( const String& rScriptURL,
}
//-------------------------------------------------------------------------
-namespace {
- using namespace ::com::sun::star::uno;
-
- //.....................................................................
- static SbxArrayRef lcl_translateUno2Basic( const void* _pAnySequence )
- {
- SbxArrayRef xReturn;
- if ( _pAnySequence )
- {
- // in real it's a sequence of Any (by convention)
- const Sequence< Any >* pArguments = static_cast< const Sequence< Any >* >( _pAnySequence );
-
- // do we have arguments ?
- if ( pArguments->getLength() )
- {
- // yep
- xReturn = new SbxArray;
- String sEmptyName;
-
- // loop through the sequence
- const Any* pArg = pArguments->getConstArray();
- const Any* pArgEnd = pArg + pArguments->getLength();
-
- for ( sal_uInt16 nArgPos=1; pArg != pArgEnd; ++pArg, ++nArgPos )
- // and create a Sb object for every Any
- xReturn->Put( GetSbUnoObject( sEmptyName, *pArg ), nArgPos );
- }
- }
- return xReturn;
- }
- //.....................................................................
- void lcl_translateBasic2Uno( const SbxVariableRef& _rBasicValue, void* _pAny )
- {
- if ( _pAny )
- *static_cast< Any* >( _pAny ) = sbxToUnoValue( _rBasicValue );
- }
-}
-//-------------------------------------------------------------------------
-ErrCode SfxObjectShell::CallStarBasicScript( const String& _rMacroName, const String& _rLocation,
- const void* _pArguments, void* _pReturn )
-{
- OSL_TRACE("in CallSBS");
- ::vos::OClearableGuard aGuard( Application::GetSolarMutex() );
-
- // the arguments for the call
- SbxArrayRef xMacroArguments = lcl_translateUno2Basic( _pArguments );
-
- // the return value
- SbxVariableRef xReturn = _pReturn ? new SbxVariable : NULL;
-
- // the location (document or application)
- String sMacroLocation;
- if ( _rLocation.EqualsAscii( "application" ) )
- sMacroLocation = SFX_APP()->GetName();
-#ifdef DBG_UTIL
- else
- DBG_ASSERT( _rLocation.EqualsAscii( "document" ),
- "SfxObjectShell::CallStarBasicScript: invalid (unknown) location!" );
-#endif
-
- // call the script
- ErrCode eError = CallBasic( _rMacroName, sMacroLocation, NULL, xMacroArguments, xReturn );
-
- // translate the return value
- lcl_translateBasic2Uno( xReturn, _pReturn );
-
- // outta here
- return eError;
-}
-
-//-------------------------------------------------------------------------
-ErrCode SfxObjectShell::CallScript(
- const String & rScriptType,
- const String & rCode,
- const void *pArgs,
- void *pRet
-)
-{
- ::vos::OClearableGuard aGuard( Application::GetSolarMutex() );
- ErrCode nErr = ERRCODE_NONE;
- if( rScriptType.EqualsAscii( "StarBasic" ) )
- {
- // the arguments for the call
- SbxArrayRef xMacroArguments = lcl_translateUno2Basic( pArgs );
-
- // the return value
- SbxVariableRef xReturn = pRet ? new SbxVariable : NULL;
-
- // call the script
- nErr = CallBasic( rCode, String(), NULL, xMacroArguments, xReturn );
-
- // translate the return value
- lcl_translateBasic2Uno( xReturn, pRet );
-
- // did this fail because the method was not found?
- if ( nErr == ERRCODE_BASIC_PROC_UNDEFINED )
- { // yep-> look in the application BASIC module
- nErr = CallBasic( rCode, SFX_APP()->GetName(), NULL, xMacroArguments, xReturn );
- }
- }
- else if( rScriptType.EqualsAscii( "JavaScript" ) )
- {
- DBG_ERROR( "JavaScript not allowed" );
- return 0;
- }
- else
- {
- DBG_ERROR( "StarScript not allowed" );
- }
- return nErr;
-}
-
SfxFrame* SfxObjectShell::GetSmartSelf( SfxFrame* pSelf, SfxMedium& /*rMedium*/ )
{
return pSelf;
@@ -1911,51 +1784,6 @@ void SfxObjectShell::SetFlags( SfxObjectShellFlags eFlags )
pImp->eFlags = eFlags;
}
-/*
-void SfxObjectShell::SetBaseURL( const String& rURL )
-{
- pImp->aBaseURL = rURL;
- pImp->bNoBaseURL = FALSE;
-}
-
-const String& SfxObjectShell::GetBaseURLForSaving() const
-{
- if ( pImp->bNoBaseURL )
- return String();
- return GetBaseURL();
-}
-
-const String& SfxObjectShell::GetBaseURL() const
-{
- if ( pImp->aBaseURL.Len() )
- return pImp->aBaseURL;
- return pMedium->GetBaseURL();
-}
-
-void SfxObjectShell::SetEmptyBaseURL()
-{
- pImp->bNoBaseURL = TRUE;
-}
-*/
-String SfxObjectShell::QueryTitle( SfxTitleQuery eType ) const
-{
- String aRet;
-
- switch( eType )
- {
- case SFX_TITLE_QUERY_SAVE_NAME_PROPOSAL:
- {
- SfxMedium* pMed = GetMedium();
- const INetURLObject aObj( pMed->GetName() );
- aRet = aObj.GetMainURL( INetURLObject::DECODE_TO_IURI );
- if ( !aRet.Len() )
- aRet = GetTitle( SFX_TITLE_CAPTION );
- break;
- }
- }
- return aRet;
-}
-
void SfxHeaderAttributes_Impl::SetAttributes()
{
bAlert = sal_True;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index c9b5e6f37293..e53e7148e561 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1089,13 +1089,6 @@ void SfxObjectShell::ExecProps_Impl(SfxRequest &rReq)
rReq.Done();
break;
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_PLAYMACRO:
- {
- SFX_APP()->PlayMacro_Impl( rReq, GetBasic() );
- break;
- }
-
case SID_DOCINFO_AUTHOR :
{
::rtl::OUString aStr = ( (SfxStringItem&)rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 0575660877a3..60921e825e20 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3025,7 +3025,7 @@ sal_Bool SfxObjectShell::IsInformationLost()
{
const SfxFilter *pFilt = GetMedium()->GetFilter();
DBG_ASSERT( pFilt && aFilterName.equals( pFilt->GetName() ), "MediaDescriptor contains wrong filter!\n" );
- return ( pFilt && pFilt->IsAlienFormat() && !(pFilt->GetFilterFlags() & SFX_FILTER_SILENTEXPORT ) );
+ return ( pFilt && pFilt->IsAlienFormat() );
}
return sal_False;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index d24a95332b58..13a42e3721c4 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -127,6 +127,7 @@
#include "sfx2/docstoragemodifylistener.hxx"
#include "sfx2/brokenpackageint.hxx"
#include "graphhelp.hxx"
+#include "docundomanager.hxx"
#include <sfx2/msgpool.hxx>
#include <sfx2/DocumentMetadataAccess.hxx>
@@ -153,6 +154,10 @@ using ::com::sun::star::lang::WrappedTargetException;
using ::com::sun::star::uno::Type;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::document::XDocumentRecovery;
+using ::com::sun::star::document::XUndoManager;
+using ::com::sun::star::document::XUndoAction;
+using ::com::sun::star::document::UndoFailedException;
+using ::com::sun::star::frame::XModel;
/** This Listener is used to get notified when the XDocumentProperties of the
XModel change.
@@ -221,15 +226,17 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
sal_Bool m_bSaving ;
sal_Bool m_bSuicide ;
sal_Bool m_bInitialized ;
+ sal_Bool m_bExternalTitle ;
sal_Bool m_bModifiedSinceLastSave;
uno::Reference< com::sun::star::view::XPrintable> m_xPrintable ;
uno::Reference< script::provider::XScriptProvider > m_xScriptProvider;
uno::Reference< ui::XUIConfigurationManager > m_xUIConfigurationManager;
::rtl::Reference< ::sfx2::DocumentStorageModifyListener > m_pStorageModifyListen;
- ::rtl::OUString m_sModuleIdentifier;
+ ::rtl::OUString m_sModuleIdentifier;
css::uno::Reference< css::frame::XTitle > m_xTitleHelper;
css::uno::Reference< css::frame::XUntitledNumbers > m_xNumberedControllers;
- uno::Reference< rdf::XDocumentMetadataAccess> m_xDocumentMetadata;
+ uno::Reference< rdf::XDocumentMetadataAccess> m_xDocumentMetadata;
+ ::rtl::Reference< ::sfx2::DocumentUndoManager > m_pDocumentUndoManager;
IMPL_SfxBaseModel_DataContainer( ::osl::Mutex& rMutex, SfxObjectShell* pObjectShell )
@@ -241,11 +248,13 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
, m_bSaving ( sal_False )
, m_bSuicide ( sal_False )
, m_bInitialized ( sal_False )
+ , m_bExternalTitle ( sal_False )
, m_bModifiedSinceLastSave( sal_False )
, m_pStorageModifyListen ( NULL )
, m_xTitleHelper ()
, m_xNumberedControllers ()
, m_xDocumentMetadata () // lazy
+ , m_pDocumentUndoManager ()
{
// increase global instance counter.
++g_nInstanceCounter;
@@ -786,6 +795,12 @@ void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeExcept
m_pData->m_pStorageModifyListen = NULL;
}
+ if ( m_pData->m_pDocumentUndoManager.is() )
+ {
+ m_pData->m_pDocumentUndoManager->disposing();
+ m_pData->m_pDocumentUndoManager = NULL;
+ }
+
lang::EventObject aEvent( (frame::XModel *)this );
m_pData->m_aInterfaceContainer.disposeAndClear( aEvent );
@@ -1183,6 +1198,51 @@ void SAL_CALL SfxBaseModel::disconnectController( const uno::Reference< frame::X
m_pData->m_xCurrent = uno::Reference< frame::XController > ();
}
+namespace
+{
+ typedef ::cppu::WeakImplHelper1< XUndoAction > ControllerLockUndoAction_Base;
+ class ControllerLockUndoAction : public ControllerLockUndoAction_Base
+ {
+ public:
+ ControllerLockUndoAction( const Reference< XModel >& i_model, const bool i_undoIsUnlock )
+ :m_xModel( i_model )
+ ,m_bUndoIsUnlock( i_undoIsUnlock )
+ {
+ }
+
+ // XUndoAction
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (RuntimeException);
+ virtual void SAL_CALL undo( ) throw (UndoFailedException, RuntimeException);
+ virtual void SAL_CALL redo( ) throw (UndoFailedException, RuntimeException);
+
+ private:
+ const Reference< XModel > m_xModel;
+ const bool m_bUndoIsUnlock;
+ };
+
+ ::rtl::OUString SAL_CALL ControllerLockUndoAction::getTitle() throw (RuntimeException)
+ {
+ // this action is intended to be used within an UndoContext only, so nobody will ever see this title ...
+ return ::rtl::OUString();
+ }
+
+ void SAL_CALL ControllerLockUndoAction::undo( ) throw (UndoFailedException, RuntimeException)
+ {
+ if ( m_bUndoIsUnlock )
+ m_xModel->unlockControllers();
+ else
+ m_xModel->lockControllers();
+ }
+
+ void SAL_CALL ControllerLockUndoAction::redo( ) throw (UndoFailedException, RuntimeException)
+ {
+ if ( m_bUndoIsUnlock )
+ m_xModel->lockControllers();
+ else
+ m_xModel->unlockControllers();
+ }
+}
+
//________________________________________________________________________________________________________
// frame::XModel
//________________________________________________________________________________________________________
@@ -1192,6 +1252,14 @@ void SAL_CALL SfxBaseModel::lockControllers() throw(::com::sun::star::uno::Runti
SfxModelGuard aGuard( *this );
++m_pData->m_nControllerLockCount ;
+
+ if ( m_pData->m_pDocumentUndoManager.is()
+ && m_pData->m_pDocumentUndoManager->isInContext()
+ && !m_pData->m_pDocumentUndoManager->isLocked()
+ )
+ {
+ m_pData->m_pDocumentUndoManager->addUndoAction( new ControllerLockUndoAction( this, true ) );
+ }
}
//________________________________________________________________________________________________________
@@ -1203,6 +1271,14 @@ void SAL_CALL SfxBaseModel::unlockControllers() throw(::com::sun::star::uno::Run
SfxModelGuard aGuard( *this );
--m_pData->m_nControllerLockCount ;
+
+ if ( m_pData->m_pDocumentUndoManager.is()
+ && m_pData->m_pDocumentUndoManager->isInContext()
+ && !m_pData->m_pDocumentUndoManager->isLocked()
+ )
+ {
+ m_pData->m_pDocumentUndoManager->addUndoAction( new ControllerLockUndoAction( this, false ) );
+ }
}
//________________________________________________________________________________________________________
@@ -1644,6 +1720,17 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString&
}
//________________________________________________________________________________________________________
+// XUndoManagerSupplier
+//________________________________________________________________________________________________________
+Reference< XUndoManager > SAL_CALL SfxBaseModel::getUndoManager( ) throw (RuntimeException)
+{
+ SfxModelGuard aGuard( *this );
+ if ( !m_pData->m_pDocumentUndoManager.is() )
+ m_pData->m_pDocumentUndoManager.set( new ::sfx2::DocumentUndoManager( *this ) );
+ return m_pData->m_pDocumentUndoManager.get();
+}
+
+//________________________________________________________________________________________________________
// XStorable
//________________________________________________________________________________________________________
@@ -3747,7 +3834,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
SfxModelGuard aGuard( *this );
::rtl::OUString aResult = impl_getTitleHelper()->getTitle ();
- if ( m_pData->m_pObjectShell )
+ if ( !m_pData->m_bExternalTitle && m_pData->m_pObjectShell )
{
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
if ( pMedium )
@@ -3757,7 +3844,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
aResult += String( SfxResId(STR_REPAIREDDOCUMENT) );
}
- if ( m_pData->m_pObjectShell->IsReadOnlyUI() || (m_pData->m_pObjectShell->GetMedium() && m_pData->m_pObjectShell->GetMedium()->IsReadOnly()) )
+ if ( m_pData->m_pObjectShell->IsReadOnlyUI() || (pMedium && pMedium->IsReadOnly()) )
aResult += ::rtl::OUString( String( SfxResId(STR_READONLY) ) );
else if ( m_pData->m_pObjectShell->IsDocShared() )
aResult += ::rtl::OUString( String( SfxResId(STR_SHARED) ) );
@@ -3778,6 +3865,7 @@ void SAL_CALL SfxBaseModel::setTitle( const ::rtl::OUString& sTitle )
SfxModelGuard aGuard( *this );
impl_getTitleHelper()->setTitle (sTitle);
+ m_pData->m_bExternalTitle = sal_True;
}
//=============================================================================
@@ -4371,3 +4459,16 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
return xDMA->storeMetadataToMedium(i_rMedium);
}
+// =====================================================================================================================
+// = SfxModelSubComponent
+// =====================================================================================================================
+
+SfxModelSubComponent::~SfxModelSubComponent()
+{
+}
+
+void SfxModelSubComponent::disposing()
+{
+ // nothing to do here
+}
+
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index bd12f3db80dc..1b3a943c4690 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -116,7 +116,6 @@ public:
// global pointers
SfxItemPool* pPool;
- SfxEventConfiguration* pEventConfig;
SvUShorts* pDisabledSlotList;
SvStrings* pSecureURLs;
SvtSaveOptions* pSaveOptions;
@@ -129,7 +128,6 @@ public:
USHORT nDocModalMode; // counts documents in modal mode
USHORT nAutoTabPageId;
- USHORT nBasicCallLevel;
USHORT nRescheduleLocks;
USHORT nInReschedule;
USHORT nAsynchronCalls;
diff --git a/sfx2/source/inc/docundomanager.hxx b/sfx2/source/inc/docundomanager.hxx
new file mode 100755
index 000000000000..9b37671662fd
--- /dev/null
+++ b/sfx2/source/inc/docundomanager.hxx
@@ -0,0 +1,116 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef DOCUMENT_UNDO_MANAGER_HXX
+#define DOCUMENT_UNDO_MANAGER_HXX
+
+#include "sfx2/sfxbasemodel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XUndoManager.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
+namespace svl
+{
+ class IUndoManager;
+}
+
+//......................................................................................................................
+namespace sfx2
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= DocumentUndoManager
+ //==================================================================================================================
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::document::XUndoManager
+ > DocumentUndoManager_Base;
+ struct DocumentUndoManager_Impl;
+ class DocumentUndoManager :public DocumentUndoManager_Base
+ ,public SfxModelSubComponent
+ ,public ::boost::noncopyable
+ {
+ friend struct DocumentUndoManager_Impl;
+
+ public:
+ DocumentUndoManager( SfxBaseModel& i_document );
+ virtual ~DocumentUndoManager();
+
+ // SfxModelSubComponent overridables
+ virtual void disposing();
+
+ // non-UNO API for our owner
+ /** determines whether we have an open Undo context. No mutex locking within this method, no disposal check - this
+ is the responsibility of the owner.
+ */
+ bool isInContext() const;
+
+ // XInterface
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XUndoManager
+ virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XLockable, base of XUndoManager
+ virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XChild, base of XUndoManager
+ 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);
+
+ private:
+ ::boost::scoped_ptr< DocumentUndoManager_Impl > m_pImpl;
+ };
+
+//......................................................................................................................
+} // namespace sfx2
+//......................................................................................................................
+
+#endif // DOCUMENT_UNDO_MANAGER_HXX
diff --git a/sfx2/source/inc/eventsupplier.hxx b/sfx2/source/inc/eventsupplier.hxx
index e012eea39c2d..83ed69ccb78e 100644
--- a/sfx2/source/inc/eventsupplier.hxx
+++ b/sfx2/source/inc/eventsupplier.hxx
@@ -57,6 +57,11 @@
#include <svl/lstner.hxx>
#include <unotools/eventcfg.hxx>
+namespace comphelper
+{
+ class NamedValueCollection;
+}
+
//--------------------------------------------------------------------------------------------------------
#define NOSUCHELEMENTEXCEPTION ::com::sun::star::container::NoSuchElementException
@@ -125,8 +130,12 @@ public:
virtual void SAL_CALL disposing( const EVENTOBJECT& Source )
throw( RUNTIMEEXCEPTION );
- static SvxMacro* ConvertToMacro( const ANY& rElement, SfxObjectShell* pDoc, BOOL bBlowUp );
- static void BlowUpMacro( const ANY& rIn, ANY& rOut, SfxObjectShell* pDoc );
+ static SvxMacro* ConvertToMacro( const ANY& rElement, SfxObjectShell* pDoc, BOOL bNormalizeMacro );
+ static void NormalizeMacro( const ANY& rIn, ANY& rOut, SfxObjectShell* pDoc );
+ static void NormalizeMacro(
+ const ::comphelper::NamedValueCollection& i_eventDescriptor,
+ ::comphelper::NamedValueCollection& o_normalizedDescriptor,
+ SfxObjectShell* i_document );
};
//=============================================================================
diff --git a/sfx2/source/inc/sfxurlrelocator.hxx b/sfx2/source/inc/sfxurlrelocator.hxx
index 8acc674b3568..5ab1125b7cb6 100644
--- a/sfx2/source/inc/sfxurlrelocator.hxx
+++ b/sfx2/source/inc/sfxurlrelocator.hxx
@@ -30,6 +30,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
+#include <com/sun/star/util/XMacroExpander.hpp>
#include <rtl/ustring.hxx>
#include <osl/mutex.hxx>
@@ -39,6 +40,7 @@ class SfxURLRelocator_Impl
::osl::Mutex maMutex;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxFactory;
::com::sun::star::uno::Reference< ::com::sun::star::util::XOfficeInstallationDirectories > mxOfficeInstDirs;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XMacroExpander > mxMacroExpander;
public:
static bool propertyCanContainOfficeDir( const rtl::OUString & rPropName );
@@ -48,6 +50,9 @@ public:
SfxURLRelocator_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory );
~SfxURLRelocator_Impl();
+
+private:
+ void implExpandURL( ::rtl::OUString& io_url );
};
#endif
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index f101b0d426b9..3d2f2db47def 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -64,7 +64,6 @@
#include <sfx2/dispatch.hxx>
#include "idpool.hxx"
#include "sfxtypes.hxx"
-#include <sfx2/macrconf.hxx>
#include "virtmenu.hxx"
#include <sfx2/mnuitem.hxx>
#include <sfx2/tbxctrl.hxx>
@@ -232,8 +231,6 @@ SfxMenuControl::SfxMenuControl(USHORT nSlotId, SfxBindings& rBindings):
SfxMenuControl::~SfxMenuControl()
{
- if ( SfxMacroConfig::IsMacroSlot( GetId() ) )
- SFX_APP()->GetMacroConfig()->ReleaseSlotId(GetId());
delete pSubMenu;
}
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index 77dbd0dcb885..f1eadf744863 100755
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -77,7 +77,6 @@
#include <sfx2/bindings.hxx>
#include "mnucfga.hxx"
#include "sfx2/sfxresid.hxx"
-#include <sfx2/macrconf.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/sfx.hrc>
#include "menu.hrc"
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index f0408a66a408..b60681e95afa 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -54,7 +54,6 @@
#include <sfx2/sfx.hrc>
#include <sfx2/viewsh.hxx>
#include "sfxpicklist.hxx"
-#include <sfx2/macrconf.hxx>
#include "sfx2/sfxresid.hxx"
#include "menu.hrc"
#include "sfx2/imagemgr.hxx"
@@ -476,24 +475,6 @@ void SfxVirtualMenu::CreateFromSVMenu()
{
SfxMenuControl *pMnuCtrl=0;
String aCmd( pSVMenu->GetItemCommand( nSlotId ) );
- if ( aCmd.CompareToAscii("slot:", 5) == 0 )
- {
- SfxMacroConfig* pCfg = SFX_APP()->GetMacroConfig();
- if ( pCfg->IsMacroSlot( nSlotId ) )
- {
- if ( pCfg->GetMacroInfo( nSlotId ) )
- {
- pCfg->RegisterSlotId( nSlotId );
- pSVMenu->SetItemCommand( nSlotId, String() );
- aCmd.Erase();
- }
- else
- {
- pSVMenu->SetItemCommand( nSlotId, String::CreateFromAscii("macro:///macro.not.founc") );
- }
- }
- }
-
if ( aCmd.Len() && (( nSlotId < SID_SFX_START ) || ( nSlotId > SHRT_MAX )) )
{
// try to create control via comand name
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 1ca10c6d9390..9ffc2200cfe8 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -48,6 +48,7 @@
#include <unotools/securityoptions.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include "eventsupplier.hxx"
#include <sfx2/app.hxx>
@@ -88,9 +89,9 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUSTRING & aName, const ANY &
{
if ( maEventNames[i] == aName )
{
- Sequence< PropertyValue > aProperties;
+ const ::comphelper::NamedValueCollection aEventDescriptor( rElement );
// check for correct type of the element
- if ( rElement.hasValue() && !( rElement >>= aProperties ) )
+ if ( rElement.hasValue() && aEventDescriptor.empty() )
throw ILLEGALARGUMENTEXCEPTION();
// create Configuration at first, creation might call this method also and that would overwrite everything
@@ -98,31 +99,27 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUSTRING & aName, const ANY &
if ( mpObjShell && !mpObjShell->IsLoading() )
mpObjShell->SetModified( TRUE );
- if ( aProperties.getLength() )
+ ::comphelper::NamedValueCollection aNormalizedDescriptor;
+ NormalizeMacro( aEventDescriptor, aNormalizedDescriptor, mpObjShell );
+
+ ::rtl::OUString sType;
+ if ( ( aNormalizedDescriptor.size() == 1 )
+ && ( aNormalizedDescriptor.has( PROP_EVENT_TYPE ) == 0 )
+ && ( aNormalizedDescriptor.get( PROP_EVENT_TYPE ) >>= sType )
+ && ( sType.getLength() == 0 )
+ )
{
- // "normalize" the macro descriptor
- ANY aValue;
- BlowUpMacro( rElement, aValue, mpObjShell );
- aValue >>= aProperties;
-
- ::rtl::OUString sType;
- if ( ( aProperties.getLength() == 1 )
- && ( aProperties[0].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 )
- && ( aProperties[0].Value >>= sType )
- && ( sType.getLength() == 0 )
- )
- {
- // An empty event type means no binding. Therefore reset data
- // to reflect that state.
- // (that's for compatibility only. Nowadays, the Tools/Customize dialog should
- // set an empty sequence to indicate the request for resetting the assignment.)
- aProperties.realloc( 0 );
- }
+ // An empty event type means no binding. Therefore reset data
+ // to reflect that state.
+ // (that's for compatibility only. Nowadays, the Tools/Customize dialog should
+ // set an empty sequence to indicate the request for resetting the assignment.)
+ OSL_ENSURE( false, "legacy event assignment format detected" );
+ aNormalizedDescriptor.clear();
}
- if ( aProperties.getLength() )
+ if ( !aNormalizedDescriptor.empty() )
{
- maEventData[i] = makeAny( aProperties );
+ maEventData[i] <<= aNormalizedDescriptor.getPropertyValues();
}
else
{
@@ -378,13 +375,13 @@ SfxEvents_Impl::~SfxEvents_Impl()
}
//--------------------------------------------------------------------------------------------------------
-SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* pObjShell, BOOL bBlowUp )
+SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* pObjShell, BOOL bNormalizeMacro )
{
SvxMacro* pMacro = NULL;
SEQUENCE < PROPERTYVALUE > aProperties;
ANY aAny;
- if ( bBlowUp )
- BlowUpMacro( rElement, aAny, pObjShell );
+ if ( bNormalizeMacro )
+ NormalizeMacro( rElement, aAny, pObjShell );
else
aAny = rElement;
@@ -444,58 +441,38 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p
return pMacro;
}
-void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell* pDoc )
+void SfxEvents_Impl::NormalizeMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell* pDoc )
{
- if ( !pDoc )
- pDoc = SfxObjectShell::Current();
-
- SEQUENCE < PROPERTYVALUE > aInProps;
- SEQUENCE < PROPERTYVALUE > aOutProps(2);
-
- if ( !( rEvent >>= aInProps ) )
- return;
+ const ::comphelper::NamedValueCollection aEventDescriptor( rEvent );
+ ::comphelper::NamedValueCollection aEventDescriptorOut;
- sal_Int32 nCount = aInProps.getLength();
+ NormalizeMacro( aEventDescriptor, aEventDescriptorOut, pDoc );
- if ( !nCount )
- return;
+ rRet <<= aEventDescriptorOut.getPropertyValues();
+}
- OUSTRING aType;
- OUSTRING aScript;
- OUSTRING aLibrary;
- OUSTRING aMacroName;
+void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i_eventDescriptor,
+ ::comphelper::NamedValueCollection& o_normalizedDescriptor, SfxObjectShell* i_document )
+{
+ SfxObjectShell* pDoc = i_document;
+ if ( !pDoc )
+ pDoc = SfxObjectShell::Current();
- sal_Int32 nIndex = 0;
+ ::rtl::OUString aType = i_eventDescriptor.getOrDefault( PROP_EVENT_TYPE, ::rtl::OUString() );
+ ::rtl::OUString aScript = i_eventDescriptor.getOrDefault( PROP_SCRIPT, ::rtl::OUString() );
+ ::rtl::OUString aLibrary = i_eventDescriptor.getOrDefault( PROP_LIBRARY, ::rtl::OUString() );
+ ::rtl::OUString aMacroName = i_eventDescriptor.getOrDefault( PROP_MACRO_NAME, ::rtl::OUString() );
- while ( nIndex < nCount )
- {
- if ( aInProps[ nIndex ].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 )
- {
- aInProps[nIndex].Value >>= aType;
- aOutProps[0] = aInProps[nIndex];
- }
- else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_SCRIPT ) == 0 )
- {
- aInProps[nIndex].Value >>= aScript;
- aOutProps[1] = aInProps[nIndex];
- }
- else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_LIBRARY ) == 0 )
- {
- aInProps[ nIndex ].Value >>= aLibrary;
- }
- else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_MACRO_NAME ) == 0 )
- {
- aInProps[ nIndex ].Value >>= aMacroName;
- }
- nIndex += 1;
- }
+ if ( aType.getLength() )
+ o_normalizedDescriptor.put( PROP_EVENT_TYPE, aType );
+ if ( aScript.getLength() )
+ o_normalizedDescriptor.put( PROP_SCRIPT, aScript );
if ( aType.compareToAscii( STAR_BASIC ) == 0 )
{
- aOutProps.realloc(4);
if ( aScript.getLength() )
{
- if( ! aMacroName.getLength() || ! aLibrary.getLength() )
+ if ( !aMacroName.getLength() || !aLibrary.getLength() )
{
sal_Int32 nHashPos = aScript.indexOf( '/', 8 );
sal_Int32 nArgsPos = aScript.indexOf( '(' );
@@ -542,22 +519,9 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell*
aLibrary = String::CreateFromAscii("application");
}
- aOutProps[1].Name = OUSTRING::createFromAscii( PROP_SCRIPT );
- aOutProps[1].Value <<= aScript;
- aOutProps[2].Name = OUSTRING::createFromAscii( PROP_LIBRARY );
- aOutProps[2].Value <<= aLibrary;
- aOutProps[3].Name = OUSTRING::createFromAscii( PROP_MACRO_NAME );
- aOutProps[3].Value <<= aMacroName;
- rRet <<= aOutProps;
- }
- else if ( aType.compareToAscii( SVX_MACRO_LANGUAGE_JAVASCRIPT ) == 0 )
- {
- aOutProps[1] = aInProps[1];
- rRet <<= aOutProps;
- }
- else
- {
- rRet <<= aOutProps;
+ o_normalizedDescriptor.put( PROP_SCRIPT, aScript );
+ o_normalizedDescriptor.put( PROP_LIBRARY, aLibrary );
+ o_normalizedDescriptor.put( PROP_MACRO_NAME, aMacroName );
}
}
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 7cc25c872eb1..6bf2dc26edd6 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -90,7 +90,6 @@
#include <sfx2/viewfrm.hxx>
#include "arrdecl.hxx"
#include "sfxtypes.hxx"
-#include <sfx2/macrconf.hxx>
#include <sfx2/genlink.hxx>
#include "sfx2/sfxresid.hxx"
#include <sfx2/sfx.hrc>
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index dbadbc54ebd4..4dcd4bb4709e 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -953,7 +953,7 @@ void SfxViewFrame::ExecHistory_Impl( SfxRequest &rReq )
{
// gibt es an der obersten Shell einen Undo-Manager?
SfxShell *pSh = GetDispatcher()->GetShell(0);
- SfxUndoManager* pShUndoMgr = pSh->GetUndoManager();
+ ::svl::IUndoManager* pShUndoMgr = pSh->GetUndoManager();
sal_Bool bOK = sal_False;
if ( pShUndoMgr )
{
@@ -965,20 +965,20 @@ void SfxViewFrame::ExecHistory_Impl( SfxRequest &rReq )
break;
case SID_UNDO:
- pShUndoMgr->Undo(0);
+ pShUndoMgr->Undo();
GetBindings().InvalidateAll(sal_False);
bOK = sal_True;
break;
case SID_REDO:
- pShUndoMgr->Redo(0);
+ pShUndoMgr->Redo();
GetBindings().InvalidateAll(sal_False);
bOK = sal_True;
break;
case SID_REPEAT:
if ( pSh->GetRepeatTarget() )
- pShUndoMgr->Repeat( *pSh->GetRepeatTarget(), 0);
+ pShUndoMgr->Repeat( *pSh->GetRepeatTarget() );
bOK = sal_True;
break;
}
@@ -1004,7 +1004,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet )
// Ich bin gerade am Reloaden und Yielde so vor mich hin ...
return;
- SfxUndoManager *pShUndoMgr = pSh->GetUndoManager();
+ ::svl::IUndoManager *pShUndoMgr = pSh->GetUndoManager();
if ( !pShUndoMgr )
{
// der SW hat eigenes Undo an der View
@@ -1040,10 +1040,10 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet )
rSet.DisableItem( SID_REDO );
SfxRepeatTarget *pTarget = pSh->GetRepeatTarget();
if ( pShUndoMgr && pTarget && pShUndoMgr->GetRepeatActionCount() &&
- pShUndoMgr->CanRepeat(*pTarget, 0) )
+ pShUndoMgr->CanRepeat(*pTarget) )
{
String aTmp( SvtResId(STR_REPEAT) );
- aTmp += pShUndoMgr->GetRepeatActionComment(*pTarget, 0);
+ aTmp += pShUndoMgr->GetRepeatActionComment(*pTarget);
rSet.Put( SfxStringItem( SID_REPEAT, aTmp ) );
}
else
@@ -2876,8 +2876,6 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro )
}
}
- pSfxApp->EnterBasicCall();
-
BasicManager* pBasMgr = 0;
if ( aLocation.EqualsIgnoreCaseAscii( "application" ) )
{
@@ -3010,19 +3008,11 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro )
}
}
}
-
- pSfxApp->LeaveBasicCall();
}
else
{
// add code for "session only" macro
}
-
- /*
- FILE* pFile = fopen( "macro.bas", "a" );
- fprintf( pFile, "%s", ::rtl::OUStringToOString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8).getStr() );
- fclose ( pFile );
- */
}
void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
diff --git a/smoketestoo_native/data/Test_10er.xml b/smoketestoo_native/data/Test_10er.xml
index e39a39eae2aa..56a8d130fc13 100644
--- a/smoketestoo_native/data/Test_10er.xml
+++ b/smoketestoo_native/data/Test_10er.xml
@@ -39,7 +39,6 @@ const cTempFileName = &quot;ttt&quot;
const cMessageSaveOpen8Doc = &quot;Save/Open open Documents (8.0)&quot;
const cMessageSaveOpenXMLDoc = &quot;Save/Open Document XML (6/7)&quot;
-const cMessageSaveOpen50Doc = &quot;Save/Open Document 5.0&quot;
const cMessageNewDoc = &quot;New Document&quot;
const cMessageCloseDoc = &quot;Close Document&quot;
@@ -90,22 +89,6 @@ Sub DeleteAllSavedFiles()
If FileExists (sFileName) then
Kill (sFileName)
End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmWriter or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmCalc or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmImpress or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
- sFileName = sWorkPath+cTempFileName+&quot;.&quot;+GetDocEndings(frmDraw or cFlt50)
- If FileExists (sFileName) then
- Kill (sFileName)
- End If
End Sub
Sub DeleteAllLogFiles()
@@ -298,18 +281,12 @@ Sub WriteTests (sText as string, bTestAll as boolean, nFileChannel as integer)
if bMakeSaveOpenXMLTest then
sWriteStr = sWriteStr + &quot;, save XML&quot;
end if
- if bMakeSaveOpen50Test then
- sWriteStr = sWriteStr + &quot;, save 5.0&quot;
- end if
if bMakeSaveOpen8Test then
sWriteStr = sWriteStr + &quot;, open 8.0&quot;
end if
if bMakeSaveOpenXMLTest then
sWriteStr = sWriteStr + &quot;, open XML&quot;
end if
- if bMakeSaveOpen50Test then
- sWriteStr = sWriteStr + &quot;, open 5.0&quot;
- end if
end if
sWriteStr = sWriteStr + &quot;, close&quot;
@@ -343,7 +320,7 @@ end Sub
Sub MakeDocTest (FilterType as Integer)
Dim oDoc as Object
- Dim sFileNameXML$, sFileName50$, sFileName8$
+ Dim sFileNameXML$, sFileName8$
Dim bError as Boolean
Dim nCurrentAction as Integer
@@ -366,11 +343,6 @@ Sub MakeDocTest (FilterType as Integer)
sFileNameXML = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFltXML)
SaveDoc (sFileNameXML, oDoc, GetDocFilter(FilterType or cFltXML))
end if
- nCurrentAction = cDocSaveOpen50
- if bMakeSaveOpen50Test and IsFilterAvailable (FilterType or cFlt50) then
- sFileName50 = sWorkPathURL+cTempFileName+&quot;.&quot;+GetDocEndings(FilterType or cFlt50)
- SaveDoc (sFileName50, oDoc, GetDocFilter(FilterType or cFlt50))
- end if
&apos; oDoc.dispose
nCurrentAction = cDocClose
oDoc.close (true)
@@ -410,21 +382,6 @@ Sub MakeDocTest (FilterType as Integer)
end If
end if
- nCurrentAction = cDocSaveOpen50
- if bMakeSaveOpen50Test and IsFilterAvailable (FilterType or cFlt50) then
- oDoc = LoadDoc (sFileName50)
-
-&apos; oDoc = Documents.open(sFileName)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen50Doc, FileChannel)
- LogState (not IsNull (oDoc),GetDocFilter(FilterType or cFltNewDoc)+&quot; &quot;+ cMessageSaveOpen50Doc, MainFileChannel)
- SetStatus (FilterType, cDocSaveOpen50, not IsNull (oDoc))
-
- if not IsNull (oDoc) then
-&apos; oDoc.dispose
- nCurrentAction = cDocClose
- oDoc.close (true)
- end If
- end if
end If
Print #FileChannel, &quot;---&quot;
Close #FileChannel%
@@ -545,16 +502,8 @@ Function GetDocEndings (DocType as Integer) as String
GetDocEndings = &quot;odp&quot; &apos;PrÕsentation
case frmDraw or cFlt8
GetDocEndings = &quot;odg&quot; &apos;Zeichen
- case frmHyperText, frmHyperText or cFlt50, frmHyperText or cFltXML
+ case frmHyperText, frmHyperText or cFltXML
GetDocEndings = &quot;html&quot; &apos;Hypertext-Dokument
- case frmWriter or cFlt50
- GetDocEndings = &quot;sdw&quot; &apos; Textdokument 5.0
- case frmCalc or cFlt50
- GetDocEndings = &quot;sdc&quot; &apos;Tabellendokument 5.0
- case frmImpress or cFlt50
- GetDocEndings = &quot;sdd&quot; &apos;PrÕsentation 5.0
- case frmDraw or cFlt50
- GetDocEndings = &quot;sda&quot; &apos;Zeichen 5.0
case frmWriter or cFltXML
GetDocEndings = &quot;sxw&quot; &apos; Textdokument
case frmCalc or cFltXML
@@ -592,18 +541,8 @@ Function GetDocFilter (DocType as Integer) as String
case frmMath or cFltXML
GetDocFilter = &quot;StarOffice XML (Math)&quot; &apos;Formel
- case frmHyperText, frmHyperText or cFlt50, frmHyperText or cFltXML
+ case frmHyperText, frmHyperText or cFltXML
GetDocFilter = &quot;HTML&quot; &apos;Hypertext-Dokument
- case frmWriter or cFlt50
- GetDocFilter = &quot;StarWriter 5.0&quot; &apos; Textdokument 5.0
- case frmCalc or cFlt50
- GetDocFilter = &quot;StarCalc 5.0&quot; &apos;Tabellendokument 5.0
- case frmImpress or cFlt50
- GetDocFilter = &quot;StarImpress 5.0&quot; &apos;Präsentation 5.0
- case frmDraw or cFlt50
- GetDocFilter = &quot;StarDraw 5.0&quot; &apos;Zeichen 5.0
- case frmMath or cFlt50
- GetDocFilter = &quot;StarMath 5.0&quot; &apos;Formel 5.0
case frmWriter or cFltNewDoc
GetDocFilter = &quot;swriter&quot; &apos; Textdokument
@@ -667,8 +606,6 @@ Function GetErrorMessageOnAction (nAction as Integer) as String
GetErrorMessageOnAction = cMessageSaveOpen8Doc
case cDocSaveOpenXML
GetErrorMessageOnAction = cMessageSaveOpenXMLDoc
- case cDocSaveOpen50
- GetErrorMessageOnAction = cMessageSaveOpen50Doc
case cDocClose
GetErrorMessageOnAction = cMessageCloseDoc
case else
@@ -678,7 +615,7 @@ end Function
Function IsFilterAvailable (FilterType as Integer) as boolean
IsFilterAvailable = true
- if ((FilterType = (frmHyperText or cFlt50)) or (FilterType = (frmHyperText or cFltXML))) then
+ if ((FilterType = (frmHyperText or cFltXML))) then
IsFilterAvailable = false
end if
End Function
diff --git a/solenv/inc/_tg_rslb.mk b/solenv/inc/_tg_rslb.mk
index 4c67a1d58c97..561b4224e649 100644..100755
--- a/solenv/inc/_tg_rslb.mk
+++ b/solenv/inc/_tg_rslb.mk
@@ -15,7 +15,8 @@ $(RSC_MULTI1) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB1NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -30,7 +31,8 @@ $(RSC_MULTI1) : \
-fs={$(BIN)/$(RESLIB1NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -76,7 +78,8 @@ $(RSC_MULTI2) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB2NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -91,7 +94,8 @@ $(RSC_MULTI2) : \
-fs={$(BIN)/$(RESLIB2NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -137,7 +141,8 @@ $(RSC_MULTI3) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB3NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -152,7 +157,8 @@ $(RSC_MULTI3) : \
-fs={$(BIN)/$(RESLIB3NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -198,7 +204,8 @@ $(RSC_MULTI4) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB4NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -213,7 +220,8 @@ $(RSC_MULTI4) : \
-fs={$(BIN)/$(RESLIB4NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -259,7 +267,8 @@ $(RSC_MULTI5) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB5NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -274,7 +283,8 @@ $(RSC_MULTI5) : \
-fs={$(BIN)/$(RESLIB5NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -320,7 +330,8 @@ $(RSC_MULTI6) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB6NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -335,7 +346,8 @@ $(RSC_MULTI6) : \
-fs={$(BIN)/$(RESLIB6NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -381,7 +393,8 @@ $(RSC_MULTI7) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB7NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -396,7 +409,8 @@ $(RSC_MULTI7) : \
-fs={$(BIN)/$(RESLIB7NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -442,7 +456,8 @@ $(RSC_MULTI8) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB8NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -457,7 +472,8 @@ $(RSC_MULTI8) : \
-fs={$(BIN)/$(RESLIB8NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -503,7 +519,8 @@ $(RSC_MULTI9) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB9NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -518,7 +535,8 @@ $(RSC_MULTI9) : \
-fs={$(BIN)/$(RESLIB9NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
@@ -564,7 +582,8 @@ $(RSC_MULTI10) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB10NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -579,7 +598,8 @@ $(RSC_MULTI10) : \
-fs={$(BIN)/$(RESLIB10NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
diff --git a/solenv/inc/_tg_shl.mk b/solenv/inc/_tg_shl.mk
index 41d48c839949..ac930bdd8a08 100644
--- a/solenv/inc/_tg_shl.mk
+++ b/solenv/inc/_tg_shl.mk
@@ -333,7 +333,7 @@ $(SHL1TARGETN) : \
$(SHL1STDLIBS) \
$(SHL1STDSHL) $(STDSHL1) \
$(SHL1LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -357,7 +357,7 @@ $(SHL1TARGETN) : \
$(SHL1STDLIBS) \
$(SHL1STDSHL) $(STDSHL1) \
$(SHL1LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -529,7 +529,6 @@ $(SHL1TARGETN) : \
$(SHL1STDLIBS:^"-l") \
$(SHL1LINKRES) \
$(SHL1STDSHL:^"-l") $(STDSHL1:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -877,7 +876,7 @@ $(SHL2TARGETN) : \
$(SHL2STDLIBS) \
$(SHL2STDSHL) $(STDSHL2) \
$(SHL2LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -901,7 +900,7 @@ $(SHL2TARGETN) : \
$(SHL2STDLIBS) \
$(SHL2STDSHL) $(STDSHL2) \
$(SHL2LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -1073,7 +1072,6 @@ $(SHL2TARGETN) : \
$(SHL2STDLIBS:^"-l") \
$(SHL2LINKRES) \
$(SHL2STDSHL:^"-l") $(STDSHL2:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -1421,7 +1419,7 @@ $(SHL3TARGETN) : \
$(SHL3STDLIBS) \
$(SHL3STDSHL) $(STDSHL3) \
$(SHL3LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -1445,7 +1443,7 @@ $(SHL3TARGETN) : \
$(SHL3STDLIBS) \
$(SHL3STDSHL) $(STDSHL3) \
$(SHL3LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -1617,7 +1615,6 @@ $(SHL3TARGETN) : \
$(SHL3STDLIBS:^"-l") \
$(SHL3LINKRES) \
$(SHL3STDSHL:^"-l") $(STDSHL3:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -1965,7 +1962,7 @@ $(SHL4TARGETN) : \
$(SHL4STDLIBS) \
$(SHL4STDSHL) $(STDSHL4) \
$(SHL4LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -1989,7 +1986,7 @@ $(SHL4TARGETN) : \
$(SHL4STDLIBS) \
$(SHL4STDSHL) $(STDSHL4) \
$(SHL4LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -2161,7 +2158,6 @@ $(SHL4TARGETN) : \
$(SHL4STDLIBS:^"-l") \
$(SHL4LINKRES) \
$(SHL4STDSHL:^"-l") $(STDSHL4:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -2509,7 +2505,7 @@ $(SHL5TARGETN) : \
$(SHL5STDLIBS) \
$(SHL5STDSHL) $(STDSHL5) \
$(SHL5LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -2533,7 +2529,7 @@ $(SHL5TARGETN) : \
$(SHL5STDLIBS) \
$(SHL5STDSHL) $(STDSHL5) \
$(SHL5LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -2705,7 +2701,6 @@ $(SHL5TARGETN) : \
$(SHL5STDLIBS:^"-l") \
$(SHL5LINKRES) \
$(SHL5STDSHL:^"-l") $(STDSHL5:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -3053,7 +3048,7 @@ $(SHL6TARGETN) : \
$(SHL6STDLIBS) \
$(SHL6STDSHL) $(STDSHL6) \
$(SHL6LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -3077,7 +3072,7 @@ $(SHL6TARGETN) : \
$(SHL6STDLIBS) \
$(SHL6STDSHL) $(STDSHL6) \
$(SHL6LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -3249,7 +3244,6 @@ $(SHL6TARGETN) : \
$(SHL6STDLIBS:^"-l") \
$(SHL6LINKRES) \
$(SHL6STDSHL:^"-l") $(STDSHL6:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -3597,7 +3591,7 @@ $(SHL7TARGETN) : \
$(SHL7STDLIBS) \
$(SHL7STDSHL) $(STDSHL7) \
$(SHL7LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -3621,7 +3615,7 @@ $(SHL7TARGETN) : \
$(SHL7STDLIBS) \
$(SHL7STDSHL) $(STDSHL7) \
$(SHL7LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -3793,7 +3787,6 @@ $(SHL7TARGETN) : \
$(SHL7STDLIBS:^"-l") \
$(SHL7LINKRES) \
$(SHL7STDSHL:^"-l") $(STDSHL7:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -4141,7 +4134,7 @@ $(SHL8TARGETN) : \
$(SHL8STDLIBS) \
$(SHL8STDSHL) $(STDSHL8) \
$(SHL8LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -4165,7 +4158,7 @@ $(SHL8TARGETN) : \
$(SHL8STDLIBS) \
$(SHL8STDSHL) $(STDSHL8) \
$(SHL8LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -4337,7 +4330,6 @@ $(SHL8TARGETN) : \
$(SHL8STDLIBS:^"-l") \
$(SHL8LINKRES) \
$(SHL8STDSHL:^"-l") $(STDSHL8:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -4685,7 +4677,7 @@ $(SHL9TARGETN) : \
$(SHL9STDLIBS) \
$(SHL9STDSHL) $(STDSHL9) \
$(SHL9LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -4709,7 +4701,7 @@ $(SHL9TARGETN) : \
$(SHL9STDLIBS) \
$(SHL9STDSHL) $(STDSHL9) \
$(SHL9LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -4881,7 +4873,6 @@ $(SHL9TARGETN) : \
$(SHL9STDLIBS:^"-l") \
$(SHL9LINKRES) \
$(SHL9STDSHL:^"-l") $(STDSHL9:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
@@ -5229,7 +5220,7 @@ $(SHL10TARGETN) : \
$(SHL10STDLIBS) \
$(SHL10STDSHL) $(STDSHL10) \
$(SHL10LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -5253,7 +5244,7 @@ $(SHL10TARGETN) : \
$(SHL10STDLIBS) \
$(SHL10STDSHL) $(STDSHL10) \
$(SHL10LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -5425,7 +5416,6 @@ $(SHL10TARGETN) : \
$(SHL10STDLIBS:^"-l") \
$(SHL10LINKRES) \
$(SHL10STDSHL:^"-l") $(STDSHL10:^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk
index 5d99bdeb0e2a..b7b49c4aec3b 100644
--- a/solenv/inc/installationtest.mk
+++ b/solenv/inc/installationtest.mk
@@ -105,10 +105,25 @@ cpptest : $(MISC)/$(TARGET)/installation.flag
.END
.IF "$(SOLAR_JAVA)" == "TRUE" && "$(OOO_JUNIT_JAR)" != ""
-javatest .PHONY : $(JAVATARGET)
+javatest_% .PHONY : $(JAVATARGET)
+ $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
+ $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
+ $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
+ '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
+ -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
+ -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
+ $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
+ org.junit.runner.JUnitCore \
+ $(subst,/,. $(PACKAGE)).$(@:s/javatest_//)
$(RM) -r $(MISC)/$(TARGET)/user
- $(MKDIRHIER) $(MISC)/$(TARGET)/user
- $(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
+.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
+ $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag
+javatest : $(MISC)/$(TARGET)/installation.flag
+.END
+javatest .PHONY : $(JAVATARGET)
+ $(COMMAND_ECHO)$(RM) -r $(MISC)/$(TARGET)/user
+ $(COMMAND_ECHO)$(MKDIRHIER) $(MISC)/$(TARGET)/user
+ $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
'$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
-Dorg.openoffice.test.arg.soffice=$(my_soffice) \
-Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 7e9c2e2bf834..cda7b46e158c 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m98(Build:9568)
-BUILD=9568
-LAST_MINOR=m98
+RSCREVISION=300m99(Build:9570)
+BUILD=9570
+LAST_MINOR=m99
SOURCEVERSION=DEV300
diff --git a/solenv/inc/tg_jar.mk b/solenv/inc/tg_jar.mk
index d1109ec4e8f1..fa6ae24110b7 100644
--- a/solenv/inc/tg_jar.mk
+++ b/solenv/inc/tg_jar.mk
@@ -57,7 +57,7 @@ $(JARMANIFEST) .PHONY : $(CUSTOMMANIFESTFILEDEP)
@@-$(RM) $@
$(COMMAND_ECHO)echo Manifest-Version: 1.0 > $@
.IF "$(JARCLASSPATH)" != ""
- echo $(USQ)Class-Path: $(JARCLASSPATH)$(USQ) >> $@
+ $(COMMAND_ECHO)echo $(USQ)Class-Path: $(JARCLASSPATH)$(USQ) >> $@
.ENDIF
# $(RSCREVISION) contains chars that must be quoted (for *NIX shells)
$(COMMAND_ECHO)echo $(USQ)Solar-Version: $(RSCREVISION)$(USQ) >> $@
@@ -67,6 +67,14 @@ $(JARMANIFEST) .PHONY : $(CUSTOMMANIFESTFILEDEP)
.ENDIF # "$(JARMANIFEST)"!=""
.ENDIF # "$(NEW_JAR_PACK)"!=""
+.IF "$(JARCLASSEXCLUDES)" == ""
+ZIPJAR_EXCLUDE=
+.ELSE # "$(JARCLASSEXCLUDES)" == ""
+ZIPJAR_EXCLUDE=$(foreach,i,$(JARCLASSEXCLUDES) -x "$i")
+# format:
+# JARCLASSEXCLUDES=foo/* bar/*
+.ENDIF # "$(JARCLASSEXCLUDES)" == ""
+
#
# build jar
#
@@ -82,8 +90,8 @@ $(JARTARGETN) :
@-find . -type d -user $(USER) ! -perm -5 -print | xargs test "$$1" != "" && chmod +r $$1
.ENDIF
.IF "$(JARMANIFEST)"!=""
- $(COMMAND_ECHO)cd $(CLASSDIR)/$(TARGET) && zip $(ZIP_VERBOSITY) -u -rX ../$(@:f) $(subst,$(CLASSDIR)/$(TARGET)/, $(JARMANIFEST)) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)cd $(CLASSDIR)/$(TARGET) && zip $(ZIP_VERBOSITY) -u -rX ../$(@:f) $(subst,$(CLASSDIR)/$(TARGET)/, $(JARMANIFEST)) $(ZIPJAR_EXCLUDE) $(CHECKZIPRESULT)
.ENDIF # "$(JARMANIFEST)"!=""
- $(COMMAND_ECHO)cd $(CLASSDIR) && zip $(ZIP_VERBOSITY) -u -rX $(@:f) $(subst,\,/ $(JARCLASSDIRS)) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)cd $(CLASSDIR) && zip $(ZIP_VERBOSITY) -u -rX $(@:f) $(subst,\,/ $(JARCLASSDIRS)) $(ZIPJAR_EXCLUDE) $(CHECKZIPRESULT)
.ENDIF
diff --git a/solenv/inc/tg_java.mk b/solenv/inc/tg_java.mk
index 5c00f2bbf7f5..c85d2d9bdfd2 100644
--- a/solenv/inc/tg_java.mk
+++ b/solenv/inc/tg_java.mk
@@ -42,13 +42,11 @@ $(MISC)/java/com/sun/star/upd/$(VERSIONINFOFILE)_updversion.java .PHONY:
.IF "$(JAVATARGET)"!=""
.IF "$(PACKAGE)"!=""
-$(CLASSDIR)/$(IDLPACKAGE)/%.class .NOINFER .IGNORE : %.java
-# echo $@
- @@-$(RM) $(JAVATARGET)
+$(CLASSDIR)/$(PACKAGE)/%.class .NOINFER .IGNORE : %.java
+ $(COMMAND_ECHO)-$(RM) $(JAVATARGET)
.ELSE # "$(PACKAGE)"!=""
$(CLASSDIR)/%.class .NOINFER .IGNORE : %.java
-# echo $@
- @@-$(RM) $(JAVATARGET)
+ $(COMMAND_ECHO)-$(RM) $(JAVATARGET)
.ENDIF # "$(PACKAGE)"!=""
$(JAVATARGET) : $(JAVAFILES) $(JAVACLASSFILES)
@@ -78,7 +76,6 @@ $(JAVATARGET) : $(JAVAFILES) $(JAVACLASSFILES)
@@-find $(CLASSDIR) -type d -user $(USER) \! -perm -5 -print | xargs chmod a+r $$1
.ENDIF
.ENDIF
- @echo > $@
+ @$(TOUCH) $@
.ENDIF # "$(JAVATARGET)"!=""
-
diff --git a/solenv/inc/tg_rslb.mk b/solenv/inc/tg_rslb.mk
index 69721a7e2204..1f0aff311903 100644
--- a/solenv/inc/tg_rslb.mk
+++ b/solenv/inc/tg_rslb.mk
@@ -43,7 +43,8 @@ $(RSC_MULTI$(TNR)) : \
-fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB$(TNR)NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
@@ -58,7 +59,8 @@ $(RSC_MULTI$(TNR)) : \
-fs={$(BIN)/$(RESLIB$(TNR)NAME)$i.res} \
$(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \
-lip={$j} ) \
- -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/$i -lip=$(SOLARSRC)/$(RSCDEFIMG) ) \
-subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
-subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
-oil=$(BIN) \
diff --git a/solenv/inc/tg_shl.mk b/solenv/inc/tg_shl.mk
index ab95b1a75c4f..1bcebb8c72e3 100644
--- a/solenv/inc/tg_shl.mk
+++ b/solenv/inc/tg_shl.mk
@@ -362,7 +362,7 @@ $(SHL$(TNR)TARGETN) : \
$(SHL$(TNR)STDLIBS) \
$(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
$(SHL$(TNR)LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -386,7 +386,7 @@ $(SHL$(TNR)TARGETN) : \
$(SHL$(TNR)STDLIBS) \
$(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
$(SHL$(TNR)LINKRES) \
- ) $(LINKOUTPUTFILTER)
+ )
# double check if target was really written... still making sense?
@@$(LS) $@
@echo linking $@.manifest ...
@@ -558,7 +558,6 @@ $(SHL$(TNR)TARGETN) : \
$(SHL$(TNR)STDLIBS:^"-l") \
$(SHL$(TNR)LINKRES) \
$(SHL$(TNR)STDSHL:^"-l") $(STDSHL$(TNR):^"-l") \
- $(LINKOUTPUTFILTER)
@$(LS) $@ >& $(NULLDEV)
.ENDIF # "$(USE_DEFFILE)"!=""
diff --git a/solenv/inc/wntmsci11.mk b/solenv/inc/wntmsci11.mk
index 972feb0a8fdc..d70fb134f056 100755
--- a/solenv/inc/wntmsci11.mk
+++ b/solenv/inc/wntmsci11.mk
@@ -230,10 +230,9 @@ _VC_MANIFEST_BASENAME=__VC80
_VC_MANIFEST_BASENAME=__VC90
.ENDIF
-LINK=link /MACHINE:IX86
+LINK=link /MACHINE:IX86 /IGNORE:4102 /IGNORE:4197
# do *not* add $(NOLOGO) to LINK or LINKFLAGS. Strangely, the wntmsci12 linker links fine then, but exits with
# a return value 1, which makes dmake think it failed
-LINKOUTPUTFILTER= $(PIPEERROR) $(GREP) -v "LNK4197:"
.IF "$(PRODUCT)"!="full"
.ELSE
LINKFLAGS=/MAP /OPT:NOREF
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index a421cc8a164e..818fec8009c9 100644..100755
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -71,6 +71,7 @@ class SmPrintOptionsTabPage : public SfxTabPage
MetricField aZoom;
FixedLine aFixedLine3;
CheckBox aNoRightSpaces;
+ CheckBox aSaveOnlyUsedSymbols;
DECL_LINK(SizeButtonClickHdl, Button *);
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index f03cd43fc965..f8ffef16dfcd 100644..100755
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -29,19 +29,21 @@
#define SMDLL 1
-#include <sot/storage.hxx>
-#include <sot/sotref.hxx>
+#include <rtl/ustring.hxx>
+#include <sfx2/docfac.hxx>
#include <sfx2/objsh.hxx>
+#include <sot/sotref.hxx>
+#include <sot/storage.hxx>
#include <svl/lstner.hxx>
-#include <sfx2/docfac.hxx>
+#include <vcl/jobset.hxx>
#include <vcl/virdev.hxx>
+#include <set>
+
#include "format.hxx"
#include "parse.hxx"
#include "smmod.hxx"
-#include <vcl/jobset.hxx>
-
class SmNode;
class SfxMenuBarManager;
class SfxPrinter;
@@ -124,6 +126,8 @@ class SmDocShell : public SfxObjectShell, public SfxListener
USHORT nModifyCount;
BOOL bIsFormulaArranged;
+ std::set< rtl::OUString > aUsedSymbols; // to export used symbols only when saving
+
virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType,
@@ -200,6 +204,8 @@ public:
const SmNode * GetFormulaTree() const { return pTree; }
void SetFormulaTree(SmNode *&rTree) { pTree = rTree; }
+ const std::set< rtl::OUString > & GetUsedSymbols() const { return aUsedSymbols; }
+
String GetAccessibleText();
EditEngine & GetEditEngine();
@@ -210,7 +216,7 @@ public:
void Repaint();
- virtual SfxUndoManager *GetUndoManager ();
+ virtual ::svl::IUndoManager *GetUndoManager ();
virtual SfxItemPool& GetPool() const;
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index facf17d561e2..e30193490539 100644..100755
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -33,11 +33,16 @@
#include <tools/list.hxx>
#include <tools/string.hxx>
+#include <set>
+#include <stack>
+#include <list>
+
#include "types.hxx"
class SmNode;
class SmDocShell;
+//////////////////////////////////////////////////////////////////////
// TokenGroups
#define TGOPER 0x00000001
@@ -113,17 +118,18 @@ enum SmTokenType
struct SmToken
{
- // token text
- String aText;
- // token info
- SmTokenType eType;
+
+ String aText; // token text
+ SmTokenType eType; // token info
sal_Unicode cMathChar;
+
// parse-help info
- ULONG nGroup;
- USHORT nLevel;
+ ULONG nGroup;
+ USHORT nLevel;
+
// token position
- USHORT nRow;
- xub_StrLen nCol;
+ USHORT nRow;
+ xub_StrLen nCol;
SmToken();
};
@@ -152,6 +158,7 @@ struct SmErrorDesc
String Text;
};
+
DECLARE_STACK(SmNodeStack, SmNode *)
DECLARE_LIST(SmErrDescList, SmErrorDesc *)
@@ -170,19 +177,22 @@ enum SmConvert
class SmParser
{
- String BufferString;
- SmToken CurToken;
- SmNodeStack NodeStack;
- SmErrDescList ErrDescList;
- int CurError;
- LanguageType nLang;
- xub_StrLen BufferIndex,
- nTokenIndex;
- USHORT Row,
- ColOff;
- SmConvert eConversion;
- BOOL bImportSymNames,
- bExportSymNames;
+ String m_aBufferString;
+ SmToken m_aCurToken;
+ SmNodeStack m_aNodeStack;
+ SmErrDescList m_aErrDescList;
+ int m_nCurError;
+ LanguageType m_nLang;
+ xub_StrLen m_nBufferIndex,
+ m_nTokenIndex;
+ USHORT m_Row,
+ m_nColOff;
+ SmConvert m_eConversion;
+ BOOL m_bImportSymNames,
+ m_bExportSymNames;
+
+ // map of used symbols (used to reduce file size by exporting only actually used symbols)
+ std::set< rtl::OUString > m_aUsedSymbols;
// declare copy-constructor and assignment-operator private
SmParser(const SmParser &);
@@ -193,7 +203,7 @@ protected:
BOOL IsDelimiter( const String &rTxt, xub_StrLen nPos );
#endif
void NextToken();
- xub_StrLen GetTokenIndex() const { return nTokenIndex; }
+ xub_StrLen GetTokenIndex() const { return m_nTokenIndex; }
void Insert(const String &rText, USHORT nPos);
void Replace( USHORT nPos, USHORT nLen, const String &rText );
@@ -231,37 +241,43 @@ protected:
void GlyphSpecial();
// end of grammar
- LanguageType GetLanguage() const { return nLang; }
- void SetLanguage( LanguageType nNewLang ) { nLang = nNewLang; }
+ LanguageType GetLanguage() const { return m_nLang; }
+ void SetLanguage( LanguageType nNewLang ) { m_nLang = nNewLang; }
void Error(SmParseError Error);
+ void ClearUsedSymbols() { m_aUsedSymbols.clear(); }
+ void AddToUsedSymbols( const String &rSymbolName ) { m_aUsedSymbols.insert( rSymbolName ); }
+
public:
SmParser();
SmNode *Parse(const String &rBuffer);
- const String & GetText() const { return BufferString; };
+ const String & GetText() const { return m_aBufferString; };
- SmConvert GetConversion() const { return eConversion; }
- void SetConversion(SmConvert eConv) { eConversion = eConv; }
+ SmConvert GetConversion() const { return m_eConversion; }
+ void SetConversion(SmConvert eConv) { m_eConversion = eConv; }
- BOOL IsImportSymbolNames() const { return bImportSymNames; }
- void SetImportSymbolNames(BOOL bVal) { bImportSymNames = bVal; }
- BOOL IsExportSymbolNames() const { return bExportSymNames; }
- void SetExportSymbolNames(BOOL bVal) { bExportSymNames = bVal; }
+ BOOL IsImportSymbolNames() const { return m_bImportSymNames; }
+ void SetImportSymbolNames(BOOL bVal) { m_bImportSymNames = bVal; }
+ BOOL IsExportSymbolNames() const { return m_bExportSymNames; }
+ void SetExportSymbolNames(BOOL bVal) { m_bExportSymNames = bVal; }
USHORT AddError(SmParseError Type, SmNode *pNode);
const SmErrorDesc * NextError();
const SmErrorDesc * PrevError();
const SmErrorDesc * GetError(USHORT i = 0xFFFF);
+
+ bool IsUsedSymbol( const String &rSymbolName ) const { return m_aUsedSymbols.find( rSymbolName ) != m_aUsedSymbols.end(); }
+ std::set< rtl::OUString > GetUsedSymbols() const { return m_aUsedSymbols; }
};
inline BOOL SmParser::TokenInGroup(ULONG nGroup)
{
- return (CurToken.nGroup & nGroup) ? TRUE : FALSE;
+ return (m_aCurToken.nGroup & nGroup) ? TRUE : FALSE;
}
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index 1b919471115c..7acefec94808 100644..100755
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -82,10 +82,9 @@
#define SID_CMDBOXWINDOW (SID_SMA_START + 122)
#define SID_TOOLBOXWINDOW (SID_SMA_START + 123)
#define SID_NO_RIGHT_SPACES (SID_SMA_START + 124)
+#define SID_SAVE_ONLY_USED_SYMBOLS (SID_SMA_START + 125)
#define SID_DUMMY (SID_SMA_START + 254)
-//#define GID_FORMEL (RID_GROUPS_OFFSET + 1)
-//#define GID_ERROR (RID_GROUPS_OFFSET + 2)
//#define RID_OPTIONSDIALOG (RID_APP_START + 1)
#define RID_FONTDIALOG (RID_APP_START + 2)
@@ -100,8 +99,6 @@
#define RID_PRINTUIOPTIONS (RID_APP_START + 11)
#define RID_MATH_TOOLBOX (RID_APP_START + 50)
-// wegen #58705# entfernt
-//#define RID_DRAW_OBJECTBAR (RID_APP_START + 51)
#define RID_DEFAULTSAVEQUERY (RID_APP_START + 102)
#define RID_WRITESYMBOLERROR (RID_APP_START + 202)
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index c8db4720b943..b654b22b2d66 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -111,7 +111,8 @@ static const char * aMathPropNames[] =
"Print/Frame",
"Print/Size",
"Print/ZoomFactor",
- //"Misc/NoSymbolsWarning",
+ "LoadSave/IsSaveOnlyUsedSymbols",
+ //"Misc/NoSymbolsWarning", @deprecated
"Misc/IgnoreSpacesRight",
"View/ToolboxVisible",
"View/AutoRedraw",
@@ -206,6 +207,7 @@ struct SmCfgOther
BOOL bPrintTitle;
BOOL bPrintFormulaText;
BOOL bPrintFrame;
+ BOOL bIsSaveOnlyUsedSymbols;
BOOL bIgnoreSpacesRight;
BOOL bToolboxVisible;
BOOL bAutoRedraw;
@@ -223,7 +225,7 @@ SmCfgOther::SmCfgOther()
bPrintTitle = bPrintFormulaText =
bPrintFrame = bIgnoreSpacesRight =
bToolboxVisible = bAutoRedraw =
- bFormulaCursor = /*bNoSymbolsWarning =*/ TRUE;
+ bFormulaCursor = bIsSaveOnlyUsedSymbols = TRUE;
}
/////////////////////////////////////////////////////////////////
@@ -900,6 +902,10 @@ void SmMathConfig::LoadOther()
// Print/ZoomFactor
if (pVal->hasValue() && (*pVal >>= nTmp16))
pOther->nPrintZoomFactor = nTmp16;
+ ++pVal;
+ // LoadSave/IsSaveOnlyUsedSymbols
+ if (pVal->hasValue() && (*pVal >>= bTmp))
+ pOther->bIsSaveOnlyUsedSymbols = bTmp;
/* ++pVal;
// Misc/NoSymbolsWarning
if (pVal->hasValue() && (*pVal >>= bTmp))
@@ -951,6 +957,8 @@ void SmMathConfig::SaveOther()
*pValue++ <<= (INT16) pOther->ePrintSize;
// Print/ZoomFactor
*pValue++ <<= (INT16) pOther->nPrintZoomFactor;
+ // LoadSave/IsSaveOnlyUsedSymbols
+ *pValue++ <<= (BOOL) pOther->bIsSaveOnlyUsedSymbols;
/* // Misc/NoSymbolsWarning
*pValue++ <<= (BOOL) pOther->bNoSymbolsWarning;
*/
@@ -1235,6 +1243,22 @@ void SmMathConfig::SetPrintFrame( BOOL bVal )
}
+BOOL SmMathConfig::IsSaveOnlyUsedSymbols() const
+{
+ if (!pOther)
+ ((SmMathConfig *) this)->LoadOther();
+ return pOther->bIsSaveOnlyUsedSymbols;
+}
+
+
+void SmMathConfig::SetSaveOnlyUsedSymbols( BOOL bVal )
+{
+ if (!pOther)
+ LoadOther();
+ SetOtherIfNotEqual( pOther->bIsSaveOnlyUsedSymbols, bVal );
+}
+
+
BOOL SmMathConfig::IsIgnoreSpacesRight() const
{
if (!pOther)
diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx
index 8e3330a6466f..25cfdae309b6 100644
--- a/starmath/source/cfgitem.hxx
+++ b/starmath/source/cfgitem.hxx
@@ -196,6 +196,9 @@ public:
USHORT GetPrintZoomFactor() const;
void SetPrintZoomFactor( USHORT nVal );
+ BOOL IsSaveOnlyUsedSymbols() const;
+ void SetSaveOnlyUsedSymbols( BOOL bVal );
+
BOOL IsIgnoreSpacesRight() const;
void SetIgnoreSpacesRight( BOOL bVal );
BOOL IsAutoRedraw() const;
diff --git a/starmath/source/config.cxx b/starmath/source/config.cxx
index 16b3b97afd96..c7adf9e07446 100644..100755
--- a/starmath/source/config.cxx
+++ b/starmath/source/config.cxx
@@ -101,6 +101,10 @@ void SmConfig::ItemSetToConfig(const SfxItemSet &rSet)
Broadcast(SfxSimpleHint(HINT_FORMATCHANGED));
}
}
+ if (rSet.GetItemState(SID_SAVE_ONLY_USED_SYMBOLS, TRUE, &pItem) == SFX_ITEM_SET)
+ { bVal = ((const SfxBoolItem *) pItem)->GetValue();
+ SetSaveOnlyUsedSymbols( bVal );
+ }
SaveOther();
}
@@ -120,6 +124,7 @@ void SmConfig::ConfigToItemSet(SfxItemSet &rSet) const
rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTFRAME), IsPrintFrame()));
rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTOREDRAW), IsAutoRedraw()));
rSet.Put(SfxBoolItem(pPool->GetWhich(SID_NO_RIGHT_SPACES), IsIgnoreSpacesRight()));
+ rSet.Put(SfxBoolItem(pPool->GetWhich(SID_SAVE_ONLY_USED_SYMBOLS), IsSaveOnlyUsedSymbols()));
}
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index a33ab14a98bf..15a644fcfba5 100644..100755
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -188,8 +188,9 @@ SmPrintOptionsTabPage::SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &
aSizeScaled (this, SmResId( RB_FIT_TO_PAGE )),
aSizeZoomed (this, SmResId( RB_ZOOM )),
aZoom (this, SmResId( MF_ZOOM )),
- aFixedLine3 (this, SmResId( FL_MISC_OPTIONS )),
- aNoRightSpaces (this, SmResId( CB_IGNORE_SPACING ))
+ aFixedLine3 (this, SmResId( FL_MISC_OPTIONS )),
+ aNoRightSpaces (this, SmResId( CB_IGNORE_SPACING )),
+ aSaveOnlyUsedSymbols (this, SmResId( CB_SAVE_ONLY_USED_SYMBOLS ))
{
FreeResource();
@@ -217,6 +218,7 @@ BOOL SmPrintOptionsTabPage::FillItemSet(SfxItemSet& rSet)
rSet.Put(SfxBoolItem(GetWhich(SID_PRINTTEXT), aText.IsChecked()));
rSet.Put(SfxBoolItem(GetWhich(SID_PRINTFRAME), aFrame.IsChecked()));
rSet.Put(SfxBoolItem(GetWhich(SID_NO_RIGHT_SPACES), aNoRightSpaces.IsChecked()));
+ rSet.Put(SfxBoolItem(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS), aSaveOnlyUsedSymbols.IsChecked()));
return TRUE;
}
@@ -238,6 +240,7 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet& rSet)
aText.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_PRINTTEXT))).GetValue());
aFrame.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_PRINTFRAME))).GetValue());
aNoRightSpaces.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_NO_RIGHT_SPACES))).GetValue());
+ aSaveOnlyUsedSymbols.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS))).GetValue());
}
diff --git a/starmath/source/dialog.hrc b/starmath/source/dialog.hrc
index 29d87ba1d287..9e3e58493ab3 100644..100755
--- a/starmath/source/dialog.hrc
+++ b/starmath/source/dialog.hrc
@@ -31,17 +31,18 @@
#define FL_PRINTOPTIONS 10
#define CB_TITLEROW 11
-#define CB_EQUATION_TEXT 12
+#define CB_EQUATION_TEXT 12
#define CB_FRAME 13
#define FL_PRINT_FORMAT 20
-#define RB_ORIGINAL_SIZE 21
-#define RB_FIT_TO_PAGE 22
+#define RB_ORIGINAL_SIZE 21
+#define RB_FIT_TO_PAGE 22
#define RB_ZOOM 23
#define MF_ZOOM 24
#define FL_MISC_OPTIONS 30
-#define CB_IGNORE_SPACING 31
+#define CB_IGNORE_SPACING 31
+#define CB_SAVE_ONLY_USED_SYMBOLS 32
#define FT_FONTS_SUBSET 110
#define LB_FONTS_SUBSET 111
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 53399212da97..1f7271168e0a 100644..100755
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -98,6 +98,7 @@
#include "mathmlexport.hxx"
#include <sfx2/sfxsids.hrc>
#include <svx/svxids.hrc>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -260,6 +261,8 @@ void SmDocShell::Parse()
pTree = aInterpreter.Parse(aText);
nModifyCount++; //! see comment for SID_GAPHIC_SM in SmDocShell::GetState
SetFormulaArranged( FALSE );
+
+ aUsedSymbols = aInterpreter.GetUsedSymbols();
}
@@ -1006,7 +1009,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
SmFormat aNewFormat( aOldFormat );
aNewFormat.SetTextmode(!aOldFormat.IsTextmode());
- SfxUndoManager *pTmpUndoMgr = GetUndoManager();
+ ::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
@@ -1049,7 +1052,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
SmFormat aNewFormat( aOldFormat );
pFontTypeDialog->WriteTo(aNewFormat);
- SfxUndoManager *pTmpUndoMgr = GetUndoManager();
+ ::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
@@ -1073,7 +1076,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pFontSizeDialog->WriteTo(aNewFormat);
- SfxUndoManager *pTmpUndoMgr = GetUndoManager();
+ ::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
@@ -1097,7 +1100,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pDistanceDialog->WriteTo(aNewFormat);
- SfxUndoManager *pTmpUndoMgr = GetUndoManager();
+ ::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
@@ -1126,7 +1129,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pAlignDialog->WriteTo( aFmt );
pp->GetConfig()->SetStandardFormat( aFmt );
- SfxUndoManager *pTmpUndoMgr = GetUndoManager();
+ ::svl::IUndoManager *pTmpUndoMgr = GetUndoManager();
if (pTmpUndoMgr)
pTmpUndoMgr->AddUndoAction(
new SmFormatAction(this, aOldFormat, aNewFormat));
@@ -1149,7 +1152,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
case SID_UNDO:
case SID_REDO:
{
- SfxUndoManager* pTmpUndoMgr = GetUndoManager();
+ ::svl::IUndoManager* pTmpUndoMgr = GetUndoManager();
if( pTmpUndoMgr )
{
USHORT nId = rReq.GetSlot(), nCnt = 1;
@@ -1158,22 +1161,29 @@ void SmDocShell::Execute(SfxRequest& rReq)
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, FALSE, &pItem ))
nCnt = ((SfxUInt16Item*)pItem)->GetValue();
- BOOL (SfxUndoManager:: *fnDo)( USHORT );
+ BOOL (::svl::IUndoManager:: *fnDo)();
sal_uInt16 nCount;
if( SID_UNDO == rReq.GetSlot() )
{
nCount = pTmpUndoMgr->GetUndoActionCount();
- fnDo = &SfxUndoManager::Undo;
+ fnDo = &::svl::IUndoManager::Undo;
}
else
{
nCount = pTmpUndoMgr->GetRedoActionCount();
- fnDo = &SfxUndoManager::Redo;
+ fnDo = &::svl::IUndoManager::Redo;
}
- for( ; nCnt && nCount; --nCnt, --nCount )
- (pTmpUndoMgr->*fnDo)( 0 );
+ try
+ {
+ for( ; nCnt && nCount; --nCnt, --nCount )
+ (pTmpUndoMgr->*fnDo)();
+ }
+ catch( const Exception& e )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
Repaint();
SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
@@ -1256,27 +1266,27 @@ void SmDocShell::GetState(SfxItemSet &rSet)
case SID_GETUNDOSTRINGS:
case SID_GETREDOSTRINGS:
{
- SfxUndoManager* pTmpUndoMgr = GetUndoManager();
+ ::svl::IUndoManager* pTmpUndoMgr = GetUndoManager();
if( pTmpUndoMgr )
{
- UniString(SfxUndoManager:: *fnGetComment)( USHORT ) const;
+ UniString(::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWh )
{
nCount = pTmpUndoMgr->GetUndoActionCount();
- fnGetComment = &SfxUndoManager::GetUndoActionComment;
+ fnGetComment = &::svl::IUndoManager::GetUndoActionComment;
}
else
{
nCount = pTmpUndoMgr->GetRedoActionCount();
- fnGetComment = &SfxUndoManager::GetRedoActionComment;
+ fnGetComment = &::svl::IUndoManager::GetRedoActionComment;
}
if( nCount )
{
String sList;
for( sal_uInt16 n = 0; n < nCount; ++n )
- ( sList += (pTmpUndoMgr->*fnGetComment)( n ) )
+ ( sList += (pTmpUndoMgr->*fnGetComment)( n, ::svl::IUndoManager::TopLevel ) )
+= '\n';
SfxStringListItem aItem( nWh );
@@ -1293,7 +1303,7 @@ void SmDocShell::GetState(SfxItemSet &rSet)
}
-SfxUndoManager *SmDocShell::GetUndoManager()
+::svl::IUndoManager *SmDocShell::GetUndoManager()
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::GetUndoManager" );
diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk
index 5900fae65b87..c9f0226c8df4 100644..100755
--- a/starmath/source/makefile.mk
+++ b/starmath/source/makefile.mk
@@ -52,31 +52,31 @@ SRC2FILES = smres.src \
SLO1FILES = \
$(SLO)$/accessibility.obj \
- $(SLO)$/edit.obj \
- $(SLO)$/eqnolefilehdr.obj \
- $(SLO)$/mathmlexport.obj \
- $(SLO)$/mathmlimport.obj \
- $(SLO)$/symbol.obj \
- $(SLO)$/types.obj \
- $(SLO)$/unodoc.obj \
$(SLO)$/action.obj \
$(SLO)$/cfgitem.obj \
$(SLO)$/config.obj \
$(SLO)$/dialog.obj \
$(SLO)$/document.obj \
+ $(SLO)$/edit.obj \
+ $(SLO)$/eqnolefilehdr.obj \
$(SLO)$/format.obj \
+ $(SLO)$/mathmlexport.obj \
+ $(SLO)$/mathmlimport.obj \
$(SLO)$/mathtype.obj \
$(SLO)$/node.obj \
$(SLO)$/parse.obj \
+ $(SLO)$/rect.obj \
$(SLO)$/register.obj \
$(SLO)$/smdll.obj \
+ $(SLO)$/smmod.obj \
+ $(SLO)$/symbol.obj \
$(SLO)$/toolbox.obj \
$(SLO)$/typemap.obj \
- $(SLO)$/smmod.obj \
+ $(SLO)$/types.obj \
+ $(SLO)$/unodoc.obj \
$(SLO)$/utility.obj \
- $(SLO)$/rect.obj \
- $(SLO)$/unomodel.obj \
- $(SLO)$/view.obj
+ $(SLO)$/view.obj \
+ $(SLO)$/unomodel.obj
SLO2FILES = \
$(SLO)$/register.obj \
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index bec69eb01b95..711ac2535a9b 100644..100755
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -79,6 +79,7 @@
#include <unomodel.hxx>
#include <document.hxx>
#include <utility.hxx>
+#include <config.hxx>
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -742,6 +743,9 @@ void SmXMLExport::GetConfigurationSettings( Sequence < PropertyValue > & rProps)
PropertyValue* pProps = rProps.getArray();
if (pProps)
{
+ SmConfig *pConfig = SM_MOD()->GetConfig();
+ const bool bUsedSymbolsOnly = pConfig ? pConfig->IsSaveOnlyUsedSymbols() : false;
+
const OUString sFormula ( RTL_CONSTASCII_USTRINGPARAM ( "Formula" ) );
const OUString sBasicLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "BasicLibraries" ) );
const OUString sDialogLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "DialogLibraries" ) );
@@ -755,7 +759,14 @@ void SmXMLExport::GetConfigurationSettings( Sequence < PropertyValue > & rProps)
rPropName != sRuntimeUID)
{
pProps->Name = rPropName;
- pProps->Value = xProps->getPropertyValue(rPropName);
+
+ rtl::OUString aActualName( rPropName );
+
+ // handle 'save used symbols only'
+ if (bUsedSymbolsOnly && rPropName.equalsAscii("Symbols"))
+ aActualName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "UserDefinedSymbolsInUse" ) );
+
+ pProps->Value = xProps->getPropertyValue( aActualName );
}
}
}
@@ -784,7 +795,8 @@ void SmXMLExport::ExportExpression(const SmNode *pNode, int nLevel)
SvXMLElementExport *pRow=0;
ULONG nSize = pNode->GetNumSubNodes();
- if (nSize > 1)
+ // #i115443: nodes of type expression always need to be grouped with mrow statement
+ if (nSize > 1 || (pNode && pNode->GetType() == NEXPRESSION))
pRow = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MROW, sal_True, sal_True);
//if (nSize)
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 36c009757eac..4364c60b9e10 100644..100755
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -1613,8 +1613,11 @@ public:
void SmXMLSubContext_Impl::GenericEndElement(SmTokenType eType, SmSubSup eSubSup)
{
/*The <msub> element requires exactly 2 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
+ const bool bNodeCheck = GetSmImport().GetNodeStack().Count() - nElementCount == 2;
+ DBG_ASSERT( bNodeCheck, "Sub has not two arguments" );
+ if (!bNodeCheck)
+ return;
+
SmToken aToken;
aToken.cMathChar = '\0';
aToken.nGroup = 0;
@@ -1672,8 +1675,10 @@ void SmXMLSubSupContext_Impl::GenericEndElement(SmTokenType eType,
SmSubSup aSub,SmSubSup aSup)
{
/*The <msub> element requires exactly 3 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 3,
- "SubSup has not three arguments");
+ const bool bNodeCheck = GetSmImport().GetNodeStack().Count() - nElementCount == 3;
+ DBG_ASSERT( bNodeCheck, "SubSup has not three arguments" );
+ if (!bNodeCheck)
+ return;
SmToken aToken;
aToken.cMathChar = '\0';
@@ -1721,8 +1726,10 @@ void SmXMLUnderContext_Impl::StartElement(const uno::Reference<
void SmXMLUnderContext_Impl::HandleAccent()
{
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
+ const bool bNodeCheck = GetSmImport().GetNodeStack().Count() - nElementCount == 2;
+ DBG_ASSERT( bNodeCheck, "Sub has not two arguments" );
+ if (!bNodeCheck)
+ return;
/*Just one special case for the underline thing*/
SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
@@ -1803,8 +1810,11 @@ void SmXMLOverContext_Impl::EndElement()
void SmXMLOverContext_Impl::HandleAccent()
{
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
+ const bool bNodeCheck = GetSmImport().GetNodeStack().Count() - nElementCount == 2;
+ DBG_ASSERT( bNodeCheck, "Sub has not two arguments" );
+ if (!bNodeCheck)
+ return;
+
SmToken aToken;
aToken.cMathChar = '\0';
aToken.nGroup = 0;
@@ -2352,6 +2362,12 @@ void SmXMLDocContext_Impl::EndElement()
void SmXMLFracContext_Impl::EndElement()
{
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ const bool bNodeCheck = rNodeStack.Count() - nElementCount == 2;
+ DBG_ASSERT( bNodeCheck, "Fraction (mfrac) tag is missing component" );
+ if (!bNodeCheck)
+ return;
+
SmToken aToken;
aToken.cMathChar = '\0';
aToken.nGroup = 0;
@@ -2359,23 +2375,19 @@ void SmXMLFracContext_Impl::EndElement()
aToken.eType = TOVER;
SmStructureNode *pSNode = new SmBinVerNode(aToken);
SmNode *pOper = new SmRectangleNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- DBG_ASSERT(rNodeStack.Count() - nElementCount == 2,
- "Fraction (mfrac) tag is missing component");
- if (rNodeStack.Count() - nElementCount == 2)
- {
- SmNode *pSecond = rNodeStack.Pop();
- SmNode *pFirst = rNodeStack.Pop();
- pSNode->SetSubNodes(pFirst,pOper,pSecond);
- rNodeStack.Push(pSNode);
- }
+ SmNode *pSecond = rNodeStack.Pop();
+ SmNode *pFirst = rNodeStack.Pop();
+ pSNode->SetSubNodes(pFirst,pOper,pSecond);
+ rNodeStack.Push(pSNode);
}
void SmXMLRootContext_Impl::EndElement()
{
/*The <mroot> element requires exactly 2 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Root tag is missing component");
+ const bool bNodeCheck = GetSmImport().GetNodeStack().Count() - nElementCount == 2;
+ DBG_ASSERT( bNodeCheck, "Root tag is missing component" );
+ if (!bNodeCheck)
+ return;
SmToken aToken;
aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font
@@ -2612,9 +2624,8 @@ void SmXMLMultiScriptsContext_Impl::MiddleElement()
{
bHasPrescripts=sal_True;
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount > 0,
- "Sub has no arguments");
SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ DBG_ASSERT( rNodeStack.Count() - nElementCount > 0, "Sub has no arguments" );
if (rNodeStack.Count()-nElementCount > 1)
{
SmToken aToken;
@@ -3168,8 +3179,14 @@ void SmXMLImport::SetConfigurationSettings(const Sequence<PropertyValue>& aConfP
if ( xInfo->hasPropertyByName( pValues->Name ) )
xProps->setPropertyValue( pValues->Name, pValues->Value );
}
- catch( Exception& )
+ catch (beans::PropertyVetoException &e)
+ {
+ (void) e;
+ // dealing with read-only properties here. Nothing to do...
+ }
+ catch( Exception& e)
{
+ (void) e;
DBG_ERROR( "SmXMLImport::SetConfigurationSettings: Exception!" );
}
}
diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx
index 22c2017c61b1..3225c2f85eb6 100644..100755
--- a/starmath/source/mathmlimport.hxx
+++ b/starmath/source/mathmlimport.hxx
@@ -251,10 +251,10 @@ public:
const SvXMLTokenMap &GetPresTableElemTokenMap();
const SvXMLTokenMap &GetColorTokenMap();
- SmNodeStack & GetNodeStack() {return aNodeStack;}
- SmNode *GetTree() { return aNodeStack.Pop();}
- sal_Bool GetSuccess() { return bSuccess; }
- String &GetText() { return aText;}
+ SmNodeStack & GetNodeStack() { return aNodeStack; }
+ SmNode *GetTree() { return aNodeStack.Pop(); }
+ sal_Bool GetSuccess() { return bSuccess; }
+ String &GetText() { return aText; }
virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps);
virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps);
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 697e18362d87..042997ee3bea 100755
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -392,22 +392,22 @@ BOOL SmParser::IsDelimiter( const String &rTxt, xub_StrLen nPos )
void SmParser::Insert(const String &rText, USHORT nPos)
{
- BufferString.Insert(rText, nPos);
+ m_aBufferString.Insert(rText, nPos);
xub_StrLen nLen = rText.Len();
- BufferIndex = BufferIndex + nLen;
- nTokenIndex = nTokenIndex + nLen;
+ m_nBufferIndex = m_nBufferIndex + nLen;
+ m_nTokenIndex = m_nTokenIndex + nLen;
}
void SmParser::Replace( USHORT nPos, USHORT nLen, const String &rText )
{
- DBG_ASSERT( nPos + nLen <= BufferString.Len(), "argument mismatch" );
+ DBG_ASSERT( nPos + nLen <= m_aBufferString.Len(), "argument mismatch" );
- BufferString.Replace( nPos, nLen, rText );
+ m_aBufferString.Replace( nPos, nLen, rText );
INT16 nChg = rText.Len() - nLen;
- BufferIndex = BufferIndex + nChg;
- nTokenIndex = nTokenIndex + nChg;
+ m_nBufferIndex = m_nBufferIndex + nChg;
+ m_nTokenIndex = m_nTokenIndex + nChg;
}
@@ -434,7 +434,7 @@ void SmParser::NextToken()
{
static const String aEmptyStr;
- xub_StrLen nBufLen = BufferString.Len();
+ xub_StrLen nBufLen = m_aBufferString.Len();
ParseResult aRes;
xub_StrLen nRealStart;
BOOL bCont;
@@ -444,12 +444,12 @@ void SmParser::NextToken()
{
// skip white spaces
while (UnicodeType::SPACE_SEPARATOR ==
- aCC.getType( BufferString, BufferIndex ))
- ++BufferIndex;
+ aCC.getType( m_aBufferString, m_nBufferIndex ))
+ ++m_nBufferIndex;
sal_Int32 nStartFlags = coStartFlags;
sal_Int32 nContFlags = coContFlags;
- sal_Unicode cFirstChar = BufferString.GetChar( BufferIndex );
+ sal_Unicode cFirstChar = m_aBufferString.GetChar( m_nBufferIndex );
/*
removed because of #i11752#
bNumStart = cFirstChar == '.' || ('0' <= cFirstChar && cFirstChar <= '9');
@@ -459,7 +459,7 @@ void SmParser::NextToken()
nContFlags = coNumContFlags;
}
*/
- aRes = aCC.parseAnyToken( BufferString, BufferIndex,
+ aRes = aCC.parseAnyToken( m_aBufferString, m_nBufferIndex,
nStartFlags, aEmptyStr,
nContFlags, aEmptyStr );
@@ -476,7 +476,7 @@ void SmParser::NextToken()
aCC.setLocale( aDotLoc );
aTmpRes = aCC.parsePredefinedToken(
KParseType::ASC_NUMBER,
- BufferString, BufferIndex,
+ m_aBufferString, m_nBufferIndex,
KParseTokens::ASC_DIGIT, aEmptyStr,
KParseTokens::ASC_DIGIT | KParseTokens::ASC_DOT, aEmptyStr );
aCC.setLocale( aOldLoc );
@@ -484,29 +484,29 @@ void SmParser::NextToken()
aRes.TokenType = aTmpRes.TokenType;
}
- nRealStart = BufferIndex + sal::static_int_cast< xub_StrLen >(aRes.LeadingWhiteSpace);
- BufferIndex = nRealStart;
+ nRealStart = m_nBufferIndex + sal::static_int_cast< xub_StrLen >(aRes.LeadingWhiteSpace);
+ m_nBufferIndex = nRealStart;
bCont = FALSE;
if ( aRes.TokenType == 0 &&
nRealStart < nBufLen &&
- '\n' == BufferString.GetChar( nRealStart ) )
+ '\n' == m_aBufferString.GetChar( nRealStart ) )
{
// keep data needed for tokens row and col entry up to date
- ++Row;
- BufferIndex = ColOff = nRealStart + 1;
+ ++m_Row;
+ m_nBufferIndex = m_nColOff = nRealStart + 1;
bCont = TRUE;
}
else if (aRes.TokenType & KParseType::ONE_SINGLE_CHAR)
{
- String aName( BufferString.Copy( nRealStart, 2 ));
+ String aName( m_aBufferString.Copy( nRealStart, 2 ));
if ( aName.EqualsAscii( "%%" ))
{
//SkipComment
- BufferIndex = nRealStart + 2;
- while (BufferIndex < nBufLen &&
- '\n' != BufferString.GetChar( BufferIndex ))
- ++BufferIndex;
+ m_nBufferIndex = nRealStart + 2;
+ while (m_nBufferIndex < nBufLen &&
+ '\n' != m_aBufferString.GetChar( m_nBufferIndex ))
+ ++m_nBufferIndex;
bCont = TRUE;
}
}
@@ -514,33 +514,33 @@ void SmParser::NextToken()
} while (bCont);
// set index of current token
- nTokenIndex = BufferIndex;
+ m_nTokenIndex = m_nBufferIndex;
- CurToken.nRow = Row;
- CurToken.nCol = nRealStart - ColOff + 1;
+ m_aCurToken.nRow = m_Row;
+ m_aCurToken.nCol = nRealStart - m_nColOff + 1;
BOOL bHandled = TRUE;
if (nRealStart >= nBufLen)
{
- CurToken.eType = TEND;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 0;
- CurToken.aText.Erase();
+ m_aCurToken.eType = TEND;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.Erase();
}
else if ((aRes.TokenType & (KParseType::ASC_NUMBER | KParseType::UNI_NUMBER))
|| (bNumStart && (aRes.TokenType & KParseType::IDENTNAME)))
{
INT32 n = aRes.EndPos - nRealStart;
DBG_ASSERT( n >= 0, "length < 0" );
- CurToken.eType = TNUMBER;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText = BufferString.Copy( nRealStart, sal::static_int_cast< xub_StrLen >(n) );
+ m_aCurToken.eType = TNUMBER;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText = m_aBufferString.Copy( nRealStart, sal::static_int_cast< xub_StrLen >(n) );
#if OSL_DEBUG_LEVEL > 1
- if (!IsDelimiter( BufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
+ if (!IsDelimiter( m_aBufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
{
DBG_WARNING( "identifier really finished? (compatibility!)" );
}
@@ -548,59 +548,59 @@ void SmParser::NextToken()
}
else if (aRes.TokenType & KParseType::DOUBLE_QUOTE_STRING)
{
- CurToken.eType = TTEXT;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText = aRes.DequotedNameOrString;
- CurToken.nRow = Row;
- CurToken.nCol = nRealStart - ColOff + 2;
+ m_aCurToken.eType = TTEXT;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText = aRes.DequotedNameOrString;
+ m_aCurToken.nRow = m_Row;
+ m_aCurToken.nCol = nRealStart - m_nColOff + 2;
}
else if (aRes.TokenType & KParseType::IDENTNAME)
{
INT32 n = aRes.EndPos - nRealStart;
DBG_ASSERT( n >= 0, "length < 0" );
- String aName( BufferString.Copy( nRealStart, sal::static_int_cast< xub_StrLen >(n) ) );
+ String aName( m_aBufferString.Copy( nRealStart, sal::static_int_cast< xub_StrLen >(n) ) );
const SmTokenTableEntry *pEntry = GetTokenTableEntry( aName );
if (pEntry)
{
- CurToken.eType = pEntry->eType;
- CurToken.cMathChar = pEntry->cMathChar;
- CurToken.nGroup = pEntry->nGroup;
- CurToken.nLevel = pEntry->nLevel;
- CurToken.aText.AssignAscii( pEntry->pIdent );
+ m_aCurToken.eType = pEntry->eType;
+ m_aCurToken.cMathChar = pEntry->cMathChar;
+ m_aCurToken.nGroup = pEntry->nGroup;
+ m_aCurToken.nLevel = pEntry->nLevel;
+ m_aCurToken.aText.AssignAscii( pEntry->pIdent );
}
else
{
- CurToken.eType = TIDENT;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText = aName;
+ m_aCurToken.eType = TIDENT;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText = aName;
#if OSL_DEBUG_LEVEL > 1
- if (!IsDelimiter( BufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
+ if (!IsDelimiter( m_aBufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
{
DBG_WARNING( "identifier really finished? (compatibility!)" );
}
#endif
}
}
- else if (aRes.TokenType == 0 && '_' == BufferString.GetChar( nRealStart ))
+ else if (aRes.TokenType == 0 && '_' == m_aBufferString.GetChar( nRealStart ))
{
- CurToken.eType = TRSUB;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = TGPOWER;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "_" );
+ m_aCurToken.eType = TRSUB;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = TGPOWER;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "_" );
aRes.EndPos = nRealStart + 1;
}
else if (aRes.TokenType & KParseType::BOOLEAN)
{
sal_Int32 &rnEndPos = aRes.EndPos;
- String aName( BufferString.Copy( nRealStart,
+ String aName( m_aBufferString.Copy( nRealStart,
sal::static_int_cast< xub_StrLen >(rnEndPos - nRealStart) ));
if (2 >= aName.Len())
{
@@ -609,91 +609,91 @@ void SmParser::NextToken()
{
case '<':
{
- if (BufferString.Copy( nRealStart, 2 ).
+ if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( "<<" ))
{
- CurToken.eType = TLL;
- CurToken.cMathChar = MS_LL;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "<<" );
+ m_aCurToken.eType = TLL;
+ m_aCurToken.cMathChar = MS_LL;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "<<" );
rnEndPos = nRealStart + 2;
}
- else if (BufferString.Copy( nRealStart, 2 ).
+ else if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( "<=" ))
{
- CurToken.eType = TLE;
- CurToken.cMathChar = MS_LE;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "<=" );
+ m_aCurToken.eType = TLE;
+ m_aCurToken.cMathChar = MS_LE;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "<=" );
rnEndPos = nRealStart + 2;
}
- else if (BufferString.Copy( nRealStart, 2 ).
+ else if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( "<>" ))
{
- CurToken.eType = TNEQ;
- CurToken.cMathChar = MS_NEQ;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "<>" );
+ m_aCurToken.eType = TNEQ;
+ m_aCurToken.cMathChar = MS_NEQ;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "<>" );
rnEndPos = nRealStart + 2;
}
- else if (BufferString.Copy( nRealStart, 3 ).
+ else if (m_aBufferString.Copy( nRealStart, 3 ).
EqualsAscii( "<?>" ))
{
- CurToken.eType = TPLACE;
- CurToken.cMathChar = MS_PLACE;
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "<?>" );
+ m_aCurToken.eType = TPLACE;
+ m_aCurToken.cMathChar = MS_PLACE;
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "<?>" );
rnEndPos = nRealStart + 3;
}
else
{
- CurToken.eType = TLT;
- CurToken.cMathChar = MS_LT;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "<" );
+ m_aCurToken.eType = TLT;
+ m_aCurToken.cMathChar = MS_LT;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "<" );
}
}
break;
case '>':
{
- if (BufferString.Copy( nRealStart, 2 ).
+ if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( ">=" ))
{
- CurToken.eType = TGE;
- CurToken.cMathChar = MS_GE;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( ">=" );
+ m_aCurToken.eType = TGE;
+ m_aCurToken.cMathChar = MS_GE;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( ">=" );
rnEndPos = nRealStart + 2;
}
- else if (BufferString.Copy( nRealStart, 2 ).
+ else if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( ">>" ))
{
- CurToken.eType = TGG;
- CurToken.cMathChar = MS_GG;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( ">>" );
+ m_aCurToken.eType = TGG;
+ m_aCurToken.cMathChar = MS_GG;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( ">>" );
rnEndPos = nRealStart + 2;
}
else
{
- CurToken.eType = TGT;
- CurToken.cMathChar = MS_GT;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( ">" );
+ m_aCurToken.eType = TGT;
+ m_aCurToken.cMathChar = MS_GT;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( ">" );
}
}
break;
@@ -705,7 +705,7 @@ void SmParser::NextToken()
else if (aRes.TokenType & KParseType::ONE_SINGLE_CHAR)
{
sal_Int32 &rnEndPos = aRes.EndPos;
- String aName( BufferString.Copy( nRealStart,
+ String aName( m_aBufferString.Copy( nRealStart,
sal::static_int_cast< xub_StrLen >(rnEndPos - nRealStart) ) );
if (1 == aName.Len())
@@ -718,12 +718,12 @@ void SmParser::NextToken()
//! modifies aRes.EndPos
DBG_ASSERT( rnEndPos >= nBufLen ||
- '%' != BufferString.GetChar( sal::static_int_cast< xub_StrLen >(rnEndPos) ),
+ '%' != m_aBufferString.GetChar( sal::static_int_cast< xub_StrLen >(rnEndPos) ),
"unexpected comment start" );
// get identifier of user-defined character
ParseResult aTmpRes = aCC.parseAnyToken(
- BufferString, rnEndPos,
+ m_aBufferString, rnEndPos,
KParseTokens::ANY_LETTER,
aEmptyStr,
coContFlags,
@@ -735,20 +735,20 @@ void SmParser::NextToken()
// default setting for the case that no identifier
// i.e. a valid symbol-name is following the '%'
// character
- CurToken.eType = TTEXT;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText = String();
- CurToken.nRow = sal::static_int_cast< xub_StrLen >(Row);
- CurToken.nCol = nTmpStart - ColOff;
+ m_aCurToken.eType = TTEXT;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText = String();
+ m_aCurToken.nRow = sal::static_int_cast< xub_StrLen >(m_Row);
+ m_aCurToken.nCol = nTmpStart - m_nColOff;
if (aTmpRes.TokenType & KParseType::IDENTNAME)
{
xub_StrLen n = sal::static_int_cast< xub_StrLen >(aTmpRes.EndPos - nTmpStart);
- CurToken.eType = TSPECIAL;
- CurToken.aText = BufferString.Copy( sal::static_int_cast< xub_StrLen >(nTmpStart-1), n+1 );
+ m_aCurToken.eType = TSPECIAL;
+ m_aCurToken.aText = m_aBufferString.Copy( sal::static_int_cast< xub_StrLen >(nTmpStart-1), n+1 );
DBG_ASSERT( aTmpRes.EndPos > rnEndPos,
"empty identifier" );
@@ -765,187 +765,187 @@ void SmParser::NextToken()
break;
case '[':
{
- CurToken.eType = TLBRACKET;
- CurToken.cMathChar = MS_LBRACKET;
- CurToken.nGroup = TGLBRACES;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "[" );
+ m_aCurToken.eType = TLBRACKET;
+ m_aCurToken.cMathChar = MS_LBRACKET;
+ m_aCurToken.nGroup = TGLBRACES;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "[" );
}
break;
case '\\':
{
- CurToken.eType = TESCAPE;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "\\" );
+ m_aCurToken.eType = TESCAPE;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "\\" );
}
break;
case ']':
{
- CurToken.eType = TRBRACKET;
- CurToken.cMathChar = MS_RBRACKET;
- CurToken.nGroup = TGRBRACES;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "]" );
+ m_aCurToken.eType = TRBRACKET;
+ m_aCurToken.cMathChar = MS_RBRACKET;
+ m_aCurToken.nGroup = TGRBRACES;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "]" );
}
break;
case '^':
{
- CurToken.eType = TRSUP;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = TGPOWER;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "^" );
+ m_aCurToken.eType = TRSUP;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = TGPOWER;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "^" );
}
break;
case '`':
{
- CurToken.eType = TSBLANK;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = TGBLANK;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "`" );
+ m_aCurToken.eType = TSBLANK;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = TGBLANK;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "`" );
}
break;
case '{':
{
- CurToken.eType = TLGROUP;
- CurToken.cMathChar = MS_LBRACE;
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "{" );
+ m_aCurToken.eType = TLGROUP;
+ m_aCurToken.cMathChar = MS_LBRACE;
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "{" );
}
break;
case '|':
{
- CurToken.eType = TOR;
- CurToken.cMathChar = MS_OR;
- CurToken.nGroup = TGSUM;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "|" );
+ m_aCurToken.eType = TOR;
+ m_aCurToken.cMathChar = MS_OR;
+ m_aCurToken.nGroup = TGSUM;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "|" );
}
break;
case '}':
{
- CurToken.eType = TRGROUP;
- CurToken.cMathChar = MS_RBRACE;
- CurToken.nGroup = 0;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "}" );
+ m_aCurToken.eType = TRGROUP;
+ m_aCurToken.cMathChar = MS_RBRACE;
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "}" );
}
break;
case '~':
{
- CurToken.eType = TBLANK;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = TGBLANK;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "~" );
+ m_aCurToken.eType = TBLANK;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = TGBLANK;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "~" );
}
break;
case '#':
{
- if (BufferString.Copy( nRealStart, 2 ).
+ if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( "##" ))
{
- CurToken.eType = TDPOUND;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "##" );
+ m_aCurToken.eType = TDPOUND;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "##" );
rnEndPos = nRealStart + 2;
}
else
{
- CurToken.eType = TPOUND;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "#" );
+ m_aCurToken.eType = TPOUND;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "#" );
}
}
break;
case '&':
{
- CurToken.eType = TAND;
- CurToken.cMathChar = MS_AND;
- CurToken.nGroup = TGPRODUCT;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "&" );
+ m_aCurToken.eType = TAND;
+ m_aCurToken.cMathChar = MS_AND;
+ m_aCurToken.nGroup = TGPRODUCT;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "&" );
}
break;
case '(':
{
- CurToken.eType = TLPARENT;
- CurToken.cMathChar = MS_LPARENT;
- CurToken.nGroup = TGLBRACES;
- CurToken.nLevel = 5; //! 0 to continue expression
- CurToken.aText.AssignAscii( "(" );
+ m_aCurToken.eType = TLPARENT;
+ m_aCurToken.cMathChar = MS_LPARENT;
+ m_aCurToken.nGroup = TGLBRACES;
+ m_aCurToken.nLevel = 5; //! 0 to continue expression
+ m_aCurToken.aText.AssignAscii( "(" );
}
break;
case ')':
{
- CurToken.eType = TRPARENT;
- CurToken.cMathChar = MS_RPARENT;
- CurToken.nGroup = TGRBRACES;
- CurToken.nLevel = 0; //! 0 to terminate expression
- CurToken.aText.AssignAscii( ")" );
+ m_aCurToken.eType = TRPARENT;
+ m_aCurToken.cMathChar = MS_RPARENT;
+ m_aCurToken.nGroup = TGRBRACES;
+ m_aCurToken.nLevel = 0; //! 0 to terminate expression
+ m_aCurToken.aText.AssignAscii( ")" );
}
break;
case '*':
{
- CurToken.eType = TMULTIPLY;
- CurToken.cMathChar = MS_MULTIPLY;
- CurToken.nGroup = TGPRODUCT;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "*" );
+ m_aCurToken.eType = TMULTIPLY;
+ m_aCurToken.cMathChar = MS_MULTIPLY;
+ m_aCurToken.nGroup = TGPRODUCT;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "*" );
}
break;
case '+':
{
- if (BufferString.Copy( nRealStart, 2 ).
+ if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( "+-" ))
{
- CurToken.eType = TPLUSMINUS;
- CurToken.cMathChar = MS_PLUSMINUS;
- CurToken.nGroup = TGUNOPER | TGSUM;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "+-" );
+ m_aCurToken.eType = TPLUSMINUS;
+ m_aCurToken.cMathChar = MS_PLUSMINUS;
+ m_aCurToken.nGroup = TGUNOPER | TGSUM;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "+-" );
rnEndPos = nRealStart + 2;
}
else
{
- CurToken.eType = TPLUS;
- CurToken.cMathChar = MS_PLUS;
- CurToken.nGroup = TGUNOPER | TGSUM;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "+" );
+ m_aCurToken.eType = TPLUS;
+ m_aCurToken.cMathChar = MS_PLUS;
+ m_aCurToken.nGroup = TGUNOPER | TGSUM;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "+" );
}
}
break;
case '-':
{
- if (BufferString.Copy( nRealStart, 2 ).
+ if (m_aBufferString.Copy( nRealStart, 2 ).
EqualsAscii( "-+" ))
{
- CurToken.eType = TMINUSPLUS;
- CurToken.cMathChar = MS_MINUSPLUS;
- CurToken.nGroup = TGUNOPER | TGSUM;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "-+" );
+ m_aCurToken.eType = TMINUSPLUS;
+ m_aCurToken.cMathChar = MS_MINUSPLUS;
+ m_aCurToken.nGroup = TGUNOPER | TGSUM;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "-+" );
rnEndPos = nRealStart + 2;
}
else
{
- CurToken.eType = TMINUS;
- CurToken.cMathChar = MS_MINUS;
- CurToken.nGroup = TGUNOPER | TGSUM;
- CurToken.nLevel = 5;
- CurToken.aText.AssignAscii( "-" );
+ m_aCurToken.eType = TMINUS;
+ m_aCurToken.cMathChar = MS_MINUS;
+ m_aCurToken.nGroup = TGUNOPER | TGSUM;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText.AssignAscii( "-" );
}
}
break;
@@ -954,40 +954,40 @@ void SmParser::NextToken()
// for compatibility with SO5.2
// texts like .34 ...56 ... h ...78..90
// will be treated as numbers
- CurToken.eType = TNUMBER;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
+ m_aCurToken.eType = TNUMBER;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
- xub_StrLen nTxtStart = BufferIndex;
+ xub_StrLen nTxtStart = m_nBufferIndex;
sal_Unicode cChar;
do
{
- cChar = BufferString.GetChar( ++BufferIndex );
+ cChar = m_aBufferString.GetChar( ++m_nBufferIndex );
}
while ( cChar == '.' || IsDigit( cChar ) );
- CurToken.aText = BufferString.Copy( sal::static_int_cast< xub_StrLen >(nTxtStart),
- sal::static_int_cast< xub_StrLen >(BufferIndex - nTxtStart) );
- aRes.EndPos = BufferIndex;
+ m_aCurToken.aText = m_aBufferString.Copy( sal::static_int_cast< xub_StrLen >(nTxtStart),
+ sal::static_int_cast< xub_StrLen >(m_nBufferIndex - nTxtStart) );
+ aRes.EndPos = m_nBufferIndex;
}
break;
case '/':
{
- CurToken.eType = TDIVIDEBY;
- CurToken.cMathChar = MS_SLASH;
- CurToken.nGroup = TGPRODUCT;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "/" );
+ m_aCurToken.eType = TDIVIDEBY;
+ m_aCurToken.cMathChar = MS_SLASH;
+ m_aCurToken.nGroup = TGPRODUCT;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "/" );
}
break;
case '=':
{
- CurToken.eType = TASSIGN;
- CurToken.cMathChar = MS_ASSIGN;
- CurToken.nGroup = TGRELATION;
- CurToken.nLevel = 0;
- CurToken.aText.AssignAscii( "=" );
+ m_aCurToken.eType = TASSIGN;
+ m_aCurToken.cMathChar = MS_ASSIGN;
+ m_aCurToken.nGroup = TGRELATION;
+ m_aCurToken.nLevel = 0;
+ m_aCurToken.aText.AssignAscii( "=" );
}
break;
default:
@@ -1000,17 +1000,17 @@ void SmParser::NextToken()
if (!bHandled)
{
- CurToken.eType = TCHARACTER;
- CurToken.cMathChar = '\0';
- CurToken.nGroup = 0;
- CurToken.nLevel = 5;
- CurToken.aText = BufferString.Copy( nRealStart, 1 );
+ m_aCurToken.eType = TCHARACTER;
+ m_aCurToken.cMathChar = '\0';
+ m_aCurToken.nGroup = 0;
+ m_aCurToken.nLevel = 5;
+ m_aCurToken.aText = m_aBufferString.Copy( nRealStart, 1 );
aRes.EndPos = nRealStart + 1;
}
- if (TEND != CurToken.eType)
- BufferIndex = sal::static_int_cast< xub_StrLen >(aRes.EndPos);
+ if (TEND != m_aCurToken.eType)
+ m_nBufferIndex = sal::static_int_cast< xub_StrLen >(aRes.EndPos);
}
@@ -1024,25 +1024,25 @@ void SmParser::Table()
SmNodeArray LineArray;
Line();
- while (CurToken.eType == TNEWLINE)
+ while (m_aCurToken.eType == TNEWLINE)
{
NextToken();
Line();
}
- if (CurToken.eType != TEND)
+ if (m_aCurToken.eType != TEND)
Error(PE_UNEXPECTED_CHAR);
- ULONG n = NodeStack.Count();
+ ULONG n = m_aNodeStack.Count();
LineArray.resize(n);
for (ULONG i = 0; i < n; i++)
- LineArray[n - (i + 1)] = NodeStack.Pop();
+ LineArray[n - (i + 1)] = m_aNodeStack.Pop();
- SmStructureNode *pSNode = new SmTableNode(CurToken);
+ SmStructureNode *pSNode = new SmTableNode(m_aCurToken);
pSNode->SetSubNodes(LineArray);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
@@ -1064,19 +1064,21 @@ void SmParser::Align()
// (the dominant one in 4.0) and erase all others (especially old
// discarded tokens) from command string.
while (TokenInGroup(TGALIGN))
- { if (TokenInGroup(TGDISCARDED) || pSNode)
- { BufferIndex = GetTokenIndex();
- BufferString.Erase(BufferIndex, CurToken.aText.Len());
+ {
+ if (TokenInGroup(TGDISCARDED) || pSNode)
+ {
+ m_nBufferIndex = GetTokenIndex();
+ m_aBufferString.Erase(m_nBufferIndex, m_aCurToken.aText.Len());
}
else
- pSNode = new SmAlignNode(CurToken);
+ pSNode = new SmAlignNode(m_aCurToken);
NextToken();
}
}
else
{
- pSNode = new SmAlignNode(CurToken);
+ pSNode = new SmAlignNode(m_aCurToken);
NextToken();
@@ -1094,8 +1096,8 @@ void SmParser::Align()
Insert('}', GetTokenIndex());
if (pSNode)
- { pSNode->SetSubNodes(NodeStack.Pop(), 0);
- NodeStack.Push(pSNode);
+ { pSNode->SetSubNodes(m_aNodeStack.Pop(), 0);
+ m_aNodeStack.Push(pSNode);
}
}
@@ -1110,37 +1112,37 @@ void SmParser::Line()
// start with single expression that may have an alignment statement
// (and go on with expressions that must not have alignment
// statements in 'while' loop below. See also 'Expression()'.)
- if (CurToken.eType != TEND && CurToken.eType != TNEWLINE)
+ if (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE)
{ Align();
ExpressionArray.resize(++n);
- ExpressionArray[n - 1] = NodeStack.Pop();
+ ExpressionArray[n - 1] = m_aNodeStack.Pop();
}
- while (CurToken.eType != TEND && CurToken.eType != TNEWLINE)
+ while (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE)
{ if (CONVERT_40_TO_50 != GetConversion())
Expression();
else
Align();
ExpressionArray.resize(++n);
- ExpressionArray[n - 1] = NodeStack.Pop();
+ ExpressionArray[n - 1] = m_aNodeStack.Pop();
}
- SmStructureNode *pSNode = new SmLineNode(CurToken);
+ SmStructureNode *pSNode = new SmLineNode(m_aCurToken);
pSNode->SetSubNodes(ExpressionArray);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
void SmParser::Expression()
{
BOOL bUseExtraSpaces = TRUE;
- SmNode *pNode = NodeStack.Pop();
+ SmNode *pNode = m_aNodeStack.Pop();
if (pNode)
{
if (pNode->GetToken().eType == TNOSPACE)
bUseExtraSpaces = FALSE;
else
- NodeStack.Push(pNode); // push the node from above again (now to be used as argument to this current 'nospace' node)
+ m_aNodeStack.Push(pNode); // push the node from above again (now to be used as argument to this current 'nospace' node)
}
USHORT n = 0;
@@ -1150,18 +1152,18 @@ void SmParser::Expression()
Relation();
RelationArray.resize(++n);
- RelationArray[n - 1] = NodeStack.Pop();
+ RelationArray[n - 1] = m_aNodeStack.Pop();
- while (CurToken.nLevel >= 4)
+ while (m_aCurToken.nLevel >= 4)
{ Relation();
RelationArray.resize(++n);
- RelationArray[n - 1] = NodeStack.Pop();
+ RelationArray[n - 1] = m_aNodeStack.Pop();
}
- SmExpressionNode *pSNode = new SmExpressionNode(CurToken);
+ SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken);
pSNode->SetSubNodes(RelationArray);
pSNode->SetUseExtraSpaces(bUseExtraSpaces);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
@@ -1170,16 +1172,16 @@ void SmParser::Relation()
Sum();
while (TokenInGroup(TGRELATION))
{
- SmStructureNode *pSNode = new SmBinHorNode(CurToken);
- SmNode *pFirst = NodeStack.Pop();
+ SmStructureNode *pSNode = new SmBinHorNode(m_aCurToken);
+ SmNode *pFirst = m_aNodeStack.Pop();
OpSubSup();
- SmNode *pSecond = NodeStack.Pop();
+ SmNode *pSecond = m_aNodeStack.Pop();
Sum();
- pSNode->SetSubNodes(pFirst, pSecond, NodeStack.Pop());
- NodeStack.Push(pSNode);
+ pSNode->SetSubNodes(pFirst, pSecond, m_aNodeStack.Pop());
+ m_aNodeStack.Push(pSNode);
}
}
@@ -1189,16 +1191,16 @@ void SmParser::Sum()
Product();
while (TokenInGroup(TGSUM))
{
- SmStructureNode *pSNode = new SmBinHorNode(CurToken);
- SmNode *pFirst = NodeStack.Pop();
+ SmStructureNode *pSNode = new SmBinHorNode(m_aCurToken);
+ SmNode *pFirst = m_aNodeStack.Pop();
OpSubSup();
- SmNode *pSecond = NodeStack.Pop();
+ SmNode *pSecond = m_aNodeStack.Pop();
Product();
- pSNode->SetSubNodes(pFirst, pSecond, NodeStack.Pop());
- NodeStack.Push(pSNode);
+ pSNode->SetSubNodes(pFirst, pSecond, m_aNodeStack.Pop());
+ m_aNodeStack.Push(pSNode);
}
}
@@ -1209,32 +1211,32 @@ void SmParser::Product()
while (TokenInGroup(TGPRODUCT))
{ SmStructureNode *pSNode;
- SmNode *pFirst = NodeStack.Pop(),
+ SmNode *pFirst = m_aNodeStack.Pop(),
*pOper;
BOOL bSwitchArgs = FALSE;
- SmTokenType eType = CurToken.eType;
+ SmTokenType eType = m_aCurToken.eType;
switch (eType)
{
case TOVER:
- pSNode = new SmBinVerNode(CurToken);
- pOper = new SmRectangleNode(CurToken);
+ pSNode = new SmBinVerNode(m_aCurToken);
+ pOper = new SmRectangleNode(m_aCurToken);
NextToken();
break;
case TBOPER:
- pSNode = new SmBinHorNode(CurToken);
+ pSNode = new SmBinHorNode(m_aCurToken);
NextToken();
GlyphSpecial();
- pOper = NodeStack.Pop();
+ pOper = m_aNodeStack.Pop();
break;
case TOVERBRACE :
case TUNDERBRACE :
- pSNode = new SmVerticalBraceNode(CurToken);
- pOper = new SmMathSymbolNode(CurToken);
+ pSNode = new SmVerticalBraceNode(m_aCurToken);
+ pOper = new SmMathSymbolNode(m_aCurToken);
NextToken();
break;
@@ -1242,11 +1244,11 @@ void SmParser::Product()
case TWIDEBACKSLASH:
case TWIDESLASH:
{
- SmBinDiagonalNode *pSTmp = new SmBinDiagonalNode(CurToken);
+ SmBinDiagonalNode *pSTmp = new SmBinDiagonalNode(m_aCurToken);
pSTmp->SetAscending(eType == TWIDESLASH);
pSNode = pSTmp;
- pOper = new SmPolyLineNode(CurToken);
+ pOper = new SmPolyLineNode(m_aCurToken);
NextToken();
bSwitchArgs =TRUE;
@@ -1254,20 +1256,20 @@ void SmParser::Product()
}
default:
- pSNode = new SmBinHorNode(CurToken);
+ pSNode = new SmBinHorNode(m_aCurToken);
OpSubSup();
- pOper = NodeStack.Pop();
+ pOper = m_aNodeStack.Pop();
}
Power();
if (bSwitchArgs)
//! vgl siehe SmBinDiagonalNode::Arrange
- pSNode->SetSubNodes(pFirst, NodeStack.Pop(), pOper);
+ pSNode->SetSubNodes(pFirst, m_aNodeStack.Pop(), pOper);
else
- pSNode->SetSubNodes(pFirst, pOper, NodeStack.Pop());
- NodeStack.Push(pSNode);
+ pSNode->SetSubNodes(pFirst, pOper, m_aNodeStack.Pop());
+ m_aNodeStack.Push(pSNode);
}
}
@@ -1281,8 +1283,8 @@ void SmParser::SubSup(ULONG nActiveGroup)
// already finish
return;
- SmSubSupNode *pNode = new SmSubSupNode(CurToken);
- //! Of course 'CurToken' is just the first sub-/supscript token.
+ SmSubSupNode *pNode = new SmSubSupNode(m_aCurToken);
+ //! Of course 'm_aCurToken' is just the first sub-/supscript token.
//! It should be of no further interest. The positions of the
//! sub-/supscripts will be identified by the corresponding subnodes
//! index in the 'aSubNodes' array (enum value from 'SmSubSup').
@@ -1292,14 +1294,14 @@ void SmParser::SubSup(ULONG nActiveGroup)
// initialize subnodes array
SmNodeArray aSubNodes;
aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- aSubNodes[0] = NodeStack.Pop();
+ aSubNodes[0] = m_aNodeStack.Pop();
for (USHORT i = 1; i < aSubNodes.size(); i++)
aSubNodes[i] = NULL;
// process all sub-/supscripts
int nIndex = 0;
while (TokenInGroup(nActiveGroup))
- { SmTokenType eType (CurToken.eType);
+ { SmTokenType eType (m_aCurToken.eType);
// skip sub-/supscript token
NextToken();
@@ -1332,18 +1334,18 @@ void SmParser::SubSup(ULONG nActiveGroup)
// set sub-/supscript if not already done
if (aSubNodes[nIndex] != NULL)
Error(PE_DOUBLE_SUBSUPSCRIPT);
- aSubNodes[nIndex] = NodeStack.Pop();
+ aSubNodes[nIndex] = m_aNodeStack.Pop();
}
pNode->SetSubNodes(aSubNodes);
- NodeStack.Push(pNode);
+ m_aNodeStack.Push(pNode);
}
void SmParser::OpSubSup()
{
// push operator symbol
- NodeStack.Push(new SmMathSymbolNode(CurToken));
+ m_aNodeStack.Push(new SmMathSymbolNode(m_aCurToken));
// skip operator token
NextToken();
// get sub- supscripts if any
@@ -1364,28 +1366,28 @@ void SmParser::Power()
void SmParser::Blank()
{
DBG_ASSERT(TokenInGroup(TGBLANK), "Sm : falsches Token");
- SmBlankNode *pBlankNode = new SmBlankNode(CurToken);
+ SmBlankNode *pBlankNode = new SmBlankNode(m_aCurToken);
while (TokenInGroup(TGBLANK))
{
- pBlankNode->IncreaseBy(CurToken);
+ pBlankNode->IncreaseBy(m_aCurToken);
NextToken();
}
// Blanks am Zeilenende ignorieren wenn die entsprechende Option gesetzt ist
- if ( CurToken.eType == TNEWLINE ||
- (CurToken.eType == TEND && SM_MOD()->GetConfig()->IsIgnoreSpacesRight()) )
+ if ( m_aCurToken.eType == TNEWLINE ||
+ (m_aCurToken.eType == TEND && SM_MOD()->GetConfig()->IsIgnoreSpacesRight()) )
{
pBlankNode->Clear();
}
- NodeStack.Push(pBlankNode);
+ m_aNodeStack.Push(pBlankNode);
}
void SmParser::Term()
{
- switch (CurToken.eType)
+ switch (m_aCurToken.eType)
{
case TESCAPE :
Escape();
@@ -1394,15 +1396,15 @@ void SmParser::Term()
case TNOSPACE :
case TLGROUP :
{
- bool bNoSpace = CurToken.eType == TNOSPACE;
+ bool bNoSpace = m_aCurToken.eType == TNOSPACE;
if (bNoSpace) // push 'no space' node and continue to parse expression
{
- NodeStack.Push(new SmExpressionNode(CurToken));
+ m_aNodeStack.Push(new SmExpressionNode(m_aCurToken));
NextToken();
}
- if (CurToken.eType != TLGROUP)
+ if (m_aCurToken.eType != TLGROUP)
{
- NodeStack.Pop(); // get rid of the 'no space' node pushed above
+ m_aNodeStack.Pop(); // get rid of the 'no space' node pushed above
Term();
}
else
@@ -1410,20 +1412,20 @@ void SmParser::Term()
NextToken();
// allow for empty group
- if (CurToken.eType == TRGROUP)
+ if (m_aCurToken.eType == TRGROUP)
{
if (bNoSpace) // get rid of the 'no space' node pushed above
- NodeStack.Pop();
- SmStructureNode *pSNode = new SmExpressionNode(CurToken);
+ m_aNodeStack.Pop();
+ SmStructureNode *pSNode = new SmExpressionNode(m_aCurToken);
pSNode->SetSubNodes(NULL, NULL);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
NextToken();
}
else // go as usual
{
Align();
- if (CurToken.eType != TRGROUP)
+ if (m_aCurToken.eType != TRGROUP)
Error(PE_RGROUP_EXPECTED);
else
NextToken();
@@ -1442,16 +1444,16 @@ void SmParser::Term()
break;
case TTEXT :
- NodeStack.Push(new SmTextNode(CurToken, FNT_TEXT));
+ m_aNodeStack.Push(new SmTextNode(m_aCurToken, FNT_TEXT));
NextToken();
break;
case TIDENT :
case TCHARACTER :
- NodeStack.Push(new SmTextNode(CurToken, FNT_VARIABLE));
+ m_aNodeStack.Push(new SmTextNode(m_aCurToken, FNT_VARIABLE));
NextToken();
break;
case TNUMBER :
- NodeStack.Push(new SmTextNode(CurToken, FNT_NUMBER));
+ m_aNodeStack.Push(new SmTextNode(m_aCurToken, FNT_NUMBER));
NextToken();
break;
@@ -1488,12 +1490,12 @@ void SmParser::Term()
case TDOTSLOW :
case TDOTSUP :
case TDOTSVERT :
- NodeStack.Push(new SmMathSymbolNode(CurToken));
+ m_aNodeStack.Push(new SmMathSymbolNode(m_aCurToken));
NextToken();
break;
case TPLACE:
- NodeStack.Push(new SmPlaceNode(CurToken));
+ m_aNodeStack.Push(new SmPlaceNode(m_aCurToken));
NextToken();
break;
@@ -1539,21 +1541,21 @@ void SmParser::Term()
FontAttribut();
// check if casting in following line is ok
- DBG_ASSERT(!NodeStack.Top()->IsVisible(), "Sm : Ooops...");
+ DBG_ASSERT(!m_aNodeStack.Top()->IsVisible(), "Sm : Ooops...");
- aArray[n] = (SmStructureNode *) NodeStack.Pop();
+ aArray[n] = (SmStructureNode *) m_aNodeStack.Pop();
n++;
}
Power();
- SmNode *pFirstNode = NodeStack.Pop();
+ SmNode *pFirstNode = m_aNodeStack.Pop();
while (n > 0)
{ aArray[n - 1]->SetSubNodes(0, pFirstNode);
pFirstNode = aArray[n - 1];
n--;
}
- NodeStack.Push(pFirstNode);
+ m_aNodeStack.Push(pFirstNode);
}
else if (TokenInGroup(TGFUNCTION))
{ if (CONVERT_40_TO_50 != GetConversion())
@@ -1569,9 +1571,9 @@ void SmParser::Term()
//
Function();
- SmNode *pFunc = NodeStack.Pop();
+ SmNode *pFunc = m_aNodeStack.Pop();
- if (CurToken.eType == TLPARENT)
+ if (m_aCurToken.eType == TLPARENT)
{ Term();
}
else
@@ -1582,8 +1584,8 @@ void SmParser::Term()
Insert('}', GetTokenIndex());
SmStructureNode *pSNode = new SmExpressionNode(pFunc->GetToken());
- pSNode->SetSubNodes(pFunc, NodeStack.Pop());
- NodeStack.Push(pSNode);
+ pSNode->SetSubNodes(pFunc, m_aNodeStack.Pop());
+ m_aNodeStack.Push(pSNode);
}
}
else
@@ -1597,7 +1599,7 @@ void SmParser::Escape()
NextToken();
sal_Unicode cChar;
- switch (CurToken.eType)
+ switch (m_aCurToken.eType)
{ case TLPARENT : cChar = MS_LPARENT; break;
case TRPARENT : cChar = MS_RPARENT; break;
case TLBRACKET : cChar = MS_LBRACKET; break;
@@ -1622,8 +1624,8 @@ void SmParser::Escape()
Error(PE_UNEXPECTED_TOKEN);
}
- SmNode *pNode = new SmMathSymbolNode(CurToken);
- NodeStack.Push(pNode);
+ SmNode *pNode = new SmMathSymbolNode(m_aCurToken);
+ m_aNodeStack.Push(pNode);
NextToken();
}
@@ -1632,27 +1634,27 @@ void SmParser::Escape()
void SmParser::Operator()
{
if (TokenInGroup(TGOPER))
- { SmStructureNode *pSNode = new SmOperNode(CurToken);
+ { SmStructureNode *pSNode = new SmOperNode(m_aCurToken);
// put operator on top of stack
Oper();
if (TokenInGroup(TGLIMIT) || TokenInGroup(TGPOWER))
- SubSup(CurToken.nGroup);
- SmNode *pOperator = NodeStack.Pop();
+ SubSup(m_aCurToken.nGroup);
+ SmNode *pOperator = m_aNodeStack.Pop();
// get argument
Power();
- pSNode->SetSubNodes(pOperator, NodeStack.Pop());
- NodeStack.Push(pSNode);
+ pSNode->SetSubNodes(pOperator, m_aNodeStack.Pop());
+ m_aNodeStack.Push(pSNode);
}
}
void SmParser::Oper()
{
- SmTokenType eType (CurToken.eType);
+ SmTokenType eType (m_aCurToken.eType);
SmNode *pNode = NULL;
switch (eType)
@@ -1666,7 +1668,7 @@ void SmParser::Oper()
case TLINT :
case TLLINT :
case TLLLINT :
- pNode = new SmMathSymbolNode(CurToken);
+ pNode = new SmMathSymbolNode(m_aCurToken);
break;
case TLIM :
@@ -1683,27 +1685,27 @@ void SmParser::Oper()
break;
}
if( pLim )
- CurToken.aText.AssignAscii( pLim );
- pNode = new SmTextNode(CurToken, FNT_TEXT);
+ m_aCurToken.aText.AssignAscii( pLim );
+ pNode = new SmTextNode(m_aCurToken, FNT_TEXT);
}
break;
case TOVERBRACE :
case TUNDERBRACE :
- pNode = new SmMathSymbolNode(CurToken);
+ pNode = new SmMathSymbolNode(m_aCurToken);
break;
case TOPER :
NextToken();
- DBG_ASSERT(CurToken.eType == TSPECIAL, "Sm: falsches Token");
- pNode = new SmGlyphSpecialNode(CurToken);
+ DBG_ASSERT(m_aCurToken.eType == TSPECIAL, "Sm: falsches Token");
+ pNode = new SmGlyphSpecialNode(m_aCurToken);
break;
default :
DBG_ASSERT(0, "Sm: unbekannter Fall");
}
- NodeStack.Push(pNode);
+ m_aNodeStack.Push(pNode);
NextToken();
}
@@ -1713,8 +1715,8 @@ void SmParser::UnOper()
{
DBG_ASSERT(TokenInGroup(TGUNOPER), "Sm: falsches Token");
- SmToken aNodeToken = CurToken;
- SmTokenType eType = CurToken.eType;
+ SmToken aNodeToken = m_aCurToken;
+ SmTokenType eType = m_aCurToken.eType;
BOOL bIsPostfix = eType == TFACT;
SmStructureNode *pSNode;
@@ -1732,13 +1734,13 @@ void SmParser::UnOper()
case TNROOT :
NextToken();
Power();
- pExtra = NodeStack.Pop();
+ pExtra = m_aNodeStack.Pop();
break;
case TUOPER :
NextToken();
GlyphSpecial();
- pOper = NodeStack.Pop();
+ pOper = m_aNodeStack.Pop();
break;
case TPLUS :
@@ -1748,7 +1750,7 @@ void SmParser::UnOper()
case TNEG :
case TFACT :
OpSubSup();
- pOper = NodeStack.Pop();
+ pOper = m_aNodeStack.Pop();
break;
default :
@@ -1757,7 +1759,7 @@ void SmParser::UnOper()
// get argument
Power();
- pArg = NodeStack.Pop();
+ pArg = m_aNodeStack.Pop();
if (eType == TABS)
{ pSNode = new SmBraceNode(aNodeToken);
@@ -1791,7 +1793,7 @@ void SmParser::UnOper()
pSNode->SetSubNodes(pOper, pArg);
}
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
@@ -1799,35 +1801,35 @@ void SmParser::Attribut()
{
DBG_ASSERT(TokenInGroup(TGATTRIBUT), "Sm: falsche Tokengruppe");
- SmStructureNode *pSNode = new SmAttributNode(CurToken);
+ SmStructureNode *pSNode = new SmAttributNode(m_aCurToken);
SmNode *pAttr;
SmScaleMode eScaleMode = SCALE_NONE;
// get appropriate node for the attribut itself
- switch (CurToken.eType)
+ switch (m_aCurToken.eType)
{ case TUNDERLINE :
case TOVERLINE :
case TOVERSTRIKE :
- pAttr = new SmRectangleNode(CurToken);
+ pAttr = new SmRectangleNode(m_aCurToken);
eScaleMode = SCALE_WIDTH;
break;
case TWIDEVEC :
case TWIDEHAT :
case TWIDETILDE :
- pAttr = new SmMathSymbolNode(CurToken);
+ pAttr = new SmMathSymbolNode(m_aCurToken);
eScaleMode = SCALE_WIDTH;
break;
default :
- pAttr = new SmMathSymbolNode(CurToken);
+ pAttr = new SmMathSymbolNode(m_aCurToken);
}
NextToken();
pSNode->SetSubNodes(pAttr, 0);
pSNode->SetScaleMode(eScaleMode);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
@@ -1835,14 +1837,14 @@ void SmParser::FontAttribut()
{
DBG_ASSERT(TokenInGroup(TGFONTATTR), "Sm: falsche Tokengruppe");
- switch (CurToken.eType)
+ switch (m_aCurToken.eType)
{
case TITALIC :
case TNITALIC :
case TBOLD :
case TNBOLD :
case TPHANTOM :
- NodeStack.Push(new SmFontNode(CurToken));
+ m_aNodeStack.Push(new SmFontNode(m_aCurToken));
NextToken();
break;
@@ -1866,7 +1868,7 @@ void SmParser::FontAttribut()
void SmParser::Color()
{
- DBG_ASSERT(CurToken.eType == TCOLOR, "Sm : Ooops...");
+ DBG_ASSERT(m_aCurToken.eType == TCOLOR, "Sm : Ooops...");
// last color rules, get that one
SmToken aToken;
@@ -1874,20 +1876,20 @@ void SmParser::Color()
{ NextToken();
if (TokenInGroup(TGCOLOR))
- { aToken = CurToken;
+ { aToken = m_aCurToken;
NextToken();
}
else
Error(PE_COLOR_EXPECTED);
- } while (CurToken.eType == TCOLOR);
+ } while (m_aCurToken.eType == TCOLOR);
- NodeStack.Push(new SmFontNode(aToken));
+ m_aNodeStack.Push(new SmFontNode(aToken));
}
void SmParser::Font()
{
- DBG_ASSERT(CurToken.eType == TFONT, "Sm : Ooops...");
+ DBG_ASSERT(m_aCurToken.eType == TFONT, "Sm : Ooops...");
// last font rules, get that one
SmToken aToken;
@@ -1895,14 +1897,14 @@ void SmParser::Font()
{ NextToken();
if (TokenInGroup(TGFONT))
- { aToken = CurToken;
+ { aToken = m_aCurToken;
NextToken();
}
else
Error(PE_FONT_EXPECTED);
- } while (CurToken.eType == TFONT);
+ } while (m_aCurToken.eType == TFONT);
- NodeStack.Push(new SmFontNode(aToken));
+ m_aNodeStack.Push(new SmFontNode(aToken));
}
@@ -1930,14 +1932,14 @@ BOOL lcl_IsNumber(const UniString& rText)
void SmParser::FontSize()
{
- DBG_ASSERT(CurToken.eType == TSIZE, "Sm : Ooops...");
+ DBG_ASSERT(m_aCurToken.eType == TSIZE, "Sm : Ooops...");
USHORT Type;
- SmFontNode *pFontNode = new SmFontNode(CurToken);
+ SmFontNode *pFontNode = new SmFontNode(m_aCurToken);
NextToken();
- switch (CurToken.eType)
+ switch (m_aCurToken.eType)
{
case TNUMBER: Type = FNTSIZ_ABSOLUT; break;
case TPLUS: Type = FNTSIZ_PLUS; break;
@@ -1954,7 +1956,7 @@ void SmParser::FontSize()
if (Type != FNTSIZ_ABSOLUT)
{
NextToken();
- if (CurToken.eType != TNUMBER)
+ if (m_aCurToken.eType != TNUMBER)
{
delete pFontNode;
Error(PE_SIZE_EXPECTED);
@@ -1964,10 +1966,10 @@ void SmParser::FontSize()
// get number argument
Fraction aValue( 1L );
- if (lcl_IsNumber( CurToken.aText ))
+ if (lcl_IsNumber( m_aCurToken.aText ))
{
double fTmp;
- if ((fTmp = CurToken.aText.ToDouble()) != 0.0)
+ if ((fTmp = m_aCurToken.aText.ToDouble()) != 0.0)
{
aValue = fTmp;
@@ -1993,23 +1995,23 @@ void SmParser::FontSize()
NextToken();
pFontNode->SetSizeParameter(aValue, Type);
- NodeStack.Push(pFontNode);
+ m_aNodeStack.Push(pFontNode);
}
void SmParser::Brace()
{
- DBG_ASSERT(CurToken.eType == TLEFT || TokenInGroup(TGLBRACES),
+ DBG_ASSERT(m_aCurToken.eType == TLEFT || TokenInGroup(TGLBRACES),
"Sm: kein Klammer Ausdruck");
- SmStructureNode *pSNode = new SmBraceNode(CurToken);
+ SmStructureNode *pSNode = new SmBraceNode(m_aCurToken);
SmNode *pBody = 0,
*pLeft = 0,
*pRight = 0;
SmScaleMode eScaleMode = SCALE_NONE;
SmParseError eError = PE_NONE;
- if (CurToken.eType == TLEFT)
+ if (m_aCurToken.eType == TLEFT)
{ NextToken();
eScaleMode = SCALE_HEIGHT;
@@ -2017,19 +2019,19 @@ void SmParser::Brace()
// check for left bracket
if (TokenInGroup(TGLBRACES) || TokenInGroup(TGRBRACES))
{
- pLeft = new SmMathSymbolNode(CurToken);
+ pLeft = new SmMathSymbolNode(m_aCurToken);
NextToken();
Bracebody(TRUE);
- pBody = NodeStack.Pop();
+ pBody = m_aNodeStack.Pop();
- if (CurToken.eType == TRIGHT)
+ if (m_aCurToken.eType == TRIGHT)
{ NextToken();
// check for right bracket
if (TokenInGroup(TGLBRACES) || TokenInGroup(TGRBRACES))
{
- pRight = new SmMathSymbolNode(CurToken);
+ pRight = new SmMathSymbolNode(m_aCurToken);
NextToken();
}
else
@@ -2045,11 +2047,11 @@ void SmParser::Brace()
{
if (TokenInGroup(TGLBRACES))
{
- pLeft = new SmMathSymbolNode(CurToken);
+ pLeft = new SmMathSymbolNode(m_aCurToken);
NextToken();
Bracebody(FALSE);
- pBody = NodeStack.Pop();
+ pBody = m_aNodeStack.Pop();
SmTokenType eExpectedType = TUNKNOWN;
switch (pLeft->GetToken().eType)
@@ -2066,9 +2068,9 @@ void SmParser::Brace()
DBG_ASSERT(0, "Sm: unbekannter Fall");
}
- if (CurToken.eType == eExpectedType)
+ if (m_aCurToken.eType == eExpectedType)
{
- pRight = new SmMathSymbolNode(CurToken);
+ pRight = new SmMathSymbolNode(m_aCurToken);
NextToken();
}
else
@@ -2083,7 +2085,7 @@ void SmParser::Brace()
DBG_ASSERT(pRight, "Sm: NULL pointer");
pSNode->SetSubNodes(pLeft, pBody, pRight);
pSNode->SetScaleMode(eScaleMode);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
else
{ delete pSNode;
@@ -2098,7 +2100,7 @@ void SmParser::Brace()
void SmParser::Bracebody(BOOL bIsLeftRight)
{
- SmStructureNode *pBody = new SmBracebodyNode(CurToken);
+ SmStructureNode *pBody = new SmBracebodyNode(m_aCurToken);
SmNodeArray aNodes;
USHORT nNum = 0;
@@ -2107,28 +2109,28 @@ void SmParser::Bracebody(BOOL bIsLeftRight)
{
do
{
- if (CurToken.eType == TMLINE)
+ if (m_aCurToken.eType == TMLINE)
{
- NodeStack.Push(new SmMathSymbolNode(CurToken));
+ m_aNodeStack.Push(new SmMathSymbolNode(m_aCurToken));
NextToken();
nNum++;
}
- else if (CurToken.eType != TRIGHT)
+ else if (m_aCurToken.eType != TRIGHT)
{ Align();
nNum++;
- if (CurToken.eType != TMLINE && CurToken.eType != TRIGHT)
+ if (m_aCurToken.eType != TMLINE && m_aCurToken.eType != TRIGHT)
Error(PE_RIGHT_EXPECTED);
}
- } while (CurToken.eType != TEND && CurToken.eType != TRIGHT);
+ } while (m_aCurToken.eType != TEND && m_aCurToken.eType != TRIGHT);
}
else
{
do
{
- if (CurToken.eType == TMLINE)
+ if (m_aCurToken.eType == TMLINE)
{
- NodeStack.Push(new SmMathSymbolNode(CurToken));
+ m_aNodeStack.Push(new SmMathSymbolNode(m_aCurToken));
NextToken();
nNum++;
}
@@ -2136,26 +2138,26 @@ void SmParser::Bracebody(BOOL bIsLeftRight)
{ Align();
nNum++;
- if (CurToken.eType != TMLINE && !TokenInGroup(TGRBRACES))
+ if (m_aCurToken.eType != TMLINE && !TokenInGroup(TGRBRACES))
Error(PE_RBRACE_EXPECTED);
}
- } while (CurToken.eType != TEND && !TokenInGroup(TGRBRACES));
+ } while (m_aCurToken.eType != TEND && !TokenInGroup(TGRBRACES));
}
// build argument vector in parsing order
aNodes.resize(nNum);
for (USHORT i = 0; i < nNum; i++)
- aNodes[nNum - 1 - i] = NodeStack.Pop();
+ aNodes[nNum - 1 - i] = m_aNodeStack.Pop();
pBody->SetSubNodes(aNodes);
pBody->SetScaleMode(bIsLeftRight ? SCALE_HEIGHT : SCALE_NONE);
- NodeStack.Push(pBody);
+ m_aNodeStack.Push(pBody);
}
void SmParser::Function()
{
- switch (CurToken.eType)
+ switch (m_aCurToken.eType)
{
case TFUNC:
NextToken(); // skip "FUNC"-statement
@@ -2180,7 +2182,7 @@ void SmParser::Function()
case TLN :
case TLOG :
case TEXP :
- NodeStack.Push(new SmTextNode(CurToken, FNT_FUNCTION));
+ m_aNodeStack.Push(new SmTextNode(m_aCurToken, FNT_FUNCTION));
NextToken();
break;
@@ -2193,7 +2195,7 @@ void SmParser::Function()
void SmParser::Binom()
{
SmNodeArray ExpressionArray;
- SmStructureNode *pSNode = new SmTableNode(CurToken);
+ SmStructureNode *pSNode = new SmTableNode(m_aCurToken);
NextToken();
@@ -2203,10 +2205,10 @@ void SmParser::Binom()
ExpressionArray.resize(2);
for (int i = 0; i < 2; i++)
- ExpressionArray[2 - (i + 1)] = NodeStack.Pop();
+ ExpressionArray[2 - (i + 1)] = m_aNodeStack.Pop();
pSNode->SetSubNodes(ExpressionArray);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
@@ -2214,7 +2216,7 @@ void SmParser::Stack()
{
SmNodeArray ExpressionArray;
NextToken();
- if (CurToken.eType == TLGROUP)
+ if (m_aCurToken.eType == TLGROUP)
{
USHORT n = 0;
@@ -2224,21 +2226,21 @@ void SmParser::Stack()
Align();
n++;
}
- while (CurToken.eType == TPOUND);
+ while (m_aCurToken.eType == TPOUND);
ExpressionArray.resize(n);
for (USHORT i = 0; i < n; i++)
- ExpressionArray[n - (i + 1)] = NodeStack.Pop();
+ ExpressionArray[n - (i + 1)] = m_aNodeStack.Pop();
- if (CurToken.eType != TRGROUP)
+ if (m_aCurToken.eType != TRGROUP)
Error(PE_RGROUP_EXPECTED);
NextToken();
- SmStructureNode *pSNode = new SmTableNode(CurToken);
+ SmStructureNode *pSNode = new SmTableNode(m_aCurToken);
pSNode->SetSubNodes(ExpressionArray);
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
}
else
Error(PE_LGROUP_EXPECTED);
@@ -2250,7 +2252,7 @@ void SmParser::Matrix()
SmNodeArray ExpressionArray;
NextToken();
- if (CurToken.eType == TLGROUP)
+ if (m_aCurToken.eType == TLGROUP)
{
USHORT c = 0;
@@ -2260,11 +2262,11 @@ void SmParser::Matrix()
Align();
c++;
}
- while (CurToken.eType == TPOUND);
+ while (m_aCurToken.eType == TPOUND);
USHORT r = 1;
- while (CurToken.eType == TDPOUND)
+ while (m_aCurToken.eType == TDPOUND)
{
NextToken();
for (USHORT i = 0; i < c; i++)
@@ -2272,7 +2274,7 @@ void SmParser::Matrix()
Align();
if (i < (c - 1))
{
- if (CurToken.eType == TPOUND)
+ if (m_aCurToken.eType == TPOUND)
{
NextToken();
}
@@ -2289,17 +2291,17 @@ void SmParser::Matrix()
ExpressionArray.resize(nRC);
for (USHORT i = 0; i < (nRC); i++)
- ExpressionArray[(nRC) - (i + 1)] = NodeStack.Pop();
+ ExpressionArray[(nRC) - (i + 1)] = m_aNodeStack.Pop();
- if (CurToken.eType != TRGROUP)
+ if (m_aCurToken.eType != TRGROUP)
Error(PE_RGROUP_EXPECTED);
NextToken();
- SmMatrixNode *pMNode = new SmMatrixNode(CurToken);
+ SmMatrixNode *pMNode = new SmMatrixNode(m_aCurToken);
pMNode->SetSubNodes(ExpressionArray);
pMNode->SetRowCol(r, c);
- NodeStack.Push(pMNode);
+ m_aNodeStack.Push(pMNode);
}
else
Error(PE_LGROUP_EXPECTED);
@@ -2309,7 +2311,7 @@ void SmParser::Matrix()
void SmParser::Special()
{
BOOL bReplace = FALSE;
- String &rName = CurToken.aText;
+ String &rName = m_aCurToken.aText;
String aNewName;
if (CONVERT_NONE == GetConversion())
@@ -2376,28 +2378,33 @@ void SmParser::Special()
rName = aNewName;
}
- NodeStack.Push(new SmSpecialNode(CurToken));
+ // add symbol name to list of used symbols
+ const String aSymbolName( m_aCurToken.aText.Copy( 1 ) );
+ if (aSymbolName.Len() > 0 )
+ AddToUsedSymbols( aSymbolName );
+
+ m_aNodeStack.Push(new SmSpecialNode(m_aCurToken));
NextToken();
}
void SmParser::GlyphSpecial()
{
- NodeStack.Push(new SmGlyphSpecialNode(CurToken));
+ m_aNodeStack.Push(new SmGlyphSpecialNode(m_aCurToken));
NextToken();
}
void SmParser::Error(SmParseError eError)
{
- SmStructureNode *pSNode = new SmExpressionNode(CurToken);
- SmErrorNode *pErr = new SmErrorNode(eError, CurToken);
+ SmStructureNode *pSNode = new SmExpressionNode(m_aCurToken);
+ SmErrorNode *pErr = new SmErrorNode(eError, m_aCurToken);
pSNode->SetSubNodes(pErr, 0);
//! put a structure node on the stack (instead of the error node itself)
//! because sometimes such a node is expected in order to attach some
//! subnodes
- NodeStack.Push(pSNode);
+ m_aNodeStack.Push(pSNode);
AddError(eError, pSNode);
@@ -2410,34 +2417,36 @@ void SmParser::Error(SmParseError eError)
SmParser::SmParser()
{
- eConversion = CONVERT_NONE;
- bImportSymNames = bExportSymNames = FALSE;
- nLang = Application::GetSettings().GetUILanguage();
+ m_eConversion = CONVERT_NONE;
+ m_bImportSymNames = m_bExportSymNames = FALSE;
+ m_nLang = Application::GetSettings().GetUILanguage();
}
SmNode *SmParser::Parse(const String &rBuffer)
{
- BufferString = rBuffer;
- BufferString.ConvertLineEnd( LINEEND_LF );
- BufferIndex =
- nTokenIndex = 0;
- Row = 1;
- ColOff = 0;
- CurError = -1;
+ ClearUsedSymbols();
+
+ m_aBufferString = rBuffer;
+ m_aBufferString.ConvertLineEnd( LINEEND_LF );
+ m_nBufferIndex =
+ m_nTokenIndex = 0;
+ m_Row = 1;
+ m_nColOff = 0;
+ m_nCurError = -1;
- for (USHORT i = 0; i < ErrDescList.Count(); i++)
- delete ErrDescList.Remove(i);
+ for (USHORT i = 0; i < m_aErrDescList.Count(); i++)
+ delete m_aErrDescList.Remove(i);
- ErrDescList.Clear();
+ m_aErrDescList.Clear();
- NodeStack.Clear();
+ m_aNodeStack.Clear();
SetLanguage( Application::GetSettings().GetUILanguage() );
NextToken();
Table();
- return NodeStack.Pop();
+ return m_aNodeStack.Pop();
}
@@ -2471,20 +2480,20 @@ USHORT SmParser::AddError(SmParseError Type, SmNode *pNode)
}
pErrDesc->Text += SmResId(nRID);
- ErrDescList.Insert(pErrDesc);
+ m_aErrDescList.Insert(pErrDesc);
- return (USHORT) ErrDescList.GetPos(pErrDesc);
+ return (USHORT) m_aErrDescList.GetPos(pErrDesc);
}
const SmErrorDesc *SmParser::NextError()
{
- if (ErrDescList.Count())
- if (CurError > 0) return ErrDescList.Seek(--CurError);
+ if (m_aErrDescList.Count())
+ if (m_nCurError > 0) return m_aErrDescList.Seek(--m_nCurError);
else
{
- CurError = 0;
- return ErrDescList.Seek(CurError);
+ m_nCurError = 0;
+ return m_aErrDescList.Seek(m_nCurError);
}
else return 0;
}
@@ -2492,12 +2501,12 @@ const SmErrorDesc *SmParser::NextError()
const SmErrorDesc *SmParser::PrevError()
{
- if (ErrDescList.Count())
- if (CurError < (int) (ErrDescList.Count() - 1)) return ErrDescList.Seek(++CurError);
+ if (m_aErrDescList.Count())
+ if (m_nCurError < (int) (m_aErrDescList.Count() - 1)) return m_aErrDescList.Seek(++m_nCurError);
else
{
- CurError = (int) (ErrDescList.Count() - 1);
- return ErrDescList.Seek(CurError);
+ m_nCurError = (int) (m_aErrDescList.Count() - 1);
+ return m_aErrDescList.Seek(m_nCurError);
}
else return 0;
}
@@ -2505,9 +2514,9 @@ const SmErrorDesc *SmParser::PrevError()
const SmErrorDesc *SmParser::GetError(USHORT i)
{
- return (/*i >= 0 &&*/ i < ErrDescList.Count())
- ? ErrDescList.Seek(i)
- : ErrDescList.Seek(CurError);
+ return (/*i >= 0 &&*/ i < m_aErrDescList.Count())
+ ? m_aErrDescList.Seek(i)
+ : m_aErrDescList.Seek(m_nCurError);
}
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 9dcd4d05930d..4e3eebf99a65 100644..100755
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -352,6 +352,7 @@ SfxItemSet* SmModule::CreateItemSet( USHORT nId )
SID_PRINTTEXT, SID_PRINTTEXT,
SID_PRINTFRAME, SID_PRINTFRAME,
SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES,
+ SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS,
0 );
GetConfig()->ConfigToItemSet(*pRet);
diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index 601472b62f5a..41edb1790198 100755
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -1099,6 +1099,13 @@ TabPage RID_PRINTOPTIONPAGE
Size = MAP_APPFONT ( 236 , 10 ) ;
Text [ en-US ] = "Ig~nore ~~ and ` at the end of the line";
};
+ CheckBox CB_SAVE_ONLY_USED_SYMBOLS
+ {
+ TabStop = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 154 ) ;
+ Size = MAP_APPFONT ( 236 , 10 ) ;
+ Text [ en-US ] = "Embed only used symbols (smaller file size)";
+ };
};
ModalDialog RID_SYMBOLDIALOG
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 52d0520ae61b..bd3420773587 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -218,14 +218,19 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang
}
else if (pFound && !bForceChange && bSymbolConflict)
{
- // TODO: but what ...
- DBG_ASSERT( 0, "symbol conflict, different symbol with same name found!" );
+ // TODO: to solve this a document owned symbol manager would be required ...
+ // But for now we have a global one to easily support availability of all
+ // symbols in all formulas. A copy of the global one would be needed here
+ // and then the new symbol has to be forcefully applied. This would keep
+ // the current formula intact but will leave the set of symbols in the
+ // global symbol manager somewhat to chance.
+ DBG_ASSERT( 0, "symbol conflict, different symbol with same name found!" );
}
- }
- DBG_ASSERT( bAdded, "failed to add symbol" );
- if (bAdded)
- m_bModified = true;
+ if (bAdded)
+ m_bModified = true;
+ DBG_ASSERT( bAdded || (pFound && !bSymbolConflict), "AddOrReplaceSymbol: unresolved symbol conflict" );
+ }
return bAdded;
}
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 6520f9e8acf7..3aa9001f8319 100755
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -171,7 +171,11 @@ SmPrintUIOptions::SmPrintUIOptions()
//
// class SmModel
//
-#define PROPERTY_NONE 0
+
+// values from com/sun/star/beans/PropertyAttribute
+#define PROPERTY_NONE 0
+#define PROPERTY_READONLY 16
+
enum SmModelPropertyHandles
{
HANDLE_FORMULA,
@@ -233,6 +237,7 @@ enum SmModelPropertyHandles
HANDLE_PRINTER_NAME,
HANDLE_PRINTER_SETUP,
HANDLE_SYMBOLS,
+ HANDLE_USED_SYMBOLS,
HANDLE_BASIC_LIBRARIES, /* #93295# */
HANDLE_RUNTIME_UID,
// --> PB 2004-08-25 #i33095# Security Options
@@ -307,6 +312,7 @@ PropertySetInfo * lcl_createModelPropertyInfo ()
{ RTL_CONSTASCII_STRINGPARAM( "RightMargin" ), HANDLE_RIGHT_MARGIN , &::getCppuType((const sal_Int16*)0), PROPERTY_NONE, DIS_RIGHTSPACE },
{ RTL_CONSTASCII_STRINGPARAM( "RuntimeUID" ), HANDLE_RUNTIME_UID , &::getCppuType(static_cast< const rtl::OUString * >(0)), PropertyAttribute::READONLY, 0 },
{ RTL_CONSTASCII_STRINGPARAM( "Symbols" ), HANDLE_SYMBOLS , &::getCppuType((const Sequence < SymbolDescriptor > *)0), PROPERTY_NONE, 0 },
+ { RTL_CONSTASCII_STRINGPARAM( "UserDefinedSymbolsInUse" ), HANDLE_USED_SYMBOLS , &::getCppuType((const Sequence < SymbolDescriptor > *)0), PropertyAttribute::READONLY, 0 },
{ RTL_CONSTASCII_STRINGPARAM( "TopMargin" ), HANDLE_TOP_MARGIN , &::getCppuType((const sal_Int16*)0), PROPERTY_NONE, DIS_TOPSPACE },
// --> PB 2004-08-25 #i33095# Security Options
{ RTL_CONSTASCII_STRINGPARAM( "LoadReadonly" ), HANDLE_LOAD_READONLY, &::getBooleanCppuType(), PROPERTY_NONE, 0 },
@@ -904,7 +910,11 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
}
break;
case HANDLE_SYMBOLS:
+ case HANDLE_USED_SYMBOLS:
{
+ const bool bUsedSymbolsOnly = (*ppEntries)->mnHandle == HANDLE_USED_SYMBOLS;
+ const std::set< rtl::OUString > &rUsedSymbols = pDocSh->GetUsedSymbols();
+
// this is get
SmModule *pp = SM_MOD();
const SmSymbolManager &rManager = pp->GetSymbolManager();
@@ -915,7 +925,9 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
for (size_t i = 0; i < aSymbols.size(); ++i)
{
const SmSym * pSymbol = aSymbols[ i ];
- if (pSymbol && !pSymbol->IsPredefined () )
+ const bool bIsUsedSymbol = rUsedSymbols.find( pSymbol->GetName() ) != rUsedSymbols.end();
+ if (pSymbol && !pSymbol->IsPredefined() &&
+ (!bUsedSymbolsOnly || bIsUsedSymbol))
{
aVector.push_back ( pSymbol );
nCount++;
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index ad9ff8e618f0..5d2d624c285e 100755
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -34,6 +34,9 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/XFramesSupplier.hpp>
+#include <com/sun/star/container/XChild.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
@@ -652,7 +655,51 @@ void SmCmdBoxWindow::StateChanged( StateChangedType nStateChange )
IMPL_LINK( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
{
- aEdit.GrabFocus();
+ // We want to have the focus in the edit window once Math has been opened
+ // to allow for immediate typing.
+ // Problem: There is no proper way to do this
+ // Thus: this timer based soultion has been implemented (see GrabFocus below)
+ //
+ // Follow-up problem (#i114910): grabing the focus may bust the help system since
+ // it relies on getting the current frame which conflicts with grabbing the focus.
+ // Thus aside from the 'GrabFocus' call everything else is to get the
+ // help reliably working despite using 'GrabFocus'.
+
+ try
+ {
+ uno::Reference< frame::XDesktop > xDesktop;
+ uno::Reference< lang::XMultiServiceFactory > xSMGR( comphelper::getProcessServiceFactory() );
+ if (xSMGR.is())
+ {
+ xDesktop = uno::Reference< frame::XDesktop >(
+ xSMGR->createInstance( rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" )), uno::UNO_QUERY_THROW );
+ }
+
+ aEdit.GrabFocus();
+
+ if (xDesktop.is())
+ {
+ bool bInPlace = GetView()->GetViewFrame()->GetFrame().IsInPlace();
+ uno::Reference< frame::XFrame > xFrame( GetBindings().GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface());
+ if ( bInPlace )
+ {
+ uno::Reference< container::XChild > xModel( GetView()->GetDoc()->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XModel > xParent( xModel->getParent(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XController > xParentCtrler( xParent->getCurrentController() );
+ uno::Reference< frame::XFramesSupplier > xParentFrame( xParentCtrler->getFrame(), uno::UNO_QUERY_THROW );
+ xParentFrame->setActiveFrame( xFrame );
+ }
+ else
+ {
+ uno::Reference< frame::XFramesSupplier > xFramesSupplier( xDesktop, uno::UNO_QUERY );
+ xFramesSupplier->setActiveFrame( xFrame );
+ }
+ }
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ASSERT( 0, "failed to properly set initial focus to edit window" );
+ }
return 0;
}
diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx
index 5aea03207626..08d2fa6c5b84 100644
--- a/svl/inc/svl/undo.hxx
+++ b/svl/inc/svl/undo.hxx
@@ -32,6 +32,10 @@
#include <tools/string.hxx>
#include <svl/svarray.hxx>
+#include <boost/scoped_ptr.hpp>
+
+#include <vector>
+
//====================================================================
class SVL_DLLPUBLIC SfxRepeatTarget
@@ -43,6 +47,14 @@ public:
//====================================================================
+class SVL_DLLPUBLIC SfxUndoContext
+{
+public:
+ virtual ~SfxUndoContext() = 0;
+};
+
+//====================================================================
+
class SVL_DLLPUBLIC SfxUndoAction
{
BOOL bLinked;
@@ -54,14 +66,16 @@ public:
virtual BOOL IsLinked();
virtual void SetLinked( BOOL bIsLinked = TRUE );
virtual void Undo();
+ virtual void UndoWithContext( SfxUndoContext& i_context );
virtual void Redo();
+ virtual void RedoWithContext( SfxUndoContext& i_context );
virtual void Repeat(SfxRepeatTarget&);
virtual BOOL CanRepeat(SfxRepeatTarget&) const;
virtual BOOL Merge( SfxUndoAction *pNextAction );
- virtual UniString GetComment() const;
- virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
+ virtual UniString GetComment() const;
+ virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
virtual USHORT GetId() const;
private:
@@ -70,19 +84,67 @@ private:
//========================================================================
-SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 )
+/// is a mark on the Undo stack
+typedef sal_Int32 UndoStackMark;
+#define MARK_INVALID ::std::numeric_limits< UndoStackMark >::max()
+
+//========================================================================
+
+struct MarkedUndoAction
+{
+ SfxUndoAction* pAction;
+ ::std::vector< UndoStackMark > aMarks;
+
+ MarkedUndoAction( SfxUndoAction* i_action )
+ :pAction( i_action )
+ ,aMarks()
+ {
+ }
+};
+
+class SfxUndoActions
+{
+private:
+ ::std::vector< MarkedUndoAction > m_aActions;
+
+public:
+ SfxUndoActions()
+ {
+ }
+
+ bool empty() const { return m_aActions.empty(); }
+ size_t size() const { return m_aActions.size(); }
+
+ const MarkedUndoAction& operator[]( size_t i ) const { return m_aActions[i]; }
+ MarkedUndoAction& operator[]( size_t i ) { return m_aActions[i]; }
+
+ void Remove( size_t i_pos )
+ {
+ m_aActions.erase( m_aActions.begin() + i_pos );
+ }
+
+ void Remove( size_t i_pos, size_t i_count )
+ {
+ m_aActions.erase( m_aActions.begin() + i_pos, m_aActions.begin() + i_pos + i_count );
+ }
+
+ void Insert( SfxUndoAction* i_action, size_t i_pos )
+ {
+ m_aActions.insert( m_aActions.begin() + i_pos, MarkedUndoAction( i_action ) );
+ }
+};
//====================================================================
-/** do not make use of this implementation details, unless you
+/** do not make use of these implementation details, unless you
really really have to! */
struct SVL_DLLPUBLIC SfxUndoArray
{
SfxUndoActions aUndoActions;
- USHORT nMaxUndoActions;
- USHORT nCurUndoAction;
+ size_t nMaxUndoActions;
+ size_t nCurUndoAction;
SfxUndoArray *pFatherUndoArray;
- SfxUndoArray(USHORT nMax=0):
+ SfxUndoArray(size_t nMax=0):
nMaxUndoActions(nMax), nCurUndoAction(0),
pFatherUndoArray(0) {}
~SfxUndoArray();
@@ -90,7 +152,7 @@ struct SVL_DLLPUBLIC SfxUndoArray
//=========================================================================
-/** do not make use of this implementation details, unless you
+/** do not make use of these implementation details, unless you
really really have to! */
class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArray
@@ -111,14 +173,16 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
SfxListUndoAction( const UniString &rComment,
const UniString rRepeatComment, USHORT Id, SfxUndoArray *pFather);
virtual void Undo();
+ virtual void UndoWithContext( SfxUndoContext& i_context );
virtual void Redo();
+ virtual void RedoWithContext( SfxUndoContext& i_context );
virtual void Repeat(SfxRepeatTarget&);
virtual BOOL CanRepeat(SfxRepeatTarget&) const;
virtual BOOL Merge( SfxUndoAction *pNextAction );
- virtual UniString GetComment() const;
- virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
+ virtual UniString GetComment() const;
+ virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
virtual USHORT GetId() const;
void SetComment( const UniString& rComment );
@@ -126,70 +190,242 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
private:
USHORT nId;
- UniString aComment, aRepeatComment;
+ UniString aComment;
+ UniString aRepeatComment;
};
//=========================================================================
-class SVL_DLLPUBLIC SfxUndoManager
+/** is a callback interface for notifications about state changes of an SfxUndoManager
+*/
+class SAL_NO_VTABLE SfxUndoListener
{
- friend class SfxLinkUndoAction;
+public:
+ virtual void actionUndone( const String& i_actionComment ) = 0;
+ virtual void actionRedone( const String& i_actionComment ) = 0;
+ virtual void undoActionAdded( const String& i_actionComment ) = 0;
+ virtual void cleared() = 0;
+ virtual void clearedRedo() = 0;
+ virtual void resetAll() = 0;
+ virtual void listActionEntered( const String& i_comment ) = 0;
+ virtual void listActionLeft( const String& i_comment ) = 0;
+ virtual void listActionLeftAndMerged() = 0;
+ virtual void listActionCancelled() = 0;
+ virtual void undoManagerDying() = 0;
+};
- SfxUndoArray *pUndoArray;
- SfxUndoArray *pActUndoArray;
- SfxUndoArray *pFatherUndoArray;
+//=========================================================================
- bool mbUndoEnabled;
-public:
- SfxUndoManager( USHORT nMaxUndoActionCount = 20 );
- virtual ~SfxUndoManager();
+namespace svl
+{
+ class SAL_NO_VTABLE IUndoManager
+ {
+ public:
+ enum
+ {
+ CurrentLevel = true,
+ TopLevel = false
+ };
- virtual void SetMaxUndoActionCount( USHORT nMaxUndoActionCount );
- virtual USHORT GetMaxUndoActionCount() const;
- virtual void Clear();
+ virtual ~IUndoManager() { };
- virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE );
+ virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) = 0;
+ virtual size_t GetMaxUndoActionCount() const = 0;
- virtual USHORT GetUndoActionCount() const;
- virtual USHORT GetUndoActionId(USHORT nNo=0) const;
- virtual UniString GetUndoActionComment( USHORT nNo=0 ) const;
- /** returns the nNo'th undo action from the top */
- SfxUndoAction* GetUndoAction( USHORT nNo=0 ) const;
+ virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE ) = 0;
- virtual BOOL Undo( USHORT nCount=1 );
- virtual void Undo( SfxUndoAction &rAction );
+ virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual USHORT GetUndoActionId() const = 0;
+ virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const = 0;
- virtual USHORT GetRedoActionCount() const;
- virtual USHORT GetRedoActionId(USHORT nNo=0) const;
- virtual UniString GetRedoActionComment( USHORT nNo=0 ) const;
+ virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
+ virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
- virtual BOOL Redo( USHORT nCount=1 );
- virtual void Redo( SfxUndoAction &rAction );
- virtual void ClearRedo();
+ virtual BOOL Undo() = 0;
+ virtual BOOL Redo() = 0;
+
+ /** clears both the Redo and the Undo stack.
+
+ Will assert and bail out when called while within a list action (<member>IsInListAction</member>).
+ */
+ virtual void Clear() = 0;
+
+ /** clears the Redo stack.
- virtual USHORT GetRepeatActionCount() const;
- virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo = 0) const;
- virtual BOOL Repeat( SfxRepeatTarget &rTarget, USHORT nFrom=0, USHORT nCount=1 );
- virtual void Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction );
- virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo = 0 ) const;
- virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const;
+ Will assert and bail out when called while within a list action (<member>IsInListAction</member>).
+ */
+ virtual void ClearRedo() = 0;
+ /** leaves any possible open list action (<member>IsInListAction</member>), and clears both the Undo and the
+ Redo stack.
+
+ Effectively, calling this method is equivalent to <code>while ( IsInListAction() ) LeaveListAction();</code>,
+ followed by <code>Clear()</code>. The only difference to this calling sequence is that Reset is an
+ atomar operation, also resulting in only one notification.
+ */
+ virtual void Reset() = 0;
+
+ /** determines whether an Undo or Redo is currently running
+ */
+ virtual bool IsDoing() const = 0;
+
+ virtual size_t GetRepeatActionCount() const = 0;
+ virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const = 0;
+ virtual BOOL Repeat( SfxRepeatTarget &rTarget ) = 0;
+ virtual BOOL CanRepeat( SfxRepeatTarget &rTarget ) const = 0;
+
+ virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0) = 0;
+
+ /** leaves the list action entered with EnterListAction
+ @return the number of the sub actions in the list which has just been left. Note that in case no such
+ actions exist, the list action does not contribute to the Undo stack, but is silently removed.
+ */
+ virtual size_t LeaveListAction() = 0;
+
+ /** leaves the list action entered with EnterListAction, and forcefully merges the previous
+ action on the stack into the newly created list action.
+
+ Say you have an Undo action A on the stack, then call EnterListAction, followed by one or more calls to
+ AddUndoAction, followed by a call to LeaveAndMergeListAction. In opposite to LeaveListAction, your Undo
+ stack will now still contain one undo action: the newly created list action, whose first child is the
+ original A, whose other children are those you added via AddUndoAction, and whose comment is the same as
+ the comment of A.
+
+ Effectively, this means that all actions added between EnterListAction and LeaveAndMergeListAction are
+ hidden from the user.
+
+ @return the number of the sub actions in the list which has just been left. Note that in case no such
+ actions exist, the list action does not contribute to the Undo stack, but is silently removed.
+ */
+ virtual size_t LeaveAndMergeListAction() = 0;
+
+ /// determines whether we're within a ListAction context, i.e. a LeaveListAction/LeaveAndMergeListAction call is pending
+ virtual bool IsInListAction() const = 0;
+
+ /// determines how many nested list actions are currently open
+ virtual size_t GetListActionDepth() const = 0;
+
+ /** clears the redo stack and removes the top undo action */
+ virtual void RemoveLastUndoAction() = 0;
+
+ // enables (true) or disables (false) recording of undo actions
+ // If undo actions are added while undo is disabled, they are deleted.
+ // Disabling undo does not clear the current undo buffer!
+ virtual void EnableUndo( bool bEnable ) = 0;
+
+ // returns true if undo is currently enabled
+ // This returns false if undo was disabled using EnableUndo( false ) and
+ // also during the runtime of the Undo() and Redo() methods.
+ virtual bool IsUndoEnabled() const = 0;
+
+ /// adds a new listener to be notified about changes in the UndoManager's state
+ virtual void AddUndoListener( SfxUndoListener& i_listener ) = 0;
+ virtual void RemoveUndoListener( SfxUndoListener& i_listener ) = 0;
+ };
+}
+
+//=========================================================================
+
+namespace svl { namespace undo { namespace impl
+{
+ class UndoManagerGuard;
+ class LockGuard;
+} } }
+
+struct SfxUndoManager_Data;
+class SVL_DLLPUBLIC SfxUndoManager : public ::svl::IUndoManager
+{
+ friend class SfxLinkUndoAction;
+
+ ::boost::scoped_ptr< SfxUndoManager_Data >
+ m_pData;
+public:
+ SfxUndoManager( size_t nMaxUndoActionCount = 20 );
+ virtual ~SfxUndoManager();
+
+ // IUndoManager overridables
+ virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount );
+ virtual size_t GetMaxUndoActionCount() const;
+ virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE );
+ virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const;
+ virtual USHORT GetUndoActionId() const;
+ virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const;
+ virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const;
+ virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const;
+ virtual BOOL Undo();
+ virtual BOOL Redo();
+ virtual void Clear();
+ virtual void ClearRedo();
+ virtual void Reset();
+ virtual bool IsDoing() const;
+ virtual size_t GetRepeatActionCount() const;
+ virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const;
+ virtual BOOL Repeat( SfxRepeatTarget &rTarget );
+ virtual BOOL CanRepeat( SfxRepeatTarget &rTarget ) const;
virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0);
- virtual void LeaveListAction();
+ virtual size_t LeaveListAction();
+ virtual size_t LeaveAndMergeListAction();
+ virtual bool IsInListAction() const;
+ virtual size_t GetListActionDepth() const;
+ virtual void RemoveLastUndoAction();
+ virtual void EnableUndo( bool bEnable );
+ virtual bool IsUndoEnabled() const;
+ virtual void AddUndoListener( SfxUndoListener& i_listener );
+ virtual void RemoveUndoListener( SfxUndoListener& i_listener );
+
+ /** marks the current top-level element of the Undo stack, and returns a unique ID for it
+ */
+ UndoStackMark MarkTopUndoAction();
+
+ /** removes a mark given by its ID.
+
+ After the call, the mark ID is invalid.
+ */
+ void RemoveMark( UndoStackMark const i_mark );
+
+ /** determines whether the top action on the Undo stack has a given mark
+ */
+ bool HasTopUndoActionMark( UndoStackMark const i_mark );
+
+ /** removes the oldest Undo actions from the stack
+ */
+ void RemoveOldestUndoActions( size_t const i_count );
+
+protected:
+ BOOL UndoWithContext( SfxUndoContext& i_context );
+ BOOL RedoWithContext( SfxUndoContext& i_context );
+
+ void ImplClearRedo_NoLock( bool const i_currentLevel );
- /** clears the redo stack and removes the top undo action */
- void RemoveLastUndoAction();
+ /** clears all undo actions on the current level, plus all undo actions on superordinate levels,
+ as soon as those levels are reached.
- // enables (true) or disables (false) recording of undo actions
- // If undo actions are added while undo is disabled, they are deleted.
- // Disabling undo does not clear the current undo buffer!
- void EnableUndo( bool bEnable );
+ If no list action is active currently, i.e. we're on the top level already, this method is equivalent to
+ ->Clear.
- // returns true if undo is currently enabled
- // This returns false if undo was disabled using EnableUndo( false ) and
- // also during the runtime of the Undo() and Redo() methods.
- bool IsUndoEnabled() const { return mbUndoEnabled; }
+ Otherwise, the Undo actions on the current level are removed. Upon leaving the current list action, all
+ undo actions on the then-current level are removed, too. This is continued until the top level is reached.
+ */
+ void ClearAllLevels();
+
+private:
+ size_t ImplLeaveListAction( const bool i_merge, ::svl::undo::impl::UndoManagerGuard& i_guard );
+ bool ImplAddUndoAction_NoNotify( SfxUndoAction* pAction, bool bTryMerge, bool bClearRedo, ::svl::undo::impl::UndoManagerGuard& i_guard );
+ void ImplClearRedo( ::svl::undo::impl::UndoManagerGuard& i_guard, bool const i_currentLevel );
+ void ImplClearUndo( ::svl::undo::impl::UndoManagerGuard& i_guard );
+ void ImplClearCurrentLevel_NoNotify( ::svl::undo::impl::UndoManagerGuard& i_guard );
+ size_t ImplGetRedoActionCount_Lock( bool const i_currentLevel = CurrentLevel ) const;
+ bool ImplIsUndoEnabled_Lock() const;
+ bool ImplIsInListAction_Lock() const;
+ void ImplEnableUndo_Lock( bool const i_enable );
+
+ BOOL ImplUndo( SfxUndoContext* i_contextOrNull );
+ BOOL ImplRedo( SfxUndoContext* i_contextOrNull );
+
+ friend class ::svl::undo::impl::LockGuard;
};
//=========================================================================
@@ -213,7 +449,7 @@ class SVL_DLLPUBLIC SfxLinkUndoAction : public SfxUndoAction
{
public:
TYPEINFO();
- SfxLinkUndoAction(SfxUndoManager *pManager);
+ SfxLinkUndoAction(::svl::IUndoManager *pManager);
~SfxLinkUndoAction();
virtual void Undo();
@@ -222,14 +458,14 @@ public:
virtual void Repeat(SfxRepeatTarget&r);
- virtual UniString GetComment() const;
- virtual UniString GetRepeatComment(SfxRepeatTarget&r) const;
+ virtual UniString GetComment() const;
+ virtual UniString GetRepeatComment(SfxRepeatTarget&r) const;
virtual USHORT GetId() const;
SfxUndoAction* GetAction() const { return pAction; }
protected:
- SfxUndoManager *pUndoManager;
+ ::svl::IUndoManager *pUndoManager;
SfxUndoAction *pAction;
};
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index fa5eca964a8c..fd789e6a4aac 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -30,10 +30,16 @@
#include <com/sun/star/uno/Exception.hpp>
+#include <comphelper/flagguard.hxx>
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <svl/undo.hxx>
+#include <vector>
+#include <list>
+#include <limits>
+
using ::com::sun::star::uno::Exception;
// STATIC DATA -----------------------------------------------------------
@@ -55,6 +61,12 @@ SfxRepeatTarget::~SfxRepeatTarget()
//------------------------------------------------------------------------
+SfxUndoContext::~SfxUndoContext()
+{
+}
+
+//------------------------------------------------------------------------
+
BOOL SfxUndoAction::IsLinked()
{
return bLinked;
@@ -117,7 +129,6 @@ XubString SfxUndoAction::GetRepeatComment(SfxRepeatTarget&) const
//------------------------------------------------------------------------
-
void SfxUndoAction::Undo()
{
// die sind nur konzeptuell pure virtual
@@ -126,6 +137,14 @@ void SfxUndoAction::Undo()
//------------------------------------------------------------------------
+void SfxUndoAction::UndoWithContext( SfxUndoContext& i_context )
+{
+ (void)i_context;
+ Undo();
+}
+
+//------------------------------------------------------------------------
+
void SfxUndoAction::Redo()
{
// die sind nur konzeptuell pure virtual
@@ -134,6 +153,14 @@ void SfxUndoAction::Redo()
//------------------------------------------------------------------------
+void SfxUndoAction::RedoWithContext( SfxUndoContext& i_context )
+{
+ (void)i_context;
+ Redo();
+}
+
+//------------------------------------------------------------------------
+
void SfxUndoAction::Repeat(SfxRepeatTarget&)
{
// die sind nur konzeptuell pure virtual
@@ -150,206 +177,554 @@ BOOL SfxUndoAction::CanRepeat(SfxRepeatTarget&) const
//========================================================================
+typedef ::std::vector< SfxUndoListener* > UndoListeners;
+
+struct SVL_DLLPRIVATE SfxUndoManager_Data
+{
+ ::osl::Mutex aMutex;
+ SfxUndoArray* pUndoArray;
+ SfxUndoArray* pActUndoArray;
+ SfxUndoArray* pFatherUndoArray;
+
+ sal_Int32 mnLockCount;
+ sal_Int32 mnMarks;
+ sal_Int32 mnEmptyMark;
+ bool mbDoing;
+ bool mbClearUntilTopLevel;
+
+ UndoListeners aListeners;
+
+ SfxUndoManager_Data( size_t i_nMaxUndoActionCount )
+ :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) )
+ ,pActUndoArray( NULL )
+ ,pFatherUndoArray( NULL )
+ ,mnLockCount( 0 )
+ ,mnMarks( 0 )
+ ,mnEmptyMark(MARK_INVALID)
+ ,mbDoing( false )
+ ,mbClearUntilTopLevel( false )
+ {
+ pActUndoArray = pUndoArray;
+ }
+
+ ~SfxUndoManager_Data()
+ {
+ delete pUndoArray;
+ }
+};
+
+//========================================================================
-SfxUndoManager::SfxUndoManager( USHORT nMaxUndoActionCount )
- : pFatherUndoArray(0)
- , mbUndoEnabled( true )
+namespace svl { namespace undo { namespace impl
{
- pUndoArray=new SfxUndoArray(nMaxUndoActionCount);
- pActUndoArray=pUndoArray;
+ //--------------------------------------------------------------------
+ class SVL_DLLPRIVATE LockGuard
+ {
+ public:
+ LockGuard( SfxUndoManager& i_manager )
+ :m_manager( i_manager )
+ {
+ m_manager.ImplEnableUndo_Lock( false );
+ }
+
+ ~LockGuard()
+ {
+ m_manager.ImplEnableUndo_Lock( true );
+ }
+
+ private:
+ SfxUndoManager& m_manager;
+ };
+
+ //--------------------------------------------------------------------
+ typedef void ( SfxUndoListener::*UndoListenerVoidMethod )();
+ typedef void ( SfxUndoListener::*UndoListenerStringMethod )( const String& );
+
+ //--------------------------------------------------------------------
+ struct SVL_DLLPRIVATE NotifyUndoListener : public ::std::unary_function< SfxUndoListener*, void >
+ {
+ NotifyUndoListener()
+ :m_notificationMethod( NULL )
+ ,m_altNotificationMethod( NULL )
+ ,m_sActionComment()
+ {
+ }
+ NotifyUndoListener( UndoListenerVoidMethod i_notificationMethod )
+ :m_notificationMethod( i_notificationMethod )
+ ,m_altNotificationMethod( NULL )
+ ,m_sActionComment()
+ {
+ }
+
+ NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment )
+ :m_notificationMethod( NULL )
+ ,m_altNotificationMethod( i_notificationMethod )
+ ,m_sActionComment( i_actionComment )
+ {
+ }
+
+ bool is() const
+ {
+ return ( m_notificationMethod != NULL ) || ( m_altNotificationMethod != NULL );
+ }
+
+ void operator()( SfxUndoListener* i_listener ) const
+ {
+ OSL_PRECOND( is(), "NotifyUndoListener: this will crash!" );
+ if ( m_altNotificationMethod != NULL )
+ {
+ ( i_listener->*m_altNotificationMethod )( m_sActionComment );
+ }
+ else
+ {
+ ( i_listener->*m_notificationMethod )();
+ }
+ }
+
+ private:
+ UndoListenerVoidMethod m_notificationMethod;
+ UndoListenerStringMethod m_altNotificationMethod;
+ String m_sActionComment;
+ };
+
+ //--------------------------------------------------------------------
+ class SVL_DLLPRIVATE UndoManagerGuard
+ {
+ public:
+ UndoManagerGuard( SfxUndoManager_Data& i_managerData )
+ :m_rManagerData( i_managerData )
+ ,m_aGuard( i_managerData.aMutex )
+ ,m_notifiers()
+ {
+ }
+
+ ~UndoManagerGuard();
+
+ void clear()
+ {
+ m_aGuard.clear();
+ }
+
+ void reset()
+ {
+ m_aGuard.reset();
+ }
+
+ void cancelNotifications()
+ {
+ m_notifiers.clear();
+ }
+
+ /** marks the given Undo action for deletion
+
+ The Undo action will be put into a list, whose members will be deleted from within the destructor of the
+ UndoManagerGuard. This deletion will happen without the UndoManager's mutex locked.
+ */
+ void markForDeletion( SfxUndoAction* i_action )
+ {
+ // remember
+ if ( i_action )
+ m_aUndoActionsCleanup.push_back( i_action );
+ }
+
+ /** schedules the given SfxUndoListener method to be called for all registered listeners.
+
+ The notification will happen after the Undo manager's mutex has been released, and after all pending
+ deletions of Undo actions are done.
+ */
+ void scheduleNotification( UndoListenerVoidMethod i_notificationMethod )
+ {
+ m_notifiers.push_back( NotifyUndoListener( i_notificationMethod ) );
+ }
+
+ void scheduleNotification( UndoListenerStringMethod i_notificationMethod, const String& i_actionComment )
+ {
+ m_notifiers.push_back( NotifyUndoListener( i_notificationMethod, i_actionComment ) );
+ }
+
+ private:
+ SfxUndoManager_Data& m_rManagerData;
+ ::osl::ResettableMutexGuard m_aGuard;
+ ::std::list< SfxUndoAction* > m_aUndoActionsCleanup;
+ ::std::list< NotifyUndoListener > m_notifiers;
+ };
+
+ UndoManagerGuard::~UndoManagerGuard()
+ {
+ // copy members
+ UndoListeners aListenersCopy( m_rManagerData.aListeners );
+
+ // release mutex
+ m_aGuard.clear();
+
+ // delete all actions
+ while ( !m_aUndoActionsCleanup.empty() )
+ {
+ SfxUndoAction* pAction = m_aUndoActionsCleanup.front();
+ m_aUndoActionsCleanup.pop_front();
+ try
+ {
+ delete pAction;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ // handle scheduled notification
+ for ( ::std::list< NotifyUndoListener >::const_iterator notifier = m_notifiers.begin();
+ notifier != m_notifiers.end();
+ ++notifier
+ )
+ {
+ if ( notifier->is() )
+ ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(), *notifier );
+ }
+ }
+} } }
+
+using namespace ::svl::undo::impl;
+
+//========================================================================
+
+SfxUndoManager::SfxUndoManager( size_t nMaxUndoActionCount )
+ :m_pData( new SfxUndoManager_Data( nMaxUndoActionCount ) )
+{
}
//------------------------------------------------------------------------
-
SfxUndoManager::~SfxUndoManager()
{
- delete pUndoArray;
+ UndoListeners aListenersCopy;
+ {
+ UndoManagerGuard aGuard( *m_pData );
+ aListenersCopy = m_pData->aListeners;
+ }
+
+ ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(),
+ NotifyUndoListener( &SfxUndoListener::undoManagerDying ) );
}
//------------------------------------------------------------------------
-void SfxUndoManager::EnableUndo( bool bEnable )
+void SfxUndoManager::EnableUndo( bool i_enable )
{
- mbUndoEnabled = bEnable;
+ UndoManagerGuard aGuard( *m_pData );
+ ImplEnableUndo_Lock( i_enable );
+
}
//------------------------------------------------------------------------
+void SfxUndoManager::ImplEnableUndo_Lock( bool const i_enable )
+{
+ if ( !i_enable )
+ ++m_pData->mnLockCount;
+ else
+ {
+ OSL_PRECOND( m_pData->mnLockCount > 0, "SfxUndoManager::ImplEnableUndo_NoNotify: not disabled, so why enabling?" );
+ if ( m_pData->mnLockCount > 0 )
+ --m_pData->mnLockCount;
+ }
+}
-void SfxUndoManager::SetMaxUndoActionCount( USHORT nMaxUndoActionCount )
+//------------------------------------------------------------------------
+
+bool SfxUndoManager::IsUndoEnabled() const
{
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplIsUndoEnabled_Lock();
+}
+
+//------------------------------------------------------------------------
+
+bool SfxUndoManager::ImplIsUndoEnabled_Lock() const
+{
+ return m_pData->mnLockCount == 0;
+}
+
+//------------------------------------------------------------------------
+
+void SfxUndoManager::SetMaxUndoActionCount( size_t nMaxUndoActionCount )
+{
+ UndoManagerGuard aGuard( *m_pData );
+
// Remove entries from the pActUndoArray when we have to reduce
// the number of entries due to a lower nMaxUndoActionCount.
// Both redo and undo action entries will be removed until we reached the
// new nMaxUndoActionCount.
- long nNumToDelete = pActUndoArray->aUndoActions.Count() - nMaxUndoActionCount;
- if ( nNumToDelete > 0 )
+ long nNumToDelete = m_pData->pActUndoArray->aUndoActions.size() - nMaxUndoActionCount;
+ while ( nNumToDelete > 0 )
{
- while ( nNumToDelete > 0 )
+ size_t nPos = m_pData->pActUndoArray->aUndoActions.size();
+ if ( nPos > m_pData->pActUndoArray->nCurUndoAction )
{
- USHORT nPos = pActUndoArray->aUndoActions.Count();
- if ( nPos > pActUndoArray->nCurUndoAction )
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[nPos-1].pAction;
+ if ( !pAction->IsLinked() )
{
- if ( !pActUndoArray->aUndoActions[nPos-1]->IsLinked() )
- {
- delete pActUndoArray->aUndoActions[nPos-1];
- pActUndoArray->aUndoActions.Remove( nPos-1 );
- --nNumToDelete;
- }
+ aGuard.markForDeletion( pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove( nPos-1 );
+ --nNumToDelete;
}
+ }
- if ( nNumToDelete > 0 && pActUndoArray->nCurUndoAction > 0 )
+ if ( nNumToDelete > 0 && m_pData->pActUndoArray->nCurUndoAction > 0 )
+ {
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[0].pAction;
+ if ( !pAction->IsLinked() )
{
- if ( !pActUndoArray->aUndoActions[0]->IsLinked() )
- {
- delete pActUndoArray->aUndoActions[0];
- pActUndoArray->aUndoActions.Remove(0);
- --pActUndoArray->nCurUndoAction;
- --nNumToDelete;
- }
+ aGuard.markForDeletion( pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove(0);
+ --m_pData->pActUndoArray->nCurUndoAction;
+ --nNumToDelete;
}
-
- if ( nPos == pActUndoArray->aUndoActions.Count() )
- break; // Cannot delete more entries
}
+
+ if ( nPos == m_pData->pActUndoArray->aUndoActions.size() )
+ break; // Cannot delete more entries
}
- pActUndoArray->nMaxUndoActions = nMaxUndoActionCount;
+ m_pData->pActUndoArray->nMaxUndoActions = nMaxUndoActionCount;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetMaxUndoActionCount() const
+size_t SfxUndoManager::GetMaxUndoActionCount() const
{
- return pActUndoArray->nMaxUndoActions;
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->pActUndoArray->nMaxUndoActions;
}
//------------------------------------------------------------------------
-void SfxUndoManager::Clear()
+void SfxUndoManager::ImplClearCurrentLevel_NoNotify( UndoManagerGuard& i_guard )
{
- while ( pActUndoArray->aUndoActions.Count() )
+ // clear array
+ while ( !m_pData->pActUndoArray->aUndoActions.empty() )
{
- SfxUndoAction *pAction=
- pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1];
- pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 );
- delete pAction;
+ size_t deletePos = m_pData->pActUndoArray->aUndoActions.size() - 1;
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ deletePos ].pAction;
+ i_guard.markForDeletion( pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove( deletePos );
}
- pActUndoArray->nCurUndoAction = 0;
+ m_pData->pActUndoArray->nCurUndoAction = 0;
+
+ m_pData->mnMarks = 0;
+ m_pData->mnEmptyMark = MARK_INVALID;
}
//------------------------------------------------------------------------
-void SfxUndoManager::ClearRedo()
+void SfxUndoManager::Clear()
{
- while ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
- {
- SfxUndoAction *pAction=
- pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1];
- pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 );
- delete pAction;
- }
+ UndoManagerGuard aGuard( *m_pData );
+
+ OSL_ENSURE( !ImplIsInListAction_Lock(), "SfxUndoManager::Clear: suspicious call - do you really wish to clear the current level?" );
+ ImplClearCurrentLevel_NoNotify( aGuard );
+
+ // notify listeners
+ aGuard.scheduleNotification( &SfxUndoListener::cleared );
}
//------------------------------------------------------------------------
-void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge )
+void SfxUndoManager::ClearAllLevels()
{
- if( mbUndoEnabled )
+ UndoManagerGuard aGuard( *m_pData );
+ ImplClearCurrentLevel_NoNotify( aGuard );
+
+ if ( ImplIsInListAction_Lock() )
+ {
+ m_pData->mbClearUntilTopLevel = true;
+ }
+ else
{
- // Redo-Actions loeschen
- for ( USHORT nPos = pActUndoArray->aUndoActions.Count();
- nPos > pActUndoArray->nCurUndoAction; --nPos )
- delete pActUndoArray->aUndoActions[nPos-1];
+ aGuard.scheduleNotification( &SfxUndoListener::cleared );
+ }
+}
- pActUndoArray->aUndoActions.Remove(
- pActUndoArray->nCurUndoAction,
- pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction );
+//------------------------------------------------------------------------
- if ( pActUndoArray->nMaxUndoActions )
- {
- SfxUndoAction *pTmpAction = pActUndoArray->nCurUndoAction ?
- pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1] : 0;
+void SfxUndoManager::ImplClearRedo_NoLock( bool const i_currentLevel )
+{
+ UndoManagerGuard aGuard( *m_pData );
+ ImplClearRedo( aGuard, i_currentLevel );
+}
- if ( !bTryMerge || !(pTmpAction && pTmpAction->Merge(pAction)) )
- {
- // auf Max-Anzahl anpassen
- if( pActUndoArray == pUndoArray )
- while( pActUndoArray->aUndoActions.Count() >=
- pActUndoArray->nMaxUndoActions &&
- !pActUndoArray->aUndoActions[0]->IsLinked() )
- {
- delete pActUndoArray->aUndoActions[0];
- pActUndoArray->aUndoActions.Remove(0);
- --pActUndoArray->nCurUndoAction;
- }
-
- // neue Action anh"angen
- const SfxUndoAction* pTemp = pAction;
- pActUndoArray->aUndoActions.Insert(
- pTemp, pActUndoArray->nCurUndoAction++ );
- return;
- }
- }
- }
- delete pAction;
+//------------------------------------------------------------------------
+
+void SfxUndoManager::ClearRedo()
+{
+ OSL_ENSURE( !IsInListAction(), "SfxUndoManager::ClearRedo: suspicious call - do you really wish to clear the current level?" );
+ ImplClearRedo_NoLock( CurrentLevel );
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetUndoActionCount() const
+void SfxUndoManager::Reset()
{
- return pActUndoArray->nCurUndoAction;
+ UndoManagerGuard aGuard( *m_pData );
+
+ // clear all locks
+ while ( !ImplIsUndoEnabled_Lock() )
+ ImplEnableUndo_Lock( true );
+
+ // cancel all list actions
+ while ( IsInListAction() )
+ ImplLeaveListAction( false, aGuard );
+
+ // clear both stacks
+ ImplClearCurrentLevel_NoNotify( aGuard );
+
+ // cancel the notifications scheduled by ImplLeaveListAction,
+ // as we want to do an own, dedicated notification
+ aGuard.cancelNotifications();
+
+ // schedule notification
+ aGuard.scheduleNotification( &SfxUndoListener::resetAll );
}
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetUndoActionComment( USHORT nNo ) const
+void SfxUndoManager::ImplClearUndo( UndoManagerGuard& i_guard )
{
- DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment(), illegal id!" );
- if( nNo < pActUndoArray->nCurUndoAction )
+ while ( m_pData->pActUndoArray->nCurUndoAction > 0 )
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetComment(); //!
+ SfxUndoAction* pUndoAction = m_pData->pActUndoArray->aUndoActions[0].pAction;
+ m_pData->pActUndoArray->aUndoActions.Remove( 0 );
+ i_guard.markForDeletion( pUndoAction );
+ --m_pData->pActUndoArray->nCurUndoAction;
}
- else
+ // TODO: notifications? We don't have clearedUndo, only cleared and clearedRedo at the SfxUndoListener
+}
+
+//------------------------------------------------------------------------
+
+void SfxUndoManager::ImplClearRedo( UndoManagerGuard& i_guard, bool const i_currentLevel )
+{
+ SfxUndoArray* pUndoArray = ( i_currentLevel == IUndoManager::CurrentLevel ) ? m_pData->pActUndoArray : m_pData->pUndoArray;
+
+ // clearance
+ while ( pUndoArray->aUndoActions.size() > pUndoArray->nCurUndoAction )
{
- XubString aEmpty;
- return aEmpty;
+ size_t deletePos = pUndoArray->aUndoActions.size() - 1;
+ SfxUndoAction* pAction = pUndoArray->aUndoActions[ deletePos ].pAction;
+ pUndoArray->aUndoActions.Remove( deletePos );
+ i_guard.markForDeletion( pAction );
}
+
+ // notification - only if the top level's stack was cleared
+ if ( i_currentLevel == IUndoManager::TopLevel )
+ i_guard.scheduleNotification( &SfxUndoListener::clearedRedo );
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetUndoActionId( USHORT nNo ) const
+bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bTryMerge, bool bClearRedo, UndoManagerGuard& i_guard )
{
- DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" );
- if( nNo < pActUndoArray->nCurUndoAction )
+ if ( !ImplIsUndoEnabled_Lock() || ( m_pData->pActUndoArray->nMaxUndoActions == 0 ) )
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetId(); //!
+ i_guard.markForDeletion( pAction );
+ return false;
}
- else
+
+ // merge, if required
+ SfxUndoAction* pMergeWithAction = m_pData->pActUndoArray->nCurUndoAction ?
+ m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction : NULL;
+ if ( bTryMerge && ( !pMergeWithAction || !pMergeWithAction->Merge( pAction ) ) )
{
- return 0;
+ i_guard.markForDeletion( pAction );
+ return false;
}
+
+ // clear redo stack, if requested
+ if ( bClearRedo && ( ImplGetRedoActionCount_Lock( CurrentLevel ) > 0 ) )
+ ImplClearRedo( i_guard, IUndoManager::CurrentLevel );
+
+ // respect max number
+ if( m_pData->pActUndoArray == m_pData->pUndoArray )
+ {
+ while( m_pData->pActUndoArray->aUndoActions.size() >=
+ m_pData->pActUndoArray->nMaxUndoActions &&
+ !m_pData->pActUndoArray->aUndoActions[0].pAction->IsLinked() )
+ {
+ i_guard.markForDeletion( m_pData->pActUndoArray->aUndoActions[0].pAction );
+ m_pData->pActUndoArray->aUndoActions.Remove(0);
+ --m_pData->pActUndoArray->nCurUndoAction;
+ }
+ }
+
+ // append new action
+ m_pData->pActUndoArray->aUndoActions.Insert( pAction, m_pData->pActUndoArray->nCurUndoAction++ );
+ return true;
}
//------------------------------------------------------------------------
-SfxUndoAction* SfxUndoManager::GetUndoAction( USHORT nNo ) const
+void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge )
{
- DBG_ASSERT( nNo < pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" );
- if( nNo < pActUndoArray->nCurUndoAction )
+ UndoManagerGuard aGuard( *m_pData );
+
+ // add
+ if ( ImplAddUndoAction_NoNotify( pAction, bTryMerge, true, aGuard ) )
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]; //!
+ // notify listeners
+ aGuard.scheduleNotification( &SfxUndoListener::undoActionAdded, pAction->GetComment() );
}
- else
+}
+
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::GetUndoActionCount( bool const i_currentLevel ) const
+{
+ UndoManagerGuard aGuard( *m_pData );
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ return pUndoArray->nCurUndoAction;
+}
+
+//------------------------------------------------------------------------
+
+XubString SfxUndoManager::GetUndoActionComment( size_t nNo, bool const i_currentLevel ) const
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ String sComment;
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ DBG_ASSERT( nNo < pUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment: illegal index!" );
+ if( nNo < pUndoArray->nCurUndoAction )
{
- return 0;
+ sComment = pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction - 1 - nNo ].pAction->GetComment();
}
+ return sComment;
+}
+
+//------------------------------------------------------------------------
+
+USHORT SfxUndoManager::GetUndoActionId() const
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ DBG_ASSERT( m_pData->pActUndoArray->nCurUndoAction > 0, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" );
+ if ( m_pData->pActUndoArray->nCurUndoAction == 0 )
+ return NULL;
+ return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction->GetId();
+}
+
+//------------------------------------------------------------------------
+
+SfxUndoAction* SfxUndoManager::GetUndoAction( size_t nNo ) const
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ DBG_ASSERT( nNo < m_pData->pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" );
+ if( nNo >= m_pData->pActUndoArray->nCurUndoAction )
+ return NULL;
+ return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1-nNo].pAction;
}
//------------------------------------------------------------------------
@@ -357,158 +732,235 @@ SfxUndoAction* SfxUndoManager::GetUndoAction( USHORT nNo ) const
/** clears the redo stack and removes the top undo action */
void SfxUndoManager::RemoveLastUndoAction()
{
- DBG_ASSERT( pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::RemoveLastUndoAction(), no action to remove?!" );
- if( pActUndoArray->nCurUndoAction )
- {
- pActUndoArray->nCurUndoAction--;
+ UndoManagerGuard aGuard( *m_pData );
- // delete redo-actions and top action
- USHORT nPos;
- for ( nPos = pActUndoArray->aUndoActions.Count(); nPos > pActUndoArray->nCurUndoAction; --nPos )
- delete pActUndoArray->aUndoActions[nPos-1];
+ ENSURE_OR_RETURN_VOID( m_pData->pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::RemoveLastUndoAction(), no action to remove?!" );
- pActUndoArray->aUndoActions.Remove(
- pActUndoArray->nCurUndoAction,
- pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction );
+ m_pData->pActUndoArray->nCurUndoAction--;
+
+ // delete redo-actions and top action
+ for ( size_t nPos = m_pData->pActUndoArray->aUndoActions.size(); nPos > m_pData->pActUndoArray->nCurUndoAction; --nPos )
+ {
+ aGuard.markForDeletion( m_pData->pActUndoArray->aUndoActions[nPos-1].pAction );
}
+
+ m_pData->pActUndoArray->aUndoActions.Remove(
+ m_pData->pActUndoArray->nCurUndoAction,
+ m_pData->pActUndoArray->aUndoActions.size() - m_pData->pActUndoArray->nCurUndoAction );
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::Undo( USHORT )
+bool SfxUndoManager::IsDoing() const
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->mbDoing;
+}
- BOOL bRet = FALSE;
+//------------------------------------------------------------------------
- try
- {
- DBG_ASSERT( pActUndoArray == pUndoArray, "svl::SfxUndoManager::Undo(), LeaveListAction() not yet called!" );
- if ( pActUndoArray->nCurUndoAction )
- {
- Undo( *pActUndoArray->aUndoActions[ --pActUndoArray->nCurUndoAction ] );
- bRet = TRUE;
- }
- }
- catch( Exception& e )
- {
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
- }
- mbUndoEnabled = bUndoWasEnabled;
- return bRet;
+BOOL SfxUndoManager::Undo()
+{
+ return ImplUndo( NULL );
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxUndoManager::UndoWithContext( SfxUndoContext& i_context )
+{
+ return ImplUndo( &i_context );
}
//------------------------------------------------------------------------
-void SfxUndoManager::Undo( SfxUndoAction &rAction )
+BOOL SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull )
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
+ UndoManagerGuard aGuard( *m_pData );
+ OSL_ENSURE( !IsDoing(), "SfxUndoManager::Undo: *nested* Undo/Redo actions? How this?" );
+
+ ::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing );
+ LockGuard aLockGuard( *this );
+
+ if ( ImplIsInListAction_Lock() )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Undo: not possible when within a list action!" );
+ return FALSE;
+ }
+
+ if ( m_pData->pActUndoArray->nCurUndoAction == 0 )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Undo: undo stack is empty!" );
+ return FALSE;
+ }
+
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ --m_pData->pActUndoArray->nCurUndoAction ].pAction;
+ const String sActionComment = pAction->GetComment();
try
{
- rAction.Undo();
+ // clear the guard/mutex before calling into the SfxUndoAction - this can be an extension-implemented UNO component
+ // nowadays ...
+ aGuard.clear();
+ if ( i_contextOrNull != NULL )
+ pAction->UndoWithContext( *i_contextOrNull );
+ else
+ pAction->Undo();
+ aGuard.reset();
}
- catch( Exception& e )
+ catch( ... )
{
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
+ aGuard.reset();
+
+ // in theory, somebody might have tampered with all of *m_pData while the mutex was unlocked. So, see if
+ // we still find pAction in our current Undo array
+ size_t nCurAction = 0;
+ while ( nCurAction < m_pData->pActUndoArray->aUndoActions.size() )
+ {
+ if ( m_pData->pActUndoArray->aUndoActions[ nCurAction++ ].pAction == pAction )
+ {
+ // the Undo action is still there ...
+ // assume the error is a permanent failure, and clear the Undo stack
+ ImplClearUndo( aGuard );
+ throw;
+ }
+ }
+ OSL_ENSURE( false, "SfxUndoManager::Undo: can't clear the Undo stack after the failure - some other party was faster ..." );
+ throw;
}
- mbUndoEnabled = bUndoWasEnabled;
+ aGuard.scheduleNotification( &SfxUndoListener::actionUndone, sActionComment );
+
+ return TRUE;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetRedoActionCount() const
+size_t SfxUndoManager::GetRedoActionCount( bool const i_currentLevel ) const
{
- return pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction; //!
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplGetRedoActionCount_Lock( i_currentLevel );
}
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetRedoActionComment( USHORT nNo ) const
+size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel ) const
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetComment(); //!
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ return pUndoArray->aUndoActions.size() - pUndoArray->nCurUndoAction;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetRedoActionId( USHORT nNo ) const
+XubString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const
{
- return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetId(); //!
+ UndoManagerGuard aGuard( *m_pData );
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction->GetComment();
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::Redo( USHORT )
+BOOL SfxUndoManager::Redo()
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
-
- BOOL bRet = FALSE;
+ return ImplRedo( NULL );
+}
- try
- {
- if ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
- {
- Redo( *pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction++] );
- bRet = TRUE;
- }
- }
- catch( Exception& e )
- {
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
- }
+//------------------------------------------------------------------------
- mbUndoEnabled = bUndoWasEnabled;
- return bRet;
+BOOL SfxUndoManager::RedoWithContext( SfxUndoContext& i_context )
+{
+ return ImplRedo( &i_context );
}
//------------------------------------------------------------------------
-void SfxUndoManager::Redo( SfxUndoAction &rAction )
+BOOL SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull )
{
- bool bUndoWasEnabled = mbUndoEnabled;
- mbUndoEnabled = false;
+ UndoManagerGuard aGuard( *m_pData );
+ OSL_ENSURE( !IsDoing(), "SfxUndoManager::Redo: *nested* Undo/Redo actions? How this?" );
+ ::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing );
+ LockGuard aLockGuard( *this );
+
+ if ( ImplIsInListAction_Lock() )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Redo: not possible when within a list action!" );
+ return FALSE;
+ }
+
+ if ( m_pData->pActUndoArray->nCurUndoAction >= m_pData->pActUndoArray->aUndoActions.size() )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::Redo: redo stack is empty!" );
+ return FALSE;
+ }
+
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction++ ].pAction;
+ const String sActionComment = pAction->GetComment();
try
{
- rAction.Redo();
+ // clear the guard/mutex before calling into the SfxUndoAction - this can be a extension-implemented UNO component
+ // nowadays ...
+ aGuard.clear();
+ if ( i_contextOrNull != NULL )
+ pAction->RedoWithContext( *i_contextOrNull );
+ else
+ pAction->Redo();
+ aGuard.reset();
}
- catch( Exception& e )
+ catch( ... )
{
- mbUndoEnabled = bUndoWasEnabled;
- throw e;
+ aGuard.reset();
+
+ // in theory, somebody might have tampered with all of *m_pData while the mutex was unlocked. So, see if
+ // we still find pAction in our current Undo array
+ size_t nCurAction = 0;
+ while ( nCurAction < m_pData->pActUndoArray->aUndoActions.size() )
+ {
+ if ( m_pData->pActUndoArray->aUndoActions[ nCurAction ].pAction == pAction )
+ {
+ // the Undo action is still there ...
+ // assume the error is a permanent failure, and clear the Undo stack
+ ImplClearRedo( aGuard, IUndoManager::CurrentLevel );
+ throw;
+ }
+ ++nCurAction;
+ }
+ OSL_ENSURE( false, "SfxUndoManager::Redo: can't clear the Undo stack after the failure - some other party was faster ..." );
+ throw;
}
- mbUndoEnabled = bUndoWasEnabled;
+ aGuard.scheduleNotification( &SfxUndoListener::actionRedone, sActionComment );
+
+ return TRUE;
}
//------------------------------------------------------------------------
-USHORT SfxUndoManager::GetRepeatActionCount() const
+size_t SfxUndoManager::GetRepeatActionCount() const
{
- return pActUndoArray->aUndoActions.Count();
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->pActUndoArray->aUndoActions.size();
}
//------------------------------------------------------------------------
-XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo ) const
+XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget) const
{
- return pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 - nNo ]
+ UndoManagerGuard aGuard( *m_pData );
+ return m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->aUndoActions.size() - 1 ].pAction
->GetRepeatComment(rTarget);
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, USHORT /*nFrom*/, USHORT /*nCount*/ )
+BOOL SfxUndoManager::Repeat( SfxRepeatTarget &rTarget )
{
- if ( pActUndoArray->aUndoActions.Count() )
+ UndoManagerGuard aGuard( *m_pData );
+ if ( !m_pData->pActUndoArray->aUndoActions.empty() )
{
- Repeat( rTarget, *pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 ] );
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->aUndoActions.size() - 1 ].pAction;
+ aGuard.clear();
+ if ( pAction->CanRepeat( rTarget ) )
+ pAction->Repeat( rTarget );
return TRUE;
}
@@ -517,30 +969,41 @@ BOOL SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, USHORT /*nFrom*/, USHORT
//------------------------------------------------------------------------
-void SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction )
+BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget ) const
{
- if ( rAction.CanRepeat(rTarget) )
- rAction.Repeat(rTarget);
+ UndoManagerGuard aGuard( *m_pData );
+ if ( !m_pData->pActUndoArray->aUndoActions.empty() )
+ {
+ size_t nActionNo = m_pData->pActUndoArray->aUndoActions.size() - 1;
+ return m_pData->pActUndoArray->aUndoActions[nActionNo].pAction->CanRepeat(rTarget);
+ }
+ return FALSE;
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const
+void SfxUndoManager::AddUndoListener( SfxUndoListener& i_listener )
{
- return rAction.CanRepeat(rTarget);
+ UndoManagerGuard aGuard( *m_pData );
+ m_pData->aListeners.push_back( &i_listener );
}
//------------------------------------------------------------------------
-BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo ) const
+void SfxUndoManager::RemoveUndoListener( SfxUndoListener& i_listener )
{
- if ( pActUndoArray->aUndoActions.Count() > nNo )
+ UndoManagerGuard aGuard( *m_pData );
+ for ( UndoListeners::iterator lookup = m_pData->aListeners.begin();
+ lookup != m_pData->aListeners.end();
+ ++lookup
+ )
{
- USHORT nActionNo = pActUndoArray->aUndoActions.Count() - 1 - nNo;
- return pActUndoArray->aUndoActions[nActionNo]->CanRepeat(rTarget);
+ if ( (*lookup) == &i_listener )
+ {
+ m_pData->aListeners.erase( lookup );
+ break;
+ }
}
-
- return FALSE;
}
//------------------------------------------------------------------------
@@ -554,69 +1017,270 @@ void SfxUndoManager::EnterListAction(
*/
{
- if( !mbUndoEnabled )
+ UndoManagerGuard aGuard( *m_pData );
+
+ if( !ImplIsUndoEnabled_Lock() )
return;
- if ( !pUndoArray->nMaxUndoActions )
+ if ( !m_pData->pUndoArray->nMaxUndoActions )
return;
- pFatherUndoArray=pActUndoArray;
- SfxListUndoAction *pAction=new SfxListUndoAction(
- rComment, rRepeatComment, nId, pActUndoArray);
- AddUndoAction( pAction );
- pActUndoArray=pAction;
+ m_pData->pFatherUndoArray = m_pData->pActUndoArray;
+ SfxListUndoAction* pAction = new SfxListUndoAction( rComment, rRepeatComment, nId, m_pData->pActUndoArray );
+ OSL_VERIFY( ImplAddUndoAction_NoNotify( pAction, false, false, aGuard ) );
+ // expected to succeed: all conditions under which it could fail should have been checked already
+ m_pData->pActUndoArray = pAction;
+
+ // notification
+ aGuard.scheduleNotification( &SfxUndoListener::listActionEntered, rComment );
}
//------------------------------------------------------------------------
-void SfxUndoManager::LeaveListAction()
+bool SfxUndoManager::IsInListAction() const
+{
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplIsInListAction_Lock();
+}
-/* [Beschreibung]
+//------------------------------------------------------------------------
- Verlaesst die aktuelle ListAction und geht eine Ebene nach oben.
-*/
+bool SfxUndoManager::ImplIsInListAction_Lock() const
{
- if ( !mbUndoEnabled )
- return;
+ return ( m_pData->pActUndoArray != m_pData->pUndoArray );
+}
- if ( !pUndoArray->nMaxUndoActions )
- return;
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::GetListActionDepth() const
+{
+ UndoManagerGuard aGuard( *m_pData );
+ size_t nDepth(0);
- if( pActUndoArray == pUndoArray )
+ SfxUndoArray* pLookup( m_pData->pActUndoArray );
+ while ( pLookup != m_pData->pUndoArray )
{
- DBG_ERROR( "svl::SfxUndoManager::LeaveListAction(), called without calling EnterListAction()!" );
- return;
+ pLookup = pLookup->pFatherUndoArray;
+ ++nDepth;
}
- DBG_ASSERT(pActUndoArray->pFatherUndoArray,"svl::SfxUndoManager::LeaveListAction(), no father undo array!?");
+ return nDepth;
+}
+
+//------------------------------------------------------------------------
- SfxUndoArray* pTmp=pActUndoArray;
- pActUndoArray=pActUndoArray->pFatherUndoArray;
+size_t SfxUndoManager::LeaveListAction()
+{
+ UndoManagerGuard aGuard( *m_pData );
+ size_t nCount = ImplLeaveListAction( false, aGuard );
- // If no undo action where added, delete the undo list action
- SfxUndoAction *pTmpAction= pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1];
- if(!pTmp->nCurUndoAction)
+ if ( m_pData->mbClearUntilTopLevel )
{
- pActUndoArray->aUndoActions.Remove( --pActUndoArray->nCurUndoAction);
- delete pTmpAction;
+ ImplClearCurrentLevel_NoNotify( aGuard );
+ if ( !ImplIsInListAction_Lock() )
+ {
+ m_pData->mbClearUntilTopLevel = false;
+ aGuard.scheduleNotification( &SfxUndoListener::cleared );
+ }
+ nCount = 0;
}
- else
+
+ return nCount;
+}
+
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::LeaveAndMergeListAction()
+{
+ UndoManagerGuard aGuard( *m_pData );
+ return ImplLeaveListAction( true, aGuard );
+}
+
+//------------------------------------------------------------------------
+
+size_t SfxUndoManager::ImplLeaveListAction( const bool i_merge, UndoManagerGuard& i_guard )
+{
+ if ( !ImplIsUndoEnabled_Lock() )
+ return 0;
+
+ if ( !m_pData->pUndoArray->nMaxUndoActions )
+ return 0;
+
+ if( !ImplIsInListAction_Lock() )
+ {
+ DBG_ERROR( "svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" );
+ return 0;
+ }
+
+ DBG_ASSERT( m_pData->pActUndoArray->pFatherUndoArray, "SfxUndoManager::ImplLeaveListAction, no father undo array!?" );
+
+ // the array/level which we're about to leave
+ SfxUndoArray* pArrayToLeave = m_pData->pActUndoArray;
+ // one step up
+ m_pData->pActUndoArray = m_pData->pActUndoArray->pFatherUndoArray;
+
+ // If no undo actions were added to the list, delete the list action
+ const size_t nListActionElements = pArrayToLeave->nCurUndoAction;
+ if ( nListActionElements == 0 )
+ {
+ SfxUndoAction* pCurrentAction= m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction-1 ].pAction;
+ m_pData->pActUndoArray->aUndoActions.Remove( --m_pData->pActUndoArray->nCurUndoAction );
+ i_guard.markForDeletion( pCurrentAction );
+
+ i_guard.scheduleNotification( &SfxUndoListener::listActionCancelled );
+ return 0;
+ }
+
+ // now that it is finally clear the list action is non-trivial, and does participate in the Undo stack, clear
+ // the redo stack
+ ImplClearRedo( i_guard, IUndoManager::CurrentLevel );
+
+ SfxUndoAction* pCurrentAction= m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction-1 ].pAction;
+ SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction * >( pCurrentAction );
+ ENSURE_OR_RETURN( pListAction, "SfxUndoManager::ImplLeaveListAction: list action expected at this position!", nListActionElements );
+
+ if ( i_merge )
+ {
+ // merge the list action with its predecessor on the same level
+ OSL_ENSURE( m_pData->pActUndoArray->nCurUndoAction > 1,
+ "SfxUndoManager::ImplLeaveListAction: cannot merge the list action if there's no other action on the same level - check this beforehand!" );
+ if ( m_pData->pActUndoArray->nCurUndoAction > 1 )
+ {
+ SfxUndoAction* pPreviousAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction - 2 ].pAction;
+ m_pData->pActUndoArray->aUndoActions.Remove( m_pData->pActUndoArray->nCurUndoAction - 2 );
+ --m_pData->pActUndoArray->nCurUndoAction;
+ pListAction->aUndoActions.Insert( pPreviousAction, 0 );
+ ++pListAction->nCurUndoAction;
+
+ pListAction->SetComment( pPreviousAction->GetComment() );
+ }
+ }
+
+ // if the undo array has no comment, try to get it from its children
+ if ( pListAction->GetComment().Len() == 0 )
+ {
+ for( size_t n = 0; n < pListAction->aUndoActions.size(); n++ )
+ {
+ if( pListAction->aUndoActions[n].pAction->GetComment().Len() )
+ {
+ pListAction->SetComment( pListAction->aUndoActions[n].pAction->GetComment() );
+ break;
+ }
+ }
+ }
+
+ // notify listeners
+ i_guard.scheduleNotification( &SfxUndoListener::listActionLeft, pListAction->GetComment() );
+
+ // outta here
+ return nListActionElements;
+}
+
+//------------------------------------------------------------------------
+UndoStackMark SfxUndoManager::MarkTopUndoAction()
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ OSL_ENSURE( !IsInListAction(),
+ "SfxUndoManager::MarkTopUndoAction(): suspicious call!" );
+ OSL_ENSURE((m_pData->mnMarks + 1) < (m_pData->mnEmptyMark - 1),
+ "SfxUndoManager::MarkTopUndoAction(): mark overflow!");
+
+ size_t const nActionPos = m_pData->pUndoArray->nCurUndoAction;
+ if (0 == nActionPos)
+ {
+ --m_pData->mnEmptyMark;
+ return m_pData->mnEmptyMark;
+ }
+
+ m_pData->pUndoArray->aUndoActions[ nActionPos-1 ].aMarks.push_back(
+ ++m_pData->mnMarks );
+ return m_pData->mnMarks;
+}
+
+//------------------------------------------------------------------------
+void SfxUndoManager::RemoveMark( UndoStackMark const i_mark )
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ if ((m_pData->mnEmptyMark < i_mark) || (MARK_INVALID == i_mark))
{
- // if the undo array has no comment, try to get it from its children
- SfxListUndoAction* pList = dynamic_cast< SfxListUndoAction * >( pTmpAction );
- if( pList && pList->GetComment().Len() == 0 )
+ return; // nothing to remove
+ }
+ else if (i_mark == m_pData->mnEmptyMark)
+ {
+ --m_pData->mnEmptyMark; // never returned from MarkTop => invalid
+ return;
+ }
+
+ for ( size_t i=0; i<m_pData->pUndoArray->aUndoActions.size(); ++i )
+ {
+ MarkedUndoAction& rAction = m_pData->pUndoArray->aUndoActions[i];
+ for ( ::std::vector< UndoStackMark >::iterator markPos = rAction.aMarks.begin();
+ markPos != rAction.aMarks.end();
+ ++markPos
+ )
{
- USHORT n;
- for( n = 0; n < pList->aUndoActions.Count(); n++ )
+ if ( *markPos == i_mark )
{
- if( pList->aUndoActions[n]->GetComment().Len() )
- {
- pList->SetComment( pList->aUndoActions[n]->GetComment() );
- break;
- }
+ rAction.aMarks.erase( markPos );
+ return;
}
}
}
+ OSL_ENSURE( false, "SfxUndoManager::RemoveMark: mark not found!" );
+ // TODO: this might be too offensive. There are situations where we implicitly remove marks
+ // without our clients, in particular the client which created the mark, having a chance to know
+ // about this.
+}
+
+//------------------------------------------------------------------------
+bool SfxUndoManager::HasTopUndoActionMark( UndoStackMark const i_mark )
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ size_t nActionPos = m_pData->pUndoArray->nCurUndoAction;
+ if ( nActionPos == 0 )
+ {
+ return (i_mark == m_pData->mnEmptyMark);
+ }
+
+ const MarkedUndoAction& rAction =
+ m_pData->pUndoArray->aUndoActions[ nActionPos-1 ];
+ for ( ::std::vector< UndoStackMark >::const_iterator markPos = rAction.aMarks.begin();
+ markPos != rAction.aMarks.end();
+ ++markPos
+ )
+ {
+ if ( *markPos == i_mark )
+ return true;
+ }
+
+ return false;
+}
+
+//------------------------------------------------------------------------
+
+void SfxUndoManager::RemoveOldestUndoActions( size_t const i_count )
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ size_t nActionsToRemove = i_count;
+ while ( nActionsToRemove )
+ {
+ SfxUndoAction* pActionToRemove = m_pData->pUndoArray->aUndoActions[0].pAction;
+
+ if ( IsInListAction() && ( m_pData->pUndoArray->nCurUndoAction == 1 ) )
+ {
+ OSL_ENSURE( false, "SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!" );
+ return;
+ }
+
+ aGuard.markForDeletion( pActionToRemove );
+ m_pData->pUndoArray->aUndoActions.Remove( 0 );
+ --m_pData->pUndoArray->nCurUndoAction;
+ --nActionsToRemove;
+ }
}
//------------------------------------------------------------------------
@@ -667,8 +1331,17 @@ SfxListUndoAction::SfxListUndoAction
void SfxListUndoAction::Undo()
{
- for(INT16 i=nCurUndoAction-1;i>=0;i--)
- aUndoActions[i]->Undo();
+ for(size_t i=nCurUndoAction;i>0;)
+ aUndoActions[--i].pAction->Undo();
+ nCurUndoAction=0;
+}
+
+//------------------------------------------------------------------------
+
+void SfxListUndoAction::UndoWithContext( SfxUndoContext& i_context )
+{
+ for(size_t i=nCurUndoAction;i>0;)
+ aUndoActions[--i].pAction->UndoWithContext( i_context );
nCurUndoAction=0;
}
@@ -676,25 +1349,34 @@ void SfxListUndoAction::Undo()
void SfxListUndoAction::Redo()
{
- for(USHORT i=nCurUndoAction;i<aUndoActions.Count();i++)
- aUndoActions[i]->Redo();
- nCurUndoAction = aUndoActions.Count();
+ for(size_t i=nCurUndoAction;i<aUndoActions.size();i++)
+ aUndoActions[i].pAction->Redo();
+ nCurUndoAction = aUndoActions.size();
+}
+
+//------------------------------------------------------------------------
+
+void SfxListUndoAction::RedoWithContext( SfxUndoContext& i_context )
+{
+ for(size_t i=nCurUndoAction;i<aUndoActions.size();i++)
+ aUndoActions[i].pAction->RedoWithContext( i_context );
+ nCurUndoAction = aUndoActions.size();
}
//------------------------------------------------------------------------
void SfxListUndoAction::Repeat(SfxRepeatTarget&rTarget)
{
- for(USHORT i=0;i<nCurUndoAction;i++)
- aUndoActions[i]->Repeat(rTarget);
+ for(size_t i=0;i<nCurUndoAction;i++)
+ aUndoActions[i].pAction->Repeat(rTarget);
}
//------------------------------------------------------------------------
BOOL SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const
{
- for(USHORT i=0;i<nCurUndoAction;i++)
- if(!aUndoActions[i]->CanRepeat(r))
+ for(size_t i=0;i<nCurUndoAction;i++)
+ if(!aUndoActions[i].pAction->CanRepeat(r))
return FALSE;
return TRUE;
}
@@ -703,12 +1385,12 @@ BOOL SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const
BOOL SfxListUndoAction::Merge( SfxUndoAction *pNextAction )
{
- return aUndoActions.Count() && aUndoActions[aUndoActions.Count()-1]->Merge( pNextAction );
+ return !aUndoActions.empty() && aUndoActions[aUndoActions.size()-1].pAction->Merge( pNextAction );
}
//------------------------------------------------------------------------
-SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager)
+SfxLinkUndoAction::SfxLinkUndoAction(::svl::IUndoManager *pManager)
/* [Beschreibung]
Richtet eine LinkAction ein, die auf einen weiteren UndoManager zeigt.
@@ -718,10 +1400,15 @@ SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager)
{
pUndoManager = pManager;
+ SfxUndoManager* pUndoManagerImplementation = dynamic_cast< SfxUndoManager* >( pManager );
+ ENSURE_OR_THROW( pUndoManagerImplementation != NULL, "unsupported undo manager implementation!" );
+ // yes, this cast is dirty. But reaching into the the SfxUndoManager's implementation,
+ // directly accessing its internal stack, and tampering with an action on that stack
+ // is dirty, too.
if ( pManager->GetMaxUndoActionCount() )
{
- USHORT nPos = pManager->GetUndoActionCount()-1;
- pAction = pManager->pActUndoArray->aUndoActions[nPos];
+ size_t nPos = pManager->GetUndoActionCount()-1;
+ pAction = pUndoManagerImplementation->m_pData->pActUndoArray->aUndoActions[nPos].pAction;
pAction->SetLinked();
}
else
@@ -733,7 +1420,7 @@ SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager)
void SfxLinkUndoAction::Undo()
{
if ( pAction )
- pUndoManager->Undo(1);
+ pUndoManager->Undo();
}
//------------------------------------------------------------------------
@@ -741,7 +1428,7 @@ void SfxLinkUndoAction::Undo()
void SfxLinkUndoAction::Redo()
{
if ( pAction )
- pUndoManager->Redo(1);
+ pUndoManager->Redo();
}
//------------------------------------------------------------------------
@@ -749,7 +1436,7 @@ void SfxLinkUndoAction::Redo()
BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const
{
- return pAction && pUndoManager->CanRepeat(r,*pAction);
+ return pAction && pAction->CanRepeat(r);
}
@@ -758,8 +1445,8 @@ BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const
void SfxLinkUndoAction::Repeat(SfxRepeatTarget&r)
{
- if ( pAction )
- pUndoManager->Repeat(r,*pAction);
+ if ( pAction && pAction->CanRepeat( r ) )
+ pAction->Repeat( r );
}
@@ -797,11 +1484,10 @@ SfxLinkUndoAction::~SfxLinkUndoAction()
SfxUndoArray::~SfxUndoArray()
{
- while ( aUndoActions.Count() )
+ while ( !aUndoActions.empty() )
{
- SfxUndoAction *pAction =
- aUndoActions[ aUndoActions.Count() - 1 ];
- aUndoActions.Remove( aUndoActions.Count() - 1 );
+ SfxUndoAction *pAction = aUndoActions[ aUndoActions.size() - 1 ].pAction;
+ aUndoActions.Remove( aUndoActions.size() - 1 );
delete pAction;
}
}
@@ -811,6 +1497,3 @@ USHORT SfxLinkUndoAction::GetId() const
{
return pAction ? pAction->GetId() : 0;
}
-
-
-
diff --git a/svtools/inc/svtools/textdata.hxx b/svtools/inc/svtools/textdata.hxx
index 809d64248eb6..d0182e6a2c77 100644
--- a/svtools/inc/svtools/textdata.hxx
+++ b/svtools/inc/svtools/textdata.hxx
@@ -33,26 +33,6 @@
#include <svl/smplhint.hxx>
#include <tools/string.hxx>
-#define TEXTUNDO_START 100
-#define TEXTUNDO_REMOVECHARS 100
-#define TEXTUNDO_CONNECTPARAS 101
-#define TEXTUNDO_SPLITPARA 102
-#define TEXTUNDO_INSERTCHARS 103
-#define TEXTUNDO_DELCONTENT 104
-#define TEXTUNDO_DELETE 105
-#define TEXTUNDO_CUT 106
-#define TEXTUNDO_PASTE 107
-#define TEXTUNDO_INSERT 108
-#define TEXTUNDO_ATTRIBS 109
-#define TEXTUNDO_DRAGANDDROP 110
-#define TEXTUNDO_READ 111
-#define TEXTUNDO_END 149
-
-#define XTEXTUNDO_START 150
-#define XTEXTUNDO_END 199
-
-#define TEXTUNDO_USER 200
-
// Fuer Notify, wenn alle Absaetze geloescht wurden...
#define TEXT_PARA_ALL 0xFFFFFFFF
diff --git a/svtools/inc/svtools/texteng.hxx b/svtools/inc/svtools/texteng.hxx
index ef27edee2efe..ee49316c317f 100644
--- a/svtools/inc/svtools/texteng.hxx
+++ b/svtools/inc/svtools/texteng.hxx
@@ -39,7 +39,6 @@ class TextAttrib;
class TextCharAttrib;
class TextUndo;
class TextUndoManager;
-class SfxUndoManager;
class EditSelFunctionSet;
class EditSelEngine;
class IdleFormatter;
@@ -49,6 +48,11 @@ class SfxUndoAction;
class KeyEvent;
class Timer;
+namespace svl
+{
+ class IUndoManager;
+}
+
class TextLine;
class TETextPortion;
#include <svl/brdcst.hxx>
@@ -280,9 +284,10 @@ public:
BOOL IsRightToLeft() const { return mbRightToLeft; }
BOOL HasUndoManager() const { return mpUndoManager ? TRUE : FALSE; }
- SfxUndoManager& GetUndoManager();
- void UndoActionStart( USHORT nId );
- void UndoActionEnd( USHORT nId );
+ ::svl::IUndoManager&
+ GetUndoManager();
+ void UndoActionStart( USHORT nId = 0 );
+ void UndoActionEnd();
void InsertUndo( TextUndo* pUndo, BOOL bTryMerge = FALSE );
BOOL IsInUndo() { return mbIsInUndo; }
void SetIsInUndo( BOOL bInUndo ) { mbIsInUndo = bInUndo; }
diff --git a/svtools/inc/svtools/xtextedt.hxx b/svtools/inc/svtools/xtextedt.hxx
index 46c6441e005e..e95ba0b09359 100644
--- a/svtools/inc/svtools/xtextedt.hxx
+++ b/svtools/inc/svtools/xtextedt.hxx
@@ -31,10 +31,6 @@
#include <svtools/texteng.hxx>
#include <svtools/textview.hxx>
-#define XTEXTUNDO_REPLACEALL (XTEXTUNDO_START+1)
-#define XTEXTUNDO_INDENTBLOCK 122
-#define XTEXTUNDO_UNINDENTBLOCK 123
-
namespace com {
namespace sun {
namespace star {
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index 9d6bc78caff9..5a59dcc3900f 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -1146,9 +1146,11 @@ void SvTreeListBox::ModelIsRemoving( SvListEntry* pEntry )
NotifyRemoving( (SvLBoxEntry*)pEntry );
}
-void SvTreeListBox::ModelHasRemoved( SvListEntry* /* pEntry */ )
+void SvTreeListBox::ModelHasRemoved( SvListEntry* pEntry )
{
DBG_CHKTHIS(SvTreeListBox,0);
+ if ( pEntry == pHdlEntry)
+ pHdlEntry = NULL;
pImp->EntryRemoved();
}
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 574f2bde4e1e..593065c0ac0c 100755
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -847,7 +847,8 @@ void SvtURLBox::ImplInit()
{
pImp = new SvtURLBox_Impl();
- SetHelpId( ".uno:OpenURL" );
+ if ( GetHelpId().getLength() == 0 )
+ SetHelpId( ".uno:OpenURL" );
EnableAutocomplete( FALSE );
SetText( String() );
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index e0e136089d78..c0afe8962009 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -763,7 +763,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
if ( bUndoAction )
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
if ( rCurSel.HasRange() )
{
@@ -847,7 +847,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextModified();
if ( bUndoAction )
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
}
return aPaM;
@@ -856,7 +856,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString& rStr )
{
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
TextPaM aPaM;
@@ -908,7 +908,7 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
break;
}
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
TextModified();
return aPaM;
@@ -1430,7 +1430,7 @@ void TextEngine::EnableUndo( BOOL bEnable )
mbUndoEnabled = bEnable;
}
-SfxUndoManager& TextEngine::GetUndoManager()
+::svl::IUndoManager& TextEngine::GetUndoManager()
{
if ( !mpUndoManager )
mpUndoManager = new TextUndoManager( this );
@@ -1447,7 +1447,7 @@ void TextEngine::UndoActionStart( USHORT nId )
}
}
-void TextEngine::UndoActionEnd( USHORT )
+void TextEngine::UndoActionEnd()
{
if ( IsUndoEnabled() && !IsInUndo() )
GetUndoManager().LeaveListAction();
@@ -2640,7 +2640,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
BOOL bUpdate = GetUpdateMode();
SetUpdateMode( FALSE );
- UndoActionStart( TEXTUNDO_READ );
+ UndoActionStart();
TextSelection aSel;
if ( pSel )
aSel = *pSel;
@@ -2666,7 +2666,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = ImpInsertParaBreak( aSel.GetEnd() );
}
- UndoActionEnd( TEXTUNDO_READ );
+ UndoActionEnd();
TextSelection aNewSel( aSel.GetEnd(), aSel.GetEnd() );
diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx
index 4c243de16c31..2ad5e318e92f 100644
--- a/svtools/source/edit/textundo.cxx
+++ b/svtools/source/edit/textundo.cxx
@@ -54,7 +54,7 @@ TextUndoManager::~TextUndoManager()
{
}
-BOOL __EXPORT TextUndoManager::Undo( USHORT nCount )
+BOOL __EXPORT TextUndoManager::Undo()
{
if ( GetUndoActionCount() == 0 )
return FALSE;
@@ -62,7 +62,7 @@ BOOL __EXPORT TextUndoManager::Undo( USHORT nCount )
UndoRedoStart();
mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Undo( nCount );
+ BOOL bDone = SfxUndoManager::Undo();
mpTextEngine->SetIsInUndo( FALSE );
UndoRedoEnd();
@@ -70,7 +70,7 @@ BOOL __EXPORT TextUndoManager::Undo( USHORT nCount )
return bDone;
}
-BOOL __EXPORT TextUndoManager::Redo( USHORT nCount )
+BOOL __EXPORT TextUndoManager::Redo()
{
if ( GetRedoActionCount() == 0 )
return FALSE;
@@ -79,7 +79,7 @@ BOOL __EXPORT TextUndoManager::Redo( USHORT nCount )
UndoRedoStart();
mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Redo( nCount );
+ BOOL bDone = SfxUndoManager::Redo();
mpTextEngine->SetIsInUndo( FALSE );
UndoRedoEnd();
@@ -110,9 +110,8 @@ void TextUndoManager::UndoRedoEnd()
}
-TextUndo::TextUndo( USHORT nI, TextEngine* p )
+TextUndo::TextUndo( TextEngine* p )
{
- mnId = nI;
mpTextEngine = p;
}
@@ -120,12 +119,6 @@ TextUndo::~TextUndo()
{
}
-USHORT __EXPORT TextUndo::GetId() const
-{
- //nId sollte mal entfallen => GetId ueberall ueberladen...
- return mnId;
-}
-
XubString __EXPORT TextUndo::GetComment() const
{
// return mpTextEngine->GetUndoComment( this );
@@ -140,7 +133,7 @@ void TextUndo::SetSelection( const TextSelection& rSel )
TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara )
- : TextUndo( TEXTUNDO_DELCONTENT, pTextEngine )
+ : TextUndo( pTextEngine )
{
mpNode = pNode;
mnPara = nPara;
@@ -191,7 +184,7 @@ void __EXPORT TextUndoDelPara::Redo()
// TextUndoConnectParas
// ------------------------------------------------------------------------
TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_CONNECTPARAS, pTextEngine )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -215,7 +208,7 @@ void __EXPORT TextUndoConnectParas::Redo()
TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_SPLITPARA, pTextEngine )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -239,7 +232,7 @@ void __EXPORT TextUndoSplitPara::Redo()
TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_INSERTCHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -281,7 +274,7 @@ BOOL __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_REMOVECHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -304,7 +297,7 @@ void __EXPORT TextUndoRemoveChars::Redo()
TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rSel )
- : TextUndo( TEXTUNDO_ATTRIBS, pTextEngine ), maSelection( rSel )
+ : TextUndo( pTextEngine ), maSelection( rSel )
{
maSelection.Justify();
// aNewAttribs.Set( rNewItems );
diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx
index cc26c0b51ef6..69b5fc393744 100644
--- a/svtools/source/edit/textundo.hxx
+++ b/svtools/source/edit/textundo.hxx
@@ -47,16 +47,15 @@ public:
~TextUndoManager();
using SfxUndoManager::Undo;
- virtual BOOL Undo( USHORT nCount=1 );
+ virtual BOOL Undo();
using SfxUndoManager::Redo;
- virtual BOOL Redo( USHORT nCount=1 );
+ virtual BOOL Redo();
};
class TextUndo : public SfxUndoAction
{
private:
- USHORT mnId;
TextEngine* mpTextEngine;
protected:
@@ -69,7 +68,7 @@ protected:
public:
TYPEINFO();
- TextUndo( USHORT nId, TextEngine* pTextEngine );
+ TextUndo( TextEngine* pTextEngine );
virtual ~TextUndo();
TextEngine* GetTextEngine() const { return mpTextEngine; }
@@ -78,7 +77,6 @@ public:
virtual void Redo() = 0;
virtual XubString GetComment() const;
- virtual USHORT GetId() const;
};
#endif // _TEXTUNDO_HXX
diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx
index 48cd23bdcc6f..64c6470be1e8 100644
--- a/svtools/source/edit/textview.cxx
+++ b/svtools/source/edit/textview.cxx
@@ -311,9 +311,9 @@ void TextView::DeleteSelected()
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionEnd();
ImpSetSelection( aPaM );
mpImpl->mpTextEngine->FormatAndUpdate( this );
@@ -695,7 +695,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
default: break;
}
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
if(mpImpl->mbSupportProtectAttribute)
{
//expand selection to include all protected content - if there is any
@@ -717,7 +717,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
}
}
aCurSel = ImpDelete( nDel, nMode );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionEnd();
bModified = TRUE;
bAllowIdle = FALSE;
}
@@ -745,7 +745,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod1() &&
!rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( 'x' ) )
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
aCurSel = mpImpl->mpTextEngine->ImpInsertParaBreak( aCurSel );
if ( mpImpl->mbAutoIndent )
{
@@ -760,7 +760,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( n )
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, pPrev->GetText().Copy( 0, n ) );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
bModified = TRUE;
}
else
@@ -1122,21 +1122,21 @@ void TextView::Scroll( long ndX, long ndY )
void TextView::Undo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Undo( 1 );
+ mpImpl->mpTextEngine->GetUndoManager().Undo();
}
void TextView::Redo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Redo( 0 );
+ mpImpl->mpTextEngine->GetUndoManager().Redo();
}
void TextView::Cut()
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionStart();
Copy();
DeleteSelected();
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionEnd();
}
void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
@@ -1370,7 +1370,7 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect )
void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
/* #i87633#
break inserted text into chunks that fit into the underlying String
@@ -1405,7 +1405,7 @@ void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
nLen -= nChunkLen;
nPos += nChunkLen;
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
mpImpl->mpTextEngine->FormatAndUpdate( this );
}
@@ -1417,9 +1417,9 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect )
TextSelection aNewSel( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpInsertText( mpImpl->maSelection, rStr );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
if ( bSelect )
{
@@ -2169,7 +2169,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
HideSelection();
ImpSetSelection( mpImpl->mpDDInfo->maDropPos );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionStart();
String aText;
uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
@@ -2247,7 +2247,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
mpImpl->mpTextEngine->ImpDeleteText( aPrevSel );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionEnd();
delete mpImpl->mpDDInfo;
mpImpl->mpDDInfo = 0;
diff --git a/svtools/source/edit/xtextedt.cxx b/svtools/source/edit/xtextedt.cxx
index 0a4907edcadd..10e05a58676a 100644
--- a/svtools/source/edit/xtextedt.cxx
+++ b/svtools/source/edit/xtextedt.cxx
@@ -327,7 +327,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
BOOL bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE );
if ( bFound )
- pTextEngine->UndoActionStart( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionStart();
while ( bFound )
{
nFound++;
@@ -341,7 +341,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
{
SetSelection( aSel.GetStart() );
pTextEngine->FormatAndUpdate( this );
- pTextEngine->UndoActionEnd( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionEnd();
}
}
return nFound;
@@ -355,7 +355,7 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
aSel.Justify();
HideSelection();
- GetTextEngine()->UndoActionStart( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionStart();
ULONG nStartPara = aSel.GetStart().GetPara();
ULONG nEndPara = aSel.GetEnd().GetPara();
@@ -386,7 +386,7 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
}
}
- GetTextEngine()->UndoActionEnd( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionEnd();
BOOL bRange = aSel.HasRange();
if ( bRight )
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index a6c3617b50a7..3c118445c6f4 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -116,8 +116,8 @@ namespace svt
//=====================================================================
struct TemplateContent;
typedef ::std::vector< ::vos::ORef< TemplateContent > > TemplateFolderContent;
- typedef TemplateFolderContent::const_iterator ConstFolderIterator;
- typedef TemplateFolderContent::iterator FolderIterator;
+ typedef TemplateFolderContent::const_iterator ConstFolderIterator;
+ typedef TemplateFolderContent::iterator FolderIterator;
/** a struct describing one content in one of the template dirs (or at least it's relevant aspects)
*/
@@ -706,15 +706,18 @@ namespace svt
m_aCurrentState.swap( aTemplateFolderContent );
// the template directories from the config
- String aDirs = SvtPathOptions().GetTemplatePath();
+ const SvtPathOptions aPathOptions;
+ String aDirs = aPathOptions.GetTemplatePath();
sal_uInt16 nDirs = aDirs.GetTokenCount( ';' );
m_aCurrentState.reserve( nDirs );
// loop through all the root-level template folders
for ( sal_uInt16 i=0; i<nDirs; ++i)
{
+ String sTemplatePath( aDirs.GetToken( i, ';' ) );
+ sTemplatePath = aPathOptions.ExpandMacros( sTemplatePath );
// create a new entry
- m_aCurrentState.push_back( new TemplateContent( INetURLObject( aDirs.GetToken( i, ';' ) ) ) );
+ m_aCurrentState.push_back( new TemplateContent( INetURLObject( sTemplatePath ) ) );
TemplateFolderContent::iterator aCurrentRoot = m_aCurrentState.end();
--aCurrentRoot;
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 9ff37fbc2af4..bc5627d2fab6 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -1650,7 +1650,7 @@ void SVTXRoadmap::ImplSetNewImage()
{
OSL_PRECOND( GetWindow(), "SVTXRoadmap::ImplSetNewImage: window is required to be not-NULL!" );
::svt::ORoadmap* pButton = static_cast< ::svt::ORoadmap* >( GetWindow() );
- pButton->SetRoadmapBitmap( GetBitmap() );
+ pButton->SetRoadmapBitmap( GetImage().GetBitmapEx() );
}
void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index b1bb7d74887f..21e9b5c5a05f 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -632,6 +632,7 @@ public:
/** application can set it's own undo manager, BegUndo, EndUndo and AddUndoAction
calls are routet to this interface if given */
void SetSdrUndoManager( SfxUndoManager* pUndoManager );
+ SfxUndoManager* GetSdrUndoManager() const;
/** applications can set their own undo factory to overide creation of
undo actions. The SdrModel will become owner of the given SdrUndoFactory
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index d6a530db85e3..783e07c3a2ed 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1974,10 +1974,12 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
}
else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) )
{
- INetURLObject aHID( ::comphelper::getString(Value) );
- DBG_ASSERT( aHID.GetProtocol() == INET_PROT_HID, "Wrong HelpURL!" );
+ ::rtl::OUString sHelpURL;
+ OSL_VERIFY( Value >>= sHelpURL );
+ INetURLObject aHID( sHelpURL );
if ( aHID.GetProtocol() == INET_PROT_HID )
- pGrid->SetHelpId( rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) );
+ sHelpURL = aHID.GetURLPath();
+ pGrid->SetHelpId( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) );
}
else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) )
{
@@ -2073,25 +2075,28 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
}
else if ( 0 == PropertyName.compareTo( FM_PROP_HASNAVIGATION ) )
{
- if (Value.getValueType() == ::getBooleanCppuType())
- pGrid->EnableNavigationBar(*(sal_Bool*)Value.getValue());
+ sal_Bool bValue( sal_True );
+ OSL_VERIFY( Value >>= bValue );
+ pGrid->EnableNavigationBar( bValue );
}
else if ( 0 == PropertyName.compareTo( FM_PROP_RECORDMARKER ) )
{
- if (Value.getValueType() == ::getBooleanCppuType())
- pGrid->EnableHandle(*(sal_Bool*)Value.getValue());
+ sal_Bool bValue( sal_True );
+ OSL_VERIFY( Value >>= bValue );
+ pGrid->EnableHandle( bValue );
}
else if ( 0 == PropertyName.compareTo( FM_PROP_ENABLED ) )
{
- if (Value.getValueType() == ::getBooleanCppuType())
- {
- // Im DesignModus nur das Datenfenster disablen
- // Sonst kann das Control nicht mehr konfiguriert werden
- if (isDesignMode())
- pGrid->GetDataWindow().Enable(*(sal_Bool*)Value.getValue());
- else
- pGrid->Enable(*(sal_Bool*)Value.getValue());
- }
+ sal_Bool bValue( sal_True );
+ OSL_VERIFY( Value >>= bValue );
+ pGrid->EnableHandle( bValue );
+
+ // Im DesignModus nur das Datenfenster disablen
+ // Sonst kann das Control nicht mehr konfiguriert werden
+ if (isDesignMode())
+ pGrid->GetDataWindow().Enable( bValue );
+ else
+ pGrid->Enable( bValue );
}
else
VCLXWindow::setProperty( PropertyName, Value );
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 7cdf707eb811..33a7dde794b4 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1193,7 +1193,7 @@ String DbTextField::GetFormatText(const Reference< XColumn >& _rxField, const Re
if ( _rxField.is() )
try
{
- aString = getValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType);
+ aString = getFormattedValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType);
}
catch( const Exception& )
{
@@ -1534,7 +1534,7 @@ String DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb::X
// ein double-Feld bindet und als Text formatiert, liefert m_rColumn.IsNumeric() sal_True. Das heisst
// also einfach, dass ich den Inhalt der Variant mittels getDouble abfragen kann, und dann kann
// ich den Rest (die Formatierung) dem FormattedField ueberlassen.
- double dValue = getValue(_rxField, m_rColumn.GetParent().getNullDate(), m_nKeyType);
+ double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() );
if (_rxField->wasNull())
return aText;
((FormattedField*)m_pPainter)->SetValue(dValue);
@@ -1578,7 +1578,7 @@ void DbFormattedField::UpdateFromField(const Reference< ::com::sun::star::sdb::X
// ein double-Feld bindet und als Text formatiert, liefert m_rColumn.IsNumeric() sal_True. Das heisst
// also einfach, dass ich den Inhalt der Variant mittels getDouble abfragen kann, und dann kann
// ich den Rest (die Formatierung) dem FormattedField ueberlassen.
- double dValue = getValue(_rxField, m_rColumn.GetParent().getNullDate(), m_nKeyType);
+ double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() );
if (_rxField->wasNull())
m_pWindow->SetText(String());
else
@@ -2556,7 +2556,7 @@ String DbComboBox::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn
if (_rxField.is())
try
{
- aString = getValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType );
+ aString = getFormattedValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType );
}
catch( const Exception& )
{
@@ -3167,7 +3167,7 @@ void DbFilterField::Update()
while (!xListCursor->isAfterLast() && i++ < SHRT_MAX) // max anzahl eintraege
{
- aStr = getValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType);
+ aStr = getFormattedValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType);
aStringList.push_back(aStr);
xListCursor->next();
}
diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx
index b8b4055ef5de..3e8aa88a2612 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include "fmscriptingenv.hxx"
-#include <svx/fmmodel.hxx>
+#include "svx/fmmodel.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -37,6 +37,7 @@
#include <com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
/** === end UNO includes === **/
+
#include <tools/diagnose_ex.h>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/implementationreference.hxx>
@@ -45,6 +46,8 @@
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/app.hxx>
+#include <basic/basmgr.hxx>
#include <boost/shared_ptr.hpp>
@@ -416,60 +419,6 @@ namespace svxform
m_rObjectShell.CallXScript( m_sScriptCode, _rArguments, _rSynchronousResult, aOutArgsIndex, aOutArgs );
}
-
- //................................................................
- //. QualifiedBasicScript
- //................................................................
- class QualifiedBasicScript : public IScript
- {
- SfxObjectShell& m_rObjectShell;
- const ::rtl::OUString m_sMacroLocation;
- const ::rtl::OUString m_sScriptCode;
-
- public:
- QualifiedBasicScript( SfxObjectShell& _rObjectShell, const ::rtl::OUString& _rLocation, const ::rtl::OUString& _rScriptCode )
- :m_rObjectShell( _rObjectShell )
- ,m_sMacroLocation( _rLocation )
- ,m_sScriptCode( _rScriptCode )
- {
- }
-
- // IScript
- virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult );
- };
-
- //................................................................
- void QualifiedBasicScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult )
- {
- m_rObjectShell.CallStarBasicScript( m_sScriptCode, m_sMacroLocation,
- &_rArguments, &_rSynchronousResult );
- }
-
- //................................................................
- //. UnqualifiedBasicScript
- //................................................................
- class UnqualifiedBasicScript : public IScript
- {
- SfxObjectShell& m_rObjectShell;
- const ::rtl::OUString m_sScriptCode;
-
- public:
- UnqualifiedBasicScript( SfxObjectShell& _rObjectShell, const ::rtl::OUString& _rScriptCode )
- :m_rObjectShell( _rObjectShell )
- ,m_sScriptCode( _rScriptCode )
- {
- }
-
- // IScript
- virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult );
- };
-
- //................................................................
- void UnqualifiedBasicScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult )
- {
- m_rObjectShell.CallScript( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarBasic" ) ), m_sScriptCode,
- &_rArguments, &_rSynchronousResult );
- }
}
//--------------------------------------------------------------------
@@ -514,14 +463,24 @@ namespace svxform
sScriptCode = sScriptCode.copy( nPrefixLen + 1 );
}
- if ( sMacroLocation.getLength() )
- { // we have a StarBasic macro with fully-qualified macro location
- pScript.reset( new QualifiedBasicScript( *xObjectShell, sMacroLocation, sScriptCode ) );
- }
- else
- { // we have a StarBasic macro without qualified location - let the object shell gues ....
- pScript.reset( new UnqualifiedBasicScript( *xObjectShell, sScriptCode ) );
+ if ( !sMacroLocation.getLength() )
+ {
+ // legacy format: use the app-wide Basic, if it has a respective method, otherwise fall back to the doc's Basic
+ if ( SFX_APP()->GetBasicManager()->HasMacro( sScriptCode ) )
+ sMacroLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application" ) );
+ else
+ sMacroLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "document" ) );
}
+
+ ::rtl::OUStringBuffer aScriptURI;
+ aScriptURI.appendAscii( "vnd.sun.star.script:" );
+ aScriptURI.append( sScriptCode );
+ aScriptURI.appendAscii( "?language=Basic" );
+ aScriptURI.appendAscii( "&location=" );
+ aScriptURI.append( sMacroLocation );
+
+ const ::rtl::OUString sScriptURI( aScriptURI.makeStringAndClear() );
+ pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) );
}
OSL_ENSURE( pScript.get(), "FormScriptingEnvironment::doFireScriptEvent: no script to execute!" );
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index f9980284993d..1147e71b0731 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -46,7 +46,6 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <basic/sbuno.hxx>
-#include <sfx2/macrconf.hxx>
#include <basic/sbx.hxx>
#include "fmitems.hxx"
#include "fmobj.hxx"
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 7087e3d6793f..528661d2abe4 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -81,7 +81,7 @@
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/uno3.hxx>
-#include <comphelper/scopeguard.hxx>
+#include <comphelper/flagguard.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <toolkit/controls/unocontrol.hxx>
diff --git a/svx/source/inc/typeconversionclient.hxx b/svx/source/inc/typeconversionclient.hxx
index 53bf13b7702c..9ff7e12fe4d0 100644
--- a/svx/source/inc/typeconversionclient.hxx
+++ b/svx/source/inc/typeconversionclient.hxx
@@ -60,17 +60,16 @@ namespace svxform
// --------------------------------------------------------
inline double getValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant,
- const ::com::sun::star::util::Date& _rNullDate,
- sal_Int16 _nKeyType) const
+ const ::com::sun::star::util::Date& _rNullDate ) const
{
double nReturn(0);
if ( ensureLoaded() )
- nReturn = m_xTypeConversion->getValue(_rxVariant, _rNullDate, _nKeyType);
+ nReturn = m_xTypeConversion->getValue( _rxVariant, _rNullDate );
return nReturn;
}
// --------------------------------------------------------
- inline ::rtl::OUString getValue(
+ inline ::rtl::OUString getFormattedValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
const ::com::sun::star::util::Date& _rNullDate,
@@ -79,7 +78,7 @@ namespace svxform
{
::rtl::OUString sReturn;
if ( ensureLoaded() )
- sReturn = m_xTypeConversion->getValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
+ sReturn = m_xTypeConversion->getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
return sReturn;
}
};
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 3f849e92b462..5e225e626175 100644..100755
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -367,6 +367,10 @@ namespace sdr { namespace contact {
::basegfx::B2DTuple aViewScale, aViewTranslate;
double nViewRotate(0), nViewShearX(0);
_rViewTransformation.decompose( aViewScale, aViewTranslate, nViewRotate, nViewShearX );
+
+ ::basegfx::B2DTuple aZoomScale, aZoomTranslate;
+ double nZoomRotate(0), nZoomShearX(0);
+ _rZoomLevelNormalization.decompose( aZoomScale, aZoomTranslate, nZoomRotate, nZoomShearX );
#endif
// transform the logic bound rect, using the view transformation, to pixel coordinates
@@ -979,6 +983,10 @@ namespace sdr { namespace contact {
aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() );
aScaleNormalization.set( 1, 1, (double)aCurrentDeviceMapMode.GetScaleY() );
m_aZoomLevelNormalization *= aScaleNormalization;
+
+ #if OSL_DEBUG_LEVEL > 1
+ m_aZoomLevelNormalization.decompose( aScale, aTranslate, fRotate, fShearX );
+ #endif
}
//--------------------------------------------------------------------
@@ -1818,6 +1826,10 @@ namespace sdr { namespace contact {
// disposed the control though it doesn't own it. So, /me thinks we should not bother here.
return drawinglayer::primitive2d::Primitive2DSequence();
+ if ( GetObjectContact().getViewInformation2D().getViewTransformation().isIdentity() )
+ // remove this when #i115754# is fixed
+ return drawinglayer::primitive2d::Primitive2DSequence();
+
// ignore existing controls which are in alive mode and manually switched to "invisible"
// #102090# / 2009-06-05 / frank.schoenheit@sun.com
const ControlHolder& rControl( m_pImpl->getExistentControl() );
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 7718451ab945..80b586c01600 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -2115,6 +2115,11 @@ void SdrModel::SetSdrUndoManager( SfxUndoManager* pUndoManager )
mpImpl->mpUndoManager = pUndoManager;
}
+SfxUndoManager* SdrModel::GetSdrUndoManager() const
+{
+ return mpImpl->mpUndoManager;
+}
+
SdrUndoFactory& SdrModel::GetSdrUndoFactory() const
{
if( !mpImpl->mpUndoFactory )
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index a905aa0fd2f4..af6a35ddd5ef 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -58,6 +58,7 @@
#include <svx/extrud3d.hxx>
#include <svx/lathe3d.hxx>
#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
using ::rtl::OUString;
using namespace ::vos;
@@ -306,7 +307,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpModel == 0) || (mpPage == 0) )
+ if ( ( mpModel == NULL ) || ( mpPage == NULL ) )
throw lang::DisposedException();
SvxShape* pShape = SvxShape::getImplementation( xShape );
@@ -319,6 +320,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
if(!pObj)
{
pObj = CreateSdrObject( xShape );
+ ENSURE_OR_RETURN_VOID( pObj != NULL, "SvxDrawPage::add: no SdrObject was created!" );
}
else if ( !pObj->IsInserted() )
{
@@ -326,14 +328,10 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
mpPage->InsertObject( pObj );
}
- if(pObj == NULL)
- return;
-
- if(pShape)
- pShape->Create( pObj, this );
+ pShape->Create( pObj, this );
+ OSL_ENSURE( pShape->GetSdrObject() == pObj, "SvxDrawPage::add: shape does not know about its newly created SdrObject!" );
- if( mpModel )
- mpModel->SetChanged();
+ mpModel->SetChanged();
}
//----------------------------------------------------------------------
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 0f1482adaf5d..839c4553a859 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -147,7 +147,7 @@ struct SvxShapeImpl
* SdrObject so a multiple call to SvxShape::Create() with same SdrObject
* is prohibited.
*/
- SdrObject* mpCreatedObj;
+ ::tools::WeakReference< SdrObject > mpCreatedObj;
// for xComponent
::cppu::OInterfaceContainerHelper maDisposeListeners;
@@ -160,7 +160,7 @@ struct SvxShapeImpl
,mpMaster( NULL )
,mbHasSdrObjectOwnership( false )
,mbDisposing( false )
- ,mpCreatedObj( NULL )
+ ,mpCreatedObj()
,maDisposeListeners( _rMutex )
,maPropertyNotifier( _rAntiImpl, _rMutex )
{
@@ -468,11 +468,12 @@ void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ )
if ( !pNewObj )
return;
- OSL_ENSURE( ( mpImpl->mpCreatedObj == NULL ) || ( mpImpl->mpCreatedObj == pNewObj ),
+ SdrObject* pCreatedObj = mpImpl->mpCreatedObj.get();
+ OSL_ENSURE( ( pCreatedObj == NULL ) || ( pCreatedObj == pNewObj ),
"SvxShape::Create: the same shape used for two different objects?! Strange ..." );
// --> CL, OD 2005-07-19 #i52126# - correct condition
- if ( mpImpl->mpCreatedObj != pNewObj )
+ if ( pCreatedObj != pNewObj )
// <--
{
DBG_ASSERT( pNewObj->GetModel(), "no model for SdrObject?" );
diff --git a/sw/inc/IDocumentDeviceAccess.hxx b/sw/inc/IDocumentDeviceAccess.hxx
index 75e6d650a203..42923a2fadf4 100755
--- a/sw/inc/IDocumentDeviceAccess.hxx
+++ b/sw/inc/IDocumentDeviceAccess.hxx
@@ -129,7 +129,7 @@
@returns
the current PrintData
*/
- virtual SwPrintData* getPrintData() const = 0;
+ virtual const SwPrintData & getPrintData() const = 0;
/** Sets the PrintData
diff --git a/sw/inc/IDocumentUndoRedo.hxx b/sw/inc/IDocumentUndoRedo.hxx
index a224395429a9..0d78d3b361c9 100644
--- a/sw/inc/IDocumentUndoRedo.hxx
+++ b/sw/inc/IDocumentUndoRedo.hxx
@@ -29,59 +29,87 @@
#define IDOCUMENTUNDOREDO_HXX_INCLUDED
#include <sal/types.h>
+
#include <swundo.hxx>
-class SwUndoIter;
class SwRewriter;
-class String;
-class SwUndoIds;
class SwNodes;
class SwUndo;
+namespace sw {
+ class RepeatContext;
+}
+
-typedef sal_uInt16 SwUndoNoModifiedPosition;
/** IDocumentUndoRedo
*/
class IDocumentUndoRedo
{
public:
- /**
+
+ /** Enable/Disable Undo.
*/
- virtual void SetUndoNoResetModified() = 0;
+ virtual void DoUndo(bool const bDoUndo) = 0;
- /**
+ /** Is Undo enabled?
*/
- virtual bool IsUndoNoResetModified() const = 0;
+ virtual bool DoesUndo() const = 0;
- /** UndoHistory am Dokument pflegen
- bei Save, SaveAs, Create wird UndoHistory zurueckgesetzt ???
+ /** Enable/Disable Group Undo.
+ This determines whether successive Insert/Delete/Overwrite
+ actions are combined.
*/
- virtual void DoUndo(bool bUn) = 0;
+ virtual void DoGroupUndo(bool const bDoUndo) = 0;
- /**
+ /** Is Group Undo enabled?
*/
- virtual bool DoesUndo() const = 0;
+ virtual bool DoesGroupUndo() const = 0;
+
+ /** Enable/Disable Undo for Drawing objects.
+ */
+ virtual void DoDrawUndo(bool const bDoUndo) = 0;
- /** Zusammenfassen von Kontinuierlichen Insert/Delete/Overwrite von
- Charaktern. Default ist ::com::sun::star::sdbcx::Group-Undo.
+ /** Is Undo for Drawing objects enabled?
+ for Draw-Undo: writer wants to handle actions on Flys on its own.
+ */
+ virtual bool DoesDrawUndo() const = 0;
+
+ /** Set the position at which the document is in the "unmodified" state
+ to the current position in the Undo stack.
*/
- virtual void DoGroupUndo(bool bUn) = 0;
+ virtual void SetUndoNoModifiedPosition() = 0;
- /**
+ /** Prevent updates to the "unmodified" state position
+ via SetUndoNoResetModified().
*/
- virtual bool DoesGroupUndo() const = 0;
+ virtual void LockUndoNoModifiedPosition() = 0;
- /** macht rueckgaengig:
- 0 letzte Aktion, sonst Aktionen bis zum Start der Klammerung nUndoId
- In rUndoRange wird der restaurierte Bereich gesetzt.
+ /** Allow updates to the "unmodified" state position
+ via SetUndoNoResetModified().
*/
- virtual bool Undo( SwUndoIter& ) = 0; // -> #111827#
+ virtual void UnLockUndoNoModifiedPosition() = 0;
+
+ /** Disable (re)setting the document modified flag on Undo/Redo.
+ */
+ virtual void SetUndoNoResetModified() = 0;
+
+ /** Is setting the document modified flag on Undo/Redo disabled?
+ */
+ virtual bool IsUndoNoResetModified() const = 0;
+
+ /** Execute Undo.
+
+ @return true if executing the last Undo action was successful.
+ */
+ virtual sal_Bool Undo() = 0;
/** Opens undo block.
- @param nUndoId undo ID for the start object
+ @remark StartUndo() and EndUndo() do nothing if !DoesUndo().
+
+ @param nUndoId undo ID for the list action
@param pRewriter rewriter for comments @see SwUndo::GetComment
If the given nUndoId is equal to zero an undo object with ID
@@ -89,105 +117,167 @@ public:
@return the undo ID of the created object
*/
- virtual SwUndoId StartUndo( SwUndoId eUndoId, const SwRewriter * pRewriter) = 0;
+ virtual SwUndoId StartUndo(SwUndoId const eUndoId,
+ SwRewriter const*const pRewriter) = 0;
/**
Closes undo block.
- @param nUndoId undo ID for the closure object
- @param pRewriter rewriter for comments @see SwUndo::GetComment
+ @remark StartUndo() and EndUndo() do nothing if !DoesUndo().
- If the given nUndoId is equal to zero an undo object with ID
- UNDO_START will be generated.
+ @param nUndoId undo ID for the list action
+ @param pRewriter rewriter for comments @see SwUndo::GetComment
- If pRewriter is not equal to zero the given rewriter will be
- set for the generated closure object and the corresponding
- start object. Otherwise an existent rewriter in theIDocumentRedlineAccess
- corresponding start object will be propagated to the generated
- closure object.
+ If the given nUndoId is not UNDO_EMPTY or UNDO_END, the comment of
+ the resulting list action will be set via the nUndoId, applying the
+ given pRewriter (if not 0). Otherwise the comment of the resulting
+ list action is unchanged if it has an UndoId that is not UNDO_START
+ set by StartUndo, and in case the UndoId is UNDO_START the comment
+ of the list action defaults to the comment of the last action
+ contained in the list action.
*/
- virtual SwUndoId EndUndo( SwUndoId eUndoId, const SwRewriter * pRewriter) = 0;
+ virtual SwUndoId EndUndo(SwUndoId const eUndoId,
+ SwRewriter const*const pRewriter) = 0;
/** <- #111827#
- loescht die gesamten UndoObjecte ( fuer Methoden die am Nodes
- Array drehen ohne entsprechendes Undo !!)
+ Delete all Undo actions.
+ Of course Undo will be disabled during deletion.
*/
virtual void DelAllUndoObj() = 0;
- /** liefert die Id der letzten undofaehigen Aktion zurueck
- oder USHRT_MAX fuellt ggf. VARARR mit ::com::sun::star::sdbcx::User-UndoIds
+ /** Get Id and comment of last Undo action.
+ @param o_pStr if not 0, receives comment of last Undo action.
+ @param o_pId if not 0, receives Id of last Undo action.
+ @return true if there is a Undo action, false if none
*/
- virtual SwUndoId GetUndoIds(String* pStr, SwUndoIds *pUndoIds) const = 0;
+ virtual bool GetLastUndoInfo(::rtl::OUString *const o_pStr,
+ SwUndoId *const o_pId) const = 0;
- /**
+ /** Get comments of Undo actions.
+ @return comments of all top-level Undo actions.
*/
- virtual String GetUndoIdsStr(String* pStr, SwUndoIds *pUndoIds) const = 0;
+ virtual SwUndoComments_t GetUndoComments() const = 0;
- /** gibt es Klammerung mit der Id?
- */
- virtual bool HasUndoId(SwUndoId eId) const = 0;
+ /** Execute Redo.
- /* @@@MAINTAINABILITY-HORROR@@@
- Implementation details made public.
- die drei folgenden Methoden werden beim Undo und nur dort
- benoetigt. Sollten sonst nicht aufgerufen werden.
+ @return true if executing the first Redo action was successful.
*/
- virtual const SwNodes* GetUndoNds() const = 0;
+ virtual sal_Bool Redo() = 0;
- virtual SwUndo* RemoveLastUndo(SwUndoId eUndoId) = 0;
-
- /** 2002-05-31 dvo, #95884#: To prevent an undo array overflow when
- doing nested undos, undo may have to be disabled. Undo-intensive
- actions (like auto-format) should check this manually.
+ /** Get comment of first Redo action.
+ @param o_pStr if not 0, receives comment of first Redo action.
+ @return true if there is a Redo action, false if none
*/
- virtual bool HasTooManyUndos() const = 0;
+ virtual bool GetFirstRedoInfo(::rtl::OUString *const o_pStr) const = 0;
- /**
+ /** Get comments of Redo actions.
+ @return comments of all top-level Redo actions.
*/
- virtual bool Redo( SwUndoIter& ) = 0;
+ virtual SwUndoComments_t GetRedoComments() const = 0;
- /** liefert die Id der letzten Redofaehigen Aktion zurueck
- fuellt ggf. VARARR mit RedoIds
+ /** Repeat the last Undo action.
+ @return true if repeating the last Undo Redo action was attempted.
*/
- virtual SwUndoId GetRedoIds( String* pStr, SwUndoIds *pRedoIds) const = 0;
-
- /**
+ virtual bool Repeat(::sw::RepeatContext & rContext,
+ sal_uInt16 const nRepeatCnt) = 0;
+
+ /** Get Id and comment of last Undo action, if it is Repeat capable.
+ @param o_pStr if not 0, receives comment of last Undo action
+ if it is Repeat capable.
+ @return Id of last Undo action if it is Repeat capable,
+ or UNDO_EMPTY if there is none or it is not Repeat capable.
*/
- virtual String GetRedoIdsStr( String* pStr, SwUndoIds *pRedoIds) const = 0;
+ virtual SwUndoId GetRepeatInfo(::rtl::OUString *const o_pStr) const = 0;
- /**
+ /** Add new Undo action.
+ Takes over ownership of pUndo.
+ @remark calls ClearRedo(), except for UNDO_START/UNDO_END.
+ @remark does nothing if !DoesUndo().
*/
- virtual bool Repeat( SwUndoIter&, sal_uInt16 nRepeatCnt) = 0;
+ virtual void AppendUndo(SwUndo *const pUndo) = 0;
- /** liefert die Id der letzten Repeatfaehigen Aktion zurueck
- fuellt ggf. VARARR mit RedoIds
+ /** Delete all Redo actions.
*/
- virtual SwUndoId GetRepeatIds( String* pStr, SwUndoIds *pRedoIds) const = 0;
+ virtual void ClearRedo() = 0;
- /**
+ /* Is the given nodes array the Undo nodes array?
*/
- virtual String GetRepeatIdsStr( String* pStr, SwUndoIds *pRedoIds) const = 0;
+ virtual bool IsUndoNodes(SwNodes const& rNodes) const = 0;
- /** interne Verkuerzung fuer Insert am Ende
- */
- virtual void AppendUndo(SwUndo*) = 0;
+protected:
+ virtual ~IDocumentUndoRedo() {};
+};
- /** loescht alle UndoObjecte von nUndoPos
- bis zum Ende des Undo-Arrays
- */
- virtual void ClearRedo() = 0;
- /** Manipulates the position of the undo stack which reset the modified flag
- */
- virtual void setUndoNoModifiedPosition( SwUndoNoModifiedPosition ) = 0;
+namespace sw {
- /** Gets the position of the undo stack which reset the modified flag
- */
- virtual SwUndoNoModifiedPosition getUndoNoModifiedPosition() const = 0;
+class UndoGuard
+{
+public:
-protected:
- virtual ~IDocumentUndoRedo() {};
+ UndoGuard(IDocumentUndoRedo & rUndoRedo)
+ : m_rUndoRedo(rUndoRedo)
+ , m_bUndoWasEnabled(rUndoRedo.DoesUndo())
+ {
+ m_rUndoRedo.DoUndo(false);
+ }
+ ~UndoGuard()
+ {
+ m_rUndoRedo.DoUndo(m_bUndoWasEnabled);
+ }
+
+ bool UndoWasEnabled() const
+ {
+ return m_bUndoWasEnabled;
+ }
+
+private:
+ IDocumentUndoRedo & m_rUndoRedo;
+ bool const m_bUndoWasEnabled;
+};
+
+class GroupUndoGuard
+{
+public:
+
+ GroupUndoGuard(IDocumentUndoRedo & rUndoRedo)
+ : m_rUndoRedo(rUndoRedo)
+ , m_bGroupUndoWasEnabled(rUndoRedo.DoesGroupUndo())
+ {
+ m_rUndoRedo.DoGroupUndo(false);
+ }
+ ~GroupUndoGuard()
+ {
+ m_rUndoRedo.DoGroupUndo(m_bGroupUndoWasEnabled);
+ }
+
+private:
+ IDocumentUndoRedo & m_rUndoRedo;
+ bool const m_bGroupUndoWasEnabled;
};
+class DrawUndoGuard
+{
+public:
+
+ DrawUndoGuard(IDocumentUndoRedo & rUndoRedo)
+ : m_rUndoRedo(rUndoRedo)
+ , m_bDrawUndoWasEnabled(rUndoRedo.DoesDrawUndo())
+ {
+ m_rUndoRedo.DoDrawUndo(false);
+ }
+ ~DrawUndoGuard()
+ {
+ m_rUndoRedo.DoDrawUndo(m_bDrawUndoWasEnabled);
+ }
+
+private:
+ IDocumentUndoRedo & m_rUndoRedo;
+ bool const m_bDrawUndoWasEnabled;
+};
+
+
+} // namespace sw
+
#endif
diff --git a/sw/inc/IShellCursorSupplier.hxx b/sw/inc/IShellCursorSupplier.hxx
new file mode 100644
index 000000000000..a160f43d40dd
--- /dev/null
+++ b/sw/inc/IShellCursorSupplier.hxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef ISHELLCURSORSUPPLIER_HXX
+#define ISHELLCURSORSUPPLIER_HXX
+
+
+class SwPaM;
+
+
+namespace sw {
+
+/** The Undo actions need to create new Shell cursors.
+ Just creating new SwPaMs in the Undo actions is not sufficient,
+ because only Shell cursors are corrected by doccorr.cxx.
+ */
+class IShellCursorSupplier
+{
+public:
+ virtual ~IShellCursorSupplier() { }
+ virtual SwPaM & CreateNewShellCursor() = 0;
+ virtual SwPaM & GetCurrentShellCursor() = 0;
+};
+
+} // namespace sw
+
+#endif // ISHELLCURSORSUPPLIER_HXX
diff --git a/sw/inc/SwRewriter.hxx b/sw/inc/SwRewriter.hxx
index 8d2b9bd04bbe..5c98db3807ab 100644
--- a/sw/inc/SwRewriter.hxx
+++ b/sw/inc/SwRewriter.hxx
@@ -31,6 +31,12 @@
#include <vector>
#include <tools/string.hxx>
+
+String const UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US);
+String const UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US);
+String const UNDO_ARG3("$3", RTL_TEXTENCODING_ASCII_US);
+
+
typedef std::pair<String, String> SwRewriteRule;
class SwRewriter
diff --git a/sw/inc/SwUndoField.hxx b/sw/inc/SwUndoField.hxx
index 33f5cfd85e49..5d8d1bd92e4c 100644
--- a/sw/inc/SwUndoField.hxx
+++ b/sw/inc/SwUndoField.hxx
@@ -24,11 +24,14 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _SW_UNDO_FIELD_HXX
-#define _SW_UNDO_FIELD_HXX
+#ifndef SW_UNDO_FIELD_HXX
+#define SW_UNDO_FIELD_HXX
#include <undobj.hxx>
+#include <com/sun/star/uno/Any.h>
+
+
class SwDoc;
class SwField;
class SwMsgPoolItem;
@@ -53,16 +56,19 @@ class SwUndoFieldFromDoc : public SwUndoField
SwMsgPoolItem * pHnt;
BOOL bUpdate;
+ void DoImpl();
+
public:
SwUndoFieldFromDoc(const SwPosition & rPos, const SwField & aOldField,
const SwField & aNewField,
SwMsgPoolItem * pHnt, BOOL bUpdate,
SwUndoId nId = UNDO_FIELD );
+
virtual ~SwUndoFieldFromDoc();
- virtual void Undo(SwUndoIter & rIt);
- virtual void Redo(SwUndoIter & rIt);
- virtual void Repeat(SwUndoIter & rIt);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
};
class SwUndoFieldFromAPI : public SwUndoField
@@ -70,6 +76,8 @@ class SwUndoFieldFromAPI : public SwUndoField
com::sun::star::uno::Any aOldVal, aNewVal;
USHORT nWhich;
+ void DoImpl();
+
public:
SwUndoFieldFromAPI(const SwPosition & rPos,
const com::sun::star::uno::Any & rOldVal,
@@ -77,9 +85,9 @@ public:
USHORT nWhich);
virtual ~SwUndoFieldFromAPI();
- virtual void Undo(SwUndoIter & rIt);
- virtual void Redo(SwUndoIter & rIt);
- virtual void Repeat(SwUndoIter & rIt);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
};
-#endif // _SW_UNDO_FIELD_HXX
+#endif // SW_UNDO_FIELD_HXX
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index ac4222ab1ce9..5e0e3c4eeddb 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -911,6 +911,9 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
// #i972: bool items to be passed to SwFrmPage for evaluation
#define FN_OLE_IS_MATH (FN_EXTRA2 + 114)
#define FN_MATH_BASELINE_ALIGNMENT (FN_EXTRA2 + 115)
+
+#define FN_EMBEDDED_OBJECT (FN_EXTRA2 + 116)
+
/*--------------------------------------------------------------------
Bereich: Hilfe
--------------------------------------------------------------------*/
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 22cb3613502e..a050a28805ae 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -24,14 +24,16 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _CRSRSH_HXX
-#define _CRSRSH_HXX
+#ifndef SW_CRSRSH_HXX
+#define SW_CRSRSH_HXX
#include <com/sun/star/i18n/WordType.hpp>
#include <tools/string.hxx>
#include <tools/link.hxx>
#include <tools/rtti.hxx>
+
+#include <IShellCursorSupplier.hxx>
#include "swdllapi.h"
#include <swtypes.hxx> // fuer SWPOSDOC
#include <viewsh.hxx> // fuer ViewShell
@@ -152,7 +154,10 @@ const int CRSR_POSOLD = 0x01, // Cursor bleibt an alter Doc-Position
String *ReplaceBackReferences( const com::sun::star::util::SearchOptions& rSearchOpt, SwPaM* pPam );
// die Cursor - Shell
-class SW_DLLPUBLIC SwCrsrShell : public ViewShell, public SwModify
+class SW_DLLPUBLIC SwCrsrShell
+ : public ViewShell
+ , public SwModify
+ , public ::sw::IShellCursorSupplier
{
friend class SwCallLink;
friend class SwVisCrsr;
@@ -331,6 +336,10 @@ public:
virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ // IShellCursorSupplier
+ virtual SwPaM & CreateNewShellCursor();
+ virtual SwPaM & GetCurrentShellCursor();
+
// neuen Cusror erzeugen und den alten anhaengen
SwPaM * CreateCrsr();
// loesche den aktuellen Cursor und der folgende wird zum Aktuellen
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index e1822bd4ace9..1a33f41f69d3 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -46,7 +46,6 @@ struct SwPosition;
class SwPaM;
class SwNodeNum;
class SwUndo;
-class SwUndos;
class SwRect;
class SwFrmFmt;
class SwFrmFmts;
@@ -86,7 +85,6 @@ SW_DLLPUBLIC const char * dbg_out(const SwPosition & rPos);
SW_DLLPUBLIC const char * dbg_out(const SwPaM & rPam);
SW_DLLPUBLIC const char * dbg_out(const SwNodeNum & rNum);
SW_DLLPUBLIC const char * dbg_out(const SwUndo & rUndo);
-SW_DLLPUBLIC const char * dbg_out(const SwUndos & rUndos);
SW_DLLPUBLIC const char * dbg_out(const SwRewriter & rRewriter);
SW_DLLPUBLIC const char * dbg_out(const SwNumRule & rRule);
SW_DLLPUBLIC const char * dbg_out(const SwTxtFmtColl & rFmt);
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 4aad1fb56cd1..5530db9af525 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _DOC_HXX
-#define _DOC_HXX
+#ifndef SW_DOC_HXX
+#define SW_DOC_HXX
/** SwDoc interfaces */
@@ -34,7 +34,6 @@
#include <IDocumentDeviceAccess.hxx>
#include <IDocumentMarkAccess.hxx>
#include <IDocumentRedlineAccess.hxx>
-#include <IDocumentUndoRedo.hxx>
#include <IDocumentLinksAdministration.hxx>
#include <IDocumentFieldsAccess.hxx>
#include <IDocumentContentOperations.hxx>
@@ -63,7 +62,6 @@ class SwList;
#include <vcl/timer.hxx>
#include "swdllapi.h"
#include <swtypes.hxx>
-#include <ndarr.hxx>
#include <swatrset.hxx>
#include <toxe.hxx> // enums
#include <flyenum.hxx>
@@ -154,6 +152,7 @@ class SwNewDBMgr;
class SwNoTxtNode;
class SwNodeIndex;
class SwNodeRange;
+class SwNodes;
class SwNumRule;
class SwNumRuleTbl;
class SwPageDesc;
@@ -187,10 +186,6 @@ class SwTextBlocks;
class SwTxtFmtColl;
class SwTxtFmtColls;
class SwURLStateChanged;
-class SwUndo;
-class SwUndoIds;
-class SwUndoIter;
-class SwUndos;
class SwUnoCrsr;
class SwUnoCrsrTbl;
class ViewShell;
@@ -220,12 +215,15 @@ class SwPrintData;
class SwRenderData;
class SwPageFrm;
class SwViewOption;
+class IDocumentUndoRedo;
namespace sw { namespace mark {
class MarkManager;
}}
namespace sw {
class MetaFieldManager;
+ class UndoManager;
+ class IShellCursorSupplier;
}
namespace com { namespace sun { namespace star {
@@ -261,7 +259,6 @@ class SW_DLLPUBLIC SwDoc :
public IDocumentSettingAccess,
public IDocumentDeviceAccess,
public IDocumentRedlineAccess,
- public IDocumentUndoRedo,
public IDocumentLinksAdministration,
public IDocumentFieldsAccess,
public IDocumentContentOperations,
@@ -289,9 +286,7 @@ class SW_DLLPUBLIC SwDoc :
//---------------- private Member --------------------------------
// -------------------------------------------------------------------
- // die Objecte
- SwNodes aNodes; // Inhalt des Dokumentes
- SwNodes aUndoNodes; // Inhalt fuer das Undo
+ ::boost::scoped_ptr<SwNodes> m_pNodes; /// document content (Nodes Array)
SwAttrPool* mpAttrPool; // der Attribut Pool
SwPageDescs aPageDescs; // PageDescriptoren
Link aOle2Link; // OLE 2.0-Benachrichtigung
@@ -310,6 +305,7 @@ class SW_DLLPUBLIC SwDoc :
const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager;
const ::boost::scoped_ptr< ::sw::MetaFieldManager > m_pMetaFieldManager;
+ const ::boost::scoped_ptr< ::sw::UndoManager > m_pUndoManager;
// -------------------------------------------------------------------
// die Pointer
@@ -335,8 +331,6 @@ class SW_DLLPUBLIC SwDoc :
SwRootFrm *pLayout; // Rootframe des spezifischen Layouts.
SdrModel *pDrawModel; // StarView Drawing
- SwUndos *pUndos; // Undo/Redo History
-
SwDocUpdtFld *pUpdtFlds; // Struktur zum Field-Update
SwFldTypes *pFldTypes; // Feldtypen
SwNewDBMgr *pNewDBMgr; // Pointer auf den neuen DBMgr fuer
@@ -426,11 +420,6 @@ private:
// -------------------------------------------------------------------
// sonstige
- sal_uInt16 nUndoPos; // akt. Undo-InsertPosition (fuers Redo!)
- sal_uInt16 nUndoSavePos; // Position im Undo-Array, ab der das Doc
- // nicht als modifiziert gilt
- sal_uInt16 nUndoCnt; // Anzahl von Undo Aktionen
- sal_uInt16 nUndoSttEnd; // != 0 -> innerhalb einer Klammerung
sal_uInt16 nAutoFmtRedlnCommentNo; // SeqNo fuers UI-seitige zusammenfassen
// von AutoFmt-Redlines. Wird vom SwAutoFmt
@@ -462,15 +451,12 @@ private:
// leider auch temporaer von
// SwSwgReader::InLayout(), wenn fehlerhafte
// Frames geloescht werden muessen
- bool mbUndo : 1; // TRUE: Undo eingeschaltet
- bool mbGroupUndo : 1; // TRUE: Undos werden gruppiert
bool mbPageNums : 1; // TRUE: es gibt virtuelle Seitennummern
bool mbLoaded : 1; // TRUE: ein geladenes Doc
bool mbUpdateExpFld : 1; // TRUE: Expression-Felder updaten
bool mbNewDoc : 1; // TRUE: neues Doc
bool mbNewFldLst : 1; // TRUE: Felder-Liste neu aufbauen
bool mbCopyIsMove : 1; // TRUE: Copy ist ein verstecktes Move
- bool mbNoDrawUndoObj : 1; // TRUE: keine DrawUndoObjecte speichern
bool mbVisibleLinks : 1; // TRUE: Links werden sichtbar eingefuegt
bool mbBrowseMode : 1; // TRUE: Dokument im BrowseModus anzeigen
bool mbInReading : 1; // TRUE: Dokument wird gerade gelesen
@@ -614,13 +600,10 @@ private:
sal_Bool mbStartIdleTimer ; // idle timer mode start/stop
static SwAutoCompleteWord *pACmpltWords; // Liste aller Worte fuers AutoComplete
- static sal_uInt16 nUndoActions; // anzahl von Undo ::com::sun::star::chaos::Action
//---------------- private Methoden ------------------------------
void checkRedlining(RedlineMode_t& _rReadlineMode);
- sal_Bool DelUndoObj( sal_uInt16 nEnde ); // loescht alle UndoObjecte vom Anfang
- // bis zum angegebenen Ende
DECL_LINK( AddDrawUndo, SdrUndoAction * );
// DrawModel
void DrawNotifyUndoHdl(); // wegen CLOOKs
@@ -735,8 +718,8 @@ public:
/* @@@MAINTAINABILITY-HORROR@@@
Implementation details made public.
*/
- SwNodes& GetNodes() { return aNodes; }
- const SwNodes& GetNodes() const { return aNodes; }
+ SwNodes & GetNodes() { return *m_pNodes; }
+ SwNodes const& GetNodes() const { return *m_pNodes; }
/** IInterface
*/
@@ -769,7 +752,7 @@ public:
virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewHiRes );
virtual const JobSetup* getJobsetup() const;
virtual void setJobsetup(/*[in]*/ const JobSetup& rJobSetup );
- virtual SwPrintData* getPrintData() const;
+ virtual const SwPrintData & getPrintData() const;
virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData);
/** IDocumentMarkAccess
@@ -810,37 +793,8 @@ public:
/** IDocumentUndoRedo
*/
- virtual void SetUndoNoResetModified();
- virtual bool IsUndoNoResetModified() const;
- virtual void DoUndo(bool bUn);
- virtual bool DoesUndo() const;
- virtual void DoGroupUndo(bool bUn);
- virtual bool DoesGroupUndo() const;
- virtual bool Undo(SwUndoIter& );
- virtual SwUndoId StartUndo(SwUndoId eUndoId, const SwRewriter * pRewriter);
- virtual SwUndoId EndUndo(SwUndoId eUndoId, const SwRewriter * pRewriter);
- virtual void DelAllUndoObj();
- virtual SwUndoId GetUndoIds(String* pStr, SwUndoIds *pUndoIds) const;
- virtual String GetUndoIdsStr(String* pStr, SwUndoIds *pUndoIds) const;
- virtual bool HasUndoId(SwUndoId eId) const;
- virtual const SwNodes* GetUndoNds() const;
- virtual SwUndo* RemoveLastUndo(SwUndoId eUndoId);
- virtual bool HasTooManyUndos() const;
- virtual bool Redo(SwUndoIter&);
- virtual SwUndoId GetRedoIds(String* pStr, SwUndoIds *pRedoIds) const;
- virtual String GetRedoIdsStr(String* pStr, SwUndoIds *pRedoIds) const;
- virtual bool Repeat(SwUndoIter&, sal_uInt16 nRepeatCnt);
- virtual SwUndoId GetRepeatIds(String* pStr, SwUndoIds *pRedoIds) const;
- virtual String GetRepeatIdsStr(String* pStr, SwUndoIds *pRedoIds) const;
- virtual void AppendUndo(SwUndo*);
- virtual void ClearRedo();
- virtual void setUndoNoModifiedPosition( SwUndoNoModifiedPosition );
- virtual SwUndoNoModifiedPosition getUndoNoModifiedPosition() const;
-
-
- /** abfragen/setzen der Anzahl von wiederherstellbaren Undo-Actions */
- static sal_uInt16 GetUndoActionCount();
- static void SetUndoActionCount(sal_uInt16 nNew);
+ IDocumentUndoRedo & GetIDocumentUndoRedo();
+ IDocumentUndoRedo const& GetIDocumentUndoRedo() const;
/** IDocumentLinksAdministration
*/
@@ -1803,6 +1757,7 @@ public:
// suche ueber das Layout eine EditShell und ggfs. eine ViewShell
SwEditShell* GetEditShell( ViewShell** ppSh = 0 ) const;
+ ::sw::IShellCursorSupplier * GetIShellCursorSupplier();
// OLE 2.0-Benachrichtung
inline void SetOle2Link(const Link& rLink) {aOle2Link = rLink;}
@@ -1856,9 +1811,6 @@ public:
bool IsCopyIsMove() const { return mbCopyIsMove; }
void SetCopyIsMove( bool bFlag ) { mbCopyIsMove = bFlag; }
- // fuers Draw-Undo: Aktionen auf Flys wollen wir selbst behandeln
- bool IsNoDrawUndoObj() const { return mbNoDrawUndoObj; }
- void SetNoDrawUndoObj( bool bFlag ) { mbNoDrawUndoObj = bFlag; }
SwDrawContact* GroupSelection( SdrView& );
void UnGroupSelection( SdrView& );
sal_Bool DeleteSelection( SwDrawView& );
@@ -1898,12 +1850,11 @@ public:
inline SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True );
inline const SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ) const;
- // loesche den nicht sichtbaren ::com::sun::star::ucb::Content aus dem Document, wie z.B.:
- // versteckte Bereiche, versteckte Absaetze
- sal_Bool RemoveInvisibleContent();
- sal_Bool HasInvisibleContent() const;
- //restore the invisible content if it's available on the undo stack
- sal_Bool RestoreInvisibleContent();
+ bool HasInvisibleContent() const;
+ /// delete invisible content, like hidden sections and paragraphs
+ bool RemoveInvisibleContent();
+ /// restore the invisible content if it's available on the undo stack
+ bool RestoreInvisibleContent();
// replace fields by text - mailmerge support
BOOL ConvertFieldsToText();
@@ -2138,6 +2089,8 @@ public:
#endif
::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
::sw::MetaFieldManager & GetMetaFieldManager();
+ ::sw::UndoManager & GetUndoManager();
+ ::sw::UndoManager const& GetUndoManager() const;
SfxObjectShell* CreateCopy(bool bCallInitNew) const;
};
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 2b5ad3fd5203..379db4ca0559 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -71,13 +71,6 @@ SV_DECL_PTRARR_DEL( SwFldTypes, SwFldTypePtr, INIT_FLDTYPES, GROW_FLDTYPES )
typedef SwTOXType* SwTOXTypePtr;
SV_DECL_PTRARR_DEL( SwTOXTypes, SwTOXTypePtr, 0, 1 )
-// Undo
-#define INIT_UNDOS 5
-#define GROW_UNDOS 5
-// Das Array der Undo-History
-typedef SwUndo* SwUndoPtr;
-SV_DECL_PTRARR_DEL( SwUndos, SwUndoPtr, INIT_UNDOS, GROW_UNDOS )
-
typedef SwSectionFmt* SwSectionFmtPtr;
SV_DECL_PTRARR_DEL(SwSectionFmts,SwSectionFmtPtr,0,4)
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 85201ff9b5b9..de590e4b5d78 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -73,7 +73,6 @@ class SwFmtRefMark;
class SwNumRule; // Numerierung
//class SwNodeNum; // Numerierung
-class SwUndoIds; // fuer Undo
class SwTxtFmtColl;
class SwGrfNode;
class SwFlyFrmFmt;
@@ -123,6 +122,10 @@ namespace sfx2{
class LinkManager;
}
+namespace sw {
+ class UndoRedoContext;
+}
+
#define GETSELTXT_PARABRK_TO_BLANK 0
#define GETSELTXT_PARABRK_KEEP 1
#define GETSELTXT_PARABRK_TO_ONLYCR 2
@@ -533,35 +536,22 @@ public:
SwUndoId StartUndo( SwUndoId eUndoId = UNDO_EMPTY, const SwRewriter * pRewriter = 0 );
// schliesst Klammerung der nUndoId, nicht vom UI benutzt
SwUndoId EndUndo( SwUndoId eUndoId = UNDO_EMPTY, const SwRewriter * pRewriter = 0 );
- // liefert die Id der letzten undofaehigen Aktion zurueck
- // fuellt ggf. VARARR mit User-UndoIds
- SwUndoId GetUndoIds( String* pUndoStr = 0, SwUndoIds *pUndoIds = 0) const;
- String GetUndoIdsStr( String* pUndoStr = 0, SwUndoIds *pUndoIds = 0) const;
-
- // abfragen/setzen der Anzahl von wiederherstellbaren Undo-Actions
- static USHORT GetUndoActionCount();
- static void SetUndoActionCount( USHORT nNew );
-
- // Redo
- // liefert die Id der letzten Redofaehigen Aktion zurueck
- // fuellt ggf. VARARR mit RedoIds
- SwUndoId GetRedoIds( String* pRedoStr = 0, SwUndoIds *pRedoIds = 0) const;
- String GetRedoIdsStr( String* pRedoStr = 0, SwUndoIds *pRedoIds = 0) const;
-
- // Repeat
- // liefert die Id der letzten Repeatfaehigen Aktion zurueck
- // fuellt ggf. VARARR mit RedoIds
- SwUndoId GetRepeatIds( String* pRepeatStr = 0, SwUndoIds *pRedoIds = 0) const;
- String GetRepeatIdsStr( String* pRepeatStr = 0,
- SwUndoIds *pRedoIds = 0) const;
-
- // 0 letzte Aktion, sonst Aktionen bis zum Start der Klammerung nUndoId
- // mit KillPaMs, ClearMark
- BOOL Undo(SwUndoId nUndoId = UNDO_EMPTY, USHORT nCnt = 1 );
- // wiederholt
- USHORT Repeat( USHORT nCount );
- // wiederholt
- USHORT Redo( USHORT nCnt = 1 );
+
+ bool GetLastUndoInfo(::rtl::OUString *const o_pStr,
+ SwUndoId *const o_pId) const;
+ bool GetFirstRedoInfo(::rtl::OUString *const o_pStr) const;
+ SwUndoId GetRepeatInfo(::rtl::OUString *const o_pStr) const;
+
+ /// is it forbidden to modify cursors via API calls?
+ bool CursorsLocked() const;
+ /// set selections to those contained in the UndoRedoContext
+ /// should only be called by sw::UndoManager!
+ void HandleUndoRedoContext(::sw::UndoRedoContext & rContext);
+
+ bool Undo(USHORT const nCount = 1);
+ bool Redo(USHORT const nCount = 1);
+ bool Repeat(USHORT const nCount);
+
// fuer alle Sichten auf dieses Dokument
void StartAllAction();
void EndAllAction();
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index dd822a11dfdd..6fc7199404fb 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -30,6 +30,8 @@
#include <vector>
+#include <boost/utility.hpp>
+
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <svl/svarray.hxx>
@@ -82,7 +84,9 @@ typedef BOOL (*FnForEach_SwNodes)( const SwNodePtr&, void* pArgs );
SV_DECL_PTRARR_SORT( SwOutlineNodes, SwNodePtr, 0, 10 )
-class SW_DLLPUBLIC SwNodes: private BigPtrArray
+class SW_DLLPUBLIC SwNodes
+ : private BigPtrArray
+ , private ::boost::noncopyable
{
friend class SwDoc;
friend class SwNode;
@@ -141,10 +145,6 @@ public:
SwNodePtr operator[]( ULONG n ) const
{ return (SwNodePtr)BigPtrArray::operator[] ( n ); }
-//JP 29.09.97: impl. steht im ndindex.hxx - sollte moeglichst bald auf die
-// neue Schnittstelle angepasst werden
- inline SwNodePtr operator[]( const SwNodeIndex& rIdx ) const;
-
ULONG Count() const { return BigPtrArray::Count(); }
void ForEach( FnForEach_SwNodes fnForEach, void* pArgs = 0 )
{
@@ -342,11 +342,6 @@ public:
SwNode * DocumentSectionStartNode(SwNode * pNode) const;
SwNode * DocumentSectionEndNode(SwNode * pNode) const;
//<- #112139#
-private:
- // privater Constructor, weil nie kopiert werden darf !!
- SwNodes( const SwNodes & rNodes );
};
-
-
#endif
diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx
index 3c3a71dd8641..d3969da42f03 100644
--- a/sw/inc/ndindex.hxx
+++ b/sw/inc/ndindex.hxx
@@ -24,14 +24,15 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _NDINDEX_HXX
-#define _NDINDEX_HXX
+#ifndef SW_NDINDEX_HXX
+#define SW_NDINDEX_HXX
#include <limits.h>
+
#include <tools/solar.h>
-#include "node.hxx"
-#include "ndarr.hxx"
+#include <node.hxx>
+
class SwNode;
class SwNodes;
@@ -239,14 +240,4 @@ inline SwNodeIndex& SwNodeIndex::operator=( ULONG nWert )
return *this;
}
-
-
-//JP 29.09.97: impl. steht im ndindex.hxx - sollte moeglichst bald auf die
-// neue Schnittstelle angepasst werden
-inline SwNode* SwNodes::operator[]( const SwNodeIndex& rIdx ) const
-{
- return &rIdx.GetNode();
-}
-
-
#endif
diff --git a/sw/source/ui/inc/prtopt.hxx b/sw/inc/prtopt.hxx
index 75f0520e35e8..75f0520e35e8 100644
--- a/sw/source/ui/inc/prtopt.hxx
+++ b/sw/inc/prtopt.hxx
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 0e52ce256754..54055242fb03 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -516,8 +516,8 @@ public:
SvPtrarr& rArr );
// lege einen neuen PaM an der Position an
- static SwPaM* NewSwPaM( SwDoc & rDoc, ULONG nStartIdx, ULONG nEndIdx,
- BOOL bNodesArray = TRUE );
+ static SwPaM * NewSwPaM(SwDoc & rDoc,
+ ULONG const nStartIdx, ULONG const nEndIdx);
// kopiere ggfs. eine lokale Datei ins Internet
BOOL CopyLocalFileToINet( String& rFileNm );
diff --git a/sw/inc/swdbtoolsclient.hxx b/sw/inc/swdbtoolsclient.hxx
index 324075d0aeb7..067e58cbcf52 100644
--- a/sw/inc/swdbtoolsclient.hxx
+++ b/sw/inc/swdbtoolsclient.hxx
@@ -64,7 +64,7 @@ public:
const ::com::sun::star::lang::Locale& _rLocale
);
- ::rtl::OUString getValue(
+ ::rtl::OUString getFormattedValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter,
const ::com::sun::star::lang::Locale& _rLocale,
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 02212401d990..3506a7e176b9 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -24,10 +24,16 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _SWUNDO_HXX
-#define _SWUNDO_HXX
+#ifndef SWUNDO_HXX
+#define SWUNDO_HXX
+
+#include <vector>
+
+#include <rtl/ustring.hxx>
+
+
+typedef ::std::vector< ::rtl::OUString > SwUndoComments_t;
-#include <svl/svarray.hxx>
// die Ids fuer StdAktionen
enum SwUndoId
@@ -177,24 +183,4 @@ enum SwUndoId
};
-#define INIT_UNDOIDS 20
-#define GROW_UNDOIDS 32
-// Das Array der verwendeten Undo-Ids
-class String;
-class SwUndoIdAndName
-{
- SwUndoId eUndoId;
- String* pUndoStr;
-
-public:
- SwUndoIdAndName() : eUndoId( UNDO_EMPTY ), pUndoStr( 0 ) {}
- SwUndoIdAndName( SwUndoId nId, const String* pStr = 0 );
- ~SwUndoIdAndName();
-
- SwUndoId GetUndoId() const { return eUndoId; }
- const String* GetUndoStr() const { return pUndoStr; }
-};
-typedef SwUndoIdAndName* SwUndoIdAndNamePtr;
-SV_DECL_PTRARR_DEL( SwUndoIds, SwUndoIdAndNamePtr, INIT_UNDOIDS, GROW_UNDOIDS )
-
#endif
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 7f16e4e4d44c..94601247dce5 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -28,103 +28,37 @@
#define SW_UNDOBJ_HXX
#include <vector>
-#include <memory>
#include <boost/shared_ptr.hpp>
-#include <com/sun/star/uno/Sequence.h>
+#include <svl/undo.hxx>
-#include <tools/mempool.hxx>
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
-#define _SVSTDARR_BOOLS
-#define _SVSTDARR_BYTES
-#define _SVSTDARR_USHORTSSORT
-#include <svl/svstdarr.hxx>
-#endif
-#include <svl/itemset.hxx>
-
-#include <svx/svdundo.hxx> // #111827#
-
-#include <numrule.hxx>
-#include <itabenum.hxx>
-#include <format.hxx>
#include <SwRewriter.hxx>
#include <swundo.hxx>
-#include <IMark.hxx>
-#include <IDocumentContentOperations.hxx>
-class SwUndoIter;
class SwHistory;
class SwIndex;
class SwPaM;
struct SwPosition;
class SwDoc;
-class SwFmt;
-class SwFmtColl;
class SwTxtFmtColl;
-class SwTxtNode;
-class SwTableNode;
-class SwTable;
-class SwTableBox;
-struct SwSortOptions;
class SwFrmFmt;
-class SwHistoryBookmark;
-class SwSectionData;
-class SwSectionFmt;
-class SwTOXBase;
-class SvxTabStopItem;
-class SwDDEFieldType;
-class Graphic;
-class SwGrfNode;
-class SwUndos;
-class SwFtnInfo;
-class SwEndNoteInfo;
class SwNodeIndex;
class SwNodeRange;
-class SwFmtAnchor;
-struct SwUndoGroupObjImpl;
-class SdrMark;
-class SdrMarkList;
-class SdrObject;
-class SdrObjGroup;
-class SdrUndoAction;
-class SwDrawFrmFmt;
-class _SaveTable;
-class SwTableAutoFmt;
-class SwSelBoxes;
-class SwTableSortBoxes;
-class SwUndoSaveSections;
-class SwUndoMoves;
-class SwStartNode;
-class _SaveFlyArr;
-class SwTblToTxtSaves;
class SwRedlineData;
-class SwRedlineSaveData;
-class SwRedline;
-struct SwSaveRowSpan;
-
-namespace sfx2 {
- class MetadatableUndo;
-}
+class SwRedlineSaveDatas;
-namespace utl {
- class TransliterationWrapper;
+namespace sw {
+ class UndoRedoContext;
+ class RepeatContext;
}
-const String UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US);
-const String UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US);
-const String UNDO_ARG3("$3", RTL_TEXTENCODING_ASCII_US);
-
-typedef SwRedlineSaveData* SwRedlineSaveDataPtr;
-SV_DECL_PTRARR_DEL( SwRedlineSaveDatas, SwRedlineSaveDataPtr, 8, 8 )
-
class SwUndo
+ : public SfxUndoAction
{
- SwUndoId nId;
+ SwUndoId const m_nId;
USHORT nOrigRedlineMode;
protected:
@@ -135,8 +69,6 @@ protected:
void RemoveIdxFromRange( SwPaM& rPam, BOOL bMoveNext );
void RemoveIdxRel( ULONG, const SwPosition& );
- void SetId( SwUndoId nNew ) { nId = nNew; }
-
static BOOL CanRedlineGroup( SwRedlineSaveDatas& rCurr,
const SwRedlineSaveDatas& rCheck,
BOOL bCurrIsEnd );
@@ -148,16 +80,31 @@ protected:
@return the rewriter for this object
*/
virtual SwRewriter GetRewriter() const;
+
+ // return type is USHORT because this overrides SfxUndoAction::GetId()
+ virtual USHORT GetId() const { return static_cast<USHORT>(m_nId); }
+
+ // the 4 methods that derived classes have to override
+ // base implementation does nothing
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+ virtual bool CanRepeatImpl( ::sw::RepeatContext & ) const;
+public: // should not be public, but ran into trouble in untbl.cxx
+ virtual void UndoImpl( ::sw::UndoRedoContext & ) = 0;
+ virtual void RedoImpl( ::sw::UndoRedoContext & ) = 0;
+
+private:
+ // SfxUndoAction
+ virtual void Undo();
+ virtual void Redo();
+ virtual void UndoWithContext(SfxUndoContext &);
+ virtual void RedoWithContext(SfxUndoContext &);
+ virtual void Repeat(SfxRepeatTarget &);
+ virtual BOOL CanRepeat(SfxRepeatTarget &) const;
+
public:
- SwUndo( SwUndoId nI );
+ SwUndo(SwUndoId const nId);
virtual ~SwUndo();
- SwUndoId GetId() const { return nId; }
- virtual SwUndoId GetEffectiveId() const;
- virtual void Undo( SwUndoIter& ) = 0;
- virtual void Redo( SwUndoIter& ) = 0;
- virtual void Repeat( SwUndoIter& );
-
// #111827#
/**
Returns textual comment for this undo object.
@@ -279,487 +226,20 @@ public:
void SetValues( const SwPaM& rPam );
void SetPaM( SwPaM&, BOOL bCorrToCntnt = FALSE ) const;
- void SetPaM( SwUndoIter&, BOOL bCorrToCntnt = FALSE ) const;
+ SwPaM & AddUndoRedoPaM(
+ ::sw::UndoRedoContext &, bool const bCorrToCntnt = false) const;
};
-class SwUndoStart: public SwUndo
-{
- // Um innerhalb von Undo zuerkennen, wann ein Start vorliegt, gibt
- // GetId() immer die UNDO_START zurueck. Die UserId kann ueber
- // GetUserId() erfragt werden.
- SwUndoId nUserId;
- // fuer die "Verpointerung" von Start- und End-Undos
- USHORT nEndOffset;
-
- SwRewriter mRewriter;
-
-public:
- SwUndoStart( SwUndoId nId );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
- // -> #111827#
- virtual String GetComment() const;
- void SetRewriter(const SwRewriter & rRewriter);
- virtual SwRewriter GetRewriter() const;
- // <- #111827#
-
- virtual SwUndoId GetEffectiveId() const;
- SwUndoId GetUserId() const { return nUserId; }
- // Setzen vom End-Undo-Offset geschieht im Doc::EndUndo
- USHORT GetEndOffset() const { return nEndOffset; }
- void SetEndOffset( USHORT n ) { nEndOffset = n; }
-};
-
-class SwUndoEnd: public SwUndo
-{
- // Um innerhalb von Undo zuerkennen, wann ein Ende vorliegt, gibt
- // GetId() immer die UNDO_END zurueck. Die UserId kann ueber
- // GetUserId() erfragt werden.
- SwUndoId nUserId;
- // fuer die "Verpointerung" von Start- und End-Undos
- USHORT nSttOffset;
-
- SwRewriter mRewriter;
-
-public:
- SwUndoEnd( SwUndoId nId );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- // -> #111827#
- virtual String GetComment() const;
- void SetRewriter(const SwRewriter & rRewriter);
- virtual SwRewriter GetRewriter() const;
- // <- #111827#
-
- virtual SwUndoId GetEffectiveId() const;
- SwUndoId GetUserId() const { return nUserId; }
-
- // Setzen vom Start-Undo-Offset geschieht im Doc::EndUndo
- void SetSttOffset(USHORT _nSttOffSet) { nSttOffset = _nSttOffSet; }
- USHORT GetSttOffset() const { return nSttOffset; }
-};
-
-class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt
-{
- SwPosition *pPos; // Inhalt fuers Redo
- String *pTxt, *pUndoTxt;
- SwRedlineData* pRedlData;
- ULONG nNode;
- xub_StrLen nCntnt, nLen;
- BOOL bIsWordDelim : 1;
- BOOL bIsAppend : 1;
-
- const IDocumentContentOperations::InsertFlags m_nInsertFlags;
-
- friend class SwDoc; // eigentlich nur SwDoc::Insert( String )
- BOOL CanGrouping( sal_Unicode cIns );
- BOOL CanGrouping( const SwPosition& rPos );
-
- SwDoc * pDoc;
-
- void Init(const SwNodeIndex & rNode);
- String * GetTxtFromDoc() const;
-
-public:
- SwUndoInsert( const SwNodeIndex& rNode, xub_StrLen nCntnt, xub_StrLen nLen,
- const IDocumentContentOperations::InsertFlags nInsertFlags,
- BOOL bWDelim = TRUE );
- SwUndoInsert( const SwNodeIndex& rNode );
- virtual ~SwUndoInsert();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- // #111827#
- /**
- Returns rewriter for this undo object.
-
- The returned rewriter has the following rule:
-
- $1 -> '<inserted text>'
-
- <inserted text> is shortened to a length of nUndoStringLength.
-
- @return rewriter for this undo object
- */
- virtual SwRewriter GetRewriter() const;
-
-
- DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert)
-};
-
-
-class SwUndoDelete: public SwUndo, private SwUndRng, private SwUndoSaveCntnt
-{
- SwNodeIndex* pMvStt; // Position der Nodes im UndoNodes-Array
- String *pSttStr, *pEndStr;
- SwRedlineData* pRedlData;
- SwRedlineSaveDatas* pRedlSaveData;
- ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
- ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
-
- String sTableName;
-
- ULONG nNode;
- ULONG nNdDiff; // Differenz von Nodes vor-nach Delete
- ULONG nSectDiff; // Diff. von Nodes vor/nach Move mit SectionNodes
- ULONG nReplaceDummy; // Diff. to a temporary dummy object
- USHORT nSetPos;
-
- BOOL bGroup : 1; // TRUE: ist schon eine Gruppe; wird in CanGrouping() ausgwertet !!
- BOOL bBackSp : 1; // TRUE: wenn Gruppierung und der Inhalt davor geloescht wird
- BOOL bJoinNext: 1; // TRUE: wenn der Bereich von Oben nach unten geht
- BOOL bTblDelLastNd : 1; // TRUE: TextNode hinter der Tabelle einf./loeschen
- BOOL bDelFullPara : 1; // TRUE: gesamte Nodes wurden geloescht
- BOOL bResetPgDesc : 1; // TRUE: am nachfolgenden Node das PgDsc zuruecksetzen
- BOOL bResetPgBrk : 1; // TRUE: am nachfolgenden Node das PgBreak zuruecksetzen
- BOOL bFromTableCopy : 1; // TRUE: called by SwUndoTblCpyTbl
-
- BOOL SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
- SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd );
-public:
- SwUndoDelete( SwPaM&, BOOL bFullPara = FALSE, BOOL bCalledByTblCpy = FALSE );
- virtual ~SwUndoDelete();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- // #111827#
- /**
- Returns rewriter for this undo object.
-
- The rewriter consists of the following rule:
-
- $1 -> '<deleted text>'
-
- <deleted text> is shortened to nUndoStringLength characters.
-
- @return rewriter for this undo object
- */
- virtual SwRewriter GetRewriter() const;
-
- BOOL CanGrouping( SwDoc*, const SwPaM& );
-
- void SetTblDelLastNd() { bTblDelLastNd = TRUE; }
-
- // fuer die PageDesc/PageBreak Attribute einer Tabelle
- void SetPgBrkFlags( BOOL bPageBreak, BOOL bPageDesc )
- { bResetPgDesc = bPageDesc; bResetPgBrk = bPageBreak; }
-
- void SetTableName(const String & rName);
-
- // SwUndoTblCpyTbl needs this information:
- long NodeDiff() const { return nSttNode - nEndNode; }
- xub_StrLen ContentStart() const { return nSttCntnt; }
- BOOL IsDelFullPara() const { return bDelFullPara; }
-
- DECL_FIXEDMEMPOOL_NEWDEL(SwUndoDelete)
-};
-
-
-class SwUndoOverwrite: public SwUndo, private SwUndoSaveCntnt
-{
- String aDelStr, aInsStr;
- SwRedlineSaveDatas* pRedlSaveData;
- ULONG nSttNode;
- xub_StrLen nSttCntnt;
- BOOL bInsChar : 1; // kein Overwrite mehr; sondern Insert
- BOOL bGroup : 1; // TRUE: ist schon eine Gruppe; wird in
- // CanGrouping() ausgwertet !!
-public:
- SwUndoOverwrite( SwDoc*, SwPosition&, sal_Unicode cIns );
- virtual ~SwUndoOverwrite();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- // #111827#
- /**
- Returns the rewriter of this undo object.
-
- The rewriter contains the following rule:
-
- $1 -> '<overwritten text>'
-
- <overwritten text> is shortened to nUndoStringLength characters.
-
- @return the rewriter of this undo object
- */
- virtual SwRewriter GetRewriter() const;
-
- BOOL CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns );
-};
-
-
-class SwUndoSplitNode: public SwUndo
-{
- SwHistory* pHistory;
- SwRedlineData* pRedlData;
- ULONG nNode;
- xub_StrLen nCntnt;
- BOOL bTblFlag : 1;
- BOOL bChkTblStt : 1;
-public:
- SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, BOOL bChkTbl );
- virtual ~SwUndoSplitNode();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
- void SetTblFlag() { bTblFlag = TRUE; }
-};
-
-
-class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveCntnt
-{
- // nDest.. - Bereich, in den verschoben wurde (nach dem Move!)
- // nIns.. - Position, von der verschoben wurde und wieder die neue InsPos. ist
- // nMv.. Position auf die verschoben wird (vor dem Move!) ; fuers REDO
- ULONG nDestSttNode, nDestEndNode, nInsPosNode, nMvDestNode;
- xub_StrLen nDestSttCntnt, nDestEndCntnt, nInsPosCntnt, nMvDestCntnt;
-
- USHORT nFtnStt; // StartPos der Fussnoten in der History
-
- BOOL bJoinNext : 1,
- bJoinPrev : 1,
- bMoveRange : 1;
-
- bool bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
-
- void DelFtn( const SwPaM& );
-public:
- SwUndoMove( const SwPaM&, const SwPosition& );
- SwUndoMove( SwDoc* pDoc, const SwNodeRange&, const SwNodeIndex& );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- // setze den Destination-Bereich nach dem Verschieben.
- void SetDestRange( const SwPaM&, const SwPosition&, BOOL, BOOL );
- void SetDestRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
- const SwNodeIndex& rInsPos );
-
- BOOL IsMoveRange() const { return bMoveRange; }
- ULONG GetEndNode() const { return nEndNode; }
- ULONG GetDestSttNode() const { return nDestSttNode; }
- xub_StrLen GetDestSttCntnt() const { return nDestSttCntnt; }
-
- void SetMoveRedlines( bool b ) { bMoveRedlines = b; }
-
-};
-
-
-class SwUndoAttr : public SwUndo, private SwUndRng
-{
- SfxItemSet m_AttrSet; // attributes for Redo
- const ::std::auto_ptr<SwHistory> m_pHistory; // History for Undo
- ::std::auto_ptr<SwRedlineData> m_pRedlineData; // Redlining
- ::std::auto_ptr<SwRedlineSaveDatas> m_pRedlineSaveData;
- ULONG m_nNodeIndex; // Offset: for Redlining
- const SetAttrMode m_nInsertFlags; // insert flags
-
- void RemoveIdx( SwDoc& rDoc );
-
-public:
- SwUndoAttr( const SwPaM&, const SfxItemSet &, const SetAttrMode nFlags );
- SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags );
- virtual ~SwUndoAttr();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
- void SaveRedlineData( const SwPaM& rPam, BOOL bInsCntnt );
-
- SwHistory& GetHistory() { return *m_pHistory; }
-
-};
-
-class SwUndoResetAttr : public SwUndo, private SwUndRng
-{
- const ::std::auto_ptr<SwHistory> m_pHistory;
- SvUShortsSort m_Ids;
- const USHORT m_nFormatId; // Format-Id for Redo
-
-public:
- SwUndoResetAttr( const SwPaM&, USHORT nFmtId );
- SwUndoResetAttr( const SwPosition&, USHORT nFmtId );
- virtual ~SwUndoResetAttr();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
- void SetAttrs( const SvUShortsSort& rArr );
-
- SwHistory& GetHistory() { return *m_pHistory; }
-
-};
-
-class SwUndoFmtAttr : public SwUndo
-{
- friend class SwUndoDefaultAttr;
- SwFmt * m_pFmt;
- ::std::auto_ptr<SfxItemSet> m_pOldSet; // old attributes
- ULONG m_nNodeIndex;
- const USHORT m_nFmtWhich;
- const bool m_bSaveDrawPt;
-
- bool IsFmtInDoc( SwDoc* ); //is the attribute format still in the Doc?
- void SaveFlyAnchor( bool bSaveDrawPt = false );
- // --> OD 2004-10-26 #i35443# - Add return value, type <bool>.
- // Return value indicates, if anchor attribute is restored.
- // Notes: - If anchor attribute is restored, all other existing attributes
- // are also restored.
- // - Anchor attribute isn't restored successfully, if it contains
- // an invalid anchor position and all other existing attributes
- // aren't restored.
- // This situation occurs for undo of styles.
- bool RestoreFlyAnchor( SwUndoIter& rIter );
- // <--
- // --> OD 2008-02-27 #refactorlists# - removed <rAffectedItemSet>
- void Init();
- // <--
-
-public:
- // register at the Format and save old attributes
- // --> OD 2008-02-27 #refactorlists# - removed <rNewSet>
- SwUndoFmtAttr( const SfxItemSet& rOldSet,
- SwFmt& rFmt,
- bool bSaveDrawPt = true );
- // <--
- SwUndoFmtAttr( const SfxPoolItem& rItem,
- SwFmt& rFmt,
- bool bSaveDrawPt = true );
- virtual ~SwUndoFmtAttr();
- virtual void Undo( SwUndoIter& );
- // --> OD 2004-10-26 #i35443# - <Redo(..)> calls <Undo(..)> - nothing else
- virtual void Redo( SwUndoIter& );
- // <--
- virtual void Repeat( SwUndoIter& );
- virtual SwRewriter GetRewriter() const;
-
- void PutAttr( const SfxPoolItem& rItem );
- SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc!
-};
-
-// --> OD 2008-02-12 #newlistlevelattrs#
-class SwUndoFmtResetAttr : public SwUndo
-{
- public:
- SwUndoFmtResetAttr( SwFmt& rChangedFormat,
- const USHORT nWhichId );
- ~SwUndoFmtResetAttr();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- private:
- // format at which a certain attribute is reset.
- SwFmt * const m_pChangedFormat;
- // which ID of the reset attribute
- const USHORT m_nWhichId;
- // old attribute which has been reset - needed for undo.
- ::std::auto_ptr<SfxPoolItem> m_pOldItem;
-};
-// <--
-
-class SwUndoDontExpandFmt : public SwUndo
-{
- const ULONG m_nNodeIndex;
- const xub_StrLen m_nContentIndex;
+class SwUndoInsLayFmt;
-public:
- SwUndoDontExpandFmt( const SwPosition& rPos );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-};
-
-// helper class to receive changed attribute sets
-class SwUndoFmtAttrHelper : public SwClient
-{
- ::std::auto_ptr<SwUndoFmtAttr> m_pUndo;
- const bool m_bSaveDrawPt;
-
-public:
- SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true );
-
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
- SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); }
- // release the undo object (so it is not deleted here), and return it
- SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); }
-};
-
-
-class SwUndoFmtColl : public SwUndo, private SwUndRng
-{
- String aFmtName;
- SwHistory* pHistory;
- SwFmtColl* pFmtColl;
- // --> OD 2008-04-15 #refactorlists# - for correct <ReDo(..)> and <Repeat(..)>
- // boolean, which indicates that the attributes are reseted at the nodes
- // before the format has been applied.
- const bool mbReset;
- // boolean, which indicates that the list attributes had been reseted at
- // the nodes before the format has been applied.
- const bool mbResetListAttrs;
- // <--
-public:
- // --> OD 2008-04-15 #refactorlists#
-// SwUndoFmtColl( const SwPaM&, SwFmtColl* );
- SwUndoFmtColl( const SwPaM&, SwFmtColl*,
- const bool bReset,
- const bool bResetListAttrs );
- // <--
- virtual ~SwUndoFmtColl();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- // #111827#
- /**
- Returns the rewriter for this undo object.
-
- The rewriter contains one rule:
-
- $1 -> <name of format collection>
-
- <name of format collection> is the name of the format
- collection that is applied by the action recorded by this undo
- object.
-
- @return the rewriter for this undo object
- */
- virtual SwRewriter GetRewriter() const;
-
- SwHistory* GetHistory() { return pHistory; }
-
-};
-
-
-class SwUndoMoveLeftMargin : public SwUndo, private SwUndRng
-{
- const ::std::auto_ptr<SwHistory> m_pHistory;
- const bool m_bModulus;
-
-public:
- SwUndoMoveLeftMargin( const SwPaM&, BOOL bRight, BOOL bModulus );
- virtual ~SwUndoMoveLeftMargin();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- SwHistory& GetHistory() { return *m_pHistory; }
-
-};
-
-// Basis-Klasse fuer Insert von Dokument, Glossaries und Kopieren
+// base class for insertion of Document, Glossaries and Copy
class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveCntnt
{
SwTxtFmtColl *pTxtFmtColl, *pLastNdColl;
SvPtrarr* pFrmFmts;
- SwUndos* pFlyUndos;
+ ::std::vector< ::boost::shared_ptr<SwUndoInsLayFmt> > m_FlyUndos;
SwRedlineData* pRedlData;
BOOL bSttWasTxtNd;
protected:
@@ -771,9 +251,10 @@ protected:
public:
virtual ~SwUndoInserts();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
// setze den Destination-Bereich nach dem Einlesen.
void SetInsertRange( const SwPaM&, BOOL bScanFlys = TRUE,
BOOL bSttWasTxtNd = TRUE );
@@ -791,384 +272,6 @@ public:
SwUndoCpyDoc( const SwPaM& );
};
-class SwUndoInsTbl : public SwUndo
-{
- String sTblNm;
- SwInsertTableOptions aInsTblOpts;
- SwDDEFieldType* pDDEFldType;
- SvUShorts* pColWidth;
- SwRedlineData* pRedlData;
- SwTableAutoFmt* pAutoFmt;
- ULONG nSttNode;
- USHORT nRows, nCols;
- USHORT nAdjust;
-
-public:
- SwUndoInsTbl( const SwPosition&, USHORT nCols, USHORT nRows,
- USHORT eAdjust, const SwInsertTableOptions& rInsTblOpts,
- const SwTableAutoFmt* pTAFmt, const SvUShorts* pColArr,
- const String & rName);
- virtual ~SwUndoInsTbl();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- virtual SwRewriter GetRewriter() const;
-
-};
-
-class SwUndoTxtToTbl : public SwUndo, public SwUndRng
-{
- String sTblNm;
- SwInsertTableOptions aInsTblOpts;
- SvULongs* pDelBoxes;
- SwTableAutoFmt* pAutoFmt;
- SwHistory* pHistory;
- sal_Unicode cTrenner;
- USHORT nAdjust;
- BOOL bSplitEnd : 1;
-
-public:
- SwUndoTxtToTbl( const SwPaM&, const SwInsertTableOptions&, sal_Unicode , USHORT,
- const SwTableAutoFmt* pAFmt );
- virtual ~SwUndoTxtToTbl();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- SwHistory& GetHistory(); // wird ggfs. angelegt
- void AddFillBox( const SwTableBox& rBox );
-};
-
-class SwUndoTblToTxt : public SwUndo
-{
- String sTblNm;
- SwDDEFieldType* pDDEFldType;
- _SaveTable* pTblSave;
- SwTblToTxtSaves* pBoxSaves;
- SwHistory* pHistory;
- ULONG nSttNd, nEndNd;
- USHORT nAdjust;
- sal_Unicode cTrenner;
- USHORT nHdlnRpt;
- BOOL bCheckNumFmt : 1;
-
-public:
- SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh );
- virtual ~SwUndoTblToTxt();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- void SetRange( const SwNodeRange& );
- void AddBoxPos( SwDoc& rDoc, ULONG nNdIdx, ULONG nEndIdx,
- xub_StrLen nCntntIdx = STRING_MAXLEN);
-};
-
-class SwUndoAttrTbl : public SwUndo
-{
- ULONG nSttNode;
- _SaveTable* pSaveTbl;
- BOOL bClearTabCol : 1;
-public:
- SwUndoAttrTbl( const SwTableNode& rTblNd, BOOL bClearTabCols = FALSE );
- virtual ~SwUndoAttrTbl();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
-class SwUndoTblAutoFmt : public SwUndo
-{
- ULONG nSttNode;
- _SaveTable* pSaveTbl;
- SwUndos* pUndos;
- BOOL bSaveCntntAttr;
-
- void UndoRedo( BOOL bUndo, SwUndoIter& rUndoIter );
-
-public:
- SwUndoTblAutoFmt( const SwTableNode& rTblNd, const SwTableAutoFmt& );
- virtual ~SwUndoTblAutoFmt();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- void SaveBoxCntnt( const SwTableBox& rBox );
-};
-
-class SwUndoTblNdsChg : public SwUndo
-{
- _SaveTable* pSaveTbl;
- SvULongs aBoxes;
-
- union {
- SvULongs* pNewSttNds;
- SwUndoSaveSections* pDelSects;
- } Ptrs;
- SvBools aMvBoxes; // fuers SplitRow (aufgeteilte Nodes einer Box)
- long nMin, nMax; // for redo of delete column
- ULONG nSttNode, nCurrBox;
- USHORT nCount, nRelDiff, nAbsDiff, nSetColType;
- BOOL bFlag;
- BOOL bSameHeight; // only used for SplitRow
-public:
- SwUndoTblNdsChg( SwUndoId UndoId,
- const SwSelBoxes& rBoxes,
- const SwTableNode& rTblNd,
- long nMn, long nMx,
- USHORT nCnt, BOOL bFlg, BOOL bSameHeight );
-
- // fuer SetColWidth
- SwUndoTblNdsChg( SwUndoId UndoId, const SwSelBoxes& rBoxes,
- const SwTableNode& rTblNd );
-
- virtual ~SwUndoTblNdsChg();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld );
- void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld,
- const SwSelBoxes& rBoxes, const SvULongs& rNodeCnts );
- void SaveSection( SwStartNode* pSttNd );
- void ReNewBoxes( const SwSelBoxes& rBoxes );
-
-
- void SetColWidthParam( ULONG nBoxIdx, USHORT nMode, USHORT nType,
- SwTwips nAbsDif, SwTwips nRelDif )
- {
- nCurrBox = nBoxIdx;
- nCount = nMode;
- nSetColType = nType;
- nAbsDiff = (USHORT)nAbsDif;
- nRelDiff = (USHORT)nRelDif;
- }
-
-};
-
-class SwUndoTblMerge : public SwUndo, private SwUndRng
-{
- ULONG nTblNode;
- _SaveTable* pSaveTbl;
- SvULongs aBoxes, aNewSttNds;
- SwUndoMoves* pMoves;
- SwHistory* pHistory;
-
-public:
- SwUndoTblMerge( const SwPaM& rTblSel );
- virtual ~SwUndoTblMerge();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos );
-
- void SetSelBoxes( const SwSelBoxes& rBoxes );
-
- void AddNewBox( ULONG nSttNdIdx )
- { aNewSttNds.Insert( nSttNdIdx, aNewSttNds.Count() ); }
-
- void SaveCollection( const SwTableBox& rBox );
-
-};
-
-
-class SwUndoTblNumFmt : public SwUndo
-{
- SfxItemSet *pBoxSet;
- SwHistory* pHistory;
- String aStr, aNewFml;
-
- ULONG nFmtIdx, nNewFmtIdx;
- double fNum, fNewNum;
- ULONG nNode;
- ULONG nNdPos;
-
- BOOL bNewFmt : 1;
- BOOL bNewFml : 1;
- BOOL bNewValue : 1;
-
-public:
- SwUndoTblNumFmt( const SwTableBox& rBox, const SfxItemSet* pNewSet = 0 );
- virtual ~SwUndoTblNumFmt();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void SetNumFmt( ULONG nNewNumFmtIdx, const double& rNewNumber )
- { nFmtIdx = nNewNumFmtIdx; fNum = rNewNumber; }
- void SetBox( const SwTableBox& rBox );
-};
-
-class _UndoTblCpyTbl_Entries;
-
-class SwUndoTblCpyTbl : public SwUndo
-{
- _UndoTblCpyTbl_Entries* pArr;
- SwUndoTblNdsChg* pInsRowUndo;
-
- //b6341295: When redlining is active, PrepareRedline has to create the redlining attributes
- //for the new and the old table cell content
- SwUndo* PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, const SwPosition& rPos,
- bool& rJoin, bool bRedo );
-public:
- SwUndoTblCpyTbl();
- virtual ~SwUndoTblCpyTbl();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void AddBoxBefore( const SwTableBox& rBox, BOOL bDelCntnt );
- void AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx, BOOL bDelCntnt );
-
- BOOL IsEmpty() const;
- BOOL InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes, USHORT nCnt );
-};
-
-class SwUndoCpyTbl : public SwUndo
-{
- SwUndoDelete* pDel;
- ULONG nTblNode;
-public:
- SwUndoCpyTbl();
- virtual ~SwUndoCpyTbl();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void SetTableSttIdx( ULONG nIdx ) { nTblNode = nIdx; }
-};
-
-class SwUndoSplitTbl : public SwUndo
-{
- ULONG nTblNode, nOffset;
- SwSaveRowSpan* mpSaveRowSpan; // stores the row span values at the splitting row
- _SaveTable* pSavTbl;
- SwHistory* pHistory;
- USHORT nMode, nFmlEnd;
- BOOL bCalcNewSize;
-public:
- SwUndoSplitTbl( const SwTableNode& rTblNd, SwSaveRowSpan* pRowSp, USHORT nMode, BOOL bCalcNewSize );
- virtual ~SwUndoSplitTbl();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- void SetTblNodeOffset( ULONG nIdx ) { nOffset = nIdx - nTblNode; }
- SwHistory* GetHistory() { return pHistory; }
- void SaveFormula( SwHistory& rHistory );
-};
-
-class SwUndoMergeTbl : public SwUndo
-{
- String aName;
- ULONG nTblNode;
- _SaveTable* pSavTbl, *pSavHdl;
- SwHistory* pHistory;
- USHORT nMode;
- BOOL bWithPrev;
-public:
- SwUndoMergeTbl( const SwTableNode& rTblNd, const SwTableNode& rDelTblNd,
- BOOL bWithPrev, USHORT nMode );
- virtual ~SwUndoMergeTbl();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- void SaveFormula( SwHistory& rHistory );
-};
-
-
-class SwUndoBookmark : public SwUndo
-{
- const ::std::auto_ptr<SwHistoryBookmark> m_pHistoryBookmark;
-
-protected:
- SwUndoBookmark( SwUndoId nUndoId, const ::sw::mark::IMark& );
-
- void SetInDoc( SwDoc* );
- void ResetInDoc( SwDoc* );
-
-public:
- virtual ~SwUndoBookmark();
-
- // #111827#
- /**
- Returns the rewriter for this undo object.
-
- The rewriter contains the following rule:
-
- $1 -> <name of bookmark>
-
- <name of bookmark> is the name of the bookmark whose
- insertion/deletion is recorded by this undo object.
-
- @return the rewriter for this undo object
- */
- virtual SwRewriter GetRewriter() const;
-};
-
-
-class SwUndoInsBookmark : public SwUndoBookmark
-{
-public:
- SwUndoInsBookmark( const ::sw::mark::IMark& );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
-
-/*--------------------------------------------------------------------
- Beschreibung: Undo auf Sorting
- --------------------------------------------------------------------*/
-
-struct SwSortUndoElement
-{
- union {
- struct {
- ULONG nKenn;
- ULONG nSource, nTarget;
- } TXT;
- struct {
- String *pSource, *pTarget;
- } TBL;
- } SORT_TXT_TBL;
-
- SwSortUndoElement( const String& aS, const String& aT )
- {
- SORT_TXT_TBL.TBL.pSource = new String( aS );
- SORT_TXT_TBL.TBL.pTarget = new String( aT );
- }
- SwSortUndoElement( ULONG nS, ULONG nT )
- {
- SORT_TXT_TBL.TXT.nSource = nS;
- SORT_TXT_TBL.TXT.nTarget = nT;
- SORT_TXT_TBL.TXT.nKenn = 0xffffffff;
- }
- ~SwSortUndoElement();
-};
-
-SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10,30)
-SV_DECL_PTRARR(SwUndoSortList, SwNodeIndex*, 10,30)
-
-class SwUndoSort : public SwUndo, private SwUndRng
-{
- SwSortOptions* pSortOpt; // die Optionen mit den Sortier-Kriterien
- SwSortList aSortList;
- SwUndoAttrTbl* pUndoTblAttr;
- SwRedlineData* pRedlData;
- ULONG nTblNd;
-
- void RemoveIdx( SwPaM& rPam );
-public:
- SwUndoSort( const SwPaM&, const SwSortOptions& );
- SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode&,
- const SwSortOptions&, BOOL bSaveTable );
- virtual ~SwUndoSort();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- void Insert( const String& rOrgPos, const String& rNewPos );
- void Insert( ULONG nOrgPos, ULONG nNewPos );
-
-};
-
//--------------------------------------------------------------------
@@ -1182,7 +285,7 @@ protected:
USHORT nRndId;
BOOL bDelFmt; // loesche das gespeicherte Format
- void InsFly( SwUndoIter&, BOOL bShowSel = TRUE );
+ void InsFly(::sw::UndoRedoContext & rContext, bool bShowSel = true);
void DelFly( SwDoc* );
SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId );
@@ -1193,9 +296,6 @@ protected:
public:
virtual ~SwUndoFlyBase();
- virtual void Undo( SwUndoIter& ) = 0;
- virtual void Redo( SwUndoIter& ) = 0;
-
};
class SwUndoInsLayFmt : public SwUndoFlyBase
@@ -1204,11 +304,12 @@ class SwUndoInsLayFmt : public SwUndoFlyBase
xub_StrLen mnCrsrSaveIndexPos; // for undo
public:
SwUndoInsLayFmt( SwFrmFmt* pFormat, ULONG nNodeIdx, xub_StrLen nCntIdx );
- ~SwUndoInsLayFmt();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
+ virtual ~SwUndoInsLayFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
String GetComment() const;
@@ -1220,700 +321,15 @@ class SwUndoDelLayFmt : public SwUndoFlyBase
public:
SwUndoDelLayFmt( SwFrmFmt* pFormat );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- void Redo(); // Schnittstelle fuers Rollback
-
- void ChgShowSel( BOOL bNew ) { bShowSelFrm = bNew; }
-
- virtual SwRewriter GetRewriter() const;
-
-};
-
-
-class SwUndoSetFlyFmt : public SwUndo, public SwClient
-{
- SwFrmFmt* pFrmFmt; // das gespeicherte FlyFormat
- SwFrmFmt* pOldFmt; // die alte Fly Vorlage
- SwFrmFmt* pNewFmt; // die neue Fly Vorlage
- SfxItemSet* pItemSet; // die zurueck-/ gesetzten Attribute
- ULONG nOldNode, nNewNode;
- xub_StrLen nOldCntnt, nNewCntnt;
- USHORT nOldAnchorTyp, nNewAnchorTyp;
- BOOL bAnchorChgd;
-
- void PutAttr( USHORT nWhich, const SfxPoolItem* pItem );
- void Modify( SfxPoolItem*, SfxPoolItem* );
- void GetAnchor( SwFmtAnchor& rAnhor, ULONG nNode, xub_StrLen nCntnt );
-
-public:
- SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt );
- virtual ~SwUndoSetFlyFmt();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- virtual SwRewriter GetRewriter() const;
-};
-
-//--------------------------------------------------------------------
-
-class _UnReplaceData;
-SV_DECL_PTRARR_DEL( _UnReplaceDatas, _UnReplaceData*, 10, 25 )
-
-class SwUndoReplace : public SwUndo
-{
- friend class SwDoc;
-
- BOOL bOldIterFlag; // Status vom Undo-Iter vorm 1. Aufruf
- USHORT nAktPos; // fuer GetUndoRange und Undo/Redo
- _UnReplaceDatas aArr;
- SwRedlineData* pRedlData;
-
-public:
- SwUndoReplace();
- virtual ~SwUndoReplace();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- // #111827#
- /**
- Returns the rewriter of this undo object.
-
- If this undo object represents several replacements the
- rewriter contains the following rules:
-
- $1 -> <number of replacements>
- $2 -> occurrences of
- $3 -> <replaced text>
-
- If this undo object represents one replacement the rewriter
- contains these rules:
-
- $1 -> <replaced text>
- $2 -> "->" (STR_YIELDS)
- $3 -> <replacing text>
-
- @return the rewriter of this undo object
- */
- virtual SwRewriter GetRewriter() const;
-
- void AddEntry( const SwPaM& rPam, const String& rInsert, BOOL bRegExp );
- void SetEntryEnd( const SwPaM& rPam );
-
- BOOL IsFull() const
- { return ((USHRT_MAX / sizeof( void* )) - 50 ) < aArr.Count(); }
-
-};
-
-
-//--------------------------------------------------------------------
-
-
-class SwUndoTblHeadline : public SwUndo
-{
- ULONG nTblNd;
- USHORT nOldHeadline;
- USHORT nNewHeadline;
-public:
- SwUndoTblHeadline( const SwTable&, USHORT nOldHdl, USHORT nNewHdl );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-};
-
-
-//------------ Undo von Insert-/Delete-Sections ----------------------
-
-class SwUndoInsSection : public SwUndo, private SwUndRng
-{
-private:
- const ::std::auto_ptr<SwSectionData> m_pSectionData;
- const ::std::auto_ptr<SwTOXBase> m_pTOXBase; /// set iff section is TOX
- const ::std::auto_ptr<SfxItemSet> m_pAttrSet;
- ::std::auto_ptr<SwHistory> m_pHistory;
- ::std::auto_ptr<SwRedlineData> m_pRedlData;
- ULONG m_nSectionNodePos;
- bool m_bSplitAtStart : 1;
- bool m_bSplitAtEnd : 1;
- bool m_bUpdateFtn : 1;
-
- void Join( SwDoc& rDoc, ULONG nNode );
-
-public:
- SwUndoInsSection(SwPaM const&, SwSectionData const&,
- SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase);
- virtual ~SwUndoInsSection();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- void SetSectNdPos(ULONG const nPos) { m_nSectionNodePos = nPos; }
- void SaveSplitNode(SwTxtNode *const pTxtNd, bool const bAtStart);
- void SetUpdtFtnFlag(bool const bFlag) { m_bUpdateFtn = bFlag; }
-};
-
-SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const&);
-
-SW_DLLPRIVATE SwUndo * MakeUndoUpdateSection(SwSectionFmt const&, bool const);
-
-
-//------------ Undo von verschieben/stufen von Gliederung ----------------
-
-class SwUndoOutlineLeftRight : public SwUndo, private SwUndRng
-{
- short nOffset;
-public:
- SwUndoOutlineLeftRight( const SwPaM& rPam, short nOffset );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-};
-
-//--------------------------------------------------------------------
-
-class SwUndoDefaultAttr : public SwUndo
-{
- ::std::auto_ptr<SfxItemSet> m_pOldSet; // the old attributes
- ::std::auto_ptr<SvxTabStopItem> m_pTabStop;
-
-public:
- // registers at the format and saves old attributes
- SwUndoDefaultAttr( const SfxItemSet& rOldSet );
- virtual ~SwUndoDefaultAttr();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
-//--------------------------------------------------------------------
-// ---------- Undo fuer Numerierung ----------------------------------
-
-class SwUndoInsNum : public SwUndo, private SwUndRng
-{
- SwNumRule aNumRule;
- SwHistory* pHistory;
- ULONG nSttSet;
- SwNumRule* pOldNumRule;
- String sReplaceRule;
- USHORT nLRSavePos;
-public:
- SwUndoInsNum( const SwPaM& rPam, const SwNumRule& rRule );
- SwUndoInsNum( const SwNumRule& rOldRule, const SwNumRule& rNewRule,
- SwUndoId nUndoId = UNDO_INSFMTATTR );
- SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule,
- const String& rReplaceRule );
- virtual ~SwUndoInsNum();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
- virtual SwRewriter GetRewriter() const;
-
- SwHistory* GetHistory(); // wird ggfs. neu angelegt!
- void SetSttNum( ULONG nNdIdx ) { nSttSet = nNdIdx; }
- void SaveOldNumRule( const SwNumRule& rOld );
-
- void SetLRSpaceEndPos();
-
-};
-
-class SwUndoDelNum : public SwUndo, private SwUndRng
-{
- SvULongs aNodeIdx;
- SvBytes aLevels;
- SvBools aRstLRSpaces;
- SwHistory* pHistory;
-public:
- SwUndoDelNum( const SwPaM& rPam );
- virtual ~SwUndoDelNum();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- void AddNode( const SwTxtNode& rNd, BOOL bResetLRSpace );
- SwHistory* GetHistory() { return pHistory; }
-
-};
-
-class SwUndoMoveNum : public SwUndo, private SwUndRng
-{
- ULONG nNewStt;
- long nOffset;
-public:
- SwUndoMoveNum( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv = FALSE );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
- void SetStartNode( ULONG nValue ) { nNewStt = nValue; }
-};
-
-class SwUndoNumUpDown : public SwUndo, private SwUndRng
-{
- short nOffset;
-public:
- SwUndoNumUpDown( const SwPaM& rPam, short nOffset );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-};
-
-class SwUndoNumOrNoNum : public SwUndo
-{
- ULONG nIdx;
- BOOL mbNewNum, mbOldNum;
-
-public:
- SwUndoNumOrNoNum( const SwNodeIndex& rIdx, BOOL mbOldNum,
- BOOL mbNewNum );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-};
-
-class SwUndoNumRuleStart : public SwUndo
-{
- ULONG nIdx;
- USHORT nOldStt, nNewStt;
- BOOL bSetSttValue : 1;
- BOOL bFlag : 1;
-public:
- SwUndoNumRuleStart( const SwPosition& rPos, BOOL bDelete );
- SwUndoNumRuleStart( const SwPosition& rPos, USHORT nStt );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-};
-
-//--------------------------------------------------------------------
-// ---------- Undo fuer DrawObjecte ----------------------------------
-
-class SwSdrUndo : public SwUndo
-{
- SdrUndoAction* pSdrUndo;
- SdrMarkList* pMarkList; // MarkList for all selected SdrObjects
-public:
- SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList );
- virtual ~SwSdrUndo();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- String GetComment() const;
-};
-
-class SwUndoDrawGroup : public SwUndo
-{
- SwUndoGroupObjImpl* pObjArr;
- USHORT nSize;
- BOOL bDelFmt;
-
-public:
- SwUndoDrawGroup( USHORT nCnt );
- virtual ~SwUndoDrawGroup();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void AddObj( USHORT nPos, SwDrawFrmFmt*, SdrObject* );
- void SetGroupFmt( SwDrawFrmFmt* );
-};
-
-// --> OD 2006-11-01 #130889#
-// Action "ungroup drawing object" is now splitted into three parts - see
-// method <SwDoc::UnGroupSelection(..)>:
-// - creation for <SwDrawFrmFmt> instances for the group members of the
-// selected group objects
-// - intrinsic ungroup of the selected group objects
-// - creation of <SwDrawContact> instances for the former group members and
-// connection to the Writer layout.
-// Thus, two undo actions (instances of <SwUndo>) are needed:
-// - Existing class <SwUndoDrawUnGroup> takes over the part for the formats.
-// - New class <SwUndoDrawUnGroupConnectToLayout> takes over the part for
-// contact object.
-class SwUndoDrawUnGroup : public SwUndo
-{
- SwUndoGroupObjImpl* pObjArr;
- USHORT nSize;
- BOOL bDelFmt;
-
-public:
- SwUndoDrawUnGroup( SdrObjGroup* );
- virtual ~SwUndoDrawUnGroup();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void AddObj( USHORT nPos, SwDrawFrmFmt* );
-};
-
-// --> OD 2006-11-01 #130889#
-class SwUndoDrawUnGroupConnectToLayout : public SwUndo
-{
- private:
- std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > > aDrawFmtsAndObjs;
-
- public:
- SwUndoDrawUnGroupConnectToLayout();
- virtual ~SwUndoDrawUnGroupConnectToLayout();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
- SdrObject* pDrawObject );
-};
-// <--
-
-
-class SwUndoDrawDelete : public SwUndo
-{
- SwUndoGroupObjImpl* pObjArr;
- SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects
- USHORT nSize;
- BOOL bDelFmt;
-
-public:
- SwUndoDrawDelete( USHORT nCnt );
- virtual ~SwUndoDrawDelete();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- void AddObj( USHORT nPos, SwDrawFrmFmt*, const SdrMark& );
-};
-
-//--------------------------------------------------------------------
-
-class SwUndoReRead : public SwUndo
-{
- Graphic *pGrf;
- String *pNm, *pFltr;
- ULONG nPos;
- USHORT nMirr;
-
- void SaveGraphicData( const SwGrfNode& );
- void SetAndSave( SwUndoIter& );
-
-public:
- SwUndoReRead( const SwPaM& rPam, const SwGrfNode& pGrfNd );
- virtual ~SwUndoReRead();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
-//--------------------------------------------------------------------
-
-class SwUndoInsertLabel : public SwUndo
-{
- union {
- struct {
- // fuer NoTxtFrms
- SwUndoInsLayFmt* pUndoFly;
- SwUndoFmtAttr* pUndoAttr;
- } OBJECT;
- struct {
- // fuer Tabelle/TextRahmen
- SwUndoDelete* pUndoInsNd;
- ULONG nNode;
- } NODE;
- };
-
- String sText;
- // --> PB 2005-01-06 #i39983# - the separator will be drawed with a character style
- String sSeparator;
- // <--
- String sNumberSeparator;
- String sCharacterStyle;
- // OD 2004-04-15 #i26791# - re-store of drawing object position no longer needed
- USHORT nFldId;
- SwLabelType eType;
- BYTE nLayerId; // fuer Zeichen-Objekte
- BOOL bBefore :1;
- BOOL bUndoKeep :1;
- BOOL bCpyBrd :1;
-
-public:
- SwUndoInsertLabel( const SwLabelType eTyp, const String &rText,
- // --> PB 2005-01-06 #i39983# - the separator will be drawed with a character style
- const String& rSeparator,
- // <--
- const String& rNumberSeparator, //#i61007# order of captions
- const BOOL bBefore, const USHORT nId,
- const String& rCharacterStyle,
- const BOOL bCpyBrd );
- virtual ~SwUndoInsertLabel();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
- // #111827#
- /**
- Returns the rewriter of this undo object.
-
- The rewriter contains this rule:
+ void RedoForRollback();
- $1 -> '<text of inserted label>'
-
- <text of inserted label> is shortened to nUndoStringLength
- characters.
+ void ChgShowSel( BOOL bNew ) { bShowSelFrm = bNew; }
- @return the rewriter of this undo object
- */
virtual SwRewriter GetRewriter() const;
- void SetNodePos( ULONG nNd )
- { if( LTYPE_OBJECT != eType ) NODE.nNode = nNd; }
-
- void SetUndoKeep() { bUndoKeep = TRUE; }
- void SetFlys( SwFrmFmt& rOldFly, SfxItemSet& rChgSet, SwFrmFmt& rNewFly );
- void SetDrawObj( BYTE nLayerId );
-};
-
-//--------------------------------------------------------------------
-
-class SwUndoChangeFootNote : public SwUndo, private SwUndRng
-{
- const ::std::auto_ptr<SwHistory> m_pHistory;
- const String m_Text;
- const USHORT m_nNumber;
- const bool m_bEndNote;
-
-public:
- SwUndoChangeFootNote( const SwPaM& rRange, const String& rTxt,
- USHORT nNum, bool bIsEndNote );
- virtual ~SwUndoChangeFootNote();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- virtual void Repeat( SwUndoIter& );
-
- SwHistory& GetHistory() { return *m_pHistory; }
-};
-
-class SwUndoFootNoteInfo : public SwUndo
-{
- ::std::auto_ptr<SwFtnInfo> m_pFootNoteInfo;
-
-public:
- SwUndoFootNoteInfo( const SwFtnInfo &rInfo );
- virtual ~SwUndoFootNoteInfo();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
-class SwUndoEndNoteInfo : public SwUndo
-{
- ::std::auto_ptr<SwEndNoteInfo> m_pEndNoteInfo;
-
-public:
- SwUndoEndNoteInfo( const SwEndNoteInfo &rInfo );
- virtual ~SwUndoEndNoteInfo();
-
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
-
-//--------------------------------------------------------------------
-
-struct _UndoTransliterate_Data;
-class SwUndoTransliterate : public SwUndo, public SwUndRng
-{
- std::vector< _UndoTransliterate_Data * > aChanges;
- sal_uInt32 nType;
-
-public:
- SwUndoTransliterate( const SwPaM& rPam,
- const utl::TransliterationWrapper& rTrans );
- virtual ~SwUndoTransliterate();
-
- virtual void Undo( SwUndoIter& rUndoIter );
- virtual void Redo( SwUndoIter& rUndoIter );
- virtual void Repeat( SwUndoIter& rUndoIter );
-
- void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen,
- ::com::sun::star::uno::Sequence <sal_Int32>& rOffsets );
- BOOL HasData() const { return aChanges.size() > 0; }
-};
-
-//--------------------------------------------------------------------
-
-class SwUndoRedline : public SwUndo, public SwUndRng
-{
-protected:
- SwRedlineData* pRedlData;
- SwRedlineSaveDatas* pRedlSaveData;
- SwUndoId nUserId;
- BOOL bHiddenRedlines;
-
- virtual void _Undo( SwUndoIter& );
- virtual void _Redo( SwUndoIter& );
-
-public:
- SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange );
- virtual ~SwUndoRedline();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-
- SwUndoId GetUserId() const { return nUserId; }
- USHORT GetRedlSaveCount() const
- { return pRedlSaveData ? pRedlSaveData->Count() : 0; }
-};
-
-class SwUndoRedlineDelete : public SwUndoRedline
-{
- BOOL bCanGroup : 1;
- BOOL bIsDelim : 1;
- BOOL bIsBackspace : 1;
-
- virtual void _Undo( SwUndoIter& );
- virtual void _Redo( SwUndoIter& );
-
-public:
- SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId = UNDO_EMPTY );
-
- BOOL CanGrouping( const SwUndoRedlineDelete& rPrev );
-};
-
-class SwUndoRedlineSort : public SwUndoRedline
-{
- SwSortOptions* pOpt;
- ULONG nSaveEndNode, nOffset;
- xub_StrLen nSaveEndCntnt;
-
- virtual void _Undo( SwUndoIter& );
- virtual void _Redo( SwUndoIter& );
-
-public:
- SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt );
- virtual ~SwUndoRedlineSort();
- virtual void Repeat( SwUndoIter& );
-
- void SetSaveRange( const SwPaM& rRange );
- void SetOffset( const SwNodeIndex& rIdx );
-};
-
-class SwUndoAcceptRedline : public SwUndoRedline
-{
- virtual void _Redo( SwUndoIter& );
-public:
- SwUndoAcceptRedline( const SwPaM& rRange );
- virtual void Repeat( SwUndoIter& );
-};
-
-class SwUndoRejectRedline : public SwUndoRedline
-{
- virtual void _Redo( SwUndoIter& );
-public:
- SwUndoRejectRedline( const SwPaM& rRange );
- virtual void Repeat( SwUndoIter& );
-};
-
-//--------------------------------------------------------------------
-
-class SwUndoCompDoc : public SwUndo, public SwUndRng
-{
- SwRedlineData* pRedlData;
- SwUndoDelete* pUnDel, *pUnDel2;
- SwRedlineSaveDatas* pRedlSaveData;
- BOOL bInsert;
-public:
- SwUndoCompDoc( const SwPaM& rRg, BOOL bIns );
- SwUndoCompDoc( const SwRedline& rRedl );
-
- virtual ~SwUndoCompDoc();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
-
-//--------------------------------------------------------------------
-
-// Object der als Iterator durch die Undo-Liste laeuft, bis die
-// letze oder die angegebene Klammerung/Id erreicht ist.
-
-class SwUndoIter
-{
- friend class SwDoc; // um im SwDoc::Undo bWeiter zu stezen
- friend void SwUndoEnd::Undo( SwUndoIter& );
- friend void SwUndoStart::Undo( SwUndoIter& );
- friend void SwUndoEnd::Redo( SwUndoIter& );
- friend void SwUndoStart::Redo( SwUndoIter& );
- friend void SwUndoEnd::Repeat( SwUndoIter& );
- friend void SwUndoStart::Repeat( SwUndoIter& );
- friend void SwUndoReplace::Undo( SwUndoIter& );
- friend void SwUndoReplace::Redo( SwUndoIter& );
-
- SwUndoId nUndoId;
- USHORT nEndCnt;
- BOOL bWeiter : 1;
- BOOL bUpdateAttr : 1; // Setze das GCAttr an der CursorShell
-
-public:
- SwPaM * pAktPam; // Member fuer das Undo
- SwUndo* pLastUndoObj; // fuers Redo, das vorherige UndoObj.
- SwFrmFmt* pSelFmt; // ggfs. das Format Rahmen/Object-Selektionen
- SdrMarkList* pMarkList; // MarkList for all selected SdrObjects
-
- SwUndoIter( SwPaM * pPam, SwUndoId nId = UNDO_EMPTY );
-
- BOOL IsNextUndo() const { return bWeiter; }
- BOOL IsUpdateAttr() const { return bUpdateAttr; }
- void SetUpdateAttr( BOOL bNew ) { bUpdateAttr = bNew; }
-
- inline SwDoc& GetDoc() const;
- SwUndoId GetId() const { return nUndoId; }
- SwUndoId GetLastUndoId() const
- { return pLastUndoObj ? pLastUndoObj->GetId() : UNDO_EMPTY ; }
- void ClearSelections() { pSelFmt = 0; pMarkList = 0; }
};
-
-// -> #111827#
-const int nUndoStringLength = 20;
-
-/**
- Shortens a string to a maximum length.
-
- @param rStr the string to be shortened
- @param nLength the maximum length for rStr
- @param rFillStr string to replace cut out characters with
-
- If rStr has less than nLength characters it will be returned unaltered.
-
- If rStr has more than nLength characters the following algorithm
- generates the shortened string:
-
- frontLength = (nLength - length(rFillStr)) / 2
- rearLength = nLength - length(rFillStr) - frontLength
- shortenedString = concat(<first frontLength characters of rStr,
- rFillStr,
- <last rearLength characters of rStr>)
-
- Preconditions:
- - nLength - length(rFillStr) >= 2
-
- @return the shortened string
- */
-String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr);
-// <- #111827#
-
-// #16487#
-/**
- Denotes special characters in a string.
-
- The rStr is split into parts containing special characters and
- parts not containing special characters. In a part containing
- special characters all characters are equal. These parts are
- maximal.
-
- @param rStr the string to denote in
-
- The resulting string is generated by concatenating the found
- parts. The parts without special characters are surrounded by
- "'". The parts containing special characters are denoted as "n x",
- where n is the length of the part and x is the representation of
- the special character (i. e. "tab(s)").
-
- @return the denoted string
-*/
-String DenoteSpecialCharacters(const String & rStr);
-
#endif
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 0ea5fa9db598..a12f911efce0 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -806,7 +806,8 @@ enum SwPropNameIds
// <--
/* 0738 */ UNO_NAME_META, // #i91565#
/* 0739 */ UNO_NAME_NESTED_TEXT_CONTENT, // #i109601#
-/* 0740 */ SW_PROPNAME_END
+/* 0740 */ UNO_NAME_EMBEDDED_OBJECT,
+/* 0741 */ SW_PROPNAME_END
};
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 480876904d59..8e3299dd227c 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -335,7 +335,8 @@ public:
/** Provides access to the document undo/redo interface
*/
- IDocumentUndoRedo* getIDocumentUndoRedoAccess();
+ IDocumentUndoRedo const& GetIDocumentUndoRedo() const;
+ IDocumentUndoRedo & GetIDocumentUndoRedo();
// --> OD 2007-11-14 #i83479#
const IDocumentListItems* getIDocumentListItemsAccess() const;
diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx
index 1ce5e4b9cf6c..3015d8cf4b44 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -39,7 +39,8 @@
#include <frmfmt.hxx>
#include <frmtool.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoDelete.hxx>
+#include <UndoInsert.hxx>
#include <swtable.hxx>
#include <viscrs.hxx>
#include <fntcache.hxx>
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 11060352b6c3..18dc67cfc958 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -31,6 +31,7 @@
#include <bookmrk.hxx>
#include <IDocumentMarkAccess.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <doc.hxx>
#include <errhdl.hxx>
#include <ndtxt.hxx>
@@ -38,7 +39,7 @@
#include <swserv.hxx>
#include <sfx2/linkmgr.hxx>
#include <swtypes.hxx>
-#include <undobj.hxx>
+#include <UndoBookmark.hxx>
#include <unobookmark.hxx>
#include <rtl/random.h>
#include <xmloff/odffields.hxx>
@@ -79,13 +80,14 @@ namespace
{
SwPosition& rStart = pField->GetMarkStart();
SwPosition& rEnd = pField->GetMarkEnd();
- SwTxtNode const * const pStartTxtNode = io_pDoc->GetNodes()[rStart.nNode]->GetTxtNode();
- SwTxtNode const * const pEndTxtNode = io_pDoc->GetNodes()[rEnd.nNode]->GetTxtNode();
+ SwTxtNode const*const pStartTxtNode =
+ rStart.nNode.GetNode().GetTxtNode();
+ SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode();
const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex());
const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(rEnd.nContent.GetIndex()-1);
SwPaM aStartPaM(rStart);
SwPaM aEndPaM(rEnd);
- io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL);
+ io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL);
if(ch_start != aStartMark)
{
io_pDoc->InsertString(aStartPaM, aStartMark);
@@ -94,7 +96,7 @@ namespace
{
io_pDoc->InsertString(aEndPaM, aEndMark);
}
- io_pDoc->EndUndo(UNDO_UI_REPLACE, NULL);
+ io_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_UI_REPLACE, NULL);
};
}
@@ -231,10 +233,10 @@ namespace sw { namespace mark
void Bookmark::InitDoc(SwDoc* const io_pDoc)
{
- if(io_pDoc->DoesUndo())
+ if (io_pDoc->GetIDocumentUndoRedo().DoesUndo())
{
- io_pDoc->ClearRedo();
- io_pDoc->AppendUndo(new SwUndoInsBookmark(*this));
+ io_pDoc->GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsBookmark(*this));
}
io_pDoc->SetModified();
}
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 9cf698a3a709..d1f3473dce5f 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -174,6 +174,21 @@ BOOL SwCrsrShell::DestroyCrsr()
}
+SwPaM & SwCrsrShell::CreateNewShellCursor()
+{
+ if (HasSelection())
+ {
+ (void) CreateCrsr(); // n.b. returns old cursor
+ }
+ return *GetCrsr();
+}
+
+SwPaM & SwCrsrShell::GetCurrentShellCursor()
+{
+ return *GetCrsr();
+}
+
+
// gebe den aktuellen zurueck
SwPaM* SwCrsrShell::GetCrsr( BOOL bMakeTblCrsr ) const
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index e16207f03fa0..2b8a7ba91bdf 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -37,6 +37,7 @@
#include <svx/svdobj.hxx>
#include <crsrsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <cntfrm.hxx>
#include <rootfrm.hxx>
@@ -1705,7 +1706,8 @@ BOOL SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode,
SET_CURR_SHELL( this );
BOOL bRet = FALSE;
- if( !IsTableMode() && !HasSelection() && GetDoc()->DoesUndo() )
+ if (!IsTableMode() && !HasSelection()
+ && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
{
Point aPt( rPt );
SwPosition aPos( *pCurCrsr->GetPoint() );
@@ -1730,7 +1732,8 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
SET_CURR_SHELL( this );
BOOL bRet = FALSE;
- if( !IsTableMode() && !HasSelection() && GetDoc()->DoesUndo() )
+ if (!IsTableMode() && !HasSelection()
+ && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
{
Point aPt( rPt );
SwPosition aPos( *pCurCrsr->GetPoint() );
@@ -1754,7 +1757,7 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
pCNd && pCNd->Len() )
nUndoId = UNDO_EMPTY;
- GetDoc()->StartUndo( nUndoId, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( nUndoId, NULL );
SwTxtFmtColl* pNextFmt = 0;
SwTxtNode* pTNd = pCNd->GetTxtNode();
@@ -1860,7 +1863,7 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
break;
}
- GetDoc()->EndUndo( nUndoId, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( nUndoId, NULL );
EndAction();
bRet = TRUE;
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index be581b17735d..08b73b887ccc 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -45,13 +45,14 @@
#include <fchrfmt.hxx>
#include <charfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swcrsr.hxx>
#include <editsh.hxx>
#include <ndtxt.hxx>
#include <pamtyp.hxx>
#include <swundo.hxx>
#include <crsskip.hxx>
-#include <undobj.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -1287,9 +1288,11 @@ ULONG SwCursor::Find( const SfxItemSet& rSet, BOOL bNoCollections,
BOOL bReplace = ( pSearchOpt && ( pSearchOpt->replaceString.getLength() ||
!rSet.Count() ) ) ||
(pReplSet && pReplSet->Count());
- BOOL bSttUndo = pDoc->DoesUndo() && bReplace;
- if( bSttUndo )
- pDoc->StartUndo( UNDO_REPLACE, NULL );
+ bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace;
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_REPLACE, NULL );
+ }
SwFindParaAttr aSwFindParaAttr( rSet, bNoCollections, pSearchOpt,
pReplSet, *this );
@@ -1299,8 +1302,10 @@ ULONG SwCursor::Find( const SfxItemSet& rSet, BOOL bNoCollections,
if( nRet && bReplace )
pDoc->SetModified();
- if( bSttUndo )
- pDoc->EndUndo( UNDO_REPLACE, NULL );
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_REPLACE, NULL );
+ }
return nRet;
}
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index 4bb594ceb4ca..ed8fb97e9b54 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -28,16 +28,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <tools/resid.hxx>
#include <swcrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pamtyp.hxx>
#include <swundo.hxx>
-#include <undobj.hxx>
-#ifndef _COMCORE_HRC
+#include <SwRewriter.hxx>
#include <comcore.hrc>
-#endif
-#include <tools/resid.hxx>
//------------------ Methoden der CrsrShell ---------------------------
@@ -91,15 +90,17 @@ ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl,
Link aLnk( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
- BOOL bSttUndo = pDoc->DoesUndo() && pReplFmtColl;
- if( bSttUndo )
+ bool const bStartUndo =
+ pDoc->GetIDocumentUndoRedo().DoesUndo() && pReplFmtColl;
+ if (bStartUndo)
{
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, rFmtColl.GetName());
aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
aRewriter.AddRule(UNDO_ARG3, pReplFmtColl->GetName());
- pDoc->StartUndo( UNDO_UI_REPLACE_STYLE, &aRewriter );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_UI_REPLACE_STYLE,
+ &aRewriter );
}
SwFindParaFmtColl aSwFindParaFmtColl( rFmtColl, pReplFmtColl, *this );
@@ -110,8 +111,10 @@ ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl,
if( nRet && pReplFmtColl )
pDoc->SetModified();
- if( bSttUndo )
- pDoc->EndUndo( UNDO_UI_REPLACE_STYLE, NULL );
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
return nRet;
}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index ed4bcc089957..9f2c6d71ad6d 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -27,15 +27,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
-
-
#define _SVSTDARR_USHORTS
#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
+
#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+
#include <txatritr.hxx>
#include <fldbas.hxx>
#include <fmtfld.hxx>
@@ -43,15 +45,16 @@
#include <txtfld.hxx>
#include <swcrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pamtyp.hxx>
#include <ndtxt.hxx>
#include <swundo.hxx>
+#include <UndoInsert.hxx>
#include <breakit.hxx>
#include <docsh.hxx>
#include <PostItMgr.hxx>
#include <viewsh.hxx>
-#include <vcl/window.hxx>
using namespace ::com::sun::star;
using namespace util;
@@ -643,9 +646,11 @@ ULONG SwCursor::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes,
Link aLnk( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
- BOOL bSttUndo = pDoc->DoesUndo() && bReplace;
- if( bSttUndo )
- pDoc->StartUndo( UNDO_REPLACE, NULL );
+ bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace;
+ if (bStartUndo)
+ {
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_REPLACE, NULL );
+ }
BOOL bSearchSel = 0 != (rSearchOpt.searchFlag & SearchFlags::REG_NOT_BEGINOFLINE);
if( bSearchSel )
@@ -656,8 +661,12 @@ ULONG SwCursor::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes,
if( nRet && bReplace )
pDoc->SetModified();
- if( bSttUndo )
- pDoc->EndUndo( UNDO_REPLACE, NULL );
+ if (bStartUndo)
+ {
+ SwRewriter rewriter(MakeUndoReplaceRewriter(
+ nRet, rSearchOpt.searchString, rSearchOpt.replaceString));
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_REPLACE, & rewriter );
+ }
return nRet;
}
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 7637df0a67b4..082e61e3347c 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -43,6 +43,7 @@
#include <swcrsr.hxx>
#include <unocrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <ndtxt.hxx>
#include <section.hxx>
@@ -58,9 +59,7 @@
#include <crsskip.hxx>
#include <vcl/msgbox.hxx>
#include <mdiexp.hxx> // ...Percent()
-#ifndef _STATSTR_HRC
#include <statstr.hrc> // ResId fuer Statusleiste
-#endif
#include <redline.hxx> // SwRedline
@@ -743,7 +742,7 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
BOOL bInReadOnly, BOOL& bCancel )
{
SwDoc* pDoc = pCurCrsr->GetDoc();
- BOOL bDoesUndo = pDoc->DoesUndo();
+ bool const bDoesUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
int nFndRet = 0;
ULONG nFound = 0;
int bSrchBkwrd = fnMove == fnMoveBackward, bEnde = FALSE;
@@ -806,14 +805,15 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
break;
}
- if( coSrchRplcThreshold == nFound && pDoc->DoesUndo()
+ if ((coSrchRplcThreshold == nFound)
+ && pDoc->GetIDocumentUndoRedo().DoesUndo()
&& rParas.IsReplaceMode())
{
short nRet = pCurCrsr->MaxReplaceArived();
if( RET_YES == nRet )
{
- pDoc->DelAllUndoObj();
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
}
else
{
@@ -858,7 +858,7 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
pFndRing = pCurCrsr->Create();
delete pPHdl;
- pDoc->DoUndo( bDoesUndo );
+ pDoc->GetIDocumentUndoRedo().DoUndo(bDoesUndo);
return nFound;
}
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 3c85091c7d20..daded009ac01 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -42,6 +42,7 @@
#include <docary.hxx>
#include <swundo.hxx>
#include <undobj.hxx>
+#include <numrule.hxx>
#include <doc.hxx>
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
@@ -808,43 +809,10 @@ String lcl_dbg_out(const SwUndo & rUndo)
{
String aStr("[ ", RTL_TEXTENCODING_ASCII_US);
- aStr += String::CreateFromInt32(rUndo.GetId());
+ aStr += String::CreateFromInt32(
+ static_cast<SfxUndoAction const&>(rUndo).GetId());
aStr += String(": ", RTL_TEXTENCODING_ASCII_US);
- switch(rUndo.GetId())
- {
- case UNDO_START:
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr +=
- String::CreateFromInt32(dynamic_cast
- <const SwUndoStart &>(rUndo).
- GetUserId());
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr += String::CreateFromInt32(dynamic_cast
- <const SwUndoStart &>(rUndo).
- GetEndOffset());
- aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
-
- break;
-
- case UNDO_END:
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr +=
- String::CreateFromInt32(dynamic_cast
- <const SwUndoEnd &>(rUndo).
- GetId());
- aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
- aStr += String::CreateFromInt32(dynamic_cast
- <const SwUndoEnd &>(rUndo).
- GetSttOffset());
- aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
-
- break;
-
- default:
- break;
- }
-
aStr += rUndo.GetComment();
aStr += String(" ]", RTL_TEXTENCODING_ASCII_US);
@@ -876,39 +844,6 @@ SW_DLLPUBLIC const char * dbg_out(SwOutlineNodes & rNodes)
return dbg_out(lcl_dbg_out(rNodes));
}
-String lcl_dbg_out(const SwUndos & rUndos)
-{
- USHORT nIndent = 0;
-
- String aStr("[\n", RTL_TEXTENCODING_ASCII_US);
-
- for (USHORT n = 0; n < rUndos.Count(); n++)
- {
- SwUndo * pUndo = rUndos[n];
-
- if (pUndo->GetId() == UNDO_END)
- nIndent--;
-
- for (USHORT nI = 0; n < nIndent; nI++)
- aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
-
- aStr += lcl_dbg_out(*pUndo);
- aStr += String("\n", RTL_TEXTENCODING_ASCII_US);
-
- if (pUndo->GetId() == UNDO_START)
- nIndent++;
- }
-
- aStr += String("]\n", RTL_TEXTENCODING_ASCII_US);
-
- return aStr;
-}
-
-SW_DLLPUBLIC const char * dbg_out(const SwUndos & rUndos)
-{
- return dbg_out(lcl_dbg_out(rUndos));
-}
-
String lcl_dbg_out(const SwRewriter & rRewriter)
{
(void) rRewriter;
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 9b835a1a4b05..71bd7e26ac71 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -27,7 +27,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <hintids.hxx>
#include <tools/shl.hxx>
@@ -80,7 +82,10 @@
#include <pam.hxx>
#include <ndtxt.hxx>
#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoInsert.hxx>
+#include <UndoSplitMove.hxx>
+#include <UndoTable.hxx>
#include <pagedesc.hxx> //DTor
#include <breakit.hxx>
#include <ndole.hxx>
@@ -112,15 +117,15 @@
#include <viewsh.hxx>
#include <shellres.hxx>
#include <txtfrm.hxx>
+#include <wdocsh.hxx> // SwWebDocShell
+#include <prtopt.hxx> // SwPrintOptions
#include <vector>
#include <map>
#include <osl/diagnose.h>
#include <osl/interlck.h>
-#ifdef FUTURE_VBA
#include <vbahelper/vbaaccesshelper.hxx>
-#endif
/* @@@MAINTAINABILITY-HORROR@@@
Probably unwanted dependency on SwDocShell
@@ -632,11 +637,23 @@ void SwDoc::setJobsetup(/*[in]*/ const JobSetup &rJobSetup )
PrtDataChanged();
}
-SwPrintData* SwDoc::getPrintData() const
+const SwPrintData & SwDoc::getPrintData() const
{
if(!pPrtData)
- ((SwDoc*)this)->pPrtData = new SwPrintData;
- return pPrtData;
+ {
+ SwDoc * pThis = const_cast< SwDoc * >(this);
+ pThis->pPrtData = new SwPrintData;
+
+ // SwPrintData should be initialized from the configuration,
+ // the respective config item is implememted by SwPrintOptions which
+ // is also derived from SwPrintData
+ const SwDocShell *pDocSh = GetDocShell();
+ DBG_ASSERT( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" );
+ bool bWeb = 0 != dynamic_cast< const SwWebDocShell * >(pDocSh);
+ SwPrintOptions aPrintOptions( bWeb );
+ *pThis->pPrtData = aPrintOptions;
+ }
+ return *pPrtData;
}
void SwDoc::setPrintData(/*[in]*/ const SwPrintData& rPrtData )
@@ -677,14 +694,14 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
}
SwUndoSplitNode* pUndo = 0;
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
// einfuegen vom Undo-Object, z.Z. nur beim TextNode
if( pNode->IsTxtNode() )
{
pUndo = new SwUndoSplitNode( this, rPos, bChkTableStart );
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
@@ -791,10 +808,8 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
bool SwDoc::AppendTxtNode( SwPosition& rPos )
{
- /*
- * Neuen Node vor EndOfContent erzeugen.
- */
- SwTxtNode *pCurNode = GetNodes()[ rPos.nNode ]->GetTxtNode();
+ // create new node before EndOfContent
+ SwTxtNode * pCurNode = rPos.nNode.GetNode().GetTxtNode();
if( !pCurNode )
{
// dann kann ja einer angelegt werden!
@@ -808,10 +823,9 @@ bool SwDoc::AppendTxtNode( SwPosition& rPos )
rPos.nNode++;
rPos.nContent.Assign( pCurNode, 0 );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsert( rPos.nNode ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoInsert( rPos.nNode ) );
}
if( IsRedlineOn() || (!IsIgnoreRedline() && pRedlineTbl->Count() ))
@@ -832,9 +846,9 @@ bool SwDoc::AppendTxtNode( SwPosition& rPos )
bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
const enum InsertFlags nInsertMode )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo not always called!
}
const SwPosition& rPos = *rRg.GetPoint();
@@ -856,15 +870,16 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
SwDataChanged aTmp( rRg, 0 );
- if( !DoesUndo() || !DoesGroupUndo() )
+ if (!GetIDocumentUndoRedo().DoesUndo() ||
+ !GetIDocumentUndoRedo().DoesGroupUndo())
{
pNode->InsertText( rStr, rPos.nContent, nInsertMode );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndoInsert * const pUndo( new SwUndoInsert(
rPos.nNode, rPos.nContent.GetIndex(), rStr.Len(), nInsertMode));
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
else
@@ -875,25 +890,12 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
if (!(nInsertMode & IDocumentContentOperations::INS_FORCEHINTEXPAND))
// -> #111827#
{
- USHORT const nUndoSize = pUndos->Count();
- if (0 != nUndoSize)
+ SwUndo *const pLastUndo = GetUndoManager().GetLastUndo();
+ SwUndoInsert *const pUndoInsert(
+ dynamic_cast<SwUndoInsert *>(pLastUndo) );
+ if (pUndoInsert && pUndoInsert->CanGrouping(rPos))
{
- SwUndo * const pLastUndo = (*pUndos)[ nUndoSize - 1 ];
-
- switch (pLastUndo->GetId())
- {
- case UNDO_INSERT:
- case UNDO_TYPING:
- if (static_cast<SwUndoInsert*>(pLastUndo)
- ->CanGrouping( rPos ))
- {
- pUndo = static_cast<SwUndoInsert*>(pLastUndo);
- }
- break;
-
- default:
- break;
- }
+ pUndo = pUndoInsert;
}
}
// <- #111827#
@@ -905,7 +907,7 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
{
pUndo = new SwUndoInsert( rPos.nNode, nInsPos, 0, nInsertMode,
!rCC.isLetterNumeric( rStr, 0 ) );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
pNode->InsertText( rStr, rPos.nContent, nInsertMode );
@@ -918,7 +920,7 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
{
pUndo = new SwUndoInsert( rPos.nNode, nInsPos, 1, nInsertMode,
!rCC.isLetterNumeric( rStr, i ) );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
}
@@ -1339,12 +1341,14 @@ void SwDoc::CalculatePagesForPrinting(
// get PageRange value to use
OUString aPageRange;
- if (bIsPDFExport)
- {
- // ?? rOptions.getValue( C2U("Selection") );
- aPageRange = rOptions.getStringValue( "PageRange", OUString() );
- }
- else
+ // --> PL, OD #i116085# - adjusting fix for i113919
+// if (bIsPDFExport)
+// {
+// aPageRange = rOptions.getStringValue( "PageRange", OUString() );
+// }
+// else
+ if ( !bIsPDFExport )
+ // <--
{
// PageContent :
// 0 -> print all pages (default if aPageRange is empty)
@@ -1997,7 +2001,7 @@ void SwDoc::ResetModified()
// it is correct. In this case we reset the modified flag.
if ( 0 != pDocStat->nChar )
pDocStat->bModified = FALSE;
- nUndoSavePos = nUndoPos;
+ GetIDocumentUndoRedo().SetUndoNoModifiedPosition();
if( nCall && aOle2Link.IsSet() )
{
mbInCallModified = TRUE;
@@ -2016,10 +2020,9 @@ void SwDoc::ReRead( SwPaM& rPam, const String& rGrfName,
|| rPam.GetPoint()->nNode.GetIndex() == rPam.GetMark()->nNode.GetIndex() )
&& 0 != ( pGrfNd = rPam.GetPoint()->nNode.GetNode().GetGrfNode() ) )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoReRead( rPam, *pGrfNd ) );
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoReRead(rPam, *pGrfNd));
}
// Weil nicht bekannt ist, ob sich die Grafik spiegeln laesst,
@@ -2231,10 +2234,10 @@ void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
// loesche den nicht sichtbaren Content aus dem Document, wie z.B.:
// versteckte Bereiche, versteckte Absaetze
-BOOL SwDoc::RemoveInvisibleContent()
+bool SwDoc::RemoveInvisibleContent()
{
BOOL bRet = FALSE;
- StartUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
{
SwTxtNode* pTxtNd;
@@ -2398,13 +2401,13 @@ BOOL SwDoc::RemoveInvisibleContent()
if( bRet )
SetModified();
- EndUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_UI_DELETE_INVISIBLECNTNT, NULL );
return bRet;
}
/*-- 25.08.2010 14:18:12---------------------------------------------------
-----------------------------------------------------------------------*/
-BOOL SwDoc::HasInvisibleContent() const
+bool SwDoc::HasInvisibleContent() const
{
BOOL bRet = sal_False;
@@ -2449,6 +2452,21 @@ BOOL SwDoc::HasInvisibleContent() const
}
return bRet;
}
+
+bool SwDoc::RestoreInvisibleContent()
+{
+ bool bRet = false;
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId)
+ && (UNDO_UI_DELETE_INVISIBLECNTNT == nLastUndoId))
+ {
+ GetIDocumentUndoRedo().Undo();
+ GetIDocumentUndoRedo().ClearRedo();
+ bRet = true;
+ }
+ return bRet;
+}
+
/*-- 11.06.2004 08:34:04---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -2456,7 +2474,7 @@ BOOL SwDoc::ConvertFieldsToText()
{
BOOL bRet = FALSE;
LockExpFlds();
- StartUndo( UNDO_UI_REPLACE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_UI_REPLACE, NULL );
const SwFldTypes* pMyFldTypes = GetFldTypes();
sal_uInt16 nCount = pMyFldTypes->Count();
@@ -2526,7 +2544,7 @@ BOOL SwDoc::ConvertFieldsToText()
if( bRet )
SetModified();
- EndUndo( UNDO_UI_REPLACE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_UI_REPLACE, NULL );
UnlockExpFlds();
return bRet;
@@ -2593,8 +2611,7 @@ bool SwDoc::EmbedAllLinks()
const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.GetLinks();
if( rLinks.Count() )
{
- BOOL bDoesUndo = DoesUndo();
- DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
::sfx2::SvBaseLink* pLnk = 0;
while( 0 != (pLnk = lcl_FindNextRemovableLink( rLinks, rLnkMgr ) ) )
@@ -2610,8 +2627,7 @@ bool SwDoc::EmbedAllLinks()
bRet = TRUE;
}
- DelAllUndoObj();
- DoUndo( bDoesUndo );
+ GetIDocumentUndoRedo().DelAllUndoObj();
SetModified();
}
return bRet;
@@ -2650,26 +2666,26 @@ void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, BOOL bIsTable )
{
SwUndoCpyTbl* pUndo = new SwUndoCpyTbl;
pUndo->SetTableSttIdx( pTblNd->GetIndex() );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
else if( rPam.HasMark() )
{
SwUndoCpyDoc* pUndo = new SwUndoCpyDoc( rPam );
pUndo->SetInsertRange( rPam, FALSE );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
void SwDoc::ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew)
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DelAllUndoObj();
+ GetIDocumentUndoRedo().DelAllUndoObj();
SwUndo * pUndo = new SwUndoTOXChange(&rTOX, rNew);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
rTOX = rNew;
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index 37568933e522..f4ce285d0cf2 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -100,7 +100,7 @@ BOOL SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs )
aRef = pRetValue;
eErr = pDocShell->CallBasic( rMacro.GetMacName(),
rMacro.GetLibName(),
- 0, pArgs, pRet ? pRetValue : 0 );
+ pArgs, pRet ? pRetValue : 0 );
if( pRet && SbxNULL < pRetValue->GetType() &&
SbxVOID != pRetValue->GetType() )
@@ -231,7 +231,7 @@ USHORT SwDoc::CallEvent( USHORT nEvent, const SwCallMouseEvent& rCallEvent,
if( STARBASIC == rMacro.GetScriptType() )
{
nRet += 0 == pDocShell->CallBasic( rMacro.GetMacName(),
- rMacro.GetLibName(), 0, pArgs ) ? 1 : 0;
+ rMacro.GetLibName(), pArgs ) ? 1 : 0;
}
else if( EXTENDED_STYPE == rMacro.GetScriptType() )
{
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 587c846667f4..4f57a374bb9a 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -58,7 +58,6 @@
#include <swserv.hxx>
#include <swundo.hxx>
#include <tools/pstm.hxx>
-#include <undobj.hxx>
#include <unocrsr.hxx>
#include <viscrs.hxx>
#include <stdio.h>
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 170193778421..67c5d24ab505 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -37,11 +37,12 @@
#include <editeng/boxitem.hxx>
#include <editeng/udlnitem.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <redline.hxx>
-#include <undobj.hxx>
+#include <UndoRedline.hxx>
#include <section.hxx>
#include <tox.hxx>
#include <docsh.hxx>
@@ -1216,14 +1217,12 @@ BOOL SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
if( nStt != nSEnd )
{
{
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
SwPaM aCpyPam( rSrcNd, nStt );
aCpyPam.SetMark();
aCpyPam.GetPoint()->nContent = nSEnd;
aCpyPam.GetDoc()->CopyRange( aCpyPam, *aPam.GetPoint(),
false );
- pDoc->DoUndo( bUndo );
}
SwPaM* pTmp = new SwPaM( *aPam.GetPoint(), rpDelRing );
@@ -1494,8 +1493,11 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
rDoc.DeleteRedline( *pTmp, false, USHRT_MAX );
- if( rDoc.DoesUndo() )
- rDoc.AppendUndo( new SwUndoCompDoc( *pTmp, FALSE ));
+ if (rDoc.GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo(new SwUndoCompDoc( *pTmp, FALSE )) ;
+ rDoc.GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
rDoc.AppendRedline( new SwRedline( aRedlnData, *pTmp ), true );
} while( pDelRing != ( pTmp = (SwPaM*)pTmp->GetNext() ));
@@ -1560,8 +1562,11 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
do {
if( rDoc.AppendRedline( new SwRedline( aRedlnData, *pTmp ), true) &&
- rDoc.DoesUndo() )
- rDoc.AppendUndo( new SwUndoCompDoc( *pTmp, TRUE ));
+ rDoc.GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo(new SwUndoCompDoc( *pTmp, TRUE ));
+ rDoc.GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
} while( pInsRing != ( pTmp = (SwPaM*)pTmp->GetNext() ));
}
}
@@ -1578,7 +1583,7 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
long nRet = 0;
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
BOOL bDocWasModified = IsModified();
SwDoc& rSrcDoc = (SwDoc&)rDoc;
BOOL bSrcModified = rSrcDoc.IsModified();
@@ -1609,14 +1614,12 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
if( !bSrcModified )
rSrcDoc.ResetModified();
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
return nRet;
}
-typedef void (SwDoc::*FNInsUndo)( SwUndo* );
-
class _SaveMergeRedlines : public Ring
{
const SwRedline* pSrcRedl;
@@ -1624,7 +1627,7 @@ class _SaveMergeRedlines : public Ring
public:
_SaveMergeRedlines( const SwNode& rDstNd,
const SwRedline& rSrcRedl, Ring* pRing );
- USHORT InsertRedline( FNInsUndo pFn );
+ USHORT InsertRedline();
SwRedline* GetDestRedline() { return pDestRedl; }
};
@@ -1655,7 +1658,7 @@ _SaveMergeRedlines::_SaveMergeRedlines( const SwNode& rDstNd,
}
}
-USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
+USHORT _SaveMergeRedlines::InsertRedline()
{
USHORT nIns = 0;
SwDoc* pDoc = pDestRedl->GetDoc();
@@ -1663,8 +1666,7 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
if( nsRedlineType_t::REDLINE_INSERT == pDestRedl->GetType() )
{
// der Teil wurde eingefuegt, also kopiere ihn aus dem SourceDoc
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodeIndex aSaveNd( pDestRedl->GetPoint()->nNode, -1 );
xub_StrLen nSaveCnt = pDestRedl->GetPoint()->nContent.GetIndex();
@@ -1677,7 +1679,6 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
*pDestRedl->GetPoint(), false );
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
pDestRedl->SetMark();
aSaveNd++;
@@ -1739,13 +1740,16 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
pCpyRedl->SetMark();
*pCpyRedl->GetPoint() = *pRStt;
- SwUndoCompDoc* pUndo = pDoc->DoesUndo()
+ SwUndoCompDoc *const pUndo =
+ (pDoc->GetIDocumentUndoRedo().DoesUndo())
? new SwUndoCompDoc( *pCpyRedl ) : 0;
// now modify doc: append redline, undo (and count)
pDoc->AppendRedline( pCpyRedl, true );
if( pUndo )
- (pDoc->*pFn)( pUndo );
+ {
+ pDoc->GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
++nIns;
*pDStt = *pREnd;
@@ -1772,12 +1776,15 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
if( pDestRedl )
{
- SwUndoCompDoc* pUndo = pDoc->DoesUndo() ? new SwUndoCompDoc( *pDestRedl ) : 0;
+ SwUndoCompDoc *const pUndo = (pDoc->GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoCompDoc( *pDestRedl ) : 0;
// now modify doc: append redline, undo (and count)
bool bRedlineAccepted = pDoc->AppendRedline( pDestRedl, true );
if( pUndo )
- (pDoc->*pFn)( pUndo );
+ {
+ pDoc->GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
++nIns;
// if AppendRedline has deleted our redline, we may not keep a
@@ -1796,7 +1803,7 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
long nRet = 0;
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
SwDoc& rSrcDoc = (SwDoc&)rDoc;
BOOL bSrcModified = rSrcDoc.IsModified();
@@ -1853,7 +1860,7 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
_SaveMergeRedlines* pTmp = pRing;
do {
- nRet += pTmp->InsertRedline( &SwDoc::AppendUndo );
+ nRet += pTmp->InsertRedline();
} while( pRing != ( pTmp = (_SaveMergeRedlines*)pTmp->GetNext() ));
while( pRing != pRing->GetNext() )
@@ -1868,7 +1875,7 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
SetRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE));
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
return nRet;
}
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 0520a9b5c81c..d62a92887d85 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -353,4 +353,8 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
return 0;
}
+::sw::IShellCursorSupplier * SwDoc::GetIShellCursorSupplier()
+{
+ return GetEditShell(0);
+}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 0b56578e0536..7a441480f07f 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <vcl/virdev.hxx>
#include <svx/svdmodel.hxx>
@@ -48,6 +49,7 @@
#include <ndole.hxx>
#include <mdiexp.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pagefrm.hxx> //Fuer DelPageDesc
#include <rootfrm.hxx> //Fuer DelPageDesc
@@ -55,9 +57,7 @@
#include <frmtool.hxx>
#include <pagedesc.hxx>
#include <poolfmt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <ndindex.hxx>
#include <ftnidx.hxx>
#include <fmtftn.hxx>
@@ -69,9 +69,8 @@
#include <swwait.hxx>
#include <GetMetricVal.hxx>
#include <unotools/syslocale.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
+#include <hints.hxx>
#include <SwUndoPageDesc.hxx>
@@ -203,12 +202,12 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
SwPageDesc *pDesc = aPageDescs[i];
- BOOL bDoesUndo = DoesUndo();
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- AppendUndo(new SwUndoPageDesc(*pDesc, rChged, this));
- DoUndo(FALSE);
+ SwUndo *const pUndo(new SwUndoPageDesc(*pDesc, rChged, this));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
//Als erstes wird ggf. gespiegelt.
if ( rChged.GetUseOn() == nsUseOnPage::PD_MIRROR )
@@ -247,7 +246,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
//Header abgleichen.
const SwFmtHeader &rHead = rChged.GetMaster().GetHeader();
- if( bDoesUndo )
+ if (undoGuard.UndoWasEnabled())
{
// #i46909# no undo if header or footer changed
// hat sich an den Nodes etwas veraendert ?
@@ -311,7 +310,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
//Footer abgleichen.
const SwFmtFooter &rFoot = rChged.GetMaster().GetFooter();
- if( bDoesUndo )
+ if (undoGuard.UndoWasEnabled())
{
// #i46909# no undo if header or footer changed
// hat sich an den Nodes etwas veraendert ?
@@ -426,13 +425,10 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
}
SetModified();
- DoUndo(bDoesUndo);
-
// #i46909# no undo if header or footer changed
if( bHeaderFooterChanged )
{
- ClearRedo();
- DelAllUndoObj();
+ GetIDocumentUndoRedo().DelAllUndoObj();
}
}
@@ -570,9 +566,10 @@ void SwDoc::DelPageDesc( USHORT i, BOOL bBroadcast )
SFX_STYLESHEET_ERASED);
// <- #116530#
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- AppendUndo(new SwUndoPageDescDelete(*pDel, this));
+ SwUndo *const pUndo(new SwUndoPageDescDelete(*pDel, this));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
PreDelPageDesc(pDel); // #i7983#
@@ -629,8 +626,11 @@ USHORT SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
SFX_STYLESHEET_CREATED);
// <- #116530#
- if (DoesUndo())
- AppendUndo(new SwUndoPageDescCreate(pNew, this)); // #116530#
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ // #116530#
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoPageDescCreate(pNew, this));
+ }
SetModified();
return (aPageDescs.Count()-1);
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 1a10428d5a58..000f12892cf9 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <rtl/logfile.hxx>
#include <vcl/outdev.hxx>
@@ -49,12 +50,13 @@
#include <viewimp.hxx>
#include <swhints.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
#include <rootfrm.hxx> //Damit der RootDtor gerufen wird.
#include <poolfmt.hxx>
#include <viewsh.hxx> // fuer MakeDrawView
#include <drawdoc.hxx>
-#include <undobj.hxx>
+#include <UndoDraw.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <dcontact.hxx>
#include <dview.hxx>
@@ -227,7 +229,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
SwDrawContact *pMyContact = (SwDrawContact*)GetUserCall(pObj);
const SwFmtAnchor aAnch( pMyContact->GetFmt()->GetAnchor() );
- SwUndoDrawGroup* pUndo = !DoesUndo()
+ SwUndoDrawGroup *const pUndo = (!GetIDocumentUndoRedo().DoesUndo())
? 0
: new SwUndoDrawGroup( (USHORT)rMrkList.GetMarkCount() );
@@ -303,14 +305,15 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
if( pUndo )
{
pUndo->SetGroupFmt( pFmt );
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
}
else
{
- if ( DoesUndo() )
- ClearRedo();
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ }
rDrawView.GroupMarked();
ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
@@ -322,9 +325,11 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
void SwDoc::UnGroupSelection( SdrView& rDrawView )
{
- const int bUndo = DoesUndo();
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
if( bUndo )
- ClearRedo();
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ }
// OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
// the corresponding 'master' drawing objects.
@@ -358,7 +363,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
if( bUndo )
{
pUndo = new SwUndoDrawUnGroup( (SdrObjGroup*)pObj );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
for ( USHORT i2 = 0; i2 < pLst->GetObjCount(); ++i2 )
@@ -403,7 +408,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
if( bUndo )
{
pUndo = new SwUndoDrawUnGroupConnectToLayout();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
while ( pFmtsAndObjs[i].size() > 0 )
@@ -442,7 +447,7 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
if( rMrkList.GetMarkCount() )
{
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
USHORT i;
BOOL bDelMarked = TRUE;
@@ -483,7 +488,9 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
if( !pObj->GetUpGroup() )
{
- SwUndoDrawDelete* pUndo = !DoesUndo() ? 0
+ SwUndoDrawDelete *const pUndo =
+ (!GetIDocumentUndoRedo().DoesUndo())
+ ? 0
: new SwUndoDrawDelete( (USHORT)rMrkList.GetMarkCount() );
//ContactObjekte vernichten, Formate sicherstellen.
@@ -516,13 +523,15 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView )
}
if( pUndo )
- AppendUndo( pUndo );
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
}
bCallBase = TRUE;
}
SetModified();
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
}
return bCallBase;
@@ -625,7 +634,7 @@ void SwDoc::InitDrawModel()
//Seite.
pDrawModel = new SwDrawDocument( this );
- pDrawModel->EnableUndo( DoesUndo() );
+ pDrawModel->EnableUndo( GetIDocumentUndoRedo().DoesUndo() );
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Hell" ));
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index bdcf8caaff7b..782bc556953f 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -48,6 +48,7 @@
#include <cntfrm.hxx> // fuers Spell
#include <crsrsh.hxx>
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <docsh.hxx>
#include <docary.hxx>
#include <doctxm.hxx> // beim Move: Verzeichnisse korrigieren
@@ -63,7 +64,12 @@
#include <swtable.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <txtfrm.hxx>
-#include <undobj.hxx>
+#include <hints.hxx>
+#include <UndoSplitMove.hxx>
+#include <UndoRedline.hxx>
+#include <UndoOverwrite.hxx>
+#include <UndoInsert.hxx>
+#include <UndoDelete.hxx>
#include <breakit.hxx>
#include <hhcwrp.hxx>
#include <breakit.hxx>
@@ -773,8 +779,10 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
if(!pNode)
return sal_False;
- if( DoesUndo() )
- ClearRedo();
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo not always called
+ }
sal_uInt16 nOldAttrCnt = pNode->GetpSwpHints()
? pNode->GetpSwpHints()->Count() : 0;
@@ -782,8 +790,6 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
SwIndex& rIdx = rPt.nContent;
xub_StrLen nStart = 0;
- sal_uInt16 nUndoSize = pUndos->Count();
- SwUndo * pUndo;
sal_Unicode c;
String aStr;
@@ -799,16 +805,24 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
lcl_SkipAttr( pNode, rIdx, nStart );
}
c = rStr.GetChar( nCnt );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- if( DoesGroupUndo() && nUndoSize &&
- UNDO_OVERWRITE == ( pUndo = (*pUndos)[ nUndoSize-1 ])->GetId() &&
- ((SwUndoOverwrite*)pUndo)->CanGrouping( this, rPt, c ))
- ;// wenn CanGrouping() sal_True returnt, ist schon alles erledigt
- else
+ bool bMerged(false);
+ if (GetIDocumentUndoRedo().DoesGroupUndo())
+ {
+ SwUndo *const pUndo = GetUndoManager().GetLastUndo();
+ SwUndoOverwrite *const pUndoOW(
+ dynamic_cast<SwUndoOverwrite *>(pUndo) );
+ if (pUndoOW)
+ {
+ // if CanGrouping() returns true it's already merged
+ bMerged = pUndoOW->CanGrouping( this, rPt, c );
+ }
+ }
+ if (!bMerged)
{
- AppendUndo( new SwUndoOverwrite( this, rPt, c ));
- nUndoSize = pUndos->Count();
+ SwUndo *const pUndoOW( new SwUndoOverwrite(this, rPt, c) );
+ GetIDocumentUndoRedo().AppendUndo(pUndoOW);
}
}
else
@@ -841,7 +855,8 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
}
}
- if( !DoesUndo() && !IsIgnoreRedline() && GetRedlineTbl().Count() )
+ if (!GetIDocumentUndoRedo().DoesUndo() &&
+ !IsIgnoreRedline() && GetRedlineTbl().Count())
{
SwPaM aPam( rPt.nNode, nStart, rPt.nNode, rPt.nContent.GetIndex() );
DeleteRedline( aPam, true, USHRT_MAX );
@@ -909,15 +924,13 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
// in a particular order, and presence of bookmarks
// will change this order. Hence, we delete bookmarks
// here without undo.
- BOOL bDoesUndo = DoesUndo();
- DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
_DelBookmarks(
pStt->nNode,
pEnd->nNode,
NULL,
&pStt->nContent,
&pEnd->nContent);
- DoUndo( bDoesUndo );
}
@@ -926,9 +939,9 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
// falls Undo eingeschaltet, erzeuge das UndoMove-Objekt
SwUndoMove * pUndoMove = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoMove = new SwUndoMove( rPaM, rPos );
pUndoMove->SetMoveRedlines( eMvFlags == DOC_MOVEREDLINES );
}
@@ -1025,7 +1038,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
rPaM.SetMark(); // um den neuen Bereich eine Sel. aufspannen
pTNd = aSavePam.GetNode()->GetTxtNode();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// korrigiere erstmal den Content vom SavePam
if( bNullCntnt )
@@ -1069,7 +1082,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
// zwischen SPoint und GetMark steht jetzt der neu eingefuegte Bereich
pUndoMove->SetDestRange( aSavePam, *rPaM.GetPoint(),
bJoin, bCorrSavePam );
- AppendUndo( pUndoMove );
+ GetIDocumentUndoRedo().AppendUndo( pUndoMove );
}
else
{
@@ -1152,11 +1165,15 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
SwFtnIdxs aTmpFntIdx;
SwUndoMove* pUndo = 0;
- if( (DOC_CREATEUNDOOBJ & eMvFlags ) && DoesUndo() )
+ if ((DOC_CREATEUNDOOBJ & eMvFlags ) && GetIDocumentUndoRedo().DoesUndo())
+ {
pUndo = new SwUndoMove( this, rRange, rPos );
+ }
else
+ {
bUpdateFtn = lcl_SaveFtn( rRange.aStart, rRange.aEnd, rPos,
GetFtnIdxs(), aTmpFntIdx );
+ }
_SaveRedlines aSaveRedl( 0, 4 );
SvPtrarr aSavRedlInsPosArr( 0, 4 );
@@ -1246,9 +1263,8 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
if( pUndo )
{
- ClearRedo();
pUndo->SetDestRange( aIdx, rPos, *pSaveInsPos );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( pSaveInsPos )
@@ -1359,8 +1375,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
// falls PageBreaks geloescht / gesetzt werden, darf das
// nicht in die Undo-History aufgenommen werden !!
// (das loeschen vom Node geht auch am Undo vorbei !!!)
- sal_Bool bDoUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
/* PageBreaks, PageDesc, ColumnBreaks */
// Sollte an der Logik zum Kopieren der PageBreak's ...
@@ -1412,8 +1427,6 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
if( aBkmkArr.Count() )
::_RestoreCntntIdx( pDoc, aBkmkArr, aIdx.GetIndex() );
- pDoc->DoUndo( bDoUndo );
-
// falls der uebergebene PaM nicht im Crsr-Ring steht,
// gesondert behandeln (z.B. Aufruf aus dem Auto-Format)
if( pOldTxtNd == rPam.GetBound( sal_True ).nContent.GetIdxReg() )
@@ -1553,21 +1566,19 @@ bool SwDoc::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool )
ASSERT( IsRedlineOn(), "DeleteAndJoinWithRedline: redline off" );
{
- sal_uInt16 nUndoSize = 0;
SwUndoRedlineDelete* pUndo = 0;
RedlineMode_t eOld = GetRedlineMode();
checkRedlining(eOld);
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode(
(RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE ));
- nUndoSize = pUndos->Count();
- StartUndo(UNDO_EMPTY, NULL);
- AppendUndo( pUndo = new SwUndoRedlineDelete( rPam, UNDO_DELETE ));
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
+ pUndo = new SwUndoRedlineDelete( rPam, UNDO_DELETE );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( *rPam.GetPoint() != *rPam.GetMark() )
AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, rPam ), true);
@@ -1575,18 +1586,29 @@ bool SwDoc::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool )
if( pUndo )
{
- EndUndo(UNDO_EMPTY, NULL);
- SwUndo* pPrevUndo;
- if( nUndoSize && DoesGroupUndo() &&
- nUndoSize + 1 == pUndos->Count() &&
- UNDO_REDLINE == ( pPrevUndo = (*pUndos)[ nUndoSize-1 ])->GetId() &&
- UNDO_DELETE == ((SwUndoRedline*)pPrevUndo)->GetUserId() &&
- ((SwUndoRedlineDelete*)pPrevUndo)->CanGrouping( *pUndo ))
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
+ // ??? why the hell is the AppendUndo not below the
+ // CanGrouping, so this hideous cleanup wouldn't be necessary?
+ // bah, this is redlining, probably changing this would break it...
+ if (GetIDocumentUndoRedo().DoesGroupUndo())
{
- DoUndo( sal_False );
- pUndos->DeleteAndDestroy( nUndoSize, 1 );
- --nUndoPos, --nUndoCnt;
- DoUndo( sal_True );
+ SwUndo *const pLastUndo( GetUndoManager().GetLastUndo() );
+ SwUndoRedlineDelete *const pUndoRedlineDel(
+ dynamic_cast<SwUndoRedlineDelete*>(pLastUndo) );
+ if (pUndoRedlineDel)
+ {
+ bool const bMerged = pUndoRedlineDel->CanGrouping(*pUndo);
+ if (bMerged)
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ SwUndo const*const pDeleted =
+ GetUndoManager().RemoveLastUndo();
+ OSL_ENSURE(pDeleted == pUndo,
+ "DeleteAndJoinWithRedlineImpl: "
+ "undo removed is not undo inserted?");
+ delete pDeleted;
+ }
+ }
}
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode( eOld );
@@ -1683,17 +1705,25 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- sal_uInt16 nUndoSize = pUndos->Count();
- SwUndo * pUndo;
- if( DoesGroupUndo() && nUndoSize-- &&
- UNDO_DELETE == ( pUndo = (*pUndos)[ nUndoSize ])->GetId() &&
- ((SwUndoDelete*)pUndo)->CanGrouping( this, rPam ))
- ;// wenn CanGrouping() sal_True returnt, ist schon alles erledigt
- else
- AppendUndo( new SwUndoDelete( rPam ) );
+ GetIDocumentUndoRedo().ClearRedo();
+ bool bMerged(false);
+ if (GetIDocumentUndoRedo().DoesGroupUndo())
+ {
+ SwUndo *const pLastUndo( GetUndoManager().GetLastUndo() );
+ SwUndoDelete *const pUndoDelete(
+ dynamic_cast<SwUndoDelete *>(pLastUndo) );
+ if (pUndoDelete)
+ {
+ bMerged = pUndoDelete->CanGrouping( this, rPam );
+ // if CanGrouping() returns true it's already merged
+ }
+ }
+ if (!bMerged)
+ {
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDelete( rPam ) );
+ }
SetModified();
@@ -2316,9 +2346,9 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
{
RedlineMode_t eOld = GetRedlineMode();
checkRedlining(eOld);
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
// Bug 68584 - if any Redline will change (split!) the node
const ::sw::mark::IMark* pBkmk = getIDocumentMarkAccess()->makeMark( aDelPam, ::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK );
@@ -2398,15 +2428,19 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
InsertItemSet( aTmpRange, aSet, 0 );
}
- if( DoesUndo() )
- AppendUndo( new SwUndoRedlineDelete( aDelPam, UNDO_REPLACE ));
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndoRD =
+ new SwUndoRedlineDelete( aDelPam, UNDO_REPLACE );
+ GetIDocumentUndoRedo().AppendUndo(pUndoRD);
+ }
AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_DELETE, aDelPam ), true);
*rPam.GetMark() = *aDelPam.GetMark();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
*aDelPam.GetPoint() = *rPam.GetPoint();
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
// Bug 68584 - if any Redline will change (split!) the node
const ::sw::mark::IMark* pBkmk = getIDocumentMarkAccess()->makeMark( aDelPam, ::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK );
@@ -2433,21 +2467,13 @@ SetRedlineMode( eOld );
DeleteRedline( aDelPam, true, USHRT_MAX );
SwUndoReplace* pUndoRpl = 0;
- if( DoesUndo() )
+ bool const bDoesUndo = GetIDocumentUndoRedo().DoesUndo();
+ if (bDoesUndo)
{
- ClearRedo();
- SwUndo* pU;
-
- if( !pUndos->Count() ||
- UNDO_REPLACE != ( pU = (*pUndos)[ pUndos->Count()-1 ])->GetId() ||
- ( pUndoRpl = (SwUndoReplace*)pU )->IsFull() )
- {
- pUndoRpl = new SwUndoReplace();
- AppendUndo( pUndoRpl );
- }
- pUndoRpl->AddEntry( aDelPam, sRepl, bRegExReplace );
- DoUndo( sal_False );
+ pUndoRpl = new SwUndoReplace(aDelPam, sRepl, bRegExReplace);
+ GetIDocumentUndoRedo().AppendUndo(pUndoRpl);
}
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
if( aDelPam.GetPoint() != pStt )
aDelPam.Exchange();
@@ -2500,8 +2526,7 @@ SetRedlineMode( eOld );
if( pUndoRpl )
{
- pUndoRpl->SetEntryEnd( rPam );
- DoUndo( sal_True );
+ pUndoRpl->SetEnd(rPam);
}
}
}
@@ -2532,8 +2557,10 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
if ( nSectDiff-2 <= nNodeDiff || IsRedlineOn() ||
/* #i9185# Prevent getting the node after the end node (see below) */
- rEnd.nNode.GetIndex() + 1 == aNodes.Count() )
+ rEnd.nNode.GetIndex() + 1 == GetNodes().Count() )
+ {
return sal_False;
+ }
// harte SeitenUmbrueche am nachfolgenden Node verschieben
sal_Bool bSavePageBreak = sal_False, bSavePageDesc = sal_False;
@@ -2541,7 +2568,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
/* #i9185# This whould lead to a segmentation fault if not catched
above. */
ULONG nNextNd = rEnd.nNode.GetIndex() + 1;
- SwTableNode* pTblNd = aNodes[ nNextNd ]->GetTableNode();
+ SwTableNode *const pTblNd = GetNodes()[ nNextNd ]->GetTableNode();
if( pTblNd && pNd->IsCntntNode() )
{
@@ -2570,7 +2597,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
}
}
- sal_Bool bDoesUndo = DoesUndo();
+ bool const bDoesUndo = GetIDocumentUndoRedo().DoesUndo();
if( bDoesUndo )
{
if( !rPam.HasMark() )
@@ -2585,7 +2612,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
pTmpNode = rPam.GetMark()->nNode.GetNode().GetCntntNode();
rPam.GetMark()->nContent.Assign( pTmpNode, 0 );
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
{
@@ -2602,7 +2629,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
*rPam.GetPoint() = *aDelPam.GetPoint();
pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
{
@@ -2660,11 +2687,9 @@ void SwDoc::TransliterateText(
const SwPaM& rPaM,
utl::TransliterationWrapper& rTrans )
{
- SwUndoTransliterate* pUndo;
- if( DoesUndo() )
- pUndo = new SwUndoTransliterate( rPaM, rTrans );
- else
- pUndo = 0;
+ SwUndoTransliterate *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoTransliterate( rPaM, rTrans )
+ : 0;
const SwPosition* pStt = rPaM.Start(),
* pEnd = rPaM.End();
@@ -2722,8 +2747,7 @@ void SwDoc::TransliterateText(
{
if( pUndo->HasData() )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
delete pUndo;
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 7e18e990d070..a54db564a315 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -43,6 +43,7 @@
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -69,9 +70,7 @@
#include <authfld.hxx>
#include <txtinet.hxx>
#include <fmtcntnt.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc> // fuer InitFldTypes
-#endif
#include <SwUndoField.hxx>
@@ -2725,13 +2724,14 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
if (pDstFld->GetTyp()->Which() ==
rSrcFld.GetTyp()->Which())
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwPosition aPosition( pDstTxtFld->GetTxtNode() );
aPosition.nContent = *pDstTxtFld->GetStart();
- AppendUndo(new SwUndoFieldFromDoc(aPosition, *pDstFld, rSrcFld,
- pMsgHnt, bUpdateFlds));
+ SwUndo *const pUndo( new SwUndoFieldFromDoc(
+ aPosition, *pDstFld, rSrcFld, pMsgHnt, bUpdateFlds) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// Das gefundene Feld wird angepasst ...
@@ -2818,8 +2818,12 @@ bool SwDoc::PutValueToField(const SwPosition & rPos,
SwField * pField = GetField(rPos);
- if (DoesUndo() && pField->QueryValue(aOldVal, nWhich))
- AppendUndo(new SwUndoFieldFromAPI(rPos, aOldVal, rVal, nWhich));
+ if (GetIDocumentUndoRedo().DoesUndo() &&
+ pField->QueryValue(aOldVal, nWhich))
+ {
+ SwUndo *const pUndo(new SwUndoFieldFromAPI(rPos, aOldVal, rVal, nWhich));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
return pField->PutValue(rVal, nWhich);
}
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 68c525ad74e1..ad59c85e1844 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <svl/itemiter.hxx>
#include <svx/svdobj.hxx>
@@ -43,6 +42,7 @@
#include <ndgrf.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndindex.hxx>
#include <docary.hxx>
#include <fmtcntnt.hxx>
@@ -61,7 +61,8 @@
#include <swundo.hxx>
#include <swtable.hxx>
#include <crstate.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoAttribute.hxx>
#include <fmtcnct.hxx>
#include <dflyobj.hxx>
@@ -389,34 +390,26 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
return MAKEFRMS;
}
-BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
+static bool
+lcl_SetFlyFrmAttr(SwDoc & rDoc,
+ sal_Int8 (SwDoc::*pSetFlyFrmAnchor)(SwFrmFmt &, SfxItemSet &, BOOL),
+ SwFrmFmt & rFlyFmt, SfxItemSet & rSet)
{
- if( !rSet.Count() )
- return FALSE;
-
- ::std::auto_ptr<SwUndoFmtAttrHelper> pSaveUndo;
- const bool bDoesUndo = DoesUndo();
-
- if( DoesUndo() )
- {
- ClearRedo();
- pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the frame causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
- }
+ // #i32968# Inserting columns in the frame causes MakeFrmFmt to put two
+ // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
//Ist das Ankerattribut dabei? Falls ja ueberlassen wir die Verarbeitung
//desselben einer Spezialmethode. Sie Returnt TRUE wenn der Fly neu
//erzeugt werden muss (z.B. weil ein Wechsel des FlyTyps vorliegt).
- sal_Int8 nMakeFrms = SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, FALSE )?
- SetFlyFrmAnchor( rFlyFmt, rSet, FALSE ) : DONTMAKEFRMS;
+ sal_Int8 const nMakeFrms =
+ (SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, FALSE ))
+ ? (rDoc.*pSetFlyFrmAnchor)( rFlyFmt, rSet, FALSE )
+ : DONTMAKEFRMS;
const SfxPoolItem* pItem;
SfxItemIter aIter( rSet );
- SfxItemSet aTmpSet( GetAttrPool(), aFrmFmtSetRange );
+ SfxItemSet aTmpSet( rDoc.GetAttrPool(), aFrmFmtSetRange );
USHORT nWhich = aIter.GetCurItem()->Which();
do {
switch( nWhich )
@@ -426,7 +419,7 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
case RES_PAGEDESC:
case RES_CNTNT:
case RES_FOOTER:
- ASSERT( !this, ":-) Unbekanntes Attribut fuer Fly." );
+ OSL_ENSURE(false, ":-) unknown Attribute for Fly.");
// kein break;
case RES_CHAIN:
rSet.ClearItem( nWhich );
@@ -454,21 +447,36 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
if( MAKEFRMS == nMakeFrms )
rFlyFmt.MakeFrms();
- if ( pSaveUndo.get() )
+ return aTmpSet.Count() || MAKEFRMS == nMakeFrms;
+}
+
+BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
+{
+ if( !rSet.Count() )
+ return FALSE;
+
+ ::std::auto_ptr<SwUndoFmtAttrHelper> pSaveUndo;
+
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- // --> FME 2004-10-13 #i32968#
- DoUndo( bDoesUndo );
- // <--
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo far below, so leave it
+ pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
+ }
+
+ bool const bRet =
+ lcl_SetFlyFrmAttr(*this, &SwDoc::SetFlyFrmAnchor, rFlyFmt, rSet);
+ if ( pSaveUndo.get() )
+ {
if ( pSaveUndo->GetUndo() )
{
- AppendUndo( pSaveUndo->ReleaseUndo() );
+ GetIDocumentUndoRedo().AppendUndo( pSaveUndo->ReleaseUndo() );
}
}
SetModified();
- return aTmpSet.Count() || MAKEFRMS == nMakeFrms;
+ return bRet;
}
// --> OD 2009-07-20 #i73249#
@@ -480,13 +488,11 @@ void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
return;
}
- const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() );
- SetNoDrawUndoObj( true );
+ ::sw::DrawUndoGuard const drawUndoGuard(GetIDocumentUndoRedo());
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
UNDO_FLYFRMFMT_TITLE,
rFlyFrmFmt.GetObjTitle(),
sNewTitle ) );
@@ -494,8 +500,6 @@ void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
rFlyFrmFmt.SetObjTitle( sNewTitle, true );
- SetNoDrawUndoObj( bFormerIsNoDrawUndoObj );
-
SetModified();
}
@@ -507,13 +511,11 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
return;
}
- const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() );
- SetNoDrawUndoObj( true );
+ ::sw::DrawUndoGuard const drawUndoGuard(GetIDocumentUndoRedo());
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
UNDO_FLYFRMFMT_DESCRIPTION,
rFlyFrmFmt.GetObjDescription(),
sNewDescription ) );
@@ -521,8 +523,6 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
rFlyFrmFmt.SetObjDescription( sNewDescription, true );
- SetNoDrawUndoObj( bFormerIsNoDrawUndoObj );
-
SetModified();
}
// <--
@@ -544,17 +544,17 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
const SwFmtHoriOrient aHori( rFmt.GetHoriOrient() );
SwUndoSetFlyFmt* pUndo = 0;
- if( DoesUndo() )
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
+ if (bUndo)
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoSetFlyFmt( rFmt, rNewFmt ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the section causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
+ pUndo = new SwUndoSetFlyFmt( rFmt, rNewFmt );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
+ // #i32968# Inserting columns in the section causes MakeFrmFmt to put
+ // 2 objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
//Erstmal die Spalten setzen, sonst gibts nix als Aerger mit dem
//Set/Reset/Abgleich usw.
const SfxPoolItem* pItem;
@@ -621,11 +621,6 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SetModified();
- // --> FME 2004-10-13 #i32968#
- if ( pUndo )
- DoUndo( TRUE );
- // <--
-
return bChgAnchor;
}
@@ -660,7 +655,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
return false;
}
- StartUndo( UNDO_INSATTR, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSATTR, NULL );
BOOL bUnmark = FALSE;
for ( USHORT i = 0; i < _rMrkList.GetMarkCount(); ++i )
@@ -891,7 +886,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
}
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
return bUnmark;
@@ -1007,7 +1002,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
int nErr = Chainable( rSource, rDest );
if ( !nErr )
{
- StartUndo( UNDO_CHAINE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_CHAINE, NULL );
SwFlyFrmFmt& rDestFmt = (SwFlyFrmFmt&)rDest;
@@ -1041,7 +1036,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
}
SetAttr( aSet, rSource );
- EndUndo( UNDO_CHAINE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_CHAINE, NULL );
}
return nErr;
}
@@ -1053,14 +1048,14 @@ void SwDoc::Unchain( SwFrmFmt &rFmt )
SwFmtChain aChain( rFmt.GetChain() );
if ( aChain.GetNext() )
{
- StartUndo( UNDO_UNCHAIN, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_UNCHAIN, NULL );
SwFrmFmt *pFollow = aChain.GetNext();
aChain.SetNext( 0 );
SetAttr( aChain, rFmt );
aChain = pFollow->GetChain();
aChain.SetPrev( 0 );
SetAttr( aChain, *pFollow );
- EndUndo( UNDO_UNCHAIN, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_UNCHAIN, NULL );
}
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index eba51c0354f8..b335f50ed014 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -54,12 +54,14 @@
#include <fmtcntnt.hxx>
#include <frmatr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <pagefrm.hxx>
#include <hints.hxx> // fuer SwHyphenBug (in SetDefault)
#include <ndtxt.hxx>
#include <pam.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoAttribute.hxx>
#include <ndgrf.hxx>
#include <pagedesc.hxx> // Fuer Sonderbehandlung in InsFrmFmt
#include <rolbck.hxx> // Undo-Attr
@@ -357,12 +359,11 @@ void SwDoc::RstTxtAttrs(const SwPaM &rRg, BOOL bInclRefToxMark )
{
SwHistory* pHst = 0;
SwDataChanged aTmp( rRg, 0 );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoResetAttr* pUndo = new SwUndoResetAttr( rRg, RES_CHRFMT );
pHst = &pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
ParaRstFmt aPara( pStt, pEnd, pHst );
@@ -441,9 +442,8 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
}
// <--
SwHistory* pHst = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoResetAttr* pUndo = new SwUndoResetAttr( rRg,
static_cast<USHORT>(bTxtAttr ? RES_CONDTXTFMTCOLL : RES_TXTFMTCOLL ));
if( pAttrs && pAttrs->Count() )
@@ -451,7 +451,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
pUndo->SetAttrs( *pAttrs );
}
pHst = &pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
const SwPosition *pStt = pPam->Start(), *pEnd = pPam->End();
@@ -1125,9 +1125,9 @@ bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
{
SwDataChanged aTmp( rRg, 0 );
SwUndoAttr* pUndoAttr = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoAttr = new SwUndoAttr( rRg, rHt, nFlags );
}
@@ -1135,8 +1135,10 @@ bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
aSet.Put( rHt );
bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr );
- if( DoesUndo() )
- AppendUndo( pUndoAttr );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndoAttr );
+ }
if( bRet )
SetModified();
@@ -1148,16 +1150,18 @@ bool SwDoc::InsertItemSet ( const SwPaM &rRg, const SfxItemSet &rSet,
{
SwDataChanged aTmp( rRg, 0 );
SwUndoAttr* pUndoAttr = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoAttr = new SwUndoAttr( rRg, rSet, nFlags );
}
bool bRet = lcl_InsAttr( this, rRg, rSet, nFlags, pUndoAttr );
- if( DoesUndo() )
- AppendUndo( pUndoAttr );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndoAttr );
+ }
if( bRet )
SetModified();
@@ -1179,14 +1183,17 @@ void SwDoc::SetAttr( const SfxPoolItem& rAttr, SwFmt& rFmt )
// das alte in die Undo-History aufgenommen
void SwDoc::SetAttr( const SfxItemSet& rSet, SwFmt& rFmt )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoFmtAttrHelper aTmp( rFmt );
rFmt.SetFmtAttr( rSet );
if ( aTmp.GetUndo() )
{
- AppendUndo( aTmp.ReleaseUndo() );
+ GetIDocumentUndoRedo().AppendUndo( aTmp.ReleaseUndo() );
+ }
+ else
+ {
+ GetIDocumentUndoRedo().ClearRedo();
}
}
else
@@ -1200,16 +1207,18 @@ void SwDoc::SetAttr( const SfxItemSet& rSet, SwFmt& rFmt )
void SwDoc::ResetAttrAtFormat( const USHORT nWhichId,
SwFmt& rChangedFormat )
{
- SwUndo* pUndo = 0;
- if ( DoesUndo() )
- pUndo = new SwUndoFmtResetAttr( rChangedFormat, nWhichId );
+ SwUndo *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoFmtResetAttr( rChangedFormat, nWhichId )
+ : 0;
const BOOL bAttrReset = rChangedFormat.ResetFmtAttr( nWhichId );
if ( bAttrReset )
{
if ( pUndo )
- AppendUndo( pUndo );
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
SetModified();
}
@@ -1326,10 +1335,9 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
if( aNew.Count() && aCallMod.GetDepends() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoDefaultAttr( aOld ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDefaultAttr( aOld ) );
}
const SfxPoolItem* pTmpItem;
@@ -1396,12 +1404,12 @@ void SwDoc::DelCharFmt(USHORT nFmt, BOOL bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_CHAR,
SFX_STYLESHEET_ERASED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo =
new SwUndoCharFmtDelete(pDel, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pCharFmtTbl->DeleteAndDestroy(nFmt);
@@ -1438,11 +1446,11 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, BOOL bBroadcast )
SFX_STYLE_FAMILY_FRAME,
SFX_STYLESHEET_ERASED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoFrmFmtDelete(pFmt, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pFrmFmtTbl->DeleteAndDestroy( nPos );
@@ -1491,7 +1499,7 @@ USHORT SwDoc::GetTblFrmFmtCount(BOOL bUsed) const
USHORT nCount = pTblFrmFmtTbl->Count();
if(bUsed)
{
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
for ( USHORT i = nCount; i; )
{
if((*pTblFrmFmtTbl)[--i]->GetInfo( aGetHt ))
@@ -1509,8 +1517,7 @@ SwFrmFmt& SwDoc::GetTblFrmFmt(USHORT nFmt, BOOL bUsed ) const
USHORT nRemoved = 0;
if(bUsed)
{
- SwAutoFmtGetDocNode aGetHt( &aNodes );
-
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
for ( USHORT i = 0; i <= nFmt; i++ )
{
while ( (*pTblFrmFmtTbl)[ i + nRemoved]->GetInfo( aGetHt ))
@@ -1548,11 +1555,11 @@ SwFrmFmt *SwDoc::MakeFrmFmt(const String &rFmtName,
BroadcastStyleOperation(rFmtName, SFX_STYLE_FAMILY_PARA,
SFX_STYLESHEET_CREATED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoFrmFmtCreate(pFmt, pDerivedFrom, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
@@ -1581,11 +1588,11 @@ SwCharFmt *SwDoc::MakeCharFmt( const String &rFmtName,
pFmt->SetAuto( FALSE );
SetModified();
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoCharFmtCreate(pFmt, pDerivedFrom, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
@@ -1624,11 +1631,11 @@ SwTxtFmtColl* SwDoc::MakeTxtFmtColl( const String &rFmtName,
pFmtColl->SetAuto( FALSE );
SetModified();
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoTxtFmtCollCreate(pFmtColl, pDerivedFrom,
this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
@@ -1693,12 +1700,12 @@ void SwDoc::DelTxtFmtColl(USHORT nFmtColl, BOOL bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_PARA,
SFX_STYLESHEET_ERASED);
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndoTxtFmtCollDelete * pUndo =
new SwUndoTxtFmtCollDelete(pDel, this);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// Die FmtColl austragen
@@ -1807,16 +1814,15 @@ BOOL SwDoc::SetTxtFmtColl( const SwPaM &rRg,
SwHistory* pHst = 0;
BOOL bRet = TRUE;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
// --> OD 2008-04-15 #refactorlists#
SwUndoFmtColl* pUndo = new SwUndoFmtColl( rRg, pFmt,
bReset,
bResetListAttrs );
// <--
pHst = pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
ParaRstFmt aPara( pStt, pEnd, pHst );
@@ -2261,8 +2267,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
void SwDoc::ReplaceStyles( SwDoc& rSource )
{
- BOOL bIsUndo = DoesUndo();
- DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
CopyFmtArr( *rSource.pCharFmtTbl, *pCharFmtTbl,
&SwDoc::_MakeCharFmt, *pDfltCharFmt );
@@ -2313,15 +2318,13 @@ void SwDoc::ReplaceStyles( SwDoc& rSource )
}
}
- if( bIsUndo )
+ if (undoGuard.UndoWasEnabled())
{
- // es wurde am Nodes-Array gedreht!
- ClearRedo();
- DelAllUndoObj();
+ // nodes array was modified!
+ GetIDocumentUndoRedo().DelAllUndoObj();
}
SetModified();
- DoUndo( bIsUndo );
}
SwFmt* SwDoc::FindFmtByName( const SvPtrarr& rFmtArr,
@@ -2343,13 +2346,12 @@ SwFmt* SwDoc::FindFmtByName( const SvPtrarr& rFmtArr,
void SwDoc::MoveLeftMargin( const SwPaM& rPam, BOOL bRight, BOOL bModulus )
{
SwHistory* pHistory = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
SwUndoMoveLeftMargin* pUndo = new SwUndoMoveLeftMargin( rPam, bRight,
bModulus );
pHistory = &pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
const SvxTabStopItem& rTabItem = (SvxTabStopItem&)GetDefault( RES_PARATR_TABSTOP );
@@ -2409,10 +2411,9 @@ BOOL SwDoc::DontExpandFmt( const SwPosition& rPos, BOOL bFlag )
if( pTxtNd )
{
bRet = pTxtNd->DontExpandFmt( rPos.nContent, bFlag );
- if( bRet && DoesUndo() )
+ if( bRet && GetIDocumentUndoRedo().DoesUndo() )
{
- ClearRedo();
- AppendUndo( new SwUndoDontExpandFmt( rPos ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDontExpandFmt(rPos) );
}
}
return bRet;
@@ -2560,7 +2561,7 @@ void SwDoc::SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& rSet )
void SwDoc::ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet)
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// copying <rSet> to <aSet>
SfxItemSet aSet(rSet);
@@ -2588,7 +2589,7 @@ void SwDoc::ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet)
SwUndo * pUndo = new SwUndoFmtAttr(aOldSet, rFmt);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
rFmt.SetFmtAttr(rSet);
@@ -2599,7 +2600,7 @@ void SwDoc::RenameFmt(SwFmt & rFmt, const String & sNewName,
{
SfxStyleFamily eFamily = SFX_STYLE_FAMILY_ALL;
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = NULL;
@@ -2623,7 +2624,9 @@ void SwDoc::RenameFmt(SwFmt & rFmt, const String & sNewName,
}
if (pUndo)
- AppendUndo(pUndo);
+ {
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
}
rFmt.SetName(sNewName);
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 306f7b3dfcc8..ed4ce39eb8de 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -36,9 +36,11 @@
#include <pam.hxx>
#include <pagedesc.hxx>
#include <charfmt.hxx>
-#include <undobj.hxx>
+#include <UndoAttribute.hxx>
+#include <hints.hxx>
#include <rolbck.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndtxt.hxx>
#include <poolfmt.hxx>
#include <ftninfo.hxx>
@@ -259,10 +261,9 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
{
const SwFtnInfo &rOld = GetFtnInfo();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFootNoteInfo( rOld ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFootNoteInfo(rOld) );
}
BOOL bFtnPos = rInfo.ePos != rOld.ePos;
@@ -326,10 +327,10 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
{
if( !(GetEndNoteInfo() == rInfo) )
{
- if( DoesUndo() )
+ if(GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoEndNoteInfo( GetEndNoteInfo() ) );
+ SwUndo *const pUndo( new SwUndoEndNoteInfo( GetEndNoteInfo() ) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
BOOL bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset;
@@ -403,9 +404,9 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
rFtnArr.SeekEntry( pStt->nNode, &nPos );
SwUndoChangeFootNote* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo far below, so leave it
pUndo = new SwUndoChangeFootNote( rPam, rNumStr, nNumber, bIsEndNote );
}
@@ -479,8 +480,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
{
if( pUndo )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if ( bTypeChgd )
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 91c67cc96fb3..f528652ccd2d 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -43,6 +43,7 @@
#include <fmtinfmt.hxx>
#include <fmtanchr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -181,7 +182,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
return FALSE;
// Undo/Redline aufjedenfall abschalten
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON));
String sExt( pFilter->GetSuffixes().GetToken(0, ',') );
@@ -542,7 +543,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
return FALSE;
// Undo/Redline aufjedenfall abschalten
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON));
String sExt( pFilter->GetSuffixes().GetToken(0, ',') );
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 8395c358c495..3a7ac788f04d 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -28,8 +28,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <shellio.hxx>
#include <pam.hxx>
#include <swundo.hxx>
@@ -38,11 +43,6 @@
#include <crsrsh.hxx>
#include <docsh.hxx>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-
using namespace ::com::sun::star;
@@ -160,7 +160,7 @@ BOOL SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
pCntntNd = aCpyPam.GetCntntNode();
aCpyPam.GetPoint()->nContent.Assign( pCntntNd, pCntntNd->Len() );
- StartUndo( UNDO_INSGLOSSARY, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
SwPaM *_pStartCrsr = &rPaM, *__pStartCrsr = _pStartCrsr;
do {
@@ -187,7 +187,7 @@ BOOL SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
pShell->SaveTblBoxCntnt( &rInsPos );
} while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) !=
__pStartCrsr );
- EndUndo( UNDO_INSGLOSSARY, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, NULL );
UnlockExpFlds();
if( !IsExpFldsLocked() )
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index cc29cc8406d0..3a633ec6fed8 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -75,6 +75,7 @@
#include <ndnotxt.hxx>
#include <ndole.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <pagefrm.hxx>
#include <cntfrm.hxx>
@@ -85,7 +86,7 @@
#include <dcontact.hxx>
#include <swundo.hxx>
#include <flypos.hxx>
-#include <undobj.hxx>
+#include <UndoInsert.hxx>
#include <expfld.hxx> // InsertLabel
#include <poolfmt.hxx> // PoolVorlagen-Id's
#include <docary.hxx>
@@ -197,10 +198,10 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet )
if( pSet ) // noch ein paar Attribute setzen ?
pFmt->SetFmtAttr( *pSet );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pFmt,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsLayFmt(pFmt, 0, 0));
}
}
break;
@@ -253,7 +254,7 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
}
const SwNodeIndex* pCntIdx = pFmt->GetCntnt().GetCntntIdx();
- if( pCntIdx && !DoesUndo() )
+ if (pCntIdx && !GetIDocumentUndoRedo().DoesUndo())
{
//Verbindung abbauen, falls es sich um ein OLE-Objekt handelt.
SwOLENode* pOLENd = GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
@@ -295,11 +296,10 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
// erstmal sind nur Fly's Undofaehig
const sal_uInt16 nWh = pFmt->Which();
- if( DoesUndo() && (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh) )
+ if (GetIDocumentUndoRedo().DoesUndo() &&
+ (RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh))
{
- // erstmal werden alle Undo - Objecte geloescht.
- ClearRedo();
- AppendUndo( new SwUndoDelLayFmt( pFmt ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDelLayFmt( pFmt ));
}
else
{
@@ -494,10 +494,9 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
}
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pDest,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoInsLayFmt(pDest,0,0));
}
// sorge dafuer das auch Fly's in Fly's kopiert werden
@@ -536,10 +535,9 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
else
pDest->SetFmtAttr( rNewAnchor );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pDest,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoInsLayFmt(pDest,0,0));
}
}
@@ -729,12 +727,12 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
if( GetRootFrm() )
pFmt->MakeFrms(); // ???
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
ULONG nNodeIdx = rAnchPos.nNode.GetIndex();
xub_StrLen nCntIdx = rAnchPos.nContent.GetIndex();
- AppendUndo( new SwUndoInsLayFmt( pFmt, nNodeIdx, nCntIdx ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsLayFmt( pFmt, nNodeIdx, nCntIdx ));
}
SetModified();
@@ -803,7 +801,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
{
SwFmtAnchor& rAnch = (SwFmtAnchor&)rSet.Get( RES_ANCHOR );
- StartUndo( UNDO_INSLAYFMT, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSLAYFMT, NULL );
SwFlyFrmFmt* pFmt = MakeFlySection( rAnch.GetAnchorId(), rPam.GetPoint(),
&rSet, pParent );
@@ -871,8 +869,11 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
GetNodes().Delete( aIndex, 1 );
//JP erstmal ein Hack, solange keine Flys/Headers/Footers Undofaehig sind
-if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
- DelAllUndoObj();
+// werden erstmal alle Undo - Objecte geloescht.
+if( GetIDocumentUndoRedo().DoesUndo() )
+{
+ GetIDocumentUndoRedo().DelAllUndoObj();
+}
}
else
@@ -888,9 +889,10 @@ if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
*/
// copy all Pams and then delete all
SwPaM* pTmp = (SwPaM*)&rPam;
- BOOL bOldFlag = mbCopyIsMove, bOldUndo = mbUndo;
+ BOOL bOldFlag = mbCopyIsMove;
+ bool const bOldUndo = GetIDocumentUndoRedo().DoesUndo();
mbCopyIsMove = TRUE;
- mbUndo = FALSE;
+ GetIDocumentUndoRedo().DoUndo(false);
do {
if( pTmp->HasMark() &&
*pTmp->GetPoint() != *pTmp->GetMark() )
@@ -900,7 +902,7 @@ if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
pTmp = static_cast<SwPaM*>(pTmp->GetNext());
} while ( &rPam != pTmp );
mbCopyIsMove = bOldFlag;
- mbUndo = bOldUndo;
+ GetIDocumentUndoRedo().DoUndo(bOldUndo);
pTmp = (SwPaM*)&rPam;
do {
@@ -917,7 +919,7 @@ if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
SetModified();
- EndUndo( UNDO_INSLAYFMT, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSLAYFMT, NULL );
return pFmt;
}
@@ -1016,10 +1018,9 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
// <--
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoInsLayFmt( pFmt,0,0 ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoInsLayFmt(pFmt, 0, 0) );
}
SetModified();
@@ -1225,31 +1226,27 @@ void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWh
}
-SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
+static SwFlyFrmFmt *
+lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
+ SwUndoInsertLabel *const pUndo,
+ SwLabelType const eType, String const& rTxt, String const& rSeparator,
const String& rNumberingSeparator,
const sal_Bool bBefore, const sal_uInt16 nId, const ULONG nNdIdx,
const String& rCharacterStyle,
const sal_Bool bCpyBrd )
{
- sal_Bool bWasUndo = DoesUndo();
- SwUndoInsertLabel* pUndo = 0;
- if( bWasUndo )
- {
- ClearRedo();
- pUndo = new SwUndoInsertLabel( eType, rTxt, rSeparator, rNumberingSeparator,
- bBefore, nId, rCharacterStyle, bCpyBrd );
- DoUndo( sal_False );
- }
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
sal_Bool bTable = sal_False; //Um etwas Code zu sparen.
//Erstmal das Feld bauen, weil ueber den Namen die TxtColl besorgt werden
//muss
- ASSERT( nId == USHRT_MAX || nId < GetFldTypes()->Count(), "FldType ueberindiziert." );
- SwFieldType *pType = nId != USHRT_MAX ? (*GetFldTypes())[nId] : NULL;
- ASSERT( !pType || pType->Which() == RES_SETEXPFLD, "Falsche Id fuer Label" );
+ OSL_ENSURE( nId == USHRT_MAX || nId < rDoc.GetFldTypes()->Count(),
+ "FldType index out of bounds." );
+ SwFieldType *pType = (nId != USHRT_MAX) ? (*rDoc.GetFldTypes())[nId] : NULL;
+ OSL_ENSURE(!pType || pType->Which() == RES_SETEXPFLD, "wrong Id for Label");
- SwTxtFmtColl *pColl = NULL;
+ SwTxtFmtColl * pColl = NULL;
if( pType )
{
for( sal_uInt16 i = pTxtFmtCollTbl->Count(); i; )
@@ -1264,7 +1261,9 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
}
if( !pColl )
- pColl = GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ {
+ pColl = rDoc.GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ }
SwTxtNode *pNew = NULL;
SwFlyFrmFmt* pNewFmt = NULL;
@@ -1278,7 +1277,7 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
//Am Anfang/Ende der Fly-Section den entsprechenden Node mit Feld
//einfuegen (Frame wird automatisch erzeugt).
{
- SwStartNode *pSttNd = GetNodes()[nNdIdx]->GetStartNode();
+ SwStartNode *pSttNd = rDoc.GetNodes()[nNdIdx]->GetStartNode();
ASSERT( pSttNd, "Kein StartNode in InsertLabel." );
ULONG nNode;
if( bBefore )
@@ -1298,8 +1297,8 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
pUndo->SetNodePos( nNode );
//Node fuer Beschriftungsabsatz erzeugen.
- SwNodeIndex aIdx( GetNodes(), nNode );
- pNew = GetNodes().MakeTxtNode( aIdx, pColl );
+ SwNodeIndex aIdx( rDoc.GetNodes(), nNode );
+ pNew = rDoc.GetNodes().MakeTxtNode( aIdx, pColl );
}
break;
@@ -1311,12 +1310,12 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
// Frames erzeugen.
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
- SwFrmFmt *pOldFmt = GetNodes()[nNdIdx]->GetFlyFmt();
+ SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
ASSERT( pOldFmt, "Format des Fly nicht gefunden." );
pOldFmt->DelFrms();
- pNewFmt = MakeFlyFrmFmt( GetUniqueFrameName(),
- GetFrmFmtFromPool( RES_POOLFRM_FRAME ));
+ pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
+ rDoc.GetFrmFmtFromPool(RES_POOLFRM_FRAME) );
/* #i6447#: Only the selected items are copied from the old
format. */
@@ -1374,8 +1373,8 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
aFrmSize.SetHeightSizeType( ATT_MIN_SIZE );
pNewSet->Put( aFrmSize );
- SwStartNode* pSttNd = GetNodes().MakeTextSection(
- SwNodeIndex( GetNodes().GetEndOfAutotext() ),
+ SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection(
+ SwNodeIndex( rDoc.GetNodes().GetEndOfAutotext() ),
SwFlyStartNode, pColl );
pNewSet->Put( SwFmtCntnt( pSttNd ));
@@ -1454,7 +1453,7 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
break;
default:
- ASSERT( !this, "Neuer LabelType?." );
+ OSL_ENSURE(false, "unknown LabelType?");
}
ASSERT( pNew, "No Label inserted" );
if( pNew )
@@ -1496,11 +1495,11 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
pNew->InsertItem( aFmt, nIdx, nIdx );
if(rCharacterStyle.Len())
{
- SwCharFmt* pCharFmt = FindCharFmtByName( rCharacterStyle );
+ SwCharFmt* pCharFmt = rDoc.FindCharFmtByName(rCharacterStyle);
if( !pCharFmt )
{
const USHORT nMyId = SwStyleNameMapper::GetPoolIdFromUIName(rCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
- pCharFmt = GetCharFmtFromPool( nMyId );
+ pCharFmt = rDoc.GetCharFmtFromPool( nMyId );
}
if (pCharFmt)
{
@@ -1520,7 +1519,8 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
}
else
{
- SwTableNode *pNd = GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
+ SwTableNode *const pNd =
+ rDoc.GetNodes()[nNdIdx]->GetStartNode()->GetTableNode();
SwTable &rTbl = pNd->GetTable();
if ( !rTbl.GetFrmFmt()->GetKeep().GetValue() )
rTbl.GetFrmFmt()->SetFmtAttr( SvxFmtKeepItem( sal_True, RES_KEEP ) );
@@ -1528,18 +1528,45 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
pUndo->SetUndoKeep();
}
}
- SetModified();
+ rDoc.SetModified();
}
- if( pUndo )
- AppendUndo( pUndo );
+ return pNewFmt;
+}
+
+SwFlyFrmFmt *
+SwDoc::InsertLabel(
+ SwLabelType const eType, String const& rTxt, String const& rSeparator,
+ String const& rNumberingSeparator,
+ sal_Bool const bBefore, sal_uInt16 const nId, ULONG const nNdIdx,
+ String const& rCharacterStyle,
+ sal_Bool const bCpyBrd )
+{
+ SwUndoInsertLabel * pUndo(0);
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ pUndo = new SwUndoInsertLabel(
+ eType, rTxt, rSeparator, rNumberingSeparator,
+ bBefore, nId, rCharacterStyle, bCpyBrd );
+ }
+
+ SwFlyFrmFmt *const pNewFmt = lcl_InsertLabel(*this, pTxtFmtCollTbl, pUndo,
+ eType, rTxt, rSeparator, rNumberingSeparator, bBefore,
+ nId, nNdIdx, rCharacterStyle, bCpyBrd);
+
+ if (pUndo)
+ {
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
else
- DelAllUndoObj();
- DoUndo( bWasUndo );
+ {
+ GetIDocumentUndoRedo().DelAllUndoObj();
+ }
return pNewFmt;
}
+
/*************************************************************************
|*
|* SwDoc::InsertDrawLabel()
@@ -1549,41 +1576,25 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co
|*
|*************************************************************************/
-SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
+static SwFlyFrmFmt *
+lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
+ SwUndoInsertLabel *const pUndo, SwDrawFrmFmt *const pOldFmt,
+ String const& rTxt,
const String& rSeparator,
const String& rNumberSeparator,
const sal_uInt16 nId,
const String& rCharacterStyle,
SdrObject& rSdrObj )
{
-
- SwDrawContact* pContact = (SwDrawContact*)GetUserCall( &rSdrObj );
- ASSERT( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
- "Kein DrawFrmFmt" );
- if ( !pContact )
- return 0;
-
- SwDrawFrmFmt* pOldFmt = (SwDrawFrmFmt *)pContact->GetFmt();
- if( !pOldFmt )
- return 0;
-
- sal_Bool bWasUndo = DoesUndo();
- sal_Bool bWasNoDrawUndo = IsNoDrawUndoObj();
- SwUndoInsertLabel* pUndo = 0;
- if( bWasUndo )
- {
- ClearRedo();
- pUndo = new SwUndoInsertLabel(
- LTYPE_DRAW, rTxt, rSeparator, rNumberSeparator, sal_False, nId, rCharacterStyle, sal_False );
- DoUndo( sal_False );
- SetNoDrawUndoObj( sal_True );
- }
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
+ ::sw::DrawUndoGuard const drawUndoGuard(rDoc.GetIDocumentUndoRedo());
// Erstmal das Feld bauen, weil ueber den Namen die TxtColl besorgt
// werden muss
- ASSERT( nId == USHRT_MAX || nId < GetFldTypes()->Count(), "FldType overflow" );
- SwFieldType *pType = nId != USHRT_MAX ? (*GetFldTypes())[nId] : 0;
- ASSERT( !pType || pType->Which() == RES_SETEXPFLD, "Wrong label id" );
+ OSL_ENSURE( nId == USHRT_MAX || nId < rDoc.GetFldTypes()->Count(),
+ "FldType index out of bounds" );
+ SwFieldType *pType = nId != USHRT_MAX ? (*rDoc.GetFldTypes())[nId] : 0;
+ OSL_ENSURE( !pType || pType->Which() == RES_SETEXPFLD, "Wrong label id" );
SwTxtFmtColl *pColl = NULL;
if( pType )
@@ -1600,7 +1611,9 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
}
if( !pColl )
- pColl = GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ {
+ pColl = rDoc.GetTxtCollFromPool( RES_POOLCOLL_LABEL );
+ }
SwTxtNode* pNew = NULL;
SwFlyFrmFmt* pNewFmt = NULL;
@@ -1639,8 +1652,8 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
// Den Rahmen ggf. in den Hintergrund schicken.
// OD 02.07.2003 #108784# - consider 'invisible' hell layer.
- if ( GetHellId() != nLayerId &&
- GetInvisibleHellId() != nLayerId )
+ if ( rDoc.GetHellId() != nLayerId &&
+ rDoc.GetInvisibleHellId() != nLayerId )
{
SvxOpaqueItem aOpaque( RES_OPAQUE );
aOpaque.SetValue( sal_True );
@@ -1669,11 +1682,12 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
pNewSet->Put( pOldFmt->GetULSpace() );
SwStartNode* pSttNd =
- GetNodes().MakeTextSection( SwNodeIndex( GetNodes().GetEndOfAutotext() ),
+ rDoc.GetNodes().MakeTextSection(
+ SwNodeIndex( rDoc.GetNodes().GetEndOfAutotext() ),
SwFlyStartNode, pColl );
- pNewFmt = MakeFlyFrmFmt( GetUniqueFrameName(),
- GetFrmFmtFromPool( RES_POOLFRM_FRAME ) );
+ pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
+ rDoc.GetFrmFmtFromPool( RES_POOLFRM_FRAME ) );
// JP 28.10.99: Bug 69487 - set border and shadow to default if the
// template contains any.
@@ -1712,11 +1726,15 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
pNewSet->ClearItem();
pNewSet->Put( SwFmtSurround( SURROUND_NONE ) );
- if( nLayerId == GetHellId() )
- rSdrObj.SetLayer( GetHeavenId() );
+ if (nLayerId == rDoc.GetHellId())
+ {
+ rSdrObj.SetLayer( rDoc.GetHeavenId() );
+ }
// OD 02.07.2003 #108784# - consider drawing objects in 'invisible' hell layer
- else if( nLayerId == GetInvisibleHellId() )
- rSdrObj.SetLayer( GetInvisibleHeavenId() );
+ else if (nLayerId == rDoc.GetInvisibleHellId())
+ {
+ rSdrObj.SetLayer( rDoc.GetInvisibleHeavenId() );
+ }
pNewSet->Put( SvxLRSpaceItem( RES_LR_SPACE ) );
pNewSet->Put( SvxULSpaceItem( RES_UL_SPACE ) );
@@ -1785,11 +1803,11 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
pNew->InsertItem( aFmt, nIdx, nIdx );
if ( rCharacterStyle.Len() )
{
- SwCharFmt* pCharFmt = FindCharFmtByName( rCharacterStyle );
+ SwCharFmt * pCharFmt = rDoc.FindCharFmtByName(rCharacterStyle);
if ( !pCharFmt )
{
const USHORT nMyId = SwStyleNameMapper::GetPoolIdFromUIName( rCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
- pCharFmt = GetCharFmtFromPool( nMyId );
+ pCharFmt = rDoc.GetCharFmtFromPool( nMyId );
}
if ( pCharFmt )
{
@@ -1801,18 +1819,54 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt,
}
}
- if( pUndo )
+ return pNewFmt;
+}
+
+SwFlyFrmFmt* SwDoc::InsertDrawLabel(
+ String const& rTxt,
+ String const& rSeparator,
+ String const& rNumberSeparator,
+ sal_uInt16 const nId,
+ String const& rCharacterStyle,
+ SdrObject& rSdrObj )
+{
+ SwDrawContact *const pContact =
+ static_cast<SwDrawContact*>(GetUserCall( &rSdrObj ));
+ OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
+ "InsertDrawLabel(): not a DrawFrmFmt" );
+ if (!pContact)
+ return 0;
+
+ SwDrawFrmFmt* pOldFmt = (SwDrawFrmFmt *)pContact->GetFmt();
+ if (!pOldFmt)
+ return 0;
+
+ SwUndoInsertLabel * pUndo = 0;
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- AppendUndo( pUndo );
- SetNoDrawUndoObj( bWasNoDrawUndo );
+ GetIDocumentUndoRedo().ClearRedo();
+ pUndo = new SwUndoInsertLabel(
+ LTYPE_DRAW, rTxt, rSeparator, rNumberSeparator, sal_False,
+ nId, rCharacterStyle, sal_False );
+ }
+
+ SwFlyFrmFmt *const pNewFmt = lcl_InsertDrawLabel(
+ *this, pTxtFmtCollTbl, pUndo, pOldFmt,
+ rTxt, rSeparator, rNumberSeparator, nId, rCharacterStyle, rSdrObj);
+
+ if (pUndo)
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
- DelAllUndoObj();
- DoUndo( bWasUndo );
+ {
+ GetIDocumentUndoRedo().DelAllUndoObj();
+ }
return pNewFmt;
}
+
/*************************************************************************
|*
|* IDocumentTimerAccess-methods
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index e0d3437959c7..c20eaa55ce12 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -96,6 +96,7 @@
#include <IGrammarContact.hxx>
#include <tblsel.hxx>
#include <MarkManager.hxx>
+#include <UndoManager.hxx>
#include <unochart.hxx>
#include <cmdid.h> // fuer den dflt - Printer in SetJob
@@ -217,12 +218,14 @@ BOOL lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
* exportierte Methoden
*/
-SwDoc::SwDoc() :
- aNodes( this ),
- aUndoNodes( this ),
+SwDoc::SwDoc()
+ : m_pNodes( new SwNodes(this) )
+ ,
mpAttrPool(new SwAttrPool(this)),
pMarkManager(new ::sw::mark::MarkManager(*this)),
m_pMetaFieldManager(new ::sw::MetaFieldManager()),
+ m_pUndoManager(new ::sw::UndoManager(
+ ::std::auto_ptr<SwNodes>(new SwNodes(this)), *this, *this, *this)),
pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt ) ),
pColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, pDfltFrmFmt ) ),
@@ -240,7 +243,6 @@ SwDoc::SwDoc() :
pDefTOXBases( new SwDefTOXBase_Impl() ),
pLayout( 0 ), // Rootframe des spezifischen Layouts.
pDrawModel( 0 ),
- pUndos( new SwUndos( 0, 20 ) ),
pUpdtFlds( new SwDocUpdtFld() ),
pFldTypes( new SwFldTypes() ),
pVirDev( 0 ),
@@ -281,10 +283,6 @@ SwDoc::SwDoc() :
mpListItemsList( new tImplSortedNodeNumList() ),
// <--
m_pXmlIdRegistry(),
- nUndoPos( 0 ),
- nUndoSavePos( 0 ),
- nUndoCnt( 0 ),
- nUndoSttEnd( 0 ),
nAutoFmtRedlnCommentNo( 0 ),
nLinkUpdMode( GLOBALSETTING ),
eFldUpdMode( AUTOUPD_GLOBALSETTING ),
@@ -309,13 +307,11 @@ SwDoc::SwDoc() :
mbGlossDoc =
mbModified =
mbDtor =
- mbUndo =
mbPageNums =
mbLoaded =
mbUpdateExpFld =
mbNewDoc =
mbCopyIsMove =
- mbNoDrawUndoObj =
mbBrowseMode =
mbInReading =
mbInXMLImport =
@@ -341,7 +337,6 @@ SwDoc::SwDoc() :
// <--
false;
- mbGroupUndo =
mbNewFldLst =
mbVisibleLinks =
mbPurgeOLE =
@@ -433,8 +428,10 @@ SwDoc::SwDoc() :
pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
// <--
- new SwTxtNode( SwNodeIndex( aUndoNodes.GetEndOfContent() ), pDfltTxtFmtColl );
- new SwTxtNode( SwNodeIndex( aNodes.GetEndOfContent() ),
+ new SwTxtNode(
+ SwNodeIndex(GetUndoManager().GetUndoNodes().GetEndOfContent()),
+ pDfltTxtFmtColl );
+ new SwTxtNode( SwNodeIndex( GetNodes().GetEndOfContent() ),
GetTxtCollFromPool( RES_POOLCOLL_STANDARD ));
// den eigenen IdleTimer setzen
@@ -474,6 +471,14 @@ SwDoc::SwDoc() :
SwDoc::~SwDoc()
{
+ // nothing here should create Undo actions!
+ GetIDocumentUndoRedo().DoUndo(false);
+
+ if (pDocShell)
+ {
+ pDocShell->SetUndoManager(0);
+ }
+
// --> OD 2007-03-16 #i73788#
SwPauseThreadStarting aPauseThreadStarting;
// <--
@@ -522,8 +527,6 @@ SwDoc::~SwDoc()
delete pPgPViewPrtData;
- mbUndo = FALSE; // immer das Undo abschalten !!
- // damit die Fussnotenattribute die Fussnotennodes in Frieden lassen.
mbDtor = TRUE;
DELETEZ( pLayout );
@@ -549,13 +552,14 @@ SwDoc::~SwDoc()
// die KapitelNummern / Nummern muessen vor den Vorlage geloescht werden
// ansonsten wird noch staendig geupdatet !!!
- aNodes.pOutlineNds->Remove( USHORT(0), aNodes.pOutlineNds->Count() );
- aUndoNodes.pOutlineNds->Remove( USHORT(0), aUndoNodes.pOutlineNds->Count() );
+ m_pNodes->pOutlineNds->Remove(USHORT(0), m_pNodes->pOutlineNds->Count());
+ SwNodes & rUndoNodes( GetUndoManager().GetUndoNodes() );
+ rUndoNodes.pOutlineNds->Remove(USHORT(0), rUndoNodes.pOutlineNds->Count());
pFtnIdxs->Remove( USHORT(0), pFtnIdxs->Count() );
- pUndos->DeleteAndDestroy( 0, pUndos->Count() ); //Es koennen in den Attributen noch
- //noch indizes angemeldet sein.
+ // indices could be registered in attributes
+ m_pUndoManager->DelAllUndoObj();
// in den BookMarks sind Indizies auf den Content. Diese muessen vorm
// loesche der Nodes geloescht werden.
@@ -598,8 +602,8 @@ SwDoc::~SwDoc()
// Inhaltssections loeschen
// nicht erst durch den SwNodes-DTOR, damit Formate
// keine Abhaengigen mehr haben.
- aNodes.DelNodes( SwNodeIndex( aNodes ), aNodes.Count() );
- aUndoNodes.DelNodes( SwNodeIndex( aUndoNodes ), aUndoNodes.Count() );
+ m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
+ rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
// Formate loeschen, spaeter mal permanent machen.
@@ -691,7 +695,6 @@ SwDoc::~SwDoc()
delete pFtnIdxs;
delete pFldTypes;
delete pTOXTypes;
- delete pUndos;
delete pDocStat;
delete pEmptyPageFmt;
delete pColumnContFmt;
@@ -754,7 +757,15 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
{
if( pDocShell != pDSh )
{
+ if (pDocShell)
+ {
+ pDocShell->SetUndoManager(0);
+ }
pDocShell = pDSh;
+ if (pDocShell)
+ {
+ pDocShell->SetUndoManager(& GetUndoManager());
+ }
pLinkMgr->SetPersist( pDocShell );
//JP 27.08.98: Bug 55570 - DocShell Pointer auch am DrawModel setzen
@@ -793,9 +804,8 @@ SfxObjectShell* SwDoc::GetPersist() const
void SwDoc::ClearDoc()
{
- BOOL bOldUndo = mbUndo;
- DelAllUndoObj();
- mbUndo = FALSE; // immer das Undo abschalten !!
+ GetIDocumentUndoRedo().DelAllUndoObj();
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
// Undo-Benachrichtigung vom Draw abschalten
if( pDrawModel )
@@ -906,8 +916,6 @@ void SwDoc::ClearDoc()
pFirstNd->ResetAllAttr();
// delete now the dummy pagedesc
DelPageDesc( nDummyPgDsc );
-
- mbUndo = bOldUndo;
}
void SwDoc::SetPreViewPrtData( const SwPagePreViewPrtData* pNew )
@@ -1062,6 +1070,30 @@ SwDoc::GetMetaFieldManager()
return *m_pMetaFieldManager;
}
+::sw::UndoManager &
+SwDoc::GetUndoManager()
+{
+ return *m_pUndoManager;
+}
+
+::sw::UndoManager const&
+SwDoc::GetUndoManager() const
+{
+ return *m_pUndoManager;
+}
+
+IDocumentUndoRedo &
+SwDoc::GetIDocumentUndoRedo()
+{
+ return *m_pUndoManager;
+}
+
+IDocumentUndoRedo const&
+SwDoc::GetIDocumentUndoRedo() const
+{
+ return *m_pUndoManager;
+}
+
void SwDoc::InitTOXTypes()
{
ShellResource* pShellRes = ViewShell::GetShellRes();
@@ -1182,7 +1214,7 @@ void SwDoc::Paste( const SwDoc& rSource )
aCpyPam.SetMark();
aCpyPam.Move( fnMoveForward, fnGoDoc );
- this->StartUndo( UNDO_INSGLOSSARY, NULL );
+ this->GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
this->LockExpFlds();
{
@@ -1236,7 +1268,7 @@ void SwDoc::Paste( const SwDoc& rSource )
}
}
- this->EndUndo( UNDO_INSGLOSSARY, NULL );
+ this->GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, NULL );
UnlockExpFlds();
UpdateFlds(NULL, false);
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 6ba37816b0dc..ed6ece5c8f97 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/date.hxx>
#include <tools/time.hxx>
@@ -35,11 +36,14 @@
#include <ftninfo.hxx>
#include <ftnidx.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <doctxm.hxx> // pTOXBaseRing
#include <poolfmt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoRedline.hxx>
+#include <UndoNumbering.hxx>
#include <swundo.hxx>
#include <SwUndoFmt.hxx>
#include <rolbck.hxx>
@@ -49,9 +53,7 @@
#include <txtfrm.hxx>
#include <pamtyp.hxx>
#include <redline.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <editeng/adjitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <frmatr.hxx>
@@ -371,11 +373,11 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
return FALSE;
/* <-- #i13747 # */
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- StartUndo(UNDO_OUTLINE_LR, NULL);
- AppendUndo( new SwUndoOutlineLeftRight( rPam, nOffset ) );
+ GetIDocumentUndoRedo().StartUndo(UNDO_OUTLINE_LR, NULL);
+ SwUndo *const pUndoOLR( new SwUndoOutlineLeftRight( rPam, nOffset ) );
+ GetIDocumentUndoRedo().AppendUndo(pUndoOLR);
}
// 2. allen Nodes die neue Vorlage zuweisen
@@ -417,8 +419,10 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
n++;
// Undo ???
}
- if (DoesUndo())
- EndUndo(UNDO_OUTLINE_LR, NULL);
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo(UNDO_OUTLINE_LR, NULL);
+ }
ChkCondColls();
SetModified();
@@ -436,9 +440,11 @@ BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
& rEnd = &rStt == rPam.GetPoint() ? *rPam.GetMark()
: *rPam.GetPoint();
if( !GetNodes().GetOutLineNds().Count() || !nOffset ||
- rStt.nNode.GetIndex() < aNodes.GetEndOfExtras().GetIndex() ||
- rEnd.nNode.GetIndex() < aNodes.GetEndOfExtras().GetIndex() )
+ (rStt.nNode.GetIndex() < GetNodes().GetEndOfExtras().GetIndex()) ||
+ (rEnd.nNode.GetIndex() < GetNodes().GetEndOfExtras().GetIndex()))
+ {
return FALSE;
+ }
USHORT nAktPos = 0;
SwNodeIndex aSttRg( rStt.nNode ), aEndRg( rEnd.nNode );
@@ -572,7 +578,7 @@ BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
// setze die Position auf den Dokumentanfang.
// Sollten da Bereiche oder Tabellen stehen, so werden sie nach
// hinten verschoben.
- nNewPos = Max( nNewPos, aNodes.GetEndOfExtras().GetIndex() + 2 );
+ nNewPos = Max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 );
long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex());
SwPaM aPam( aSttRg, aEndRg, 0, -1 );
@@ -976,11 +982,12 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
const bool bResetIndentAttrs )
{
SwUndoInsNum * pUndo = NULL;
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- StartUndo( UNDO_INSNUM, NULL ); // Klammerung fuer die Attribute!
- AppendUndo( pUndo = new SwUndoInsNum( rPam, rRule ) );
+ // Start/End for attributes!
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSNUM, NULL );
+ pUndo = new SwUndoInsNum( rPam, rRule );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
SwNumRule * pNew = FindNumRulePtr( rRule.GetName() );
@@ -1112,8 +1119,10 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
// <--
- if (DoesUndo())
- EndUndo( UNDO_INSNUM, NULL );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSNUM, NULL );
+ }
SetModified();
}
@@ -1158,10 +1167,10 @@ void SwDoc::SetNumRuleStart( const SwPosition& rPos, BOOL bFlag )
const SwNumRule* pRule = pTxtNd->GetNumRule();
if( pRule && !bFlag != !pTxtNd->IsListRestart())
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoNumRuleStart( rPos, bFlag ));
+ SwUndo *const pUndo( new SwUndoNumRuleStart(rPos, bFlag) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pTxtNd->SetListRestart(bFlag ? true : false);
@@ -1193,10 +1202,10 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, USHORT nStt )
if ( !pTxtNd->HasAttrListRestartValue() ||
pTxtNd->GetAttrListRestartValue() != nStt )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoNumRuleStart( rPos, nStt ));
+ SwUndo *const pUndo( new SwUndoNumRuleStart(rPos, nStt) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
pTxtNd->SetAttrListRestartValue( nStt );
@@ -1222,12 +1231,11 @@ BOOL SwDoc::DelNumRule( const String& rName, BOOL bBroadcast )
if( USHRT_MAX != nPos && !IsUsed( *(*pNumRuleTbl)[ nPos ] ))
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo =
new SwUndoNumruleDelete(*(*pNumRuleTbl)[nPos], this);
-
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
@@ -1279,12 +1287,11 @@ void SwDoc::ChgNumRuleFmts( const SwNumRule& rRule, const String * pName )
if( pRule )
{
SwUndoInsNum* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
pUndo = new SwUndoInsNum( *pRule, rRule );
pUndo->GetHistory();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
::lcl_ChgNumRule( *this, rRule );
@@ -1303,11 +1310,10 @@ sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName,
if (pNumRule)
{
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoNumruleRename(rOldName, rNewName, this);
-
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// --> OD 2008-02-19 #refactorlists#
@@ -1390,11 +1396,12 @@ BOOL SwDoc::ReplaceNumRule( const SwPosition& rPos,
{
// --> OD 2008-02-19 #refactorlists#
SwUndoInsNum* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- StartUndo( UNDO_START, NULL ); // Klammerung fuer die Attribute!
- AppendUndo( pUndo = new SwUndoInsNum( rPos, *pNewRule, rOldRule ) );
+ // Start/End for attributes!
+ GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ pUndo = new SwUndoInsNum( rPos, *pNewRule, rOldRule );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
// --> OD 2008-02-19 #refactorlists#
@@ -1477,7 +1484,7 @@ BOOL SwDoc::ReplaceNumRule( const SwPosition& rPos,
pTxtNd->NumRuleChgd();
}
}
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
bRet = TRUE; // #106897#
@@ -1615,10 +1622,10 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
}
SwUndoDelNum* pUndo;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoDelNum( rPam ) );
+ pUndo = new SwUndoDelNum( rPam );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
pUndo = 0;
@@ -1919,8 +1926,8 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
pNode = &aIdx.GetNode();
}
- while (! (pNode == aNodes.DocumentSectionStartNode(pStartFromNode) ||
- pNode == aNodes.DocumentSectionEndNode(pStartFromNode)));
+ while (!(pNode == GetNodes().DocumentSectionStartNode(pStartFromNode) ||
+ pNode == GetNodes().DocumentSectionEndNode(pStartFromNode)));
// <--
}
@@ -2003,10 +2010,10 @@ BOOL SwDoc::NumUpDown( const SwPaM& rPam, BOOL bDown )
if( bRet )
{
/* <-- #i24560# */
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoNumUpDown( rPam, nDiff ) );
+ SwUndo *const pUndo( new SwUndoNumUpDown(rPam, nDiff) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
String sNumRule;
@@ -2233,7 +2240,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
if( !pOwnRedl )
{
- StartUndo( UNDO_START, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
// zuerst das Insert, dann das Loeschen
SwPosition aInsPos( aIdx );
@@ -2308,12 +2315,13 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
RedlineMode_t eOld = GetRedlineMode();
checkRedlining(eOld);
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode(
(RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE));
- AppendUndo( new SwUndoRedlineDelete( aPam, UNDO_DELETE ));
+ SwUndo *const pUndo(new SwUndoRedlineDelete(aPam, UNDO_DELETE));
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
SwRedline* pNewRedline = new SwRedline( nsRedlineType_t::REDLINE_DELETE, aPam );
@@ -2328,7 +2336,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
//JP 06.01.98: MUSS noch optimiert werden!!!
SetRedlineMode( eOld );
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
return TRUE;
@@ -2351,7 +2359,7 @@ SetRedlineMode( eOld );
SwUndoMoveNum* pUndo = 0;
ULONG nMoved = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
pUndo = new SwUndoMoveNum( rPam, nOffset, bIsOutlMv );
nMoved = rPam.End()->nNode.GetIndex() - rPam.Start()->nNode.GetIndex() + 1;
@@ -2362,13 +2370,12 @@ SetRedlineMode( eOld );
if( pUndo )
{
- ClearRedo();
// i57907: Under circumstances (sections at the end of a chapter)
// the rPam.Start() is not moved to the new position.
// But aIdx should be at the new end position and as long as the number of moved paragraphs
// is nMoved, I know, where the new position is.
pUndo->SetStartNode( aIdx.GetIndex() - nMoved );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( pOwnRedl )
@@ -2410,12 +2417,12 @@ BOOL SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, BOOL bDel )
bResult = TRUE;
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndoNumOrNoNum * pUndo =
new SwUndoNumOrNoNum(rIdx, bOldNum, bNewNum);
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
}
else if (bDel && pTxtNd->GetNumRule(FALSE) &&
@@ -2529,11 +2536,10 @@ USHORT SwDoc::MakeNumRule( const String &rName,
AddNumRule(pNew); // #i36749#
- if (DoesUndo())
+ if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo * pUndo = new SwUndoNumruleCreate(pNew, this);
-
- AppendUndo(pUndo);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if (bBroadcast)
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 9997eabd79c3..809e560dce21 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -31,20 +31,21 @@
#include <hintids.hxx>
#include <tools/shl.hxx>
-#ifndef _SFX_ITEMITER_HXX //autogen
#include <svl/itemiter.hxx>
-#endif
#include <sfx2/app.hxx>
#include <editeng/colritem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/crsditem.hxx>
#include <swmodule.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <ndtxt.hxx>
#include <redline.hxx>
#include <swundo.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoRedline.hxx>
+#include <hints.hxx>
#include <pamtyp.hxx>
#include <poolfmt.hxx>
#include <viewsh.hxx>
@@ -1398,13 +1399,12 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo,
BOOL bChg = FALSE;
- if( bSaveInUndo && DoesUndo() )
+ if (bSaveInUndo && GetIDocumentUndoRedo().DoesUndo())
{
SwUndoRedline* pUndo = new SwUndoRedline( UNDO_REDLINE, rRange );
if( pUndo->GetRedlSaveCount() )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
else
delete pUndo;
@@ -2089,13 +2089,13 @@ bool SwDoc::AcceptRedline( USHORT nPos, bool bCallDelete )
SwRedline* pTmp = (*pRedlineTbl)[ nPos ];
if( pTmp->HasMark() && pTmp->IsVisible() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
- StartUndo( UNDO_ACCEPT_REDLINE, &aRewriter);
+ GetIDocumentUndoRedo().StartUndo(UNDO_ACCEPT_REDLINE, &aRewriter);
}
int nLoopCnt = 2;
@@ -2103,8 +2103,11 @@ bool SwDoc::AcceptRedline( USHORT nPos, bool bCallDelete )
do {
- if( DoesUndo() )
- AppendUndo( new SwUndoAcceptRedline( *pTmp ));
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo( new SwUndoAcceptRedline(*pTmp) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
bRet |= lcl_AcceptRedline( *pRedlineTbl, nPos, bCallDelete );
@@ -2133,8 +2136,10 @@ bool SwDoc::AcceptRedline( USHORT nPos, bool bCallDelete )
SetModified();
}
- if( DoesUndo() )
- EndUndo( UNDO_ACCEPT_REDLINE, NULL );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
}
return bRet;
}
@@ -2152,10 +2157,10 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
SwPaM aPam( *rPam.GetMark(), *rPam.GetPoint() );
lcl_AdjustRedlineRange( aPam );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_ACCEPT_REDLINE, NULL );
- AppendUndo( new SwUndoAcceptRedline( aPam ));
+ GetIDocumentUndoRedo().StartUndo( UNDO_ACCEPT_REDLINE, NULL );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoAcceptRedline( aPam ));
}
// #111827#
@@ -2166,7 +2171,7 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
CompressRedlines();
SetModified();
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
String aTmpStr;
@@ -2180,7 +2185,7 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, aTmpStr);
- EndUndo( UNDO_ACCEPT_REDLINE, &aRewriter );
+ GetIDocumentUndoRedo().EndUndo( UNDO_ACCEPT_REDLINE, &aRewriter );
}
return nRet != 0;
}
@@ -2197,13 +2202,13 @@ bool SwDoc::RejectRedline( USHORT nPos, bool bCallDelete )
SwRedline* pTmp = (*pRedlineTbl)[ nPos ];
if( pTmp->HasMark() && pTmp->IsVisible() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
- StartUndo( UNDO_REJECT_REDLINE, NULL );
+ GetIDocumentUndoRedo().StartUndo(UNDO_REJECT_REDLINE, &aRewriter);
}
int nLoopCnt = 2;
@@ -2211,8 +2216,11 @@ bool SwDoc::RejectRedline( USHORT nPos, bool bCallDelete )
do {
- if( DoesUndo() )
- AppendUndo( new SwUndoRejectRedline( *pTmp ));
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ SwUndo *const pUndo( new SwUndoRejectRedline( *pTmp ) );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
bRet |= lcl_RejectRedline( *pRedlineTbl, nPos, bCallDelete );
@@ -2241,8 +2249,10 @@ bool SwDoc::RejectRedline( USHORT nPos, bool bCallDelete )
SetModified();
}
- if( DoesUndo() )
- EndUndo( UNDO_REJECT_REDLINE, NULL );
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
}
return bRet;
}
@@ -2260,10 +2270,10 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
SwPaM aPam( *rPam.GetMark(), *rPam.GetPoint() );
lcl_AdjustRedlineRange( aPam );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_REJECT_REDLINE, NULL );
- AppendUndo( new SwUndoRejectRedline( aPam ));
+ GetIDocumentUndoRedo().StartUndo( UNDO_REJECT_REDLINE, NULL );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoRejectRedline(aPam) );
}
// #111827#
@@ -2274,7 +2284,7 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
CompressRedlines();
SetModified();
}
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
// #111827#
String aTmpStr;
@@ -2288,7 +2298,7 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, aTmpStr);
- EndUndo( UNDO_REJECT_REDLINE, &aRewriter );
+ GetIDocumentUndoRedo().EndUndo( UNDO_REJECT_REDLINE, &aRewriter );
}
return nRet != 0;
@@ -3148,8 +3158,7 @@ void SwRedline::Show( USHORT nLoop )
SwDoc* pDoc = GetDoc();
RedlineMode_t eOld = pDoc->GetRedlineMode();
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
switch( GetType() )
{
@@ -3171,7 +3180,6 @@ void SwRedline::Show( USHORT nLoop )
break;
}
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
}
}
@@ -3180,8 +3188,7 @@ void SwRedline::Hide( USHORT nLoop )
SwDoc* pDoc = GetDoc();
RedlineMode_t eOld = pDoc->GetRedlineMode();
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
switch( GetType() )
{
@@ -3210,7 +3217,6 @@ void SwRedline::Hide( USHORT nLoop )
break;
}
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
}
void SwRedline::ShowOriginal( USHORT nLoop )
@@ -3220,8 +3226,7 @@ void SwRedline::ShowOriginal( USHORT nLoop )
SwRedlineData* pCur;
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
// bestimme den Type, ist der erste auf Stack
for( pCur = pRedlineData; pCur->pNext; )
@@ -3254,7 +3259,6 @@ void SwRedline::ShowOriginal( USHORT nLoop )
break;
}
pDoc->SetRedlineMode_intern( eOld );
- pDoc->DoUndo( bUndo );
}
@@ -3856,9 +3860,9 @@ String SwRedline::GetDescr(USHORT nPos)
bool SwDoc::IsInRedlines(const SwNode & rNode) const
{
SwPosition aPos(rNode);
- SwNode & rEndOfRedlines = aNodes.GetEndOfRedlines();
+ SwNode & rEndOfRedlines = GetNodes().GetEndOfRedlines();
SwPaM aPam(SwPosition(*rEndOfRedlines.StartOfSectionNode()),
SwPosition(rEndOfRedlines));
- return aPam.ContainsPosition(aPos) ? sal_True : sal_False;
+ return aPam.ContainsPosition(aPos) ? true : false;
}
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index 4a707e1fb1af..a2e9d5cfa0c6 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -28,18 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <string.h> // fuer strchr()
-#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_UNICODETYPE_HDL
#include <com/sun/star/i18n/UnicodeType.hdl>
-#endif
-#ifndef _COM_SUN_STAR_I18N_WORDTYPE_HDL
#include <com/sun/star/i18n/WordType.hdl>
-#endif
+
#include <unotools/charclass.hxx>
+
+#include <hintids.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <mvsave.hxx> // Strukturen zum Sichern beim Move/Delete
#include <ndtxt.hxx>
@@ -47,7 +45,6 @@
#include <rubylist.hxx>
#include <pam.hxx>
#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
#include <breakit.hxx>
#include <crsskip.hxx>
@@ -112,7 +109,7 @@ USHORT SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList,
USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
USHORT nMode )
{
- StartUndo( UNDO_SETRUBYATTR, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_SETRUBYATTR, NULL );
SvUShortsSort aDelArr;
aDelArr.Insert( RES_TXTATR_CJK_RUBY );
@@ -193,7 +190,7 @@ USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
} while( 30 > rList.Count() &&
(_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr );
- EndUndo( UNDO_SETRUBYATTR, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_SETRUBYATTR, NULL );
return nListEntry;
}
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 8923b5322998..33b3b8966f7f 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <rtl/math.hxx>
#include <unotools/collatorwrapper.hxx>
@@ -39,6 +40,7 @@
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <node.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -46,7 +48,9 @@
#include <swundo.hxx>
#include <sortopt.hxx>
#include <docsort.hxx>
-#include <undobj.hxx>
+#include <UndoSort.hxx>
+#include <UndoRedline.hxx>
+#include <hints.hxx>
#include <tblsel.hxx>
#include <cellatr.hxx>
#include <redline.hxx>
@@ -357,9 +361,11 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
return FALSE;
}
- BOOL bUndo = DoesUndo();
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
if( bUndo )
- StartUndo( UNDO_START, NULL );
+ {
+ GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+ }
SwPaM* pRedlPam = 0;
SwUndoRedlineSort* pRedlUndo = 0;
@@ -377,7 +383,7 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
if( bUndo )
{
pRedlUndo = new SwUndoRedlineSort( *pRedlPam,rOpt );
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
}
// erst den Bereich kopieren, dann
SwNodeIndex aEndIdx( pEnd->nNode, 1 );
@@ -430,9 +436,12 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
SwNodeRange aRg( aStart, aStart );
if( bUndo && !pRedlUndo )
- AppendUndo( pUndoSort = new SwUndoSort( rPaM, rOpt ) );
+ {
+ pUndoSort = new SwUndoSort(rPaM, rOpt);
+ GetIDocumentUndoRedo().AppendUndo(pUndoSort);
+ }
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
for ( USHORT n = 0; n < aSortArr.Count(); ++n )
{
@@ -458,7 +467,10 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
if( pRedlUndo )
{
pRedlUndo->SetSaveRange( *pRedlPam );
- AppendUndo( pRedlUndo );
+ // UGLY: temp. enable Undo
+ GetIDocumentUndoRedo().DoUndo(true);
+ GetIDocumentUndoRedo().AppendUndo( pRedlUndo );
+ GetIDocumentUndoRedo().DoUndo(false);
}
// nBeg is start of sorted range
@@ -495,9 +507,11 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
delete pRedlPam, pRedlPam = 0;
}
- DoUndo( bUndo );
+ GetIDocumentUndoRedo().DoUndo( bUndo );
if( bUndo )
- EndUndo( UNDO_END, NULL );
+ {
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ }
return TRUE;
}
@@ -575,18 +589,15 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
pTblNd->DelFrms();
// ? TL_CHART2: ?
- // Redo loeschen bevor Undo
- BOOL bUndo = DoesUndo();
SwUndoSort* pUndoSort = 0;
- if(bUndo)
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
pUndoSort = new SwUndoSort( rBoxes[0]->GetSttIdx(),
rBoxes[rBoxes.Count()-1]->GetSttIdx(),
*pTblNd, rOpt, aFlatBox.HasItemSets() );
- AppendUndo(pUndoSort);
- DoUndo(FALSE);
+ GetIDocumentUndoRedo().AppendUndo(pUndoSort);
}
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
// SchluesselElemente einsortieren
USHORT nCount = (rOpt.eDirection == SRT_ROWS) ?
@@ -631,9 +642,6 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
aSortList.DeleteAndDestroy( 0, aSortList.Count() );
SwSortElement::Finit();
- // Undo wieder aktivieren
- DoUndo(bUndo);
-
SetModified();
return TRUE;
}
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index b7395402d01d..5b02a00271c1 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -49,6 +49,7 @@
#include <frmatr.hxx>
#include <pagedesc.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <ndtxt.hxx>
#include <swtable.hxx>
@@ -58,7 +59,7 @@
#include <poolfmt.hxx>
#include <txtfrm.hxx>
#include <rootfrm.hxx>
-#include <undobj.hxx>
+#include <UndoAttribute.hxx>
#include <swundo.hxx>
#include <mdiexp.hxx>
#include <docary.hxx>
@@ -140,9 +141,8 @@ USHORT SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
USHORT SwDoc::GetCurTOXMark( const SwPosition& rPos,
SwTOXMarks& rArr ) const
{
- // suche an der Position rPos nach allen SwTOXMark's
- SwTxtNode* pTxtNd = GetNodes()[ rPos.nNode ]->GetTxtNode();
- // kein TextNode oder kein HintsArray vorhanden ??
+ // search on Position rPos for all SwTOXMarks
+ SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if( !pTxtNd || !pTxtNd->GetpSwpHints() )
return 0;
@@ -188,14 +188,13 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
SwTxtNode& rTxtNd = const_cast<SwTxtNode&>(pTxtTOXMark->GetTxtNode());
ASSERT( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- // fuers Undo die Attribute sichern
- ClearRedo();
+ // save attributes for Undo
SwUndoResetAttr* pUndo = new SwUndoResetAttr(
SwPosition( rTxtNd, SwIndex( &rTxtNd, *pTxtTOXMark->GetStart() ) ),
RES_TXTATR_TOXMARK );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
SwRegHistory aRHst( rTxtNd, &pUndo->GetHistory() );
rTxtNd.GetpSwpHints()->Register( &aRHst );
@@ -203,7 +202,7 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
rTxtNd.DeleteAttribute( const_cast<SwTxtTOXMark*>(pTxtTOXMark) );
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
if( rTxtNd.GetpSwpHints() )
rTxtNd.GetpSwpHints()->DeRegister();
@@ -364,7 +363,7 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
const SfxItemSet* pSet,
BOOL bExpand )
{
- StartUndo( UNDO_INSTOX, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSTOX, NULL );
String sSectNm( rTOX.GetTOXName() );
sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), &sSectNm );
@@ -406,7 +405,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
}
}
- EndUndo( UNDO_INSTOX, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_INSTOX, NULL );
return pNewSection;
}
@@ -548,7 +547,7 @@ BOOL SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
SwSectionFmt* pFmt = rTOXSect.GetFmt();
if( pFmt )
{
- StartUndo( UNDO_CLEARTOXRANGE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_CLEARTOXRANGE, NULL );
/* Save the start node of the TOX' section. */
SwSectionNode * pMyNode = pFmt->GetSectionNode();
@@ -620,7 +619,7 @@ BOOL SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes )
DelSectionFmt( pFmt, bDelNodes );
- EndUndo( UNDO_CLEARTOXRANGE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_CLEARTOXRANGE, NULL );
bRet = TRUE;
}
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index f627870932f9..ebc5a66b7694 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -28,19 +28,23 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <com/sun/star/i18n/ScriptType.hpp>
+
+#include <editeng/langitem.hxx>
+#include <editeng/scripttypeitem.hxx>
-#include <hintids.hxx>
#include <vcl/keycodes.hxx>
#include <vcl/cmdevt.hxx>
+
+#include <hintids.hxx>
#include <extinput.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <index.hxx>
#include <ndtxt.hxx>
#include <txtfrm.hxx>
#include <swundo.hxx>
-#include <editeng/langitem.hxx>
-#include <editeng/scripttypeitem.hxx>
-#include <com/sun/star/i18n/ScriptType.hpp>
+
using namespace ::com::sun::star;
@@ -106,12 +110,14 @@ SwExtTextInput::~SwExtTextInput()
if( bInsText )
{
rIdx = nSttCnt;
- pDoc->StartUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo(
+ UNDO_OVERWRITE, NULL );
pDoc->Overwrite( *this, sTxt.Copy( 0,
sOverwriteText.Len() ));
pDoc->InsertString( *this,
sTxt.Copy( sOverwriteText.Len() ) );
- pDoc->EndUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo(
+ UNDO_OVERWRITE, NULL );
}
}
else
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index e5cfc065db2a..464388220c03 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <i18npool/mslangid.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -54,6 +55,7 @@
#include <editeng/scriptspaceitem.hxx>
#include <viewopt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
@@ -67,9 +69,7 @@
#include <fmtcol.hxx>
#include <ndtxt.hxx>
#include <fmtline.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <GetMetricVal.hxx>
#include <numrule.hxx>
@@ -1085,7 +1085,7 @@ bool SwDoc::IsPoolTxtCollUsed( USHORT nId ) const
if( !bFnd || !pNewColl->GetDepends() )
return FALSE;
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
return !pNewColl->GetInfo( aGetHt );
}
@@ -1164,24 +1164,21 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
{
BOOL bIsModified = IsModified();
- BOOL bDoesUndo = DoesUndo();
- DoUndo(FALSE);
- switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
{
- case POOLGRP_CHARFMT:
- pNewFmt = _MakeCharFmt( aNm, pDeriveFmt, FALSE, TRUE );
-
- break;
- case POOLGRP_FRAMEFMT:
- pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, FALSE, TRUE );
-
- break;
- default:
- break;
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
+ {
+ case POOLGRP_CHARFMT:
+ pNewFmt = _MakeCharFmt(aNm, pDeriveFmt, FALSE, TRUE);
+ break;
+ case POOLGRP_FRAMEFMT:
+ pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, FALSE, TRUE);
+ break;
+ default:
+ break;
+ }
}
- DoUndo(bDoesUndo);
-
if( !bIsModified )
ResetModified();
pNewFmt->SetPoolFmtId( nId );
@@ -1436,7 +1433,7 @@ bool SwDoc::IsPoolFmtUsed( USHORT nId ) const
{
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
bFnd = !pNewFmt->GetInfo( aGetHt );
}
else
@@ -1486,10 +1483,10 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
BOOL bIsModified = IsModified();
- BOOL bDoesUndo = DoesUndo();
- DoUndo(FALSE);
- n = MakePageDesc( aNm, 0, bRegardLanguage );
- DoUndo(bDoesUndo);
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ n = MakePageDesc( aNm, 0, bRegardLanguage );
+ }
pNewPgDsc = aPageDescs[ n ];
pNewPgDsc->SetPoolFmtId( nId );
@@ -2359,7 +2356,7 @@ bool SwDoc::IsPoolPageDescUsed( USHORT nId ) const
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
return !pNewPgDsc->GetInfo( aGetHt );
}
@@ -2368,7 +2365,7 @@ sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const
{
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
- SwAutoFmtGetDocNode aGetHt( &aNodes );
+ SwAutoFmtGetDocNode aGetHt( &GetNodes() );
return !rModify.GetInfo( aGetHt );
}
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index e19e60e645df..06ca1c814688 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -35,6 +35,7 @@
#include <svl/zforlist.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <swtable.hxx>
@@ -47,7 +48,8 @@
#include <mvsave.hxx>
#include <docary.hxx>
#include <fmtanchr.hxx>
-#include <undobj.hxx>
+#include <hints.hxx>
+#include <UndoTable.hxx>
#include <redline.hxx>
#include <fmtfsize.hxx>
#include <list>
@@ -558,9 +560,8 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
if( pUndo )
pUndo->AddBoxBefore( *pDstBox, bDelCntnt );
- BOOL bUndo = pDoc->DoesUndo();
bool bUndoRedline = pUndo && pDoc->IsRedlineOn();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodeIndex aSavePos( aInsIdx, -1 );
if( pRg.get() )
@@ -628,8 +629,8 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
if( pUndo )
pUndo->AddBoxAfter( *pDstBox, aInsIdx, bDelCntnt );
- // Ueberschrift
- SwTxtNode* pTxtNd = pDoc->GetNodes()[ aSavePos ]->GetTxtNode();
+ // heading
+ SwTxtNode *const pTxtNd = aSavePos.GetNode().GetTxtNode();
if( pTxtNd )
{
USHORT nPoolId = pTxtNd->GetTxtColl()->GetPoolFmtId();
@@ -685,8 +686,6 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
}
}
}
-
- pDoc->DoUndo( bUndo );
}
BOOL SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index fe5beeb006a0..9e24caa26a29 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -52,7 +52,8 @@
#include <swundo.hxx>
#include <rowfrm.hxx>
#include <ddefld.hxx>
-#include <undobj.hxx>
+#include <hints.hxx>
+#include <UndoTable.hxx>
#include <cellatr.hxx>
#include <mvsave.hxx>
#include <swtblfmt.hxx>
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 9c2ce7af3139..c669e59a2708 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -28,16 +28,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <editeng/brkitem.hxx>
#define _ZFORLIST_DECLARE_TABLE
#include <hintids.hxx>
-
-
-#include <editeng/brkitem.hxx>
#include <fmtpdsc.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <fldbas.hxx>
@@ -142,8 +141,7 @@ namespace
const SwDoc* pSrcDoc = rPam.GetDoc();
SwDoc* pDestDoc = rCpyPam.GetDoc();
const IDocumentMarkAccess* const pSrcMarkAccess = pSrcDoc->getIDocumentMarkAccess();
- bool bDoesUndo = pDestDoc->DoesUndo();
- pDestDoc->DoUndo(false);
+ ::sw::UndoGuard const undoGuard(pDestDoc->GetIDocumentUndoRedo());
const SwPosition &rStt = *rPam.Start(), &rEnd = *rPam.End();
SwPosition* pCpyStt = rCpyPam.Start();
@@ -209,7 +207,6 @@ namespace
pNewMetadatable->RegisterAsCopyOf(*pMetadatable);
}
}
- pDestDoc->DoUndo(bDoesUndo);
}
}
@@ -647,8 +644,7 @@ void lcl_DeleteRedlines( const SwPaM& rPam, SwPaM& rCpyPam )
RedlineMode_t eOld = pDestDoc->GetRedlineMode();
pDestDoc->SetRedlineMode_intern( (RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bDoesUndo = pDestDoc->DoesUndo();
- pDestDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDestDoc->GetIDocumentUndoRedo());
do {
pDestDoc->DeleteAndJoin( *(SwPaM*)pDelPam->GetNext() );
@@ -658,7 +654,6 @@ void lcl_DeleteRedlines( const SwPaM& rPam, SwPaM& rCpyPam )
} while( TRUE );
delete pDelPam;
- pDestDoc->DoUndo( bDoesUndo );
pDestDoc->SetRedlineMode_intern( eOld );
}
}
@@ -737,49 +732,50 @@ SwDoc::CopyRange( SwPaM& rPam, SwPosition& rPos, const bool bCopyAll ) const
"please tell me what you did to get here!");
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- BOOL bDoUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE ); // Auf jedenfall Undo abschalten
// dann kopiere den Bereich im unteren DokumentBereich,
// (mit Start/End-Nodes geklammert) und verschiebe diese
// dann an die gewuenschte Stelle.
SwUndoCpyDoc* pUndo = 0;
SwPaM aPam( rPos ); // UndoBereich sichern
- if( bDoUndo )
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
- pDoc->ClearRedo();
+ pDoc->GetIDocumentUndoRedo().ClearRedo();
pUndo = new SwUndoCpyDoc( aPam );
}
- SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection(
+ {
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection(
SwNodeIndex( GetNodes().GetEndOfAutotext() ));
- aPam.GetPoint()->nNode = *pSttNd->EndOfSectionNode();
- // copy without Frames
- pDoc->CopyImpl( rPam, *aPam.GetPoint(), false, bCopyAll, 0 );
-
- aPam.GetPoint()->nNode = pDoc->GetNodes().GetEndOfAutotext();
- aPam.SetMark();
- SwCntntNode* pNode = pDoc->GetNodes().GoPrevious( &aPam.GetMark()->nNode );
- pNode->MakeEndIndex( &aPam.GetMark()->nContent );
-
- aPam.GetPoint()->nNode = *aPam.GetNode()->StartOfSectionNode();
- pNode = pDoc->GetNodes().GoNext( &aPam.GetPoint()->nNode );
- pNode->MakeStartIndex( &aPam.GetPoint()->nContent );
- // move to desired position
- pDoc->MoveRange( aPam, rPos, DOC_MOVEDEFAULT );
-
- pNode = aPam.GetCntntNode();
- *aPam.GetPoint() = rPos; // Cursor umsetzen fuers Undo !
- aPam.SetMark(); // auch den Mark umsetzen !!
- aPam.DeleteMark(); // aber keinen Bereich makieren !!
- pDoc->DeleteSection( pNode ); // Bereich wieder loeschen
-
- // falls Undo eingeschaltet ist, so speicher den eingefuegten Bereich
- pDoc->DoUndo( bDoUndo );
- if( bDoUndo )
+ aPam.GetPoint()->nNode = *pSttNd->EndOfSectionNode();
+ // copy without Frames
+ pDoc->CopyImpl( rPam, *aPam.GetPoint(), false, bCopyAll, 0 );
+
+ aPam.GetPoint()->nNode = pDoc->GetNodes().GetEndOfAutotext();
+ aPam.SetMark();
+ SwCntntNode* pNode =
+ pDoc->GetNodes().GoPrevious( &aPam.GetMark()->nNode );
+ pNode->MakeEndIndex( &aPam.GetMark()->nContent );
+
+ aPam.GetPoint()->nNode = *aPam.GetNode()->StartOfSectionNode();
+ pNode = pDoc->GetNodes().GoNext( &aPam.GetPoint()->nNode );
+ pNode->MakeStartIndex( &aPam.GetPoint()->nContent );
+ // move to desired position
+ pDoc->MoveRange( aPam, rPos, DOC_MOVEDEFAULT );
+
+ pNode = aPam.GetCntntNode();
+ *aPam.GetPoint() = rPos; // Cursor umsetzen fuers Undo !
+ aPam.SetMark(); // auch den Mark umsetzen !!
+ aPam.DeleteMark(); // aber keinen Bereich makieren !!
+ pDoc->DeleteSection( pNode ); // Bereich wieder loeschen
+ }
+
+ // if Undo is enabled, store the insertion range
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
pUndo->SetInsertRange( aPam );
- pDoc->AppendUndo( pUndo );
+ pDoc->GetIDocumentUndoRedo().AppendUndo(pUndo);
}
if( pRedlineRange )
@@ -889,11 +885,10 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
SwTblNumFmtMerge aTNFM( *this, *pDoc );
- if( pDoc->DoesUndo() )
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
- pDoc->ClearRedo();
pUndo = new SwUndoCpyDoc( aCpyPam );
- pDoc->AppendUndo( pUndo );
+ pDoc->GetIDocumentUndoRedo().AppendUndo( pUndo );
}
RedlineMode_t eOld = pDoc->GetRedlineMode();
@@ -976,10 +971,10 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
else if( !bOneNode || bColumnSel )
{
xub_StrLen nCntntEnd = pEnd->nContent.GetIndex();
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
- pDoc->SplitNode( rPos, false );
- pDoc->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
+ pDoc->SplitNode( rPos, false );
+ }
if( bCanMoveBack && rPos == *aCpyPam.GetPoint() )
{
@@ -1106,10 +1101,10 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// splitte den TextNode, bei dem Eingefuegt wird.
xub_StrLen nCntntEnd = pEnd->nContent.GetIndex();
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
- pDoc->SplitNode( rPos, false );
- pDoc->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
+ pDoc->SplitNode( rPos, false );
+ }
if( bCanMoveBack && rPos == *aCpyPam.GetPoint() )
{
@@ -1285,8 +1280,10 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
lcl_DeleteRedlines( rPam, aCpyPam );
// falls Undo eingeschaltet ist, so speicher den eingefuegten Bereich
- if( pDoc->DoesUndo() )
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
+ {
pUndo->SetInsertRange( aCpyPam, TRUE, bStartIsTxtNode );
+ }
if( pCpyRange )
{
@@ -1349,11 +1346,10 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte
}
#endif
- // Undo abschalten
- BOOL bUndo = pDest->DoesUndo();
- pDest->DoUndo( FALSE );
- CopyFlyInFlyImpl( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly );
- pDest->DoUndo( bUndo );
+ {
+ ::sw::UndoGuard const undoGuard(pDest->GetIDocumentUndoRedo());
+ CopyFlyInFlyImpl( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly );
+ }
SwNodeRange aCpyRange( aSavePos, rInsPos );
@@ -1440,7 +1436,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
//last node information is only necessary to know for the last TextNode
SwNodeIndex aTmp( pAPos->nNode );
++aTmp;//goto next node
- while( rNodes[aTmp ]->IsEndNode() )
+ while (aTmp.GetNode().IsEndNode())
{
if( aTmp == rNodes.GetEndOfContent().GetIndex() )
{
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 306560272c6f..60ceac5779c5 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -38,11 +38,13 @@
#include <txtftn.hxx>
#include <fmtclds.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <section.hxx>
-#include <undobj.hxx>
+#include <UndoSection.hxx>
+#include <UndoDelete.hxx>
#include <swundo.hxx>
#include <calc.hxx>
#include <swtable.hxx>
@@ -58,9 +60,7 @@
#include <node2lay.hxx>
#include <doctxm.hxx>
#include <fmtftntx.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
// --> OD 2005-12-01 #i27138#
#include <viewsh.hxx>
#include <txtfrm.hxx>
@@ -188,12 +188,12 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
}
SwUndoInsSection* pUndoInsSect = 0;
- if( DoesUndo() )
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
+ if (bUndo)
{
- ClearRedo();
pUndoInsSect = new SwUndoInsSection(rRange, rNewData, pAttr, pTOXBase);
- AppendUndo( pUndoInsSect );
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().AppendUndo( pUndoInsSect );
+ GetIDocumentUndoRedo().DoUndo(false);
}
SwSectionFmt* const pFmt = MakeSectionFmt( 0 );
@@ -374,7 +374,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
{
pUndoInsSect->SetSectNdPos( pNewSectNode->GetIndex() );
pUndoInsSect->SetUpdtFtnFlag( bUpdateFtn );
- DoUndo( TRUE );
+ GetIDocumentUndoRedo().DoUndo(bUndo);
}
if (rNewData.IsLinkType())
@@ -527,7 +527,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
{
USHORT nPos = pSectionFmtTbl->GetPos( pFmt );
- StartUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_DELSECTION, NULL);
if( USHRT_MAX != nPos )
{
@@ -541,24 +541,22 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
const SwSectionNode* pSectNd;
- if( DoesUndo() )
+ if( GetIDocumentUndoRedo().DoesUndo() )
{
- ClearRedo();
if( bDelNodes && pIdx && &GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
SwNodeIndex aUpdIdx( *pIdx );
- ClearRedo();
SwPaM aPaM( *pSectNd->EndOfSectionNode(), *pSectNd );
- AppendUndo( new SwUndoDelete( aPaM ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoDelete( aPaM ));
if( pFtnEndAtTxtEnd )
GetFtnIdxs().UpdateFtn( aUpdIdx );
SetModified();
//#126178# start/end undo have to be pairs!
- EndUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL);
return ;
}
- AppendUndo( MakeUndoDelSection( *pFmt ) );
+ GetIDocumentUndoRedo().AppendUndo( MakeUndoDelSection( *pFmt ) );
}
else if( bDelNodes && pIdx && &GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
@@ -569,7 +567,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
GetFtnIdxs().UpdateFtn( aUpdIdx );
SetModified();
//#126178# start/end undo have to be pairs!
- EndUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL);
return ;
}
@@ -613,7 +611,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
//FEATURE::CONDCOLL
}
- EndUndo(UNDO_DELSECTION, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL);
SetModified();
}
@@ -651,23 +649,17 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
if( bOnlyAttrChg )
{
- const BOOL bDoesUndo = DoesUndo();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( MakeUndoUpdateSection( *pFmt, true ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the section causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
+ GetIDocumentUndoRedo().AppendUndo(
+ MakeUndoUpdateSection( *pFmt, true ) );
}
+ // #i32968# Inserting columns in the section causes MakeFrmFmt
+ // to put two objects of type SwUndoFrmFmt on the undo stack.
+ // We don't want them.
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
pFmt->SetFmtAttr( *pAttr );
SetModified();
-
- // --> FME 2004-10-13 #i32968#
- DoUndo( bDoesUndo );
- // <--
}
return;
}
@@ -692,17 +684,13 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
}
}
- const BOOL bDoesUndo = DoesUndo();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( MakeUndoUpdateSection( *pFmt, false ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the section causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
+ GetIDocumentUndoRedo().AppendUndo(MakeUndoUpdateSection(*pFmt, false));
}
+ // #i32968# Inserting columns in the section causes MakeFrmFmt to put two
+ // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
// #56167# Der LinkFileName koennte auch nur aus Separatoren bestehen
String sCompareString = sfx2::cTokenSeperator;
@@ -770,10 +758,6 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
}
SetModified();
-
- // --> FME 2004-10-13 #i32968#
- DoUndo( bDoesUndo );
- // <--
}
/* -----------------19.02.99 09:31-------------------
@@ -1097,7 +1081,6 @@ SwSectionNode::~SwSectionNode()
pLast = aIter++;
}
}
- SwDoc* pDoc = GetDoc();
SwSectionFmt* pFmt = m_pSection->GetFmt();
if( pFmt )
@@ -1108,12 +1091,6 @@ SwSectionNode::~SwSectionNode()
pFmt->ResetFmtAttr( RES_CNTNT );
pFmt->UnlockModify();
}
-
- BOOL bUndo = pDoc->DoesUndo();
- // verhinder beim Loeschen aus der Undo/Redo-History einen rekursiven Aufruf
- if( bUndo && &pDoc->GetNodes() != &GetNodes() )
- pDoc->DoUndo( FALSE );
- pDoc->DoUndo( bUndo );
}
@@ -1142,7 +1119,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
if( 0 == ( pCNd = rNds.GoPrevSection( &aIdx, TRUE, FALSE )) )
return ;
}
- pCNd = rNds[ aIdx ]->GetCntntNode();
+ pCNd = aIdx.GetNode().GetCntntNode();
pCNd->MakeFrms( (SwCntntNode&)rIdx.GetNode() );
}
else
@@ -1365,7 +1342,8 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
: CREATE_NONE );
// falls als Server aus dem Undo kopiert wird, wieder eintragen
- if (m_pSection->IsServer() && (pDoc->GetUndoNds() == &rNds))
+ if (m_pSection->IsServer()
+ && pDoc->GetIDocumentUndoRedo().IsUndoNodes(rNds))
{
pNewSect->SetRefObject( m_pSection->GetObject() );
pDoc->GetLinkManager().InsertServer( pNewSect->GetObject() );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 5f21e32df796..d91506721fb6 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -30,9 +30,6 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
-#ifdef WTC
-#define private public
-#endif
#include <hintids.hxx>
#include <editeng/lrspitem.hxx>
@@ -53,6 +50,8 @@
#include <pagefrm.hxx>
#include <tabcol.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <UndoManager.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <swcrsr.hxx>
@@ -64,7 +63,11 @@
#include <fldbas.hxx>
#include <poolfmt.hxx>
#include <tabfrm.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoRedline.hxx>
+#include <UndoDelete.hxx>
+#include <UndoTable.hxx>
+#include <hints.hxx>
#include <tblafmt.hxx>
#include <swcache.hxx>
#include <ddefld.hxx>
@@ -83,9 +86,7 @@
#include <section.hxx>
#include <frmtool.hxx>
#include <node2lay.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include "docsh.hxx"
#include <tabcol.hxx>
#include <unochart.hxx>
@@ -137,7 +138,7 @@ public:
lcl_DelRedlines::lcl_DelRedlines( SwPaM & rPam) : pDoc( rPam.GetDoc() )
{
- pDoc->StartUndo(UNDO_EMPTY, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
if( !pDoc->IsIgnoreRedline() && pDoc->GetRedlineTbl().Count() )
pDoc->AcceptRedline( rPam, true );
}
@@ -390,10 +391,10 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
String aTblName = GetUniqueTblName();
- if( DoesUndo() )
+ if( GetIDocumentUndoRedo().DoesUndo() )
{
- ClearRedo();
- AppendUndo( new SwUndoInsTbl( rPos, nCols, nRows, static_cast<USHORT>(eAdjust),
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsTbl( rPos, nCols, nRows, static_cast<USHORT>(eAdjust),
rInsTblOpts, pTAFmt, pColArr,
aTblName));
}
@@ -692,15 +693,15 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
#endif
SwUndoTxtToTbl* pUndo = 0;
- if( DoesUndo() )
+ if( GetIDocumentUndoRedo().DoesUndo() )
{
- StartUndo( UNDO_TEXTTOTABLE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE, NULL );
pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh,
static_cast<USHORT>(eAdjust), pTAFmt );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
// das Splitten vom TextNode nicht in die Undohistory aufnehmen
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo( false );
}
::PaMCorrAbs( aOriginal, *pEnd );
@@ -739,7 +740,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// Wir gehen jetzt immer ueber die Upper, um die Tabelle einzufuegen:
SwNode2Layout aNode2Layout( aRg.aStart.GetNode() );
- DoUndo( 0 != pUndo );
+ GetIDocumentUndoRedo().DoUndo( 0 != pUndo );
// dann erstelle die Box/Line/Table-Struktur
SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt();
@@ -916,7 +917,9 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
}
if( pUndo )
- EndUndo( UNDO_TEXTTOTABLE, NULL );
+ {
+ GetIDocumentUndoRedo().EndUndo( UNDO_TEXTTOTABLE, NULL );
+ }
SetModified();
SetFieldsDirty(true, NULL, 0);
@@ -1146,15 +1149,16 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
lcl_DelRedlines aDelRedl( aOriginal );
#endif
- SwUndoTxtToTbl* pUndo = 0;
- if( DoesUndo() )
+// SwUndoTxtToTbl* pUndo = 0;
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
+ if (bUndo)
{
-// StartUndo( UNDO_TEXTTOTABLE );
+// GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE );
// pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, eAdjust, pTAFmt );
-// AppendUndo( pUndo );
+// GetIDocumentUndoRedo().AppendUndo(pUndo);
// das Splitten vom TextNode nicht in die Undohistory aufnehmen
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
}
::PaMCorrAbs( aOriginal, *pEnd );
@@ -1193,7 +1197,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
// Wir gehen jetzt immer ueber die Upper, um die Tabelle einzufuegen:
SwNode2Layout aNode2Layout( aRg.aStart.GetNode() );
- DoUndo( 0 != pUndo );
+ GetIDocumentUndoRedo().DoUndo(bUndo);
// dann erstelle die Box/Line/Table-Struktur
SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt();
@@ -1264,7 +1268,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
}
// if( pUndo )
-// EndUndo( UNDO_TEXTTOTABLE );
+// GetIDocumentUndoRedo().EndUndo( UNDO_TEXTTOTABLE );
SetModified();
SetFieldsDirty( true, NULL, 0 );
@@ -1530,9 +1534,9 @@ BOOL SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
SwNodeRange aRg( *pTblNd, 0, *pTblNd->EndOfSectionNode() );
SwUndoTblToTxt* pUndo = 0;
SwNodeRange* pUndoRg = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndoRg = new SwNodeRange( aRg.aStart, -1, aRg.aEnd, +1 );
pUndo = new SwUndoTblToTxt( pTblNd->GetTable(), cCh );
}
@@ -1547,7 +1551,7 @@ BOOL SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
pUndoRg->aStart++;
pUndoRg->aEnd--;
pUndo->SetRange( *pUndoRg );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
delete pUndoRg;
}
@@ -1659,7 +1663,7 @@ BOOL SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh,
// ist eine Tabelle selektiert ?
SwTableNode* pTblNd;
if( rRange.aStart.GetIndex() >= rRange.aEnd.GetIndex() ||
- 0 == ( pTblNd = (*this)[ rRange.aStart ]->GetTableNode()) ||
+ 0 == ( pTblNd = rRange.aStart.GetNode().GetTableNode()) ||
&rRange.aEnd.GetNode() != pTblNd->EndOfSectionNode() )
return FALSE;
@@ -1802,34 +1806,36 @@ BOOL SwDoc::InsertCol( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind )
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSCOL, rBoxes, *pTblNd,
0, 0, nCnt, bBehind, FALSE );
aTmpLst.Insert( &rTbl.GetTabSortBoxes(), 0, rTbl.GetTabSortBoxes().Count() );
}
- SwTableFmlUpdate aMsgHnt( &rTbl );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
-
- BOOL bRet = rTbl.InsertCol( this, rBoxes, nCnt, bBehind );
- if( bRet )
+ bool bRet(false);
{
- SetModified();
- ::ClearFEShellTabCols();
- SetFieldsDirty( true, NULL, 0 );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
+ SwTableFmlUpdate aMsgHnt( &rTbl );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
+
+ bRet = rTbl.InsertCol( this, rBoxes, nCnt, bBehind );
+ if (bRet)
+ {
+ SetModified();
+ ::ClearFEShellTabCols();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
if( pUndo )
{
- DoUndo( TRUE );
if( bRet )
{
- ClearRedo();
pUndo->SaveNewBoxes( *pTblNd, aTmpLst );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -1867,34 +1873,36 @@ BOOL SwDoc::InsertRow( const SwSelBoxes& rBoxes, USHORT nCnt, BOOL bBehind )
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSROW,rBoxes, *pTblNd,
0, 0, nCnt, bBehind, FALSE );
aTmpLst.Insert( &rTbl.GetTabSortBoxes(), 0, rTbl.GetTabSortBoxes().Count() );
}
- SwTableFmlUpdate aMsgHnt( &rTbl );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
-
- BOOL bRet = rTbl.InsertRow( this, rBoxes, nCnt, bBehind );
- if( bRet )
+ bool bRet(false);
{
- SetModified();
- ::ClearFEShellTabCols();
- SetFieldsDirty( true, NULL, 0 );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
+ SwTableFmlUpdate aMsgHnt( &rTbl );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
+
+ bRet = rTbl.InsertRow( this, rBoxes, nCnt, bBehind );
+ if (bRet)
+ {
+ SetModified();
+ ::ClearFEShellTabCols();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
if( pUndo )
{
- DoUndo( TRUE );
if( bRet )
{
- ClearRedo();
pUndo->SaveNewBoxes( *pTblNd, aTmpLst );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -2004,9 +2012,9 @@ BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
// dann loesche doch die Zeilen
- StartUndo(UNDO_ROW_DELETE, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_ROW_DELETE, NULL);
BOOL bResult = DeleteRowCol( aBoxes );
- EndUndo(UNDO_ROW_DELETE, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_ROW_DELETE, NULL);
return bResult;
}
@@ -2030,9 +2038,9 @@ BOOL SwDoc::DeleteCol( const SwCursor& rCursor )
}
// dann loesche doch die Spalten
- StartUndo(UNDO_COL_DELETE, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_COL_DELETE, NULL);
BOOL bResult = DeleteRowCol( aBoxes, true );
- EndUndo(UNDO_COL_DELETE, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_COL_DELETE, NULL);
return bResult;
}
@@ -2107,9 +2115,9 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
// kein Fly ?? also Kopf- oder Fusszeile: dann immer einen
// TextNode ueberig lassen.
aIdx++;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
SwPaM aPaM( *pTblNd->EndOfSectionNode(), aIdx.GetNode() );
if( bNewTxtNd )
@@ -2165,7 +2173,7 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
pUndo->SetTblDelLastNd();
pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc );
pUndo->SetTableName(pTblNd->GetTable().GetFrmFmt()->GetName());
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
{
@@ -2212,39 +2220,41 @@ BOOL SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
}
SwUndoTblNdsChg* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_DELBOX, aSelBoxes, *pTblNd,
nMin, nMax, 0, FALSE, FALSE );
}
- SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
-
- if( rTable.IsNewModel() )
+ bool bRet(false);
{
- if( bColumn )
- rTable.PrepareDeleteCol( nMin, nMax );
- rTable.FindSuperfluousRows( aSelBoxes );
- if( pUndo )
- pUndo->ReNewBoxes( aSelBoxes );
- }
- const BOOL bRet = rTable.DeleteSel( this, aSelBoxes, 0, pUndo, TRUE, TRUE );
- if( bRet )
- {
- SetModified();
- SetFieldsDirty( true, NULL, 0 );
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
+ SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
+
+ if (rTable.IsNewModel())
+ {
+ if (bColumn)
+ rTable.PrepareDeleteCol( nMin, nMax );
+ rTable.FindSuperfluousRows( aSelBoxes );
+ if (pUndo)
+ pUndo->ReNewBoxes( aSelBoxes );
+ }
+ bRet = rTable.DeleteSel( this, aSelBoxes, 0, pUndo, TRUE, TRUE );
+ if (bRet)
+ {
+ SetModified();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
if( pUndo )
{
- DoUndo( TRUE );
if( bRet )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -2276,10 +2286,8 @@ BOOL SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, USHORT nCnt,
SvULongs aNdsCnts;
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
- BOOL bDoUndo = DoesUndo();
- if( bDoUndo )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- DoUndo( FALSE );
pUndo = new SwUndoTblNdsChg( UNDO_TABLE_SPLIT, rBoxes, *pTblNd, 0, 0,
nCnt, bVert, bSameHeight );
@@ -2295,33 +2303,35 @@ BOOL SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, USHORT nCnt,
}
}
- SwTableFmlUpdate aMsgHnt( &rTbl );
- aMsgHnt.eFlags = TBL_BOXPTR;
- UpdateTblFlds( &aMsgHnt );
+ bool bRet(false);
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
- BOOL bRet;
- if( bVert )
- bRet = rTbl.SplitCol( this, rBoxes, nCnt );
- else
- bRet = rTbl.SplitRow( this, rBoxes, nCnt, bSameHeight );
+ SwTableFmlUpdate aMsgHnt( &rTbl );
+ aMsgHnt.eFlags = TBL_BOXPTR;
+ UpdateTblFlds( &aMsgHnt );
- if( bRet )
- {
- SetModified();
- SetFieldsDirty( true, NULL, 0 );
+ if (bVert)
+ bRet = rTbl.SplitCol( this, rBoxes, nCnt );
+ else
+ bRet = rTbl.SplitRow( this, rBoxes, nCnt, bSameHeight );
+
+ if (bRet)
+ {
+ SetModified();
+ SetFieldsDirty( true, NULL, 0 );
+ }
}
- DoUndo( bDoUndo );
if( pUndo )
{
if( bRet )
{
- ClearRedo();
if( bVert )
pUndo->SaveNewBoxes( *pTblNd, aTmpLst );
else
pUndo->SaveNewBoxes( *pTblNd, aTmpLst, rBoxes, aNdsCnts );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -2350,7 +2360,7 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
}
// --> FME 2004-10-08 #i33394#
- StartUndo( UNDO_TABLE_MERGE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_MERGE, NULL );
// <--
#ifdef DEL_TABLE_REDLINES
@@ -2360,9 +2370,9 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
RedlineMode_t eOld = GetRedlineMode();
SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- SwUndoTblMerge* pUndo = 0;
- if( DoesUndo() )
- pUndo = new SwUndoTblMerge( rPam );
+ SwUndoTblMerge *const pUndo( (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoTblMerge( rPam )
+ : 0 );
// lasse ueber das Layout die Boxen suchen
SwSelBoxes aBoxes;
@@ -2375,13 +2385,19 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
if( pUndo )
{
delete pUndo;
- if( UNDO_REDLINE == GetUndoIds(NULL, NULL) )
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId)
+ && (UNDO_REDLINE == nLastUndoId))
{
- SwUndoRedline* pU = (SwUndoRedline*)RemoveLastUndo( UNDO_REDLINE );
+ // FIXME: why is this horrible cleanup necessary?
+ SwUndoRedline *const pU = dynamic_cast<SwUndoRedline*>(
+ GetUndoManager().RemoveLastUndo());
if( pU->GetRedlSaveCount() )
{
- SwUndoIter aUndoIter( &rPam, UNDO_REDLINE );
- pU->Undo( aUndoIter );
+ SwEditShell *const pEditShell(GetEditShell(0));
+ OSL_ASSERT(pEditShell);
+ ::sw::UndoRedoContext context(*this, *pEditShell);
+ static_cast<SfxUndoAction *>(pU)->UndoWithContext(context);
}
delete pU;
}
@@ -2418,7 +2434,9 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
SetModified();
SetFieldsDirty( true, NULL, 0 );
if( pUndo )
- AppendUndo( pUndo );
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
}
else if( pUndo )
delete pUndo;
@@ -2429,7 +2447,7 @@ USHORT SwDoc::MergeTbl( SwPaM& rPam )
::ClearFEShellTabCols();
SetRedlineMode_intern( eOld );
}
- EndUndo( UNDO_TABLE_MERGE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_TABLE_MERGE, NULL );
return nRet;
}
@@ -2929,7 +2947,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*
GetTabRows( aOld, 0, pBoxFrm );
- StartUndo( UNDO_TABLE_ATTR, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_ATTR, NULL );
// check for differences between aOld and rNew:
const USHORT nCount = rNew.Count();
@@ -3012,7 +3030,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*
}
}
- EndUndo( UNDO_TABLE_ATTR, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_TABLE_ATTR, NULL );
::ClearFEShellTabCols();
}
@@ -3023,10 +3041,10 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, BOOL bCurColOnly, const SwCursor*
void SwDoc::SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld,
const SwTableBox *pStart, BOOL bCurRowOnly )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *rTab.GetTableNode(), TRUE ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoAttrTbl( *rTab.GetTableNode(), TRUE ));
}
rTab.SetTabCols( rNew, rOld, pStart, bCurRowOnly );
::ClearFEShellTabCols();
@@ -3038,10 +3056,10 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, USHORT nSet )
if( nSet == rTable.GetRowsToRepeat() )
return;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoTblHeadline( rTable, rTable.GetRowsToRepeat() , nSet) );
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoTblHeadline(rTable, rTable.GetRowsToRepeat(), nSet) );
}
SwMsgPoolItem aChg( RES_TBLHEADLINECHG );
@@ -3249,8 +3267,10 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
SwTableFmlUpdate aMsgHnt( &rTbl );
SwHistory aHistory;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
aMsgHnt.pHistory = &aHistory;
+ }
{
ULONG nSttIdx = pNd->FindTableBoxStartNode()->GetIndex();
@@ -3287,10 +3307,11 @@ BOOL SwDoc::SplitTable( const SwPosition& rPos, USHORT eHdlnMode,
{
SwSaveRowSpan* pSaveRowSp = pNew->GetTable().CleanUpTopRowSpan( rTbl.GetTabLines().Count() );
SwUndoSplitTbl* pUndo = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoSplitTbl( *pNew, pSaveRowSp, eHdlnMode, bCalcNewSize ));
+ pUndo = new SwUndoSplitTbl(
+ *pNew, pSaveRowSp, eHdlnMode, bCalcNewSize);
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
if( aHistory.Count() )
pUndo->SaveFormula( aHistory );
}
@@ -3612,11 +3633,10 @@ BOOL SwDoc::MergeTable( const SwPosition& rPos, BOOL bWithPrev, USHORT nMode )
// beide Tabellen vorhanden, also kanns losgehen
SwUndoMergeTbl* pUndo = 0;
SwHistory* pHistory = 0;
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoMergeTbl( *pTblNd, *pDelTblNd,
- bWithPrev, nMode ));
+ pUndo = new SwUndoMergeTbl( *pTblNd, *pDelTblNd, bWithPrev, nMode );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
pHistory = new SwHistory;
}
@@ -3873,11 +3893,12 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
// Undo abschalten, Attribute werden sich vorher gemerkt
SwUndoTblAutoFmt* pUndo = 0;
- if( DoesUndo() )
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
+ if (bUndo)
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoTblAutoFmt( *pTblNd, rNew ) );
- DoUndo( FALSE );
+ pUndo = new SwUndoTblAutoFmt( *pTblNd, rNew );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ GetIDocumentUndoRedo().DoUndo(false);
}
_SetAFmtTabPara aPara( rNew );
@@ -3909,7 +3930,9 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
}
if( pUndo )
- DoUndo( TRUE );
+ {
+ GetIDocumentUndoRedo().DoUndo(bUndo);
+ }
SetModified();
SetFieldsDirty( true, NULL, 0 );
@@ -4062,6 +4085,7 @@ BOOL SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, USHORT eType,
aMsgHnt.eFlags = TBL_BOXPTR;
UpdateTblFlds( &aMsgHnt );
+ bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
BOOL bRet = FALSE;
switch( eType & 0xff )
{
@@ -4072,7 +4096,7 @@ BOOL SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, USHORT eType,
{
bRet = pTblNd->GetTable().SetColWidth( rAktBox,
eType, nAbsDiff, nRelDiff,
- DoesUndo() ? &pUndo : 0 );
+ (bUndo) ? &pUndo : 0 );
}
break;
case nsTblChgWidthHeightType::WH_ROW_TOP:
@@ -4081,15 +4105,14 @@ BOOL SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, USHORT eType,
case nsTblChgWidthHeightType::WH_CELL_BOTTOM:
bRet = pTblNd->GetTable().SetRowHeight( rAktBox,
eType, nAbsDiff, nRelDiff,
- DoesUndo() ? &pUndo : 0 );
+ (bUndo) ? &pUndo : 0 );
break;
}
+ GetIDocumentUndoRedo().DoUndo(bUndo); // SetColWidth can turn it off
if( pUndo )
{
- ClearRedo();
- AppendUndo( pUndo );
- DoUndo( TRUE ); // im SetColWidth kann es abgeschaltet werden!
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
if( bRet )
@@ -4123,9 +4146,9 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
bChgd = FALSE;
else
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_TABLE_AUTOFMT, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_AUTOFMT, NULL );
pUndo = new SwUndoTblNumFmt( rBox );
pUndo->SetNumFmt( nFmtIdx, fNumber );
}
@@ -4198,9 +4221,9 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
SFX_ITEM_SET == pBoxFmt->GetItemState( RES_BOXATR_VALUE,
FALSE, &pValueItem ))
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- StartUndo( UNDO_TABLE_AUTOFMT, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_AUTOFMT, NULL );
pUndo = new SwUndoTblNumFmt( rBox );
}
@@ -4231,8 +4254,8 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
if( pUndo )
{
pUndo->SetBox( rBox );
- AppendUndo( pUndo );
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
const SwTableNode* pTblNd = rBox.GetSttNd()->FindTableNode();
@@ -4252,10 +4275,9 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, BOOL bCallUpdate )
void SwDoc::SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoTblNumFmt( rBox, &rSet ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoTblNumFmt(rBox, &rSet) );
}
SwFrmFmt* pBoxFmt = rBox.ClaimFrmFmt();
@@ -4278,7 +4300,7 @@ void SwDoc::SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet )
void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode )
{
SwStartNode* pSttNd;
- if( 0 != ( pSttNd = GetNodes()[ rNode ]->
+ if( 0 != ( pSttNd = rNode.GetNode().
FindSttNodeByType( SwTableBoxStartNode )) &&
2 == pSttNd->EndOfSectionIndex() - pSttNd->GetIndex() )
{
@@ -4291,10 +4313,9 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode )
SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMULA, FALSE ) ||
SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_VALUE, FALSE ))
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoTblNumFmt( *pBox ) );
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoTblNumFmt(*pBox));
}
SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
@@ -4331,32 +4352,38 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
? pCpyTbl->GetTableNode()
: rBoxes[ 0 ]->GetSttNd()->FindTableNode();
- SwTableNode* pInsTblNd = GetNodes()[ rInsPos.nNode ]->FindTableNode();
+ SwTableNode * pInsTblNd = rInsPos.nNode.GetNode().FindTableNode();
+ bool const bUndo( GetIDocumentUndoRedo().DoesUndo() );
if( !pCpyTbl && !pInsTblNd )
{
SwUndoCpyTbl* pUndo = 0;
- if( DoesUndo() )
+ if (bUndo)
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndo = new SwUndoCpyTbl;
- DoUndo( FALSE );
}
- bRet = pSrcTblNd->GetTable().MakeCopy( this, rInsPos, rBoxes,
+ {
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+ bRet = pSrcTblNd->GetTable().MakeCopy( this, rInsPos, rBoxes,
TRUE, bCpyName );
+ }
+
if( pUndo )
{
if( !bRet )
+ {
delete pUndo;
+ pUndo = 0;
+ }
else
{
pInsTblNd = GetNodes()[ rInsPos.nNode.GetIndex() - 1 ]->FindTableNode();
pUndo->SetTableSttIdx( pInsTblNd->GetIndex() );
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
- DoUndo( TRUE );
}
}
else
@@ -4368,11 +4395,11 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
nsRedlineMode_t::REDLINE_SHOW_DELETE));
SwUndoTblCpyTbl* pUndo = 0;
- if( DoesUndo() )
+ if (bUndo)
{
- ClearRedo();
+ GetIDocumentUndoRedo().ClearRedo();
pUndo = new SwUndoTblCpyTbl;
- DoUndo( FALSE );
+ GetIDocumentUndoRedo().DoUndo(false);
}
SwDoc* pCpyDoc = (SwDoc*)pSrcTblNd->GetDoc();
@@ -4392,8 +4419,9 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
if( pUndo )
{
- DoUndo( TRUE );
+ GetIDocumentUndoRedo().DoUndo(bUndo);
delete pUndo;
+ pUndo = 0;
}
return FALSE;
}
@@ -4445,11 +4473,13 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
{
// falls die Tabelle nicht kopiert werden konnte, das Undo-Object
// wieder loeschen
+ GetIDocumentUndoRedo().DoUndo(bUndo);
if( !bRet && pUndo->IsEmpty() )
delete pUndo;
else
- AppendUndo( pUndo );
- DoUndo( TRUE );
+ {
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
}
if( bCorrPos )
@@ -4473,8 +4503,9 @@ BOOL SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
BOOL SwDoc::_UnProtectTblCells( SwTable& rTbl )
{
BOOL bChgd = FALSE;
- SwUndoAttrTbl* pUndo = DoesUndo() ? new SwUndoAttrTbl( *rTbl.GetTableNode() )
- : 0;
+ SwUndoAttrTbl *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
+ ? new SwUndoAttrTbl( *rTbl.GetTableNode() )
+ : 0;
SwTableSortBoxes& rSrtBox = rTbl.GetTabSortBoxes();
for( USHORT i = rSrtBox.Count(); i; )
@@ -4491,8 +4522,7 @@ BOOL SwDoc::_UnProtectTblCells( SwTable& rTbl )
{
if( bChgd )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -4520,7 +4550,7 @@ BOOL SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
BOOL bChgd = FALSE;
if( rBoxes.Count() )
{
- SwUndoAttrTbl* pUndo = DoesUndo()
+ SwUndoAttrTbl *const pUndo = (GetIDocumentUndoRedo().DoesUndo())
? new SwUndoAttrTbl( *rBoxes[0]->GetSttNd()->FindTableNode() )
: 0;
@@ -4549,8 +4579,7 @@ BOOL SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
{
if( bChgd )
{
- ClearRedo();
- AppendUndo( pUndo );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
}
else
delete pUndo;
@@ -4561,7 +4590,7 @@ BOOL SwDoc::UnProtectCells( const SwSelBoxes& rBoxes )
BOOL SwDoc::UnProtectTbls( const SwPaM& rPam )
{
- StartUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
BOOL bChgd = FALSE, bHasSel = rPam.HasMark() ||
rPam.GetNext() != (SwPaM*)&rPam;
@@ -4595,7 +4624,7 @@ BOOL SwDoc::UnProtectTbls( const SwPaM& rPam )
bChgd |= _UnProtectTblCells( *pTbl );
}
- EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
if( bChgd )
SetModified();
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index c561f10d0a3f..fea3d66c3ea9 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -29,10 +29,6 @@
#include "precompiled_sw.hxx"
-#ifdef WTC
-#define private public
-#endif
-
#include "hintids.hxx"
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
@@ -49,7 +45,8 @@
#include <cntfrm.hxx>
#include <txtfrm.hxx>
#include <svx/svxids.hrc>
-#include "doc.hxx"
+#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include "pam.hxx"
#include "swcrsr.hxx"
#include "viscrs.hxx"
@@ -59,7 +56,8 @@
#include "swtblfmt.hxx"
#include "docary.hxx"
#include "ndindex.hxx"
-#include "undobj.hxx"
+#include <UndoTable.hxx>
+
using namespace ::com::sun::star;
@@ -337,10 +335,9 @@ void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew )
if( aRowArr.Count() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
@@ -398,10 +395,9 @@ void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew )
if( aRowArr.Count() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
@@ -472,10 +468,10 @@ BOOL SwDoc::BalanceRowHeight( const SwCursor& rCursor, BOOL bTstOnly )
}
SwFmtFrmSize aNew( ATT_MIN_SIZE, 0, nHeight );
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoAttrTbl(*pTblNd));
}
SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
@@ -504,10 +500,9 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew
if( aRowArr.Count() )
{
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
@@ -600,10 +595,9 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
if( aUnions.Count() )
{
SwTable& rTable = pTblNd->GetTable();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) );
}
SvPtrarr aFmtCmp( 255, 255 );
@@ -849,10 +843,9 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
if( aUnions.Count() )
{
SwTable& rTable = pTblNd->GetTable();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
}
for( USHORT i = 0; i < aUnions.Count(); ++i )
@@ -1132,10 +1125,9 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes, TRUE ) )
{
SwTable& rTable = pTblNd->GetTable();
- if( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) );
}
SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aBoxes.Count()) ), 255 );
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 1d387df76063..efe7d8177ca6 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -29,8 +29,10 @@
#include "precompiled_sw.hxx"
#include <stdlib.h>
+
#include <node.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <txtfld.hxx>
#include <fmtfld.hxx>
@@ -226,9 +228,12 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
}
else
{
- int bSavePersData = GetDoc()->GetUndoNds() == &rNds;
- int bRestPersData = GetDoc()->GetUndoNds() == this;
+ bool bSavePersData(GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNds));
+ bool bRestPersData(GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this));
SwDoc* pDestDoc = rNds.GetDoc() != GetDoc() ? rNds.GetDoc() : 0;
+ OSL_ENSURE(!pDestDoc, "SwNodes::ChgNode(): "
+ "the code to handle text fields here looks broken\n"
+ "if the target is in a different document.");
if( !bRestPersData && !bSavePersData && pDestDoc )
bSavePersData = bRestPersData = TRUE;
@@ -305,7 +310,9 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
// Sonderbehandlung fuer die Felder!
if( pHts && pHts->Count() )
{
- int bToUndo = &pDestDoc->GetNodes() != &rNds;
+ // this looks fishy if pDestDoc != 0
+ bool const bToUndo = !pDestDoc &&
+ GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNds);
for( USHORT i = pHts->Count(); i; )
{
USHORT nDelMsg = 0;
@@ -658,7 +665,8 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
}
}
- if( GetDoc()->GetUndoNds() == &rNodes )
+ if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(
+ rNodes))
{
SwFrmFmt* pTblFmt = pTblNd->GetTable().GetFrmFmt();
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
@@ -695,8 +703,8 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
// noch den EndNode erzeugen
new SwEndNode( aIdx, *pTmp );
}
- else if( (const SwNodes*)&rNodes ==
- GetDoc()->GetUndoNds() )
+ else if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(
+ rNodes))
{
// im UndoNodes-Array spendieren wir einen
// Platzhalter
@@ -762,7 +770,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
case ND_SECTIONNODE:
if( !nLevel &&
- ( (const SwNodes*)&rNodes == GetDoc()->GetUndoNds() ) )
+ GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNodes))
{
// dann muss an der akt. InsPos ein SectionDummyNode
// eingefuegt werden
@@ -889,7 +897,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
break;
case ND_SECTIONDUMMY:
- if( (const SwNodes*)this == GetDoc()->GetUndoNds() )
+ if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this))
{
if( &rNodes == this ) // innerhalb vom UndoNodesArray
{
@@ -1461,8 +1469,7 @@ USHORT SwNodes::GetSectionLevel(const SwNodeIndex &rIdx) const {
* Keine Rekursion! - hier wird das SwNode::GetSectionLevel
* aufgerufen
*/
- return (*this)[rIdx]->GetSectionLevel();
-
+ return rIdx.GetNode().GetSectionLevel();
}
void SwNodes::GoStartOfSection(SwNodeIndex *pIdx) const
@@ -1790,8 +1797,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
SwNodeIndex aEndIdx( pEnd->nNode );
SwNodeIndex aSttIdx( pStt->nNode );
- SwTxtNode* const pSrcNd = (*this)[ aSttIdx ]->GetTxtNode();
- SwTxtNode* pDestNd = rNodes[ rPos.nNode ]->GetTxtNode();
+ SwTxtNode *const pSrcNd = aSttIdx.GetNode().GetTxtNode();
+ SwTxtNode * pDestNd = rPos.nNode.GetNode().GetTxtNode();
BOOL bSplitDestNd = TRUE;
BOOL bCopyCollFmt = pDestNd && !pDestNd->GetTxt().Len();
@@ -1841,10 +1848,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( rNodes.IsDocNodes() )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
pInsDoc->SplitNode( rPos, false );
- pInsDoc->DoUndo( bIsUndo );
}
else
{
@@ -1872,10 +1877,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( bCopyCollFmt )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const undoGuard(pInsDoc->GetIDocumentUndoRedo());
pSrcNd->CopyCollFmt( *pDestNd );
- pInsDoc->DoUndo( bIsUndo );
bCopyCollFmt = FALSE;
}
@@ -1911,10 +1914,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( rNodes.IsDocNodes() )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
pInsDoc->SplitNode( rPos, false );
- pInsDoc->DoUndo( bIsUndo );
}
else
{
@@ -1933,7 +1934,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
bSplitDestNd = TRUE;
}
- SwTxtNode* const pEndSrcNd = (*this)[ aEndIdx ]->GetTxtNode();
+ SwTxtNode* const pEndSrcNd = aEndIdx.GetNode().GetTxtNode();
if ( pEndSrcNd )
{
{
@@ -1952,7 +1953,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
}
else
{
- pDestNd = rNodes[ rPos.nNode ]->GetTxtNode();
+ pDestNd = rPos.nNode.GetNode().GetTxtNode();
}
if( pDestNd && pEnd->nContent.GetIndex() )
@@ -1966,10 +1967,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if( bCopyCollFmt )
{
SwDoc* const pInsDoc = pDestNd->GetDoc();
- const bool bIsUndo = pInsDoc->DoesUndo();
- pInsDoc->DoUndo( false );
+ ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
pEndSrcNd->CopyCollFmt( *pDestNd );
- pInsDoc->DoUndo( bIsUndo );
}
}
}
@@ -2009,7 +2008,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
ASSERT( bSuccess, "Move() - no ContentNode here" );
(void) bSuccess;
}
- pStt->nContent.Assign( (*this)[ pStt->nNode ]->GetCntntNode(),
+ pStt->nContent.Assign( pStt->nNode.GetNode().GetCntntNode(),
pStt->nContent.GetIndex() );
// der PaM wird korrigiert, denn falls ueber Nodegrenzen verschoben
// wurde, so stehen sie in unterschielichen Nodes. Auch die Selektion
@@ -2054,7 +2053,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
SwNodeRange aRg( rRange );
// "einfache" StartNodes oder EndNodes ueberspringen
- while( ND_STARTNODE == (pAktNode = (*this)[ aRg.aStart ])->GetNodeType()
+ while( ND_STARTNODE == (pAktNode = & aRg.aStart.GetNode())->GetNodeType()
|| ( pAktNode->IsEndNode() &&
!pAktNode->pStartOfSection->IsSectionNode() ) )
aRg.aStart++;
@@ -2066,7 +2065,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
// special section nodes and then one before the first.
if (aRg.aEnd.GetNode().StartOfSectionIndex() != 0)
{
- while( (( pAktNode = (*this)[ aRg.aEnd ])->GetStartNode() &&
+ while( ((pAktNode = & aRg.aEnd.GetNode())->GetStartNode() &&
!pAktNode->IsSectionNode() ) ||
( pAktNode->IsEndNode() &&
ND_STARTNODE == pAktNode->pStartOfSection->GetNodeType()) )
@@ -2214,12 +2213,12 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
break;
case ND_SECTIONDUMMY:
- if( (const SwNodes*)this == GetDoc()->GetUndoNds() )
+ if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(*this))
{
// dann muss an der akt. InsPos auch ein SectionNode
// (Start/Ende) stehen; dann diesen ueberspringen.
// Andernfalls nicht weiter beachten.
- SwNode* pTmpNd = pDoc->GetNodes()[ aInsPos ];
+ SwNode *const pTmpNd = & aInsPos.GetNode();
if( pTmpNd->IsSectionNode() ||
pTmpNd->StartOfSectionNode()->IsSectionNode() )
aInsPos++; // ueberspringen
@@ -2294,7 +2293,8 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
const SwNode* pNd;
while( aTmp < Count() - 1 )
{
- if( ND_SECTIONNODE == ( pNd = (*this)[aTmp])->GetNodeType() )
+ pNd = & aTmp.GetNode();
+ if (ND_SECTIONNODE == pNd->GetNodeType())
{
const SwSection& rSect = ((SwSectionNode*)pNd)->GetSection();
if( (bSkipHidden && rSect.IsHiddenFlag()) ||
@@ -2346,7 +2346,8 @@ SwCntntNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx,
const SwNode* pNd;
while( aTmp > 0 )
{
- if( ND_ENDNODE == ( pNd = (*this)[aTmp])->GetNodeType() )
+ pNd = & aTmp.GetNode();
+ if (ND_ENDNODE == pNd->GetNodeType())
{
if( pNd->pStartOfSection->IsSectionNode() )
{
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index a0c16bd9d1e5..bd517ae0b32a 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -28,8 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <stdlib.h>
+
#include <hintids.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -46,6 +46,7 @@
#include <fmtpdsc.hxx>
#include <errhdl.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <node.hxx>
#include <pam.hxx>
#include <frmtool.hxx>
@@ -274,10 +275,8 @@ SwSection::~SwSection()
{
// Bug: 28191 - nicht ins Undo aufnehmen, sollte schon vorher
// geschehen sein!!
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
pDoc->DelSectionFmt( pFmt ); // und loeschen
- pDoc->DoUndo( bUndo );
}
}
if (m_RefObj.Is())
@@ -1447,8 +1446,8 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
// <--
// Undo immer abschalten
- BOOL bWasUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
BOOL bWasVisibleLinks = pDoc->IsVisibleLinks();
pDoc->SetVisibleLinks( FALSE );
@@ -1685,9 +1684,9 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
}
- // Alle UndoActions entfernen und Undo wieder einschalten
- pDoc->DelAllUndoObj();
- pDoc->DoUndo( bWasUndo );
+ // remove all undo actions and turn undo on again
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DoUndo(bWasUndo);
pDoc->SetVisibleLinks( bWasVisibleLinks );
pDoc->UnlockExpFlds();
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index cb804b102c0e..4a88ec8df07c 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -354,7 +354,7 @@ BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
SwNode *pANd;
SwTableNode *pTblNd;
if( pAPos &&
- 0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
+ 0 != (pANd = & pAPos->nNode.GetNode()) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
const BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 75111933e0ec..56b33730efa2 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -43,6 +43,7 @@
#include "cntfrm.hxx"
#include "frmatr.hxx"
#include "doc.hxx"
+#include <IDocumentUndoRedo.hxx>
#include "dview.hxx"
#include "dflyobj.hxx"
#include "flyfrm.hxx"
@@ -884,7 +885,7 @@ void __EXPORT SwVirtFlyDrawObj::Move(const Size& rSiz)
{
NbcMove( rSiz );
SetChanged();
- GetFmt()->GetDoc()->SetNoDrawUndoObj( TRUE );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
}
@@ -893,7 +894,7 @@ void __EXPORT SwVirtFlyDrawObj::Resize(const Point& rRef,
{
NbcResize( rRef, xFact, yFact );
SetChanged();
- GetFmt()->GetDoc()->SetNoDrawUndoObj( TRUE );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
}
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 441b474c6b27..2142053586d2 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -52,6 +52,7 @@
#include <ndole.hxx>
#include <fmtanchr.hxx>
#include "shellres.hxx"
+#include <IDocumentUndoRedo.hxx>
// #i7672#
#include <editeng/outliner.hxx>
@@ -1085,7 +1086,7 @@ void SwDrawView::DeleteMarked()
SwDoc* pDoc = Imp().GetShell()->GetDoc();
if ( pDoc->GetRootFrm() )
pDoc->GetRootFrm()->StartAllAction();
- pDoc->StartUndo(UNDO_EMPTY, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
// OD 18.06.2003 #108784# - replace marked <SwDrawVirtObj>-objects by its
// reference objects.
{
@@ -1104,7 +1105,7 @@ void SwDrawView::DeleteMarked()
FmFormView::DeleteMarked();
::FrameNotify( Imp().GetShell(), FLY_DRAG_END );
}
- pDoc->EndUndo(UNDO_EMPTY, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
if( pDoc->GetRootFrm() )
pDoc->GetRootFrm()->EndAllAction();
}
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index b7e92570df42..7601afc663b3 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -32,9 +32,7 @@
#define _STD_VAR_ARRAYS
#include <hintids.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <editeng/langitem.hxx>
#include <fmtinfmt.hxx>
#include <txtatr.hxx>
@@ -96,17 +94,19 @@ void _PaMIntoCrsrShellRing::RemoveFromRing( SwPaM& rPam, Ring* pPrev )
SwAutoCorrDoc::SwAutoCorrDoc( SwEditShell& rEditShell, SwPaM& rPam,
sal_Unicode cIns )
- : rEditSh( rEditShell ), rCrsr( rPam ), pIdx( 0 ),
- nUndoId( UNDO_EMPTY ),
- bUndoIdInitialized( cIns ? false : true )
+ : rEditSh( rEditShell ), rCrsr( rPam ), pIdx( 0 )
+ , m_nEndUndoCounter(0)
+ , bUndoIdInitialized( cIns ? false : true )
{
}
SwAutoCorrDoc::~SwAutoCorrDoc()
{
- if( UNDO_EMPTY != nUndoId )
- rEditSh.EndUndo( nUndoId );
+ for (int i = 0; i < m_nEndUndoCounter; ++i)
+ {
+ rEditSh.EndUndo();
+ }
delete pIdx;
}
@@ -146,7 +146,10 @@ BOOL SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt )
{
bUndoIdInitialized = true;
if( 1 == rTxt.Len() )
- rEditSh.StartUndo( nUndoId = UNDO_AUTOCORRECT );
+ {
+ rEditSh.StartUndo( UNDO_AUTOCORRECT );
+ ++m_nEndUndoCounter;
+ }
}
return TRUE;
}
@@ -215,7 +218,10 @@ BOOL SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
{
bUndoIdInitialized = true;
if( 1 == rTxt.Len() )
- rEditSh.StartUndo( nUndoId = UNDO_AUTOCORRECT );
+ {
+ rEditSh.StartUndo( UNDO_AUTOCORRECT );
+ ++m_nEndUndoCounter;
+ }
}
}
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 639bab3c10c5..9029f57f75dc 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -36,7 +36,11 @@
#include <hintids.hxx>
#include <svl/svstdarr.hxx>
+
#include <unotools/charclass.hxx>
+
+#include <vcl/msgbox.hxx>
+
#include <editeng/boxitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/brkitem.hxx>
@@ -46,12 +50,13 @@
#include <editeng/langitem.hxx>
#include <editeng/cscoitem.hxx>
#include <editeng/unolingu.hxx>
-
#include <editeng/acorrcfg.hxx>
+
#include <swwait.hxx>
#include <fmtpdsc.hxx>
#include <fmtanchr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <editsh.hxx>
#include <index.hxx>
@@ -72,13 +77,8 @@
#include <frmatr.hxx>
#include <charatr.hxx>
#include <mdiexp.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-#include <vcl/msgbox.hxx>
#include <numrule.hxx>
using namespace ::com::sun::star;
@@ -2253,7 +2253,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
pDoc->SetRedlineMode( eRedlMode );
// save undo state (might be turned off)
- sal_Bool bUndoState = pDoc->DoesUndo();
+ bool const bUndoState = pDoc->GetIDocumentUndoRedo().DoesUndo();
// wenn mehrere Zeilen, dann erstmal nicht mit
// dem nachfolgenden Absatz zusammenfassen.
@@ -2271,51 +2271,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
eStat = READ_NEXT_PARA;
while( !bEnde )
{
- // #95884# limit redline array size to prevent overflow and to conserve
- // memory
- if( pDoc->HasTooManyUndos() )
- {
- DBG_ASSERT( bUndoState, "undo overflow without undo?" );
-
- //ask user
- short nResult = m_nActionWhileAutoformatUndoBufferOverflow; // TODO: #102007# read the last decision of the user from configuration
- if(m_bAskForCancelUndoWhileBufferOverflow) // #102007# TODO: read the last decision of the user from configuration
- {
- Window* pParent = pEditShell?pEditShell->GetWin():NULL;
- WarningBox aWarning( pParent,SW_RES(MSG_DISABLE_UNDO_QUESTION));
- aWarning.SetDefaultCheckBoxText();
- USHORT nDefaultButton = nResult==RET_YES?BUTTONID_YES:(nResult==RET_NO?BUTTONID_NO:BUTTONID_CANCEL);
- aWarning.SetFocusButton(nDefaultButton);
- nResult = aWarning.Execute();
- m_bAskForCancelUndoWhileBufferOverflow = !aWarning.GetCheckBoxState();
- m_nActionWhileAutoformatUndoBufferOverflow = nResult;
- // TODO: #102007# store m_bAskForCancelUndoWhileBufferOverflow in configuration
- // TODO: #102007# store m_nActionWhileAutoformatUndoBufferOverflow in configuration
- }
-
- DBG_ASSERT( (nResult == RET_YES) || (nResult == RET_CANCEL) || (nResult == RET_NO),
- "unexpected result" );
-
- if( nResult == RET_YES )
- {
- // turn off undo and continue
- pDoc->DoUndo( sal_False );
- pDoc->DelAllUndoObj();
- }
- else if( nResult == RET_NO )
- {
- //stop autoformatting and keep changes
- eStat = IS_ENDE;
- }
- else if( nResult == RET_CANCEL )
- {
- //cancel autoformatting and undo changes
- eStat = IS_ENDE;
-
- // TODO: #102004# undo changes
- }
- }
-
switch( eStat )
{
case READ_NEXT_PARA:
@@ -2709,7 +2664,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
pDoc->SetRedlineMode( eOldMode );
// restore undo (in case it has been changed)
- pDoc->DoUndo( bUndoState );
+ pDoc->GetIDocumentUndoRedo().DoUndo(bUndoState);
// Prozent-Anzeige wieder abschalten
if( !aFlags.bAFmtByInput )
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index 6fda3a164c32..ea923b77a54d 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -28,9 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <editsh.hxx>
#include <doc.hxx> // fuer aNodes
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx> // fuer SwPaM
#include <edimp.hxx> // fuer MACROS
#include <swundo.hxx> // fuer die UndoIds
@@ -49,7 +49,9 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
StartAllAction();
BOOL bUndoGroup = GetCrsr()->GetNext() != GetCrsr();
if( bUndoGroup )
- GetDoc()->StartUndo(UNDO_RESETATTR, NULL);
+ {
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_RESETATTR, NULL);
+ }
FOREACHPAM_START(this)
// if ( PCURCRSR->HasMark() )
@@ -57,7 +59,9 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
FOREACHPAM_END()
if( bUndoGroup )
- GetDoc()->EndUndo(UNDO_RESETATTR, NULL);
+ {
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_RESETATTR, NULL);
+ }
CallChgLnk();
EndAllAction();
}
@@ -71,12 +75,14 @@ void SwEditShell::GCAttr()
// Sonst Probleme im MouseBut.DownHdl - Bug 35562
// StartAllAction();
FOREACHPAM_START(this)
- SwTxtNode *pTxtNode;
if ( !PCURCRSR->HasMark() )
{
- if( 0 != (pTxtNode = GetDoc()->GetNodes()[
- PCURCRSR->GetPoint()->nNode]->GetTxtNode()))
+ SwTxtNode *const pTxtNode =
+ PCURCRSR->GetPoint()->nNode.GetNode().GetTxtNode();
+ if (pTxtNode)
+ {
pTxtNode->GCAttr();
+ }
}
else
{
@@ -133,7 +139,7 @@ void SwEditShell::SetAttr( const SfxPoolItem& rHint, USHORT nFlags )
if( pCrsr->GetNext() != pCrsr ) // Ring von Cursorn
{
BOOL bIsTblMode = IsTableMode();
- GetDoc()->StartUndo(UNDO_INSATTR, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL);
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() && ( bIsTblMode ||
@@ -143,7 +149,7 @@ void SwEditShell::SetAttr( const SfxPoolItem& rHint, USHORT nFlags )
}
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_INSATTR, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_INSATTR, NULL);
}
else
{
@@ -163,7 +169,7 @@ void SwEditShell::SetAttr( const SfxItemSet& rSet, USHORT nFlags )
if( pCrsr->GetNext() != pCrsr ) // Ring von Cursorn
{
BOOL bIsTblMode = IsTableMode();
- GetDoc()->StartUndo(UNDO_INSATTR, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL);
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() && ( bIsTblMode ||
@@ -173,7 +179,7 @@ void SwEditShell::SetAttr( const SfxItemSet& rSet, USHORT nFlags )
}
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_INSATTR, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_INSATTR, NULL);
}
else
{
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index a996ed802a42..ef4362e2a9fd 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -31,6 +31,7 @@
#include <hintids.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
@@ -39,7 +40,6 @@
#include <IMark.hxx>
#include <docary.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
#include <globals.hrc>
#include <comcore.hrc>
@@ -68,7 +68,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, BOOL* pUndo )
// in Tabellen das Undo gruppieren
if( pUndo && !*pUndo )
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
*pUndo = TRUE;
}
SwPaM aDelPam( *rPam.Start() );
@@ -129,7 +129,7 @@ long SwEditShell::Delete()
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_MULTISEL)));
- GetDoc()->StartUndo( UNDO_DELETE, &aRewriter );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_DELETE, &aRewriter);
}
FOREACHPAM_START(this)
@@ -138,7 +138,9 @@ long SwEditShell::Delete()
// falls eine Undo-Klammerung, dann hier beenden
if( bUndo )
- GetDoc()->EndUndo( UNDO_DELETE, NULL );
+ {
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
+ }
EndAllAction();
nRet = 1;
}
@@ -207,7 +209,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
// For block selection this list is filled with the insert positions
std::list< boost::shared_ptr<SwPosition> >::iterator pNextInsert = aInsertList.begin();
- pDestShell->GetDoc()->StartUndo( UNDO_START, NULL );
+ pDestShell->GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
FOREACHPAM_START(this)
if( !pPos )
@@ -289,7 +291,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
#endif
// Undo-Klammerung hier beenden
- pDestShell->GetDoc()->EndUndo( UNDO_END, NULL );
+ pDestShell->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
pDestShell->EndAllAction();
pDestShell->SaveTblBoxCntnt( pDestShell->GetCrsr()->GetPoint() );
@@ -312,7 +314,7 @@ BOOL SwEditShell::Replace( const String& rNewStr, BOOL bRegExpRplc )
if( !HasReadonlySel() )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START(this)
if( PCURCRSR->HasMark() && *PCURCRSR->GetMark() != *PCURCRSR->GetPoint() )
@@ -324,7 +326,7 @@ BOOL SwEditShell::Replace( const String& rNewStr, BOOL bRegExpRplc )
FOREACHPAM_END()
// Undo-Klammerung hier beenden
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
EndAllAction();
}
return bRet;
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index c3dc53f1ba26..fb430aa053ab 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -33,6 +33,7 @@
#include <editeng/brkitem.hxx>
#include <editsh.hxx>
#include <doc.hxx> // fuer SwTxtFmtColls
+#include <IDocumentUndoRedo.hxx>
#include <edimp.hxx> // fuer MACROS
#include <ndtxt.hxx>
#include <paratr.hxx>
@@ -41,7 +42,7 @@
#include <viewopt.hxx>
// <--
#include <SwRewriter.hxx>
-#include <undobj.hxx>
+#include <numrule.hxx>
#include <swundo.hxx>
/*************************************
@@ -77,7 +78,7 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pLocal->GetName());
- GetDoc()->StartUndo(UNDO_SETFMTCOLL, &aRewriter);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_SETFMTCOLL, &aRewriter);
FOREACHPAM_START(this)
if( !PCURCRSR->HasReadonlySel(
@@ -87,7 +88,7 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
GetDoc()->SetTxtFmtColl( *PCURCRSR, pLocal, true, bResetListAttrs );
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_SETFMTCOLL, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_SETFMTCOLL, &aRewriter);
EndAllAction();
}
// <--
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx
index 6f884f244326..5edee9f0cb83 100644
--- a/sw/source/core/edit/edglbldc.cxx
+++ b/sw/source/core/edit/edglbldc.cxx
@@ -28,8 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -52,7 +52,9 @@ void SwEditShell::SetGlblDocSaveLinks( BOOL bFlag )
{
getIDocumentSettingAccess()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, bFlag);
if( !GetDoc()->IsModified() ) // Bug 57028
- GetDoc()->SetUndoNoResetModified();
+ {
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
GetDoc()->SetModified();
}
@@ -163,13 +165,13 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
BOOL bEndUndo = FALSE;
SwDoc* pMyDoc = GetDoc();
- SwTxtNode* pTxtNd = pMyDoc->GetNodes()[ rPos.nNode ]->GetTxtNode();
+ SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if( pTxtNd )
rPos.nContent.Assign( pTxtNd, 0 );
else
{
bEndUndo = TRUE;
- pMyDoc->StartUndo( UNDO_START, NULL );
+ pMyDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
rPos.nNode--;
pMyDoc->AppendTxtNode( rPos );
pCrsr->SetMark();
@@ -178,7 +180,9 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
InsertSection( rNew );
if( bEndUndo )
- pMyDoc->EndUndo( UNDO_END, NULL );
+ {
+ pMyDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ }
EndAllAction();
return TRUE;
@@ -209,7 +213,7 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
else
{
bEndUndo = TRUE;
- pMyDoc->StartUndo( UNDO_START, NULL );
+ pMyDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
rPos.nNode--;
pMyDoc->AppendTxtNode( rPos );
}
@@ -217,7 +221,9 @@ BOOL SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
InsertTableOf( rTOX );
if( bEndUndo )
- pMyDoc->EndUndo( UNDO_END, NULL );
+ {
+ pMyDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
+ }
EndAllAction();
return TRUE;
@@ -365,7 +371,7 @@ BOOL SwEditShell::GotoGlobalDocContent( const SwGlblDocContent& rPos )
rCrsrPos.nNode = rPos.GetDocPos();
SwDoc* pMyDoc = GetDoc();
- SwCntntNode* pCNd = pMyDoc->GetNodes()[ rCrsrPos.nNode ]->GetCntntNode();
+ SwCntntNode * pCNd = rCrsrPos.nNode.GetNode().GetCntntNode();
if( !pCNd )
pCNd = pMyDoc->GetNodes().GoNext( &rCrsrPos.nNode );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 7a143a2d29d9..4dbe56523482 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/list.hxx>
#include <tools/urlobj.hxx>
@@ -41,6 +42,7 @@
#include <frmfmt.hxx>
#include <charfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <editsh.hxx>
#include <frame.hxx>
@@ -201,7 +203,7 @@ void SwEditShell::Overwrite(const String &rStr)
long SwEditShell::SplitNode( BOOL bAutoFormat, BOOL bCheckTableStart )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START(this)
// eine Tabellen Zelle wird jetzt zu einer normalen Textzelle!
@@ -209,7 +211,7 @@ long SwEditShell::SplitNode( BOOL bAutoFormat, BOOL bCheckTableStart )
GetDoc()->SplitNode( *PCURCRSR->GetPoint(), bCheckTableStart );
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
if( bAutoFormat )
AutoFmtBySplitNode();
@@ -227,14 +229,14 @@ sal_Bool SwEditShell::AppendTxtNode()
{
sal_Bool bRet = sal_False;
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START(this)
GetDoc()->ClearBoxNumAttrs( PCURCRSR->GetPoint()->nNode );
bRet = GetDoc()->AppendTxtNode( *PCURCRSR->GetPoint()) || bRet;
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
ClearTblBoxCntnt();
@@ -752,7 +754,7 @@ BOOL SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, BOOL
if( !rFmt.GetValue().Len() || ( !rStr.Len() && !HasSelection() ) )
return FALSE;
StartAllAction();
- GetDoc()->StartUndo( UNDO_UI_INSERT_URLTXT, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_UI_INSERT_URLTXT, NULL);
BOOL bInsTxt = TRUE;
if( rStr.Len() )
@@ -796,7 +798,7 @@ BOOL SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, BOOL
ClearMark();
if( bInsTxt )
DontExpandFmt();
- GetDoc()->EndUndo( UNDO_UI_INSERT_URLTXT, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_UI_INSERT_URLTXT, NULL );
EndAllAction();
return TRUE;
}
@@ -1169,14 +1171,14 @@ void SwEditShell::TransliterateText( sal_uInt32 nType )
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr )
{
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
FOREACHPAM_START( this )
if( PCURCRSR->HasMark() )
GetDoc()->TransliterateText( *PCURCRSR, aTrans );
FOREACHPAM_END()
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
}
else
GetDoc()->TransliterateText( *pCrsr, aTrans );
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index c9ab4a591383..24057039e1ef 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -35,9 +35,7 @@
#include <unoflatpara.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <hintids.hxx>
#include <linguistic/lngprops.hxx>
#include <vcl/msgbox.hxx>
@@ -49,6 +47,7 @@
#include <charatr.hxx>
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx> // SwRootFrm
#include <pam.hxx>
#include <swundo.hxx> // fuer die UndoIds
@@ -57,9 +56,7 @@
#include <viscrs.hxx> // SwShellCrsr
#include <SwGrammarMarkUp.hxx> // SwWrongList
#include <mdiexp.hxx> // Statusanzeige
-#ifndef _STATSTR_HRC
#include <statstr.hrc> // StatLine-String
-#endif
#include <cntfrm.hxx>
#include <crsskip.hxx>
#include <splargs.hxx>
@@ -1334,7 +1331,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
// iterate over the new portions, beginning at the end to take advantage of the previously
// saved content positions
- pDoc->StartUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_OVERWRITE, NULL );
StartAction();
SwPaM *pCrsr = GetCrsr();
@@ -1463,7 +1460,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
// set continuation position for spell/grammar checking to the end of this sentence
pSpellIter->SetCurr( new SwPosition( *pCrsr->Start() ) );
- pDoc->EndUndo( UNDO_OVERWRITE, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_OVERWRITE, NULL );
EndAction();
}
}
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index ea1088f36f69..f5b2ef0fb2b9 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -33,6 +33,7 @@
#include <editsh.hxx>
#include <edimp.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndtxt.hxx>
#include <paratr.hxx>
#include <swundo.hxx>
@@ -153,12 +154,12 @@ BOOL SwEditShell::NoNum()
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( USHORT n = 0; n < aRangeArr.Count(); ++n )
bRet = bRet && GetDoc()->NoNum( aRangeArr.SetPam( n, aPam ));
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
bRet = GetDoc()->NoNum( *pCrsr );
@@ -217,14 +218,14 @@ void SwEditShell::DelNumRules()
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( USHORT n = 0; n < aRangeArr.Count(); ++n )
{
GetDoc()->DelNumRules( aRangeArr.SetPam( n, aPam ) );
}
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
GetDoc()->DelNumRules( *pCrsr );
@@ -255,12 +256,12 @@ BOOL SwEditShell::NumUpDown( BOOL bDown )
bRet = GetDoc()->NumUpDown( *pCrsr, bDown );
else
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( USHORT n = 0; n < aRangeArr.Count(); ++n )
bRet = bRet && GetDoc()->NumUpDown( aRangeArr.SetPam( n, aPam ), bDown );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
GetDoc()->SetModified();
@@ -517,13 +518,13 @@ BOOL SwEditShell::OutlineUpDown( short nOffset )
bRet = GetDoc()->OutlineUpDown( *pCrsr, nOffset );
else
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( USHORT n = 0; n < aRangeArr.Count(); ++n )
bRet = bRet && GetDoc()->OutlineUpDown(
aRangeArr.SetPam( n, aPam ), nOffset );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
GetDoc()->SetModified();
EndAllAction();
@@ -698,10 +699,11 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
{
StartAllAction();
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
+
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( USHORT n = 0; n < aRangeArr.Count(); ++n )
@@ -715,21 +717,17 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
// <--
GetDoc()->SetCounted( aPam, true );
}
- GetDoc()->EndUndo( UNDO_END, NULL );
}
else
{
- GetDoc()->StartUndo( UNDO_START, NULL );
-
// --> OD 2008-02-08 #newlistlevelattrs#
// --> OD 2008-03-17 #refactorlists#
GetDoc()->SetNumRule( *pCrsr, rRule,
bCreateNewList, sContinuedListId,
sal_True, bResetIndentAttrs );
GetDoc()->SetCounted( *pCrsr, true );
-
- GetDoc()->EndUndo( UNDO_END, NULL );
}
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
EndAllAction();
}
@@ -761,12 +759,12 @@ void SwEditShell::SetNumRuleStart( BOOL bFlag )
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( USHORT n = 0; n < aRangeArr.Count(); ++n )
GetDoc()->SetNumRuleStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), bFlag );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
GetDoc()->SetNumRuleStart( *pCrsr->GetPoint(), bFlag );
@@ -790,12 +788,12 @@ void SwEditShell::SetNodeNumStart( USHORT nStt )
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
{
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
for( USHORT n = 0; n < aRangeArr.Count(); ++n )
GetDoc()->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), nStt );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
GetDoc()->SetNodeNumStart( *pCrsr->GetPoint(), nStt );
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index a936002df9a2..4cdf271c50f0 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -28,9 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <doc.hxx>
#include <editsh.hxx>
+#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
@@ -50,7 +50,7 @@ SwEditShell::InsertSection(
if( !IsTableMode() )
{
StartAllAction();
- GetDoc()->StartUndo( UNDO_INSSECTION, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_INSSECTION, NULL );
FOREACHPAM_START(this)
SwSection const*const pNew =
@@ -59,8 +59,7 @@ SwEditShell::InsertSection(
pRet = pNew;
FOREACHPAM_END()
- // Undo-Klammerung hier beenden
- GetDoc()->EndUndo( UNDO_INSSECTION, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_INSSECTION, NULL );
EndAllAction();
}
return pRet;
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index 76a37e4e8627..d363b0ac845a 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -35,9 +35,7 @@
#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <vcl/window.hxx>
#include <editeng/boxitem.hxx>
#include <swwait.hxx>
@@ -45,6 +43,7 @@
#include <frmatr.hxx>
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -259,7 +258,9 @@ void SwEditShell::SetTblChgMode( TblChgMode eMode )
{
((SwTable&)pTblNd->GetTable()).SetTblChgMode( eMode );
if( !GetDoc()->IsModified() ) // Bug 57028
- GetDoc()->SetUndoNoResetModified();
+ {
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
GetDoc()->SetModified();
}
}
@@ -331,10 +332,10 @@ void SwEditShell::SetTblBoxFormulaAttrs( const SfxItemSet& rSet )
ClearTblBoxCntnt();
StartAllAction();
- GetDoc()->StartUndo( UNDO_START, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
for( USHORT n = 0; n < aBoxes.Count(); ++n )
GetDoc()->SetTblBoxFormulaAttrs( *aBoxes[ n ], rSet );
- GetDoc()->EndUndo( UNDO_END, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
EndAllAction();
}
@@ -407,11 +408,11 @@ BOOL SwEditShell::SplitTable( USHORT eMode )
if( pCrsr->GetNode()->FindTableNode() )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
bRet = GetDoc()->SplitTable( *pCrsr->GetPoint(), eMode, TRUE );
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
ClearFEShellTabCols();
EndAllAction();
}
@@ -425,11 +426,11 @@ BOOL SwEditShell::MergeTable( BOOL bWithPrev, USHORT nMode )
if( pCrsr->GetNode()->FindTableNode() )
{
StartAllAction();
- GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
bRet = GetDoc()->MergeTable( *pCrsr->GetPoint(), bWithPrev, nMode );
- GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
ClearFEShellTabCols();
EndAllAction();
}
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index b1188588fe4d..93c4e0cd10aa 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -27,38 +27,40 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
-
#include <tools/urlobj.hxx>
-#include <svtools/txtcmp.hxx>
-#ifndef SVTOOLS_FSTATHELPER_HXX
+
#include <svl/fstathelper.hxx>
-#endif
+
+#include <svtools/txtcmp.hxx>
+
#include <sfx2/docfile.hxx>
-#include "editeng/unolingu.hxx"
+
+#include <xmloff/odffields.hxx>
+
+#include <editeng/unolingu.hxx>
+
#include <swtypes.hxx>
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <viewopt.hxx>
#include <ndtxt.hxx>
#include <errhdl.hxx>
#include <swundo.hxx>
-#include <undobj.hxx>
#include <txttxmrk.hxx>
#include <edimp.hxx>
#include <tox.hxx>
#include <doctxm.hxx>
#include <docary.hxx>
#include <mdiexp.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
#include <bookmrk.hxx>
-#include <xmloff/odffields.hxx>
using namespace ::com::sun::star;
@@ -211,7 +213,7 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
::StartProgress( STR_STATSTR_TOX_UPDATE, 0, 0, pDocSh );
::SetProgressText( STR_STATSTR_TOX_UPDATE, pDocSh );
- pMyDoc->StartUndo(UNDO_TOXCHANGE, NULL);
+ pMyDoc->GetIDocumentUndoRedo().StartUndo(UNDO_TOXCHANGE, NULL);
// Verzeichnisrumpf erzeugen
pTOX->Update(pSet);
@@ -226,7 +228,7 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
// Seitennummern eintragen
pTOX->UpdatePageNum();
- pMyDoc->EndUndo(UNDO_TOXCHANGE, NULL);
+ pMyDoc->GetIDocumentUndoRedo().EndUndo(UNDO_TOXCHANGE, NULL);
::EndProgress( pDocSh );
EndAllAction();
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index a27b09f5d4ff..fb7a2103a5b1 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -28,18 +28,20 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <svx/svdview.hxx>
+
#include <editsh.hxx>
#include <fesh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <swundo.hxx>
#include <dcontact.hxx>
#include <flyfrm.hxx>
#include <frmfmt.hxx>
#include <viewimp.hxx>
+#include <docsh.hxx>
/** helper function to select all objects in an SdrMarkList;
@@ -47,16 +49,64 @@
void lcl_SelectSdrMarkList( SwEditShell* pShell,
const SdrMarkList* pSdrMarkList );
+bool SwEditShell::CursorsLocked() const
+{
+
+ return GetDoc()->GetDocShell()->GetModel()->hasControllersLocked();
+}
+
+void
+SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext)
+{
+ // do nothing if somebody has locked controllers!
+ if (CursorsLocked())
+ {
+ return;
+ }
+
+ SwFrmFmt * pSelFmt(0);
+ SdrMarkList * pMarkList(0);
+ rContext.GetSelections(pSelFmt, pMarkList);
+
+ if (pSelFmt) // select frame
+ {
+ if (RES_DRAWFRMFMT == pSelFmt->Which())
+ {
+ SdrObject* pSObj = pSelFmt->FindSdrObject();
+ static_cast<SwFEShell*>(this)->SelectObj(
+ pSObj->GetCurrentBoundRect().Center() );
+ }
+ else
+ {
+ Point aPt;
+ SwFlyFrm *const pFly =
+ static_cast<SwFlyFrmFmt*>(pSelFmt)->GetFrm(& aPt, false);
+ if (pFly)
+ {
+ static_cast<SwFEShell*>(this)->SelectFlyFrm(*pFly, true);
+ }
+ }
+ }
+ else if (pMarkList)
+ {
+ lcl_SelectSdrMarkList( this, pMarkList );
+ }
+ else if (GetCrsr()->GetNext() != GetCrsr())
+ {
+ // current cursor is the last one:
+ // go around the ring, to the first cursor
+ GoNextCrsr();
+ }
+}
-BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
+bool SwEditShell::Undo(USHORT const nCount)
{
SET_CURR_SHELL( this );
// #105332# current undo state was not saved
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
BOOL bRet = FALSE;
- BOOL bSaveDoesUndo = GetDoc()->DoesUndo();
- GetDoc()->DoUndo( FALSE );
StartAllAction();
{
// eigentlich muesste ja nur der aktuelle Cursor berarbeitet
@@ -69,8 +119,9 @@ BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
// JP 02.04.98: Cursor merken - beim Auto-Format/-Korrektur
// soll dieser wieder an die Position
- SwUndoId nLastUndoId = GetDoc()->GetUndoIds(NULL, NULL);
- BOOL bRestoreCrsr = 1 == nCnt && ( UNDO_AUTOFORMAT == nLastUndoId ||
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId);
+ bool bRestoreCrsr = 1 == nCount && (UNDO_AUTOFORMAT == nLastUndoId ||
UNDO_AUTOCORRECT == nLastUndoId );
Push();
@@ -80,51 +131,19 @@ BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
RedlineMode_t eOld = GetDoc()->GetRedlineMode();
- SwUndoIter aUndoIter( GetCrsr(), nUndoId );
- while( nCnt-- )
- {
- do {
-
- bRet = GetDoc()->Undo( aUndoIter ) || bRet;
-
- if( !aUndoIter.IsNextUndo() )
- break;
-
- // es geht weiter, also erzeuge einen neuen Cursor wenn
- // der alte schon eine Selection hat
- // JP 02.04.98: aber nicht wenns ein Autoformat ist
- if( !bRestoreCrsr && HasSelection() )
- {
- CreateCrsr();
- aUndoIter.pAktPam = GetCrsr();
- }
- } while( TRUE );
- }
-
- Pop( !bRestoreCrsr );
-
- if( aUndoIter.pSelFmt ) // dann erzeuge eine Rahmen-Selection
- {
- if( RES_DRAWFRMFMT == aUndoIter.pSelFmt->Which() )
+ try {
+ for (USHORT i = 0; i < nCount; ++i)
{
- SdrObject* pSObj = aUndoIter.pSelFmt->FindSdrObject();
- ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
+ bRet = GetDoc()->GetIDocumentUndoRedo().Undo()
+ || bRet;
}
- else
- {
- Point aPt;
- SwFlyFrm* pFly = ((SwFlyFrmFmt*)aUndoIter.pSelFmt)->GetFrm(
- &aPt, FALSE );
- if( pFly )
- ((SwFEShell*)this)->SelectFlyFrm( *pFly, TRUE );
- }
- }
- else if( aUndoIter.pMarkList )
- {
- lcl_SelectSdrMarkList( this, aUndoIter.pMarkList );
+ } catch (::com::sun::star::uno::Exception & e) {
+ OSL_TRACE("SwEditShell::Undo(): exception caught:\n %s",
+ ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)
+ .getStr());
}
- else if( GetCrsr()->GetNext() != GetCrsr() ) // gehe nach einem
- GoNextCrsr(); // Undo zur alten Undo-Position !!
+
+ Pop( !bRestoreCrsr );
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
@@ -134,21 +153,18 @@ BOOL SwEditShell::Undo( SwUndoId nUndoId, USHORT nCnt )
}
EndAllAction();
- // #105332# undo state was not restored but set to FALSE everytime
- GetDoc()->DoUndo( bSaveDoesUndo );
return bRet;
}
-USHORT SwEditShell::Redo( USHORT nCnt )
+bool SwEditShell::Redo(USHORT const nCount)
{
SET_CURR_SHELL( this );
BOOL bRet = FALSE;
// #105332# undo state was not saved
- BOOL bSaveDoesUndo = GetDoc()->DoesUndo();
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
- GetDoc()->DoUndo( FALSE );
StartAllAction();
{
@@ -166,51 +182,17 @@ USHORT SwEditShell::Redo( USHORT nCnt )
RedlineMode_t eOld = GetDoc()->GetRedlineMode();
- SwUndoIter aUndoIter( GetCrsr(), UNDO_EMPTY );
- while( nCnt-- )
- {
- do {
-
- bRet = GetDoc()->Redo( aUndoIter ) || bRet;
-
- if( !aUndoIter.IsNextUndo() )
- break;
-
- // es geht weiter, also erzeugen einen neuen Cursor wenn
- // der alte schon eine SSelection hat
- if( HasSelection() )
- {
- CreateCrsr();
- aUndoIter.pAktPam = GetCrsr();
- }
- } while( TRUE );
- }
-
- if( aUndoIter.IsUpdateAttr() )
- UpdateAttr();
-
- if( aUndoIter.pSelFmt ) // dann erzeuge eine Rahmen-Selection
- {
- if( RES_DRAWFRMFMT == aUndoIter.pSelFmt->Which() )
+ try {
+ for (USHORT i = 0; i < nCount; ++i)
{
- SdrObject* pSObj = aUndoIter.pSelFmt->FindSdrObject();
- ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
+ bRet = GetDoc()->GetIDocumentUndoRedo().Redo()
+ || bRet;
}
- else
- {
- Point aPt;
- SwFlyFrm* pFly = ((SwFlyFrmFmt*)aUndoIter.pSelFmt)->GetFrm(
- &aPt, FALSE );
- if( pFly )
- ((SwFEShell*)this)->SelectFlyFrm( *pFly, TRUE );
- }
- }
- else if( aUndoIter.pMarkList )
- {
- lcl_SelectSdrMarkList( this, aUndoIter.pMarkList );
+ } catch (::com::sun::star::uno::Exception & e) {
+ OSL_TRACE("SwEditShell::Redo(): exception caught:\n %s",
+ ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)
+ .getStr());
}
- else if( GetCrsr()->GetNext() != GetCrsr() ) // gehe nach einem
- GoNextCrsr(); // Redo zur alten Undo-Position !!
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
@@ -221,41 +203,31 @@ USHORT SwEditShell::Redo( USHORT nCnt )
EndAllAction();
- // #105332# undo state was not restored but set FALSE everytime
- GetDoc()->DoUndo( bSaveDoesUndo );
return bRet;
}
-USHORT SwEditShell::Repeat( USHORT nCount )
+bool SwEditShell::Repeat(USHORT const nCount)
{
SET_CURR_SHELL( this );
BOOL bRet = FALSE;
StartAllAction();
- SwUndoIter aUndoIter( GetCrsr(), UNDO_EMPTY );
- bRet = GetDoc()->Repeat( aUndoIter, nCount ) || bRet;
+ try {
+ ::sw::RepeatContext context(*GetDoc(), *GetCrsr());
+ bRet = GetDoc()->GetIDocumentUndoRedo().Repeat( context, nCount )
+ || bRet;
+ } catch (::com::sun::star::uno::Exception & e) {
+ OSL_TRACE("SwEditShell::Repeat(): exception caught:\n %s",
+ ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)
+ .getStr());
+ }
EndAllAction();
return bRet;
}
- // abfragen/setzen der Anzahl von wiederherstellbaren Undo-Actions
-
-USHORT SwEditShell::GetUndoActionCount()
-{
- return SwDoc::GetUndoActionCount();
-}
-
-
-void SwEditShell::SetUndoActionCount( USHORT nNew )
-{
- SwDoc::SetUndoActionCount( nNew );
-}
-
-
-
void lcl_SelectSdrMarkList( SwEditShell* pShell,
const SdrMarkList* pSdrMarkList )
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 81088bcc0e56..1a681ad2cf29 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -28,12 +28,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#include <vcl/window.hxx>
+
#include <editsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <docary.hxx>
#include <acorrect.hxx>
@@ -59,7 +58,7 @@ SwEditShell::SwEditShell( SwEditShell& rEdSH, Window *pWindow )
SwEditShell::SwEditShell( SwDoc& rDoc, Window *pWindow, const SwViewOption *pOptions )
: SwCrsrShell( rDoc, pWindow, pOptions )
{
- GetDoc()->DoUndo(true);
+ GetDoc()->GetIDocumentUndoRedo().DoUndo(true);
}
@@ -98,7 +97,7 @@ void SwEditShell::ResetModified()
void SwEditShell::SetUndoNoResetModified()
{
GetDoc()->SetModified();
- GetDoc()->SetUndoNoResetModified();
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
/******************************************************************************
@@ -261,24 +260,24 @@ void SwEditShell::InsertTOXType(const SwTOXType& rTyp)
void SwEditShell::DoUndo( sal_Bool bOn )
-{ GetDoc()->DoUndo( bOn ); }
+{ GetDoc()->GetIDocumentUndoRedo().DoUndo( bOn ); }
sal_Bool SwEditShell::DoesUndo() const
-{ return GetDoc()->DoesUndo(); }
+{ return GetDoc()->GetIDocumentUndoRedo().DoesUndo(); }
void SwEditShell::DoGroupUndo( sal_Bool bOn )
-{ GetDoc()->DoGroupUndo( bOn ); }
+{ GetDoc()->GetIDocumentUndoRedo().DoGroupUndo( bOn ); }
sal_Bool SwEditShell::DoesGroupUndo() const
-{ return GetDoc()->DoesGroupUndo(); }
+{ return GetDoc()->GetIDocumentUndoRedo().DoesGroupUndo(); }
void SwEditShell::DelAllUndoObj()
{
- GetDoc()->DelAllUndoObj();
+ GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
// Zusammenfassen von Kontinuierlichen Insert/Delete/Overwrite von
@@ -289,44 +288,25 @@ void SwEditShell::DelAllUndoObj()
SwUndoId SwEditShell::StartUndo( SwUndoId eUndoId,
const SwRewriter *pRewriter )
-{ return GetDoc()->StartUndo( eUndoId, pRewriter ); }
+{ return GetDoc()->GetIDocumentUndoRedo().StartUndo( eUndoId, pRewriter ); }
// schliesst Klammerung der nUndoId, nicht vom UI benutzt
SwUndoId SwEditShell::EndUndo(SwUndoId eUndoId,
const SwRewriter *pRewriter)
-{ return GetDoc()->EndUndo(eUndoId, pRewriter); }
-
-// liefert die Id der letzten undofaehigen Aktion zurueck
-// fuellt ggf. VARARR mit sdbcx::User-UndoIds
-
-
-SwUndoId SwEditShell::GetUndoIds(String* pStr,SwUndoIds *pUndoIds) const
-{ return GetDoc()->GetUndoIds(pStr,pUndoIds); }
-
-String SwEditShell::GetUndoIdsStr(String* pStr,SwUndoIds *pUndoIds) const
-{ return GetDoc()->GetUndoIdsStr(pStr,pUndoIds); }
-
-// liefert die Id der letzten Redofaehigen Aktion zurueck
-// fuellt ggf. VARARR mit RedoIds
-
-
-SwUndoId SwEditShell::GetRedoIds(String* pStr,SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRedoIds(pStr,pRedoIds); }
-
-String SwEditShell::GetRedoIdsStr(String* pStr,SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRedoIdsStr(pStr,pRedoIds); }
+{ return GetDoc()->GetIDocumentUndoRedo().EndUndo(eUndoId, pRewriter); }
-// liefert die Id der letzten Repeatfaehigen Aktion zurueck
-// fuellt ggf. VARARR mit RedoIds
+bool SwEditShell::GetLastUndoInfo(::rtl::OUString *const o_pStr,
+ SwUndoId *const o_pId) const
+{ return GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(o_pStr, o_pId); }
-SwUndoId SwEditShell::GetRepeatIds(String* pStr, SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRepeatIds(pStr,pRedoIds); }
+bool SwEditShell::GetFirstRedoInfo(::rtl::OUString *const o_pStr) const
+{ return GetDoc()->GetIDocumentUndoRedo().GetFirstRedoInfo(o_pStr); }
-String SwEditShell::GetRepeatIdsStr(String* pStr, SwUndoIds *pRedoIds) const
-{ return GetDoc()->GetRepeatIdsStr(pStr,pRedoIds); }
+SwUndoId SwEditShell::GetRepeatInfo(::rtl::OUString *const o_pStr) const
+{ return GetDoc()->GetIDocumentUndoRedo().GetRepeatInfo(o_pStr); }
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 1af598eb4e46..2957f696905d 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -863,7 +863,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
const ::sw::mark::IMark* pBkmk = ppMark->get();
const SwPosition* pPos = &pBkmk->GetMarkStart();
- pTxtNd = pDoc->GetNodes()[ pPos->nNode ]->GetTxtNode();
+ pTxtNd = pPos->nNode.GetNode().GetTxtNode();
*pStt = pPos->nContent.GetIndex();
if(pEnd)
{
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index ccb10ca03ee1..c745538d2013 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -28,16 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
-#include <svx/svdmodel.hxx>
+#include <svx/svdmodel.hxx>
#include <calbck.hxx>
#include <calc.hxx>
#include <usrfld.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <dpage.hxx>
#include <unofldmid.h>
@@ -302,7 +302,9 @@ void SwUserFieldType::SetContent( const String& rStr, sal_uInt32 nFmt )
sal_Bool bModified = GetDoc()->IsModified();
GetDoc()->SetModified();
if( !bModified ) // Bug 57028
- GetDoc()->SetUndoNoResetModified();
+ {
+ GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
}
}
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 79a2b64433d9..e973b7f64920 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -68,6 +68,7 @@
#include <txtflcnt.hxx>
#include <fesh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <rootfrm.hxx>
#include <ndtxt.hxx>
#include <pam.hxx>
@@ -104,7 +105,7 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
{
ASSERT( pClpDoc, "kein Clipboard-Dokument" );
- pClpDoc->DoUndo( FALSE ); // immer auf FALSE !!
+ pClpDoc->GetIDocumentUndoRedo().DoUndo(false); // always false!
// steht noch Inhalt im ClpDocument, dann muss dieser geloescht werden
SwNodeIndex aSttIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -733,7 +734,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
BOOL bRet = TRUE, bDelTbl = TRUE;
StartAllAction();
- GetDoc()->StartUndo( UNDO_INSGLOSSARY, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
GetDoc()->LockExpFlds();
// When the clipboard content has been created by a rectangular selection
@@ -1112,7 +1113,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
FOREACHPAM_END()
}
- GetDoc()->EndUndo( UNDO_INSGLOSSARY, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, NULL );
// wurden neue Tabellenformeln eingefuegt ?
if( pTblFldTyp->GetDepends() )
@@ -1484,7 +1485,7 @@ void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
if( SW_PASTESDR_INSERT == nAction )
{
- GetDoc()->SetNoDrawUndoObj( TRUE );
+ ::sw::DrawUndoGuard drawUndoGuard(GetDoc()->GetIDocumentUndoRedo());
sal_Bool bDesignMode = pView->IsDesignMode();
if( !bDesignMode )
@@ -1525,7 +1526,6 @@ void SwFEShell::Paste( SvStream& rStrm, USHORT nAction, const Point* pPt )
if( !bDesignMode )
pView->SetDesignMode( sal_False );
}
- GetDoc()->SetNoDrawUndoObj( FALSE );
}
EndUndo();
EndAllAction();
diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx
index fe73c36016a0..d346cecd0e73 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -28,11 +28,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <tools/ref.hxx>
#include <hintids.hxx>
-#include <tools/ref.hxx>
#include <fesh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <cntfrm.hxx>
@@ -42,6 +43,7 @@
#include <tabfrm.hxx>
#include <edimp.hxx>
#include <SwStyleNameMapper.hxx>
+
/*************************************************************************
|*
|* SwFEShell::GetPageDescCnt()
@@ -144,11 +146,11 @@ void SwFEShell::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
SET_CURR_SHELL( this );
//Fix i64842: because Undo has a very special way to handle header/footer content
// we have to copy the page descriptor before calling ChgPageDesc.
- const sal_Bool bDoesUndo( GetDoc()->DoesUndo() );
SwPageDesc aDesc( rChged );
- GetDoc()->DoUndo( sal_False );
- GetDoc()->CopyPageDesc(rChged, aDesc);
- GetDoc()->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
+ GetDoc()->CopyPageDesc(rChged, aDesc);
+ }
GetDoc()->ChgPageDesc( i, aDesc );
EndAllActionAndCall();
}
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index e4d4f2e9b399..231fb022dcb5 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -55,6 +55,7 @@
#include <viewimp.hxx>
#include <viscrs.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <dview.hxx>
#include <dflyobj.hxx>
#include <dcontact.hxx>
@@ -707,7 +708,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
SwFlyFrmFmt *pRet;
if( bMoveCntnt )
{
- GetDoc()->StartUndo( UNDO_INSLAYFMT, NULL );
+ GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_INSLAYFMT, NULL );
SwFmtAnchor* pOldAnchor = 0;
sal_Bool bHOriChgd = sal_False, bVOriChgd = sal_False;
SwFmtVertOrient aOldV;
@@ -765,9 +766,18 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
// das verschieben von TabelleSelektion ist noch nicht
// Undofaehig - also darf das UmAnkern auch nicht
// aufgezeichnet werden.
- sal_Bool bDoesUndo = GetDoc()->DoesUndo();
- if( bDoesUndo && UNDO_INSLAYFMT == GetDoc()->GetUndoIds(NULL, NULL) )
- GetDoc()->DoUndo( sal_False );
+ bool const bDoesUndo =
+ GetDoc()->GetIDocumentUndoRedo().DoesUndo();
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (bDoesUndo &&
+ GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(0,
+ & nLastUndoId))
+ {
+ if (UNDO_INSLAYFMT == nLastUndoId)
+ {
+ GetDoc()->GetIDocumentUndoRedo().DoUndo(false);
+ }
+ }
((SfxItemSet&)rSet).Put( *pOldAnchor );
@@ -777,11 +787,11 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
((SfxItemSet&)rSet).Put( aOldV );
GetDoc()->SetFlyFrmAttr( *pRet, (SfxItemSet&)rSet );
- GetDoc()->DoUndo( bDoesUndo );
+ GetDoc()->GetIDocumentUndoRedo().DoUndo(bDoesUndo);
}
delete pOldAnchor;
}
- GetDoc()->EndUndo( UNDO_INSLAYFMT, NULL );
+ GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_INSLAYFMT, NULL );
}
else
/* #109161# If called from a shell try to propagate an
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 0f8a61134595..09e5d20dd058 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -71,6 +71,7 @@
#include "pagefrm.hxx"
#include "sectfrm.hxx"
#include "doc.hxx"
+#include <IDocumentUndoRedo.hxx>
#include "dview.hxx"
#include "dflyobj.hxx"
#include "dcontact.hxx"
@@ -722,7 +723,7 @@ long SwFEShell::EndDrag( const Point *, BOOL )
pView->EndDragObj();
// JP 18.08.95: DrawUndo-Action auf FlyFrames werden nicht gespeichert
// Die Fly aendern das Flag
- GetDoc()->SetNoDrawUndoObj( FALSE );
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
ChgAnchor( 0, TRUE );
EndUndo( UNDO_END );
@@ -1623,10 +1624,12 @@ BOOL SwFEShell::EndCreate( UINT16 eSdrCreateCmd )
// das Undo abschalten
ASSERT( Imp()->HasDrawView(), "EndCreate without DrawView?" );
if( !Imp()->GetDrawView()->IsGroupEntered() )
- GetDoc()->SetNoDrawUndoObj( TRUE );
+ {
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
+ }
BOOL bCreate = Imp()->GetDrawView()->EndCreateObj(
SdrCreateCmd( eSdrCreateCmd ) );
- GetDoc()->SetNoDrawUndoObj( FALSE );
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
if ( !bCreate )
{
@@ -1852,7 +1855,7 @@ BOOL SwFEShell::ImpEndCreate()
//Erzeugtes Object wegwerfen, so kann der Fly am elegentesten
//ueber vorhandene SS erzeugt werden.
- GetDoc()->SetNoDrawUndoObj( TRUE ); // siehe oben
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false); // see above
// --> OD 2005-08-08 #i52858# - method name changed
SdrPage *pPg = getIDocumentDrawModelAccess()->GetOrCreateDrawModel()->GetPage( 0 );
// <--
@@ -1865,7 +1868,7 @@ BOOL SwFEShell::ImpEndCreate()
pPg->RecalcObjOrdNums();
SdrObject* pRemovedObject = pPg->RemoveObject( rSdrObj.GetOrdNumDirect() );
SdrObject::Free( pRemovedObject );
- GetDoc()->SetNoDrawUndoObj( FALSE );
+ GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
SwFlyFrm* pFlyFrm;
if( NewFlyFrm( aSet, TRUE ) &&
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index ad2e077e5d7c..85b661c9b95f 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1017,7 +1017,7 @@ BOOL SwFEShell::HasBoxSelection() const
pNd->EndOfSectionIndex())
{
SwNodeIndex aIdx( *pNd->EndOfSectionNode(), -1 );
- SwCntntNode* pCNd = GetDoc()->GetNodes()[ aIdx ]->GetCntntNode();
+ SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
if( !pCNd )
{
pCNd = GetDoc()->GetNodes().GoPrevious( &aIdx );
@@ -1309,7 +1309,7 @@ BOOL SwFEShell::IsAdjustCellWidthAllowed( BOOL bBalance ) const
if ( pCNd->GetTxt().Len() )
return TRUE;
++aIdx;
- pCNd = GetDoc()->GetNodes()[ aIdx ]->GetTxtNode();
+ pCNd = aIdx.GetNode().GetTxtNode();
}
}
}
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index deefc2205b67..e5cba746a013 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -28,15 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <hintids.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/protitem.hxx>
+
+#include <hintids.hxx>
#include <fmtanchr.hxx>
#include <fmtfsize.hxx>
#include <frmatr.hxx>
#include <tblsel.hxx>
#include <crsrsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -50,7 +52,7 @@
#include <rootfrm.hxx>
#include <viscrs.hxx>
#include <swtblfmt.hxx>
-#include <undobj.hxx>
+#include <UndoTable.hxx>
#include <mvsave.hxx>
// OD 26.08.2003 #i18103#
#include <sectfrm.hxx>
@@ -1449,11 +1451,16 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwNodeIndex aSttNdIdx( *rPt.pSelBox->GetSttNd(), 1 );
// ein Node muss in der Box erhalten bleiben (sonst wird beim
// Move die gesamte Section geloescht)
+ bool const bUndo(pDoc->GetIDocumentUndoRedo().DoesUndo());
if( pUndo )
- pDoc->DoUndo( FALSE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ }
pDoc->AppendTxtNode( *aPam.GetPoint() );
if( pUndo )
- pDoc->DoUndo( TRUE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(bUndo);
+ }
SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode );
rInsPosNd++;
if( pUndo )
diff --git a/sw/inc/SwUndoFmt.hxx b/sw/source/core/inc/SwUndoFmt.hxx
index ea23724fa817..d84983bc4011 100644
--- a/sw/inc/SwUndoFmt.hxx
+++ b/sw/source/core/inc/SwUndoFmt.hxx
@@ -24,11 +24,13 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _SW_UNDO_TXT_FMT_COLL_HXX
-#define _SW_UNDO_TXT_FMT_COLL_HXX
+#ifndef SW_UNDO_TXT_FMT_COLL_HXX
+#define SW_UNDO_TXT_FMT_COLL_HXX
#include <undobj.hxx>
#include <swundo.hxx>
+#include <numrule.hxx>
+
class SwDoc;
class SwTxtFmtColl;
@@ -53,8 +55,8 @@ public:
SwDoc * pDoc);
virtual ~SwUndoFmtCreate();
- virtual void Undo(SwUndoIter & rIter);
- virtual void Redo(SwUndoIter & rIter);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual SwRewriter GetRewriter() const;
@@ -77,8 +79,8 @@ public:
SwUndoFmtDelete(SwUndoId nUndoId, SwFmt * pOld, SwDoc * pDoc);
~SwUndoFmtDelete();
- virtual void Undo(SwUndoIter & rIter);
- virtual void Redo(SwUndoIter & rIter);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual SwRewriter GetRewriter() const;
@@ -100,8 +102,8 @@ public:
SwDoc * pDoc);
~SwUndoRenameFmt();
- void Undo(SwUndoIter & rIter);
- void Redo(SwUndoIter & rIter);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
SwRewriter GetRewriter() const;
@@ -213,8 +215,8 @@ class SwUndoNumruleCreate : public SwUndo
public:
SwUndoNumruleCreate(const SwNumRule * pNew, SwDoc * pDoc);
- virtual void Undo(SwUndoIter & rIter);
- virtual void Redo(SwUndoIter & rIter);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
SwRewriter GetRewriter() const;
};
@@ -227,8 +229,8 @@ class SwUndoNumruleDelete : public SwUndo
public:
SwUndoNumruleDelete(const SwNumRule & aRule, SwDoc * pDoc);
- virtual void Undo(SwUndoIter & rIter);
- virtual void Redo(SwUndoIter & rIter);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
SwRewriter GetRewriter() const;
};
@@ -242,9 +244,10 @@ class SwUndoNumruleRename : public SwUndo
SwUndoNumruleRename(const String & aOldName, const String & aNewName,
SwDoc * pDoc);
- virtual void Undo(SwUndoIter & rIter);
- virtual void Redo(SwUndoIter & rIter);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
SwRewriter GetRewriter() const;
};
-#endif // _SW_UNDO_TXT_FMT_COLL_HXX
+
+#endif // SW_UNDO_TXT_FMT_COLL_HXX
diff --git a/sw/inc/SwUndoPageDesc.hxx b/sw/source/core/inc/SwUndoPageDesc.hxx
index 84a734b57937..1de717a453d6 100644
--- a/sw/inc/SwUndoPageDesc.hxx
+++ b/sw/source/core/inc/SwUndoPageDesc.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _SW_UNDO_PAGE_DESC_HXX
-#define _SW_UNDO_PAGE_DESC_HXX
+#ifndef SW_UNDO_PAGE_DESC_HXX
+#define SW_UNDO_PAGE_DESC_HXX
#include <undobj.hxx>
#include <pagedesc.hxx>
@@ -48,9 +48,8 @@ public:
SwDoc * pDoc);
virtual ~SwUndoPageDesc();
- virtual void Undo(SwUndoIter & rIt);
- virtual void Redo(SwUndoIter & rIt);
- virtual void Repeat(SwUndoIter & rIt);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual SwRewriter GetRewriter() const;
};
@@ -61,13 +60,15 @@ class SwUndoPageDescCreate : public SwUndo
SwPageDescExt aNew;
SwDoc * pDoc;
+ void DoImpl();
+
public:
SwUndoPageDescCreate(const SwPageDesc * pNew, SwDoc * pDoc); // #116530#
virtual ~SwUndoPageDescCreate();
- virtual void Undo(SwUndoIter & rIt);
- virtual void Redo(SwUndoIter & rIt);
- virtual void Repeat(SwUndoIter & rIt);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
virtual SwRewriter GetRewriter() const;
};
@@ -77,13 +78,15 @@ class SwUndoPageDescDelete : public SwUndo
SwPageDescExt aOld;
SwDoc * pDoc;
+ void DoImpl();
+
public:
SwUndoPageDescDelete(const SwPageDesc & aOld, SwDoc * pDoc);
virtual ~SwUndoPageDescDelete();
- virtual void Undo(SwUndoIter & rIt);
- virtual void Redo(SwUndoIter & rIt);
- virtual void Repeat(SwUndoIter & rIt);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
virtual SwRewriter GetRewriter() const;
};
diff --git a/sw/inc/SwUndoTOXChange.hxx b/sw/source/core/inc/SwUndoTOXChange.hxx
index 36498fec9643..5fa221b23979 100644
--- a/sw/inc/SwUndoTOXChange.hxx
+++ b/sw/source/core/inc/SwUndoTOXChange.hxx
@@ -24,8 +24,9 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _SW_UNDO_TOX_CHANGE_HXX
-#define _SW_UNDO_TOX_CHANGE_HXX
+#ifndef SW_UNDO_TOX_CHANGE_HXX
+#define SW_UNDO_TOX_CHANGE_HXX
+
#include <undobj.hxx>
#include <tox.hxx>
@@ -34,14 +35,15 @@ class SwUndoTOXChange : public SwUndo
SwTOXBase * pTOX, aOld, aNew;
void UpdateTOXBaseSection();
+ void DoImpl();
public:
SwUndoTOXChange(SwTOXBase * pTOX, const SwTOXBase & rNew);
virtual ~SwUndoTOXChange();
- virtual void Undo(SwUndoIter & rIter);
- virtual void Redo(SwUndoIter & rIter);
- virtual void Repeat(SwUndoIter & rIter);
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
};
-#endif //_SW_UNDO_TOX_CHANGE_HXX
+#endif // SW_UNDO_TOX_CHANGE_HXX
diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx
new file mode 100644
index 000000000000..975e37202982
--- /dev/null
+++ b/sw/source/core/inc/UndoAttribute.hxx
@@ -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 SW_UNDO_ATTRIBUTE_HXX
+#define SW_UNDO_ATTRIBUTE_HXX
+
+#include <undobj.hxx>
+
+#include <memory>
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_ULONGS
+#define _SVSTDARR_BOOLS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_USHORTSSORT
+#include <svl/svstdarr.hxx>
+#endif
+#include <svl/itemset.hxx>
+
+#include <swtypes.hxx>
+#include <calbck.hxx>
+
+
+class SvxTabStopItem;
+class SwFmt;
+class SwFtnInfo;
+class SwEndNoteInfo;
+
+
+class SwUndoAttr : public SwUndo, private SwUndRng
+{
+ SfxItemSet m_AttrSet; // attributes for Redo
+ const ::std::auto_ptr<SwHistory> m_pHistory; // History for Undo
+ ::std::auto_ptr<SwRedlineData> m_pRedlineData; // Redlining
+ ::std::auto_ptr<SwRedlineSaveDatas> m_pRedlineSaveData;
+ ULONG m_nNodeIndex; // Offset: for Redlining
+ const SetAttrMode m_nInsertFlags; // insert flags
+
+ void RemoveIdx( SwDoc& rDoc );
+
+public:
+ SwUndoAttr( const SwPaM&, const SfxItemSet &, const SetAttrMode nFlags );
+ SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags );
+
+ virtual ~SwUndoAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SaveRedlineData( const SwPaM& rPam, BOOL bInsCntnt );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+
+};
+
+class SwUndoResetAttr : public SwUndo, private SwUndRng
+{
+ const ::std::auto_ptr<SwHistory> m_pHistory;
+ SvUShortsSort m_Ids;
+ const USHORT m_nFormatId; // Format-Id for Redo
+
+public:
+ SwUndoResetAttr( const SwPaM&, USHORT nFmtId );
+ SwUndoResetAttr( const SwPosition&, USHORT nFmtId );
+
+ virtual ~SwUndoResetAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetAttrs( const SvUShortsSort& rArr );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+
+};
+
+class SwUndoFmtAttr : public SwUndo
+{
+ friend class SwUndoDefaultAttr;
+ SwFmt * m_pFmt;
+ ::std::auto_ptr<SfxItemSet> m_pOldSet; // old attributes
+ ULONG m_nNodeIndex;
+ const USHORT m_nFmtWhich;
+ const bool m_bSaveDrawPt;
+
+ bool IsFmtInDoc( SwDoc* ); //is the attribute format still in the Doc?
+ void SaveFlyAnchor( bool bSaveDrawPt = false );
+ // --> OD 2004-10-26 #i35443# - Add return value, type <bool>.
+ // Return value indicates, if anchor attribute is restored.
+ // Notes: - If anchor attribute is restored, all other existing attributes
+ // are also restored.
+ // - Anchor attribute isn't restored successfully, if it contains
+ // an invalid anchor position and all other existing attributes
+ // aren't restored.
+ // This situation occurs for undo of styles.
+ bool RestoreFlyAnchor(::sw::UndoRedoContext & rContext);
+ // <--
+ // --> OD 2008-02-27 #refactorlists# - removed <rAffectedItemSet>
+ void Init();
+ // <--
+
+public:
+ // register at the Format and save old attributes
+ // --> OD 2008-02-27 #refactorlists# - removed <rNewSet>
+ SwUndoFmtAttr( const SfxItemSet& rOldSet,
+ SwFmt& rFmt,
+ bool bSaveDrawPt = true );
+ // <--
+ SwUndoFmtAttr( const SfxPoolItem& rItem,
+ SwFmt& rFmt,
+ bool bSaveDrawPt = true );
+
+ virtual ~SwUndoFmtAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+ void PutAttr( const SfxPoolItem& rItem );
+ SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc!
+};
+
+// --> OD 2008-02-12 #newlistlevelattrs#
+class SwUndoFmtResetAttr : public SwUndo
+{
+ public:
+ SwUndoFmtResetAttr( SwFmt& rChangedFormat,
+ const USHORT nWhichId );
+ ~SwUndoFmtResetAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ private:
+ // format at which a certain attribute is reset.
+ SwFmt * const m_pChangedFormat;
+ // which ID of the reset attribute
+ const USHORT m_nWhichId;
+ // old attribute which has been reset - needed for undo.
+ ::std::auto_ptr<SfxPoolItem> m_pOldItem;
+};
+// <--
+
+class SwUndoDontExpandFmt : public SwUndo
+{
+ const ULONG m_nNodeIndex;
+ const xub_StrLen m_nContentIndex;
+
+public:
+ SwUndoDontExpandFmt( const SwPosition& rPos );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+// helper class to receive changed attribute sets
+class SwUndoFmtAttrHelper : public SwClient
+{
+ ::std::auto_ptr<SwUndoFmtAttr> m_pUndo;
+ const bool m_bSaveDrawPt;
+
+public:
+ SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true );
+
+ virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+
+ SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); }
+ // release the undo object (so it is not deleted here), and return it
+ SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); }
+};
+
+
+class SwUndoMoveLeftMargin : public SwUndo, private SwUndRng
+{
+ const ::std::auto_ptr<SwHistory> m_pHistory;
+ const bool m_bModulus;
+
+public:
+ SwUndoMoveLeftMargin( const SwPaM&, BOOL bRight, BOOL bModulus );
+
+ virtual ~SwUndoMoveLeftMargin();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoDefaultAttr : public SwUndo
+{
+ ::std::auto_ptr<SfxItemSet> m_pOldSet; // the old attributes
+ ::std::auto_ptr<SvxTabStopItem> m_pTabStop;
+
+public:
+ // registers at the format and saves old attributes
+ SwUndoDefaultAttr( const SfxItemSet& rOldSet );
+
+ virtual ~SwUndoDefaultAttr();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoChangeFootNote : public SwUndo, private SwUndRng
+{
+ const ::std::auto_ptr<SwHistory> m_pHistory;
+ const String m_Text;
+ const USHORT m_nNumber;
+ const bool m_bEndNote;
+
+public:
+ SwUndoChangeFootNote( const SwPaM& rRange, const String& rTxt,
+ USHORT nNum, bool bIsEndNote );
+ virtual ~SwUndoChangeFootNote();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ SwHistory& GetHistory() { return *m_pHistory; }
+};
+
+class SwUndoFootNoteInfo : public SwUndo
+{
+ ::std::auto_ptr<SwFtnInfo> m_pFootNoteInfo;
+
+public:
+ SwUndoFootNoteInfo( const SwFtnInfo &rInfo );
+
+ virtual ~SwUndoFootNoteInfo();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+class SwUndoEndNoteInfo : public SwUndo
+{
+ ::std::auto_ptr<SwEndNoteInfo> m_pEndNoteInfo;
+
+public:
+ SwUndoEndNoteInfo( const SwEndNoteInfo &rInfo );
+
+ virtual ~SwUndoEndNoteInfo();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+#endif // SW_UNDO_ATTRIBUTE_HXX
+
diff --git a/connectivity/qa/connectivity/GeneralTest.java b/sw/source/core/inc/UndoBookmark.hxx
index a69ac5c1048f..87d774d0c43e 100644
--- a/connectivity/qa/connectivity/GeneralTest.java
+++ b/sw/source/core/inc/UndoBookmark.hxx
@@ -24,39 +24,60 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-package complex.connectivity;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.sdbc.*;
+#ifndef SW_UNDO_BOOKMARK_HXX
+#define SW_UNDO_BOOKMARK_HXX
-import com.sun.star.lang.XMultiServiceFactory;
+#include <undobj.hxx>
-import complexlib.ComplexTestCase;
+class SwHistoryBookmark;
-//import complex.connectivity.DBaseStringFunctions;
+namespace sw {
+ namespace mark {
+ class IMark;
+ }
+}
-public class GeneralTest extends ComplexTestCase {
- public String[] getTestMethodNames() {
- return new String[] { "test" };
- }
+class SwUndoBookmark : public SwUndo
+{
+ const ::std::auto_ptr<SwHistoryBookmark> m_pHistoryBookmark;
- public String getTestObjectName() {
- return "GeneralTest";
- }
- public void assure2(String s,boolean b){
- assure(s,b);
- }
+protected:
+ SwUndoBookmark( SwUndoId nUndoId, const ::sw::mark::IMark& );
+
+ void SetInDoc( SwDoc* );
+ void ResetInDoc( SwDoc* );
+
+public:
+ virtual ~SwUndoBookmark();
+
+ // #111827#
+ /**
+ Returns the rewriter for this undo object.
+
+ The rewriter contains the following rule:
+
+ $1 -> <name of bookmark>
+
+ <name of bookmark> is the name of the bookmark whose
+ insertion/deletion is recorded by this undo object.
+
+ @return the rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+};
+
+
+class SwUndoInsBookmark : public SwUndoBookmark
+{
+public:
+ SwUndoInsBookmark( const ::sw::mark::IMark& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+#endif // SW_UNDO_BOOKMARK_HXX
- public void test() throws com.sun.star.uno.Exception,com.sun.star.beans.UnknownPropertyException {
- try
- {
- XDriverManager driverManager = UnoRuntime.queryInterface( XDriverManager.class, ((XMultiServiceFactory)param.getMSF()).createInstance( "com.sun.star.sdbc.DriverManager" ) );
- String databaseURL = "sdbc:calc:singin' in the rain" ;
- XConnection catalogConnection = driverManager.getConnection(databaseURL);
- failed();
- }
- catch(SQLException e){}
- }
-}
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
new file mode 100644
index 000000000000..ce91ef058032
--- /dev/null
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -0,0 +1,263 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDOCORE_HXX
+#define SW_UNDOCORE_HXX
+
+#include <undobj.hxx>
+
+#include <calbck.hxx>
+
+
+class SfxItemSet;
+class SwFmtColl;
+class SwFmtAnchor;
+class SdrMarkList;
+class SwUndoDelete;
+class SwRedlineSaveData;
+
+namespace sw {
+ class UndoManager;
+ class IShellCursorSupplier;
+}
+
+
+typedef SwRedlineSaveData* SwRedlineSaveDataPtr;
+SV_DECL_PTRARR_DEL( SwRedlineSaveDatas, SwRedlineSaveDataPtr, 8, 8 )
+
+
+namespace sw {
+
+class SW_DLLPRIVATE UndoRedoContext
+ : public SfxUndoContext
+{
+public:
+ UndoRedoContext(SwDoc & rDoc, IShellCursorSupplier & rCursorSupplier)
+ : m_rDoc(rDoc)
+ , m_rCursorSupplier(rCursorSupplier)
+ , m_pSelFmt(0)
+ , m_pMarkList(0)
+ { }
+
+ SwDoc & GetDoc() const { return m_rDoc; }
+
+ IShellCursorSupplier & GetCursorSupplier() { return m_rCursorSupplier; }
+
+ void SetSelections(SwFrmFmt *const pSelFmt, SdrMarkList *const pMarkList)
+ {
+ m_pSelFmt = pSelFmt;
+ m_pMarkList = pMarkList;
+ }
+ void GetSelections(SwFrmFmt *& o_rpSelFmt, SdrMarkList *& o_rpMarkList)
+ {
+ o_rpSelFmt = m_pSelFmt;
+ o_rpMarkList = m_pMarkList;
+ }
+
+private:
+ SwDoc & m_rDoc;
+ IShellCursorSupplier & m_rCursorSupplier;
+ SwFrmFmt * m_pSelFmt;
+ SdrMarkList * m_pMarkList;
+};
+
+class SW_DLLPRIVATE RepeatContext
+ : public SfxRepeatTarget
+{
+public:
+ RepeatContext(SwDoc & rDoc, SwPaM & rPaM)
+ : m_rDoc(rDoc)
+ , m_pCurrentPaM(& rPaM)
+ , m_bDeleteRepeated(false)
+ { }
+
+ SwDoc & GetDoc() const { return m_rDoc; }
+
+ SwPaM & GetRepeatPaM()
+ {
+ return *m_pCurrentPaM;
+ }
+
+private:
+ friend class ::sw::UndoManager;
+ friend class ::SwUndoDelete;
+
+ SwDoc & m_rDoc;
+ SwPaM * m_pCurrentPaM;
+ bool m_bDeleteRepeated; /// has a delete action been repeated?
+};
+
+} // namespace sw
+
+
+
+class SwUndoFmtColl : public SwUndo, private SwUndRng
+{
+ String aFmtName;
+ SwHistory* pHistory;
+ SwFmtColl* pFmtColl;
+ // --> OD 2008-04-15 #refactorlists# - for correct <ReDo(..)> and <Repeat(..)>
+ // boolean, which indicates that the attributes are reseted at the nodes
+ // before the format has been applied.
+ const bool mbReset;
+ // boolean, which indicates that the list attributes had been reseted at
+ // the nodes before the format has been applied.
+ const bool mbResetListAttrs;
+ // <--
+
+ void DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM);
+
+public:
+ // --> OD 2008-04-15 #refactorlists#
+// SwUndoFmtColl( const SwPaM&, SwFmtColl* );
+ SwUndoFmtColl( const SwPaM&, SwFmtColl*,
+ const bool bReset,
+ const bool bResetListAttrs );
+ // <--
+ virtual ~SwUndoFmtColl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter for this undo object.
+
+ The rewriter contains one rule:
+
+ $1 -> <name of format collection>
+
+ <name of format collection> is the name of the format
+ collection that is applied by the action recorded by this undo
+ object.
+
+ @return the rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ SwHistory* GetHistory() { return pHistory; }
+
+};
+
+
+class SwUndoSetFlyFmt : public SwUndo, public SwClient
+{
+ SwFrmFmt* pFrmFmt; // das gespeicherte FlyFormat
+ SwFrmFmt* pOldFmt; // die alte Fly Vorlage
+ SwFrmFmt* pNewFmt; // die neue Fly Vorlage
+ SfxItemSet* pItemSet; // die zurueck-/ gesetzten Attribute
+ ULONG nOldNode, nNewNode;
+ xub_StrLen nOldCntnt, nNewCntnt;
+ USHORT nOldAnchorTyp, nNewAnchorTyp;
+ BOOL bAnchorChgd;
+
+ void PutAttr( USHORT nWhich, const SfxPoolItem* pItem );
+ void Modify( SfxPoolItem*, SfxPoolItem* );
+ void GetAnchor( SwFmtAnchor& rAnhor, ULONG nNode, xub_StrLen nCntnt );
+
+public:
+ SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt );
+ virtual ~SwUndoSetFlyFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ virtual SwRewriter GetRewriter() const;
+};
+
+
+//------------ Undo von verschieben/stufen von Gliederung ----------------
+
+class SwUndoOutlineLeftRight : public SwUndo, private SwUndRng
+{
+ short nOffset;
+public:
+ SwUndoOutlineLeftRight( const SwPaM& rPam, short nOffset );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+
+//--------------------------------------------------------------------
+
+// -> #111827#
+const int nUndoStringLength = 20;
+
+/**
+ Shortens a string to a maximum length.
+
+ @param rStr the string to be shortened
+ @param nLength the maximum length for rStr
+ @param rFillStr string to replace cut out characters with
+
+ If rStr has less than nLength characters it will be returned unaltered.
+
+ If rStr has more than nLength characters the following algorithm
+ generates the shortened string:
+
+ frontLength = (nLength - length(rFillStr)) / 2
+ rearLength = nLength - length(rFillStr) - frontLength
+ shortenedString = concat(<first frontLength characters of rStr,
+ rFillStr,
+ <last rearLength characters of rStr>)
+
+ Preconditions:
+ - nLength - length(rFillStr) >= 2
+
+ @return the shortened string
+ */
+String
+ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr);
+// <- #111827#
+
+// #16487#
+/**
+ Denotes special characters in a string.
+
+ The rStr is split into parts containing special characters and
+ parts not containing special characters. In a part containing
+ special characters all characters are equal. These parts are
+ maximal.
+
+ @param rStr the string to denote in
+
+ The resulting string is generated by concatenating the found
+ parts. The parts without special characters are surrounded by
+ "'". The parts containing special characters are denoted as "n x",
+ where n is the length of the part and x is the representation of
+ the special character (i. e. "tab(s)").
+
+ @return the denoted string
+*/
+String DenoteSpecialCharacters(const String & rStr);
+
+
+#endif // SW_UNDOCORE_HXX
+
diff --git a/sw/source/core/inc/UndoDelete.hxx b/sw/source/core/inc/UndoDelete.hxx
new file mode 100644
index 000000000000..e8be65ef115b
--- /dev/null
+++ b/sw/source/core/inc/UndoDelete.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 SW_UNDO_DELETE_HXX
+#define SW_UNDO_DELETE_HXX
+
+#include <undobj.hxx>
+
+#include <tools/mempool.hxx>
+
+
+class SwRedlineSaveDatas;
+class SwTxtNode;
+
+namespace sfx2 {
+ class MetadatableUndo;
+}
+
+
+class SwUndoDelete
+ : public SwUndo
+ , private SwUndRng
+ , private SwUndoSaveCntnt
+{
+ SwNodeIndex* pMvStt; // Position of Nodes in UndoNodes-Array
+ String *pSttStr, *pEndStr;
+ SwRedlineData* pRedlData;
+ SwRedlineSaveDatas* pRedlSaveData;
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
+
+ String sTableName;
+
+ ULONG nNode;
+ ULONG nNdDiff; // difference of Nodes before/after Delete
+ ULONG nSectDiff; // diff. of Nodes before/after Move w/ SectionNodes
+ ULONG nReplaceDummy; // diff. to a temporary dummy object
+ USHORT nSetPos;
+
+ BOOL bGroup : 1; // TRUE: is already Grouped; see CanGrouping()
+ BOOL bBackSp : 1; // TRUE: if Grouped and preceding content deleted
+ BOOL bJoinNext: 1; // TRUE: if range is selected forwards
+ BOOL bTblDelLastNd : 1; // TRUE: TextNode following Table inserted/deleted
+ BOOL bDelFullPara : 1; // TRUE: entire Nodes were deleted
+ BOOL bResetPgDesc : 1; // TRUE: reset PgDsc on following node
+ BOOL bResetPgBrk : 1; // TRUE: reset PgBreak on following node
+ BOOL bFromTableCopy : 1; // TRUE: called by SwUndoTblCpyTbl
+
+ BOOL SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
+ SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd );
+public:
+ SwUndoDelete( SwPaM&,
+ BOOL bFullPara = FALSE, BOOL bCalledByTblCpy = FALSE );
+ virtual ~SwUndoDelete();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns rewriter for this undo object.
+
+ The rewriter consists of the following rule:
+
+ $1 -> '<deleted text>'
+
+ <deleted text> is shortened to nUndoStringLength characters.
+
+ @return rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ BOOL CanGrouping( SwDoc*, const SwPaM& );
+
+ void SetTblDelLastNd() { bTblDelLastNd = TRUE; }
+
+ // for PageDesc/PageBreak Attributes of a table
+ void SetPgBrkFlags( BOOL bPageBreak, BOOL bPageDesc )
+ { bResetPgDesc = bPageDesc; bResetPgBrk = bPageBreak; }
+
+ void SetTableName(const String & rName);
+
+ // SwUndoTblCpyTbl needs this information:
+ BOOL IsDelFullPara() const { return bDelFullPara; }
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwUndoDelete)
+};
+
+#endif // SW_UNDO_DELETE_HXX
+
diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx
new file mode 100644
index 000000000000..1407266279fa
--- /dev/null
+++ b/sw/source/core/inc/UndoDraw.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 SW_UNDO_DRAW_HXX
+#define SW_UNDO_DRAW_HXX
+
+#include <undobj.hxx>
+
+#include <svx/svdundo.hxx>
+
+
+struct SwUndoGroupObjImpl;
+class SdrMark;
+class SdrMarkList;
+class SdrObject;
+class SdrObjGroup;
+class SdrUndoAction;
+class SwDrawFrmFmt;
+
+
+
+//--------------------------------------------------------------------
+// ----------- Undo for Draw Objects ---------------------------------
+
+class SwSdrUndo : public SwUndo
+{
+ SdrUndoAction* pSdrUndo;
+ SdrMarkList* pMarkList; // MarkList for all selected SdrObjects
+public:
+ SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList );
+
+ virtual ~SwSdrUndo();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ String GetComment() const;
+};
+
+class SwUndoDrawGroup : public SwUndo
+{
+ SwUndoGroupObjImpl* pObjArr;
+ USHORT nSize;
+ BOOL bDelFmt;
+
+public:
+ SwUndoDrawGroup( USHORT nCnt );
+
+ virtual ~SwUndoDrawGroup();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddObj( USHORT nPos, SwDrawFrmFmt*, SdrObject* );
+ void SetGroupFmt( SwDrawFrmFmt* );
+};
+
+// --> OD 2006-11-01 #130889#
+// Action "ungroup drawing object" is now splitted into three parts - see
+// method <SwDoc::UnGroupSelection(..)>:
+// - creation for <SwDrawFrmFmt> instances for the group members of the
+// selected group objects
+// - intrinsic ungroup of the selected group objects
+// - creation of <SwDrawContact> instances for the former group members and
+// connection to the Writer layout.
+// Thus, two undo actions (instances of <SwUndo>) are needed:
+// - Existing class <SwUndoDrawUnGroup> takes over the part for the formats.
+// - New class <SwUndoDrawUnGroupConnectToLayout> takes over the part for
+// contact object.
+class SwUndoDrawUnGroup : public SwUndo
+{
+ SwUndoGroupObjImpl* pObjArr;
+ USHORT nSize;
+ BOOL bDelFmt;
+
+public:
+ SwUndoDrawUnGroup( SdrObjGroup* );
+
+ virtual ~SwUndoDrawUnGroup();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddObj( USHORT nPos, SwDrawFrmFmt* );
+};
+
+// --> OD 2006-11-01 #130889#
+class SwUndoDrawUnGroupConnectToLayout : public SwUndo
+{
+ private:
+ std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > > aDrawFmtsAndObjs;
+
+ public:
+ SwUndoDrawUnGroupConnectToLayout();
+
+ virtual ~SwUndoDrawUnGroupConnectToLayout();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
+ SdrObject* pDrawObject );
+};
+// <--
+
+
+class SwUndoDrawDelete : public SwUndo
+{
+ SwUndoGroupObjImpl* pObjArr;
+ SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects
+ USHORT nSize;
+ BOOL bDelFmt;
+
+public:
+ SwUndoDrawDelete( USHORT nCnt );
+
+ virtual ~SwUndoDrawDelete();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddObj( USHORT nPos, SwDrawFrmFmt*, const SdrMark& );
+};
+
+#endif // SW_UNDO_DRAW_HXX
+
diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx
new file mode 100644
index 000000000000..085ce702fcb4
--- /dev/null
+++ b/sw/source/core/inc/UndoInsert.hxx
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_INSERT_HXX
+#define SW_UNDO_INSERT_HXX
+
+#include <undobj.hxx>
+
+#include <tools/mempool.hxx>
+
+#include <swtypes.hxx>
+#include <IDocumentContentOperations.hxx>
+
+
+class Graphic;
+class SwGrfNode;
+class SwUndoDelete;
+class SwUndoFmtAttr;
+
+
+class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt
+{
+ SwPosition *pPos; // Inhalt fuers Redo
+ String *pTxt, *pUndoTxt;
+ SwRedlineData* pRedlData;
+ ULONG nNode;
+ xub_StrLen nCntnt, nLen;
+ BOOL bIsWordDelim : 1;
+ BOOL bIsAppend : 1;
+
+ const IDocumentContentOperations::InsertFlags m_nInsertFlags;
+
+ friend class SwDoc; // eigentlich nur SwDoc::Insert( String )
+ BOOL CanGrouping( sal_Unicode cIns );
+ BOOL CanGrouping( const SwPosition& rPos );
+
+ SwDoc * pDoc;
+
+ void Init(const SwNodeIndex & rNode);
+ String * GetTxtFromDoc() const;
+
+public:
+ SwUndoInsert( const SwNodeIndex& rNode, xub_StrLen nCntnt, xub_StrLen nLen,
+ const IDocumentContentOperations::InsertFlags nInsertFlags,
+ BOOL bWDelim = TRUE );
+ SwUndoInsert( const SwNodeIndex& rNode );
+ virtual ~SwUndoInsert();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns rewriter for this undo object.
+
+ The returned rewriter has the following rule:
+
+ $1 -> '<inserted text>'
+
+ <inserted text> is shortened to a length of nUndoStringLength.
+
+ @return rewriter for this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+
+ DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert)
+};
+
+
+//--------------------------------------------------------------------
+
+SwRewriter SW_DLLPRIVATE
+MakeUndoReplaceRewriter(ULONG const ocurrences,
+ ::rtl::OUString const& sOld, ::rtl::OUString const& sNew);
+
+class SwUndoReplace
+ : public SwUndo
+{
+public:
+ SwUndoReplace(SwPaM const& rPam,
+ ::rtl::OUString const& rInsert, bool const bRegExp);
+
+ virtual ~SwUndoReplace();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter of this undo object.
+
+ If this undo object represents several replacements the
+ rewriter contains the following rules:
+
+ $1 -> <number of replacements>
+ $2 -> occurrences of
+ $3 -> <replaced text>
+
+ If this undo object represents one replacement the rewriter
+ contains these rules:
+
+ $1 -> <replaced text>
+ $2 -> "->" (STR_YIELDS)
+ $3 -> <replacing text>
+
+ @return the rewriter of this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ void SetEnd( const SwPaM& rPam );
+
+private:
+ class Impl;
+ ::std::auto_ptr<Impl> m_pImpl;
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoReRead : public SwUndo
+{
+ Graphic *pGrf;
+ String *pNm, *pFltr;
+ ULONG nPos;
+ USHORT nMirr;
+
+ void SaveGraphicData( const SwGrfNode& );
+ void SetAndSave( ::sw::UndoRedoContext & );
+
+public:
+ SwUndoReRead( const SwPaM& rPam, const SwGrfNode& pGrfNd );
+
+ virtual ~SwUndoReRead();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+//--------------------------------------------------------------------
+
+class SwUndoInsertLabel : public SwUndo
+{
+ union {
+ struct {
+ // fuer NoTxtFrms
+ SwUndoInsLayFmt* pUndoFly;
+ SwUndoFmtAttr* pUndoAttr;
+ } OBJECT;
+ struct {
+ // fuer Tabelle/TextRahmen
+ SwUndoDelete* pUndoInsNd;
+ ULONG nNode;
+ } NODE;
+ };
+
+ String sText;
+ // --> PB 2005-01-06 #i39983# the separator is drawn with a character style
+ String sSeparator;
+ // <--
+ String sNumberSeparator;
+ String sCharacterStyle;
+ // OD 2004-04-15 #i26791# - re-store of drawing object position no longer needed
+ USHORT nFldId;
+ SwLabelType eType;
+ BYTE nLayerId; // fuer Zeichen-Objekte
+ BOOL bBefore :1;
+ BOOL bUndoKeep :1;
+ BOOL bCpyBrd :1;
+
+public:
+ SwUndoInsertLabel( const SwLabelType eTyp, const String &rText,
+ // --> PB 2005-01-06 #i39983# the separator is drawn with a character style
+ const String& rSeparator,
+ // <--
+ const String& rNumberSeparator, //#i61007# order of captions
+ const BOOL bBefore, const USHORT nId,
+ const String& rCharacterStyle,
+ const BOOL bCpyBrd );
+ virtual ~SwUndoInsertLabel();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter of this undo object.
+
+ The rewriter contains this rule:
+
+ $1 -> '<text of inserted label>'
+
+ <text of inserted label> is shortened to nUndoStringLength
+ characters.
+
+ @return the rewriter of this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ void SetNodePos( ULONG nNd )
+ { if( LTYPE_OBJECT != eType ) NODE.nNode = nNd; }
+
+ void SetUndoKeep() { bUndoKeep = TRUE; }
+ void SetFlys( SwFrmFmt& rOldFly, SfxItemSet& rChgSet, SwFrmFmt& rNewFly );
+ void SetDrawObj( BYTE nLayerId );
+};
+
+#endif // SW_UNDO_INSERT_HXX
+
diff --git a/sw/source/core/inc/UndoManager.hxx b/sw/source/core/inc/UndoManager.hxx
new file mode 100644
index 000000000000..0f734d17abfa
--- /dev/null
+++ b/sw/source/core/inc/UndoManager.hxx
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_MANAGER_HXX
+#define SW_UNDO_MANAGER_HXX
+
+#include <IDocumentUndoRedo.hxx>
+
+#include <memory>
+
+#include <svl/undo.hxx>
+
+
+class IDocumentDrawModelAccess;
+class IDocumentRedlineAccess;
+class IDocumentState;
+
+
+namespace sw {
+
+class UndoManager
+ : public IDocumentUndoRedo
+ , public SfxUndoManager
+{
+public:
+
+ UndoManager(::std::auto_ptr<SwNodes> pUndoNodes,
+ IDocumentDrawModelAccess & rDrawModelAccess,
+ IDocumentRedlineAccess & rRedlineAccess,
+ IDocumentState & rState);
+
+ /** IDocumentUndoRedo */
+ virtual void DoUndo(bool const bDoUndo);
+ virtual bool DoesUndo() const;
+ virtual void DoGroupUndo(bool const bDoUndo);
+ virtual bool DoesGroupUndo() const;
+ virtual void DoDrawUndo(bool const bDoUndo);
+ virtual bool DoesDrawUndo() const;
+ virtual void SetUndoNoModifiedPosition();
+ virtual void LockUndoNoModifiedPosition();
+ virtual void UnLockUndoNoModifiedPosition();
+ virtual void SetUndoNoResetModified();
+ virtual bool IsUndoNoResetModified() const;
+// virtual bool Undo();
+ virtual SwUndoId StartUndo(SwUndoId const eUndoId,
+ SwRewriter const*const pRewriter);
+ virtual SwUndoId EndUndo(SwUndoId const eUndoId,
+ SwRewriter const*const pRewriter);
+ virtual void DelAllUndoObj();
+ virtual bool GetLastUndoInfo(::rtl::OUString *const o_pStr,
+ SwUndoId *const o_pId) const;
+ virtual SwUndoComments_t GetUndoComments() const;
+// virtual bool Redo();
+ virtual bool GetFirstRedoInfo(::rtl::OUString *const o_pStr) const;
+ virtual SwUndoComments_t GetRedoComments() const;
+ virtual bool Repeat(::sw::RepeatContext & rContext,
+ sal_uInt16 const nRepeatCnt);
+ virtual SwUndoId GetRepeatInfo(::rtl::OUString *const o_pStr) const;
+ virtual void AppendUndo(SwUndo *const pUndo);
+ virtual void ClearRedo();
+ virtual bool IsUndoNodes(SwNodes const& rNodes) const;
+
+ // ::svl::IUndoManager
+ virtual void AddUndoAction(SfxUndoAction *pAction,
+ sal_Bool bTryMerg = sal_False);
+ virtual sal_Bool Undo();
+ virtual sal_Bool Redo();
+ virtual void EnableUndo(bool bEnable);
+
+ SwUndo * RemoveLastUndo();
+ SwUndo * GetLastUndo();
+
+ SwNodes const& GetUndoNodes() const;
+ SwNodes & GetUndoNodes();
+
+private:
+ IDocumentDrawModelAccess & m_rDrawModelAccess;
+ IDocumentRedlineAccess & m_rRedlineAccess;
+ IDocumentState & m_rState;
+
+ /// Undo nodes array: content not currently in document
+ ::std::auto_ptr<SwNodes> m_pUndoNodes;
+
+ bool m_bGroupUndo : 1; // TRUE: Undo grouping enabled
+ bool m_bDrawUndo : 1; // TRUE: Draw Undo enabled
+ bool m_bLockUndoNoModifiedPosition : 1;
+ /// position in Undo-Array at which Doc was saved (and is not modified)
+ UndoStackMark m_UndoSaveMark;
+
+ typedef enum { UNDO = true, REDO = false } UndoOrRedo_t;
+ bool impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo);
+
+ // UGLY: should not be called
+ using SfxUndoManager::Repeat;
+};
+
+} // namespace sw
+
+#endif // SW_UNDO_MANAGER_HXX
+
diff --git a/sw/source/core/inc/UndoNumbering.hxx b/sw/source/core/inc/UndoNumbering.hxx
new file mode 100644
index 000000000000..462bd7fae31f
--- /dev/null
+++ b/sw/source/core/inc/UndoNumbering.hxx
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_NUMBERING_HXX
+#define SW_UNDO_NUMBERING_HXX
+
+#include <undobj.hxx>
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_ULONGS
+#define _SVSTDARR_BOOLS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_USHORTSSORT
+#include <svl/svstdarr.hxx>
+#endif
+
+#include <numrule.hxx>
+
+
+//--------------------------------------------------------------------
+//----------- Undo for Numbering -------------------------------------
+
+class SwUndoInsNum : public SwUndo, private SwUndRng
+{
+ SwNumRule aNumRule;
+ SwHistory* pHistory;
+ ULONG nSttSet;
+ SwNumRule* pOldNumRule;
+ String sReplaceRule;
+ USHORT nLRSavePos;
+public:
+ SwUndoInsNum( const SwPaM& rPam, const SwNumRule& rRule );
+ SwUndoInsNum( const SwNumRule& rOldRule, const SwNumRule& rNewRule,
+ SwUndoId nUndoId = UNDO_INSFMTATTR );
+ SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule,
+ const String& rReplaceRule );
+
+ virtual ~SwUndoInsNum();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+ SwHistory* GetHistory(); // will be created if necessary
+ void SetSttNum( ULONG nNdIdx ) { nSttSet = nNdIdx; }
+ void SaveOldNumRule( const SwNumRule& rOld );
+
+ void SetLRSpaceEndPos();
+
+};
+
+class SwUndoDelNum : public SwUndo, private SwUndRng
+{
+ SvULongs aNodeIdx;
+ SvBytes aLevels;
+ SvBools aRstLRSpaces;
+ SwHistory* pHistory;
+public:
+ SwUndoDelNum( const SwPaM& rPam );
+
+ virtual ~SwUndoDelNum();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void AddNode( const SwTxtNode& rNd, BOOL bResetLRSpace );
+ SwHistory* GetHistory() { return pHistory; }
+
+};
+
+class SwUndoMoveNum : public SwUndo, private SwUndRng
+{
+ ULONG nNewStt;
+ long nOffset;
+public:
+ SwUndoMoveNum( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv = FALSE );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetStartNode( ULONG nValue ) { nNewStt = nValue; }
+};
+
+class SwUndoNumUpDown : public SwUndo, private SwUndRng
+{
+ short nOffset;
+public:
+ SwUndoNumUpDown( const SwPaM& rPam, short nOffset );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+class SwUndoNumOrNoNum : public SwUndo
+{
+ ULONG nIdx;
+ BOOL mbNewNum, mbOldNum;
+
+public:
+ SwUndoNumOrNoNum( const SwNodeIndex& rIdx, BOOL mbOldNum,
+ BOOL mbNewNum );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+class SwUndoNumRuleStart : public SwUndo
+{
+ ULONG nIdx;
+ USHORT nOldStt, nNewStt;
+ BOOL bSetSttValue : 1;
+ BOOL bFlag : 1;
+public:
+ SwUndoNumRuleStart( const SwPosition& rPos, BOOL bDelete );
+ SwUndoNumRuleStart( const SwPosition& rPos, USHORT nStt );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+#endif // SW_UNDO_NUMBERING_HXX
+
diff --git a/sw/source/core/inc/UndoOverwrite.hxx b/sw/source/core/inc/UndoOverwrite.hxx
new file mode 100644
index 000000000000..c144ab6518d7
--- /dev/null
+++ b/sw/source/core/inc/UndoOverwrite.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 SW_UNDO_OVERWRITE_HXX
+#define SW_UNDO_OVERWRITE_HXX
+
+#include <undobj.hxx>
+
+#include <com/sun/star/uno/Sequence.h>
+
+
+class SwRedlineSaveDatas;
+class SwTxtNode;
+
+namespace utl {
+ class TransliterationWrapper;
+}
+
+
+class SwUndoOverwrite: public SwUndo, private SwUndoSaveCntnt
+{
+ String aDelStr, aInsStr;
+ SwRedlineSaveDatas* pRedlSaveData;
+ ULONG nSttNode;
+ xub_StrLen nSttCntnt;
+ BOOL bInsChar : 1; // no Overwrite, but Insert
+ BOOL bGroup : 1; // TRUE: is already grouped; evaluated in CanGrouping()
+
+public:
+ SwUndoOverwrite( SwDoc*, SwPosition&, sal_Unicode cIns );
+
+ virtual ~SwUndoOverwrite();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ // #111827#
+ /**
+ Returns the rewriter of this undo object.
+
+ The rewriter contains the following rule:
+
+ $1 -> '<overwritten text>'
+
+ <overwritten text> is shortened to nUndoStringLength characters.
+
+ @return the rewriter of this undo object
+ */
+ virtual SwRewriter GetRewriter() const;
+
+ BOOL CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns );
+};
+
+//--------------------------------------------------------------------
+
+struct _UndoTransliterate_Data;
+class SwUndoTransliterate : public SwUndo, public SwUndRng
+{
+ std::vector< _UndoTransliterate_Data * > aChanges;
+ sal_uInt32 nType;
+
+ void DoTransliterate(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoTransliterate( const SwPaM& rPam,
+ const utl::TransliterationWrapper& rTrans );
+
+ virtual ~SwUndoTransliterate();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen,
+ ::com::sun::star::uno::Sequence <sal_Int32>& rOffsets );
+ BOOL HasData() const { return aChanges.size() > 0; }
+};
+
+#endif // SW_UNDO_OVERWRITE_HXX
+
diff --git a/sw/source/core/inc/UndoRedline.hxx b/sw/source/core/inc/UndoRedline.hxx
new file mode 100644
index 000000000000..520b20b2b450
--- /dev/null
+++ b/sw/source/core/inc/UndoRedline.hxx
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_REDLINE_HXX
+#define SW_UNDO_REDLINE_HXX
+
+#include <undobj.hxx>
+
+
+struct SwSortOptions;
+class SwRedline;
+class SwRedlineSaveDatas;
+class SwUndoDelete;
+
+
+//--------------------------------------------------------------------
+
+class SwUndoRedline : public SwUndo, public SwUndRng
+{
+protected:
+ SwRedlineData* pRedlData;
+ SwRedlineSaveDatas* pRedlSaveData;
+ SwUndoId nUserId;
+ BOOL bHiddenRedlines;
+
+ virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange );
+
+ virtual ~SwUndoRedline();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ SwUndoId GetUserId() const { return nUserId; }
+ USHORT GetRedlSaveCount() const;
+};
+
+class SwUndoRedlineDelete : public SwUndoRedline
+{
+ BOOL bCanGroup : 1;
+ BOOL bIsDelim : 1;
+ BOOL bIsBackspace : 1;
+
+ virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId = UNDO_EMPTY );
+
+ BOOL CanGrouping( const SwUndoRedlineDelete& rPrev );
+
+ // SwUndoTblCpyTbl needs this information:
+ long NodeDiff() const { return nSttNode - nEndNode; }
+ xub_StrLen ContentStart() const { return nSttCntnt; }
+};
+
+class SwUndoRedlineSort : public SwUndoRedline
+{
+ SwSortOptions* pOpt;
+ ULONG nSaveEndNode, nOffset;
+ xub_StrLen nSaveEndCntnt;
+
+ virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt );
+
+ virtual ~SwUndoRedlineSort();
+
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetSaveRange( const SwPaM& rRange );
+ void SetOffset( const SwNodeIndex& rIdx );
+};
+
+class SwUndoAcceptRedline : public SwUndoRedline
+{
+private:
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoAcceptRedline( const SwPaM& rRange );
+
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+class SwUndoRejectRedline : public SwUndoRedline
+{
+private:
+ virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
+
+public:
+ SwUndoRejectRedline( const SwPaM& rRange );
+
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+//--------------------------------------------------------------------
+
+class SwUndoCompDoc : public SwUndo, public SwUndRng
+{
+ SwRedlineData* pRedlData;
+ SwUndoDelete* pUnDel, *pUnDel2;
+ SwRedlineSaveDatas* pRedlSaveData;
+ BOOL bInsert;
+public:
+ SwUndoCompDoc( const SwPaM& rRg, BOOL bIns );
+ SwUndoCompDoc( const SwRedline& rRedl );
+
+ virtual ~SwUndoCompDoc();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+#endif // SW_UNDO_REDLINE_HXX
+
diff --git a/sw/source/core/inc/UndoSection.hxx b/sw/source/core/inc/UndoSection.hxx
new file mode 100644
index 000000000000..a93715f2f113
--- /dev/null
+++ b/sw/source/core/inc/UndoSection.hxx
@@ -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.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_SECTION_HXX
+#define SW_UNDO_SECTION_HXX
+
+#include <undobj.hxx>
+
+#include <memory>
+
+#include <swdllapi.h>
+
+
+class SfxItemSet;
+class SwTxtNode;
+class SwSectionData;
+class SwSectionFmt;
+class SwTOXBase;
+
+
+//------------ Undo of Insert-/Delete-Section ----------------------
+
+class SwUndoInsSection : public SwUndo, private SwUndRng
+{
+private:
+ const ::std::auto_ptr<SwSectionData> m_pSectionData;
+ const ::std::auto_ptr<SwTOXBase> m_pTOXBase; /// set iff section is TOX
+ const ::std::auto_ptr<SfxItemSet> m_pAttrSet;
+ ::std::auto_ptr<SwHistory> m_pHistory;
+ ::std::auto_ptr<SwRedlineData> m_pRedlData;
+ ULONG m_nSectionNodePos;
+ bool m_bSplitAtStart : 1;
+ bool m_bSplitAtEnd : 1;
+ bool m_bUpdateFtn : 1;
+
+ void Join( SwDoc& rDoc, ULONG nNode );
+
+public:
+ SwUndoInsSection(SwPaM const&, SwSectionData const&,
+ SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase);
+
+ virtual ~SwUndoInsSection();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetSectNdPos(ULONG const nPos) { m_nSectionNodePos = nPos; }
+ void SaveSplitNode(SwTxtNode *const pTxtNd, bool const bAtStart);
+ void SetUpdtFtnFlag(bool const bFlag) { m_bUpdateFtn = bFlag; }
+};
+
+SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const&);
+
+SW_DLLPRIVATE SwUndo * MakeUndoUpdateSection(SwSectionFmt const&, bool const);
+
+#endif // SW_UNDO_SECTION_HXX
+
diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx
new file mode 100644
index 000000000000..b89ae502f7db
--- /dev/null
+++ b/sw/source/core/inc/UndoSort.hxx
@@ -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.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_SORT_HXX
+#define SW_UNDO_SORT_HXX
+
+#include <undobj.hxx>
+
+
+struct SwSortOptions;
+class SwTableNode;
+class SwUndoAttrTbl;
+
+
+/*--------------------------------------------------------------------
+ Undo for Sorting
+ --------------------------------------------------------------------*/
+
+struct SwSortUndoElement
+{
+ union {
+ struct {
+ ULONG nKenn;
+ ULONG nSource, nTarget;
+ } TXT;
+ struct {
+ String *pSource, *pTarget;
+ } TBL;
+ } SORT_TXT_TBL;
+
+ SwSortUndoElement( const String& aS, const String& aT )
+ {
+ SORT_TXT_TBL.TBL.pSource = new String( aS );
+ SORT_TXT_TBL.TBL.pTarget = new String( aT );
+ }
+ SwSortUndoElement( ULONG nS, ULONG nT )
+ {
+ SORT_TXT_TBL.TXT.nSource = nS;
+ SORT_TXT_TBL.TXT.nTarget = nT;
+ SORT_TXT_TBL.TXT.nKenn = 0xffffffff;
+ }
+ ~SwSortUndoElement();
+};
+
+SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10,30)
+SV_DECL_PTRARR(SwUndoSortList, SwNodeIndex*, 10,30)
+
+class SwUndoSort : public SwUndo, private SwUndRng
+{
+ SwSortOptions* pSortOpt;
+ SwSortList aSortList;
+ SwUndoAttrTbl* pUndoTblAttr;
+ SwRedlineData* pRedlData;
+ ULONG nTblNd;
+
+public:
+ SwUndoSort( const SwPaM&, const SwSortOptions& );
+ SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode&,
+ const SwSortOptions&, BOOL bSaveTable );
+
+ virtual ~SwUndoSort();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void Insert( const String& rOrgPos, const String& rNewPos );
+ void Insert( ULONG nOrgPos, ULONG nNewPos );
+
+};
+
+#endif // SW_UNDO_SORT_HXX
+
diff --git a/sw/source/core/inc/UndoSplitMove.hxx b/sw/source/core/inc/UndoSplitMove.hxx
new file mode 100644
index 000000000000..3f6966a871eb
--- /dev/null
+++ b/sw/source/core/inc/UndoSplitMove.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_MOVE_HXX
+#define SW_UNDO_MOVE_HXX
+
+#include <undobj.hxx>
+
+
+class SwUndoSplitNode: public SwUndo
+{
+ SwHistory* pHistory;
+ SwRedlineData* pRedlData;
+ ULONG nNode;
+ xub_StrLen nCntnt;
+ BOOL bTblFlag : 1;
+ BOOL bChkTblStt : 1;
+
+public:
+ SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, BOOL bChkTbl );
+
+ virtual ~SwUndoSplitNode();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetTblFlag() { bTblFlag = TRUE; }
+};
+
+
+class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveCntnt
+{
+ // nDest.. - destination range of move (after move!)
+ // nIns.. - source Position of move (after move!)
+ // nMv.. - destination position of move (before move!); for REDO
+ ULONG nDestSttNode, nDestEndNode, nInsPosNode, nMvDestNode;
+ xub_StrLen nDestSttCntnt, nDestEndCntnt, nInsPosCntnt, nMvDestCntnt;
+
+ USHORT nFtnStt; // StartPos of Footnotes in History
+
+ BOOL bJoinNext : 1,
+ bJoinPrev : 1,
+ bMoveRange : 1;
+
+ bool bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
+
+ void DelFtn( const SwPaM& );
+
+public:
+ SwUndoMove( const SwPaM&, const SwPosition& );
+ SwUndoMove( SwDoc* pDoc, const SwNodeRange&, const SwNodeIndex& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ /// set the destination range after the move
+ void SetDestRange( const SwPaM&, const SwPosition&, BOOL, BOOL );
+ void SetDestRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
+ const SwNodeIndex& rInsPos );
+
+ BOOL IsMoveRange() const { return bMoveRange; }
+ ULONG GetEndNode() const { return nEndNode; }
+ ULONG GetDestSttNode() const { return nDestSttNode; }
+ xub_StrLen GetDestSttCntnt() const { return nDestSttCntnt; }
+
+ void SetMoveRedlines( bool b ) { bMoveRedlines = b; }
+
+};
+
+#endif // SW_UNDO_MOVE_HXX
+
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
new file mode 100644
index 000000000000..87246417b54d
--- /dev/null
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -0,0 +1,391 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SW_UNDO_TABLE_HXX
+#define SW_UNDO_TABLE_HXX
+
+#include <undobj.hxx>
+
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_ULONGS
+#define _SVSTDARR_BOOLS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_USHORTSSORT
+#include <svl/svstdarr.hxx>
+#endif
+
+#include <swtypes.hxx>
+#include <itabenum.hxx>
+
+
+class SfxItemSet;
+
+struct SwSaveRowSpan;
+class _SaveTable;
+class SwDDEFieldType;
+class SwUndoSaveSections;
+class SwUndoMoves;
+class SwUndoDelete;
+class SwSelBoxes;
+class SwTblToTxtSaves;
+class SwTable;
+class SwTableBox;
+class SwStartNode;
+class SwTableNode;
+class SwTableAutoFmt;
+class SwTableSortBoxes;
+
+
+class SwUndoInsTbl : public SwUndo
+{
+ String sTblNm;
+ SwInsertTableOptions aInsTblOpts;
+ SwDDEFieldType* pDDEFldType;
+ SvUShorts* pColWidth;
+ SwRedlineData* pRedlData;
+ SwTableAutoFmt* pAutoFmt;
+ ULONG nSttNode;
+ USHORT nRows, nCols;
+ USHORT nAdjust;
+
+public:
+ SwUndoInsTbl( const SwPosition&, USHORT nCols, USHORT nRows,
+ USHORT eAdjust, const SwInsertTableOptions& rInsTblOpts,
+ const SwTableAutoFmt* pTAFmt, const SvUShorts* pColArr,
+ const String & rName);
+
+ virtual ~SwUndoInsTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ virtual SwRewriter GetRewriter() const;
+
+};
+
+class SwUndoTxtToTbl : public SwUndo, public SwUndRng
+{
+ String sTblNm;
+ SwInsertTableOptions aInsTblOpts;
+ SvULongs* pDelBoxes;
+ SwTableAutoFmt* pAutoFmt;
+ SwHistory* pHistory;
+ sal_Unicode cTrenner;
+ USHORT nAdjust;
+ BOOL bSplitEnd : 1;
+
+public:
+ SwUndoTxtToTbl( const SwPaM&, const SwInsertTableOptions&, sal_Unicode,
+ USHORT,
+ const SwTableAutoFmt* pAFmt );
+
+ virtual ~SwUndoTxtToTbl();
+
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ SwHistory& GetHistory(); // will be created if necessary
+ void AddFillBox( const SwTableBox& rBox );
+};
+
+class SwUndoTblToTxt : public SwUndo
+{
+ String sTblNm;
+ SwDDEFieldType* pDDEFldType;
+ _SaveTable* pTblSave;
+ SwTblToTxtSaves* pBoxSaves;
+ SwHistory* pHistory;
+ ULONG nSttNd, nEndNd;
+ USHORT nAdjust;
+ sal_Unicode cTrenner;
+ USHORT nHdlnRpt;
+ BOOL bCheckNumFmt : 1;
+
+public:
+ SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh );
+
+ virtual ~SwUndoTblToTxt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetRange( const SwNodeRange& );
+ void AddBoxPos( SwDoc& rDoc, ULONG nNdIdx, ULONG nEndIdx,
+ xub_StrLen nCntntIdx = STRING_MAXLEN);
+};
+
+class SwUndoAttrTbl : public SwUndo
+{
+ ULONG nSttNode;
+ _SaveTable* pSaveTbl;
+ BOOL bClearTabCol : 1;
+public:
+ SwUndoAttrTbl( const SwTableNode& rTblNd, BOOL bClearTabCols = FALSE );
+
+ virtual ~SwUndoAttrTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+};
+
+class SwUndoTblNumFmt;
+
+class SwUndoTblAutoFmt : public SwUndo
+{
+ ULONG nSttNode;
+ _SaveTable* pSaveTbl;
+ ::std::vector< ::boost::shared_ptr<SwUndoTblNumFmt> > m_Undos;
+ BOOL bSaveCntntAttr;
+
+ void UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext);
+
+public:
+ SwUndoTblAutoFmt( const SwTableNode& rTblNd, const SwTableAutoFmt& );
+
+ virtual ~SwUndoTblAutoFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SaveBoxCntnt( const SwTableBox& rBox );
+};
+
+class SwUndoTblNdsChg : public SwUndo
+{
+ _SaveTable* pSaveTbl;
+ SvULongs aBoxes;
+
+ union {
+ SvULongs* pNewSttNds;
+ SwUndoSaveSections* pDelSects;
+ } Ptrs;
+ SvBools aMvBoxes; // for SplitRow (split Nodes of Box)
+ long nMin, nMax; // for redo of delete column
+ ULONG nSttNode, nCurrBox;
+ USHORT nCount, nRelDiff, nAbsDiff, nSetColType;
+ BOOL bFlag;
+ BOOL bSameHeight; // only used for SplitRow
+public:
+ SwUndoTblNdsChg( SwUndoId UndoId,
+ const SwSelBoxes& rBoxes,
+ const SwTableNode& rTblNd,
+ long nMn, long nMx,
+ USHORT nCnt, BOOL bFlg, BOOL bSameHeight );
+
+ // for SetColWidth
+ SwUndoTblNdsChg( SwUndoId UndoId, const SwSelBoxes& rBoxes,
+ const SwTableNode& rTblNd );
+
+ virtual ~SwUndoTblNdsChg();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld );
+ void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld,
+ const SwSelBoxes& rBoxes, const SvULongs& rNodeCnts );
+ void SaveSection( SwStartNode* pSttNd );
+ void ReNewBoxes( const SwSelBoxes& rBoxes );
+
+
+ void SetColWidthParam( ULONG nBoxIdx, USHORT nMode, USHORT nType,
+ SwTwips nAbsDif, SwTwips nRelDif )
+ {
+ nCurrBox = nBoxIdx;
+ nCount = nMode;
+ nSetColType = nType;
+ nAbsDiff = (USHORT)nAbsDif;
+ nRelDiff = (USHORT)nRelDif;
+ }
+
+};
+
+class SwUndoTblMerge : public SwUndo, private SwUndRng
+{
+ ULONG nTblNode;
+ _SaveTable* pSaveTbl;
+ SvULongs aBoxes, aNewSttNds;
+ SwUndoMoves* pMoves;
+ SwHistory* pHistory;
+
+public:
+ SwUndoTblMerge( const SwPaM& rTblSel );
+
+ virtual ~SwUndoTblMerge();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos );
+
+ void SetSelBoxes( const SwSelBoxes& rBoxes );
+
+ void AddNewBox( ULONG nSttNdIdx )
+ { aNewSttNds.Insert( nSttNdIdx, aNewSttNds.Count() ); }
+
+ void SaveCollection( const SwTableBox& rBox );
+
+};
+
+
+class SwUndoTblNumFmt : public SwUndo
+{
+ SfxItemSet *pBoxSet;
+ SwHistory* pHistory;
+ String aStr, aNewFml;
+
+ ULONG nFmtIdx, nNewFmtIdx;
+ double fNum, fNewNum;
+ ULONG nNode;
+ ULONG nNdPos;
+
+ BOOL bNewFmt : 1;
+ BOOL bNewFml : 1;
+ BOOL bNewValue : 1;
+
+public:
+ SwUndoTblNumFmt( const SwTableBox& rBox, const SfxItemSet* pNewSet = 0 );
+
+ virtual ~SwUndoTblNumFmt();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SetNumFmt( ULONG nNewNumFmtIdx, const double& rNewNumber )
+ { nFmtIdx = nNewNumFmtIdx; fNum = rNewNumber; }
+ void SetBox( const SwTableBox& rBox );
+};
+
+class _UndoTblCpyTbl_Entries;
+
+class SwUndoTblCpyTbl : public SwUndo
+{
+ _UndoTblCpyTbl_Entries* pArr;
+ SwUndoTblNdsChg* pInsRowUndo;
+
+ //b6341295: When redlining is active, PrepareRedline has to create the
+ //redlining attributes for the new and the old table cell content
+ SwUndo* PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox,
+ const SwPosition& rPos, bool& rJoin, bool bRedo );
+public:
+ SwUndoTblCpyTbl();
+
+ virtual ~SwUndoTblCpyTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void AddBoxBefore( const SwTableBox& rBox, BOOL bDelCntnt );
+ void AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx,
+ BOOL bDelCntnt );
+
+ BOOL IsEmpty() const;
+ BOOL InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes, USHORT nCnt );
+};
+
+class SwUndoCpyTbl : public SwUndo
+{
+ SwUndoDelete* pDel;
+ ULONG nTblNode;
+public:
+ SwUndoCpyTbl();
+
+ virtual ~SwUndoCpyTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+
+ void SetTableSttIdx( ULONG nIdx ) { nTblNode = nIdx; }
+};
+
+class SwUndoSplitTbl : public SwUndo
+{
+ ULONG nTblNode, nOffset;
+ SwSaveRowSpan* mpSaveRowSpan; // stores row span values at the splitting row
+ _SaveTable* pSavTbl;
+ SwHistory* pHistory;
+ USHORT nMode, nFmlEnd;
+ BOOL bCalcNewSize;
+public:
+ SwUndoSplitTbl( const SwTableNode& rTblNd, SwSaveRowSpan* pRowSp,
+ USHORT nMode, BOOL bCalcNewSize );
+
+ virtual ~SwUndoSplitTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SetTblNodeOffset( ULONG nIdx ) { nOffset = nIdx - nTblNode; }
+ SwHistory* GetHistory() { return pHistory; }
+ void SaveFormula( SwHistory& rHistory );
+};
+
+class SwUndoMergeTbl : public SwUndo
+{
+ String aName;
+ ULONG nTblNode;
+ _SaveTable* pSavTbl, *pSavHdl;
+ SwHistory* pHistory;
+ USHORT nMode;
+ BOOL bWithPrev;
+public:
+ SwUndoMergeTbl( const SwTableNode& rTblNd, const SwTableNode& rDelTblNd,
+ BOOL bWithPrev, USHORT nMode );
+
+ virtual ~SwUndoMergeTbl();
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+
+ void SaveFormula( SwHistory& rHistory );
+};
+
+
+//--------------------------------------------------------------------
+
+class SwUndoTblHeadline : public SwUndo
+{
+ ULONG nTblNd;
+ USHORT nOldHeadline;
+ USHORT nNewHeadline;
+public:
+ SwUndoTblHeadline( const SwTable&, USHORT nOldHdl, USHORT nNewHdl );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
+ virtual void RepeatImpl( ::sw::RepeatContext & );
+};
+
+#endif // SW_UNDO_TABLE_HXX
+
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index bc2d2d4cb1f3..dcd28bfdd46d 100644
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -56,7 +56,7 @@ class SwAutoCorrDoc : public SvxAutoCorrDoc
SwEditShell& rEditSh;
SwPaM& rCrsr;
SwNodeIndex* pIdx;
- SwUndoId nUndoId;
+ int m_nEndUndoCounter;
bool bUndoIdInitialized;
void DeleteSel( SwPaM& rDelPam );
diff --git a/sw/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index e2aa129f65e1..e2aa129f65e1 100644
--- a/sw/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
diff --git a/sw/source/core/inc/undoflystrattr.hxx b/sw/source/core/inc/undoflystrattr.hxx
index 329502ea1d1c..5115f1a37c07 100644
--- a/sw/source/core/inc/undoflystrattr.hxx
+++ b/sw/source/core/inc/undoflystrattr.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _UNDO_FLY_STR_ATTR_HXX
-#define _UNDO_FLY_STR_ATTR_HXX
+#ifndef SW_UNDO_FLY_STR_ATTR_HXX
+#define SW_UNDO_FLY_STR_ATTR_HXX
#include <undobj.hxx>
#include <swundo.hxx>
@@ -42,9 +42,8 @@ class SwUndoFlyStrAttr : public SwUndo
const String& sNewStr );
virtual ~SwUndoFlyStrAttr();
- virtual void Undo( SwUndoIter & rIt );
- virtual void Redo( SwUndoIter & rIt );
- virtual void Repeat( SwUndoIter & rIt );
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual SwRewriter GetRewriter() const;
@@ -54,4 +53,4 @@ class SwUndoFlyStrAttr : public SwUndo
const String msNewStr;
};
-#endif // _UNDO_FLY_STR_ATTR_HXX
+#endif // SW_UNDO_FLY_STR_ATTR_HXX
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 37ec80632153..4016f9cb92ef 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -78,6 +78,7 @@
#include <tgrditem.hxx>
#include <hfspacingitem.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <cntfrm.hxx>
@@ -106,9 +107,7 @@
#include <cmdid.h>
#include <unomid.h>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <svx/svdundo.hxx> // #111827#
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
@@ -218,7 +217,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
// <--
//Wenn in einem der Nodes noch ein Crsr angemeldet ist, muss das
//ParkCrsr einer (beliebigen) Shell gerufen werden.
- pNode = pDoc->GetNodes()[ aIdx ];
+ pNode = & aIdx.GetNode();
sal_uInt32 nEnd = pNode->EndOfSectionIndex();
while ( aIdx < nEnd )
{
@@ -237,21 +236,17 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
} while ( aIter++ );
}
aIdx++;
- pNode = pDoc->GetNodes()[ aIdx ];
+ pNode = & aIdx.GetNode();
}
}
rCnt.SetNewCntntIdx( (const SwNodeIndex*)0 );
// beim Loeschen von Header/Footer-Formaten IMMER das Undo
// abschalten! (Bug 31069)
- sal_Bool bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
ASSERT( pNode, "Ein grosses Problem." );
pDoc->DeleteSection( pNode );
-
- if( bDoesUndo )
- pDoc->DoUndo( sal_True );
}
delete pFmt;
}
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 4d9b654fb79c..ba3652bd0d20 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -27,13 +27,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <tools/bigint.hxx>
#include "pagefrm.hxx"
#include "rootfrm.hxx"
#include "cntfrm.hxx"
#include "flyfrm.hxx"
#include "txtfrm.hxx"
-#include "doc.hxx"
+#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include "viewsh.hxx"
#include "viewimp.hxx"
#include "pam.hxx"
@@ -1370,7 +1372,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
nX = rNew.X() - pFrm->Frm().Left() - nBaseOfstForFly;
}
}
- GetFmt()->GetDoc()->StartUndo( UNDO_START, NULL );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
if( pCnt != GetAnchorFrm() || ( IsAutoPos() && pCnt->IsTxtFrm() &&
GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE)) )
@@ -1421,7 +1423,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
const Point aRelPos = bVert ? Point( -nY, nX ) : Point( nX, nY );
ChgRelPos( aRelPos );
- GetFmt()->GetDoc()->EndUndo( UNDO_END, NULL );
+ GetFmt()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
if ( pOldPage != FindPageFrm() )
::Notify_Background( GetVirtDrawObj(), pOldPage, aOld, PREP_FLY_LEAVE,
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index a85ee7091ff1..e089d5a2d726 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -491,8 +491,7 @@ SwActualSection::SwActualSection( SwActualSection *pUp,
if ( !pSectNode )
{
const SwNodeIndex *pIndex = pSect->GetFmt()->GetCntnt().GetCntntIdx();
- pSectNode = pSect->GetFmt()->GetDoc()->GetNodes()[*pIndex]->
- FindSectionNode();
+ pSectNode = pIndex->GetNode().FindSectionNode();
}
}
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 8c54ed8623a6..6d3827a69336 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -892,7 +892,7 @@ BOOL SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, BOOL bInReadOnly ) const
USHORT SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
{
ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" );
- const SwFrm *pActFrm = GetFmt()->GetDoc()->GetNodes()[pActualCrsr->GetPoint()->nNode]->
+ SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode().
GetCntntNode()->GetFrm( 0,
pActualCrsr->GetPoint(),
FALSE );
@@ -2011,7 +2011,6 @@ inline void Sub( SwRegionRects& rRegion, const SwRect& rRect )
void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
{
- const SwNodes &rNds = GetFmt()->GetDoc()->GetNodes();
SwPosition *pStartPos = rCrsr.Start(),
*pEndPos = rCrsr.GetPoint() == pStartPos ?
rCrsr.GetMark() : rCrsr.GetPoint();
@@ -2047,10 +2046,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
//Erstmal die CntntFrms zum Start und End besorgen, die brauch ich auf
//jedenfall.
- const SwCntntFrm *pStartFrm = rNds[ pStartPos->nNode ]->
+ SwCntntFrm const* pStartFrm = pStartPos->nNode.GetNode().
GetCntntNode()->GetFrm( &rCrsr.GetSttPos(), pStartPos );
- const SwCntntFrm *pEndFrm = rNds[ pEndPos->nNode ]->
+ SwCntntFrm const* pEndFrm = pEndPos->nNode.GetNode().
GetCntntNode()->GetFrm( &rCrsr.GetEndPos(), pEndPos );
ASSERT( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." );
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 358b00e12ca1..73cff76dcbd9 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <tools/urlobj.hxx>
@@ -39,9 +38,8 @@
#include <comphelper/storagehelper.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
-#endif
#include <pam.hxx>
#include <swblocks.hxx>
#include <ndtxt.hxx>
@@ -81,7 +79,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const String& rFile )
pDoc = pDocSh->GetDoc();
xDocShellRef = pDocSh;
pDoc->SetOle2Link( Link() );
- pDoc->DoUndo( FALSE ); // always FALSE
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->acquire();
uno::Reference< embed::XStorage > refStg;
if( !aDateModified.GetDate() || !aTimeModified.GetTime() )
@@ -124,7 +122,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const uno::Reference < embed::XStorage >& rStg
pDoc = pDocSh->GetDoc();
xDocShellRef = pDocSh;
pDoc->SetOle2Link( Link() );
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->acquire();
InitBlockMode ( rStg );
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index de76b856cda7..c1ad9f4c63ec 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -32,13 +32,14 @@
#include <tblsel.hxx>
#include <tblrwcl.hxx>
#include <node.hxx>
-#include <undobj.hxx>
+#include <UndoTable.hxx>
#include <pam.hxx>
#include <frmfmt.hxx>
#include <frmatr.hxx>
#include <cellfrm.hxx>
#include <fmtfsize.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <vector>
#include <set>
#include <list>
@@ -897,11 +898,16 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
USHORT nL = pCNd ? pCNd->Len() : 0;
aPam.GetPoint()->nContent.Assign( pCNd, nL );
SwNodeIndex aSttNdIdx( *pBox->GetSttNd(), 1 );
+ bool const bUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
if( pUndo )
- pDoc->DoUndo( FALSE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
+ }
pDoc->AppendTxtNode( *aPam.GetPoint() );
if( pUndo )
- pDoc->DoUndo( TRUE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(bUndo);
+ }
SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode );
if( pUndo )
pUndo->MoveBoxCntnt( pDoc, aRg, rInsPosNd );
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 48b3b5f335fb..c4f8abdda65c 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1769,10 +1769,9 @@ SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, const SwNodeIndex &rIdx,
pUpper( pUp ),
pImpl( 0 )
{
- SwDoc* pDoc = pFmt->GetDoc();
CheckBoxFmt( pFmt )->Add( this );
- pSttNd = pDoc->GetNodes()[ rIdx ]->GetStartNode();
+ pSttNd = rIdx.GetNode().GetStartNode();
// an der Table eintragen
const SwTableNode* pTblNd = pSttNd->FindTableNode();
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index 02da2c32be8a..d3076e642ef5 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -28,11 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "hintids.hxx"
#include "cntfrm.hxx" // _GetFly
#include "doc.hxx"
+#include <IDocumentUndoRedo.hxx>
#include "pam.hxx" // fuer SwTxtFlyCnt
#include "flyfrm.hxx" // fuer SwTxtFlyCnt
#include "ndtxt.hxx" // SwFlyFrmFmt
@@ -117,9 +116,8 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc )
// In CopyLayoutFmt (siehe doclay.cxx) wird das FlyFrmFmt erzeugt
// und der Inhalt dupliziert.
- // fuers kopieren vom Attribut das Undo immer abschalten
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ // disable undo while copying attribute
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwFmtAnchor aAnchor( pFmt->GetAnchor() );
if ((FLY_AT_PAGE != aAnchor.GetAnchorId()) &&
(pDoc != pFmt->GetDoc())) // different documents?
@@ -146,7 +144,6 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc )
}
SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false );
- pDoc->DoUndo( bUndo );
((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew );
}
@@ -193,16 +190,13 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode )
// stehen wir noch im falschen Dokument ?
if( pDoc != pFmt->GetDoc() )
{
- // fuers kopieren vom Attribut das Undo immer abschalten
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ // disable undo while copying attribute
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false );
- pDoc->DoUndo( bUndo );
- bUndo = pFmt->GetDoc()->DoesUndo();
- pFmt->GetDoc()->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuardFmt(
+ pFmt->GetDoc()->GetIDocumentUndoRedo());
pFmt->GetDoc()->DelLayoutFmt( pFmt );
- pFmt->GetDoc()->DoUndo( bUndo );
((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew );
}
else if( pNode->GetpSwpHints() &&
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d6a6dfb045ac..65ad24d2b8b3 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -64,6 +64,7 @@
#include <charfmt.hxx>
#include <ndtxt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <pam.hxx> // fuer SwPosition
#include <fldbas.hxx>
@@ -163,8 +164,8 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
// 1. den Nachfolger nehmen
// 2. den Vorgaenger
- SwNode *pNd;
- switch( ( pNd = (*this)[aTmp] )->GetNodeType() )
+ SwNode * pNd = & aTmp.GetNode();
+ switch (pNd->GetNodeType())
{
case ND_TABLENODE:
((SwTableNode*)pNd)->MakeFrms( aIdx );
@@ -1628,7 +1629,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
}
}
- const bool bUndoNodes = !pOtherDoc && GetDoc()->GetUndoNds() == &GetNodes();
+ bool const bUndoNodes = !pOtherDoc
+ && GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
// Ende erst jetzt holen, weil beim Kopieren in sich selbst der
// Start-Index und alle Attribute vorher aktualisiert werden.
@@ -2098,8 +2100,8 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
const xub_StrLen nEnd = rStart.GetIndex() + nLen;
SwDoc* const pOtherDoc = (pDest->GetDoc() != GetDoc())
? pDest->GetDoc() : 0;
- const bool bUndoNodes =
- !pOtherDoc && GetDoc()->GetUndoNds() == &GetNodes();
+ bool const bUndoNodes = !pOtherDoc
+ && GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
ASSERT(!pOtherDoc,
"mst: entering dead and bitrotted code; fasten your seatbelts!");
@@ -5084,7 +5086,7 @@ bool SwTxtNode::IsInClipboard() const
bool SwTxtNode::IsInUndo() const
{
- return &GetNodes() == GetDoc()->GetUndoNds();
+ return GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
}
bool SwTxtNode::IsInContent() const
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 4d56942ecef4..4ef913b8a932 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -65,6 +65,7 @@
#include <fmtmeta.hxx>
#include <breakit.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <errhdl.hxx>
#include <fldbas.hxx>
#include <pam.hxx>
@@ -1318,11 +1319,9 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
SwIndex aTmpIdx( this, *pAttr->GetStart() );
Update( aTmpIdx, 1, TRUE );
}
- // Format loeschen nicht ins Undo aufnehmen!!
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ // do not record deletion of Format!
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
DestroyAttr( pAttr );
- pDoc->DoUndo( bUndo );
return false;
}
}
@@ -3047,12 +3046,19 @@ sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr )
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
cRet = CH_TXTATR_INWORD;
- break;
+ break;
case RES_TXTATR_FIELD:
case RES_TXTATR_FLYCNT:
+ {
cRet = CH_TXTATR_BREAKWORD;
- break;
+
+ // #i78149: PostIt fields should not break words for spell and grammar checking
+ if (rAttr.Which() == RES_TXTATR_FIELD &&
+ RES_POSTITFLD == rAttr.GetFld().GetFld()->GetTyp()->Which())
+ cRet = CH_TXTATR_INWORD;
+ }
+ break;
default:
ASSERT(false, "GetCharOfTxtAttr: unknown attr");
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 0630dbd722b6..cd2a8d3227c4 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -70,7 +70,7 @@
#include <txttypes.hxx>
#include <breakit.hxx>
#include <crstate.hxx>
-#include <undobj.hxx>
+#include <UndoOverwrite.hxx>
#include <txatritr.hxx>
#include <redline.hxx> // SwRedline
#include <docary.hxx> // SwRedlineTbl
@@ -736,6 +736,7 @@ BOOL SwScanner::NextWord()
// get the word boundaries
aBound = pBreakIt->GetBreakIter()->getWordBoundary( rText, nBegin,
pBreakIt->GetLocale( aCurrLang ), nWordType, sal_True );
+ ASSERT( aBound.endPos >= aBound.startPos, "broken aBound result" );
//no word boundaries could be found
if(aBound.endPos == aBound.startPos)
@@ -750,46 +751,54 @@ BOOL SwScanner::NextWord()
rCC.setLocale( aOldLocale );
- // we have to differenciate between these cases:
- if ( aBound.startPos <= nBegin )
+ // #i89042, as discussed with HDU: don't evaluate script changes for word count. Use whole word.
+ if ( nWordType == i18n::WordType::WORD_COUNT )
{
- ASSERT( aBound.endPos >= nBegin, "Unexpected aBound result" )
-
- // restrict boundaries to script boundaries and nEndPos
- const USHORT nCurrScript =
- pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
-
- XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) );
- const sal_Int32 nScriptEnd = nBegin +
- pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
- const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
-
- // restrict word start to last script change position
- sal_Int32 nScriptBegin = 0;
- if ( aBound.startPos < nBegin )
- {
- // search from nBegin backwards until the next script change
- aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) );
- nScriptBegin = aBound.startPos +
- pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos,
- nCurrScript );
- }
-
- nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin );
- nLen = (xub_StrLen)(nEnd - nBegin);
+ nBegin = Max( static_cast< xub_StrLen >(aBound.startPos), nBegin );
+ nLen = 0;
+ if (static_cast< xub_StrLen >(aBound.endPos) > nBegin)
+ nLen = static_cast< xub_StrLen >(aBound.endPos) - nBegin;
}
else
{
- const USHORT nCurrScript =
- pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos );
- XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) );
- const sal_Int32 nScriptEnd = aBound.startPos +
- pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
- const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
- nBegin = (xub_StrLen)aBound.startPos;
- nLen = (xub_StrLen)(nEnd - nBegin);
+ // we have to differenciate between these cases:
+ if ( aBound.startPos <= nBegin )
+ {
+ ASSERT( aBound.endPos >= nBegin, "Unexpected aBound result" )
+
+ // restrict boundaries to script boundaries and nEndPos
+ const USHORT nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
+ XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) );
+ const sal_Int32 nScriptEnd = nBegin +
+ pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
+ const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
+
+ // restrict word start to last script change position
+ sal_Int32 nScriptBegin = 0;
+ if ( aBound.startPos < nBegin )
+ {
+ // search from nBegin backwards until the next script change
+ aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
+ static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) );
+ nScriptBegin = aBound.startPos +
+ pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos,
+ nCurrScript );
+ }
+
+ nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin );
+ nLen = (xub_StrLen)(nEnd - nBegin);
+ }
+ else
+ {
+ const USHORT nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos );
+ XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
+ static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) );
+ const sal_Int32 nScriptEnd = aBound.startPos +
+ pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
+ const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
+ nBegin = (xub_StrLen)aBound.startPos;
+ nLen = (xub_StrLen)(nEnd - nBegin);
+ }
}
// optionally clip the result of getWordBoundaries:
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index 8a3c6c507c93..3f714561b05b 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -27,10 +27,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <tools/rtti.hxx>
+
#include <SwUndoField.hxx>
#include <swundo.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <txtfld.hxx>
#include <fldbas.hxx>
#include <ndtxt.hxx>
@@ -83,43 +86,41 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc()
delete pNewField;
}
-void SwUndoFieldFromDoc::Undo( SwUndoIter& )
+void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &)
{
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
const SwField * pField = pTxtFld->GetFld().GetFld();
if (pField)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->UpdateFld(pTxtFld, *pOldField, pHnt, bUpdate);
- pDoc->DoUndo(bUndo);
}
}
-void SwUndoFieldFromDoc::Redo( SwUndoIter& )
+void SwUndoFieldFromDoc::DoImpl()
{
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
const SwField * pField = pTxtFld->GetFld().GetFld();
if (pField)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->UpdateFld(pTxtFld, *pNewField, pHnt, bUpdate);
SwFmtFld* pDstFmtFld = (SwFmtFld*)&pTxtFld->GetFld();
if ( pDoc->GetFldType(RES_POSTITFLD, aEmptyStr,false) == pDstFmtFld->GetFld()->GetTyp() )
pDoc->GetDocShell()->Broadcast( SwFmtFldHint( pDstFmtFld, SWFMTFLD_INSERTED ) );
- pDoc->DoUndo(bUndo);
}
}
-void SwUndoFieldFromDoc::Repeat(SwUndoIter & rIt)
+void SwUndoFieldFromDoc::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
+}
+
+void SwUndoFieldFromDoc::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIt);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ DoImpl();
}
SwUndoFieldFromAPI::SwUndoFieldFromAPI(const SwPosition & rPos,
@@ -133,7 +134,7 @@ SwUndoFieldFromAPI::~SwUndoFieldFromAPI()
{
}
-void SwUndoFieldFromAPI::Undo( SwUndoIter& )
+void SwUndoFieldFromAPI::UndoImpl(::sw::UndoRedoContext &)
{
SwField * pField = SwDoc::GetField(GetPosition());
@@ -141,7 +142,7 @@ void SwUndoFieldFromAPI::Undo( SwUndoIter& )
pField->PutValue(aOldVal, nWhich);
}
-void SwUndoFieldFromAPI::Redo( SwUndoIter& )
+void SwUndoFieldFromAPI::DoImpl()
{
SwField * pField = SwDoc::GetField(GetPosition());
@@ -149,8 +150,13 @@ void SwUndoFieldFromAPI::Redo( SwUndoIter& )
pField->PutValue(aNewVal, nWhich);
}
+void SwUndoFieldFromAPI::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
+}
-void SwUndoFieldFromAPI::Repeat(SwUndoIter & rIter)
+void SwUndoFieldFromAPI::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIter);
+ DoImpl();
}
+
diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx
index f3b2fe4d1a25..4c95a6f1049d 100644
--- a/sw/source/core/undo/SwUndoFmt.cxx
+++ b/sw/source/core/undo/SwUndoFmt.cxx
@@ -29,6 +29,8 @@
#include "precompiled_sw.hxx"
#include <tools/resid.hxx>
+#include <tools/string.hxx>
+
#include <poolfmt.hxx>
#include <charfmt.hxx>
#include <frmfmt.hxx>
@@ -37,8 +39,8 @@
#include <swundo.hxx>
#include <undobj.hxx>
#include <fmtcol.hxx>
-#include <tools/string.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <comcore.hrc>
SwUndoFmtCreate::SwUndoFmtCreate
@@ -54,7 +56,7 @@ SwUndoFmtCreate::~SwUndoFmtCreate()
{
}
-void SwUndoFmtCreate::Undo(SwUndoIter &)
+void SwUndoFmtCreate::UndoImpl(::sw::UndoRedoContext &)
{
if (pNew)
{
@@ -70,20 +72,13 @@ void SwUndoFmtCreate::Undo(SwUndoIter &)
nId = pNew->GetPoolFmtId() & COLL_GET_RANGE_BITS;
bAuto = pNew->IsAuto();
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
Delete();
- pDoc->DoUndo(bDoesUndo);
}
}
}
-void SwUndoFmtCreate::Redo(SwUndoIter &)
+void SwUndoFmtCreate::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
SwFmt * pDerivedFrom = Find(sDerivedFrom);
SwFmt * pFmt = Create(pDerivedFrom);
@@ -99,8 +94,6 @@ void SwUndoFmtCreate::Redo(SwUndoIter &)
}
else
pNew = NULL;
-
- pDoc->DoUndo(bDoesUndo);
}
SwRewriter SwUndoFmtCreate::GetRewriter() const
@@ -130,12 +123,8 @@ SwUndoFmtDelete::~SwUndoFmtDelete()
{
}
-void SwUndoFmtDelete::Undo(SwUndoIter &)
+void SwUndoFmtDelete::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
SwFmt * pDerivedFrom = Find(sDerivedFrom);
SwFmt * pFmt = Create(pDerivedFrom);
@@ -147,23 +136,16 @@ void SwUndoFmtDelete::Undo(SwUndoIter &)
pFmt->SetPoolFmtId((pFmt->GetPoolFmtId() &
~COLL_GET_RANGE_BITS)
| nId);
-
}
-
- pDoc->DoUndo(bDoesUndo);
}
-void SwUndoFmtDelete::Redo(SwUndoIter &)
+void SwUndoFmtDelete::RedoImpl(::sw::UndoRedoContext &)
{
SwFmt * pOld = Find(sOldName);
if (pOld)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
Delete(pOld);
- pDoc->DoUndo(bDoesUndo);
}
}
@@ -190,31 +172,23 @@ SwUndoRenameFmt::~SwUndoRenameFmt()
{
}
-void SwUndoRenameFmt::Undo(SwUndoIter &)
+void SwUndoRenameFmt::UndoImpl(::sw::UndoRedoContext &)
{
SwFmt * pFmt = Find(sNewName);
if (pFmt)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->RenameFmt(*pFmt, sOldName, TRUE);
- pDoc->DoUndo(bDoesUndo);
}
}
-void SwUndoRenameFmt::Redo(SwUndoIter &)
+void SwUndoRenameFmt::RedoImpl(::sw::UndoRedoContext &)
{
SwFmt * pFmt = Find(sOldName);
if (pFmt)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->RenameFmt(*pFmt, sNewName, TRUE);
- pDoc->DoUndo(bDoesUndo);
}
}
@@ -399,12 +373,8 @@ SwUndoNumruleCreate::SwUndoNumruleCreate(const SwNumRule * _pNew,
{
}
-void SwUndoNumruleCreate::Undo(SwUndoIter &)
+void SwUndoNumruleCreate::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
if (! bInitialized)
{
aNew = *pNew;
@@ -412,16 +382,11 @@ void SwUndoNumruleCreate::Undo(SwUndoIter &)
}
pDoc->DelNumRule(aNew.GetName(), TRUE);
- pDoc->DoUndo(bDoesUndo);
}
-void SwUndoNumruleCreate::Redo(SwUndoIter &)
+void SwUndoNumruleCreate::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->MakeNumRule(aNew.GetName(), &aNew, TRUE);
- pDoc->DoUndo(bDoesUndo);
}
SwRewriter SwUndoNumruleCreate::GetRewriter() const
@@ -445,22 +410,14 @@ SwUndoNumruleDelete::SwUndoNumruleDelete(const SwNumRule & rRule,
{
}
-void SwUndoNumruleDelete::Undo(SwUndoIter &)
+void SwUndoNumruleDelete::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->MakeNumRule(aOld.GetName(), &aOld, TRUE);
- pDoc->DoUndo(bDoesUndo);
}
-void SwUndoNumruleDelete::Redo(SwUndoIter &)
+void SwUndoNumruleDelete::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->DelNumRule(aOld.GetName(), TRUE);
- pDoc->DoUndo(bDoesUndo);
}
SwRewriter SwUndoNumruleDelete::GetRewriter() const
@@ -480,22 +437,14 @@ SwUndoNumruleRename::SwUndoNumruleRename(const String & _aOldName,
{
}
-void SwUndoNumruleRename::Undo(SwUndoIter &)
+void SwUndoNumruleRename::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->RenameNumRule(aNewName, aOldName, TRUE);
- pDoc->DoUndo(bDoesUndo);
}
-void SwUndoNumruleRename::Redo(SwUndoIter &)
+void SwUndoNumruleRename::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bDoesUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->RenameNumRule(aOldName, aNewName, TRUE);
- pDoc->DoUndo(bDoesUndo);
}
SwRewriter SwUndoNumruleRename::GetRewriter() const
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index 9a395375eabe..c23811d08f4c 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -30,6 +30,7 @@
#include <tools/resid.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swundo.hxx>
#include <pagedesc.hxx>
#include <SwUndoPageDesc.hxx>
@@ -325,34 +326,20 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
}
}
-void SwUndoPageDesc::Undo(SwUndoIter &)
+void SwUndoPageDesc::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
// Move (header/footer)content node responsibility from new page descriptor to old one again.
if( bExchange )
ExchangeContentNodes( (SwPageDesc&)aNew, (SwPageDesc&)aOld );
pDoc->ChgPageDesc(aOld.GetName(), aOld);
- pDoc->DoUndo(bUndo);
}
-void SwUndoPageDesc::Redo(SwUndoIter &)
+void SwUndoPageDesc::RedoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
// Move (header/footer)content node responsibility from old page descriptor to new one again.
if( bExchange )
ExchangeContentNodes( (SwPageDesc&)aOld, (SwPageDesc&)aNew );
pDoc->ChgPageDesc(aNew.GetName(), aNew);
- pDoc->DoUndo(bUndo);
-}
-
-void SwUndoPageDesc::Repeat(SwUndoIter &)
-{
}
SwRewriter SwUndoPageDesc::GetRewriter() const
@@ -379,12 +366,8 @@ SwUndoPageDescCreate::~SwUndoPageDescCreate()
{
}
-void SwUndoPageDescCreate::Undo(SwUndoIter &)
+void SwUndoPageDescCreate::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
// -> #116530#
if (pDesc)
{
@@ -394,25 +377,23 @@ void SwUndoPageDescCreate::Undo(SwUndoIter &)
// <- #116530#
pDoc->DelPageDesc(aNew.GetName(), TRUE);
- pDoc->DoUndo(bUndo);
}
-
-void SwUndoPageDescCreate::Redo(SwUndoIter &)
+void SwUndoPageDescCreate::DoImpl()
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
SwPageDesc aPageDesc = aNew;
pDoc->MakePageDesc(aNew.GetName(), &aPageDesc, FALSE, TRUE); // #116530#
+}
- pDoc->DoUndo(bUndo);
+void SwUndoPageDescCreate::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
}
-void SwUndoPageDescCreate::Repeat(SwUndoIter & rIt)
+void SwUndoPageDescCreate::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIt);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ DoImpl();
}
SwRewriter SwUndoPageDescCreate::GetRewriter() const
@@ -439,29 +420,26 @@ SwUndoPageDescDelete::~SwUndoPageDescDelete()
{
}
-void SwUndoPageDescDelete::Undo(SwUndoIter &)
+void SwUndoPageDescDelete::UndoImpl(::sw::UndoRedoContext &)
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
-
SwPageDesc aPageDesc = aOld;
pDoc->MakePageDesc(aOld.GetName(), &aPageDesc, FALSE, TRUE); // #116530#
- pDoc->DoUndo(bUndo);
}
-void SwUndoPageDescDelete::Redo(SwUndoIter &)
+void SwUndoPageDescDelete::DoImpl()
{
- BOOL bUndo = pDoc->DoesUndo();
-
- pDoc->DoUndo(FALSE);
pDoc->DelPageDesc(aOld.GetName(), TRUE); // #116530#
- pDoc->DoUndo(bUndo);
}
-void SwUndoPageDescDelete::Repeat(SwUndoIter & rIt)
+void SwUndoPageDescDelete::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
+}
+
+void SwUndoPageDescDelete::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIt);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
+ DoImpl();
}
SwRewriter SwUndoPageDescDelete::GetRewriter() const
diff --git a/sw/source/core/undo/SwUndoTOXChange.cxx b/sw/source/core/undo/SwUndoTOXChange.cxx
index 8628ff70acc7..457ddc366e7c 100644
--- a/sw/source/core/undo/SwUndoTOXChange.cxx
+++ b/sw/source/core/undo/SwUndoTOXChange.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <SwUndoTOXChange.hxx>
#include <swundo.hxx>
#include <doctxm.hxx>
@@ -45,27 +46,32 @@ void SwUndoTOXChange::UpdateTOXBaseSection()
if (pTOX->ISA(SwTOXBaseSection))
{
SwTOXBaseSection * pTOXBase = static_cast<SwTOXBaseSection *>(pTOX);
-
pTOXBase->Update();
pTOXBase->UpdatePageNum();
}
}
-void SwUndoTOXChange::Undo(SwUndoIter &)
+void SwUndoTOXChange::UndoImpl(::sw::UndoRedoContext &)
{
*pTOX = aOld;
UpdateTOXBaseSection();
}
-void SwUndoTOXChange::Redo(SwUndoIter &)
+void SwUndoTOXChange::DoImpl()
{
*pTOX = aNew;
UpdateTOXBaseSection();
}
-void SwUndoTOXChange::Repeat(SwUndoIter & rIter)
+void SwUndoTOXChange::RedoImpl(::sw::UndoRedoContext &)
+{
+ DoImpl();
+}
+
+void SwUndoTOXChange::RepeatImpl(::sw::RepeatContext &)
{
- Redo(rIter);
+ DoImpl();
}
+
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 85adbd1c7138..3dce09e66fa9 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -28,1000 +28,553 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <svx/svdmodel.hxx>
+#include <UndoManager.hxx>
+
+#include <unotools/undoopt.hxx>
#include <vcl/wrkwin.hxx>
+
+#include <svx/svdmodel.hxx>
+
+#include <swmodule.hxx>
#include <doc.hxx>
+#include <ndarr.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
+#include <swundo.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
-#include <docary.hxx>
-#ifndef _UNDO_HRC
#include <undo.hrc>
-#endif
+#include <editsh.hxx>
+#include <unobaseclass.hxx>
using namespace ::com::sun::star;
-USHORT SwDoc::nUndoActions = UNDO_ACTION_COUNT; // anzahl von Undo-Action
-
// the undo array should never grow beyond this limit:
#define UNDO_ACTION_LIMIT (USHRT_MAX - 1000)
-SV_IMPL_PTRARR( SwUndoIds, SwUndoIdAndNamePtr )
-
-//#define _SHOW_UNDORANGE
-#ifdef _SHOW_UNDORANGE
+// UndoManager ///////////////////////////////////////////////////////////
+namespace sw {
-class UndoArrStatus : public WorkWindow
+UndoManager::UndoManager(::std::auto_ptr<SwNodes> pUndoNodes,
+ IDocumentDrawModelAccess & rDrawModelAccess,
+ IDocumentRedlineAccess & rRedlineAccess,
+ IDocumentState & rState)
+ : m_rDrawModelAccess(rDrawModelAccess)
+ , m_rRedlineAccess(rRedlineAccess)
+ , m_rState(rState)
+ , m_pUndoNodes(pUndoNodes)
+ , m_bGroupUndo(true)
+ , m_bDrawUndo(true)
+ , m_bLockUndoNoModifiedPosition(false)
+ , m_UndoSaveMark(MARK_INVALID)
{
- USHORT nUndo, nUndoNds;
- virtual void Paint( const Rectangle& );
-public:
- UndoArrStatus();
- void Set( USHORT, USHORT );
-};
-static UndoArrStatus* pUndoMsgWin = 0;
-
-
-UndoArrStatus::UndoArrStatus()
- : WorkWindow( APP_GETAPPWINDOW() ), nUndo(0), nUndoNds(0)
-{
- SetSizePixel( Size( 200, 100 ));
- SetFont( Font( "Courier", Size( 0, 10 )) );
- Show();
+ OSL_ASSERT(m_pUndoNodes.get());
+ // writer expects it to be disabled initially
+ // Undo is enabled by SwEditShell constructor
+ SfxUndoManager::EnableUndo(false);
}
-
-void UndoArrStatus::Set( USHORT n1, USHORT n2 )
+SwNodes const& UndoManager::GetUndoNodes() const
{
- nUndo = n1; nUndoNds = n2;
- Invalidate();
+ return *m_pUndoNodes;
}
-
-void UndoArrStatus::Paint( const Rectangle& )
+SwNodes & UndoManager::GetUndoNodes()
{
- String s;
- DrawRect( Rectangle( Point(0,0), GetOutputSize() ));
- ( s = "Undos: " ) += nUndo;
- DrawText( Point( 0, 0 ), s );
- ( s = "UndoNodes: " ) += nUndoNds;
- DrawText( Point( 0, 15 ), s );
+ return *m_pUndoNodes;
}
-#endif
-
-void SwDoc::SetUndoNoResetModified()
+bool UndoManager::IsUndoNodes(SwNodes const& rNodes) const
{
- nUndoSavePos = USHRT_MAX;
+ return & rNodes == m_pUndoNodes.get();
}
-bool SwDoc::IsUndoNoResetModified() const
+void UndoManager::DoUndo(bool const bDoUndo)
{
- return USHRT_MAX == nUndoSavePos;
-}
+ EnableUndo(bDoUndo);
-void SwDoc::DoUndo(bool bUn)
-{
- mbUndo = bUn;
-
- SdrModel* pSdrModel = GetDrawModel();
+ SdrModel *const pSdrModel = m_rDrawModelAccess.GetDrawModel();
if( pSdrModel )
- pSdrModel->EnableUndo(bUn);
+ {
+ pSdrModel->EnableUndo(bDoUndo);
+ }
}
-bool SwDoc::DoesUndo() const
+bool UndoManager::DoesUndo() const
{
- return mbUndo;
+ return IsUndoEnabled();
}
-void SwDoc::DoGroupUndo(bool bUn)
+void UndoManager::DoGroupUndo(bool const bDoUndo)
{
- mbGroupUndo = bUn;
+ m_bGroupUndo = bDoUndo;
}
-bool SwDoc::DoesGroupUndo() const
+bool UndoManager::DoesGroupUndo() const
{
- return mbGroupUndo;
+ return m_bGroupUndo;
}
-sal_uInt16 SwDoc::GetUndoActionCount()
+void UndoManager::DoDrawUndo(bool const bDoUndo)
{
- return nUndoActions;
+ m_bDrawUndo = bDoUndo;
}
-void SwDoc::SetUndoActionCount( sal_uInt16 nNew )
+bool UndoManager::DoesDrawUndo() const
{
- nUndoActions = nNew;
+ return m_bDrawUndo;
}
-const SwNodes* SwDoc::GetUndoNds() const
-{
- return &aUndoNodes;
-}
-void SwDoc::AppendUndo( SwUndo* pUndo )
+bool UndoManager::IsUndoNoResetModified() const
{
- if( nsRedlineMode_t::REDLINE_NONE == pUndo->GetRedlineMode() )
- pUndo->SetRedlineMode( GetRedlineMode() );
-
- // Unfortunately, the silly SvPtrArr can only store a little less than
- // USHRT_MAX elements. Of course it doesn't see any necessity for asserting
- // or even doing error handling. pUndos should definitely be replaced by an
- // STL container that doesn't have this problem. cf #95884#
- DBG_ASSERT( pUndos->Count() < USHRT_MAX - 16,
- "Writer will crash soon. I apologize for the inconvenience." );
-
- pUndos->Insert( pUndo, nUndoPos );
- ++nUndoPos;
- switch( pUndo->GetId() )
- {
- case UNDO_START: ++nUndoSttEnd;
- break;
-
- case UNDO_END: ASSERT( nUndoSttEnd, "Undo-Ende ohne Start" );
- --nUndoSttEnd;
- // kein break !!!
- default:
- if( pUndos->Count() != nUndoPos && UNDO_END != pUndo->GetId() )
- ClearRedo();
- else {
- ASSERT( pUndos->Count() == nUndoPos || UNDO_END == pUndo->GetId(),
- "Redo history not deleted!" );
- }
- if( !nUndoSttEnd )
- ++nUndoCnt;
- break;
- }
-
-#ifdef _SHOW_UNDORANGE
- // zur Anzeige der aktuellen Undo-Groessen
- if( !pUndoMsgWin )
- pUndoMsgWin = new UndoArrStatus;
- pUndoMsgWin->Set( pUndos->Count(), aUndoNodes.Count() );
-#endif
-
- // noch eine offene Klammerung, kann man sich den Rest schenken
- if( nUndoSttEnd )
- return;
-
- // folgende Array-Grenzen muessen ueberwacht werden:
- // - Undo, Grenze: fester Wert oder USHRT_MAX - 1000
- // - UndoNodes, Grenze: USHRT_MAX - 1000
- // - AttrHistory Grenze: USHRT_MAX - 1000
- // (defined in UNDO_ACTION_LIMIT at the top of this file)
-
- USHORT nEnde = UNDO_ACTION_LIMIT;
+ return MARK_INVALID == m_UndoSaveMark;
+}
-// nur zum Testen der neuen DOC-Member
-#ifdef DBG_UTIL
+void UndoManager::SetUndoNoResetModified()
{
- SwUndoId nId = UNDO_EMPTY;
- USHORT nUndosCnt = 0, nSttEndCnt = 0;
- for( USHORT nCnt = 0; nCnt < nUndoPos; ++nCnt )
+ if (MARK_INVALID != m_UndoSaveMark)
{
- if( UNDO_START == ( nId = (*pUndos)[ nCnt ]->GetId()) )
- ++nSttEndCnt;
- else if( UNDO_END == nId )
- --nSttEndCnt;
- if( !nSttEndCnt )
- ++nUndosCnt;
+ RemoveMark(m_UndoSaveMark);
+ m_UndoSaveMark = MARK_INVALID;
}
- ASSERT( nSttEndCnt == nUndoSttEnd, "Start-Ende Count ungleich" );
- ASSERT( nUndosCnt == nUndoCnt, "Undo Count ungleich" );
}
-#endif
- if( SwDoc::nUndoActions < nUndoCnt )
- // immer 1/10 loeschen
- //JP 23.09.95: oder wenn neu eingestellt wurde um die Differenz
- //JP 29.5.2001: Task #83891#: remove only the overlapping actions
- DelUndoObj( nUndoCnt - SwDoc::nUndoActions );
- else
+void UndoManager::SetUndoNoModifiedPosition()
+{
+ if (!m_bLockUndoNoModifiedPosition)
{
- USHORT nUndosCnt = nUndoCnt;
- // immer 1/10 loeschen bis der "Ausloeser" behoben ist
- while( aUndoNodes.Count() && nEnde < aUndoNodes.Count() )
- DelUndoObj( nUndosCnt / 10 );
+ m_UndoSaveMark = MarkTopUndoAction();
}
}
-
-
-void SwDoc::ClearRedo()
+void UndoManager::LockUndoNoModifiedPosition()
{
- if( DoesUndo() && nUndoPos != pUndos->Count() )
- {
-//?? why ?? if( !nUndoSttEnd )
- {
- // setze UndoCnt auf den neuen Wert
- SwUndo* pUndo;
- for( USHORT nCnt = pUndos->Count(); nUndoPos < nCnt; --nUndoCnt )
- // Klammerung ueberspringen
- if( UNDO_END == (pUndo = (*pUndos)[ --nCnt ])->GetId() )
- nCnt = nCnt - ((SwUndoEnd*)pUndo)->GetSttOffset();
- }
-
- // loesche die Undo-Aktionen (immer von hinten !)
- pUndos->DeleteAndDestroy( nUndoPos, pUndos->Count() - nUndoPos );
- }
+ m_bLockUndoNoModifiedPosition = true;
}
-
- // loescht die gesamten UndoObjecte
-void SwDoc::DelAllUndoObj()
+void UndoManager::UnLockUndoNoModifiedPosition()
{
- ClearRedo();
-
- DoUndo( FALSE );
-
- // Offene Undo-Klammerungen erhalten !!
- SwUndo* pUndo;
- USHORT nSize = pUndos->Count();
- while( nSize )
- if( UNDO_START != ( pUndo = (*pUndos)[ --nSize ] )->GetId() ||
- ((SwUndoStart*)pUndo)->GetEndOffset() )
- // keine offenen Gruppierung ?
- pUndos->DeleteAndDestroy( nSize, 1 );
-
- nUndoCnt = 0;
- nUndoPos = pUndos->Count();
-
-/*
- while( nUndoPos )
- aUndos.DelDtor( --nUndoPos, 1 );
- nUndoCnt = nUndoSttEnd = nUndoPos = 0;
-*/
- nUndoSavePos = USHRT_MAX;
- DoUndo( TRUE );
+ m_bLockUndoNoModifiedPosition = false;
}
- // loescht alle UndoObjecte vom Anfang bis zum angegebenen Ende
-BOOL SwDoc::DelUndoObj( USHORT nEnde )
+SwUndo* UndoManager::GetLastUndo()
{
- if( !nEnde ) // sollte mal 0 uebergeben werden,
+ if (!SfxUndoManager::GetUndoActionCount(CurrentLevel))
{
- if( !pUndos->Count() )
- return FALSE;
- ++nEnde; // dann korrigiere es auf 1
+ return 0;
}
-
- DoUndo( FALSE );
-
- // pruefe erstmal, wo das Ende steht
- SwUndoId nId = UNDO_EMPTY;
- USHORT nSttEndCnt = 0;
- USHORT nCnt;
-
- for( nCnt = 0; nEnde && nCnt < nUndoPos; ++nCnt )
- {
- if( UNDO_START == ( nId = (*pUndos)[ nCnt ]->GetId() ))
- ++nSttEndCnt;
- else if( UNDO_END == nId )
- --nSttEndCnt;
- if( !nSttEndCnt )
- --nEnde, --nUndoCnt;
- }
-
- ASSERT( nCnt < nUndoPos || nUndoPos == pUndos->Count(),
- "Undo-Del-Ende liegt in einer Redo-Aktion" );
-
- // dann setze ab Ende bis Undo-Ende bei allen Undo-Objecte die Werte um
- nSttEndCnt = nCnt; // Position merken
- if( nUndoSavePos < nSttEndCnt ) // SavePos wird aufgegeben
- nUndoSavePos = USHRT_MAX;
- else if( nUndoSavePos != USHRT_MAX )
- nUndoSavePos = nUndoSavePos - nSttEndCnt;
-
- while( nSttEndCnt )
- pUndos->DeleteAndDestroy( --nSttEndCnt, 1 );
- nUndoPos = pUndos->Count();
-
- DoUndo( TRUE );
- return TRUE;
+ SfxUndoAction *const pAction( SfxUndoManager::GetUndoAction(0) );
+ return dynamic_cast<SwUndo*>(pAction);
}
-/**************** UNDO ******************/
-
-void SwDoc::setUndoNoModifiedPosition( SwUndoNoModifiedPosition nNew )
-{
- nUndoSavePos = nNew;
- if( !pUndos->Count() || nUndoSavePos > pUndos->Count() - 1 )
- nUndoSavePos = USHRT_MAX;
-}
-
-SwUndoNoModifiedPosition SwDoc::getUndoNoModifiedPosition() const
+void UndoManager::AppendUndo(SwUndo *const pUndo)
{
- return nUndoSavePos;
+ AddUndoAction(pUndo);
}
-
-bool SwDoc::HasUndoId(SwUndoId eId) const
+void UndoManager::ClearRedo()
{
- USHORT nSize = nUndoPos;
- SwUndo * pUndo;
- while( nSize-- )
- if( ( pUndo = (*pUndos)[nSize])->GetId() == eId ||
- ( UNDO_START == pUndo->GetId() &&
- ((SwUndoStart*)pUndo)->GetUserId() == eId )
- || ( UNDO_END == pUndo->GetId() &&
- ((SwUndoEnd*)pUndo)->GetUserId() == eId ) )
- {
- return TRUE;
- }
-
- return FALSE;
+ return SfxUndoManager::ImplClearRedo_NoLock(TopLevel);
}
-
-bool SwDoc::Undo( SwUndoIter& rUndoIter )
+void UndoManager::DelAllUndoObj()
{
- if ( (rUndoIter.GetId()!=0) && (!HasUndoId(rUndoIter.GetId())) )
- {
- rUndoIter.bWeiter = FALSE;
- return FALSE;
- }
- if( !nUndoPos )
- {
- rUndoIter.bWeiter = FALSE;
- return FALSE;
- }
-
- SwUndo *pUndo = (*pUndos)[ --nUndoPos ];
+ ::sw::UndoGuard const undoGuard(*this);
- RedlineMode_t eOld = GetRedlineMode();
- RedlineMode_t eTmpMode = (RedlineMode_t)pUndo->GetRedlineMode();
- if( (nsRedlineMode_t::REDLINE_SHOW_MASK & eTmpMode) != (nsRedlineMode_t::REDLINE_SHOW_MASK & eOld) &&
- UNDO_START != pUndo->GetId() && UNDO_END != pUndo->GetId() )
- SetRedlineMode( eTmpMode );
+ SfxUndoManager::ClearAllLevels();
- SetRedlineMode_intern((RedlineMode_t)(eTmpMode | nsRedlineMode_t::REDLINE_IGNORE));
- // Undo ausfuehren
-
- // zum spaeteren ueberpruefen
- SwUndoId nAktId = pUndo->GetId();
- //JP 11.05.98: FlyFormate ueber die EditShell selektieren, nicht aus dem
- // Undo heraus
- switch( nAktId )
- {
- case UNDO_START:
- case UNDO_END:
- case UNDO_INSDRAWFMT:
- break;
-
- default:
- rUndoIter.ClearSelections();
- }
-
- pUndo->Undo( rUndoIter );
-
- SetRedlineMode( eOld );
-
- // Besonderheit von Undo-Replace (interne History)
- if( UNDO_REPLACE == nAktId && ((SwUndoReplace*)pUndo)->nAktPos )
- {
- ++nUndoPos;
- return TRUE;
- }
-
- // Objekt aus History entfernen und zerstoeren
- if( nUndoPos && !rUndoIter.bWeiter &&
- UNDO_START == ( pUndo = (*pUndos)[ nUndoPos-1 ] )->GetId() )
- --nUndoPos;
-
- // JP 29.10.96: Start und End setzen kein Modify-Flag.
- // Sonst gibt es Probleme mit der autom. Aufnahme von Ausnahmen
- // bei der Autokorrektur
- if( UNDO_START != nAktId && UNDO_END != nAktId )
- SetModified(); // default: immer setzen, kann zurueck gesetzt werden
-
- // ist die History leer und wurde nicht wegen Speichermangel
- // verworfen, so kann das Dokument als unveraendert gelten
- if( nUndoSavePos == nUndoPos )
- ResetModified();
-
- return TRUE;
+ m_UndoSaveMark = MARK_INVALID;
}
-// setzt Undoklammerung auf, liefert nUndoId der Klammerung
-
+/**************** UNDO ******************/
-SwUndoId SwDoc::StartUndo( SwUndoId eUndoId, const SwRewriter * pRewriter )
+SwUndoId
+UndoManager::StartUndo(SwUndoId const i_eUndoId,
+ SwRewriter const*const pRewriter)
{
- if( !mbUndo )
+ if (!IsUndoEnabled())
+ {
return UNDO_EMPTY;
+ }
- if( !eUndoId )
- eUndoId = UNDO_START;
-
- SwUndoStart * pUndo = new SwUndoStart( eUndoId );
+ SwUndoId const eUndoId( (0 == i_eUndoId) ? UNDO_START : i_eUndoId );
+ OSL_ASSERT(UNDO_END != eUndoId);
+ String comment( (UNDO_START == eUndoId)
+ ? String("??", RTL_TEXTENCODING_ASCII_US)
+ : String(SW_RES(UNDO_BASE + eUndoId)) );
if (pRewriter)
- pUndo->SetRewriter(*pRewriter);
+ {
+ OSL_ASSERT(UNDO_START != eUndoId);
+ comment = pRewriter->Apply(comment);
+ }
- AppendUndo(pUndo);
+ SfxUndoManager::EnterListAction(comment, comment, eUndoId);
return eUndoId;
}
-// schliesst Klammerung der nUndoId, nicht vom UI benutzt
-SwUndoId SwDoc::EndUndo(SwUndoId eUndoId, const SwRewriter * pRewriter)
+SwUndoId
+UndoManager::EndUndo(SwUndoId const i_eUndoId, SwRewriter const*const pRewriter)
{
- USHORT nSize = nUndoPos;
- if( !mbUndo || !nSize-- )
- return UNDO_EMPTY;
-
- if( UNDO_START == eUndoId || !eUndoId )
- eUndoId = UNDO_END;
-
- SwUndo* pUndo = (*pUndos)[ nSize ];
- if( UNDO_START == pUndo->GetId() )
+ if (!IsUndoEnabled())
{
- // leere Start/End-Klammerung ??
- pUndos->DeleteAndDestroy( nSize );
- --nUndoPos;
- --nUndoSttEnd;
return UNDO_EMPTY;
}
- // exist above any redo objects? If yes, delete them
- if( nUndoPos != pUndos->Count() )
- {
- // setze UndoCnt auf den neuen Wert
- for( USHORT nCnt = pUndos->Count(); nUndoPos < nCnt; --nUndoCnt )
- // Klammerung ueberspringen
- if( UNDO_END == (pUndo = (*pUndos)[ --nCnt ])->GetId() )
- nCnt = nCnt - ((SwUndoEnd*)pUndo)->GetSttOffset();
-
- pUndos->DeleteAndDestroy( nUndoPos, pUndos->Count() - nUndoPos );
- }
-
- // suche den Anfang dieser Klammerung
- SwUndoId nId = UNDO_EMPTY;
- while( nSize )
- if( UNDO_START == ( nId = (pUndo = (*pUndos)[ --nSize ] )->GetId()) &&
- !((SwUndoStart*)pUndo)->GetEndOffset() )
- break; // Start gefunden
+ SwUndoId const eUndoId( ((0 == i_eUndoId) || (UNDO_START == i_eUndoId))
+ ? UNDO_END : i_eUndoId );
+ OSL_ENSURE(!((UNDO_END == eUndoId) && pRewriter),
+ "EndUndo(): no Undo ID, but rewriter given?");
- if( nId != UNDO_START )
- {
- // kann eigentlich nur beim Abspielen von Macros passieren, die
- // Undo/Redo/Repeat benutzen und die eine exitierende Selection
- // durch Einfuegen loeschen
- ASSERT( !this, "kein entsprechendes Ende gefunden" );
- // kein entsprechenden Start gefunden -> Ende nicht einfuegen
- // und die Member am Doc updaten
-
- nUndoSttEnd = 0;
- nUndoCnt = 0;
- // setze UndoCnt auf den neuen Wert
- SwUndo* pTmpUndo;
- for( USHORT nCnt = 0; nCnt < pUndos->Count(); ++nCnt, ++nUndoCnt )
- // Klammerung ueberspringen
- if( UNDO_START == (pTmpUndo = (*pUndos)[ nCnt ])->GetId() )
- nCnt = nCnt + ((SwUndoStart*)pTmpUndo)->GetEndOffset();
- return UNDO_EMPTY;
+ SfxUndoAction *const pLastUndo(
+ (0 == SfxUndoManager::GetUndoActionCount(CurrentLevel))
+ ? 0 : SfxUndoManager::GetUndoAction(0) );
- }
+ int const nCount = LeaveListAction();
- // Klammerung um eine einzelne Action muss nicht sein!
- // Aussnahme: es ist eine eigene ID definiert
- if( 2 == pUndos->Count() - nSize &&
- (UNDO_END == eUndoId || eUndoId == (*pUndos)[ nSize+1 ]->GetId() ))
+ if (nCount) // otherwise: empty list action not inserted!
{
- pUndos->DeleteAndDestroy( nSize );
- nUndoPos = pUndos->Count();
- if( !--nUndoSttEnd )
+ OSL_ASSERT(pLastUndo);
+ OSL_ASSERT(UNDO_START != eUndoId);
+ SfxUndoAction *const pUndoAction(SfxUndoManager::GetUndoAction(0));
+ SfxListUndoAction *const pListAction(
+ dynamic_cast<SfxListUndoAction*>(pUndoAction));
+ OSL_ASSERT(pListAction);
+ if (pListAction)
{
- ++nUndoCnt;
- if( SwDoc::nUndoActions < nUndoCnt )
- // immer 1/10 loeschen
- //JP 23.09.95: oder wenn neu eingestellt wurde um die Differenz
- //JP 29.5.2001: Task #83891#: remove only the overlapping actions
- DelUndoObj( nUndoCnt - SwDoc::nUndoActions );
+ if (UNDO_END != eUndoId)
+ {
+ OSL_ENSURE(pListAction->GetId() == eUndoId,
+ "EndUndo(): given ID different from StartUndo()");
+ // comment set by caller of EndUndo
+ String comment = String(SW_RES(UNDO_BASE + eUndoId));
+ if (pRewriter)
+ {
+ comment = pRewriter->Apply(comment);
+ }
+ pListAction->SetComment(comment);
+ }
+ else if ((UNDO_START != pListAction->GetId()))
+ {
+ // comment set by caller of StartUndo: nothing to do here
+ }
+ else if (pLastUndo)
+ {
+ // comment was not set at StartUndo or EndUndo:
+ // take comment of last contained action
+ // (note that this works recursively, i.e. the last contained
+ // action may be a list action created by StartUndo/EndUndo)
+ String const comment(pLastUndo->GetComment());
+ pListAction->SetComment(comment);
+ }
else
{
- USHORT nEnde = USHRT_MAX - 1000;
- USHORT nUndosCnt = nUndoCnt;
- // immer 1/10 loeschen bis der "Ausloeser" behoben ist
- while( aUndoNodes.Count() && nEnde < aUndoNodes.Count() )
- DelUndoObj( nUndosCnt / 10 );
+ OSL_ENSURE(false, "EndUndo(): no comment?");
}
}
- return eUndoId;
}
- // setze die Klammerung am Start/End-Undo
- nSize = pUndos->Count() - nSize;
- ((SwUndoStart*)pUndo)->SetEndOffset( nSize );
-
- SwUndoEnd* pUndoEnd = new SwUndoEnd( eUndoId );
- pUndoEnd->SetSttOffset( nSize );
+ return eUndoId;
+}
-// nur zum Testen der Start/End-Verpointerung vom Start/End Undo
-#ifdef DBG_UTIL
+bool
+UndoManager::GetLastUndoInfo(
+ ::rtl::OUString *const o_pStr, SwUndoId *const o_pId) const
+{
+ // this is actually expected to work on the current level,
+ // but that was really not obvious from the previous implementation...
+ if (!SfxUndoManager::GetUndoActionCount(CurrentLevel))
{
- USHORT nEndCnt = 1, nCnt = pUndos->Count();
- SwUndoId nTmpId = UNDO_EMPTY;
- while( nCnt )
- {
- if( UNDO_START == ( nTmpId = (*pUndos)[ --nCnt ]->GetId()) )
- {
- if( !nEndCnt ) // falls mal ein Start ohne Ende vorhanden ist
- continue;
- --nEndCnt;
- if( !nEndCnt ) // hier ist der Anfang
- break;
- }
- else if( UNDO_END == nTmpId )
- ++nEndCnt;
- else if( !nEndCnt )
- break;
- }
- ASSERT( nCnt == pUndos->Count() - nSize,
- "Start-Ende falsch geklammert" );
+ return false;
}
-#endif
- if (pRewriter)
+ SfxUndoAction *const pAction( SfxUndoManager::GetUndoAction(0) );
+
+ if (o_pStr)
{
- ((SwUndoStart *) pUndo)->SetRewriter(*pRewriter);
- pUndoEnd->SetRewriter(*pRewriter);
+ *o_pStr = pAction->GetComment();
+ }
+ if (o_pId)
+ {
+ USHORT const nId(pAction->GetId());
+ *o_pId = static_cast<SwUndoId>(nId);
}
- else
- pUndoEnd->SetRewriter(((SwUndoStart *) pUndo)->GetRewriter());
- AppendUndo( pUndoEnd );
- return eUndoId;
+ return true;
}
-// liefert die Id der letzten Undofaehigen Aktion zurueck oder 0
-// fuellt ggf. VARARR mit User-UndoIds
-
-String SwDoc::GetUndoIdsStr( String* pStr, SwUndoIds *pUndoIds) const
+SwUndoComments_t UndoManager::GetUndoComments() const
{
- String aTmpStr;
+ OSL_ENSURE(!SfxUndoManager::IsInListAction(),
+ "GetUndoComments() called while in list action?");
- if (pStr != NULL)
+ SwUndoComments_t ret;
+ USHORT const nUndoCount(SfxUndoManager::GetUndoActionCount(TopLevel));
+ for (USHORT n = 0; n < nUndoCount; ++n)
{
- GetUndoIds( pStr, pUndoIds);
- aTmpStr = *pStr;
+ ::rtl::OUString const comment(
+ SfxUndoManager::GetUndoActionComment(n, TopLevel));
+ ret.push_back(comment);
}
- else
- GetUndoIds( &aTmpStr, pUndoIds);
- return aTmpStr;
+ return ret;
}
-/*-- 24.11.2004 16:11:21---------------------------------------------------
- -----------------------------------------------------------------------*/
-sal_Bool SwDoc::RestoreInvisibleContent()
+/**************** REDO ******************/
+
+bool UndoManager::GetFirstRedoInfo(::rtl::OUString *const o_pStr) const
{
- sal_Bool bRet = sal_False;
- if(nUndoPos > 0 )
+ if (!SfxUndoManager::GetRedoActionCount(CurrentLevel))
{
- SwUndo * pUndo = (*pUndos)[ nUndoPos - 1 ];
- if( ( pUndo->GetId() == UNDO_END &&
- static_cast<SwUndoEnd *>(pUndo)->GetUserId() == UNDO_UI_DELETE_INVISIBLECNTNT) )
- {
- SwPaM aPam( GetNodes().GetEndOfPostIts() );
- SwUndoIter aUndoIter( &aPam );
- do
- {
- Undo( aUndoIter );
- }
- while ( aUndoIter.IsNextUndo() );
- ClearRedo();
- bRet = sal_True;
- }
+ return false;
}
- return bRet;
-}
-
-
-/**
- Returns id and comment for a certain undo object in an undo stack.
-
- Remark: In the following the object type referred to is always the
- effective object type. If an UNDO_START or UNDO_END has a user type
- it is referred to as this type.
-
- If the queried object is an UNDO_END and has no user id the result
- is taken from the first object that is not an UNDO_END nor an
- UNDO_START preceeding the queried object.
-
- If the queried object is an UNDO_START and has no user id the
- result is taken from the first object that is not an UNDO_END nor
- an UNDO_START preceeding the UNDO_END object belonging to the
- queried object.
- In all other cases the result is taken from the queried object.
-
- @param rUndos the undo stack
- @param nPos position of the undo object to query
-
- @return SwUndoIdAndName object containing the query result
- */
-SwUndoIdAndName * lcl_GetUndoIdAndName(const SwUndos & rUndos, sal_uInt16 nPos )
-{
- SwUndo * pUndo = rUndos[ nPos ];
- SwUndoId nId = UNDO_EMPTY;
- String sStr("??", RTL_TEXTENCODING_ASCII_US);
-
- ASSERT( nPos < rUndos.Count(), "nPos out of range");
-
- switch (pUndo->GetId())
+ if (o_pStr)
{
- case UNDO_START:
- {
- SwUndoStart * pUndoStart = (SwUndoStart *) pUndo;
- nId = pUndoStart->GetUserId();
-
- if (nId <= UNDO_END)
- {
- /**
- Start at the according UNDO_END. Search backwards
- for first objects that is not a UNDO_END.
- */
- int nTmpPos = nPos + pUndoStart->GetEndOffset();
- int nSubstitute = -1;
-
- // --> OD 2009-09-30 #i105457#
- if ( nTmpPos > 0 )
- // <--
- {
- SwUndo * pTmpUndo;
- do
- {
- nTmpPos--;
- pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ];
-
- if (pTmpUndo->GetEffectiveId() > UNDO_END)
- nSubstitute = nTmpPos;
- }
- while (nSubstitute < 0 && nTmpPos > nPos);
-
- if (nSubstitute >= 0)
- {
- SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ];
- nId = pSubUndo->GetEffectiveId();
- sStr = pSubUndo->GetComment();
- }
- }
- }
- else
- sStr = pUndo->GetComment();
- }
-
- break;
-
- case UNDO_END:
- {
- SwUndoEnd * pUndoEnd = (SwUndoEnd *) pUndo;
- nId = pUndoEnd->GetUserId();
-
- if (nId <= UNDO_END)
- {
- /**
- Start at this UNDO_END. Search backwards
- for first objects that is not a UNDO_END.
- */
-
- int nTmpPos = nPos;
- int nUndoStart = nTmpPos - pUndoEnd->GetSttOffset();
- int nSubstitute = -1;
-
- if (nTmpPos > 0)
- {
- SwUndo * pTmpUndo;
-
- do
- {
- nTmpPos--;
- pTmpUndo = rUndos[ static_cast<USHORT>(nTmpPos) ];
-
- if (pTmpUndo->GetEffectiveId() > UNDO_END)
- nSubstitute = nTmpPos;
- }
- while (nSubstitute < 0 && nTmpPos > nUndoStart);
-
- if (nSubstitute >= 0)
- {
- SwUndo * pSubUndo = rUndos[ static_cast<USHORT>(nSubstitute) ];
- nId = pSubUndo->GetEffectiveId();
- sStr = pSubUndo->GetComment();
- }
- }
- }
- else
- sStr = pUndo->GetComment();
- }
-
- break;
-
- default:
- nId = pUndo->GetId();
- sStr = pUndo->GetComment();
+ *o_pStr = SfxUndoManager::GetRedoActionComment(0, CurrentLevel);
}
- return new SwUndoIdAndName(nId, &sStr);
+ return true;
}
-SwUndoId SwDoc::GetUndoIds( String* pStr, SwUndoIds *pUndoIds) const
+
+SwUndoComments_t UndoManager::GetRedoComments() const
{
- int nTmpPos = nUndoPos - 1;
- SwUndoId nId = UNDO_EMPTY;
+ OSL_ENSURE(!SfxUndoManager::IsInListAction(),
+ "GetRedoComments() called while in list action?");
- while (nTmpPos >= 0)
+ SwUndoComments_t ret;
+ USHORT const nRedoCount(SfxUndoManager::GetRedoActionCount(TopLevel));
+ for (USHORT n = 0; n < nRedoCount; ++n)
{
- SwUndo * pUndo = (*pUndos)[ static_cast<USHORT>(nTmpPos) ];
-
- SwUndoIdAndName * pIdAndName = lcl_GetUndoIdAndName( *pUndos, static_cast<sal_uInt16>(nTmpPos) );
-
- if (nTmpPos == nUndoPos - 1)
- {
- nId = pIdAndName->GetUndoId();
-
- if (pStr)
- *pStr = *pIdAndName->GetUndoStr();
- }
-
- if (pUndoIds)
- pUndoIds->Insert(pIdAndName, pUndoIds->Count());
- else
- break;
-
- if (pUndo->GetId() == UNDO_END)
- nTmpPos -= ((SwUndoEnd *) pUndo)->GetSttOffset();
-
- nTmpPos--;
+ ::rtl::OUString const comment(
+ SfxUndoManager::GetRedoActionComment(n, TopLevel));
+ ret.push_back(comment);
}
- return nId;
+ return ret;
}
-bool SwDoc::HasTooManyUndos() const
-{
- // AppendUndo checks the UNDO_ACTION_LIMIT, unless there's a nested undo.
- // So HasTooManyUndos() may only occur when undos are nested; else
- // AppendUndo has some sort of bug.
- DBG_ASSERT( (nUndoSttEnd != 0) || (pUndos->Count() < UNDO_ACTION_LIMIT),
- "non-nested undos should have been handled in AppendUndo" );
- return (pUndos->Count() >= UNDO_ACTION_LIMIT);
-}
-
-
-/**************** REDO ******************/
-
+/**************** REPEAT ******************/
-bool SwDoc::Redo( SwUndoIter& rUndoIter )
+SwUndoId UndoManager::GetRepeatInfo(::rtl::OUString *const o_pStr) const
{
- if( rUndoIter.GetId() && !HasUndoId( rUndoIter.GetId() ) )
+ SwUndoId nRepeatId(UNDO_EMPTY);
+ GetLastUndoInfo(o_pStr, & nRepeatId);
+ if( REPEAT_START <= nRepeatId && REPEAT_END > nRepeatId )
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ return nRepeatId;
}
- if( nUndoPos == pUndos->Count() )
+ if (o_pStr) // not repeatable -> clear comment
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ *o_pStr = String();
}
+ return UNDO_EMPTY;
+}
- SwUndo *pUndo = (*pUndos)[ nUndoPos++ ];
-
- RedlineMode_t eOld = GetRedlineMode();
- RedlineMode_t eTmpMode = (RedlineMode_t)pUndo->GetRedlineMode();
- if( (nsRedlineMode_t::REDLINE_SHOW_MASK & eTmpMode) != (nsRedlineMode_t::REDLINE_SHOW_MASK & eOld) &&
- UNDO_START != pUndo->GetId() && UNDO_END != pUndo->GetId() )
- SetRedlineMode( eTmpMode );
- SetRedlineMode_intern( (RedlineMode_t)(eTmpMode | nsRedlineMode_t::REDLINE_IGNORE));
-
- //JP 11.05.98: FlyFormate ueber die EditShell selektieren, nicht aus dem
- // Undo heraus
- if( UNDO_START != pUndo->GetId() && UNDO_END != pUndo->GetId() )
- rUndoIter.ClearSelections();
-
- pUndo->Redo( rUndoIter );
-
- SetRedlineMode( eOld );
-
- // Besonderheit von Undo-Replace (interne History)
- if( UNDO_REPLACE == pUndo->GetId() &&
- USHRT_MAX != ((SwUndoReplace*)pUndo)->nAktPos )
+SwUndo * UndoManager::RemoveLastUndo()
+{
+ if (SfxUndoManager::GetRedoActionCount(CurrentLevel) ||
+ SfxUndoManager::GetRedoActionCount(TopLevel))
{
- --nUndoPos;
- return TRUE;
+ OSL_ENSURE(false, "RemoveLastUndoAction(): there are Redo actions?");
+ return 0;
}
-
- if( rUndoIter.bWeiter && nUndoPos >= pUndos->Count() )
- rUndoIter.bWeiter = FALSE;
-
- // ist die History leer und wurde nicht wegen Speichermangel
- // verworfen, so kann das Dokument als unveraendert gelten
- if( nUndoSavePos == nUndoPos )
- ResetModified();
- else
- SetModified();
- return TRUE;
+ if (!SfxUndoManager::GetUndoActionCount(CurrentLevel))
+ {
+ OSL_ENSURE(false, "RemoveLastUndoAction(): no Undo actions");
+ return 0;
+ }
+ SfxUndoAction *const pLastUndo(GetUndoAction(0));
+ SfxUndoManager::RemoveLastUndoAction();
+ return dynamic_cast<SwUndo *>(pLastUndo);
}
+// svl::IUndoManager /////////////////////////////////////////////////////
-// liefert die Id der letzten Redofaehigen Aktion zurueck oder 0
-// fuellt ggf. VARARR mit User-RedoIds
-
-String SwDoc::GetRedoIdsStr( String* pStr, SwUndoIds *pRedoIds ) const
+void UndoManager::EnableUndo(bool bEnable)
{
- String aTmpStr;
-
- if (pStr != NULL)
+ // UGLY: SfxUndoManager has a counter to match enable/disable calls
+ // but the writer code expects that a single call switches
+ while (IsUndoEnabled() != bEnable)
{
- GetRedoIds( pStr, pRedoIds );
- aTmpStr = *pStr;
+ SfxUndoManager::EnableUndo(bEnable);
}
- else
- GetRedoIds( &aTmpStr, pRedoIds );
-
-
- return aTmpStr;
}
-
-SwUndoId SwDoc::GetRedoIds( String* pStr, SwUndoIds *pRedoIds ) const
+void UndoManager::AddUndoAction(SfxUndoAction *pAction, sal_Bool bTryMerge)
{
- sal_uInt16 nTmpPos = nUndoPos;
- SwUndoId nId = UNDO_EMPTY;
-
- while (nTmpPos < pUndos->Count())
+ SwUndo *const pUndo( dynamic_cast<SwUndo *>(pAction) );
+ if (pUndo)
{
- SwUndo * pUndo = (*pUndos)[nTmpPos];
-
- SwUndoIdAndName * pIdAndName = lcl_GetUndoIdAndName(*pUndos, nTmpPos);
-
- if (nTmpPos == nUndoPos)
+ if (nsRedlineMode_t::REDLINE_NONE == pUndo->GetRedlineMode())
{
- nId = pIdAndName->GetUndoId();
-
- if (pStr)
- *pStr = *pIdAndName->GetUndoStr();
+ pUndo->SetRedlineMode( m_rRedlineAccess.GetRedlineMode() );
}
-
- if (pRedoIds)
- pRedoIds->Insert(pIdAndName, pRedoIds->Count());
- else
- break;
-
- if (pUndo->GetId() == UNDO_START)
- nTmpPos = nTmpPos + ((SwUndoStart *) pUndo)->GetEndOffset();
-
- nTmpPos++;
}
-
- return nId;
+ SfxUndoManager::AddUndoAction(pAction, bTryMerge);
+ // if the undo nodes array is too large, delete some actions
+ while (UNDO_ACTION_LIMIT < GetUndoNodes().Count())
+ {
+ RemoveOldestUndoActions(1);
+ }
}
-/**************** REPEAT ******************/
-
-
-bool SwDoc::Repeat( SwUndoIter& rUndoIter, sal_uInt16 nRepeatCnt )
+class CursorGuard
{
- if( rUndoIter.GetId() && !HasUndoId( rUndoIter.GetId() ) )
+public:
+ CursorGuard(SwEditShell & rShell, bool const bSave)
+ : m_rShell(rShell)
+ , m_bSaveCursor(bSave)
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ if (m_bSaveCursor)
+ {
+ m_rShell.Push(); // prevent modification of current cursor
+ }
}
- USHORT nSize = nUndoPos;
- if( !nSize )
+ ~CursorGuard()
{
- rUndoIter.bWeiter = FALSE;
- return FALSE;
+ if (m_bSaveCursor)
+ {
+ m_rShell.Pop();
+ }
}
+private:
+ SwEditShell & m_rShell;
+ bool const m_bSaveCursor;
+};
- // dann suche jetzt ueber die End/Start-Gruppen die gueltige Repeat-Aktion
- SwUndo *pUndo = (*pUndos)[ --nSize ];
- if( UNDO_END == pUndo->GetId() )
- nSize = nSize - ((SwUndoEnd*)pUndo)->GetSttOffset();
+bool UndoManager::impl_DoUndoRedo(UndoOrRedo_t const undoOrRedo)
+{
+ SwDoc & rDoc(*GetUndoNodes().GetDoc());
- USHORT nEndCnt = nUndoPos;
- BOOL bOneUndo = nSize + 1 == nUndoPos;
+ UnoActionContext c(& rDoc); // exception-safe StartAllAction/EndAllAction
- SwPaM* pTmpCrsr = rUndoIter.pAktPam;
- SwUndoId nId = UNDO_EMPTY;
+ SwEditShell *const pEditShell( rDoc.GetEditShell() );
- if( pTmpCrsr != pTmpCrsr->GetNext() || !bOneUndo ) // Undo-Klammerung aufbauen
+ OSL_ENSURE(pEditShell, "sw::UndoManager needs a SwEditShell!");
+ if (!pEditShell)
{
- if (pUndo->GetId() == UNDO_END)
- {
- SwUndoStart * pStartUndo =
- (SwUndoStart *) (*pUndos)[nSize];
-
- nId = pStartUndo->GetUserId();
- }
-
- StartUndo( nId, NULL );
+ throw uno::RuntimeException();
}
- do { // dann durchlaufe mal den gesamten Ring
- for( USHORT nRptCnt = nRepeatCnt; nRptCnt > 0; --nRptCnt )
- {
- rUndoIter.pLastUndoObj = 0;
- for( USHORT nCnt = nSize; nCnt < nEndCnt; ++nCnt )
- (*pUndos)[ nCnt ]->Repeat( rUndoIter ); // Repeat ausfuehren
- }
- } while( pTmpCrsr !=
- ( rUndoIter.pAktPam = (SwPaM*)rUndoIter.pAktPam->GetNext() ));
- if( pTmpCrsr != pTmpCrsr->GetNext() || !bOneUndo )
- EndUndo( nId, NULL );
- return TRUE;
-}
+ // in case the model has controllers locked, the Undo should not
+ // change the view cursors!
+ bool const bSaveCursors(pEditShell->CursorsLocked());
+ CursorGuard(*pEditShell, bSaveCursors);
+ if (!bSaveCursors)
+ {
+ // (in case Undo was called via API) clear the cursors:
+ pEditShell->KillPams();
+ pEditShell->SetMark();
+ pEditShell->ClearMark();
+ }
-// liefert die Id der letzten Repeatfaehigen Aktion zurueck oder 0
-// fuellt ggf. VARARR mit User-RedoIds
+ bool bRet(false);
-String SwDoc::GetRepeatIdsStr(String* pStr, SwUndoIds *pRepeatIds) const
-{
- String aTmpStr;
- SwUndoId nId;
+ ::sw::UndoRedoContext context(rDoc, *pEditShell);
- if ( pStr != NULL)
+ // N.B. these may throw!
+ if (UNDO == undoOrRedo)
{
- nId = GetRepeatIds(pStr, pRepeatIds);
- aTmpStr = *pStr;
+ bRet = SfxUndoManager::UndoWithContext(context);
}
else
- nId = GetRepeatIds(&aTmpStr, pRepeatIds);
+ {
+ bRet = SfxUndoManager::RedoWithContext(context);
+ }
- if (nId <= UNDO_END)
- return String();
+ if (bRet)
+ {
+ // if we are at the "last save" position, the document is not modified
+ if (SfxUndoManager::HasTopUndoActionMark(m_UndoSaveMark))
+ {
+ m_rState.ResetModified();
+ }
+ else
+ {
+ m_rState.SetModified();
+ }
+ }
+
+ pEditShell->HandleUndoRedoContext(context);
- return aTmpStr;
+ return bRet;
}
-SwUndoId SwDoc::GetRepeatIds(String* pStr, SwUndoIds *pRepeatIds) const
+sal_Bool UndoManager::Undo()
{
- SwUndoId nRepeatId = GetUndoIds( pStr, pRepeatIds );
- if( REPEAT_START <= nRepeatId && REPEAT_END > nRepeatId )
- return nRepeatId;
- return UNDO_EMPTY;
+ bool const bRet = impl_DoUndoRedo(UNDO);
+ return bRet;
}
+sal_Bool UndoManager::Redo()
+{
+ bool const bRet = impl_DoUndoRedo(REDO);
+ return bRet;
+}
-SwUndo* SwDoc::RemoveLastUndo( SwUndoId eUndoId )
+/** N.B.: this does _not_ call SfxUndoManager::Repeat because it is not
+ possible to wrap a list action around it:
+ calling EnterListAction here will cause SfxUndoManager::Repeat
+ to repeat the list action!
+ */
+bool
+UndoManager::Repeat(::sw::RepeatContext & rContext,
+ sal_uInt16 const nRepeatCount)
{
- SwUndo* pUndo = (*pUndos)[ nUndoPos - 1 ];
- if( eUndoId == pUndo->GetId() && nUndoPos == pUndos->Count() )
+ if (SfxUndoManager::IsInListAction())
{
- if( !nUndoSttEnd )
- --nUndoCnt;
- --nUndoPos;
- pUndos->Remove( nUndoPos, 1 );
+ OSL_ENSURE(false, "repeat in open list action???");
+ return false;
}
- else
+ if (!SfxUndoManager::GetUndoActionCount(TopLevel))
{
- pUndo = 0;
- ASSERT( !this, "falsches Undo-Object" );
+ return false;
+ }
+ SfxUndoAction *const pRepeatAction(GetUndoAction(0));
+ OSL_ASSERT(pRepeatAction);
+ if (!pRepeatAction || !pRepeatAction->CanRepeat(rContext))
+ {
+ return false;
}
- return pUndo;
-}
-SwUndoIdAndName::SwUndoIdAndName( SwUndoId nId, const String* pStr )
- : eUndoId( nId ), pUndoStr( pStr ? new String( *pStr ) : 0 )
-{
-}
+ ::rtl::OUString const comment(pRepeatAction->GetComment());
+ ::rtl::OUString const rcomment(pRepeatAction->GetRepeatComment(rContext));
+ USHORT const nId(pRepeatAction->GetId());
+ if (DoesUndo())
+ {
+ EnterListAction(comment, rcomment, nId);
+ }
-SwUndoIdAndName::~SwUndoIdAndName()
-{
- delete pUndoStr;
-}
+ SwPaM *const pFirstCursor(& rContext.GetRepeatPaM());
+ do { // iterate over ring
+ for (USHORT nRptCnt = nRepeatCount; nRptCnt > 0; --nRptCnt)
+ {
+ pRepeatAction->Repeat(rContext);
+ }
+ rContext.m_bDeleteRepeated = false; // reset for next PaM
+ rContext.m_pCurrentPaM =
+ static_cast<SwPaM*>(rContext.m_pCurrentPaM->GetNext());
+ } while (pFirstCursor != & rContext.GetRepeatPaM());
+ if (DoesUndo())
+ {
+ LeaveListAction();
+ }
+ return true;
+}
+} // namespace sw
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index d9a0cc8514a4..d2844658df0c 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -28,9 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <rolbck.hxx>
+
+#include <tools/resid.hxx>
-#include <hintids.hxx>
#include <svl/itemiter.hxx>
+
+#include <editeng/brkitem.hxx>
+
+#include <hints.hxx>
+#include <hintids.hxx>
#include <fmtftn.hxx>
#include <fchrfmt.hxx>
#include <fmtflcnt.hxx>
@@ -47,6 +54,7 @@
#include <frmfmt.hxx>
#include <ftnidx.hxx>
#include <doc.hxx> // SwDoc.GetNodes()
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <ndtxt.hxx> // SwTxtNode
#include <paratr.hxx> //
@@ -54,19 +62,12 @@
#include <fldbas.hxx> // fuer Felder
#include <pam.hxx> // fuer SwPaM
#include <swtable.hxx>
-#include <rolbck.hxx>
#include <ndgrf.hxx> // SwGrfNode
-#include <undobj.hxx> // fuer UndoDelete
+#include <UndoCore.hxx>
#include <IMark.hxx> // fuer SwBookmark
#include <charfmt.hxx> // #i27615#
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-#include <tools/resid.hxx>
-#ifndef _UNDO_HRC
#include <undo.hrc>
-#endif
-#include <editeng/brkitem.hxx>
#include <bookmrk.hxx>
SV_IMPL_PTRARR( SwpHstry, SwHistoryHintPtr)
@@ -580,9 +581,10 @@ SwHistoryTxtFlyCnt::~SwHistoryTxtFlyCnt()
void SwHistoryTxtFlyCnt::SetInDoc( SwDoc* pDoc, bool )
{
- SwPaM aPam( pDoc->GetNodes().GetEndOfPostIts() );
- SwUndoIter aUndoIter( &aPam );
- m_pUndo->Undo( aUndoIter );
+ ::sw::IShellCursorSupplier *const pISCS(pDoc->GetIShellCursorSupplier());
+ OSL_ASSERT(pISCS);
+ ::sw::UndoRedoContext context(*pDoc, *pISCS);
+ m_pUndo->UndoImpl(context);
}
@@ -626,8 +628,7 @@ SwHistoryBookmark::SwHistoryBookmark(
void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
{
- bool bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo(false);
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodes& rNds = pDoc->GetNodes();
IDocumentMarkAccess* pMarkAccess = pDoc->getIDocumentMarkAccess();
@@ -698,7 +699,6 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
}
}
}
- pDoc->DoUndo(bDoesUndo);
}
@@ -793,8 +793,7 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
{
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ];
if ( pNode->IsCntntNode() )
@@ -815,8 +814,6 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
rFmt.ResetFmtAttr( *m_ResetArray.GetData() );
}
}
-
- pDoc->DoUndo( bDoesUndo );
}
/*************************************************************************/
@@ -879,8 +876,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
{
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwCntntNode * pCntntNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetCntntNode();
ASSERT( pCntntNd, "SwHistoryResetAttrSet: no CntntNode" );
@@ -906,8 +902,6 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
}
}
}
-
- pDoc->DoUndo( bDoesUndo );
}
@@ -927,8 +921,7 @@ SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt )
void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
{
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
USHORT nPos = pDoc->GetSpzFrmFmts()->GetPos( &m_rFmt );
if ( USHRT_MAX != nPos ) // Format does still exist
@@ -956,7 +949,6 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
m_rFmt.SetFmtAttr( aTmp );
}
- pDoc->DoUndo( bDoesUndo );
}
@@ -1276,7 +1268,7 @@ USHORT SwHistory::SetTmpEnd( USHORT nNewTmpEnd )
if ( HSTRY_FLYCNT == (*this)[ n ]->Which() )
{
static_cast<SwHistoryTxtFlyCnt*>((*this)[ n ])
- ->GetUDelLFmt()->Redo();
+ ->GetUDelLFmt()->RedoForRollback();
}
}
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index e3b54c59b142..d1b92a8049e3 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -28,16 +28,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#define _SVSTDARR_USHORTS
#define _SVSTDARR_USHORTSSORT
-#include <hintids.hxx>
-#include <svx/svdmodel.hxx>
-#include <editeng/tstpitem.hxx>
-#include <svx/svdpage.hxx>
+#include <UndoAttribute.hxx>
+
#include <svl/itemiter.hxx>
+#include <editeng/tstpitem.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svdpage.hxx>
+
+#include <hintids.hxx>
#include <fmtflcnt.hxx>
#include <txtftn.hxx>
#include <fmtornt.hxx>
@@ -47,13 +49,16 @@
#include <fmtcntnt.hxx>
#include <ftnidx.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <IShellCursorSupplier.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
#include <swtable.hxx>
#include <swtblfmt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <hints.hxx>
#include <rolbck.hxx>
#include <ndnotxt.hxx>
#include <dcontact.hxx>
@@ -64,9 +69,6 @@
-inline SwDoc& SwUndoIter::GetDoc() const
-{ return *pAktPam->GetDoc(); }
-
// -----------------------------------------------------
SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt )
@@ -194,12 +196,12 @@ SwUndoFmtAttr::~SwUndoFmtAttr()
{
}
-void SwUndoFmtAttr::Undo( SwUndoIter& rUndoIter)
+void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
// OD 2004-10-26 #i35443#
// Important note: <Undo(..)> also called by <ReDo(..)>
- if ( !m_pOldSet.get() || !m_pFmt || !IsFmtInDoc( &rUndoIter.GetDoc() ))
+ if ( !m_pOldSet.get() || !m_pFmt || !IsFmtInDoc( &rContext.GetDoc() ))
return;
// --> OD 2004-10-26 #i35443# - If anchor attribute has been successfull
@@ -208,7 +210,7 @@ void SwUndoFmtAttr::Undo( SwUndoIter& rUndoIter)
bool bAnchorAttrRestored( false );
if ( SFX_ITEM_SET == m_pOldSet->GetItemState( RES_ANCHOR, FALSE ))
{
- bAnchorAttrRestored = RestoreFlyAnchor( rUndoIter );
+ bAnchorAttrRestored = RestoreFlyAnchor(rContext);
if ( bAnchorAttrRestored )
{
// Anchor attribute successfull restored.
@@ -240,7 +242,7 @@ void SwUndoFmtAttr::Undo( SwUndoIter& rUndoIter)
if ( RES_FLYFRMFMT == m_nFmtWhich || RES_DRAWFRMFMT == m_nFmtWhich )
{
- rUndoIter.pSelFmt = static_cast<SwFrmFmt*>(m_pFmt);
+ rContext.SetSelections(static_cast<SwFrmFmt*>(m_pFmt), 0);
}
}
}
@@ -330,49 +332,41 @@ SwFmt* SwUndoFmtAttr::GetFmt( SwDoc& rDoc )
return m_pFmt && IsFmtInDoc( &rDoc ) ? m_pFmt : 0;
}
-void SwUndoFmtAttr::Redo( SwUndoIter& rUndoIter)
+void SwUndoFmtAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
// --> OD 2004-10-26 #i35443# - Because the undo stores the attributes for
// redo, the same code as for <Undo(..)> can be applied for <Redo(..)>
- Undo( rUndoIter );
+ UndoImpl(rContext);
// <--
}
-void SwUndoFmtAttr::Repeat( SwUndoIter& rUndoIter)
+void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
{
if ( !m_pOldSet.get() )
return;
- if ( UNDO_INSFMTATTR == rUndoIter.GetLastUndoId())
- {
- SwUndoFmtAttr* pLast
- = static_cast<SwUndoFmtAttr*>(rUndoIter.pLastUndoObj);
- if (pLast->m_pOldSet.get() && pLast->m_pFmt)
- {
- return;
- }
- }
+ SwDoc & rDoc(rContext.GetDoc());
switch ( m_nFmtWhich )
{
case RES_GRFFMTCOLL:
{
- SwNoTxtNode * pNd = rUndoIter.pAktPam->GetNode()->GetNoTxtNode();
+ SwNoTxtNode *const pNd =
+ rContext.GetRepeatPaM().GetNode()->GetNoTxtNode();
if( pNd )
{
- rUndoIter.GetDoc().SetAttr( m_pFmt->GetAttrSet(),
- *pNd->GetFmtColl() );
+ rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() );
}
}
break;
case RES_TXTFMTCOLL:
{
- SwTxtNode * pNd = rUndoIter.pAktPam->GetNode()->GetTxtNode();
+ SwTxtNode *const pNd =
+ rContext.GetRepeatPaM().GetNode()->GetTxtNode();
if( pNd )
{
- rUndoIter.GetDoc().SetAttr( m_pFmt->GetAttrSet(),
- *pNd->GetFmtColl() );
+ rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() );
}
}
break;
@@ -386,7 +380,8 @@ void SwUndoFmtAttr::Repeat( SwUndoIter& rUndoIter)
// Rahmen steht. Der Weg ist: suche in allen FlyFrmFormaten
// nach dem FlyCntnt-Attribut und teste ob der Cursor in der
// entsprechenden Section liegt.
- SwFrmFmt* pFly = rUndoIter.pAktPam->GetNode()->GetFlyFmt();
+ SwFrmFmt *const pFly =
+ rContext.GetRepeatPaM().GetNode()->GetFlyFmt();
if( pFly )
{
// Bug 43672: es duerfen nicht alle Attribute gesetzt werden!
@@ -396,18 +391,18 @@ void SwUndoFmtAttr::Repeat( SwUndoIter& rUndoIter)
SfxItemSet aTmpSet( m_pFmt->GetAttrSet() );
aTmpSet.ClearItem( RES_CNTNT );
if( aTmpSet.Count() )
- rUndoIter.GetDoc().SetAttr( aTmpSet, *pFly );
+ {
+ rDoc.SetAttr( aTmpSet, *pFly );
+ }
}
else
{
- rUndoIter.GetDoc().SetAttr( m_pFmt->GetAttrSet(), *pFly );
+ rDoc.SetAttr( m_pFmt->GetAttrSet(), *pFly );
}
}
break;
}
}
-
- rUndoIter.pLastUndoObj = this;
}
SwRewriter SwUndoFmtAttr::GetRewriter() const
@@ -477,9 +472,9 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
// Return value indicates, if anchor attribute is restored.
// Note: If anchor attribute is restored, all other existing attributes
// are also restored.
-bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
+bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
SwFlyFrmFmt* pFrmFmt = static_cast<SwFlyFrmFmt*>(m_pFmt);
const SwFmtAnchor& rAnchor =
static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, FALSE ) );
@@ -622,7 +617,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
if( RES_DRAWFRMFMT != pFrmFmt->Which() )
pFrmFmt->MakeFrms();
- rIter.pSelFmt = pFrmFmt;
+ rContext.SetSelections(pFrmFmt, 0);
// --> OD 2004-10-26 #i35443# - anchor attribute restored.
return true;
@@ -650,7 +645,7 @@ SwUndoFmtResetAttr::~SwUndoFmtResetAttr()
{
}
-void SwUndoFmtResetAttr::Undo( SwUndoIter& )
+void SwUndoFmtResetAttr::UndoImpl(::sw::UndoRedoContext &)
{
if ( m_pOldItem.get() )
{
@@ -658,7 +653,7 @@ void SwUndoFmtResetAttr::Undo( SwUndoIter& )
}
}
-void SwUndoFmtResetAttr::Redo( SwUndoIter& )
+void SwUndoFmtResetAttr::RedoImpl(::sw::UndoRedoContext &)
{
if ( m_pOldItem.get() )
{
@@ -689,10 +684,10 @@ SwUndoResetAttr::~SwUndoResetAttr()
{
}
-void SwUndoResetAttr::Undo( SwUndoIter& rUndoIter )
+void SwUndoResetAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
// reset old values
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
m_pHistory->TmpRollback( &rDoc, 0 );
m_pHistory->SetTmpEnd( m_pHistory->Count() );
@@ -707,28 +702,25 @@ void SwUndoResetAttr::Undo( SwUndoIter& rUndoIter )
}
}
- // setze noch den Cursor auf den Undo-Bereich
- SetPaM( rUndoIter );
+ AddUndoRedoPaM(rContext);
}
-void SwUndoResetAttr::Redo( SwUndoIter& rUndoIter )
+void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze Attribut in dem Bereich:
- SetPaM( rUndoIter );
- SwDoc& rDoc = rUndoIter.GetDoc();
- rUndoIter.pLastUndoObj = 0;
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
SvUShortsSort* pIdArr = m_Ids.Count() ? &m_Ids : 0;
switch ( m_nFormatId )
{
case RES_CHRFMT:
- rUndoIter.GetDoc().RstTxtAttrs( *rUndoIter.pAktPam );
+ rDoc.RstTxtAttrs(rPam);
break;
case RES_TXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, FALSE, pIdArr );
+ rDoc.ResetAttrs(rPam, FALSE, pIdArr );
break;
case RES_CONDTXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, TRUE, pIdArr );
+ rDoc.ResetAttrs(rPam, TRUE, pIdArr );
break;
case RES_TXTATR_TOXMARK:
@@ -770,15 +762,11 @@ void SwUndoResetAttr::Redo( SwUndoIter& rUndoIter )
}
break;
}
- rUndoIter.pLastUndoObj = 0;
}
-void SwUndoResetAttr::Repeat( SwUndoIter& rUndoIter )
+void SwUndoResetAttr::RepeatImpl(::sw::RepeatContext & rContext)
{
- if ( (RES_FMT_BEGIN > m_nFormatId) ||
- ( (UNDO_RESETATTR == rUndoIter.GetLastUndoId()) &&
- (m_nFormatId == static_cast<SwUndoResetAttr*>(rUndoIter.pLastUndoObj)
- ->m_nFormatId) ) )
+ if (m_nFormatId < RES_FMT_BEGIN)
{
return;
}
@@ -787,16 +775,15 @@ void SwUndoResetAttr::Repeat( SwUndoIter& rUndoIter )
switch ( m_nFormatId )
{
case RES_CHRFMT:
- rUndoIter.GetDoc().RstTxtAttrs( *rUndoIter.pAktPam );
+ rContext.GetDoc().RstTxtAttrs(rContext.GetRepeatPaM());
break;
case RES_TXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, FALSE, pIdArr );
+ rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, pIdArr);
break;
case RES_CONDTXTFMTCOLL:
- rUndoIter.GetDoc().ResetAttrs( *rUndoIter.pAktPam, TRUE, pIdArr );
+ rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, pIdArr);
break;
}
- rUndoIter.pLastUndoObj = this;
}
@@ -865,29 +852,29 @@ void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, BOOL bIsCntnt )
}
}
-void SwUndoAttr::Undo( SwUndoIter& rUndoIter )
+void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
RemoveIdx( *pDoc );
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) )
{
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
if ( ULONG_MAX != m_nNodeIndex )
{
- rPam.DeleteMark();
- rPam.GetPoint()->nNode = m_nNodeIndex;
- rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSttCntnt );
- rPam.SetMark();
- rPam.GetPoint()->nContent++;
- pDoc->DeleteRedline( rPam, false, USHRT_MAX );
+ aPam.DeleteMark();
+ aPam.GetPoint()->nNode = m_nNodeIndex;
+ aPam.GetPoint()->nContent.Assign( aPam.GetCntntNode(), nSttCntnt );
+ aPam.SetMark();
+ aPam.GetPoint()->nContent++;
+ pDoc->DeleteRedline(aPam, false, USHRT_MAX);
}
else
{
// alle Format-Redlines entfernen, werden ggfs. neu gesetzt
- SetPaM( rUndoIter );
- pDoc->DeleteRedline( rPam, false, nsRedlineType_t::REDLINE_FORMAT );
+ SetPaM(aPam);
+ pDoc->DeleteRedline(aPam, false, nsRedlineType_t::REDLINE_FORMAT);
if ( m_pRedlineSaveData.get() )
{
SetSaveData( *pDoc, *m_pRedlineSaveData );
@@ -904,67 +891,30 @@ void SwUndoAttr::Undo( SwUndoIter& rUndoIter )
m_pHistory->SetTmpEnd( m_pHistory->Count() );
// set cursor onto Undo area
- SetPaM( rUndoIter );
+ AddUndoRedoPaM(rContext);
}
-int lcl_HasEqualItems( const SfxItemSet& rSet1, const SfxItemSet& rSet2 )
+void SwUndoAttr::RepeatImpl(::sw::RepeatContext & rContext)
{
- int nRet = -1;
- SfxItemIter aIter1( rSet1 ), aIter2( rSet2 );
- const SfxPoolItem *pI1 = aIter1.FirstItem(), *pI2 = aIter2.FirstItem();
-
- while( pI1 && pI2 )
- {
- if( pI1->Which() != pI2->Which() ||
- aIter1.IsAtEnd() != aIter2.IsAtEnd() )
- {
- nRet = 0;
- break;
- }
- if( aIter1.IsAtEnd() )
- break;
- pI1 = aIter1.NextItem();
- pI2 = aIter2.NextItem();
- }
- return nRet;
-}
-
-void SwUndoAttr::Repeat( SwUndoIter& rUndoIter )
-{
- if ( UNDO_INSATTR == rUndoIter.GetLastUndoId() )
- {
- SwUndoAttr* pLast = static_cast<SwUndoAttr*>(rUndoIter.pLastUndoObj);
- if ((pLast->m_AttrSet.Count() == m_AttrSet.Count()) &&
- (pLast->m_nInsertFlags == m_nInsertFlags ) &&
- lcl_HasEqualItems( m_AttrSet, pLast->m_AttrSet ))
- {
- return;
- }
- }
-
-
// RefMarks are not repeat capable
if ( SFX_ITEM_SET != m_AttrSet.GetItemState( RES_TXTATR_REFMARK, FALSE ) )
{
- rUndoIter.GetDoc().InsertItemSet( *rUndoIter.pAktPam,
+ rContext.GetDoc().InsertItemSet( rContext.GetRepeatPaM(),
m_AttrSet, m_nInsertFlags );
}
else if ( 1 < m_AttrSet.Count() )
{
SfxItemSet aTmpSet( m_AttrSet );
aTmpSet.ClearItem( RES_TXTATR_REFMARK );
- rUndoIter.GetDoc().InsertItemSet( *rUndoIter.pAktPam,
+ rContext.GetDoc().InsertItemSet( rContext.GetRepeatPaM(),
aTmpSet, m_nInsertFlags );
}
- rUndoIter.pLastUndoObj = this;
}
-void SwUndoAttr::Redo( SwUndoIter& rUndoIter )
+void SwUndoAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze Attribut in dem Bereich:
- SetPaM( rUndoIter );
- SwPaM& rPam = *rUndoIter.pAktPam;
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
if ( m_pRedlineData.get() &&
IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) )
@@ -995,8 +945,6 @@ void SwUndoAttr::Redo( SwUndoIter& rUndoIter )
{
rDoc.InsertItemSet( rPam, m_AttrSet, m_nInsertFlags );
}
-
- rUndoIter.pLastUndoObj = 0;
}
@@ -1096,9 +1044,9 @@ SwUndoDefaultAttr::~SwUndoDefaultAttr()
{
}
-void SwUndoDefaultAttr::Undo( SwUndoIter& rUndoIter)
+void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if ( m_pOldSet.get() )
{
SwUndoFmtAttrHelper aTmp(
@@ -1120,9 +1068,9 @@ void SwUndoDefaultAttr::Undo( SwUndoIter& rUndoIter)
}
}
-void SwUndoDefaultAttr::Redo( SwUndoIter& rUndoIter)
+void SwUndoDefaultAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
- Undo( rUndoIter );
+ UndoImpl(rContext);
}
// -----------------------------------------------------
@@ -1140,34 +1088,31 @@ SwUndoMoveLeftMargin::~SwUndoMoveLeftMargin()
{
}
-void SwUndoMoveLeftMargin::Undo( SwUndoIter& rIter )
+void SwUndoMoveLeftMargin::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
// restore old values
- m_pHistory->TmpRollback( pDoc, 0 );
+ m_pHistory->TmpRollback( & rDoc, 0 );
m_pHistory->SetTmpEnd( m_pHistory->Count() );
- pDoc->DoUndo( bUndo );
- SetPaM( rIter );
+ AddUndoRedoPaM(rContext);
}
-void SwUndoMoveLeftMargin::Redo( SwUndoIter& rIter )
+void SwUndoMoveLeftMargin::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- SetPaM( rIter );
- pDoc->MoveLeftMargin( *rIter.pAktPam, GetId() == UNDO_INC_LEFTMARGIN,
- m_bModulus );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
+
+ rDoc.MoveLeftMargin( rPam,
+ GetId() == UNDO_INC_LEFTMARGIN, m_bModulus );
}
-void SwUndoMoveLeftMargin::Repeat( SwUndoIter& rIter )
+void SwUndoMoveLeftMargin::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- pDoc->MoveLeftMargin( *rIter.pAktPam, GetId() == UNDO_INC_LEFTMARGIN,
+ SwDoc & rDoc = rContext.GetDoc();
+ rDoc.MoveLeftMargin(rContext.GetRepeatPaM(), GetId() == UNDO_INC_LEFTMARGIN,
m_bModulus );
- rIter.pLastUndoObj = this;
}
// -----------------------------------------------------
@@ -1187,35 +1132,30 @@ SwUndoChangeFootNote::~SwUndoChangeFootNote()
{
}
-void SwUndoChangeFootNote::Undo( SwUndoIter& rIter )
+void SwUndoChangeFootNote::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- SetPaM( rIter );
-
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
m_pHistory->TmpRollback( &rDoc, 0 );
m_pHistory->SetTmpEnd( m_pHistory->Count() );
rDoc.GetFtnIdxs().UpdateAllFtn();
- SetPaM( rIter );
- rDoc.DoUndo( bUndo );
+ AddUndoRedoPaM(rContext);
}
-void SwUndoChangeFootNote::Redo( SwUndoIter& rIter )
+void SwUndoChangeFootNote::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rIter );
- rIter.GetDoc().SetCurFtn( *rIter.pAktPam, m_Text, m_nNumber, m_bEndNote );
- SetPaM( rIter );
+ SwDoc & rDoc( rContext.GetDoc() );
+ SwPaM & rPaM = AddUndoRedoPaM(rContext);
+ rDoc.SetCurFtn(rPaM, m_Text, m_nNumber, m_bEndNote);
+ SetPaM(rPaM);
}
-void SwUndoChangeFootNote::Repeat( SwUndoIter& rIter )
+void SwUndoChangeFootNote::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- rDoc.SetCurFtn( *rIter.pAktPam, m_Text, m_nNumber, m_bEndNote );
- rIter.pLastUndoObj = this;
+ SwDoc & rDoc = rContext.GetDoc();
+ rDoc.SetCurFtn( rContext.GetRepeatPaM(), m_Text, m_nNumber, m_bEndNote );
}
@@ -1232,17 +1172,17 @@ SwUndoFootNoteInfo::~SwUndoFootNoteInfo()
{
}
-void SwUndoFootNoteInfo::Undo( SwUndoIter &rIter )
+void SwUndoFootNoteInfo::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwFtnInfo *pInf = new SwFtnInfo( rDoc.GetFtnInfo() );
rDoc.SetFtnInfo( *m_pFootNoteInfo );
m_pFootNoteInfo.reset( pInf );
}
-void SwUndoFootNoteInfo::Redo( SwUndoIter &rIter )
+void SwUndoFootNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwFtnInfo *pInf = new SwFtnInfo( rDoc.GetFtnInfo() );
rDoc.SetFtnInfo( *m_pFootNoteInfo );
m_pFootNoteInfo.reset( pInf );
@@ -1261,17 +1201,17 @@ SwUndoEndNoteInfo::~SwUndoEndNoteInfo()
{
}
-void SwUndoEndNoteInfo::Undo( SwUndoIter &rIter )
+void SwUndoEndNoteInfo::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
rDoc.SetEndNoteInfo( *m_pEndNoteInfo );
m_pEndNoteInfo.reset( pInf );
}
-void SwUndoEndNoteInfo::Redo( SwUndoIter &rIter )
+void SwUndoEndNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc &rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwEndNoteInfo *pInf = new SwEndNoteInfo( rDoc.GetEndNoteInfo() );
rDoc.SetEndNoteInfo( *m_pEndNoteInfo );
m_pEndNoteInfo.reset( pInf );
@@ -1286,10 +1226,10 @@ SwUndoDontExpandFmt::SwUndoDontExpandFmt( const SwPosition& rPos )
{
}
-void SwUndoDontExpandFmt::Undo( SwUndoIter& rIter )
+void SwUndoDontExpandFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+ SwDoc *const pDoc = & rContext.GetDoc();
SwPosition& rPos = *pPam->GetPoint();
rPos.nNode = m_nNodeIndex;
@@ -1298,10 +1238,10 @@ void SwUndoDontExpandFmt::Undo( SwUndoIter& rIter )
}
-void SwUndoDontExpandFmt::Redo( SwUndoIter& rIter )
+void SwUndoDontExpandFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+ SwDoc *const pDoc = & rContext.GetDoc();
SwPosition& rPos = *pPam->GetPoint();
rPos.nNode = m_nNodeIndex;
@@ -1309,10 +1249,10 @@ void SwUndoDontExpandFmt::Redo( SwUndoIter& rIter )
pDoc->DontExpandFmt( rPos );
}
-void SwUndoDontExpandFmt::Repeat( SwUndoIter& rIter )
+void SwUndoDontExpandFmt::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
- pDoc->DontExpandFmt( *pPam->GetPoint() );
+ SwPaM & rPam = rContext.GetRepeatPaM();
+ SwDoc & rDoc = rContext.GetDoc();
+ rDoc.DontExpandFmt( *rPam.GetPoint() );
}
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index b86bdad692ac..52fe406e459b 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -28,22 +28,20 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoBookmark.hxx>
#include "doc.hxx"
#include "docary.hxx"
#include "swundo.hxx" // fuer die UndoIds
#include "pam.hxx"
-#include "undobj.hxx"
+#include <UndoCore.hxx>
#include "IMark.hxx"
#include "rolbck.hxx"
#include "SwRewriter.hxx"
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
-
SwUndoBookmark::SwUndoBookmark( SwUndoId nUndoId,
const ::sw::mark::IMark& rBkmk )
: SwUndo( nUndoId )
@@ -60,7 +58,6 @@ void SwUndoBookmark::SetInDoc( SwDoc* pDoc )
m_pHistoryBookmark->SetInDoc( pDoc, false );
}
-
void SwUndoBookmark::ResetInDoc( SwDoc* pDoc )
{
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
@@ -95,15 +92,13 @@ SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::IMark& rBkmk )
}
-void SwUndoInsBookmark::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsBookmark::UndoImpl(::sw::UndoRedoContext & rContext)
{
- ResetInDoc( &rUndoIter.GetDoc() );
+ ResetInDoc( &rContext.GetDoc() );
}
-
-void SwUndoInsBookmark::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsBookmark::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetInDoc( &rUndoIter.GetDoc() );
+ SetInDoc( &rContext.GetDoc() );
}
-
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index ef39a4e18950..3e1c0988b285 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoDelete.hxx>
#include <hintids.hxx>
#include <unotools/charclass.hxx>
@@ -36,11 +37,12 @@
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <swtable.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <poolfmt.hxx>
#include <mvsave.hxx>
@@ -60,8 +62,6 @@
// using namespace comphelper;
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
// DELETE
/* lcl_MakeAutoFrms has to call MakeFrms for objects bounded "AtChar" ( == AUTO ),
@@ -147,10 +147,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(),
DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) );
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
_DelBookmarks(pStt->nNode, pEnd->nNode);
- pDoc->DoUndo( bDoesUndo );
}
else
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() );
@@ -220,7 +218,7 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
if( bMoveNds ) // sind noch Nodes zu verschieben ?
{
- SwNodes& rNds = (SwNodes&)*pDoc->GetUndoNds();
+ SwNodes& rNds = pDoc->GetUndoManager().GetUndoNodes();
SwNodes& rDocNds = pDoc->GetNodes();
SwNodeRange aRg( rDocNds, nSttNode - nNdDiff,
rDocNds, nEndNode - nNdDiff );
@@ -253,11 +251,9 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
++nReplaceDummy;
SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 );
SwPosition aSplitPos( *pEndTxtNd );
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
pDoc->SplitNode( aSplitPos, false );
rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, TRUE );
- pDoc->DoUndo( bDoesUndo );
aRg.aEnd--;
}
else
@@ -279,11 +275,9 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy )
{
SwNodeRange aMvRg( *pSttTxtNd, 0, *pSttTxtNd, 1 );
SwPosition aSplitPos( *pSttTxtNd );
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
pDoc->SplitNode( aSplitPos, false );
rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, TRUE );
- pDoc->DoUndo( bDoesUndo );
aRg.aStart--;
}
}
@@ -648,11 +642,9 @@ void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos
}
}
-void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc *const pDoc = & rContext.GetDoc();
ULONG nCalcStt = nSttNode - nNdDiff;
@@ -686,7 +678,6 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
else
pInsNd = 0; // Node nicht loeschen !!
- SwNodes* pUNds = (SwNodes*)pDoc->GetUndoNds();
BOOL bNodeMove = 0 != nNode;
if( pEndStr )
@@ -763,7 +754,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
{
SwNodeRange aRange( *pMvStt, 0, *pMvStt, nNode );
SwNodeIndex aCopyIndex( aPos.nNode, -1 );
- pUNds->_Copy( aRange, aPos.nNode );
+ pDoc->GetUndoManager().GetUndoNodes()._Copy( aRange, aPos.nNode );
if( nReplaceDummy )
{
@@ -854,19 +845,14 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter )
if( pRedlSaveData )
SetSaveData( *pDoc, *pRedlSaveData );
- pDoc->DoUndo( bUndo ); // Undo wieder einschalten
- SetPaM( rUndoIter, TRUE );
+ AddUndoRedoPaM(rContext, true);
}
-void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
{
- rUndoIter.SetUpdateAttr( TRUE );
-
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
SwDoc& rDoc = *rPam.GetDoc();
- SetPaM( rPam );
-
if( pRedlSaveData )
{
bool bSuccess = FillSaveData(rPam, *pRedlSaveData, TRUE);
@@ -981,15 +967,16 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
rDoc.DeleteAndJoin( rPam );
}
-void SwUndoDelete::Repeat( SwUndoIter& rUndoIter )
+void SwUndoDelete::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( UNDO_DELETE == rUndoIter.GetLastUndoId() )
+ // this action does not seem idempotent,
+ // so make sure it is only executed once on repeat
+ if (rContext.m_bDeleteRepeated)
return;
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwPaM & rPam = rContext.GetRepeatPaM();
SwDoc& rDoc = *rPam.GetDoc();
- BOOL bGroupUndo = rDoc.DoesGroupUndo();
- rDoc.DoGroupUndo( FALSE );
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
if( !rPam.HasMark() )
{
rPam.SetMark();
@@ -999,8 +986,7 @@ void SwUndoDelete::Repeat( SwUndoIter& rUndoIter )
rDoc.DelFullPara( rPam );
else
rDoc.DeleteAndJoin( rPam );
- rDoc.DoGroupUndo( bGroupUndo );
- rUndoIter.pLastUndoObj = this;
+ rContext.m_bDeleteRepeated = true;
}
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 1a71a705b2fb..0bca86a04d70 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -29,28 +29,26 @@
#include "precompiled_sw.hxx"
+#include <IShellCursorSupplier.hxx>
#include <txtftn.hxx>
#include <fmtanchr.hxx>
#include <ftnidx.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <UndoManager.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <ndnotxt.hxx>
#include <IMark.hxx>
#include <mvsave.hxx>
#include <redline.hxx>
#include <crossrefbookmark.hxx>
-#ifndef _UNDO_HRC
#include <undo.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <docsh.hxx>
class SwRedlineSaveData : public SwUndRng, public SwRedlineData,
@@ -70,20 +68,8 @@ public:
#endif
};
-SV_IMPL_PTRARR( SwUndos, SwUndo*)
SV_IMPL_PTRARR( SwRedlineSaveDatas, SwRedlineSaveDataPtr )
-SwUndoIter::SwUndoIter( SwPaM* pPam, SwUndoId nId )
-{
- nUndoId = nId;
- bWeiter = nId ? TRUE : FALSE;
- bUpdateAttr = FALSE;
- pAktPam = pPam;
- nEndCnt = 0;
- pSelFmt = 0;
- pMarkList = 0;
-}
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
//------------------------------------------------------------
@@ -147,12 +133,15 @@ void SwUndRng::SetPaM( SwPaM & rPam, BOOL bCorrToCntnt ) const
rPam.GetPoint()->nContent.Assign( 0, 0 );
}
-void SwUndRng::SetPaM( SwUndoIter& rIter, BOOL bCorrToCntnt ) const
+SwPaM & SwUndRng::AddUndoRedoPaM(
+ ::sw::UndoRedoContext & rContext, bool bCorrToCntnt) const
{
- if( rIter.pAktPam )
- SetPaM( *rIter.pAktPam, bCorrToCntnt );
+ SwPaM & rPaM( rContext.GetCursorSupplier().CreateNewShellCursor() );
+ SetPaM( rPaM, bCorrToCntnt );
+ return rPaM;
}
+
//------------------------------------------------------------
@@ -201,8 +190,8 @@ void SwUndo::RemoveIdxRel( ULONG nIdx, const SwPosition& rPos )
::PaMCorrRel( aIdx, rPos );
}
-SwUndo::SwUndo( SwUndoId nI )
- : nId(nI), nOrigRedlineMode(nsRedlineMode_t::REDLINE_NONE),
+SwUndo::SwUndo(SwUndoId const nId)
+ : m_nId(nId), nOrigRedlineMode(nsRedlineMode_t::REDLINE_NONE),
bCacheComment(true), pComment(NULL)
{
}
@@ -218,9 +207,89 @@ SwUndo::~SwUndo()
delete pComment;
}
-void SwUndo::Repeat( SwUndoIter& rIter )
+
+class UndoRedoRedlineGuard
+{
+public:
+ UndoRedoRedlineGuard(::sw::UndoRedoContext & rContext, SwUndo & rUndo)
+ : m_rRedlineAccess(rContext.GetDoc())
+ , m_eMode(m_rRedlineAccess.GetRedlineMode())
+ {
+ RedlineMode_t const eTmpMode =
+ static_cast<RedlineMode_t>(rUndo.GetRedlineMode());
+ if ((nsRedlineMode_t::REDLINE_SHOW_MASK & eTmpMode) !=
+ (nsRedlineMode_t::REDLINE_SHOW_MASK & m_eMode))
+ {
+ m_rRedlineAccess.SetRedlineMode( eTmpMode );
+ }
+ m_rRedlineAccess.SetRedlineMode_intern( static_cast<RedlineMode_t>(
+ eTmpMode | nsRedlineMode_t::REDLINE_IGNORE) );
+ }
+ ~UndoRedoRedlineGuard()
+ {
+ m_rRedlineAccess.SetRedlineMode(m_eMode);
+ }
+private:
+ IDocumentRedlineAccess & m_rRedlineAccess;
+ RedlineMode_t const m_eMode;
+};
+
+void SwUndo::Undo()
+{
+ OSL_ENSURE(false, "SwUndo::Undo(): ERROR: must call Undo(context) instead");
+}
+
+void SwUndo::Redo()
+{
+ OSL_ENSURE(false, "SwUndo::Redo(): ERROR: must call Redo(context) instead");
+}
+
+void SwUndo::UndoWithContext(SfxUndoContext & rContext)
+{
+ ::sw::UndoRedoContext *const pContext(
+ dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
+ OSL_ASSERT(pContext);
+ if (!pContext) { return; }
+ UndoRedoRedlineGuard(*pContext, *this);
+ UndoImpl(*pContext);
+}
+
+void SwUndo::RedoWithContext(SfxUndoContext & rContext)
+{
+ ::sw::UndoRedoContext *const pContext(
+ dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
+ OSL_ASSERT(pContext);
+ if (!pContext) { return; }
+ UndoRedoRedlineGuard(*pContext, *this);
+ RedoImpl(*pContext);
+}
+
+void SwUndo::Repeat(SfxRepeatTarget & rContext)
+{
+ ::sw::RepeatContext *const pRepeatContext(
+ dynamic_cast< ::sw::RepeatContext * >(& rContext));
+ OSL_ASSERT(pRepeatContext);
+ if (!pRepeatContext) { return; }
+ RepeatImpl(*pRepeatContext);
+}
+
+BOOL SwUndo::CanRepeat(SfxRepeatTarget & rContext) const
+{
+ ::sw::RepeatContext *const pRepeatContext(
+ dynamic_cast< ::sw::RepeatContext * >(& rContext));
+ OSL_ASSERT(pRepeatContext);
+ if (!pRepeatContext) { return false; }
+ return CanRepeatImpl(*pRepeatContext);
+}
+
+void SwUndo::RepeatImpl( ::sw::RepeatContext & )
{
- rIter.pLastUndoObj = this;
+}
+
+bool SwUndo::CanRepeatImpl( ::sw::RepeatContext & ) const
+{
+// return false;
+ return ((REPEAT_START <= GetId()) && (GetId() < REPEAT_END));
}
String SwUndo::GetComment() const
@@ -231,7 +300,7 @@ String SwUndo::GetComment() const
{
if (! pComment)
{
- pComment = new String(SW_RES(UNDO_BASE + nId));
+ pComment = new String(SW_RES(UNDO_BASE + GetId()));
SwRewriter aRewriter = GetRewriter();
@@ -242,7 +311,7 @@ String SwUndo::GetComment() const
}
else
{
- aResult = String(SW_RES(UNDO_BASE + nId));
+ aResult = String(SW_RES(UNDO_BASE + GetId()));
SwRewriter aRewriter = GetRewriter();
@@ -252,11 +321,6 @@ String SwUndo::GetComment() const
return aResult;
}
-SwUndoId SwUndo::GetEffectiveId() const
-{
- return GetId();
-}
-
SwRewriter SwUndo::GetRewriter() const
{
SwRewriter aResult;
@@ -264,6 +328,7 @@ SwRewriter SwUndo::GetRewriter() const
return aResult;
}
+
//------------------------------------------------------------
SwUndoSaveCntnt::SwUndoSaveCntnt()
@@ -289,13 +354,12 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
SwIndex* pCntIdx, ULONG* pEndNdIdx, xub_StrLen* pEndCntIdx )
{
SwDoc& rDoc = *rPaM.GetDoc();
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
SwNoTxtNode* pCpyNd = rPaM.GetNode()->GetNoTxtNode();
// jetzt kommt das eigentliche Loeschen(Verschieben)
- SwNodes& rNds = (SwNodes&)*rDoc.GetUndoNds();
+ SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes();
SwPosition aPos( pEndNdIdx ? rNds.GetEndOfPostIts()
: rNds.GetEndOfExtras() );
aPos.nNode--;
@@ -371,8 +435,6 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
else
pCntIdx->Assign( 0, 0 );
}
-
- rDoc.DoUndo( bUndo );
}
void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, ULONG nNodeIdx,
@@ -380,12 +442,11 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, ULONG nNodeIdx,
ULONG* pEndNdIdx, xub_StrLen* pEndCntIdx )
{
// jetzt kommt das wiederherstellen
- SwNodes& rNds = (SwNodes&)*rDoc.GetUndoNds();
+ SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes();
if( nNodeIdx == rNds.GetEndOfPostIts().GetIndex() )
return; // nichts gespeichert
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
SwPaM aPaM( rInsPos );
if( pEndNdIdx ) // dann hole aus diesem den Bereich
@@ -440,8 +501,6 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, ULONG nNodeIdx,
else {
ASSERT( FALSE, "was ist es denn nun?" );
}
-
- rDoc.DoUndo( bUndo );
}
// diese beiden Methoden bewegen den Point vom Pam zurueck/vor. Damit
@@ -501,8 +560,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
SwDoc* pDoc = rMark.nNode.GetNode().GetDoc();
- BOOL bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
// 1. Fussnoten
if( nsDelCntntType::DELCNT_FTN & nDelCntntType )
@@ -599,7 +657,8 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
{
if( !pHistory )
pHistory = new SwHistory;
- SwTxtNode* pTxtNd = pDoc->GetNodes()[ pAPos->nNode]->GetTxtNode();
+ SwTxtNode *const pTxtNd =
+ pAPos->nNode.GetNode().GetTxtNode();
SwTxtAttr* const pFlyHnt = pTxtNd->GetTxtAttrForCharAt(
pAPos->nContent.GetIndex());
ASSERT( pFlyHnt, "kein FlyAttribut" );
@@ -813,8 +872,6 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
}
}
-
- pDoc->DoUndo( bDoesUndo );
}
@@ -882,8 +939,8 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
{
// ueberpruefe, ob der Inhalt an der alten Position steht
SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos );
- ASSERT( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
- "Position in irgendeiner Section" );
+ OSL_ENSURE(!aSttIdx.GetNode().GetCntntNode(),
+ "RestoreSection(): Position on content node");
// move den Inhalt aus dem UndoNodes-Array in den Fly
SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( aSttIdx,
@@ -917,128 +974,6 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos
}
}
-// START
-SwUndoStart::SwUndoStart( SwUndoId nInitId )
- : SwUndo( UNDO_START ), nUserId( nInitId ), nEndOffset( 0 )
-{
-}
-
-void SwUndoStart::Undo( SwUndoIter& rUndoIter )
-{
- if( !( --rUndoIter.nEndCnt ) && rUndoIter.bWeiter &&
- ( rUndoIter.GetId() ? ( rUndoIter.GetId() == nUserId ||
- ( UNDO_END == rUndoIter.GetId() && UNDO_START == GetId() )) : TRUE ))
- rUndoIter.bWeiter = FALSE;
-}
-
-void SwUndoStart::Redo( SwUndoIter& rUndoIter )
-{
- rUndoIter.bWeiter = TRUE;
- ++rUndoIter.nEndCnt;
-}
-
-void SwUndoStart::Repeat( SwUndoIter& rUndoIter )
-{
- rUndoIter.bWeiter = FALSE;
-}
-
-String SwUndoStart::GetComment() const
-{
- String sResult;
-
- switch (nUserId)
- {
- case UNDO_START:
- case UNDO_END:
- sResult = String("??", RTL_TEXTENCODING_ASCII_US);
-
- break;
-
- default:
- sResult = String(SW_RES(UNDO_BASE + nUserId));
- sResult = GetRewriter().Apply(sResult);
- }
-
- return sResult;
-}
-
-SwRewriter SwUndoStart::GetRewriter() const
-{
- return mRewriter;
-}
-
-SwUndoId SwUndoStart::GetEffectiveId() const
-{
- return GetUserId();
-}
-
-void SwUndoStart::SetRewriter(const SwRewriter & rRewriter)
-{
- mRewriter = rRewriter;
-}
-
-// END
-SwUndoEnd::SwUndoEnd( SwUndoId nInitId )
- : SwUndo( UNDO_END ), nUserId( nInitId ), nSttOffset( 0 )
-{
-}
-
-void SwUndoEnd::Undo( SwUndoIter& rUndoIter )
-{
- if( rUndoIter.GetId() == GetId() || !rUndoIter.GetId() )
- rUndoIter.bWeiter = TRUE;
- if( rUndoIter.bWeiter )
- ++rUndoIter.nEndCnt;
-}
-
-void SwUndoEnd::Redo( SwUndoIter& rUndoIter )
-{
- if( !( --rUndoIter.nEndCnt ) && rUndoIter.bWeiter &&
- ( rUndoIter.GetId() ? ( rUndoIter.GetId() == nUserId ||
- ( UNDO_END == rUndoIter.GetId() && UNDO_START == GetId() )) : TRUE ))
- rUndoIter.bWeiter = FALSE;
-}
-
-void SwUndoEnd::Repeat( SwUndoIter& rUndoIter )
-{
- rUndoIter.bWeiter = FALSE;
-}
-
-String SwUndoEnd::GetComment() const
-{
- String sResult;
-
- switch (nUserId)
- {
- case UNDO_START:
- case UNDO_END:
- sResult = String("??", RTL_TEXTENCODING_ASCII_US);
-
- break;
- default:
- sResult = SW_RES(UNDO_BASE + nUserId);
- sResult = GetRewriter().Apply(sResult);
- }
-
- return sResult;
-}
-
-void SwUndoEnd::SetRewriter(const SwRewriter & rRewriter)
-{
- mRewriter = rRewriter;
-}
-
-SwUndoId SwUndoEnd::GetEffectiveId() const
-{
- return GetUserId();
-}
-
-SwRewriter SwUndoEnd::GetRewriter() const
-{
- return mRewriter;
-}
-
-/* */
// sicher und setze die RedlineDaten
SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index a0ba635549ac..fe57a900fabf 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -28,16 +28,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <svl/itemiter.hxx>
#include <hintids.hxx>
-#include <svl/itemiter.hxx>
+#include <hints.hxx>
#include <fmtflcnt.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
#include <txtflcnt.hxx>
#include <frmfmt.hxx>
#include <flyfrm.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoDraw.hxx>
#include <rolbck.hxx> // fuer die Attribut History
#include <doc.hxx>
#include <docary.hxx>
@@ -49,10 +51,9 @@
#include <dcontact.hxx>
#include <ndole.hxx>
-// Inline Methode vom UndoIter
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
//---------------------------------------------------------------------
+// SwUndoLayBase /////////////////////////////////////////////////////////
SwUndoFlyBase::SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId )
: SwUndo( nUndoId ), pFrmFmt( pFormat )
@@ -65,9 +66,9 @@ SwUndoFlyBase::~SwUndoFlyBase()
delete pFrmFmt;
}
-void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
+void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
// ins Array wieder eintragen
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
@@ -96,7 +97,7 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
}
else
{
- SwPosition aNewPos( *rUndoIter.pAktPam->GetPoint() );
+ SwPosition aNewPos(pDoc->GetNodes().GetEndOfContent());
aNewPos.nNode = nNdPgPos;
if ((FLY_AS_CHAR == nRndId) || (FLY_AT_CHAR == nRndId))
{
@@ -132,7 +133,9 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
pFrmFmt->MakeFrms();
if( bShowSelFrm )
- rUndoIter.pSelFmt = pFrmFmt;
+ {
+ rContext.SetSelections(pFrmFmt, 0);
+ }
if( GetHistory() )
GetHistory()->Rollback( pDoc );
@@ -199,8 +202,8 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
{
nNdPgPos = pPos->nNode.GetIndex();
nCntPos = pPos->nContent.GetIndex();
- SwTxtNode *pTxtNd = pDoc->GetNodes()[ pPos->nNode ]->GetTxtNode();
- ASSERT( pTxtNd, "Kein Textnode gefunden" );
+ SwTxtNode *const pTxtNd = pPos->nNode.GetNode().GetTxtNode();
+ OSL_ENSURE(pTxtNd, "no Textnode");
SwTxtFlyCnt* const pAttr = static_cast<SwTxtFlyCnt*>(
pTxtNd->GetTxtAttrForCharAt( nCntPos, RES_TXTATR_FLYCNT ) );
// Attribut steht noch im TextNode, loeschen
@@ -234,7 +237,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
rFlyFmts.Remove( rFlyFmts.GetPos( pFrmFmt ));
}
-// ----- Undo-InsertFly ------
+// SwUndoInsLayFmt ///////////////////////////////////////////////////////
SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, ULONG nNodeIdx, xub_StrLen nCntIdx )
: SwUndoFlyBase( pFormat, RES_DRAWFRMFMT == pFormat->Which() ?
@@ -270,52 +273,52 @@ SwUndoInsLayFmt::~SwUndoInsLayFmt()
{
}
-void SwUndoInsLayFmt::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsLayFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
+ SwDoc & rDoc(rContext.GetDoc());
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
if( rCntnt.GetCntntIdx() ) // kein Inhalt
{
bool bRemoveIdx = true;
if( mnCrsrSaveIndexPara > 0 )
{
- SwTxtNode *pNode = rUndoIter.GetDoc().GetNodes()[mnCrsrSaveIndexPara]->GetTxtNode();
+ SwTxtNode *const pNode =
+ rDoc.GetNodes()[mnCrsrSaveIndexPara]->GetTxtNode();
if( pNode )
{
- SwNodeIndex aIdx( rUndoIter.GetDoc().GetNodes(), rCntnt.GetCntntIdx()->GetIndex() );
- SwNodeIndex aEndIdx( rUndoIter.GetDoc().GetNodes(), aIdx.GetNode().EndOfSectionIndex() );
+ SwNodeIndex aIdx( rDoc.GetNodes(),
+ rCntnt.GetCntntIdx()->GetIndex() );
+ SwNodeIndex aEndIdx( rDoc.GetNodes(),
+ aIdx.GetNode().EndOfSectionIndex() );
SwIndex aIndex( pNode, mnCrsrSaveIndexPos );
SwPosition aPos( *pNode, aIndex );
- rUndoIter.GetDoc().CorrAbs( aIdx, aEndIdx, aPos, TRUE );
+ rDoc.CorrAbs( aIdx, aEndIdx, aPos, TRUE );
bRemoveIdx = false;
}
}
if( bRemoveIdx )
- RemoveIdxFromSection( rUndoIter.GetDoc(),
- rCntnt.GetCntntIdx()->GetIndex() );
+ {
+ RemoveIdxFromSection( rDoc, rCntnt.GetCntntIdx()->GetIndex() );
+ }
}
- DelFly( &rUndoIter.GetDoc() );
+ DelFly(& rDoc);
}
-void SwUndoInsLayFmt::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsLayFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- rUndoIter.pLastUndoObj = 0;
- InsFly( rUndoIter );
+ InsFly(rContext);
}
-void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( UNDO_INSLAYFMT == rUndoIter.GetLastUndoId() &&
- pFrmFmt == ((SwUndoInsLayFmt*)rUndoIter.pLastUndoObj)->pFrmFmt )
- return;
-
- SwDoc* pDoc = &rUndoIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
// erfrage und setze den Anker neu
SwFmtAnchor aAnchor( pFrmFmt->GetAnchor() );
if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
(FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
(FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
- SwPosition aPos( *rUndoIter.pAktPam->GetPoint() );
+ SwPosition aPos( *rContext.GetRepeatPaM().GetPoint() );
if (FLY_AT_PARA == aAnchor.GetAnchorId())
{
aPos.nContent.Assign( 0, 0 );
@@ -324,7 +327,8 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
}
else if( FLY_AT_FLY == aAnchor.GetAnchorId() )
{
- const SwStartNode* pSttNd = rUndoIter.pAktPam->GetNode()->FindFlyStartNode();
+ SwStartNode const*const pSttNd =
+ rContext.GetRepeatPaM().GetNode()->FindFlyStartNode();
if( pSttNd )
{
SwPosition aPos( *pSttNd );
@@ -332,23 +336,22 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
}
else
{
- rUndoIter.pLastUndoObj = this;
return ;
}
}
else if (FLY_AT_PAGE == aAnchor.GetAnchorId())
{
- aAnchor.SetPageNum( pDoc->GetRootFrm()->GetCurrPage(
- rUndoIter.pAktPam ));
+ aAnchor.SetPageNum(
+ pDoc->GetRootFrm()->GetCurrPage(& rContext.GetRepeatPaM()) );
}
else {
ASSERT( FALSE, "was fuer ein Anker ist es denn nun?" );
}
SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true );
- rUndoIter.pSelFmt = pFlyFmt;
-
- rUndoIter.pLastUndoObj = this;
+ (void) pFlyFmt;
+//FIXME nobody ever did anything with this selection:
+// rContext.SetSelections(pFlyFmt, 0);
}
// #111827#
@@ -356,7 +359,12 @@ String SwUndoInsLayFmt::GetComment() const
{
String aResult;
- if (! pComment)
+ // HACK: disable caching:
+ // the SfxUndoManager calls GetComment() too early: the pFrmFmt does not
+ // have a SwDrawContact yet, so it will fall back to SwUndo::GetComment(),
+ // which sets pComment to a wrong value.
+// if (! pComment)
+ if (true)
{
/*
If frame format is present and has an SdrObject use the undo
@@ -383,28 +391,37 @@ String SwUndoInsLayFmt::GetComment() const
return aResult;
}
-// ----- Undo-DeleteFly ------
+// SwUndoDelLayFmt ///////////////////////////////////////////////////////
-SwUndoDelLayFmt::SwUndoDelLayFmt( SwFrmFmt* pFormat )
- : SwUndoFlyBase( pFormat, UNDO_DELLAYFMT ), bShowSelFrm( TRUE )
+static SwUndoId
+lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt)
{
- SwDoc* pDoc = pFormat->GetDoc();
- DelFly( pDoc );
-
- SwNodeIndex* pIdx = GetMvSttIdx();
- SwNode* pNd;
- if( 1 == GetMvNodeCnt() && pIdx &&
- ( pNd = (*pDoc->GetUndoNds())[ *pIdx ] )->IsNoTxtNode() )
+ if (RES_DRAWFRMFMT != pFrmFmt->Which())
{
- // dann setze eine andere Undo-ID; Grafik oder OLE
- if( pNd->IsGrfNode() )
- SetId( UNDO_DELGRF );
- else if( pNd->IsOLENode() )
- {
- SetId( UNDO_DELETE );
+ const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "Fly without content" );
+ SwNodeIndex firstNode(*rCntnt.GetCntntIdx(), 1);
+ SwNoTxtNode *const pNoTxtNode(firstNode.GetNode().GetNoTxtNode());
+ if (pNoTxtNode && pNoTxtNode->IsGrfNode())
+ {
+ return UNDO_DELGRF;
+ }
+ else if (pNoTxtNode && pNoTxtNode->IsOLENode())
+ {
+ // surprisingly not UNDO_DELOLE, which does not seem to work
+ return UNDO_DELETE;
}
}
+ return UNDO_DELLAYFMT;
+}
+
+SwUndoDelLayFmt::SwUndoDelLayFmt( SwFrmFmt* pFormat )
+ : SwUndoFlyBase( pFormat, lcl_GetSwUndoId(pFormat) )
+ , bShowSelFrm( TRUE )
+{
+ SwDoc* pDoc = pFormat->GetDoc();
+ DelFly( pDoc );
}
SwRewriter SwUndoDelLayFmt::GetRewriter() const
@@ -418,7 +435,7 @@ SwRewriter SwUndoDelLayFmt::GetRewriter() const
SwNodeIndex* pIdx = GetMvSttIdx();
if( 1 == GetMvNodeCnt() && pIdx)
{
- SwNode * pNd = (*pDoc->GetUndoNds())[ *pIdx ];
+ SwNode *const pNd = & pIdx->GetNode();
if ( pNd->IsNoTxtNode() && pNd->IsOLENode())
{
@@ -432,22 +449,24 @@ SwRewriter SwUndoDelLayFmt::GetRewriter() const
return aRewriter;
}
-void SwUndoDelLayFmt::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelLayFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- InsFly( rUndoIter, bShowSelFrm );
+ InsFly( rContext, bShowSelFrm );
}
-void SwUndoDelLayFmt::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelLayFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
+ SwDoc & rDoc(rContext.GetDoc());
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
if( rCntnt.GetCntntIdx() ) // kein Inhalt
- RemoveIdxFromSection( rUndoIter.GetDoc(),
- rCntnt.GetCntntIdx()->GetIndex() );
+ {
+ RemoveIdxFromSection(rDoc, rCntnt.GetCntntIdx()->GetIndex());
+ }
- DelFly( &rUndoIter.GetDoc() );
+ DelFly(& rDoc);
}
-void SwUndoDelLayFmt::Redo()
+void SwUndoDelLayFmt::RedoForRollback()
{
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
if( rCntnt.GetCntntIdx() ) // kein Inhalt
@@ -457,7 +476,7 @@ void SwUndoDelLayFmt::Redo()
DelFly( pFrmFmt->GetDoc() );
}
-/* */
+// SwUndoSetFlyFmt ///////////////////////////////////////////////////////
SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt )
: SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFmt ), pFrmFmt( &rFlyFmt ),
@@ -533,9 +552,9 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
rAnchor.SetPageNum( nCntnt );
}
-void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter )
+void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
// ist das neue Format noch vorhanden ??
if( USHRT_MAX != rDoc.GetFrmFmts()->GetPos( (const SwFrmFmtPtr)pOldFmt ) )
@@ -603,13 +622,13 @@ void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter )
pFrmFmt->MakeFrms();
}
- rIter.pSelFmt = pFrmFmt;
+ rContext.SetSelections(pFrmFmt, 0);
}
}
-void SwUndoSetFlyFmt::Redo( SwUndoIter& rIter )
+void SwUndoSetFlyFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
// ist das neue Format noch vorhanden ??
if( USHRT_MAX != rDoc.GetFrmFmts()->GetPos( (const SwFrmFmtPtr)pNewFmt ) )
@@ -626,7 +645,7 @@ void SwUndoSetFlyFmt::Redo( SwUndoIter& rIter )
else
rDoc.SetFrmFmtToFly( *pFrmFmt, *pNewFmt, 0 );
- rIter.pSelFmt = pFrmFmt;
+ rContext.SetSelections(pFrmFmt, 0);
}
}
diff --git a/sw/source/core/undo/undoflystrattr.cxx b/sw/source/core/undo/undoflystrattr.cxx
index 23113d6b0d1b..fad07654f6f8 100644
--- a/sw/source/core/undo/undoflystrattr.cxx
+++ b/sw/source/core/undo/undoflystrattr.cxx
@@ -49,7 +49,7 @@ SwUndoFlyStrAttr::~SwUndoFlyStrAttr()
{
}
-void SwUndoFlyStrAttr::Undo( SwUndoIter& )
+void SwUndoFlyStrAttr::UndoImpl(::sw::UndoRedoContext &)
{
switch ( GetId() )
{
@@ -69,7 +69,7 @@ void SwUndoFlyStrAttr::Undo( SwUndoIter& )
}
}
-void SwUndoFlyStrAttr::Redo( SwUndoIter& )
+void SwUndoFlyStrAttr::RedoImpl(::sw::UndoRedoContext &)
{
switch ( GetId() )
{
@@ -89,11 +89,6 @@ void SwUndoFlyStrAttr::Redo( SwUndoIter& )
}
}
-void SwUndoFlyStrAttr::Repeat( SwUndoIter& )
-{
- // no repeat
-}
-
SwRewriter SwUndoFlyStrAttr::GetRewriter() const
{
SwRewriter aResult;
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 980496cfd518..3e20e9e8aef0 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -28,25 +28,30 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoDraw.hxx>
+
#include <rtl/string.h>
#include <rtl/memory.h>
-#include <hintids.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdmark.hxx>
+
+#include <hintids.hxx>
+#include <hints.hxx>
#include <fmtanchr.hxx>
#include <fmtflcnt.hxx>
#include <txtflcnt.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <frame.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <dcontact.hxx>
#include <dview.hxx>
#include <rootfrm.hxx>
@@ -64,8 +69,6 @@ struct SwUndoGroupObjImpl
};
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
// Draw-Objecte
IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
@@ -76,15 +79,15 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
String sComment( pUndo->GetComment() );
#endif
- if( DoesUndo() && !IsNoDrawUndoObj() )
+ if (GetIDocumentUndoRedo().DoesUndo() &&
+ GetIDocumentUndoRedo().DoesDrawUndo())
{
- ClearRedo();
const SdrMarkList* pMarkList = 0;
ViewShell* pSh = GetRootFrm() ? GetRootFrm()->GetCurrShell() : 0;
if( pSh && pSh->HasDrawView() )
pMarkList = &pSh->GetDrawView()->GetMarkedObjectList();
- AppendUndo( new SwSdrUndo( pUndo, pMarkList ) );
+ GetIDocumentUndoRedo().AppendUndo( new SwSdrUndo(pUndo, pMarkList) );
}
else
delete pUndo;
@@ -106,16 +109,16 @@ SwSdrUndo::~SwSdrUndo()
delete pMarkList;
}
-void SwSdrUndo::Undo( SwUndoIter& rUndoIter )
+void SwSdrUndo::UndoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Undo();
- rUndoIter.pMarkList = pMarkList;
+ rContext.SetSelections(0, pMarkList);
}
-void SwSdrUndo::Redo( SwUndoIter& rUndoIter )
+void SwSdrUndo::RedoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Redo();
- rUndoIter.pMarkList = pMarkList;
+ rContext.SetSelections(0, pMarkList);
}
String SwSdrUndo::GetComment() const
@@ -222,7 +225,7 @@ SwUndoDrawGroup::~SwUndoDrawGroup()
delete [] pObjArr;
}
-void SwUndoDrawGroup::Undo( SwUndoIter& )
+void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
{
bDelFmt = FALSE;
@@ -273,7 +276,7 @@ void SwUndoDrawGroup::Undo( SwUndoIter& )
}
}
-void SwUndoDrawGroup::Redo( SwUndoIter& )
+void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
{
bDelFmt = TRUE;
@@ -387,14 +390,14 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup()
delete [] pObjArr;
}
-void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter )
+void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
{
bDelFmt = TRUE;
- // aus dem Array austragen
- SwDoc* pDoc = &rIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
+ // remove from array
for( USHORT n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -439,7 +442,7 @@ void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter )
// <--
}
-void SwUndoDrawUnGroup::Redo( SwUndoIter& )
+void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
{
bDelFmt = FALSE;
@@ -509,7 +512,8 @@ SwUndoDrawUnGroupConnectToLayout::~SwUndoDrawUnGroupConnectToLayout()
{
}
-void SwUndoDrawUnGroupConnectToLayout::Undo( SwUndoIter& )
+void
+SwUndoDrawUnGroupConnectToLayout::UndoImpl(::sw::UndoRedoContext &)
{
for ( std::vector< SdrObject >::size_type i = 0;
i < aDrawFmtsAndObjs.size(); ++i )
@@ -528,7 +532,8 @@ void SwUndoDrawUnGroupConnectToLayout::Undo( SwUndoIter& )
}
}
-void SwUndoDrawUnGroupConnectToLayout::Redo( SwUndoIter& )
+void
+SwUndoDrawUnGroupConnectToLayout::RedoImpl(::sw::UndoRedoContext &)
{
for ( std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >::size_type i = 0;
i < aDrawFmtsAndObjs.size(); ++i )
@@ -570,10 +575,10 @@ SwUndoDrawDelete::~SwUndoDrawDelete()
delete pMarkLst;
}
-void SwUndoDrawDelete::Undo( SwUndoIter &rIter )
+void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
bDelFmt = FALSE;
- SwSpzFrmFmts& rFlyFmts = *rIter.GetDoc().GetSpzFrmFmts();
+ SwSpzFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts();
for( USHORT n = 0; n < pMarkLst->GetMarkCount(); ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -596,13 +601,13 @@ void SwUndoDrawDelete::Undo( SwUndoIter &rIter )
}
// <--
}
- rIter.pMarkList = pMarkLst;
+ rContext.SetSelections(0, pMarkLst);
}
-void SwUndoDrawDelete::Redo( SwUndoIter &rIter )
+void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext)
{
bDelFmt = TRUE;
- SwSpzFrmFmts& rFlyFmts = *rIter.GetDoc().GetSpzFrmFmts();
+ SwSpzFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts();
for( USHORT n = 0; n < pMarkLst->GetMarkCount(); ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx
index e67ec2e9d8c2..29eadf62d572 100644
--- a/sw/source/core/undo/unfmco.cxx
+++ b/sw/source/core/undo/unfmco.cxx
@@ -35,12 +35,10 @@
#include "pam.hxx"
#include "ndtxt.hxx"
-#include "undobj.hxx"
+#include <UndoCore.hxx>
#include "rolbck.hxx"
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
//--------------------------------------------------
@@ -70,51 +68,45 @@ SwUndoFmtColl::~SwUndoFmtColl()
}
-void SwUndoFmtColl::Undo( SwUndoIter& rUndoIter )
+void SwUndoFmtColl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- // die alten Werte wieder zurueck
- pHistory->TmpRollback( &rUndoIter.GetDoc(), 0 );
+ // restore old values
+ pHistory->TmpRollback(& rContext.GetDoc(), 0);
pHistory->SetTmpEnd( pHistory->Count() );
- // setze noch den Cursor auf den Undo-Bereich
- SetPaM( rUndoIter );
+ // create cursor for undo range
+ AddUndoRedoPaM(rContext);
}
-void SwUndoFmtColl::Redo( SwUndoIter& rUndoIter )
+void SwUndoFmtColl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze Attribut in dem Bereich:
- SetPaM( rUndoIter );
- rUndoIter.pLastUndoObj = 0;
-
- Repeat( rUndoIter ); // Collection setzen
+ SwPaM & rPam = AddUndoRedoPaM(rContext);
- rUndoIter.pLastUndoObj = 0;
+ DoSetFmtColl(rContext.GetDoc(), rPam);
}
-
-void SwUndoFmtColl::Repeat( SwUndoIter& rUndoIter )
+void SwUndoFmtColl::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( UNDO_SETFMTCOLL == rUndoIter.GetLastUndoId() &&
- pFmtColl == ((SwUndoFmtColl*)rUndoIter.pLastUndoObj)->pFmtColl )
- return;
+ DoSetFmtColl(rContext.GetDoc(), rContext.GetRepeatPaM());
+}
+void SwUndoFmtColl::DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM)
+{
// es kann nur eine TextFmtColl auf einen Bereich angewendet werden,
// also erfrage auch nur in dem Array
- USHORT nPos = rUndoIter.GetDoc().GetTxtFmtColls()->GetPos(
+ USHORT const nPos = rDoc.GetTxtFmtColls()->GetPos(
(SwTxtFmtColl*)pFmtColl );
- // ist das Format ueberhaupt noch vorhanden?
+ // does the format still exist?
if( USHRT_MAX != nPos )
{
// --> OD 2008-04-15 #refactorlists#
- rUndoIter.GetDoc().SetTxtFmtColl( *rUndoIter.pAktPam,
+ rDoc.SetTxtFmtColl(rPaM,
(SwTxtFmtColl*)pFmtColl,
mbReset,
mbResetListAttrs );
// <--
}
-
- rUndoIter.pLastUndoObj = this;
}
SwRewriter SwUndoFmtColl::GetRewriter() const
@@ -129,3 +121,4 @@ SwRewriter SwUndoFmtColl::GetRewriter() const
return aResult;
}
+
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index dd95d06a34b1..c210bad3212e 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -27,6 +27,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
+#include <UndoInsert.hxx>
+
#include <hintids.hxx>
#include <unotools/charclass.hxx>
#include <sot/storage.hxx>
@@ -38,10 +41,13 @@
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoDelete.hxx>
+#include <UndoAttribute.hxx>
#include <rolbck.hxx>
#include <ndgrf.hxx>
#include <ndole.hxx>
@@ -61,42 +67,6 @@
using namespace ::com::sun::star;
-class _UnReplaceData : private SwUndoSaveCntnt
-{
- String m_sOld, m_sIns;
- ULONG m_nSttNd, m_nEndNd, m_nOffset;
- xub_StrLen m_nSttCnt, m_nEndCnt, m_nSetPos, m_nSelEnd;
- BOOL m_bSplitNext : 1;
- BOOL m_bRegExp : 1;
- // metadata references for paragraph and following para (if m_bSplitNext)
- ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
- ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
-
-public:
- _UnReplaceData( const SwPaM& rPam, const String& rIns, BOOL bRegExp );
- ~_UnReplaceData();
-
- void Undo( SwUndoIter& rIter );
- void Redo( SwUndoIter& rIter );
- void SetEnd( const SwPaM& rPam );
-
- const String & GetOld() const { return m_sOld; }
- const String & GetIns() const { return m_sIns; }
-};
-
-
-SV_IMPL_PTRARR( _UnReplaceDatas, _UnReplaceData* )
-
-//------------------------------------------------------------------
-
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
-// zwei Zugriffs-Funktionen
-inline SwPosition* IterPt( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetPoint(); }
-inline SwPosition* IterMk( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetMark(); }
-
//------------------------------------------------------------
// INSERT
@@ -248,13 +218,13 @@ SwUndoInsert::~SwUndoInsert()
-void SwUndoInsert::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pTmpDoc = &rUndoIter.GetDoc();
+ SwDoc *const pTmpDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
if( bIsAppend )
{
- SwPaM* pPam = rUndoIter.pAktPam;
pPam->GetPoint()->nNode = nNode;
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
@@ -311,24 +281,22 @@ void SwUndoInsert::Undo( SwUndoIter& rUndoIter )
nCntnt = aPaM.GetPoint()->nContent.GetIndex();
}
- // setze noch den Cursor auf den Undo-Bereich
- rUndoIter.pAktPam->DeleteMark();
+ // set cursor to Undo range
+ pPam->DeleteMark();
- IterPt(rUndoIter)->nNode = nNd;
- IterPt(rUndoIter)->nContent.Assign( pTmpDoc->GetNodes()[
- IterPt(rUndoIter)->nNode ]->GetCntntNode(), nCnt );
- // SPoint und GetMark auf der gleichen Position
+ pPam->GetPoint()->nNode = nNd;
+ pPam->GetPoint()->nContent.Assign(
+ pPam->GetPoint()->nNode.GetNode().GetCntntNode(), nCnt );
}
DELETEZ(pUndoTxt);
}
-void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze noch den Cursor auf den Redo-Bereich
- SwPaM* pPam = rUndoIter.pAktPam;
- SwDoc* pTmpDoc = pPam->GetDoc();
+ SwDoc *const pTmpDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
if( bIsAppend )
@@ -356,7 +324,8 @@ void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
else
{
pPam->GetPoint()->nNode = nNode;
- SwCntntNode* pCNd = pTmpDoc->GetNodes()[ pPam->GetPoint()->nNode ]->GetCntntNode();
+ SwCntntNode *const pCNd =
+ pPam->GetPoint()->nNode.GetNode().GetCntntNode();
pPam->GetPoint()->nContent.Assign( pCNd, nCntnt );
if( nLen )
@@ -383,18 +352,18 @@ void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
nCntnt = pPam->GetMark()->nContent.GetIndex();
MovePtForward( *pPam, bMvBkwrd );
- rUndoIter.pAktPam->Exchange();
+ pPam->Exchange();
if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
{
RedlineMode_t eOld = pTmpDoc->GetRedlineMode();
pTmpDoc->SetRedlineMode_intern((RedlineMode_t)(eOld & ~nsRedlineMode_t::REDLINE_IGNORE));
pTmpDoc->AppendRedline( new SwRedline( *pRedlData,
- *rUndoIter.pAktPam ), true);
+ *pPam ), true);
pTmpDoc->SetRedlineMode_intern( eOld );
}
else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) &&
pTmpDoc->GetRedlineTbl().Count() )
- pTmpDoc->SplitRedline( *rUndoIter.pAktPam );
+ pTmpDoc->SplitRedline(*pPam);
}
}
@@ -402,13 +371,12 @@ void SwUndoInsert::Redo( SwUndoIter& rUndoIter )
}
-void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.pLastUndoObj = this;
if( !nLen )
return;
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aNd( rDoc.GetNodes(), nNode );
SwCntntNode* pCNd = aNd.GetNode().GetCntntNode();;
@@ -426,15 +394,15 @@ void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
{
case ND_TEXTNODE:
if( bIsAppend )
- rDoc.AppendTxtNode( *rUndoIter.pAktPam->GetPoint() );
+ {
+ rDoc.AppendTxtNode( *rContext.GetRepeatPaM().GetPoint() );
+ }
else
{
String aTxt( ((SwTxtNode*)pCNd)->GetTxt() );
- BOOL bGroupUndo = rDoc.DoesGroupUndo();
- rDoc.DoGroupUndo( FALSE );
- rDoc.InsertString( *rUndoIter.pAktPam,
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
+ rDoc.InsertString( rContext.GetRepeatPaM(),
aTxt.Copy( nCntnt - nLen, nLen ) );
- rDoc.DoGroupUndo( bGroupUndo );
}
break;
case ND_GRFNODE:
@@ -444,7 +412,7 @@ void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
if( pGrfNd->IsGrfLink() )
pGrfNd->GetFileFilterNms( &sFile, &sFilter );
- rDoc.Insert( *rUndoIter.pAktPam, sFile, sFilter,
+ rDoc.Insert( rContext.GetRepeatPaM(), sFile, sFilter,
&pGrfNd->GetGrf(),
0/* Grafik-Collection*/, NULL, NULL );
}
@@ -464,7 +432,10 @@ void SwUndoInsert::Repeat( SwUndoIter& rUndoIter )
if ( aCnt.StoreEmbeddedObject( rSwOLE.GetOleRef(), aName, sal_True ) )
{
uno::Reference < embed::XEmbeddedObject > aNew = aCnt.GetEmbeddedObject( aName );
- rDoc.Insert( *rUndoIter.pAktPam, svt::EmbeddedObjectRef( aNew, ((SwOLENode*)pCNd)->GetAspect() ), NULL, NULL, NULL );
+ rDoc.Insert( rContext.GetRepeatPaM(),
+ svt::EmbeddedObjectRef( aNew,
+ static_cast<SwOLENode*>(pCNd)->GetAspect() ),
+ NULL, NULL, NULL );
}
break;
@@ -504,82 +475,85 @@ SwRewriter SwUndoInsert::GetRewriter() const
}
-/* */
+// SwUndoReplace /////////////////////////////////////////////////////////
-SwUndoReplace::SwUndoReplace()
- : SwUndo( UNDO_REPLACE ), nAktPos( USHRT_MAX )
-{
-}
-SwUndoReplace::~SwUndoReplace()
+class SwUndoReplace::Impl
+ : private SwUndoSaveCntnt
{
-}
+ ::rtl::OUString m_sOld;
+ ::rtl::OUString m_sIns;
+ ULONG m_nSttNd, m_nEndNd, m_nOffset;
+ xub_StrLen m_nSttCnt, m_nEndCnt, m_nSetPos, m_nSelEnd;
+ bool m_bSplitNext : 1;
+ bool m_bRegExp : 1;
+ // metadata references for paragraph and following para (if m_bSplitNext)
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
+ ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
-void SwUndoReplace::Undo( SwUndoIter& rUndoIter )
-{
- // war dieses nicht die letze Undo-Aktion, dann setze den
- // Count neu
- if( rUndoIter.pLastUndoObj != this )
+public:
+ Impl(SwPaM const& rPam, ::rtl::OUString const& rIns, bool const bRegExp);
+ virtual ~Impl()
{
- nAktPos = aArr.Count();
- rUndoIter.pLastUndoObj = this;
- bOldIterFlag = rUndoIter.bWeiter;
- rUndoIter.bWeiter = TRUE;
}
- aArr[ --nAktPos ]->Undo( rUndoIter );
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
- if( !nAktPos ) // alten Status wieder zurueck
- rUndoIter.bWeiter = bOldIterFlag;
-}
+ void SetEnd(SwPaM const& rPam);
+
+ ::rtl::OUString const& GetOld() const { return m_sOld; }
+ ::rtl::OUString const& GetIns() const { return m_sIns; }
+};
-void SwUndoReplace::Redo( SwUndoIter& rUndoIter )
+SwUndoReplace::SwUndoReplace(SwPaM const& rPam,
+ ::rtl::OUString const& rIns, bool const bRegExp)
+ : SwUndo( UNDO_REPLACE )
+ , m_pImpl(new Impl(rPam, rIns, bRegExp))
{
- // war dieses nicht die letze Undo-Aktion, dann setze den
- // Count neu
- if( rUndoIter.pLastUndoObj != this )
- {
- ASSERT( !nAktPos, "Redo ohne vorheriges Undo??" );
- rUndoIter.pLastUndoObj = this;
- bOldIterFlag = rUndoIter.bWeiter;
- rUndoIter.bWeiter = TRUE;
- }
+}
- aArr[ nAktPos ]->Redo( rUndoIter );
+SwUndoReplace::~SwUndoReplace()
+{
+}
- if( ++nAktPos >= aArr.Count() ) // alten Status wieder zurueck
- {
- nAktPos = USHRT_MAX;
- rUndoIter.bWeiter = bOldIterFlag;
- }
+void SwUndoReplace::UndoImpl(::sw::UndoRedoContext & rContext)
+{
+ m_pImpl->UndoImpl(rContext);
}
-// #111827#
-SwRewriter SwUndoReplace::GetRewriter() const
+void SwUndoReplace::RedoImpl(::sw::UndoRedoContext & rContext)
+{
+ m_pImpl->RedoImpl(rContext);
+}
+
+SwRewriter
+MakeUndoReplaceRewriter(ULONG const occurrences,
+ ::rtl::OUString const& sOld, ::rtl::OUString const& sNew)
{
SwRewriter aResult;
- if (aArr.Count() > 1)
+ if (1 < occurrences)
{
- aResult.AddRule(UNDO_ARG1, String::CreateFromInt32(aArr.Count()));
+ aResult.AddRule(UNDO_ARG1, String::CreateFromInt32(occurrences));
aResult.AddRule(UNDO_ARG2, String(SW_RES(STR_OCCURRENCES_OF)));
String aTmpStr;
aTmpStr += String(SW_RES(STR_START_QUOTE));
- aTmpStr += ShortenString(aArr[0]->GetOld(), nUndoStringLength,
+ aTmpStr += ShortenString(sOld, nUndoStringLength,
SW_RES(STR_LDOTS));
aTmpStr += String(SW_RES(STR_END_QUOTE));
aResult.AddRule(UNDO_ARG3, aTmpStr);
}
- else if (aArr.Count() == 1)
+ else if (1 == occurrences)
{
{
String aTmpStr;
aTmpStr += String(SW_RES(STR_START_QUOTE));
// #i33488 #
- aTmpStr += ShortenString(aArr[0]->GetOld(), nUndoStringLength,
+ aTmpStr += ShortenString(sOld, nUndoStringLength,
SW_RES(STR_LDOTS));
aTmpStr += String(SW_RES(STR_END_QUOTE));
aResult.AddRule(UNDO_ARG1, aTmpStr);
@@ -592,7 +566,7 @@ SwRewriter SwUndoReplace::GetRewriter() const
aTmpStr += String(SW_RES(STR_START_QUOTE));
// #i33488 #
- aTmpStr += ShortenString(aArr[0]->GetIns(), nUndoStringLength,
+ aTmpStr += ShortenString(sNew, nUndoStringLength,
SW_RES(STR_LDOTS));
aTmpStr += String(SW_RES(STR_END_QUOTE));
aResult.AddRule(UNDO_ARG3, aTmpStr);
@@ -602,24 +576,23 @@ SwRewriter SwUndoReplace::GetRewriter() const
return aResult;
}
-void SwUndoReplace::AddEntry( const SwPaM& rPam, const String& rInsert,
- BOOL bRegExp )
+// #111827#
+SwRewriter SwUndoReplace::GetRewriter() const
{
- _UnReplaceData* pNew = new _UnReplaceData( rPam, rInsert, bRegExp );
- aArr.C40_INSERT(_UnReplaceData, pNew, aArr.Count() );
+ return MakeUndoReplaceRewriter(1, m_pImpl->GetOld(), m_pImpl->GetIns());
}
-void SwUndoReplace::SetEntryEnd( const SwPaM& rPam )
+void SwUndoReplace::SetEnd(SwPaM const& rPam)
{
- _UnReplaceData* pEntry = aArr[ aArr.Count()-1 ];
- pEntry->SetEnd( rPam );
+ m_pImpl->SetEnd(rPam);
}
-_UnReplaceData::_UnReplaceData( const SwPaM& rPam, const String& rIns,
- BOOL bRgExp )
- : m_sIns( rIns ), m_nOffset( 0 )
+SwUndoReplace::Impl::Impl(
+ SwPaM const& rPam, ::rtl::OUString const& rIns, bool const bRegExp)
+ : m_sIns( rIns )
+ , m_nOffset( 0 )
+ , m_bRegExp(bRegExp)
{
- m_bRegExp = bRgExp;
const SwPosition * pStt( rPam.Start() );
const SwPosition * pEnd( rPam.End() );
@@ -673,14 +646,10 @@ _UnReplaceData::_UnReplaceData( const SwPaM& rPam, const String& rIns,
m_sOld = pNd->GetTxt().Copy( m_nSttCnt, nECnt - m_nSttCnt );
}
-_UnReplaceData::~_UnReplaceData()
-{
-}
-
-void _UnReplaceData::Undo( SwUndoIter& rIter )
+void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
- SwPaM& rPam = *rIter.pAktPam;
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM & rPam(rContext.GetCursorSupplier().CreateNewShellCursor());
rPam.DeleteMark();
SwTxtNode* pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTxtNode();
@@ -689,18 +658,18 @@ void _UnReplaceData::Undo( SwUndoIter& rIter )
SwAutoCorrExceptWord* pACEWord = pDoc->GetAutoCorrExceptWord();
if( pACEWord )
{
- if( 1 == m_sIns.Len() && 1 == m_sOld.Len() )
+ if ((1 == m_sIns.getLength()) && (1 == m_sOld.getLength()))
{
SwPosition aPos( *pNd ); aPos.nContent.Assign( pNd, m_nSttCnt );
- pACEWord->CheckChar( aPos, m_sOld.GetChar( 0 ) );
+ pACEWord->CheckChar( aPos, m_sOld[ 0 ] );
}
pDoc->SetAutoCorrExceptWord( 0 );
}
- SwIndex aIdx( pNd, m_nSttCnt );
+ SwIndex aIdx( pNd, USHORT( m_nSttCnt ) );
if( m_nSttNd == m_nEndNd )
{
- pNd->EraseText( aIdx, m_sIns.Len() );
+ pNd->EraseText( aIdx, USHORT( m_sIns.getLength() ) );
}
else
{
@@ -728,7 +697,7 @@ void _UnReplaceData::Undo( SwUndoIter& rIter )
pNd->RestoreMetadata(m_pMetadataUndoStart);
}
- if( m_sOld.Len() )
+ if (m_sOld.getLength())
{
pNd->InsertText( m_sOld, aIdx );
}
@@ -762,13 +731,10 @@ void _UnReplaceData::Undo( SwUndoIter& rIter )
rPam.GetPoint()->nContent = aIdx;
}
-void _UnReplaceData::Redo( SwUndoIter& rIter )
+void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
-
- SwPaM& rPam = *rIter.pAktPam;
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam(rContext.GetCursorSupplier().CreateNewShellCursor());
rPam.DeleteMark();
rPam.GetPoint()->nNode = m_nSttNd;
@@ -805,21 +771,21 @@ void _UnReplaceData::Redo( SwUndoIter& rIter )
rDoc.ReplaceRange( rPam, m_sIns, m_bRegExp );
rPam.DeleteMark();
- rDoc.DoUndo( bUndo );
}
-void _UnReplaceData::SetEnd( const SwPaM& rPam )
+void SwUndoReplace::Impl::SetEnd(SwPaM const& rPam)
{
if( rPam.GetPoint()->nNode != rPam.GetMark()->nNode )
{
- // es wurden mehrere Absaetze eingefuegt
+ // multiple paragraphs were inserted
const SwPosition* pEnd = rPam.End();
m_nEndNd = m_nOffset + pEnd->nNode.GetIndex();
m_nEndCnt = pEnd->nContent.GetIndex();
}
}
-/* */
+
+// SwUndoReRead //////////////////////////////////////////////////////////
SwUndoReRead::SwUndoReRead( const SwPaM& rPam, const SwGrfNode& rGrfNd )
@@ -837,9 +803,9 @@ SwUndoReRead::~SwUndoReRead()
}
-void SwUndoReRead::SetAndSave( SwUndoIter& rIter )
+void SwUndoReRead::SetAndSave(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwGrfNode* pGrfNd = rDoc.GetNodes()[ nPos ]->GetGrfNode();
if( !pGrfNd )
@@ -867,19 +833,19 @@ void SwUndoReRead::SetAndSave( SwUndoIter& rIter )
if( RES_MIRROR_GRAPH_DONT != nOldMirr )
pGrfNd->SetAttr( SwMirrorGrf() );
- rIter.pSelFmt = pGrfNd->GetFlyFmt();
+ rContext.SetSelections(pGrfNd->GetFlyFmt(), 0);
}
-void SwUndoReRead::Undo( SwUndoIter& rIter )
+void SwUndoReRead::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SetAndSave( rIter );
+ SetAndSave(rContext);
}
-void SwUndoReRead::Redo( SwUndoIter& rIter )
+void SwUndoReRead::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetAndSave( rIter );
+ SetAndSave(rContext);
}
@@ -938,9 +904,9 @@ SwUndoInsertLabel::~SwUndoInsertLabel()
delete NODE.pUndoInsNd;
}
-void SwUndoInsertLabel::Undo( SwUndoIter& rIter )
+void SwUndoInsertLabel::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
@@ -952,8 +918,8 @@ void SwUndoInsertLabel::Undo( SwUndoIter& rIter )
( LTYPE_DRAW != eType ||
0 != (pSdrObj = pFmt->FindSdrObject()) ) )
{
- OBJECT.pUndoAttr->Undo( rIter );
- OBJECT.pUndoFly->Undo( rIter );
+ OBJECT.pUndoAttr->UndoImpl(rContext);
+ OBJECT.pUndoFly->UndoImpl(rContext);
if( LTYPE_DRAW == eType )
{
pSdrObj->SetLayer( nLayerId );
@@ -969,7 +935,7 @@ void SwUndoInsertLabel::Undo( SwUndoIter& rIter )
if ( pNd )
pNd->GetTable().GetFrmFmt()->ResetFmtAttr( RES_KEEP );
}
- SwPaM aPam( *rIter.pAktPam->GetPoint() );
+ SwPaM aPam( rDoc.GetNodes().GetEndOfContent() );
aPam.GetPoint()->nNode = NODE.nNode;
aPam.SetMark();
aPam.GetPoint()->nNode = NODE.nNode + 1;
@@ -978,9 +944,9 @@ void SwUndoInsertLabel::Undo( SwUndoIter& rIter )
}
-void SwUndoInsertLabel::Redo( SwUndoIter& rIter )
+void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
@@ -992,8 +958,8 @@ void SwUndoInsertLabel::Redo( SwUndoIter& rIter )
( LTYPE_DRAW != eType ||
0 != (pSdrObj = pFmt->FindSdrObject()) ) )
{
- OBJECT.pUndoFly->Redo( rIter );
- OBJECT.pUndoAttr->Redo( rIter );
+ OBJECT.pUndoFly->RedoImpl(rContext);
+ OBJECT.pUndoAttr->RedoImpl(rContext);
if( LTYPE_DRAW == eType )
{
pSdrObj->SetLayer( nLayerId );
@@ -1014,15 +980,15 @@ void SwUndoInsertLabel::Redo( SwUndoIter& rIter )
if ( pNd )
pNd->GetTable().GetFrmFmt()->SetFmtAttr( SvxFmtKeepItem(TRUE, RES_KEEP) );
}
- NODE.pUndoInsNd->Undo( rIter );
+ NODE.pUndoInsNd->UndoImpl(rContext);
delete NODE.pUndoInsNd, NODE.pUndoInsNd = 0;
}
}
-void SwUndoInsertLabel::Repeat( SwUndoIter& rIter )
+void SwUndoInsertLabel::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
- const SwPosition& rPos = *rIter.pAktPam->GetPoint();
+ SwDoc & rDoc = rContext.GetDoc();
+ const SwPosition& rPos = *rContext.GetRepeatPaM().GetPoint();
ULONG nIdx = 0;
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 4c5fbca4085c..49155827b473 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -28,17 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoSplitMove.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
// MOVE
SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
@@ -79,7 +79,8 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
pHistory->CopyFmtAttr( *pEndTxtNd->GetpSwAttrSet(), nEndNode );
}
- if( 0 != (pTxtNd = rRange.GetDoc()->GetNodes()[ rMvPos.nNode ]->GetTxtNode() ))
+ pTxtNd = rMvPos.nNode.GetNode().GetTxtNode();
+ if (0 != pTxtNd)
{
pHistory->Add( pTxtNd->GetTxtColl(), nMvDestNode, ND_TEXTNODE );
if ( pTxtNd->GetpSwpHints() )
@@ -187,11 +188,9 @@ void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
}
-void SwUndoMove::Undo( SwUndoIter& rUndoIter )
+void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc *const pDoc = & rContext.GetDoc();
// Block, damit aus diesem gesprungen werden kann
do {
@@ -276,18 +275,18 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter )
pHistory->SetTmpEnd( pHistory->Count() );
}
- pDoc->DoUndo( bUndo );
-
// setze noch den Cursor auf den Undo-Bereich
if( !bMoveRange )
- SetPaM( rUndoIter );
+ {
+ AddUndoRedoPaM(rContext);
+ }
}
-void SwUndoMove::Redo( SwUndoIter& rUndoIter )
+void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rUndoIter.pAktPam;
- SwDoc& rDoc = *pPam->GetDoc();
+ SwPaM *const pPam = & AddUndoRedoPaM(rContext);
+ SwDoc & rDoc = rContext.GetDoc();
SwNodes& rNds = rDoc.GetNodes();
SwNodeIndex aIdx( rNds, nMvDestNode );
diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index 8cf782e85b53..121f4e5b9210 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -28,21 +28,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoNumbering.hxx>
#include <hintids.hxx>
#include <editeng/lrspitem.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
SV_DECL_PTRARR_DEL( _SfxPoolItems, SfxPoolItem*, 16, 16 )
SV_IMPL_PTRARR( _SfxPoolItems, SfxPoolItem* );
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
SwUndoInsNum::SwUndoInsNum( const SwNumRule& rOldRule,
const SwNumRule& rNewRule,
@@ -87,14 +88,9 @@ SwRewriter SwUndoInsNum::GetRewriter() const
return aResult;
}
-void SwUndoInsNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- if( nSttNode )
- SetPaM( rUndoIter );
-
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
if( pOldNumRule )
rDoc.ChgNumRuleFmts( *pOldNumRule );
@@ -134,29 +130,31 @@ void SwUndoInsNum::Undo( SwUndoIter& rUndoIter )
pHistory->SetTmpEnd( pHistory->Count() );
}
- if( nSttNode )
- SetPaM( rUndoIter );
- rDoc.DoUndo( bUndo );
+ if (nSttNode)
+ {
+ AddUndoRedoPaM(rContext);
+ }
}
-
-void SwUndoInsNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if( pOldNumRule )
rDoc.ChgNumRuleFmts( aNumRule );
else if( pHistory )
{
- SetPaM( rUndoIter );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
if( sReplaceRule.Len() )
- rDoc.ReplaceNumRule( *rUndoIter.pAktPam->GetPoint(),
+ {
+ rDoc.ReplaceNumRule(*rPam.GetPoint(),
sReplaceRule, aNumRule.GetName() );
+ }
else
{
// --> OD 2005-02-25 #i42921# - adapt to changed signature
// --> OD 2008-03-18 #refactorlists#
- rDoc.SetNumRule( *rUndoIter.pAktPam, aNumRule, false );
+ rDoc.SetNumRule(rPam, aNumRule, false);
// <--
}
}
@@ -168,20 +166,23 @@ void SwUndoInsNum::SetLRSpaceEndPos()
nLRSavePos = pHistory->Count();
}
-void SwUndoInsNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsNum::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc(rContext.GetDoc());
if( nSttNode )
{
if( !sReplaceRule.Len() )
{
// --> OD 2005-02-25 #i42921# - adapt to changed signature
// --> OD 2008-03-18 #refactorlists#
- rUndoIter.GetDoc().SetNumRule( *rUndoIter.pAktPam, aNumRule, false );
+ rDoc.SetNumRule(rContext.GetRepeatPaM(), aNumRule, false);
// <--
}
}
else
- rUndoIter.GetDoc().ChgNumRuleFmts( aNumRule );
+ {
+ rDoc.ChgNumRuleFmts( aNumRule );
+ }
}
SwHistory* SwUndoInsNum::GetHistory()
@@ -207,20 +208,14 @@ SwUndoDelNum::SwUndoDelNum( const SwPaM& rPam )
pHistory = new SwHistory;
}
-
SwUndoDelNum::~SwUndoDelNum()
{
delete pHistory;
}
-
-void SwUndoDelNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SetPaM( rUndoIter );
-
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
pHistory->TmpRollback( &rDoc, 0 );
pHistory->SetTmpEnd( pHistory->Count() );
@@ -235,22 +230,18 @@ void SwUndoDelNum::Undo( SwUndoIter& rUndoIter )
pNd->ChkCondColl();
}
- SetPaM( rUndoIter );
- rDoc.DoUndo( bUndo );
+ AddUndoRedoPaM(rContext);
}
-
-void SwUndoDelNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().DelNumRules( *rUndoIter.pAktPam );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().DelNumRules(rPam);
}
-
-void SwUndoDelNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoDelNum::RepeatImpl(::sw::RepeatContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().DelNumRules( *rUndoIter.pAktPam );
+ rContext.GetDoc().DelNumRules(rContext.GetRepeatPaM());
}
void SwUndoDelNum::AddNode( const SwTxtNode& rNd, BOOL )
@@ -277,8 +268,7 @@ SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, BOOL bIsOutlMv )
// nach oben => -1
}
-
-void SwUndoMoveNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoMoveNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
ULONG nTmpStt = nSttNode, nTmpEnd = nEndNode;
@@ -295,33 +285,35 @@ void SwUndoMoveNum::Undo( SwUndoIter& rUndoIter )
// SetPaM( rUndoIter );
// RemoveIdxFromRange( *rUndoIter.pAktPam, TRUE );
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().MoveParagraph( *rUndoIter.pAktPam, -nOffset,
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().MoveParagraph( rPam, -nOffset,
UNDO_OUTLINE_UD == GetId() );
nSttNode = nTmpStt;
nEndNode = nTmpEnd;
}
-
-void SwUndoMoveNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoMoveNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
//JP 22.06.95: wird wollen die Bookmarks/Verzeichnisse behalten, oder?
// SetPaM( rUndoIter );
// RemoveIdxFromRange( *rUndoIter.pAktPam, TRUE );
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().MoveParagraph( *rUndoIter.pAktPam, nOffset,
- UNDO_OUTLINE_UD == GetId() );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().MoveParagraph(rPam, nOffset, UNDO_OUTLINE_UD == GetId());
}
-
-void SwUndoMoveNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoMoveNum::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc = rContext.GetDoc();
if( UNDO_OUTLINE_UD == GetId() )
- rUndoIter.GetDoc().MoveOutlinePara( *rUndoIter.pAktPam,
+ {
+ rDoc.MoveOutlinePara(rContext.GetRepeatPaM(),
0 < nOffset ? 1 : -1 );
+ }
else
- rUndoIter.GetDoc().MoveParagraph( *rUndoIter.pAktPam, nOffset, FALSE );
+ {
+ rDoc.MoveParagraph(rContext.GetRepeatPaM(), nOffset, FALSE);
+ }
}
/* */
@@ -335,24 +327,21 @@ SwUndoNumUpDown::SwUndoNumUpDown( const SwPaM& rPam, short nOff )
// Up => -1
}
-
-void SwUndoNumUpDown::Undo( SwUndoIter& rUndoIter )
+void SwUndoNumUpDown::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().NumUpDown( *rUndoIter.pAktPam, 1 != nOffset );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().NumUpDown(rPam, 1 != nOffset );
}
-
-void SwUndoNumUpDown::Redo( SwUndoIter& rUndoIter )
+void SwUndoNumUpDown::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().NumUpDown( *rUndoIter.pAktPam, 1 == nOffset );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().NumUpDown(rPam, 1 == nOffset);
}
-
-void SwUndoNumUpDown::Repeat( SwUndoIter& rUndoIter )
+void SwUndoNumUpDown::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.GetDoc().NumUpDown( *rUndoIter.pAktPam, 1 == nOffset );
+ rContext.GetDoc().NumUpDown(rContext.GetRepeatPaM(), 1 == nOffset);
}
/* */
@@ -366,9 +355,9 @@ SwUndoNumOrNoNum::SwUndoNumOrNoNum( const SwNodeIndex& rIdx, BOOL bOldNum,
}
// #115901#, #i40034#
-void SwUndoNumOrNoNum::Undo( SwUndoIter& rUndoIter )
+void SwUndoNumOrNoNum::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwNodeIndex aIdx( rUndoIter.GetDoc().GetNodes(), nIdx );
+ SwNodeIndex aIdx( rContext.GetDoc().GetNodes(), nIdx );
SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode();
if (NULL != pTxtNd)
@@ -378,9 +367,9 @@ void SwUndoNumOrNoNum::Undo( SwUndoIter& rUndoIter )
}
// #115901#, #i40034#
-void SwUndoNumOrNoNum::Redo( SwUndoIter& rUndoIter )
+void SwUndoNumOrNoNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwNodeIndex aIdx( rUndoIter.GetDoc().GetNodes(), nIdx );
+ SwNodeIndex aIdx( rContext.GetDoc().GetNodes(), nIdx );
SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode();
if (NULL != pTxtNd)
@@ -390,15 +379,17 @@ void SwUndoNumOrNoNum::Redo( SwUndoIter& rUndoIter )
}
// #115901#
-void SwUndoNumOrNoNum::Repeat( SwUndoIter& rUndoIter )
+void SwUndoNumOrNoNum::RepeatImpl(::sw::RepeatContext & rContext)
{
-
+ SwDoc & rDoc = rContext.GetDoc();
if (mbOldNum && ! mbNewNum)
- rUndoIter.GetDoc().NumOrNoNum( rUndoIter.pAktPam->GetPoint()->nNode,
- FALSE);
+ {
+ rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, FALSE);
+ }
else if ( ! mbOldNum && mbNewNum )
- rUndoIter.GetDoc().NumOrNoNum( rUndoIter.pAktPam->GetPoint()->nNode,
- TRUE);
+ {
+ rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, TRUE);
+ }
}
/* */
@@ -432,34 +423,47 @@ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, USHORT nStt )
}
-void SwUndoNumRuleStart::Undo( SwUndoIter& rUndoIter )
+void SwUndoNumRuleStart::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPosition aPos( *rUndoIter.GetDoc().GetNodes()[ nIdx ] );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPosition const aPos( *rDoc.GetNodes()[ nIdx ] );
if( bSetSttValue )
- rUndoIter.GetDoc().SetNodeNumStart( aPos, nOldStt );
+ {
+ rDoc.SetNodeNumStart( aPos, nOldStt );
+ }
else
- rUndoIter.GetDoc().SetNumRuleStart( aPos, !bFlag );
+ {
+ rDoc.SetNumRuleStart( aPos, !bFlag );
+ }
}
-void SwUndoNumRuleStart::Redo( SwUndoIter& rUndoIter )
+void SwUndoNumRuleStart::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
-
- SwPosition aPos( *rDoc.GetNodes()[ nIdx ] );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPosition const aPos( *rDoc.GetNodes()[ nIdx ] );
if( bSetSttValue )
+ {
rDoc.SetNodeNumStart( aPos, nNewStt );
+ }
else
+ {
rDoc.SetNumRuleStart( aPos, bFlag );
+ }
}
-void SwUndoNumRuleStart::Repeat( SwUndoIter& rUndoIter )
+void SwUndoNumRuleStart::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc = rContext.GetDoc();
if( bSetSttValue )
- rUndoIter.GetDoc().SetNodeNumStart( *rUndoIter.pAktPam->GetPoint(), nNewStt );
+ {
+ rDoc.SetNodeNumStart(*rContext.GetRepeatPaM().GetPoint(), nNewStt);
+ }
else
- rUndoIter.GetDoc().SetNumRuleStart( *rUndoIter.pAktPam->GetPoint(), bFlag );
+ {
+ rDoc.SetNumRuleStart(*rContext.GetRepeatPaM().GetPoint(), bFlag);
+ }
}
diff --git a/sw/source/core/undo/unoutl.cxx b/sw/source/core/undo/unoutl.cxx
index 2a92097221b6..bbe80824d44a 100644
--- a/sw/source/core/undo/unoutl.cxx
+++ b/sw/source/core/undo/unoutl.cxx
@@ -28,43 +28,34 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "doc.hxx"
#include "swundo.hxx" // fuer die UndoIds
#include "pam.hxx"
#include "ndtxt.hxx"
-#include "undobj.hxx"
+#include <UndoCore.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
SwUndoOutlineLeftRight::SwUndoOutlineLeftRight( const SwPaM& rPam,
short nOff )
: SwUndo( UNDO_OUTLINE_LR ), SwUndRng( rPam ), nOffset( nOff )
{
}
-
-void SwUndoOutlineLeftRight::Undo( SwUndoIter& rUndoIter )
+void SwUndoOutlineLeftRight::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().OutlineUpDown( *rUndoIter.pAktPam, -nOffset );
+ SwPaM & rPaM( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().OutlineUpDown(rPaM, -nOffset);
}
-
-void SwUndoOutlineLeftRight::Redo( SwUndoIter& rUndoIter )
+void SwUndoOutlineLeftRight::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- rUndoIter.GetDoc().OutlineUpDown( *rUndoIter.pAktPam, nOffset );
+ SwPaM & rPaM( AddUndoRedoPaM(rContext) );
+ rContext.GetDoc().OutlineUpDown(rPaM, nOffset);
}
-
-void SwUndoOutlineLeftRight::Repeat( SwUndoIter& rUndoIter )
+void SwUndoOutlineLeftRight::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.GetDoc().OutlineUpDown( *rUndoIter.pAktPam, nOffset );
+ rContext.GetDoc().OutlineUpDown(rContext.GetRepeatPaM(), nOffset);
}
-
-
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 91549c84a57e..0cd1711ffcd0 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -28,20 +28,26 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoOverwrite.hxx>
+
+#include <tools/resid.hxx>
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
+
#include <comphelper/processfactory.hxx>
+
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <IShellCursorSupplier.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <acorrect.hxx>
#include <docary.hxx>
-#include <tools/resid.hxx>
#include <comcore.hrc> // #111827#
#include <undo.hrc>
@@ -49,19 +55,9 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::uno;
-//------------------------------------------------------------------
-
-// zwei Zugriffs-Funktionen
-inline SwPosition* IterPt( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetPoint(); }
-inline SwPosition* IterMk( SwUndoIter& rUIter )
-{ return rUIter.pAktPam->GetMark(); }
-
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
//------------------------------------------------------------
-
// OVERWRITE
@@ -200,10 +196,11 @@ BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
-void SwUndoOverwrite::Undo( SwUndoIter& rUndoIter )
+void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pAktPam = rUndoIter.pAktPam;
- SwDoc* pDoc = pAktPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pAktPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
@@ -266,29 +263,27 @@ void SwUndoOverwrite::Undo( SwUndoIter& rUndoIter )
SetSaveData( *pDoc, *pRedlSaveData );
}
-void SwUndoOverwrite::Repeat( SwUndoIter& rUndoIter )
+void SwUndoOverwrite::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.pLastUndoObj = this;
- SwPaM* pAktPam = rUndoIter.pAktPam;
+ SwPaM *const pAktPam = & rContext.GetRepeatPaM();
if( !aInsStr.Len() || pAktPam->HasMark() )
return;
- SwDoc& rDoc = *pAktPam->GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
- BOOL bGroupUndo = rDoc.DoesGroupUndo();
- rDoc.DoGroupUndo( FALSE );
- rDoc.Overwrite( *pAktPam, aInsStr.GetChar( 0 ));
- rDoc.DoGroupUndo( bGroupUndo );
+ {
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
+ rDoc.Overwrite(*pAktPam, aInsStr.GetChar(0));
+ }
for( xub_StrLen n = 1; n < aInsStr.Len(); ++n )
rDoc.Overwrite( *pAktPam, aInsStr.GetChar( n ) );
}
-
-
-void SwUndoOverwrite::Redo( SwUndoIter& rUndoIter )
+void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pAktPam = rUndoIter.pAktPam;
- SwDoc* pDoc = pAktPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pAktPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
+
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
@@ -380,11 +375,9 @@ SwUndoTransliterate::~SwUndoTransliterate()
delete aChanges[i];
}
-void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter )
+void SwUndoTransliterate::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- BOOL bUndo = rDoc.DoesUndo();
- rDoc.DoUndo( FALSE );
+ SwDoc & rDoc = rContext.GetDoc();
// since the changes were added to the vector from the end of the string/node towards
// the start, we need to revert them from the start towards the end now to keep the
@@ -393,27 +386,24 @@ void SwUndoTransliterate::Undo( SwUndoIter& rUndoIter )
for (sal_Int32 i = aChanges.size() - 1; i >= 0; --i)
aChanges[i]->SetChangeAtNode( rDoc );
- rDoc.DoUndo( bUndo );
- SetPaM( rUndoIter, TRUE );
+ AddUndoRedoPaM(rContext, true);
}
-void SwUndoTransliterate::Redo( SwUndoIter& rUndoIter )
+void SwUndoTransliterate::RedoImpl(::sw::UndoRedoContext & rContext)
{
-/* ??? */ rUndoIter.SetUpdateAttr( TRUE );
-
- SetPaM( *rUndoIter.pAktPam );
- Repeat( rUndoIter );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ DoTransliterate(rContext.GetDoc(), rPam);
}
-void SwUndoTransliterate::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTransliterate::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM& rPam = *rUndoIter.pAktPam;
- SwDoc& rDoc = rUndoIter.GetDoc();
+ DoTransliterate(rContext.GetDoc(), rContext.GetRepeatPaM());
+}
+void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM & rPam)
+{
utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType );
rDoc.TransliterateText( rPam, aTrans );
-
- rUndoIter.pLastUndoObj = this;
}
void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd,
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 7f76697c80a3..a3508cf5d568 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoRedline.hxx>
#include <hintids.hxx>
#include <unotools/charclass.hxx>
@@ -35,7 +36,8 @@
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoDelete.hxx>
#include <rolbck.hxx>
#include <redline.hxx>
#include <docary.hxx>
@@ -46,9 +48,6 @@ extern void lcl_GetJoinFlags( SwPaM& rPam, BOOL& rJoinTxt, BOOL& rJoinPrev );
//------------------------------------------------------------------
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
-
SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
: SwUndo( UNDO_REDLINE ), SwUndRng( rRange ),
pRedlData( 0 ), pRedlSaveData( 0 ), nUserId( nUsrId ),
@@ -94,13 +93,18 @@ SwUndoRedline::~SwUndoRedline()
delete pRedlSaveData;
}
-void SwUndoRedline::Undo( SwUndoIter& rIter )
+USHORT SwUndoRedline::GetRedlSaveCount() const
{
- SwDoc* pDoc = &rIter.GetDoc();
- SetPaM( *rIter.pAktPam );
+ return pRedlSaveData ? pRedlSaveData->Count() : 0;
+}
-// RedlineMode setzen?
- _Undo( rIter );
+
+void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext)
+{
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+
+ UndoRedlineImpl(*pDoc, rPam);
if( pRedlSaveData )
{
@@ -114,47 +118,47 @@ void SwUndoRedline::Undo( SwUndoIter& rIter )
nSttNode += nEndExtra;
nEndNode += nEndExtra;
}
- SetPaM( *rIter.pAktPam, TRUE );
+ SetPaM(rPam, true);
}
}
-void SwUndoRedline::Redo( SwUndoIter& rIter )
+void SwUndoRedline::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rIter.GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
RedlineMode_t eOld = pDoc->GetRedlineMode();
pDoc->SetRedlineMode_intern((RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON ));
- SetPaM( *rIter.pAktPam );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
if( pRedlSaveData && bHiddenRedlines )
{
ULONG nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
- FillSaveData( *rIter.pAktPam, *pRedlSaveData, FALSE,
+ FillSaveData(rPam, *pRedlSaveData, FALSE,
UNDO_REJECT_REDLINE != nUserId );
nEndExtra -= pDoc->GetNodes().GetEndOfExtras().GetIndex();
nSttNode -= nEndExtra;
nEndNode -= nEndExtra;
}
- _Redo( rIter );
- SetPaM( *rIter.pAktPam, TRUE );
+ RedoRedlineImpl(*pDoc, rPam);
+
+ SetPaM(rPam, true);
pDoc->SetRedlineMode_intern( eOld );
}
-// default ist leer
-void SwUndoRedline::_Undo( SwUndoIter& )
+void SwUndoRedline::UndoRedlineImpl(SwDoc &, SwPaM &)
{
}
-// default ist Redlines entfernen
-void SwUndoRedline::_Redo( SwUndoIter& rIter )
+// default: remove redlines
+void SwUndoRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().DeleteRedline( *rIter.pAktPam, true, USHRT_MAX );
+ rDoc.DeleteRedline(rPam, true, USHRT_MAX);
}
-/* */
+// SwUndoRedlineDelete ///////////////////////////////////////////////////
SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
: SwUndoRedline( nUsrId = (nUsrId ? nUsrId : UNDO_DELETE), rRange ),
@@ -178,15 +182,17 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
bCacheComment = false;
}
-void SwUndoRedlineDelete::_Undo( SwUndoIter& rIter )
+void SwUndoRedlineDelete::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().DeleteRedline( *rIter.pAktPam, true, USHRT_MAX );
+ rDoc.DeleteRedline(rPam, true, USHRT_MAX);
}
-void SwUndoRedlineDelete::_Redo( SwUndoIter& rIter )
+void SwUndoRedlineDelete::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- if( *rIter.pAktPam->GetPoint() != *rIter.pAktPam->GetMark() )
- rIter.GetDoc().AppendRedline( new SwRedline( *pRedlData, *rIter.pAktPam ), FALSE );
+ if (rPam.GetPoint() != rPam.GetMark())
+ {
+ rDoc.AppendRedline( new SwRedline(*pRedlData, rPam), FALSE );
+ }
}
BOOL SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
@@ -238,14 +244,13 @@ SwUndoRedlineSort::~SwUndoRedlineSort()
delete pOpt;
}
-void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
+void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- // im rIter.pAktPam ist der sortiete Bereich,
- // im aSaveRange steht der kopierte, sprich der originale.
- SwDoc& rDoc = rIter.GetDoc();
+ // rPam contains the sorted range
+ // aSaveRange contains copied (i.e. original) range
- SwPosition* pStart = rIter.pAktPam->Start();
- SwPosition* pEnd = rIter.pAktPam->End();
+ SwPosition *const pStart = rPam.Start();
+ SwPosition *const pEnd = rPam.End();
SwNodeIndex aPrevIdx( pStart->nNode, -1 );
ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
@@ -266,7 +271,7 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
}
{
- SwPaM aTmp( *rIter.pAktPam->GetMark() );
+ SwPaM aTmp( *rPam.GetMark() );
aTmp.GetMark()->nContent = 0;
aTmp.SetMark();
aTmp.GetPoint()->nNode = nSaveEndNode;
@@ -274,9 +279,9 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
rDoc.DeleteRedline( aTmp, true, USHRT_MAX );
}
- rDoc.DelFullPara( *rIter.pAktPam );
+ rDoc.DelFullPara(rPam);
- SwPaM* pPam = rIter.pAktPam;
+ SwPaM *const pPam = & rPam;
pPam->DeleteMark();
pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
SwCntntNode* pCNd = pPam->GetCntntNode();
@@ -289,13 +294,11 @@ void SwUndoRedlineSort::_Undo( SwUndoIter& rIter )
SetValues( *pPam );
- SetPaM( *rIter.pAktPam );
+ SetPaM(rPam);
}
-void SwUndoRedlineSort::_Redo( SwUndoIter& rIter )
+void SwUndoRedlineSort::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- SwPaM& rPam = *rIter.pAktPam;
-
SwPaM* pPam = &rPam;
SwPosition* pStart = pPam->Start();
SwPosition* pEnd = pPam->End();
@@ -304,7 +307,7 @@ void SwUndoRedlineSort::_Redo( SwUndoIter& rIter )
ULONG nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex();
xub_StrLen nCntStt = pStart->nContent.GetIndex();
- rIter.GetDoc().SortText( rPam, *pOpt );
+ rDoc.SortText(rPam, *pOpt);
pPam->DeleteMark();
pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 );
@@ -326,9 +329,9 @@ void SwUndoRedlineSort::_Redo( SwUndoIter& rIter )
rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSaveEndCntnt );
}
-void SwUndoRedlineSort::Repeat( SwUndoIter& rIter )
+void SwUndoRedlineSort::RepeatImpl(::sw::RepeatContext & rContext)
{
- rIter.GetDoc().SortText( *rIter.pAktPam, *pOpt );
+ rContext.GetDoc().SortText( rContext.GetRepeatPaM(), *pOpt );
}
void SwUndoRedlineSort::SetSaveRange( const SwPaM& rRange )
@@ -343,21 +346,21 @@ void SwUndoRedlineSort::SetOffset( const SwNodeIndex& rIdx )
nOffset = rIdx.GetIndex() - nSttNode;
}
-/* */
+// SwUndoAcceptRedline ///////////////////////////////////////////////////
SwUndoAcceptRedline::SwUndoAcceptRedline( const SwPaM& rRange )
: SwUndoRedline( UNDO_ACCEPT_REDLINE, rRange )
{
}
-void SwUndoAcceptRedline::_Redo( SwUndoIter& rIter )
+void SwUndoAcceptRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().AcceptRedline( *rIter.pAktPam, false );
+ rDoc.AcceptRedline(rPam, false);
}
-void SwUndoAcceptRedline::Repeat( SwUndoIter& rIter )
+void SwUndoAcceptRedline::RepeatImpl(::sw::RepeatContext & rContext)
{
- rIter.GetDoc().AcceptRedline( *rIter.pAktPam, true );
+ rContext.GetDoc().AcceptRedline(rContext.GetRepeatPaM(), true);
}
SwUndoRejectRedline::SwUndoRejectRedline( const SwPaM& rRange )
@@ -365,17 +368,17 @@ SwUndoRejectRedline::SwUndoRejectRedline( const SwPaM& rRange )
{
}
-void SwUndoRejectRedline::_Redo( SwUndoIter& rIter )
+void SwUndoRejectRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
{
- rIter.GetDoc().RejectRedline( *rIter.pAktPam, false );
+ rDoc.RejectRedline(rPam, false);
}
-void SwUndoRejectRedline::Repeat( SwUndoIter& rIter )
+void SwUndoRejectRedline::RepeatImpl(::sw::RepeatContext & rContext)
{
- rIter.GetDoc().RejectRedline( *rIter.pAktPam, true );
+ rContext.GetDoc().RejectRedline(rContext.GetRepeatPaM(), true);
}
-/* */
+// SwUndoCompDoc /////////////////////////////////////////////////////////
SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, BOOL bIns )
: SwUndo( UNDO_COMPAREDOC ), SwUndRng( rRg ), pRedlData( 0 ),
@@ -416,12 +419,10 @@ SwUndoCompDoc::~SwUndoCompDoc()
delete pRedlSaveData;
}
-void SwUndoCompDoc::Undo( SwUndoIter& rIter )
+void SwUndoCompDoc::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
-
- SetPaM( *pPam );
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam( & AddUndoRedoPaM(rContext) );
if( !bInsert )
{
@@ -481,22 +482,17 @@ void SwUndoCompDoc::Undo( SwUndoIter& rIter )
if( pRedlSaveData )
SetSaveData( *pDoc, *pRedlSaveData );
}
- SetPaM( rIter, TRUE );
+ SetPaM(*pPam, true);
}
}
-void SwUndoCompDoc::Redo( SwUndoIter& rIter )
+void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze noch den Cursor auf den Redo-Bereich
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
-
- rIter.pLastUndoObj = 0;
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam( & AddUndoRedoPaM(rContext) );
if( bInsert )
{
- SetPaM( *pPam );
-
if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
{
SwRedline* pTmp = new SwRedline( *pRedlData, *pPam );
@@ -521,10 +517,10 @@ void SwUndoCompDoc::Redo( SwUndoIter& rIter )
if( pUnDel2 )
{
- pUnDel2->Undo( rIter );
+ pUnDel2->UndoImpl(rContext);
delete pUnDel2, pUnDel2 = 0;
}
- pUnDel->Undo( rIter );
+ pUnDel->UndoImpl(rContext);
delete pUnDel, pUnDel = 0;
SetPaM( *pPam );
@@ -537,7 +533,6 @@ void SwUndoCompDoc::Redo( SwUndoIter& rIter )
// pDoc->SetRedlineMode_intern( eOld );
}
- SetPaM( rIter, TRUE );
+ SetPaM(*pPam, true);
}
-
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 98d0e41d4616..80e918670f7a 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoSection.hxx>
#include <sfx2/linkmgr.hxx>
#include <fmtcntnt.hxx>
@@ -36,7 +37,7 @@
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <section.hxx>
#include <rolbck.hxx>
#include <redline.hxx>
@@ -48,8 +49,6 @@
#include <calc.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
SfxItemSet* lcl_GetAttrSet( const SwSection& rSect )
{
// Attribute des Formate sichern (Spalten, Farbe, ... )
@@ -122,9 +121,9 @@ SwUndoInsSection::~SwUndoInsSection()
{
}
-void SwUndoInsSection::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
RemoveIdxFromSection( rDoc, m_nSectionNodePos );
@@ -167,25 +166,23 @@ void SwUndoInsSection::Undo( SwUndoIter& rUndoIter )
rDoc.GetFtnIdxs().UpdateFtn( aIdx );
}
- SetPaM( rUndoIter );
+ AddUndoRedoPaM(rContext);
}
-
-void SwUndoInsSection::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SetPaM( rUndoIter );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
const SwTOXBaseSection* pUpdateTOX = 0;
if (m_pTOXBase.get())
{
- pUpdateTOX = rDoc.InsertTableOf( *rUndoIter.pAktPam->GetPoint(),
+ pUpdateTOX = rDoc.InsertTableOf( *rPam.GetPoint(),
*m_pTOXBase, m_pAttrSet.get(), true);
}
else
{
- rDoc.InsertSwSection(*rUndoIter.pAktPam,
- *m_pSectionData, 0, m_pAttrSet.get(), true);
+ rDoc.InsertSwSection(rPam, *m_pSectionData, 0, m_pAttrSet.get(), true);
}
if (m_pHistory.get())
@@ -224,22 +221,21 @@ void SwUndoInsSection::Redo( SwUndoIter& rUndoIter )
}
}
-
-void SwUndoInsSection::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsSection::RepeatImpl(::sw::RepeatContext & rContext)
{
+ SwDoc & rDoc = rContext.GetDoc();
if (m_pTOXBase.get())
{
- rUndoIter.GetDoc().InsertTableOf( *rUndoIter.pAktPam->GetPoint(),
+ rDoc.InsertTableOf(*rContext.GetRepeatPaM().GetPoint(),
*m_pTOXBase, m_pAttrSet.get(), true);
}
else
{
- rUndoIter.GetDoc().InsertSwSection( *rUndoIter.pAktPam,
+ rDoc.InsertSwSection(rContext.GetRepeatPaM(),
*m_pSectionData, 0, m_pAttrSet.get());
}
}
-
void SwUndoInsSection::Join( SwDoc& rDoc, ULONG nNode )
{
SwNodeIndex aIdx( rDoc.GetNodes(), nNode );
@@ -300,9 +296,11 @@ private:
public:
SwUndoDelSection(
SwSectionFmt const&, SwSection const&, SwNodeIndex const*const);
+
virtual ~SwUndoDelSection();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
};
SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const& rFormat)
@@ -330,9 +328,9 @@ SwUndoDelSection::~SwUndoDelSection()
{
}
-void SwUndoDelSection::Undo( SwUndoIter& rUndoIter )
+void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if (m_pTOXBase.get())
{
@@ -383,13 +381,13 @@ void SwUndoDelSection::Undo( SwUndoIter& rUndoIter )
}
}
-void SwUndoDelSection::Redo( SwUndoIter& rUndoIter )
+void SwUndoDelSection::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwSectionNode *const pNd =
rDoc.GetNodes()[ m_nStartNode ]->GetSectionNode();
- ASSERT( pNd, "wo ist mein SectionNode?" );
+ OSL_ENSURE(pNd, "SwUndoDelSection::RedoImpl(): no SectionNode?");
// einfach das Format loeschen, der Rest erfolgt automatisch
rDoc.DelSectionFmt( pNd->GetSection().GetFmt() );
}
@@ -409,9 +407,11 @@ private:
public:
SwUndoUpdateSection(
SwSection const&, SwNodeIndex const*const, bool const bOnlyAttr);
+
virtual ~SwUndoUpdateSection();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
+
+ virtual void UndoImpl( ::sw::UndoRedoContext & );
+ virtual void RedoImpl( ::sw::UndoRedoContext & );
};
SW_DLLPRIVATE SwUndo *
@@ -436,9 +436,9 @@ SwUndoUpdateSection::~SwUndoUpdateSection()
{
}
-void SwUndoUpdateSection::Undo( SwUndoIter& rUndoIter )
+void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwSectionNode *const pSectNd =
rDoc.GetNodes()[ m_nStartNode ]->GetSectionNode();
ASSERT( pSectNd, "wo ist mein SectionNode?" );
@@ -492,8 +492,8 @@ void SwUndoUpdateSection::Undo( SwUndoIter& rUndoIter )
}
}
-void SwUndoUpdateSection::Redo( SwUndoIter& rUndoIter )
+void SwUndoUpdateSection::RedoImpl(::sw::UndoRedoContext & rContext)
{
- Undo( rUndoIter );
+ UndoImpl(rContext);
}
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 44b73736e458..d786a7c06e9e 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -27,20 +27,21 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
+#include <UndoSort.hxx>
+
#include <doc.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <swtable.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoTable.hxx>
#include <sortopt.hxx>
-#ifndef _DOCSORT_HXX
#include <docsort.hxx>
-#endif
#include <redline.hxx>
#include <node2lay.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
/*--------------------------------------------------------------------
Beschreibung: Undo fuers Sorting
@@ -69,7 +70,6 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt)
pSortOpt = new SwSortOptions(rOpt);
}
-
SwUndoSort::SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode& rTblNd,
const SwSortOptions& rOpt, BOOL bSaveTable )
: SwUndo(UNDO_SORT_TBL), pUndoTblAttr( 0 ), pRedlData( 0 )
@@ -83,8 +83,6 @@ SwUndoSort::SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode& rTblNd,
pUndoTblAttr = new SwUndoAttrTbl( rTblNd );
}
-
-
SwUndoSort::~SwUndoSort()
{
delete pSortOpt;
@@ -92,18 +90,18 @@ SwUndoSort::~SwUndoSort()
delete pRedlData;
}
-
-
-void SwUndoSort::Undo( SwUndoIter& rIter)
+void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if(pSortOpt->bTable)
{
// Undo Tabelle
RemoveIdxFromSection( rDoc, nSttNode, &nEndNode );
if( pUndoTblAttr )
- pUndoTblAttr->Undo( rIter );
+ {
+ pUndoTblAttr->UndoImpl(rContext);
+ }
SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
@@ -141,7 +139,8 @@ void SwUndoSort::Undo( SwUndoIter& rIter)
else
{
// Undo Text
- RemoveIdx( *rIter.pAktPam );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ RemoveIdxFromRange(rPam, true);
// fuer die sorted Positions einen Index anlegen.
// JP 25.11.97: Die IndexList muss aber nach SourcePosition
@@ -168,14 +167,13 @@ void SwUndoSort::Undo( SwUndoIter& rIter)
}
// Indixes loeschen
aIdxList.DeleteAndDestroy(0, aIdxList.Count());
- SetPaM( rIter, TRUE );
+ SetPaM(rPam, true);
}
}
-
-void SwUndoSort::Redo( SwUndoIter& rIter)
+void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
if(pSortOpt->bTable)
{
@@ -208,7 +206,9 @@ void SwUndoSort::Redo( SwUndoIter& rIter)
}
if( pUndoTblAttr )
- pUndoTblAttr->Redo( rIter );
+ {
+ pUndoTblAttr->RedoImpl(rContext);
+ }
// Restore table frames:
// --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
@@ -219,8 +219,10 @@ void SwUndoSort::Redo( SwUndoIter& rIter)
}
else
{
- // Redo bei Text
- RemoveIdx( *rIter.pAktPam );
+ // Redo for Text
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ SetPaM(rPam);
+ RemoveIdxFromRange(rPam, true);
SwUndoSortList aIdxList( (BYTE)aSortList.Count() );
USHORT i;
@@ -241,62 +243,37 @@ void SwUndoSort::Redo( SwUndoIter& rIter)
}
// Indixes loeschen
aIdxList.DeleteAndDestroy(0, aIdxList.Count());
- SetPaM( rIter, TRUE );
- const SwTxtNode* pTNd = rIter.pAktPam->GetNode()->GetTxtNode();
+ SetPaM(rPam, true);
+ SwTxtNode const*const pTNd = rPam.GetNode()->GetTxtNode();
if( pTNd )
- rIter.pAktPam->GetPoint()->nContent = pTNd->GetTxt().Len();
+ {
+ rPam.GetPoint()->nContent = pTNd->GetTxt().Len();
+ }
}
}
-
-void SwUndoSort::Repeat(SwUndoIter& rIter)
+void SwUndoSort::RepeatImpl(::sw::RepeatContext & rContext)
{
+ // table not repeat capable
if(!pSortOpt->bTable)
{
- SwPaM* pPam = rIter.pAktPam;
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
SwDoc& rDoc = *pPam->GetDoc();
if( !rDoc.IsIdxInTbl( pPam->Start()->nNode ) )
rDoc.SortText(*pPam, *pSortOpt);
}
- // Tabelle ist nicht Repeat-Faehig
- rIter.pLastUndoObj = this;
}
-
-void SwUndoSort::RemoveIdx( SwPaM& rPam )
-{
- rPam.DeleteMark();
- rPam.GetPoint()->nNode = nSttNode;
-
- SwCntntNode* pCNd = rPam.GetCntntNode();
- xub_StrLen nLen = pCNd->Len();
- if( nLen >= nSttCntnt )
- nLen = nSttCntnt;
- rPam.GetPoint()->nContent.Assign(pCNd, nLen );
- rPam.SetMark();
-
- rPam.GetPoint()->nNode = nEndNode;
- pCNd = rPam.GetCntntNode();
- nLen = pCNd->Len();
- if( nLen >= nEndCntnt )
- nLen = nEndCntnt;
- rPam.GetPoint()->nContent.Assign(pCNd, nLen );
- RemoveIdxFromRange( rPam, TRUE );
-}
-
-
void SwUndoSort::Insert( const String& rOrgPos, const String& rNewPos)
{
SwSortUndoElement* pEle = new SwSortUndoElement(rOrgPos, rNewPos);
aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() );
}
-
void SwUndoSort::Insert( ULONG nOrgPos, ULONG nNewPos)
{
SwSortUndoElement* pEle = new SwSortUndoElement(nOrgPos, nNewPos);
aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() );
}
-
diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 14aa18ed6e07..a96e860dfe04 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoSplitMove.hxx>
#include "doc.hxx"
#include "pam.hxx"
@@ -37,13 +38,11 @@
#include <editeng/brkitem.hxx>
#include <fmtpdsc.hxx>
#include <frmfmt.hxx>
-#include "undobj.hxx"
+#include <UndoCore.hxx>
#include "rolbck.hxx"
#include "redline.hxx"
#include "docary.hxx"
-
-
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
+#include <IShellCursorSupplier.hxx>
//------------------------------------------------------------------
@@ -57,8 +56,8 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
nCntnt( rPos.nContent.GetIndex() ),
bTblFlag( FALSE ), bChkTblStt( bChkTable )
{
- SwTxtNode* pTxtNd = pDoc->GetNodes()[ rPos.nNode ]->GetTxtNode();
- ASSERT( pTxtNd, "nur beim TextNode rufen!" );
+ SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode();
+ OSL_ENSURE(pTxtNd, "SwUndoSplitNode: TextNode expected!");
if( pTxtNd->GetpSwpHints() )
{
pHistory = new SwHistory;
@@ -75,21 +74,16 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
}
}
-
-
-
SwUndoSplitNode::~SwUndoSplitNode()
{
delete pHistory;
delete pRedlData;
}
-
-
-void SwUndoSplitNode::Undo( SwUndoIter& rUndoIter )
+void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
- SwPaM& rPam = *rUndoIter.pAktPam;
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
rPam.DeleteMark();
if( bTblFlag )
{
@@ -163,23 +157,13 @@ void SwUndoSplitNode::Undo( SwUndoIter& rUndoIter )
rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nCntnt );
}
-
-void SwUndoSplitNode::Repeat( SwUndoIter& rUndoIter )
-{
- if( UNDO_SPLITNODE == rUndoIter.GetLastUndoId() )
- return;
- rUndoIter.GetDoc().SplitNode( *rUndoIter.pAktPam->GetPoint(), bChkTblStt );
- rUndoIter.pLastUndoObj = this;
-}
-
-
-void SwUndoSplitNode::Redo( SwUndoIter& rUndoIter )
+void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM& rPam = *rUndoIter.pAktPam;
- ULONG nOldNode = rPam.GetPoint()->nNode.GetIndex();
+ SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
rPam.GetPoint()->nNode = nNode;
SwTxtNode * pTNd = rPam.GetNode()->GetTxtNode();
- if( pTNd ) // sollte eigentlich immer ein TextNode sein !!
+ OSL_ENSURE(pTNd, "SwUndoSplitNode::RedoImpl(): SwTxtNode expected");
+ if (pTNd)
{
rPam.GetPoint()->nContent.Assign( pTNd, nCntnt );
@@ -210,7 +194,11 @@ void SwUndoSplitNode::Redo( SwUndoIter& rUndoIter )
rPam.DeleteMark();
}
}
- else
- rPam.GetPoint()->nNode = nOldNode;
+}
+
+void SwUndoSplitNode::RepeatImpl(::sw::RepeatContext & rContext)
+{
+ rContext.GetDoc().SplitNode(
+ *rContext.GetRepeatPaM().GetPoint(), bChkTblStt );
}
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 9a654170187a..929fa647b455 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -28,12 +28,19 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoTable.hxx>
+#include <UndoRedline.hxx>
+#include <UndoDelete.hxx>
+#include <UndoSplitMove.hxx>
+#include <UndoCore.hxx>
#include <hintids.hxx>
+#include <hints.hxx>
#include <editeng/brkitem.hxx>
#include <fmtornt.hxx>
#include <fmtpdsc.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <editsh.hxx>
#include <docary.hxx>
#include <ndtxt.hxx>
@@ -42,7 +49,6 @@
#include <cntfrm.hxx>
#include <tblsel.hxx>
#include <swundo.hxx> // fuer die UndoIds
-#include <undobj.hxx>
#include <rolbck.hxx>
#include <ddefld.hxx>
#include <tabcol.hxx>
@@ -80,7 +86,6 @@
#define _DEBUG_REDLINE( pDoc ) lcl_DebugRedline( pDoc );
#endif
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
extern void ClearFEShellTabCols();
typedef SfxItemSet* SfxItemSetPtr;
@@ -275,9 +280,9 @@ SwUndoInsTbl::~SwUndoInsTbl()
delete pAutoFmt;
}
-void SwUndoInsTbl::Undo( SwUndoIter& rUndoIter )
+void SwUndoInsTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode );
SwTableNode* pTblNd = aIdx.GetNode().GetTableNode();
@@ -313,19 +318,18 @@ void SwUndoInsTbl::Undo( SwUndoIter& rUndoIter )
rDoc.GetNodes().Delete( aIdx, pTblNd->EndOfSectionIndex() -
aIdx.GetIndex() + 1 );
- rUndoIter.pAktPam->DeleteMark();
- rUndoIter.pAktPam->GetPoint()->nNode = aIdx;
- rUndoIter.pAktPam->GetPoint()->nContent.Assign(
- rUndoIter.pAktPam->GetCntntNode(), 0 );
+ SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
+ rPam.DeleteMark();
+ rPam.GetPoint()->nNode = aIdx;
+ rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 );
}
-void SwUndoInsTbl::Redo( SwUndoIter& rUndoIter )
+void SwUndoInsTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
- SwPosition aPos( *rUndoIter.pAktPam->GetPoint() );
- aPos.nNode = nSttNode;
+ SwPosition const aPos(SwNodeIndex(rDoc.GetNodes(), nSttNode));
const SwTable* pTbl = rDoc.InsertTable( aInsTblOpts, aPos, nRows, nCols,
nAdjust,
pAutoFmt, pColWidth );
@@ -364,11 +368,11 @@ void SwUndoInsTbl::Redo( SwUndoIter& rUndoIter )
}
-void SwUndoInsTbl::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInsTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- rUndoIter.GetDoc().InsertTable( aInsTblOpts, *rUndoIter.pAktPam->GetPoint(),
- nRows, nCols, nAdjust,
- pAutoFmt, pColWidth );
+ rContext.GetDoc().InsertTable(
+ aInsTblOpts, *rContext.GetRepeatPaM().GetPoint(),
+ nRows, nCols, nAdjust, pAutoFmt, pColWidth );
}
SwRewriter SwUndoInsTbl::GetRewriter() const
@@ -473,10 +477,10 @@ SwUndoTblToTxt::~SwUndoTblToTxt()
-void SwUndoTblToTxt::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SwPaM* pPam = rUndoIter.pAktPam;
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
SwNodeIndex aFrmIdx( rDoc.GetNodes(), nSttNd );
SwNodeIndex aEndIdx( rDoc.GetNodes(), nEndNd );
@@ -653,11 +657,10 @@ SwTableNode* SwNodes::UndoTableToText( ULONG nSttNd, ULONG nEndNd,
}
-void SwUndoTblToTxt::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
- SwPaM* pPam = rUndoIter.pAktPam;
-
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->GetPoint()->nNode = nSttNd;
pPam->GetPoint()->nContent.Assign( 0, 0 );
@@ -691,19 +694,19 @@ void SwUndoTblToTxt::Redo( SwUndoIter& rUndoIter )
}
-void SwUndoTblToTxt::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTblToTxt::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwTableNode* pTblNd = rUndoIter.pAktPam->GetNode()->FindTableNode();
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
+ SwTableNode *const pTblNd = pPam->GetNode()->FindTableNode();
if( pTblNd )
{
- // bewege den Cursor aus der Tabelle
- SwPaM* pPam = rUndoIter.pAktPam;
+ // move cursor out of table
pPam->GetPoint()->nNode = *pTblNd->EndOfSectionNode();
pPam->Move( fnMoveForward, fnGoCntnt );
pPam->SetMark();
pPam->DeleteMark();
- rUndoIter.GetDoc().TableToText( pTblNd, cTrenner );
+ rContext.GetDoc().TableToText( pTblNd, cTrenner );
}
}
@@ -745,16 +748,16 @@ SwUndoTxtToTbl::~SwUndoTxtToTbl()
delete pAutoFmt;
}
-void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
+void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
ULONG nTblNd = nSttNode;
if( nSttCntnt )
++nTblNd; // Node wurde vorher gesplittet
SwNodeIndex aIdx( rDoc.GetNodes(), nTblNd );
- SwTableNode* pTNd = rDoc.GetNodes()[ aIdx ]->GetTableNode();
- ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
+ SwTableNode *const pTNd = aIdx.GetNode().GetTableNode();
+ OSL_ENSURE( pTNd, "SwUndoTxtToTbl: no TableNode" );
RemoveIdxFromSection( rDoc, nTblNd );
@@ -783,15 +786,16 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
SwNodeIndex aEndIdx( *pTNd->EndOfSectionNode() );
rDoc.TableToText( pTNd, 0x0b == cTrenner ? 0x09 : cTrenner );
- // am Start wieder zusammenfuegen ?
- SwPosition* pPos = rUndoIter.pAktPam->GetPoint();
+ // join again at start?
+ SwPaM aPam(rDoc.GetNodes().GetEndOfContent());
+ SwPosition *const pPos = aPam.GetPoint();
if( nSttCntnt )
{
pPos->nNode = nTblNd;
- pPos->nContent.Assign( rDoc.GetNodes()[ pPos->nNode ]->GetCntntNode(), 0 );
- if( rUndoIter.pAktPam->Move( fnMoveBackward, fnGoCntnt))
+ pPos->nContent.Assign(pPos->nNode.GetNode().GetCntntNode(), 0);
+ if (aPam.Move(fnMoveBackward, fnGoCntnt))
{
- SwNodeIndex& rIdx = rUndoIter.pAktPam->GetPoint()->nNode;
+ SwNodeIndex & rIdx = aPam.GetPoint()->nNode;
// dann die Crsr/etc. nochmal relativ verschieben
RemoveIdxRel( rIdx.GetIndex()+1, *pPos );
@@ -800,7 +804,7 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
}
}
- // am Ende wieder zusammenfuegen ?
+ // join again at end?
if( bSplitEnd )
{
SwNodeIndex& rIdx = pPos->nNode;
@@ -808,8 +812,8 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
SwTxtNode* pTxtNd = rIdx.GetNode().GetTxtNode();
if( pTxtNd && pTxtNd->CanJoinNext() )
{
- rUndoIter.pAktPam->GetMark()->nContent.Assign( 0, 0 );
- rUndoIter.pAktPam->GetPoint()->nContent.Assign( 0, 0 );
+ aPam.GetMark()->nContent.Assign( 0, 0 );
+ aPam.GetPoint()->nContent.Assign( 0, 0 );
// dann die Crsr/etc. nochmal relativ verschieben
pPos->nContent.Assign( pTxtNd, pTxtNd->GetTxt().Len() );
@@ -819,30 +823,31 @@ void SwUndoTxtToTbl::Undo( SwUndoIter& rUndoIter )
}
}
- SetPaM( rUndoIter ); // manipulierten Bereich selectieren
+ AddUndoRedoPaM(rContext);
}
-void SwUndoTxtToTbl::Redo( SwUndoIter& rUndoIter )
+void SwUndoTxtToTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SetPaM( rUndoIter );
- RemoveIdxFromRange( *rUndoIter.pAktPam, FALSE );
- SetPaM( rUndoIter );
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ RemoveIdxFromRange(rPam, false);
+ SetPaM(rPam);
- const SwTable* pTable = rUndoIter.GetDoc().TextToTable(
- aInsTblOpts, *rUndoIter.pAktPam, cTrenner,
- nAdjust, pAutoFmt );
+ SwTable const*const pTable = rContext.GetDoc().TextToTable(
+ aInsTblOpts, rPam, cTrenner, nAdjust, pAutoFmt );
((SwFrmFmt*)pTable->GetFrmFmt())->SetName( sTblNm );
}
-void SwUndoTxtToTbl::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTxtToTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- // keine TABLE IN TABLE
- if( !rUndoIter.pAktPam->GetNode()->FindTableNode() )
- rUndoIter.GetDoc().TextToTable( aInsTblOpts, *rUndoIter.pAktPam,
+ // no Table In Table
+ if (!rContext.GetRepeatPaM().GetNode()->FindTableNode())
+ {
+ rContext.GetDoc().TextToTable( aInsTblOpts, rContext.GetRepeatPaM(),
cTrenner, nAdjust,
pAutoFmt );
+ }
}
void SwUndoTxtToTbl::AddFillBox( const SwTableBox& rBox )
@@ -874,20 +879,18 @@ SwUndoTblHeadline::SwUndoTblHeadline( const SwTable& rTbl, USHORT nOldHdl,
nTblNd = pSttNd->StartOfSectionIndex();
}
-
-void SwUndoTblHeadline::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblHeadline::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
rDoc.SetRowsToRepeat( pTNd->GetTable(), nOldHeadline );
}
-
-void SwUndoTblHeadline::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblHeadline::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
@@ -895,17 +898,18 @@ void SwUndoTblHeadline::Redo( SwUndoIter& rUndoIter )
rDoc.SetRowsToRepeat( pTNd->GetTable(), nNewHeadline );
}
-
-void SwUndoTblHeadline::Repeat( SwUndoIter& rUndoIter )
+void SwUndoTblHeadline::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwTableNode* pTblNd = rUndoIter.pAktPam->GetNode()->FindTableNode();
+ SwTableNode *const pTblNd =
+ rContext.GetRepeatPaM().GetNode()->FindTableNode();
if( pTblNd )
- rUndoIter.GetDoc().SetRowsToRepeat( pTblNd->GetTable(), nNewHeadline );
+ {
+ rContext.GetDoc().SetRowsToRepeat( pTblNd->GetTable(), nNewHeadline );
+ }
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
_SaveTable::_SaveTable( const SwTable& rTbl, USHORT nLnCnt, BOOL bSaveFml )
@@ -1424,7 +1428,7 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
}
-/* */
+//////////////////////////////////////////////////////////////////////////
// UndoObject fuer Attribut Aenderung an der Tabelle
@@ -1437,17 +1441,14 @@ SwUndoAttrTbl::SwUndoAttrTbl( const SwTableNode& rTblNd, BOOL bClearTabCols )
pSaveTbl = new _SaveTable( rTblNd.GetTable() );
}
-
SwUndoAttrTbl::~SwUndoAttrTbl()
{
delete pSaveTbl;
}
-
-
-void SwUndoAttrTbl::Undo( SwUndoIter& rUndoIter )
+void SwUndoAttrTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
ASSERT( pTblNd, "kein TabellenNode" );
@@ -1463,14 +1464,13 @@ void SwUndoAttrTbl::Undo( SwUndoIter& rUndoIter )
ClearFEShellTabCols();
}
-
-void SwUndoAttrTbl::Redo( SwUndoIter& rUndoIter )
+void SwUndoAttrTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- Undo( rUndoIter );
+ UndoImpl(rContext);
}
-/* */
+//////////////////////////////////////////////////////////////////////////
// UndoObject fuer AutoFormat an der Tabelle
@@ -1478,7 +1478,7 @@ void SwUndoAttrTbl::Redo( SwUndoIter& rUndoIter )
SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode& rTblNd,
const SwTableAutoFmt& rAFmt )
: SwUndo( UNDO_TABLE_AUTOFMT ),
- nSttNode( rTblNd.GetIndex() ), pUndos( 0 ),
+ nSttNode( rTblNd.GetIndex() ),
bSaveCntntAttr( FALSE )
{
pSaveTbl = new _SaveTable( rTblNd.GetTable() );
@@ -1492,25 +1492,22 @@ SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode& rTblNd,
}
}
-
SwUndoTblAutoFmt::~SwUndoTblAutoFmt()
{
- delete pUndos;
delete pSaveTbl;
}
void SwUndoTblAutoFmt::SaveBoxCntnt( const SwTableBox& rBox )
{
- SwUndoTblNumFmt* p = new SwUndoTblNumFmt( rBox );
- if( !pUndos )
- pUndos = new SwUndos( 8, 8 );
- pUndos->Insert( p, pUndos->Count() );
+ ::boost::shared_ptr<SwUndoTblNumFmt> const p(new SwUndoTblNumFmt(rBox));
+ m_Undos.push_back(p);
}
-void SwUndoTblAutoFmt::UndoRedo( BOOL bUndo, SwUndoIter& rUndoIter )
+void
+SwUndoTblAutoFmt::UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
ASSERT( pTblNd, "kein TabellenNode" );
@@ -1520,29 +1517,31 @@ void SwUndoTblAutoFmt::UndoRedo( BOOL bUndo, SwUndoIter& rUndoIter )
if( bSaveCntntAttr )
pOrig->SaveCntntAttrs( &rDoc );
- if( pUndos && bUndo )
- for( USHORT n = pUndos->Count(); n; )
- pUndos->GetObject( --n )->Undo( rUndoIter );
+ if (bUndo)
+ {
+ for (size_t n = m_Undos.size(); 0 < n; --n)
+ {
+ m_Undos.at(n-1)->UndoImpl(rContext);
+ }
+ }
pSaveTbl->RestoreAttr( pTblNd->GetTable(), !bUndo );
delete pSaveTbl;
pSaveTbl = pOrig;
}
-void SwUndoTblAutoFmt::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblAutoFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- UndoRedo( TRUE, rUndoIter );
+ UndoRedo(true, rContext);
}
-
-void SwUndoTblAutoFmt::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblAutoFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
- UndoRedo( FALSE, rUndoIter );
+ UndoRedo(false, rContext);
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
const SwSelBoxes& rBoxes,
@@ -1766,13 +1765,13 @@ void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd )
}
-void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode );
- SwTableNode* pTblNd = rDoc.GetNodes()[ aIdx ]->GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode();
+ OSL_ENSURE( pTblNd, "SwUndoTblNdsChg: no TableNode" );
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
aMsgHnt.eFlags = TBL_BOXPTR;
@@ -1885,9 +1884,9 @@ void SwUndoTblNdsChg::Undo( SwUndoIter& rUndoIter )
}
-void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
ASSERT( pTblNd, "kein TabellenNode" );
@@ -1956,7 +1955,8 @@ void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
TblChgMode eOldMode = rTbl.GetTblChgMode();
rTbl.SetTblChgMode( (TblChgMode)nCount );
- rDoc.DoUndo( TRUE ); // wir brauchen die SaveSections!
+ // need the SaveSections!
+ rDoc.GetIDocumentUndoRedo().DoUndo( true );
SwUndoTblNdsChg* pUndo = 0;
switch( nSetColType & 0xff )
@@ -1984,7 +1984,7 @@ void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
delete pUndo;
}
- rDoc.DoUndo( FALSE );
+ rDoc.GetIDocumentUndoRedo().DoUndo( false );
rTbl.SetTblChgMode( eOldMode );
}
@@ -1998,8 +1998,7 @@ void SwUndoTblNdsChg::Redo( SwUndoIter& rUndoIter )
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
SwUndoTblMerge::SwUndoTblMerge( const SwPaM& rTblSel )
: SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTblSel ), pHistory( 0 )
@@ -2011,7 +2010,6 @@ SwUndoTblMerge::SwUndoTblMerge( const SwPaM& rTblSel )
nTblNode = pTblNd->GetIndex();
}
-
SwUndoTblMerge::~SwUndoTblMerge()
{
delete pSaveTbl;
@@ -2019,14 +2017,13 @@ SwUndoTblMerge::~SwUndoTblMerge()
delete pHistory;
}
-
-void SwUndoTblMerge::Undo( SwUndoIter& rUndoIter )
+void SwUndoTblMerge::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rUndoIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwNodeIndex aIdx( rDoc.GetNodes(), nTblNode );
- SwTableNode* pTblNd = rDoc.GetNodes()[ aIdx ]->GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode();
+ OSL_ENSURE( pTblNd, "SwUndoTblMerge: no TableNode" );
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
aMsgHnt.eFlags = TBL_BOXPTR;
@@ -2094,7 +2091,7 @@ CHECKTABLE(pTblNd->GetTable())
pTxtNd = rDoc.GetNodes()[ pUndo->GetDestSttNode() ]->GetTxtNode();
nDelPos = pUndo->GetDestSttCntnt() - 1;
}
- pUndo->Undo( rUndoIter );
+ pUndo->UndoImpl(rContext);
if( pUndo->IsMoveRange() )
{
// den ueberfluessigen Node loeschen
@@ -2167,7 +2164,7 @@ CHECKTABLE(pTblNd->GetTable())
}
// nTblNode = pTblNd->GetIndex();
- SwPaM* pPam = rUndoIter.pAktPam;
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nSttNode;
pPam->GetPoint()->nContent.Assign( pPam->GetCntntNode(), nSttCntnt );
@@ -2178,27 +2175,21 @@ CHECKTABLE(pTblNd->GetTable())
ClearFEShellTabCols();
}
-
-void SwUndoTblMerge::Redo( SwUndoIter& rUndoIter )
+void SwUndoTblMerge::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rUndoIter.pAktPam;
- SwDoc& rDoc = *pPam->GetDoc();
-
- SetPaM( *pPam );
- rDoc.MergeTbl( *pPam );
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM & rPam( AddUndoRedoPaM(rContext) );
+ rDoc.MergeTbl(rPam);
}
void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos )
{
SwNodeIndex aTmp( rRg.aStart, -1 ), aTmp2( rPos, -1 );
SwUndoMove* pUndo = new SwUndoMove( pDoc, rRg, rPos );
- sal_Bool bDoesUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
pDoc->MoveNodeRange( rRg, rPos, (pSaveTbl->IsNewModel()) ?
IDocumentContentOperations::DOC_NO_DELFRMS :
IDocumentContentOperations::DOC_MOVEDEFAULT );
- if( bDoesUndo )
- pDoc->DoUndo( sal_True );
aTmp++;
aTmp2++;
pUndo->SetDestRange( aTmp2, rPos, aTmp );
@@ -2206,7 +2197,6 @@ void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& r
pMoves->Insert( pUndo, pMoves->Count() );
}
-
void SwUndoTblMerge::SetSelBoxes( const SwSelBoxes& rBoxes )
{
// die Selektion merken
@@ -2237,8 +2227,8 @@ void SwUndoTblMerge::SaveCollection( const SwTableBox& rBox )
pHistory->CopyFmtAttr( *pCNd->GetpSwAttrSet(), aIdx.GetIndex() );
}
-/* */
+//////////////////////////////////////////////////////////////////////////
SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox,
const SfxItemSet* pNewSet )
@@ -2301,18 +2291,17 @@ SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox,
DELETEZ( pHistory );
}
-
SwUndoTblNumFmt::~SwUndoTblNumFmt()
{
delete pHistory;
delete pBoxSet;
}
-void SwUndoTblNumFmt::Undo( SwUndoIter& rIter )
+void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
ASSERT( pBoxSet, "Where's the stored item set?" )
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwStartNode* pSttNd = rDoc.GetNodes()[ nNode ]->
FindSttNodeByType( SwTableBoxStartNode );
ASSERT( pSttNd, "ohne StartNode kein TabellenBox" );
@@ -2358,7 +2347,7 @@ void SwUndoTblNumFmt::Undo( SwUndoIter& rIter )
pHistory->SetTmpEnd( nTmpEnd );
}
- SwPaM* pPam = rIter.pAktPam;
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nNode + 1;
pPam->GetPoint()->nContent.Assign( pTxtNd, 0 );
@@ -2401,19 +2390,19 @@ RedlineModeInternGuard::~RedlineModeInternGuard()
-void SwUndoTblNumFmt::Redo( SwUndoIter& rIter )
+void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
// konnte die Box veraendert werden ?
if( !pBoxSet )
return ;
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
- SwPaM* pPam = rIter.pAktPam;
pPam->DeleteMark();
pPam->GetPoint()->nNode = nNode;
- SwNode* pNd = rDoc.GetNodes()[ pPam->GetPoint()->nNode ];
+ SwNode * pNd = & pPam->GetPoint()->nNode.GetNode();
SwStartNode* pSttNd = pNd->FindSttNodeByType( SwTableBoxStartNode );
ASSERT( pSttNd, "ohne StartNode kein TabellenBox" );
SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTblBox(
@@ -2501,7 +2490,8 @@ void SwUndoTblNumFmt::SetBox( const SwTableBox& rBox )
nNode = rBox.GetSttIdx();
}
-/* */
+
+//////////////////////////////////////////////////////////////////////////
_UndoTblCpyTbl_Entry::_UndoTblCpyTbl_Entry( const SwTableBox& rBox )
: nBoxIdx( rBox.GetSttIdx() ), nOffset( 0 ),
@@ -2528,9 +2518,9 @@ SwUndoTblCpyTbl::~SwUndoTblCpyTbl()
delete pInsRowUndo;
}
-void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
+void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
_DEBUG_REDLINE( &rDoc )
SwTableNode* pTblNd = 0;
@@ -2559,23 +2549,29 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
// There are a couple of different situations to consider during redlining
if( pEntry->pUndo )
{
- SwUndoDelete *pUnDel = (SwUndoDelete*)pEntry->pUndo;
- if( UNDO_REDLINE == pUnDel->GetId() )
+ SwUndoDelete *const pUndoDelete =
+ dynamic_cast<SwUndoDelete*>(pEntry->pUndo);
+ SwUndoRedlineDelete *const pUndoRedlineDelete =
+ dynamic_cast<SwUndoRedlineDelete*>(pEntry->pUndo);
+ OSL_ASSERT(pUndoDelete || pUndoRedlineDelete);
+ if (pUndoRedlineDelete)
{
// The old content was not empty or he has been merged with the new content
bDeleteCompleteParagraph = !pEntry->bJoin; // bJoin is set when merged
// Set aTmpIdx to the beginning fo the old content
- SwNodeIndex aTmpIdx( *pEndNode, pUnDel->NodeDiff()-1 );
+ SwNodeIndex aTmpIdx( *pEndNode,
+ pUndoRedlineDelete->NodeDiff()-1 );
SwTxtNode *pTxt = aTmpIdx.GetNode().GetTxtNode();
if( pTxt )
{
aPam.GetPoint()->nNode = *pTxt;
- aPam.GetPoint()->nContent.Assign( pTxt, pUnDel->ContentStart() );
+ aPam.GetPoint()->nContent.Assign( pTxt,
+ pUndoRedlineDelete->ContentStart() );
}
else
*aPam.GetPoint() = SwPosition( aTmpIdx );
}
- else if( pUnDel->IsDelFullPara() )
+ else if (pUndoDelete && pUndoDelete->IsDelFullPara())
{
// When the old content was an empty paragraph, but could not be joined
// with the new content (e.g. because of a section or table)
@@ -2599,8 +2595,9 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
if( pEntry->pUndo )
{
- pEntry->pUndo->Undo( rIter );
+ pEntry->pUndo->UndoImpl(rContext);
delete pEntry->pUndo;
+ pEntry->pUndo = 0;
}
if( bShiftPam )
{
@@ -2623,8 +2620,9 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
pUndo = new SwUndoDelete( aPam, true );
if( pEntry->pUndo )
{
- pEntry->pUndo->Undo( rIter );
+ pEntry->pUndo->UndoImpl(rContext);
delete pEntry->pUndo;
+ pEntry->pUndo = 0;
}
}
pEntry->pUndo = pUndo;
@@ -2660,17 +2658,21 @@ void SwUndoTblCpyTbl::Undo( SwUndoIter& rIter )
}
if( pInsRowUndo )
- pInsRowUndo->Undo( rIter );
+ {
+ pInsRowUndo->UndoImpl(rContext);
+ }
_DEBUG_REDLINE( &rDoc )
}
-void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
+void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
_DEBUG_REDLINE( &rDoc )
if( pInsRowUndo )
- pInsRowUndo->Redo( rIter );
+ {
+ pInsRowUndo->RedoImpl(rContext);
+ }
SwTableNode* pTblNd = 0;
for( USHORT n = 0; n < pArr->Count(); ++n )
@@ -2691,7 +2693,7 @@ void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
SwUndo* pUndo = IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ? 0 : new SwUndoDelete( aPam, TRUE );
if( pEntry->pUndo )
{
- pEntry->pUndo->Undo( rIter );
+ pEntry->pUndo->UndoImpl(rContext);
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) )
{
// PrepareRedline has to be called with the beginning of the old content
@@ -2699,8 +2701,12 @@ void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
// by the Undo operation to this point.
// Otherwise aInsIdx has been moved during the Undo operation
if( pEntry->bJoin )
- pUndo = PrepareRedline( &rDoc, rBox, *rIter.pAktPam->GetPoint(),
+ {
+ SwPaM const& rLastPam =
+ rContext.GetCursorSupplier().GetCurrentShellCursor();
+ pUndo = PrepareRedline( &rDoc, rBox, *rLastPam.GetPoint(),
pEntry->bJoin, true );
+ }
else
{
SwPosition aTmpPos( aInsIdx );
@@ -2708,6 +2714,7 @@ void SwUndoTblCpyTbl::Redo( SwUndoIter& rIter )
}
}
delete pEntry->pUndo;
+ pEntry->pUndo = 0;
}
pEntry->pUndo = pUndo;
// b62341295: Redline for copying tables - End.
@@ -2899,7 +2906,8 @@ BOOL SwUndoTblCpyTbl::IsEmpty() const
return !pInsRowUndo && !pArr->Count();
}
-/* */
+
+//////////////////////////////////////////////////////////////////////////
SwUndoCpyTbl::SwUndoCpyTbl()
: SwUndo( UNDO_CPYTBL ), pDel( 0 ), nTblNode( 0 )
@@ -2911,9 +2919,9 @@ SwUndoCpyTbl::~SwUndoCpyTbl()
delete pDel;
}
-void SwUndoCpyTbl::Undo( SwUndoIter& rIter )
+void SwUndoCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc& rDoc = rIter.GetDoc();
+ SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNode ]->GetTableNode();
// harte SeitenUmbrueche am nachfolgenden Node verschieben
@@ -2936,14 +2944,14 @@ void SwUndoCpyTbl::Undo( SwUndoIter& rIter )
pDel = new SwUndoDelete( aPam, TRUE );
}
-void SwUndoCpyTbl::Redo( SwUndoIter& rIter )
+void SwUndoCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- pDel->Undo( rIter );
+ pDel->UndoImpl(rContext);
delete pDel, pDel = 0;
}
-/* */
+//////////////////////////////////////////////////////////////////////////
SwUndoSplitTbl::SwUndoSplitTbl( const SwTableNode& rTblNd,
SwSaveRowSpan* pRowSp, USHORT eMode, BOOL bNewSize )
@@ -2970,10 +2978,10 @@ SwUndoSplitTbl::~SwUndoSplitTbl()
delete mpSaveRowSpan;
}
-void SwUndoSplitTbl::Undo( SwUndoIter& rIter )
+void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
SwNodeIndex& rIdx = pPam->GetPoint()->nNode;
@@ -3035,10 +3043,10 @@ void SwUndoSplitTbl::Undo( SwUndoIter& rIter )
ClearFEShellTabCols();
}
-void SwUndoSplitTbl::Redo( SwUndoIter& rIter )
+void SwUndoSplitTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nTblNode;
@@ -3047,10 +3055,10 @@ void SwUndoSplitTbl::Redo( SwUndoIter& rIter )
ClearFEShellTabCols();
}
-void SwUndoSplitTbl::Repeat( SwUndoIter& rIter )
+void SwUndoSplitTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
+ SwDoc *const pDoc = & rContext.GetDoc();
pDoc->SplitTable( *pPam->GetPoint(), nMode, bCalcNewSize );
ClearFEShellTabCols();
@@ -3065,7 +3073,8 @@ void SwUndoSplitTbl::SaveFormula( SwHistory& rHistory )
pHistory->Move( 0, &rHistory );
}
-/* */
+
+//////////////////////////////////////////////////////////////////////////
SwUndoMergeTbl::SwUndoMergeTbl( const SwTableNode& rTblNd,
const SwTableNode& rDelTblNd,
@@ -3092,10 +3101,10 @@ SwUndoMergeTbl::~SwUndoMergeTbl()
delete pHistory;
}
-void SwUndoMergeTbl::Undo( SwUndoIter& rIter )
+void SwUndoMergeTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
SwNodeIndex& rIdx = pPam->GetPoint()->nNode;
@@ -3159,10 +3168,10 @@ void SwUndoMergeTbl::Undo( SwUndoIter& rIter )
}
}
-void SwUndoMergeTbl::Redo( SwUndoIter& rIter )
+void SwUndoMergeTbl::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
pPam->DeleteMark();
pPam->GetPoint()->nNode = nTblNode;
@@ -3176,10 +3185,10 @@ void SwUndoMergeTbl::Redo( SwUndoIter& rIter )
ClearFEShellTabCols();
}
-void SwUndoMergeTbl::Repeat( SwUndoIter& rIter )
+void SwUndoMergeTbl::RepeatImpl(::sw::RepeatContext & rContext)
{
- SwPaM* pPam = rIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam = & rContext.GetRepeatPaM();
pDoc->MergeTable( *pPam->GetPoint(), bWithPrev, nMode );
ClearFEShellTabCols();
@@ -3192,8 +3201,8 @@ void SwUndoMergeTbl::SaveFormula( SwHistory& rHistory )
pHistory->Move( 0, &rHistory );
}
-/* */
+//////////////////////////////////////////////////////////////////////////
void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos )
{
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index e9e7ce1e0e02..cf410a04032d 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -28,16 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <pam.hxx>
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <redline.hxx>
@@ -45,7 +45,7 @@
SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
: SwUndo( nUndoId ), SwUndRng( rPam ),
- pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pFlyUndos(0), pRedlData( 0 ),
+ pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pRedlData( 0 ),
bSttWasTxtNd( TRUE ), nNdDiff( 0 ), pPos( 0 ), nSetPos( 0 )
{
pHistory = new SwHistory;
@@ -116,7 +116,6 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys,
{
// dann alle neuen Flys zusammen sammeln !!
SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
- pFlyUndos = new SwUndos();
USHORT nFndPos, nArrLen = pDoc->GetSpzFrmFmts()->Count();
for( USHORT n = 0; n < nArrLen; ++n )
{
@@ -130,16 +129,15 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys,
if( !pFrmFmts ||
USHRT_MAX == ( nFndPos = pFrmFmts->GetPos( pFmt ) ) )
{
- SwUndoInsLayFmt* pFlyUndo = new SwUndoInsLayFmt( pFmt,0,0 );
- pFlyUndos->Insert( pFlyUndo, pFlyUndos->Count() );
+ ::boost::shared_ptr<SwUndoInsLayFmt> const pFlyUndo(
+ new SwUndoInsLayFmt(pFmt, 0, 0));
+ m_FlyUndos.push_back(pFlyUndo);
}
else
pFrmFmts->Remove( nFndPos );
}
}
delete pFrmFmts, pFrmFmts = 0;
- if( !pFlyUndos->Count() )
- delete pFlyUndos, pFlyUndos = 0;
}
}
@@ -166,18 +164,14 @@ SwUndoInserts::~SwUndoInserts()
delete pPos;
}
delete pFrmFmts;
- delete pFlyUndos;
delete pRedlData;
}
-void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
+void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM * pPam = rUndoIter.pAktPam;
- SwDoc* pDoc = pPam->GetDoc();
- SetPaM( rUndoIter );
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ SwDoc *const pDoc = & rContext.GetDoc();
+ SwPaM *const pPam = & AddUndoRedoPaM(rContext);
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
pDoc->DeleteRedline( *pPam, true, USHRT_MAX );
@@ -200,7 +194,7 @@ void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
}
RemoveIdxFromRange( *pPam, FALSE );
- SetPaM( rUndoIter );
+ SetPaM(*pPam);
// sind Fussnoten oder CntntFlyFrames im Text ??
nSetPos = pHistory->Count();
@@ -218,11 +212,13 @@ void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
}
}
- if( pFlyUndos )
+ if (m_FlyUndos.size())
{
ULONG nTmp = pPam->GetPoint()->nNode.GetIndex();
- for( USHORT n = pFlyUndos->Count(); n; )
- (*pFlyUndos)[ --n ]->Undo( rUndoIter );
+ for (size_t n = m_FlyUndos.size(); 0 < n; --n)
+ {
+ m_FlyUndos[ n-1 ]->UndoImpl(rContext);
+ }
nNdDiff += nTmp - pPam->GetPoint()->nNode.GetIndex();
}
@@ -268,16 +264,12 @@ void SwUndoInserts::Undo( SwUndoIter& rUndoIter )
pHistory->TmpRollback( pDoc, 0, false );
}
}
-
- pDoc->DoUndo( bUndo );
- if( pPam != rUndoIter.pAktPam )
- delete pPam;
}
-void SwUndoInserts::Redo( SwUndoIter& rUndoIter )
+void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext)
{
// setze noch den Cursor auf den Redo-Bereich
- SwPaM* pPam = rUndoIter.pAktPam;
+ SwPaM *const pPam = & AddUndoRedoPaM(rContext);
SwDoc* pDoc = pPam->GetDoc();
pPam->DeleteMark();
pPam->GetPoint()->nNode = nSttNode - nNdDiff;
@@ -321,9 +313,10 @@ void SwUndoInserts::Redo( SwUndoIter& rUndoIter )
pTxtNd->ChgFmtColl( pLastNdColl );
}
- if( pFlyUndos )
- for( USHORT n = pFlyUndos->Count(); n; )
- (*pFlyUndos)[ --n ]->Redo( rUndoIter );
+ for (size_t n = m_FlyUndos.size(); 0 < n; --n)
+ {
+ m_FlyUndos[ n-1 ]->RedoImpl(rContext);
+ }
pHistory->Rollback( pDoc, nSetPos );
@@ -339,21 +332,16 @@ void SwUndoInserts::Redo( SwUndoIter& rUndoIter )
pDoc->SplitRedline( *pPam );
}
-void SwUndoInserts::Repeat( SwUndoIter& rUndoIter )
+void SwUndoInserts::RepeatImpl(::sw::RepeatContext & rContext)
{
- if( GetId() == rUndoIter.GetLastUndoId() )
- return;
-
- SwPaM aPam( *rUndoIter.pAktPam->GetPoint() );
+ SwPaM aPam( rContext.GetDoc().GetNodes().GetEndOfContent() );
SetPaM( aPam );
- aPam.GetDoc()->CopyRange( aPam, *rUndoIter.pAktPam->GetPoint(), false );
-
- rUndoIter.pLastUndoObj = this;
+ SwPaM & rRepeatPaM( rContext.GetRepeatPaM() );
+ aPam.GetDoc()->CopyRange( aPam, *rRepeatPaM.GetPoint(), false );
}
-/* */
-
+//////////////////////////////////////////////////////////////////////////
SwUndoInsDoc::SwUndoInsDoc( const SwPaM& rPam )
: SwUndoInserts( UNDO_INSDOKUMENT, rPam )
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 590ddb6e803e..7a67b7748c97 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -40,12 +40,11 @@
#include <IMark.hxx>
#include <crossrefbookmark.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <swundo.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-#include <undobj.hxx>
+#include <SwRewriter.hxx>
#include <docsh.hxx>
@@ -376,9 +375,11 @@ throw (uno::RuntimeException)
aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS));
aRewriter.AddRule(UNDO_ARG3, lcl_QuoteName(rName));
- m_pImpl->m_pDoc->StartUndo(UNDO_BOOKMARK_RENAME, &aRewriter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(
+ UNDO_BOOKMARK_RENAME, &aRewriter);
pMarkAccess->renameMark(m_pImpl->m_pRegisteredBookmark, rName);
- m_pImpl->m_pDoc->EndUndo(UNDO_BOOKMARK_RENAME, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(
+ UNDO_BOOKMARK_RENAME, &aRewriter);
}
OUString SAL_CALL
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 9b60693c6755..5c8669691aba 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -43,6 +43,7 @@
#include <unoframe.hxx>
#include <unocrsr.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <fmtftn.hxx>
#include <fmtpdsc.hxx>
@@ -708,7 +709,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
if( rPam.GetNext() != &rPam ) // Mehrfachselektion ?
{
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rPam );
SwPaM aPam( *rPam.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
@@ -718,7 +719,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
pDoc->SetNumRule( aRangeArr.SetPam( n, aPam ), aRule, false );
// <--
}
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
{
@@ -805,12 +806,12 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa
if( rPam.GetNext() != &rPam ) // Mehrfachselektion ?
{
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rPam );
SwPaM aPam( *rPam.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
pDoc->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), 1 );
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
pDoc->SetNodeNumStart( *rPam.GetPoint(), 0 );
@@ -1008,6 +1009,8 @@ sal_Bool DocInsertStringSplitCR(
IDocumentContentOperations::INS_EMPTYEXPAND)
: IDocumentContentOperations::INS_EMPTYEXPAND;
+ // grouping done in InsertString is intended for typing, not API calls
+ ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
OUString aTxt;
xub_StrLen nStartIdx = 0;
SwTxtNode* const pTxtNd =
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index ab5d68910769..005ead8cddd1 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -42,6 +42,7 @@
#include <svx/svditer.hxx>
#include <swunohelper.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <fmtcntnt.hxx>
#include <fmtflcnt.hxx>
#include <txtatr.hxx>
@@ -866,7 +867,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
if( !bFlyInCnt )
{
UnoActionContext aContext(pDoc);
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwDrawContact* pContact = pDoc->GroupSelection( *pPage->GetDrawView() );
pDoc->ChgAnchor(
@@ -880,7 +881,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
uno::Reference< uno::XInterface > xInt = pPage->GetInterface( pContact->GetMaster() );
xRet = uno::Reference< drawing::XShapeGroup >(xInt, uno::UNO_QUERY);
}
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
}
pPage->RemovePageView();
@@ -903,13 +904,13 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG
{
pPage->PreUnGroup(xShapeGroup);
UnoActionContext aContext(pDoc);
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
pDoc->UnGroupSelection( *pPage->GetDrawView() );
pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(),
FLY_AT_PARA/*int eAnchorId*/,
sal_True, sal_False );
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
pPage->RemovePageView();
}
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 3a3df506b457..40b5afa67367 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -45,6 +45,7 @@
#include <memory>
#include <hints.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
#include <editsh.hxx>
#include <swcli.hxx>
@@ -1656,7 +1657,8 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
}
}
else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_MODEL == pEntry->nWID||
- FN_UNO_COMPONENT == pEntry->nWID ||FN_UNO_STREAM_NAME == pEntry->nWID)
+ FN_UNO_COMPONENT == pEntry->nWID ||FN_UNO_STREAM_NAME == pEntry->nWID||
+ FN_EMBEDDED_OBJECT == pEntry->nWID)
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
@@ -1677,7 +1679,15 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
{
uno::Reference < lang::XComponent > xComp( xIP->getComponent(), uno::UNO_QUERY );
uno::Reference < frame::XModel > xModel( xComp, uno::UNO_QUERY );
- if ( xModel.is() )
+ if ( FN_EMBEDDED_OBJECT == pEntry->nWID )
+ {
+ // ensure the
+ ASSERT( pDoc->GetDocShell(), "no doc shell => no client site" );
+ if ( pDoc->GetDocShell() )
+ pDoc->GetDocShell()->GetIPClient( svt::EmbeddedObjectRef( xIP, embed::Aspects::MSOLE_CONTENT ) );
+ aAny <<= xIP;
+ }
+ else if ( xModel.is() )
aAny <<= xModel;
else if ( FN_UNO_COMPONENT == pEntry->nWID )
aAny <<= xComp;
@@ -2311,7 +2321,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
// xIPObj->OnDocumentPrinterChanged( pDoc->getPrinter( false ) );
UnoActionContext aAction(pDoc);
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
if(!bSizeFound)
{
//TODO/LATER: from where do I get a ViewAspect? And how do I transport it to the OLENode?
@@ -2358,7 +2368,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
pFmt2 = pDoc->Insert(aPam, xObjRef, &aFrmSet, NULL, NULL );
ASSERT( pFmt2, "Doc->Insert(notxt) failed." );
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
pFmt2->Add(this);
if(sName.Len())
pDoc->SetFlyName((SwFlyFrmFmt&)*pFmt2, sName);
@@ -2368,11 +2378,11 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
{
::rtl::OUString sStreamName;
(*pStreamName) >>= sStreamName;
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
SwFlyFrmFmt* pFrmFmt = 0;
pFrmFmt = pDoc->InsertOLE( aPam, sStreamName, embed::Aspects::MSOLE_CONTENT, &aFrmSet, NULL, NULL );
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
pFrmFmt->Add(this);
if(sName.Len())
pDoc->SetFlyName((SwFlyFrmFmt&)*pFrmFmt, sName);
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 765b1ae37485..a52b6325535a 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1150,6 +1150,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_GRAPHIC_URL), FN_UNO_REPLACEMENT_GRAPHIC_URL, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0 },
{ SW_PROP_NMID(UNO_NAME_GRAPHIC), FN_UNO_REPLACEMENT_GRAPHIC, CPPU_E2T(CPPUTYPE_REFXGRAPHIC), PropertyAttribute::MAYBEVOID, 0 },
{ SW_PROP_NMID(UNO_NAME_COMPONENT),FN_UNO_COMPONENT, CPPU_E2T(CPPUTYPE_REFCOMPONENT), PropertyAttribute::READONLY, 0},
+ { SW_PROP_NMID(UNO_NAME_EMBEDDED_OBJECT),FN_EMBEDDED_OBJECT, CPPU_E2T(CPPUTPYE_REFEMBEDDEDOBJECT), PropertyAttribute::READONLY, 0},
// { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 },
{0,0,0,0,0,0}
};
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index f572b5f3e91c..73f5c9736018 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -40,6 +40,7 @@
#include <IMark.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <istyleaccess.hxx>
#include <ndtxt.hxx>
#include <ndnotxt.hxx>
@@ -66,9 +67,7 @@
#include <fmtfld.hxx>
#include <fmtpdsc.hxx>
#include <pagedesc.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <poolfmt.hxx>
#include <edimp.hxx>
#include <fchrfmt.hxx>
@@ -350,13 +349,13 @@ throw (lang::IllegalArgumentException)
SwTxtFmtColl *const pLocal = pStyle->GetCollection();
UnoActionContext aAction(pDoc);
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPaM *pTmpCrsr = &rPaM;
do {
pDoc->SetTxtFmtColl(*pTmpCrsr, pLocal);
pTmpCrsr = static_cast<SwPaM*>(pTmpCrsr->GetNext());
} while ( pTmpCrsr != &rPaM );
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
/* -----------------06.07.98 07:38-------------------
@@ -427,7 +426,7 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue)
if( rCrsr.GetNext() != &rCrsr ) // Mehrfachselektion ?
{
- pDoc->StartUndo( UNDO_START, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rCrsr );
SwPaM aPam( *rCrsr.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
@@ -436,7 +435,7 @@ lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue)
pDoc->SetNodeNumStart(*aRangeArr.SetPam( n, aPam ).GetPoint(),
nStt );
}
- pDoc->EndUndo( UNDO_END, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
{
@@ -457,7 +456,7 @@ lcl_setCharFmtSequence(SwPaM & rPam, uno::Any const& rValue)
for (sal_Int32 nStyle = 0; nStyle < aCharStyles.getLength(); nStyle++)
{
uno::Any aStyle;
- rPam.GetDoc()->StartUndo(UNDO_START, NULL);
+ rPam.GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_START, NULL);
aStyle <<= aCharStyles.getConstArray()[nStyle];
// create a local set and apply each format directly
SfxItemSet aSet(rPam.GetDoc()->GetAttrPool(),
@@ -468,7 +467,7 @@ lcl_setCharFmtSequence(SwPaM & rPam, uno::Any const& rValue)
SwUnoCursorHelper::SetCrsrAttr(rPam, aSet, (nStyle)
? nsSetAttrMode::SETATTR_DONTREPLACE
: nsSetAttrMode::SETATTR_DEFAULT);
- rPam.GetDoc()->EndUndo(UNDO_START, NULL);
+ rPam.GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_START, NULL);
}
return true;
}
@@ -931,7 +930,7 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
SwDoc* pDoc = pUnoCrsr->GetDoc();
UnoActionContext aAction(pDoc);
const xub_StrLen nTxtLen = rText.getLength();
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
SwCursor * pCurrent = pUnoCrsr;
do
{
@@ -953,7 +952,7 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
}
pCurrent = static_cast<SwCursor *>(pCurrent->GetNext());
} while (pCurrent != pUnoCrsr);
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
}
}
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index d9334e97c841..0a6b5d1cfce4 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -37,6 +37,7 @@
#include <bookmrk.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndtxt.hxx>
#include <ndnotxt.hxx>
#include <unocrsr.hxx>
@@ -357,7 +358,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
UnoActionContext aAction(pDoc);
if (rPam.GetNext() != &rPam) // Ring of Cursors
{
- pDoc->StartUndo(UNDO_INSATTR, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL);
SwPaM *pCurrent = &rPam;
do
@@ -371,7 +372,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
pCurrent= static_cast<SwPaM *>(pCurrent->GetNext());
} while (pCurrent != &rPam);
- pDoc->EndUndo(UNDO_INSATTR, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSATTR, NULL);
}
else
{
@@ -923,7 +924,7 @@ throw (uno::RuntimeException)
if (GetPositions(aCursor))
{
UnoActionContext aAction(& m_pImpl->m_rDoc);
- m_pImpl->m_rDoc.StartUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_rDoc.GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
if (aCursor.HasMark())
{
m_pImpl->m_rDoc.DeleteAndJoin(aCursor);
@@ -938,7 +939,7 @@ throw (uno::RuntimeException)
aCursor.Left(rText.getLength(), CRSR_SKIP_CHARS, FALSE, FALSE);
}
SetPositions(aCursor);
- m_pImpl->m_rDoc.EndUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
}
}
@@ -1794,7 +1795,7 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
// Start/EndAction
SwDoc *const pDoc = rCursor.GetDoc();
UnoActionContext aAction(pDoc);
- pDoc->StartUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
if (rCursor.HasMark())
{
pDoc->DeleteAndJoin(rCursor);
@@ -1809,7 +1810,7 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
SwUnoCursorHelper::SelectPam(rCursor, true);
rCursor.Left(rString.getLength(), CRSR_SKIP_CHARS, FALSE, FALSE);
}
- pDoc->EndUndo(UNDO_INSERT, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
}
/******************************************************************
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 049ccfe42ed7..e4351ce1e571 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -779,6 +779,7 @@ const SwPropNameTab aPropNameTab = {
/* 0737 UNO_NAME_DESCRIPTION */ {MAP_CHAR_LEN("Description")},
/* 0738 UNO_NAME_META */ {MAP_CHAR_LEN("InContentMetadata")},
/* 0739 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
+/* 0740 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
};
const SwPropNameLen& SwGetPropName( USHORT nId )
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 2810b500ea4b..b8d1e3318ddf 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -50,6 +50,7 @@
#include <unocrsr.hxx>
#include <section.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
#include <sfx2/docfile.hxx>
#include <docary.hxx>
@@ -327,7 +328,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
//das muss jetzt sal_True liefern
::sw::XTextRangeToSwPaM(aPam, xTextRange);
UnoActionContext aCont(pDoc);
- pDoc->StartUndo( UNDO_INSSECTION, NULL );
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_INSSECTION, NULL );
if (!m_pImpl->m_sName.getLength())
{
@@ -456,7 +457,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
// Undo-Klammerung hier beenden
- pDoc->EndUndo( UNDO_INSSECTION, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_INSSECTION, NULL );
m_pImpl->m_pProps.reset();
m_pImpl->m_bIsDescriptor = false;
}
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 252be1efa9ba..49030c7e8eeb 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -47,6 +47,7 @@
#include <editeng/paperinf.hxx>
#include <pagedesc.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <charfmt.hxx>
#include <cmdid.h>
@@ -3397,15 +3398,13 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
}
if(aBaseImpl.HasItemSet())
{
- BOOL bDoesUndo = GetDoc()->DoesUndo();
- if( bDoesUndo )
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
+ if (undoGuard.UndoWasEnabled())
{
// Fix i64460: as long as Undo of page styles with header/footer causes trouble...
- GetDoc()->DelAllUndoObj();
- GetDoc()->DoUndo( FALSE );
+ GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
aBaseImpl.mxNewBase->SetItemSet(aBaseImpl.GetItemSet());
- GetDoc()->DoUndo( bDoesUndo );
}
}
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 856d5e0b44bb..225896af5349 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -45,6 +45,7 @@
#include <hints.hxx>
#include <swtblfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <shellres.hxx>
#include <docary.hxx>
#include <ndole.hxx>
@@ -2505,7 +2506,7 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
{
UnoActionContext aCont( pDoc );
- pDoc->StartUndo(UNDO_EMPTY, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
const SwTable *pTable = 0;
if( 0 != aPam.Start()->nContent.GetIndex() )
{
@@ -2564,9 +2565,8 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
bIsDescriptor = sal_False;
DELETEZ(pTableProps);
}
- pDoc->EndUndo( UNDO_END, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
-
}
else
throw lang::IllegalArgumentException();
@@ -3417,7 +3417,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
SwDoc* pDoc = pFmt->GetDoc();
SwTable* pTable = SwTable::FindTable( pFmt );
SwTableLines &rLines = pTable->GetTabLines();
- pDoc->StartUndo(UNDO_START, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_START, NULL);
for(sal_uInt16 i = 0; i < rLines.Count(); i++)
{
SwTableLine* pLine = rLines.GetObject(i);
@@ -3447,7 +3447,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
}
}
}
- pDoc->EndUndo(UNDO_END, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
}
break;
case FN_UNO_TABLE_COLUMN_SEPARATORS:
@@ -3777,7 +3777,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
aIdx++;
- SwNode *pNd = pFmt->GetDoc()->GetNodes()[aIdx];
+ SwNode *const pNd = & aIdx.GetNode();
if ( pNd->IsOLENode() &&
aOldName == ((SwOLENode*)pNd)->GetChartTblName() )
{
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 3ddcfc1d2ed7..9caf8e5f5d1e 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -28,6 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <stdlib.h>
+
+#include <memory>
+#include <iostream>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
@@ -57,12 +61,12 @@
#include <unoredline.hxx>
#include <unomap.hxx>
#include <unoprnms.hxx>
-#include <undobj.hxx>
#include <unoparagraph.hxx>
#include <unocrsrhelper.hxx>
#include <docsh.hxx>
#include <docary.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <redline.hxx>
#include <swundo.hxx>
#include <section.hxx>
@@ -72,10 +76,7 @@
#include <crsskip.hxx>
#include <ndtxt.hxx>
-#include <memory>
-#include <stdlib.h>
-#include <iostream>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -404,12 +405,9 @@ throw (uno::RuntimeException)
// so the text is inserted before
UnoActionContext aContext(GetDoc());
SwPaM aInsertPam(*pPam->Start());
- const sal_Bool bGroupUndo = GetDoc()->DoesGroupUndo();
- GetDoc()->DoGroupUndo(sal_False);
-
+ ::sw::GroupUndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
SwUnoCursorHelper::DocInsertStringSplitCR(
*GetDoc(), aInsertPam, rString, bForceExpandHints );
- GetDoc()->DoGroupUndo(bGroupUndo);
}
}
@@ -991,7 +989,7 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
throw uno::RuntimeException();
}
- GetDoc()->StartUndo(UNDO_START, NULL);
+ GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_START, NULL);
//insert an empty paragraph at the start and at the end to ensure that
//all tables and sections can be removed by the selecting text::XTextCursor
if (CURSOR_META != m_pImpl->m_eType)
@@ -1029,14 +1027,14 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
const uno::Reference< text::XTextCursor > xRet = CreateCursor();
if(!xRet.is())
{
- GetDoc()->EndUndo(UNDO_END, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
uno::RuntimeException aRuntime;
aRuntime.Message = C2U(cInvalidObject);
throw aRuntime;
}
xRet->gotoEnd(sal_True);
xRet->setString(rString);
- GetDoc()->EndUndo(UNDO_END, NULL);
+ GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
}
//FIXME why is CheckForOwnMember duplicated in some insert methods?
@@ -1373,7 +1371,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
bool bIllegalException = false;
bool bRuntimeException = false;
::rtl::OUString sMessage;
- m_pDoc->StartUndo(UNDO_START , NULL);
+ m_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_START , NULL);
// find end node, go backward - don't skip tables because the new
// paragraph has to be the last node
//aPam.Move( fnMoveBackward, fnGoNode );
@@ -1425,11 +1423,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
}
- m_pDoc->EndUndo(UNDO_END, NULL);
+ m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
if (bIllegalException || bRuntimeException)
{
- SwUndoIter aUndoIter( &aPam, UNDO_EMPTY );
- m_pDoc->Undo(aUndoIter);
+ m_pDoc->GetIDocumentUndoRedo().Undo();
if (bIllegalException)
{
lang::IllegalArgumentException aEx;
@@ -1483,7 +1480,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
bool bIllegalException = false;
bool bRuntimeException = false;
::rtl::OUString sMessage;
- m_pImpl->m_pDoc->StartUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
// SwPaM aPam(*pStartNode->EndOfSectionNode());
//aPam.Move( fnMoveBackward, fnGoNode );
@@ -1538,11 +1535,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
}
- m_pImpl->m_pDoc->EndUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
if (bIllegalException || bRuntimeException)
{
- SwUndoIter aUndoIter( pCursor, UNDO_EMPTY );
- m_pImpl->m_pDoc->Undo(aUndoIter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
if (bIllegalException)
{
lang::IllegalArgumentException aEx;
@@ -1584,7 +1580,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
uno::Reference< text::XTextRange > xRet;
- m_pImpl->m_pDoc->StartUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL);
// find end node, go backward - don't skip tables because the
// new paragraph has to be the last node
SwPaM aPam(*pStartNode->EndOfSectionNode());
@@ -1619,7 +1615,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
throw uno::RuntimeException();
}
}
- m_pImpl->m_pDoc->EndUndo(UNDO_INSERT, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
return xRet;
}
@@ -1666,7 +1662,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
pEndRange->Invalidate();
}
- m_pImpl->m_pDoc->StartUndo( UNDO_START, NULL );
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
bool bIllegalException = false;
bool bRuntimeException = false;
::rtl::OUString sMessage;
@@ -1817,11 +1813,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
- m_pImpl->m_pDoc->EndUndo(UNDO_END, NULL);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, NULL);
if (bIllegalException || bRuntimeException)
{
- SwUndoIter aUndoIter( &aStartPam, UNDO_EMPTY );
- m_pImpl->m_pDoc->Undo(aUndoIter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
if (bIllegalException)
{
lang::IllegalArgumentException aEx;
@@ -2301,8 +2296,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
if(bExcept)
{
- SwUndoIter aUndoIter( &aLastPaM, UNDO_EMPTY );
- m_pImpl->m_pDoc->Undo(aUndoIter);
+ m_pImpl->m_pDoc->GetIDocumentUndoRedo().Undo();
throw lang::IllegalArgumentException();
}
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 6897e6065db0..764a71b76b69 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -71,8 +71,7 @@ SwPagePreviewLayout::SwPagePreviewLayout( ViewShell& _rParentViewShell,
mbBookPreview = false;
mbBookPreviewModeToggled = false;
- const SwPrintData* pPrintData = mrParentViewShell.getIDocumentDeviceAccess()->getPrintData();
- mbPrintEmptyPages = pPrintData ? pPrintData->IsPrintEmptyPages() : true;
+ mbPrintEmptyPages = mrParentViewShell.getIDocumentDeviceAccess()->getPrintData().IsPrintEmptyPages();
}
void SwPagePreviewLayout::_Clear()
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 0bbfc70d5a22..e7addbff63e0 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2731,7 +2731,12 @@ const IDocumentFieldsAccess* ViewShell::getIDocumentFieldsAccess() const { retur
IDocumentContentOperations* ViewShell::getIDocumentContentOperations() { return pDoc; }
IDocumentStylePoolAccess* ViewShell::getIDocumentStylePoolAccess() { return pDoc; }
const IDocumentStatistics* ViewShell::getIDocumentStatistics() const { return pDoc; }
-IDocumentUndoRedo* ViewShell::getIDocumentUndoRedoAccess() { return pDoc; }
+
+IDocumentUndoRedo & ViewShell::GetIDocumentUndoRedo()
+{ return pDoc->GetIDocumentUndoRedo(); }
+IDocumentUndoRedo const& ViewShell::GetIDocumentUndoRedo() const
+{ return pDoc->GetIDocumentUndoRedo(); }
+
// --> OD 2007-11-14 #i83479#
const IDocumentListItems* ViewShell::getIDocumentListItemsAccess() const
{
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index adf37dd11f22..209730ff59dd 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -32,9 +32,8 @@
#include <sfx2/printer.hxx>
#include <rtl/logfile.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
+#include <IDocumentUndoRedo.hxx>
#include <docsh.hxx>
-#endif
#include <viewsh.hxx>
#include <rootfrm.hxx>
#include <viewimp.hxx>
@@ -220,7 +219,8 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
//In Init wird ein Standard-FrmFmt angelegt.
// --> OD 2005-02-11 #i38810#
- if ( !pDoc->IsUndoNoResetModified() && !bIsDocModified )
+ if ( !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified()
+ && !bIsDocModified )
// <--
{
pDoc->ResetModified();
@@ -293,8 +293,10 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
SetHiddenFlag( !pOpt->IsShowHiddenField() );
// in Init wird ein Standard-FrmFmt angelegt
- if( !bModified && !pDoc->IsUndoNoResetModified() )
+ if( !bModified && !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified() )
+ {
pDoc->ResetModified();
+ }
//Format-Cache erweitern.
if ( SwTxtFrm::GetTxtCache()->GetCurMax() < 2550 )
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index df6bcb377fb5..271ca4e4c463 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -60,6 +60,7 @@
#include <pagefrm.hxx>
#include <cntfrm.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <wdocsh.hxx>
#include <fesh.hxx>
#include <pam.hxx>
@@ -270,10 +271,10 @@ void ViewShell::ChgAllPageOrientation( USHORT eOri )
if( rOld.GetLandscape() != bNewOri )
{
SwPageDesc aNew( rOld );
- const sal_Bool bDoesUndo( GetDoc()->DoesUndo() );
- GetDoc()->DoUndo( sal_False );
- GetDoc()->CopyPageDesc(rOld, aNew);
- GetDoc()->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(GetDoc()->GetIDocumentUndoRedo());
+ GetDoc()->CopyPageDesc(rOld, aNew);
+ }
aNew.SetLandscape( bNewOri );
SwFrmFmt& rFmt = aNew.GetMaster();
SwFmtFrmSize aSz( rFmt.GetFrmSize() );
@@ -313,10 +314,10 @@ void ViewShell::ChgAllPageSize( Size &rSz )
{
const SwPageDesc &rOld = const_cast<const SwDoc *>(pMyDoc)->GetPageDesc( i );
SwPageDesc aNew( rOld );
- const sal_Bool bDoesUndo( GetDoc()->DoesUndo() );
- GetDoc()->DoUndo( sal_False );
- GetDoc()->CopyPageDesc( rOld, aNew );
- GetDoc()->DoUndo( bDoesUndo );
+ {
+ ::sw::UndoGuard const ug(GetDoc()->GetIDocumentUndoRedo());
+ GetDoc()->CopyPageDesc( rOld, aNew );
+ }
SwFrmFmt& rPgFmt = aNew.GetMaster();
Size aSz( rSz );
const BOOL bOri = aNew.GetLandscape();
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index b0b69501979e..80ed9630318c 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/date.hxx>
#include <tools/time.hxx>
@@ -46,6 +47,7 @@
#include <swtypes.hxx>
#include <shellio.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <editsh.hxx>
#include <undobj.hxx> // fuer Undo Insert-Dokument
@@ -131,7 +133,7 @@ ULONG SwReader::Read( const Reader& rOptions )
SwUndoInsDoc* pUndo = 0;
BOOL bReadPageDescs = FALSE;
- BOOL bDocUndo = pDoc->DoesUndo();
+ bool const bDocUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
BOOL bSaveUndo = bDocUndo && pCrsr;
if( bSaveUndo )
{
@@ -139,15 +141,15 @@ ULONG SwReader::Read( const Reader& rOptions )
if( 0 != ( bReadPageDescs = po->aOpt.IsPageDescs() ) )
{
bSaveUndo = FALSE;
- pDoc->DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
}
else
{
- pDoc->ClearRedo();
- pDoc->StartUndo( UNDO_INSDOKUMENT, NULL );
+ pDoc->GetIDocumentUndoRedo().ClearRedo();
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_INSDOKUMENT, NULL );
}
}
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
SwNodeIndex aSplitIdx( pDoc->GetNodes() );
@@ -270,7 +272,11 @@ ULONG SwReader::Read( const Reader& rOptions )
if( bSaveUndo )
{
pDoc->SetRedlineMode_intern( eOld );
- pDoc->AppendUndo( new SwUndoInsLayFmt( pFrmFmt,0,0 ) );
+ // UGLY: temp. enable undo
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
+ pDoc->GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsLayFmt( pFrmFmt,0,0 ) );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
}
if( pFrmFmt->GetDepends() )
@@ -314,7 +320,10 @@ ULONG SwReader::Read( const Reader& rOptions )
{
pDoc->SetRedlineMode_intern( eOld );
pUndo->SetInsertRange( *pUndoPam, FALSE );
- pDoc->AppendUndo( pUndo );
+ // UGLY: temp. enable undo
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
+ pDoc->GetIDocumentUndoRedo().AppendUndo( pUndo );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
}
@@ -348,15 +357,13 @@ ULONG SwReader::Read( const Reader& rOptions )
pDoc->ChkCondColls();
pDoc->SetAllUniqueFlyNames();
- if( bReadPageDescs )
- pDoc->DoUndo( TRUE );
- else
+ pDoc->GetIDocumentUndoRedo().DoUndo(bDocUndo);
+ if (!bReadPageDescs)
{
- pDoc->DoUndo( bDocUndo );
if( bSaveUndo )
{
pDoc->SetRedlineMode_intern( eOld );
- pDoc->EndUndo( UNDO_INSDOKUMENT, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_INSDOKUMENT, NULL );
pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
}
}
@@ -535,7 +542,8 @@ SwDoc* Reader::GetTemplateDoc()
{
pTemplate = pDocSh->GetDoc();
pTemplate->SetOle2Link( Link() );
- pTemplate->DoUndo( FALSE ); // always FALSE
+ // always FALSE
+ pTemplate->GetIDocumentUndoRedo().DoUndo( false );
pTemplate->set(IDocumentSettingAccess::BROWSE_MODE, bTmplBrowseMode );
pTemplate->RemoveAllFmtLanguageDependencies();
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 6a6bcc04b34c..c81547e66213 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -271,8 +271,7 @@ void SwHTMLParser::InsertBasicDocEvent( rtl::OUString aEvent, const String& rNam
rtl::OUString aEventName;
- SfxEventConfiguration* pECfg = SFX_APP()->GetEventConfig();
- pECfg->ConfigureEvent( aEvent, SvxMacro( sEvent, sScriptType, eScrType ),
+ SfxEventConfiguration::ConfigureEvent( aEvent, SvxMacro( sEvent, sScriptType, eScrType ),
pDocSh );
}
@@ -281,14 +280,11 @@ void SwHTMLWriter::OutBasic()
if( !bCfgStarBasic )
return;
- SFX_APP()->EnterBasicCall();
-
BasicManager *pBasicMan = pDoc->GetDocShell()->GetBasicManager();
ASSERT( pBasicMan, "Wo ist der Basic-Manager?" );
//JP 17.07.96: Bug 29538 - nur das DocumentBasic schreiben
if( !pBasicMan || pBasicMan == SFX_APP()->GetBasicManager() )
{
- SFX_APP()->LeaveBasicCall();
return;
}
@@ -335,8 +331,6 @@ void SwHTMLWriter::OutBasic()
eDestEnc, &aNonConvertableCharacters );
}
}
-
- SFX_APP()->LeaveBasicCall();
}
static const char* aEventNames[] =
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index 9d05d833c2d2..fdc5f5f90452 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -2077,7 +2077,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/,
// sie nicht schon in einem Rahmen stehen und sonst
// Rahmengebunden.
const SwStartNode *pFlySttNd =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->FindFlyStartNode();
+ pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
if( pFlySttNd )
{
aAnchor.SetType( FLY_AT_FLY );
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx
index e0f8be92c93e..e973ad3df26d 100644
--- a/sw/source/filter/html/htmldraw.cxx
+++ b/sw/source/filter/html/htmldraw.cxx
@@ -183,7 +183,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj,
SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eTopType )
{
const SwStartNode *pFlySttNd =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->FindFlyStartNode();
+ pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
if( pFlySttNd )
{
@@ -446,8 +446,8 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT,
0
};
- const SwTxtNode *pTxtNd = pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->GetTxtNode();
+ SwTxtNode const*const pTxtNd =
+ pPam->GetPoint()->nNode.GetNode().GetTxtNode();
if( pTxtNd )
{
const SfxItemSet& rItemSet = pTxtNd->GetAnyFmtColl().GetAttrSet();
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index a8c0aedc388f..d45202d88c48 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -544,7 +544,7 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height )
SwNode *pANd;
SwTableNode *pTblNd;
if( pAPos &&
- 0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
+ 0 != (pANd = & pAPos->nNode.GetNode()) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
const sal_Bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
@@ -1171,7 +1171,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eTopType )
{
const SwStartNode *pFlySttNd =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->FindFlyStartNode();
+ pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
if( pFlySttNd )
{
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index ac2f348532e8..6494e07f15ad 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -204,7 +204,7 @@ void SwHTMLParser::NewDivision( int nToken )
aDelPam.SetMark();
const SwStartNode *pStNd =
- (const SwStartNode *)pDoc->GetNodes()[rCntntStIdx];
+ (const SwStartNode *) &rCntntStIdx.GetNode();
aDelPam.GetPoint()->nNode = pStNd->EndOfSectionIndex() - 1;
pDoc->DelFullPara( aDelPam );
@@ -261,7 +261,7 @@ void SwHTMLParser::NewDivision( int nToken )
if( !bAppended )
{
SwNodeIndex aPrvNdIdx( pPam->GetPoint()->nNode, -1 );
- if( (pDoc->GetNodes()[aPrvNdIdx])->IsSectionNode() )
+ if (aPrvNdIdx.GetNode().IsSectionNode())
{
AppendTxtNode();
bAppended = sal_True;
@@ -350,8 +350,7 @@ void SwHTMLParser::NewDivision( int nToken )
}
SwTxtNode* pOldTxtNd =
- bAppended ? 0 : pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->GetTxtNode();
+ (bAppended) ? 0 : pPam->GetPoint()->nNode.GetNode().GetTxtNode();
pPam->Move( fnMoveBackward );
@@ -438,7 +437,7 @@ void SwHTMLParser::FixHeaderFooterDistance( sal_Bool bHeader,
ULONG nPrvNxtIdx;
if( bHeader )
{
- nPrvNxtIdx = pDoc->GetNodes()[rCntntStIdx]->EndOfSectionIndex()-1;
+ nPrvNxtIdx = rCntntStIdx.GetNode().EndOfSectionIndex()-1;
}
else
{
@@ -689,7 +688,7 @@ void SwHTMLParser::NewMultiCol()
// node must be inserted. Otherwise, the new section will be
// inserted in front of the old one.
SwNodeIndex aPrvNdIdx( pPam->GetPoint()->nNode, -1 );
- if( (pDoc->GetNodes()[aPrvNdIdx])->IsSectionNode() )
+ if (aPrvNdIdx.GetNode().IsSectionNode())
{
AppendTxtNode();
bAppended = sal_True;
@@ -745,8 +744,7 @@ void SwHTMLParser::NewMultiCol()
}
SwTxtNode* pOldTxtNd =
- bAppended ? 0 : pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->GetTxtNode();
+ (bAppended) ? 0 : pPam->GetPoint()->nNode.GetNode().GetTxtNode();
pPam->Move( fnMoveBackward );
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index df9f43fafa41..111fce4863dc 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2894,7 +2894,7 @@ const SwStartNode *SwHTMLParser::InsertTableSection
const SwStartNode *pStNd;
if( pTable && pTable->bFirstCell )
{
- SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode *const pNd = & pPam->GetPoint()->nNode.GetNode();
pNd->GetTxtNode()->ChgFmtColl( pColl );
pStNd = pNd->FindTableBoxStartNode();
pTable->bFirstCell = sal_False;
@@ -2937,7 +2937,7 @@ const SwStartNode *SwHTMLParser::InsertTableSection( sal_uInt16 nPoolId )
SwTxtFmtColl *pColl = pCSS1Parser->GetTxtCollFromPool( nPoolId );
- SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode *const pNd = & pPam->GetPoint()->nNode.GetNode();
const SwStartNode *pStNd;
if( pTable && pTable->bFirstCell )
{
@@ -3453,7 +3453,7 @@ void _CellSaveStruct::EndNoBreak( const SwPosition& rPos )
}
}
-void _CellSaveStruct::CheckNoBreak( const SwPosition& rPos, SwDoc *pDoc )
+void _CellSaveStruct::CheckNoBreak( const SwPosition& rPos, SwDoc * /*pDoc*/ )
{
if( pCnts && pCurrCnts==pCnts )
{
@@ -3472,8 +3472,7 @@ void _CellSaveStruct::CheckNoBreak( const SwPosition& rPos, SwDoc *pDoc )
}
else if( nNoBreakEndCntntPos + 1 == rPos.nContent.GetIndex() )
{
- const SwTxtNode *pTxtNd =
- pDoc->GetNodes()[rPos.nNode]->GetTxtNode();
+ SwTxtNode const*const pTxtNd(rPos.nNode.GetNode().GetTxtNode());
if( pTxtNd )
{
sal_Unicode cLast =
@@ -3866,11 +3865,11 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
pPam->Move( fnMoveBackward );
}
- const SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode const*const pNd = & pPam->GetPoint()->nNode.GetNode();
if( !bAppended && !bForceFrame )
{
- SwTxtNode* pOldTxtNd =
- pDoc->GetNodes()[pSavePos->nNode]->GetTxtNode();
+ SwTxtNode *const pOldTxtNd =
+ pSavePos->nNode.GetNode().GetTxtNode();
ASSERT( pOldTxtNd, "Wieso stehen wir in keinem Txt-Node?" );
SwFrmFmt *pFrmFmt = pSwTable->GetFrmFmt();
@@ -3939,7 +3938,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
}
}
- const SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode const*const pNd = & pPam->GetPoint()->nNode.GetNode();
const SwStartNode *pStNd = (pTable->bFirstCell ? pNd->FindTableNode()
: pNd->FindTableBoxStartNode() );
@@ -4043,8 +4042,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
// koennen wir erneut eine echte Tabelle aufmachen.
// Wir erkennen das daran, dass wir keinen
// Tabellen-Node mehr finden.
- bTopTable = pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->FindTableNode() == 0;
+ bTopTable = (0 ==
+ pPam->GetPoint()->nNode.GetNode().FindTableNode());
// Wenn im aktuellen Absatz Flys verankert sind,
// muss die neue Tabelle in einen Rahmen.
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 230da033d50c..2ba3388d767a 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -87,6 +87,7 @@
#include <docary.hxx>
#include <docstat.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <mdiexp.hxx> // ...Percent()
@@ -109,9 +110,7 @@
#include <sfx2/viewfrm.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc> // ResId fuer Statusleiste
-#endif
#include <swerror.h>
#define FONTSIZE_MASK 7
@@ -631,8 +630,8 @@ void __EXPORT SwHTMLParser::Continue( int nToken )
pDoc->SetOle2Link( Link() );
BOOL bModified = pDoc->IsModified();
- BOOL bWasUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
// Wenn der Import abgebrochen wird, kein Continue mehr rufen.
// Falls ein Pending-Stack existiert aber durch einen Aufruf
@@ -889,8 +888,8 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() )
{
if( bWasUndo )
{
- pDoc->DelAllUndoObj();
- pDoc->DoUndo( TRUE );
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
}
else if( !pInitVSh )
{
@@ -900,7 +899,9 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() )
// wir muessen das Undo noch anschalten.
ViewShell *pTmpVSh = CheckActionViewShell();
if( pTmpVSh )
- pDoc->DoUndo( TRUE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
+ }
}
pDoc->SetOle2Link( aOLELink );
@@ -951,7 +952,7 @@ void SwHTMLParser::DocumentDetected()
CallEndAction( TRUE, TRUE );
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
// Durch das DocumentDetected wurde im allgemeinen eine
// ViewShell angelegt. Es kann aber auch sein, dass sie
// erst spaeter angelegt wird, naemlich dann, wenn die UI
@@ -1461,8 +1462,7 @@ void __EXPORT SwHTMLParser::NextToken( int nToken )
if( nPos )
{
const String& rText =
- pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->GetTxtNode()
- ->GetTxt();
+ pPam->GetPoint()->nNode.GetNode().GetTxtNode()->GetTxt();
sal_Unicode cLast = rText.GetChar(--nPos);
if( ' ' == cLast || '\x0a' == cLast)
aToken.Erase(0,1);
@@ -2111,7 +2111,7 @@ BOOL SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, BOOL bUpdateNum )
if( AM_SPACE==eMode || AM_NOSPACE==eMode )
{
SwTxtNode *pTxtNode =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->GetTxtNode();
+ pPam->GetPoint()->nNode.GetNode().GetTxtNode();
const SvxULSpaceItem& rULSpace =
(const SvxULSpaceItem&)pTxtNode->SwCntntNode::GetAttr( RES_UL_SPACE );
@@ -2426,8 +2426,10 @@ void SwHTMLParser::Show()
// ist der aktuelle Node nicht mehr sichtbar, dann benutzen wir
// eine groessere Schrittweite
if( pVSh )
- nParaCnt = pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->IsInVisibleArea(pVSh) ? 5 : 50;
+ {
+ nParaCnt = (pPam->GetPoint()->nNode.GetNode().IsInVisibleArea(pVSh))
+ ? 5 : 50;
+ }
}
void SwHTMLParser::ShowStatline()
@@ -2656,7 +2658,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable,
}
- pCNd = pDoc->GetNodes()[ pAttr->nSttPara ]->GetCntntNode();
+ pCNd = pAttr->nSttPara.GetNode().GetCntntNode();
if( !pCNd )
{
// durch die elende Loescherei von Nodes kann auch mal
@@ -2696,7 +2698,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable,
if ( (pAttr->GetSttPara() != pAttr->GetEndPara()) &&
!isTXTATR_NOEND(nWhich) )
{
- pCNd = pDoc->GetNodes()[ pAttr->nEndPara ]->GetCntntNode();
+ pCNd = pAttr->nEndPara.GetNode().GetCntntNode();
if( !pCNd )
{
pCNd = pDoc->GetNodes().GoPrevious( &(pAttr->nEndPara) );
@@ -2888,7 +2890,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable,
{
pAttr = aFields[0];
- pCNd = pDoc->GetNodes()[ pAttr->nSttPara ]->GetCntntNode();
+ pCNd = pAttr->nSttPara.GetNode().GetCntntNode();
pAttrPam->GetPoint()->nNode = pAttr->nSttPara;
pAttrPam->GetPoint()->nContent.Assign( pCNd, pAttr->nSttCntnt );
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 5303ad26dcba..0309d85833ed 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -115,7 +115,7 @@ int SwFlySave::IsEqualFly( const SwPaM& rPos, SfxItemSet& rSet )
else
{
SwNodeIndex aIdx( nEndNd );
- SwCntntNode* pCNd = rPos.GetDoc()->GetNodes()[ aIdx ]->GetCntntNode();
+ SwCntntNode *const pCNd = aIdx.GetNode().GetCntntNode();
if( !GoNextNds( &aIdx, TRUE ) ||
aIdx.GetIndex() != rPos.GetPoint()->nNode.GetIndex() ||
( pCNd && pCNd->Len() != nEndCnt ))
@@ -287,7 +287,7 @@ void SwRTFParser::SetFlysInDoc()
if( n + 1 < aFlyArr.Count() && pFlySave->nEndCnt &&
pFlySave->nEndNd == aFlyArr[ n + 1 ]->nSttNd )
{
- SwCntntNode* pCNd = rNds[ pFlySave->nEndNd ]->GetCntntNode();
+ SwCntntNode *const pCNd = pFlySave->nEndNd.GetNode().GetCntntNode();
if( pCNd )
{
SwPosition aPos( pFlySave->nEndNd,
@@ -1375,7 +1375,7 @@ void SwRTFParser::_SetPictureSize( const SwNoTxtNode& rNd,
}
//steht der Fly etwa in einer Tabelle ?
- const SwNode* pAnchorNd = pDoc->GetNodes()[ rAnchor ];
+ const SwNode* pAnchorNd = & rAnchor.GetNode();
const SwTableNode* pTblNd = pAnchorNd->FindTableNode();
if( pTblNd )
{
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx
index 6737ebce596e..8a7f38044ecb 100644
--- a/sw/source/filter/rtf/rtftbl.cxx
+++ b/sw/source/filter/rtf/rtftbl.cxx
@@ -181,7 +181,7 @@ void SwRTFParser::ReadTable( int nToken )
// wenn schon in einer Tabellen, dann splitte oder benutze
// die bisherigen Boxen weiter
- bChkExistTbl = 0 != pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->FindTableNode();
+ bChkExistTbl = 0 != pPam->GetPoint()->nNode.GetNode().FindTableNode();
}
else
{
@@ -919,7 +919,7 @@ void SwRTFParser::GotoNextBox()
// dann hinter die Tabelle
pPam->Move( fnMoveForward, fnGoNode );
}
- else if( !pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->IsCntntNode() )
+ else if (pPam->GetPoint()->nNode.GetNode().IsCntntNode())
// dann in die vorherige ans Ende
pPam->Move( fnMoveBackward, fnGoCntnt );
}
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 0c23218092d5..629c7f068dc9 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -1015,8 +1015,7 @@ void rtfSections::InsertSegments(bool bNewDoc)
}
const SwPosition* pPos = aSectPaM.GetPoint();
- const SwTxtNode* pSttNd =
- mrReader.pDoc->GetNodes()[ pPos->nNode ]->GetTxtNode();
+ SwTxtNode const*const pSttNd = pPos->nNode.GetNode().GetTxtNode();
const SwTableNode* pTableNd = pSttNd ? pSttNd->FindTableNode() : 0;
if (pTableNd)
{
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 2a77d47dd65b..f11cbd751c8e 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -223,10 +223,10 @@ sal_Int32 Writer::FindPos_Bkmk(const SwPosition& rPos) const
}
-SwPaM* Writer::NewSwPaM( SwDoc & rDoc, ULONG nStartIdx, ULONG nEndIdx,
- BOOL bNodesArray )
+SwPaM *
+Writer::NewSwPaM(SwDoc & rDoc, ULONG const nStartIdx, ULONG const nEndIdx)
{
- SwNodes* pNds = bNodesArray ? &rDoc.GetNodes() : (SwNodes*)rDoc.GetUndoNds();
+ SwNodes *const pNds = &rDoc.GetNodes();
SwNodeIndex aStt( *pNds, nStartIdx );
SwCntntNode* pCNode = aStt.GetNode().GetCntntNode();
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 2cf1ca325a5b..a110e4003263 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -79,7 +79,7 @@ using namespace com::sun::star;
static SwCntntNode* GetCntntNode(SwDoc* pDoc, SwNodeIndex& rIdx, BOOL bNext)
{
- SwCntntNode* pCNd = pDoc->GetNodes()[ rIdx ]->GetCntntNode();
+ SwCntntNode * pCNd = rIdx.GetNode().GetCntntNode();
if(!pCNd && 0 == (pCNd = bNext ? pDoc->GetNodes().GoNext(&rIdx)
: pDoc->GetNodes().GoPrevious(&rIdx)))
{
@@ -368,12 +368,12 @@ static void MakeBookRegionOrPoint(SwFltStackEntry* pEntry, SwDoc* pDoc,
SwPaM& rRegion, BOOL bCheck )
{
if (pEntry->MakeRegion(pDoc, rRegion, bCheck )){
- const SwNodes& rNds = pDoc->GetNodes();
// BOOL b1 = rNds[rRegion.GetPoint()->nNode]->FindTableNode() != 0;
// const SwStartNode* p1 = rNds[rRegion.GetPoint()->nNode]->FindTableBoxStartNode();
// const SwStartNode* p2 = rNds[rRegion.GetMark()->nNode]->FindTableBoxStartNode();
- if( rNds[rRegion.GetPoint()->nNode]->FindTableBoxStartNode()
- != rNds[rRegion.GetMark()->nNode]->FindTableBoxStartNode() ){
+ if (rRegion.GetPoint()->nNode.GetNode().FindTableBoxStartNode()
+ != rRegion.GetMark()->nNode.GetNode().FindTableBoxStartNode())
+ {
rRegion.Exchange(); // Ungueltiger Bereich
rRegion.DeleteMark(); // -> beide auf Mark
}
@@ -632,7 +632,7 @@ const SfxPoolItem* SwFltControlStack::GetFmtAttr(const SwPosition& rPos, USHORT
// im Stack ist das Attribut nicht vorhanden, also befrage das Dokument
// SwCntntNode * pNd = rPaM.GetCntntNode();
- SwCntntNode * pNd = pDoc->GetNodes()[ rPos.nNode ]->GetCntntNode();
+ SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode();
if (!pNd) // kein ContentNode, dann das dflt. Attribut
return &pDoc->GetAttrPool().GetDefaultItem(nWhich);
@@ -1205,8 +1205,7 @@ const SfxPoolItem& SwFltFormatCollection::GetAttr(USHORT nWhich)
const SfxPoolItem& SwFltOutDoc::GetNodeOrStyAttr(USHORT nWhich)
{
- SwCntntNode * pNd = GetDoc().GetNodes()[ pPaM->GetPoint()->nNode ]
- ->GetCntntNode();
+ SwCntntNode * pNd = pPaM->GetPoint()->nNode.GetNode().GetCntntNode();
if (pNd) // ContentNode: Attribut mit Parent
return pNd->GetAttr(nWhich);
else // kein ContentNode, dann das dflt. Attribut
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 21804b38dca9..e1a0fbc1f5b1 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1007,7 +1007,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFmtAttr(const SwPosition& rPos,
const SfxPoolItem *pItem = GetStackAttr(rPos, nWhich);
if (!pItem)
{
- const SwCntntNode *pNd = pDoc->GetNodes()[ rPos.nNode ]->GetCntntNode();
+ SwCntntNode const*const pNd = rPos.nNode.GetNode().GetCntntNode();
if (!pNd)
pItem = &pDoc->GetAttrPool().GetDefaultItem(nWhich);
else
@@ -3609,8 +3609,7 @@ void wwSectionManager::InsertSegments()
}
const SwPosition* pPos = aSectPaM.GetPoint();
- const SwTxtNode* pSttNd =
- mrReader.rDoc.GetNodes()[ pPos->nNode ]->GetTxtNode();
+ SwTxtNode const*const pSttNd = pPos->nNode.GetNode().GetTxtNode();
const SwTableNode* pTableNd = pSttNd ? pSttNd->FindTableNode() : 0;
if (pTableNd)
{
@@ -4025,8 +4024,7 @@ ULONG SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
// evtl. Zeilen eingefuegt / aufgebrochen werden
//
const SwPosition* pPos = pPaM->GetPoint();
- const SwTxtNode* pSttNd =
- rDoc.GetNodes()[ pPos->nNode ]->GetTxtNode();
+ SwTxtNode const*const pSttNd = pPos->nNode.GetNode().GetTxtNode();
USHORT nCntPos = pPos->nContent.GetIndex();
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index f848b6332c38..059f33634424 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2505,7 +2505,7 @@ void WW8TabDesc::CreateSwTable()
// ein Pagedesc steht. Dann wuerde der PageDesc in die naechste Zeile
// hinter der Tabelle rutschen, wo er nichts zu suchen hat. -> loeschen
// und spaeter an das Tabellenformat setzen
- if (SwTxtNode* pNd = pIo->rDoc.GetNodes()[pTmpPos->nNode]->GetTxtNode())
+ if (SwTxtNode *const pNd = pTmpPos->nNode.GetNode().GetTxtNode())
{
if (const SfxItemSet* pSet = pNd->GetpSwAttrSet())
{
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 0002928c0eb6..8e939c88fd37 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/urlobj.hxx>
@@ -71,9 +72,7 @@
#include <srcview.hxx>
#include <wrtsh.hxx>
#include <docsh.hxx>
-#ifndef _CMDID_H
#include <cmdid.h> // Funktion-Ids
-#endif
#include <initui.hxx>
#include <uitool.hxx>
#include <swmodule.hxx>
@@ -83,13 +82,12 @@
#include <gloslst.hxx> // SwGlossaryList
#include <glosdoc.hxx> // SwGlossaryList
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cfgitems.hxx>
#include <prtopt.hxx>
#include <modcfg.hxx>
#include <globals.h> // globale Konstanten z.B.
-#ifndef _APP_HRC
#include <app.hrc>
-#endif
#include <fontcfg.hxx>
#include <barcfg.hxx>
#include <uinums.hxx>
@@ -802,22 +800,18 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal
}
else if( pBrdCst == pUndoOptions )
{
- const int nNew = GetUndoOptions().GetUndoCount();
- const int nOld = SwEditShell::GetUndoActionCount();
- if(!nNew || !nOld)
+ sal_Int32 const nNew = GetUndoOptions().GetUndoCount();
+ bool const bUndo = (nNew != 0);
+ // switch Undo for all DocShells
+ TypeId aType(TYPE(SwDocShell));
+ SwDocShell * pDocShell =
+ static_cast<SwDocShell *>(SfxObjectShell::GetFirst(&aType));
+ while (pDocShell)
{
- sal_Bool bUndo = nNew != 0;
- //ueber DocShells iterieren und Undo umschalten
-
- TypeId aType(TYPE(SwDocShell));
- SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType);
- while( pDocShell )
- {
- pDocShell->GetDoc()->DoUndo( bUndo );
- pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
- }
+ pDocShell->GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo);
+ pDocShell = static_cast<SwDocShell *>(
+ SfxObjectShell::GetNext(*pDocShell, &aType));
}
- SwEditShell::SetUndoActionCount( static_cast< USHORT >(nNew));
}
else if ( pBrdCst == pColorConfig || pBrdCst == pAccessibilityOptions )
{
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx
index a1e6cef80cd1..0b6b728f18f7 100644
--- a/sw/source/ui/app/appopt.cxx
+++ b/sw/source/ui/app/appopt.cxx
@@ -246,8 +246,8 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId )
/*-----------------01.02.97 13.02-------------------
Optionen fuer PrintTabPage
--------------------------------------------------*/
- SwPrintData* pOpt = pAppView ?
- pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() :
+ const SwPrintData* pOpt = pAppView ?
+ &pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() :
0;
if(!pOpt)
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 7f48cdf40230..c1704f21d0f0 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -81,6 +81,7 @@
#include <shellio.hxx> // I/O
#include <docstyle.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docstat.hxx>
#include <pagedesc.hxx>
#include <pview.hxx>
@@ -494,7 +495,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
// Modified-Flag merken und erhalten ohne den Link zu Callen
// (fuer OLE; nach Anweisung von MM)
BOOL bIsModified = pDoc->IsModified();
- SwUndoNoModifiedPosition aOldPos = pDoc->getUndoNoModifiedPosition();
+ pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
Link aOldOLELnk( pDoc->GetOle2Link() );
pDoc->SetOle2Link( Link() );
@@ -521,7 +522,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
if( bIsModified )
{
pDoc->SetModified();
- pDoc->setUndoNoModifiedPosition( aOldPos );
+ pDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition();
}
pDoc->SetOle2Link( aOldOLELnk );
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index df49dc4b1e68..263e3274972b 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -44,9 +44,7 @@
#include <svl/zformat.hxx>
#include <unotools/pathoptions.hxx>
#include <svtools/transfer.hxx>
-#ifndef _SFXSIDS_HRC //autogen
#include <sfx2/dialogs.hrc>
-#endif
#include <sfx2/dinfdlg.hxx>
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
@@ -57,9 +55,7 @@
#include <svtools/sfxecode.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <svx/drawitem.hxx>
#include <editeng/svxacorr.hxx>
#include <editeng/langitem.hxx>
@@ -86,6 +82,7 @@
#include <redlndlg.hxx>
#include <docstyle.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagedesc.hxx>
#include <shellio.hxx>
#include <pview.hxx>
@@ -103,15 +100,9 @@
#include <cmdid.h>
#include <globals.h>
#include <helpid.h>
-#ifndef _APP_HRC
#include <app.hrc>
-#endif
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
@@ -342,8 +333,7 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource,
// --> OD 2005-05-10 #i48949# - actions aren't undoable. Thus, allow no undo
// actions
// Note: The undo action stack is cleared at the end of this method.
- bool bDoesUndo( GetDoc()->DoesUndo() );
- GetDoc()->DoUndo( sal_False );
+ ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
// <--
BOOL bRet = FALSE;
@@ -542,11 +532,10 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource,
// --> OD 2005-05-10 #i48949# - actions aren't undoable and could have change
// the document node array. Thus, clear the undo action stack.
- if ( bDoesUndo )
+ if (undoGuard.UndoWasEnabled())
{
- GetDoc()->DelAllUndoObj();
+ GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
- GetDoc()->DoUndo( bDoesUndo );
// <--
return bRet;
@@ -947,12 +936,11 @@ void SwDocShell::Execute(SfxRequest& rReq)
aTempFile.EnableKillingFile();
pSrcView->SaveContent(aTempFile.GetURL());
bDone = TRUE;
- SfxEventConfiguration* pEvent = SFX_APP()->GetEventConfig();
SvxMacro aMac(aEmptyStr, aEmptyStr, STARBASIC);
- pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC ), aMac, this);
- pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC ), aMac, this);
- pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), aMac, this);
- pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ), aMac, this);
+ SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC ), aMac, this);
+ SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC ), aMac, this);
+ SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), aMac, this);
+ SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ), aMac, this);
ReloadFromHtml(aTempFile.GetURL(), pSrcView);
nSlot = 0;
}
@@ -1637,7 +1625,9 @@ void SwDocShell::SetModified( BOOL bSet )
BOOL bOld = pDoc->IsModified();
pDoc->SetModified();
if( !bOld )
- pDoc->SetUndoNoResetModified();
+ {
+ pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
}
else
pDoc->ResetModified();
@@ -1697,9 +1687,6 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
ClearHeaderAttributesForSourceViewHack();
// MIB 24.07.97: Das Dokument-Basic muss auch noch d'ran glauben ...
- // Ein EnterBasicCall braucht man hier nicht, weil man nichts ruft und
- // in HTML-Dokument kein Dok-Basic vorhanden sein kann, das noch nicht
- // geladen wurde.
SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
//#59620# HasBasic() zeigt an, dass es schon einen BasicManager an der DocShell
// gibt. Der wurde im HTML-Import immer angelegt, wenn Macros im Quelltext
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index d06ab31b7478..60206f764663 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -52,7 +53,8 @@
#include <fchrfmt.hxx>
#include <svtools/htmlcfg.hxx>
#include <SwStyleNameMapper.hxx>
-#include <undobj.hxx>
+#include <SwRewriter.hxx>
+#include <numrule.hxx>
#include <swundo.hxx>
#include "view.hxx"
@@ -62,7 +64,8 @@
#include "cmdid.h"
#include "globals.hrc"
#include "viewopt.hxx"
-#include "doc.hxx"
+#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include "swstyle.h"
#include "frmfmt.hxx"
#include "charfmt.hxx"
@@ -751,7 +754,9 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam
pDoc->SetModified();
if( !bModified ) // Bug 57028
- pDoc->SetUndoNoResetModified();
+ {
+ pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
GetWrtShell()->EndAllAction();
}
@@ -761,8 +766,8 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam
{
// #116530#
//pBasePool->Erase( &aTmp );
- GetWrtShell()->Undo(UNDO_EMPTY, 1);
- pDoc->ClearRedo();
+ GetWrtShell()->Undo(1);
+ pDoc->GetIDocumentUndoRedo().ClearRedo();
}
if( !bModified )
@@ -814,7 +819,9 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam
pDoc->SetModified();
if( !bModified ) // Bug 57028
- pDoc->SetUndoNoResetModified();
+ {
+ pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
+ }
GetWrtShell()->EndAllAction();
}
@@ -1003,7 +1010,7 @@ USHORT SwDocShell::UpdateStyle(const String &rName, USHORT nFamily, SwWrtShell*
// Vorlage auch anwenden, um harte Attributierung
// zu entfernen
GetWrtShell()->SetTxtFmtColl( pColl );
- GetWrtShell()->EndUndo(UNDO_INSFMTATTR, NULL);
+ GetWrtShell()->EndUndo();
GetWrtShell()->EndAllAction();
}
break;
@@ -1200,7 +1207,7 @@ USHORT SwDocShell::MakeByExample( const String &rName, USHORT nFamily,
rDest.SetPoolHlpFileId( nHFId );
// werden Kopf-/Fusszeilen angelegt, so gibt es kein Undo mehr!
- pCurrWrtShell->GetDoc()->DelAllUndoObj();
+ pCurrWrtShell->GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
pCurrWrtShell->EndAllAction();
}
@@ -1274,7 +1281,7 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, BOOL bPreserveCurrentDocu
{
// die View wird spaeter angelegt, ueberschreibt aber das
// Modify-Flag. Per Undo ist sowieso nichts mehr zu machen
- pDoc->SetUndoNoResetModified();
+ pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
}
}
}
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index b0b81c5df6e4..e3d47a82b38f 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -54,6 +54,7 @@
#include <docary.hxx>
#include <ccoll.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cmdid.h>
#include <swstyle.h>
#include <app.hrc>
@@ -68,7 +69,6 @@
#include <svx/svxids.hrc>
// --> OD 2008-02-12 #newlistlevelattrs#
#include <SwRewriter.hxx>
-#include <undobj.hxx>
// <--
// MD 06.02.95: Die Formatnamen in der Liste aller Namen haben als
@@ -844,11 +844,11 @@ BOOL SwDocStyleSheet::SetName( const String& rStr)
String aOldName(aPageDesc.GetName());
aPageDesc.SetName( rStr );
- BOOL bDoesUndo = rDoc.DoesUndo();
+ bool const bDoesUndo = rDoc.GetIDocumentUndoRedo().DoesUndo();
- rDoc.DoUndo(aOldName.Len() > 0);
+ rDoc.GetIDocumentUndoRedo().DoUndo(aOldName.Len() > 0);
rDoc.ChgPageDesc(aOldName, aPageDesc);
- rDoc.DoUndo(bDoesUndo);
+ rDoc.GetIDocumentUndoRedo().DoUndo(bDoesUndo);
// <- #116530#
rDoc.SetModified();
@@ -1140,11 +1140,11 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
ASSERT( &rSet != &aCoreSet, "SetItemSet mit eigenem Set ist nicht erlaubt" );
// --> OD 2008-02-12 #newlistlevelattrs#
- if ( rDoc.DoesUndo() )
+ if (rDoc.GetIDocumentUndoRedo().DoesUndo())
{
SwRewriter aRewriter;
aRewriter.AddRule( UNDO_ARG1, GetName() );
- rDoc.StartUndo( UNDO_INSFMTATTR, &aRewriter );
+ rDoc.GetIDocumentUndoRedo().StartUndo( UNDO_INSFMTATTR, &aRewriter );
}
// <--
@@ -1310,10 +1310,8 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
pNewDsc = new SwPageDesc( *pDesc );
// --> OD 2005-05-09 #i48949# - no undo actions for the
// copy of the page style
- const sal_Bool bDoesUndo( rDoc.DoesUndo() );
- rDoc.DoUndo( sal_False );
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
rDoc.CopyPageDesc(*pDesc, *pNewDsc); // #i7983#
- rDoc.DoUndo( bDoesUndo );
// <--
pFmt = &pNewDsc->GetMaster();
@@ -1409,9 +1407,9 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
}
// --> OD 2008-02-12 #newlistlevelattrs#
- if ( rDoc.DoesUndo() )
+ if (rDoc.GetIDocumentUndoRedo().DoesUndo())
{
- rDoc.EndUndo( UNDO_INSFMTATTR, NULL );
+ rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
}
// <--
}
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 4a0c9c2a6b25..b1f3bd899018 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -34,13 +34,9 @@
#include <tools/shl.hxx>
#include <swtypes.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <uiitems.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
#include "swmodule.hxx"
#include "usrpref.hxx"
#include "wrtsh.hxx"
@@ -65,9 +61,7 @@
#include <sot/clsids.hxx>
#include <unotools/configmgr.hxx>
#include <docsh.hxx>
-#ifndef _CONFIG_HRC
#include <config.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
#include <numrule.hxx>
#include <SwNodeNum.hxx>
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 94d7c8c2f057..c3119dc14876 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -643,7 +643,8 @@ BOOL SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName)
else
{
rtl::OUString sDBName(rDBName);
- xConnection = RegisterConnection( sDBName );
+ if ( sDBName.getLength() )
+ xConnection = RegisterConnection( sDBName );
}
if(xConnection.is())
{
@@ -1750,7 +1751,7 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
try
{
SwDbtoolsClient& aClient = SwNewDBMgr::GetDbtoolsClient();
- sRet = aClient.getValue(
+ sRet = aClient.getFormattedValue(
xColumnProps,
rDBFormatData.xFormatter,
rDBFormatData.aLocale,
@@ -2948,8 +2949,14 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
pWorkDoc->SetNewDBMgr( this );
pWorkDoc->EmbedAllLinks();
- if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
- rWorkShell.Undo();
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (rWorkShell.GetLastUndoInfo(0, & nLastUndoId))
+ {
+ if (UNDO_UI_DELETE_INVISIBLECNTNT == nLastUndoId)
+ {
+ rWorkShell.Undo();
+ }
+ }
// #i69485# lock fields to prevent access to the result set while calculating layout
rWorkShell.LockExpFlds();
// create a layout
diff --git a/sw/source/ui/dbui/swdbtoolsclient.cxx b/sw/source/ui/dbui/swdbtoolsclient.cxx
index ca50ee02d593..bb932f0f9a04 100644
--- a/sw/source/ui/dbui/swdbtoolsclient.cxx
+++ b/sw/source/ui/dbui/swdbtoolsclient.cxx
@@ -230,7 +230,7 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat(
/* -----------------------------30.08.2001 12:38------------------------------
---------------------------------------------------------------------------*/
-::rtl::OUString SwDbtoolsClient::getValue(
+::rtl::OUString SwDbtoolsClient::getFormattedValue(
const uno::Reference< beans::XPropertySet>& _rxColumn,
const uno::Reference< util::XNumberFormatter>& _rxFormatter,
const lang::Locale& _rLocale,
@@ -242,7 +242,7 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat(
getAccessTypeConversion();
rtl::OUString sRet;
if(xConversion.is())
- sRet = xConversion->getValue(_rxColumn, _rxFormatter, _rLocale, _rNullDate);
+ sRet = xConversion->getFormattedValue(_rxColumn, _rxFormatter, _rLocale, _rNullDate);
return sRet;
}
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index 2d2b7c357720..fe19a7310135 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -61,8 +61,6 @@
using ::com::sun::star::uno::Reference;
using ::com::sun::star::frame::XFrame;
-// SvStringsDtor* __EXPORT _GetRangeHdl( _SfxMacroTabPage*, const String& );
-
SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
{
// const SfxItemSet& rSet = rPg.GetItemSet();
@@ -163,34 +161,3 @@ BOOL SwMacroAssignDlg::INetFmtDlg( Window* pParent, SwWrtShell& rSh,
}
return bRet;
}
-
-/*
-SvStringsDtor* __EXPORT _GetRangeHdl( _SfxMacroTabPage* , const String& rLanguage )
-{
- SvStringsDtor* pNew = new SvStringsDtor;
-
- SfxApplication* pSfxApp = SFX_APP();
- if ( !rLanguage.EqualsAscii(SVX_MACRO_LANGUAGE_JAVASCRIPT) )
- {
- pSfxApp->EnterBasicCall();
-
- String* pNewEntry = new String( pSfxApp->GetName() );
- pNew->Insert( pNewEntry, pNew->Count() );
-
- TypeId aType( TYPE( SwDocShell ));
- SfxObjectShell* pDoc = SfxObjectShell::GetFirst( &aType );
- while( pDoc )
- {
- pNewEntry = new String( pDoc->GetTitle() );
- pNew->Insert( pNewEntry, pNew->Count() );
- pDoc = SfxObjectShell::GetNext( *pDoc, &aType );
- }
- pSfxApp->LeaveBasicCall();
- }
-
- return pNew;
-}
-*/
-
-
-
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 2efe65c50079..23f7741969ce 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -88,6 +88,7 @@
#include <shellio.hxx>
#include <ddefld.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pagedesc.hxx>
#include <IMark.hxx>
#include <docary.hxx>
@@ -132,7 +133,6 @@
// #109590#
#include <swcrsr.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
#include <globals.hrc>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
@@ -228,7 +228,7 @@ public:
}
~SwTrnsfrActionAndUndo()
{
- pSh->EndUndo( eUndoId );
+ pSh->EndUndo();
pSh->EndAllAction();
}
};
@@ -3434,7 +3434,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
{
// nicht in sich selbst kopieren/verschieben
rSh.DestroyCrsr();
- rSh.EndUndo( eUndoId );
+ rSh.EndUndo();
rSh.EndAction();
rSh.EndAction();
return 0;
@@ -3542,8 +3542,8 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
rSrcSh.LeaveSelFrmMode();
if( rSrcSh.GetDoc() != rSh.GetDoc() )
- rSrcSh.EndUndo( eUndoId );
- rSh.EndUndo( eUndoId );
+ rSrcSh.EndUndo();
+ rSh.EndUndo();
// Shell in den richtigen Status versetzen
if( &rSrcSh != &rSh && ( rSh.IsFrmSelected() || rSh.IsObjSelected() ))
@@ -3797,8 +3797,7 @@ void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise )
if( bDelBookmrk && refObj.Is() && FindDocShell() )
{
SwDoc* pDoc = pDocShell->GetDoc();
- BOOL bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
// --> OD, CD, OS 2005-11-25 #i58448#
Link aSavedOle2Link( pDoc->GetOle2Link() );
@@ -3815,7 +3814,6 @@ void SwTrnsfrDdeLink::Disconnect( BOOL bRemoveDataAdvise )
pDoc->SetOle2Link( aSavedOle2Link );
// <--
- pDoc->DoUndo( bUndo );
bDelBookmrk = FALSE;
}
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index 08fb91dcc3c6..52b1821d5a8b 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -28,7 +28,6 @@
*
************************************************************************/
-
#include "precompiled_sw.hxx"
#include <AnnotationWin.hxx>
@@ -62,8 +61,10 @@
#include <wrtsh.hxx>
#include <docsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <SwUndoField.hxx>
+
namespace sw { namespace annotation {
SwAnnotationWin::SwAnnotationWin( SwEditWin& rEditWin,
@@ -116,7 +117,8 @@ void SwAnnotationWin::UpdateData()
SwField* pOldField = mpFld->Copy();
mpFld->SetPar2(Engine()->GetEditEngine().GetText());
mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView().GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
delete pOldField;
// so we get a new layout of notes (anchor position is still the same and we would otherwise not get one)
Mgr().SetLayout();
@@ -246,7 +248,8 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
SwField* pOldField = mpFld->Copy();
mpFld->SetPar2(Engine()->GetEditEngine().GetText());
mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView().GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
delete pOldField;
Engine()->SetModifyHdl( LINK( this, SwAnnotationWin, ModifyHdl ) );
Engine()->ClearModifyFlag();
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 645d4773626a..f45d1ee1e78c 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -59,16 +59,12 @@
#include <redline.hxx>
#include <docary.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
#include <tools/color.hxx>
#include <swmodule.hxx>
#include <annotation.hrc>
#include "cmdid.h"
-#include <SwRewriter.hxx>
-#include <undobj.hxx>
-
#include <sfx2/request.hxx>
#include <sfx2/event.hxx>
#include <svl/srchitem.hxx>
@@ -1251,7 +1247,7 @@ void SwPostItMgr::Delete(String aAuthor)
mpWrtShell->GotoField( *(*i) );
mpWrtShell->DelRight();
}
- mpWrtShell->EndUndo( UNDO_DELETE );
+ mpWrtShell->EndUndo();
PrepareView();
mpWrtShell->EndAllAction();
mbLayout = true;
@@ -1297,7 +1293,7 @@ void SwPostItMgr::Delete()
mvPostItFlds.clear();
*/
- mpWrtShell->EndUndo( UNDO_DELETE );
+ mpWrtShell->EndUndo();
PrepareView();
mpWrtShell->EndAllAction();
mbLayout = true;
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx
index 829c79373a61..bd645324ee13 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx
@@ -64,7 +64,6 @@
#include <wrtsh.hxx>
#include <shellres.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
namespace css = ::com::sun::star;
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 5049220b1b5a..e3991352b0b3 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -4320,8 +4320,14 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
!GetConnectMetaFile() &&
rSh.VisArea().IsInside( aDocPt ))
{
- if( UNDO_INS_FROM_SHADOWCRSR == rSh.GetUndoIds() )
- rSh.Undo();
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (rSh.GetLastUndoInfo(0, & nLastUndoId))
+ {
+ if (UNDO_INS_FROM_SHADOWCRSR == nLastUndoId)
+ {
+ rSh.Undo();
+ }
+ }
SwFillMode eMode = (SwFillMode)rSh.GetViewOptions()->GetShdwCrsrFillMode();
rSh.SetShadowCrsrPos( aDocPt, eMode );
}
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 43ef58b11d7c..49932804d8ea 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -804,11 +804,8 @@ bool SwMailMergeDlg::ExecQryShell()
}
}
}
- SwPrintData aPrtData = *SW_MOD()->GetPrtOptions(FALSE);
IDocumentDeviceAccess* pIDDA = rSh.getIDocumentDeviceAccess();
- SwPrintData* pShellPrintData = pIDDA->getPrintData();
- if(pShellPrintData)
- aPrtData = *pShellPrintData;
+ SwPrintData aPrtData( pIDDA->getPrintData() );
aPrtData.SetPrintSingleJobs(aSingleJobsCB.IsChecked());
pIDDA->setPrintData(aPrtData);
diff --git a/sw/source/ui/inc/annotsh.hxx b/sw/source/ui/inc/annotsh.hxx
index 979e1374e004..ad91eb1b4f52 100755
--- a/sw/source/ui/inc/annotsh.hxx
+++ b/sw/source/ui/inc/annotsh.hxx
@@ -71,7 +71,8 @@ public:
void StateSearch(SfxItemSet &);
- virtual SfxUndoManager* GetUndoManager();
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
};
#endif
diff --git a/sw/source/ui/inc/drwtxtsh.hxx b/sw/source/ui/inc/drwtxtsh.hxx
index 79aebc4e016a..1bbec5daafcb 100644
--- a/sw/source/ui/inc/drwtxtsh.hxx
+++ b/sw/source/ui/inc/drwtxtsh.hxx
@@ -57,7 +57,8 @@ public:
SwDrawTextShell(SwView &rView);
virtual ~SwDrawTextShell();
- virtual SfxUndoManager* GetUndoManager();
+ virtual ::svl::IUndoManager*
+ GetUndoManager();
void StateDisableItems(SfxItemSet &);
diff --git a/sw/source/ui/inc/inputwin.hxx b/sw/source/ui/inc/inputwin.hxx
index 8693572d167f..c752b723937f 100644
--- a/sw/source/ui/inc/inputwin.hxx
+++ b/sw/source/ui/inc/inputwin.hxx
@@ -27,17 +27,11 @@
#ifndef SW_INPUTWIN_HXX
#define SW_INPUTWIN_HXX
-
-#ifndef _MENU_HXX //autogen
+#include <vcl/edit.hxx>
#include <vcl/menu.hxx>
-#endif
-#include <sfx2/childwin.hxx>
-#ifndef _TOOLBOX_HXX //autogen
#include <vcl/toolbox.hxx>
-#endif
-#ifndef _EDIT_HXX //autogen
-#include <vcl/edit.hxx>
-#endif
+
+#include <sfx2/childwin.hxx>
class SwFldMgr;
class SwWrtShell;
@@ -72,16 +66,17 @@ friend class InputEdit;
SwView* pView;
SfxBindings* pBindings;
String aAktTableName, sOldFml;
- USHORT nActionCnt;
+ sal_Int32 m_nActionCount;
BOOL bFirst : 1; //Initialisierungen beim ersten Aufruf
BOOL bActive : 1; //fuer Hide/Show beim Dokumentwechsel
BOOL bIsTable : 1;
BOOL bDelSel : 1;
- BOOL bDoesUndo : 1;
- BOOL bResetUndo : 1;
- BOOL bCallUndo : 1;
+ bool m_bDoesUndo : 1;
+ bool m_bResetUndo : 1;
+ bool m_bCallUndo : 1;
+ void CleanupUglyHackWithUndo();
void DelBoxCntnt();
DECL_LINK( ModifyHdl, InputEdit* );
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 54d1fab4cc0c..16ff3e4973d8 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -33,9 +33,7 @@
#include "swuiidxmrk.hxx"
#include <hintids.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#define _SVSTDARR_STRINGSSORT
#include <svl/svstdarr.hxx>
#include <comphelper/processfactory.hxx>
@@ -46,9 +44,7 @@
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <svl/stritem.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <sfx2/dispatch.hxx>
#include <svl/eitem.hxx>
#include <svtools/txtcmp.hxx>
@@ -60,20 +56,12 @@
#include <idxmrk.hxx>
#include <txttxmrk.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <multmrk.hxx>
#include <swundo.hxx> // fuer Undo-Ids
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _INDEX_HRC
#include <index.hrc>
-#endif
-#ifndef _IDXMRK_HRC
#include <idxmrk.hrc>
-#endif
#include <swmodule.hxx>
#include <fldmgr.hxx>
#include <fldbas.hxx>
@@ -83,7 +71,6 @@
#include <ndtxt.hxx>
#include <breakit.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
#include "swuiidxmrk.hxx"
#include <unomid.h>
diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx
index 8564000d26ac..e23073053e54 100644
--- a/sw/source/ui/index/toxmgr.cxx
+++ b/sw/source/ui/index/toxmgr.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <wrtsh.hxx>
#include <shellres.hxx>
#include <swwait.hxx>
@@ -34,10 +35,9 @@
#include <toxmgr.hxx>
#include <crsskip.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <swundo.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
/*--------------------------------------------------------------------
Beschreibung: Handhabung der Verzeichnisse durch TOXMgr
@@ -450,12 +450,14 @@ BOOL SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
{
SwDoc * pDoc = pSh->GetDoc();
- if (pDoc->DoesUndo())
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
if (pNewTOX != NULL)
- pDoc->DelAllUndoObj();
+ {
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ }
- pDoc->StartUndo(UNDO_TOXCHANGE, NULL);
+ pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_TOXCHANGE, NULL);
}
if (pNewTOX != NULL) // => pTOX != NULL
@@ -463,12 +465,14 @@ BOOL SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
bRet = pSh->UpdateTableOf(*pTOX, pSet);
- if (pDoc->DoesUndo())
+ if (pDoc->GetIDocumentUndoRedo().DoesUndo())
{
- pDoc->EndUndo(UNDO_TOXCHANGE, NULL);
+ pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_TOXCHANGE, NULL);
if (pNewTOX == NULL)
- pDoc->DelAllUndoObj();
+ {
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ }
}
}
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index e9bb702b3d66..352580707f74 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -47,7 +47,6 @@
#include "swtypes.hxx"
#include "swundo.hxx"
#include "uitool.hxx"
-#include "undobj.hxx"
#include "unomid.h"
#include "view.hxx"
#include "viewopt.hxx"
@@ -789,7 +788,7 @@ void SwSpellPopup::Execute( USHORT nId )
of temporary auto correction is now undoable two and
must reside in the same undo group.*/
pSh->EndAction();
- pSh->EndUndo(UNDO_UI_REPLACE);
+ pSh->EndUndo();
pSh->SetInsMode( bOldIns );
}
diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx
index 4d93f8d7542f..9c70ef06e58a 100644
--- a/sw/source/ui/misc/glshell.cxx
+++ b/sw/source/ui/misc/glshell.cxx
@@ -49,18 +49,13 @@
#include <view.hxx>
#include <glshell.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <glosdoc.hxx>
#include <shellio.hxx>
#include <initui.hxx> // fuer ::GetGlossaries()
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _SWERROR_H
#include <swerror.h>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
#define SwWebGlosDocShell
@@ -311,8 +306,9 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
aDocTitle += ' ';
aDocTitle += sLongName;
- BOOL bDoesUndo = xDocSh->GetDoc()->DoesUndo();
- xDocSh->GetDoc()->DoUndo( FALSE );
+ bool const bDoesUndo =
+ xDocSh->GetDoc()->GetIDocumentUndoRedo().DoesUndo();
+ xDocSh->GetDoc()->GetIDocumentUndoRedo().DoUndo( false );
xDocSh->GetWrtShell()->InsertGlossary( *pGroup, rShortName );
if( !xDocSh->GetDoc()->getPrinter( false ) )
@@ -340,7 +336,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
catch( uno::Exception& )
{}
- xDocSh->GetDoc()->DoUndo( bDoesUndo );
+ xDocSh->GetDoc()->GetIDocumentUndoRedo().DoUndo( bDoesUndo );
xDocSh->GetDoc()->ResetModified();
if ( bShow )
pFrame->GetFrame().Appear();
diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index 0101e92a0081..19decf172798 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -37,9 +37,7 @@
#include <redline.hxx>
#include <tools/datetime.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _SVSTDARR_HXX
#include <svl/svstdarr.hxx>
-#endif
#include <svl/eitem.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
@@ -47,9 +45,7 @@
#include <svx/postattr.hxx>
#include <swtypes.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <swmodule.hxx>
#ifndef _REDLNDLG_HXX
#define _REDLNACCEPTDLG
@@ -58,26 +54,15 @@
#include <swwait.hxx>
#include <uitool.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _REDLNDLG_HRC
#include <redlndlg.hrc>
-#endif
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
// -> #111827#
#include <comcore.hrc>
#include <swundo.hxx>
-#include <undobj.hxx>
#include <SwRewriter.hxx>
// <- #111827#
@@ -975,7 +960,9 @@ void SwRedlineAcceptDlg::CallAcceptReject( BOOL bSelect, BOOL bAccept )
// #111827#
if (aRedlines.size() > 1)
- pSh->EndUndo(bAccept? UNDO_ACCEPT_REDLINE : UNDO_REJECT_REDLINE);
+ {
+ pSh->EndUndo();
+ }
pSh->EndAction();
diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx
index 61dcd3f23505..fae2df9c0f4a 100644
--- a/sw/source/ui/ribbar/drawbase.cxx
+++ b/sw/source/ui/ribbar/drawbase.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/list.hxx>
#include <svx/svdview.hxx>
@@ -45,7 +46,7 @@
#include "edtwin.hxx"
#include "caption.hxx"
#include "swundo.hxx"
-#include "undobj.hxx"
+#include <SwRewriter.hxx>
#include "comcore.hrc"
using namespace ::com::sun::star;
@@ -363,7 +364,9 @@ BOOL SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
}
}
if (m_pWin->GetSdrDrawMode() == OBJ_NONE)
- m_pSh->EndUndo(UNDO_INSERT);
+ {
+ m_pSh->EndUndo();
+ }
}
bReturn = TRUE;
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index e6d7bf26db80..ec85bc2a3bf6 100755
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -36,6 +36,7 @@
#include <svx/ruler.hxx>
#include <svl/zforlist.hxx>
#include <svl/stritem.hxx>
+#include <unotools/undoopt.hxx>
#include "swtypes.hxx"
#include "cmdid.h"
@@ -74,9 +75,13 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind )
pView(0),
pBindings(pBind),
aAktTableName(aEmptyStr)
+ , m_nActionCount(0)
+ , m_bDoesUndo(true)
+ , m_bResetUndo(false)
+ , m_bCallUndo(false)
{
- bFirst = bDoesUndo = TRUE;
- bActive = bIsTable = bDelSel = bResetUndo = bCallUndo = FALSE;
+ bFirst = TRUE;
+ bActive = bIsTable = bDelSel = FALSE;
FreeResource();
@@ -143,16 +148,27 @@ __EXPORT SwInputWindow::~SwInputWindow()
if(pWrtShell)
pWrtShell->EndSelTblCells();
- if( bResetUndo )
+ CleanupUglyHackWithUndo();
+}
+
+void SwInputWindow::CleanupUglyHackWithUndo()
+{
+ if (m_bResetUndo)
{
DelBoxCntnt();
- pWrtShell->DoUndo( bDoesUndo );
- if(bCallUndo)
+ pWrtShell->DoUndo(m_bDoesUndo);
+ if (m_bCallUndo)
+ {
pWrtShell->Undo();
- SwEditShell::SetUndoActionCount( nActionCnt );
+ }
+ if (0 == m_nActionCount)
+ {
+ SW_MOD()->GetUndoOptions().SetUndoCount(0);
+ }
}
}
+
//==================================================================
void SwInputWindow::DataChanged( const DataChangedEvent& rDCEvt )
@@ -233,13 +249,17 @@ void SwInputWindow::ShowWin()
{
if( bIsTable )
{
- bResetUndo = TRUE;
- nActionCnt = SwEditShell::GetUndoActionCount();
- SwEditShell::SetUndoActionCount( nActionCnt + 1 );
+ m_bResetUndo = true;
+ m_nActionCount = SW_MOD()->GetUndoOptions().GetUndoCount();
+ if (0 == m_nActionCount) { // deactivated? turn it on...
+ SW_MOD()->GetUndoOptions().SetUndoCount(1);
+ }
- bDoesUndo = pWrtShell->DoesUndo();
- if( !bDoesUndo )
- pWrtShell->DoUndo( TRUE );
+ m_bDoesUndo = pWrtShell->DoesUndo();
+ if (!m_bDoesUndo)
+ {
+ pWrtShell->DoUndo(true);
+ }
if( !pWrtShell->SwCrsrShell::HasSelection() )
{
@@ -252,9 +272,11 @@ void SwInputWindow::ShowWin()
pWrtShell->StartUndo( UNDO_DELETE );
pWrtShell->Delete();
if( 0 != pWrtShell->EndUndo( UNDO_DELETE ))
- bCallUndo = TRUE;
+ {
+ m_bCallUndo = true;
+ }
}
- pWrtShell->DoUndo( FALSE );
+ pWrtShell->DoUndo(false);
SfxItemSet aSet( pWrtShell->GetAttrPool(), RES_BOXATR_FORMULA, RES_BOXATR_FORMULA );
if( pWrtShell->GetTblBoxFormulaAttrs( aSet ))
@@ -376,15 +398,7 @@ void SwInputWindow::ApplyFormula()
{
pView->GetViewFrame()->GetDispatcher()->Lock(FALSE);
pView->GetEditWin().LockKeyInput(FALSE);
- if( bResetUndo )
- {
- DelBoxCntnt();
- pWrtShell->DoUndo( bDoesUndo );
- SwEditShell::SetUndoActionCount( nActionCnt );
- if( bCallUndo )
- pWrtShell->Undo();
- bResetUndo = FALSE;
- }
+ CleanupUglyHackWithUndo();
pWrtShell->Pop( FALSE );
// JP 13.01.97: Formel soll immer mit einem "=" beginnen, hier
@@ -411,15 +425,7 @@ void SwInputWindow::CancelFormula()
{
pView->GetViewFrame()->GetDispatcher()->Lock( FALSE );
pView->GetEditWin().LockKeyInput(FALSE);
- if( bResetUndo )
- {
- DelBoxCntnt();
- pWrtShell->DoUndo( bDoesUndo );
- SwEditShell::SetUndoActionCount( nActionCnt );
- if( bCallUndo )
- pWrtShell->Undo();
- bResetUndo = FALSE;
- }
+ CleanupUglyHackWithUndo();
pWrtShell->Pop( FALSE );
if( bDelSel )
@@ -496,7 +502,7 @@ void SwInputWindow::SetFormula( const String& rFormula, BOOL bDelFlag )
IMPL_LINK( SwInputWindow, ModifyHdl, InputEdit*, EMPTYARG )
{
- if( bIsTable && bResetUndo )
+ if (bIsTable && m_bResetUndo)
{
pWrtShell->StartAllAction();
DelBoxCntnt();
@@ -670,25 +676,3 @@ SfxChildWinInfo __EXPORT SwInputChild::GetInfo() const
return aInfo;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 8115b4ec7438..f750447ed3fe 100755
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -161,7 +161,7 @@ SwAnnotationShell::~SwAnnotationShell()
{
}
-SfxUndoManager* SwAnnotationShell::GetUndoManager()
+::svl::IUndoManager* SwAnnotationShell::GetUndoManager()
{
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
if ( !pPostItMgr ||
@@ -1358,7 +1358,7 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
{
const SfxItemSet* pArgs = rReq.GetArgs();
- SfxUndoManager* pUndoManager = GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = GetUndoManager();
SwWrtShell &rSh = rView.GetWrtShell();
long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin()
@@ -1387,7 +1387,7 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
nCnt = 0;
while( nSteps-- )
- pUndoManager->Undo(0);
+ pUndoManager->Undo();
}
if ( nCnt )
@@ -1411,7 +1411,7 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
nCnt = 0;
while( nSteps-- )
- pUndoManager->Redo(0);
+ pUndoManager->Redo();
}
if ( nCnt )
@@ -1435,7 +1435,7 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
SfxWhichIter aIter(rSet);
USHORT nWhich = aIter.FirstWhich();
- SfxUndoManager* pUndoManager = GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = GetUndoManager();
SfxViewFrame *pSfxViewFrame = rView.GetViewFrame();
SwWrtShell &rSh = rView.GetWrtShell();
@@ -1448,8 +1448,10 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
sal_uInt16 nCount = pUndoManager->GetUndoActionCount();
if ( nCount )
pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
- else if( rSh.GetUndoIds() )
+ else if (rSh.GetLastUndoInfo(0, 0))
+ {
rSet.Put( SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::UNDO)) );
+ }
else
rSet.DisableItem(nWhich);
break;
@@ -1459,8 +1461,10 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
sal_uInt16 nCount = pUndoManager->GetRedoActionCount();
if ( nCount )
pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
- else if(rSh.GetRedoIds())
+ else if (rSh.GetFirstRedoInfo(0))
+ {
rSet.Put(SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::REDO)) );
+ }
else
rSet.DisableItem(nWhich);
break;
@@ -1470,34 +1474,36 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
{
if( pUndoManager )
{
- UniString (SfxUndoManager:: *fnGetComment)( USHORT ) const;
+ UniString (::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWhich )
{
nCount = pUndoManager->GetUndoActionCount();
- fnGetComment = &SfxUndoManager::GetUndoActionComment;
+ fnGetComment = &::svl::IUndoManager::GetUndoActionComment;
}
else
{
nCount = pUndoManager->GetRedoActionCount();
- fnGetComment = &SfxUndoManager::GetRedoActionComment;
+ fnGetComment = &::svl::IUndoManager::GetRedoActionComment;
}
String sList;
if( nCount )
{
for( sal_uInt16 n = 0; n < nCount; ++n )
- ( sList += (pUndoManager->*fnGetComment)( n ) )
+ ( sList += (pUndoManager->*fnGetComment)( n, ::svl::IUndoManager::TopLevel ) )
+= '\n';
}
SfxStringListItem aItem( nWhich );
- if( nWhich == SID_GETUNDOSTRINGS && rSh.GetUndoIds() )
+ if ((nWhich == SID_GETUNDOSTRINGS) &&
+ rSh.GetLastUndoInfo(0, 0))
{
rSh.GetDoStrings( SwWrtShell::UNDO, aItem );
}
- else if( nWhich == SID_GETREDOSTRINGS && rSh.GetRedoIds() )
+ else if ((nWhich == SID_GETREDOSTRINGS) &&
+ (rSh.GetFirstRedoInfo(0)))
{
rSh.GetDoStrings( SwWrtShell::UNDO, aItem );
}
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 15c97f67c847..9b760ed1b596 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -27,14 +27,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <sot/factory.hxx>
#include <hintids.hxx>
#include <svl/urihelper.hxx>
#include <svl/languageoptions.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <sfx2/linkmgr.hxx>
#include <svx/htmlmode.hxx>
#include <svx/imapdlg.hxx>
@@ -97,15 +96,9 @@
#include <caption.hxx>
#include <swwait.hxx>
#include <cmdid.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
#include <globals.h>
#include <unotxdoc.hxx>
#include <crsskip.hxx>
@@ -120,10 +113,7 @@
#include <instable.hxx>
#include <svx/fmshell.hxx> // for FN_XFORMS_DESIGN_MODE
#include <SwRewriter.hxx>
-#include <undobj.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <unomid.h>
@@ -553,35 +543,41 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet)
{
case SID_UNDO:
{
- if( rSh.GetUndoIds() )
+ if (rSh.GetLastUndoInfo(0, 0))
+ {
rSet.Put( SfxStringItem(nWhich,
rSh.GetDoString(SwWrtShell::UNDO)));
+ }
else
rSet.DisableItem(nWhich);
break;
}
case SID_REDO:
{
- if(rSh.GetRedoIds())
+ if (rSh.GetFirstRedoInfo(0))
+ {
rSet.Put(SfxStringItem(nWhich,
rSh.GetDoString(SwWrtShell::REDO)));
+ }
else
rSet.DisableItem(nWhich);
break;
}
case SID_REPEAT:
{ // Repeat nur moeglich wenn kein REDO moeglich - UI-Restriktion
- if(rSh.GetRedoIds() == UNDO_EMPTY &&
+ if ((!rSh.GetFirstRedoInfo(0)) &&
!rSh.IsSelFrmMode() &&
- rSh.GetRepeatIds() )
+ (UNDO_EMPTY != rSh.GetRepeatInfo(0)))
+ {
rSet.Put(SfxStringItem(nWhich, rSh.GetRepeatString()));
+ }
else
rSet.DisableItem(nWhich);
break;
}
case SID_GETUNDOSTRINGS:
- if( rSh.GetUndoIds() )
+ if (rSh.GetLastUndoInfo(0, 0))
{
SfxStringListItem aStrLst( nWhich );
rSh.GetDoStrings( SwWrtShell::UNDO, aStrLst );
@@ -592,7 +588,7 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet)
break;
case SID_GETREDOSTRINGS:
- if( rSh.GetRedoIds() )
+ if (rSh.GetFirstRedoInfo(0))
{
SfxStringListItem aStrLst( nWhich );
rSh.GetDoStrings( SwWrtShell::REDO, aStrLst );
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 2bd3a59d0810..ba205e5fb313 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -294,7 +294,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
pSh->StartAllAction();
// --> OD 2004-07-14 #i30451#
- pSh->StartUndo();
+ pSh->StartUndo(UNDO_INSFMTATTR);
pSdrView->SetGeoAttrToMarked(*pOutSet);
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 78a9b05ce70b..afd69a492c71 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -623,15 +623,15 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq)
1 < (nCnt = ((SfxUInt16Item*)pItem)->GetValue()) )
{
// then we make by ourself.
- SfxUndoManager* pUndoManager = GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = GetUndoManager();
if( pUndoManager )
{
if( SID_UNDO == nId )
while( nCnt-- )
- pUndoManager->Undo(0);
+ pUndoManager->Undo();
else
while( nCnt-- )
- pUndoManager->Redo(0);
+ pUndoManager->Redo();
}
bCallBase = FALSE;
GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False);
@@ -668,27 +668,27 @@ void SwDrawTextShell::StateUndo(SfxItemSet &rSet)
case SID_GETUNDOSTRINGS:
case SID_GETREDOSTRINGS:
{
- SfxUndoManager* pUndoManager = GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = GetUndoManager();
if( pUndoManager )
{
- UniString (SfxUndoManager:: *fnGetComment)( USHORT ) const;
+ UniString (::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
sal_uInt16 nCount;
if( SID_GETUNDOSTRINGS == nWhich )
{
nCount = pUndoManager->GetUndoActionCount();
- fnGetComment = &SfxUndoManager::GetUndoActionComment;
+ fnGetComment = &::svl::IUndoManager::GetUndoActionComment;
}
else
{
nCount = pUndoManager->GetRedoActionCount();
- fnGetComment = &SfxUndoManager::GetRedoActionComment;
+ fnGetComment = &::svl::IUndoManager::GetRedoActionComment;
}
if( nCount )
{
String sList;
for( sal_uInt16 n = 0; n < nCount; ++n )
- ( sList += (pUndoManager->*fnGetComment)( n ) )
+ ( sList += (pUndoManager->*fnGetComment)( n, ::svl::IUndoManager::TopLevel ) )
+= '\n';
SfxStringListItem aItem( nWhich );
@@ -899,7 +899,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
/*-- 22.10.2003 14:26:32---------------------------------------------------
-----------------------------------------------------------------------*/
-SfxUndoManager* SwDrawTextShell::GetUndoManager()
+::svl::IUndoManager* SwDrawTextShell::GetUndoManager()
{
SwWrtShell &rSh = GetShell();
pSdrView = rSh.GetDrawView();
diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx
index fe2e7502a3df..8669c4e201c1 100644
--- a/sw/source/ui/shells/grfshex.cxx
+++ b/sw/source/ui/shells/grfshex.cxx
@@ -34,42 +34,28 @@
#include <wrtsh.hxx>
#include <view.hxx>
#include <docary.hxx>
-#ifndef _TEXTSH_HXX
#include <textsh.hxx>
-#endif
#include <viewopt.hxx>
#include <swundo.hxx>
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
#include <caption.hxx>
#define _SVSTDARR_STRINGSSORTDTOR
#include <svl/svstdarr.hxx>
#include <svtools/filter.hxx>
#include <svx/htmlmode.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <frmfmt.hxx>
#include <frmmgr.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _SVX_SVDOMEDIA_HXX
#include <svx/svdomedia.hxx>
-#endif
-#ifndef _SVX_SVDVIEW_HXX
#include <svx/svdview.hxx>
-#endif
-#ifndef _SVX_SVDPAGV_HXX
#include <svx/svdpagv.hxx>
-#endif
#include <SwStyleNameMapper.hxx>
#include <sfx2/filedlghelper.hxx>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
@@ -79,7 +65,6 @@
// -> #111827#
#include <SwRewriter.hxx>
-#include <undobj.hxx>
#include <comcore.hrc>
// <- #111827#
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index 37d5e1ed5d69..fbdcd264c5d5 100644..100755
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -300,11 +300,9 @@ namespace SwLangHelper
}
rWrtSh.SetDefault( SvxLanguageItem( nLang, nLangWhichId ) );
- // set respective language attribute in text document to default
+ // #i102191: hard set respective language attribute in text document
// (for all text in the document - which should be selected by now...)
- SvUShortsSort aAttribs;
- aAttribs.Insert( nLangWhichId );
- rWrtSh.ResetAttr( &aAttribs );
+ rWrtSh.SetAttr( SvxLanguageItem( nLang, nLangWhichId ) );
}
}
}
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 0d217532e32a..b7795172e55f 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -79,9 +79,7 @@
#include <doc.hxx>
#include <uitool.hxx>
#include <cmdid.h>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <frmmgr.hxx>
#include <textsh.hxx>
#include <frmfmt.hxx>
@@ -100,12 +98,8 @@
#include <modcfg.hxx>
#include <column.hxx>
#include <edtwin.hxx>
-#ifndef _SHELLS_HRC
#include <shells.hrc>
-#endif
-#ifndef _POPUP_HRC
#include <popup.hrc>
-#endif
#include <swerror.h>
#include <SwAppletImpl.hxx>
#include <unochart.hxx>
@@ -120,10 +114,7 @@
#include <sfx2/msg.hxx>
#include <swslots.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -1217,7 +1208,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
}
rSh.EndAllAction();
- rSh.EndUndo( UNDO_INSERT );
+ rSh.EndUndo();
if ( aChars.Len() )
{
diff --git a/sw/source/ui/table/chartins.cxx b/sw/source/ui/table/chartins.cxx
index a11f04d55656..50d22e2d7804 100644
--- a/sw/source/ui/table/chartins.cxx
+++ b/sw/source/ui/table/chartins.cxx
@@ -53,9 +53,7 @@
#include <edtwin.hxx>
#include <cmdid.h>
-#ifndef _CHARTINS_HRC
#include <chartins.hrc>
-#endif
#include <anchoredobject.hxx>
#include <sot/clsids.hxx>
@@ -259,7 +257,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings )
if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
{
rWrtShell.Undo();
- rWrtShell.getIDocumentUndoRedoAccess()->ClearRedo();
+ rWrtShell.GetIDocumentUndoRedo().ClearRedo();
}
else
{
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index af7e12629a73..1f223350ed70 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -553,7 +553,7 @@ void SwSrcView::GetState(SfxItemSet& rSet)
case SID_UNDO:
case SID_REDO:
{
- SfxUndoManager& rMgr = pTextView->GetTextEngine()->GetUndoManager();
+ ::svl::IUndoManager& rMgr = pTextView->GetTextEngine()->GetUndoManager();
USHORT nCount = 0;
if(nWhich == SID_UNDO)
{
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index c1b93b56b96d..2c4a556f6bca 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -74,12 +74,12 @@
#include <beziersh.hxx>
#include <globdoc.hxx>
#include <scroll.hxx>
-#include <globdoc.hxx>
#include <navipi.hxx>
#include <gloshdl.hxx>
#include <usrpref.hxx>
#include <srcview.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <drawdoc.hxx>
#include <wdocsh.hxx>
#include <wview.hxx>
@@ -973,9 +973,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
!pDocSh->GetVisArea(ASPECT_CONTENT).IsEmpty() )
SetVisArea( pDocSh->GetVisArea(ASPECT_CONTENT),sal_False);
- SwEditShell::SetUndoActionCount(
- static_cast< USHORT >( SW_MOD()->GetUndoOptions().GetUndoCount() ) );
- pWrtShell->DoUndo( 0 != SwEditShell::GetUndoActionCount() );
+ pWrtShell->DoUndo( 0 != SW_MOD()->GetUndoOptions().GetUndoCount() );
const BOOL bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
SetNewWindowAllowed(!bBrowse);
@@ -1020,7 +1018,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
// so setze das Modified NICHT zurueck.
// --> OD 2005-02-11 #i38810# - no reset of modified state, if document
// was already modified.
- if ( !pWrtShell->GetDoc()->IsUndoNoResetModified() &&
+ if (!pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() &&
( !pFirst || pFirst == pVFrame ) &&
!bIsDocModified )
// <--
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 7c4ee3924a4b..960478c925dd 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
@@ -43,7 +44,7 @@
#include <docary.hxx>
#include <hintids.hxx>
#include <SwRewriter.hxx>
-#include <undobj.hxx>
+#include <numrule.hxx>
#include <swundo.hxx>
#include <caption.hxx>
#include <svl/PasswordHelper.hxx>
@@ -86,6 +87,7 @@
#include <uivwimp.hxx>
#include <docsh.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <wrtsh.hxx>
#include <viewopt.hxx>
#include <basesh.hxx>
@@ -469,7 +471,7 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq )
rReq.Done();
}
- rSh.EndUndo(UNDO_INSERT); // wegen moegl. Shellwechsel
+ rSh.EndUndo(); // due to possible change of Shell
}
delete pFileDlg;
@@ -2105,10 +2107,8 @@ long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion )
}
else
{
- sal_Bool bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
nErrno = pDocSh->InsertFrom( *pMedium ) ? 0 : ERR_SWG_READ_ERROR;
- pDoc->DoUndo( bUndo );
}
}
@@ -2125,7 +2125,9 @@ long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion )
{ // Disable Undo for .sdw (136991) or
// if the number of page styles with header/footer has changed (#i67305)
if( !pRead || nUndoCheck != lcl_PageDescWithHeader( *pDoc ) )
- pDoc->DelAllUndoObj();
+ {
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ }
}
pWrtShell->EndAllAction();
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index 3fdc6f6d61d3..64e0d5142db7 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -301,12 +301,8 @@ SfxTabPage* CreatePrintOptionsPage( Window *pParent,
void SetAppPrintOptions( ViewShell* pSh, BOOL bWeb )
{
- SwPrintData aPrtData = *SW_MOD()->GetPrtOptions(bWeb);
const IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess();
- SwPrintData* pShellPrintData = pIDDA->getPrintData();
-
- if(pShellPrintData)
- aPrtData = *pShellPrintData;
+ SwPrintData aPrtData = pIDDA->getPrintData();
if( pIDDA->getPrinter( false ) )
{
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index 57c7bd20623c..dd2db26a58e8 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -38,9 +38,7 @@
#include <svl/whiter.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/stritem.hxx>
-#ifndef _T2XTCMP_HXX //autogen
#include <svtools/txtcmp.hxx>
-#endif
#include <svl/itempool.hxx>
#include <svl/eitem.hxx>
#include <svl/srchitem.hxx>
@@ -52,27 +50,16 @@
#include <swmodule.hxx>
#include <swwait.hxx>
#include <workctrl.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <swundo.hxx> // fuer Undo-Ids
#include <uitool.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _VIEW_HRC
#include <view.hrc>
-#endif
#include <SwRewriter.hxx>
-#include <undobj.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include "PostItMgr.hxx"
@@ -598,7 +585,7 @@ void SwView::Replace()
pSrchItem->GetReplaceString(),
SwWrtShell::GETSTYLE_CREATESOME ));
- pWrtShell->EndUndo(UNDO_UI_REPLACE_STYLE); // #111827#
+ pWrtShell->EndUndo(); // #111827#
}
else
{
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index 40ba6e3c6d2d..d0b9d2a06827 100644
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <com/sun/star/uno/Sequence.hxx>
@@ -49,28 +50,20 @@
#include <tox.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _BASESH_HXX
#include <basesh.hxx>
-#endif
#include <uitool.hxx>
#include <viewopt.hxx>
#include <tablemgr.hxx>
#include <pagedesc.hxx>
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
#include <globdoc.hxx>
#include <svl/stritem.hxx>
#include <unotools/moduleoptions.hxx>
#include <svl/visitem.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <IDocumentRedlineAccess.hxx>
@@ -163,7 +156,7 @@ void SwView::GetState(SfxItemSet &rSet)
break;
case SID_CLEARHISTORY:
{
- rSet.Put(SfxBoolItem(nWhich, pWrtShell->GetUndoIds() != UNDO_EMPTY));
+ rSet.Put(SfxBoolItem(nWhich, pWrtShell->GetLastUndoInfo(0, 0)));
}
break;
case SID_UNDO:
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 9b847644234f..64f904b61c87 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -708,11 +708,7 @@ void SwXDocumentSettings::_postSetValues ()
// #i86352# the printer is also used as container for options by sfx
// when setting a printer it should have decent default options
SfxItemSet aOptions( mpPrinter->GetOptions() );
- SwPrintData aPrtData;
- if( mpDoc->getPrintData() )
- aPrtData = *mpDoc->getPrintData();
- else
- aPrtData = *SW_MOD()->GetPrtOptions(false);
+ SwPrintData aPrtData( mpDoc->getPrintData() );
SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, aPrtData);
aOptions.Put(aAddPrinterItem);
mpPrinter->SetOptions( aOptions );
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 256d5737f7f5..7a9cc3bceaee 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -712,11 +712,8 @@ uno::Any SAL_CALL SwXMailMerge::execute(
uno::Reference< mail::XMailService > xInService;
if (MailMergeType::PRINTER == nCurOutputType)
{
- SwPrintData aPrtData = *SW_MOD()->GetPrtOptions( FALSE );
IDocumentDeviceAccess* pIDDA = rSh.getIDocumentDeviceAccess();
- SwPrintData* pShellPrintData = pIDDA->getPrintData();
- if (pShellPrintData)
- aPrtData = *pShellPrintData;
+ SwPrintData aPrtData( pIDDA->getPrintData() );
aPrtData.SetPrintSingleJobs( bCurSinglePrintJobs );
pIDDA->setPrintData( aPrtData );
// #i25686# printing should not be done asynchronously to prevent dangling offices
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 75b76b6de887..42ef04634f6c 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -340,13 +340,7 @@ void SwXPrintSettings::_preSetValues ()
{
if (!mpDoc)
throw IllegalArgumentException ();
- if ( !mpDoc->getPrintData() )
- {
- mpPrtOpt = new SwPrintData;
- mpDoc->setPrintData ( *mpPrtOpt );
- delete mpPrtOpt;
- }
- mpPrtOpt = mpDoc->getPrintData();
+ mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getPrintData());
}
break;
}
@@ -502,13 +496,7 @@ void SwXPrintSettings::_preGetValues ()
{
if (!mpDoc)
throw IllegalArgumentException ();
- if ( !mpDoc->getPrintData() )
- {
- mpPrtOpt = new SwPrintData;
- mpDoc->setPrintData ( *mpPrtOpt );
- delete mpPrtOpt;
- }
- mpPrtOpt = mpDoc->getPrintData();
+ mpPrtOpt = const_cast< SwPrintData * >(&mpDoc->getPrintData());
}
break;
}
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 2dea6feb88c9..280ee131f958 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -198,10 +198,9 @@ SwPrintUIOptions * lcl_GetPrintUIOptions(
const bool bHasPostIts = lcl_GetPostIts( pDocShell->GetDoc(), 0 );
// get default values to use in dialog from documents SwPrintData
- const SwPrintData *pPrintData = pDocShell->GetDoc()->getPrintData();
- DBG_ASSERT( pPrintData, "failed to get SwPrintData from document" );
+ const SwPrintData &rPrintData = pDocShell->GetDoc()->getPrintData();
- return new SwPrintUIOptions( bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, *pPrintData );
+ return new SwPrintUIOptions( bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, rPrintData );
}
////////////////////////////////////////////////////////////
@@ -2616,33 +2615,28 @@ static void lcl_SavePrintUIOptionsToDocumentPrintData(
const SwPrintUIOptions &rPrintUIOptions,
bool bIsPDFEXport )
{
- if (!rDoc.getPrintData())
- {
- SwPrintData *pTmpData = new SwPrintData;
- rDoc.setPrintData ( *pTmpData );
- delete pTmpData; // setPrintData does make its own copy!
- }
-
- SwPrintData *pDocPrintData = rDoc.getPrintData();
-
- pDocPrintData->SetPrintGraphic( rPrintUIOptions.IsPrintGraphics() );
- pDocPrintData->SetPrintTable( rPrintUIOptions.IsPrintTables() );
- pDocPrintData->SetPrintDraw( rPrintUIOptions.IsPrintDrawings() );
- pDocPrintData->SetPrintControl( rPrintUIOptions.IsPrintFormControls() );
- pDocPrintData->SetPrintLeftPage( rPrintUIOptions.IsPrintLeftPages() );
- pDocPrintData->SetPrintRightPage( rPrintUIOptions.IsPrintRightPages() );
- pDocPrintData->SetPrintReverse( rPrintUIOptions.IsPrintReverse() );
- pDocPrintData->SetPaperFromSetup( rPrintUIOptions.IsPaperFromSetup() );
- pDocPrintData->SetPrintEmptyPages( rPrintUIOptions.IsPrintEmptyPages( bIsPDFEXport ) );
- pDocPrintData->SetPrintPostIts( rPrintUIOptions.GetPrintPostItsType() );
- pDocPrintData->SetPrintProspect( rPrintUIOptions.IsPrintProspect() );
- pDocPrintData->SetPrintProspect_RTL( rPrintUIOptions.IsPrintProspectRTL() );
- pDocPrintData->SetPrintPageBackground( rPrintUIOptions.IsPrintPageBackground() );
- pDocPrintData->SetPrintBlackFont( rPrintUIOptions.IsPrintWithBlackTextColor() );
- // pDocPrintData->SetPrintSingleJobs( b ); handled by File/Print dialog itself
- // pDocPrintData->SetFaxName( s ); n/a in File/Print dialog
- pDocPrintData->SetPrintHiddenText( rPrintUIOptions.IsPrintHiddenText() );
- pDocPrintData->SetPrintTextPlaceholder( rPrintUIOptions.IsPrintTextPlaceholders() );
+ SwPrintData aDocPrintData( rDoc.getPrintData() );
+
+ aDocPrintData.SetPrintGraphic( rPrintUIOptions.IsPrintGraphics() );
+ aDocPrintData.SetPrintTable( rPrintUIOptions.IsPrintTables() );
+ aDocPrintData.SetPrintDraw( rPrintUIOptions.IsPrintDrawings() );
+ aDocPrintData.SetPrintControl( rPrintUIOptions.IsPrintFormControls() );
+ aDocPrintData.SetPrintLeftPage( rPrintUIOptions.IsPrintLeftPages() );
+ aDocPrintData.SetPrintRightPage( rPrintUIOptions.IsPrintRightPages() );
+ aDocPrintData.SetPrintReverse( rPrintUIOptions.IsPrintReverse() );
+ aDocPrintData.SetPaperFromSetup( rPrintUIOptions.IsPaperFromSetup() );
+ aDocPrintData.SetPrintEmptyPages( rPrintUIOptions.IsPrintEmptyPages( bIsPDFEXport ) );
+ aDocPrintData.SetPrintPostIts( rPrintUIOptions.GetPrintPostItsType() );
+ aDocPrintData.SetPrintProspect( rPrintUIOptions.IsPrintProspect() );
+ aDocPrintData.SetPrintProspect_RTL( rPrintUIOptions.IsPrintProspectRTL() );
+ aDocPrintData.SetPrintPageBackground( rPrintUIOptions.IsPrintPageBackground() );
+ aDocPrintData.SetPrintBlackFont( rPrintUIOptions.IsPrintWithBlackTextColor() );
+ // aDocPrintData.SetPrintSingleJobs( b ); handled by File/Print dialog itself
+ // arDocPrintData.SetFaxName( s ); n/a in File/Print dialog
+ aDocPrintData.SetPrintHiddenText( rPrintUIOptions.IsPrintHiddenText() );
+ aDocPrintData.SetPrintTextPlaceholder( rPrintUIOptions.IsPrintTextPlaceholders() );
+
+ rDoc.setPrintData( aDocPrintData );
}
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 6eab64f68a60..e3777e6a8feb 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -36,9 +36,7 @@
#include <tools/urlobj.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/dispatch.hxx>
-#ifndef _HELP_HXX
#include <vcl/help.hxx>
-#endif
#include <sot/formats.hxx>
#include <vcl/sound.hxx>
#include <uiitems.hxx>
@@ -47,13 +45,9 @@
#include <fmtfld.hxx>
#include <swmodule.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <errhdl.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <content.hxx>
#include <frmfmt.hxx>
#include <fldbas.hxx>
@@ -69,24 +63,12 @@
#include <doc.hxx>
#include <unotools.hxx>
#include <crsskip.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _NAVIPI_HRC
#include <navipi.hrc>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
-#ifndef _MISC_HRC
#include <misc.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <com/sun/star/text/XTextSectionsSupplier.hpp>
#include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
@@ -102,7 +84,9 @@
#include <svx/svdview.hxx>
#include <vcl/scrbar.hxx>
#include <comcore.hrc>
-#include <undobj.hxx>
+#include <SwRewriter.hxx>
+#include <hints.hxx>
+#include <numrule.hxx>
#include <swundo.hxx>
#include <ndtxt.hxx>
#include <PostItMgr.hxx>
@@ -2834,7 +2818,7 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode)
pActiveShell->StartUndo(UNDO_DELETE, &aRewriter);
pActiveShell->GetView().GetViewFrame()->GetDispatcher()->Execute(FN_TABLE_SELECT_ALL);
pActiveShell->DeleteRow();
- pActiveShell->EndUndo(UNDO_DELETE);
+ pActiveShell->EndUndo();
pActiveShell->EndAction();
}
else if(nMode == EDIT_MODE_RENAME)
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 9acf40160bc3..8deacd017970 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -210,7 +210,7 @@ ULONG SwWrtShell::SearchPattern( const SearchOptions& rSearchOpt, BOOL bSearchIn
ULONG nRet = Find( rSearchOpt, bSearchInNotes, eStt, eEnd, bCancel, eFlags, bReplace );
if(bCancel)
{
- Undo(UNDO_EMPTY, 1);
+ Undo(1);
nRet = ULONG_MAX;
}
return nRet;
@@ -238,7 +238,7 @@ ULONG SwWrtShell::SearchTempl( const String &rTempl,
eStt,eEnd, bCancel, eFlags, pReplaceColl);
if(bCancel)
{
- Undo(UNDO_EMPTY, 1);
+ Undo(1);
nRet = ULONG_MAX;
}
return nRet;
@@ -263,7 +263,7 @@ ULONG SwWrtShell::SearchAttr( const SfxItemSet& rFindSet, BOOL bNoColls,
if(bCancel)
{
- Undo(UNDO_EMPTY, 1);
+ Undo(1);
nRet = ULONG_MAX;
}
return nRet;
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 50da84bbcdab..60b9821c15ba 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -102,7 +102,6 @@
// -> #111827#
#include <SwRewriter.hxx>
#include <comcore.hrc>
-#include <undobj.hxx>
// <- #111827#
#include <toolkit/helper/vclunohelper.hxx>
@@ -278,7 +277,7 @@ JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das
if( bStarted )
{
EndAllAction();
- EndUndo(UNDO_REPLACE);
+ EndUndo();
}
// delete pChgFlg;
}
@@ -378,7 +377,7 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
if ( bOwnMgr )
delete pFrmMgr;
- EndUndo(UNDO_INSERT);
+ EndUndo();
EndAllAction();
}
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 0e51cd4c756c..7aa0c49087d2 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -51,6 +51,7 @@
#include <reffld.hxx>
#include <swundo.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <viewopt.hxx> // SwViewOptions
#include <frmfmt.hxx> // fuer UpdateTable
#include <swtable.hxx> // fuer UpdateTable
@@ -67,8 +68,7 @@
#include <wrtsh.hrc>
#include "swabstdlg.hxx"
#include "fldui.hrc"
-
-#include <undobj.hxx>
+#include <SwRewriter.hxx>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -97,7 +97,7 @@ void SwWrtShell::Insert(SwField &rFld)
}
SwEditShell::Insert2(rFld, bDeleted);
- EndUndo(UNDO_INSERT);
+ EndUndo();
EndAllAction();
}
@@ -229,10 +229,11 @@ BOOL SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
if (pSet == NULL)
{
- SwDoc * _pDoc = GetDoc();
-
- if (_pDoc != NULL)
- _pDoc->DelAllUndoObj();
+ SwDoc *const pDoc_ = GetDoc();
+ if (pDoc_)
+ {
+ pDoc_->GetIDocumentUndoRedo().DelAllUndoObj();
+ }
}
}
@@ -480,8 +481,14 @@ void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk,
// the undostack. Then the change of the section dont create
// any undoobject. - BUG 69145
BOOL bDoesUndo = DoesUndo();
- if( UNDO_INSSECTION != GetUndoIds() )
- DoUndo( FALSE );
+ SwUndoId nLastUndoId(UNDO_EMPTY);
+ if (GetLastUndoInfo(0, & nLastUndoId))
+ {
+ if (UNDO_INSSECTION != nLastUndoId)
+ {
+ DoUndo(false);
+ }
+ }
UpdateSection( GetSectionFmtPos( *pIns->GetFmt() ), aSection );
DoUndo( bDoesUndo );
}
diff --git a/sw/source/ui/wrtsh/wrtundo.cxx b/sw/source/ui/wrtsh/wrtundo.cxx
index 8a20a03be0f0..b721b0500a29 100644
--- a/sw/source/ui/wrtsh/wrtundo.cxx
+++ b/sw/source/ui/wrtsh/wrtundo.cxx
@@ -36,6 +36,7 @@
#include <svl/slstitm.hxx>
#include <wrtsh.hxx>
#include <swundo.hxx> // fuer Undo-Ids
+#include <IDocumentUndoRedo.hxx>
#include <swdtflvr.hxx>
#include <svtools/svtdata.hxx>
#include <svtools/svtools.hrc>
@@ -60,7 +61,7 @@ void SwWrtShell::Do( DoType eDoType, USHORT nCnt )
DoUndo(sal_False); // #i21739#
// Modi zuruecksetzen
EnterStdMode();
- SwEditShell::Undo(UNDO_EMPTY, nCnt );
+ SwEditShell::Undo(nCnt);
break;
case REDO:
DoUndo(sal_False); // #i21739#
@@ -113,70 +114,66 @@ void SwWrtShell::Do( DoType eDoType, USHORT nCnt )
String SwWrtShell::GetDoString( DoType eDoType ) const
{
- String aStr, aUndoStr;
+ ::rtl::OUString aUndoStr;
USHORT nResStr = STR_UNDO;
switch( eDoType )
{
case UNDO:
nResStr = STR_UNDO;
- aUndoStr = GetUndoIdsStr();
+ GetLastUndoInfo(& aUndoStr, 0);
break;
case REDO:
nResStr = STR_REDO;
- aUndoStr = GetRedoIdsStr();
+ GetFirstRedoInfo(& aUndoStr);
break;
default:;//prevent warning
}
- aStr.Insert( String( SvtResId( nResStr)), 0 );
- aStr += aUndoStr;
+ ::rtl::OUStringBuffer buf = ::rtl::OUStringBuffer( String( SvtResId( nResStr ) ) );
+ buf.append(aUndoStr);
- return aStr;
+ return buf.makeStringAndClear();
}
USHORT SwWrtShell::GetDoStrings( DoType eDoType, SfxStringListItem& rStrs ) const
{
- SwUndoIds aIds;
+ SwUndoComments_t comments;
switch( eDoType )
{
case UNDO:
- GetUndoIds( NULL, &aIds );
+ comments = GetIDocumentUndoRedo().GetUndoComments();
break;
case REDO:
- GetRedoIds( NULL, &aIds );
+ comments = GetIDocumentUndoRedo().GetRedoComments();
break;
default:;//prevent warning
}
- String sList;
- for( USHORT n = 0, nEnd = aIds.Count(); n < nEnd; ++n )
+ ::rtl::OUStringBuffer buf;
+ for (size_t i = 0; i < comments.size(); ++i)
{
- const SwUndoIdAndName& rIdNm = *aIds[ n ];
- if( rIdNm.GetUndoStr() )
- sList += *rIdNm.GetUndoStr();
- else
- {
- ASSERT( !this, "no Undo/Redo Test set" );
- }
- sList += '\n';
+ OSL_ENSURE(comments[i].getLength(), "no Undo/Redo Text set");
+ buf.append(comments[i]);
+ buf.append(sal_Unicode('\n'));
}
- rStrs.SetString( sList );
- return aIds.Count();
+ rStrs.SetString(buf.makeStringAndClear());
+ return static_cast<sal_uInt16>(comments.size());
}
String SwWrtShell::GetRepeatString() const
{
- String aStr;
- String aUndoStr = GetRepeatIdsStr();
+ ::rtl::OUString str;
+ GetRepeatInfo(& str);
- if (aUndoStr.Len() > 0)
+ if (str.getLength() == 0)
{
- aStr.Insert( SvtResId( STR_REPEAT ), 0 );
- aStr += aUndoStr;
+ return str;
}
- return aStr;
+ ::rtl::OUStringBuffer buf( String(SvtResId(STR_REPEAT)) );
+ buf.append(str);
+ return buf.makeStringAndClear();
}
diff --git a/test/prj/build.lst b/test/prj/build.lst
index 5ef6353a1dc3..7adea0c0727b 100644
--- a/test/prj/build.lst
+++ b/test/prj/build.lst
@@ -2,3 +2,4 @@ te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offuh ridlja
te test\inc nmake - all inc NULL
te test\source\cpp nmake - all source_cpp inc NULL
te test\source\java\org\openoffice\test nmake - all source_java NULL
+te test\source\java\org\openoffice\test\tools nmake - all source_java_tools NULL
diff --git a/test/prj/d.lst b/test/prj/d.lst
index 48f9d8edba0c..54da2062a511 100644
--- a/test/prj/d.lst
+++ b/test/prj/d.lst
@@ -11,3 +11,4 @@ mkdir: %_DEST%\inc%_EXT%\test\detail
..\inc\test\toabsolutefileurl.hxx %_DEST%\inc%_EXT%\test\toabsolutefileurl.hxx
..\inc\test\uniquepipename.hxx %_DEST%\inc%_EXT%\test\uniquepipename.hxx
..\%__SRC%\class\test.jar %_DEST%\bin%_EXT%\test.jar
+..\%__SRC%\class\test-tools.jar %_DEST%\bin%_EXT%\test-tools.jar
diff --git a/test/source/java/org/openoffice/test/makefile.mk b/test/source/java/org/openoffice/test/makefile.mk
index 9314ea6a1506..8340f144aed3 100644
--- a/test/source/java/org/openoffice/test/makefile.mk
+++ b/test/source/java/org/openoffice/test/makefile.mk
@@ -25,7 +25,7 @@
PRJ = ../../../../..
PRJNAME = test
-TARGET = java
+TARGET = test
.IF "$(OOO_JUNIT_JAR)" != ""
@@ -39,9 +39,10 @@ JAVAFILES = \
JARFILES = juh.jar ridl.jar unoil.jar
EXTRAJARFILES = $(OOO_JUNIT_JAR)
-JARTARGET = test.jar
-JARCLASSDIRS = $(PACKAGE)
-JARCLASSPATH = $(JARFILES)
+JARTARGET = $(TARGET).jar
+JARCLASSDIRS = $(PACKAGE)
+JARCLASSEXCLUDES = $(PACKAGE)/tools/*
+JARCLASSPATH = $(JARFILES)
# expect $(OOO_JUNIT_JAR) to be on CLASSPATH wherever test.jar is used (also,
# on Windows, $(OOO_JUNIT_JAR) could be an absolute pathname with drive letter
# like X:/path and some JVMs would refuse to load test.jar if its MANIFEST.MF
diff --git a/test/source/java/org/openoffice/test/tools/DocumentType.java b/test/source/java/org/openoffice/test/tools/DocumentType.java
new file mode 100644
index 000000000000..bf310c5ed0fa
--- /dev/null
+++ b/test/source/java/org/openoffice/test/tools/DocumentType.java
@@ -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.
+ *
+ ************************************************************************/
+package org.openoffice.test.tools;
+
+/** a helper "enumeration class" for classifying a document type
+*/
+public class DocumentType extends com.sun.star.uno.Enum
+{
+ private DocumentType( int value )
+ {
+ super( value );
+ }
+
+ public static DocumentType getDefault()
+ {
+ return WRITER;
+ }
+
+ public static final DocumentType WRITER = new DocumentType(0);
+ public static final DocumentType CALC = new DocumentType(1);
+ public static final DocumentType DRAWING = new DocumentType(2);
+ public static final DocumentType XMLFORM = new DocumentType(3);
+ public static final DocumentType PRESENTATION = new DocumentType(4);
+ public static final DocumentType FORMULA = new DocumentType(5);
+ public static final DocumentType UNKNOWN = new DocumentType(-1);
+
+ public static DocumentType fromInt(int value)
+ {
+ switch(value)
+ {
+ case 0: return WRITER;
+ case 1: return CALC;
+ case 2: return DRAWING;
+ case 3: return XMLFORM;
+ case 4: return PRESENTATION;
+ case 5: return FORMULA;
+ default: return UNKNOWN;
+ }
+ }
+};
diff --git a/test/source/java/org/openoffice/test/tools/OfficeDocument.java b/test/source/java/org/openoffice/test/tools/OfficeDocument.java
new file mode 100644
index 000000000000..bfb76a347e1c
--- /dev/null
+++ b/test/source/java/org/openoffice/test/tools/OfficeDocument.java
@@ -0,0 +1,328 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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 org.openoffice.test.tools;
+
+import com.sun.star.beans.PropertyState;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.document.MacroExecMode;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.CloseVetoException;
+import com.sun.star.util.XCloseable;
+import com.sun.star.util.XModifiable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**************************************************************************/
+
+/**************************************************************************/
+/** provides a small wrapper around a document
+*/
+public class OfficeDocument
+{
+ /* ================================================================== */
+ /* ------------------------------------------------------------------ */
+ public OfficeDocument( XMultiServiceFactory orb, XComponent document )
+ {
+ m_orb = orb;
+ m_documentComponent = document;
+ }
+
+ /* ------------------------------------------------------------------ */
+ protected static XComponent implLoadAsComponent( XMultiServiceFactory orb, String documentOrFactoryURL ) throws com.sun.star.uno.Exception
+ {
+ return implLoadAsComponent( orb, documentOrFactoryURL, new PropertyValue[0] );
+ }
+
+ /* ------------------------------------------------------------------ */
+ protected static XComponent implLoadAsComponent( XMultiServiceFactory orb, String documentOrFactoryURL, final PropertyValue[] i_args ) throws com.sun.star.uno.Exception
+ {
+ XComponentLoader aLoader = UnoRuntime.queryInterface( XComponentLoader.class,
+ orb.createInstance( "com.sun.star.frame.Desktop" ) );
+
+ XComponent document = UnoRuntime.queryInterface( XComponent.class,
+ aLoader.loadComponentFromURL( documentOrFactoryURL, "_blank", 0, i_args )
+ );
+ return document;
+ }
+
+ /* ------------------------------------------------------------------ */
+ private static OfficeDocument implLoadDocument( XMultiServiceFactory orb, String documentOrFactoryURL ) throws com.sun.star.uno.Exception
+ {
+ return implLoadDocument( orb, documentOrFactoryURL, new PropertyValue[0] );
+ }
+
+ /* ------------------------------------------------------------------ */
+ private static OfficeDocument implLoadDocument( XMultiServiceFactory orb, String documentOrFactoryURL, final PropertyValue[] i_args ) throws com.sun.star.uno.Exception
+ {
+ XComponent document = implLoadAsComponent( orb, documentOrFactoryURL, i_args );
+
+ XServiceInfo xSI = UnoRuntime.queryInterface( XServiceInfo.class, document );
+ if ( xSI.supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
+ return new SpreadsheetDocument( orb, document );
+ return new OfficeDocument( orb, document );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public static OfficeDocument loadDocument( XMultiServiceFactory orb, String documentURL ) throws com.sun.star.uno.Exception
+ {
+ return implLoadDocument( orb, documentURL );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public static OfficeDocument blankTextDocument( XMultiServiceFactory orb ) throws com.sun.star.uno.Exception
+ {
+ return blankDocument( orb, DocumentType.WRITER );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public static OfficeDocument blankXMLForm( XMultiServiceFactory orb ) throws com.sun.star.uno.Exception
+ {
+ return blankDocument( orb, DocumentType.XMLFORM );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public static OfficeDocument blankDocument( XMultiServiceFactory orb, DocumentType eType ) throws com.sun.star.uno.Exception
+ {
+ final PropertyValue[] args = new PropertyValue[] {
+ new PropertyValue( "MacroExecutionMode", -1, MacroExecMode.ALWAYS_EXECUTE, PropertyState.DIRECT_VALUE )
+ };
+ return implLoadDocument( orb, getDocumentFactoryURL( eType ), args );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public boolean close()
+ {
+ try
+ {
+ XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class, m_documentComponent );
+ closeDoc.close( true );
+ return true;
+ }
+ catch ( CloseVetoException e )
+ {
+ Logger.getLogger( OfficeDocument.class.getName() ).log( Level.SEVERE, "closing the document was vetoed", e );
+ }
+ return false;
+ }
+
+ /* ================================================================== */
+ /* ------------------------------------------------------------------ */
+ public XComponent getDocument( )
+ {
+ return m_documentComponent;
+ }
+
+ /* ------------------------------------------------------------------ */
+ public boolean isModified()
+ {
+ XModifiable modify = (XModifiable)query( XModifiable.class );
+ return modify.isModified();
+ }
+
+ /* ------------------------------------------------------------------ */
+ public Object query( Class aInterfaceClass )
+ {
+ return UnoRuntime.queryInterface( aInterfaceClass, m_documentComponent );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public XMultiServiceFactory getOrb( )
+ {
+ return m_orb;
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** retrieves the current view of the document
+ @return
+ the view component, queried for the interface described by aInterfaceClass
+ */
+ public OfficeDocumentView getCurrentView( )
+ {
+ // get the model interface for the document
+ XModel xDocModel = UnoRuntime.queryInterface( XModel.class, m_documentComponent );
+ // get the current controller for the document - as a controller is tied to a view,
+ // this gives us the currently active view for the document.
+ XController xController = xDocModel.getCurrentController();
+
+ if ( classify() == DocumentType.CALC )
+ return new SpreadsheetView( m_orb, this, xController );
+
+ return new OfficeDocumentView( m_orb, this, xController );
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** reloads the document
+ *
+ * The reload is done by dispatching the respective URL at a frame of the document.
+ * As a consequence, if you have references to a view of the document, or any interface
+ * of the document, they will become invalid.
+ * The Model instance itself, at which you called reload, will still be valid, it will
+ * automatically update its internal state after the reload.
+ *
+ * Another consequence is that if the document does not have a view at all, it cannot
+ * be reloaded.
+ */
+ public void reload() throws Exception
+ {
+ OfficeDocumentView view = getCurrentView();
+ XFrame frame = view.getController().getFrame();
+ XModel oldModel = frame.getController().getModel();
+
+ getCurrentView().dispatch( ".uno:Reload" );
+
+ m_documentComponent = UnoRuntime.queryInterface( XComponent.class, frame.getController().getModel() );
+
+ XModel newModel = getCurrentView().getController().getModel();
+ if ( UnoRuntime.areSame( oldModel, newModel ) )
+ throw new java.lang.IllegalStateException( "reload failed" );
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** returns a URL which can be used to create a document of a certain type
+ */
+ public static String getDocumentFactoryURL( DocumentType eType )
+ {
+ if ( eType == DocumentType.WRITER )
+ return "private:factory/swriter";
+ if ( eType == DocumentType.CALC )
+ return "private:factory/scalc";
+ if ( eType == DocumentType.DRAWING )
+ return "private:factory/sdraw";
+ if ( eType == DocumentType.XMLFORM )
+ return "private:factory/swriter?slot=21053";
+ if ( eType == DocumentType.PRESENTATION )
+ return "private:factory/simpress";
+ if ( eType == DocumentType.FORMULA )
+ return "private:factory/smath";
+ return "private:factory/swriter";
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** classifies a document
+ */
+ public DocumentType classify( )
+ {
+ XServiceInfo xSI = UnoRuntime.queryInterface( XServiceInfo.class, m_documentComponent );
+
+ if ( xSI.supportsService( "com.sun.star.text.TextDocument" ) )
+ return DocumentType.WRITER;
+ else if ( xSI.supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
+ return DocumentType.CALC;
+ else if ( xSI.supportsService( "com.sun.star.drawing.DrawingDocument" ) )
+ return DocumentType.DRAWING;
+ else if ( xSI.supportsService( "com.sun.star.presentation.PresentationDocument" ) )
+ return DocumentType.PRESENTATION;
+ else if ( xSI.supportsService( "com.sun.star.formula.FormulaProperties" ) )
+ return DocumentType.FORMULA;
+
+ return DocumentType.UNKNOWN;
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** retrieves a com.sun.star.drawing.DrawPage of the document, denoted by index
+ * @param index
+ * the index of the draw page
+ * @throws
+ * com.sun.star.lang.IndexOutOfBoundsException
+ * com.sun.star.lang.WrappedTargetException
+ */
+ protected XDrawPage getDrawPage( int index ) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException
+ {
+ XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface( XDrawPagesSupplier.class, getDocument() );
+ XDrawPages xPages = xSuppPages.getDrawPages();
+
+ return UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** retrieves the <type scope="com.sun.star.drawing">DrawPage</type> of the document
+ */
+ protected XDrawPage getMainDrawPage( ) throws com.sun.star.uno.Exception
+ {
+ XDrawPage xReturn;
+
+ // in case of a Writer document, this is rather easy: simply ask the XDrawPageSupplier
+ XDrawPageSupplier xSuppPage = UnoRuntime.queryInterface( XDrawPageSupplier.class, getDocument() );
+ if ( null != xSuppPage )
+ xReturn = xSuppPage.getDrawPage();
+ else
+ { // the model itself is no draw page supplier - okay, it may be a Writer or Calc document
+ // (or any other multi-page document)
+ XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface( XDrawPagesSupplier.class, getDocument() );
+ XDrawPages xPages = xSuppPages.getDrawPages();
+
+ xReturn = UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
+
+ // Note that this is no really error-proof code: If the document model does not support the
+ // XDrawPagesSupplier interface, or if the pages collection returned is empty, this will break.
+ }
+
+ return xReturn;
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** creates a component at the service factory provided by the document
+ */
+ public XInterface createInstance( String serviceSpecifier ) throws com.sun.star.uno.Exception
+ {
+ XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class, m_documentComponent );
+ return (XInterface)xORB.createInstance( serviceSpecifier );
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** creates a component at the service factory provided by the document, queried for a given interface type
+ */
+ public <T> T createInstance( String i_serviceSpecifier, Class<T> i_interfaceClass ) throws com.sun.star.uno.Exception
+ {
+ return UnoRuntime.queryInterface( i_interfaceClass, createInstance( i_serviceSpecifier ) );
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** creates a component at the service factory provided by the document
+ */
+ public XInterface createInstanceWithArguments( String serviceSpecifier, Object[] arguments ) throws com.sun.star.uno.Exception
+ {
+ XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class, m_documentComponent );
+ return (XInterface) xORB.createInstanceWithArguments( serviceSpecifier, arguments );
+ }
+
+ private XMultiServiceFactory m_orb;
+ private XComponent m_documentComponent;
+};
+
diff --git a/test/source/java/org/openoffice/test/tools/OfficeDocumentView.java b/test/source/java/org/openoffice/test/tools/OfficeDocumentView.java
new file mode 100644
index 000000000000..9d5db59ac009
--- /dev/null
+++ b/test/source/java/org/openoffice/test/tools/OfficeDocumentView.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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 org.openoffice.test.tools;
+
+/**************************************************************************/
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.PropertyState;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+
+/**************************************************************************/
+/** provides a small wrapper around a document view
+*/
+public class OfficeDocumentView
+{
+ private XMultiServiceFactory m_orb;
+ private XController m_controller;
+ private OfficeDocument m_document;
+
+ /* ------------------------------------------------------------------ */
+ final public XController getController()
+ {
+ return m_controller;
+ }
+
+ /* ------------------------------------------------------------------ */
+ final protected OfficeDocument getDocument()
+ {
+ return m_document;
+ }
+
+ /* ------------------------------------------------------------------ */
+ public OfficeDocumentView( XMultiServiceFactory orb, OfficeDocument document, XController controller )
+ {
+ m_orb = orb;
+ m_document = document;
+ m_controller = controller;
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** retrieves a dispatcher for the given URL, obtained at the current view of the document
+ @param aURL
+ a one-element array. The first element must contain a valid
+ <member scope="com.sun.star.util">URL::Complete</member> value. Upon return, the URL is correctly
+ parsed.
+ @return
+ the dispatcher for the URL in question
+ */
+ public XDispatch getDispatcher( URL[] aURL ) throws com.sun.star.uno.Exception
+ {
+ XDispatch xReturn = null;
+
+ // go get the dispatch provider of it's frame
+ XDispatchProvider xProvider = UnoRuntime.queryInterface( XDispatchProvider.class, m_controller.getFrame() );
+ if ( null != xProvider )
+ {
+ // need an URLTransformer
+ XURLTransformer xTransformer = UnoRuntime.queryInterface( XURLTransformer.class,
+ m_orb.createInstance( "com.sun.star.util.URLTransformer" ) );
+ xTransformer.parseStrict( aURL );
+
+ xReturn = xProvider.queryDispatch( aURL[0], new String( ), 0 );
+ }
+ return xReturn;
+ }
+
+
+ /* ------------------------------------------------------------------ */
+ /** retrieves a dispatcher for the given URL, obtained at the current view of the document
+ */
+ public XDispatch getDispatcher( String url ) throws com.sun.star.uno.Exception
+ {
+ URL[] aURL = new URL[] { new URL() };
+ aURL[0].Complete = url;
+ return getDispatcher( aURL );
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** dispatches the given URL into the view, if there's a dispatcher for it
+
+ @return
+ <TRUE/> if the URL was successfully dispatched
+ */
+ public boolean dispatch( String i_url ) throws com.sun.star.uno.Exception
+ {
+ return dispatch( i_url, new PropertyValue[0] );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public boolean dispatch( final String i_url, final PropertyValue[] i_arguments ) throws com.sun.star.uno.Exception
+ {
+ URL[] completeURL = new URL[] { new URL() };
+ completeURL[0].Complete = i_url;
+ XDispatch dispatcher = getDispatcher( completeURL );
+ if ( dispatcher == null )
+ return false;
+
+ dispatcher.dispatch( completeURL[0], i_arguments );
+ return true;
+ }
+
+ /* ------------------------------------------------------------------ */
+ public boolean dispatch( final String i_url, final NamedValue[] i_arguments ) throws com.sun.star.uno.Exception
+ {
+ final PropertyValue[] dispatchArgs = new PropertyValue[ i_arguments.length ];
+ for ( int i=0; i<i_arguments.length; ++i )
+ {
+ dispatchArgs[i] = new PropertyValue( i_arguments[i].Name, -1, i_arguments[i].Value, PropertyState.DIRECT_VALUE );
+ }
+ return dispatch( i_url, dispatchArgs );
+ }
+};
+
diff --git a/test/source/java/org/openoffice/test/tools/SpreadsheetDocument.java b/test/source/java/org/openoffice/test/tools/SpreadsheetDocument.java
new file mode 100644
index 000000000000..83b4028eec32
--- /dev/null
+++ b/test/source/java/org/openoffice/test/tools/SpreadsheetDocument.java
@@ -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.
+ *
+ ************************************************************************/
+
+package org.openoffice.test.tools;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XComponent;
+import com.sun.star.table.XCellRange;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+ * @author frank.schoenheit@oracle.com
+ */
+public class SpreadsheetDocument extends OfficeDocument
+{
+ /** Creates a new blank spreadsheet document */
+ /* ------------------------------------------------------------------ */
+ public SpreadsheetDocument( XMultiServiceFactory orb ) throws com.sun.star.uno.Exception
+ {
+ super( orb, implLoadAsComponent( orb, "private:factory/scalc" ) );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public SpreadsheetDocument( XMultiServiceFactory orb, XComponent document ) throws com.sun.star.uno.Exception
+ {
+ super( orb, document );
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** returns the sheets collection
+ */
+ public XSpreadsheets getSheets() throws com.sun.star.uno.Exception
+ {
+ XSpreadsheetDocument spreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class, getDocument() );
+ return spreadsheetDoc.getSheets();
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** returns the sheet with the given index
+ */
+ public XCellRange getSheet( int index ) throws com.sun.star.uno.Exception
+ {
+ XIndexAccess sheets = UnoRuntime.queryInterface( XIndexAccess.class, getSheets() );
+ return UnoRuntime.queryInterface( XCellRange.class, sheets.getByIndex( index ) );
+ }
+}
diff --git a/test/source/java/org/openoffice/test/tools/SpreadsheetView.java b/test/source/java/org/openoffice/test/tools/SpreadsheetView.java
new file mode 100644
index 000000000000..34cb8b0813e4
--- /dev/null
+++ b/test/source/java/org/openoffice/test/tools/SpreadsheetView.java
@@ -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.
+ *
+ ************************************************************************/
+package org.openoffice.test.tools;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheetView;
+import com.sun.star.uno.UnoRuntime;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * @author frank.schoenheit@oracle.com
+ */
+public class SpreadsheetView extends OfficeDocumentView
+{
+
+ /** Creates a new instance of SpreadsheetView */
+ public SpreadsheetView( XMultiServiceFactory orb, OfficeDocument document, XController controller )
+ {
+ super( orb, document, controller );
+ }
+
+ /** activates the sheet with the given index
+ */
+ void activateSheet( int sheetIndex )
+ {
+ try
+ {
+ // get the sheet to activate
+ XSpreadsheetDocument doc = UnoRuntime.queryInterface( XSpreadsheetDocument.class, getDocument().getDocument() );
+ XIndexAccess sheets = UnoRuntime.queryInterface( XIndexAccess.class, doc.getSheets() );
+
+ XSpreadsheet sheet = UnoRuntime.queryInterface( XSpreadsheet.class, sheets.getByIndex( sheetIndex ) );
+
+ // activate
+ XSpreadsheetView view = UnoRuntime.queryInterface( XSpreadsheetView.class, getController() );
+ view.setActiveSheet( sheet );
+ }
+ catch( com.sun.star.uno.Exception e )
+ {
+ Logger.getLogger( SpreadsheetView.class.getName() ).log( Level.SEVERE, "unable to activate the given sheet", e );
+ }
+ }
+}
diff --git a/test/source/java/org/openoffice/test/tools/makefile.mk b/test/source/java/org/openoffice/test/tools/makefile.mk
new file mode 100644
index 000000000000..1464bb958d49
--- /dev/null
+++ b/test/source/java/org/openoffice/test/tools/makefile.mk
@@ -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.
+#***********************************************************************/
+
+PRJ = ../../../../../..
+PRJNAME = test
+TARGET = test-tools
+
+PACKAGE = org/openoffice/test/tools
+
+.INCLUDE: settings.mk
+
+JARFILES = juh.jar ridl.jar unoil.jar
+JAVAFILES = \
+ OfficeDocument.java \
+ OfficeDocumentView.java \
+ DocumentType.java \
+ SpreadsheetDocument.java \
+ SpreadsheetView.java \
+
+JARTARGET = $(TARGET).jar
+JARCLASSDIRS = $(PACKAGE)
+JARCLASSPATH = $(JARFILES)
+
+.INCLUDE: target.mk
+
+test:
+ echo $(JAVACLASSFILES)
diff --git a/testautomation/chart2/optional/ch2_losa_ods_to_sdc.bas b/testautomation/chart2/optional/ch2_losa_ods_to_sdc.bas
deleted file mode 100755
index d61c6183086a..000000000000
--- a/testautomation/chart2/optional/ch2_losa_ods_to_sdc.bas
+++ /dev/null
@@ -1,67 +0,0 @@
-'encoding UTF-8 Do not remove or change this line!
-'**************************************************************************
-' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'
-' Copyright 2000, 2010 Oracle and/or its affiliates.
-'
-' OpenOffice.org - a multi-platform office productivity suite
-'
-' This file is part of OpenOffice.org.
-'
-' OpenOffice.org is free software: you can redistribute it and/or modify
-' it under the terms of the GNU Lesser General Public License version 3
-' only, as published by the Free Software Foundation.
-'
-' OpenOffice.org is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-' GNU Lesser General Public License version 3 for more details
-' (a copy is included in the LICENSE file that accompanied this code).
-'
-' You should have received a copy of the GNU Lesser General Public License
-' version 3 along with OpenOffice.org. If not, see
-' <http://www.openoffice.org/license.html>
-' for a copy of the LGPLv3 License.
-'
-'/************************************************************************
-'*
-'* owner : oliver.craemer@oracle.com
-'*
-'* short description : Load/Save test for chart files - Input: ODS, Output: SDC
-'*
-'\************************************************************************
-
-Global gsFileFormat as String
-Global gsDirectoryInSourcePath as String
-Global gsOutputFileCustomExtension as String
-
-sub main
- gsFileFormat = "StarCalc 5.0"
- 'Important for determination of input file source path
- '-> gtesttoolpath & "chart2\optional\input\" & gsDirectoryInSourcePath &"\"
- gsDirectoryInSourcePath = "ods"
-
- 'Custom output file extension. Can be different to result from hGetFilternameExtension.
- 'e.g. "_excel95.xls"
- gsOutputFileCustomExtension = ".sdc"
-
- Printlog "--------------------------------------------------"
- Printlog "--- Load charts in ODS - SaveAS SDC ---"
- Printlog "--------------------------------------------------"
-
- use "chart2/optional/includes/loadsave/ch2_losa.inc"
- use "chart2/tools/ch_tools_common.inc"
-
- Call hStatusIn("Chart2", "ch2_losa_ods_to_sdc.bas")
- call subLoSaFromTo
- Call hStatusOut
-end sub
-'
-'-------------------------------------------------------------------------
-'
-sub LoadIncludeFiles
- use "global\system\includes\master.inc"
- use "global\system\includes\gvariabl.inc"
- gApplication = "CALC"
- Call GetUseFiles
-end sub
diff --git a/testautomation/chart2/optional/ch2_losa_sxc_to_sdc.bas b/testautomation/chart2/optional/ch2_losa_sxc_to_sdc.bas
deleted file mode 100755
index 7c8e8726f580..000000000000
--- a/testautomation/chart2/optional/ch2_losa_sxc_to_sdc.bas
+++ /dev/null
@@ -1,68 +0,0 @@
-'encoding UTF-8 Do not remove or change this line!
-'**************************************************************************
-' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'
-' Copyright 2000, 2010 Oracle and/or its affiliates.
-'
-' OpenOffice.org - a multi-platform office productivity suite
-'
-' This file is part of OpenOffice.org.
-'
-' OpenOffice.org is free software: you can redistribute it and/or modify
-' it under the terms of the GNU Lesser General Public License version 3
-' only, as published by the Free Software Foundation.
-'
-' OpenOffice.org is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-' GNU Lesser General Public License version 3 for more details
-' (a copy is included in the LICENSE file that accompanied this code).
-'
-' You should have received a copy of the GNU Lesser General Public License
-' version 3 along with OpenOffice.org. If not, see
-' <http://www.openoffice.org/license.html>
-' for a copy of the LGPLv3 License.
-'
-'/************************************************************************
-'*
-'* owner : oliver.craemer@oracle.com
-'*
-'* short description : Load/Save test for chart files - Input: SXC, Output: SDC
-'*
-'\************************************************************************
-
-Global gsFileFormat as String
-Global gsDirectoryInSourcePath as String
-Global gsOutputFileCustomExtension as String
-
-sub main
- gsFileFormat = "StarCalc 5.0"
-
- 'Important for determination of input file source path
- '-> gtesttoolpath & "chart2\optional\input\" & gsDirectoryInSourcePath &"\"
- gsDirectoryInSourcePath = "sxc"
-
- 'Custom output file extension. Can be different to result from hGetFilternameExtension.
- 'e.g. "_excel95.xls"
- gsOutputFileCustomExtension = ".sdc"
-
- Printlog "--------------------------------------------------"
- Printlog "--- Load charts in SXC - SaveAS SDC ---"
- Printlog "--------------------------------------------------"
-
- use "chart2/optional/includes/loadsave/ch2_losa.inc"
- use "chart2/tools/ch_tools_common.inc"
-
- Call hStatusIn("Chart2", "ch2_losa_sxc_to_sdc.bas")
- Call subLoSaFromTo
- Call hStatusOut
-end sub
-'
-'-------------------------------------------------------------------------
-'
-sub LoadIncludeFiles
- use "global\system\includes\master.inc"
- use "global\system\includes\gvariabl.inc"
- gApplication = "CALC"
- Call GetUseFiles
-end sub
diff --git a/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc
index 0151f5021b3e..f2a6e24e45a2 100755..100644
--- a/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc
+++ b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc
@@ -239,10 +239,10 @@ testcase tDataSeriesWizardCalc
call DialogTest ( TabChartTypeDataSeries )
printlog "Check if the data series listbox is enabled and contains three entries"
iDataSeries = DataSeries.GetItemCount
- if iDataSeries = 3 then
- printlog " All 3 data series are available"
+ if iDataSeries = 4 then
+ printlog " All 4 data series are available"
else
- warnlog "There are " & iDataSeries & " data series instead of 3"
+ warnlog "There are " & iDataSeries & " data series instead of 4"
endif
printlog "Check if the ADD button is enabled and click the button"
if AddButton.IsEnabled then
@@ -253,10 +253,10 @@ testcase tDataSeriesWizardCalc
endif
printlog "Check if there are now four entries in the data series listbox"
iDataSeries = DataSeries.GetItemCount
- if iDataSeries = 4 then
+ if iDataSeries = 5 then
printlog " Adding a data series was successfull"
else
- warnlog "There are " & iDataSeries & " data series instead of 4"
+ warnlog "There are " & iDataSeries & " data series instead of 5"
endif
printlog "Check if the second data series was added below the highlighted one"
if DataSeries.GetSelIndex = 2 then
@@ -271,9 +271,9 @@ testcase tDataSeriesWizardCalc
else
warnlog "REMOVE button is not enabled"
endif
- printlog "Check if there are now 3 entries in the data series listbox"
+ printlog "Check if there are now 4 entries in the data series listbox"
iDataSeries = DataSeries.GetItemCount
- if iDataSeries = 3 then
+ if iDataSeries = 4 then
printlog " Removing a data series was successfull"
else
warnlog "There are " & iDataSeries & " data series instead of 3"
@@ -302,13 +302,14 @@ testcase tDataSeriesWizardCalc
DataSeries.Select(1)
if MoveDown.IsEnabled then
printlog " The MoveDown button is enabled"
- printlog "Click Move Down button twice"
+ printlog "Click Move Down button three times"
+ MoveDown.Click
MoveDown.Click
MoveDown.Click
else
warnlog "The MoveDown button is disabled"
endif
- if DataSeries.GetSelIndex = 3 then
+ if DataSeries.GetSelIndex = 4 then
printlog " Moving data series was successfull"
if MoveDown.IsEnabled then
warnlog "MoveDown button is not disabled on first entry"
diff --git a/testautomation/chart2/required/ch2_updt_calc.bas b/testautomation/chart2/required/ch2_updt_calc.bas
index 02cc2c883269..806f0f220ed2 100755..100644
--- a/testautomation/chart2/required/ch2_updt_calc.bas
+++ b/testautomation/chart2/required/ch2_updt_calc.bas
@@ -71,8 +71,6 @@ sub main
call tFileSaveAsSTC
call tFileSaveAsXLS
call tFileSaveAsXLT
- call tFileSaveAsSDC
- call tFileSaveAsVOR
call tFileReload
printLog Chr(13) + "---------- Chart2 View Menu -----------"
Call tViewToolbars
@@ -112,6 +110,7 @@ sub main
Call tFormatAxisSecondaryXAxis
Call tFormatAxisSecondaryYAxis
Call tFormatAxisAllAxes
+ Call tFormatDateAxis
Call tFormatXAxisMainGrid
Call tFormatYAxisMainGrid
Call tFormatZAxisMainGrid
diff --git a/testautomation/chart2/required/includes/ch2_file.inc b/testautomation/chart2/required/includes/ch2_file.inc
index f7166df9c82e..51e41398532e 100755..100644
--- a/testautomation/chart2/required/includes/ch2_file.inc
+++ b/testautomation/chart2/required/includes/ch2_file.inc
@@ -37,8 +37,6 @@
' #1 tFileSaveAsSTC
' #1 tFileSaveAsXLS
' #1 tFileSaveAsXLT
-' #1 tFileSaveAsSDC
-' #1 tFileSaveAsVOR
' #1 tFileReload
'*
'\************************************************************************
@@ -295,82 +293,7 @@ testcase tFileSaveAsXLT
endcase
'
'-------------------------------------------------------------
-'
-testcase tFileSaveAsSDC
-'///<u><b>Save the test file as StarCalc 5.0 (.sdc)</b></u>
- Dim sOutputFile as string
-
- sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.sdc" )
- '/// Load simple chart document
- if fLoadVerySimpleChartAndSaveLocal() > 0 then
- warnlog "Loading test document seems to have failed -> Check this out!"
- goto endsub
- endif
- '/// Select chart using navigator
- call fSelectFirstOLE
- '/// Invoke Edit::Object::Edit to enter Inplace Mode
- EditObjectEdit
- '/// Convert chart to 3D (just to edit document)
- if NOT fConvertChartTo3D() then
- warnlog "Conversion of chart to 3D failed -> Quit testcase"
- Call hCloseDocument
- goto endsub
- endif
- '/// Unselect chart using Escape key
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- '/// Save document as StarCalc 5.0 (.sdc)
- if NOT hFileSaveAsWithFilterKill ( sOutputFile , "StarCalc 5.0" ) then
- warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
- call hCloseDocument
- goto endsub
- endif
- '/// Close document
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- Call hCloseDocument
-endcase
-'
-'-------------------------------------------------------------
-'
-testcase tFileSaveAsVOR
-'///<u><b>Save the test file as StarCalc 5.0 Template(.vor)</b></u>
- Dim sOutputFile as string
-
- sOutputFile = convertpath( gOfficepath & "user/work/verySimpleChart.vor" )
-
- '/// Load simple chart document
- if fLoadVerySimpleChartAndSaveLocal() > 0 then
- warnlog "Loading test document seems to have failed -> Check this out!"
- goto endsub
- endif
- '/// Select chart using navigator
- call fSelectFirstOLE
- '/// Invoke Edit::Object::Edit to enter Inplace Mode
- EditObjectEdit
- '/// Convert chart to 3D (just to edit document)
- if NOT fConvertChartTo3D() then
- warnlog "Conversion of chart to 3D failed -> Quit testcase"
- Call hCloseDocument
- goto endsub
- endif
- '/// Unselect chart using Escape key
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- '/// Save document as StarCalc 5.0 Template(.vor)
- if NOT hFileSaveAsWithFilterKill ( sOutputFile , "StarCalc 5.0 Vorlage/Template" ) then
- warnlog "Saving test document as '" & sOutputFile & "' failed -> Aborting"
- call hCloseDocument
- goto endsub
- endif
- '/// Close document
- Kontext "DocumentCalc"
- DocumentCalc.TypeKeys "<Escape>"
- Call hCloseDocument
-endcase
-'
-'-------------------------------------------------------------
'
testcase tFileReload
printlog "Load simple chart document"
diff --git a/testautomation/chart2/required/includes/ch2_format.inc b/testautomation/chart2/required/includes/ch2_format.inc
index 42048cbbb7de..27575ca4324f 100755..100644
--- a/testautomation/chart2/required/includes/ch2_format.inc
+++ b/testautomation/chart2/required/includes/ch2_format.inc
@@ -47,6 +47,7 @@
' #1 tFormatAxisSecondaryXAxis
' #1 tFormatAxisSecondaryYAxis
' #1 tFormatAxisAllAxes
+' #1 tFormatDateAxis
'*
'\************************************************************************
@@ -1404,4 +1405,40 @@ testcase tFormatAxisAllAxes
endcase
+'
+'-------------------------------------------------------------
+'
+testcase tFormatDateAxis
+ printlog "Load simple chart document"
+ if fLoadVerySimpleChartAndSaveLocal() > 0 then
+ warnlog "Loading test document seems to have failed -> Check this out!"
+ goto endsub
+ endif
+ printlog " Select chart using navigator"
+ call fSelectFirstOLE
+ printlog "Edit / Object / Edit"
+ EditObjectEdit
+ sleep(1)
+ printlog "Invoke Format::Axis::X Axis"
+ FormatAxisXAxis
+ printlog "Goto tab page Scale"
+ Kontext
+ Active.SetPage TabChartAxisScale
+ Kontext "TabChartAxisScale"
+ printlog " Switch axis type to Date"
+ AxisType.Select (3)
+ printlog " Verify that the date controls are available"
+ if MinorIntervalUnit.exists then
+ call DialogTest ( TabChartAxisScale,2 )
+ else
+ warnlog "Datecontrols are not available"
+ end if
+ printlog " Close dialog"
+ TabChartAxisScale.Cancel
+ printlog "Close document"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ Call hCloseDocument
+
+endcase
diff --git a/testautomation/dbaccess/optional/dba_rpt_Charts.bas b/testautomation/dbaccess/optional/dba_rpt_Charts.bas
new file mode 100644
index 000000000000..abe7817c7842
--- /dev/null
+++ b/testautomation/dbaccess/optional/dba_rpt_Charts.bas
@@ -0,0 +1,47 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner : marc.neumann@oracle.com
+'*
+'* short description : Charts in Reports
+'*
+'\***********************************************************************
+
+sub main
+
+ use "dbaccess/optional/includes/rpt_Charts.inc"
+
+ call rpt_Charts
+
+end sub
+
+sub LoadIncludeFiles
+ use "dbaccess/tools/dbinit.inc"
+ Call sDBInit
+ Call GetUseFiles
+ gApplication = "WRITER"
+end sub
diff --git a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
index 93f864d7e0d4..cc3be846569c 100755..100644
--- a/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
+++ b/testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc
@@ -192,13 +192,13 @@ testcase db_JDBCMySQL
dbok = fCreateMySQL_JDBC_Datasource(sFileName,aDatabaseProperties(3),aDatabaseProperties(2),aDatabaseProperties(4),aDatabaseProperties(5))
if dbok = true then
- 'call fOpendatabase(sFileName,aDatabaseProperties(6))
- 'call fCreateTable( aFieldTypeContent(), sTableName)
- 'call fInsertIntoTable( aFieldContent(), sTableName)
- 'call fCloseDatabase
+ call fOpendatabase(sFileName,aDatabaseProperties(6))
+ call fCreateTable( aFieldTypeContent(), sTableName)
+ call fInsertIntoTable( aFieldContent(), sTableName)
+ call fCloseDatabase
- 'use "dbaccess/optional/includes/b_lvl1_Query.inc"
- 'call b_lvl1_Query(sFileName,"dbase")
+ use "dbaccess/optional/includes/db_Query.inc"
+ call db_Query(sFileName,"MYSQL_JDBC",aDatabaseProperties(6))
call tRelation( sFileName, aDatabaseProperties(6), "rel1", "rel2" )
diff --git a/testautomation/dbaccess/optional/includes/db_Query.inc b/testautomation/dbaccess/optional/includes/db_Query.inc
index 46dce6e903c6..b9d88142698f 100755..100644
--- a/testautomation/dbaccess/optional/includes/db_Query.inc
+++ b/testautomation/dbaccess/optional/includes/db_Query.inc
@@ -45,7 +45,9 @@ function db_Query( sFileName , optional sType , optional sPassword)
case "ODBC", "JDBC"
sType = "2"
case "HSQLDB"
- sType = "2"
+ sType = "2"
+ case "MYSQL_JDBC"
+ sType = "3"
case else
sType = "1"
end select
@@ -57,6 +59,10 @@ function db_Query( sFileName , optional sType , optional sPassword)
call tQueryJoin( sFileName , sType, sPassword )
call tQueriesInQueries(sFileName)
endif
+
+ if sType = "3" then 'run only with database type MYSQL_JDBC
+ call tCastQuery( sFileName , sPassword )
+ endif
call tSortQueryWithAlias(sFileName , sPassword)
@@ -825,6 +831,46 @@ sub tTest8
sleep(2)
end sub
'--------------------------------------------------------------------
+sub tCastQuery( sFileName , sPassword )
+
+ fOpenDatabase(sFileName,sPassword)
+
+ if ( fOpenNewQueryDesign ) then
+ if ( fChooseTableInQueryAddTableDialog("TT_Query3") ) then
+ Kontext "QueryDesignCriterion"
+ sleep(1)
+ QueryDesignCriterion.TypeKeys "<MOD1 PAGEUP>" , true
+ sleep(1)
+ QueryDesignCriterion.TypeKeys "cast(f_date_s as date)" , true
+ sleep(1)
+ QueryDesignCriterion.TypeKeys "<RETURN>" , true
+ sleep(1)
+ Kontext "Toolbar"
+ printlog "- Executing query"
+ ExecuteBtn.Click
+ sleep(5)
+
+ Kontext "TableView"
+ if TableView.Exists(3) then
+
+ DataWindow.TypeKeys "<MOD1 C>"
+ if GetClipboard <> "40219" then
+ warnlog "the result should be 40219 but it is " + GetClipboard
+ else
+ printlog "the result is OK"
+ endif
+ else
+ warnlog "Execution of a query failed!"
+ end if
+
+ call fCloseQueryDesign
+
+ endif
+ endif
+ call fCloseDatabase
+
+end sub
+'--------------------------------------------------------------------
function tSortQueryWithAlias(sFileName, optional sPassword) ' test for isse 27832
if IsMissing(sPassword) then
diff --git a/testautomation/dbaccess/optional/includes/rpt_Charts.inc b/testautomation/dbaccess/optional/includes/rpt_Charts.inc
new file mode 100644
index 000000000000..cb7fc8ab1ce4
--- /dev/null
+++ b/testautomation/dbaccess/optional/includes/rpt_Charts.inc
@@ -0,0 +1,94 @@
+'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'/************************************************************************
+'*
+'* owner :
+'*
+'* short description :
+'*
+'\***********************************************************************
+
+sub rpt_Charts
+
+ tInsertChart
+
+end sub
+'--------------------------------------------------------------------------------------
+testcase tInsertChart
+
+ printlog "open Bibliography database"
+ call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb"))
+
+ printlog "open the report designer"
+ call fOpenNewReportDesign
+
+ sleep(1)
+
+ printlog "select the first table in the content list box"
+ Kontext "ReportDataProperties"
+ Content.select 1
+ Content.typeKeys("<RETURN>",true) ' important to leave the listbox
+
+ 'close the Add Field dialog to get the focus back to the design
+ call fCloseAddFieldDialog
+
+ printlog "insert a chart"
+ Kontext "StandardBar"
+ CreateChart.Click
+ sleep(1)
+
+ Kontext "ReportDesign"
+ ReportDesign.MouseDown ( 30, 10 )
+ ReportDesign.MouseMove ( 40, 20 )
+ ReportDesign.MouseUp ( 40, 20 )
+
+ sleep(1)
+
+ '/// execute the report
+ printlog "execute the report"
+ call fExecuteReport
+
+ sleep(10)
+
+ '/// check if the report is created
+ printlog "check if the report is created"
+ Kontext "DocumentWriter"
+ if (DocumentWriter.exists(10)) then
+ hFileSaveAsKill(gOfficePath + ConvertPath("user/work/report01.odt"))
+ call fCloseReportView
+ else
+ warnlog "No report is created."
+ endif
+
+ '/// close the report designer
+ printlog "close the report designer"
+ call fCloseReportDesign
+
+ '/// close the database
+ printlog "close the database"
+ call fCloseDatabase
+
+endcase \ No newline at end of file
diff --git a/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
index 91270481ca7b..7ba19ac8e449 100755..100644
--- a/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
+++ b/testautomation/dbaccess/optional/includes/rpt_ExecuteReport.inc
@@ -40,12 +40,7 @@ end sub
'-------------------------------------------------------------------------
'-------------------------------------------------------------------------
'-------------------------------------------------------------------------
-testcase tExecute
-
- if (iSprache = 7) then
- qaerrorlog "due to issue i94729 this testcase does not work under russian."
- goto endsub
- endif
+testcase tExecute
'/// open Bibliography database
printlog "open Bibliography database"
diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc
index cc99d8d203c5..034b1d18fef1 100644
--- a/testautomation/dbaccess/tools/dbcreatetools.inc
+++ b/testautomation/dbaccess/tools/dbcreatetools.inc
@@ -1377,14 +1377,7 @@ function fRegisterDatabaseFile( sFileName, sName)
Kontext "CreateDatabaseLink"
RegisteredName.setText(sName)
-
- ' this does not work due to issue 115468
- ' DatabaseFile.setText(sFileName)
- ' workaround
- CreatedatabaseLink.typeKeys("<shift tab>")
- CreatedatabaseLink.typeKeys("<shift tab>")
- CreatedatabaseLink.typeKeys(sFileName)
- ' -
+ DatabaseFile.setText(sFileName)
CreateDatabaseLink.OK
diff --git a/testautomation/dbaccess/tools/tabletools.inc b/testautomation/dbaccess/tools/tabletools.inc
index 99c4abf723b3..461ef8ff2da3 100755..100644
--- a/testautomation/dbaccess/tools/tabletools.inc
+++ b/testautomation/dbaccess/tools/tabletools.inc
@@ -340,6 +340,7 @@ function fCreateTable(aFieldTypeContent(),sTableName,optional sCatalog,optional
sleep 1
FieldType.TypeKeys "<RETURN>" , TRUE
Description.TypeKeys "<RETURN>" , TRUE
+ CellDescription.TypeKeys "<RETURN>" , TRUE
printlog "-------------------------------"
next
sleep(1)
diff --git a/testautomation/extensions/optional/e_display_name.bas b/testautomation/extensions/optional/e_display_name.bas
index c05ce235cb25..b0cafa1a8c71 100755
--- a/testautomation/extensions/optional/e_display_name.bas
+++ b/testautomation/extensions/optional/e_display_name.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension display names
'*
diff --git a/testautomation/extensions/optional/e_fileopen.bas b/testautomation/extensions/optional/e_fileopen.bas
index 63afebe693ba..47223ff61209 100755
--- a/testautomation/extensions/optional/e_fileopen.bas
+++ b/testautomation/extensions/optional/e_fileopen.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : CWS oxtsysint01 enables installing extensions via file open dialog
'*
diff --git a/testautomation/extensions/optional/e_help.bas b/testautomation/extensions/optional/e_help.bas
index 79420ad9d4de..c68005f75142 100755
--- a/testautomation/extensions/optional/e_help.bas
+++ b/testautomation/extensions/optional/e_help.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extensible help
'*
diff --git a/testautomation/extensions/optional/e_identifiers.bas b/testautomation/extensions/optional/e_identifiers.bas
index 3eea26b9d46f..fe10332cec61 100755
--- a/testautomation/extensions/optional/e_identifiers.bas
+++ b/testautomation/extensions/optional/e_identifiers.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Use unique identifiers instead of filenames for extensions
'*
diff --git a/testautomation/extensions/optional/e_issues.bas b/testautomation/extensions/optional/e_issues.bas
index cd3a4fe2f2ad..0e7659d8b7b4 100755
--- a/testautomation/extensions/optional/e_issues.bas
+++ b/testautomation/extensions/optional/e_issues.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension publisher string
'*
diff --git a/testautomation/extensions/optional/e_location.bas b/testautomation/extensions/optional/e_location.bas
index cfe2f0c0fb19..cfc660bba2d4 100755
--- a/testautomation/extensions/optional/e_location.bas
+++ b/testautomation/extensions/optional/e_location.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test the extension locator service
'*
diff --git a/testautomation/extensions/optional/e_meta-inf.bas b/testautomation/extensions/optional/e_meta-inf.bas
index 1e4e80dc1f0b..0758fd0d1600 100755
--- a/testautomation/extensions/optional/e_meta-inf.bas
+++ b/testautomation/extensions/optional/e_meta-inf.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Case sensitive META-INF file
'*
diff --git a/testautomation/extensions/optional/e_online_update.bas b/testautomation/extensions/optional/e_online_update.bas
index 0a23d2ad4aa7..8e21d9cd2a34 100755
--- a/testautomation/extensions/optional/e_online_update.bas
+++ b/testautomation/extensions/optional/e_online_update.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Hit update button for an extension
'*
diff --git a/testautomation/extensions/optional/e_options.bas b/testautomation/extensions/optional/e_options.bas
index bfa0a14e16a5..1f7b6a3e2342 100755
--- a/testautomation/extensions/optional/e_options.bas
+++ b/testautomation/extensions/optional/e_options.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Options for extensions
'*
diff --git a/testautomation/extensions/optional/e_platforms.bas b/testautomation/extensions/optional/e_platforms.bas
index 3884e374317f..8287060abb2f 100755
--- a/testautomation/extensions/optional/e_platforms.bas
+++ b/testautomation/extensions/optional/e_platforms.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Supported extension platforms
'*
diff --git a/testautomation/extensions/optional/e_publisher.bas b/testautomation/extensions/optional/e_publisher.bas
index e87d84d05f49..320064c8b633 100755
--- a/testautomation/extensions/optional/e_publisher.bas
+++ b/testautomation/extensions/optional/e_publisher.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension publisher string
'*
diff --git a/testautomation/extensions/optional/includes/display_name.inc b/testautomation/extensions/optional/includes/display_name.inc
index 080c22fa3a98..e7663c7dc8b6 100755..100644
--- a/testautomation/extensions/optional/includes/display_name.inc
+++ b/testautomation/extensions/optional/includes/display_name.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension display names
'*
diff --git a/testautomation/extensions/optional/includes/fileopen.inc b/testautomation/extensions/optional/includes/fileopen.inc
index 922e5ece9adc..8c3800f007d8 100755..100644
--- a/testautomation/extensions/optional/includes/fileopen.inc
+++ b/testautomation/extensions/optional/includes/fileopen.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : CWS oxtsysint01 enables installing extensions via file open dialog
'*
diff --git a/testautomation/extensions/optional/includes/help.inc b/testautomation/extensions/optional/includes/help.inc
index 004fd70ac429..5e6aa357e4b6 100755..100644
--- a/testautomation/extensions/optional/includes/help.inc
+++ b/testautomation/extensions/optional/includes/help.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extensible help
'*
diff --git a/testautomation/extensions/optional/includes/identifiers.inc b/testautomation/extensions/optional/includes/identifiers.inc
index 1a183f6c8025..dd4d42ca160d 100755..100644
--- a/testautomation/extensions/optional/includes/identifiers.inc
+++ b/testautomation/extensions/optional/includes/identifiers.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Use unique identifiers instead of filenames for extensions
'*
diff --git a/testautomation/extensions/optional/includes/issue110083.inc b/testautomation/extensions/optional/includes/issue110083.inc
index 73f7ad108322..8bd6c38dacee 100755
--- a/testautomation/extensions/optional/includes/issue110083.inc
+++ b/testautomation/extensions/optional/includes/issue110083.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : CWS sb112 fixes a problem with configuration schemas
'*
diff --git a/testautomation/extensions/optional/includes/location.inc b/testautomation/extensions/optional/includes/location.inc
index 262495666cbb..2c1cc45f0b07 100644
--- a/testautomation/extensions/optional/includes/location.inc
+++ b/testautomation/extensions/optional/includes/location.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test the extension locator service
'*
diff --git a/testautomation/extensions/optional/includes/meta-inf.inc b/testautomation/extensions/optional/includes/meta-inf.inc
index 4d36586dd908..e9fbd91bf7b3 100755..100644
--- a/testautomation/extensions/optional/includes/meta-inf.inc
+++ b/testautomation/extensions/optional/includes/meta-inf.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Case sensitive META-INF in packages
'*
diff --git a/testautomation/extensions/optional/includes/online_update.inc b/testautomation/extensions/optional/includes/online_update.inc
index ce3da2df0622..9f125c1c8a2c 100644
--- a/testautomation/extensions/optional/includes/online_update.inc
+++ b/testautomation/extensions/optional/includes/online_update.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Hit update button for an extension
'*
diff --git a/testautomation/extensions/optional/includes/options.inc b/testautomation/extensions/optional/includes/options.inc
index ff30ba00847b..e3cc82ba15f2 100755..100644
--- a/testautomation/extensions/optional/includes/options.inc
+++ b/testautomation/extensions/optional/includes/options.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Options for extensions
'*
diff --git a/testautomation/extensions/optional/includes/platforms.inc b/testautomation/extensions/optional/includes/platforms.inc
index eaac40b777cb..3ba5d4b2bc7f 100644
--- a/testautomation/extensions/optional/includes/platforms.inc
+++ b/testautomation/extensions/optional/includes/platforms.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Supported extension platforms
'*
diff --git a/testautomation/extensions/optional/includes/publisher.inc b/testautomation/extensions/optional/includes/publisher.inc
index 4fec6ab1bab2..8df7f96724a9 100644
--- a/testautomation/extensions/optional/includes/publisher.inc
+++ b/testautomation/extensions/optional/includes/publisher.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension publisher and release notes
'*
diff --git a/testautomation/extensions/required/e_update.bas b/testautomation/extensions/required/e_update.bas
index 89c85cb139fc..7761fae5ebe2 100644..100755
--- a/testautomation/extensions/required/e_update.bas
+++ b/testautomation/extensions/required/e_update.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension Update Test
'*
diff --git a/testautomation/extensions/required/includes/e_update.inc b/testautomation/extensions/required/includes/e_update.inc
index 22fe13395413..3f63beab2ff0 100644
--- a/testautomation/extensions/required/includes/e_update.inc
+++ b/testautomation/extensions/required/includes/e_update.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension Update Test
'*
diff --git a/testautomation/framework/optional/f_basic_dialog_i18n.bas b/testautomation/framework/optional/f_basic_dialog_i18n.bas
index 0c65064803c1..db3b3ddcb705 100755
--- a/testautomation/framework/optional/f_basic_dialog_i18n.bas
+++ b/testautomation/framework/optional/f_basic_dialog_i18n.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Testing the dialog i18n feature of the BASIC IDE
'*
diff --git a/testautomation/framework/optional/f_basic_documents.bas b/testautomation/framework/optional/f_basic_documents.bas
index 48e78dc2c0c6..40d49e7b7635 100755
--- a/testautomation/framework/optional/f_basic_documents.bas
+++ b/testautomation/framework/optional/f_basic_documents.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : BASIC organizers and documents
'*
diff --git a/testautomation/framework/optional/f_basic_first.bas b/testautomation/framework/optional/f_basic_first.bas
index d8f749380625..c4d3ecae6448 100755
--- a/testautomation/framework/optional/f_basic_first.bas
+++ b/testautomation/framework/optional/f_basic_first.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : BASIC IDE / Macro dialogs
'*
diff --git a/testautomation/framework/optional/f_basic_formcontrols.bas b/testautomation/framework/optional/f_basic_formcontrols.bas
index c0f6931d0a19..d3189961f4a2 100755
--- a/testautomation/framework/optional/f_basic_formcontrols.bas
+++ b/testautomation/framework/optional/f_basic_formcontrols.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Form controls in BASIC-IDE dialogs
'*
diff --git a/testautomation/framework/optional/f_basic_gridcontrol.bas b/testautomation/framework/optional/f_basic_gridcontrol.bas
index dc5f9a392988..de92175ab5ec 100644
--- a/testautomation/framework/optional/f_basic_gridcontrol.bas
+++ b/testautomation/framework/optional/f_basic_gridcontrol.bas
@@ -39,6 +39,7 @@ sub main
hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
call tGridcontrolLoad
+ call tTabcontrolLoad
hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
call hStatusOut()
diff --git a/testautomation/framework/optional/f_basic_issues.bas b/testautomation/framework/optional/f_basic_issues.bas
index 57e94aa505e4..7dbb5e2855f3 100755
--- a/testautomation/framework/optional/f_basic_issues.bas
+++ b/testautomation/framework/optional/f_basic_issues.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : Joerg.Skottke@Sun.Com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Regression tests for especially annoying BASIC issues
'*
diff --git a/testautomation/framework/optional/f_basic_library_export_import.bas b/testautomation/framework/optional/f_basic_library_export_import.bas
index f3fc06196a03..73e755ba7926 100755
--- a/testautomation/framework/optional/f_basic_library_export_import.bas
+++ b/testautomation/framework/optional/f_basic_library_export_import.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Export BASIC libraries
'*
diff --git a/testautomation/framework/optional/f_basic_modules.bas b/testautomation/framework/optional/f_basic_modules.bas
index ec92e75da4e9..f890b90ea2d7 100755
--- a/testautomation/framework/optional/f_basic_modules.bas
+++ b/testautomation/framework/optional/f_basic_modules.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Modules in BASIC-IDE
'*
diff --git a/testautomation/framework/optional/f_basic_package_export_import.bas b/testautomation/framework/optional/f_basic_package_export_import.bas
index dd299bda71bb..785f4596475f 100755
--- a/testautomation/framework/optional/f_basic_package_export_import.bas
+++ b/testautomation/framework/optional/f_basic_package_export_import.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Export BASIC libraries
'*
diff --git a/testautomation/framework/optional/f_basic_protected_libraries.bas b/testautomation/framework/optional/f_basic_protected_libraries.bas
index db372cc4a232..e0eb4d72dd26 100755
--- a/testautomation/framework/optional/f_basic_protected_libraries.bas
+++ b/testautomation/framework/optional/f_basic_protected_libraries.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test protected libraries
'*
diff --git a/testautomation/framework/optional/f_basic_shared_modules.bas b/testautomation/framework/optional/f_basic_shared_modules.bas
index d62d56f4e24c..6ff20f05c65a 100755
--- a/testautomation/framework/optional/f_basic_shared_modules.bas
+++ b/testautomation/framework/optional/f_basic_shared_modules.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Access modules below OpenOffice.org macros
'*
diff --git a/testautomation/framework/optional/f_basic_templatedocuments.bas b/testautomation/framework/optional/f_basic_templatedocuments.bas
index f701417c8648..ba40f8279270 100755
--- a/testautomation/framework/optional/f_basic_templatedocuments.bas
+++ b/testautomation/framework/optional/f_basic_templatedocuments.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : My Macros/standard execution with user defined template
'*
diff --git a/testautomation/framework/optional/f_basic_vba-compat.bas b/testautomation/framework/optional/f_basic_vba-compat.bas
index 1d867b61edee..3f5d3e376652 100755
--- a/testautomation/framework/optional/f_basic_vba-compat.bas
+++ b/testautomation/framework/optional/f_basic_vba-compat.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA import options and compatibility switches
'*
diff --git a/testautomation/framework/optional/f_extras_labels.bas b/testautomation/framework/optional/f_extras_labels.bas
index 51722ac38a32..493c55f4aa7d 100755
--- a/testautomation/framework/optional/f_extras_labels.bas
+++ b/testautomation/framework/optional/f_extras_labels.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the names of all labels
'*
diff --git a/testautomation/framework/optional/f_extras_samplefileopen.bas b/testautomation/framework/optional/f_extras_samplefileopen.bas
index f8484c3f5310..cc435bb6c06a 100755
--- a/testautomation/framework/optional/f_extras_samplefileopen.bas
+++ b/testautomation/framework/optional/f_extras_samplefileopen.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : open all samples via file-open dialog
'*
diff --git a/testautomation/framework/optional/f_extras_sampleopen.bas b/testautomation/framework/optional/f_extras_sampleopen.bas
index aa96bb6ab4fa..d7797bb87944 100755
--- a/testautomation/framework/optional/f_extras_sampleopen.bas
+++ b/testautomation/framework/optional/f_extras_sampleopen.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : open/save/load samples via template dialog
'*
diff --git a/testautomation/framework/optional/f_extras_samplepreview.bas b/testautomation/framework/optional/f_extras_samplepreview.bas
index 070d7eaf0c39..01e0bed22a2e 100755
--- a/testautomation/framework/optional/f_extras_samplepreview.bas
+++ b/testautomation/framework/optional/f_extras_samplepreview.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : display all samples as preview in template dialog
'*
diff --git a/testautomation/framework/optional/f_extras_tableautoformat.bas b/testautomation/framework/optional/f_extras_tableautoformat.bas
index 2081369b40c0..a2f816c5f7b7 100755
--- a/testautomation/framework/optional/f_extras_tableautoformat.bas
+++ b/testautomation/framework/optional/f_extras_tableautoformat.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check all names of table autoformats
'*
diff --git a/testautomation/framework/optional/f_extras_templatefileopen.bas b/testautomation/framework/optional/f_extras_templatefileopen.bas
index 5907f2cb00e5..e8e25ceb109f 100755
--- a/testautomation/framework/optional/f_extras_templatefileopen.bas
+++ b/testautomation/framework/optional/f_extras_templatefileopen.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : open all templates via file-open dialog
'*
diff --git a/testautomation/framework/optional/f_extras_templateopen.bas b/testautomation/framework/optional/f_extras_templateopen.bas
index 0b184af060eb..414fdad4f564 100755
--- a/testautomation/framework/optional/f_extras_templateopen.bas
+++ b/testautomation/framework/optional/f_extras_templateopen.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : open all templates via template dialog
'*
diff --git a/testautomation/framework/optional/f_extras_templatepreview.bas b/testautomation/framework/optional/f_extras_templatepreview.bas
index 1d50569b42b3..9e3e5d7f2ad4 100755
--- a/testautomation/framework/optional/f_extras_templatepreview.bas
+++ b/testautomation/framework/optional/f_extras_templatepreview.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : show all templates as preview in template dialog
'*
diff --git a/testautomation/framework/optional/f_filedlg_allowed_names.bas b/testautomation/framework/optional/f_filedlg_allowed_names.bas
index c3d44ee82754..37c58a414ce4 100755
--- a/testautomation/framework/optional/f_filedlg_allowed_names.bas
+++ b/testautomation/framework/optional/f_filedlg_allowed_names.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check special filenames and destinations
' **
diff --git a/testautomation/framework/optional/f_filedlg_autocompletion.bas b/testautomation/framework/optional/f_filedlg_autocompletion.bas
index 21f3addd2af4..e10ac78d17bd 100755
--- a/testautomation/framework/optional/f_filedlg_autocompletion.bas
+++ b/testautomation/framework/optional/f_filedlg_autocompletion.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : Filedialog - check autocompletion and wildcards
' **
diff --git a/testautomation/framework/optional/f_filedlg_cjk_files.bas b/testautomation/framework/optional/f_filedlg_cjk_files.bas
index a3e807edad9a..10248a2b8d61 100755
--- a/testautomation/framework/optional/f_filedlg_cjk_files.bas
+++ b/testautomation/framework/optional/f_filedlg_cjk_files.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check special filenames and destinations
' **
diff --git a/testautomation/framework/optional/f_filedlg_dialogtest.bas b/testautomation/framework/optional/f_filedlg_dialogtest.bas
index 8a14571ffe14..a0b299b99ab4 100755
--- a/testautomation/framework/optional/f_filedlg_dialogtest.bas
+++ b/testautomation/framework/optional/f_filedlg_dialogtest.bas
@@ -24,7 +24,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check the internal file dialog (Dialog)
' **
diff --git a/testautomation/framework/optional/f_filedlg_folder_navigation.bas b/testautomation/framework/optional/f_filedlg_folder_navigation.bas
index feacdd291253..6e5620703bff 100755
--- a/testautomation/framework/optional/f_filedlg_folder_navigation.bas
+++ b/testautomation/framework/optional/f_filedlg_folder_navigation.bas
@@ -24,7 +24,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check the internal file dialog (Folders/Navigation)
' **
diff --git a/testautomation/framework/optional/f_filedlg_forbidden_names_windows.bas b/testautomation/framework/optional/f_filedlg_forbidden_names_windows.bas
index f2a05d765b05..5e8d2d7e0f0c 100755
--- a/testautomation/framework/optional/f_filedlg_forbidden_names_windows.bas
+++ b/testautomation/framework/optional/f_filedlg_forbidden_names_windows.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check special filenames and destinations
' **
diff --git a/testautomation/framework/optional/f_filedlg_multiselection.bas b/testautomation/framework/optional/f_filedlg_multiselection.bas
index f25fe68fce74..ce581103000e 100755
--- a/testautomation/framework/optional/f_filedlg_multiselection.bas
+++ b/testautomation/framework/optional/f_filedlg_multiselection.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Select a huge number of documents and load
'*
diff --git a/testautomation/framework/optional/f_filedlg_passwords.bas b/testautomation/framework/optional/f_filedlg_passwords.bas
index dac9a5258ac4..1dd3af8d51b4 100755
--- a/testautomation/framework/optional/f_filedlg_passwords.bas
+++ b/testautomation/framework/optional/f_filedlg_passwords.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : save and load passworded files
'*
diff --git a/testautomation/framework/optional/f_filedlg_reserved_names_unix.bas b/testautomation/framework/optional/f_filedlg_reserved_names_unix.bas
index 81359724a57c..661f15361e07 100755
--- a/testautomation/framework/optional/f_filedlg_reserved_names_unix.bas
+++ b/testautomation/framework/optional/f_filedlg_reserved_names_unix.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check special filenames and destinations
' **
diff --git a/testautomation/framework/optional/f_filedlg_reserved_names_windows.bas b/testautomation/framework/optional/f_filedlg_reserved_names_windows.bas
index 1ca74f352f67..ea47663a6eec 100755
--- a/testautomation/framework/optional/f_filedlg_reserved_names_windows.bas
+++ b/testautomation/framework/optional/f_filedlg_reserved_names_windows.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check special filenames and destinations
' **
diff --git a/testautomation/framework/optional/f_help_bookmarks.bas b/testautomation/framework/optional/f_help_bookmarks.bas
index c61241437303..10323714400c 100755
--- a/testautomation/framework/optional/f_help_bookmarks.bas
+++ b/testautomation/framework/optional/f_help_bookmarks.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Bookmarks in the help browser
'*
diff --git a/testautomation/framework/optional/f_help_compare_applications.bas b/testautomation/framework/optional/f_help_compare_applications.bas
index 2f1d9418477c..e0fd6109a940 100755
--- a/testautomation/framework/optional/f_help_compare_applications.bas
+++ b/testautomation/framework/optional/f_help_compare_applications.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Compare lists from the Help Viewer against references
'*
diff --git a/testautomation/framework/optional/f_help_compare_content.bas b/testautomation/framework/optional/f_help_compare_content.bas
index 2df5ddc8eb00..a44a54e5253e 100755
--- a/testautomation/framework/optional/f_help_compare_content.bas
+++ b/testautomation/framework/optional/f_help_compare_content.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Compare lists from the Help Viewer against references
'*
diff --git a/testautomation/framework/optional/f_help_compare_topics.bas b/testautomation/framework/optional/f_help_compare_topics.bas
index 6ac22c441bbe..7e53e77f6aa4 100755
--- a/testautomation/framework/optional/f_help_compare_topics.bas
+++ b/testautomation/framework/optional/f_help_compare_topics.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Compare lists from the Help Viewer against references
'*
diff --git a/testautomation/framework/optional/f_help_search.bas b/testautomation/framework/optional/f_help_search.bas
index 7479644d0daf..65dfacfd4278 100755
--- a/testautomation/framework/optional/f_help_search.bas
+++ b/testautomation/framework/optional/f_help_search.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Search for a string, apply limitations
'*
diff --git a/testautomation/framework/optional/f_help_view_topics.bas b/testautomation/framework/optional/f_help_view_topics.bas
index 1cfa9fd5ab30..7be052e96d02 100755
--- a/testautomation/framework/optional/f_help_view_topics.bas
+++ b/testautomation/framework/optional/f_help_view_topics.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : load all index pages in help
'*
diff --git a/testautomation/framework/optional/f_scripting_organizers.bas b/testautomation/framework/optional/f_scripting_organizers.bas
index 999b40e15a8c..e046b20745cd 100755
--- a/testautomation/framework/optional/f_scripting_organizers.bas
+++ b/testautomation/framework/optional/f_scripting_organizers.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test scripting-organizers / document-stored scripts
'*
diff --git a/testautomation/framework/optional/f_security_broken_signature.bas b/testautomation/framework/optional/f_security_broken_signature.bas
index 465465d5f39a..ef09f008e2fd 100755
--- a/testautomation/framework/optional/f_security_broken_signature.bas
+++ b/testautomation/framework/optional/f_security_broken_signature.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Document with macro and broken signature
'*
diff --git a/testautomation/framework/optional/f_security_certification_dialogs.bas b/testautomation/framework/optional/f_security_certification_dialogs.bas
index da7c4a576249..5f200ba11184 100755
--- a/testautomation/framework/optional/f_security_certification_dialogs.bas
+++ b/testautomation/framework/optional/f_security_certification_dialogs.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Walk through a number of dialogs related to digital signatures
'*
diff --git a/testautomation/framework/optional/f_security_certified_docs.bas b/testautomation/framework/optional/f_security_certified_docs.bas
index cbedea197802..e08bb5104891 100755
--- a/testautomation/framework/optional/f_security_certified_docs.bas
+++ b/testautomation/framework/optional/f_security_certified_docs.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load certified documents and verify the certificate
'*
diff --git a/testautomation/framework/optional/f_security_evilmacro.bas b/testautomation/framework/optional/f_security_evilmacro.bas
index b34174b70412..ff1bf33dad49 100755
--- a/testautomation/framework/optional/f_security_evilmacro.bas
+++ b/testautomation/framework/optional/f_security_evilmacro.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load documents containing hidden BASIC scripts
'*
diff --git a/testautomation/framework/optional/f_security_incorrect_password.bas b/testautomation/framework/optional/f_security_incorrect_password.bas
index f10835af3e72..97f711ab2f3d 100755
--- a/testautomation/framework/optional/f_security_incorrect_password.bas
+++ b/testautomation/framework/optional/f_security_incorrect_password.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Verify that documents really get password protected
'*
diff --git a/testautomation/framework/optional/f_security_macrosecurity.bas b/testautomation/framework/optional/f_security_macrosecurity.bas
index 27bf1de7da4e..047e9961a3d4 100755
--- a/testautomation/framework/optional/f_security_macrosecurity.bas
+++ b/testautomation/framework/optional/f_security_macrosecurity.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Macros with all security-levels
'*
diff --git a/testautomation/framework/optional/f_security_recommend_password.bas b/testautomation/framework/optional/f_security_recommend_password.bas
index 2807b6f7cd0d..1fdaf3ed0b12 100755
--- a/testautomation/framework/optional/f_security_recommend_password.bas
+++ b/testautomation/framework/optional/f_security_recommend_password.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : checkbox to recommend password protection
'*
diff --git a/testautomation/framework/optional/f_security_trusted_path.bas b/testautomation/framework/optional/f_security_trusted_path.bas
index 1d1b21a0eefb..4f667f4c69e1 100755
--- a/testautomation/framework/optional/f_security_trusted_path.bas
+++ b/testautomation/framework/optional/f_security_trusted_path.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Execute macros from trusted path
'*
diff --git a/testautomation/framework/optional/f_toolbar_items.bas b/testautomation/framework/optional/f_toolbar_items.bas
index 3bacf71ac7af..09340f17554f 100755
--- a/testautomation/framework/optional/f_toolbar_items.bas
+++ b/testautomation/framework/optional/f_toolbar_items.bas
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update/resource-test for toolbars
'*
diff --git a/testautomation/framework/optional/f_usage_tracking.bas b/testautomation/framework/optional/f_usage_tracking.bas
index c056aa239624..4be8077635ff 100755
--- a/testautomation/framework/optional/f_usage_tracking.bas
+++ b/testautomation/framework/optional/f_usage_tracking.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Usage tracking
'*
diff --git a/testautomation/framework/optional/includes/basic_delete_modules.inc b/testautomation/framework/optional/includes/basic_delete_modules.inc
index c35900b012e4..72a073f9d68b 100755..100644
--- a/testautomation/framework/optional/includes/basic_delete_modules.inc
+++ b/testautomation/framework/optional/includes/basic_delete_modules.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Delete modules while BASIC is running
'*
diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
index c3db79efc08d..f9b28ff67180 100755..100644
--- a/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
+++ b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : Joerg.Skottke@Sun.Com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Copy a control with i18n data
'*
diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
index 89d5614c5b11..6d31d635bc55 100755..100644
--- a/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
+++ b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test correct handling of the default language
'*
diff --git a/testautomation/framework/optional/includes/basic_documents.inc b/testautomation/framework/optional/includes/basic_documents.inc
index 7e6613cdfcbc..1f2d62eaa70c 100755..100644
--- a/testautomation/framework/optional/includes/basic_documents.inc
+++ b/testautomation/framework/optional/includes/basic_documents.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : BASIC organizers and documents
'*
diff --git a/testautomation/framework/optional/includes/basic_formcontrols.inc b/testautomation/framework/optional/includes/basic_formcontrols.inc
index 68d6ae7c80ef..36a4ae35e1ab 100644
--- a/testautomation/framework/optional/includes/basic_formcontrols.inc
+++ b/testautomation/framework/optional/includes/basic_formcontrols.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Basic form-controls
'*
diff --git a/testautomation/framework/optional/includes/basic_gridcontrol.inc b/testautomation/framework/optional/includes/basic_gridcontrol.inc
index 61d7837df3cb..95bad4d09463 100644
--- a/testautomation/framework/optional/includes/basic_gridcontrol.inc
+++ b/testautomation/framework/optional/includes/basic_gridcontrol.inc
@@ -32,7 +32,6 @@
'\******************************************************************************
testcase tGridcontrolLoad
-
const MACRO_NAME = "Show"
const FILE_NAME = "framework/optional/input/gridcontrol.odt"
@@ -91,7 +90,58 @@ testcase tGridcontrolLoad
printlog( "Test exit, cleanup" )
hFileCloseAll()
hDeleteFile( gLastWorkFile )
+endcase
+
+
+testcase tTabcontrolLoad
+ const MACRO_NAME = "ShowTab"
+ const FILE_NAME = "framework/optional/input/gridcontrol.odt"
+
+ dim i as integer
+ dim a as integer
+ printlog( "Open the test document: " & FILE_NAME )
+ call hFileOpenLocally( gTestToolPath & FILE_NAME )
+
+ printlog "Start the macro, that performs the test"
+ hExecMacro( MACRO_NAME )
+
+ Kontext "tabcontroldialog"
+ if tabcontroldialog.exists(5) then
+ if tabcontainer.getPageCount = 2 then
+ printlog "There are 2 tabs"
+ else
+ warnlog "There are NOT 2 tabs, there are: " + tabcontainer.getpagecount
+ endif
+ if tabcontainer.getPage = "tabcontrol_1" then
+ printlog "Default tab page is page 1"
+ else
+ warnlog "Default tab page is NOT page 1"
+ endif
+ tabcontainer.setPage tabcontrol_2
+ wait 1000
+ if tabcontainer.getPage = "tabcontrol_2" then
+ printlog "Switching to tab 2 works"
+ else
+ warnlog "Switching to tab 2 failed"
+ endif
+ tabcontainer.setPage tabcontrol_1
+ wait 1000
+ if tabcontainer.getPage = "tabcontrol_1" then
+ printlog "Switching to tab 1 works"
+ else
+ warnlog "Switching to tab 1 failed"
+ endif
+
+ Kontext "tabcontroldialog"
+ tabcontroldialog.close
+ else
+ warnlog "tabcontrol Dialog did not come up after pressing button"
+ endif
+
+ printlog( "Test exit, cleanup" )
+ hFileCloseAll()
+ hDeleteFile( gLastWorkFile )
endcase
diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc
index eabaadf3176a..6537b8f8c80f 100755..100644
--- a/testautomation/framework/optional/includes/basic_ide.inc
+++ b/testautomation/framework/optional/includes/basic_ide.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Macro Dialogs opened from Basic-IDE
'*
diff --git a/testautomation/framework/optional/includes/basic_issues.inc b/testautomation/framework/optional/includes/basic_issues.inc
index 3fec49f61fbe..32ddb1390d85 100755..100644
--- a/testautomation/framework/optional/includes/basic_issues.inc
+++ b/testautomation/framework/optional/includes/basic_issues.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : Joerg.Skottke@Sun.Com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Regression tests for especially annoying BASIC issues
'*
diff --git a/testautomation/framework/optional/includes/basic_library_export.inc b/testautomation/framework/optional/includes/basic_library_export.inc
index 9d539e2a82a0..942d87b25062 100755..100644
--- a/testautomation/framework/optional/includes/basic_library_export.inc
+++ b/testautomation/framework/optional/includes/basic_library_export.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Export BASIC library (flat)
'*
diff --git a/testautomation/framework/optional/includes/basic_library_import.inc b/testautomation/framework/optional/includes/basic_library_import.inc
index f6b62e99c7ea..cb82055e95f1 100755..100644
--- a/testautomation/framework/optional/includes/basic_library_import.inc
+++ b/testautomation/framework/optional/includes/basic_library_import.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Import BASIC library (flat)
'*
diff --git a/testautomation/framework/optional/includes/basic_macros.inc b/testautomation/framework/optional/includes/basic_macros.inc
index dc58e21f1dea..cc8ff04fb408 100755..100644
--- a/testautomation/framework/optional/includes/basic_macros.inc
+++ b/testautomation/framework/optional/includes/basic_macros.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : check macro-dialogs / BASIC-IDE ( 1. part )
' **
diff --git a/testautomation/framework/optional/includes/basic_modulehide.inc b/testautomation/framework/optional/includes/basic_modulehide.inc
index fe492590c41b..c6daea7e834f 100755..100644
--- a/testautomation/framework/optional/includes/basic_modulehide.inc
+++ b/testautomation/framework/optional/includes/basic_modulehide.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Verify that hiding modules works
'*
diff --git a/testautomation/framework/optional/includes/basic_modulenames.inc b/testautomation/framework/optional/includes/basic_modulenames.inc
index 6b166c54680a..ed076927f2c1 100755..100644
--- a/testautomation/framework/optional/includes/basic_modulenames.inc
+++ b/testautomation/framework/optional/includes/basic_modulenames.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test modulenames on the tabbar
'*
diff --git a/testautomation/framework/optional/includes/basic_modules.inc b/testautomation/framework/optional/includes/basic_modules.inc
index 14e3aedca6db..9a227484846c 100755..100644
--- a/testautomation/framework/optional/includes/basic_modules.inc
+++ b/testautomation/framework/optional/includes/basic_modules.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Edit several modules and dialogs in basic ide
'*
diff --git a/testautomation/framework/optional/includes/basic_package_export.inc b/testautomation/framework/optional/includes/basic_package_export.inc
index b389c750e51d..6b80282185be 100755..100644
--- a/testautomation/framework/optional/includes/basic_package_export.inc
+++ b/testautomation/framework/optional/includes/basic_package_export.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Export BASIC libraries as package
'*
diff --git a/testautomation/framework/optional/includes/basic_package_import.inc b/testautomation/framework/optional/includes/basic_package_import.inc
index 80fe04cc92d4..ef9a5938c799 100644
--- a/testautomation/framework/optional/includes/basic_package_import.inc
+++ b/testautomation/framework/optional/includes/basic_package_import.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Import BASIC library via Package Manager GUI as UNO Package
'*
diff --git a/testautomation/framework/optional/includes/basic_protected_libraries.inc b/testautomation/framework/optional/includes/basic_protected_libraries.inc
index 6162352d710f..3ea033129924 100755..100644
--- a/testautomation/framework/optional/includes/basic_protected_libraries.inc
+++ b/testautomation/framework/optional/includes/basic_protected_libraries.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test protected libraries
'*
diff --git a/testautomation/framework/optional/includes/basic_shared_modules.inc b/testautomation/framework/optional/includes/basic_shared_modules.inc
index 497d69103bf6..48f97094b449 100644
--- a/testautomation/framework/optional/includes/basic_shared_modules.inc
+++ b/testautomation/framework/optional/includes/basic_shared_modules.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Access modules below OpenOffice.org macros
'*
diff --git a/testautomation/framework/optional/includes/basic_spectemplate.inc b/testautomation/framework/optional/includes/basic_spectemplate.inc
index 7fc265837f78..245eab9115c9 100644
--- a/testautomation/framework/optional/includes/basic_spectemplate.inc
+++ b/testautomation/framework/optional/includes/basic_spectemplate.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load the spec template via http and enable macros
'*
diff --git a/testautomation/framework/optional/includes/basic_usertemplate.inc b/testautomation/framework/optional/includes/basic_usertemplate.inc
index 97ec55c91505..a96d4aa81406 100755..100644
--- a/testautomation/framework/optional/includes/basic_usertemplate.inc
+++ b/testautomation/framework/optional/includes/basic_usertemplate.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : My Macros/standard execution with user defined template
'*
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc b/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
index e35fc8ae3494..39fd57f643f7 100644
--- a/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_application-union.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA compatibility switches
'*
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
index 81b2764a28f1..a3c8109941e2 100755..100644
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA compatibility switches
'*
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
index 970b8249a412..f889f77da58f 100755..100644
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA compatibility switches
'*
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
index dfade69eaafb..7959e5d3a8ac 100755..100644
--- a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA compatibility switches
'*
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_security_check.inc b/testautomation/framework/optional/includes/basic_vba-compat_security_check.inc
index 2dd9f6228455..5589d5b420e6 100644
--- a/testautomation/framework/optional/includes/basic_vba-compat_security_check.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_security_check.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA compatibility switches
'*
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc b/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc
index 201dd8eb9862..fa3abab3078f 100755..100644
--- a/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA compatibility switches
'*
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc b/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc
index 4c6f7c20a076..524c65c31227 100755..100644
--- a/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc
+++ b/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA compatibility switches
'*
diff --git a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
index 8fc37badb55f..d2f684743405 100755..100644
--- a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
+++ b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Small helpers for Excel BASIC import modes
'*
diff --git a/testautomation/framework/optional/includes/extras_file_open.inc b/testautomation/framework/optional/includes/extras_file_open.inc
index b4de32acd917..969c45247d58 100755..100644
--- a/testautomation/framework/optional/includes/extras_file_open.inc
+++ b/testautomation/framework/optional/includes/extras_file_open.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Perform standard operations on all samples/templates etc.
'*
diff --git a/testautomation/framework/optional/includes/extras_labels.inc b/testautomation/framework/optional/includes/extras_labels.inc
index 27e2ae8dced7..2c670ed494a6 100755..100644
--- a/testautomation/framework/optional/includes/extras_labels.inc
+++ b/testautomation/framework/optional/includes/extras_labels.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@sun.co
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : test names of labels
'*
diff --git a/testautomation/framework/optional/includes/extras_modify_objects.inc b/testautomation/framework/optional/includes/extras_modify_objects.inc
index 9500e7609e24..b76782e6468a 100644
--- a/testautomation/framework/optional/includes/extras_modify_objects.inc
+++ b/testautomation/framework/optional/includes/extras_modify_objects.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Perform standard operations on all samples/templates etc.
'*
diff --git a/testautomation/framework/optional/includes/extras_preview.inc b/testautomation/framework/optional/includes/extras_preview.inc
index ca3a24ec9995..33b6832bdf6f 100755..100644
--- a/testautomation/framework/optional/includes/extras_preview.inc
+++ b/testautomation/framework/optional/includes/extras_preview.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Perform standard operations on all samples/templates etc.
'*
diff --git a/testautomation/framework/optional/includes/extras_table_autoformat.inc b/testautomation/framework/optional/includes/extras_table_autoformat.inc
index 7ecb2ce9bf30..f3f5042a2e26 100755..100644
--- a/testautomation/framework/optional/includes/extras_table_autoformat.inc
+++ b/testautomation/framework/optional/includes/extras_table_autoformat.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test the autoformat-feature for tables
'*
diff --git a/testautomation/framework/optional/includes/f_usage_tracking.inc b/testautomation/framework/optional/includes/f_usage_tracking.inc
index c52ae61c0945..a53f6614ed64 100644
--- a/testautomation/framework/optional/includes/f_usage_tracking.inc
+++ b/testautomation/framework/optional/includes/f_usage_tracking.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Usage tracking
'*
@@ -88,7 +88,7 @@ testcase tUsageTracking3
endif
if ( ShowData.isEnabled() ) then
- warnlog( "#i97340# - Show data button should not be enabled if nothing is logged" )
+ warnlog( "#i116461# - Show data button should not be enabled if nothing is logged" )
ShowData.click()
@@ -100,7 +100,7 @@ testcase tUsageTracking3
kontext "Active"
if ( Active.exists( 2 ) ) then
- warnlog( "Messagebox not required as control should not be enabled (see #i97340#)" )
+ warnlog( "Messagebox not required as control should not be enabled (see #i116461#)" )
Active.ok()
kontext "TextImport"
diff --git a/testautomation/framework/optional/includes/filedlg_allowed_names.inc b/testautomation/framework/optional/includes/filedlg_allowed_names.inc
index a6d54077f4b5..60c0f6d53481 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_allowed_names.inc
+++ b/testautomation/framework/optional/includes/filedlg_allowed_names.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( extended tests )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_autocomplete.inc b/testautomation/framework/optional/includes/filedlg_autocomplete.inc
index bfa424378ef4..e49bdfb98551 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_autocomplete.inc
+++ b/testautomation/framework/optional/includes/filedlg_autocomplete.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Autocompletion feature
'*
diff --git a/testautomation/framework/optional/includes/filedlg_cjk_files.inc b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
index f9a049c6dbc9..c0777190ddb1 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_cjk_files.inc
+++ b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( extended tests )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_cjk_folders.inc b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
index cdeb2f922c98..9470a9e70190 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
+++ b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( extended tests )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_document_properties.inc b/testautomation/framework/optional/includes/filedlg_document_properties.inc
index 53917531e275..b350797ff18a 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_document_properties.inc
+++ b/testautomation/framework/optional/includes/filedlg_document_properties.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Access document properties
'*
diff --git a/testautomation/framework/optional/includes/filedlg_filternames.inc b/testautomation/framework/optional/includes/filedlg_filternames.inc
index 1d0b91e2710d..db09ceaa48ab 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_filternames.inc
+++ b/testautomation/framework/optional/includes/filedlg_filternames.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Verify that all filters are listed in the filter listbox
'*
diff --git a/testautomation/framework/optional/includes/filedlg_folders1.inc b/testautomation/framework/optional/includes/filedlg_folders1.inc
index 99cf0831f12c..01bd9467a816 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_folders1.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders1.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( 1. part )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_folders2.inc b/testautomation/framework/optional/includes/filedlg_folders2.inc
index e7b6f6e0dcbf..c8e9ac646fec 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_folders2.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders2.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( 1. part )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_folders3.inc b/testautomation/framework/optional/includes/filedlg_folders3.inc
index 354c95fbc23c..f0a132c4a494 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_folders3.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders3.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( 1. part )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_folders4.inc b/testautomation/framework/optional/includes/filedlg_folders4.inc
index 6c0bbb881730..4482fba90283 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_folders4.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders4.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( 1. part )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_folders5.inc b/testautomation/framework/optional/includes/filedlg_folders5.inc
index ed3959a6e7e4..b4f4a5690973 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_folders5.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders5.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( 1. part )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_folders6.inc b/testautomation/framework/optional/includes/filedlg_folders6.inc
index e82589bbe1d0..afca7a57aaa3 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_folders6.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders6.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog
'*
diff --git a/testautomation/framework/optional/includes/filedlg_folders7.inc b/testautomation/framework/optional/includes/filedlg_folders7.inc
index df9c399c7253..048ab7f5ca70 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_folders7.inc
+++ b/testautomation/framework/optional/includes/filedlg_folders7.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( 1. part )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
index b4b538b85cf6..f40b956b9c36 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
+++ b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( extended tests )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_multiselection.inc b/testautomation/framework/optional/includes/filedlg_multiselection.inc
index 32754ec00553..3d0cf3606260 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_multiselection.inc
+++ b/testautomation/framework/optional/includes/filedlg_multiselection.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Select a huge number of documents and load
'*
diff --git a/testautomation/framework/optional/includes/filedlg_passwords.inc b/testautomation/framework/optional/includes/filedlg_passwords.inc
index b9442cd2bfbd..a52db4690552 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_passwords.inc
+++ b/testautomation/framework/optional/includes/filedlg_passwords.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : save and load passworded files
'*
diff --git a/testautomation/framework/optional/includes/filedlg_rename.inc b/testautomation/framework/optional/includes/filedlg_rename.inc
index 513a652b8f36..c5f983db8c95 100644
--- a/testautomation/framework/optional/includes/filedlg_rename.inc
+++ b/testautomation/framework/optional/includes/filedlg_rename.inc
@@ -26,7 +26,7 @@
'
'/******************************************************************************
'*
-'* owner : Joerg.Skottke@Sun.Com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Remane files dialog
'*
diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
index 7758fbe55783..af6e67b53ce7 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
+++ b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( extended tests )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
index 48ed1a59e4a3..ec4119ca8518 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
+++ b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( extended tests )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_tools.inc b/testautomation/framework/optional/includes/filedlg_tools.inc
index b04fdc3f92ec..06c86bce75aa 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_tools.inc
+++ b/testautomation/framework/optional/includes/filedlg_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( 1. part )
'*
diff --git a/testautomation/framework/optional/includes/filedlg_triggers.inc b/testautomation/framework/optional/includes/filedlg_triggers.inc
index 1e39d2900895..68c715326769 100755..100644
--- a/testautomation/framework/optional/includes/filedlg_triggers.inc
+++ b/testautomation/framework/optional/includes/filedlg_triggers.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Alternative ways to open file-dialogs / slot availablilty
'*
diff --git a/testautomation/framework/optional/includes/help_bookmarks.inc b/testautomation/framework/optional/includes/help_bookmarks.inc
index 04a16951c0a9..22cd3d0dde03 100755..100644
--- a/testautomation/framework/optional/includes/help_bookmarks.inc
+++ b/testautomation/framework/optional/includes/help_bookmarks.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Bookmarks in the help browser
'*
diff --git a/testautomation/framework/optional/includes/help_compare_applications.inc b/testautomation/framework/optional/includes/help_compare_applications.inc
index 3028c41ecedf..ca1874d6a63d 100755..100644
--- a/testautomation/framework/optional/includes/help_compare_applications.inc
+++ b/testautomation/framework/optional/includes/help_compare_applications.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description :
'*
diff --git a/testautomation/framework/optional/includes/help_compare_content.inc b/testautomation/framework/optional/includes/help_compare_content.inc
index 73c11940e0dc..a65e27b27d04 100755..100644
--- a/testautomation/framework/optional/includes/help_compare_content.inc
+++ b/testautomation/framework/optional/includes/help_compare_content.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description :
'*
diff --git a/testautomation/framework/optional/includes/help_compare_topics.inc b/testautomation/framework/optional/includes/help_compare_topics.inc
index ef060eb18275..a067e814f3ab 100755..100644
--- a/testautomation/framework/optional/includes/help_compare_topics.inc
+++ b/testautomation/framework/optional/includes/help_compare_topics.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description :
'*
diff --git a/testautomation/framework/optional/includes/help_search.inc b/testautomation/framework/optional/includes/help_search.inc
index 92243b538c4f..e485b267da9c 100755..100644
--- a/testautomation/framework/optional/includes/help_search.inc
+++ b/testautomation/framework/optional/includes/help_search.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Search for a string, apply restrictions, verify
'*
diff --git a/testautomation/framework/optional/includes/help_view_topics.inc b/testautomation/framework/optional/includes/help_view_topics.inc
index b14c5d5a8511..6c7cd35bb510 100755..100644
--- a/testautomation/framework/optional/includes/help_view_topics.inc
+++ b/testautomation/framework/optional/includes/help_view_topics.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Display each help topic
'*
diff --git a/testautomation/framework/optional/includes/options_loadsave_html.inc b/testautomation/framework/optional/includes/options_loadsave_html.inc
index d1b7790f539b..fa65c21a8368 100755..100644
--- a/testautomation/framework/optional/includes/options_loadsave_html.inc
+++ b/testautomation/framework/optional/includes/options_loadsave_html.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test the Load/Save HTML compatibility page
'*
diff --git a/testautomation/framework/optional/includes/options_loadsave_msoffice.inc b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
index c04a110e7ce5..9a9e258e3e8b 100755..100644
--- a/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
+++ b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test Load/Save MS-Office settings page
'*
diff --git a/testautomation/framework/optional/includes/options_loadsave_vba.inc b/testautomation/framework/optional/includes/options_loadsave_vba.inc
index be367449553b..e227b0d9dc77 100755..100644
--- a/testautomation/framework/optional/includes/options_loadsave_vba.inc
+++ b/testautomation/framework/optional/includes/options_loadsave_vba.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test VBA settings-page
'*
diff --git a/testautomation/framework/optional/includes/options_ooo_general.inc b/testautomation/framework/optional/includes/options_ooo_general.inc
index 311f5bf8543d..78a6f48a770b 100644
--- a/testautomation/framework/optional/includes/options_ooo_general.inc
+++ b/testautomation/framework/optional/includes/options_ooo_general.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : 1. test for general group userdata
'*
diff --git a/testautomation/framework/optional/includes/options_ooo_memory.inc b/testautomation/framework/optional/includes/options_ooo_memory.inc
index 6c2038556af4..357e6e5a2f16 100755..100644
--- a/testautomation/framework/optional/includes/options_ooo_memory.inc
+++ b/testautomation/framework/optional/includes/options_ooo_memory.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : 1. test for general group userdata ... view)
'*
diff --git a/testautomation/framework/optional/includes/scripting_organizers.inc b/testautomation/framework/optional/includes/scripting_organizers.inc
index c3da1313da9c..5f804a951ea2 100755..100644
--- a/testautomation/framework/optional/includes/scripting_organizers.inc
+++ b/testautomation/framework/optional/includes/scripting_organizers.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test scripting-organizers / document-attached scripts
'*
diff --git a/testautomation/framework/optional/includes/security_broken_signature.inc b/testautomation/framework/optional/includes/security_broken_signature.inc
index 1cce0f33af3d..4e64d2073b7c 100755..100644
--- a/testautomation/framework/optional/includes/security_broken_signature.inc
+++ b/testautomation/framework/optional/includes/security_broken_signature.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load documents containing hidden BASIC scripts
'*
diff --git a/testautomation/framework/optional/includes/security_certification_dialogs.inc b/testautomation/framework/optional/includes/security_certification_dialogs.inc
index c367285956ae..60cb3cfaf657 100644
--- a/testautomation/framework/optional/includes/security_certification_dialogs.inc
+++ b/testautomation/framework/optional/includes/security_certification_dialogs.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Walk through a number of dialogs related to digital signatures
'*
diff --git a/testautomation/framework/optional/includes/security_certified_docs.inc b/testautomation/framework/optional/includes/security_certified_docs.inc
index b00e5460e3fb..71e899609b4b 100755..100644
--- a/testautomation/framework/optional/includes/security_certified_docs.inc
+++ b/testautomation/framework/optional/includes/security_certified_docs.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@sun.co
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load certified documents and verify the certificate
'*
diff --git a/testautomation/framework/optional/includes/security_evilmacro1.inc b/testautomation/framework/optional/includes/security_evilmacro1.inc
index 9927f1652cb3..0de48f87824e 100755..100644
--- a/testautomation/framework/optional/includes/security_evilmacro1.inc
+++ b/testautomation/framework/optional/includes/security_evilmacro1.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load documents containing hidden BASIC scripts
'*
diff --git a/testautomation/framework/optional/includes/security_evilmacro2.inc b/testautomation/framework/optional/includes/security_evilmacro2.inc
index 0c687976fba7..6b8b29903f72 100755..100644
--- a/testautomation/framework/optional/includes/security_evilmacro2.inc
+++ b/testautomation/framework/optional/includes/security_evilmacro2.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load documents containing hidden BASIC scripts
'*
diff --git a/testautomation/framework/optional/includes/security_evilmacro3.inc b/testautomation/framework/optional/includes/security_evilmacro3.inc
index c891163ef3e2..a4613be4b678 100755..100644
--- a/testautomation/framework/optional/includes/security_evilmacro3.inc
+++ b/testautomation/framework/optional/includes/security_evilmacro3.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Load documents containing hidden BASIC scripts
'*
diff --git a/testautomation/framework/optional/includes/security_incorrect_password.inc b/testautomation/framework/optional/includes/security_incorrect_password.inc
index 9f8cfcb39d7d..74be4748b55e 100644
--- a/testautomation/framework/optional/includes/security_incorrect_password.inc
+++ b/testautomation/framework/optional/includes/security_incorrect_password.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Password protect files
'*
diff --git a/testautomation/framework/optional/includes/security_macrosecurity.inc b/testautomation/framework/optional/includes/security_macrosecurity.inc
index 3df134d83d33..11c5b0ec6123 100644
--- a/testautomation/framework/optional/includes/security_macrosecurity.inc
+++ b/testautomation/framework/optional/includes/security_macrosecurity.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Macros with all security-levels
'*
diff --git a/testautomation/framework/optional/includes/security_recommend_password.inc b/testautomation/framework/optional/includes/security_recommend_password.inc
index ab914fe5125b..d7eef2f15146 100755..100644
--- a/testautomation/framework/optional/includes/security_recommend_password.inc
+++ b/testautomation/framework/optional/includes/security_recommend_password.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Password settings in Tools/Options
'*
diff --git a/testautomation/framework/optional/includes/security_trusted_path.inc b/testautomation/framework/optional/includes/security_trusted_path.inc
index 9115ba2e9f5a..163f0b9305f6 100755..100644
--- a/testautomation/framework/optional/includes/security_trusted_path.inc
+++ b/testautomation/framework/optional/includes/security_trusted_path.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Execute macros from trusted path
'*
@@ -63,6 +63,7 @@ testcase tSecTrustedPath( cWorkFile as string, iSecLevel as integer )
endif
endif
+ Sleep (1)
printlog( "Verify that the macro is executed" )
kontext "Active"
if ( active.exists( 2 ) ) then
diff --git a/testautomation/framework/optional/includes/standardbar2.inc b/testautomation/framework/optional/includes/standardbar2.inc
index 2b9f8a95d129..9cb9fb1c066f 100755..100644
--- a/testautomation/framework/optional/includes/standardbar2.inc
+++ b/testautomation/framework/optional/includes/standardbar2.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : global update test (Standardbar)
'*
diff --git a/testautomation/framework/optional/input/gridcontrol.odt b/testautomation/framework/optional/input/gridcontrol.odt
index 2f467b3f2852..d1d52c32245f 100755
--- a/testautomation/framework/optional/input/gridcontrol.odt
+++ b/testautomation/framework/optional/input/gridcontrol.odt
Binary files differ
diff --git a/testautomation/framework/required/f_help_browser.bas b/testautomation/framework/required/f_help_browser.bas
index 753b1d8cae99..b3acd3054f34 100755
--- a/testautomation/framework/required/f_help_browser.bas
+++ b/testautomation/framework/required/f_help_browser.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update/resource-test for the help-browser
'*
diff --git a/testautomation/framework/required/f_printer_administration.bas b/testautomation/framework/required/f_printer_administration.bas
index 93ad542126ae..f501f51e3ec1 100755
--- a/testautomation/framework/required/f_printer_administration.bas
+++ b/testautomation/framework/required/f_printer_administration.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : A brief look at the spadmin-tool
'*
diff --git a/testautomation/framework/required/f_programmability_dialogs.bas b/testautomation/framework/required/f_programmability_dialogs.bas
index 7965a842d5f4..e785d224b278 100644
--- a/testautomation/framework/required/f_programmability_dialogs.bas
+++ b/testautomation/framework/required/f_programmability_dialogs.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update-Test for some dialogs in Basic-IDE
'*
diff --git a/testautomation/framework/required/f_security_dialogs.bas b/testautomation/framework/required/f_security_dialogs.bas
index 76bd6cc57373..a07d2d5387fc 100755
--- a/testautomation/framework/required/f_security_dialogs.bas
+++ b/testautomation/framework/required/f_security_dialogs.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Security dialogs in Tools/Options
'*
diff --git a/testautomation/framework/required/f_standard_toolbar.bas b/testautomation/framework/required/f_standard_toolbar.bas
index 83a860f6674a..6308add90d95 100755
--- a/testautomation/framework/required/f_standard_toolbar.bas
+++ b/testautomation/framework/required/f_standard_toolbar.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update/resource-test for toolbars
'*
diff --git a/testautomation/framework/required/f_tools_customize.bas b/testautomation/framework/required/f_tools_customize.bas
index a46985a629fb..958c1c943e75 100755
--- a/testautomation/framework/required/f_tools_customize.bas
+++ b/testautomation/framework/required/f_tools_customize.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : Joerg.Skottke@Sun.COM
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : ToolsCustomize Dialog
'*
diff --git a/testautomation/framework/required/f_tools_options.bas b/testautomation/framework/required/f_tools_options.bas
index b4cac6c8f4b3..20dc7f3b574c 100755
--- a/testautomation/framework/required/f_tools_options.bas
+++ b/testautomation/framework/required/f_tools_options.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Verify that the applications appear in tools/options
'*
diff --git a/testautomation/framework/required/f_topten.bas b/testautomation/framework/required/f_topten.bas
index 4d9b741aa071..3b8fcf80adda 100755
--- a/testautomation/framework/required/f_topten.bas
+++ b/testautomation/framework/required/f_topten.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : smoke test for each application
'*
diff --git a/testautomation/framework/required/f_window_functions.bas b/testautomation/framework/required/f_window_functions.bas
index 5f848835e7a6..c1b4dd30d049 100755
--- a/testautomation/framework/required/f_window_functions.bas
+++ b/testautomation/framework/required/f_window_functions.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Basic Window/Titlebar functionality
'*
diff --git a/testautomation/framework/required/f_wizards.bas b/testautomation/framework/required/f_wizards.bas
index 9ad1be7a05ed..f7bc38e1623b 100755
--- a/testautomation/framework/required/f_wizards.bas
+++ b/testautomation/framework/required/f_wizards.bas
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Category 0 tests for all included wizards
'*
diff --git a/testautomation/framework/required/includes/basic_dialog_export.inc b/testautomation/framework/required/includes/basic_dialog_export.inc
index ecdb26cc6ac0..5899cd6c1288 100755..100644
--- a/testautomation/framework/required/includes/basic_dialog_export.inc
+++ b/testautomation/framework/required/includes/basic_dialog_export.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for the dialog export feature
'*
diff --git a/testautomation/framework/required/includes/basic_dialog_i18n.inc b/testautomation/framework/required/includes/basic_dialog_i18n.inc
index 162f0cc040cd..871cb3bb976e 100644
--- a/testautomation/framework/required/includes/basic_dialog_i18n.inc
+++ b/testautomation/framework/required/includes/basic_dialog_i18n.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for Basic IDE / Dialog i18n-feature
'*
diff --git a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc
index e6e62995716c..df193a2bddbf 100755..100644
--- a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc
+++ b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description :
'*
diff --git a/testautomation/framework/required/includes/basic_macroassignment.inc b/testautomation/framework/required/includes/basic_macroassignment.inc
index 6dda14b07698..9b29b50810cc 100755..100644
--- a/testautomation/framework/required/includes/basic_macroassignment.inc
+++ b/testautomation/framework/required/includes/basic_macroassignment.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update-Test for some dialogs in Basic-IDE
'*
diff --git a/testautomation/framework/required/includes/basic_organizer.inc b/testautomation/framework/required/includes/basic_organizer.inc
index 7df67c82cd62..8e59ff8e42ae 100755..100644
--- a/testautomation/framework/required/includes/basic_organizer.inc
+++ b/testautomation/framework/required/includes/basic_organizer.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for the Basic Organizer dialog
'*
diff --git a/testautomation/framework/required/includes/first.inc b/testautomation/framework/required/includes/first.inc
index 478ba7cd6b90..35905c20c39c 100755..100644
--- a/testautomation/framework/required/includes/first.inc
+++ b/testautomation/framework/required/includes/first.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : First test of basic functionality
'*
diff --git a/testautomation/framework/required/includes/help_browser.inc b/testautomation/framework/required/includes/help_browser.inc
index 858dc46c2779..94aadb2ea8ea 100755..100644
--- a/testautomation/framework/required/includes/help_browser.inc
+++ b/testautomation/framework/required/includes/help_browser.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : global update/resource test
'*
diff --git a/testautomation/framework/required/includes/printer_administration.inc b/testautomation/framework/required/includes/printer_administration.inc
index 6349f381d194..781c1837a25c 100755..100644
--- a/testautomation/framework/required/includes/printer_administration.inc
+++ b/testautomation/framework/required/includes/printer_administration.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : updatetest for the printer configuration
'*
diff --git a/testautomation/framework/required/includes/script_organizers.inc b/testautomation/framework/required/includes/script_organizers.inc
index 3a70c8051808..dcb5c3829519 100644
--- a/testautomation/framework/required/includes/script_organizers.inc
+++ b/testautomation/framework/required/includes/script_organizers.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : Joerg.Skottke@Sun.Com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Verify names of macros and scripts
'*
diff --git a/testautomation/framework/required/includes/scripting_basics.inc b/testautomation/framework/required/includes/scripting_basics.inc
index d1939546b89d..28e4a3f013df 100644
--- a/testautomation/framework/required/includes/scripting_basics.inc
+++ b/testautomation/framework/required/includes/scripting_basics.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Quick short test for the scripting framework
'*
diff --git a/testautomation/framework/required/includes/security_dialogs.inc b/testautomation/framework/required/includes/security_dialogs.inc
index d8f5a096595a..0127a5ae5d8e 100755..100644
--- a/testautomation/framework/required/includes/security_dialogs.inc
+++ b/testautomation/framework/required/includes/security_dialogs.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Security dialogs in Tools/Options
'*
diff --git a/testautomation/framework/required/includes/smoketest.inc b/testautomation/framework/required/includes/smoketest.inc
index d4e327a21ad7..79e7b2da9db1 100644
--- a/testautomation/framework/required/includes/smoketest.inc
+++ b/testautomation/framework/required/includes/smoketest.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : "10ner/Smoke Test" from release engineering
'*
@@ -131,7 +131,7 @@ testcase tSmokeTest
' If macro fails for whatever reason, a message comes up
Kontext
if active.exists() then
- warnlog "#i87290# " + active.getText
+ warnlog "Macro failed " + active.getText
active.ok
call hCloseDocument()
goto endsub
diff --git a/testautomation/framework/required/includes/standard_toolbar_1.inc b/testautomation/framework/required/includes/standard_toolbar_1.inc
index b7d54bb89180..1965f3424a05 100755..100644
--- a/testautomation/framework/required/includes/standard_toolbar_1.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_1.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : global update test (Standardbar)
'*
diff --git a/testautomation/framework/required/includes/standard_toolbar_3.inc b/testautomation/framework/required/includes/standard_toolbar_3.inc
index 46c71bd93409..3a3cdc7513df 100755..100644
--- a/testautomation/framework/required/includes/standard_toolbar_3.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_3.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Items on the standardbar
'*
diff --git a/testautomation/framework/required/includes/standard_toolbar_4.inc b/testautomation/framework/required/includes/standard_toolbar_4.inc
index fbd21e46d032..c86894e9f749 100755..100644
--- a/testautomation/framework/required/includes/standard_toolbar_4.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_4.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Invisible items on the standardbar
'*
diff --git a/testautomation/framework/required/includes/standard_toolbar_5.inc b/testautomation/framework/required/includes/standard_toolbar_5.inc
index 8e03d1253f84..61ca8ef905a1 100755..100644
--- a/testautomation/framework/required/includes/standard_toolbar_5.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_5.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Customize toolbar
'*
diff --git a/testautomation/framework/required/includes/standard_toolbar_6.inc b/testautomation/framework/required/includes/standard_toolbar_6.inc
index ab357cd81013..74f7709f79a0 100755..100644
--- a/testautomation/framework/required/includes/standard_toolbar_6.inc
+++ b/testautomation/framework/required/includes/standard_toolbar_6.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Open applications from New button on standardbar
'*
diff --git a/testautomation/framework/required/includes/tools_customize.inc b/testautomation/framework/required/includes/tools_customize.inc
index 36089018a589..b3518ae615a2 100755..100644
--- a/testautomation/framework/required/includes/tools_customize.inc
+++ b/testautomation/framework/required/includes/tools_customize.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update Test for the Tools Customize Dialog
'*
diff --git a/testautomation/framework/required/includes/tools_options.inc b/testautomation/framework/required/includes/tools_options.inc
index 928d533cbe3a..e9a93159254b 100755..100644
--- a/testautomation/framework/required/includes/tools_options.inc
+++ b/testautomation/framework/required/includes/tools_options.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Verify that the applications appear in tools/options
'*
diff --git a/testautomation/framework/required/includes/topten.inc b/testautomation/framework/required/includes/topten.inc
index fdfdb49fec97..165c63bb20e6 100644
--- a/testautomation/framework/required/includes/topten.inc
+++ b/testautomation/framework/required/includes/topten.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Smoke test (load/save/clipboard)
'*
@@ -65,7 +65,6 @@ testcase Top_ten_test
dim sUserWorkDirectory as string
dim sFilename_native as String
- dim sFilename_export as String
dim sFilter_native as string
dim sFilter_export as String
dim bExportFile as boolean
@@ -78,19 +77,15 @@ testcase Top_ten_test
' set the filenames and their filters. HTML is not exported
if ( gApplication = "HTML" ) then
sFilename_native = "ls_test.html"
- sFilename_export = "ls_test.htm"
bExportFile = FALSE
else
sFilename_native = "ls_test" & hGetSuffix( "current" )
- sFilename_export = "ls_test" & hGetSuffix( "569" )
endif
printlog( "File (current): " & sFilename_native )
- printlog( "File (src569).: " & sFilename_export )
' Delete the workfiles, they might have been left over by prior incomplete testrun
hDeleteFile( sUserWorkDirectory & sFilename_native )
- hDeleteFile( sUserWorkDirectory & sFilename_export )
' Set the API filternames for the current application (native XML format)
select case gApplication
@@ -113,45 +108,16 @@ testcase Top_ten_test
printlog( "Save (default-fileformat): " & sFilename_native )
call hFileSaveAsKill ( sUserWorkDirectory & sFilename_native )
- if ( bExportFile ) then
-
- ' Set the API filternames for the current application (StarOffice 5.2 binary format)
- select case gApplication
- case "WRITER" : sFilter_export = "StarWriter 5.0"
- case "CALC" : sFilter_export = "StarCalc 5.0"
- case "DRAW" : sFilter_export = "StarDraw 5.0"
- case "IMPRESS" : sFilter_export = "StarImpress 5.0"
- case "MATH" : sFilter_export = "StarMath 5.0"
- case "MASTERDOCUMENT" : sFilter_export = "StarWriter 5.0/GlobalDocument"
- case else : warnlog "Invalid gApplication: " & gApplication
- end select
-
- printlog( "Save (5.2-fileformat): " & sFilename_export )
- hFileSaveAsWithFilterKill( sUserWorkDirectory & sFilename_export , sFilter_export )
-
- printlog( "Close" )
- FileClose
-
- ' There should be no alien warning
- kontext "active"
- If ( active.exists( 1 ) ) then
- warnlog( "Unexpected messagebox: '" & active.getText & "'" )
- Active.Yes
- else
- printlog( "No more alien warning on closing the document. Good." )
- endif
- else
- FileClose
+ FileClose
- kontext "active"
- if ( Active.Exists( 1 ) ) then
- warnlog( "Unexpected Active after saving: '" & active.getText & "'" )
- try
- Active.Yes()
- catch
- Active.No()
- endcatch
- endif
+ kontext "active"
+ if ( Active.Exists( 1 ) ) then
+ warnlog( "Unexpected Active after saving: '" & active.getText & "'" )
+ try
+ Active.Yes()
+ catch
+ Active.No()
+ endcatch
endif
printlog( "Load (default-fileformat): " & sFilename_native )
@@ -167,60 +133,7 @@ testcase Top_ten_test
printlog( "Close" )
FileClose
- if ( bExportFile ) then
-
- printlog( "Load (5.2-fileformat): " & sFilename_export )
- call hFileOpen (sUserWorkDirectory & sFilename_export)
-
- if ( gApplication = "MATH" AND iSprache = 84 AND gPlatform="lin" ) then
- try
- kontext "DocumentMath"
- DocumentMath.MouseDown(50,50)
- DocumentMath.MouseUp(50,50)
- qaErrorLog( "Use workaround focus problem for math and language vi/84" )
- ' Needed by AndreSchnabel, not manual reproduceable, only with TestTool
- catch
- qaErrorLog( "Workaround focus problem failed." )
- endcatch
- endif
-
- ' Modify the export document to trigger the alien warning on next save
- printlog( "Change the document" )
- hChangeDoc()
-
- printlog( "Save" )
- FileSave
-
- Kontext "AlienWarning"
- if ( AlienWarning.exists( 3 ) ) then
- printlog( "Closing expected alien warning. Good." )
- AlienWarning.OK()
- else
- warnlog( "Alien warning is missing" )
- endif
-
- kontext "active"
- if ( Active.Exists( 3 ) ) then
- warnlog( "Unexpected messagebox: '" & active.getText & "'" )
- Active.yes
- else
- printlog( "No unexpected messages on save. Good." )
- endif
-
- printlog( "Close" )
- FileClose
-
- kontext "active"
- if ( Active.Exists() ) then
- warnlog( "Unexpected messagebox: '" & active.getText & "'" )
- Active.Yes()
- else
- printlog( "No more alien warning to close. Good." )
- endif
- endif
-
hDeleteFile( sUserWorkDirectory & sFilename_native )
- hDeleteFile( sUserWorkDirectory & sFilename_export )
endcase
diff --git a/testautomation/framework/required/includes/window_functions.inc b/testautomation/framework/required/includes/window_functions.inc
index dfb6b2600df8..8abdfce0b08a 100755
--- a/testautomation/framework/required/includes/window_functions.inc
+++ b/testautomation/framework/required/includes/window_functions.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Window/Titlebar functionality
'*
diff --git a/testautomation/framework/required/includes/wizard_agenda.inc b/testautomation/framework/required/includes/wizard_agenda.inc
index d423d2fd7c62..2cbfb602cfc8 100644
--- a/testautomation/framework/required/includes/wizard_agenda.inc
+++ b/testautomation/framework/required/includes/wizard_agenda.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for agenda wizard
'*
diff --git a/testautomation/framework/required/includes/wizard_documentconverter.inc b/testautomation/framework/required/includes/wizard_documentconverter.inc
index b99cef0a9c6c..0d37fc9f6af6 100644
--- a/testautomation/framework/required/includes/wizard_documentconverter.inc
+++ b/testautomation/framework/required/includes/wizard_documentconverter.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for documentconverter
'*
diff --git a/testautomation/framework/required/includes/wizard_euroconverter.inc b/testautomation/framework/required/includes/wizard_euroconverter.inc
index aeee35c59282..a27bb1c3bf5f 100644
--- a/testautomation/framework/required/includes/wizard_euroconverter.inc
+++ b/testautomation/framework/required/includes/wizard_euroconverter.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for the Euroconverter
'*
diff --git a/testautomation/framework/required/includes/wizard_fax.inc b/testautomation/framework/required/includes/wizard_fax.inc
index 07fcc562dddc..4965ad1f7255 100644
--- a/testautomation/framework/required/includes/wizard_fax.inc
+++ b/testautomation/framework/required/includes/wizard_fax.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update Test for Fax Wizard
'*
diff --git a/testautomation/framework/required/includes/wizard_firsttime.inc b/testautomation/framework/required/includes/wizard_firsttime.inc
index 657a68ada3d0..ea6fcd744227 100644
--- a/testautomation/framework/required/includes/wizard_firsttime.inc
+++ b/testautomation/framework/required/includes/wizard_firsttime.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Updatetest for the first time wizard
'*
diff --git a/testautomation/framework/required/includes/wizard_letter.inc b/testautomation/framework/required/includes/wizard_letter.inc
index 4f68a04cbd8b..ab24971f0275 100644
--- a/testautomation/framework/required/includes/wizard_letter.inc
+++ b/testautomation/framework/required/includes/wizard_letter.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update Test for Letter Wizard
'*
diff --git a/testautomation/framework/required/includes/wizard_mailmerge.inc b/testautomation/framework/required/includes/wizard_mailmerge.inc
index 95f8d6d19a54..3e631335c7b6 100755..100644
--- a/testautomation/framework/required/includes/wizard_mailmerge.inc
+++ b/testautomation/framework/required/includes/wizard_mailmerge.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for the mailmerge wizard
'*
diff --git a/testautomation/framework/required/includes/wizard_presentation.inc b/testautomation/framework/required/includes/wizard_presentation.inc
index 53e2e0d3a50b..166028b3e18f 100644
--- a/testautomation/framework/required/includes/wizard_presentation.inc
+++ b/testautomation/framework/required/includes/wizard_presentation.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for the presentation wizard
'*
diff --git a/testautomation/framework/required/input/10erTest_680.sxw b/testautomation/framework/required/input/10erTest_680.sxw
index afae9513c6fe..b07bfc2e36bb 100755
--- a/testautomation/framework/required/input/10erTest_680.sxw
+++ b/testautomation/framework/required/input/10erTest_680.sxw
Binary files differ
diff --git a/testautomation/framework/tools/includes/customize_tools.inc b/testautomation/framework/tools/includes/customize_tools.inc
index 9fbdb6928b08..0237990a3166 100755..100644
--- a/testautomation/framework/tools/includes/customize_tools.inc
+++ b/testautomation/framework/tools/includes/customize_tools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools to ease the use of the ToolsCustomize-Dialog
'*
diff --git a/testautomation/framework/tools/includes/fileoperations.inc b/testautomation/framework/tools/includes/fileoperations.inc
index 061f9f606f48..1ba484df58af 100755..100644
--- a/testautomation/framework/tools/includes/fileoperations.inc
+++ b/testautomation/framework/tools/includes/fileoperations.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : check the internal file dialog ( extended tests )
'*
diff --git a/testautomation/framework/tools/includes/formcontrols.inc b/testautomation/framework/tools/includes/formcontrols.inc
index 6755ed2a2cdd..7271347e10eb 100755..100644
--- a/testautomation/framework/tools/includes/formcontrols.inc
+++ b/testautomation/framework/tools/includes/formcontrols.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : Tools to draw and select form controls in basic-ide
' **
diff --git a/testautomation/framework/tools/includes/help_tools.inc b/testautomation/framework/tools/includes/help_tools.inc
index 9c81084952df..7b17d4fe37ed 100755..100644
--- a/testautomation/framework/tools/includes/help_tools.inc
+++ b/testautomation/framework/tools/includes/help_tools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Replacements for routines in t_lists.inc adds some
'*
diff --git a/testautomation/framework/tools/includes/i18n_tools.inc b/testautomation/framework/tools/includes/i18n_tools.inc
index f918b1fe5076..aa0e141a45f3 100755..100644
--- a/testautomation/framework/tools/includes/i18n_tools.inc
+++ b/testautomation/framework/tools/includes/i18n_tools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools to ease working with language dependent strings/values
'*
diff --git a/testautomation/framework/tools/includes/pbrowser_tools.inc b/testautomation/framework/tools/includes/pbrowser_tools.inc
index a6a089150a96..391c1a3c2456 100755..100644
--- a/testautomation/framework/tools/includes/pbrowser_tools.inc
+++ b/testautomation/framework/tools/includes/pbrowser_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools for working with the property browser for formcontrols
'*
diff --git a/testautomation/framework/tools/includes/private_environment.inc b/testautomation/framework/tools/includes/private_environment.inc
index af81110b3f18..40851aa8bc1a 100755..100644
--- a/testautomation/framework/tools/includes/private_environment.inc
+++ b/testautomation/framework/tools/includes/private_environment.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools to ease working with private environment
'*
diff --git a/testautomation/framework/tools/includes/scriptorganizer_tools.inc b/testautomation/framework/tools/includes/scriptorganizer_tools.inc
index 8cf067913d64..52503af25bd6 100755..100644
--- a/testautomation/framework/tools/includes/scriptorganizer_tools.inc
+++ b/testautomation/framework/tools/includes/scriptorganizer_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Test scripting-organizers / document-attached scripts
'*
diff --git a/testautomation/framework/tools/includes/spadmin_tools.inc b/testautomation/framework/tools/includes/spadmin_tools.inc
index 77cbdf61a44b..ad41ccf017d3 100755..100644
--- a/testautomation/framework/tools/includes/spadmin_tools.inc
+++ b/testautomation/framework/tools/includes/spadmin_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : helper functions for SPAdmin
'*
diff --git a/testautomation/framework/tools/includes/template_tools.inc b/testautomation/framework/tools/includes/template_tools.inc
index 1491abe9c64f..20881f3fb85e 100644
--- a/testautomation/framework/tools/includes/template_tools.inc
+++ b/testautomation/framework/tools/includes/template_tools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Helper functions to ease usage of templates
'*
diff --git a/testautomation/framework/tools/includes/toolbar_tools.inc b/testautomation/framework/tools/includes/toolbar_tools.inc
index 66c6c27982d0..d3539abf8a37 100644
--- a/testautomation/framework/tools/includes/toolbar_tools.inc
+++ b/testautomation/framework/tools/includes/toolbar_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : global update test (Standardbar)
'*
diff --git a/testautomation/framework/tools/includes/webtools.inc b/testautomation/framework/tools/includes/webtools.inc
index 424ace8c959e..7904c4532de1 100755..100644
--- a/testautomation/framework/tools/includes/webtools.inc
+++ b/testautomation/framework/tools/includes/webtools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools to ease working with web functionality
'*
diff --git a/testautomation/framework/tools/includes/window_tools.inc b/testautomation/framework/tools/includes/window_tools.inc
index 93a09ccf533d..649935dd574a 100755..100644
--- a/testautomation/framework/tools/includes/window_tools.inc
+++ b/testautomation/framework/tools/includes/window_tools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools to handle windows/frames
'*
diff --git a/testautomation/framework/tools/includes/wizards.inc b/testautomation/framework/tools/includes/wizards.inc
index 380f84141d34..a32a77f4518f 100644
--- a/testautomation/framework/tools/includes/wizards.inc
+++ b/testautomation/framework/tools/includes/wizards.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : helper functions for the wizards
'*
diff --git a/testautomation/global/required/includes/g_findbar.inc b/testautomation/global/required/includes/g_findbar.inc
index dd8e9062b604..63731c97ab1d 100644
--- a/testautomation/global/required/includes/g_findbar.inc
+++ b/testautomation/global/required/includes/g_findbar.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : Joerg.Skottke@Sun.Com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Update test for the findbar
'*
diff --git a/testautomation/global/required/includes/g_option.inc b/testautomation/global/required/includes/g_option.inc
index 0c40d3c3d08e..620164b98abd 100644
--- a/testautomation/global/required/includes/g_option.inc
+++ b/testautomation/global/required/includes/g_option.inc
@@ -756,7 +756,7 @@ testcase tToolsOptionsImprovementProgram
Active.ok()
else
if ( NOT bImportDialogHasBeenDisplayed ) then
- warnlog( "#i97340# Show Data button enabled but no logged data found" )
+ warnlog( "#i116461# Show Data button enabled but no logged data found" )
endif
endif
diff --git a/testautomation/global/required/includes/g_printing.inc b/testautomation/global/required/includes/g_printing.inc
index 2d0bd716e551..01c6321b12e9 100644
--- a/testautomation/global/required/includes/g_printing.inc
+++ b/testautomation/global/required/includes/g_printing.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Resource test for the printing dialog
'*
diff --git a/testautomation/global/tools/includes/optional/t_accels.inc b/testautomation/global/tools/includes/optional/t_accels.inc
index 04718449b13b..c700d887b8d5 100755..100644
--- a/testautomation/global/tools/includes/optional/t_accels.inc
+++ b/testautomation/global/tools/includes/optional/t_accels.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : handle accelerators
'*
diff --git a/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc b/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc
index f7537d52700c..536ffb99dda6 100755..100644
--- a/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : tools for the property-browser test
' **
diff --git a/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc b/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc
index f63d610dbdb8..83c037b83f0e 100755..100644
--- a/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : tools for tools/macro test
' **
diff --git a/testautomation/global/tools/includes/optional/t_control_objects.inc b/testautomation/global/tools/includes/optional/t_control_objects.inc
index 4ee8b908c93f..266243d93bb1 100644
--- a/testautomation/global/tools/includes/optional/t_control_objects.inc
+++ b/testautomation/global/tools/includes/optional/t_control_objects.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Functions to manipulate controls by accessing them as objects
'*
diff --git a/testautomation/global/tools/includes/optional/t_docfuncs.inc b/testautomation/global/tools/includes/optional/t_docfuncs.inc
index 7f43b7211630..5e3e76028e6b 100755..100644
--- a/testautomation/global/tools/includes/optional/t_docfuncs.inc
+++ b/testautomation/global/tools/includes/optional/t_docfuncs.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : misc functions to handle documents
'*
diff --git a/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc b/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc
index 654b1b76c515..4b7c481ffe8f 100755..100644
--- a/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools to ease working with the extension manager
'*
diff --git a/testautomation/global/tools/includes/optional/t_filetools.inc b/testautomation/global/tools/includes/optional/t_filetools.inc
index 7189a8e01a43..dd8a9affc1be 100644
--- a/testautomation/global/tools/includes/optional/t_filetools.inc
+++ b/testautomation/global/tools/includes/optional/t_filetools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Functions that work with files like deleting, loading...
'*
diff --git a/testautomation/global/tools/includes/optional/t_key_tools.inc b/testautomation/global/tools/includes/optional/t_key_tools.inc
index 14906c127c68..f32984f963e3 100755..100644
--- a/testautomation/global/tools/includes/optional/t_key_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_key_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : tools for evaluation of key=value datalists
'*
diff --git a/testautomation/global/tools/includes/optional/t_listfuncs.inc b/testautomation/global/tools/includes/optional/t_listfuncs.inc
index c90d077db651..cb020d343662 100644
--- a/testautomation/global/tools/includes/optional/t_listfuncs.inc
+++ b/testautomation/global/tools/includes/optional/t_listfuncs.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Replacements for routines in t_lists.inc adds some
'*
diff --git a/testautomation/global/tools/includes/optional/t_macro_tools.inc b/testautomation/global/tools/includes/optional/t_macro_tools.inc
index 733b28fa32f4..c4b432135739 100644
--- a/testautomation/global/tools/includes/optional/t_macro_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_macro_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
' **
-' ** owner : joerg.skottke@oracle.com
+' ** owner : gregor.hartmann@oracle.com
' **
' ** short description : Helper functions for Macro tests
' **
diff --git a/testautomation/global/tools/includes/optional/t_ole.inc b/testautomation/global/tools/includes/optional/t_ole.inc
index 13138dfc52ab..23b3e02a7ae8 100755..100644
--- a/testautomation/global/tools/includes/optional/t_ole.inc
+++ b/testautomation/global/tools/includes/optional/t_ole.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools for OLE objects
'*
diff --git a/testautomation/global/tools/includes/optional/t_security_tools.inc b/testautomation/global/tools/includes/optional/t_security_tools.inc
index 28625be35880..bb872a65c40f 100755..100644
--- a/testautomation/global/tools/includes/optional/t_security_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_security_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools to ease testing of security related funtionality
'*
diff --git a/testautomation/global/tools/includes/optional/t_stringtools.inc b/testautomation/global/tools/includes/optional/t_stringtools.inc
index 7f946fd3b046..6ffb2f467a1b 100755..100644
--- a/testautomation/global/tools/includes/optional/t_stringtools.inc
+++ b/testautomation/global/tools/includes/optional/t_stringtools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Functions for manipulation of strings
'*
diff --git a/testautomation/global/tools/includes/optional/t_treelist_tools.inc b/testautomation/global/tools/includes/optional/t_treelist_tools.inc
index e9c254ac07b4..3ce78163d843 100644
--- a/testautomation/global/tools/includes/optional/t_treelist_tools.inc
+++ b/testautomation/global/tools/includes/optional/t_treelist_tools.inc
@@ -25,7 +25,7 @@
'
'/************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Helpers for accessing treelists
'*
diff --git a/testautomation/global/tools/includes/optional/t_ui_filters.inc b/testautomation/global/tools/includes/optional/t_ui_filters.inc
index 7b9dd66e1a40..d4c536b73718 100755..100644
--- a/testautomation/global/tools/includes/optional/t_ui_filters.inc
+++ b/testautomation/global/tools/includes/optional/t_ui_filters.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Get the UI names for default filters
'*
diff --git a/testautomation/global/tools/includes/optional/t_user_info.inc b/testautomation/global/tools/includes/optional/t_user_info.inc
index d4771be2e3c9..429aad5d2e8e 100755..100644
--- a/testautomation/global/tools/includes/optional/t_user_info.inc
+++ b/testautomation/global/tools/includes/optional/t_user_info.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Extension Update Test
'*
diff --git a/testautomation/global/tools/includes/required/t_filters.inc b/testautomation/global/tools/includes/required/t_filters.inc
index 243483be9e7d..c0a23d56d092 100644
--- a/testautomation/global/tools/includes/required/t_filters.inc
+++ b/testautomation/global/tools/includes/required/t_filters.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Retrieve and set filternames and suffixes
'*
diff --git a/testautomation/global/tools/includes/required/t_tools1.inc b/testautomation/global/tools/includes/required/t_tools1.inc
index 051afec0ad24..837a989678be 100755..100644
--- a/testautomation/global/tools/includes/required/t_tools1.inc
+++ b/testautomation/global/tools/includes/required/t_tools1.inc
@@ -25,7 +25,7 @@
'
'/******************************************************************************
'*
-'* owner : joerg.skottke@oracle.com
+'* owner : gregor.hartmann@oracle.com
'*
'* short description : Tools (1)
'*
diff --git a/testautomation/global/win/dial_d_h.win b/testautomation/global/win/dial_d_h.win
index ba6673edb39d..926c153ae43b 100644..100755
--- a/testautomation/global/win/dial_d_h.win
+++ b/testautomation/global/win/dial_d_h.win
@@ -448,6 +448,12 @@ ShowGridcontrol sym:showGridcontrol
*GridControlDialog sym:gridcontroldialog
gridcontrolcontrol sym:gridcontrolself
+*TabControlDialog sym:tabcontroldialog
+tabcontrol_1 sym:tabcontrol_1
+tabcontrol_2 sym:tabcontrol_2
+tabbutton sym:tabbutton
+tabcontainer sym:tabcontainer
+
*GroupingDlg sym:SC_HID_SC_DPDATEGROUP
AutoStart sym:sc:RadioButton:RID_SCDLG_DPNUMGROUP:RB_AUTOSTART
ManualStart sym:sc:RadioButton:RID_SCDLG_DPNUMGROUP:RB_MANSTART
diff --git a/testautomation/global/win/edia_d_h.win b/testautomation/global/win/edia_d_h.win
index b781c636da3a..0448fccc9f02 100644..100755
--- a/testautomation/global/win/edia_d_h.win
+++ b/testautomation/global/win/edia_d_h.win
@@ -55,7 +55,7 @@ AdoURL sym:DBACCESS_HID_PAGE_DBWIZARD_ADO_ET_ADOURL
StartTableWizard sym:DBACCESS_HID_PAGE_DBWIZARD_FINAL_CB_STARTTABLEWIZARD
*CreateDatabaseLink sym:cui:ModalDialog:DLG_DOCUMENTLINK
-DatabaseFile .uno:OpenUrl
+DatabaseFile sym:cui:ComboBox:DLG_DOCUMENTLINK:CMB_URL
Browse sym:cui:PushButton:DLG_DOCUMENTLINK:PB_BROWSEFILE
RegisteredName sym:cui:Edit:DLG_DOCUMENTLINK:ET_NAME
diff --git a/testautomation/global/win/edia_t_z.win b/testautomation/global/win/edia_t_z.win
index 5acdef31038b..b235855ce9dc 100644..100755
--- a/testautomation/global/win/edia_t_z.win
+++ b/testautomation/global/win/edia_t_z.win
@@ -5,6 +5,7 @@ TableWindow sym:DBACCESS_HID_CTL_TABLEEDIT
Fieldname sym:DBACCESS_HID_TABDESIGN_NAMECELL
FieldType sym:DBACCESS_HID_TABDESIGN_TYPECELL
Description sym:DBACCESS_HID_TABDESIGN_HELPTEXT
+CellDescription sym:DBACCESS_HID_TABDESIGN_COMMENTCELL
*TablesFilter sym:DBACCESS_HID_DSADMIN_TABLE_SUBSCRIPTION
Tables sym:DBACCESS_HID_DSADMIN_TABLE_SELECTOR
diff --git a/testautomation/global/win/etab_a_d.win b/testautomation/global/win/etab_a_d.win
index 17cf61f910ca..e8fb0ac7b870 100644..100755
--- a/testautomation/global/win/etab_a_d.win
+++ b/testautomation/global/win/etab_a_d.win
@@ -194,9 +194,16 @@ MajorIntervalAutomatic sym:chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_MAIN
MinorIntervalCount sym:chart2:MetricField:TP_SCALE:MT_STEPHELP
MinorIntervalCountAutomatic sym:chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_HELP
ReferenceValue sym:chart2:SpinField:TP_SCALE:EDT_ORIGIN
-RreferenceValueAutomatic sym:chart2:CheckBox:TP_SCALE:CBX_AUTO_ORIGIN
+ReferenceValueAutomatic sym:chart2:CheckBox:TP_SCALE:CBX_AUTO_ORIGIN
LogarithmicScale sym:chart2:CheckBox:TP_SCALE:CBX_LOGARITHM
-ReverseDirection sym:chart2:CheckBox:TP_SCALE:CBX_REVERSE
+ReverseDirectionDateAxis sym:chart2:CheckBox:TP_SCALE:CBX_REVERSE:MayBeDateAxis
+ReverseDirectionValueAxis sym:chart2:CheckBox:TP_SCALE:CBX_REVERSE:ValueAxis
+AxisType sym:chart2:ListBox:TP_SCALE:LB_AXIS_TYPE
+Resolution sym:chart2:ListBox:TP_SCALE:LB_TIME_RESOLUTION
+AutoResolution sym:chart2:CheckBox:TP_SCALE:CBX_AUTO_TIME_RESOLUTION
+MajorIntervalMetric sym:chart2:MetricField:TP_SCALE:MT_MAIN_DATE_STEP
+MajorIntervalUnit sym:chart2:ListBox:TP_SCALE:LB_MAIN_TIME_UNIT
+MinorIntervalUnit sym:chart2:ListBox:TP_SCALE:LB_HELP_TIME_UNIT
*TabChartAxisPositioning sym:chart2:TabPage:TP_AXIS_POSITIONS
CrossOtherAxisAt sym:chart2:ListBox:TP_AXIS_POSITIONS:LB_CROSSES_OTHER_AXIS_AT
diff --git a/testautomation/graphics/optional/g_spellcheck.bas b/testautomation/graphics/optional/g_spellcheck.bas
index f8a8eb6c0668..bf49f64329b5 100755
--- a/testautomation/graphics/optional/g_spellcheck.bas
+++ b/testautomation/graphics/optional/g_spellcheck.bas
@@ -42,13 +42,15 @@ sub main
use "graphics\optional\includes\global\g_spellcheck.inc"
hSetLocaleStrings ( gTesttoolPath + "graphics\tools\locale_1.txt" , glLocale () )
- PrintLog "-------------------------" + gApplication + "-------------------"
+ PrintLog "-------------------------" + gApplication + "-------------------"
+ call tiToolsSpellcheckError
call tiToolsSpellcheckCheck_AlwaysIgnore
call tiToolsSpellcheckCheck_Change
call tiToolsSpellcheckCheck_ChangeAll
gApplication = "DRAW"
PrintLog "-------------------------" + gApplication + "-------------------"
+ call tiToolsSpellcheckError
call tiToolsSpellcheckCheck_AlwaysIgnore
call tiToolsSpellcheckCheck_Change
call tiToolsSpellcheckCheck_ChangeAll
diff --git a/testautomation/graphics/optional/includes/global/g_clipboard.inc b/testautomation/graphics/optional/includes/global/g_clipboard.inc
index d43c49610c26..8da14643d748 100644
--- a/testautomation/graphics/optional/includes/global/g_clipboard.inc
+++ b/testautomation/graphics/optional/includes/global/g_clipboard.inc
@@ -30,15 +30,6 @@
'* short description :
'*
'**************************************************************************************
-' #1 tiEditUndo
-' #1 tiEditRedo
-' #1 tiEditClipboard
-' #1 tiEditPasteSpecial_HTML
-' #1 tdEditPasteSpecial_Text
-' #1 tdEditPasteSpecial_Graphic
-' #1 tdEditPasteSpecial_Circle
-' #1 tiEditPasteSpecial
-'\*************************************************************************************
testcase tiEditUndo
@@ -128,6 +119,7 @@ testcase tiEditUndo
end if
TabPositionAndSize.Cancel
printlog "Close document"
+ Call hCloseDocument
sLocaltestfile = hFileGetLocalPath( gTesttoolPath + "leer."+ExtensionString )
printlog sLocaltestfile
if (FileExists (sLocaltestfile)) then
@@ -136,10 +128,7 @@ testcase tiEditUndo
else
warnlog "File is missing."
endif
-
- printlog "Close document"
- Call hCloseDocument
-
+
endcase 'tiEditUndo
'-------------------------------------------------------------------------------
diff --git a/testautomation/graphics/optional/includes/global/g_spellcheck.inc b/testautomation/graphics/optional/includes/global/g_spellcheck.inc
index c10239e69775..1684738ded35 100644
--- a/testautomation/graphics/optional/includes/global/g_spellcheck.inc
+++ b/testautomation/graphics/optional/includes/global/g_spellcheck.inc
@@ -212,19 +212,9 @@ testcase tiToolsSpellcheckError
end if
end if
- printlog "Close dialog 'Edit Custom Dictionary'."
- BenutzerwoerterbuchBearbeiten.Close
- Kontext "ExtrasOptionenDlg"
- printlog "Close the Option dialog."
- ExtrasOptionenDlg.OK
-
printlog "Close document"
Call hCloseDocument
- ' remove the word again from the dictionary
- delete_word_from_dictionary(sWrongWord,"IgnoreAllList")
-
- kill (convertPath(gOfficePath+"user/work/"+"recht_"+iSprache+sExt))
endcase 'tiToolsSpellcheckCorrect
'-------------------------------------------------------------------------------
diff --git a/testautomation/graphics/optional/includes/impress/i_slidecopy.inc b/testautomation/graphics/optional/includes/impress/i_slidecopy.inc
index 61249353c9d1..4de5505fe0a1 100644
--- a/testautomation/graphics/optional/includes/impress/i_slidecopy.inc
+++ b/testautomation/graphics/optional/includes/impress/i_slidecopy.inc
@@ -51,6 +51,7 @@ testcase tiSlideCopyNewPresentation
sleep 1
try
Verbinder.TearOff
+ printlog "Tearing off Connector bar.."
catch
warnlog "bug for GH from FHA; .tearoff doesnt tell success"
endcatch
@@ -93,19 +94,21 @@ testcase tiSlideCopyNewPresentation
sleep 2
try
StarShapes.TearOff
+ printlog "Tearing off StarShapes Bar..."
catch
warnlog( "<StarShapes.TearOff> failed" )
goto endsub
endcatch
kontext "StarShapes"
+ sleep 2
if ( StarShapes.exists( 2 ) ) then
StarShapesDoorplate.click
else
warnlog( "<StarShapesDoorplate> could not be clicked" )
endif
- sleep (3)
+ sleep (5)
gMouseDown (40,40)
gMouseMove (40,40,60,60)
gMouseUp (60,60)
diff --git a/testautomation/graphics/required/includes/global/id_001.inc b/testautomation/graphics/required/includes/global/id_001.inc
index fee150c8381a..b878278961b1 100644
--- a/testautomation/graphics/required/includes/global/id_001.inc
+++ b/testautomation/graphics/required/includes/global/id_001.inc
@@ -105,68 +105,122 @@ testcase tiFileSaveAs
printlog "load a sample presentation file"
Call hFileOpen ( ConvertPath(gTesttoolPath + sFileName) )
WaitSlot (3000)
-
- printlog "running 5 times save as with different Filters"
- for i = 1 to 6
- printlog "calling Save as Dialog"
- FileSaveAs
- WaitSlot (2000)
- Kontext "SpeichernDlg"
- printlog "Selecting filter according to number of run"
- Dateityp.Select i
- sFilterName = Dateityp.GetSelText
- sFileName = sPath + sFile + (i)
- printlog "Filename is " & sFileName
- printlog "Filtername for this file is " & sFilterName
- Dateiname.SetText (sFileName)
- Speichern.Click
- kontext "AlienWarning"
- if AlienWarning.exists(5) then
- AlienWarning.OK
+
+ printlog "Select between Impress and Draw:"
+
+ if (gApplication = "DRAW") then
+ printlog "CASE DRAW: running 4 times save as with different Filters"
+ for i = 1 to 4
+ printlog "calling Save as Dialog, " & i
+ FileSaveAs
+ WaitSlot (2000)
+ Kontext "SpeichernDlg"
+ printlog "Selecting filter according to number of run"
+ Dateityp.Select i
+ sFilterName = Dateityp.GetSelText
+ sFileName = sPath + sFile + (i)
+ printlog "Filename is " & sFileName
+ printlog "Filtername for this file is " & sFilterName
+ Dateiname.SetText (sFileName)
+ Speichern.Click
+ kontext "AlienWarning"
+ if AlienWarning.exists(5) then
+ AlienWarning.OK
+ end if
+ WaitSlot (5000)
+ next i
+ printlog "closing the sample file"
+ fileclose
+ WaitSlot (3000)
+ kontext "Messagebox"
+ if Messagebox.exists then
+ printlog "Messagebox about informationloss... :-) that's OK: 'Text in the messagebox: "+Messagebox.GetText+"'"
+ Messagebox.YES
end if
- WaitSlot (5000)
- next i
- printlog "closing the sample file"
- fileclose
- WaitSlot (3000)
- kontext "Messagebox"
- if Messagebox.exists then
- printlog "Messagebox about informationloss... :-) that's OK: 'Text in the messagebox: "+Messagebox.GetText+"'"
- Messagebox.YES
- end if
-
- printlog "Loading the former saved files:"
- for i = 1 to 6 'run it 5 times
-
- FileOpen
- Kontext "OeffnenDlg"
- WaitSlot (2000)
- DateiAuswahl.TypeKeys "<END>"
- DateiAuswahl.TypeKeys "<HOME>"
- if i <> 1 then
- DateiAuswahl.TypeKeys "<DOWN>", (i-1)
- endif
- sFileNameLoaded = Dateiname.GetSelText
- printlog "File will be loaded: " & sFileNameLoaded
- Oeffnen.Click
- printlog "Closing doc if it gets loaded: " & sFileNameLoaded
- if gApplication = "IMPRESS" then
- Kontext "DocumentImpress"
- if DocumentImpress.exists(5) then
- Call hCloseDocument
- else
- warnlog "File did not get loaded."
+
+ printlog "Loading the former saved files:"
+ for i = 1 to 4 'run it 4 times
+
+ FileOpen
+ Kontext "OeffnenDlg"
+ WaitSlot (2000)
+ DateiAuswahl.TypeKeys "<END>"
+ DateiAuswahl.TypeKeys "<HOME>"
+ if i <> 1 then
+ DateiAuswahl.TypeKeys "<DOWN>", (i-1)
endif
- else
+ sFileNameLoaded = Dateiname.GetSelText
+ printlog i & ":File will be loaded: " & sFileNameLoaded
+ Oeffnen.Click
+ printlog "Closing doc if it gets loaded: " & sFileNameLoaded
Kontext "DocumentDraw"
if DocumentDraw.exists(5) then
Call hCloseDocument
else
warnlog "File did not get loaded."
endif
- endif
- WaitSlot (2000)
- next i
+ WaitSlot (2000)
+ next i
+ else
+ printlog "CASE IMPRESS: running 9 times save as with different Filters"
+ for i = 1 to 9
+ printlog "calling Save as Dialog, " & i
+ FileSaveAs
+ WaitSlot (2000)
+ Kontext "SpeichernDlg"
+ printlog "Selecting filter according to number of run"
+ Dateityp.Select i
+ sFilterName = Dateityp.GetSelText
+ sFileName = sPath + sFile + (i)
+ printlog "Filename is " & sFileName
+ printlog "Filtername for this file is " & sFilterName
+ Dateiname.SetText (sFileName)
+ Speichern.Click
+ kontext "AlienWarning"
+ if AlienWarning.exists(5) then
+ AlienWarning.OK
+ end if
+ WaitSlot (5000)
+ next i
+ printlog "closing the sample file"
+ fileclose
+ WaitSlot (3000)
+ kontext "Messagebox"
+ if Messagebox.exists then
+ printlog "Messagebox about informationloss... :-) that's OK: 'Text in the messagebox: "+Messagebox.GetText+"'"
+ Messagebox.YES
+ end if
+
+ printlog "Loading the former saved files:"
+ for i = 1 to 9 'run it 9 times
+ FileOpen
+ Kontext "OeffnenDlg"
+ WaitSlot (2000)
+ DateiAuswahl.TypeKeys "<END>"
+ DateiAuswahl.TypeKeys "<HOME>"
+ if i <> 1 then
+ DateiAuswahl.TypeKeys "<DOWN>", (i-1)
+ endif
+ sFileNameLoaded = Dateiname.GetSelText
+ printlog i & ":File will be loaded: " & sFileNameLoaded
+ Oeffnen.Click
+ printlog "Closing doc if it gets loaded: " & sFileNameLoaded
+ printlog "For checking if its open and closing the doc we need to differ Impress and Draw:"
+ Kontext "DocumentImpress"
+ if DocumentImpress.exists(5) then
+ Call hCloseDocument
+ else
+ Kontext "DocumentDraw"
+ if DocumentDraw.exists(5) then
+ Call hCloseDocument
+ else
+ warnlog "File did not get loaded."
+ endif
+ endif
+
+ WaitSlot (2000)
+ next i
+ endif
endcase 'tiFileSaveAs
diff --git a/testautomation/graphics/required/includes/global/id_004.inc b/testautomation/graphics/required/includes/global/id_004.inc
index a14912c6f141..c06f88c682b8 100644
--- a/testautomation/graphics/required/includes/global/id_004.inc
+++ b/testautomation/graphics/required/includes/global/id_004.inc
@@ -249,7 +249,7 @@ testcase tiInsertGraphic
catch
Warnlog "Insert graphic doesn't work :-("
endcatch
-
+ WaitSlot (2000)
printlog "close application "
Call hCloseDocument
diff --git a/testautomation/math/optional/includes/m_101_.inc b/testautomation/math/optional/includes/m_101_.inc
index 58582452dc63..c36bb8822808 100644
--- a/testautomation/math/optional/includes/m_101_.inc
+++ b/testautomation/math/optional/includes/m_101_.inc
@@ -243,7 +243,7 @@ endcase
testcase tFilePassword
dim i,x as integer
dim sTemp as string
- const cFilterCount = 4
+ const cFilterCount = 3
dim sFilterName as string
dim sFilter as string
dim sFilterExt() as string
@@ -269,7 +269,6 @@ testcase tFilePassword
if x <> cFilterCount then warnlog " The Filter count is wrong! Have to be ("+cFilterCount+"), but are: "+x
' Check: (1): Open Office Formula (.oof)
' Check: (2): MathML 1.01 (.mml)
-' Check: (5): StarMath 5.0 (.smf)
' Check: (6): StarOffice 6.0/7 Formula (.sxm)
'/// check if any other then gMathFilter is password able; and if gMathFilter is password able ///'
diff --git a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
index f8dd252cd174..33768d6ffc38 100644
--- a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
+++ b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc
@@ -217,7 +217,7 @@ testcase tExportAllReadableFormatsIntoThemselves
end if
app.Mkdir sWorkDirectory
- For iCurrentFileIndex = 7 to 7
+ For iCurrentFileIndex = 1 to 7
select case iCurrentFileIndex
case 1 : sCurrentFile = "xml2.odt"
sCurrentFilter = "writer8"
@@ -225,49 +225,18 @@ testcase tExportAllReadableFormatsIntoThemselves
sCurrentFilter = "Text (encoded)"
case 3 : sCurrentFile = "dostext.txt"
sCurrentFilter = "Text (encoded)"
- case 4 : sCurrentFile = "sw30.sdw"
- sCurrentFilter = "StarWriter 3.0"
- case 5 : sCurrentFile = "sw50.vor"
- sCurrentFilter = "StarWriter 5.0 Vorlage/Template"
- case 6 : sCurrentFile = "sw31.sdw"
- sCurrentFilter = "StarWriter 3.0"
- case 7 : sCurrentFile = "sw31.vor"
- sCurrentFilter = "StarWriter 3.0 Vorlage/Template"
- case 8 : sCurrentFile = "sw40.sdw"
- sCurrentFilter = "StarWriter 4.0"
- case 9 : sCurrentFile = "sw40_sp2.vor"
- sCurrentFilter = "StarWriter 4.0 Vorlage/Template"
- case 10 : sCurrentFile = "sw50.sdw"
- sCurrentFilter = "StarWriter 5.0"
- case 11 : sCurrentFile = "html.html"
+ case 4 : sCurrentFile = "html.html"
sCurrentFilter = "HTML (StarWriter)"
- case 12 : sCurrentFile = "rtf.rtf"
+ case 5 : sCurrentFile = "rtf.rtf"
sCurrentFilter = "Rich Text Format"
- case 13 : sCurrentFile = "sw60.sxw"
+ case 6 : sCurrentFile = "sw60.sxw"
sCurrentFilter = "StarOffice XML (Writer)"
- case 14 : sCurrentFile = "winw97.doc"
+ case 7 : sCurrentFile = "winw97.doc"
sCurrentFilter = "MS Word 97"
- case 15 : sCurrentFile = "winword6.doc"
+ case 8 : sCurrentFile = "winword6.doc"
sCurrentFilter = "MS Word 95"
- case 16 : sCurrentFile = "wintext.txt"
+ case 9 : sCurrentFile = "wintext.txt"
sCurrentFilter = "Text (encoded)"
- ' case 17 : sCurrentFile = "pocketword.psw"
- ' sCurrentFilter = "PocketWord File"
- ' TODO: 18-23 not applyable. Can be opened, but saving in the format is not supported.
- ' case 18 : sCurrentFile = "unixtext.txt"
- ' sCurrentFilter = "Text"
- ' case 19 : sCurrentFile = "sw2.sdw"
- ' sCurrentFilter = "StarWriter 2.0"
- ' case 20 : sCurrentFile = "amipro3.sam"
- ' sCurrentFilter = "Ami Pro 1.x-3.1 (W4W)"
- ' case 21 : sCurrentFile = "mactext.txt"
- ' sCurrentFilter = "Mac Write 4.x 5.0 (W4W)"
- ' case 22 : sCurrentFile = "sw1.sdw"
- ' sCurrentFilter = "StarWriter 1.0"
- ' case 23 : sCurrentFile = "swdoc.txt"
- ' sCurrentFilter = "Text (encoded) (StarWriter/GlobalDocument)"
- ' case 24 : sCurrentFile = "hangul.hwp"
- ' sCurrentFilter = "writer_MIZI_Hwp_97"
end select
sLoadFile = sImportDir & sCurrentFile
diff --git a/testautomation/writer/optional/includes/number/w_207_.inc b/testautomation/writer/optional/includes/number/w_207_.inc
index 4bc525553f56..972f2303d565 100644
--- a/testautomation/writer/optional/includes/number/w_207_.inc
+++ b/testautomation/writer/optional/includes/number/w_207_.inc
@@ -106,12 +106,15 @@ testcase tToolsNumbering12
"." & sCurrentFilterExt )
hDeleteFile( ExportFileName ) ' There should never be a reason to overwrite
- printlog " - export as: " & ExportFileName
- Call hFileSaveAsWithFilter( ExportFileName, sCurrentFilter )
- Call hCloseDocument
-
- printlog " - load previous saved document"
- hFileOpen( ExportFileName )
+ ' Binary export filter was removed
+ if iDocumentType < 3 then
+ printlog " - export as: " & ExportFileName
+ Call hFileSaveAsWithFilter( ExportFileName, sCurrentFilter )
+ Call hCloseDocument
+
+ printlog " - load previous saved document"
+ hFileOpen( ExportFileName )
+ endif
printlog " - close document"
hFileCloseAll()
diff --git a/testautomation/writer/required/includes/w_007_.inc b/testautomation/writer/required/includes/w_007_.inc
index 466328026d9b..64eae48786c5 100644
--- a/testautomation/writer/required/includes/w_007_.inc
+++ b/testautomation/writer/required/includes/w_007_.inc
@@ -919,7 +919,8 @@ testcase tToolsUpdate
Active.Ok
end if
end if
-
+ Sleep 5
+
Kontext
Active.Setpage TabVerzeichnisseVerzeichnis
diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk
index ab51c1e282bb..323f3f6b0c91 100644
--- a/toolkit/Library_tk.mk
+++ b/toolkit/Library_tk.mk
@@ -82,6 +82,8 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
toolkit/source/awt/vclxsystemdependentwindow \
toolkit/source/awt/vclxtabcontrol \
toolkit/source/awt/vclxtabpage \
+ toolkit/source/awt/vclxtabpagecontainer \
+ toolkit/source/awt/animatedimagespeer \
toolkit/source/awt/vclxtoolkit \
toolkit/source/awt/vclxtopwindow \
toolkit/source/awt/vclxwindow \
@@ -90,6 +92,7 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
toolkit/source/awt/xsimpleanimation \
toolkit/source/awt/xthrobber \
toolkit/source/controls/accessiblecontrolcontext \
+ toolkit/source/controls/controlmodelcontainerbase \
toolkit/source/controls/dialogcontrol \
toolkit/source/controls/eventcontainer \
toolkit/source/controls/formattedcontrol \
@@ -100,12 +103,16 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
toolkit/source/controls/grid/gridcontrol \
toolkit/source/controls/roadmapcontrol \
toolkit/source/controls/roadmapentry \
+ toolkit/source/controls/tabpagecontainer \
+ toolkit/source/controls/tabpagemodel \
toolkit/source/controls/stdtabcontroller \
toolkit/source/controls/stdtabcontrollermodel \
toolkit/source/controls/tkscrollbar \
toolkit/source/controls/tksimpleanimation \
toolkit/source/controls/tkspinbutton \
toolkit/source/controls/tkthrobber \
+ toolkit/source/controls/animatedimages \
+ toolkit/source/controls/spinningprogress \
toolkit/source/controls/tree/treecontrol \
toolkit/source/controls/tree/treedatamodel \
toolkit/source/controls/unocontrol \
@@ -123,7 +130,6 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
toolkit/source/helper/property \
toolkit/source/helper/registerservices \
toolkit/source/helper/servicenames \
- toolkit/source/helper/throbberimpl \
toolkit/source/helper/tkresmgr \
toolkit/source/helper/unomemorystream \
toolkit/source/helper/unopropertyarrayhelper \
diff --git a/toolkit/Package_inc.mk b/toolkit/Package_inc.mk
index 3fc23a5b9f1f..4079a3d53383 100644
--- a/toolkit/Package_inc.mk
+++ b/toolkit/Package_inc.mk
@@ -59,7 +59,6 @@ $(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/mutexhelper.hxx
$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/property.hxx,toolkit/helper/property.hxx))
$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/servicenames.hxx,toolkit/helper/servicenames.hxx))
$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/solarrelease.hxx,toolkit/helper/solarrelease.hxx))
-$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/throbberimpl.hxx,toolkit/helper/throbberimpl.hxx))
$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/tkresmgr.hxx,toolkit/helper/tkresmgr.hxx))
$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/unomemorystream.hxx,toolkit/helper/unomemorystream.hxx))
$(eval $(call gb_Package_add_file,toolkit_inc,inc/toolkit/helper/unopropertyarrayhelper.hxx,toolkit/helper/unopropertyarrayhelper.hxx))
diff --git a/toolkit/inc/toolkit/awt/animatedimagespeer.hxx b/toolkit/inc/toolkit/awt/animatedimagespeer.hxx
new file mode 100755
index 000000000000..b9bdecdf0e47
--- /dev/null
+++ b/toolkit/inc/toolkit/awt/animatedimagespeer.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_ANIMATEDIMAGEPEER_HXX
+#define TOOLKIT_ANIMATEDIMAGEPEER_HXX
+
+#include "toolkit/awt/vclxwindow.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/XAnimation.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase3.hxx>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= AnimatedImagesPeer
+ //==================================================================================================================
+ struct AnimatedImagesPeer_Data;
+ typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow
+ , ::com::sun::star::awt::XAnimation
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XModifyListener
+ > AnimatedImagesPeer_Base;
+
+ class AnimatedImagesPeer :public AnimatedImagesPeer_Base
+ ,public ::boost::noncopyable
+ {
+ public:
+ AnimatedImagesPeer();
+
+ protected:
+ ~AnimatedImagesPeer();
+
+ public:
+ // XAnimation
+ virtual void SAL_CALL startAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stopAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isAnimationRunning( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // VclWindowPeer
+ virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // 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);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ protected:
+ void ProcessWindowEvent( const VclWindowEvent& i_windowEvent );
+
+ private:
+ /** updates our images with the ones from the givem XAnimatedImages component
+ */
+ void impl_updateImages_nolck( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_animatedImages );
+
+ private:
+ ::boost::scoped_ptr< AnimatedImagesPeer_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_ANIMATEDIMAGEPEER_HXX
diff --git a/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx b/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx
new file mode 100644
index 000000000000..d4fe2a727b43
--- /dev/null
+++ b/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx
@@ -0,0 +1,90 @@
+// ----------------------------------------------------
+// class VCLXDialog
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
+#define _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include "toolkit/awt/vclxwindow.hxx"
+//#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainer.hpp>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <toolkit/awt/vclxcontainer.hxx>
+
+// ----------------------------------------------------
+typedef ::cppu::ImplInheritanceHelper2 < VCLXContainer
+ , ::com::sun::star::awt::tab::XTabPageContainer
+ , ::com::sun::star::container::XContainerListener
+ > VCLXTabPageContainer_Base;
+class VCLXTabPageContainer : public VCLXTabPageContainer_Base
+{
+public:
+ VCLXTabPageContainer();
+ ~VCLXTabPageContainer();
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::grid::XTabPageContainer
+ virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
+ virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+ 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);
+
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
+private:
+ sal_Int16 m_nActiveTabPageId;
+ TabPageListenerMultiplexer m_aTabPageListeners;
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > > m_aTabPages;
+};
+#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
diff --git a/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx b/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx
new file mode 100644
index 000000000000..670ed25c0f2d
--- /dev/null
+++ b/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx
@@ -0,0 +1,82 @@
+// ----------------------------------------------------
+// class VCLXDialog
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+#define _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
+
+#include <toolkit/dllapi.h>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include "toolkit/awt/vclxwindow.hxx"
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include "forward.hxx"
+#include <cppuhelper/implbase1.hxx>
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel,
+ ::com::sun::star::awt::tab::XTabPageModel
+ > VCLXTabPageModel_Base;
+class VCLXTabPageModel : public VCLXTabPageModel_Base
+{
+public:
+ VCLXTabPageModel();
+ VCLXTabPageModel( const VCLXTabPageModel& rModel ) : VCLXTabPageModel_Base( rModel ) {;}
+ ~VCLXTabPageModel();
+
+ // ::com::sun::star::awt::XView
+ void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XDevice,
+ ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
+
+ // virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+ UnoControlModel* Clone() const { return new VCLXTabPageModel( *this ); }
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageModel
+ virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ 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 getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+protected:
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+};
+#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx
index 36ac2fa51337..1d3b10120e0c 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -121,7 +121,7 @@ private:
Image maImage;
protected:
- BitmapEx GetBitmap() const { return maImage.GetBitmapEx(); }
+ const Image& GetImage() const { return maImage; }
protected:
// ::com::sun::star::awt::XWindow
diff --git a/toolkit/inc/toolkit/awt/xsimpleanimation.hxx b/toolkit/inc/toolkit/awt/xsimpleanimation.hxx
index dc8fbe4506ed..9e6043b7d9ef 100644
--- a/toolkit/inc/toolkit/awt/xsimpleanimation.hxx
+++ b/toolkit/inc/toolkit/awt/xsimpleanimation.hxx
@@ -33,40 +33,28 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/awt/XSimpleAnimation.hpp>
+#include <boost/scoped_ptr.hpp>
+
//........................................................................
namespace toolkit
{
- class Throbber_Impl;
//........................................................................
//====================================================================
//= XSimpleAnimation
//====================================================================
- typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSimpleAnimation
- > XSimpleAnimation_Base;
+ typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow
+ , ::com::sun::star::awt::XSimpleAnimation
+ > XSimpleAnimation_Base;
- class XSimpleAnimation :public VCLXWindow
- ,public XSimpleAnimation_Base
+ class XSimpleAnimation : public XSimpleAnimation_Base
{
- private:
- //::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > maImageList;
- sal_Bool mbRepeat;
- sal_Int32 mnStepTime;
-
- Throbber_Impl *mpThrobber;
-
public:
XSimpleAnimation();
protected:
~XSimpleAnimation();
- // XInterface
- DECLARE_XINTERFACE()
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER()
-
// XSimpleAnimation
virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
@@ -76,9 +64,6 @@ namespace toolkit
virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
- // VCLXWindow
- void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
-
private:
XSimpleAnimation( const XSimpleAnimation& ); // never implemented
XSimpleAnimation& operator=( const XSimpleAnimation& ); // never implemented
diff --git a/toolkit/inc/toolkit/awt/xthrobber.hxx b/toolkit/inc/toolkit/awt/xthrobber.hxx
index 511f3f76ecf6..67015e049a48 100644
--- a/toolkit/inc/toolkit/awt/xthrobber.hxx
+++ b/toolkit/inc/toolkit/awt/xthrobber.hxx
@@ -33,23 +33,25 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/awt/XThrobber.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
//........................................................................
namespace toolkit
{
//........................................................................
- class Throbber_Impl;
//====================================================================
//= XThrobber
//====================================================================
- typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XThrobber
- > XThrobber_Base;
+ typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow
+ , ::com::sun::star::awt::XThrobber
+ > XThrobber_Base;
- class XThrobber :public VCLXWindow
- ,public XThrobber_Base
+ class XThrobber :public XThrobber_Base
+ ,public ::boost::noncopyable
{
private:
- Throbber_Impl *mpThrobber;
void SAL_CALL InitImageList() throw(::com::sun::star::uno::RuntimeException);
public:
@@ -58,22 +60,12 @@ namespace toolkit
protected:
~XThrobber();
- // XInterface
- DECLARE_XINTERFACE()
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER()
-
// XThrobber
virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
- // VclWindowPeer
- virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
-
// VCLXWindow
- void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
+ virtual void SetWindow( Window* pWindow );
private:
XThrobber( const XThrobber& ); // never implemented
diff --git a/toolkit/inc/toolkit/controls/animatedimages.hxx b/toolkit/inc/toolkit/controls/animatedimages.hxx
new file mode 100755
index 000000000000..96791c252b0b
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/animatedimages.hxx
@@ -0,0 +1,144 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_ANIMATEDIMAGES_HXX
+#define TOOLKIT_ANIMATEDIMAGES_HXX
+
+#include "toolkit/controls/unocontrolbase.hxx"
+#include "toolkit/controls/unocontrolmodel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/XAnimation.hpp>
+#include <com/sun/star/awt/XAnimatedImages.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //=
+ //==================================================================================================================
+ typedef ::cppu::AggImplInheritanceHelper2 < UnoControlBase
+ , ::com::sun::star::awt::XAnimation
+ , ::com::sun::star::container::XContainerListener
+ > AnimatedImagesControl_Base;
+
+ class AnimatedImagesControl : public AnimatedImagesControl_Base
+ {
+ public:
+ AnimatedImagesControl();
+ ::rtl::OUString GetComponentServiceName();
+
+ // XAnimation
+ virtual void SAL_CALL startAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL stopAnimation( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isAnimationRunning( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XControl
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& i_rModel ) throw ( ::com::sun::star::uno::RuntimeException );
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& i_toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& i_parentPeer ) throw(::com::sun::star::uno::RuntimeException);
+
+
+ // 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);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
+ };
+
+ //==================================================================================================================
+ //= AnimatedImagesControlModel
+ //==================================================================================================================
+ struct AnimatedImagesControlModel_Data;
+ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , ::com::sun::star::awt::XAnimatedImages
+ > AnimatedImagesControlModel_Base;
+ class AnimatedImagesControlModel : public AnimatedImagesControlModel_Base
+ {
+ public:
+ AnimatedImagesControlModel();
+ AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource );
+
+ virtual UnoControlModel* Clone() const;
+
+ // XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // XAnimatedImages
+ virtual ::sal_Int32 SAL_CALL getStepTime() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setStepTime( ::sal_Int32 _steptime ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getAutoRepeat() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAutoRepeat( ::sal_Bool _autorepeat ) 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);
+ virtual ::sal_Int32 SAL_CALL getImageSetCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL replaceImageSet( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& i_imageURLs ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeImageSet( ::sal_Int32 i_index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAnimatedImages::XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ ~AnimatedImagesControlModel();
+
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
+ private:
+ ::boost::scoped_ptr< AnimatedImagesControlModel_Data >
+ m_pData;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_ANIMATEDIMAGES_HXX
diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
new file mode 100644
index 000000000000..d50fecd8a344
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_CONTROL_MODEL_CONTAINERBASE_HXX
+#define TOOLKIT_CONTROL_MODEL_CONTAINERBASE_HXX
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <com/sun/star/util/XChangesNotifier.hpp>
+#include <com/sun/star/util/XChangesListener.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <cppuhelper/implbase8.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/controls/unocontrolcontainer.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+// ----------------------------------------------------
+// class ControlModelContainerBase
+// ----------------------------------------------------
+typedef UnoControlModel ControlModel_Base;
+typedef ::cppu::AggImplInheritanceHelper8 < ControlModel_Base
+ , ::com::sun::star::lang::XMultiServiceFactory
+ , ::com::sun::star::container::XContainer
+ , ::com::sun::star::container::XNameContainer
+ , ::com::sun::star::awt::XTabControllerModel
+ , ::com::sun::star::util::XChangesNotifier
+ , ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::awt::tab::XTabPageModel
+ , ::com::sun::star::lang::XInitialization
+ > ControlModelContainer_IBase;
+
+class ControlModelContainerBase : public ControlModelContainer_IBase
+{
+public:
+ // would like to make this typedef private, too, but the Forte 7 compiler does have
+ // problems with this .....
+ typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >, ::rtl::OUString >
+ UnoControlModelHolder;
+private:
+ typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList;
+
+ // for grouping control models (XTabControllerModel::getGroupXXX)
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >
+ ModelGroup;
+ typedef ::std::vector< ModelGroup > AllGroups;
+
+ friend struct CloneControlModel;
+ friend struct FindControlModel;
+ friend struct CompareControlModel;
+
+protected:
+ ContainerListenerMultiplexer maContainerListeners;
+ ::cppu::OInterfaceContainerHelper maChangeListeners;
+ UnoControlModelHolderList maModels;
+
+ AllGroups maGroups;
+ sal_Bool mbGroupsUpToDate;
+
+ bool m_bEnabled;
+ ::rtl::OUString m_sTitle;
+ ::rtl::OUString m_sImageURL;
+ ::rtl::OUString m_sTooltip;
+ sal_Int16 m_nTabPageId;
+
+
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ UnoControlModelHolderList::iterator ImplFindElement( const ::rtl::OUString& rName );
+
+public:
+ ControlModelContainerBase();
+ ControlModelContainerBase( const ControlModelContainerBase& rModel );
+ ~ControlModelContainerBase();
+
+ UnoControlModel* Clone() const;
+
+ // ::com::sun::star::container::XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAcces
+ ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess
+ void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XMultiServiceFactory
+ ::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);
+ ::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( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTabControllerModel
+ virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const ::rtl::OUString& GroupName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getGroupCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL getGroupByName( const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XChangesNotifier
+ virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) 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);
+
+ // XEventListener
+ using cppu::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED(ControlModelContainerBase, ControlModel_Base, "toolkit.ControlModelContainerBase" )
+
+ // XInitialization
+ virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageModel
+ virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ 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 getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+
+protected:
+ void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
+ void stopControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
+
+ void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
+
+ void implUpdateGroupStructure();
+};
+
+class ResourceListener :public ::com::sun::star::util::XModifyListener,
+ public ::cppu::OWeakObject,
+ public ::cppu::BaseMutex
+{
+ public:
+ ResourceListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener );
+ virtual ~ResourceListener();
+
+ void startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver >& rResource );
+ void stopListening();
+
+ // 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 ();
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) 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);
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xResource;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xListener;
+ bool m_bListening;
+};
+
+typedef ::cppu::AggImplInheritanceHelper2 < UnoControlContainer
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XChangesListener
+ > ContainerControl_IBase;
+
+class ControlContainerBase : public ContainerControl_IBase
+{
+protected:
+ bool mbSizeModified;
+ bool mbPosModified;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener;
+
+ void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName );
+ void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel );
+ virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
+ void ImplUpdateResourceResolver();
+ void ImplStartListingForResourceEvents();
+ ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > Impl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL );
+public:
+ ControlContainerBase();
+ ~ControlContainerBase();
+
+ DECLIMPL_SERVICEINFO_DERIVED( ControlContainerBase, UnoControlBase, "toolkit.ControlContainerBase" )
+
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XContainerListener
+ void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XChangesListener
+ virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+ virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
+};
+#endif
diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
index f6a0f768bc10..a68760715035 100644
--- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@ -28,221 +28,55 @@
#ifndef TOOLKIT_DIALOG_CONTROL_HXX
#define TOOLKIT_DIALOG_CONTROL_HXX
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
#include <com/sun/star/awt/XTopWindow.hpp>
-#include <com/sun/star/util/XChangesNotifier.hpp>
-#include <com/sun/star/util/XChangesListener.hpp>
-#include <com/sun/star/util/XModifyListener.hpp>
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/awt/XDialog2.hpp>
+#include <com/sun/star/awt/XDialog.hpp>
#include <com/sun/star/resource/XStringResourceResolver.hpp>
-#include <cppuhelper/implbase6.hxx>
-#include <cppuhelper/implbase5.hxx>
-#include <toolkit/helper/listenermultiplexer.hxx>
-#include <toolkit/controls/unocontrolmodel.hxx>
#include "toolkit/helper/servicenames.hxx"
#include "toolkit/helper/macros.hxx"
#include <toolkit/controls/unocontrolcontainer.hxx>
-#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/basemutex.hxx>
#include <list>
// ----------------------------------------------------
// class UnoControlDialogModel
// ----------------------------------------------------
-typedef UnoControlModel UnoControlDialogModel_Base;
-typedef ::cppu::ImplHelper6 < ::com::sun::star::lang::XMultiServiceFactory
- , ::com::sun::star::container::XContainer
- , ::com::sun::star::container::XNameContainer
- , ::com::sun::star::awt::XTabControllerModel
- , ::com::sun::star::util::XChangesNotifier
- , ::com::sun::star::beans::XPropertyChangeListener
- > UnoControlDialogModel_IBase;
-class UnoControlDialogModel : public UnoControlDialogModel_IBase
- , public UnoControlDialogModel_Base
+class UnoControlDialogModel : public ControlModelContainerBase
{
-public:
- // would like to make this typedef private, too, but the Forte 7 compiler does have
- // problems with this .....
- typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >, ::rtl::OUString >
- UnoControlModelHolder;
-private:
- typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList;
-
- // for grouping control models (XTabControllerModel::getGroupXXX)
- typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >
- ModelGroup;
- typedef ::std::vector< ModelGroup > AllGroups;
-
- friend struct CloneControlModel;
- friend struct FindControlModel;
- friend struct CompareControlModel;
-
-private:
- ContainerListenerMultiplexer maContainerListeners;
- ::cppu::OInterfaceContainerHelper maChangeListeners;
- UnoControlModelHolderList maModels;
-
- AllGroups maGroups;
- sal_Bool mbGroupsUpToDate;
-
protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
-
- UnoControlModelHolderList::iterator ImplFindElement( const ::rtl::OUString& rName );
-
public:
UnoControlDialogModel();
UnoControlDialogModel( const UnoControlDialogModel& rModel );
~UnoControlDialogModel();
- UnoControlModel* Clone() const;
-
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlModel::queryInterface(rType); }
- ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
- void SAL_CALL release() throw() { OWeakAggObject::release(); }
-
- // ::com::sun::star::lang::XTypeProvider
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::container::XContainer
- void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::container::XElementAcces
- ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
- sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::container::XIndexContainer, XIndexReplace, XIndexAcces
- // 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) = 0;
- // sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException) = 0;
- // ::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) = 0;
- // 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) = 0;
- // void SAL_CALL removeByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
-
- // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess
- void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
- sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::beans::XMultiPropertySet
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::lang::XMultiServiceFactory
- ::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);
- ::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( ) throw(::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::io::XPersistObject
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
- // XComponent
- void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XTabControllerModel
- virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const ::rtl::OUString& GroupName ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getGroupCount( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL getGroupByName( const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw (::com::sun::star::uno::RuntimeException);
-
- // XChangesNotifier
- virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) 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);
-
- // XEventListener
- using cppu::OPropertySetHelper::disposing;
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
-
// XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel,UnoControlDialogModel_Base, szServiceName2_UnoControlDialogModel )
-
-protected:
- void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
- void stopControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel );
-
- void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
-
- void implUpdateGroupStructure();
-};
-
-// ----------------------------------------------------
-// class UnoDialogControl
-// ----------------------------------------------------
-typedef ::cppu::ImplHelper6 < ::com::sun::star::container::XContainerListener
- , ::com::sun::star::awt::XTopWindow
- , ::com::sun::star::awt::XDialog2
- , ::com::sun::star::util::XChangesListener
- , ::com::sun::star::util::XModifyListener
- , ::com::sun::star::awt::XWindowListener
- > UnoDialogControl_IBase;
-
-class ResourceListener :public ::com::sun::star::util::XModifyListener,
- public ::cppu::OWeakObject,
- public ::cppu::BaseMutex
-{
- public:
- ResourceListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener );
- virtual ~ResourceListener();
-
- void startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver >& rResource );
- void stopListening();
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel )
- // 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 ();
-
- // XModifyListener
- virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) 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);
-
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xResource;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xListener;
- bool m_bListening;
};
-class UnoDialogControl :public UnoControlContainer
- ,public UnoDialogControl_IBase
+class UnoDialogControl :public ControlContainerBase,
+ public ::com::sun::star::awt::XTopWindow,
+ public ::com::sun::star::awt::XDialog,
+ public ::com::sun::star::awt::XWindowListener
{
private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener;
TopWindowListenerMultiplexer maTopWindowListeners;
bool mbWindowListener;
- bool mbSizeModified;
- bool mbPosModified;
-
-protected:
-
- void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName );
- void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel );
- void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
- void ImplUpdateResourceResolver();
- void ImplStartListingForResourceEvents();
public:
- UnoDialogControl();
+ UnoDialogControl();
+ ~UnoDialogControl();
::rtl::OUString GetComponentServiceName();
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); }
@@ -267,15 +101,6 @@ public:
virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::container::XContainerListener
- void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
-
- // ::com::sun::star::awt::XDialog2
- virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::awt::XDialog
void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException);
@@ -288,10 +113,6 @@ public:
// ::com::sun::star::awt::XControl
sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException);
-
- // XChangesListener
- virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) 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);
@@ -300,13 +121,10 @@ public:
DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog )
protected:
- virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
+ // virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc );
-
+ virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
protected:
- virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
- virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
};
-
#endif // TOOLKIT_DIALOG_CONTROL_HXX
diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
index 05b3016e690a..558d145f3d14 100644
--- a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
+++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
@@ -186,6 +186,7 @@ FORWARD_DECLARE_INTERFACE( script, XNameContainer )
{
public:
OGeometryControlModel();
+ OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_xCompContext);
private:
OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance);
diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
index d6491877c7ad..3b784251b65e 100644
--- a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
+++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
@@ -37,6 +37,12 @@ OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel()
{
}
+template <class CONTROLMODEL>
+OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_xCompContext)
+ :OGeometryControlModel_Base(new CONTROLMODEL(i_xCompContext))
+{
+}
+
//--------------------------------------------------------------------
template <class CONTROLMODEL>
OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance)
diff --git a/toolkit/inc/toolkit/controls/spinningprogress.hxx b/toolkit/inc/toolkit/controls/spinningprogress.hxx
new file mode 100755
index 000000000000..b2e8204ca999
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/spinningprogress.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 TOOLKIT_SPINNINGPROGRESS_HXX
+#define TOOLKIT_SPINNINGPROGRESS_HXX
+
+#include "toolkit/controls/animatedimages.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= SpinningProgressControlModel
+ //==================================================================================================================
+ typedef AnimatedImagesControlModel SpinningProgressControlModel_Base;
+ class SpinningProgressControlModel : public SpinningProgressControlModel_Base
+ {
+ public:
+ SpinningProgressControlModel();
+ SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource );
+
+ virtual UnoControlModel* Clone() const;
+
+ // XPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ protected:
+ ~SpinningProgressControlModel();
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_SPINNINGPROGRESS_HXX
diff --git a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx
new file mode 100644
index 000000000000..6861f4bc01bb
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_TABPAGE_CONTAINER_HXX
+#define TOOLKIT_TABPAGE_CONTAINER_HXX
+
+#include <com/sun/star/awt/tab/XTabPageContainer.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerModel.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/sequence.hxx>
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+using namespace ::com::sun::star::uno;
+//using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+
+// ------------------------------------------------------------------
+// class ::com::sun::star::awt::tab::UnoControlTabPageContainerModel
+// ------------------------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , ::com::sun::star::awt::tab::XTabPageContainerModel
+ > UnoControlTabPageContainerModel_Base;
+class UnoControlTabPageContainerModel : public UnoControlTabPageContainerModel_Base
+{
+private:
+ std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageModel > > m_aTabPageVector;
+ ContainerListenerMultiplexer maContainerListeners;
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+
+public:
+ UnoControlTabPageContainerModel();
+ UnoControlTabPageContainerModel( const UnoControlTabPageContainerModel& rModel ) : UnoControlTabPageContainerModel_Base( rModel ),maContainerListeners( *this ) {;}
+
+ UnoControlModel* Clone() const { return new UnoControlTabPageContainerModel( *this ); }
+
+ // ::com::sun::star::io::XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainerModel, UnoControlModel, szServiceName_UnoControlTabPageContainerModel )
+ // 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);
+ //{
+ //return ::getCppuType((com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >*)0);
+ //}
+
+ virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XContainer
+ void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+};
+// ===================================================================
+// = UnoControlTabPageContainer
+// ===================================================================
+typedef ::cppu::AggImplInheritanceHelper1 < ControlContainerBase
+ , ::com::sun::star::awt::tab::XTabPageContainer
+ > UnoControlTabPageContainer_Base;
+class UnoControlTabPageContainer : public UnoControlTabPageContainer_Base
+{
+public:
+ UnoControlTabPageContainer();
+ ::rtl::OUString GetComponentServiceName();
+
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XControl
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::tab::XTabPageContainer
+ virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addControl( const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw (::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainer, UnoControlBase, szServiceName_UnoControlTabPageContainer )
+
+// using UnoControl::getPeer;
+protected:
+ virtual void updateFromModel();
+private:
+ TabPageListenerMultiplexer m_aTabPageListeners;
+ sal_Int16 m_nActiveTabPageId;
+};
+
+#endif // _TOOLKIT_TABPAGE_CONTAINER_HXX
diff --git a/toolkit/inc/toolkit/controls/tabpagemodel.hxx b/toolkit/inc/toolkit/controls/tabpagemodel.hxx
new file mode 100644
index 000000000000..76edc2e68026
--- /dev/null
+++ b/toolkit/inc/toolkit/controls/tabpagemodel.hxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_TABPAGE_MODEL_HXX
+#define TOOLKIT_TABPAGE_MODEL_HXX
+
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/macros.hxx"
+#include <toolkit/controls/unocontrolcontainer.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <list>
+#include <cppuhelper/implbase2.hxx>
+
+// ----------------------------------------------------
+// class TabPageModel
+// ----------------------------------------------------
+//typedef ::cppu::ImplHelper2< ::com::sun::star::awt::tab::XTabPageModel,
+// ::com::sun::star::lang::XInitialization
+// > TabPageAccess_BASE;
+//
+//class TabPageModel : public TabPageAccess_BASE
+//{
+//
+//private:
+// bool m_bEnabled;
+// ::rtl::OUString m_sTitle;
+// ::rtl::OUString m_sImageURL;
+// ::rtl::OUString m_sTooltip;
+// sal_Int16 m_nTabPageId;
+//
+//public:
+// TabPageModel();
+// explicit TabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xCompContext);
+// ~TabPageModel();
+//
+// // XInitialization
+// virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+// throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+//
+// ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+// void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
+// void SAL_CALL release() throw() { OWeakAggObject::release(); }
+//
+// // ::com::sun::star::lang::XTypeProvider
+// //::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
+// //::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
+//
+// // ::com::sun::star::awt::tab::XTabPageModel
+// virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException);
+// 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 getTitle() throw (::com::sun::star::uno::RuntimeException);
+// virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException);
+// virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+// virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+// virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException);
+// virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException);
+//};
+// ----------------------------------------------------
+// class UnoControlTabPageModel
+// ----------------------------------------------------
+
+class UnoControlTabPageModel : public ControlModelContainerBase
+ //public TabPageModel
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xCompContext;
+protected:
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+public:
+ UnoControlTabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_xCompContext);
+
+ // ::com::sun::star::io::XPersistObject
+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::beans::XMultiPropertySet
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XInitialization
+ virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageModel, ControlModelContainerBase, szServiceName_UnoControlTabPageModel )
+
+};
+
+// ----------------------------------------------------
+// class UnoTabPageControl
+// ----------------------------------------------------
+typedef ::cppu::AggImplInheritanceHelper2 < ControlContainerBase
+ , ::com::sun::star::awt::tab::XTabPage
+ , ::com::sun::star::awt::XWindowListener
+ > UnoControlTabPage_Base;
+class UnoControlTabPage : public UnoControlTabPage_Base
+{
+private:
+ bool m_bWindowListener;
+public:
+
+ UnoControlTabPage();
+ ~UnoControlTabPage();
+ ::rtl::OUString GetComponentServiceName();
+
+ void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+ void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::awt::XWindowListener
+ virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO( UnoControlTabPage, szServiceName_UnoControlTabPage)
+};
+
+#endif // TOOLKIT_TABPAGE_MODEL_HXX
diff --git a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
index 697d1679af45..1d059c749902 100644
--- a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
+++ b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
@@ -71,11 +71,11 @@ namespace toolkit
//= UnoSimpleAnimationControl
//====================================================================
- typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSimpleAnimation
- > UnoSimpleAnimationControl_Base;
+ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase
+ , ::com::sun::star::awt::XSimpleAnimation
+ > UnoSimpleAnimationControl_Base;
- class UnoSimpleAnimationControl :public UnoControlBase
- ,public UnoSimpleAnimationControl_Base
+ class UnoSimpleAnimationControl : public UnoSimpleAnimationControl_Base
{
private:
@@ -83,16 +83,6 @@ namespace toolkit
UnoSimpleAnimationControl();
::rtl::OUString GetComponentServiceName();
- DECLARE_UNO3_AGG_DEFAULTS( UnoSimpleAnimationControl, UnoControlBase );
- ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
-
- void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
- void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER()
-
// XSimpleAnimation
virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx
index 01ff047ee3de..5e34c23279a1 100644
--- a/toolkit/inc/toolkit/controls/unocontrols.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrols.hxx
@@ -1501,5 +1501,6 @@ public:
};
+
#endif // _TOOLKIT_HELPER_UNOCONTROLS_HXX_
diff --git a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
index b4151fe0f35e..408dd4cbe385 100644
--- a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
+++ b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
@@ -55,6 +55,7 @@
#include <toolkit/helper/mutexhelper.hxx>
#include <toolkit/helper/macros.hxx>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
// ----------------------------------------------------
// class ListenerMultiplexerBase
// ----------------------------------------------------
@@ -251,5 +252,12 @@ DECL_LISTENERMULTIPLEXER_START_DLLPUB( SelectionListenerMultiplexer, ::com::sun:
void SAL_CALL selectionChanged( const ::com::sun::star::awt::grid::GridSelectionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
DECL_LISTENERMULTIPLEXER_END
+// ----------------------------------------------------
+// class TabPageListenerMultiplexer
+// ----------------------------------------------------
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener )
+ void SAL_CALL tabPageActivated( const ::com::sun::star::awt::tab::TabPageActivatedEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+DECL_LISTENERMULTIPLEXER_END
+
#endif // _TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX_
diff --git a/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx b/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
index c84a6e54d73b..45e0bdf93dc4 100644
--- a/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
+++ b/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
@@ -44,7 +44,7 @@ public:
::cppu::OBroadcastHelper BrdcstHelper;
::osl::Mutex& GetMutex() { return Mutex; }
-
+ ::cppu::OBroadcastHelper& GetBroadcastHelper() { return BrdcstHelper; }
};
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx
index 837d283f4e8c..082ac75bafae 100644
--- a/toolkit/inc/toolkit/helper/property.hxx
+++ b/toolkit/inc/toolkit/helper/property.hxx
@@ -202,6 +202,7 @@ namespace rtl {
#define BASEPROPERTY_GRID_ROW_BACKGROUND 151
#define BASEPROPERTY_MULTISELECTION_SIMPLEMODE 152
#define BASEPROPERTY_ITEM_SEPARATOR_POS 153
+#define BASEPROPERTY_AUTO_REPEAT 154
// Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
diff --git a/toolkit/inc/toolkit/helper/servicenames.hxx b/toolkit/inc/toolkit/helper/servicenames.hxx
index 2d1df79b733b..1e5d394fb660 100644
--- a/toolkit/inc/toolkit/helper/servicenames.hxx
+++ b/toolkit/inc/toolkit/helper/servicenames.hxx
@@ -102,7 +102,17 @@ extern const sal_Char __FAR_DATA szServiceName_UnoSimpleAnimationControl[], szSe
extern const sal_Char __FAR_DATA szServiceName_UnoSimpleAnimationControlModel[], szServiceName2_UnoSimpleAnimationControlModel[];
extern const sal_Char __FAR_DATA szServiceName_UnoThrobberControl[], szServiceName2_UnoThrobberControl[];
extern const sal_Char __FAR_DATA szServiceName_UnoThrobberControlModel[], szServiceName2_UnoThrobberControlModel[];
+extern const sal_Char __FAR_DATA szServiceName_AnimatedImagesControl[];
+extern const sal_Char __FAR_DATA szServiceName_AnimatedImagesControlModel[];
+extern const sal_Char __FAR_DATA szServiceName_SpinningProgressControlModel[];
extern const sal_Char __FAR_DATA szServiceName_UnoControlFixedHyperlink[], szServiceName_UnoControlFixedHyperlinkModel[];
+extern const sal_Char __FAR_DATA szServiceName_UnoControlTabPageModel[], szServiceName2_UnoControlTabPageModel[];
+extern const sal_Char __FAR_DATA szServiceName_UnoControlTabPage[];
+extern const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainerModel[];
+extern const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainer[];
+
+// ExtUnoWrapper:
+extern const char __FAR_DATA szServiceName_ImageProducer[], szServiceName2_ImageProducer[];
#endif // _TOOLKIT_HELPER_SERVICENAMES_HXX_
diff --git a/toolkit/inc/toolkit/helper/throbberimpl.hxx b/toolkit/inc/toolkit/helper/throbberimpl.hxx
deleted file mode 100644
index b944a74b65d2..000000000000
--- a/toolkit/inc/toolkit/helper/throbberimpl.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _TOOLKIT_HELPER_THROBBERIMPL_HXX_
-#define _TOOLKIT_HELPER_THROBBERIMPL_HXX_
-
-#include <toolkit/awt/vclxwindow.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-
-#include <com/sun/star/graphic/XGraphic.hpp>
-#include <vcl/timer.hxx>
-#include <vos/mutex.hxx>
-
-//........................................................................
-namespace toolkit
-//........................................................................
-{
-
- class Throbber_Impl
- {
- private:
- vos::IMutex& mrMutex; // Reference to SolarMutex
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > maImageList;
- ::com::sun::star::uno::Reference< VCLXWindow > mxParent;
-
- sal_Bool mbRepeat;
- sal_Int32 mnStepTime;
- sal_Int32 mnCurStep;
- sal_Int32 mnStepCount;
- AutoTimer maWaitTimer;
-
- DECL_LINK( TimeOutHdl, Throbber_Impl* );
-
- vos::IMutex& GetMutex() { return mrMutex; }
-
- public:
- Throbber_Impl( ::com::sun::star::uno::Reference< VCLXWindow > xParent,
- sal_Int32 nStepTime,
- sal_Bool bRepeat );
- ~Throbber_Impl();
-
- // Properties
- void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
- void setRepeat( sal_Bool bRepeat ) { mbRepeat = bRepeat; }
-
- // XSimpleAnimation
- void start() throw ( ::com::sun::star::uno::RuntimeException );
- void stop() throw ( ::com::sun::star::uno::RuntimeException );
- void setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList )
- throw ( ::com::sun::star::uno::RuntimeException );
- // Helpers
- void initImage() throw ( ::com::sun::star::uno::RuntimeException );
- sal_Bool isHCMode() throw ( ::com::sun::star::uno::RuntimeException );
- };
-//........................................................................
-} // namespacetoolkit
-//........................................................................
-
-#endif //_TOOLKIT_HELPER_THROBBERIMPL_HXX_
-
diff --git a/toolkit/inc/toolkit/helper/tkresmgr.hxx b/toolkit/inc/toolkit/helper/tkresmgr.hxx
index d7a1c42ea13c..ea62cd3db361 100644
--- a/toolkit/inc/toolkit/helper/tkresmgr.hxx
+++ b/toolkit/inc/toolkit/helper/tkresmgr.hxx
@@ -70,6 +70,7 @@ public:
// loads the image with the specified resource id
static Image loadImage( sal_uInt16 nResId );
+ static Image getImageFromURL( const ::rtl::OUString& i_rImageURL );
};
diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx
new file mode 100755
index 000000000000..c9c640d51c60
--- /dev/null
+++ b/toolkit/source/awt/animatedimagespeer.cxx
@@ -0,0 +1,538 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_toolkit.hxx"
+
+#include "toolkit/awt/animatedimagespeer.hxx"
+#include "toolkit/helper/property.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/XAnimatedImages.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/urlobj.hxx>
+#include <vcl/throbber.hxx>
+
+#include <limits>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::awt::XAnimatedImages;
+ using ::com::sun::star::awt::Size;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::graphic::XGraphicProvider;
+ using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::graphic::XGraphic;
+ /** === end UNO using === **/
+ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
+
+ //==================================================================================================================
+ //= AnimatedImagesPeer_Data
+ //==================================================================================================================
+ struct CachedImage
+ {
+ ::rtl::OUString sImageURL;
+ mutable Reference< XGraphic > xGraphic;
+
+ CachedImage()
+ :sImageURL()
+ ,xGraphic()
+ {
+ }
+
+ CachedImage( ::rtl::OUString const& i_imageURL )
+ :sImageURL( i_imageURL )
+ ,xGraphic()
+ {
+ }
+ };
+
+ struct AnimatedImagesPeer_Data
+ {
+ AnimatedImagesPeer& rAntiImpl;
+ ::std::vector< ::std::vector< CachedImage > > aCachedImageSets;
+
+ AnimatedImagesPeer_Data( AnimatedImagesPeer& i_antiImpl )
+ :rAntiImpl( i_antiImpl )
+ ,aCachedImageSets()
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ //--------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString lcl_getHighContrastURL( ::rtl::OUString const& i_imageURL )
+ {
+ INetURLObject aURL( i_imageURL );
+ if ( aURL.GetProtocol() != INET_PROT_PRIV_SOFFICE )
+ {
+ OSL_VERIFY( aURL.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hicontrast" ) ), false, 0 ) );
+ return aURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ // the private: scheme is not considered to be hierarchical by INetURLObject, so manually insert the
+ // segment
+ const sal_Int32 separatorPos = i_imageURL.indexOf( '/' );
+ ENSURE_OR_RETURN( separatorPos != -1, "lcl_getHighContrastURL: unsipported URL scheme - cannot automatically determine HC version!", i_imageURL );
+
+ ::rtl::OUStringBuffer composer;
+ composer.append( i_imageURL.copy( 0, separatorPos ) );
+ composer.appendAscii( "/hicontrast" );
+ composer.append( i_imageURL.copy( separatorPos ) );
+ return composer.makeStringAndClear();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ bool lcl_ensureImage_throw( Reference< XGraphicProvider > const& i_graphicProvider, const bool i_isHighContrast, const CachedImage& i_cachedImage )
+ {
+ if ( !i_cachedImage.xGraphic.is() )
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ if ( i_isHighContrast )
+ {
+ // try (to find) the high-contrast version of the graphic first
+ aMediaProperties.put( "URL", lcl_getHighContrastURL( i_cachedImage.sImageURL ) );
+ i_cachedImage.xGraphic.set( i_graphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ if ( !i_cachedImage.xGraphic.is() )
+ {
+ aMediaProperties.put( "URL", i_cachedImage.sImageURL );
+ i_cachedImage.xGraphic.set( i_graphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ }
+ return i_cachedImage.xGraphic.is();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ Size lcl_getGraphicSizePixel( Reference< XGraphic > const& i_graphic )
+ {
+ Size aSizePixel;
+ try
+ {
+ if ( i_graphic.is() )
+ {
+ const Reference< XPropertySet > xGraphicProps( i_graphic, UNO_QUERY_THROW );
+ OSL_VERIFY( xGraphicProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SizePixel" ) ) ) >>= aSizePixel );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aSizePixel;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_init( Sequence< ::rtl::OUString > const& i_imageURLs, ::std::vector< CachedImage >& o_images )
+ {
+ o_images.resize(0);
+ size_t count = size_t( i_imageURLs.getLength() );
+ o_images.reserve( count );
+ for ( size_t i = 0; i < count; ++i )
+ {
+ o_images.push_back( CachedImage( i_imageURLs[i] ) );
+ }
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_updateImageList_nothrow( AnimatedImagesPeer_Data& i_data )
+ {
+ Throbber* pThrobber = dynamic_cast< Throbber* >( i_data.rAntiImpl.GetWindow() );
+ if ( pThrobber == NULL )
+ return;
+
+ try
+ {
+ // collect the image sizes of the different image sets
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW );
+
+ const bool isHighContrast = pThrobber->GetSettings().GetStyleSettings().GetHighContrastMode();
+
+ sal_Int32 nPreferredSet = -1;
+ const size_t nImageSetCount = i_data.aCachedImageSets.size();
+ if ( nImageSetCount < 2 )
+ {
+ nPreferredSet = sal_Int32( nImageSetCount ) - 1;
+ }
+ else
+ {
+ ::std::vector< Size > aImageSizes( nImageSetCount );
+ for ( sal_Int32 nImageSet = 0; size_t( nImageSet ) < nImageSetCount; ++nImageSet )
+ {
+ ::std::vector< CachedImage > const& rImageSet( i_data.aCachedImageSets[ nImageSet ] );
+ if ( ( rImageSet.empty() )
+ || ( !lcl_ensureImage_throw( xGraphicProvider, isHighContrast, rImageSet[0] ) )
+ )
+ {
+ aImageSizes[ nImageSet ] = Size( ::std::numeric_limits< long >::max(), ::std::numeric_limits< long >::max() );
+ }
+ else
+ {
+ aImageSizes[ nImageSet ] = lcl_getGraphicSizePixel( rImageSet[0].xGraphic );
+ }
+ }
+
+ // find the set with the smallest difference between window size and image size
+ const ::Size aWindowSizePixel = pThrobber->GetSizePixel();
+ long nMinimalDistance = ::std::numeric_limits< long >::max();
+ for ( ::std::vector< Size >::const_iterator check = aImageSizes.begin();
+ check != aImageSizes.end();
+ ++check
+ )
+ {
+ if ( ( check->Width > aWindowSizePixel.Width() )
+ || ( check->Height > aWindowSizePixel.Height() )
+ )
+ // do not use an image set which doesn't fit into the window
+ continue;
+
+ const sal_Int64 distance =
+ ( aWindowSizePixel.Width() - check->Width ) * ( aWindowSizePixel.Width() - check->Width )
+ + ( aWindowSizePixel.Height() - check->Height ) * ( aWindowSizePixel.Height() - check->Height );
+ if ( distance < nMinimalDistance )
+ {
+ nMinimalDistance = distance;
+ nPreferredSet = check - aImageSizes.begin();
+ }
+ }
+ }
+
+ // found a set?
+ Sequence< Reference< XGraphic > > aImages;
+ if ( ( nPreferredSet >= 0 ) && ( size_t( nPreferredSet ) < nImageSetCount ) )
+ {
+ // => set the images
+ ::std::vector< CachedImage > const& rImageSet( i_data.aCachedImageSets[ nPreferredSet ] );
+ aImages.realloc( rImageSet.size() );
+ sal_Int32 imageIndex = 0;
+ for ( ::std::vector< CachedImage >::const_iterator cachedImage = rImageSet.begin();
+ cachedImage != rImageSet.end();
+ ++cachedImage, ++imageIndex
+ )
+ {
+ lcl_ensureImage_throw( xGraphicProvider, isHighContrast, *cachedImage );
+ aImages[ imageIndex ] = cachedImage->xGraphic;
+ }
+ }
+ pThrobber->setImageList( aImages );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void lcl_updateImageList_nothrow( AnimatedImagesPeer_Data& i_data, const Reference< XAnimatedImages >& i_images )
+ {
+ try
+ {
+ const sal_Int32 nImageSetCount = i_images->getImageSetCount();
+ i_data.aCachedImageSets.resize(0);
+ for ( sal_Int32 set = 0; set < nImageSetCount; ++set )
+ {
+ const Sequence< ::rtl::OUString > aImageURLs( i_images->getImageSet( set ) );
+ ::std::vector< CachedImage > aImages;
+ lcl_init( aImageURLs, aImages );
+ i_data.aCachedImageSets.push_back( aImages );
+ }
+
+ lcl_updateImageList_nothrow( i_data );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ //==================================================================================================================
+ //= AnimatedImagesPeer
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesPeer::AnimatedImagesPeer()
+ :AnimatedImagesPeer_Base()
+ ,m_pData( new AnimatedImagesPeer_Data( *this ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesPeer::~AnimatedImagesPeer()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::startAnimation( ) throw (RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->start();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::stopAnimation( ) throw (RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->stop();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL AnimatedImagesPeer::isAnimationRunning( ) throw (RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ return pThrobber->isRunning();
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::setProperty( const ::rtl::OUString& i_propertyName, const Any& i_value ) throw(RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
+ {
+ VCLXWindow::setProperty( i_propertyName, i_value );
+ return;
+ }
+
+ const sal_uInt16 nPropertyId = GetPropertyId( i_propertyName );
+ switch ( nPropertyId )
+ {
+ case BASEPROPERTY_STEP_TIME:
+ {
+ sal_Int32 nStepTime( 0 );
+ if ( i_value >>= nStepTime )
+ pThrobber->setStepTime( nStepTime );
+ break;
+ }
+ case BASEPROPERTY_AUTO_REPEAT:
+ {
+ sal_Bool bRepeat( sal_True );
+ if ( i_value >>= bRepeat )
+ pThrobber->setRepeat( bRepeat );
+ break;
+ }
+
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ {
+ sal_Int16 nScaleMode( ImageScaleMode::Anisotropic );
+ ImageControl* pImageControl = dynamic_cast< ImageControl* >( GetWindow() );
+ if ( pImageControl && ( i_value >>= nScaleMode ) )
+ {
+ pImageControl->SetScaleMode( nScaleMode );
+ }
+ }
+ break;
+
+ default:
+ AnimatedImagesPeer_Base::setProperty( i_propertyName, i_value );
+ break;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL AnimatedImagesPeer::getProperty( const ::rtl::OUString& i_propertyName ) throw(RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+
+ Any aReturn;
+
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
+ return VCLXWindow::getProperty( i_propertyName );
+
+ const sal_uInt16 nPropertyId = GetPropertyId( i_propertyName );
+ switch ( nPropertyId )
+ {
+ case BASEPROPERTY_STEP_TIME:
+ aReturn <<= pThrobber->getStepTime();
+ break;
+
+ case BASEPROPERTY_AUTO_REPEAT:
+ aReturn <<= pThrobber->getRepeat();
+ break;
+
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ {
+ ImageControl const* pImageControl = dynamic_cast< ImageControl* >( GetWindow() );
+ aReturn <<= ( pImageControl ? pImageControl->GetScaleMode() : ImageScaleMode::Anisotropic );
+ }
+ break;
+
+ default:
+ aReturn = AnimatedImagesPeer_Base::getProperty( i_propertyName );
+ break;
+ }
+
+ return aReturn;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void AnimatedImagesPeer::ProcessWindowEvent( const VclWindowEvent& i_windowEvent )
+ {
+ switch ( i_windowEvent.GetId() )
+ {
+ case VCLEVENT_WINDOW_RESIZE:
+ lcl_updateImageList_nothrow( *m_pData );
+ break;
+ }
+
+ AnimatedImagesPeer_Base::ProcessWindowEvent( i_windowEvent );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void AnimatedImagesPeer::impl_updateImages_nolck( const Reference< XInterface >& i_animatedImages )
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+
+ lcl_updateImageList_nothrow( *m_pData, Reference< XAnimatedImages >( i_animatedImages, UNO_QUERY_THROW ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+ Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW );
+
+ sal_Int32 nPosition(0);
+ OSL_VERIFY( i_event.Accessor >>= nPosition );
+ size_t position = size_t( nPosition );
+ if ( position > m_pData->aCachedImageSets.size() )
+ {
+ OSL_ENSURE( false, "AnimatedImagesPeer::elementInserted: illegal accessor/index!" );
+ lcl_updateImageList_nothrow( *m_pData, xAnimatedImages );
+ }
+
+ Sequence< ::rtl::OUString > aImageURLs;
+ OSL_VERIFY( i_event.Element >>= aImageURLs );
+ ::std::vector< CachedImage > aImages;
+ lcl_init( aImageURLs, aImages );
+ m_pData->aCachedImageSets.insert( m_pData->aCachedImageSets.begin() + position, aImages );
+ lcl_updateImageList_nothrow( *m_pData );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+ Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW );
+
+ sal_Int32 nPosition(0);
+ OSL_VERIFY( i_event.Accessor >>= nPosition );
+ size_t position = size_t( nPosition );
+ if ( position >= m_pData->aCachedImageSets.size() )
+ {
+ OSL_ENSURE( false, "AnimatedImagesPeer::elementRemoved: illegal accessor/index!" );
+ lcl_updateImageList_nothrow( *m_pData, xAnimatedImages );
+ }
+
+ m_pData->aCachedImageSets.erase( m_pData->aCachedImageSets.begin() + position );
+ lcl_updateImageList_nothrow( *m_pData );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ ::vos::OGuard aGuard( GetMutex() );
+ Reference< XAnimatedImages > xAnimatedImages( i_event.Source, UNO_QUERY_THROW );
+
+ sal_Int32 nPosition(0);
+ OSL_VERIFY( i_event.Accessor >>= nPosition );
+ size_t position = size_t( nPosition );
+ if ( position >= m_pData->aCachedImageSets.size() )
+ {
+ OSL_ENSURE( false, "AnimatedImagesPeer::elementReplaced: illegal accessor/index!" );
+ lcl_updateImageList_nothrow( *m_pData, xAnimatedImages );
+ }
+
+ Sequence< ::rtl::OUString > aImageURLs;
+ OSL_VERIFY( i_event.Element >>= aImageURLs );
+ ::std::vector< CachedImage > aImages;
+ lcl_init( aImageURLs, aImages );
+ m_pData->aCachedImageSets[ position ] = aImages;
+ lcl_updateImageList_nothrow( *m_pData );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ VCLXWindow::disposing( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::modified( const EventObject& i_event ) throw (RuntimeException)
+ {
+ impl_updateImages_nolck( i_event.Source );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesPeer::dispose( ) throw(RuntimeException)
+ {
+ AnimatedImagesPeer_Base::dispose();
+ ::vos::OGuard aGuard( GetMutex() );
+ m_pData->aCachedImageSets.resize(0);
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx
new file mode 100644
index 000000000000..ead570f80b88
--- /dev/null
+++ b/toolkit/source/awt/vclxtabpagecontainer.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 "precompiled_toolkit.hxx"
+
+#include <toolkit/awt/vclxtabpagecontainer.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <vcl/tabpage.hxx>
+#include <vcl/tabctrl.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <toolkit/helper/tkresmgr.hxx>
+#include <cppuhelper/typeprovider.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::view;
+// ----------------------------------------------------
+// class VCLXTabPageContainer
+// ----------------------------------------------------
+void VCLXTabPageContainer::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+{
+ VCLXWindow::ImplGetPropertyIds( rIds );
+}
+
+VCLXTabPageContainer::VCLXTabPageContainer() :
+ m_aTabPageListeners( *this )
+{
+}
+
+VCLXTabPageContainer::~VCLXTabPageContainer()
+{
+#ifndef __SUNPRO_CC
+ OSL_TRACE ("%s", __FUNCTION__);
+#endif
+}
+
+void SAL_CALL VCLXTabPageContainer::draw( sal_Int32 nX, sal_Int32 nY ) throw(RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+ TabControl* pTabControl = (TabControl*)GetWindow();
+ if ( pTabControl )
+ {
+ TabPage *pTabPage = pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( pTabControl->GetCurPageId( ) ) );
+ if ( pTabPage )
+ {
+ ::Point aPos( nX, nY );
+ ::Size aSize = pTabPage->GetSizePixel();
+
+ OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
+ aPos = pDev->PixelToLogic( aPos );
+ aSize = pDev->PixelToLogic( aSize );
+
+ pTabPage->Draw( pDev, aPos, aSize, 0 );
+ }
+ }
+
+ VCLXWindow::draw( nX, nY );
+/*
+ if ( pWindow )
+ {
+ OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
+ if ( !pDev )
+ pDev = pWindow->GetParent();
+
+ Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() );
+ Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
+
+ pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS );
+ }
+*/
+}
+
+::com::sun::star::awt::DeviceInfo VCLXTabPageContainer::getInfo() throw(RuntimeException)
+{
+ ::com::sun::star::awt::DeviceInfo aInfo = VCLXDevice::getInfo();
+ return aInfo;
+}
+
+void SAL_CALL VCLXTabPageContainer::setProperty(const ::rtl::OUString& PropertyName, const Any& Value ) throw(RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TabControl* pTabPage = (TabControl*)GetWindow();
+ if ( pTabPage )
+ {
+ VCLXWindow::setProperty( PropertyName, Value );
+ }
+}
+::sal_Int16 SAL_CALL VCLXTabPageContainer::getActiveTabPageID() throw (RuntimeException)
+{
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ return pTabCtrl != NULL ? pTabCtrl->GetCurPageId( ) : 0;
+}
+void SAL_CALL VCLXTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (RuntimeException)
+{
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ if ( pTabCtrl )
+ pTabCtrl->SelectTabPage(_activetabpageid);
+}
+::sal_Int32 SAL_CALL VCLXTabPageContainer::getTabPageCount( ) throw (RuntimeException)
+{
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ return pTabCtrl != NULL ? pTabCtrl->GetPageCount() : 0;
+}
+::sal_Bool SAL_CALL VCLXTabPageContainer::isTabPageActive( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ return (getActiveTabPageID() == tabPageIndex);
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPage( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ return (tabPageIndex >= 0 && tabPageIndex < static_cast<sal_Int16>(m_aTabPages.size())) ? m_aTabPages[tabPageIndex] : NULL;
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) throw (RuntimeException)
+{
+ ::vos::OClearableGuard aGuard( GetMutex() );
+ Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage;
+ ::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aIter = m_aTabPages.begin();
+ ::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aEnd = m_aTabPages.end();
+ for(;aIter != aEnd;++aIter)
+ {
+ Reference< awt::XControl > xControl(*aIter,UNO_QUERY );
+ Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
+ if ( tabPageID == xP->getTabPageID() )
+ {
+ xTabPage = *aIter;
+ break;
+ }
+ }
+ return xTabPage;
+}
+void SAL_CALL VCLXTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ m_aTabPageListeners.addInterface( listener );
+}
+void SAL_CALL VCLXTabPageContainer::removeTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ m_aTabPageListeners.removeInterface( listener );
+}
+
+void VCLXTabPageContainer::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent )
+{
+ ::vos::OClearableGuard aGuard( GetMutex() );
+ TabControl* pTabControl = static_cast< TabControl* >( GetWindow() );
+ if ( pTabControl )
+ {
+ switch ( _rVclWindowEvent.GetId() )
+ {
+ case VCLEVENT_TABPAGE_ACTIVATE:
+ {
+// allocateArea( maAllocation );
+ ULONG page = (ULONG)_rVclWindowEvent.GetData();
+ awt::tab::TabPageActivatedEvent aEvent(NULL,page);
+ m_aTabPageListeners.tabPageActivated(aEvent);
+ break;
+ }
+ default:
+ aGuard.clear();
+ VCLXWindow::ProcessWindowEvent( _rVclWindowEvent );
+ break;
+ }
+ }
+}
+void SAL_CALL VCLXTabPageContainer::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY);
+ if ( pTabCtrl && xTabPage.is() )
+ {
+ Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
+ Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
+ sal_Int16 nPageID = xP->getTabPageID();
+
+ Window* pWindow = VCLUnoHelper::GetWindow(xControl->getPeer());
+ TabPage* pPage = (TabPage*)pWindow;
+ pTabCtrl->InsertPage(nPageID,pPage->GetText());
+
+ pPage->Hide();
+ pTabCtrl->SetTabPage(nPageID,pPage);
+ pTabCtrl->SetHelpText(nPageID,xP->getTooltip());
+ pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL()));
+ pTabCtrl->SelectTabPage(nPageID);
+ m_aTabPages.push_back(xTabPage);
+ }
+}
+void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+ TabControl* pTabCtrl = (TabControl*)GetWindow();
+ Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage(Event.Element,uno::UNO_QUERY);
+ if ( pTabCtrl && xTabPage.is() )
+ {
+ Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
+ Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
+ pTabCtrl->RemovePage(xP->getTabPageID());
+ m_aTabPages.erase(::std::remove(m_aTabPages.begin(),m_aTabPages.end(),xTabPage));
+ }
+}
+void SAL_CALL VCLXTabPageContainer::elementReplaced( const ::com::sun::star::container::ContainerEvent& /*Event*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
diff --git a/toolkit/source/awt/vclxtabpagemodel.cxx b/toolkit/source/awt/vclxtabpagemodel.cxx
new file mode 100644
index 000000000000..c7145992bd7f
--- /dev/null
+++ b/toolkit/source/awt/vclxtabpagemodel.cxx
@@ -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.
+ *
+ ************************************************************************/
+#include "precompiled_toolkit.hxx"
+
+#include <toolkit/awt/vclxtabpagemodel.hxx>
+#include <vcl/tabpage.hxx>
+#include <vcl/tabctrl.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <cppuhelper/typeprovider.hxx>
+// ----------------------------------------------------
+// class VCLXDialog
+// ----------------------------------------------------
+
+VCLXTabPageModel::VCLXTabPageModel()
+{
+}
+
+VCLXTabPageModel::~VCLXTabPageModel()
+{
+#ifndef __SUNPRO_CC
+ OSL_TRACE ("%s", __FUNCTION__);
+#endif
+}
+
+void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( GetMutex() );
+ Window* pWindow = GetWindow();
+
+ if ( pWindow )
+ {
+ OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
+ if ( !pDev )
+ pDev = pWindow->GetParent();
+
+ Size aSize = pDev->PixelToLogic( pWindow->GetSizePixel() );
+ Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
+
+ pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS );
+ }
+}
+
+::com::sun::star::awt::DeviceInfo VCLXTabPageModel::getInfo() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::awt::DeviceInfo aInfo;// = VCLXDevice::getInfo();
+ return aInfo;
+}
+
+
+void SAL_CALL VCLXTabPageModel::setProperty(
+ const ::rtl::OUString& /*PropertyName*/,
+ const ::com::sun::star::uno::Any& /*Value*/ )
+throw(::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( GetMutex() );
+
+ /*TabPage* pTabPage = (TabPage*)GetWindow();
+ if ( pTabPage )
+ {
+ VCLXWindow::setProperty( PropertyName, Value );
+ }*/
+}
+//XTabPageModel
+::sal_Int16 SAL_CALL VCLXTabPageModel::getTabPageID() throw (::com::sun::star::uno::RuntimeException)
+{
+ return 0;
+}
+::sal_Bool SAL_CALL VCLXTabPageModel::getEnabled() throw (::com::sun::star::uno::RuntimeException)
+{
+ return false;
+}
+void SAL_CALL VCLXTabPageModel::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //TabControl* pTabControl = (TabControl*)GetWindow();
+ //if ( pTabControl )
+ // pTabControl->EnablePage(0, true);
+}
+::rtl::OUString SAL_CALL VCLXTabPageModel::getTitle() throw (::com::sun::star::uno::RuntimeException)
+{
+ //TabControl* pTabControl = (TabControl*)GetWindow();
+ //if ( pTabControl )
+ // return pTabControl->GetPageText(0);
+ //else
+ return ::rtl::OUString::createFromAscii("");
+}
+void SAL_CALL VCLXTabPageModel::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //TabControl* pTabControl = (TabControl*)GetWindow();
+ //if ( pTabControl )
+ // pTabControl->SetPageText(0, _title);
+
+}
+::rtl::OUString SAL_CALL VCLXTabPageModel::getImageURL() throw (::com::sun::star::uno::RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii("");
+}
+void SAL_CALL VCLXTabPageModel::setImageURL( const ::rtl::OUString& /*_imageurl*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+ //m_sImageURL = _imageurl;
+}
+::rtl::OUString SAL_CALL VCLXTabPageModel::getTooltip() throw (::com::sun::star::uno::RuntimeException)
+{
+ //return m_sTooltip;
+ return ::rtl::OUString::createFromAscii("");
+}
+void SAL_CALL VCLXTabPageModel::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException)
+{
+ (void)_tooltip;
+}
+::cppu::IPropertyArrayHelper& VCLXTabPageModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ com::sun::star::uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > VCLXTabPageModel::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ static ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 1af422bf7f00..96370911e9ed 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -33,6 +33,7 @@
#include <tools/svwin.h>
#endif
#include <stdio.h>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
#include <com/sun/star/awt/WindowClass.hpp>
@@ -68,9 +69,12 @@
#include <toolkit/awt/vclxsystemdependentwindow.hxx>
#include <toolkit/awt/vclxregion.hxx>
#include <toolkit/awt/vclxtoolkit.hxx>
+#include <toolkit/awt/vclxtabpagecontainer.hxx>
+#include <toolkit/awt/vclxtabpagemodel.hxx>
#include <toolkit/awt/xsimpleanimation.hxx>
#include <toolkit/awt/xthrobber.hxx>
+#include <toolkit/awt/animatedimagespeer.hxx>
#include <toolkit/awt/vclxtopwindow.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -115,6 +119,7 @@
#include <vcl/virdev.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
+#include <vcl/throbber.hxx>
#include "toolkit/awt/vclxspinbutton.hxx"
#include <tools/debug.hxx>
@@ -313,6 +318,7 @@ static ComponentInfo __FAR_DATA aComponentInfos [] =
{ "scrollbar", WINDOW_SCROLLBAR },
{ "scrollbarbox", WINDOW_SCROLLBARBOX },
{ "simpleanimation", WINDOW_CONTROL },
+ { "animatedimages", WINDOW_CONTROL },
{ "spinbutton", WINDOW_SPINBUTTON },
{ "spinfield", WINDOW_SPINFIELD },
{ "throbber", WINDOW_CONTROL },
@@ -329,7 +335,9 @@ static ComponentInfo __FAR_DATA aComponentInfos [] =
{ "tristatebox", WINDOW_TRISTATEBOX },
{ "warningbox", WINDOW_WARNINGBOX },
{ "window", WINDOW_WINDOW },
- { "workwindow", WINDOW_WORKWINDOW }
+ { "workwindow", WINDOW_WORKWINDOW },
+ { "tabpagecontainer", WINDOW_CONTROL },
+ { "tabpagemodel", WINDOW_TABPAGE }
};
extern "C"
@@ -863,13 +871,25 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
break;
case WINDOW_TABCONTROL:
pNewWindow = new TabControl( pParent, nWinBits );
+ *ppNewComp = new VCLXTabPageContainer;
break;
case WINDOW_TABDIALOG:
pNewWindow = new TabDialog( pParent, nWinBits );
break;
case WINDOW_TABPAGE:
- pNewWindow = new TabPage( pParent, nWinBits );
- *ppNewComp = new VCLXTabPage;
+ /*
+ if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
+ ::rtl::OUString::createFromAscii("tabpagemodel") ) )
+ {
+ pNewWindow = new TabControl( pParent, nWinBits );
+ *ppNewComp = new VCLXTabPageContainer;
+ }
+ else
+ */
+ {
+ pNewWindow = new TabPage( pParent, nWinBits );
+ *ppNewComp = new VCLXTabPage;
+ }
break;
case WINDOW_TIMEBOX:
pNewWindow = new TimeBox( pParent, nWinBits );
@@ -984,22 +1004,35 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
}
break;
case WINDOW_CONTROL:
- if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
- ::rtl::OUString::createFromAscii("simpleanimation") ) )
+ if ( aServiceName.EqualsAscii( "simpleanimation" ) )
{
- nWinBits |= WB_SCALE;
- pNewWindow = new FixedImage( pParent, nWinBits );
+ pNewWindow = new Throbber( pParent, nWinBits, Throbber::IMAGES_NONE );
+ ((Throbber*)pNewWindow)->SetScaleMode( css::awt::ImageScaleMode::Anisotropic );
+ // (compatibility)
*ppNewComp = new ::toolkit::XSimpleAnimation;
}
- else if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
- ::rtl::OUString::createFromAscii("throbber") ) )
+ else if ( aServiceName.EqualsAscii( "throbber" ) )
{
- nWinBits |= WB_SCALE;
- pNewWindow = new FixedImage( pParent, nWinBits );
+ pNewWindow = new Throbber( pParent, nWinBits, Throbber::IMAGES_NONE );
+ ((Throbber*)pNewWindow)->SetScaleMode( css::awt::ImageScaleMode::Anisotropic );
+ // (compatibility)
*ppNewComp = new ::toolkit::XThrobber;
}
+ else if ( rDescriptor.WindowServiceName.equalsIgnoreAsciiCase(
+ ::rtl::OUString::createFromAscii("tabpagecontainer") ) )
+ {
+ pNewWindow = new TabControl( pParent, nWinBits );
+ *ppNewComp = new VCLXTabPageContainer;
+ }
+ else if ( aServiceName.EqualsAscii( "animatedimages" ) )
+ {
+ pNewWindow = new Throbber( pParent, nWinBits );
+ *ppNewComp = new ::toolkit::AnimatedImagesPeer;
+ }
break;
- default: DBG_ERRORFILE( "UNO3!" );
+ default:
+ OSL_ENSURE( false, "VCLXToolkit::ImplCreateWindow: unknown window type!" );
+ break;
}
}
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 808f3578ef97..5d25e2f7b29b 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -65,6 +65,7 @@
#include <vcl/tabpage.hxx>
#include <vcl/button.hxx>
#include <comphelper/asyncnotification.hxx>
+#include <comphelper/flagguard.hxx>
#include <toolkit/helper/solarrelease.hxx>
#include "stylesettings.hxx"
#include <tools/urlobj.hxx>
@@ -95,32 +96,6 @@ namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
using ::toolkit::ReleaseSolarMutex;
//====================================================================
-//= misc helpers
-//====================================================================
-namespace
-{
- //................................................................
- //. FlagGuard
- //................................................................
- class FlagGuard
- {
- private:
- bool& m_rFlag;
-
- public:
- FlagGuard( bool& _rFlag )
- :m_rFlag( _rFlag )
- {
- m_rFlag = true;
- }
- ~FlagGuard()
- {
- m_rFlag = false;
- }
- };
-}
-
-//====================================================================
//= VCLXWindowImpl
//====================================================================
class SAL_DLLPRIVATE VCLXWindowImpl
@@ -2347,7 +2322,7 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno:
// #i40647# / 2005-01-18 / frank.schoenheit@sun.com
if ( !mpImpl->getDrawingOntoParent_ref() )
{
- FlagGuard aDrawingflagGuard( mpImpl->getDrawingOntoParent_ref() );
+ ::comphelper::FlagGuard aDrawingflagGuard( mpImpl->getDrawingOntoParent_ref() );
BOOL bWasVisible = pWindow->IsVisible();
Point aOldPos( pWindow->GetPosPixel() );
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 6c6b9dc4b2c8..fa3f840a05d6 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -37,6 +37,7 @@
#include <toolkit/helper/imagealign.hxx>
#include <toolkit/helper/accessibilityclient.hxx>
#include <toolkit/helper/fixedhyperbase.hxx>
+#include <toolkit/helper/tkresmgr.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/awt/VisualEffect.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -62,6 +63,7 @@
#include <vcl/scrbar.hxx>
#include <vcl/svapp.hxx>
#include <vcl/tabpage.hxx>
+#include <vcl/tabctrl.hxx>
#include <tools/diagnose_ex.h>
#include <boost/bind.hpp>
@@ -219,7 +221,7 @@ void VCLXGraphicControl::ImplSetNewImage()
{
OSL_PRECOND( GetWindow(), "VCLXGraphicControl::ImplSetNewImage: window is required to be not-NULL!" );
Button* pButton = static_cast< Button* >( GetWindow() );
- pButton->SetModeBitmap( GetBitmap() );
+ pButton->SetModeImage( GetImage() );
}
void VCLXGraphicControl::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, short Flags ) throw(::com::sun::star::uno::RuntimeException)
@@ -660,14 +662,14 @@ void VCLXImageControl::ImplSetNewImage()
{
OSL_PRECOND( GetWindow(), "VCLXImageControl::ImplSetNewImage: window is required to be not-NULL!" );
ImageControl* pControl = static_cast< ImageControl* >( GetWindow() );
- pControl->SetBitmap( GetBitmap() );
+ pControl->SetImage( GetImage() );
}
::com::sun::star::awt::Size VCLXImageControl::getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- Size aSz = GetBitmap().GetSizePixel();
+ Size aSz = GetImage().GetSizePixel();
aSz = ImplCalcWindowSize( aSz );
return AWTSize(aSz);
@@ -2068,34 +2070,32 @@ void VCLXListBox::ImplCallItemListeners()
maItemListeners.itemStateChanged( aEvent );
}
}
-
namespace
{
- Image lcl_getImageFromURL( const ::rtl::OUString& i_rImageURL )
- {
- if ( !i_rImageURL.getLength() )
- return Image();
+ Image lcl_getImageFromURL( const ::rtl::OUString& i_rImageURL )
+ {
+ if ( !i_rImageURL.getLength() )
+ return Image();
try
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Reference< XGraphicProvider > xProvider;
- if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
- {
- ::comphelper::NamedValueCollection aMediaProperties;
- aMediaProperties.put( "URL", i_rImageURL );
- Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() );
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XGraphicProvider > xProvider;
+ if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ aMediaProperties.put( "URL", i_rImageURL );
+ Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() );
return Image( xGraphic );
- }
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return Image();
- }
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return Image();
+ }
}
-
void SAL_CALL VCLXListBox::listItemInserted( const ItemListEvent& i_rEvent ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
@@ -2107,7 +2107,7 @@ void SAL_CALL VCLXListBox::listItemInserted( const ItemListEvent& i_rEvent ) thr
"VCLXListBox::listItemInserted: illegal (inconsistent) item position!" );
pListBox->InsertEntry(
i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString(),
- i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(),
+ i_rEvent.ItemImageURL.IsPresent ? TkResMgr::getImageFromURL( i_rEvent.ItemImageURL.Value ) : Image(),
i_rEvent.ItemPosition );
}
@@ -2137,7 +2137,7 @@ void SAL_CALL VCLXListBox::listItemModified( const ItemListEvent& i_rEvent ) thr
// VCL's ListBox does not support changing an entry's text or image, so remove and re-insert
const ::rtl::OUString sNewText = i_rEvent.ItemText.IsPresent ? i_rEvent.ItemText.Value : ::rtl::OUString( pListBox->GetEntry( i_rEvent.ItemPosition ) );
- const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? lcl_getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) );
+ const Image aNewImage( i_rEvent.ItemImageURL.IsPresent ? TkResMgr::getImageFromURL( i_rEvent.ItemImageURL.Value ) : pListBox->GetEntryImage( i_rEvent.ItemPosition ) );
pListBox->RemoveEntry( i_rEvent.ItemPosition );
pListBox->InsertEntry( sNewText, aNewImage, i_rEvent.ItemPosition );
@@ -2554,6 +2554,15 @@ throw(::com::sun::star::uno::RuntimeException)
}
}
break;
+ case BASEPROPERTY_TITLE:
+ {
+ ::rtl::OUString sTitle;
+ if ( Value >>= sTitle )
+ {
+ pTabPage->SetText(sTitle);
+ }
+ }
+ break;
default:
{
diff --git a/toolkit/source/awt/xsimpleanimation.cxx b/toolkit/source/awt/xsimpleanimation.cxx
index c7ccbde118f4..75701cb94b46 100644
--- a/toolkit/source/awt/xsimpleanimation.cxx
+++ b/toolkit/source/awt/xsimpleanimation.cxx
@@ -29,8 +29,8 @@
#include "precompiled_toolkit.hxx"
#include "toolkit/awt/xsimpleanimation.hxx"
#include "toolkit/helper/property.hxx"
-#include "toolkit/helper/throbberimpl.hxx"
#include <tools/debug.hxx>
+#include <vcl/throbber.hxx>
//........................................................................
namespace toolkit
@@ -48,54 +48,40 @@ namespace toolkit
XSimpleAnimation::XSimpleAnimation()
{
DBG_CTOR( XSimpleAnimation, NULL );
- mbRepeat = sal_True;
- mnStepTime = 100;
- mpThrobber = new Throbber_Impl( this, mnStepTime, mbRepeat );
}
//--------------------------------------------------------------------
XSimpleAnimation::~XSimpleAnimation()
{
DBG_DTOR( XSimpleAnimation, NULL );
- delete mpThrobber;
}
//--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XINTERFACE2( XSimpleAnimation, VCLXWindow, XSimpleAnimation_Base )
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( XSimpleAnimation, VCLXWindow, XSimpleAnimation_Base )
-
- //--------------------------------------------------------------------
void SAL_CALL XSimpleAnimation::start() throw ( uno::RuntimeException )
{
- mpThrobber->start();
+ ::vos::OGuard aGuard( GetMutex() );
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->start();
}
//--------------------------------------------------------------------
void SAL_CALL XSimpleAnimation::stop() throw ( uno::RuntimeException )
{
- mpThrobber->stop();
+ ::vos::OGuard aGuard( GetMutex() );
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->stop();
}
//--------------------------------------------------------------------
void SAL_CALL XSimpleAnimation::setImageList( const uno::Sequence< uno::Reference< graphic::XGraphic > >& rImageList )
throw ( uno::RuntimeException )
{
- mpThrobber->setImageList( rImageList );
- }
-
- //--------------------------------------------------------------------
- void XSimpleAnimation::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent )
- {
- // TODO: XSimpleAnimation::ProcessWindowEvent
- //::vos::OClearableGuard aGuard( GetMutex() );
- //Reference< XSimpleAnimation > xKeepAlive( this );
- //SpinButton* pSpinButton = static_cast< SpinButton* >( GetWindow() );
- //if ( !pSpinButton )
- // return;
-
- VCLXWindow::ProcessWindowEvent( _rVclWindowEvent );
+ ::vos::OGuard aGuard( GetMutex() );
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->setImageList( rImageList );
}
//--------------------------------------------------------------------
@@ -104,33 +90,31 @@ namespace toolkit
{
::vos::OGuard aGuard( GetMutex() );
- if ( GetWindow() )
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
{
- sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
- switch ( nPropertyId )
- {
- case BASEPROPERTY_STEP_TIME: {
- sal_Int32 nStepTime( 0 );
- if ( Value >>= nStepTime )
- {
- mnStepTime = nStepTime;
- mpThrobber->setStepTime( mnStepTime );
- }
-
- break;
- }
- case BASEPROPERTY_REPEAT: {
- sal_Bool bRepeat( sal_True );
- if ( Value >>= bRepeat )
- {
- mbRepeat = bRepeat;
- mpThrobber->setRepeat( mbRepeat );
- }
- break;
- }
- default:
- VCLXWindow::setProperty( PropertyName, Value );
+ VCLXWindow::setProperty( PropertyName, Value );
+ return;
+ }
+
+ sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
+ switch ( nPropertyId )
+ {
+ case BASEPROPERTY_STEP_TIME: {
+ sal_Int32 nStepTime( 0 );
+ if ( Value >>= nStepTime )
+ pThrobber->setStepTime( nStepTime );
+
+ break;
}
+ case BASEPROPERTY_REPEAT: {
+ sal_Bool bRepeat( sal_True );
+ if ( Value >>= bRepeat )
+ pThrobber->setRepeat( bRepeat );
+ break;
+ }
+ default:
+ VCLXWindow::setProperty( PropertyName, Value );
}
}
@@ -140,22 +124,22 @@ namespace toolkit
{
::vos::OGuard aGuard( GetMutex() );
- uno::Any aReturn;
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL )
+ return VCLXWindow::getProperty( PropertyName );
- if ( GetWindow() )
+ uno::Any aReturn;
+ sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
+ switch ( nPropertyId )
{
- sal_uInt16 nPropertyId = GetPropertyId( PropertyName );
- switch ( nPropertyId )
- {
- case BASEPROPERTY_STEP_TIME:
- aReturn <<= mnStepTime;
- break;
- case BASEPROPERTY_REPEAT:
- aReturn <<= mbRepeat;
- break;
- default:
- aReturn = VCLXWindow::getProperty( PropertyName );
- }
+ case BASEPROPERTY_STEP_TIME:
+ aReturn <<= pThrobber->getStepTime();
+ break;
+ case BASEPROPERTY_REPEAT:
+ aReturn <<= pThrobber->getRepeat();
+ break;
+ default:
+ aReturn = VCLXWindow::getProperty( PropertyName );
}
return aReturn;
}
diff --git a/toolkit/source/awt/xthrobber.cxx b/toolkit/source/awt/xthrobber.cxx
index 439fb49c1cbe..3b9b361202e9 100644
--- a/toolkit/source/awt/xthrobber.cxx
+++ b/toolkit/source/awt/xthrobber.cxx
@@ -30,7 +30,6 @@
#include "toolkit/awt/xthrobber.hxx"
#include "toolkit/helper/property.hxx"
#include <toolkit/helper/tkresmgr.hxx>
-#include <toolkit/helper/throbberimpl.hxx>
#ifndef _TOOLKIT_AWT_XTHROBBER_HRC_
#include "xthrobber.hrc"
@@ -38,6 +37,7 @@
#include <tools/debug.hxx>
#include <vcl/fixed.hxx>
#include <vcl/timer.hxx>
+#include <vcl/throbber.hxx>
//........................................................................
namespace toolkit
@@ -55,82 +55,37 @@ namespace toolkit
XThrobber::XThrobber()
{
DBG_CTOR( XThrobber, NULL );
-
- mpThrobber = new Throbber_Impl( this, 100, sal_True );
-
- InitImageList();
}
//--------------------------------------------------------------------
XThrobber::~XThrobber()
{
DBG_DTOR( XThrobber, NULL );
- delete mpThrobber;
}
//--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XINTERFACE2( XThrobber, VCLXWindow, XThrobber_Base )
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( XThrobber, VCLXWindow, XThrobber_Base )
-
- //--------------------------------------------------------------------
void SAL_CALL XThrobber::start() throw ( uno::RuntimeException )
{
- mpThrobber->start();
+ ::vos::OGuard aGuard( GetMutex() );
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->start();
}
//--------------------------------------------------------------------
void SAL_CALL XThrobber::stop() throw ( uno::RuntimeException )
{
- mpThrobber->stop();
- }
-
- //--------------------------------------------------------------------
- void XThrobber::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent )
- {
- static bool bInit = false;
- if ( !bInit )
- {
- // Images won't be shown if set too early
- mpThrobber->initImage();
- bInit = true;
- }
- // TODO: XSimpleAnimation::ProcessWindowEvent
- //::vos::OClearableGuard aGuard( GetMutex() );
- //Reference< XSimpleAnimation > xKeepAlive( this );
- //SpinButton* pSpinButton = static_cast< SpinButton* >( GetWindow() );
- //if ( !pSpinButton )
- // return;
-
- VCLXWindow::ProcessWindowEvent( _rVclWindowEvent );
- }
-
- //--------------------------------------------------------------------
- void SAL_CALL XThrobber::setProperty( const ::rtl::OUString& PropertyName, const uno::Any& Value )
- throw( uno::RuntimeException )
- {
::vos::OGuard aGuard( GetMutex() );
-
- if ( GetWindow() )
- {
- VCLXWindow::setProperty( PropertyName, Value );
- }
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber != NULL)
+ pThrobber->stop();
}
//--------------------------------------------------------------------
- uno::Any SAL_CALL XThrobber::getProperty( const ::rtl::OUString& PropertyName )
- throw( uno::RuntimeException )
+ void XThrobber::SetWindow( Window* pWindow )
{
- ::vos::OGuard aGuard( GetMutex() );
-
- uno::Any aReturn;
-
- if ( GetWindow() )
- {
- aReturn = VCLXWindow::getProperty( PropertyName );
- }
- return aReturn;
+ XThrobber_Base::SetWindow( pWindow );
+ InitImageList();
}
//--------------------------------------------------------------------
@@ -138,10 +93,15 @@ namespace toolkit
throw( uno::RuntimeException )
{
::vos::OGuard aGuard( GetMutex() );
+
+ Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) );
+ if ( pThrobber == NULL)
+ return;
+
uno::Sequence< uno::Reference< graphic::XGraphic > > aImageList(12);
sal_uInt16 nIconIdStart = RID_TK_ICON_THROBBER_START;
- if ( mpThrobber->isHCMode() )
+ if ( pThrobber->GetSettings().GetStyleSettings().GetHighContrastMode() )
nIconIdStart = RID_TK_HC_ICON_THROBBER_START;
for ( sal_uInt16 i=0; i<12; i++ )
@@ -150,7 +110,7 @@ namespace toolkit
aImageList[i] = aImage.GetXGraphic();
}
- mpThrobber->setImageList( aImageList );
+ pThrobber->setImageList( aImageList );
}
//........................................................................
diff --git a/toolkit/source/controls/animatedimages.cxx b/toolkit/source/controls/animatedimages.cxx
new file mode 100755
index 000000000000..03cb2f26f324
--- /dev/null
+++ b/toolkit/source/controls/animatedimages.cxx
@@ -0,0 +1,491 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_toolkit.hxx"
+
+#include "toolkit/controls/animatedimages.hxx"
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/property.hxx"
+#include "toolkit/helper/unopropertyarrayhelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/awt/VisualEffect.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::container::XContainerListener;
+ using ::com::sun::star::beans::XPropertySetInfo;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::lang::IndexOutOfBoundsException;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::XControlModel;
+ using ::com::sun::star::awt::XAnimatedImages;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::awt::XWindowPeer;
+ using ::com::sun::star::util::XModifyListener;
+ using ::com::sun::star::awt::XToolkit;
+ /** === end UNO using === **/
+ namespace VisualEffect = ::com::sun::star::awt::VisualEffect;
+ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
+
+ //==================================================================================================================
+ //= AnimatedImagesControl
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControl::AnimatedImagesControl()
+ :AnimatedImagesControl_Base()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString AnimatedImagesControl::GetComponentServiceName()
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AnimatedImages" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::startAnimation( ) throw (RuntimeException)
+ {
+ Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
+ if ( xAnimation.is() )
+ xAnimation->startAnimation();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::stopAnimation( ) throw (RuntimeException)
+ {
+ Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
+ if ( xAnimation.is() )
+ xAnimation->stopAnimation();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL AnimatedImagesControl::isAnimationRunning( ) throw (RuntimeException)
+ {
+ Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
+ if ( xAnimation.is() )
+ return xAnimation->isAnimationRunning();
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL AnimatedImagesControl::getImplementationName( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.AnimatedImagesControl" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL AnimatedImagesControl::getSupportedServiceNames() throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServices( AnimatedImagesControl_Base::getSupportedServiceNames() );
+ aServices.realloc( aServices.getLength() + 1 );
+ aServices[ aServices.getLength() - 1 ] = ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControl );
+ return aServices;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ void lcl_updatePeer( Reference< XWindowPeer > const& i_peer, Reference< XControlModel > const& i_model )
+ {
+ const Reference< XModifyListener > xPeerModify( i_peer, UNO_QUERY );
+ if ( xPeerModify.is() )
+ {
+ EventObject aEvent;
+ aEvent.Source = i_model;
+ xPeerModify->modified( aEvent );
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL AnimatedImagesControl::setModel( const Reference< XControlModel >& i_rModel ) throw ( RuntimeException )
+ {
+ const Reference< XAnimatedImages > xOldContainer( getModel(), UNO_QUERY );
+ const Reference< XAnimatedImages > xNewContainer( i_rModel, UNO_QUERY );
+
+ if ( !AnimatedImagesControl_Base::setModel( i_rModel ) )
+ return sal_False;
+
+ if ( xOldContainer.is() )
+ xOldContainer->removeContainerListener( this );
+
+ if ( xNewContainer.is() )
+ xNewContainer->addContainerListener( this );
+
+ lcl_updatePeer( getPeer(), getModel() );
+
+ return sal_True;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::createPeer( const Reference< XToolkit >& i_toolkit, const Reference< XWindowPeer >& i_parentPeer ) throw(RuntimeException)
+ {
+ AnimatedImagesControl_Base::createPeer( i_toolkit, i_parentPeer );
+
+ lcl_updatePeer( getPeer(), getModel() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
+ if ( xPeerListener.is() )
+ xPeerListener->elementInserted( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
+ if ( xPeerListener.is() )
+ xPeerListener->elementRemoved( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
+ if ( xPeerListener.is() )
+ xPeerListener->elementReplaced( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControl::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ UnoControlBase::disposing( i_event );
+ }
+
+ //==================================================================================================================
+ //= AnimatedImagesControlModel_Data
+ //==================================================================================================================
+ struct AnimatedImagesControlModel_Data
+ {
+ ::std::vector< Sequence< ::rtl::OUString > > aImageSets;
+ };
+
+ namespace
+ {
+ void lcl_checkIndex( const AnimatedImagesControlModel_Data& i_data, const sal_Int32 i_index, const Reference< XInterface >& i_context,
+ const bool i_forInsert = false )
+ {
+ if ( ( i_index < 0 ) || ( size_t( i_index ) > i_data.aImageSets.size() + ( i_forInsert ? 1 : 0 ) ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), i_context );
+ }
+
+ void lcl_notify( ::osl::ClearableMutexGuard& i_guard, ::cppu::OBroadcastHelper& i_broadcaseHelper,
+ void ( SAL_CALL XContainerListener::*i_notificationMethod )( const ContainerEvent& ),
+ const sal_Int32 i_accessor, const Sequence< ::rtl::OUString >& i_imageURLs, const Reference< XInterface >& i_context )
+ {
+ ::cppu::OInterfaceContainerHelper* pContainerListeners = i_broadcaseHelper.getContainer( XContainerListener::static_type() );
+ if ( pContainerListeners == NULL )
+ return;
+
+ ContainerEvent aEvent;
+ aEvent.Source = i_context;
+ aEvent.Accessor <<= i_accessor;
+ aEvent.Element <<= i_imageURLs;
+
+ i_guard.clear();
+ pContainerListeners->notifyEach( i_notificationMethod, aEvent );
+ }
+ }
+
+ //==================================================================================================================
+ //= AnimatedImagesControlModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControlModel::AnimatedImagesControlModel()
+ :m_pData( new AnimatedImagesControlModel_Data )
+ {
+ ImplRegisterProperty( BASEPROPERTY_AUTO_REPEAT );
+ ImplRegisterProperty( BASEPROPERTY_BORDER );
+ ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_IMAGE_SCALE_MODE );
+ ImplRegisterProperty( BASEPROPERTY_STEP_TIME );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControlModel::AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource )
+ :AnimatedImagesControlModel_Base( i_copySource )
+ ,m_pData( new AnimatedImagesControlModel_Data( *i_copySource.m_pData ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ AnimatedImagesControlModel::~AnimatedImagesControlModel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoControlModel* AnimatedImagesControlModel::Clone() const
+ {
+ return new AnimatedImagesControlModel( *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XPropertySetInfo > SAL_CALL AnimatedImagesControlModel::getPropertySetInfo( ) throw(RuntimeException)
+ {
+ static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL AnimatedImagesControlModel::getServiceName() throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControlModel );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL AnimatedImagesControlModel::getImplementationName( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( "org.openoffice.comp.toolkit.AnimatedImagesControlModel" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL AnimatedImagesControlModel::getSupportedServiceNames() throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(2);
+ aServiceNames[0] = ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControlModel );
+ aServiceNames[1] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.UnoControlModel" );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 i_handle, const Any& i_value ) throw (Exception)
+ {
+ switch ( i_handle )
+ {
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ {
+ sal_Int16 nImageScaleMode( ImageScaleMode::Anisotropic );
+ OSL_VERIFY( i_value >>= nImageScaleMode ); // convertFastPropertyValue ensures that this has the proper type
+ if ( ( nImageScaleMode != ImageScaleMode::None )
+ && ( nImageScaleMode != ImageScaleMode::Isotropic )
+ && ( nImageScaleMode != ImageScaleMode::Anisotropic )
+ )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+ }
+ break;
+ }
+
+ AnimatedImagesControlModel_Base::setFastPropertyValue_NoBroadcast( i_handle, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any AnimatedImagesControlModel::ImplGetDefaultValue( sal_uInt16 i_propertyId ) const
+ {
+ switch ( i_propertyId )
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ return makeAny( ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControl ) );
+
+ case BASEPROPERTY_BORDER:
+ return makeAny( VisualEffect::NONE );
+
+ case BASEPROPERTY_STEP_TIME:
+ return makeAny( (sal_Int32) 100 );
+
+ case BASEPROPERTY_AUTO_REPEAT:
+ return makeAny( (sal_Bool)sal_True );
+
+ case BASEPROPERTY_IMAGE_SCALE_MODE:
+ return makeAny( ImageScaleMode::None );
+
+ default:
+ return UnoControlModel::ImplGetDefaultValue( i_propertyId );
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::cppu::IPropertyArrayHelper& SAL_CALL AnimatedImagesControlModel::getInfoHelper()
+ {
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ Sequence< sal_Int32 > aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL AnimatedImagesControlModel::getStepTime() throw (RuntimeException)
+ {
+ sal_Int32 nStepTime( 100 );
+ OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_STEP_TIME ) ) >>= nStepTime );
+ return nStepTime;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setStepTime( ::sal_Int32 i_stepTime ) throw (RuntimeException)
+ {
+ setPropertyValue( GetPropertyName( BASEPROPERTY_STEP_TIME ), makeAny( i_stepTime ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL AnimatedImagesControlModel::getAutoRepeat() throw (RuntimeException)
+ {
+ sal_Bool bAutoRepeat( sal_True );
+ OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_AUTO_REPEAT ) ) >>= bAutoRepeat );
+ return bAutoRepeat;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setAutoRepeat( ::sal_Bool i_autoRepeat ) throw (RuntimeException)
+ {
+ setPropertyValue( GetPropertyName( BASEPROPERTY_AUTO_REPEAT ), makeAny( i_autoRepeat ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int16 SAL_CALL AnimatedImagesControlModel::getScaleMode() throw (RuntimeException)
+ {
+ sal_Int16 nImageScaleMode( ImageScaleMode::Anisotropic );
+ OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ) ) >>= nImageScaleMode );
+ return nImageScaleMode;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::setScaleMode( ::sal_Int16 i_scaleMode ) throw (IllegalArgumentException, RuntimeException)
+ {
+ setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ), makeAny( i_scaleMode ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL AnimatedImagesControlModel::getImageSetCount( ) throw (RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ return m_pData->aImageSets.size();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL AnimatedImagesControlModel::getImageSet( ::sal_Int32 i_index ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this );
+
+ return m_pData->aImageSets[ i_index ];
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::insertImageSet( ::sal_Int32 i_index, const Sequence< ::rtl::OUString >& i_imageURLs ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::ClearableMutexGuard aGuard( GetMutex() );
+ // sanity checks
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this, true );
+
+ // actaul insertion
+ m_pData->aImageSets.insert( m_pData->aImageSets.begin() + i_index, i_imageURLs );
+
+ // listener notification
+ lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementInserted, i_index, i_imageURLs, *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::replaceImageSet( ::sal_Int32 i_index, const Sequence< ::rtl::OUString >& i_imageURLs ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::ClearableMutexGuard aGuard( GetMutex() );
+ // sanity checks
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this );
+
+ // actaul insertion
+ m_pData->aImageSets[ i_index ] = i_imageURLs;
+
+ // listener notification
+ lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementReplaced, i_index, i_imageURLs, *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::removeImageSet( ::sal_Int32 i_index ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::osl::ClearableMutexGuard aGuard( GetMutex() );
+ // sanity checks
+ if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
+ throw DisposedException();
+
+ lcl_checkIndex( *m_pData, i_index, *this );
+
+ // actual removal
+ ::std::vector< Sequence< ::rtl::OUString > >::iterator removalPos = m_pData->aImageSets.begin() + i_index;
+ Sequence< ::rtl::OUString > aRemovedElement( *removalPos );
+ m_pData->aImageSets.erase( removalPos );
+
+ // listener notification
+ lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementRemoved, i_index, aRemovedElement, *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::addContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ BrdcstHelper.addListener( XContainerListener::static_type(), i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL AnimatedImagesControlModel::removeContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ BrdcstHelper.removeListener( XContainerListener::static_type(), i_listener );
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
new file mode 100644
index 000000000000..58ca81f74541
--- /dev/null
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -0,0 +1,1811 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_toolkit.hxx"
+
+#include <toolkit/controls/controlmodelcontainerbase.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <vcl/wall.hxx>
+#include <vos/mutex.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <toolkit/controls/geometrycontrolmodel.hxx>
+#include <toolkit/controls/unocontrols.hxx>
+#include "toolkit/controls/formattedcontrol.hxx"
+#include "toolkit/controls/roadmapcontrol.hxx"
+#ifndef TOOLKIT_INC_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
+#include "toolkit/controls/tkscrollbar.hxx"
+#endif
+#include <toolkit/controls/stdtabcontroller.hxx>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/WindowAttribute.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <tools/list.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/processfactory.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <comphelper/types.hxx>
+
+#include <comphelper/componentcontext.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <toolkit/helper/tkresmgr.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/image.hxx>
+
+#include "tree/treecontrol.hxx"
+#include "grid/gridcontrol.hxx"
+#include <toolkit/controls/tabpagecontainer.hxx>
+
+#include <map>
+#include <algorithm>
+#include <functional>
+#include "tools/urlobj.hxx"
+#include "osl/file.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
+using namespace toolkit;
+
+#define PROPERTY_RESOURCERESOLVER ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ))
+
+//HELPER
+::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl );
+
+struct LanguageDependentProp
+{
+ const char* pPropName;
+ sal_Int32 nPropNameLength;
+};
+
+// ----------------------------------------------------------------------------
+namespace
+{
+ static const Sequence< ::rtl::OUString >& lcl_getLanguageDependentProperties()
+ {
+ static Sequence< ::rtl::OUString > s_aLanguageDependentProperties;
+ if ( s_aLanguageDependentProperties.getLength() == 0 )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( s_aLanguageDependentProperties.getLength() == 0 )
+ {
+ s_aLanguageDependentProperties.realloc( 2 );
+ s_aLanguageDependentProperties[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
+ s_aLanguageDependentProperties[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
+ // note: properties must be sorted
+ }
+ }
+ return s_aLanguageDependentProperties;
+ }
+}
+
+// ----------------------------------------------------------------------------
+// functor for disposing a control model
+struct DisposeControlModel : public ::std::unary_function< Reference< XControlModel >, void >
+{
+ void operator()( Reference< XControlModel >& _rxModel )
+ {
+ try
+ {
+ ::comphelper::disposeComponent( _rxModel );
+ }
+ catch( const Exception& )
+ {
+ DBG_ERROR( "DisposeControlModel::(): caught an exception while disposing a component!" );
+ }
+ }
+};
+
+// ----------------------------------------------------------------------------
+// functor for searching control model by name
+struct FindControlModel : public ::std::unary_function< ControlModelContainerBase::UnoControlModelHolder, bool >
+{
+private:
+ const ::rtl::OUString& m_rName;
+
+public:
+ FindControlModel( const ::rtl::OUString& _rName ) : m_rName( _rName ) { }
+
+ bool operator()( const ControlModelContainerBase::UnoControlModelHolder& _rCompare )
+ {
+ return ( _rCompare.second == m_rName ) ? true : false;
+ }
+};
+
+// ----------------------------------------------------------------------------
+// functor for cloning a control model, and insertion into a target list
+struct CloneControlModel : public ::std::unary_function< ControlModelContainerBase::UnoControlModelHolder, void >
+{
+private:
+ ControlModelContainerBase::UnoControlModelHolderList& m_rTargetList;
+
+public:
+ CloneControlModel( ControlModelContainerBase::UnoControlModelHolderList& _rTargetList )
+ :m_rTargetList( _rTargetList )
+ {
+ }
+
+ void operator()( const ControlModelContainerBase::UnoControlModelHolder& _rSource )
+ {
+ // clone the source object
+ Reference< XCloneable > xCloneSource( _rSource.first, UNO_QUERY );
+ Reference< XControlModel > xClone( xCloneSource->createClone(), UNO_QUERY );
+ // add to target list
+ m_rTargetList.push_back( ControlModelContainerBase::UnoControlModelHolder( xClone, _rSource.second ) );
+ }
+};
+
+// ----------------------------------------------------------------------------
+// functor for comparing a XControlModel with a given reference
+struct CompareControlModel : public ::std::unary_function< ControlModelContainerBase::UnoControlModelHolder, bool >
+{
+private:
+ Reference< XControlModel > m_xReference;
+public:
+ CompareControlModel( const Reference< XControlModel >& _rxReference ) : m_xReference( _rxReference ) { }
+
+ bool operator()( const ControlModelContainerBase::UnoControlModelHolder& _rCompare )
+ {
+ return ( _rCompare.first.get() == m_xReference.get() ) ? true : false;
+ }
+};
+
+// ----------------------------------------------------------------------------
+static void lcl_throwIllegalArgumentException( )
+{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
+ throw IllegalArgumentException();
+}
+
+// ----------------------------------------------------------------------------
+static void lcl_throwNoSuchElementException( )
+{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
+ throw NoSuchElementException();
+}
+
+// ----------------------------------------------------------------------------
+static void lcl_throwElementExistException( )
+{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
+ throw ElementExistException();
+}
+
+// ----------------------------------------------------------------------------
+static const ::rtl::OUString& getTabIndexPropertyName( )
+{
+ static const ::rtl::OUString s_sTabIndexProperty( RTL_CONSTASCII_USTRINGPARAM( "TabIndex" ) );
+ return s_sTabIndexProperty;
+}
+
+// ----------------------------------------------------------------------------
+static const ::rtl::OUString& getStepPropertyName( )
+{
+ static const ::rtl::OUString s_sStepProperty( RTL_CONSTASCII_USTRINGPARAM( "Step" ) );
+ return s_sStepProperty;
+}
+
+// ----------------------------------------------------
+// class ControlModelContainerBase
+// ----------------------------------------------------
+ControlModelContainerBase::ControlModelContainerBase()
+ :maContainerListeners( *this )
+ ,maChangeListeners ( GetMutex() )
+ ,mbGroupsUpToDate( sal_False )
+{
+}
+
+ControlModelContainerBase::ControlModelContainerBase( const ControlModelContainerBase& rModel )
+ : ControlModelContainer_IBase( rModel )
+ , maContainerListeners( *this )
+ , maChangeListeners ( GetMutex() )
+ , mbGroupsUpToDate( sal_False )
+{
+}
+
+ControlModelContainerBase::~ControlModelContainerBase()
+{
+ maModels.clear();
+ mbGroupsUpToDate = sal_False;
+}
+
+Any ControlModelContainerBase::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ Any aAny;
+
+ switch ( nPropId )
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlDialog );
+ break;
+ default:
+ aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
+ }
+
+ return aAny;
+}
+
+::cppu::IPropertyArrayHelper& ControlModelContainerBase::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+
+void SAL_CALL ControlModelContainerBase::dispose( ) throw(RuntimeException)
+{
+ // ====================================================================
+ // tell our listeners
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ EventObject aDisposeEvent;
+ aDisposeEvent.Source = static_cast< XAggregation* >( static_cast< ::cppu::OWeakAggObject* >( this ) );
+
+ maContainerListeners.disposeAndClear( aDisposeEvent );
+ maChangeListeners.disposeAndClear( aDisposeEvent );
+ }
+
+ // ====================================================================
+ // call the base class
+ UnoControlModel::dispose();
+
+ // ====================================================================
+ // dispose our child models
+ // for this, collect the models (we collect them from maModels, and this is modified when disposing children)
+ ::std::vector< Reference< XControlModel > > aChildModels( maModels.size() );
+
+ ::std::transform(
+ maModels.begin(), maModels.end(), // source range
+ aChildModels.begin(), // target location
+ ::std::select1st< UnoControlModelHolder >( ) // operation to apply -> select the XControlModel part
+ );
+
+ // now dispose
+ ::std::for_each( aChildModels.begin(), aChildModels.end(), DisposeControlModel() );
+ aChildModels.clear();
+
+ mbGroupsUpToDate = sal_False;
+}
+
+// XMultiPropertySet
+Reference< XPropertySetInfo > ControlModelContainerBase::getPropertySetInfo( ) throw(RuntimeException)
+{
+ static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+
+UnoControlModel* ControlModelContainerBase::Clone() const
+{
+ // clone the container itself
+ ControlModelContainerBase* pClone = new ControlModelContainerBase( *this );
+
+ // clone all children
+ ::std::for_each(
+ maModels.begin(), maModels.end(),
+ CloneControlModel( pClone->maModels )
+ );
+
+ return pClone;
+}
+
+ControlModelContainerBase::UnoControlModelHolderList::iterator ControlModelContainerBase::ImplFindElement( const ::rtl::OUString& rName )
+{
+ return ::std::find_if( maModels.begin(), maModels.end(), FindControlModel( rName ) );
+}
+
+// ::XMultiServiceFactory
+Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(Exception, RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ OGeometryControlModel_Base* pNewModel = NULL;
+
+ if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlEditModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlEditModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFormattedFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFileControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFileControlModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlButtonModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlButtonModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlImageControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlImageControlModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRadioButtonModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCheckBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedHyperlinkModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedTextModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlGroupBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlListBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlListBoxModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlComboBoxModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlDateFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlTimeFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlNumericFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCurrencyFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlPatternFieldModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlProgressBarModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlScrollBarModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFixedLineModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRoadmapModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_TreeControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoTreeModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_GridControlModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoGridModel >;
+ else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageContainerModel ) == 0 )
+ pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >;
+
+ if ( !pNewModel )
+ {
+ Reference< XMultiServiceFactory > xORB( ::comphelper::getProcessServiceFactory() );
+ if ( xORB.is() )
+ {
+ Reference< XInterface > xObject = xORB->createInstance( aServiceSpecifier );
+ Reference< XServiceInfo > xSI( xObject, UNO_QUERY );
+ Reference< XCloneable > xCloneAccess( xSI, UNO_QUERY );
+ Reference< XAggregation > xAgg( xCloneAccess, UNO_QUERY );
+ if ( xAgg.is() )
+ {
+ if ( xSI->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.awt.UnoControlModel" ) ) )
+ {
+ // release 3 of the 4 references we have to the object
+ xAgg.clear();
+ xSI.clear();
+ xObject.clear();
+
+ pNewModel = new OCommonGeometryControlModel( xCloneAccess, aServiceSpecifier );
+ }
+ }
+ }
+ }
+
+ Reference< XInterface > xNewModel = (::cppu::OWeakObject*)pNewModel;
+ return xNewModel;
+}
+
+Reference< XInterface > ControlModelContainerBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& /* Arguments */ ) throw(Exception, RuntimeException)
+{
+ return createInstance( ServiceSpecifier );
+}
+
+Sequence< ::rtl::OUString > ControlModelContainerBase::getAvailableServiceNames() throw(RuntimeException)
+{
+ static Sequence< ::rtl::OUString >* pNamesSeq = NULL;
+ if ( !pNamesSeq )
+ {
+ pNamesSeq = new Sequence< ::rtl::OUString >( 23 );
+ ::rtl::OUString* pNames = pNamesSeq->getArray();
+ pNames[0] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlEditModel );
+ pNames[1] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFormattedFieldModel );
+ pNames[2] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFileControlModel );
+ pNames[3] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlButtonModel );
+ pNames[4] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlImageControlModel );
+ pNames[5] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel );
+ pNames[6] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCheckBoxModel );
+ pNames[7] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedTextModel );
+ pNames[8] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlGroupBoxModel );
+ pNames[9] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlListBoxModel );
+ pNames[10] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlComboBoxModel );
+ pNames[11] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlDateFieldModel );
+ pNames[12] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlTimeFieldModel );
+ pNames[13] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlNumericFieldModel );
+ pNames[14] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCurrencyFieldModel );
+ pNames[15] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlPatternFieldModel );
+ pNames[16] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlProgressBarModel );
+ pNames[17] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlScrollBarModel );
+ pNames[18] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedLineModel );
+ pNames[19] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRoadmapModel );
+ pNames[20] = ::rtl::OUString::createFromAscii( szServiceName_TreeControlModel );
+ pNames[21] = ::rtl::OUString::createFromAscii( szServiceName_GridControlModel );
+ pNames[22] = ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainerModel );
+
+ }
+ return *pNamesSeq;
+}
+
+// XContainer
+void ControlModelContainerBase::addContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.addInterface( l );
+}
+
+void ControlModelContainerBase::removeContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.removeInterface( l );
+}
+
+// XElementAcces
+Type ControlModelContainerBase::getElementType() throw(RuntimeException)
+{
+ Type aType = getCppuType( ( Reference< XControlModel>* ) NULL );
+ return aType;
+}
+
+sal_Bool ControlModelContainerBase::hasElements() throw(RuntimeException)
+{
+ return !maModels.empty();
+}
+
+// XNameContainer, XNameReplace, XNameAccess
+void ControlModelContainerBase::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ Reference< XControlModel > xNewModel;
+ aElement >>= xNewModel;
+ if ( !xNewModel.is() )
+ lcl_throwIllegalArgumentException();
+
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() == aElementPos )
+ lcl_throwNoSuchElementException();
+
+ // stop listening at the old model
+ stopControlListening( aElementPos->first );
+ Reference< XControlModel > xReplaced( aElementPos->first );
+ // remember the new model, and start listening
+ aElementPos->first = xNewModel;
+ startControlListening( xNewModel );
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element = aElement;
+ aEvent.ReplacedElement <<= xReplaced;
+ aEvent.Accessor <<= aName;
+
+ // notify the container listener
+ maContainerListeners.elementReplaced( aEvent );
+
+ // our "tab controller model" has potentially changed -> notify this
+ implNotifyTabModelChange( aName );
+}
+
+Any ControlModelContainerBase::getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() == aElementPos )
+ lcl_throwNoSuchElementException();
+
+ return makeAny( aElementPos->first );
+}
+
+Sequence< ::rtl::OUString > ControlModelContainerBase::getElementNames() throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aNames( maModels.size() );
+
+ ::std::transform(
+ maModels.begin(), maModels.end(), // source range
+ aNames.getArray(), // target range
+ ::std::select2nd< UnoControlModelHolder >() // operator to apply: select the second element (the name)
+ );
+
+ return aNames;
+}
+
+sal_Bool ControlModelContainerBase::hasByName( const ::rtl::OUString& aName ) throw(RuntimeException)
+{
+ return maModels.end() != ImplFindElement( aName );
+}
+
+void ControlModelContainerBase::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ Reference< XControlModel > xM;
+ aElement >>= xM;
+
+ if ( xM.is() )
+ {
+ Reference< beans::XPropertySet > xProps( xM, UNO_QUERY );
+ if ( xProps.is() )
+ {
+
+ Reference< beans::XPropertySetInfo > xPropInfo = xProps.get()->getPropertySetInfo();
+
+ ::rtl::OUString sImageSourceProperty = GetPropertyName( BASEPROPERTY_IMAGEURL );
+ if ( xPropInfo.get()->hasPropertyByName( sImageSourceProperty ) && ImplHasProperty(BASEPROPERTY_DIALOGSOURCEURL) )
+ {
+ Any aUrl = xProps.get()->getPropertyValue( sImageSourceProperty );
+
+ ::rtl::OUString absoluteUrl =
+ getPhysicalLocation( getPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL ) ), aUrl );
+
+ aUrl <<= absoluteUrl;
+
+ xProps.get()->setPropertyValue( sImageSourceProperty , aUrl );
+ }
+ }
+ }
+
+
+
+ if ( !aName.getLength() || !xM.is() )
+ lcl_throwIllegalArgumentException();
+
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() != aElementPos )
+ lcl_throwElementExistException();
+
+ maModels.push_back( UnoControlModelHolder( xM, aName ) );
+ mbGroupsUpToDate = sal_False;
+ startControlListening( xM );
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element <<= aElement;
+ aEvent.Accessor <<= aName;
+ maContainerListeners.elementInserted( aEvent );
+
+ // our "tab controller model" has potentially changed -> notify this
+ implNotifyTabModelChange( aName );
+}
+
+void ControlModelContainerBase::removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
+ if ( maModels.end() == aElementPos )
+ lcl_throwNoSuchElementException();
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element <<= aElementPos->first;
+ aEvent.Accessor <<= aName;
+ maContainerListeners.elementRemoved( aEvent );
+
+ stopControlListening( aElementPos->first );
+ Reference< XPropertySet > xPS( aElementPos->first, UNO_QUERY );
+ maModels.erase( aElementPos );
+ mbGroupsUpToDate = sal_False;
+
+ if ( xPS.is() )
+ try
+ {
+ xPS->setPropertyValue( PROPERTY_RESOURCERESOLVER, makeAny( Reference< resource::XStringResourceResolver >() ) );
+ }
+ catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); }
+
+ // our "tab controller model" has potentially changed -> notify this
+ implNotifyTabModelChange( aName );
+}
+
+// ----------------------------------------------------------------------------
+sal_Bool SAL_CALL ControlModelContainerBase::getGroupControl( ) throw (RuntimeException)
+{
+ return sal_True;
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::setGroupControl( sal_Bool ) throw (RuntimeException)
+{
+ DBG_ERROR( "UnoControlDialogModel::setGroupControl: explicit grouping not supported" );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::setControlModels( const Sequence< Reference< XControlModel > >& _rControls ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // set the tab indexes according to the order of models in the sequence
+ const Reference< XControlModel >* pControls = _rControls.getConstArray( );
+ const Reference< XControlModel >* pControlsEnd = _rControls.getConstArray( ) + _rControls.getLength();
+
+ sal_Int16 nTabIndex = 1;
+
+ for ( ; pControls != pControlsEnd; ++pControls )
+ {
+ // look up the control in our own structure. This is to prevent invalid arguments
+ UnoControlModelHolderList::const_iterator aPos =
+ ::std::find_if(
+ maModels.begin(), maModels.end(),
+ CompareControlModel( *pControls )
+ );
+ if ( maModels.end() != aPos )
+ {
+ // okay, this is an existent model
+ // now set the TabIndex property (if applicable)
+ Reference< XPropertySet > xProps( aPos->first, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xProps.is() )
+ xPSI = xProps->getPropertySetInfo();
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ xProps->setPropertyValue( getTabIndexPropertyName(), makeAny( nTabIndex++ ) );
+ }
+ mbGroupsUpToDate = sal_False;
+ }
+}
+
+
+typedef ::std::multimap< sal_Int32, Reference< XControlModel >, ::std::less< sal_Int32 > > MapIndexToModel;
+
+// ----------------------------------------------------------------------------
+Sequence< Reference< XControlModel > > SAL_CALL ControlModelContainerBase::getControlModels( ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ MapIndexToModel aSortedModels;
+ // will be the sorted container of all models which have a tab index property
+ ::std::vector< Reference< XControlModel > > aUnindexedModels;
+ // will be the container of all models which do not have a tab index property
+
+ UnoControlModelHolderList::const_iterator aLoop = maModels.begin();
+ for ( ; aLoop != maModels.end(); ++aLoop )
+ {
+ Reference< XControlModel > xModel( aLoop->first );
+
+ // see if the model has a TabIndex property
+ Reference< XPropertySet > xControlProps( xModel, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xControlProps.is() )
+ xPSI = xControlProps->getPropertySetInfo( );
+ DBG_ASSERT( xPSI.is(), "UnoControlDialogModel::getControlModels: invalid child model!" );
+
+ // has it?
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ { // yes
+ sal_Int32 nTabIndex = -1;
+ xControlProps->getPropertyValue( getTabIndexPropertyName() ) >>= nTabIndex;
+
+ aSortedModels.insert( MapIndexToModel::value_type( nTabIndex, xModel ) );
+ }
+ else if ( xModel.is() )
+ // no, it hasn't, but we have to include it, anyway
+ aUnindexedModels.push_back( xModel );
+ }
+
+ // okay, here we have a container of all our models, sorted by tab index,
+ // plus a container of "unindexed" models
+ // -> merge them
+ Sequence< Reference< XControlModel > > aReturn( aUnindexedModels.size() + aSortedModels.size() );
+ ::std::transform(
+ aSortedModels.begin(), aSortedModels.end(),
+ ::std::copy( aUnindexedModels.begin(), aUnindexedModels.end(), aReturn.getArray() ),
+ ::std::select2nd< MapIndexToModel::value_type >( )
+ );
+
+ return aReturn;
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::setGroup( const Sequence< Reference< XControlModel > >&, const ::rtl::OUString& ) throw (RuntimeException)
+{
+ // not supported. We have only implicit grouping:
+ // We only have a sequence of control models, and we _know_ (yes, that's a HACK relying on
+ // implementation details) that VCL does grouping according to the order of controls automatically
+ // At least VCL does this for all we're interested in: Radio buttons.
+ DBG_ERROR( "UnoControlDialogModel::setGroup: grouping not supported" );
+}
+
+////----- XInitialization -------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::initialize (const Sequence<Any>& rArguments) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nPageId = -1;
+ if ( rArguments.getLength() == 1 )
+ {
+ if ( !( rArguments[ 0 ] >>= nPageId ))
+ throw lang::IllegalArgumentException();
+ m_nTabPageId = nPageId;
+ }
+ else
+ m_nTabPageId = -1;
+}
+::sal_Int16 SAL_CALL ControlModelContainerBase::getTabPageID() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_nTabPageId;
+}
+::sal_Bool SAL_CALL ControlModelContainerBase::getEnabled() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_bEnabled;
+}
+void SAL_CALL ControlModelContainerBase::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_bEnabled = _enabled;
+}
+::rtl::OUString SAL_CALL ControlModelContainerBase::getTitle() throw (::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference<XPropertySet> xThis(*this,UNO_QUERY);
+ ::rtl::OUString sTitle;
+ xThis->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE)) >>= sTitle;
+ return sTitle;
+ //return m_sTitle;
+}
+void SAL_CALL ControlModelContainerBase::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference<XPropertySet> xThis(*this,UNO_QUERY);
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),makeAny(_title));
+}
+::rtl::OUString SAL_CALL ControlModelContainerBase::getImageURL() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_sImageURL;
+}
+void SAL_CALL ControlModelContainerBase::setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_sImageURL = _imageurl;
+}
+::rtl::OUString SAL_CALL ControlModelContainerBase::getTooltip() throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_sTooltip;
+}
+void SAL_CALL ControlModelContainerBase::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException)
+{
+ m_sTooltip = _tooltip;
+}
+
+// ----------------------------------------------------------------------------
+namespace
+{
+ enum GroupingMachineState
+ {
+ eLookingForGroup,
+ eExpandingGroup
+ };
+
+ // ........................................................................
+ static sal_Int32 lcl_getDialogStep( const Reference< XControlModel >& _rxModel )
+ {
+ sal_Int32 nStep = 0;
+ try
+ {
+ Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY );
+ xModelProps->getPropertyValue( getStepPropertyName() ) >>= nStep;
+ }
+ catch( const Exception& )
+ {
+ DBG_ERROR( "lcl_getDialogStep: caught an exception while determining the dialog page!" );
+ }
+ return nStep;
+ }
+}
+
+// ----------------------------------------------------------------------------
+sal_Int32 SAL_CALL ControlModelContainerBase::getGroupCount( ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ implUpdateGroupStructure();
+
+ return maGroups.size();
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::getGroup( sal_Int32 _nGroup, Sequence< Reference< XControlModel > >& _rGroup, ::rtl::OUString& _rName ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ implUpdateGroupStructure();
+
+ if ( ( _nGroup < 0 ) || ( _nGroup >= (sal_Int32)maGroups.size() ) )
+ {
+ DBG_ERROR( "UnoControlDialogModel::getGroup: invalid argument and I am not allowed to throw an exception!" );
+ _rGroup.realloc( 0 );
+ _rName = ::rtl::OUString();
+ }
+ else
+ {
+ AllGroups::const_iterator aGroupPos = maGroups.begin() + _nGroup;
+ _rGroup.realloc( aGroupPos->size() );
+ // copy the models
+ ::std::copy( aGroupPos->begin(), aGroupPos->end(), _rGroup.getArray() );
+ // give the group a name
+ _rName = ::rtl::OUString::valueOf( _nGroup );
+ }
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::getGroupByName( const ::rtl::OUString& _rName, Sequence< Reference< XControlModel > >& _rGroup ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::rtl::OUString sDummyName;
+ getGroup( _rName.toInt32( ), _rGroup, sDummyName );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::addChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
+{
+ maChangeListeners.addInterface( _rxListener );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::removeChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
+{
+ maChangeListeners.removeInterface( _rxListener );
+}
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::implNotifyTabModelChange( const ::rtl::OUString& _rAccessor )
+{
+ // multiplex to our change listeners:
+ // the changes event
+ ChangesEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Base <<= aEvent.Source; // the "base of the changes root" is also ourself
+ aEvent.Changes.realloc( 1 ); // exactly one change
+ aEvent.Changes[ 0 ].Accessor <<= _rAccessor;
+
+
+ Sequence< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() );
+ const Reference< XInterface >* pListener = aChangeListeners.getConstArray();
+ const Reference< XInterface >* pListenerEnd = aChangeListeners.getConstArray() + aChangeListeners.getLength();
+ for ( ; pListener != pListenerEnd; ++pListener )
+ {
+ if ( pListener->is() )
+ static_cast< XChangesListener* >( pListener->get() )->changesOccurred( aEvent );
+ }
+}
+
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::implUpdateGroupStructure()
+{
+ if ( mbGroupsUpToDate )
+ // nothing to do
+ return;
+
+ // conditions for a group:
+ // * all elements of the group are radio buttons
+ // * all elements of the group are on the same dialog page
+ // * in the overall control order (determined by the tab index), all elements are subsequent
+
+ maGroups.clear();
+
+ Sequence< Reference< XControlModel > > aControlModels = getControlModels();
+ const Reference< XControlModel >* pControlModels = aControlModels.getConstArray();
+ const Reference< XControlModel >* pControlModelsEnd = pControlModels + aControlModels.getLength();
+
+ // in extreme we have as much groups as controls
+ maGroups.reserve( aControlModels.getLength() );
+
+ GroupingMachineState eState = eLookingForGroup; // the current state of our machine
+ Reference< XServiceInfo > xModelSI; // for checking for a radion button
+ AllGroups::iterator aCurrentGroup = maGroups.end(); // the group which we're currently building
+ sal_Int32 nCurrentGroupStep = -1; // the step which all controls of the current group belong to
+ sal_Bool bIsRadioButton; // is it a radio button?
+
+#if OSL_DEBUG_LEVEL > 1
+ ::std::vector< ::rtl::OUString > aCurrentGroupLabels;
+#endif
+
+ for ( ; pControlModels != pControlModelsEnd; ++pControlModels )
+ {
+ // we'll need this in every state
+ xModelSI = xModelSI.query( *pControlModels );
+ bIsRadioButton = xModelSI.is() && xModelSI->supportsService( ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel ) );
+
+ switch ( eState )
+ {
+ case eLookingForGroup:
+ {
+ if ( !bIsRadioButton )
+ // this is no radio button -> still looking for the beginning of a group
+ continue;
+ // the current model is a radio button
+ // -> we found the beginning of a new group
+ // create the place for this group
+ size_t nGroups = maGroups.size();
+ maGroups.resize( nGroups + 1 );
+ aCurrentGroup = maGroups.begin() + nGroups;
+ // and add the (only, til now) member
+ aCurrentGroup->push_back( *pControlModels );
+
+ // get the step which all controls of this group now have to belong to
+ nCurrentGroupStep = lcl_getDialogStep( *pControlModels );
+ // new state: looking for further members
+ eState = eExpandingGroup;
+
+#if OSL_DEBUG_LEVEL > 1
+ Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
+ ::rtl::OUString sLabel;
+ if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
+ xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
+ aCurrentGroupLabels.push_back( sLabel );
+#endif
+ }
+ break;
+
+ case eExpandingGroup:
+ {
+ if ( !bIsRadioButton )
+ { // no radio button -> the group is done
+ aCurrentGroup = maGroups.end();
+ eState = eLookingForGroup;
+#if OSL_DEBUG_LEVEL > 1
+ aCurrentGroupLabels.clear();
+#endif
+ continue;
+ }
+
+ // it is a radio button - is it on the proper page?
+ const sal_Int32 nThisModelStep = lcl_getDialogStep( *pControlModels );
+ if ( ( nThisModelStep == nCurrentGroupStep ) // the current button is on the same dialog page
+ || ( 0 == nThisModelStep ) // the current button appears on all pages
+ )
+ {
+ // -> it belongs to the same group
+ aCurrentGroup->push_back( *pControlModels );
+ // state still is eExpandingGroup - we're looking for further elements
+ eState = eExpandingGroup;
+
+#if OSL_DEBUG_LEVEL > 1
+ Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
+ ::rtl::OUString sLabel;
+ if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
+ xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
+ aCurrentGroupLabels.push_back( sLabel );
+#endif
+ continue;
+ }
+
+ // it's a radio button, but on a different page
+ // -> we open a new group for it
+
+ // close the old group
+ aCurrentGroup = maGroups.end();
+#if OSL_DEBUG_LEVEL > 1
+ aCurrentGroupLabels.clear();
+#endif
+
+ // open a new group
+ size_t nGroups = maGroups.size();
+ maGroups.resize( nGroups + 1 );
+ aCurrentGroup = maGroups.begin() + nGroups;
+ // and add the (only, til now) member
+ aCurrentGroup->push_back( *pControlModels );
+
+ nCurrentGroupStep = nThisModelStep;
+
+ // state is the same: we still are looking for further elements of the current group
+ eState = eExpandingGroup;
+#if OSL_DEBUG_LEVEL > 1
+ Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
+ ::rtl::OUString sLabel;
+ if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
+ xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
+ aCurrentGroupLabels.push_back( sLabel );
+#endif
+ }
+ break;
+ }
+ }
+
+ mbGroupsUpToDate = sal_True;
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ DBG_ASSERT( 0 == _rEvent.PropertyName.compareToAscii( "TabIndex" ),
+ "UnoControlDialogModel::propertyChange: not listening for this property!" );
+
+ // the accessor for the changed element
+ ::rtl::OUString sAccessor;
+ UnoControlModelHolderList::const_iterator aPos =
+ ::std::find_if(
+ maModels.begin(), maModels.end(),
+ CompareControlModel( Reference< XControlModel >( _rEvent.Source, UNO_QUERY ) )
+ );
+ OSL_ENSURE( maModels.end() != aPos, "UnoControlDialogModel::propertyChange: don't know this model!" );
+ if ( maModels.end() != aPos )
+ sAccessor = aPos->second;
+
+ // our groups are not up-to-date
+ mbGroupsUpToDate = sal_False;
+
+ // notify
+ implNotifyTabModelChange( sAccessor );
+}
+
+// ----------------------------------------------------------------------------
+void SAL_CALL ControlModelContainerBase::disposing( const EventObject& /*rEvent*/ ) throw (RuntimeException)
+{
+}
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::startControlListening( const Reference< XControlModel >& _rxChildModel )
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xModelProps.is() )
+ xPSI = xModelProps->getPropertySetInfo();
+
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ xModelProps->addPropertyChangeListener( getTabIndexPropertyName(), this );
+}
+
+// ----------------------------------------------------------------------------
+void ControlModelContainerBase::stopControlListening( const Reference< XControlModel >& _rxChildModel )
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xModelProps.is() )
+ xPSI = xModelProps->getPropertySetInfo();
+
+ if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
+ xModelProps->removePropertyChangeListener( getTabIndexPropertyName(), this );
+}
+
+// ============================================================================
+// = class ResourceListener
+// ============================================================================
+
+ResourceListener::ResourceListener(
+ const Reference< util::XModifyListener >& rListener ) :
+ OWeakObject(),
+ m_xListener( rListener ),
+ m_bListening( false )
+{
+}
+
+ResourceListener::~ResourceListener()
+{
+}
+
+// XInterface
+Any SAL_CALL ResourceListener::queryInterface( const Type& rType )
+throw ( RuntimeException )
+{
+ Any a = ::cppu::queryInterface(
+ rType ,
+ static_cast< XModifyListener* >( this ),
+ static_cast< XEventListener* >( this ));
+
+ if ( a.hasValue() )
+ return a;
+
+ return OWeakObject::queryInterface( rType );
+}
+
+void SAL_CALL ResourceListener::acquire() throw ()
+{
+ OWeakObject::acquire();
+}
+
+void SAL_CALL ResourceListener::release() throw ()
+{
+ OWeakObject::release();
+}
+
+void ResourceListener::startListening(
+ const Reference< resource::XStringResourceResolver >& rResource )
+{
+ Reference< util::XModifyBroadcaster > xModifyBroadcaster( rResource, UNO_QUERY );
+
+ {
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ bool bListening( m_bListening );
+ bool bResourceSet( m_xResource.is() );
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( bListening && bResourceSet )
+ stopListening();
+
+ // --- SAFE ---
+ aGuard.reset();
+ m_xResource = rResource;
+ aGuard.clear();
+ // --- SAFE ---
+ }
+
+ Reference< util::XModifyListener > xThis( static_cast<OWeakObject*>( this ), UNO_QUERY );
+ if ( xModifyBroadcaster.is() )
+ {
+ try
+ {
+ xModifyBroadcaster->addModifyListener( xThis );
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ m_bListening = true;
+ // --- SAFE ---
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+}
+
+void ResourceListener::stopListening()
+{
+ Reference< util::XModifyBroadcaster > xModifyBroadcaster;
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ if ( m_bListening && m_xResource.is() )
+ xModifyBroadcaster = Reference< util::XModifyBroadcaster >( m_xResource, UNO_QUERY );
+ aGuard.clear();
+ // --- SAFE ---
+
+ Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ if ( xModifyBroadcaster.is() )
+ {
+ try
+ {
+ // --- SAFE ---
+ aGuard.reset();
+ m_bListening = false;
+ m_xResource.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ xModifyBroadcaster->removeModifyListener( xThis );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+}
+
+// XModifyListener
+void SAL_CALL ResourceListener::modified(
+ const lang::EventObject& aEvent )
+throw ( RuntimeException )
+{
+ Reference< util::XModifyListener > xListener;
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ xListener = m_xListener;
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( xListener.is() )
+ {
+ try
+ {
+ xListener->modified( aEvent );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+}
+
+// XEventListener
+void SAL_CALL ResourceListener::disposing(
+ const EventObject& Source )
+throw ( RuntimeException )
+{
+ Reference< lang::XEventListener > xListener;
+ Reference< resource::XStringResourceResolver > xResource;
+
+ // --- SAFE ---
+ ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ Reference< XInterface > xIfacRes( m_xResource, UNO_QUERY );
+ Reference< XInterface > xIfacList( m_xListener, UNO_QUERY );
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( Source.Source == xIfacRes )
+ {
+ // --- SAFE ---
+ aGuard.reset();
+ m_bListening = false;
+ xResource = m_xResource;
+ xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
+ m_xResource.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( xListener.is() )
+ {
+ try
+ {
+ xListener->disposing( Source );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+ }
+ else if ( Source.Source == xIfacList )
+ {
+ // --- SAFE ---
+ aGuard.reset();
+ m_bListening = false;
+ xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
+ xResource = m_xResource;
+ m_xResource.clear();
+ m_xListener.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ // Remove ourself as listener from resource resolver
+ Reference< util::XModifyBroadcaster > xModifyBroadcaster( xResource, UNO_QUERY );
+ Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
+ if ( xModifyBroadcaster.is() )
+ {
+ try
+ {
+ xModifyBroadcaster->removeModifyListener( xThis );
+ }
+ catch ( RuntimeException& )
+ {
+ throw;
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+ }
+}
+
+//===============================================================
+// ----------------------------------------------------
+// class DialogContainerControl
+// ----------------------------------------------------
+ControlContainerBase::ControlContainerBase() :
+ mbSizeModified(false),
+ mbPosModified(false)
+{
+ maComponentInfos.nWidth = 280;
+ maComponentInfos.nHeight = 400;
+ mxListener = new ResourceListener( Reference< util::XModifyListener >(
+ static_cast< OWeakObject* >( this ), UNO_QUERY ));
+}
+
+ControlContainerBase::~ControlContainerBase()
+{
+}
+
+void ControlContainerBase::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ UnoControlContainer::createPeer( rxToolkit, rParentPeer );
+}
+
+void ControlContainerBase::ImplInsertControl( Reference< XControlModel >& rxModel, const ::rtl::OUString& rName )
+{
+ Reference< XPropertySet > xP( rxModel, UNO_QUERY );
+
+ ::rtl::OUString aDefCtrl;
+ xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl;
+ Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ Reference < XControl > xCtrl( xMSF->createInstance( aDefCtrl ), UNO_QUERY );
+
+ DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" );
+ if ( xCtrl.is() )
+ {
+ xCtrl->setModel( rxModel );
+ addControl( rName, xCtrl );
+ // will implicitly call addingControl, where we can add the PropertiesChangeListener to the model
+ // (which we formerly did herein)
+ // 08.01.2001 - 96008 - fs@openoffice.org
+
+ ImplSetPosSize( xCtrl );
+ }
+}
+
+void ControlContainerBase::ImplRemoveControl( Reference< XControlModel >& rxModel )
+{
+ Sequence< Reference< XControl > > aControls = getControls();
+ Reference< XControl > xCtrl = StdTabController::FindControl( aControls, rxModel );
+ if ( xCtrl.is() )
+ removeControl( xCtrl );
+}
+
+void ControlContainerBase::ImplSetPosSize( Reference< XControl >& rxCtrl )
+{
+ Reference< XPropertySet > xP( rxCtrl->getModel(), UNO_QUERY );
+
+ sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ) ) >>= nX;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ) ) >>= nY;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nWidth;
+ xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nHeight;
+ MapMode aMode( MAP_APPFONT );
+ OutputDevice*pOutDev = Application::GetDefaultDevice();
+ if ( pOutDev )
+ {
+ ::Size aTmp( nX, nY );
+ aTmp = pOutDev->LogicToPixel( aTmp, aMode );
+ nX = aTmp.Width();
+ nY = aTmp.Height();
+ aTmp = ::Size( nWidth, nHeight );
+ aTmp = pOutDev->LogicToPixel( aTmp, aMode );
+ nWidth = aTmp.Width();
+ nHeight = aTmp.Height();
+ }
+ else
+ {
+ Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True );
+ Reference< XDevice > xD( xPeer, UNO_QUERY );
+
+ SimpleFontMetric aFM;
+ FontDescriptor aFD;
+ Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
+ aVal >>= aFD;
+ if ( aFD.StyleName.getLength() )
+ {
+ Reference< XFont > xFont = xD->getFont( aFD );
+ aFM = xFont->getFontMetric();
+ }
+ else
+ {
+ Reference< XGraphics > xG = xD->createGraphics();
+ aFM = xG->getFontMetric();
+ }
+
+ sal_Int16 nH = aFM.Ascent + aFM.Descent;
+ sal_Int16 nW = nH/2; // calculate avarage width?!
+
+ nX *= nW;
+ nX /= 4;
+ nWidth *= nW;
+ nWidth /= 4;
+ nY *= nH;
+ nY /= 8;
+ nHeight *= nH;
+ nHeight /= 8;
+ }
+ Reference < XWindow > xW( rxCtrl, UNO_QUERY );
+ xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
+}
+
+void ControlContainerBase::dispose() throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ EventObject aEvt;
+ aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
+ // Notify our listener helper about dispose
+ // --- SAFE ---
+ ::osl::ResettableGuard< ::osl::Mutex > aGuard( GetMutex() );
+ Reference< XEventListener > xListener( mxListener, UNO_QUERY );
+ mxListener.clear();
+ aGuard.clear();
+ // --- SAFE ---
+
+ if ( xListener.is() )
+ xListener->disposing( aEvt );
+ UnoControlContainer::dispose();
+}
+
+void SAL_CALL ControlContainerBase::disposing(
+ const EventObject& Source )
+throw(RuntimeException)
+{
+ UnoControlContainer::disposing( Source );
+}
+
+sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // destroy the old tab controller, if existent
+ if ( mxTabController.is() )
+ {
+ mxTabController->setModel( NULL ); // just to be sure, should not be necessary
+ removeTabController( mxTabController );
+ ::comphelper::disposeComponent( mxTabController ); // just to be sure, should not be necessary
+ mxTabController.clear();
+ }
+
+ if ( getModel().is() )
+ {
+ Sequence< Reference< XControl > > aControls = getControls();
+ const Reference< XControl >* pCtrls = aControls.getConstArray();
+ const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength();
+
+ for ( ; pCtrls < pCtrlsEnd; ++pCtrls )
+ removeControl( *pCtrls );
+ // will implicitly call removingControl, which will remove the PropertyChangeListener
+ // (which we formerly did herein)
+ // 08.01.2001 - 96008 - fs@openoffice.org
+
+ Reference< XContainer > xC( getModel(), UNO_QUERY );
+ if ( xC.is() )
+ xC->removeContainerListener( this );
+
+ Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
+ if ( xChangeNotifier.is() )
+ xChangeNotifier->removeChangesListener( this );
+ }
+
+ sal_Bool bRet = UnoControl::setModel( rxModel );
+
+ if ( getModel().is() )
+ {
+ Reference< XNameAccess > xNA( getModel(), UNO_QUERY );
+ if ( xNA.is() )
+ {
+ Sequence< ::rtl::OUString > aNames = xNA->getElementNames();
+ const ::rtl::OUString* pNames = aNames.getConstArray();
+ sal_uInt32 nCtrls = aNames.getLength();
+
+ Reference< XControlModel > xCtrlModel;
+ for( sal_uInt32 n = 0; n < nCtrls; ++n, ++pNames )
+ {
+ xNA->getByName( *pNames ) >>= xCtrlModel;
+ ImplInsertControl( xCtrlModel, *pNames );
+ }
+ }
+
+ Reference< XContainer > xC( getModel(), UNO_QUERY );
+ if ( xC.is() )
+ xC->addContainerListener( this );
+
+ Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
+ if ( xChangeNotifier.is() )
+ xChangeNotifier->addChangesListener( this );
+ }
+
+ Reference< XTabControllerModel > xTabbing( getModel(), UNO_QUERY );
+ if ( xTabbing.is() )
+ {
+ mxTabController = new StdTabController;
+ mxTabController->setModel( xTabbing );
+ addTabController( mxTabController );
+ }
+ ImplStartListingForResourceEvents();
+
+ return bRet;
+}
+void ControlContainerBase::setDesignMode( sal_Bool bOn ) throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ UnoControl::setDesignMode( bOn );
+
+ Sequence< Reference< XControl > > xCtrls = getControls();
+ sal_Int32 nControls = xCtrls.getLength();
+ Reference< XControl >* pControls = xCtrls.getArray();
+ for ( sal_Int32 n = 0; n < nControls; n++ )
+ pControls[n]->setDesignMode( bOn );
+
+ // #109067# in design mode the tab controller is not notified about
+ // tab index changes, therefore the tab order must be activated
+ // when switching from design mode to live mode
+ if ( mxTabController.is() && !bOn )
+ mxTabController->activateTabOrder();
+}
+
+void ControlContainerBase::elementInserted( const ContainerEvent& Event ) throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ Reference< XControlModel > xModel;
+ ::rtl::OUString aName;
+
+ Event.Accessor >>= aName;
+ Event.Element >>= xModel;
+ ImplInsertControl( xModel, aName );
+}
+
+void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ Reference< XControlModel > xModel;
+ Event.Element >>= xModel;
+ if ( xModel.is() )
+ ImplRemoveControl( xModel );
+}
+
+void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ Reference< XControlModel > xModel;
+ Event.ReplacedElement >>= xModel;
+ if ( xModel.is() )
+ ImplRemoveControl( xModel );
+
+ ::rtl::OUString aName;
+ Event.Accessor >>= aName;
+ Event.Element >>= xModel;
+ ImplInsertControl( xModel, aName );
+}
+
+// XPropertiesChangeListener
+void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
+{
+ if( !isDesignMode() && !mbCreatingCompatiblePeer )
+ {
+ ::rtl::OUString s1( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) );
+ ::rtl::OUString s2( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) );
+ ::rtl::OUString s3( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
+ ::rtl::OUString s4( RTL_CONSTASCII_USTRINGPARAM( "Height" ) );
+
+ sal_Int32 nLen = rEvents.getLength();
+ for( sal_Int32 i = 0; i < nLen; i++ )
+ {
+ const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
+ Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
+ sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
+ if ( ( rEvt.PropertyName == s1 ) ||
+ ( rEvt.PropertyName == s2 ) ||
+ ( rEvt.PropertyName == s3 ) ||
+ ( rEvt.PropertyName == s4 ) )
+ {
+ if ( bOwnModel )
+ {
+ if ( !mbPosModified && !mbSizeModified )
+ {
+ // Don't set new pos/size if we get new values from window listener
+ Reference< XControl > xThis( (XAggregation*)(::cppu::OWeakAggObject*)this, UNO_QUERY );
+ ImplSetPosSize( xThis );
+ }
+ }
+ else
+ {
+ Sequence<Reference<XControl> > aControlSequence(getControls());
+ Reference<XControl> aControlRef( StdTabController::FindControl( aControlSequence, xModel ) );
+ ImplSetPosSize( aControlRef );
+ }
+ break;
+ }
+ }
+ }
+
+ UnoControlContainer::ImplModelPropertiesChanged( rEvents );
+}
+
+void ControlContainerBase::addingControl( const Reference< XControl >& _rxControl )
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ UnoControlContainer::addingControl( _rxControl );
+
+ if ( _rxControl.is() )
+ {
+ Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
+ if ( xProps.is() )
+ {
+ Sequence< ::rtl::OUString > aNames( 4 );
+ ::rtl::OUString* pNames = aNames.getArray();
+ *pNames++ = ::rtl::OUString::createFromAscii( "PositionX" );
+ *pNames++ = ::rtl::OUString::createFromAscii( "PositionY" );
+ *pNames++ = ::rtl::OUString::createFromAscii( "Width" );
+ *pNames++ = ::rtl::OUString::createFromAscii( "Height" );
+
+ xProps->addPropertiesChangeListener( aNames, this );
+ }
+ }
+}
+
+void ControlContainerBase::removingControl( const Reference< XControl >& _rxControl )
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ UnoControlContainer::removingControl( _rxControl );
+
+ if ( _rxControl.is() )
+ {
+ Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
+ if ( xProps.is() )
+ xProps->removePropertiesChangeListener( this );
+ }
+
+}
+
+void SAL_CALL ControlContainerBase::changesOccurred( const ChangesEvent& ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ // a tab controller model may have changed
+
+ // #109067# in design mode don't notify the tab controller
+ // about tab index changes
+ if ( mxTabController.is() && !mbDesignMode )
+ mxTabController->activateTabOrder();
+}
+void lcl_ApplyResolverToNestedContainees( const Reference< resource::XStringResourceResolver >& xStringResourceResolver, const Reference< XControlContainer >& xContainer )
+{
+ rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
+
+ Any xNewStringResourceResolver; xNewStringResourceResolver <<= xStringResourceResolver;
+
+ Sequence< rtl::OUString > aPropNames(1);
+ aPropNames[0] = aPropName;
+
+ const Sequence< Reference< awt::XControl > > aSeq = xContainer->getControls();
+ for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
+ {
+ Reference< XControl > xControl( aSeq[i] );
+ Reference< XPropertySet > xPropertySet;
+
+ if ( xControl.is() )
+ xPropertySet = Reference< XPropertySet >( xControl->getModel(), UNO_QUERY );
+
+ if ( !xPropertySet.is() )
+ continue;
+
+ try
+ {
+ Reference< resource::XStringResourceResolver > xCurrStringResourceResolver;
+ Any aOldValue = xPropertySet->getPropertyValue( aPropName );
+ if ( ( aOldValue >>= xCurrStringResourceResolver )
+ && ( xStringResourceResolver == xCurrStringResourceResolver )
+ )
+ {
+ Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
+ Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
+ xMultiPropSet->firePropertiesChangeEvent( aPropNames, xListener );
+ }
+ else
+ xPropertySet->setPropertyValue( aPropName, xNewStringResourceResolver );
+ }
+ /*catch ( NoSuchElementException& )*/ // that's nonsense, this is never thrown above ...
+ catch ( const Exception& )
+ {
+ }
+
+ uno::Reference< XControlContainer > xNestedContainer( xControl, uno::UNO_QUERY );
+ if ( xNestedContainer.is() )
+ lcl_ApplyResolverToNestedContainees( xStringResourceResolver, xNestedContainer );
+
+ }
+
+}
+void ControlContainerBase::ImplStartListingForResourceEvents()
+{
+ Reference< resource::XStringResourceResolver > xStringResourceResolver;
+
+ ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver;
+
+ // Add our helper as listener to retrieve notifications about changes
+ Reference< util::XModifyListener > rListener( mxListener );
+ ResourceListener* pResourceListener = static_cast< ResourceListener* >( rListener.get() );
+
+ // resource listener will stop listening if resolver reference is empty
+ if ( pResourceListener )
+ pResourceListener->startListening( xStringResourceResolver );
+ ImplUpdateResourceResolver();
+}
+
+void ControlContainerBase::ImplUpdateResourceResolver()
+{
+ rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
+ Reference< resource::XStringResourceResolver > xStringResourceResolver;
+
+ ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
+ if ( !xStringResourceResolver.is() )
+ return;
+
+ lcl_ApplyResolverToNestedContainees( xStringResourceResolver, this );
+
+ // propagate resource resolver changes to language dependent props of the dialog
+ Reference< XPropertySet > xPropertySet( getModel(), UNO_QUERY );
+ if ( xPropertySet.is() )
+ {
+ Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
+ Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
+ xMultiPropSet->firePropertiesChangeEvent( lcl_getLanguageDependentProperties(), xListener );
+ }
+}
+
+
+uno::Reference< graphic::XGraphic > ControlContainerBase::Impl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
+{
+ uno::Reference< graphic::XGraphic > xGraphic;
+ if ( !_rURL.getLength() )
+ return xGraphic;
+
+ try
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ uno::Reference< graphic::XGraphicProvider > xProvider;
+ if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ {
+ uno::Sequence< beans::PropertyValue > aMediaProperties(1);
+ aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
+ aMediaProperties[0].Value <<= _rURL;
+ xGraphic = xProvider->queryGraphic( aMediaProperties );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return xGraphic;
+}
+//// ----------------------------------------------------
+//// Helper Method to convert relative url to physical location
+//// ----------------------------------------------------
+
+::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl )
+{
+
+ ::rtl::OUString baseLocation;
+ ::rtl::OUString url;
+
+ rbase >>= baseLocation;
+ rUrl >>= url;
+
+ ::rtl::OUString absoluteURL( url );
+ if ( url.getLength() > 0 )
+ {
+ INetURLObject urlObj(baseLocation);
+ urlObj.removeSegment();
+ baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
+
+ const INetURLObject protocolCheck( url );
+ const INetProtocol protocol = protocolCheck.GetProtocol();
+ if ( protocol == INET_PROT_NOT_VALID )
+ {
+ ::rtl::OUString testAbsoluteURL;
+ if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) )
+ absoluteURL = testAbsoluteURL;
+ }
+ }
+
+ return absoluteURL;
+}
+
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index ecb4d7765723..7a7f7444645b 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -35,17 +35,7 @@
#include <toolkit/controls/dialogcontrol.hxx>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
-#include <toolkit/controls/geometrycontrolmodel.hxx>
-#include <toolkit/controls/unocontrols.hxx>
-#include "toolkit/controls/formattedcontrol.hxx"
-#include "toolkit/controls/roadmapcontrol.hxx"
-#ifndef TOOLKIT_INC_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX
-#include "toolkit/controls/tkscrollbar.hxx"
-#endif
#include <toolkit/controls/stdtabcontroller.hxx>
-#include <toolkit/controls/tksimpleanimation.hxx>
-#include <toolkit/controls/tkthrobber.hxx>
-
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/resource/XStringResourceResolver.hpp>
@@ -54,20 +44,14 @@
#include <cppuhelper/typeprovider.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
-#include <comphelper/types.hxx>
-#include <comphelper/componentcontext.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <vcl/graph.hxx>
#include <vcl/image.hxx>
-
-#include "tree/treecontrol.hxx"
-#include "grid/gridcontrol.hxx"
-
#include <map>
#include <algorithm>
#include <functional>
@@ -81,180 +65,18 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
-using namespace toolkit;
-#define PROPERTY_RESOURCERESOLVER ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ))
#define PROPERTY_DIALOGSOURCEURL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogSourceURL" ))
#define PROPERTY_IMAGEURL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ImageURL" ))
#define PROPERTY_GRAPHIC ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ))
-
-//HELPER
+//
+////HELPER
::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl );
-struct LanguageDependentProp
-{
- const char* pPropName;
- sal_Int32 nPropNameLength;
-};
-
-// ----------------------------------------------------------------------------
-namespace
-{
- static const Sequence< ::rtl::OUString >& lcl_getLanguageDependentProperties()
- {
- static Sequence< ::rtl::OUString > s_aLanguageDependentProperties;
- if ( s_aLanguageDependentProperties.getLength() == 0 )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( s_aLanguageDependentProperties.getLength() == 0 )
- {
- s_aLanguageDependentProperties.realloc( 2 );
- s_aLanguageDependentProperties[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpText" ) );
- s_aLanguageDependentProperties[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
- // note: properties must be sorted
- }
- }
- return s_aLanguageDependentProperties;
- }
-
- static uno::Reference< graphic::XGraphic > lcl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
- {
- uno::Reference< graphic::XGraphic > xGraphic;
- if ( !_rURL.getLength() )
- return xGraphic;
-
- try
- {
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- uno::Reference< graphic::XGraphicProvider > xProvider;
- if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
- {
- uno::Sequence< beans::PropertyValue > aMediaProperties(1);
- aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
- aMediaProperties[0].Value <<= _rURL;
- xGraphic = xProvider->queryGraphic( aMediaProperties );
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
- return xGraphic;
- }
-
-}
-
-// ----------------------------------------------------------------------------
-// functor for disposing a control model
-struct DisposeControlModel : public ::std::unary_function< Reference< XControlModel >, void >
-{
- void operator()( Reference< XControlModel >& _rxModel )
- {
- try
- {
- ::comphelper::disposeComponent( _rxModel );
- }
- catch( const Exception& )
- {
- DBG_ERROR( "DisposeControlModel::(): caught an exception while disposing a component!" );
- }
- }
-};
-
-// ----------------------------------------------------------------------------
-// functor for searching control model by name
-struct FindControlModel : public ::std::unary_function< UnoControlDialogModel::UnoControlModelHolder, bool >
-{
-private:
- const ::rtl::OUString& m_rName;
-
-public:
- FindControlModel( const ::rtl::OUString& _rName ) : m_rName( _rName ) { }
-
- bool operator()( const UnoControlDialogModel::UnoControlModelHolder& _rCompare )
- {
- return ( _rCompare.second == m_rName ) ? true : false;
- }
-};
-
-// ----------------------------------------------------------------------------
-// functor for cloning a control model, and insertion into a target list
-struct CloneControlModel : public ::std::unary_function< UnoControlDialogModel::UnoControlModelHolder, void >
-{
-private:
- UnoControlDialogModel::UnoControlModelHolderList& m_rTargetList;
-
-public:
- CloneControlModel( UnoControlDialogModel::UnoControlModelHolderList& _rTargetList )
- :m_rTargetList( _rTargetList )
- {
- }
-
- void operator()( const UnoControlDialogModel::UnoControlModelHolder& _rSource )
- {
- // clone the source object
- Reference< XCloneable > xCloneSource( _rSource.first, UNO_QUERY );
- Reference< XControlModel > xClone( xCloneSource->createClone(), UNO_QUERY );
- // add to target list
- m_rTargetList.push_back( UnoControlDialogModel::UnoControlModelHolder( xClone, _rSource.second ) );
- }
-};
-
-// ----------------------------------------------------------------------------
-// functor for comparing a XControlModel with a given reference
-struct CompareControlModel : public ::std::unary_function< UnoControlDialogModel::UnoControlModelHolder, bool >
-{
-private:
- Reference< XControlModel > m_xReference;
-public:
- CompareControlModel( const Reference< XControlModel >& _rxReference ) : m_xReference( _rxReference ) { }
-
- bool operator()( const UnoControlDialogModel::UnoControlModelHolder& _rCompare )
- {
- return ( _rCompare.first.get() == m_xReference.get() ) ? true : false;
- }
-};
-
-// ----------------------------------------------------------------------------
-static void lcl_throwIllegalArgumentException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
- throw IllegalArgumentException();
-}
-
-// ----------------------------------------------------------------------------
-static void lcl_throwNoSuchElementException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
- throw NoSuchElementException();
-}
-
-// ----------------------------------------------------------------------------
-static void lcl_throwElementExistException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
- throw ElementExistException();
-}
-
-// ----------------------------------------------------------------------------
-static const ::rtl::OUString& getTabIndexPropertyName( )
-{
- static const ::rtl::OUString s_sTabIndexProperty( RTL_CONSTASCII_USTRINGPARAM( "TabIndex" ) );
- return s_sTabIndexProperty;
-}
-
-// ----------------------------------------------------------------------------
-static const ::rtl::OUString& getStepPropertyName( )
-{
- static const ::rtl::OUString s_sStepProperty( RTL_CONSTASCII_USTRINGPARAM( "Step" ) );
- return s_sStepProperty;
-}
-
// ----------------------------------------------------
// class UnoControlDialogModel
// ----------------------------------------------------
UnoControlDialogModel::UnoControlDialogModel()
- :maContainerListeners( *this )
- ,maChangeListeners ( GetMutex() )
- ,mbGroupsUpToDate( sal_False )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
// ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -279,35 +101,14 @@ UnoControlDialogModel::UnoControlDialogModel()
}
UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rModel )
- : UnoControlDialogModel_IBase( rModel )
- , UnoControlDialogModel_Base( rModel )
- , maContainerListeners( *this )
- , maChangeListeners ( GetMutex() )
- , mbGroupsUpToDate( sal_False )
+ : ControlModelContainerBase( rModel )
{
}
UnoControlDialogModel::~UnoControlDialogModel()
{
- maModels.clear();
- mbGroupsUpToDate = sal_False;
}
-Any UnoControlDialogModel::queryAggregation( const Type & rType ) throw(RuntimeException)
-{
- Any aRet( UnoControlDialogModel_IBase::queryInterface( rType ) );
- return (aRet.hasValue() ? aRet : UnoControlDialogModel_Base::queryAggregation( rType ));
-}
-
-// XTypeProvider
-IMPL_IMPLEMENTATION_ID( UnoControlDialogModel )
-Sequence< Type > UnoControlDialogModel::getTypes() throw(RuntimeException)
-{
- return ::comphelper::concatSequences(
- UnoControlDialogModel_IBase::getTypes(),
- UnoControlDialogModel_Base::getTypes()
- );
-}
::rtl::OUString UnoControlDialogModel::getServiceName( ) throw(RuntimeException)
{
@@ -341,42 +142,6 @@ Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return *pHelper;
}
-void SAL_CALL UnoControlDialogModel::dispose( ) throw(RuntimeException)
-{
- // ====================================================================
- // tell our listeners
- {
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
- EventObject aDisposeEvent;
- aDisposeEvent.Source = static_cast< XAggregation* >( static_cast< ::cppu::OWeakAggObject* >( this ) );
-
- maContainerListeners.disposeAndClear( aDisposeEvent );
- maChangeListeners.disposeAndClear( aDisposeEvent );
- }
-
- // ====================================================================
- // call the base class
- UnoControlModel::dispose();
-
- // ====================================================================
- // dispose our child models
- // for this, collect the models (we collect them from maModels, and this is modified when disposing children)
- ::std::vector< Reference< XControlModel > > aChildModels( maModels.size() );
-
- ::std::transform(
- maModels.begin(), maModels.end(), // source range
- aChildModels.begin(), // target location
- ::std::select1st< UnoControlModelHolder >( ) // operation to apply -> select the XControlModel part
- );
-
- // now dispose
- ::std::for_each( aChildModels.begin(), aChildModels.end(), DisposeControlModel() );
- aChildModels.clear();
-
- mbGroupsUpToDate = sal_False;
-}
-
// XMultiPropertySet
Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) throw(RuntimeException)
{
@@ -384,961 +149,20 @@ Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) thro
return xInfo;
}
-UnoControlModel* UnoControlDialogModel::Clone() const
-{
- // clone the container itself
- UnoControlDialogModel* pClone = new UnoControlDialogModel( *this );
-
- // clone all children
- ::std::for_each(
- maModels.begin(), maModels.end(),
- CloneControlModel( pClone->maModels )
- );
-
- return pClone;
-}
-
-UnoControlDialogModel::UnoControlModelHolderList::iterator UnoControlDialogModel::ImplFindElement( const ::rtl::OUString& rName )
-{
- return ::std::find_if( maModels.begin(), maModels.end(), FindControlModel( rName ) );
-}
-
-// ::XMultiServiceFactory
-Reference< XInterface > UnoControlDialogModel::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(Exception, RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- OGeometryControlModel_Base* pNewModel = NULL;
-
- if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlEditModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlEditModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFormattedFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFileControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFileControlModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlButtonModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlButtonModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlImageControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlImageControlModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRadioButtonModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCheckBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedHyperlinkModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedTextModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlGroupBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlListBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlListBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlComboBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlDateFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlTimeFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlNumericFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCurrencyFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlPatternFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlProgressBarModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlScrollBarModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFixedLineModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRoadmapModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_TreeControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoTreeModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName_GridControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoGridModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoSimpleAnimationControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoSimpleAnimationControlModel >;
- else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoThrobberControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoThrobberControlModel >;
-
- if ( !pNewModel )
- {
- Reference< XMultiServiceFactory > xORB( ::comphelper::getProcessServiceFactory() );
- if ( xORB.is() )
- {
- Reference< XInterface > xObject = xORB->createInstance( aServiceSpecifier );
- Reference< XServiceInfo > xSI( xObject, UNO_QUERY );
- Reference< XCloneable > xCloneAccess( xSI, UNO_QUERY );
- Reference< XAggregation > xAgg( xCloneAccess, UNO_QUERY );
- if ( xAgg.is() )
- {
- if ( xSI->supportsService( ::rtl::OUString::createFromAscii( "com.sun.star.awt.UnoControlModel" ) ) )
- {
- // release 3 of the 4 references we have to the object
- xAgg.clear();
- xSI.clear();
- xObject.clear();
-
- pNewModel = new OCommonGeometryControlModel( xCloneAccess, aServiceSpecifier );
- }
- }
- }
- }
-
- Reference< XInterface > xNewModel = (::cppu::OWeakObject*)pNewModel;
- return xNewModel;
-}
-
-Reference< XInterface > UnoControlDialogModel::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& /* Arguments */ ) throw(Exception, RuntimeException)
-{
- return createInstance( ServiceSpecifier );
-}
-
-Sequence< ::rtl::OUString > UnoControlDialogModel::getAvailableServiceNames() throw(RuntimeException)
-{
- static Sequence< ::rtl::OUString >* pNamesSeq = NULL;
- if ( !pNamesSeq )
- {
- pNamesSeq = new Sequence< ::rtl::OUString >( 24 );
- ::rtl::OUString* pNames = pNamesSeq->getArray();
- pNames[0] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlEditModel );
- pNames[1] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFormattedFieldModel );
- pNames[2] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFileControlModel );
- pNames[3] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlButtonModel );
- pNames[4] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlImageControlModel );
- pNames[5] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel );
- pNames[6] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCheckBoxModel );
- pNames[7] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedTextModel );
- pNames[8] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlGroupBoxModel );
- pNames[9] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlListBoxModel );
- pNames[10] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlComboBoxModel );
- pNames[11] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlDateFieldModel );
- pNames[12] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlTimeFieldModel );
- pNames[13] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlNumericFieldModel );
- pNames[14] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlCurrencyFieldModel );
- pNames[15] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlPatternFieldModel );
- pNames[16] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlProgressBarModel );
- pNames[17] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlScrollBarModel );
- pNames[18] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFixedLineModel );
- pNames[19] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRoadmapModel );
- pNames[20] = ::rtl::OUString::createFromAscii( szServiceName_TreeControlModel );
- pNames[21] = ::rtl::OUString::createFromAscii( szServiceName_GridControlModel );
- pNames[22] = ::rtl::OUString::createFromAscii( szServiceName2_UnoSimpleAnimationControlModel );
- pNames[23] = ::rtl::OUString::createFromAscii( szServiceName2_UnoThrobberControlModel );
- }
- return *pNamesSeq;
-}
-
-// XContainer
-void UnoControlDialogModel::addContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
-{
- maContainerListeners.addInterface( l );
-}
-
-void UnoControlDialogModel::removeContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
-{
- maContainerListeners.removeInterface( l );
-}
-
-// XElementAcces
-Type UnoControlDialogModel::getElementType() throw(RuntimeException)
-{
- Type aType = getCppuType( ( Reference< XControlModel>* ) NULL );
- return aType;
-}
-
-sal_Bool UnoControlDialogModel::hasElements() throw(RuntimeException)
-{
- return !maModels.empty();
-}
-
-// XNameContainer, XNameReplace, XNameAccess
-void UnoControlDialogModel::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- Reference< XControlModel > xNewModel;
- aElement >>= xNewModel;
- if ( !xNewModel.is() )
- lcl_throwIllegalArgumentException();
-
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() == aElementPos )
- lcl_throwNoSuchElementException();
-
- // stop listening at the old model
- stopControlListening( aElementPos->first );
- Reference< XControlModel > xReplaced( aElementPos->first );
- // remember the new model, and start listening
- aElementPos->first = xNewModel;
- startControlListening( xNewModel );
-
- ContainerEvent aEvent;
- aEvent.Source = *this;
- aEvent.Element = aElement;
- aEvent.ReplacedElement <<= xReplaced;
- aEvent.Accessor <<= aName;
-
- // notify the container listener
- maContainerListeners.elementReplaced( aEvent );
-
- // our "tab controller model" has potentially changed -> notify this
- implNotifyTabModelChange( aName );
-}
-
-Any UnoControlDialogModel::getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() == aElementPos )
- lcl_throwNoSuchElementException();
-
- return makeAny( aElementPos->first );
-}
-
-Sequence< ::rtl::OUString > UnoControlDialogModel::getElementNames() throw(RuntimeException)
-{
- Sequence< ::rtl::OUString > aNames( maModels.size() );
-
- ::std::transform(
- maModels.begin(), maModels.end(), // source range
- aNames.getArray(), // target range
- ::std::select2nd< UnoControlModelHolder >() // operator to apply: select the second element (the name)
- );
-
- return aNames;
-}
-
-sal_Bool UnoControlDialogModel::hasByName( const ::rtl::OUString& aName ) throw(RuntimeException)
-{
- return maModels.end() != ImplFindElement( aName );
-}
-
-void UnoControlDialogModel::insertByName( const ::rtl::OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- Reference< XControlModel > xM;
- aElement >>= xM;
-
- if ( xM.is() )
- {
- Reference< beans::XPropertySet > xProps( xM, UNO_QUERY );
- if ( xProps.is() )
- {
-
- Reference< beans::XPropertySetInfo > xPropInfo = xProps.get()->getPropertySetInfo();
-
- ::rtl::OUString sImageSourceProperty = GetPropertyName( BASEPROPERTY_IMAGEURL );
- if ( xPropInfo.get()->hasPropertyByName( sImageSourceProperty ))
- {
- Any aUrl = xProps.get()->getPropertyValue( sImageSourceProperty );
-
- ::rtl::OUString absoluteUrl =
- getPhysicalLocation( getPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL ) ), aUrl );
-
- aUrl <<= absoluteUrl;
-
- xProps.get()->setPropertyValue( sImageSourceProperty , aUrl );
- }
- }
- }
-
-
-
- if ( !aName.getLength() || !xM.is() )
- lcl_throwIllegalArgumentException();
-
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() != aElementPos )
- lcl_throwElementExistException();
-
- maModels.push_back( UnoControlModelHolder( xM, aName ) );
- mbGroupsUpToDate = sal_False;
- startControlListening( xM );
-
- ContainerEvent aEvent;
- aEvent.Source = *this;
- aEvent.Element <<= aElement;
- aEvent.Accessor <<= aName;
- maContainerListeners.elementInserted( aEvent );
-
- // our "tab controller model" has potentially changed -> notify this
- implNotifyTabModelChange( aName );
-}
-
-void UnoControlDialogModel::removeByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName );
- if ( maModels.end() == aElementPos )
- lcl_throwNoSuchElementException();
-
- ContainerEvent aEvent;
- aEvent.Source = *this;
- aEvent.Element <<= aElementPos->first;
- aEvent.Accessor <<= aName;
- maContainerListeners.elementRemoved( aEvent );
-
- stopControlListening( aElementPos->first );
- Reference< XPropertySet > xPS( aElementPos->first, UNO_QUERY );
- maModels.erase( aElementPos );
- mbGroupsUpToDate = sal_False;
-
- if ( xPS.is() )
- try
- {
- xPS->setPropertyValue( PROPERTY_RESOURCERESOLVER, makeAny( Reference< resource::XStringResourceResolver >() ) );
- }
- catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); }
-
- // our "tab controller model" has potentially changed -> notify this
- implNotifyTabModelChange( aName );
-}
-
-// ----------------------------------------------------------------------------
-sal_Bool SAL_CALL UnoControlDialogModel::getGroupControl( ) throw (RuntimeException)
-{
- return sal_True;
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::setGroupControl( sal_Bool ) throw (RuntimeException)
-{
- DBG_ERROR( "UnoControlDialogModel::setGroupControl: explicit grouping not supported" );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::setControlModels( const Sequence< Reference< XControlModel > >& _rControls ) throw (RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- // set the tab indexes according to the order of models in the sequence
- const Reference< XControlModel >* pControls = _rControls.getConstArray( );
- const Reference< XControlModel >* pControlsEnd = _rControls.getConstArray( ) + _rControls.getLength();
-
- sal_Int16 nTabIndex = 1;
-
- for ( ; pControls != pControlsEnd; ++pControls )
- {
- // look up the control in our own structure. This is to prevent invalid arguments
- UnoControlModelHolderList::const_iterator aPos =
- ::std::find_if(
- maModels.begin(), maModels.end(),
- CompareControlModel( *pControls )
- );
- if ( maModels.end() != aPos )
- {
- // okay, this is an existent model
- // now set the TabIndex property (if applicable)
- Reference< XPropertySet > xProps( aPos->first, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xProps.is() )
- xPSI = xProps->getPropertySetInfo();
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xProps->setPropertyValue( getTabIndexPropertyName(), makeAny( nTabIndex++ ) );
- }
- mbGroupsUpToDate = sal_False;
- }
-}
-
-
-typedef ::std::multimap< sal_Int32, Reference< XControlModel >, ::std::less< sal_Int32 > > MapIndexToModel;
-
-// ----------------------------------------------------------------------------
-Sequence< Reference< XControlModel > > SAL_CALL UnoControlDialogModel::getControlModels( ) throw (RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- MapIndexToModel aSortedModels;
- // will be the sorted container of all models which have a tab index property
- ::std::vector< Reference< XControlModel > > aUnindexedModels;
- // will be the container of all models which do not have a tab index property
-
- UnoControlModelHolderList::const_iterator aLoop = maModels.begin();
- for ( ; aLoop != maModels.end(); ++aLoop )
- {
- Reference< XControlModel > xModel( aLoop->first );
-
- // see if the model has a TabIndex property
- Reference< XPropertySet > xControlProps( xModel, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xControlProps.is() )
- xPSI = xControlProps->getPropertySetInfo( );
- DBG_ASSERT( xPSI.is(), "UnoControlDialogModel::getControlModels: invalid child model!" );
-
- // has it?
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- { // yes
- sal_Int32 nTabIndex = -1;
- xControlProps->getPropertyValue( getTabIndexPropertyName() ) >>= nTabIndex;
-
- aSortedModels.insert( MapIndexToModel::value_type( nTabIndex, xModel ) );
- }
- else if ( xModel.is() )
- // no, it hasn't, but we have to include it, anyway
- aUnindexedModels.push_back( xModel );
- }
-
- // okay, here we have a container of all our models, sorted by tab index,
- // plus a container of "unindexed" models
- // -> merge them
- Sequence< Reference< XControlModel > > aReturn( aUnindexedModels.size() + aSortedModels.size() );
- ::std::transform(
- aSortedModels.begin(), aSortedModels.end(),
- ::std::copy( aUnindexedModels.begin(), aUnindexedModels.end(), aReturn.getArray() ),
- ::std::select2nd< MapIndexToModel::value_type >( )
- );
-
- return aReturn;
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::setGroup( const Sequence< Reference< XControlModel > >&, const ::rtl::OUString& ) throw (RuntimeException)
-{
- // not supported. We have only implicit grouping:
- // We only have a sequence of control models, and we _know_ (yes, that's a HACK relying on
- // implementation details) that VCL does grouping according to the order of controls automatically
- // At least VCL does this for all we're interested in: Radio buttons.
- DBG_ERROR( "UnoControlDialogModel::setGroup: grouping not supported" );
-}
-
-// ----------------------------------------------------------------------------
-namespace
-{
- enum GroupingMachineState
- {
- eLookingForGroup,
- eExpandingGroup
- };
-
- // ........................................................................
- static sal_Int32 lcl_getDialogStep( const Reference< XControlModel >& _rxModel )
- {
- sal_Int32 nStep = 0;
- try
- {
- Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY );
- xModelProps->getPropertyValue( getStepPropertyName() ) >>= nStep;
- }
- catch( const Exception& )
- {
- DBG_ERROR( "lcl_getDialogStep: caught an exception while determining the dialog page!" );
- }
- return nStep;
- }
-}
-
-// ----------------------------------------------------------------------------
-sal_Int32 SAL_CALL UnoControlDialogModel::getGroupCount( ) throw (RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- implUpdateGroupStructure();
-
- return maGroups.size();
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::getGroup( sal_Int32 _nGroup, Sequence< Reference< XControlModel > >& _rGroup, ::rtl::OUString& _rName ) throw (RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- implUpdateGroupStructure();
-
- if ( ( _nGroup < 0 ) || ( _nGroup >= (sal_Int32)maGroups.size() ) )
- {
- DBG_ERROR( "UnoControlDialogModel::getGroup: invalid argument and I am not allowed to throw an exception!" );
- _rGroup.realloc( 0 );
- _rName = ::rtl::OUString();
- }
- else
- {
- AllGroups::const_iterator aGroupPos = maGroups.begin() + _nGroup;
- _rGroup.realloc( aGroupPos->size() );
- // copy the models
- ::std::copy( aGroupPos->begin(), aGroupPos->end(), _rGroup.getArray() );
- // give the group a name
- _rName = ::rtl::OUString::valueOf( _nGroup );
- }
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::getGroupByName( const ::rtl::OUString& _rName, Sequence< Reference< XControlModel > >& _rGroup ) throw (RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- ::rtl::OUString sDummyName;
- getGroup( _rName.toInt32( ), _rGroup, sDummyName );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::addChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
-{
- maChangeListeners.addInterface( _rxListener );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::removeChangesListener( const Reference< XChangesListener >& _rxListener ) throw (RuntimeException)
-{
- maChangeListeners.removeInterface( _rxListener );
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::implNotifyTabModelChange( const ::rtl::OUString& _rAccessor )
-{
- // multiplex to our change listeners:
- // the changes event
- ChangesEvent aEvent;
- aEvent.Source = *this;
- aEvent.Base <<= aEvent.Source; // the "base of the changes root" is also ourself
- aEvent.Changes.realloc( 1 ); // exactly one change
- aEvent.Changes[ 0 ].Accessor <<= _rAccessor;
-
-
- Sequence< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() );
- const Reference< XInterface >* pListener = aChangeListeners.getConstArray();
- const Reference< XInterface >* pListenerEnd = aChangeListeners.getConstArray() + aChangeListeners.getLength();
- for ( ; pListener != pListenerEnd; ++pListener )
- {
- if ( pListener->is() )
- static_cast< XChangesListener* >( pListener->get() )->changesOccurred( aEvent );
- }
-}
-
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::implUpdateGroupStructure()
-{
- if ( mbGroupsUpToDate )
- // nothing to do
- return;
-
- // conditions for a group:
- // * all elements of the group are radio buttons
- // * all elements of the group are on the same dialog page
- // * in the overall control order (determined by the tab index), all elements are subsequent
-
- maGroups.clear();
-
- Sequence< Reference< XControlModel > > aControlModels = getControlModels();
- const Reference< XControlModel >* pControlModels = aControlModels.getConstArray();
- const Reference< XControlModel >* pControlModelsEnd = pControlModels + aControlModels.getLength();
-
- // in extreme we have as much groups as controls
- maGroups.reserve( aControlModels.getLength() );
-
- GroupingMachineState eState = eLookingForGroup; // the current state of our machine
- Reference< XServiceInfo > xModelSI; // for checking for a radion button
- AllGroups::iterator aCurrentGroup = maGroups.end(); // the group which we're currently building
- sal_Int32 nCurrentGroupStep = -1; // the step which all controls of the current group belong to
- sal_Bool bIsRadioButton; // is it a radio button?
-
-#if OSL_DEBUG_LEVEL > 1
- ::std::vector< ::rtl::OUString > aCurrentGroupLabels;
-#endif
-
- for ( ; pControlModels != pControlModelsEnd; ++pControlModels )
- {
- // we'll need this in every state
- xModelSI = xModelSI.query( *pControlModels );
- bIsRadioButton = xModelSI.is() && xModelSI->supportsService( ::rtl::OUString::createFromAscii( szServiceName2_UnoControlRadioButtonModel ) );
-
- switch ( eState )
- {
- case eLookingForGroup:
- {
- if ( !bIsRadioButton )
- // this is no radio button -> still looking for the beginning of a group
- continue;
- // the current model is a radio button
- // -> we found the beginning of a new group
- // create the place for this group
- size_t nGroups = maGroups.size();
- maGroups.resize( nGroups + 1 );
- aCurrentGroup = maGroups.begin() + nGroups;
- // and add the (only, til now) member
- aCurrentGroup->push_back( *pControlModels );
-
- // get the step which all controls of this group now have to belong to
- nCurrentGroupStep = lcl_getDialogStep( *pControlModels );
- // new state: looking for further members
- eState = eExpandingGroup;
-
-#if OSL_DEBUG_LEVEL > 1
- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
- ::rtl::OUString sLabel;
- if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
- xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
- aCurrentGroupLabels.push_back( sLabel );
-#endif
- }
- break;
-
- case eExpandingGroup:
- {
- if ( !bIsRadioButton )
- { // no radio button -> the group is done
- aCurrentGroup = maGroups.end();
- eState = eLookingForGroup;
-#if OSL_DEBUG_LEVEL > 1
- aCurrentGroupLabels.clear();
-#endif
- continue;
- }
-
- // it is a radio button - is it on the proper page?
- const sal_Int32 nThisModelStep = lcl_getDialogStep( *pControlModels );
- if ( ( nThisModelStep == nCurrentGroupStep ) // the current button is on the same dialog page
- || ( 0 == nThisModelStep ) // the current button appears on all pages
- )
- {
- // -> it belongs to the same group
- aCurrentGroup->push_back( *pControlModels );
- // state still is eExpandingGroup - we're looking for further elements
- eState = eExpandingGroup;
-
-#if OSL_DEBUG_LEVEL > 1
- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
- ::rtl::OUString sLabel;
- if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
- xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
- aCurrentGroupLabels.push_back( sLabel );
-#endif
- continue;
- }
-
- // it's a radio button, but on a different page
- // -> we open a new group for it
-
- // close the old group
- aCurrentGroup = maGroups.end();
-#if OSL_DEBUG_LEVEL > 1
- aCurrentGroupLabels.clear();
-#endif
-
- // open a new group
- size_t nGroups = maGroups.size();
- maGroups.resize( nGroups + 1 );
- aCurrentGroup = maGroups.begin() + nGroups;
- // and add the (only, til now) member
- aCurrentGroup->push_back( *pControlModels );
-
- nCurrentGroupStep = nThisModelStep;
-
- // state is the same: we still are looking for further elements of the current group
- eState = eExpandingGroup;
-#if OSL_DEBUG_LEVEL > 1
- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
- ::rtl::OUString sLabel;
- if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
- xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
- aCurrentGroupLabels.push_back( sLabel );
-#endif
- }
- break;
- }
- }
-
- mbGroupsUpToDate = sal_True;
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::propertyChange( const PropertyChangeEvent& _rEvent ) throw (RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- DBG_ASSERT( 0 == _rEvent.PropertyName.compareToAscii( "TabIndex" ),
- "UnoControlDialogModel::propertyChange: not listening for this property!" );
-
- // the accessor for the changed element
- ::rtl::OUString sAccessor;
- UnoControlModelHolderList::const_iterator aPos =
- ::std::find_if(
- maModels.begin(), maModels.end(),
- CompareControlModel( Reference< XControlModel >( _rEvent.Source, UNO_QUERY ) )
- );
- OSL_ENSURE( maModels.end() != aPos, "UnoControlDialogModel::propertyChange: don't know this model!" );
- if ( maModels.end() != aPos )
- sAccessor = aPos->second;
-
- // our groups are not up-to-date
- mbGroupsUpToDate = sal_False;
-
- // notify
- implNotifyTabModelChange( sAccessor );
-}
-
-// ----------------------------------------------------------------------------
-void SAL_CALL UnoControlDialogModel::disposing( const EventObject& /*rEvent*/ ) throw (RuntimeException)
-{
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::startControlListening( const Reference< XControlModel >& _rxChildModel )
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xModelProps.is() )
- xPSI = xModelProps->getPropertySetInfo();
-
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xModelProps->addPropertyChangeListener( getTabIndexPropertyName(), this );
-}
-
-// ----------------------------------------------------------------------------
-void UnoControlDialogModel::stopControlListening( const Reference< XControlModel >& _rxChildModel )
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- Reference< XPropertySet > xModelProps( _rxChildModel, UNO_QUERY );
- Reference< XPropertySetInfo > xPSI;
- if ( xModelProps.is() )
- xPSI = xModelProps->getPropertySetInfo();
-
- if ( xPSI.is() && xPSI->hasPropertyByName( getTabIndexPropertyName() ) )
- xModelProps->removePropertyChangeListener( getTabIndexPropertyName(), this );
-}
-
-// ============================================================================
-// = class ResourceListener
-// ============================================================================
-
-ResourceListener::ResourceListener(
- const Reference< util::XModifyListener >& rListener ) :
- OWeakObject(),
- m_xListener( rListener ),
- m_bListening( false )
-{
-}
-
-ResourceListener::~ResourceListener()
-{
-}
-
-// XInterface
-Any SAL_CALL ResourceListener::queryInterface( const Type& rType )
-throw ( RuntimeException )
-{
- Any a = ::cppu::queryInterface(
- rType ,
- static_cast< XModifyListener* >( this ),
- static_cast< XEventListener* >( this ));
-
- if ( a.hasValue() )
- return a;
-
- return OWeakObject::queryInterface( rType );
-}
-
-void SAL_CALL ResourceListener::acquire() throw ()
-{
- OWeakObject::acquire();
-}
-
-void SAL_CALL ResourceListener::release() throw ()
-{
- OWeakObject::release();
-}
-
-void ResourceListener::startListening(
- const Reference< resource::XStringResourceResolver >& rResource )
-{
- Reference< util::XModifyBroadcaster > xModifyBroadcaster( rResource, UNO_QUERY );
-
- {
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- bool bListening( m_bListening );
- bool bResourceSet( m_xResource.is() );
- aGuard.clear();
- // --- SAFE ---
-
- if ( bListening && bResourceSet )
- stopListening();
-
- // --- SAFE ---
- aGuard.reset();
- m_xResource = rResource;
- aGuard.clear();
- // --- SAFE ---
- }
-
- Reference< util::XModifyListener > xThis( static_cast<OWeakObject*>( this ), UNO_QUERY );
- if ( xModifyBroadcaster.is() )
- {
- try
- {
- xModifyBroadcaster->addModifyListener( xThis );
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- m_bListening = true;
- // --- SAFE ---
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
-}
-
-void ResourceListener::stopListening()
-{
- Reference< util::XModifyBroadcaster > xModifyBroadcaster;
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- if ( m_bListening && m_xResource.is() )
- xModifyBroadcaster = Reference< util::XModifyBroadcaster >( m_xResource, UNO_QUERY );
- aGuard.clear();
- // --- SAFE ---
-
- Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- if ( xModifyBroadcaster.is() )
- {
- try
- {
- // --- SAFE ---
- aGuard.reset();
- m_bListening = false;
- m_xResource.clear();
- aGuard.clear();
- // --- SAFE ---
-
- xModifyBroadcaster->removeModifyListener( xThis );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
-}
-
-// XModifyListener
-void SAL_CALL ResourceListener::modified(
- const lang::EventObject& aEvent )
-throw ( RuntimeException )
-{
- Reference< util::XModifyListener > xListener;
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- xListener = m_xListener;
- aGuard.clear();
- // --- SAFE ---
-
- if ( xListener.is() )
- {
- try
- {
- xListener->modified( aEvent );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
-}
-
-// XEventListener
-void SAL_CALL ResourceListener::disposing(
- const EventObject& Source )
-throw ( RuntimeException )
-{
- Reference< lang::XEventListener > xListener;
- Reference< resource::XStringResourceResolver > xResource;
-
- // --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
- Reference< XInterface > xIfacRes( m_xResource, UNO_QUERY );
- Reference< XInterface > xIfacList( m_xListener, UNO_QUERY );
- aGuard.clear();
- // --- SAFE ---
-
- if ( Source.Source == xIfacRes )
- {
- // --- SAFE ---
- aGuard.reset();
- m_bListening = false;
- xResource = m_xResource;
- xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
- m_xResource.clear();
- aGuard.clear();
- // --- SAFE ---
-
- if ( xListener.is() )
- {
- try
- {
- xListener->disposing( Source );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
- }
- else if ( Source.Source == xIfacList )
- {
- // --- SAFE ---
- aGuard.reset();
- m_bListening = false;
- xListener = Reference< lang::XEventListener >( m_xListener, UNO_QUERY );
- xResource = m_xResource;
- m_xResource.clear();
- m_xListener.clear();
- aGuard.clear();
- // --- SAFE ---
-
- // Remove ourself as listener from resource resolver
- Reference< util::XModifyBroadcaster > xModifyBroadcaster( xResource, UNO_QUERY );
- Reference< util::XModifyListener > xThis( static_cast< OWeakObject* >( this ), UNO_QUERY );
- if ( xModifyBroadcaster.is() )
- {
- try
- {
- xModifyBroadcaster->removeModifyListener( xThis );
- }
- catch ( RuntimeException& )
- {
- throw;
- }
- catch ( Exception& )
- {
- }
- }
- }
-}
-
// ============================================================================
// = class UnoDialogControl
// ============================================================================
UnoDialogControl::UnoDialogControl() :
maTopWindowListeners( *this ),
- mbWindowListener(false),
- mbSizeModified(false),
- mbPosModified(false)
+ mbWindowListener(false)
{
maComponentInfos.nWidth = 300;
maComponentInfos.nHeight = 450;
- mxListener = new ResourceListener( Reference< util::XModifyListener >(
- static_cast< OWeakObject* >( this ), UNO_QUERY ));
+ }
+
+UnoDialogControl::~UnoDialogControl()
+{
}
::rtl::OUString UnoDialogControl::GetComponentServiceName()
@@ -1355,120 +179,20 @@ UnoDialogControl::UnoDialogControl() :
// XInterface
Any UnoDialogControl::queryAggregation( const Type & rType ) throw(RuntimeException)
{
- Any aRet( UnoDialogControl_IBase::queryInterface( rType ) );
- return (aRet.hasValue() ? aRet : UnoControlContainer::queryAggregation( rType ));
-}
-
-// XTypeProvider
-IMPL_IMPLEMENTATION_ID( UnoDialogControl )
-Sequence< Type > UnoDialogControl::getTypes() throw(RuntimeException)
-{
- return ::comphelper::concatSequences(
- UnoDialogControl_IBase::getTypes(),
- UnoControlContainer::getTypes()
- );
-}
-
-void UnoDialogControl::ImplInsertControl( Reference< XControlModel >& rxModel, const ::rtl::OUString& rName )
-{
- Reference< XPropertySet > xP( rxModel, UNO_QUERY );
-
- ::rtl::OUString aDefCtrl;
- xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl;
-
- // Add our own resource resolver to a newly created control
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
- rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
-
- Any aAny;
- ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
-
- aAny <<= xStringResourceResolver;
- xP->setPropertyValue( aPropName, aAny );
-
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XControl > xCtrl( xMSF->createInstance( aDefCtrl ), UNO_QUERY );
-
- DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" );
- if ( xCtrl.is() )
- {
- xCtrl->setModel( rxModel );
- addControl( rName, xCtrl );
- // will implicitly call addingControl, where we can add the PropertiesChangeListener to the model
- // (which we formerly did herein)
- // 08.01.2001 - 96008 - fs@openoffice.org
-
- ImplSetPosSize( xCtrl );
- }
-}
-
-void UnoDialogControl::ImplRemoveControl( Reference< XControlModel >& rxModel )
-{
- Sequence< Reference< XControl > > aControls = getControls();
- Reference< XControl > xCtrl = StdTabController::FindControl( aControls, rxModel );
- if ( xCtrl.is() )
- removeControl( xCtrl );
-}
-
-void UnoDialogControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
-{
- Reference< XPropertySet > xP( rxCtrl->getModel(), UNO_QUERY );
-
- sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ) ) >>= nX;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ) ) >>= nY;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) >>= nWidth;
- xP->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) >>= nHeight;
-
- // Currentley we are simply using MAP_APPFONT
- OutputDevice*pOutDev = Application::GetDefaultDevice();
- DBG_ASSERT( pOutDev, "Missing Default Device!" );
- if ( pOutDev )
- {
- ::Size aTmp( nX, nY );
- aTmp = pOutDev->LogicToPixel( aTmp, MAP_APPFONT );
- nX = aTmp.Width();
- nY = aTmp.Height();
- aTmp = ::Size( nWidth, nHeight );
- aTmp = pOutDev->LogicToPixel( aTmp, MAP_APPFONT );
- nWidth = aTmp.Width();
- nHeight = aTmp.Height();
- }
- else
- {
- Reference< XWindowPeer > xPeer = ImplGetCompatiblePeer( sal_True );
- Reference< XDevice > xD( xPeer, UNO_QUERY );
-
- SimpleFontMetric aFM;
- FontDescriptor aFD;
- Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
- aVal >>= aFD;
- if ( aFD.StyleName.getLength() )
- {
- Reference< XFont > xFont = xD->getFont( aFD );
- aFM = xFont->getFontMetric();
- }
- else
- {
- Reference< XGraphics > xG = xD->createGraphics();
- aFM = xG->getFontMetric();
- }
-
- sal_Int16 nH = aFM.Ascent + aFM.Descent;
- sal_Int16 nW = nH/2; // calculate avarage width?!
-
- nX *= nW;
- nX /= 4;
- nWidth *= nW;
- nWidth /= 4;
- nY *= nH;
- nY /= 8;
- nHeight *= nH;
- nHeight /= 8;
- }
- Reference < XWindow > xW( rxCtrl, UNO_QUERY );
- xW->setPosSize( nX, nY, nWidth, nHeight, PosSize::POSSIZE );
-}
+ uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XTopWindow*, this ) );
+ if ( !aRet.hasValue() )
+ aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XDialog*, this ) );
+ if ( !aRet.hasValue() )
+ aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XWindowListener*, this ) );
+ return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
+}
+//lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( UnoDialogControl)
+ getCppuType( ( uno::Reference< awt::XTopWindow>* ) NULL ),
+ getCppuType( ( uno::Reference< awt::XDialog>* ) NULL ),
+ getCppuType( ( uno::Reference< awt::XWindowListener>* ) NULL ),
+ ControlContainerBase::getTypes()
+IMPL_XTYPEPROVIDER_END
void UnoDialogControl::dispose() throw(RuntimeException)
{
@@ -1477,139 +201,25 @@ void UnoDialogControl::dispose() throw(RuntimeException)
EventObject aEvt;
aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
maTopWindowListeners.disposeAndClear( aEvt );
-
- // Notify our listener helper about dispose
- // --- SAFE ---
- ::osl::ResettableGuard< ::osl::Mutex > aGuard( GetMutex() );
- Reference< XEventListener > xListener( mxListener, UNO_QUERY );
- mxListener.clear();
- aGuard.clear();
- // --- SAFE ---
-
- if ( xListener.is() )
- xListener->disposing( aEvt );
-
- UnoControlContainer::dispose();
+ ControlContainerBase::dispose();
}
void SAL_CALL UnoDialogControl::disposing(
const EventObject& Source )
throw(RuntimeException)
{
- rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
-
- ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
- Reference< XInterface > xIfac( xStringResourceResolver, UNO_QUERY );
-
- if ( Source.Source == xIfac )
- {
- Any aAny;
-
- // Reset resource resolver reference
- ImplSetPropertyValue( aPropName, aAny, sal_True );
- ImplUpdateResourceResolver();
- }
- else
- {
- UnoControlContainer::disposing( Source );
- }
+ ControlContainerBase::disposing( Source );
}
sal_Bool UnoDialogControl::setModel( const Reference< XControlModel >& rxModel ) throw(RuntimeException)
{
+ // #Can we move all the Resource stuff to the ControlContainerBase ?
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- // destroy the old tab controller, if existent
- if ( mxTabController.is() )
- {
- mxTabController->setModel( NULL ); // just to be sure, should not be necessary
- removeTabController( mxTabController );
- ::comphelper::disposeComponent( mxTabController ); // just to be sure, should not be necessary
- mxTabController.clear();
- }
-
- if ( getModel().is() )
- {
- Sequence< Reference< XControl > > aControls = getControls();
- const Reference< XControl >* pCtrls = aControls.getConstArray();
- const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength();
-
- for ( ; pCtrls < pCtrlsEnd; ++pCtrls )
- removeControl( *pCtrls );
- // will implicitly call removingControl, which will remove the PropertyChangeListener
- // (which we formerly did herein)
- // 08.01.2001 - 96008 - fs@openoffice.org
-
- Reference< XContainer > xC( getModel(), UNO_QUERY );
- if ( xC.is() )
- xC->removeContainerListener( this );
-
- Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
- if ( xChangeNotifier.is() )
- xChangeNotifier->removeChangesListener( this );
- }
-
- sal_Bool bRet = UnoControl::setModel( rxModel );
-
- if ( getModel().is() )
- {
- Reference< XNameAccess > xNA( getModel(), UNO_QUERY );
- if ( xNA.is() )
- {
- Sequence< ::rtl::OUString > aNames = xNA->getElementNames();
- const ::rtl::OUString* pNames = aNames.getConstArray();
- sal_uInt32 nCtrls = aNames.getLength();
-
- Reference< XControlModel > xCtrlModel;
- for( sal_uInt32 n = 0; n < nCtrls; ++n, ++pNames )
- {
- xNA->getByName( *pNames ) >>= xCtrlModel;
- ImplInsertControl( xCtrlModel, *pNames );
- }
- }
-
- Reference< XContainer > xC( getModel(), UNO_QUERY );
- if ( xC.is() )
- xC->addContainerListener( this );
-
- Reference< XChangesNotifier > xChangeNotifier( getModel(), UNO_QUERY );
- if ( xChangeNotifier.is() )
- xChangeNotifier->addChangesListener( this );
- }
-
- Reference< XTabControllerModel > xTabbing( getModel(), UNO_QUERY );
- if ( xTabbing.is() )
- {
- mxTabController = new StdTabController;
- mxTabController->setModel( xTabbing );
- addTabController( mxTabController );
- }
+ sal_Bool bRet = ControlContainerBase::setModel( rxModel );
ImplStartListingForResourceEvents();
-
return bRet;
}
-void UnoDialogControl::setDesignMode( sal_Bool bOn ) throw(RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
-
- UnoControl::setDesignMode( bOn );
-
- Sequence< Reference< XControl > > xCtrls = getControls();
- sal_Int32 nControls = xCtrls.getLength();
- Reference< XControl >* pControls = xCtrls.getArray();
- for ( sal_Int32 n = 0; n < nControls; n++ )
- pControls[n]->setDesignMode( bOn );
-
- // #109067# in design mode the tab controller is not notified about
- // tab index changes, therefore the tab order must be activated
- // when switching from design mode to live mode
- if ( mxTabController.is() && !bOn )
- mxTabController->activateTabOrder();
-}
-
void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
@@ -1657,48 +267,11 @@ void UnoDialogControl::PrepareWindowDescriptor( ::com::sun::star::awt::WindowDes
getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
ImplGetPropertyValue( PROPERTY_IMAGEURL ));
- xGraphic = lcl_getGraphicFromURL_nothrow( absoluteUrl );
+ xGraphic = ControlContainerBase::Impl_getGraphicFromURL_nothrow( absoluteUrl );
ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), sal_True );
}
}
-void UnoDialogControl::elementInserted( const ContainerEvent& Event ) throw(RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- Reference< XControlModel > xModel;
- ::rtl::OUString aName;
-
- Event.Accessor >>= aName;
- Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
-}
-
-void UnoDialogControl::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- Reference< XControlModel > xModel;
- Event.Element >>= xModel;
- if ( xModel.is() )
- ImplRemoveControl( xModel );
-}
-
-void UnoDialogControl::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
-
- Reference< XControlModel > xModel;
- Event.ReplacedElement >>= xModel;
- if ( xModel.is() )
- ImplRemoveControl( xModel );
-
- ::rtl::OUString aName;
- Event.Accessor >>= aName;
- Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
-}
-
void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener ) throw (RuntimeException)
{
maTopWindowListeners.addInterface( rxListener );
@@ -1752,13 +325,11 @@ void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar ) thro
xTW->setMenuBar( mxMenuBar );
}
}
-
static ::Size ImplMapPixelToAppFont( OutputDevice* pOutDev, const ::Size& aSize )
{
::Size aTmp = pOutDev->PixelToLogic( aSize, MAP_APPFONT );
return aTmp;
}
-
// ::com::sun::star::awt::XWindowListener
void SAL_CALL UnoDialogControl::windowResized( const ::com::sun::star::awt::WindowEvent& e )
throw (::com::sun::star::uno::RuntimeException)
@@ -1837,166 +408,6 @@ throw (::com::sun::star::uno::RuntimeException)
(void)e;
}
-// XPropertiesChangeListener
-void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
-{
- if( !isDesignMode() && !mbCreatingCompatiblePeer )
- {
- ::rtl::OUString s1( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) );
- ::rtl::OUString s2( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) );
- ::rtl::OUString s3( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
- ::rtl::OUString s4( RTL_CONSTASCII_USTRINGPARAM( "Height" ) );
-
- sal_Int32 nLen = rEvents.getLength();
- for( sal_Int32 i = 0; i < nLen; i++ )
- {
- const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
- Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
- sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
- if ( ( rEvt.PropertyName == s1 ) ||
- ( rEvt.PropertyName == s2 ) ||
- ( rEvt.PropertyName == s3 ) ||
- ( rEvt.PropertyName == s4 ) )
- {
- if ( bOwnModel )
- {
- if ( !mbPosModified && !mbSizeModified )
- {
- // Don't set new pos/size if we get new values from window listener
- Reference< XControl > xThis( (XAggregation*)(::cppu::OWeakAggObject*)this, UNO_QUERY );
- ImplSetPosSize( xThis );
- }
- }
- else
- {
- Sequence<Reference<XControl> > aControlSequence(getControls());
- Reference<XControl> aControlRef( StdTabController::FindControl( aControlSequence, xModel ) );
- ImplSetPosSize( aControlRef );
- }
- break;
- }
- else if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ResourceResolver", 16 ))
- {
- ImplStartListingForResourceEvents();
- }
- }
- }
-
- sal_Int32 nLen = rEvents.getLength();
- for( sal_Int32 i = 0; i < nLen; i++ )
- {
- const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
- Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
- sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
- if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ImageURL", 8 ))
- {
- ::rtl::OUString aImageURL;
- Reference< graphic::XGraphic > xGraphic;
- if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
- ( aImageURL.getLength() > 0 ))
- {
- ::rtl::OUString absoluteUrl =
- getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
- ImplGetPropertyValue( PROPERTY_IMAGEURL ));
-
- xGraphic = lcl_getGraphicFromURL_nothrow( absoluteUrl );
- }
-
- ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), sal_True );
- break;
- }
- }
-
- UnoControlContainer::ImplModelPropertiesChanged( rEvents );
-}
-
-void UnoDialogControl::ImplStartListingForResourceEvents()
-{
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
-
- ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver;
-
- // Add our helper as listener to retrieve notifications about changes
- Reference< util::XModifyListener > rListener( mxListener );
- ResourceListener* pResourceListener = static_cast< ResourceListener* >( rListener.get() );
-
- // resource listener will stop listening if resolver reference is empty
- if ( pResourceListener )
- pResourceListener->startListening( xStringResourceResolver );
- ImplUpdateResourceResolver();
-}
-
-void UnoDialogControl::ImplUpdateResourceResolver()
-{
- rtl::OUString aPropName( PROPERTY_RESOURCERESOLVER );
- Reference< resource::XStringResourceResolver > xStringResourceResolver;
-
- ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
- if ( !xStringResourceResolver.is() )
- return;
-
- Any xNewStringResourceResolver; xNewStringResourceResolver <<= xStringResourceResolver;
-
- Sequence< rtl::OUString > aPropNames(1);
- aPropNames[0] = aPropName;
-
- const Sequence< Reference< awt::XControl > > aSeq = getControls();
- for ( sal_Int32 i = 0; i < aSeq.getLength(); i++ )
- {
- Reference< XControl > xControl( aSeq[i] );
- Reference< XPropertySet > xPropertySet;
-
- if ( xControl.is() )
- xPropertySet = Reference< XPropertySet >( xControl->getModel(), UNO_QUERY );
-
- if ( !xPropertySet.is() )
- continue;
-
- try
- {
- Reference< resource::XStringResourceResolver > xCurrStringResourceResolver;
- Any aOldValue = xPropertySet->getPropertyValue( aPropName );
- if ( ( aOldValue >>= xCurrStringResourceResolver )
- && ( xStringResourceResolver == xCurrStringResourceResolver )
- )
- {
- Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
- Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
- xMultiPropSet->firePropertiesChangeEvent( aPropNames, xListener );
- }
- else
- xPropertySet->setPropertyValue( aPropName, xNewStringResourceResolver );
- }
- /*catch ( NoSuchElementException& )*/ // that's nonsense, this is never thrown above ...
- catch ( const Exception& )
- {
- }
- }
-
- // propagate resource resolver changes to language dependent props of the dialog
- Reference< XPropertySet > xPropertySet( getModel(), UNO_QUERY );
- if ( xPropertySet.is() )
- {
- Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY );
- Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY );
- xMultiPropSet->firePropertiesChangeEvent( lcl_getLanguageDependentProperties(), xListener );
- }
-}
-
-void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (RuntimeException)
-{
- Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
- if ( xPeerDialog.is() )
- xPeerDialog->endDialog( i_result );
-}
-
-void SAL_CALL UnoDialogControl::setHelpId( const rtl::OUString& i_id ) throw (RuntimeException)
-{
- Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY );
- if ( xPeerDialog.is() )
- xPeerDialog->setHelpId( i_id );
-}
-
void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
@@ -2042,53 +453,6 @@ void UnoDialogControl::endExecute() throw(RuntimeException)
}
}
-void UnoDialogControl::addingControl( const Reference< XControl >& _rxControl )
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- UnoControlContainer::addingControl( _rxControl );
-
- if ( _rxControl.is() )
- {
- Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
- if ( xProps.is() )
- {
- Sequence< ::rtl::OUString > aNames( 4 );
- ::rtl::OUString* pNames = aNames.getArray();
- *pNames++ = ::rtl::OUString::createFromAscii( "PositionX" );
- *pNames++ = ::rtl::OUString::createFromAscii( "PositionY" );
- *pNames++ = ::rtl::OUString::createFromAscii( "Width" );
- *pNames++ = ::rtl::OUString::createFromAscii( "Height" );
-
- xProps->addPropertiesChangeListener( aNames, this );
- }
- }
-}
-
-void UnoDialogControl::removingControl( const Reference< XControl >& _rxControl )
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- UnoControlContainer::removingControl( _rxControl );
-
- if ( _rxControl.is() )
- {
- Reference< XMultiPropertySet > xProps( _rxControl->getModel(), UNO_QUERY );
- if ( xProps.is() )
- xProps->removePropertiesChangeListener( this );
- }
-
-}
-
-void SAL_CALL UnoDialogControl::changesOccurred( const ChangesEvent& ) throw (RuntimeException)
-{
- vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- // a tab controller model may have changed
-
- // #109067# in design mode don't notify the tab controller
- // about tab index changes
- if ( mxTabController.is() && !mbDesignMode )
- mxTabController->activateTabOrder();
-}
-
// XModifyListener
void SAL_CALL UnoDialogControl::modified(
const lang::EventObject& /*rEvent*/ )
@@ -2097,35 +461,30 @@ throw (RuntimeException)
ImplUpdateResourceResolver();
}
-// ----------------------------------------------------
-// Helper Method to convert relative url to physical location
-// ----------------------------------------------------
-
-::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl )
+void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
{
- ::rtl::OUString baseLocation;
- ::rtl::OUString url;
-
- rbase >>= baseLocation;
- rUrl >>= url;
-
- ::rtl::OUString absoluteURL( url );
- if ( url.getLength() > 0 )
+ sal_Int32 nLen = rEvents.getLength();
+ for( sal_Int32 i = 0; i < nLen; i++ )
{
- INetURLObject urlObj(baseLocation);
- urlObj.removeSegment();
- baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
-
- const INetURLObject protocolCheck( url );
- const INetProtocol protocol = protocolCheck.GetProtocol();
- if ( protocol == INET_PROT_NOT_VALID )
+ const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
+ Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
+ sal_Bool bOwnModel = (XControlModel*)xModel.get() == (XControlModel*)getModel().get();
+ if ( bOwnModel && rEvt.PropertyName.equalsAsciiL( "ImageURL", 8 ))
{
- ::rtl::OUString testAbsoluteURL;
- if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) )
- absoluteURL = testAbsoluteURL;
+ ::rtl::OUString aImageURL;
+ Reference< graphic::XGraphic > xGraphic;
+ if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
+ ( aImageURL.getLength() > 0 ))
+ {
+ ::rtl::OUString absoluteUrl =
+ getPhysicalLocation( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL )),
+ uno::makeAny(aImageURL));
+
+ xGraphic = Impl_getGraphicFromURL_nothrow( absoluteUrl );
+ }
+ ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), sal_True );
+ break;
}
}
-
- return absoluteURL;
+ ControlContainerBase::ImplModelPropertiesChanged(rEvents);
}
-
diff --git a/toolkit/source/controls/spinningprogress.cxx b/toolkit/source/controls/spinningprogress.cxx
new file mode 100755
index 000000000000..d4b89d5123ec
--- /dev/null
+++ b/toolkit/source/controls/spinningprogress.cxx
@@ -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.
+ *
+ ************************************************************************/
+
+#include "precompiled_toolkit.hxx"
+
+#include "toolkit/controls/spinningprogress.hxx"
+#include "toolkit/helper/servicenames.hxx"
+#include "toolkit/helper/unopropertyarrayhelper.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/throbber.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::beans::XPropertySetInfo;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= SpinningProgressControlModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ SpinningProgressControlModel::SpinningProgressControlModel()
+ {
+ // default image sets
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ try
+ {
+ Throbber::ImageSet aImageSets[] =
+ {
+ Throbber::IMAGES_16_PX, Throbber::IMAGES_32_PX, Throbber::IMAGES_64_PX
+ };
+ for ( size_t i=0; i < sizeof( aImageSets ) / sizeof( aImageSets[0] ); ++i )
+ {
+ const ::std::vector< ::rtl::OUString > aDefaultURLs( Throbber::getDefaultImageURLs( aImageSets[i] ) );
+ const Sequence< ::rtl::OUString > aImageURLs( &aDefaultURLs[0], aDefaultURLs.size() );
+ insertImageSet( i, aImageURLs );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SpinningProgressControlModel::SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource )
+ :SpinningProgressControlModel_Base( i_copySource )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SpinningProgressControlModel::~SpinningProgressControlModel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoControlModel* SpinningProgressControlModel::Clone() const
+ {
+ return new SpinningProgressControlModel( *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XPropertySetInfo > SAL_CALL SpinningProgressControlModel::getPropertySetInfo( ) throw(RuntimeException)
+ {
+ static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL SpinningProgressControlModel::getServiceName() throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( szServiceName_SpinningProgressControlModel );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL SpinningProgressControlModel::getImplementationName( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii( "org.openoffice.comp.toolkit.SpinningProgressControlModel" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL SpinningProgressControlModel::getSupportedServiceNames() throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(3);
+ aServiceNames[0] = ::rtl::OUString::createFromAscii( szServiceName_SpinningProgressControlModel );
+ aServiceNames[1] = ::rtl::OUString::createFromAscii( szServiceName_AnimatedImagesControlModel );
+ aServiceNames[2] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.UnoControlModel" );
+ return aServiceNames;
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
new file mode 100644
index 000000000000..b7e381ae27c7
--- /dev/null
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -0,0 +1,301 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_toolkit.hxx"
+
+#include <toolkit/controls/tabpagecontainer.hxx>
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/controls/geometrycontrolmodel.hxx>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <comphelper/processfactory.hxx>
+#include <osl/diagnose.h>
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+#include <com/sun/star/awt/XControlModel.hpp>
+#include <tools/diagnose_ex.h>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::view;
+
+#define WRONG_TYPE_EXCEPTION "Type must be ::com::sun::star::awt::tab::XTabPageModel!"
+// ----------------------------------------------------
+// class UnoControlTabPageContainerModel
+// ----------------------------------------------------
+UnoControlTabPageContainerModel::UnoControlTabPageContainerModel() : maContainerListeners( *this )
+{
+ ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_BORDER );
+ ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLED );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
+ ImplRegisterProperty( BASEPROPERTY_TEXT );
+}
+
+::rtl::OUString UnoControlTabPageContainerModel::getServiceName() throw(RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainerModel );
+}
+
+uno::Any UnoControlTabPageContainerModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ switch(nPropId)
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ return uno::makeAny( ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainer ) );
+ case BASEPROPERTY_BORDER:
+ return uno::makeAny((sal_Int16) 0); // No Border
+ default:
+ return UnoControlModel::ImplGetDefaultValue( nPropId );
+ }
+}
+
+::cppu::IPropertyArrayHelper& UnoControlTabPageContainerModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ com::sun::star::uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+Reference< ::com::sun::star::beans::XPropertySetInfo > UnoControlTabPageContainerModel::getPropertySetInfo( ) throw(RuntimeException)
+{
+ static Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+
+void SAL_CALL UnoControlTabPageContainerModel::insertByIndex( ::sal_Int32 nIndex, const com::sun::star::uno::Any& aElement) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ uno::Reference < ::awt::tab::XTabPageModel > xTabPageModel;
+ if(aElement >>= xTabPageModel)
+ {
+ if ( sal_Int32( m_aTabPageVector.size()) ==nIndex )
+ m_aTabPageVector.push_back( xTabPageModel );
+ else if ( sal_Int32( m_aTabPageVector.size()) > nIndex )
+ {
+ std::vector< uno::Reference< ::awt::tab::XTabPageModel > >::iterator aIter = m_aTabPageVector.begin();
+ aIter += nIndex;
+ m_aTabPageVector.insert( aIter, xTabPageModel );
+ }
+ else
+ throw IndexOutOfBoundsException( ::rtl::OUString(), (OWeakObject *)this );
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Element <<= aElement;
+ aEvent.Accessor <<= ::rtl::OUString::valueOf(nIndex);
+ maContainerListeners.elementInserted( aEvent );
+ }
+ else
+ throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( WRONG_TYPE_EXCEPTION )),
+ (OWeakObject *)this, 2 );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL UnoControlTabPageContainerModel::removeByIndex( ::sal_Int32 /*Index*/ ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+// XIndexReplace
+void SAL_CALL UnoControlTabPageContainerModel::replaceByIndex( ::sal_Int32 /*Index*/, const uno::Any& /*Element*/ ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL UnoControlTabPageContainerModel::getCount( ) throw (uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return sal_Int32( m_aTabPageVector.size());
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL UnoControlTabPageContainerModel::getByIndex( ::sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ if ( nIndex < 0 || nIndex > sal_Int32(m_aTabPageVector.size()) )
+ throw lang::IndexOutOfBoundsException();
+ return uno::makeAny(m_aTabPageVector[nIndex]);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL UnoControlTabPageContainerModel::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< Reference< com::sun::star::awt::XControlModel>* >(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL UnoControlTabPageContainerModel::hasElements( ) throw (uno::RuntimeException)
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ return !m_aTabPageVector.empty();
+}
+// XContainer
+void UnoControlTabPageContainerModel::addContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.addInterface( l );
+}
+
+void UnoControlTabPageContainerModel::removeContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException)
+{
+ maContainerListeners.removeInterface( l );
+}
+
+// ----------------------------------------------------
+// class UnoControlTabPageContainer
+// ----------------------------------------------------
+UnoControlTabPageContainer::UnoControlTabPageContainer():
+ m_aTabPageListeners( *this )
+{
+}
+
+OUString UnoControlTabPageContainer::GetComponentServiceName()
+{
+ return OUString::createFromAscii( "TabPageContainer" );
+}
+
+void SAL_CALL UnoControlTabPageContainer::dispose( ) throw(RuntimeException)
+{
+ lang::EventObject aEvt;
+ aEvt.Source = (::cppu::OWeakObject*)this;
+ m_aTabPageListeners.disposeAndClear( aEvt );
+ UnoControl::dispose();
+}
+
+void UnoControlTabPageContainer::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
+{
+ UnoControlBase::createPeer( rxToolkit, rParentPeer );
+
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ if ( m_aTabPageListeners.getLength() )
+ xTPContainer->addTabPageListener(&m_aTabPageListeners);
+}
+
+// -------------------------------------------------------------------
+// XTabPageContainer
+
+::sal_Int16 SAL_CALL UnoControlTabPageContainer::getActiveTabPageID() throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getActiveTabPageID();
+}
+void SAL_CALL UnoControlTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ xTPContainer->setActiveTabPageID(_activetabpageid);
+}
+::sal_Int32 SAL_CALL UnoControlTabPageContainer::getTabPageCount( ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getTabPageCount();
+}
+::sal_Bool SAL_CALL UnoControlTabPageContainer::isTabPageActive( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->isTabPageActive(tabPageIndex);
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL UnoControlTabPageContainer::getTabPage( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getTabPage(tabPageIndex);
+}
+Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL UnoControlTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW );
+ return xTPContainer->getTabPageByID(tabPageID);
+}
+void SAL_CALL UnoControlTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ m_aTabPageListeners.addInterface( listener );
+ if( getPeer().is() && m_aTabPageListeners.getLength() == 1 )
+ {
+ uno::Reference < awt::tab::XTabPageContainer > xTabPageContainer( getPeer(), uno::UNO_QUERY );
+ xTabPageContainer->addTabPageListener( &m_aTabPageListeners );
+ }
+}
+void SAL_CALL UnoControlTabPageContainer::removeTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
+{
+ if( getPeer().is() && m_aTabPageListeners.getLength() == 1 )
+ {
+ uno::Reference < awt::tab::XTabPageContainer > xTabPageContainer( getPeer(), uno::UNO_QUERY );
+ xTabPageContainer->addTabPageListener( &m_aTabPageListeners );
+ }
+ m_aTabPageListeners.removeInterface( listener );
+}
+
+void UnoControlTabPageContainer::updateFromModel()
+{
+ UnoControlTabPageContainer_Base::updateFromModel();
+ Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY );
+ ENSURE_OR_RETURN_VOID( xContainerListener.is(), "UnoListBoxControl::updateFromModel: a peer which is no ItemListListener?!" );
+
+ ContainerEvent aEvent;
+ aEvent.Source = getModel();
+ Sequence< Reference< XControl > > aControls = getControls();
+ const Reference< XControl >* pCtrls = aControls.getConstArray();
+ const Reference< XControl >* pCtrlsEnd = pCtrls + aControls.getLength();
+
+ for ( ; pCtrls < pCtrlsEnd; ++pCtrls )
+ {
+ aEvent.Element <<= *pCtrls;
+ xContainerListener->elementInserted( aEvent );
+ }
+}
+void SAL_CALL UnoControlTabPageContainer::addControl( const ::rtl::OUString& Name, const Reference< ::com::sun::star::awt::XControl >& Control ) throw (RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ControlContainerBase::addControl(Name,Control);
+ Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY );
+ ContainerEvent aEvent;
+ aEvent.Source = getModel();
+ aEvent.Element <<= Control;
+ xContainerListener->elementInserted( aEvent );
+}
+
+Reference< XInterface > SAL_CALL UnoControlTabPageContainer_CreateInstance( const Reference< XMultiServiceFactory >& )
+{
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new UnoControlTabPageContainer );
+}
+
+Reference< XInterface > SAL_CALL UnoControlTabPageContainerModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+{
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel<UnoControlTabPageContainerModel>() );
+}
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
new file mode 100644
index 000000000000..4afd46724cab
--- /dev/null
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -0,0 +1,404 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_toolkit.hxx"
+
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <vcl/wall.hxx>
+#include <vos/mutex.hxx>
+#include <toolkit/controls/tabpagemodel.hxx>
+#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/unopropertyarrayhelper.hxx>
+#include <toolkit/controls/stdtabcontroller.hxx>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/WindowAttribute.hpp>
+#include <com/sun/star/awt/UnoControlDialogModelProvider.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <tools/list.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/sequence.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/image.hxx>
+#include <toolkit/controls/geometrycontrolmodel.hxx>
+
+#include <map>
+#include <algorithm>
+#include <functional>
+#include "tools/urlobj.hxx"
+#include "osl/file.hxx"
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
+
+////HELPER
+::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl );
+
+// ----------------------------------------------------
+// class TabPageModel
+// ----------------------------------------------------
+
+//TabPageModel::TabPageModel()
+//{
+//}
+//TabPageModel::TabPageModel( uno::Reference< uno::XComponentContext > const & xCompContext)
+//{
+// (void) xCompContext;
+//}
+//
+//TabPageModel::~TabPageModel()
+//{
+//}
+//
+//////----- XInitialization -------------------------------------------------------------------
+//void SAL_CALL TabPageModel::initialize (const Sequence<Any>& rArguments)
+//{
+// sal_Int16 nPageId;
+// if ( rArguments.getLength() == 1 )
+// {
+// if ( !( rArguments[ 0 ] >>= nPageId ))
+// throw lang::IllegalArgumentException();
+// m_nTabPageId = nPageId;
+// }
+// else
+// m_nTabPageId = -1;
+//}
+//::sal_Int16 SAL_CALL TabPageModel::getTabPageID() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_nTabPageId;
+//}
+//::sal_Bool SAL_CALL TabPageModel::getEnabled() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_bEnabled;
+//}
+//void SAL_CALL TabPageModel::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_bEnabled = _enabled;
+//}
+//::rtl::OUString SAL_CALL TabPageModel::getTitle() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_sTitle;
+//}
+//void SAL_CALL TabPageModel::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_sTitle = _title;
+//}
+//::rtl::OUString SAL_CALL TabPageModel::getImageURL() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_sImageURL;
+//}
+//void SAL_CALL TabPageModel::setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_sImageURL = _imageurl;
+//}
+//::rtl::OUString SAL_CALL TabPageModel::getTooltip() throw (::com::sun::star::uno::RuntimeException)
+//{
+// return m_sTooltip;
+//}
+//void SAL_CALL TabPageModel::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException)
+//{
+// m_sTooltip = _tooltip;
+//}
+
+// ----------------------------------------------------
+// class UnoControlTabPageModel
+// ----------------------------------------------------
+UnoControlTabPageModel::UnoControlTabPageModel(Reference< XComponentContext >const & i_xCompContext) : m_xCompContext(i_xCompContext)
+{
+ ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
+ ImplRegisterProperty( BASEPROPERTY_TITLE );
+ ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
+ ImplRegisterProperty( BASEPROPERTY_HELPURL );
+ ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
+ ImplRegisterProperty( BASEPROPERTY_ENABLED );
+}
+
+::rtl::OUString UnoControlTabPageModel::getServiceName( ) throw(RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageModel );
+}
+
+Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+{
+ Any aAny;
+
+ switch ( nPropId )
+ {
+ case BASEPROPERTY_DEFAULTCONTROL:
+ aAny <<= ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPage );
+ break;
+ default:
+ aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
+ }
+
+ return aAny;
+}
+
+::cppu::IPropertyArrayHelper& UnoControlTabPageModel::getInfoHelper()
+{
+ static UnoPropertyArrayHelper* pHelper = NULL;
+ if ( !pHelper )
+ {
+ Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
+ pHelper = new UnoPropertyArrayHelper( aIDs );
+ }
+ return *pHelper;
+}
+// beans::XMultiPropertySet
+uno::Reference< beans::XPropertySetInfo > UnoControlTabPageModel::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ static uno::Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ return xInfo;
+}
+////----- XInitialization -------------------------------------------------------------------
+void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArguments)
+ throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
+{
+ sal_Int16 nPageId = -1;
+ if ( rArguments.getLength() == 1 )
+ {
+ if ( !( rArguments[ 0 ] >>= nPageId ))
+ throw lang::IllegalArgumentException();
+ m_nTabPageId = nPageId;
+ }
+ else if ( rArguments.getLength() == 2 )
+ {
+ if ( !( rArguments[ 0 ] >>= nPageId ))
+ throw lang::IllegalArgumentException();
+ m_nTabPageId = nPageId;
+ ::rtl::OUString sURL;
+ if ( !( rArguments[ 1 ] >>= sURL ))
+ throw lang::IllegalArgumentException();
+ Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create(m_xCompContext,sURL);
+ if ( xDialogModel.is() )
+ {
+ Sequence< ::rtl::OUString> aNames = xDialogModel->getElementNames();
+ const ::rtl::OUString* pIter = aNames.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aNames.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ try
+ {
+ Any aElement(xDialogModel->getByName(*pIter));
+ xDialogModel->removeByName(*pIter);
+ insertByName(*pIter,aElement);
+ }
+ catch(const Exception& ex)
+ {
+ (void)ex;
+ }
+ }
+ Reference<XPropertySet> xDialogProp(xDialogModel,UNO_QUERY);
+ if ( xDialogProp.is() )
+ {
+ static const ::rtl::OUString s_sResourceResolver(RTL_CONSTASCII_USTRINGPARAM("ResourceResolver"));
+ Reference<XPropertySet> xThis(*this,UNO_QUERY);
+ xThis->setPropertyValue(s_sResourceResolver,xDialogProp->getPropertyValue(s_sResourceResolver));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_IMAGEURL),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_IMAGEURL)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_HELPTEXT),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_HELPTEXT)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_ENABLED),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_ENABLED)));
+ xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_HELPURL),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_HELPURL)));
+ }
+ }
+ }
+ else
+ m_nTabPageId = -1;
+}
+//===== Service ===============================================================
+Reference< XInterface > SAL_CALL UnoControlTabPageModel_CreateInstance( const Reference< XMultiServiceFactory >& xServiceFactory)
+{
+ Reference < ::com::sun::star::beans::XPropertySet > xPropertySet (xServiceFactory, UNO_QUERY);
+ Any any = xPropertySet->getPropertyValue(::rtl::OUString::createFromAscii("DefaultContext"));
+ Reference < XComponentContext > xCompCtx;
+ any >>= xCompCtx;
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel<UnoControlTabPageModel>(xCompCtx) );
+ //return Reference < XInterface > ( (::cppu::OWeakObject* ) new UnoControlTabPageModel(xCompCtx));
+}
+
+::rtl::OUString UnoControlTabPageModel_getImplementationName (void) throw(RuntimeException)
+{
+ return rtl::OUString::createFromAscii("com.sun.star.awt.tab.UnoControlTabPageModel");
+}
+
+Sequence<rtl::OUString> SAL_CALL UnoControlTabPageModel_getSupportedServiceNames (void)
+ throw (RuntimeException)
+{
+ static const ::rtl::OUString sServiceName(
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.tab.UnoControlTabPageModel"));
+ return Sequence<rtl::OUString>(&sServiceName, 1);
+}
+//=============================================================================
+// = class UnoControlTabPage
+// ============================================================================
+
+UnoControlTabPage::UnoControlTabPage() :
+ m_bWindowListener(false)
+{
+ maComponentInfos.nWidth = 280;
+ maComponentInfos.nHeight = 400;
+}
+UnoControlTabPage::~UnoControlTabPage()
+{
+}
+
+::rtl::OUString UnoControlTabPage::GetComponentServiceName()
+{
+ return ::rtl::OUString::createFromAscii( "TabPageModel" );
+}
+
+void UnoControlTabPage::dispose() throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ EventObject aEvt;
+ aEvt.Source = static_cast< ::cppu::OWeakObject* >( this );
+ ControlContainerBase::dispose();
+}
+
+void SAL_CALL UnoControlTabPage::disposing( const EventObject& Source )throw(RuntimeException)
+{
+ ControlContainerBase::disposing( Source );
+}
+
+void UnoControlTabPage::createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ImplUpdateResourceResolver();
+
+ UnoControlContainer::createPeer( rxToolkit, rParentPeer );
+
+ Reference < tab::XTabPage > xTabPage( getPeer(), UNO_QUERY );
+ if ( xTabPage.is() )
+ {
+ if ( !m_bWindowListener )
+ {
+ Reference< XWindowListener > xWL( static_cast< cppu::OWeakObject*>( this ), UNO_QUERY );
+ addWindowListener( xWL );
+ m_bWindowListener = true;
+ }
+ }
+}
+
+static ::Size ImplMapPixelToAppFont( OutputDevice* pOutDev, const ::Size& aSize )
+{
+ ::Size aTmp = pOutDev->PixelToLogic( aSize, MAP_APPFONT );
+ return aTmp;
+}
+// ::com::sun::star::awt::XWindowListener
+void SAL_CALL UnoControlTabPage::windowResized( const ::com::sun::star::awt::WindowEvent& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ OutputDevice*pOutDev = Application::GetDefaultDevice();
+ DBG_ASSERT( pOutDev, "Missing Default Device!" );
+ if ( pOutDev && !mbSizeModified )
+ {
+ // Currentley we are simply using MAP_APPFONT
+ ::Size aAppFontSize( e.Width, e.Height );
+
+ Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW );
+ Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY );
+ OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" );
+ if ( xDialogDevice.is() )
+ {
+ DeviceInfo aDeviceInfo( xDialogDevice->getInfo() );
+ aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
+ aAppFontSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
+ }
+
+ aAppFontSize = ImplMapPixelToAppFont( pOutDev, aAppFontSize );
+
+ // Remember that changes have been done by listener. No need to
+ // update the position because of property change event.
+ mbSizeModified = true;
+ Sequence< rtl::OUString > aProps( 2 );
+ Sequence< Any > aValues( 2 );
+ // Properties in a sequence must be sorted!
+ aProps[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ));
+ aProps[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ));
+ aValues[0] <<= aAppFontSize.Height();
+ aValues[1] <<= aAppFontSize.Width();
+
+ ImplSetPropertyValues( aProps, aValues, true );
+ mbSizeModified = false;
+ }
+}
+
+void SAL_CALL UnoControlTabPage::windowMoved( const ::com::sun::star::awt::WindowEvent& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ OutputDevice*pOutDev = Application::GetDefaultDevice();
+ DBG_ASSERT( pOutDev, "Missing Default Device!" );
+ if ( pOutDev && !mbPosModified )
+ {
+ // Currentley we are simply using MAP_APPFONT
+ Any aAny;
+ ::Size aTmp( e.X, e.Y );
+ aTmp = ImplMapPixelToAppFont( pOutDev, aTmp );
+
+ // Remember that changes have been done by listener. No need to
+ // update the position because of property change event.
+ mbPosModified = true;
+ Sequence< rtl::OUString > aProps( 2 );
+ Sequence< Any > aValues( 2 );
+ aProps[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ));
+ aProps[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ));
+ aValues[0] <<= aTmp.Width();
+ aValues[1] <<= aTmp.Height();
+
+ ImplSetPropertyValues( aProps, aValues, true );
+ mbPosModified = false;
+ }
+}
+
+void SAL_CALL UnoControlTabPage::windowShown( const ::com::sun::star::lang::EventObject& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ (void)e;
+}
+
+void SAL_CALL UnoControlTabPage::windowHidden( const ::com::sun::star::lang::EventObject& e )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ (void)e;
+}
diff --git a/toolkit/source/controls/tksimpleanimation.cxx b/toolkit/source/controls/tksimpleanimation.cxx
index 3d89bf59af82..6ad33608f6ee 100644
--- a/toolkit/source/controls/tksimpleanimation.cxx
+++ b/toolkit/source/controls/tksimpleanimation.cxx
@@ -130,27 +130,6 @@ namespace toolkit
}
//--------------------------------------------------------------------
- uno::Any UnoSimpleAnimationControl::queryAggregation( const uno::Type & rType )
- throw( uno::RuntimeException )
- {
- uno::Any aRet = UnoControlBase::queryAggregation( rType );
- if ( !aRet.hasValue() )
- aRet = UnoSimpleAnimationControl_Base::queryInterface( rType );
- return aRet;
- }
-
- //--------------------------------------------------------------------
- IMPLEMENT_FORWARD_XTYPEPROVIDER2( UnoSimpleAnimationControl, UnoControlBase, UnoSimpleAnimationControl_Base )
-
- //--------------------------------------------------------------------
- void UnoSimpleAnimationControl::dispose() throw( uno::RuntimeException )
- {
- ::osl::ClearableMutexGuard aGuard( GetMutex() );
-
- UnoControl::dispose();
- }
-
- //--------------------------------------------------------------------
::rtl::OUString SAL_CALL UnoSimpleAnimationControl::getImplementationName()
throw( uno::RuntimeException )
{
@@ -161,26 +140,20 @@ namespace toolkit
uno::Sequence< ::rtl::OUString > SAL_CALL UnoSimpleAnimationControl::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- uno::Sequence< ::rtl::OUString > aServices( UnoControlBase::getSupportedServiceNames() );
+ uno::Sequence< ::rtl::OUString > aServices( UnoSimpleAnimationControl_Base::getSupportedServiceNames() );
aServices.realloc( aServices.getLength() + 1 );
aServices[ aServices.getLength() - 1 ] = ::rtl::OUString::createFromAscii( szServiceName_UnoSimpleAnimationControl );
return aServices;
}
//--------------------------------------------------------------------
- void UnoSimpleAnimationControl::createPeer( const uno::Reference< awt::XToolkit > &rxToolkit,
- const uno::Reference< awt::XWindowPeer > &rParentPeer )
- throw( uno::RuntimeException )
- {
- UnoControl::createPeer( rxToolkit, rParentPeer );
- }
-
- //--------------------------------------------------------------------
void SAL_CALL UnoSimpleAnimationControl::start() throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( GetMutex() );
-
- uno::Reference< XSimpleAnimation > xAnimation( getPeer(), uno::UNO_QUERY );
+ uno::Reference< XSimpleAnimation > xAnimation;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xAnimation.set( getPeer(), uno::UNO_QUERY );
+ }
if ( xAnimation.is() )
xAnimation->start();
}
@@ -188,9 +161,11 @@ namespace toolkit
//--------------------------------------------------------------------
void SAL_CALL UnoSimpleAnimationControl::stop() throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( GetMutex() );
-
- uno::Reference< XSimpleAnimation > xAnimation( getPeer(), uno::UNO_QUERY );
+ uno::Reference< XSimpleAnimation > xAnimation;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xAnimation.set( getPeer(), uno::UNO_QUERY );
+ }
if ( xAnimation.is() )
xAnimation->stop();
}
@@ -199,9 +174,11 @@ namespace toolkit
void SAL_CALL UnoSimpleAnimationControl::setImageList( const uno::Sequence< uno::Reference< graphic::XGraphic > >& ImageList )
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( GetMutex() );
-
- uno::Reference< XSimpleAnimation > xAnimation( getPeer(), uno::UNO_QUERY );
+ uno::Reference< XSimpleAnimation > xAnimation;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xAnimation.set( getPeer(), uno::UNO_QUERY );
+ }
if ( xAnimation.is() )
xAnimation->setImageList( ImageList );
}
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index c3149a8cc869..3afe3a90f1ee 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -808,6 +808,7 @@ void UnoControlContainer::createPeer( const uno::Reference< awt::XToolkit >& rxT
aCtrls.getArray()[n]->createPeer( rxToolkit, getPeer() );
uno::Reference< awt::XVclContainerPeer > xC( getPeer(), uno::UNO_QUERY );
+ OSL_ENSURE(xC.is(),"Peer isn't valid. Please check!");
xC->enableDialogControl( sal_True );
ImplActivateTabControllers();
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 91d202409e86..e55f4809ed0b 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -532,6 +532,8 @@ void UnoControlModel::dispose( ) throw(::com::sun::star::uno::RuntimeException)
aEvt.Source = (::com::sun::star::uno::XAggregation*)(::cppu::OWeakAggObject*)this;
maDisposeListeners.disposeAndClear( aEvt );
+ BrdcstHelper.aLC.disposeAndClear( aEvt );
+
// let the property set helper notify our property listeners
OPropertySetHelper::disposing();
}
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index d3838a7421a4..87d46a592d17 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -1801,6 +1801,11 @@ struct UnoControlListBoxModel_Data
return aItems;
}
+ void copyItems( const UnoControlListBoxModel_Data& i_copySource )
+ {
+ m_aListItems = i_copySource.m_aListItems;
+ }
+
void setAllItems( const ::std::vector< ListItem >& i_rItems )
{
m_aListItems = i_rItems;
@@ -1852,6 +1857,7 @@ UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_
,m_pData( new UnoControlListBoxModel_Data( *this ) )
,m_aItemListListeners( GetMutex() )
{
+ m_pData->copyItems( *i_rSource.m_pData );
}
UnoControlListBoxModel::~UnoControlListBoxModel()
{
@@ -4356,3 +4362,4 @@ sal_Bool UnoFixedLineControl::isTransparent() throw(uno::RuntimeException)
{
return sal_True;
}
+
diff --git a/toolkit/source/helper/listenermultiplexer.cxx b/toolkit/source/helper/listenermultiplexer.cxx
index 9b8df60521ae..ed2fe978b169 100644
--- a/toolkit/source/helper/listenermultiplexer.cxx
+++ b/toolkit/source/helper/listenermultiplexer.cxx
@@ -211,3 +211,9 @@ IMPL_LISTENERMULTIPLEXER_BASEMETHODS( TreeEditListenerMultiplexer, ::com::sun::s
// ----------------------------------------------------
IMPL_LISTENERMULTIPLEXER_BASEMETHODS( SelectionListenerMultiplexer, ::com::sun::star::awt::grid::XGridSelectionListener )
IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( SelectionListenerMultiplexer, ::com::sun::star::awt::grid::XGridSelectionListener, selectionChanged, ::com::sun::star::awt::grid::GridSelectionEvent )
+
+// ----------------------------------------------------
+// class SelectionListenerMultiplexer
+// ----------------------------------------------------
+IMPL_LISTENERMULTIPLEXER_BASEMETHODS( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener )
+IMPL_LISTENERMULTIPLEXER_LISTENERMETHOD( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener, tabPageActivated, ::com::sun::star::awt::tab::TabPageActivatedEvent )
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index 3a83465a3218..1e90c0172e83 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -66,6 +66,7 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::awt::XDevice;
using ::com::sun::star::awt::FontDescriptor;
using ::com::sun::star::style::VerticalAlignment;
+using ::com::sun::star::graphic::XGraphic;
struct ImplPropertyInfo
{
@@ -181,7 +182,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_3 ( "FormatKey", FORMATKEY, sal_Int32, BOUND, MAYBEVOID, TRANSIENT ),
DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
- DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ),
+ DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< XGraphic >, BOUND, TRANSIENT ),
DECL_PROP_2 ( "HelpText", HELPTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "HelpURL", HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "HideInactiveSelection", HIDEINACTIVESELECTION, bool, BOUND, MAYBEDEFAULT ),
@@ -218,6 +219,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_2 ( "PushButtonType", PUSHBUTTONTYPE, sal_Int16, BOUND, MAYBEDEFAULT),
DECL_PROP_2 ( "ReadOnly", READONLY, bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "Repeat", REPEAT, bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "AutoRepeat", AUTO_REPEAT, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "RepeatDelay", REPEAT_DELAY, sal_Int32, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ScaleImage", SCALEIMAGE, bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ScaleMode", IMAGE_SCALE_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index 477032538af8..37f33c4168ff 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -51,8 +51,14 @@
#include "toolkit/controls/tkspinbutton.hxx"
#include <toolkit/controls/tksimpleanimation.hxx>
#include <toolkit/controls/tkthrobber.hxx>
+#include <toolkit/controls/animatedimages.hxx>
+#include <toolkit/controls/spinningprogress.hxx>
#include <toolkit/controls/dialogcontrol.hxx>
+#include <toolkit/controls/tabpagemodel.hxx>
+#include <toolkit/controls/tabpagecontainer.hxx>
#include "toolkit/dllapi.h"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
namespace toolkit
{
@@ -135,6 +141,14 @@ namespace toolkit
if ( pRet ) \
return pRet; \
+#define TRY_OOO_FACTORY( ImplName, ServiceName ) \
+ pRet = tryCreateFactory( sImplementationName, "org.openoffice.comp.toolkit." #ImplName, \
+ ServiceName, NULL, \
+ ImplName##_CreateInstance, xServiceFactory \
+ ); \
+ if ( pRet ) \
+ return pRet; \
+
using namespace toolkit;
IMPL_CREATEINSTANCE2( VCLXToolkit )
@@ -195,6 +209,13 @@ IMPL_CREATEINSTANCE( UnoSimpleAnimationControl )
IMPL_CREATEINSTANCE( UnoSimpleAnimationControlModel )
IMPL_CREATEINSTANCE( UnoThrobberControl )
IMPL_CREATEINSTANCE( UnoThrobberControlModel )
+IMPL_CREATEINSTANCE( UnoControlTabPage )
+//IMPL_CREATEINSTANCE( UnoControlTabPageModel )
+//IMPL_CREATEINSTANCE( UnoControlTabPageContainer )
+//IMPL_CREATEINSTANCE( UnoControlTabPageContainerModel )
+IMPL_CREATEINSTANCE( AnimatedImagesControl )
+IMPL_CREATEINSTANCE( AnimatedImagesControlModel )
+IMPL_CREATEINSTANCE( SpinningProgressControlModel )
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControl_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControlModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
@@ -204,6 +225,11 @@ extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlTabPageContainer_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlTabPageContainerModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+
+//extern sal_Bool SAL_CALL UnoControlTabPageModel_component_writeInfo(void * serviceManager, void * registryKey);
+extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlTabPageModel_CreateInstance (const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
@@ -288,19 +314,24 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplemen
CHECKANDCREATEFACTORY( UnoSimpleAnimationControl, szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl )
CHECKANDCREATEFACTORY( UnoThrobberControlModel, szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel )
CHECKANDCREATEFACTORY( UnoThrobberControl, szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl )
+ TRY_OOO_FACTORY( AnimatedImagesControl, szServiceName_AnimatedImagesControl )
+ TRY_OOO_FACTORY( AnimatedImagesControlModel, szServiceName_AnimatedImagesControlModel )
+ TRY_OOO_FACTORY( SpinningProgressControlModel, szServiceName_SpinningProgressControlModel )
CHECKANDCREATEFACTORY( UnoFixedHyperlinkControl, szServiceName_UnoControlFixedHyperlink, NULL )
CHECKANDCREATEFACTORY( UnoControlFixedHyperlinkModel, szServiceName_UnoControlFixedHyperlinkModel, NULL )
- CHECKANDCREATEFACTORY( GridControl, szServiceName_GridControl, NULL );
- CHECKANDCREATEFACTORY( GridControlModel, szServiceName_GridControlModel, NULL );
- CHECKANDCREATEFACTORY( DefaultGridDataModel, szServiceName_DefaultGridDataModel, NULL );
- CHECKANDCREATEFACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL );
- CHECKANDCREATEFACTORY( GridColumn, szServiceName_GridColumn, NULL );
+ CHECKANDCREATEFACTORY( GridControl, szServiceName_GridControl, NULL )
+ CHECKANDCREATEFACTORY( GridControlModel, szServiceName_GridControlModel, NULL )
+ CHECKANDCREATEFACTORY( DefaultGridDataModel, szServiceName_DefaultGridDataModel, NULL )
+ CHECKANDCREATEFACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL )
+ CHECKANDCREATEFACTORY( GridColumn, szServiceName_GridColumn, NULL )
+ CHECKANDCREATEFACTORY( UnoControlTabPageModel, szServiceName_UnoControlTabPageModel, NULL )
+ CHECKANDCREATEFACTORY( UnoControlTabPage, szServiceName_UnoControlTabPage, NULL )
+ CHECKANDCREATEFACTORY( UnoControlTabPageContainerModel, szServiceName_UnoControlTabPageContainerModel, NULL )
+ CHECKANDCREATEFACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL )
if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 )
return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
-
-
if( pRet == 0 )
pRet = comp_Layout_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
}
diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx
index f57f52f13e57..383adb22b9de 100644
--- a/toolkit/source/helper/servicenames.cxx
+++ b/toolkit/source/helper/servicenames.cxx
@@ -92,6 +92,9 @@ const sal_Char __FAR_DATA szServiceName_TreeControl[] = "com.sun.star.awt.tree.T
const sal_Char __FAR_DATA szServiceName_TreeControlModel[] = "com.sun.star.awt.tree.TreeControlModel";
const sal_Char __FAR_DATA szServiceName_MutableTreeDataModel[] = "com.sun.star.awt.tree.MutableTreeDataModel";
const sal_Char __FAR_DATA szServiceName_UnoSimpleAnimationControlModel[] = "com.sun.star.awt.UnoSimpleAnimationControlModel", szServiceName2_UnoSimpleAnimationControlModel[] = "com.sun.star.awt.UnoControlSimpleAnimationModel";
+const sal_Char __FAR_DATA szServiceName_AnimatedImagesControl[] = "com.sun.star.awt.AnimatedImagesControl";
+const sal_Char __FAR_DATA szServiceName_AnimatedImagesControlModel[] = "com.sun.star.awt.AnimatedImagesControlModel";
+const sal_Char __FAR_DATA szServiceName_SpinningProgressControlModel[] = "com.sun.star.awt.SpinningProgressControlModel";
const sal_Char __FAR_DATA szServiceName_UnoSimpleAnimationControl[] = "com.sun.star.awt.UnoSimpleAnimationControl", szServiceName2_UnoSimpleAnimationControl[] = "com.sun.star.awt.UnoControlSimpleAnimation";
const sal_Char __FAR_DATA szServiceName_UnoThrobberControlModel[] = "com.sun.star.awt.UnoThrobberControlModel", szServiceName2_UnoThrobberControlModel[] = "com.sun.star.awt.UnoControlThrobberModel";
const sal_Char __FAR_DATA szServiceName_UnoThrobberControl[] = "com.sun.star.awt.UnoThrobberControl", szServiceName2_UnoThrobberControl[] = "com.sun.star.awt.UnoControlThrobber";
@@ -102,3 +105,8 @@ const sal_Char __FAR_DATA szServiceName_GridControlModel[] = "com.sun.star.awt.g
const sal_Char __FAR_DATA szServiceName_DefaultGridDataModel[] = "com.sun.star.awt.grid.DefaultGridDataModel";
const sal_Char __FAR_DATA szServiceName_DefaultGridColumnModel[] = "com.sun.star.awt.grid.DefaultGridColumnModel";
const sal_Char __FAR_DATA szServiceName_GridColumn[] = "com.sun.star.awt.grid.GridColumn";
+const sal_Char __FAR_DATA szServiceName_UnoControlTabPage[] = "com.sun.star.awt.tab.UnoControlTabPage";
+const sal_Char __FAR_DATA szServiceName_UnoControlTabPageModel[] = "com.sun.star.awt.tab.UnoControlTabPageModel";
+const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainerModel[] = "com.sun.star.awt.tab.UnoControlTabPageContainerModel";
+const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainer[] = "com.sun.star.awt.tab.UnoControlTabPageContainer";
+
diff --git a/toolkit/source/helper/throbberimpl.cxx b/toolkit/source/helper/throbberimpl.cxx
deleted file mode 100644
index 7a8e260ab4b8..000000000000
--- a/toolkit/source/helper/throbberimpl.cxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "precompiled_toolkit.hxx"
-#include <toolkit/helper/throbberimpl.hxx>
-
-#include <vcl/svapp.hxx>
-#include <vcl/fixed.hxx>
-
-//........................................................................
-namespace toolkit
-//........................................................................
-{
- using namespace ::com::sun::star;
-
- //--------------------------------------------------------------------
- Throbber_Impl::Throbber_Impl( uno::Reference< VCLXWindow > xParent,
- sal_Int32 nStepTime,
- sal_Bool bRepeat )
- :mrMutex( Application::GetSolarMutex() )
- {
- mxParent = xParent;
- mbRepeat = bRepeat;
- mnStepTime = nStepTime;
- maWaitTimer.SetTimeout( mnStepTime );
- maWaitTimer.SetTimeoutHdl( LINK( this, Throbber_Impl, TimeOutHdl ) );
- }
-
- //--------------------------------------------------------------------
- Throbber_Impl::~Throbber_Impl()
- {
- maWaitTimer.Stop();
- mxParent = NULL;
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::start() throw ( uno::RuntimeException )
- {
- ::vos::OGuard aGuard( GetMutex() );
-
- mnCurStep = 0;
- maWaitTimer.Start();
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::stop() throw ( uno::RuntimeException )
- {
- ::vos::OGuard aGuard( GetMutex() );
-
- maWaitTimer.Stop();
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::setImageList( const uno::Sequence< uno::Reference< graphic::XGraphic > >& rImageList )
- throw ( uno::RuntimeException )
- {
- ::vos::OGuard aGuard( GetMutex() );
-
- maImageList = rImageList;
-
- mnStepCount = maImageList.getLength();
- FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() );
- if ( pImage )
- {
- if ( mnStepCount )
- pImage->SetImage( maImageList[ 0 ] );
- else
- pImage->SetImage( Image() );
- }
- }
-
- //--------------------------------------------------------------------
- void Throbber_Impl::initImage()
- throw ( uno::RuntimeException )
- {
- FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() );
- if ( pImage && maImageList.getLength() )
- pImage->SetImage( maImageList[ 0 ] );
- }
-
- //--------------------------------------------------------------------
- sal_Bool Throbber_Impl::isHCMode()
- throw ( uno::RuntimeException )
- {
- FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() );
- if ( pImage )
- return pImage->GetSettings().GetStyleSettings().GetHighContrastMode();
- else
- return Application::GetSettings().GetStyleSettings().GetHighContrastMode();
- }
-
- // -----------------------------------------------------------------------
- IMPL_LINK( Throbber_Impl, TimeOutHdl, Throbber_Impl*, EMPTYARG )
- {
- ::vos::OGuard aGuard( GetMutex() );
-
- FixedImage* pImage = static_cast< FixedImage* >( mxParent->GetWindow() );
-
- if ( !pImage || !maImageList.getLength() )
- return 0;
-
- if ( mnCurStep < mnStepCount - 1 )
- mnCurStep += 1;
- else
- mnCurStep = 0;
-
- pImage->SetImage( maImageList[ mnCurStep ] );
-
- return 0;
- }
-
-//........................................................................
-} // namespacetoolkit
-//........................................................................
-
diff --git a/toolkit/source/helper/tkresmgr.cxx b/toolkit/source/helper/tkresmgr.cxx
index 4e1e4153daf1..d0336c27bdf5 100644
--- a/toolkit/source/helper/tkresmgr.cxx
+++ b/toolkit/source/helper/tkresmgr.cxx
@@ -29,14 +29,21 @@
#include "precompiled_toolkit.hxx"
#include <toolkit/helper/tkresmgr.hxx>
#include <tools/simplerm.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
#ifndef _TOOLS_RESMGR_HXX_
#include <tools/resmgr.hxx>
#endif
-
+#include <tools/diagnose_ex.h>
#include <vcl/svapp.hxx>
-
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::graphic::XGraphic;
+using ::com::sun::star::graphic::XGraphicProvider;
+using namespace ::com::sun::star;
// -----------------------------------------------------------------------------
// TkResMgr
// -----------------------------------------------------------------------------
@@ -98,3 +105,27 @@ Image TkResMgr::loadImage( sal_uInt16 nResId )
}
// -----------------------------------------------------------------------------
+Image TkResMgr::getImageFromURL( const ::rtl::OUString& i_rImageURL )
+{
+ if ( !i_rImageURL.getLength() )
+ return Image();
+
+ try
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XGraphicProvider > xProvider;
+ if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ aMediaProperties.put( "URL", i_rImageURL );
+ Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() );
+ return Image( xGraphic );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return Image();
+}
+
diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component
index e782283c39eb..c147d2b2521d 100644
--- a/toolkit/util/tk.component
+++ b/toolkit/util/tk.component
@@ -35,6 +35,18 @@
<service name="com.sun.star.awt.Layout"/>
<service name="com.sun.star.comp.awt.Layout"/>
</implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPage">
+ <service name="com.sun.star.awt.tab.UnoControlTabPage"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPageModel">
+ <service name="com.sun.star.awt.tab.UnoControlTabPageModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPageContainerModel">
+ <service name="com.sun.star.awt.tab.UnoControlTabPageContainerModel"/>
+ </implementation>
+ <implementation name="stardiv.Toolkit.UnoControlTabPageContainer">
+ <service name="com.sun.star.awt.tab.UnoControlTabPageContainer"/>
+ </implementation>
<implementation name="stardiv.Toolkit.DefaultGridColumnModel">
<service name="com.sun.star.awt.grid.DefaultGridColumnModel"/>
</implementation>
@@ -257,6 +269,15 @@
<service name="com.sun.star.awt.UnoControlSimpleAnimationModel"/>
<service name="com.sun.star.awt.UnoSimpleAnimationControlModel"/>
</implementation>
+ <implementation name="org.openoffice.comp.toolkit.SpinningProgressControlModel">
+ <service name="com.sun.star.awt.SpinningProgressControlModel"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.toolkit.AnimatedImagesControlModel">
+ <service name="com.sun.star.awt.AnimatedImagesControlModel"/>
+ </implementation>
+ <implementation name="org.openoffice.comp.toolkit.AnimatedImagesControl">
+ <service name="com.sun.star.awt.AnimatedImagesControl"/>
+ </implementation>
<implementation name="stardiv.Toolkit.UnoSpinButtonControl">
<service name="com.sun.star.awt.UnoControlSpinButton"/>
</implementation>
diff --git a/ucb/source/ucp/webdav/ContentProperties.cxx b/ucb/source/ucp/webdav/ContentProperties.cxx
index 2285ad28a888..95bc573ecaf7 100644
--- a/ucb/source/ucp/webdav/ContentProperties.cxx
+++ b/ucb/source/ucp/webdav/ContentProperties.cxx
@@ -120,14 +120,14 @@ ContentProperties::ContentProperties( const DAVResource& rResource )
std::vector< DAVPropertyValue >::const_iterator it
= rResource.properties.begin();
- std::vector< DAVPropertyValue >::const_iterator end
+ std::vector< DAVPropertyValue >::const_iterator end
= rResource.properties.end();
- while ( it != end )
- {
+ while ( it != end )
+ {
addProperty( (*it) );
++it;
- }
+ }
if ( rResource.uri.getStr()[ rResource.uri.getLength() - 1 ]
== sal_Unicode( '/' ) )
@@ -158,6 +158,13 @@ ContentProperties::ContentProperties( const rtl::OUString & rTitle )
}
//=========================================================================
+ContentProperties::ContentProperties()
+: m_xProps( new PropertyValueMap ),
+ m_bTrailingSlash( sal_False )
+{
+}
+
+//=========================================================================
ContentProperties::ContentProperties( const ContentProperties & rOther )
: m_aEscapedTitle( rOther.m_aEscapedTitle ),
m_xProps( rOther.m_xProps.get()
@@ -254,7 +261,7 @@ void ContentProperties::UCBNamesToDAVNames(
{
if ( !bCreationDate )
{
- propertyNames.push_back( DAVProperties::CREATIONDATE );
+ propertyNames.push_back( DAVProperties::CREATIONDATE );
bCreationDate = sal_True;
}
}
@@ -265,7 +272,7 @@ void ContentProperties::UCBNamesToDAVNames(
{
if ( !bLastModified )
{
- propertyNames.push_back(
+ propertyNames.push_back(
DAVProperties::GETLASTMODIFIED );
bLastModified = sal_True;
}
@@ -277,7 +284,7 @@ void ContentProperties::UCBNamesToDAVNames(
{
if ( !bContentType )
{
- propertyNames.push_back(
+ propertyNames.push_back(
DAVProperties::GETCONTENTTYPE );
bContentType = sal_True;
}
@@ -289,7 +296,7 @@ void ContentProperties::UCBNamesToDAVNames(
{
if ( !bContentLength )
{
- propertyNames.push_back(
+ propertyNames.push_back(
DAVProperties::GETCONTENTLENGTH );
bContentLength = sal_True;
}
@@ -307,7 +314,7 @@ void ContentProperties::UCBNamesToDAVNames(
{
if ( !bResourceType )
{
- propertyNames.push_back( DAVProperties::RESOURCETYPE );
+ propertyNames.push_back( DAVProperties::RESOURCETYPE );
bResourceType = sal_True;
}
}
@@ -436,7 +443,7 @@ void ContentProperties::addProperties(
const std::vector< DAVPropertyValue > & rProps )
{
std::vector< DAVPropertyValue >::const_iterator it = rProps.begin();
- std::vector< DAVPropertyValue >::const_iterator end = rProps.end();
+ const std::vector< DAVPropertyValue >::const_iterator end = rProps.end();
while ( it != end )
{
@@ -571,3 +578,96 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
// Save property.
(*m_xProps)[ rName ] = PropertyValue( rValue, bIsCaseSensitive );
}
+
+//=========================================================================
+//=========================================================================
+//
+// CachableContentProperties Implementation.
+//
+//=========================================================================
+//=========================================================================
+
+namespace
+{
+ bool isCachable( rtl::OUString const & rName,
+ bool isCaseSensitive )
+ {
+ static rtl::OUString aNonCachableProps [] =
+ {
+ DAVProperties::LOCKDISCOVERY,
+
+ DAVProperties::GETETAG,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ETag" ) ),
+
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateModified" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Last-Modified" ) ),
+ DAVProperties::GETLASTMODIFIED,
+
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Content-Length" ) ),
+ DAVProperties::GETCONTENTLENGTH,
+
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Date" ) )
+ };
+
+ for ( sal_uInt32 n = 0;
+ n < ( sizeof( aNonCachableProps )
+ / sizeof( aNonCachableProps[ 0 ] ) );
+ ++n )
+ {
+ if ( isCaseSensitive )
+ {
+ if ( rName.equals( aNonCachableProps[ n ] ) )
+ return false;
+ }
+ else
+ if ( rName.equalsIgnoreAsciiCase( aNonCachableProps[ n ] ) )
+ return false;
+ }
+ return true;
+ }
+
+} // namespace
+
+//=========================================================================
+CachableContentProperties::CachableContentProperties(
+ const ContentProperties & rProps )
+{
+ addProperties( rProps );
+}
+
+//=========================================================================
+void CachableContentProperties::addProperties(
+ const ContentProperties & rProps )
+{
+ const std::auto_ptr< PropertyValueMap > & props = rProps.getProperties();
+
+ PropertyValueMap::const_iterator it = props->begin();
+ const PropertyValueMap::const_iterator end = props->end();
+
+ while ( it != end )
+ {
+ if ( isCachable( (*it).first, (*it).second.isCaseSensitive() ) )
+ m_aProps.addProperty( (*it).first,
+ (*it).second.value(),
+ (*it).second.isCaseSensitive() );
+
+ ++it;
+ }
+}
+
+//=========================================================================
+void CachableContentProperties::addProperties(
+ const std::vector< DAVPropertyValue > & rProps )
+{
+ std::vector< DAVPropertyValue >::const_iterator it = rProps.begin();
+ const std::vector< DAVPropertyValue >::const_iterator end = rProps.end();
+
+ while ( it != end )
+ {
+ if ( isCachable( (*it).Name, (*it).IsCaseSensitive ) )
+ m_aProps.addProperty( (*it) );
+
+ ++it;
+ }
+}
diff --git a/ucb/source/ucp/webdav/ContentProperties.hxx b/ucb/source/ucp/webdav/ContentProperties.hxx
index 7819698bf667..fb07ad19a705 100644
--- a/ucb/source/ucp/webdav/ContentProperties.hxx
+++ b/ucb/source/ucp/webdav/ContentProperties.hxx
@@ -102,10 +102,12 @@ struct DAVResource;
class ContentProperties
{
public:
- ContentProperties( const DAVResource& rResource );
+ ContentProperties();
+
+ ContentProperties( const DAVResource& rResource );
// Mini props for transient contents.
- ContentProperties( const rtl::OUString & rTitle, sal_Bool bFolder );
+ ContentProperties( const rtl::OUString & rTitle, sal_Bool bFolder );
// Micro props for non-existing contents.
ContentProperties( const rtl::OUString & rTitle );
@@ -181,7 +183,7 @@ public:
{ return m_xProps; }
private:
- ::rtl::OUString m_aEscapedTitle; // escaped Title
+ ::rtl::OUString m_aEscapedTitle;
std::auto_ptr< PropertyValueMap > m_xProps;
bool m_bTrailingSlash;
@@ -192,6 +194,34 @@ private:
const PropertyValue * get( const rtl::OUString & rName ) const;
};
-}
+class CachableContentProperties
+{
+private:
+ ContentProperties m_aProps;
+
+ CachableContentProperties & operator=( const CachableContentProperties & ); // n.i.
+ CachableContentProperties( const CachableContentProperties & ); // n.i.
+
+public:
+ CachableContentProperties( const ContentProperties & rProps );
+
+ void addProperties( const ContentProperties & rProps );
+
+ void addProperties( const std::vector< DAVPropertyValue > & rProps );
+
+ bool containsAllNames(
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::Property >& rProps,
+ std::vector< rtl::OUString > & rNamesNotContained ) const
+ { return m_aProps.containsAllNames( rProps, rNamesNotContained ); }
+
+ const com::sun::star::uno::Any &
+ getValue( const rtl::OUString & rName ) const
+ { return m_aProps.getValue( rName ); }
+
+ operator const ContentProperties & () const { return m_aProps; }
+};
+
+} // namespace webdav_ucp
#endif /* !_WEBDAV_UCP_CONTENTPROPERTIES_HXX */
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index c58ba207199f..9a77a7e941c1 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -1476,7 +1476,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
osl::Guard< osl::Mutex > aGuard( m_aMutex );
if ( !m_xCachedProps.get() )
- m_xCachedProps.reset( new ContentProperties( *xProps.get() ) );
+ m_xCachedProps.reset( new CachableContentProperties( *xProps.get() ) );
else
m_xCachedProps->addProperties( *xProps.get() );
@@ -2012,7 +2012,7 @@ uno::Any Content::open(
// cache headers.
if ( !m_xCachedProps.get())
m_xCachedProps.reset(
- new ContentProperties( aResource ) );
+ new CachableContentProperties( aResource ) );
else
m_xCachedProps->addProperties( aResource );
@@ -2058,7 +2058,7 @@ uno::Any Content::open(
// cache headers.
if ( !m_xCachedProps.get())
m_xCachedProps.reset(
- new ContentProperties( aResource ) );
+ new CachableContentProperties( aResource ) );
else
m_xCachedProps->addProperties(
aResource.properties );
@@ -3229,7 +3229,7 @@ const Content::ResourceType & Content::getResourceType(
if ( resources.size() == 1 )
{
m_xCachedProps.reset(
- new ContentProperties( resources[ 0 ] ) );
+ new CachableContentProperties( resources[ 0 ] ) );
m_xCachedProps->containsAllNames(
aProperties, m_aFailedPropNames );
}
diff --git a/ucb/source/ucp/webdav/webdavcontent.hxx b/ucb/source/ucp/webdav/webdavcontent.hxx
index 0568b2bfbb54..dcc544a9b2b5 100644
--- a/ucb/source/ucp/webdav/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav/webdavcontent.hxx
@@ -68,6 +68,7 @@ namespace webdav_ucp
class ContentProvider;
class ContentProperties;
+class CachableContentProperties;
class Content : public ::ucbhelper::ContentImplHelper,
public com::sun::star::ucb::XContentCreator
@@ -81,7 +82,8 @@ class Content : public ::ucbhelper::ContentImplHelper,
};
std::auto_ptr< DAVResourceAccess > m_xResAccess;
- std::auto_ptr< ContentProperties > m_xCachedProps; // locally cached props
+ std::auto_ptr< CachableContentProperties >
+ m_xCachedProps; // locally cached props
rtl::OUString m_aEscapedTitle;
ResourceType m_eResourceType;
ContentProvider* m_pProvider; // No need for a ref, base class holds object
diff --git a/unotools/inc/unotools/pathoptions.hxx b/unotools/inc/unotools/pathoptions.hxx
index 4d94c93cca4a..bff3a3120ee4 100644
--- a/unotools/inc/unotools/pathoptions.hxx
+++ b/unotools/inc/unotools/pathoptions.hxx
@@ -129,8 +129,9 @@ public:
void SetWorkPath( const String& rPath );
void SetPath( SvtPathOptions::Pathes ePath, const String& rNewPath );
- String SubstituteVariable( const String& rVar );
- String UseVariable( const String& rVar );
+ String SubstituteVariable( const String& rVar ) const;
+ String ExpandMacros( const String& rPath ) const;
+ String UseVariable( const String& rVar ) const;
sal_Bool SearchFile( String& rIniFile, Pathes ePath = PATH_USERCONFIG );
::com::sun::star::lang::Locale GetLocale() const;
sal_Bool IsReadonly() const;
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 3cf43a1f3bc9..d2f001d1c481 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -137,6 +137,7 @@ class SvtPathOptions_Impl
std::vector< String > m_aPathArray;
Reference< XFastPropertySet > m_xPathSettings;
Reference< XStringSubstitution > m_xSubstVariables;
+ Reference< XMacroExpander > m_xMacroExpander;
mutable EnumToHandleMap m_aMapEnumToPropHandle;
VarNameToEnumMap m_aMapVarNamesToEnum;
@@ -199,9 +200,9 @@ class SvtPathOptions_Impl
void SetUserConfigPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_USERCONFIG, rPath ); }
void SetWorkPath( const String& rPath ) { SetPath( SvtPathOptions::PATH_WORK, rPath ); }
- rtl::OUString SubstVar( const rtl::OUString& rVar );
- rtl::OUString SubstituteAndConvert( const rtl::OUString& rPath );
- rtl::OUString UsePathVariables( const rtl::OUString& rPath );
+ rtl::OUString SubstVar( const rtl::OUString& rVar ) const;
+ rtl::OUString ExpandMacros( const rtl::OUString& rPath ) const;
+ rtl::OUString UsePathVariables( const rtl::OUString& rPath ) const;
::com::sun::star::lang::Locale GetLocale() const { return m_aLocale; }
@@ -282,33 +283,31 @@ const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Pathes ePath )
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( ePath < SvtPathOptions::PATH_COUNT )
+ if ( ePath >= SvtPathOptions::PATH_COUNT )
+ return m_aEmptyString;
+
+ OUString aPathValue;
+ String aResult;
+ sal_Int32 nHandle = m_aMapEnumToPropHandle[ (sal_Int32)ePath ];
+
+ // Substitution is done by the service itself using the substition service
+ Any a = m_xPathSettings->getFastPropertyValue( nHandle );
+ a >>= aPathValue;
+ if( ePath == SvtPathOptions::PATH_ADDIN ||
+ ePath == SvtPathOptions::PATH_FILTER ||
+ ePath == SvtPathOptions::PATH_HELP ||
+ ePath == SvtPathOptions::PATH_MODULE ||
+ ePath == SvtPathOptions::PATH_PLUGIN ||
+ ePath == SvtPathOptions::PATH_STORAGE
+ )
{
- OUString aPathValue;
- String aResult;
- sal_Int32 nHandle = m_aMapEnumToPropHandle[ (sal_Int32)ePath ];
-
- // Substitution is done by the service itself using the substition service
- Any a = m_xPathSettings->getFastPropertyValue( nHandle );
- a >>= aPathValue;
- if( ePath == SvtPathOptions::PATH_ADDIN ||
- ePath == SvtPathOptions::PATH_FILTER ||
- ePath == SvtPathOptions::PATH_HELP ||
- ePath == SvtPathOptions::PATH_MODULE ||
- ePath == SvtPathOptions::PATH_PLUGIN ||
- ePath == SvtPathOptions::PATH_STORAGE
- )
- {
- // These office paths have to be converted to system pathes
- utl::LocalFileHelper::ConvertURLToPhysicalName( aPathValue, aResult );
- aPathValue = aResult;
- }
-
- m_aPathArray[ ePath ] = aPathValue;
- return m_aPathArray[ ePath ];
+ // These office paths have to be converted to system pathes
+ utl::LocalFileHelper::ConvertURLToPhysicalName( aPathValue, aResult );
+ aPathValue = aResult;
}
- return m_aEmptyString;
+ m_aPathArray[ ePath ] = aPathValue;
+ return m_aPathArray[ ePath ];
}
// -----------------------------------------------------------------------
BOOL SvtPathOptions_Impl::IsPathReadonly(SvtPathOptions::Pathes ePath)const
@@ -372,23 +371,29 @@ void SvtPathOptions_Impl::SetPath( SvtPathOptions::Pathes ePath, const String& r
}
}
-// -----------------------------------------------------------------------
+//-------------------------------------------------------------------------
-OUString SvtPathOptions_Impl::SubstituteAndConvert( const rtl::OUString& rPath )
+OUString SvtPathOptions_Impl::ExpandMacros( const rtl::OUString& rPath ) const
{
- return SubstVar( rPath );
+ ::rtl::OUString sExpanded( rPath );
+
+ const INetURLObject aParser( rPath );
+ if ( aParser.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND )
+ sExpanded = m_xMacroExpander->expandMacros( aParser.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) );
+
+ return sExpanded;
}
//-------------------------------------------------------------------------
-OUString SvtPathOptions_Impl::UsePathVariables( const OUString& rPath )
+OUString SvtPathOptions_Impl::UsePathVariables( const OUString& rPath ) const
{
return m_xSubstVariables->reSubstituteVariables( rPath );
}
// -----------------------------------------------------------------------
-OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar )
+OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const
{
// Don't work at parameter-string directly. Copy it.
OUString aWorkText = rVar;
@@ -483,18 +488,9 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
Reference< XInterface >() );
}
- m_xSubstVariables = Reference< XStringSubstitution >( xSMgr->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.PathSubstitution" ))),
- UNO_QUERY );
- if ( !m_xSubstVariables.is() )
- {
- // #112719#: check for existance
- DBG_ERROR( "SvtPathOptions_Impl::SvtPathOptions_Impl(): #112719# happened again!" );
- throw RuntimeException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Service com.sun.star.util.PathSubstitution cannot be created" )),
- Reference< XInterface >() );
- }
+ ::comphelper::ComponentContext aContext( xSMgr );
+ m_xSubstVariables.set( aContext.createComponent( "com.sun.star.util.PathSubstitution" ), UNO_QUERY_THROW );
+ m_xMacroExpander.set( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY_THROW );
// Create temporary hash map to have a mapping between property names and property handles
Reference< XPropertySet > xPropertySet = Reference< XPropertySet >( m_xPathSettings, UNO_QUERY );
@@ -905,13 +901,22 @@ void SvtPathOptions::SetWorkPath( const String& rPath )
// -----------------------------------------------------------------------
-String SvtPathOptions::SubstituteVariable( const String& rVar )
+String SvtPathOptions::SubstituteVariable( const String& rVar ) const
{
- String aRet = pImp->SubstituteAndConvert( rVar );
+ String aRet = pImp->SubstVar( rVar );
return aRet;
}
-String SvtPathOptions::UseVariable( const String& rPath )
+// -----------------------------------------------------------------------
+
+String SvtPathOptions::ExpandMacros( const String& rPath ) const
+{
+ return pImp->ExpandMacros( rPath );
+}
+
+// -----------------------------------------------------------------------
+
+String SvtPathOptions::UseVariable( const String& rPath ) const
{
String aRet = pImp->UsePathVariables( rPath );
return aRet;
@@ -982,7 +987,7 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath )
case PATH_TEMPLATE: aPath = GetTemplatePath(); break;
case PATH_WORK: aPath = GetWorkPath(); break;
case PATH_UICONFIG: aPath = GetUIConfigPath(); break;
- case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break;
+ case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break;
case PATH_USERCONFIG:/*-Wall???*/ break;
case PATH_COUNT: /*-Wall???*/ break;
}
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index 4460694420a0..4e068fc32731 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -167,10 +167,10 @@ private:
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
- const Point& rPos, const Size& rSize );
protected:
+ SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
+ const Point& rPos, const Size& rSize );
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
public:
diff --git a/vcl/inc/vcl/imgctrl.hxx b/vcl/inc/vcl/imgctrl.hxx
index fa3b01463f34..25c1e395c837 100644
--- a/vcl/inc/vcl/imgctrl.hxx
+++ b/vcl/inc/vcl/imgctrl.hxx
@@ -40,28 +40,26 @@
class VCL_DLLPUBLIC ImageControl : public FixedImage
{
private:
- BitmapEx maBmp;
- BitmapEx maBmpHC;
::sal_Int16 mnScaleMode;
public:
ImageControl( Window* pParent, WinBits nStyle = 0 );
+ ImageControl( Window* pParent, const ResId& rResId );
// set/get the scale mode. This is one of the css.awt.ImageScaleMode constants
void SetScaleMode( const ::sal_Int16 _nMode );
::sal_Int16 GetScaleMode() const { return mnScaleMode; }
virtual void Resize();
- virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
virtual void Paint( const Rectangle& rRect );
virtual void GetFocus();
virtual void LoseFocus();
- void SetBitmap( const BitmapEx& rBmp );
- using OutputDevice::GetBitmap;
- const BitmapEx& GetBitmap() const { return maBmp; }
- BOOL SetModeBitmap( const BitmapEx& rBitmap, BmpColorMode eMode = BMP_COLOR_NORMAL );
- const BitmapEx& GetModeBitmap( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
+protected:
+ void ImplDraw( OutputDevice& rDev, ULONG nDrawFlags, const Point& rPos, const Size& rSize ) const;
+private:
+ using FixedImage::ImplDraw;
};
#endif // _SV_IMGCTRL_HXX
diff --git a/vcl/inc/vcl/throbber.hxx b/vcl/inc/vcl/throbber.hxx
new file mode 100644
index 000000000000..f86a9944e28f
--- /dev/null
+++ b/vcl/inc/vcl/throbber.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 VCL_THROBBER_HXX
+#define VCL_THROBBER_HXX
+
+#include "vcl/dllapi.h"
+#include "vcl/imgctrl.hxx"
+#include "vcl/timer.hxx"
+
+#include <vos/mutex.hxx>
+
+#include <com/sun/star/graphic/XGraphic.hpp>
+
+#include <vector>
+
+class VCL_DLLPUBLIC Throbber : public ImageControl
+{
+public:
+ enum ImageSet
+ {
+ /// no (default) images at all
+ IMAGES_NONE,
+ /// automatically decide between different image sets, depending on what fits best the actual size
+ IMAGES_AUTO,
+ /// default images, 16x16 pixels
+ IMAGES_16_PX,
+ /// default images, 32x32 pixels
+ IMAGES_32_PX,
+ /// default images, 64x64 pixels
+ IMAGES_64_PX,
+ };
+
+public:
+ Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet = IMAGES_AUTO );
+ Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet = IMAGES_AUTO );
+ ~Throbber();
+
+ // Properties
+ void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
+ sal_Int32 getStepTime() const { return mnStepTime; }
+
+ void setRepeat( sal_Bool bRepeat ) { mbRepeat = bRepeat; }
+ sal_Bool getRepeat() const { return mbRepeat; }
+
+ // animation control
+ void start();
+ void stop();
+ bool isRunning() const;
+
+ void setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList );
+ void setImageList( ::std::vector< Image > const& i_images );
+
+ // default images
+ static ::std::vector< ::rtl::OUString >
+ getDefaultImageURLs( const ImageSet i_imageSet );
+
+protected:
+ // Window overridables
+ virtual void Resize();
+
+private:
+ SAL_DLLPRIVATE void initImages();
+
+private:
+ ::std::vector< Image > maImageList;
+
+ sal_Bool mbRepeat;
+ sal_Int32 mnStepTime;
+ sal_Int32 mnCurStep;
+ sal_Int32 mnStepCount;
+ AutoTimer maWaitTimer;
+ ImageSet meImageSet;
+
+ DECL_LINK( TimeOutHdl, void* );
+};
+
+#endif // VCL_THROBBER_HXX
+
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 307064f7555d..df30d48f1fab 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -56,6 +56,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\image.hxx %_DEST%\inc%_EXT%\vcl\image.hxx
..\inc\vcl\imagerepository.hxx %_DEST%\inc%_EXT%\vcl\imagerepository.hxx
..\inc\vcl\imgctrl.hxx %_DEST%\inc%_EXT%\vcl\imgctrl.hxx
+..\inc\vcl\throbber.hxx %_DEST%\inc%_EXT%\vcl\throbber.hxx
..\inc\vcl\impdel.hxx %_DEST%\inc%_EXT%\vcl\impdel.hxx
..\inc\vcl\inputctx.hxx %_DEST%\inc%_EXT%\vcl\inputctx.hxx
..\inc\vcl\javachild.hxx %_DEST%\inc%_EXT%\vcl\javachild.hxx
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index 075a8b1b95e2..662efd407995 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -30,6 +30,7 @@
#include <vcl/event.hxx>
#include <vcl/imgctrl.hxx>
+#include <tools/rcid.h>
#include <com/sun/star/awt/ImageScaleMode.hdl>
@@ -37,10 +38,18 @@ namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
// -----------------------------------------------------------------------
-ImageControl::ImageControl( Window* pParent, WinBits nStyle ) :
- FixedImage( pParent, nStyle )
+ImageControl::ImageControl( Window* pParent, WinBits nStyle )
+ :FixedImage( pParent, nStyle )
+ ,mnScaleMode( ImageScaleMode::Anisotropic )
+{
+}
+
+// -----------------------------------------------------------------------
+
+ImageControl::ImageControl( Window* pParent, const ResId& rResId )
+ :FixedImage( pParent, rResId )
+ ,mnScaleMode( ImageScaleMode::Anisotropic )
{
- mnScaleMode = ImageScaleMode::Anisotropic;
}
// -----------------------------------------------------------------------
@@ -86,17 +95,24 @@ namespace
// -----------------------------------------------------------------------
-void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
+void ImageControl::ImplDraw( OutputDevice& rDev, ULONG nDrawFlags, const Point& rPos, const Size& rSize ) const
{
USHORT nStyle = 0;
- BitmapEx* pBitmap = &maBmp;
- if( !!maBmpHC )
+ if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
{
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- pBitmap = &maBmpHC;
+ if ( !IsEnabled() )
+ nStyle |= IMAGE_DRAW_DISABLE;
}
- if ( !*pBitmap )
+ const Image& rImage( GetModeImage( BMP_COLOR_NORMAL ) );
+ const Image& rImageHC( GetModeImage( BMP_COLOR_HIGHCONTRAST ) );
+
+ const Image* pImage = &rImage;
+ if ( !!rImageHC && GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pImage = &rImageHC;
+
+ const Rectangle aDrawRect( rPos, rSize );
+ if ( !*pImage )
{
String sText( GetText() );
if ( !sText.Len() )
@@ -104,131 +120,56 @@ void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
WinBits nWinStyle = GetStyle();
USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
- if ( !IsEnabled() )
- nTextStyle |= TEXT_DRAW_DISABLE;
+ if ( !(nDrawFlags & WINDOW_DRAW_NODISABLE) )
+ if ( !IsEnabled() )
+ nTextStyle |= TEXT_DRAW_DISABLE;
- DrawText( rUDEvt.GetRect(), sText, nTextStyle );
+ rDev.DrawText( aDrawRect, sText, nTextStyle );
return;
}
- const Rectangle& rPaintRect = rUDEvt.GetRect();
- const Size& rBitmapSize = maBmp.GetSizePixel();
+ const Size& rBitmapSize = pImage->GetSizePixel();
- if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
+ switch ( mnScaleMode )
{
- // only images support IMAGE_DRAW_COLORTRANSFORM
- Image aImage( *pBitmap );
- if ( !!aImage )
- {
- switch ( mnScaleMode )
- {
- case ImageScaleMode::None:
- {
- rUDEvt.GetDevice()->DrawImage(
- lcl_centerWithin( rPaintRect, rBitmapSize ), aImage, nStyle );
- }
- break;
-
- case ImageScaleMode::Isotropic:
- {
- const Size aPaintSize = lcl_calcPaintSize( rPaintRect, rBitmapSize );
- rUDEvt.GetDevice()->DrawImage(
- lcl_centerWithin( rPaintRect, aPaintSize ),
- aPaintSize,
- aImage, nStyle );
- }
- break;
-
- case ImageScaleMode::Anisotropic:
- {
- rUDEvt.GetDevice()->DrawImage(
- rPaintRect.TopLeft(),
- rPaintRect.GetSize(),
- aImage, nStyle );
- }
- break;
-
- default:
- OSL_ENSURE( false, "ImageControl::UserDraw: unhandled scale mode!" );
- break;
-
- } // switch ( mnScaleMode )
- }
- }
- else
+ case ImageScaleMode::None:
{
- switch ( mnScaleMode )
- {
- case ImageScaleMode::None:
- {
- pBitmap->Draw( rUDEvt.GetDevice(), lcl_centerWithin( rPaintRect, rBitmapSize ) );
- }
- break;
-
- case ImageScaleMode::Isotropic:
- {
- const Size aPaintSize = lcl_calcPaintSize( rPaintRect, rBitmapSize );
- pBitmap->Draw( rUDEvt.GetDevice(),
- lcl_centerWithin( rPaintRect, aPaintSize ),
- aPaintSize );
- }
- break;
-
- case ImageScaleMode::Anisotropic:
- {
- pBitmap->Draw( rUDEvt.GetDevice(),
- rPaintRect.TopLeft(),
- rPaintRect.GetSize() );
- }
- break;
-
- default:
- OSL_ENSURE( false, "ImageControl::UserDraw: unhandled scale mode!" );
- break;
-
- } // switch ( mnScaleMode )
+ rDev.DrawImage( lcl_centerWithin( aDrawRect, rBitmapSize ), *pImage, nStyle );
}
-}
+ break;
-// -----------------------------------------------------------------------
-
-void ImageControl::SetBitmap( const BitmapEx& rBmp )
-{
- maBmp = rBmp;
- StateChanged( STATE_CHANGE_DATA );
-}
-
-// -----------------------------------------------------------------------
+ case ImageScaleMode::Isotropic:
+ {
+ const Size aPaintSize = lcl_calcPaintSize( aDrawRect, rBitmapSize );
+ rDev.DrawImage(
+ lcl_centerWithin( aDrawRect, aPaintSize ),
+ aPaintSize,
+ *pImage, nStyle );
+ }
+ break;
-BOOL ImageControl::SetModeBitmap( const BitmapEx& rBitmap, BmpColorMode eMode )
-{
- if( eMode == BMP_COLOR_NORMAL )
- SetBitmap( rBitmap );
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
+ case ImageScaleMode::Anisotropic:
{
- maBmpHC = rBitmap;
- StateChanged( STATE_CHANGE_DATA );
+ rDev.DrawImage(
+ aDrawRect.TopLeft(),
+ aDrawRect.GetSize(),
+ *pImage, nStyle );
}
- else
- return FALSE;
- return TRUE;
-}
+ break;
-// -----------------------------------------------------------------------
+ default:
+ OSL_ENSURE( false, "ImageControl::ImplDraw: unhandled scale mode!" );
+ break;
-const BitmapEx& ImageControl::GetModeBitmap( BmpColorMode eMode ) const
-{
- if( eMode == BMP_COLOR_HIGHCONTRAST )
- return maBmpHC;
- else
- return maBmp;
+ } // switch ( mnScaleMode )
}
// -----------------------------------------------------------------------
-void ImageControl::Paint( const Rectangle& rRect )
+void ImageControl::Paint( const Rectangle& /*rRect*/ )
{
- FixedImage::Paint( rRect );
+ ImplDraw( *this, 0, Point(), GetOutputSizePixel() );
+
if( HasFocus() )
{
Window *pWin = GetWindow( WINDOW_BORDER );
@@ -252,6 +193,27 @@ void ImageControl::Paint( const Rectangle& rRect )
}
// -----------------------------------------------------------------------
+void ImageControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+{
+ const Point aPos = pDev->LogicToPixel( rPos );
+ const Size aSize = pDev->LogicToPixel( rSize );
+ Rectangle aRect( aPos, aSize );
+
+ pDev->Push();
+ pDev->SetMapMode();
+
+ // Border
+ if ( !(nFlags & WINDOW_DRAW_NOBORDER) && (GetStyle() & WB_BORDER) )
+ {
+ ImplDrawFrame( pDev, aRect );
+ }
+ pDev->IntersectClipRegion( aRect );
+ ImplDraw( *pDev, nFlags, aRect.TopLeft(), aRect.GetSize() );
+
+ pDev->Pop();
+}
+
+// -----------------------------------------------------------------------
void ImageControl::GetFocus()
{
diff --git a/vcl/source/control/makefile.mk b/vcl/source/control/makefile.mk
index b1644e58ccd9..de2613b1084f 100644
--- a/vcl/source/control/makefile.mk
+++ b/vcl/source/control/makefile.mk
@@ -43,16 +43,21 @@ CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
# --- Files --------------------------------------------------------
-SLOFILES= $(SLO)$/button.obj \
+EXCEPTIONSFILES= \
+ $(SLO)$/button.obj \
$(SLO)$/ctrl.obj \
- $(SLO)$/combobox.obj \
$(SLO)$/edit.obj \
- $(SLO)$/field.obj \
$(SLO)$/field2.obj \
+ $(SLO)$/ilstbox.obj \
+ $(SLO)$/tabctrl.obj \
+ $(SLO)$/throbber.obj
+
+SLOFILES= $(EXCEPTIONSFILES) \
+ $(SLO)$/combobox.obj \
+ $(SLO)$/field.obj \
$(SLO)$/fixbrd.obj \
$(SLO)$/fixed.obj \
$(SLO)$/group.obj \
- $(SLO)$/ilstbox.obj \
$(SLO)$/imgctrl.obj \
$(SLO)$/longcurr.obj \
$(SLO)$/lstbox.obj \
@@ -62,19 +67,12 @@ SLOFILES= $(SLO)$/button.obj \
$(SLO)$/slider.obj \
$(SLO)$/spinfld.obj \
$(SLO)$/spinbtn.obj \
- $(SLO)$/tabctrl.obj \
$(SLO)$/quickselectionengine.obj
-EXCEPTIONSFILES= \
- $(SLO)$/button.obj \
- $(SLO)$/ctrl.obj \
- $(SLO)$/edit.obj \
- $(SLO)$/field2.obj \
- $(SLO)$/ilstbox.obj \
- $(SLO)$/tabctrl.obj
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
.INCLUDE : $(PRJ)$/util$/target.pmk
+
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
new file mode 100644
index 000000000000..6ebd02cb5de1
--- /dev/null
+++ b/vcl/source/control/throbber.cxx
@@ -0,0 +1,325 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_vcl.hxx"
+
+#include "vcl/throbber.hxx"
+#include "vcl/svapp.hxx"
+
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/urlobj.hxx>
+
+#include <limits>
+
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::graphic::XGraphic;
+using ::com::sun::star::graphic::XGraphicProvider;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Exception;
+namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
+
+//----------------------------------------------------------------------------------------------------------------------
+Throbber::Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet )
+ :ImageControl( i_parentWindow, i_style )
+ ,mbRepeat( sal_True )
+ ,mnStepTime( 100 )
+ ,mnCurStep( 0 )
+ ,mnStepCount( 0 )
+ ,meImageSet( i_imageSet )
+{
+ maWaitTimer.SetTimeout( mnStepTime );
+ maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
+
+ SetScaleMode( ImageScaleMode::None );
+ initImages();
+}
+
+//--------------------------------------------------------------------
+Throbber::Throbber( Window* i_parentWindow, const ResId& i_resId, const ImageSet i_imageSet )
+ :ImageControl( i_parentWindow, i_resId )
+ ,mbRepeat( sal_True )
+ ,mnStepTime( 100 )
+ ,mnCurStep( 0 )
+ ,mnStepCount( 0 )
+ ,meImageSet( i_imageSet )
+{
+ maWaitTimer.SetTimeout( mnStepTime );
+ maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );
+
+ SetScaleMode( ImageScaleMode::None );
+ initImages();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+Throbber::~Throbber()
+{
+ maWaitTimer.Stop();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ //..................................................................................................................
+ ::rtl::OUString lcl_getHighContrastURL( ::rtl::OUString const& i_imageURL )
+ {
+ INetURLObject aURL( i_imageURL );
+ if ( aURL.GetProtocol() != INET_PROT_PRIV_SOFFICE )
+ {
+ OSL_VERIFY( aURL.insertName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hicontrast" ) ), false, 0 ) );
+ return aURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ // the private: scheme is not considered to be hierarchical by INetURLObject, so manually insert the
+ // segment
+ const sal_Int32 separatorPos = i_imageURL.indexOf( '/' );
+ ENSURE_OR_RETURN( separatorPos != -1, "lcl_getHighContrastURL: unsipported URL scheme - cannot automatically determine HC version!", i_imageURL );
+
+ ::rtl::OUStringBuffer composer;
+ composer.append( i_imageURL.copy( 0, separatorPos ) );
+ composer.appendAscii( "/hicontrast" );
+ composer.append( i_imageURL.copy( separatorPos ) );
+ return composer.makeStringAndClear();
+ }
+
+ //..................................................................................................................
+ ::std::vector< Image > lcl_loadImageSet( const Throbber::ImageSet i_imageSet, const bool i_isHiContrast )
+ {
+ ::std::vector< Image > aImages;
+ ENSURE_OR_RETURN( i_imageSet != Throbber::IMAGES_NONE, "lcl_loadImageSet: illegal image set", aImages );
+
+ const ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ const Reference< XGraphicProvider > xGraphicProvider( aContext.createComponent( "com.sun.star.graphic.GraphicProvider" ), UNO_QUERY_THROW );
+
+ ::std::vector< ::rtl::OUString > aImageURLs( Throbber::getDefaultImageURLs( i_imageSet ) );
+ aImages.reserve( aImageURLs.size() );
+
+ ::comphelper::NamedValueCollection aMediaProperties;
+ for ( ::std::vector< ::rtl::OUString >::const_iterator imageURL = aImageURLs.begin();
+ imageURL != aImageURLs.end();
+ ++imageURL
+ )
+ {
+ Reference< XGraphic > xGraphic;
+ if ( i_isHiContrast )
+ {
+ aMediaProperties.put( "URL", lcl_getHighContrastURL( *imageURL ) );
+ xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ if ( !xGraphic.is() )
+ {
+ aMediaProperties.put( "URL", *imageURL );
+ xGraphic.set( xGraphicProvider->queryGraphic( aMediaProperties.getPropertyValues() ), UNO_QUERY );
+ }
+ aImages.push_back( Image( xGraphic ) );
+ }
+
+ return aImages;
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::Resize()
+{
+ ImageControl::Resize();
+
+ if ( meImageSet == IMAGES_AUTO )
+ initImages();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::initImages()
+{
+ if ( meImageSet == IMAGES_NONE )
+ return;
+
+ try
+ {
+ ::std::vector< ::std::vector< Image > > aImageSets;
+ const bool isHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+ if ( meImageSet == IMAGES_AUTO )
+ {
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_16_PX, isHiContrast ) );
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_32_PX, isHiContrast ) );
+ aImageSets.push_back( lcl_loadImageSet( IMAGES_64_PX, isHiContrast ) );
+ }
+ else
+ {
+ aImageSets.push_back( lcl_loadImageSet( meImageSet, isHiContrast ) );
+ }
+
+ // find the best matching image set (size-wise)
+ const ::Size aWindowSizePixel = GetSizePixel();
+ size_t nPreferredSet = 0;
+ if ( aImageSets.size() > 1 )
+ {
+ long nMinimalDistance = ::std::numeric_limits< long >::max();
+ for ( ::std::vector< ::std::vector< Image > >::const_iterator check = aImageSets.begin();
+ check != aImageSets.end();
+ ++check
+ )
+ {
+ ENSURE_OR_CONTINUE( !check->empty(), "Throbber::initImages: illegal image!" );
+ const Size aImageSize = (*check)[0].GetSizePixel();
+
+ if ( ( aImageSize.Width() > aWindowSizePixel.Width() )
+ || ( aImageSize.Height() > aWindowSizePixel.Height() )
+ )
+ // do not use an image set which doesn't fit into the window
+ continue;
+
+ const sal_Int64 distance =
+ ( aWindowSizePixel.Width() - aImageSize.Width() ) * ( aWindowSizePixel.Width() - aImageSize.Width() )
+ + ( aWindowSizePixel.Height() - aImageSize.Height() ) * ( aWindowSizePixel.Height() - aImageSize.Height() );
+ if ( distance < nMinimalDistance )
+ {
+ nMinimalDistance = distance;
+ nPreferredSet = check - aImageSets.begin();
+ }
+ }
+ }
+
+ if ( nPreferredSet < aImageSets.size() )
+ setImageList( aImageSets[nPreferredSet] );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::start()
+{
+ maWaitTimer.Start();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::stop()
+{
+ maWaitTimer.Stop();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+bool Throbber::isRunning() const
+{
+ return maWaitTimer.IsActive();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::setImageList( ::std::vector< Image > const& i_images )
+{
+ maImageList = i_images;
+
+ mnStepCount = maImageList.size();
+ const Image aInitialImage( mnStepCount ? maImageList[ 0 ] : Image() );
+ SetImage( aInitialImage );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList )
+{
+ ::std::vector< Image > aImages( rImageList.getLength() );
+ ::std::copy(
+ rImageList.getConstArray(),
+ rImageList.getConstArray() + rImageList.getLength(),
+ aImages.begin()
+ );
+ setImageList( aImages );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+::std::vector< ::rtl::OUString > Throbber::getDefaultImageURLs( const ImageSet i_imageSet )
+{
+ ::std::vector< ::rtl::OUString > aImageURLs;
+
+ sal_Char const* const pResolutions[] = { "16", "32", "64" };
+ size_t const nImageCounts[] = { 6, 12, 12 };
+
+ size_t index = 0;
+ switch ( i_imageSet )
+ {
+ case IMAGES_16_PX: index = 0; break;
+ case IMAGES_32_PX: index = 1; break;
+ case IMAGES_64_PX: index = 2; break;
+ case IMAGES_NONE:
+ case IMAGES_AUTO:
+ OSL_ENSURE( false, "Throbber::getDefaultImageURLs: illegal image set!" );
+ return aImageURLs;
+ }
+
+ aImageURLs.reserve( nImageCounts[index] );
+ for ( size_t i=0; i<nImageCounts[index]; ++i )
+ {
+ ::rtl::OUStringBuffer aURL;
+ aURL.appendAscii( "private:graphicrepository/shared/spinner-" );
+ aURL.appendAscii( pResolutions[index] );
+ aURL.appendAscii( "-" );
+ if ( i < 9 )
+ aURL.appendAscii( "0" );
+ aURL.append ( sal_Int32( i + 1 ) );
+ aURL.appendAscii( ".png" );
+
+ aImageURLs.push_back( aURL.makeStringAndClear() );
+ }
+
+ return aImageURLs;
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+IMPL_LINK( Throbber, TimeOutHdl, void*, EMPTYARG )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( maImageList.empty() )
+ return 0;
+
+ if ( mnCurStep < mnStepCount - 1 )
+ mnCurStep += 1;
+ else
+ {
+ if ( mbRepeat )
+ {
+ // start over
+ mnCurStep = 0;
+ }
+ else
+ {
+ stop();
+ }
+ }
+
+ SetImage( maImageList[ mnCurStep ] );
+
+ return 0;
+}
diff --git a/vcl/source/src/makefile.mk b/vcl/source/src/makefile.mk
index 40b7d4e75dfe..161d821573b9 100644
--- a/vcl/source/src/makefile.mk
+++ b/vcl/source/src/makefile.mk
@@ -44,7 +44,8 @@ SRC1FILES= images.src \
helptext.src \
units.src \
btntext.src \
- print.src
+ print.src \
+ throbber.src \
RESLIB1NAME= $(RESTARGET)
RESLIB1IMAGES= $(PRJ)$/source/src
diff --git a/vcl/source/src/throbber.src b/vcl/source/src/throbber.src
new file mode 100755
index 000000000000..d3c5ea44035c
--- /dev/null
+++ b/vcl/source/src/throbber.src
@@ -0,0 +1,114 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// TODO: we need a mechanism to add images to images.zip, *without*
+// referring them in resource files. The below resources are never loaded
+// at runtime, instead, the images in images.zip are accessed via
+// private:graphicrepository/* URLs.
+
+Resource 1000
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-16-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-16-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-16-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-16-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-16-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-16-06.png"; }; };
+};
+
+Resource 1001
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-16-06.png"; }; };
+};
+
+Resource 1002
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-32-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-32-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-32-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-32-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-32-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-32-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-32-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-32-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-32-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-32-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-32-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-32-12.png"; }; };
+};
+
+Resource 1003
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-32-12.png"; }; };
+};
+
+Resource 1004
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "shared/spinner-64-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "shared/spinner-64-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "shared/spinner-64-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "shared/spinner-64-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "shared/spinner-64-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "shared/spinner-64-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "shared/spinner-64-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "shared/spinner-64-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "shared/spinner-64-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "shared/spinner-64-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "shared/spinner-64-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "shared/spinner-64-12.png"; }; };
+};
+
+Resource 1005
+{
+ Image 1 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-01.png"; }; };
+ Image 2 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-02.png"; }; };
+ Image 3 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-03.png"; }; };
+ Image 4 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-04.png"; }; };
+ Image 5 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-05.png"; }; };
+ Image 6 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-06.png"; }; };
+ Image 7 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-07.png"; }; };
+ Image 8 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-08.png"; }; };
+ Image 9 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-09.png"; }; };
+ Image 10 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-10.png"; }; };
+ Image 11 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-11.png"; }; };
+ Image 12 { ImageBitmap = Bitmap{ file = "hicontrast/shared/spinner-64-12.png"; }; };
+};
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 2c04af384c51..5a5cd11c52d9 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -556,7 +556,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
if (returnVal)
{
- GC gc = SelectFont();
+ GC gc = GetFontGC();
if( gc )
{
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 61ed22ca95e7..0746dbfc0379 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -291,7 +291,7 @@ IMPL_LINK( MyWin, SelectHdl, ListBox*, )
aFixedSize.Width() += 10;
aFixedSize.Height() += 10;
m_aImage.SetSizePixel( aFixedSize );
- m_aImage.SetBitmap( BitmapEx( aBitmap ) );
+ m_aImage.SetImage( Image( BitmapEx( aBitmap ) ) );
}
return 0;
}
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java
index 422f4c8134f9..2d7174bdb69f 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java
+++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java
@@ -58,6 +58,7 @@ import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.NumberFormatter;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.document.OfficeDocument;
import com.sun.star.wizards.text.TextDocument;
import com.sun.star.wizards.text.TextSectionHandler;
@@ -633,7 +634,7 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data
TextEvent te = (TextEvent) param;
String controlName = (String) Helper.getUnoPropertyValue(
UnoDialog2.getModel(te.Source),
- "Name");
+ PropertyNames.PROPERTY_NAME);
redrawTitle(controlName);
}
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java
index 86567277da1d..219125b64bd2 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.java
@@ -26,7 +26,6 @@
************************************************************************/
package com.sun.star.wizards.agenda;
-import com.sun.star.wizards.common.HelpIds;
import com.sun.star.awt.FontDescriptor;
import com.sun.star.awt.XButton;
import com.sun.star.awt.XCheckBox;
@@ -39,6 +38,7 @@ import com.sun.star.awt.XTextComponent;
import com.sun.star.awt.XTimeField;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.WizardDialog;
@@ -116,14 +116,14 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda
//Resources Object
AgendaWizardDialogResources resources;
- private String[] PROPS_LIST = new String[] {"Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"};
- private String[] PROPS_LABEL_B = new String[] {"FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"};
- private String[] PROPS_CHECK = new String[] {"Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"};
- private String[] PROPS_BUTTON = new String[] {"Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"};
- private String[] PROPS_X = new String[] {"Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"};
- private String[] PROPS_TEXTAREA = new String[] {"Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"};
- private String[] PROPS_TEXT = new String[] {"Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"};
- private String[] PROPS_IMAGE = new String[] {"Border", "Height", "HelpURL", "ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"};
+ private String[] PROPS_LIST = new String[] {"Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
+ private String[] PROPS_LABEL_B = new String[] {"FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
+ private String[] PROPS_CHECK = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
+ private String[] PROPS_BUTTON = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
+ private String[] PROPS_X = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
+ private String[] PROPS_TEXTAREA = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
+ private String[] PROPS_TEXT = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
+ private String[] PROPS_IMAGE = new String[] {"Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH};
private static final Short NO_BORDER = new Short((short)0);
@@ -134,7 +134,7 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda
//set dialog properties...
Helper.setUnoPropertyValues(xDialogModel,
- new String[] { "Closeable","Height","Moveable","PositionX","PositionY","Step","TabIndex","Title","Width"},
+ new String[] { "Closeable",PropertyNames.PROPERTY_HEIGHT,"Moveable",PropertyNames.PROPERTY_POSITION_X,PropertyNames.PROPERTY_POSITION_Y,PropertyNames.PROPERTY_STEP,PropertyNames.PROPERTY_TABINDEX,"Title",PropertyNames.PROPERTY_WIDTH},
new Object[] { Boolean.TRUE,new Integer(210),Boolean.TRUE,new Integer(200),new Integer(52),INTEGERS[1],new Short((short)1),resources.resAgendaWizardDialog_title,new Integer(310)}
);
@@ -192,7 +192,7 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda
new Object[] { INTEGERS[8],resources.reslblTime_value,new Integer(97),new Integer(50),INTEGERS[2],new Short((short)203),new Integer(66)}
);
txtTime = insertTimeField("txtTime", null,
- new String[] {"Height", "HelpURL", "PositionX", "PositionY", "Step", "StrictFormat", "TabIndex", "Width"},
+ new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StrictFormat", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
new Object[] { INTEGER_12,TXTTIME_HID,new Integer(166),new Integer(48),INTEGERS[2],Boolean.TRUE,new Short((short)204),new Integer(70)}
);
@@ -201,7 +201,7 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda
new Object[] { INTEGERS[8],resources.reslblTitle_value,new Integer(97),new Integer(68),INTEGERS[2],new Short((short)205),new Integer(66)}
);
txtTitle = insertTextField("txtTitle", null,
- new String[] {"Height", "HelpURL", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"},
+ new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
new Object[] { new Integer(26),TXTTITLE_HID,Boolean.TRUE,new Integer(166),new Integer(66),INTEGERS[2],new Short((short)206),new Integer(138)}
);
lblLocation = insertLabel("lblLocation",
@@ -209,7 +209,7 @@ public abstract class AgendaWizardDialog extends WizardDialog implements Agenda
new Object[] { INTEGERS[8],resources.reslblLocation_value,new Integer(97),new Integer(100),INTEGERS[2],new Short((short)207),new Integer(66)}
);
cbLocation = insertTextField("cbLocation", null,null,
- new String[] { "Height", "HelpURL", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"},
+ new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
new Object[] { new Integer(34),CBLOCATION_HID,Boolean.TRUE,new Integer(166),new Integer(98),INTEGERS[2],new Short((short)208),new Integer(138)}
);
diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.java b/wizards/com/sun/star/wizards/agenda/TopicsControl.java
index 3cd1e550e874..0e3678139378 100644
--- a/wizards/com/sun/star/wizards/agenda/TopicsControl.java
+++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.java
@@ -45,6 +45,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.Properties;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.ControlScroller;
import com.sun.star.wizards.ui.UnoDialog2;
import com.sun.star.wizards.ui.event.EventNames;
@@ -328,7 +329,7 @@ public class TopicsControl extends ControlScroller implements XFocusListener
try
{
//calculate in which row we are...
- String name = (String) Helper.getUnoPropertyValue(UnoDialog2.getModel(control), "Name");
+ String name = (String) Helper.getUnoPropertyValue(UnoDialog2.getModel(control), PropertyNames.PROPERTY_NAME);
int i = name.indexOf("_");
String num = name.substring(i + 1);
lastFocusRow = Integer.valueOf(num).intValue() + nscrollvalue;
@@ -943,7 +944,7 @@ public class TopicsControl extends ControlScroller implements XFocusListener
*/
private int getColumn(Object control)
{
- String name = (String) Helper.getUnoPropertyValue(UnoDialog2.getModel(control), "Name");
+ String name = (String) Helper.getUnoPropertyValue(UnoDialog2.getModel(control), PropertyNames.PROPERTY_NAME);
if (name.startsWith(TOPIC))
{
return 1;
@@ -1047,14 +1048,14 @@ public class TopicsControl extends ControlScroller implements XFocusListener
*/
private static final String[] LABEL_PROPS = new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
/**
* A static member used for the child-class ControlRow (GUI Constant)
*/
private static final String[] TEXT_PROPS = new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
/**
diff --git a/wizards/com/sun/star/wizards/common/Configuration.java b/wizards/com/sun/star/wizards/common/Configuration.java
index cbe724335cf8..04dd385ddf60 100644
--- a/wizards/com/sun/star/wizards/common/Configuration.java
+++ b/wizards/com/sun/star/wizards/common/Configuration.java
@@ -334,7 +334,7 @@ public abstract class Configuration
public static String[] getNodeDisplayNames(XNameAccess _xNameAccessNode)
{
String[] snames = null;
- return getNodeChildNames(_xNameAccessNode, "Name");
+ return getNodeChildNames(_xNameAccessNode, PropertyNames.PROPERTY_NAME);
}
public static String[] getNodeChildNames(XNameAccess xNameAccessNode, String _schildname)
@@ -400,7 +400,7 @@ public abstract class Configuration
public static XNameAccess getChildNodebyDisplayName(XNameAccess _xNameAccessNode, String _displayname)
{
String[] snames = null;
- return getChildNodebyDisplayName(_xNameAccessNode, _displayname, "Name");
+ return getChildNodebyDisplayName(_xNameAccessNode, _displayname, PropertyNames.PROPERTY_NAME);
}
public static XNameAccess getChildNodebyDisplayName(XNameAccess _xNameAccessNode, String _displayname, String _nodename)
diff --git a/wizards/com/sun/star/wizards/common/PropertyNames.java b/wizards/com/sun/star/wizards/common/PropertyNames.java
new file mode 100644
index 000000000000..791f1da3a2fe
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/PropertyNames.java
@@ -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.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.common;
+
+/**
+ *
+ * @author Ocke Janssen
+ */
+public class PropertyNames
+{
+
+ public static String PROPERTY_ENABLED = "Enabled";
+ public static String PROPERTY_HEIGHT = "Height";
+ public static String PROPERTY_HELPURL = "HelpURL";
+ public static String PROPERTY_POSITION_X = "PositionX";
+ public static String PROPERTY_POSITION_Y = "PositionY";
+ public static String PROPERTY_LABEL = "Label";
+ public static String PROPERTY_MULTILINE = "MultiLine";
+ public static String PROPERTY_NAME = "Name";
+ public static String PROPERTY_STEP = "Step";
+ public static String PROPERTY_WIDTH = "Width";
+ public static String PROPERTY_TABINDEX = "TabIndex";
+ public static String PROPERTY_STATE = "State";
+ public static String PROPERTY_IMAGEURL = "ImageURL";
+}
diff --git a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java
index 204ba2328321..a3ff8c12b712 100644
--- a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java
+++ b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java
@@ -31,6 +31,7 @@ import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.sdbc.DataType;
import com.sun.star.wizards.common.Properties;
+import com.sun.star.wizards.common.PropertyNames;
// import com.sun.star.wizards.db.TypeInspector;
public class ColumnPropertySet
@@ -89,9 +90,9 @@ public class ColumnPropertySet
for (int i = 0; i < _aNewColPropertyValues.length; i++)
{
String sPropName = _aNewColPropertyValues[i].Name;
- if (_sNewName != null && sPropName.equals("Name"))
+ if (_sNewName != null && sPropName.equals(PropertyNames.PROPERTY_NAME))
{
- xPropertySet.setPropertyValue("Name", _sNewName);
+ xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, _sNewName);
}
else if (sPropName.equals("Precision"))
{
@@ -170,12 +171,12 @@ public class ColumnPropertySet
nType = ((Integer) _oValue).intValue();
xPropertySet.setPropertyValue("Type", new Integer(nType));
}
- else if (_spropname.equals("Name"))
+ else if (_spropname.equals(PropertyNames.PROPERTY_NAME))
{
String sName = (String) _oValue;
if (!sName.equals(""))
{
- xPropertySet.setPropertyValue("Name", sName);
+ xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
}
}
else if (_spropname.equals("Scale"))
diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java
index 323ded34385a..5a151937d73f 100644
--- a/wizards/com/sun/star/wizards/db/DBMetaData.java
+++ b/wizards/com/sun/star/wizards/db/DBMetaData.java
@@ -83,6 +83,7 @@ import com.sun.star.wizards.common.Properties;
import com.sun.star.wizards.common.Resource;
import com.sun.star.wizards.common.SystemDialog;
import com.sun.star.uno.Any;
+import com.sun.star.wizards.common.PropertyNames;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -102,7 +103,7 @@ public class DBMetaData
public int[] CommandTypes;
public String DataSourceName;
public com.sun.star.sdbc.XConnection DBConnection;
- public com.sun.star.sdb.tools.XConnectionTools ConnectionTools;
+ private com.sun.star.sdb.tools.XConnectionTools m_connectionTools;
public com.sun.star.lang.XMultiServiceFactory xMSF;
public XComponent xConnectionComponent;
@@ -611,7 +612,7 @@ public class DBMetaData
XPropertySet xPSet = UnoRuntime.queryInterface( XPropertySet.class, m_dataSource );
if (xPSet != null)
{
- DataSourceName = AnyConverter.toString(xPSet.getPropertyValue("Name"));
+ DataSourceName = AnyConverter.toString(xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME));
}
return getConnection(xConnection);
}
@@ -677,7 +678,7 @@ public class DBMetaData
try
{
this.DBConnection = _DBConnection;
- this.ConnectionTools = UnoRuntime.queryInterface( XConnectionTools.class, this.DBConnection );
+ this.m_connectionTools = UnoRuntime.queryInterface( XConnectionTools.class, this.DBConnection );
getDataSourceObjects();
return true;
}
@@ -740,7 +741,7 @@ public class DBMetaData
else
{
xConnectionComponent = UnoRuntime.queryInterface( XComponent.class, DBConnection );
- ConnectionTools = UnoRuntime.queryInterface( XConnectionTools.class, DBConnection );
+ m_connectionTools = UnoRuntime.queryInterface( XConnectionTools.class, DBConnection );
getDataSourceObjects();
}
return bgetConnection;
@@ -825,6 +826,16 @@ public class DBMetaData
return false;
}
+ public boolean supportsQueriesInFrom()
+ {
+ return m_connectionTools.getDataSourceMetaData().supportsQueriesInFrom();
+ }
+
+ public String suggestName( final int i_objectType, final String i_baseName ) throws IllegalArgumentException
+ {
+ return m_connectionTools.getObjectNames().suggestName( i_objectType, i_baseName );
+ }
+
/**
* inserts a Query to a datasource; There is no validation if the queryname is already existing in the datasource
* @param oQuery
@@ -844,7 +855,7 @@ public class DBMetaData
xPSet.setPropertyValue("Command", s);
XNameContainer xNameCont = UnoRuntime.queryInterface( XNameContainer.class, xQueryDefs );
- ConnectionTools.getObjectNames().checkNameForCreate(com.sun.star.sdb.CommandType.QUERY, _QueryName);
+ m_connectionTools.getObjectNames().checkNameForCreate(com.sun.star.sdb.CommandType.QUERY, _QueryName);
xNameCont.insertByName(_QueryName, oQuery);
return true;
}
@@ -937,7 +948,7 @@ public class DBMetaData
xCloseable.close(false);
NamedValueCollection creationArgs = new NamedValueCollection();
- creationArgs.put( "Name", basename );
+ creationArgs.put( PropertyNames.PROPERTY_NAME, basename );
creationArgs.put( "URL", documentURL );
creationArgs.put( "AsTemplate", i_createTemplate );
XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, _xDocNameAccess );
@@ -1080,7 +1091,7 @@ public class DBMetaData
}
catch (com.sun.star.uno.Exception ex)
{
- ex.printStackTrace();
+ Logger.getLogger( getClass().getName() ).log( Level.SEVERE, "error calling the error dialog", ex );
}
}
@@ -1095,7 +1106,7 @@ public class DBMetaData
xDataSourcePropertySet = null;
xWindowPeer = null;
DBConnection = null;
- ConnectionTools = null;
+ m_connectionTools = null;
xMSF = null;
xConnectionComponent = null;
CommandObjects = null;
diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
index 235da2d7c04a..461a256ce1c3 100644
--- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
+++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
@@ -183,7 +183,7 @@ public class SQLQueryComposer
try
{
XPropertySet xColumnPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xColumnIndexAccess.getByIndex(i));
- String sName = (String) xColumnPropertySet.getPropertyValue("Name");
+ String sName = (String) xColumnPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME);
if (JavaTools.FieldInTable(CurDBMetaData.getSortFieldNames(), sName) == -1)
{
boolean bascend = AnyConverter.toBoolean(xColumnPropertySet.getPropertyValue("IsAscending"));
diff --git a/wizards/com/sun/star/wizards/db/TableDescriptor.java b/wizards/com/sun/star/wizards/db/TableDescriptor.java
index 8e3b740417c4..c7f728648467 100644
--- a/wizards/com/sun/star/wizards/db/TableDescriptor.java
+++ b/wizards/com/sun/star/wizards/db/TableDescriptor.java
@@ -57,6 +57,7 @@ import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.Properties;
+import com.sun.star.wizards.common.PropertyNames;
public class TableDescriptor extends CommandMetaData implements XContainerListener
{
@@ -169,7 +170,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
for (int i = 0; i < _fieldnames.length; i++)
{
XPropertySet xKeyColPropertySet = xKeyColFac.createDataDescriptor();
- xKeyColPropertySet.setPropertyValue("Name", _fieldnames[i]);
+ xKeyColPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, _fieldnames[i]);
keycolumncontainer.add(xKeyColPropertySet);
XPropertySet xColPropertySet = null;
if (hasByName(_fieldnames[i]))
@@ -221,7 +222,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
{
try
{
- String sColumnName = (String) AnyConverter.toString(_xToBeAppendedPropertySet.getPropertyValue("Name"));
+ String sColumnName = (String) AnyConverter.toString(_xToBeAppendedPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME));
if (_xColumns.hasByName(sColumnName))
{
String sMessage = JavaTools.replaceSubString(sColumnAlreadyExistsMessage, sColumnName, "%FIELDNAME");
@@ -265,7 +266,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
}
if (breturn)
{
- assignTableProperty("Name", _tablename);
+ assignTableProperty(PropertyNames.PROPERTY_NAME, _tablename);
assignTableProperty("CatalogName", _catalogname);
assignTableProperty("SchemaName", _schemaname);
xTableContainer = (XContainer) UnoRuntime.queryInterface(XContainer.class, getTableNamesAsNameAccess());
@@ -318,7 +319,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
{
try
{
- xPropTableDataDescriptor.setPropertyValue("Name", "");
+ xPropTableDataDescriptor.setPropertyValue(PropertyNames.PROPERTY_NAME, "");
if ((xKeyDrop != null) && (xIndexAccessKeys != null))
{
int icount = xIndexAccessKeys.getCount();
@@ -391,7 +392,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
{
try
{
- return modifyColumn(_soldname, "Name", _snewname);
+ return modifyColumn(_soldname, PropertyNames.PROPERTY_NAME, _snewname);
}
catch (Exception e)
{
@@ -413,7 +414,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
if (oColumnDescriptor.Name.equals(_sname))
{
oColumnDescriptor.xColPropertySet.setPropertyValue(_spropname, _oValue);
- if (_spropname.equals("Name"))
+ if (_spropname.equals(PropertyNames.PROPERTY_NAME))
{
oColumnDescriptor.Name = (String) _oValue;
}
@@ -455,7 +456,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
if (oColumnDescriptor.Name.equals(_sname))
{
oColumnDescriptor.xColPropertySet = _xColPropertySet;
- oColumnDescriptor.Name = (String) _xColPropertySet.getPropertyValue("Name");
+ oColumnDescriptor.Name = (String) _xColPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME);
columncontainer.remove(i);
columncontainer.insertElementAt(oColumnDescriptor, i);
return true;
@@ -624,7 +625,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
{
try
{
- String sname = (String) Properties.getPropertyValue(_aNewPropertyValues, "Name");
+ String sname = (String) Properties.getPropertyValue(_aNewPropertyValues, PropertyNames.PROPERTY_NAME);
if (!hasByName(sname))
{
ColumnPropertySet oPropertySet = new ColumnPropertySet(oTypeInspector, xColumnDataDescriptorFactory.createDataDescriptor());
@@ -694,7 +695,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
{
XPropertySet xColPropertySet = xColumnDataDescriptorFactory.createDataDescriptor();
IDFieldName = Desktop.getUniqueName(getColumnNames(), _columnname, "");
- xColPropertySet.setPropertyValue("Name", IDFieldName);
+ xColPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, IDFieldName);
int nDataType = oTypeInspector.convertDataType(com.sun.star.sdbc.DataType.INTEGER);
xColPropertySet.setPropertyValue("Type", new Integer(nDataType));
@@ -777,7 +778,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
try
{
XPropertySet xTablePropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, arg0.Element);
- String stablename = AnyConverter.toString(xTablePropertySet.getPropertyValue("Name"));
+ String stablename = AnyConverter.toString(xTablePropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME));
String sschemaname = AnyConverter.toString(xPropTableDataDescriptor.getPropertyValue("SchemaName"));
String scatalogname = AnyConverter.toString(xPropTableDataDescriptor.getPropertyValue("CatalogName"));
ComposedTableName = new CommandName(this, scatalogname, sschemaname, stablename, false);
diff --git a/wizards/com/sun/star/wizards/document/Control.java b/wizards/com/sun/star/wizards/document/Control.java
index fb4191277b8c..96485cdf84ce 100644
--- a/wizards/com/sun/star/wizards/document/Control.java
+++ b/wizards/com/sun/star/wizards/document/Control.java
@@ -133,7 +133,7 @@ public class Control extends Shape
{
XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xFormName);
String sControlName = Desktop.getUniqueName(xNameAccess, getControlName(_fieldname));
- xPropertySet.setPropertyValue("Name", sControlName);
+ xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, sControlName);
xFormName.insertByName(sControlName, xControlModel);
}
}
@@ -248,9 +248,9 @@ public class Control extends Shape
{
xPropertySet.setPropertyValue("Text", sText);
}
- else if (xPropertySet.getPropertySetInfo().hasPropertyByName("Label"))
+ else if (xPropertySet.getPropertySetInfo().hasPropertyByName(PropertyNames.PROPERTY_LABEL))
{
- xPropertySet.setPropertyValue("Label", sText);
+ xPropertySet.setPropertyValue(PropertyNames.PROPERTY_LABEL, sText);
}
else
{
diff --git a/wizards/com/sun/star/wizards/document/DatabaseControl.java b/wizards/com/sun/star/wizards/document/DatabaseControl.java
index b0b1523840a9..67a85c436f6f 100644
--- a/wizards/com/sun/star/wizards/document/DatabaseControl.java
+++ b/wizards/com/sun/star/wizards/document/DatabaseControl.java
@@ -35,6 +35,7 @@ import com.sun.star.drawing.XShapes;
import com.sun.star.sdbc.DataType;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.FieldColumn;
/**
@@ -83,7 +84,7 @@ public class DatabaseControl extends Control
String sGridColumnName = getGridColumnName();
XPropertySet xPropColumn = _oGridControl.xGridColumnFactory.createColumn(sGridColumnName);
- xPropColumn.setPropertyValue("Name", sUniqueName);
+ xPropColumn.setPropertyValue(PropertyNames.PROPERTY_NAME, sUniqueName);
boolean bHidden = false;
if (_fieldtype == DataType.LONGVARBINARY) //TODO CONTROLType abfragen!!!!!!
{
@@ -91,8 +92,8 @@ public class DatabaseControl extends Control
}
xPropColumn.setPropertyValue("Hidden", new Boolean(bHidden));
xPropColumn.setPropertyValue("DataField", sFieldName);
- xPropColumn.setPropertyValue("Label", _columntitle);
- xPropColumn.setPropertyValue("Width", new Integer(0)); // Width of column is adjusted to Columname
+ xPropColumn.setPropertyValue(PropertyNames.PROPERTY_LABEL, _columntitle);
+ xPropColumn.setPropertyValue(PropertyNames.PROPERTY_WIDTH, new Integer(0)); // Width of column is adjusted to Columname
XPropertySetInfo xPSI = xPropColumn.getPropertySetInfo();
if ( xPSI.hasPropertyByName( "MouseWheelBehavior" ) )
@@ -166,7 +167,7 @@ public class DatabaseControl extends Control
{
if (getFieldType() == DataType.LONGVARCHAR)
{
- // Helper.setUnoPropertyValue(xControlModel, "MultiLine", Boolean.TRUE);
+ // Helper.setUnoPropertyValue(xControlModel, PropertyNames.PROPERTY_MULTILINE, Boolean.TRUE);
final int nMemofieldheight = oFormHandler.getControlReferenceHeight() * 4;
return nMemofieldheight;
}
diff --git a/wizards/com/sun/star/wizards/document/FormHandler.java b/wizards/com/sun/star/wizards/document/FormHandler.java
index 7b558d67cd9f..17dece81a03e 100644
--- a/wizards/com/sun/star/wizards/document/FormHandler.java
+++ b/wizards/com/sun/star/wizards/document/FormHandler.java
@@ -466,7 +466,7 @@ public class FormHandler
// this.xDrawPage.remove(ControlList[i].xShape);
{
ControlList[i].setPosition(new Point(this.iXNirwanaPos, this.iYNirwanaPos));
-// String sControlName = (String) ControlList[i].xPropertySet.getPropertyValue("Name");
+// String sControlName = (String) ControlList[i].xPropertySet.getPropertyValue(PropertyNames.PROPERTY_NAME);
//
// if (_xNamedForm.hasByName(sControlName))
// _xNamedForm.removeByName(sControlName);
diff --git a/wizards/com/sun/star/wizards/document/GridControl.java b/wizards/com/sun/star/wizards/document/GridControl.java
index 66bae37e1ed3..ef13d5c12a66 100644
--- a/wizards/com/sun/star/wizards/document/GridControl.java
+++ b/wizards/com/sun/star/wizards/document/GridControl.java
@@ -70,7 +70,7 @@ public class GridControl extends Shape
xGridColumnFactory = UnoRuntime.queryInterface( XGridColumnFactory.class, oGridModel );
xComponent = UnoRuntime.queryInterface( XComponent.class, oGridModel );
-// Helper.setUnoPropertyValue(oGridModel, "Name", _sname);
+// Helper.setUnoPropertyValue(oGridModel, PropertyNames.PROPERTY_NAME, _sname);
for (int i = 0; i < fieldcolumns.length; i++)
{
FieldColumn curfieldcolumn = fieldcolumns[i];
diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.java b/wizards/com/sun/star/wizards/fax/FaxDocument.java
index 8eafbed257d1..7cb8178d3264 100644
--- a/wizards/com/sun/star/wizards/fax/FaxDocument.java
+++ b/wizards/com/sun/star/wizards/fax/FaxDocument.java
@@ -166,7 +166,7 @@ public class FaxDocument extends TextDocument
myFieldHandler.changeUserFieldContent("Company", (String) Helper.getUnoObjectbyName(oUserDataAccess, "o"));
myFieldHandler.changeUserFieldContent("Street", (String) Helper.getUnoObjectbyName(oUserDataAccess, "street"));
myFieldHandler.changeUserFieldContent("PostCode", (String) Helper.getUnoObjectbyName(oUserDataAccess, "postalcode"));
- myFieldHandler.changeUserFieldContent("State", (String) Helper.getUnoObjectbyName(oUserDataAccess, "st"));
+ myFieldHandler.changeUserFieldContent(PropertyNames.PROPERTY_STATE, (String) Helper.getUnoObjectbyName(oUserDataAccess, "st"));
myFieldHandler.changeUserFieldContent("City", (String) Helper.getUnoObjectbyName(oUserDataAccess, "l"));
myFieldHandler.changeUserFieldContent("Fax", (String) Helper.getUnoObjectbyName(oUserDataAccess, "facsimiletelephonenumber"));
}
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java
index 8c81ba5e5fec..fc095af0d337 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java
@@ -112,7 +112,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Closeable", "Height", "Moveable", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width"
+ "Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -134,7 +134,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
optBusinessFax = insertRadioButton("optBusinessFax", OPTBUSINESSFAX_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -143,7 +143,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lstBusinessStyle = insertListBox("lstBusinessStyle", LSTBUSINESSSTYLE_ACTION_PERFORMED, LSTBUSINESSSTYLE_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -152,7 +152,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
optPrivateFax = insertRadioButton("optPrivateFax", OPTPRIVATEFAX_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -161,7 +161,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lstPrivateStyle = insertListBox("lstPrivateStyle", LSTPRIVATESTYLE_ACTION_PERFORMED, LSTPRIVATESTYLE_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -170,7 +170,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblBusinessStyle = insertLabel("lblBusinessStyle",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -179,7 +179,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblTitle1 = insertLabel("lblTitle1",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -188,7 +188,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblPrivateStyle = insertLabel("lblPrivateStyle",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -197,7 +197,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblIntroduction = insertLabel("lblIntroduction",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -205,7 +205,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
});
ImageControl3 = insertInfoImage(92, 145, 1);
// ImageControl3 = insertImage("ImageControl3",
-// new String[] {"Border", "Height", "ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"},
+// new String[] {"Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
// new Object[] { new Short((short)0),INTEGERS[10],"private:resource/dbu/image/19205",new Integer(92),new Integer(145),Boolean.FALSE,INTEGERS[1],new Short((short)56),INTEGERS[10]}
// );
}
@@ -215,7 +215,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkUseLogo = insertCheckBox("chkUseLogo", CHKUSELOGO_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -224,7 +224,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkUseDate = insertCheckBox("chkUseDate", CHKUSEDATE_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -233,7 +233,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkUseCommunicationType = insertCheckBox("chkUseCommunicationType", CHKUSECOMMUNICATIONTYPE_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -242,7 +242,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lstCommunicationType = insertComboBox("lstCommunicationType", LSTCOMMUNICATIONTYPE_ACTION_PERFORMED, LSTCOMMUNICATIONTYPE_ITEM_CHANGED, LSTCOMMUNICATIONTYPE_TEXT_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -251,7 +251,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkUseSubject = insertCheckBox("chkUseSubject", CHKUSESUBJECT_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -260,7 +260,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkUseSalutation = insertCheckBox("chkUseSalutation", CHKUSESALUTATION_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -269,7 +269,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lstSalutation = insertComboBox("lstSalutation", LSTSALUTATION_ACTION_PERFORMED, LSTSALUTATION_ITEM_CHANGED, LSTSALUTATION_TEXT_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -278,7 +278,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkUseGreeting = insertCheckBox("chkUseGreeting", CHKUSEGREETING_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -287,7 +287,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lstGreeting = insertComboBox("lstGreeting", LSTGREETING_ACTION_PERFORMED, LSTGREETING_ITEM_CHANGED, LSTGREETING_TEXT_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -296,7 +296,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkUseFooter = insertCheckBox("chkUseFooter", CHKUSEFOOTER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -305,7 +305,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblTitle3 = insertLabel("lblTitle3",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -318,7 +318,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
optSenderPlaceholder = insertRadioButton("optSenderPlaceholder", OPTSENDERPLACEHOLDER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -327,7 +327,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
optSenderDefine = insertRadioButton("optSenderDefine", OPTSENDERDEFINE_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -336,7 +336,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtSenderName = insertTextField("txtSenderName", TXTSENDERNAME_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -345,7 +345,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtSenderStreet = insertTextField("txtSenderStreet", TXTSENDERSTREET_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -354,7 +354,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtSenderPostCode = insertTextField("txtSenderPostCode", TXTSENDERPOSTCODE_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -363,7 +363,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtSenderState = insertTextField("txtSenderState", TXTSENDERSTATE_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -372,7 +372,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtSenderCity = insertTextField("txtSenderCity", TXTSENDERCITY_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -381,7 +381,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtSenderFax = insertTextField("txtSenderFax", TXTSENDERFAX_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -390,7 +390,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
optReceiverPlaceholder = insertRadioButton("optReceiverPlaceholder", OPTRECEIVERPLACEHOLDER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -399,7 +399,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
optReceiverDatabase = insertRadioButton("optReceiverDatabase", OPTRECEIVERDATABASE_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -408,7 +408,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblSenderAddress = insertLabel("lblSenderAddress",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -417,7 +417,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
FixedLine2 = insertFixedLine("FixedLine2",
new String[]
{
- "Height", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -426,7 +426,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblSenderName = insertLabel("lblSenderName",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -435,7 +435,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblSenderStreet = insertLabel("lblSenderStreet",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -444,7 +444,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblPostCodeCity = insertLabel("lblPostCodeCity",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -453,7 +453,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblTitle4 = insertLabel("lblTitle4",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -462,7 +462,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
Label1 = insertLabel("lblSenderFax",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -471,7 +471,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
Label2 = insertLabel("Label2",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -484,7 +484,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtFooter = insertTextField("txtFooter", TXTFOOTER_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -493,7 +493,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkFooterNextPages = insertCheckBox("chkFooterNextPages", CHKFOOTERNEXTPAGES_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -502,7 +502,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
chkFooterPageNumbers = insertCheckBox("chkFooterPageNumbers", CHKFOOTERPAGENUMBERS_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -511,7 +511,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblFooter = insertLabel("lblFooter",
new String[]
{
- "FontDescriptor", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -520,7 +520,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblTitle5 = insertLabel("lblTitle5",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -533,7 +533,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
txtTemplateName = insertTextField("txtTemplateName", TXTTEMPLATENAME_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Text", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -541,14 +541,14 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
});
/*
fileTemplatePath = insertFileControl("fileTemplatePath", FILETEMPLATEPATH_TEXT_CHANGED,
- new String[] {"Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"},
+ new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
new Object[] { INTEGER_12,FILETEMPLATEPATH_HID,new Integer(172),new Integer(74),INTEGERS[5],new Short((short)29),new Integer(130)}
);
*/
optCreateFax = insertRadioButton("optCreateFax", OPTCREATEFAX_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -557,7 +557,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
optMakeChanges = insertRadioButton("optMakeChanges", OPTMAKECHANGES_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -566,7 +566,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblFinalExplanation1 = insertLabel("lblFinalExplanation1",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -575,7 +575,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblProceed = insertLabel("lblProceed",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -584,7 +584,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblFinalExplanation2 = insertLabel("lblFinalExplanation2",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -593,7 +593,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
ImageControl2 = insertImage("ImageControl2",
new String[]
{
- "Border", "Height", "ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -602,7 +602,7 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
lblTemplateName = insertLabel("lblTemplateName",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -610,14 +610,14 @@ public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardD
});
/*
lblTemplatePath = insertLabel("lblTemplatePath",
- new String[] {"Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"},
+ new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
new Object[] { INTEGERS[8],resources.reslblTemplatePath_value,new Integer(97),new Integer(77),INTEGERS[5],new Short((short)58),new Integer(71)}
);
*/
lblTitle6 = insertLabel("lblTitle6",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
index 892505baa85b..8ee9f0472c57 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
@@ -424,9 +424,9 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
public void initializeElements()
{
- setControlProperty("chkUseLogo", "Enabled", new Boolean(myFaxDoc.hasElement("Company Logo")));
- setControlProperty("chkUseSubject", "Enabled", new Boolean(myFaxDoc.hasElement("Subject Line")));
- setControlProperty("chkUseDate", "Enabled", new Boolean(myFaxDoc.hasElement("Date")));
+ setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, new Boolean(myFaxDoc.hasElement("Company Logo")));
+ setControlProperty("chkUseSubject", PropertyNames.PROPERTY_ENABLED, new Boolean(myFaxDoc.hasElement("Subject Line")));
+ setControlProperty("chkUseDate", PropertyNames.PROPERTY_ENABLED, new Boolean(myFaxDoc.hasElement("Date")));
myFaxDoc.updateDateFields();
}
@@ -553,10 +553,10 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
public void optBusinessFaxItemChanged()
{
DataAware.setDataObject(faxDA, myConfig.cp_BusinessFax, true);
- setControlProperty("lblBusinessStyle", "Enabled", Boolean.TRUE);
- setControlProperty("lstBusinessStyle", "Enabled", Boolean.TRUE);
- setControlProperty("lblPrivateStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstPrivateStyle", "Enabled", Boolean.FALSE);
+ setControlProperty("lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
lstBusinessStyleItemChanged();
enableSenderReceiver();
setPossibleFooter(true);
@@ -572,10 +572,10 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
public void optPrivateFaxItemChanged()
{
DataAware.setDataObject(faxDA, myConfig.cp_PrivateFax, true);
- setControlProperty("lblBusinessStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstBusinessStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lblPrivateStyle", "Enabled", Boolean.TRUE);
- setControlProperty("lstPrivateStyle", "Enabled", Boolean.TRUE);
+ setControlProperty("lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
lstPrivateStyleItemChanged();
disableSenderReceiver();
setPossibleFooter(false);
@@ -598,31 +598,31 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
public void optSenderPlaceholderItemChanged()
{
- setControlProperty("lblSenderName", "Enabled", Boolean.FALSE);
- setControlProperty("lblSenderStreet", "Enabled", Boolean.FALSE);
- setControlProperty("lblPostCodeCity", "Enabled", Boolean.FALSE);
- setControlProperty("lblSenderFax", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderName", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderStreet", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderPostCode", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderState", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderCity", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderFax", "Enabled", Boolean.FALSE);
+ setControlProperty("lblSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblSenderFax", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderState", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderFax", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
myFaxDoc.fillSenderWithUserData();
}
public void optSenderDefineItemChanged()
{
- setControlProperty("lblSenderName", "Enabled", Boolean.TRUE);
- setControlProperty("lblSenderStreet", "Enabled", Boolean.TRUE);
- setControlProperty("lblPostCodeCity", "Enabled", Boolean.TRUE);
- setControlProperty("lblSenderFax", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderName", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderStreet", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderPostCode", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderState", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderCity", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderFax", "Enabled", Boolean.TRUE);
+ setControlProperty("lblSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblSenderFax", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderState", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderFax", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
txtSenderNameTextChanged();
txtSenderStreetTextChanged();
txtSenderPostCodeTextChanged();
@@ -678,7 +678,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
public void txtSenderStateTextChanged()
{
TextFieldHandler myFieldHandler = new TextFieldHandler(myFaxDoc.xMSF, xTextDocument);
- myFieldHandler.changeUserFieldContent("State", txtSenderState.getText());
+ myFieldHandler.changeUserFieldContent(PropertyNames.PROPERTY_STATE, txtSenderState.getText());
}
public void txtSenderFaxTextChanged()
@@ -754,7 +754,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
{
try
{
- boolean bFooterPossible = (chkUseFooter.getState() != 0) && AnyConverter.toBoolean(getControlProperty("chkUseFooter", "Enabled"));
+ boolean bFooterPossible = (chkUseFooter.getState() != 0) && AnyConverter.toBoolean(getControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED));
if (chkFooterNextPages.getState() != 0)
{
@@ -769,7 +769,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
//enable/disable roadmap item for footer page
XInterface BPaperItem = getRoadmapItemByID(RM_FOOTER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", new Boolean(bFooterPossible));
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bFooterPossible));
}
catch (Exception exception)
@@ -797,7 +797,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
{
XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation);
myFaxDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0));
- setControlProperty("lstSalutation", "Enabled", new Boolean(chkUseSalutation.getState() != 0));
+ setControlProperty("lstSalutation", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseSalutation.getState() != 0));
}
public void lstSalutationItemChanged()
@@ -814,7 +814,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
{
XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType);
myFaxDoc.switchUserField("CommunicationType", xTextComponent.getText(), (chkUseCommunicationType.getState() != 0));
- setControlProperty("lstCommunicationType", "Enabled", new Boolean(chkUseCommunicationType.getState() != 0));
+ setControlProperty("lstCommunicationType", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseCommunicationType.getState() != 0));
}
public void lstCommunicationItemChanged()
@@ -831,7 +831,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
{
XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting);
myFaxDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0));
- setControlProperty("lstGreeting", "Enabled", new Boolean(chkUseGreeting.getState() != 0));
+ setControlProperty("lstGreeting", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseGreeting.getState() != 0));
}
public void lstGreetingItemChanged()
@@ -846,7 +846,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
private void setPossibleFooter(boolean bState)
{
- setControlProperty("chkUseFooter", "Enabled", new Boolean(bState));
+ setControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
if (!bState)
{
chkUseFooter.setState((short) 0);
@@ -857,13 +857,13 @@ public class FaxWizardDialogImpl extends FaxWizardDialog
private void enableSenderReceiver()
{
XInterface BPaperItem = getRoadmapItemByID(RM_SENDERRECEIVER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.TRUE);
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
}
private void disableSenderReceiver()
{
XInterface BPaperItem = getRoadmapItemByID(RM_SENDERRECEIVER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.FALSE);
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
}
}
diff --git a/wizards/com/sun/star/wizards/form/DataEntrySetter.java b/wizards/com/sun/star/wizards/form/DataEntrySetter.java
index 7fab3dcdd5b1..ae042fa7de76 100644
--- a/wizards/com/sun/star/wizards/form/DataEntrySetter.java
+++ b/wizards/com/sun/star/wizards/form/DataEntrySetter.java
@@ -34,6 +34,7 @@ import com.sun.star.wizards.common.Properties;
import com.sun.star.wizards.ui.UnoDialog;
import com.sun.star.wizards.ui.WizardDialog;
import com.sun.star.wizards.ui.UIConsts;
+import com.sun.star.wizards.common.PropertyNames;
public class DataEntrySetter
{
@@ -61,7 +62,7 @@ public class DataEntrySetter
optNewDataOnly = CurUnoDialog.insertRadioButton("optNewDataOnly", "toggleCheckBoxes", this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -71,7 +72,7 @@ public class DataEntrySetter
optDisplayAllData = CurUnoDialog.insertRadioButton("optDisplayAllData", "toggleCheckBoxes", this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -80,7 +81,7 @@ public class DataEntrySetter
chknomodification = CurUnoDialog.insertCheckBox("chknomodification", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -89,7 +90,7 @@ public class DataEntrySetter
chknodeletion = CurUnoDialog.insertCheckBox("chknodeletion", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -98,7 +99,7 @@ public class DataEntrySetter
chknoaddition = CurUnoDialog.insertCheckBox("chknoaddition", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -107,7 +108,7 @@ public class DataEntrySetter
CurUnoDialog.insertLabel("lbldontdisplayExistingData",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -121,9 +122,9 @@ public class DataEntrySetter
if (optDisplayAllData.getState())
{
retProperties = new PropertyValue[3];
- boolean bAllowUpdates = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknomodification), "State")).shortValue()) != 1;
- boolean bAllowDeletes = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknodeletion), "State")).shortValue()) != 1;
- boolean bAllowInserts = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknoaddition), "State")).shortValue()) != 1;
+ boolean bAllowUpdates = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknomodification), PropertyNames.PROPERTY_STATE)).shortValue()) != 1;
+ boolean bAllowDeletes = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknodeletion), PropertyNames.PROPERTY_STATE)).shortValue()) != 1;
+ boolean bAllowInserts = (((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(chknoaddition), PropertyNames.PROPERTY_STATE)).shortValue()) != 1;
retProperties[0] = Properties.createProperty("AllowUpdates", new Boolean(bAllowUpdates));
retProperties[1] = Properties.createProperty("AllowDeletes", new Boolean(bAllowDeletes));
retProperties[2] = Properties.createProperty("AllowInserts", new Boolean(bAllowInserts));
@@ -140,8 +141,8 @@ public class DataEntrySetter
public void toggleCheckBoxes()
{
boolean bdisplayalldata = optDisplayAllData.getState();
- Helper.setUnoPropertyValue(UnoDialog.getModel(chknomodification), "Enabled", new Boolean(bdisplayalldata));
- Helper.setUnoPropertyValue(UnoDialog.getModel(chknodeletion), "Enabled", new Boolean(bdisplayalldata));
- Helper.setUnoPropertyValue(UnoDialog.getModel(chknoaddition), "Enabled", new Boolean(bdisplayalldata));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chknomodification), PropertyNames.PROPERTY_ENABLED, new Boolean(bdisplayalldata));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chknodeletion), PropertyNames.PROPERTY_ENABLED, new Boolean(bdisplayalldata));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chknoaddition), PropertyNames.PROPERTY_ENABLED, new Boolean(bdisplayalldata));
}
}
diff --git a/wizards/com/sun/star/wizards/form/FieldLinker.java b/wizards/com/sun/star/wizards/form/FieldLinker.java
index a3b4b7f5b70a..b0fecf192bb8 100644
--- a/wizards/com/sun/star/wizards/form/FieldLinker.java
+++ b/wizards/com/sun/star/wizards/form/FieldLinker.java
@@ -39,6 +39,7 @@ import com.sun.star.wizards.ui.UnoDialog;
import com.sun.star.wizards.ui.WizardDialog;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.DBLimitedFieldSelection;
+import com.sun.star.wizards.common.PropertyNames;
public class FieldLinker extends DBLimitedFieldSelection
{
@@ -93,7 +94,7 @@ public class FieldLinker extends DBLimitedFieldSelection
lblSlaveFields[i] = CurUnoDialog.insertLabel("lblSlaveFieldLink" + new Integer(i + 1).toString(),
new String[]
{
- "Enabled", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -103,15 +104,15 @@ public class FieldLinker extends DBLimitedFieldSelection
new String[]
{
"Dropdown",
- "Enabled",
- "Height",
- "HelpURL",
+ PropertyNames.PROPERTY_ENABLED,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
"LineCount",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -130,7 +131,7 @@ public class FieldLinker extends DBLimitedFieldSelection
lblMasterFields[i] = CurUnoDialog.insertLabel("lblMasterFieldLink" + new Integer(i + 1).toString(),
new String[]
{
- "Enabled", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -141,15 +142,15 @@ public class FieldLinker extends DBLimitedFieldSelection
new String[]
{
"Dropdown",
- "Enabled",
- "Height",
- "HelpURL",
+ PropertyNames.PROPERTY_ENABLED,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
"LineCount",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -205,10 +206,10 @@ public class FieldLinker extends DBLimitedFieldSelection
{
if (i < rowcount)
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(lblSlaveFields[i]), "Enabled", new Boolean(bDoEnable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[i]), "Enabled", new Boolean(bDoEnable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(lblMasterFields[i]), "Enabled", new Boolean(bDoEnable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[i]), "Enabled", new Boolean(bDoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lblSlaveFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lblMasterFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lstMasterFields[i]), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
if (bDoEnable == false)
{
Helper.setUnoPropertyValue(UnoDialog.getModel(lstSlaveFields[i]), "SelectedItems", new short[] { 0 });
diff --git a/wizards/com/sun/star/wizards/form/Finalizer.java b/wizards/com/sun/star/wizards/form/Finalizer.java
index d8ce6262731a..c5f12728e527 100644
--- a/wizards/com/sun/star/wizards/form/Finalizer.java
+++ b/wizards/com/sun/star/wizards/form/Finalizer.java
@@ -29,6 +29,7 @@ package com.sun.star.wizards.form;
import com.sun.star.awt.XRadioButton;
import com.sun.star.awt.XTextComponent;
import com.sun.star.wizards.common.Desktop;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.*;
/**
@@ -59,7 +60,7 @@ public class Finalizer
CurUnoDialog.insertLabel("lblFormName",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -68,7 +69,7 @@ public class Finalizer
txtFormName = CurUnoDialog.insertTextField("txtFormName", "toggleFinishButton", this,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Text", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -77,7 +78,7 @@ public class Finalizer
CurUnoDialog.insertLabel("lblProceed",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -86,7 +87,7 @@ public class Finalizer
CurUnoDialog.insertRadioButton("optWorkWithForm", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -95,7 +96,7 @@ public class Finalizer
optModifyForm = CurUnoDialog.insertRadioButton("optModifyForm", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/form/FormConfiguration.java b/wizards/com/sun/star/wizards/form/FormConfiguration.java
index d1f1afdfac54..9c18ab47d79d 100644
--- a/wizards/com/sun/star/wizards/form/FormConfiguration.java
+++ b/wizards/com/sun/star/wizards/form/FormConfiguration.java
@@ -31,6 +31,7 @@ import com.sun.star.awt.XFixedText;
import com.sun.star.awt.XListBox;
import com.sun.star.awt.XRadioButton;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.CommandFieldSelection;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.UnoDialog;
@@ -78,7 +79,7 @@ public class FormConfiguration
chkcreateSubForm = CurUnoDialog.insertCheckBox("chkcreateSubForm", SSUBFORMMODE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -87,7 +88,7 @@ public class FormConfiguration
optOnExistingRelation = CurUnoDialog.insertRadioButton("optOnExistingRelation", STOGGLESTEPS, this,
new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -96,7 +97,7 @@ public class FormConfiguration
optSelectManually = CurUnoDialog.insertRadioButton("optSelectManually", STOGGLESTEPS, this,
new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -105,7 +106,7 @@ public class FormConfiguration
lblRelations = CurUnoDialog.insertLabel("lblSelectRelation",
new String[]
{
- "Enabled", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -114,7 +115,7 @@ public class FormConfiguration
lstRelations = CurUnoDialog.insertListBox("lstrelations", SONEXISTINGRELATIONSELECTION, SONEXISTINGRELATIONSELECTION, this,
new String[]
{
- "Enabled", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -123,7 +124,7 @@ public class FormConfiguration
lblSubFormDescription = CurUnoDialog.insertLabel("lblSubFormDescription",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -134,7 +135,7 @@ public class FormConfiguration
// public void disableSubFormCheckBox()
// {
- // Helper.setUnoPropertyValue(UnoDialog.getModel(chkcreateSubForm), "Enabled", Boolean.FALSE);
+ // Helper.setUnoPropertyValue(UnoDialog.getModel(chkcreateSubForm), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
// }
public RelationController getRelationController()
@@ -150,8 +151,8 @@ public class FormConfiguration
public void toggleSubFormMode()
{
boolean bdoEnable = (this.chkcreateSubForm.getState() == 1);
- Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), "Enabled", new Boolean(bdoEnable && bsupportsRelations));
- Helper.setUnoPropertyValue(UnoDialog.getModel(optSelectManually), "Enabled", new Boolean(bdoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable && bsupportsRelations));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optSelectManually), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable));
toggleSteps();
}
@@ -163,7 +164,7 @@ public class FormConfiguration
Helper.setUnoPropertyValue(UnoDialog.getModel(lstRelations), "StringItemList", sreferencedTables);
this.CurSubFormFieldSelection = _CurSubFormFieldSelection;
toggleRelationsListbox();
- Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), "Enabled", new Boolean(bsupportsRelations && (chkcreateSubForm.getState() == 1)));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optOnExistingRelation), PropertyNames.PROPERTY_ENABLED, new Boolean(bsupportsRelations && (chkcreateSubForm.getState() == 1)));
}
public void toggleSteps()
@@ -230,8 +231,8 @@ public class FormConfiguration
private void toggleRelationsListbox()
{
boolean bdoenable = bsupportsRelations && this.optOnExistingRelation.getState() && (chkcreateSubForm.getState() == 1);
- Helper.setUnoPropertyValue(UnoDialog.getModel(lblRelations), "Enabled", new Boolean(bdoenable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(lstRelations), "Enabled", new Boolean(bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lblRelations), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lstRelations), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable));
}
public boolean hasSubForm()
diff --git a/wizards/com/sun/star/wizards/form/FormControlArranger.java b/wizards/com/sun/star/wizards/form/FormControlArranger.java
index 9a0c58fd41b8..f5478525eab1 100644
--- a/wizards/com/sun/star/wizards/form/FormControlArranger.java
+++ b/wizards/com/sun/star/wizards/form/FormControlArranger.java
@@ -36,6 +36,7 @@ import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Exception;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.Resource;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.*;
import com.sun.star.wizards.document.Control;
import com.sun.star.wizards.document.DatabaseControl;
@@ -643,7 +644,7 @@ public class FormControlArranger
if (DBControlList[i].getControlType() == FormHandler.SOCHECKBOX)
{
// Checkboxes have no Label near by
- DBControlList[i].setPropertyValue("Label", "");
+ DBControlList[i].setPropertyValue(PropertyNames.PROPERTY_LABEL, "");
}
}
}
@@ -662,7 +663,7 @@ public class FormControlArranger
}
if (nFieldType == DataType.LONGVARCHAR) /* memo */
{
- Helper.setUnoPropertyValue(LabelControlList[i], "MultiLine", Boolean.TRUE);
+ Helper.setUnoPropertyValue(LabelControlList[i], PropertyNames.PROPERTY_MULTILINE, Boolean.TRUE);
}
checkOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, true);
aDBControl.setPropertyValue("Border", NBorderType);
diff --git a/wizards/com/sun/star/wizards/form/FormWizard.java b/wizards/com/sun/star/wizards/form/FormWizard.java
index eb25fb65c78d..f75f3e1b84ab 100644
--- a/wizards/com/sun/star/wizards/form/FormWizard.java
+++ b/wizards/com/sun/star/wizards/form/FormWizard.java
@@ -32,6 +32,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XComponent;
import com.sun.star.sdb.application.DatabaseObject;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.NoValidPathException;
import com.sun.star.wizards.common.Properties;
@@ -81,7 +82,7 @@ public class FormWizard extends DatabaseObjectWizard
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Height", "Moveable", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width"
+ PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -230,7 +231,7 @@ public class FormWizard extends DatabaseObjectWizard
insertLabel("lblBinaryHelpText",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -245,7 +246,7 @@ public class FormWizard extends DatabaseObjectWizard
insertLabel("lblSubFormBinaryHelpText",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -457,7 +458,7 @@ public class FormWizard extends DatabaseObjectWizard
curDBCommandFieldSelection.setModified(true);
boolean benable = curDBCommandFieldSelection.getSelectedFieldNames().length > 0;
enablefromStep(SOSUBFORM_PAGE, benable);
- setControlProperty("btnWizardNext", "Enabled", new Boolean(benable));
+ setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, new Boolean(benable));
if (benable)
{
if (curFormConfiguration.hasSubForm())
@@ -470,7 +471,7 @@ public class FormWizard extends DatabaseObjectWizard
setStepEnabled(SOFIELDLINKER_PAGE, false);
}
}
- setControlProperty("btnWizardFinish", "Enabled", new Boolean(benable));
+ setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, new Boolean(benable));
}
}
}
diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java
index e1b27c05e7aa..5098a1ffbb74 100644
--- a/wizards/com/sun/star/wizards/form/StyleApplier.java
+++ b/wizards/com/sun/star/wizards/form/StyleApplier.java
@@ -43,6 +43,7 @@ import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.NoValidPathException;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.document.Control;
import com.sun.star.wizards.document.DatabaseControl;
import com.sun.star.wizards.document.GridControl;
@@ -111,7 +112,7 @@ public class StyleApplier
CurUnoDialog.insertLabel("lblStyles",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -121,7 +122,7 @@ public class StyleApplier
lstStyles = CurUnoDialog.insertListBox("lstStyles", null, SCHANGELAYOUT, this,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "SelectedItems", "Step", "StringItemList", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "SelectedItems", PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -131,7 +132,7 @@ public class StyleApplier
optNoBorder = CurUnoDialog.insertRadioButton("otpNoBorder", SCHANGEBORDERTYPE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Tag", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -141,7 +142,7 @@ public class StyleApplier
opt3DLook = CurUnoDialog.insertRadioButton("otp3DLook", SCHANGEBORDERTYPE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Tag", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -151,7 +152,7 @@ public class StyleApplier
optFlat = CurUnoDialog.insertRadioButton("otpFlat", SCHANGEBORDERTYPE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Tag", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -161,7 +162,7 @@ public class StyleApplier
CurUnoDialog.insertFixedLine("lnFieldBorder",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -193,7 +194,7 @@ public class StyleApplier
for (int i = 0; i < StyleNodeNames.length; i++)
{
Object oStyleNode = xNameAccess.getByName(StyleNodeNames[i]);
- StyleNames[i] = (String) Helper.getUnoPropertyValue(oStyleNode, "Name");
+ StyleNames[i] = (String) Helper.getUnoPropertyValue(oStyleNode, PropertyNames.PROPERTY_NAME);
FileNames[i] = (String) Helper.getUnoPropertyValue(oStyleNode, "CssHref");
}
}
diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java
index 0add27db3625..d4cd1ccc7cb6 100644
--- a/wizards/com/sun/star/wizards/form/UIControlArranger.java
+++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java
@@ -34,6 +34,7 @@ import com.sun.star.awt.XItemListener;
import com.sun.star.awt.XRadioButton;
import com.sun.star.lang.EventObject;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.NoValidPathException;
import com.sun.star.wizards.document.Control;
// import com.sun.star.wizards.ui.ImageList;
@@ -78,7 +79,7 @@ public class UIControlArranger
flnLabelPlacement = CurUnoDialog.insertFixedLine("lnLabelPlacement",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -88,7 +89,7 @@ public class UIControlArranger
optAlignLeft = CurUnoDialog.insertRadioButton("optAlignLeft", SOALIGNMETHOD, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -98,7 +99,7 @@ public class UIControlArranger
optAlignRight = CurUnoDialog.insertRadioButton("optAlignRight", SOALIGNMETHOD, this,
new String[]
{
- "Height", "HelpURL", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -114,7 +115,7 @@ public class UIControlArranger
// flnLabelPlacement = CurUnoDialog.insertFixedLine("lnArrangementHeader1",
// new String[]
// {
-// "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+// PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
// },
// new Object[]
// {
@@ -128,15 +129,15 @@ public class UIControlArranger
// CurUnoDialog.insertButton("btnLayout1", "btnLayout1",
// new String[]
// {
-// "Enabled",
-// "Height",
-// "HelpURL",
-// "Label",
-// "PositionX",
-// "PositionY",
-// "Step",
-// "TabIndex",
-// "Width"
+// PropertyNames.PROPERTY_ENABLED,
+// PropertyNames.PROPERTY_HEIGHT,
+// PropertyNames.PROPERTY_HELPURL,
+// PropertyNames.PROPERTY_LABEL,
+// PropertyNames.PROPERTY_POSITION_X,
+// PropertyNames.PROPERTY_POSITION_Y,
+// PropertyNames.PROPERTY_STEP,
+// PropertyNames.PROPERTY_TABINDEX,
+// PropertyNames.PROPERTY_WIDTH
// },
// new Object[]
// {
@@ -200,7 +201,7 @@ public class UIControlArranger
public void enableSubFormImageList(boolean _bdoEnable)
{
m_aArrangeList[1].m_aButtonList.setenabled(_bdoEnable);
- CurUnoDialog.setControlProperty("lnLabelPlacment_2", "Enabled", new Boolean(_bdoEnable));
+ CurUnoDialog.setControlProperty("lnLabelPlacment_2", PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoEnable));
}
public short getAlignValue()
@@ -243,9 +244,9 @@ public class UIControlArranger
private void enableAlignControlGroup(boolean _bEnableAlignControlGroup)
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(flnLabelPlacement), "Enabled", new Boolean(_bEnableAlignControlGroup));
- Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), "Enabled", new Boolean(_bEnableAlignControlGroup));
- Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignRight), "Enabled", new Boolean(_bEnableAlignControlGroup));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(flnLabelPlacement), PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnableAlignControlGroup));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnableAlignControlGroup));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignRight), PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnableAlignControlGroup));
}
// private class ArrangeImageList implements XItemListener
@@ -262,7 +263,7 @@ public class UIControlArranger
// CurUnoDialog.insertFixedLine("lnLabelPlacment_" + (_formindex + 1),
// new String[]
// {
-// "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+// PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
// },
// new Object[]
// {
@@ -293,7 +294,7 @@ public class UIControlArranger
//
// public void setToLeftAlign()
// {
-// Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), "State", new Short((short) 1));
+// Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), PropertyNames.PROPERTY_STATE, new Short((short) 1));
// }
//
// /* (non-Javadoc)
@@ -383,13 +384,13 @@ public class UIControlArranger
CurUnoDialog.insertFixedLine("lnLabelPlacment_" + (_formindex + 1),
new String[]
{
- "Height",
- "Label",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_LABEL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -426,7 +427,7 @@ public class UIControlArranger
public void setToLeftAlign()
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), "State", new Short((short) 1));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optAlignLeft), PropertyNames.PROPERTY_STATE, new Short((short) 1));
}
/* (non-Javadoc)
diff --git a/wizards/com/sun/star/wizards/letter/LetterDocument.java b/wizards/com/sun/star/wizards/letter/LetterDocument.java
index 0c981c6e066e..b7b260e69e85 100644
--- a/wizards/com/sun/star/wizards/letter/LetterDocument.java
+++ b/wizards/com/sun/star/wizards/letter/LetterDocument.java
@@ -172,7 +172,7 @@ public class LetterDocument extends TextDocument
myFieldHandler.changeUserFieldContent("Street", (String) Helper.getUnoObjectbyName(oUserDataAccess, "street"));
myFieldHandler.changeUserFieldContent("PostCode", (String) Helper.getUnoObjectbyName(oUserDataAccess, "postalcode"));
myFieldHandler.changeUserFieldContent("City", (String) Helper.getUnoObjectbyName(oUserDataAccess, "l"));
- myFieldHandler.changeUserFieldContent("State", (String) Helper.getUnoObjectbyName(oUserDataAccess, "st"));
+ myFieldHandler.changeUserFieldContent(PropertyNames.PROPERTY_STATE, (String) Helper.getUnoObjectbyName(oUserDataAccess, "st"));
}
catch (Exception exception)
{
@@ -304,8 +304,8 @@ public class LetterDocument extends TextDocument
{
Helper.setUnoPropertyValue(xFrame, "HoriOrient", new Short(HoriOrientation.NONE));
Helper.setUnoPropertyValue(xFrame, "VertOrient", new Short(VertOrientation.NONE));
- Helper.setUnoPropertyValue(xFrame, "Height", new Integer(iHeight));
- Helper.setUnoPropertyValue(xFrame, "Width", new Integer(iWidth));
+ Helper.setUnoPropertyValue(xFrame, PropertyNames.PROPERTY_HEIGHT, new Integer(iHeight));
+ Helper.setUnoPropertyValue(xFrame, PropertyNames.PROPERTY_WIDTH, new Integer(iWidth));
Helper.setUnoPropertyValue(xFrame, "HoriOrientPosition", new Integer(iXPos));
Helper.setUnoPropertyValue(xFrame, "VertOrientPosition", new Integer(iYPos));
Helper.setUnoPropertyValue(xFrame, "HoriOrientRelation", new Short(RelOrientation.PAGE_FRAME));
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java
index ffdec06942a6..619227d9f3ba 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.java
@@ -143,7 +143,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Closeable", "Height", "Moveable", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width"
+ "Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -165,7 +165,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optBusinessLetter = insertRadioButton("optBusinessLetter", OPTBUSINESSLETTER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -174,7 +174,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optPrivOfficialLetter = insertRadioButton("optPrivOfficialLetter", OPTPRIVOFFICIALLETTER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -183,7 +183,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optPrivateLetter = insertRadioButton("optPrivateLetter", OPTPRIVATELETTER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -192,7 +192,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lstBusinessStyle = insertListBox("lstBusinessStyle", LSTBUSINESSSTYLE_ACTION_PERFORMED, LSTBUSINESSSTYLE_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -201,7 +201,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkBusinessPaper = insertCheckBox("chkBusinessPaper", CHKBUSINESSPAPER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -210,7 +210,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lstPrivOfficialStyle = insertListBox("lstPrivOfficialStyle", LSTPRIVOFFICIALSTYLE_ACTION_PERFORMED, LSTPRIVOFFICIALSTYLE_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -219,7 +219,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lstPrivateStyle = insertListBox("lstPrivateStyle", LSTPRIVATESTYLE_ACTION_PERFORMED, LSTPRIVATESTYLE_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -228,7 +228,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblBusinessStyle = insertLabel("lblBusinessStyle",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -237,7 +237,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblPrivOfficialStyle = insertLabel("lblPrivOfficialStyle",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -246,7 +246,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblTitle1 = insertLabel("lblTitle1",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -255,7 +255,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblPrivateStyle = insertLabel("lblPrivateStyle",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -264,7 +264,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblIntroduction = insertLabel("lblIntroduction",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -273,7 +273,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
ImageControl3 = insertInfoImage(92, 145, 1);
// ImageControl3 = insertImage("ImageControl3",
-// new String[] {"Border", "Height", "ImageURL", "Name", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"},
+// new String[] {"Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
// new Object[] { new Short((short)0), INTEGERS[10],"private:resource/dbu/image/19205","ImageControl3",new Integer(92),new Integer(145),Boolean.FALSE,INTEGERS[1],new Short((short)81),INTEGERS[10]}
// );
}
@@ -283,7 +283,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkPaperCompanyLogo = insertCheckBox("chkPaperCompanyLogo", CHKPAPERCOMPANYLOGO_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -292,7 +292,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numLogoHeight = insertNumericField("numLogoHeight", NUMLOGOHEIGHT_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "StrictFormat", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, "StrictFormat", PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -301,7 +301,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numLogoX = insertNumericField("numLogoX", NUMLOGOX_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -310,7 +310,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numLogoWidth = insertNumericField("numLogoWidth", NUMLOGOWIDTH_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -319,7 +319,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numLogoY = insertNumericField("numLogoY", NUMLOGOY_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -328,7 +328,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkPaperCompanyAddress = insertCheckBox("chkPaperCompanyAddress", CHKPAPERCOMPANYADDRESS_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -337,7 +337,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numAddressHeight = insertNumericField("numAddressHeight", NUMADDRESSHEIGHT_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "StrictFormat", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, "StrictFormat", PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -346,7 +346,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numAddressX = insertNumericField("numAddressX", NUMADDRESSX_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -355,7 +355,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numAddressWidth = insertNumericField("numAddressWidth", NUMADDRESSWIDTH_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -364,7 +364,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numAddressY = insertNumericField("numAddressY", NUMADDRESSY_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -373,7 +373,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkCompanyReceiver = insertCheckBox("chkCompanyReceiver", CHKCOMPANYRECEIVER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -382,7 +382,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkPaperFooter = insertCheckBox("chkPaperFooter", CHKPAPERFOOTER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -391,7 +391,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
numFooterHeight = insertNumericField("numFooterHeight", NUMFOOTERHEIGHT_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Spin", "Step", "TabIndex", "Value", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Spin", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Value", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -400,7 +400,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblLogoHeight = insertLabel("lblLogoHeight",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -409,7 +409,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblLogoWidth = insertLabel("lblLogoWidth",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -418,7 +418,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
FixedLine5 = insertFixedLine("FixedLine5",
new String[]
{
- "Height", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -427,7 +427,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
FixedLine6 = insertFixedLine("FixedLine6",
new String[]
{
- "Height", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -436,7 +436,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblFooterHeight = insertLabel("lblFooterHeight",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -445,7 +445,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblLogoX = insertLabel("lblLogoX",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -454,7 +454,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblLogoY = insertLabel("lblLogoY",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -463,7 +463,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblAddressHeight = insertLabel("lblAddressHeight",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -472,7 +472,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblAddressWidth = insertLabel("lblAddressWidth",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -481,7 +481,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblAddressX = insertLabel("lblAddressX",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -490,7 +490,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblAddressY = insertLabel("lblAddressY",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -499,7 +499,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblTitle2 = insertLabel("lblTitle2",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -512,7 +512,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lstLetterNorm = insertListBox("lstLetterNorm", LSTLETTERNORM_ACTION_PERFORMED, LSTLETTERNORM_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -521,7 +521,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseLogo = insertCheckBox("chkUseLogo", CHKUSELOGO_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -530,7 +530,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseAddressReceiver = insertCheckBox("chkUseAddressReceiver", CHKUSEADDRESSRECEIVER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -539,7 +539,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseSigns = insertCheckBox("chkUseSigns", CHKUSESIGNS_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -548,7 +548,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseSubject = insertCheckBox("chkUseSubject", CHKUSESUBJECT_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -557,7 +557,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseSalutation = insertCheckBox("chkUseSalutation", CHKUSESALUTATION_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -566,7 +566,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lstSalutation = insertComboBox("lstSalutation", LSTSALUTATION_ACTION_PERFORMED, LSTSALUTATION_ITEM_CHANGED, LSTSALUTATION_TEXT_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -575,7 +575,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseBendMarks = insertCheckBox("chkUseBendMarks", CHKUSEBENDMARKS_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -584,7 +584,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseGreeting = insertCheckBox("chkUseGreeting", CHKUSEGREETING_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -593,7 +593,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lstGreeting = insertComboBox("lstGreeting", LSTGREETING_ACTION_PERFORMED, LSTGREETING_ITEM_CHANGED, LSTGREETING_TEXT_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -602,7 +602,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkUseFooter = insertCheckBox("chkUseFooter", CHKUSEFOOTER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -611,7 +611,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblLetterNorm = insertLabel("lblLetterNorm",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -620,7 +620,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblTitle3 = insertLabel("lblTitle3",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -633,7 +633,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optSenderPlaceholder = insertRadioButton("optSenderPlaceholder", OPTSENDERPLACEHOLDER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -642,7 +642,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optSenderDefine = insertRadioButton("optSenderDefine", OPTSENDERDEFINE_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -651,7 +651,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
txtSenderName = insertTextField("txtSenderName", TXTSENDERNAME_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -660,7 +660,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
txtSenderStreet = insertTextField("txtSenderStreet", TXTSENDERSTREET_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -669,7 +669,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
txtSenderPostCode = insertTextField("txtSenderPostCode", TXTSENDERPOSTCODE_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -678,7 +678,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
txtSenderState = insertTextField("txtSenderState", TXTSENDERSTATE_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -687,7 +687,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
txtSenderCity = insertTextField("txtSenderCity", TXTSENDERCITY_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -696,7 +696,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optReceiverPlaceholder = insertRadioButton("optReceiverPlaceholder", OPTRECEIVERPLACEHOLDER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -705,7 +705,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optReceiverDatabase = insertRadioButton("optReceiverDatabase", OPTRECEIVERDATABASE_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -714,7 +714,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblSenderAddress = insertLabel("lblSenderAddress",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -723,7 +723,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
FixedLine2 = insertFixedLine("FixedLine2",
new String[]
{
- "Height", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -732,7 +732,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblReceiverAddress = insertLabel("lblReceiverAddress",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -741,7 +741,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblSenderName = insertLabel("lblSenderName",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -750,7 +750,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblSenderStreet = insertLabel("lblSenderStreet",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -759,7 +759,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblPostCodeCity = insertLabel("lblPostCodeCity",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -768,7 +768,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblTitle4 = insertLabel("lblTitle4",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -781,7 +781,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
txtFooter = insertTextField("txtFooter", TXTFOOTER_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -790,7 +790,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkFooterNextPages = insertCheckBox("chkFooterNextPages", CHKFOOTERNEXTPAGES_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -799,7 +799,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
chkFooterPageNumbers = insertCheckBox("chkFooterPageNumbers", CHKFOOTERPAGENUMBERS_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -808,7 +808,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblFooter = insertLabel("lblFooter",
new String[]
{
- "FontDescriptor", "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -817,7 +817,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblTitle5 = insertLabel("lblTitle5",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -830,7 +830,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
txtTemplateName = insertTextField("txtTemplateName", TXTTEMPLATENAME_TEXT_CHANGED,
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Text", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -839,7 +839,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optCreateLetter = insertRadioButton("optCreateLetter", OPTCREATELETTER_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -848,7 +848,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
optMakeChanges = insertRadioButton("optMakeChanges", OPTMAKECHANGES_ITEM_CHANGED,
new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -857,7 +857,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblFinalExplanation1 = insertLabel("lblFinalExplanation1",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -866,7 +866,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblProceed = insertLabel("lblProceed",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -875,7 +875,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblFinalExplanation2 = insertLabel("lblFinalExplanation2",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -884,7 +884,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
ImageControl2 = insertImage("ImageControl2",
new String[]
{
- "Border", "Height", "ImageURL", "Name", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -893,7 +893,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblTemplateName = insertLabel("lblTemplateName",
new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -902,7 +902,7 @@ public abstract class LetterWizardDialog extends WizardDialog implements LetterW
lblTitle6 = insertLabel("lblTitle6",
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
index 9fb6c2e4b2e7..295d900bdec6 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
@@ -35,6 +35,7 @@ import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.NoValidPathException;
import com.sun.star.wizards.common.SystemDialog;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.awt.VclWindowPeerAttribute;
import com.sun.star.awt.XTextComponent;
import com.sun.star.awt.XWindow;
@@ -372,13 +373,13 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public void optBusinessLetterItemChanged()
{
DataAware.setDataObject(letterDA, myConfig.cp_BusinessLetter, true);
- setControlProperty("lblBusinessStyle", "Enabled", Boolean.TRUE);
- setControlProperty("lstBusinessStyle", "Enabled", Boolean.TRUE);
- setControlProperty("chkBusinessPaper", "Enabled", Boolean.TRUE);
- setControlProperty("lblPrivOfficialStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstPrivOfficialStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lblPrivateStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstPrivateStyle", "Enabled", Boolean.FALSE);
+ setControlProperty("lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("chkBusinessPaper", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
lstBusinessStyleItemChanged();
enableSenderReceiver();
setPossibleFooter(true);
@@ -391,13 +392,13 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public void optPrivOfficialLetterItemChanged()
{
DataAware.setDataObject(letterDA, myConfig.cp_PrivateOfficialLetter, true);
- setControlProperty("lblBusinessStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstBusinessStyle", "Enabled", Boolean.FALSE);
- setControlProperty("chkBusinessPaper", "Enabled", Boolean.FALSE);
- setControlProperty("lblPrivOfficialStyle", "Enabled", Boolean.TRUE);
- setControlProperty("lstPrivOfficialStyle", "Enabled", Boolean.TRUE);
- setControlProperty("lblPrivateStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstPrivateStyle", "Enabled", Boolean.FALSE);
+ setControlProperty("lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("chkBusinessPaper", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lstPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
lstPrivOfficialStyleItemChanged();
disableBusinessPaper();
enableSenderReceiver();
@@ -411,13 +412,13 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public void optPrivateLetterItemChanged()
{
DataAware.setDataObject(letterDA, myConfig.cp_PrivateLetter, true);
- setControlProperty("lblBusinessStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstBusinessStyle", "Enabled", Boolean.FALSE);
- setControlProperty("chkBusinessPaper", "Enabled", Boolean.FALSE);
- setControlProperty("lblPrivOfficialStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lstPrivOfficialStyle", "Enabled", Boolean.FALSE);
- setControlProperty("lblPrivateStyle", "Enabled", Boolean.TRUE);
- setControlProperty("lstPrivateStyle", "Enabled", Boolean.TRUE);
+ setControlProperty("lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("chkBusinessPaper", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lstPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
lstPrivateStyleItemChanged();
disableBusinessPaper();
disableSenderReceiver();
@@ -430,27 +431,27 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public void optSenderPlaceholderItemChanged()
{
- setControlProperty("lblSenderName", "Enabled", Boolean.FALSE);
- setControlProperty("lblSenderStreet", "Enabled", Boolean.FALSE);
- setControlProperty("lblPostCodeCity", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderName", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderStreet", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderPostCode", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderState", "Enabled", Boolean.FALSE);
- setControlProperty("txtSenderCity", "Enabled", Boolean.FALSE);
+ setControlProperty("lblSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderState", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
myLetterDoc.fillSenderWithUserData();
}
public void optSenderDefineItemChanged()
{
- setControlProperty("lblSenderName", "Enabled", Boolean.TRUE);
- setControlProperty("lblSenderStreet", "Enabled", Boolean.TRUE);
- setControlProperty("lblPostCodeCity", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderName", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderStreet", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderPostCode", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderState", "Enabled", Boolean.TRUE);
- setControlProperty("txtSenderCity", "Enabled", Boolean.TRUE);
+ setControlProperty("lblSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderName", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderStreet", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderState", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
txtSenderNameTextChanged();
txtSenderStreetTextChanged();
txtSenderPostCodeTextChanged();
@@ -579,14 +580,14 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
numLogoHeight.setValue(0.1);
}
BusCompanyLogo = myLetterDoc.new BusinessPaperObject("Company Logo", (int) (numLogoWidth.getValue() * 1000), (int) (numLogoHeight.getValue() * 1000), (int) (numLogoX.getValue() * 1000), (int) (numLogoY.getValue() * 1000));
- setControlProperty("numLogoHeight", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyLogoHeight", "Enabled", Boolean.TRUE);
- setControlProperty("numLogoWidth", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyLogoWidth", "Enabled", Boolean.TRUE);
- setControlProperty("numLogoX", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyLogoX", "Enabled", Boolean.TRUE);
- setControlProperty("numLogoY", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyLogoY", "Enabled", Boolean.TRUE);
+ setControlProperty("numLogoHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyLogoHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("numLogoWidth", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyLogoWidth", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("numLogoX", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyLogoX", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("numLogoY", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyLogoY", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
setPossibleLogo(false);
}
else
@@ -595,14 +596,14 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
BusCompanyLogo.removeFrame();
}
- setControlProperty("numLogoHeight", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyLogoHeight", "Enabled", Boolean.FALSE);
- setControlProperty("numLogoWidth", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyLogoWidth", "Enabled", Boolean.FALSE);
- setControlProperty("numLogoX", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyLogoX", "Enabled", Boolean.FALSE);
- setControlProperty("numLogoY", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyLogoY", "Enabled", Boolean.FALSE);
+ setControlProperty("numLogoHeight", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyLogoHeight", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("numLogoWidth", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyLogoWidth", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("numLogoX", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyLogoX", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("numLogoY", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyLogoY", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
setPossibleLogo(true);
}
}
@@ -621,14 +622,14 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
numAddressHeight.setValue(0.1);
}
BusCompanyAddress = myLetterDoc.new BusinessPaperObject("Company Address", (int) (numAddressWidth.getValue() * 1000), (int) (numAddressHeight.getValue() * 1000), (int) (numAddressX.getValue() * 1000), (int) (numAddressY.getValue() * 1000));
- setControlProperty("numAddressHeight", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyAddressHeight", "Enabled", Boolean.TRUE);
- setControlProperty("numAddressWidth", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyAddressWidth", "Enabled", Boolean.TRUE);
- setControlProperty("numAddressX", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyAddressX", "Enabled", Boolean.TRUE);
- setControlProperty("numAddressY", "Enabled", Boolean.TRUE);
- setControlProperty("lblCompanyAddressY", "Enabled", Boolean.TRUE);
+ setControlProperty("numAddressHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyAddressHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("numAddressWidth", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyAddressWidth", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("numAddressX", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyAddressX", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("numAddressY", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ setControlProperty("lblCompanyAddressY", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
if (myLetterDoc.hasElement("Sender Address"))
{
myLetterDoc.switchElement("Sender Address", (false));
@@ -644,14 +645,14 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
BusCompanyAddress.removeFrame();
}
- setControlProperty("numAddressHeight", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyAddressHeight", "Enabled", Boolean.FALSE);
- setControlProperty("numAddressWidth", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyAddressWidth", "Enabled", Boolean.FALSE);
- setControlProperty("numAddressX", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyAddressX", "Enabled", Boolean.FALSE);
- setControlProperty("numAddressY", "Enabled", Boolean.FALSE);
- setControlProperty("lblCompanyAddressY", "Enabled", Boolean.FALSE);
+ setControlProperty("numAddressHeight", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyAddressHeight", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("numAddressWidth", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyAddressWidth", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("numAddressX", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyAddressX", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("numAddressY", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblCompanyAddressY", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
if (myLetterDoc.hasElement("Sender Address"))
{
myLetterDoc.switchElement("Sender Address", (true));
@@ -677,7 +678,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
try
{
xReceiverFrame = TextFrameHandler.getFrameByName("Receiver Address", xTextDocument);
- Integer FrameWidth = (Integer) Helper.getUnoPropertyValue(xReceiverFrame, "Width");
+ Integer FrameWidth = (Integer) Helper.getUnoPropertyValue(xReceiverFrame, PropertyNames.PROPERTY_WIDTH);
int iFrameWidth = FrameWidth.intValue();
Integer FrameX = (Integer) Helper.getUnoPropertyValue(xReceiverFrame, "HoriOrientPosition");
int iFrameX = FrameX.intValue();
@@ -734,8 +735,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
numFooterHeight.setValue(0.1);
}
BusFooter = myLetterDoc.new BusinessPaperObject("Footer", (int) myLetterDoc.DocSize.Width, (int) (numFooterHeight.getValue() * 1000), (int) 0, (int) (myLetterDoc.DocSize.Height - (numFooterHeight.getValue() * 1000)));
- this.setControlProperty("numFooterHeight", "Enabled", Boolean.TRUE);
- this.setControlProperty("lblFooterHeight", "Enabled", Boolean.TRUE);
+ this.setControlProperty("numFooterHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ this.setControlProperty("lblFooterHeight", PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
setPossibleFooter(false);
}
else
@@ -744,8 +745,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
BusFooter.removeFrame();
}
- setControlProperty("numFooterHeight", "Enabled", Boolean.FALSE);
- setControlProperty("lblFooterHeight", "Enabled", Boolean.FALSE);
+ setControlProperty("numFooterHeight", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ setControlProperty("lblFooterHeight", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
setPossibleFooter(true);
}
}
@@ -757,7 +758,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
if (myLetterDoc.hasElement("Company Logo"))
{
- boolean logostatus = AnyConverter.toBoolean(getControlProperty("chkUseLogo", "Enabled")) && (chkUseLogo.getState() != 0);
+ boolean logostatus = AnyConverter.toBoolean(getControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED)) && (chkUseLogo.getState() != 0);
myLetterDoc.switchElement("Company Logo", logostatus);
}
}
@@ -773,7 +774,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
if (myLetterDoc.hasElement("Sender Address Repeated"))
{
- boolean rstatus = AnyConverter.toBoolean(getControlProperty("chkUseAddressReceiver", "Enabled")) && (chkUseAddressReceiver.getState() != 0);
+ boolean rstatus = AnyConverter.toBoolean(getControlProperty("chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED)) && (chkUseAddressReceiver.getState() != 0);
myLetterDoc.switchElement("Sender Address Repeated", rstatus);
}
}
@@ -811,7 +812,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
try
{
- boolean bFooterPossible = (chkUseFooter.getState() != 0) && AnyConverter.toBoolean(getControlProperty("chkUseFooter", "Enabled"));
+ boolean bFooterPossible = (chkUseFooter.getState() != 0) && AnyConverter.toBoolean(getControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED));
if (chkFooterNextPages.getState() != 0)
{
@@ -826,7 +827,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
//enable/disable roadmap item for footer page
XInterface BPaperItem = getRoadmapItemByID(RM_FOOTER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", new Boolean(bFooterPossible));
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bFooterPossible));
}
catch (Exception exception)
@@ -847,7 +848,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
private void setPossibleFooter(boolean bState)
{
- setControlProperty("chkUseFooter", "Enabled", new Boolean(bState));
+ setControlProperty("chkUseFooter", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
chkUseFooterItemChanged();
}
@@ -855,7 +856,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
if (myLetterDoc.hasElement("Sender Address Repeated"))
{
- setControlProperty("chkUseAddressReceiver", "Enabled", new Boolean(bState));
+ setControlProperty("chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
chkUseAddressReceiverItemChanged();
}
}
@@ -864,7 +865,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
if (myLetterDoc.hasElement("Company Logo"))
{
- setControlProperty("chkUseLogo", "Enabled", new Boolean(bState));
+ setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
chkUseLogoItemChanged();
}
}
@@ -901,7 +902,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public void txtSenderStateTextChanged()
{
TextFieldHandler myFieldHandler = new TextFieldHandler(myLetterDoc.xMSF, xTextDocument);
- myFieldHandler.changeUserFieldContent("State", txtSenderState.getText());
+ myFieldHandler.changeUserFieldContent(PropertyNames.PROPERTY_STATE, txtSenderState.getText());
}
public void txtTemplateNameTextChanged()
@@ -916,7 +917,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation);
myLetterDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0));
- setControlProperty("lstSalutation", "Enabled", new Boolean(chkUseSalutation.getState() != 0));
+ setControlProperty("lstSalutation", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseSalutation.getState() != 0));
}
public void lstSalutationItemChanged()
@@ -933,7 +934,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
{
XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting);
myLetterDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0));
- setControlProperty("lstGreeting", "Enabled", new Boolean(chkUseGreeting.getState() != 0));
+ setControlProperty("lstGreeting", PropertyNames.PROPERTY_ENABLED, new Boolean(chkUseGreeting.getState() != 0));
}
private void setDefaultForGreetingAndSalutation()
@@ -1008,39 +1009,39 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
private void setPossibleSenderData(boolean bState)
{
- setControlProperty("optSenderDefine", "Enabled", new Boolean(bState));
- setControlProperty("optSenderPlaceholder", "Enabled", new Boolean(bState));
- setControlProperty("lblSenderAddress", "Enabled", new Boolean(bState));
+ setControlProperty("optSenderDefine", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("optSenderPlaceholder", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("lblSenderAddress", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
if (!bState)
{
- setControlProperty("txtSenderCity", "Enabled", new Boolean(bState));
- setControlProperty("txtSenderName", "Enabled", new Boolean(bState));
- setControlProperty("txtSenderPostCode", "Enabled", new Boolean(bState));
- setControlProperty("txtSenderStreet", "Enabled", new Boolean(bState));
- setControlProperty("txtSenderCity", "Enabled", new Boolean(bState));
- setControlProperty("txtSenderState", "Enabled", new Boolean(bState));
- setControlProperty("lblSenderName", "Enabled", new Boolean(bState));
- setControlProperty("lblSenderStreet", "Enabled", new Boolean(bState));
- setControlProperty("lblPostCodeCity", "Enabled", new Boolean(bState));
+ setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("txtSenderName", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("txtSenderStreet", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("txtSenderCity", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("txtSenderState", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("lblSenderName", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("lblSenderStreet", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
+ setControlProperty("lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, new Boolean(bState));
}
}
private void enableSenderReceiver()
{
XInterface BPaperItem = getRoadmapItemByID(RM_SENDERRECEIVER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.TRUE);
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
}
private void disableSenderReceiver()
{
XInterface BPaperItem = getRoadmapItemByID(RM_SENDERRECEIVER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.FALSE);
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
}
private void enableBusinessPaper()
{
XInterface BPaperItem = getRoadmapItemByID(RM_BUSINESSPAPER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.TRUE);
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
chkPaperCompanyLogoItemChanged();
chkPaperCompanyAddressItemChanged();
chkPaperFooterItemChanged();
@@ -1050,7 +1051,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
private void disableBusinessPaper()
{
XInterface BPaperItem = getRoadmapItemByID(RM_BUSINESSPAPER);
- Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.FALSE);
+ Helper.setUnoPropertyValue(BPaperItem, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
if (BusCompanyLogo != null)
{
BusCompanyLogo.removeFrame();
@@ -1340,11 +1341,11 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
public void initializeElements()
{
- setControlProperty("chkUseLogo", "Enabled", new Boolean(myLetterDoc.hasElement("Company Logo")));
- setControlProperty("chkUseBendMarks", "Enabled", new Boolean(myLetterDoc.hasElement("Bend Marks")));
- setControlProperty("chkUseAddressReceiver", "Enabled", new Boolean(myLetterDoc.hasElement("Sender Address Repeated")));
- setControlProperty("chkUseSubject", "Enabled", new Boolean(myLetterDoc.hasElement("Subject Line")));
- setControlProperty("chkUseSigns", "Enabled", new Boolean(myLetterDoc.hasElement("Letter Signs")));
+ setControlProperty("chkUseLogo", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Company Logo")));
+ setControlProperty("chkUseBendMarks", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Bend Marks")));
+ setControlProperty("chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Sender Address Repeated")));
+ setControlProperty("chkUseSubject", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Subject Line")));
+ setControlProperty("chkUseSigns", PropertyNames.PROPERTY_ENABLED, new Boolean(myLetterDoc.hasElement("Letter Signs")));
myLetterDoc.updateDateFields();
}
diff --git a/wizards/com/sun/star/wizards/makefile.mk b/wizards/com/sun/star/wizards/makefile.mk
index a9ec3e2d5735..b3fb389bb551 100644
--- a/wizards/com/sun/star/wizards/makefile.mk
+++ b/wizards/com/sun/star/wizards/makefile.mk
@@ -64,6 +64,7 @@ JAVAFILES= \
common$/JavaTools.java \
common$/NoValidPathException.java \
common$/Properties.java \
+ common$/PropertyNames.java \
common$/Resource.java \
common$/SystemDialog.java \
common$/Configuration.java \
diff --git a/wizards/com/sun/star/wizards/query/Finalizer.java b/wizards/com/sun/star/wizards/query/Finalizer.java
index f60422503be3..1b528a749f36 100644
--- a/wizards/com/sun/star/wizards/query/Finalizer.java
+++ b/wizards/com/sun/star/wizards/query/Finalizer.java
@@ -26,15 +26,16 @@
************************************************************************/
package com.sun.star.wizards.query;
-import com.sun.star.wizards.common.*;
import com.sun.star.awt.XRadioButton;
import com.sun.star.awt.XTextComponent;
-import com.sun.star.wizards.db.*;
import com.sun.star.lang.IllegalArgumentException;
-import com.sun.star.lang.XComponent;
import com.sun.star.sdb.CommandType;
-import com.sun.star.uno.*;
-import com.sun.star.wizards.ui.*;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.wizards.common.HelpIds;
+import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
+import com.sun.star.wizards.ui.UIConsts;
+import com.sun.star.wizards.ui.UnoDialog;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -66,7 +67,7 @@ public class Finalizer
m_queryWizard.insertLabel("lblQueryTitle", new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -74,7 +75,7 @@ public class Finalizer
});
m_aTxtTitle = m_queryWizard.insertTextField("txtQueryTitle", "changeTitle", this, new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -82,7 +83,7 @@ public class Finalizer
});
m_queryWizard.insertLabel("lblHowGoOn", new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -91,7 +92,7 @@ public class Finalizer
this.xRadioDisplayQuery = m_queryWizard.insertRadioButton("optDisplayQuery",
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -101,7 +102,7 @@ public class Finalizer
m_queryWizard.insertRadioButton("optModifyQuery",
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -109,7 +110,7 @@ public class Finalizer
});
m_queryWizard.insertFixedLine("flnSummary", new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -117,7 +118,7 @@ public class Finalizer
});
m_queryWizard.insertTextField("txtSummary", 0, null, new String[]
{
- "Height", "HelpURL", "MultiLine", "PositionX", "PositionY", "ReadOnly", "Step", "VScroll", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ReadOnly", PropertyNames.PROPERTY_STEP, "VScroll", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -145,7 +146,7 @@ public class Finalizer
{
String[] sCommandNames = CurDBMetaData.getIncludedCommandNames();
sCurQueryName = resQuery + "_" + sCommandNames[0];
- sCurQueryName = CurDBMetaData.ConnectionTools.getObjectNames().suggestName(CommandType.QUERY, sCurQueryName);
+ sCurQueryName = CurDBMetaData.suggestName( CommandType.QUERY, sCurQueryName );
Helper.setUnoPropertyValue(UnoDialog.getModel(m_aTxtTitle), "Text", sCurQueryName);
}
}
@@ -182,7 +183,7 @@ public class Finalizer
{
try
{
- final short state = AnyConverter.toShort( Helper.getUnoPropertyValue( UnoDialog.getModel( xRadioDisplayQuery ), "State" ) );
+ final short state = AnyConverter.toShort( Helper.getUnoPropertyValue( UnoDialog.getModel( xRadioDisplayQuery ), PropertyNames.PROPERTY_STATE ) );
final boolean viewMode = state == (short)1;
return !viewMode;
}
diff --git a/wizards/com/sun/star/wizards/query/QuerySummary.java b/wizards/com/sun/star/wizards/query/QuerySummary.java
index f570970e0fe8..f246ef327db8 100644
--- a/wizards/com/sun/star/wizards/query/QuerySummary.java
+++ b/wizards/com/sun/star/wizards/query/QuerySummary.java
@@ -26,12 +26,13 @@
************************************************************************/
package com.sun.star.wizards.query;
+import com.sun.star.beans.PropertyValue;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.wizards.common.*;
-//import com.sun.star.wizards.ui.FilterComponent;
-import com.sun.star.wizards.ui.*;
-import com.sun.star.wizards.db.*;
-import com.sun.star.beans.*;
+import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.Resource;
+import com.sun.star.wizards.db.FieldColumn;
+import com.sun.star.wizards.db.QueryMetaData;
+import com.sun.star.wizards.ui.FilterComponent;
public class QuerySummary extends QueryMetaData
{
diff --git a/wizards/com/sun/star/wizards/query/QueryWizard.java b/wizards/com/sun/star/wizards/query/QueryWizard.java
index a0970534d657..bca4e1a6fa5f 100644
--- a/wizards/com/sun/star/wizards/query/QueryWizard.java
+++ b/wizards/com/sun/star/wizards/query/QueryWizard.java
@@ -40,6 +40,7 @@ import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.Properties;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.Resource;
import com.sun.star.wizards.db.DatabaseObjectWizard;
import com.sun.star.wizards.db.QueryMetaData;
@@ -185,7 +186,7 @@ public class QueryWizard extends DatabaseObjectWizard
resmsgNonNumericAsGroupBy = m_oResource.getResText(UIConsts.RID_QUERY + 88);
Helper.setUnoPropertyValues(xDialogModel, new String[]
{
- "Height", "Moveable", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width"
+ PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -226,7 +227,7 @@ public class QueryWizard extends DatabaseObjectWizard
try
{
Object oRoadmapItem;
- int CurStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, "Step"));
+ int CurStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP));
boolean bEnabled = false;
int CurItemID;
for (int i = 0; i < getRMItemCount(); i++)
@@ -308,7 +309,9 @@ public class QueryWizard extends DatabaseObjectWizard
{
try
{
- m_DBCommandFieldSelectio = new CommandFieldSelection(this, m_DBMetaData, 120, reslblFields, reslblSelFields, reslblTables, true, 40850);
+ m_DBCommandFieldSelectio = new CommandFieldSelection(
+ this, m_DBMetaData, 120, reslblFields, reslblSelFields, reslblTables,
+ m_DBMetaData.supportsQueriesInFrom(), 40850);
m_DBCommandFieldSelectio.setAppendMode(true);
m_DBCommandFieldSelectio.addFieldSelectionListener(new FieldSelectionListener());
m_sortingComponent = new SortingComponent(this, SOSORTING_PAGE, 95, 27, 210, 40865);
@@ -467,8 +470,8 @@ public class QueryWizard extends DatabaseObjectWizard
private void enableWizardSteps(String[] NewItems)
{
boolean bEnabled = NewItems.length > 0;
- setControlProperty("btnWizardNext", "Enabled", bEnabled);
- setControlProperty("btnWizardFinish", "Enabled", bEnabled);
+ setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, bEnabled);
+ setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, bEnabled);
enableRoadmapItems(NewItems, bEnabled); // Note: Performancewise this could be improved
}
@@ -508,7 +511,7 @@ public class QueryWizard extends DatabaseObjectWizard
else
{
boolean bEnabled = (m_groupFieldSelection.getSelectedFieldNames().length > 0);
- Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPFILTER_PAGE), "Enabled", bEnabled);
+ Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPFILTER_PAGE), PropertyNames.PROPERTY_ENABLED, bEnabled);
}
}
@@ -541,7 +544,7 @@ public class QueryWizard extends DatabaseObjectWizard
}
else
{
- Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPFILTER_PAGE), "Enabled", bEnabled);
+ Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPFILTER_PAGE), PropertyNames.PROPERTY_ENABLED, bEnabled);
}
}
}
diff --git a/wizards/com/sun/star/wizards/report/DBColumn.java b/wizards/com/sun/star/wizards/report/DBColumn.java
index eb6ce3229ac4..ee60f3744000 100644
--- a/wizards/com/sun/star/wizards/report/DBColumn.java
+++ b/wizards/com/sun/star/wizards/report/DBColumn.java
@@ -451,7 +451,7 @@ public class DBColumn
{
XDependentTextField xDependent = (XDependentTextField) UnoRuntime.queryInterface(XDependentTextField.class, oTextField);
XPropertySet xMaster = xDependent.getTextFieldMaster();
- String UserFieldName = (String) xMaster.getPropertyValue("Name");
+ String UserFieldName = (String) xMaster.getPropertyValue(PropertyNames.PROPERTY_NAME);
boolean bIsNameCell = false;
if ((UserFieldName.startsWith(CompString)) || (UserFieldName.equals(CurFieldName)))
{
diff --git a/wizards/com/sun/star/wizards/report/Dataimport.java b/wizards/com/sun/star/wizards/report/Dataimport.java
index 7c3aeaaab073..2081b655ae7e 100644
--- a/wizards/com/sun/star/wizards/report/Dataimport.java
+++ b/wizards/com/sun/star/wizards/report/Dataimport.java
@@ -119,7 +119,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Height", "Step", "Title", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_STEP, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -132,7 +132,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi
insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblProgressDBConnection",
new String[]
{
- "FontDescriptor", "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -142,7 +142,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi
insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblProgressDataImport",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -154,7 +154,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi
insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblProgressDataImport",
new String[]
{
- "FontDescriptor", "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -164,7 +164,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi
insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblCurProgress",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -174,7 +174,7 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi
insertButton("cmdCancel", 10000, this,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width", "Label"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH, PropertyNames.PROPERTY_LABEL
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/report/GroupFieldHandler.java b/wizards/com/sun/star/wizards/report/GroupFieldHandler.java
index 82e478bac781..bab8a4bb240e 100644
--- a/wizards/com/sun/star/wizards/report/GroupFieldHandler.java
+++ b/wizards/com/sun/star/wizards/report/GroupFieldHandler.java
@@ -27,6 +27,7 @@
package com.sun.star.wizards.report;
import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.*;
import com.sun.star.wizards.db.*;
@@ -59,7 +60,7 @@ public class GroupFieldHandler extends FieldSelection
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblBlindTextNote_1",
new String[]
{
- "Enabled", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -112,7 +113,7 @@ public class GroupFieldHandler extends FieldSelection
{
emptyFieldsListBoxes();
GroupFieldVector.removeAllElements();
- CurUnoDialog.setControlProperty("lblBlindTextNote_1", "Enabled", new Boolean(false));
+ CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, new Boolean(false));
}
public void getGroupFieldNames(CommandMetaData CurDBMetaData)
@@ -128,7 +129,7 @@ public class GroupFieldHandler extends FieldSelection
int iSelCount = xSelectedFieldsListBox.getItemCount();
if (iSelCount >= MAXSELFIELDS)
{
- CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, "Enabled", Boolean.FALSE);
+ CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
}
}
@@ -161,7 +162,7 @@ public class GroupFieldHandler extends FieldSelection
int iSelCount = xSelectedFieldsListBox.getItemCount();
String[] CurGroupNames = xFieldsListBox.getItems();
CurReportDocument.liveupdate_addGroupNametoDocument(CurGroupNames, CurGroupTitle, GroupFieldVector, CurReportDocument.getReportPath(), iSelCount);
- CurUnoDialog.setControlProperty("lblBlindTextNote_1", "Enabled", new Boolean(true));
+ CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, new Boolean(true));
if (iSelCount >= MAXSELFIELDS)
{
toggleMoveButtons(false, false);
@@ -177,7 +178,7 @@ public class GroupFieldHandler extends FieldSelection
String[] NewSelList = xSelectedFieldsListBox.getItems();
CurReportDocument.liveupdate_removeGroupName(NewSelList, OldGroupTitle, GroupFieldVector);
String[] NewSelGroupNames = xSelectedFieldsListBox.getItems();
- CurUnoDialog.setControlProperty("lblBlindTextNote_1", "Enabled", new Boolean(NewSelGroupNames.length == 0));
+ CurUnoDialog.setControlProperty("lblBlindTextNote_1", PropertyNames.PROPERTY_ENABLED, new Boolean(NewSelGroupNames.length == 0));
// CurReportDocument.refreshGroupFields(xSelectedFieldsListBox.getItems());
}
diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java
index 7c40c01809d2..73a32f35c029 100644
--- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java
+++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java
@@ -90,7 +90,7 @@ public class ReportFinalizer
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblTitle",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -100,7 +100,7 @@ public class ReportFinalizer
xTitleTextBox = CurUnoDialog.insertTextField("txtTitle", CHANGEREPORTTITLE_FUNCNAME, this,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -110,7 +110,7 @@ public class ReportFinalizer
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblChooseReportKind",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -120,7 +120,7 @@ public class ReportFinalizer
CurUnoDialog.insertRadioButton("optCreateDocument", TOGGLESUBTEMPLATECONTROLS_FUNCNAME, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -130,7 +130,7 @@ public class ReportFinalizer
CurUnoDialog.insertRadioButton("optCreateReportTemplate", TOGGLESUBTEMPLATECONTROLS_FUNCNAME, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -141,7 +141,7 @@ public class ReportFinalizer
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblHowProceed",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -152,7 +152,7 @@ public class ReportFinalizer
CurUnoDialog.insertRadioButton("optEditTemplate", TOGGLESUBTEMPLATECONTROLS_FUNCNAME, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -162,7 +162,7 @@ public class ReportFinalizer
CurUnoDialog.insertRadioButton("optUseTemplate", TOGGLESUBTEMPLATECONTROLS_FUNCNAME, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -177,11 +177,11 @@ public class ReportFinalizer
public void toggleSubTemplateControls()
{
// String sStorePath = "";
- Short iState = (Short) CurUnoDialog.getControlProperty("optCreateReportTemplate", "State");
+ Short iState = (Short) CurUnoDialog.getControlProperty("optCreateReportTemplate", PropertyNames.PROPERTY_STATE);
boolean bDoTemplateEnable = iState.shortValue() == 1;
- CurUnoDialog.setControlProperty("optEditTemplate", "Enabled", new Boolean(bDoTemplateEnable));
- CurUnoDialog.setControlProperty("optUseTemplate", "Enabled", new Boolean(bDoTemplateEnable));
- CurUnoDialog.setControlProperty("lblHowProceed", "Enabled", new Boolean(bDoTemplateEnable));
+ CurUnoDialog.setControlProperty("optEditTemplate", PropertyNames.PROPERTY_ENABLED, new Boolean(bDoTemplateEnable));
+ CurUnoDialog.setControlProperty("optUseTemplate", PropertyNames.PROPERTY_ENABLED, new Boolean(bDoTemplateEnable));
+ CurUnoDialog.setControlProperty("lblHowProceed", PropertyNames.PROPERTY_ENABLED, new Boolean(bDoTemplateEnable));
String sTitle = xTitleTextBox.getText();
boolean bDoEnable = sTitle.equals("");
@@ -248,17 +248,17 @@ public class ReportFinalizer
public int getReportOpenMode()
{
int ReportMode = SOCREATEDOCUMENT;
- boolean bcreateTemplate = ((Short) CurUnoDialog.getControlProperty("optCreateReportTemplate", "State")).shortValue() == (short) 1;
+ boolean bcreateTemplate = ((Short) CurUnoDialog.getControlProperty("optCreateReportTemplate", PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1;
if (bcreateTemplate)
{
ReportMode = SOCREATETEMPLATE;
}
- boolean buseTemplate = ((Short) CurUnoDialog.getControlProperty("optUseTemplate", "State")).shortValue() == (short) 1;
+ boolean buseTemplate = ((Short) CurUnoDialog.getControlProperty("optUseTemplate", PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1;
if (buseTemplate)
{
ReportMode = SOUSETEMPLATE;
}
- boolean buseDocument = ((Short) CurUnoDialog.getControlProperty("optCreateDocument", "State")).shortValue() == (short) 1;
+ boolean buseDocument = ((Short) CurUnoDialog.getControlProperty("optCreateDocument", PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1;
if (buseDocument)
{
ReportMode = SOCREATEDOCUMENT;
diff --git a/wizards/com/sun/star/wizards/report/ReportLayouter.java b/wizards/com/sun/star/wizards/report/ReportLayouter.java
index 355188e7e675..16180f4df91c 100644
--- a/wizards/com/sun/star/wizards/report/ReportLayouter.java
+++ b/wizards/com/sun/star/wizards/report/ReportLayouter.java
@@ -92,7 +92,7 @@ public class ReportLayouter
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblContent",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -111,7 +111,7 @@ public class ReportLayouter
xContentListBox = CurUnoDialog.insertListBox("lstContent", SOCONTENTLST, new ActionListenerImpl(), new ItemListenerImpl(),
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "SelectedItems", "Step", "StringItemList", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "SelectedItems", PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -124,7 +124,7 @@ public class ReportLayouter
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblLayout",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -146,7 +146,7 @@ public class ReportLayouter
xLayoutListBox = CurUnoDialog.insertListBox("lstLayout", SOLAYOUTLST, new ActionListenerImpl(), new ItemListenerImpl(),
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "SelectedItems", "Step", "StringItemList", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "SelectedItems", PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -159,7 +159,7 @@ public class ReportLayouter
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblOrientation",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -170,7 +170,7 @@ public class ReportLayouter
CurUnoDialog.insertRadioButton("optLandscape", SOOPTLANDSCAPE, new ItemListenerImpl(),
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -181,7 +181,7 @@ public class ReportLayouter
CurUnoDialog.insertRadioButton("optPortrait", SOOPTPORTRAIT, new ItemListenerImpl(),
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -191,7 +191,7 @@ public class ReportLayouter
aOrientationImage = CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlImageControlModel", "imgOrientation",
new String[]
{
- "Border", "Height", "PositionX", "PositionY", "ScaleImage", "Step", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -202,7 +202,7 @@ public class ReportLayouter
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblBlindTextNote_2",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -246,7 +246,7 @@ public class ReportLayouter
try
{
int iPos;
- Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(false));
+ Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(false));
// LLA: should we lock controllers here?
// CurReportDocument.getDoc().xTextDocument.lockControllers();
int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
@@ -279,7 +279,7 @@ public class ReportLayouter
catch (com.sun.star.lang.IllegalArgumentException e)
{
}
- Helper.setUnoPropertyValue(aOrientationImage, "ImageURL", CurUnoDialog.getWizardImageUrl(1002, 1003));
+ Helper.setUnoPropertyValue(aOrientationImage, PropertyNames.PROPERTY_IMAGEURL, CurUnoDialog.getWizardImageUrl(1002, 1003));
break;
@@ -293,8 +293,8 @@ public class ReportLayouter
{
}
- CurUnoDialog.setControlProperty("imgOrientation", "ImageURL", Desktop.getBitmapPath(m_xMSF) + "/portrait.gif");
- Helper.setUnoPropertyValue(aOrientationImage, "ImageURL", CurUnoDialog.getWizardImageUrl(1000, 1001));
+ CurUnoDialog.setControlProperty("imgOrientation", PropertyNames.PROPERTY_IMAGEURL, Desktop.getBitmapPath(m_xMSF) + "/portrait.gif");
+ Helper.setUnoPropertyValue(aOrientationImage, PropertyNames.PROPERTY_IMAGEURL, CurUnoDialog.getWizardImageUrl(1000, 1001));
break;
default:
@@ -306,7 +306,7 @@ public class ReportLayouter
e.printStackTrace();
}
// CurReportDocument.getDoc().unlockallControllers();
- Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(true));
+ Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(true));
}
public void disposing(EventObject eventObject)
@@ -325,9 +325,9 @@ public class ReportLayouter
{
try
{
- Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(false));
+ Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(false));
// CurReportDocument.getDoc().xTextDocument.lockControllers();
- boolean blandscape = (((Short) CurUnoDialog.getControlProperty("optLandscape", "State")).shortValue() == 1);
+ boolean blandscape = (((Short) CurUnoDialog.getControlProperty("optLandscape", PropertyNames.PROPERTY_STATE)).shortValue() == 1);
CurReportDocument.setPageOrientation((blandscape == true) ? SOOPTLANDSCAPE : SOOPTPORTRAIT);
}
catch (Exception exception)
@@ -335,7 +335,7 @@ public class ReportLayouter
exception.printStackTrace(System.out);
}
// CurReportDocument.getDoc().unlockallControllers();
- Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(true));
+ Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(true));
}
}
}
diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
index 05f7ad2a6a5b..ceecaf28ba4f 100644
--- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
+++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
@@ -441,7 +441,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme
// if (iCounter % 10 == 0)
// {
// sProgressCurRecord = JavaTools.replaceSubString(sProgressBaseCurRecord, String.valueOf(iCounter), "<COUNT>");
-// setControlProperty("lblCurProgress", "Label", sProgressCurRecord);
+// setControlProperty("lblCurProgress", PropertyNames.PROPERTY_LABEL, sProgressCurRecord);
// super.xReschedule.reschedule();
// }
// }
diff --git a/wizards/com/sun/star/wizards/report/ReportWizard.java b/wizards/com/sun/star/wizards/report/ReportWizard.java
index 2bffd2b4bea3..46fe77fbee38 100644
--- a/wizards/com/sun/star/wizards/report/ReportWizard.java
+++ b/wizards/com/sun/star/wizards/report/ReportWizard.java
@@ -28,7 +28,6 @@
package com.sun.star.wizards.report;
// import java.util.Vector;
-
import com.sun.star.awt.TextEvent;
import com.sun.star.awt.VclWindowPeerAttribute;
import com.sun.star.awt.XTextListener;
@@ -51,8 +50,10 @@ import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.Resource;
import com.sun.star.wizards.common.SystemDialog;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.DBMetaData;
import com.sun.star.wizards.db.DatabaseObjectWizard;
+import com.sun.star.wizards.db.RecordParser;
import com.sun.star.wizards.db.SQLQueryComposer;
import com.sun.star.wizards.ui.CommandFieldSelection;
import com.sun.star.wizards.ui.FieldSelection;
@@ -69,6 +70,7 @@ import java.util.Map;
public class ReportWizard extends DatabaseObjectWizard implements XTextListener, XCompletion
{
+
protected FieldSelection CurGroupFieldSelection;
private SortingComponent CurSortingComponent;
private TitlesComponent CurTitlesComponent;
@@ -85,7 +87,6 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
private static final int SOSORTPAGE = 4;
protected static final int SOTEMPLATEPAGE = 5;
protected static final int SOSTOREPAGE = 6;
-
private IReportDocument m_reportDocument;
private static String sMsgWizardName;
private static String slblFields;
@@ -98,24 +99,24 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
protected static boolean bCloseDocument;
private boolean bHasEscapeProcessing = true;
- public ReportWizard( XMultiServiceFactory i_serviceFactory, final PropertyValue[] i_wizardContext )
+ public ReportWizard(XMultiServiceFactory i_serviceFactory, final PropertyValue[] i_wizardContext)
{
- super(i_serviceFactory, 34320, i_wizardContext );
+ super(i_serviceFactory, 34320, i_wizardContext);
super.addResourceHandler("Report Wizard", "dbw");
if (getReportResources(false) == true)
{
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Height",
+ PropertyNames.PROPERTY_HEIGHT,
"Moveable",
- "Name",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
+ PropertyNames.PROPERTY_NAME,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
"Title",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -193,7 +194,9 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
{
// cleanup document
m_reportDocument.clearDocument();
- m_reportDocument.getRecordParser().setGroupFieldNames(new String[]{});
+ m_reportDocument.getRecordParser().setGroupFieldNames(new String[]
+ {
+ });
CurGroupFieldHandler.removeGroupFieldNames();
}
break;
@@ -248,30 +251,30 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
return;
}
- if ( ( nReportMode == ReportFinalizer.SOCREATETEMPLATE )
- || ( nReportMode == ReportFinalizer.SOUSETEMPLATE )
- )
+ if ((nReportMode == ReportFinalizer.SOCREATETEMPLATE)
+ || (nReportMode == ReportFinalizer.SOUSETEMPLATE))
{
m_reportDocument.addReportToDBView();
boolean bOpenInDesign = (nReportMode == ReportFinalizer.SOCREATETEMPLATE);
- m_reportDocument.createAndOpenReportDocument( m_sReportName, true, bOpenInDesign);
+ m_reportDocument.createAndOpenReportDocument(m_sReportName, true, bOpenInDesign);
}
else
{
m_reportDocument.importReportData(this);
- m_reportDocument.createAndOpenReportDocument( m_sReportName, false, false );
+ m_reportDocument.createAndOpenReportDocument(m_sReportName, false, false);
}
}
private boolean executeQuery()
{
boolean bQueryCreated = false;
+ final RecordParser recordParser = m_reportDocument.getRecordParser();
+ final SQLQueryComposer sqlQueryComposer = recordParser.getSQLQueryComposer();
if (this.CurDBCommandFieldSelection.getSelectedCommandType() == CommandType.TABLE)
{
- bQueryCreated = m_reportDocument.getRecordParser().getSQLQueryComposer().setQueryCommand(this.xWindow, false, false);
-
+ bQueryCreated = sqlQueryComposer.setQueryCommand(this.xWindow, false, false);
m_reportDocument.setCommandType(CommandType.COMMAND);
- String sQuery = m_reportDocument.getRecordParser().getSQLQueryComposer().getQuery();
+ String sQuery = sqlQueryComposer.getQuery();
m_reportDocument.setCommand(sQuery);
}
else
@@ -279,18 +282,18 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
try
{
String sQueryName = CurDBCommandFieldSelection.getSelectedCommandName();
- DBMetaData.CommandObject oCommand = m_reportDocument.getRecordParser().getQueryByName(sQueryName);
- bHasEscapeProcessing = m_reportDocument.getRecordParser().hasEscapeProcessing(oCommand.getPropertySet());
+ DBMetaData.CommandObject oCommand = recordParser.getQueryByName(sQueryName);
+ bHasEscapeProcessing = recordParser.hasEscapeProcessing(oCommand.getPropertySet());
String sCommand = (String) oCommand.getPropertySet().getPropertyValue("Command");
if (bHasEscapeProcessing)
{
// String sCommand = (String) oCommand.xPropertySet.getPropertyValue("Command");
bQueryCreated = (!sCommand.equals(""));
- m_reportDocument.getRecordParser().getSQLQueryComposer().m_xQueryAnalyzer.setQuery(sCommand);
- m_reportDocument.getRecordParser().getSQLQueryComposer().prependSortingCriteria();
+ sqlQueryComposer.m_xQueryAnalyzer.setQuery(sCommand);
+ sqlQueryComposer.prependSortingCriteria();
// TODO: check with query
m_reportDocument.setCommandType(CommandType.COMMAND);
- m_reportDocument.setCommand(m_reportDocument.getRecordParser().getSQLQueryComposer().getQuery());
+ m_reportDocument.setCommand(sqlQueryComposer.getQuery());
bQueryCreated = true;
}
else
@@ -311,17 +314,18 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
}
return bQueryCreated;
}
+
public void buildSteps()
{
// CurReportDocument.getDoc().xProgressBar.setValue(30);
CurDBCommandFieldSelection = new CommandFieldSelection(this, m_reportDocument.getRecordParser(), 100, slblFields, slblSelFields, slblTables, true, 34330);
CurDBCommandFieldSelection.addFieldSelectionListener(new FieldSelectionListener());
- if ( !isReportBuilderInstalled() )
+ if (!isReportBuilderInstalled())
{
insertLabel("lblBinaryFields",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -388,7 +392,7 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
private boolean isReportBuilderInstalled()
{
//! Check if the new Report Builder Extension is available
- XContentEnumerationAccess a = com.sun.star.uno.UnoRuntime.queryInterface( XContentEnumerationAccess.class, xMSF );
+ XContentEnumerationAccess a = com.sun.star.uno.UnoRuntime.queryInterface(XContentEnumerationAccess.class, xMSF);
com.sun.star.container.XEnumeration e = a.createContentEnumeration("com.sun.star.report.pentaho.SOReportJobFactory");
if (e == null)
{
@@ -411,42 +415,41 @@ public class ReportWizard extends DatabaseObjectWizard implements XTextListener,
// Get the path to the extension and try to add the path to the class loader
final XComponentContext xComponentContext = Helper.getComponentContext(_xMSF);
final Object aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider");
- XPackageInformationProvider xProvider = UnoRuntime.queryInterface( XPackageInformationProvider.class, aSingleton );
+ XPackageInformationProvider xProvider = UnoRuntime.queryInterface(XPackageInformationProvider.class, aSingleton);
final String sLocation = xProvider.getPackageLocation("com.sun.reportdesigner");
return sLocation;
}
+ private static XLogger m_xLogger;
-private static XLogger m_xLogger;
+ private static void initializeLogger(XMultiServiceFactory _xMSF)
+ {
+ XComponentContext xContext = Helper.getComponentContext(_xMSF);
-private static void initializeLogger(XMultiServiceFactory _xMSF)
-{
- XComponentContext xContext = Helper.getComponentContext(_xMSF);
+ final Object aLoggerPool = xContext.getValueByName("/singletons/com.sun.star.logging.LoggerPool");
+ if (aLoggerPool == null)
+ {
+ System.out.println("Can't get singleton from logging");
+ }
+ final XLoggerPool xLoggerPool = UnoRuntime.queryInterface(XLoggerPool.class, aLoggerPool);
+ m_xLogger = xLoggerPool.getNamedLogger("com.sun.star.wizards.ReportBuilder");
+ }
- final Object aLoggerPool = xContext.getValueByName("/singletons/com.sun.star.logging.LoggerPool");
- if (aLoggerPool == null)
+ public static XLogger getLogger()
{
- System.out.println("Can't get singleton from logging");
+ return m_xLogger;
}
- final XLoggerPool xLoggerPool = UnoRuntime.queryInterface( XLoggerPool.class, aLoggerPool );
- m_xLogger = xLoggerPool.getNamedLogger("com.sun.star.wizards.ReportBuilder");
-}
-
-public static XLogger getLogger()
-{
- return m_xLogger;
-}
public void startReportWizard()
{
initializeLogger(xMSF);
getLogger().log(LogLevel.SEVERE, "Start Report Wizard");
- if ( isReportBuilderInstalled() )
+ if (isReportBuilderInstalled())
{
// Get the path to the extension and try to add the path to the class loader
String sLocation = getPathToExtension(xMSF);
// TODO: Umlaut in filename!
- if ( sLocation.length() > 0 )
+ if (sLocation.length() > 0)
{
try
{
@@ -456,8 +459,14 @@ public static XLogger getLogger()
aURLs[0] = aLocationURI.toURL();
URLClassLoader aClassLoader = new URLClassLoader(aURLs, this.getClass().getClassLoader());
Class a = aClassLoader.loadClass("com.sun.star.wizards.reportbuilder.ReportBuilderImplementation");
- Method aMethod = a.getMethod("create", new Class[] { XMultiServiceFactory.class });
- m_reportDocument = (IReportDocument) aMethod.invoke(a, new Object[] { xMSF });
+ Method aMethod = a.getMethod("create", new Class[]
+ {
+ XMultiServiceFactory.class
+ });
+ m_reportDocument = (IReportDocument) aMethod.invoke(a, new Object[]
+ {
+ xMSF
+ });
}
catch (Exception e)
{
@@ -472,26 +481,28 @@ public static XLogger getLogger()
if (m_reportDocument == null)
{
// Fallback, if there is no reportbuilder wizard implementation, we use the old wizard
- m_reportDocument = new ReportTextImplementation( xMSF );
+ m_reportDocument = new ReportTextImplementation(xMSF);
}
- m_reportDocument.initialize( m_docUI, m_oResource );
+ m_reportDocument.initialize(m_docUI, m_oResource);
- if ( m_reportDocument.getRecordParser().getConnection( m_wizardContext ) )
+ if (m_reportDocument.getRecordParser().getConnection(m_wizardContext))
{
buildSteps();
m_reportDocument.checkInvariants();
- this.CurDBCommandFieldSelection.preselectCommand( m_wizardContext, false );
+ this.CurDBCommandFieldSelection.preselectCommand(m_wizardContext, false);
createWindowPeer(m_reportDocument.getWizardParent());
m_reportDocument.getRecordParser().setWindowPeer(this.xControl.getPeer());
insertQueryRelatedSteps();
short RetValue = executeDialog(m_reportDocument.getFrame().getComponentWindow().getPosSize());
- if ( RetValue == 0 )
+ if (RetValue == 0)
+ {
dialogFinish();
+ }
}
m_reportDocument.getRecordParser().dispose();
}
@@ -592,7 +603,7 @@ public static XLogger getLogger()
try
{
Object oRoadmapItem = null;
- int CurStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, "Step"));
+ int CurStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP));
boolean bEnabled = false;
int CurItemID;
for (int i = 0; i < getRMItemCount(); i++)
@@ -608,7 +619,7 @@ public static XLogger getLogger()
bEnabled = true;
}
- Helper.setUnoPropertyValue(oRoadmapItem, "Enabled", new Boolean(bEnabled));
+ Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled));
}
}
catch (com.sun.star.uno.Exception exception)
@@ -620,8 +631,8 @@ public static XLogger getLogger()
private void enableWizardSteps(String[] NewItems)
{
boolean bEnabled = NewItems.length > 0;
- setControlProperty("btnWizardNext", "Enabled", new Boolean(bEnabled));
- setControlProperty("btnWizardFinish", "Enabled", new Boolean(bEnabled));
+ setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled));
+ setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled));
enableRoadmapItems(bEnabled); // Note: Performancewise this could be improved
}
@@ -668,8 +679,8 @@ public static XLogger getLogger()
}
super.setStepEnabled(SOSORTPAGE, bdoenable);
- // int nCommandType = this.CurDBCommandFieldSelection.getSelectedCommandType();
- // super.setStepEnabled(SOSORTPAGE, (nCommandType == CommandType.TABLE));
+ // int nCommandType = this.CurDBCommandFieldSelection.getSelectedCommandType();
+ // super.setStepEnabled(SOSORTPAGE, (nCommandType == CommandType.TABLE));
}
public class FieldSelectionListener implements com.sun.star.wizards.ui.XFieldSelectionListener
@@ -706,7 +717,7 @@ public static XLogger getLogger()
else
{
boolean bEnabled = (CurGroupFieldSelection.getSelectedFieldNames().length > 0);
- Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), "Enabled", new Boolean(bEnabled));
+ Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled));
}
}
@@ -721,7 +732,7 @@ public static XLogger getLogger()
else
{
boolean bEnabled = (CurGroupFieldSelection.getSelectedFieldNames().length > 0);
- Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), "Enabled", new Boolean(bEnabled));
+ Helper.setUnoPropertyValue(getRoadmapItemByID(SOGROUPPAGE), PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled));
}
}
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
index a10affa9ea2c..0c2e5af3bd36 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
@@ -38,7 +38,6 @@ import com.sun.star.awt.XWindow;
import com.sun.star.awt.XWindowPeer;
import com.sun.star.beans.Property;
import com.sun.star.beans.PropertyAttribute;
-import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.XPropertySetInfo;
import com.sun.star.container.XEnumeration;
@@ -65,6 +64,7 @@ import com.sun.star.util.XNumberFormatsSupplier;
import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.PropertySetHelper;
import com.sun.star.wizards.common.Resource;
import com.sun.star.wizards.report.IReportBuilderLayouter;
@@ -347,7 +347,7 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
{
if (m_nPageWidth < 0)
{
- m_nPageWidth = getFromPageStyles("Width", 21000);
+ m_nPageWidth = getFromPageStyles(PropertyNames.PROPERTY_WIDTH, 21000);
}
return m_nPageWidth;
}
@@ -1066,16 +1066,16 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
public void setPageOrientation(int _nOrientation)
{
- final int nWidth = getFromPageStyles("Width", 0);
- final int nHeight = getFromPageStyles("Height", 0);
+ final int nWidth = getFromPageStyles(PropertyNames.PROPERTY_WIDTH, 0);
+ final int nHeight = getFromPageStyles(PropertyNames.PROPERTY_HEIGHT, 0);
if (com.sun.star.wizards.report.ReportLayouter.SOOPTLANDSCAPE == _nOrientation)
{
setToPageStyles("IsLandscape", Boolean.TRUE);
if (nWidth < nHeight)
{
- setToPageStyles("Width", new Integer(nHeight));
- setToPageStyles("Height", new Integer(nWidth));
+ setToPageStyles(PropertyNames.PROPERTY_WIDTH, new Integer(nHeight));
+ setToPageStyles(PropertyNames.PROPERTY_HEIGHT, new Integer(nWidth));
}
}
else
@@ -1083,8 +1083,8 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
setToPageStyles("IsLandscape", Boolean.FALSE);
if (nHeight < nWidth)
{
- setToPageStyles("Width", new Integer(nHeight));
- setToPageStyles("Height", new Integer(nWidth));
+ setToPageStyles(PropertyNames.PROPERTY_WIDTH, new Integer(nHeight));
+ setToPageStyles(PropertyNames.PROPERTY_HEIGHT, new Integer(nWidth));
}
}
// dirty the PageWidth
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java
index fa33e85d39cb..797ac097f915 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java
@@ -29,6 +29,7 @@
package com.sun.star.wizards.reportbuilder.layout;
import com.sun.star.awt.FontDescriptor;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.PropertySetHelper;
/**
@@ -64,7 +65,7 @@ abstract public class SectionObject
public int getHeight(int _nDefault)
{
- final int nHeight = getPropertySetHelper().getPropertyValueAsInteger("Height", _nDefault);
+ final int nHeight = getPropertySetHelper().getPropertyValueAsInteger(PropertyNames.PROPERTY_HEIGHT, _nDefault);
return nHeight;
}
diff --git a/wizards/com/sun/star/wizards/table/CGTable.java b/wizards/com/sun/star/wizards/table/CGTable.java
index a1878bdeb02f..b3e509b5b0c1 100644
--- a/wizards/com/sun/star/wizards/table/CGTable.java
+++ b/wizards/com/sun/star/wizards/table/CGTable.java
@@ -30,6 +30,7 @@ import com.sun.star.container.XNameAccess;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.Desktop;
+import com.sun.star.wizards.common.PropertyNames;
public class CGTable
{
@@ -78,7 +79,7 @@ public class CGTable
}
else
{
- fieldnames = Configuration.getNodeChildNames(xNameAccessFieldsNode, "Name");
+ fieldnames = Configuration.getNodeChildNames(xNameAccessFieldsNode, PropertyNames.PROPERTY_NAME);
}
for (int i = 0; i < fieldnames.length; i++)
{
diff --git a/wizards/com/sun/star/wizards/table/FieldDescription.java b/wizards/com/sun/star/wizards/table/FieldDescription.java
index d26e58783aba..f816b03e8f8c 100644
--- a/wizards/com/sun/star/wizards/table/FieldDescription.java
+++ b/wizards/com/sun/star/wizards/table/FieldDescription.java
@@ -36,6 +36,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.Properties;
+import com.sun.star.wizards.common.PropertyNames;
public class FieldDescription
{
@@ -70,7 +71,7 @@ public class FieldDescription
}
else
{
- xNameAccessFieldNode = Configuration.getChildNodebyDisplayName(xMSF, aLocale, xNameAccessTableNode, keyname, "Name", _nmaxcharCount);
+ xNameAccessFieldNode = Configuration.getChildNodebyDisplayName(xMSF, aLocale, xNameAccessTableNode, keyname, PropertyNames.PROPERTY_NAME, _nmaxcharCount);
}
setFieldProperties(xNameAccessFieldNode);
}
@@ -80,7 +81,7 @@ public class FieldDescription
Name = _fieldname;
aPropertyValues = new Vector();
Type = new Integer(com.sun.star.sdbc.DataType.VARCHAR);
- aPropertyValues.addElement(Properties.createProperty("Name", _fieldname));
+ aPropertyValues.addElement(Properties.createProperty(PropertyNames.PROPERTY_NAME, _fieldname));
aPropertyValues.addElement(Properties.createProperty("Type", Type));
}
@@ -89,7 +90,7 @@ public class FieldDescription
for (int i = 0; i < aPropertyValues.size(); i++)
{
PropertyValue aPropertyValue = (PropertyValue) aPropertyValues.get(i);
- if (aPropertyValue.Name.equals("Name"))
+ if (aPropertyValue.Name.equals(PropertyNames.PROPERTY_NAME))
{
aPropertyValue.Value = _newfieldname;
aPropertyValues.set(i, aPropertyValue);
@@ -133,9 +134,9 @@ public class FieldDescription
{
xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, _xNameAccessFieldNode);
// Integer Index = (Integer) xPropertySet.getPropertyValue("Index");
- if (propertyexists("Name"))
+ if (propertyexists(PropertyNames.PROPERTY_NAME))
{
- aPropertyValues.addElement(Properties.createProperty("Name", Name));
+ aPropertyValues.addElement(Properties.createProperty(PropertyNames.PROPERTY_NAME, Name));
}
if (propertyexists("Type"))
{
diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java
index 1c79b36cba58..43349d71376f 100644
--- a/wizards/com/sun/star/wizards/table/FieldFormatter.java
+++ b/wizards/com/sun/star/wizards/table/FieldFormatter.java
@@ -38,6 +38,7 @@ import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.TableDescriptor;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.UnoDialog;
@@ -79,7 +80,7 @@ public class FieldFormatter implements XItemListener
CurUnoDialog.insertLabel("lblFieldNames",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -91,7 +92,7 @@ public class FieldFormatter implements XItemListener
xlstFieldNames = CurUnoDialog.insertListBox("lstfieldnames", 3, null, this,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -109,7 +110,7 @@ public class FieldFormatter implements XItemListener
btnShiftUp = CurUnoDialog.insertButton("btnShiftUp", "shiftFieldNameUp", this,
new String[]
{
- "Enabled", "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -119,7 +120,7 @@ public class FieldFormatter implements XItemListener
btnShiftDown = CurUnoDialog.insertButton("btnShiftDown", "shiftFieldNameDown", this,
new String[]
{
- "Enabled", "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -131,7 +132,7 @@ public class FieldFormatter implements XItemListener
btnminus = CurUnoDialog.insertButton("btnminus", "removeFieldName", this,
new String[]
{
- "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -141,7 +142,7 @@ public class FieldFormatter implements XItemListener
btnplus = CurUnoDialog.insertButton("btnplus", "addFieldName", this,
new String[]
{
- "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -151,7 +152,7 @@ public class FieldFormatter implements XItemListener
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "ColDescriptorHeader",
new String[]
{
- "Height", "Label", "Orientation", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -162,7 +163,7 @@ public class FieldFormatter implements XItemListener
CurUnoDialog.insertLabel("lblFieldName",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -172,7 +173,7 @@ public class FieldFormatter implements XItemListener
txtfieldname = CurUnoDialog.insertTextField("txtfieldname", MODIFYFIELDNAME, this,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Text", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -190,8 +191,8 @@ public class FieldFormatter implements XItemListener
oColumnDescriptorModel = CurUnoDialog.insertControlModel("com.sun.star.sdb.ColumnDescriptorControlModel", "oColumnDescriptor",
new String[]
{
- "Height", "PositionX", "PositionY", "Step", "TabIndex", "Width", "EditWidth"
- }, // "HelpURL"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH, "EditWidth"
+ }, // PropertyNames.PROPERTY_HELPURL
new Object[]
{
new Integer(85), new Integer(158), new Integer(49), IFieldFormatStep, new Short(curtabindex++), new Integer(166), new Integer(50)
@@ -202,10 +203,10 @@ public class FieldFormatter implements XItemListener
}
else
{
- int nStep = ((Integer) Helper.getUnoPropertyValue(oColumnDescriptorModel, "Step")).intValue();
+ int nStep = ((Integer) Helper.getUnoPropertyValue(oColumnDescriptorModel, PropertyNames.PROPERTY_STEP)).intValue();
if (nStep > IFieldFormatStep.intValue())
{
- Helper.setUnoPropertyValue(oColumnDescriptorModel, "Step", IFieldFormatStep);
+ Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.PROPERTY_STEP, IFieldFormatStep);
CurUnoDialog.repaintDialogStep();
}
}
@@ -232,9 +233,9 @@ public class FieldFormatter implements XItemListener
benableShiftUpButton = (iselpos != 0);
benableShiftDownButton = (iselpos != ilistcount - 1);
}
- Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftUp), "Enabled", new Boolean(benableShiftUpButton));
- Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftDown), "Enabled", new Boolean(benableShiftDownButton));
- Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), "Enabled", new Boolean(blistispopulated));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftUp), PropertyNames.PROPERTY_ENABLED, new Boolean(benableShiftUpButton));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(btnShiftDown), PropertyNames.PROPERTY_ENABLED, new Boolean(benableShiftDownButton));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, new Boolean(blistispopulated));
CurUnoDialog.setcompleted(TableWizard.SOFIELDSFORMATPAGE, blistispopulated);
}
@@ -297,10 +298,10 @@ public class FieldFormatter implements XItemListener
else
{
Helper.setUnoPropertyValue(UnoDialog.getModel(txtfieldname), "Text", "");
- Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), "Enabled", new Boolean(benable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, new Boolean(benable));
CurUnoDialog.setcompleted(TableWizard.SOFIELDSFORMATPAGE, benable);
}
- Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), "Enabled", new Boolean(benable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(btnminus), PropertyNames.PROPERTY_ENABLED, new Boolean(benable));
CurUnoDialog.setControlVisible("oColumnDescriptor", benable);
CurUnoDialog.repaintDialogStep();
}
@@ -314,7 +315,7 @@ public class FieldFormatter implements XItemListener
if (curTableDescriptor.modifyColumnName(oldfieldname, newfieldname))
{
Object oColumn = Helper.getUnoPropertyValue(oColumnDescriptorModel, "Column");
- Helper.setUnoPropertyValue(oColumn, "Name", newfieldname);
+ Helper.setUnoPropertyValue(oColumn, PropertyNames.PROPERTY_NAME, newfieldname);
FieldDescription curfielddescription = (FieldDescription) CurUnoDialog.fielditems.get(oldfieldname);
CurUnoDialog.fielditems.remove(oldfieldname);
curfielddescription.setName(newfieldname);
diff --git a/wizards/com/sun/star/wizards/table/Finalizer.java b/wizards/com/sun/star/wizards/table/Finalizer.java
index 17db2aea61a3..340dd5d2dc7b 100644
--- a/wizards/com/sun/star/wizards/table/Finalizer.java
+++ b/wizards/com/sun/star/wizards/table/Finalizer.java
@@ -32,6 +32,7 @@ import com.sun.star.awt.XTextComponent;
import com.sun.star.sdbc.SQLException;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.TableDescriptor;
import com.sun.star.wizards.ui.*;
@@ -78,7 +79,7 @@ public class Finalizer
CurUnoDialog.insertLabel("lblTableName",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -87,7 +88,7 @@ public class Finalizer
txtTableName = CurUnoDialog.insertTextField("txtTableName", SETCOMPLETIONFLAG, this,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Text", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -114,7 +115,7 @@ public class Finalizer
CurUnoDialog.insertLabel("lblCatalog",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -126,7 +127,7 @@ public class Finalizer
xCatalogListBox = CurUnoDialog.insertListBox("lstCatalog", null, null,
new String[]
{
- "Dropdown", "Height", "HelpURL", "LineCount", "PositionX", "PositionY", "Step", "StringItemList", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -169,7 +170,7 @@ public class Finalizer
CurUnoDialog.insertLabel("lblSchema",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -181,7 +182,7 @@ public class Finalizer
xSchemaListBox = CurUnoDialog.insertListBox("lstSchema", null, null,
new String[]
{
- "Dropdown", "Height", "HelpURL", "LineCount", "PositionX", "PositionY", "Step", "StringItemList", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -209,7 +210,7 @@ public class Finalizer
CurUnoDialog.insertLabel("lblcongratulations",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -223,7 +224,7 @@ public class Finalizer
CurUnoDialog.insertLabel("lblProceed",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -232,7 +233,7 @@ public class Finalizer
optWorkWithTable = CurUnoDialog.insertRadioButton("optWorkWithTable", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -241,7 +242,7 @@ public class Finalizer
optModifyTable = CurUnoDialog.insertRadioButton("optModifyTable", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -250,7 +251,7 @@ public class Finalizer
optStartFormWizard = CurUnoDialog.insertRadioButton("optStartFormWizard", null,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java
index 2a59ece3e5f1..a4a896752dd2 100644
--- a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java
+++ b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java
@@ -35,6 +35,7 @@ import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.uno.AnyConverter;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.TableDescriptor;
import com.sun.star.wizards.db.TypeInspector;
import com.sun.star.wizards.ui.FieldSelection;
@@ -85,7 +86,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
CurUnoDialog.insertLabel("lblExplanation",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -95,7 +96,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
chkcreatePrimaryKey = CurUnoDialog.insertCheckBox("chkcreatePrimaryKey", SPRIMEKEYMODE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -105,7 +106,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
optAddAutomatically = CurUnoDialog.insertRadioButton("optAddAutomatically", SPRIMEKEYMODE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -115,7 +116,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
optUseExisting = CurUnoDialog.insertRadioButton("optUseExisting", SPRIMEKEYMODE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, //94
new Object[]
{
@@ -125,7 +126,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
optUseSeveral = CurUnoDialog.insertRadioButton("optUseSeveral", SPRIMEKEYMODE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -135,7 +136,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
chkApplyAutoValueAutomatic = CurUnoDialog.insertCheckBox("chkApplyAutoValueAutomatic", SPRIMEKEYMODE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, //107
new Object[]
{
@@ -145,7 +146,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
lblPrimeFieldName = CurUnoDialog.insertLabel("lblPrimeFieldName",
new String[]
{
- "Enabled", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -156,15 +157,15 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
new String[]
{
"Dropdown",
- "Enabled",
- "Height",
- "HelpURL",
+ PropertyNames.PROPERTY_ENABLED,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
"LineCount",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -183,7 +184,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
chkApplyAutoValueExisting = CurUnoDialog.insertCheckBox("chkApplyAutoValueExisting", SPRIMEKEYMODE, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, //107
new Object[]
{
@@ -259,10 +260,10 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
public void togglePrimeKeyFields()
{
boolean bdoEnable = (this.chkcreatePrimaryKey.getState() == 1);
- Helper.setUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), "Enabled", new Boolean(bdoEnable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), "Enabled", new Boolean(bAutoPrimaryKeysupportsAutoIncrmentation && bdoEnable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(optUseExisting), "Enabled", new Boolean(bdoEnable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(optUseSeveral), "Enabled", new Boolean(bdoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, new Boolean(bAutoPrimaryKeysupportsAutoIncrmentation && bdoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optUseExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(optUseSeveral), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoEnable));
//toggle subcontrols of the radiobuttons...
toggleAutomaticAutoValueCheckBox();
boolean benableSinglePrimekeyControls = bdoEnable && optUseExisting.getState();
@@ -317,7 +318,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
boolean bisAutomaticMode = false;
if (chkcreatePrimaryKey.getState() == 1)
{
- bisAutomaticMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), "State")).shortValue() == (short) 1;
+ bisAutomaticMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1;
}
return bisAutomaticMode;
}
@@ -332,8 +333,8 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
boolean bischecked = false;
if (chkcreatePrimaryKey.getState() == 1)
{
- boolean bisAutomaticMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), "State")).shortValue() == (short) 1;
- boolean bisExistingMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optUseExisting), "State")).shortValue() == (short) 1;
+ boolean bisAutomaticMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1;
+ boolean bisExistingMode = ((Short) Helper.getUnoPropertyValue(UnoDialog.getModel(optUseExisting), PropertyNames.PROPERTY_STATE)).shortValue() == (short) 1;
if (bisAutomaticMode)
{
bischecked = chkApplyAutoValueAutomatic.getState() == (short) 1;
@@ -353,16 +354,16 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
String selfieldname = lstSinglePrimeKey.getSelectedItem();
boolean bdoenable = isAutoIncrementatable(selfieldname);
CurUnoDialog.setcompleted(TableWizard.SOPRIMARYKEYPAGE, lstSinglePrimeKey.getSelectedItemPos() != -1);
- Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), "Enabled", new Boolean(bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable));
XPropertySet xColPropertySet = curTableDescriptor.getByName(selfieldname);
boolean bIsAutoIncremented = ((Boolean) xColPropertySet.getPropertyValue("IsAutoIncrement")).booleanValue();
if (bIsAutoIncremented)
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), "State", new Short((short) 1));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_STATE, new Short((short) 1));
}
else
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), "State", new Short((short) 0));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_STATE, new Short((short) 0));
}
}
catch (Exception e)
@@ -375,9 +376,9 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
{
try
{
- boolean bisAutomaticMode = AnyConverter.toBoolean(Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), "Enabled"));
+ boolean bisAutomaticMode = AnyConverter.toBoolean(Helper.getUnoPropertyValue(UnoDialog.getModel(optAddAutomatically), PropertyNames.PROPERTY_ENABLED));
boolean bdoenable = bAutoPrimaryKeysupportsAutoIncrmentation && optAddAutomatically.getState() && bisAutomaticMode;
- Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), "Enabled", new Boolean(bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueAutomatic), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable));
}
catch (IllegalArgumentException e)
{
@@ -387,11 +388,11 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
private void toggleSinglePrimeKeyFields(boolean _bdoenable)
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(lblPrimeFieldName), "Enabled", new Boolean(_bdoenable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), "Enabled", new Boolean(_bdoenable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), "Enabled", new Boolean(_bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lblPrimeFieldName), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lstSinglePrimeKey), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable));
boolean bdoenableAutoValueCheckBox = (isAutoIncrementatable(lstSinglePrimeKey.getSelectedItem()) && _bdoenable);
- Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), "Enabled", new Boolean(bdoenableAutoValueCheckBox));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(chkApplyAutoValueExisting), PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenableAutoValueCheckBox));
}
private void toggleSeveralPrimeKeyFields()
diff --git a/wizards/com/sun/star/wizards/table/ScenarioSelector.java b/wizards/com/sun/star/wizards/table/ScenarioSelector.java
index 8936f43e3250..9ad0506064bb 100644
--- a/wizards/com/sun/star/wizards/table/ScenarioSelector.java
+++ b/wizards/com/sun/star/wizards/table/ScenarioSelector.java
@@ -42,6 +42,7 @@ import com.sun.star.wizards.common.Configuration;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.TableDescriptor;
import com.sun.star.wizards.ui.FieldSelection;
import com.sun.star.wizards.ui.UIConsts;
@@ -99,7 +100,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
lblExplanation = CurUnoDialog.insertLabel("lblScenarioExplanation",
new String[]
{
- "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -109,7 +110,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
lblCategories = CurUnoDialog.insertLabel("lblCategories",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -119,7 +120,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
optBusiness = CurTableWizardUnoDialog.insertRadioButton("optBusiness", SELECTCATEGORY, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -129,7 +130,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
optPrivate = CurTableWizardUnoDialog.insertRadioButton("optPrivate", SELECTCATEGORY, this,
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -139,7 +140,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
CurUnoDialog.insertLabel("lblTableNames",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -151,7 +152,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
xTableListBox = CurUnoDialog.insertListBox("lstTableNames", 3, null, this,
new String[]
{
- "Dropdown", "Height", "HelpURL", "LineCount", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/table/TableWizard.java b/wizards/com/sun/star/wizards/table/TableWizard.java
index 1444cc946675..ebcb28ca48b1 100644
--- a/wizards/com/sun/star/wizards/table/TableWizard.java
+++ b/wizards/com/sun/star/wizards/table/TableWizard.java
@@ -79,7 +79,7 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener,
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Height", "Moveable", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width"
+ PropertyNames.PROPERTY_HEIGHT, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.java b/wizards/com/sun/star/wizards/text/TextFieldHandler.java
index 5d8c677c621e..e25227516058 100644
--- a/wizards/com/sun/star/wizards/text/TextFieldHandler.java
+++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.java
@@ -49,6 +49,7 @@ import com.sun.star.util.DateTime;
import com.sun.star.util.XRefreshable;
import com.sun.star.util.XUpdatable;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
public class TextFieldHandler
{
@@ -118,7 +119,7 @@ public class TextFieldHandler
// try
// {
// XPropertySet xTestProp = xDepField.getTextFieldMaster();
-// String UserFieldName = (String) xTestProp.getPropertyValue("Name");
+// String UserFieldName = (String) xTestProp.getPropertyValue(PropertyNames.PROPERTY_NAME);
// // UserFieldName == FieldName?
// int dummy = 0;
// }
@@ -138,11 +139,11 @@ public class TextFieldHandler
{
Object oMaster = xMSFDoc.createInstance("com.sun.star.text.FieldMaster.User");
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oMaster);
- xPSet.setPropertyValue("Name", FieldName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, FieldName);
xPSet.setPropertyValue("Content", FieldTitle);
// DEBUG
- // String sFieldName = (String)xPSet.getPropertyValue("Name");
+ // String sFieldName = (String)xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME);
return xPSet;
}
@@ -210,7 +211,7 @@ public class TextFieldHandler
{
try
{
- XDependentTextField[] xDependentTextFields = getTextFieldsByProperty("Name", _FieldName, "String");
+ XDependentTextField[] xDependentTextFields = getTextFieldsByProperty(PropertyNames.PROPERTY_NAME, _FieldName, "String");
if (xDependentTextFields != null)
{
for (int i = 0; i < xDependentTextFields.length; i++)
diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
index f59d06772a83..69583f14c8bd 100644
--- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java
+++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
@@ -84,7 +84,7 @@ public class AggregateComponent extends ControlScroller
optDetailQuery = CurUnoDialog.insertRadioButton("optDetailQuery", 0, new ActionListenerImpl(),
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -94,7 +94,7 @@ public class AggregateComponent extends ControlScroller
optSummaryQuery = CurUnoDialog.insertRadioButton("optSummaryQuery", 0, new ActionListenerImpl(),
new String[]
{
- "Height", "HelpURL", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -103,7 +103,7 @@ public class AggregateComponent extends ControlScroller
CurUnoDialog.insertLabel("lblAggregate",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -112,7 +112,7 @@ public class AggregateComponent extends ControlScroller
CurUnoDialog.insertLabel("lblFieldnames",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -127,7 +127,7 @@ public class AggregateComponent extends ControlScroller
CurUnoDialog.insertButton("btnplus", SOADDROW, new ActionListenerImpl(),
new String[]
{
- "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -136,7 +136,7 @@ public class AggregateComponent extends ControlScroller
CurUnoDialog.insertButton("btnminus", SOREMOVEROW, new ActionListenerImpl(),
new String[]
{
- "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -152,7 +152,7 @@ public class AggregateComponent extends ControlScroller
public int getQueryType()
{
- if (((Short) CurUnoDialog.getControlProperty("optDetailQuery", "State")).intValue() == 1)
+ if (((Short) CurUnoDialog.getControlProperty("optDetailQuery", PropertyNames.PROPERTY_STATE)).intValue() == 1)
{
return QueryMetaData.QueryType.SODETAILQUERY;
}
@@ -280,14 +280,14 @@ public class AggregateComponent extends ControlScroller
ControlRow curcontrolrow = null;
boolean biscomplete = true;
CurDBMetaData.Type = getQueryType();
- CurUnoDialog.setControlProperty("btnminus", "Enabled", new Boolean((super.getTotalFieldCount() > 0) && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY)));
+ CurUnoDialog.setControlProperty("btnminus", PropertyNames.PROPERTY_ENABLED, new Boolean((super.getTotalFieldCount() > 0) && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY)));
int fieldcount = super.getCurFieldCount();
if (fieldcount > 0)
{
curcontrolrow = (ControlRow) ControlRowVector.elementAt(super.getCurFieldCount() - 1);
biscomplete = curcontrolrow.isComplete();
}
- CurUnoDialog.setControlProperty("btnplus", "Enabled", new Boolean(biscomplete && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY)));
+ CurUnoDialog.setControlProperty("btnplus", PropertyNames.PROPERTY_ENABLED, new Boolean(biscomplete && (CurDBMetaData.Type == QueryMetaData.QueryType.SOSUMMARYQUERY)));
togglefollowingDialogSteps();
}
@@ -295,8 +295,8 @@ public class AggregateComponent extends ControlScroller
{
CurDBMetaData.Type = getQueryType();
boolean benableComponent = isAggregateComponentEnabled();
- CurUnoDialog.setControlProperty("lblAggregate", "Enabled", new Boolean(benableComponent));
- CurUnoDialog.setControlProperty("lblFieldnames", "Enabled", new Boolean(benableComponent));
+ CurUnoDialog.setControlProperty("lblAggregate", PropertyNames.PROPERTY_ENABLED, new Boolean(benableComponent));
+ CurUnoDialog.setControlProperty("lblFieldnames", PropertyNames.PROPERTY_ENABLED, new Boolean(benableComponent));
toggleButtons();
super.toggleComponent(benableComponent);
super.toggleControls(benableComponent);
@@ -528,7 +528,7 @@ public class AggregateComponent extends ControlScroller
xFunctionListBox = CurUnoDialog.insertListBox(getFunctionControlName(index), 1, null, new ItemListenerImpl(),
new String[]
{
- "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "StringItemList", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "StringItemList", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -538,7 +538,7 @@ public class AggregateComponent extends ControlScroller
xFieldListBox = CurUnoDialog.insertListBox(getFieldsControlName(index), 1, null, new ItemListenerImpl(),
new String[]
{
- "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java
index 770210e04706..41062757f0cf 100644
--- a/wizards/com/sun/star/wizards/ui/ButtonList.java
+++ b/wizards/com/sun/star/wizards/ui/ButtonList.java
@@ -40,9 +40,11 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.IRenderer;
import com.sun.star.wizards.common.PropertySetHelper;
+import com.sun.star.wizards.common.PropertyNames;
import javax.swing.ListModel;
import javax.swing.event.ListDataEvent;
import com.sun.star.wizards.common.HelpIds;
+import com.sun.star.wizards.common.PropertyNames;
/**
*
@@ -120,15 +122,15 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
lblImageText = dialog.insertLabel(m_aControlName + "_imageText",
new String[]
{
- "Height",
- "HelpURL",
- "Label",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ PropertyNames.PROPERTY_LABEL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
"Tabstop",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -148,14 +150,14 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
{
final String[] pNames1 = new String[]
{
- "Height",
- "HelpURL",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
"Tabstop",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
};
final Integer btnSize = Integer.valueOf(14);
@@ -198,8 +200,8 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
});
Helper.setUnoPropertyValue(getModel(lblCounter), "Align", new Short((short) 1));
- Helper.setUnoPropertyValue(getModel(btnBack), "Label", "<");
- Helper.setUnoPropertyValue(getModel(btnNext), "Label", ">");
+ Helper.setUnoPropertyValue(getModel(btnBack), PropertyNames.PROPERTY_LABEL, "<");
+ Helper.setUnoPropertyValue(getModel(btnNext), PropertyNames.PROPERTY_LABEL, ">");
}
@@ -238,17 +240,17 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
{
/* "Border", */
/* "BackgroundColor", */
- "Height",
- "HelpURL",
- /* "Label", */
- "PositionX",
- "PositionY",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ /* PropertyNames.PROPERTY_LABEL, */
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
/* "ScaleImage", */
- "Step",
- "TabIndex",
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
"Tabstop",
"Toggle",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -306,16 +308,16 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
{
if (oResources.length == 1)
{
- Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "ImageURL", (String) oResources[0]);
+ Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, (String) oResources[0]);
}
else if (oResources.length == 2)
{
oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResources[0], oResources[1]);
-// Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "ImageURL", oResources[0]);
+// Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]);
}
boolean bTabStop = Boolean.TRUE; // focusable ? Boolean.TRUE : Boolean.FALSE;
Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "Tabstop", bTabStop);
- // Object aEnabled = Helper.getUnoPropertyValue(m_aButtons[i].getModel(), "Enabled");
+ // Object aEnabled = Helper.getUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_ENABLED);
if (refreshOverNull)
{
setVisible(m_aButtons[i], true);
@@ -328,7 +330,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
private void refreshCounterText()
{
- Helper.setUnoPropertyValue(getModel(lblCounter), "Label", counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize())));
+ Helper.setUnoPropertyValue(getModel(lblCounter), PropertyNames.PROPERTY_LABEL, counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize())));
}
private int pageEnd()
@@ -674,7 +676,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
{
Object item = m_nCurrentSelection >= 0 ? getListModel().getElementAt(m_nCurrentSelection) : null;
final String sText = " " + renderer.render(item);
- Helper.setUnoPropertyValue(getModel(lblImageText), "Label", sText);
+ Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, sText);
}
/**
@@ -723,7 +725,7 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
private void enable(Object control, Boolean enable)
{
- Helper.setUnoPropertyValue(getModel(control), "Enabled", enable);
+ Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enable);
}
private Object getModel(Object control)
@@ -858,12 +860,12 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
if (i == m_nCurrentSelection)
{
final short one = 1;
- aHelper.setPropertyValueDontThrow("State", Short.valueOf(one));
+ aHelper.setPropertyValueDontThrow(PropertyNames.PROPERTY_STATE, Short.valueOf(one));
}
else
{
final short zero = 0;
- aHelper.setPropertyValueDontThrow("State", Short.valueOf(zero));
+ aHelper.setPropertyValueDontThrow(PropertyNames.PROPERTY_STATE, Short.valueOf(zero));
}
}
}
@@ -881,15 +883,15 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
XControlModel xModel = (XControlModel)UnoDialog2.getModel(actionEvent.Source);
PropertySetHelper aHelper = new PropertySetHelper(xModel);
- int nState = aHelper.getPropertyValueAsInteger("State", -1);
+ int nState = aHelper.getPropertyValueAsInteger(PropertyNames.PROPERTY_STATE, -1);
if (nState == 0)
{
// this will avoid a wrong state, if already pressed.
- aHelper.setPropertyValueDontThrow("State", Short.valueOf((short)1));
+ aHelper.setPropertyValueDontThrow(PropertyNames.PROPERTY_STATE, Short.valueOf((short)1));
}
// check which Button is pressed.
- String sControlName = aHelper.getPropertyValueAsString("Name", "");
+ String sControlName = aHelper.getPropertyValueAsString(PropertyNames.PROPERTY_NAME, "");
final String sButton = sControlName.substring(7 + m_aControlName.length());
int nButton = new Integer(sButton).intValue();
diff --git a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java
index c239c9fec4d2..5a2457a18d76 100644
--- a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java
+++ b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java
@@ -138,7 +138,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator
xlblTable = CurUnoDialog.insertLabel(sTableLabelName,
new String[]
{
- "Enabled", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -148,7 +148,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator
xTableListBox = CurUnoDialog.insertListBox(sTableListBoxName, 0, null, new ItemListenerImpl(),
new String[]
{
- "Dropdown", "Enabled", "Height", "HelpURL", "LineCount", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -366,8 +366,8 @@ public class CommandFieldSelection extends FieldSelection implements Comparator
public void toggleCommandListBox(boolean _bdoenable)
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), "Enabled", new Boolean(_bdoenable));
- Helper.setUnoPropertyValue(UnoDialog.getModel(xlblTable), "Enabled", new Boolean(_bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(xlblTable), PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable));
}
public String getSelectedCommandName()
diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.java b/wizards/com/sun/star/wizards/ui/ControlScroller.java
index aff4de7127c9..b2a736fcfb0a 100644
--- a/wizards/com/sun/star/wizards/ui/ControlScroller.java
+++ b/wizards/com/sun/star/wizards/ui/ControlScroller.java
@@ -118,7 +118,7 @@ public abstract class ControlScroller
oImgControl = CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlImageControlModel", "imgBackground" + sIncSuffix,
new String[]
{
- "Border", "Height", "PositionX", "PositionY", "Step", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -130,7 +130,7 @@ public abstract class ControlScroller
new AdjustmentListenerImpl(),
new String[]
{
- "Border", "Enabled", "Height", "HelpURL", "Orientation", "PositionX", "PositionY", "Step", "Width"
+ "Border", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -178,7 +178,7 @@ public abstract class ControlScroller
{
Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[]
{
- "Enabled", "BlockIncrement", "LineIncrement", "ScrollValue", "ScrollValueMax"
+ PropertyNames.PROPERTY_ENABLED, "BlockIncrement", "LineIncrement", "ScrollValue", "ScrollValueMax"
}, new Object[]
{
Boolean.TRUE, new Integer(nblockincrement), new Integer(nlineincrement), new Integer(nscrollvalue), new Integer(ntotfieldcount - nblockincrement)
@@ -188,7 +188,7 @@ public abstract class ControlScroller
{
Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[]
{
- "Enabled", "ScrollValue"
+ PropertyNames.PROPERTY_ENABLED, "ScrollValue"
}, new Object[]
{
Boolean.FALSE, new Integer(nscrollvalue)
@@ -286,7 +286,7 @@ public abstract class ControlScroller
{
Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[]
{
- "Enabled", "ScrollValueMax"
+ PropertyNames.PROPERTY_ENABLED, "ScrollValueMax"
}, new Object[]
{
Boolean.TRUE, new Integer(ntotfieldcount - nblockincrement)
@@ -294,14 +294,14 @@ public abstract class ControlScroller
}
else
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), "Enabled", Boolean.FALSE);
+ Helper.setUnoPropertyValue(UnoDialog.getModel(xScrollBar), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
}
}
protected void toggleComponent(boolean _bdoenable)
{
boolean bdoenable = _bdoenable && (ntotfieldcount > nblockincrement);
- CurUnoDialog.setControlProperty("TitleScrollBar" + sIncSuffix, "Enabled", new Boolean(bdoenable));
+ CurUnoDialog.setControlProperty("TitleScrollBar" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bdoenable));
}
protected void toggleControls(boolean _bdoenable)
@@ -312,7 +312,7 @@ public abstract class ControlScroller
for (int m = 0; m < curproperties.length; m++)
{
PropertyValue curproperty = curproperties[m];
- CurUnoDialog.setControlProperty(curproperty.Name, "Enabled", new Boolean(_bdoenable));
+ CurUnoDialog.setControlProperty(curproperty.Name, PropertyNames.PROPERTY_ENABLED, new Boolean(_bdoenable));
}
}
@@ -340,7 +340,7 @@ public abstract class ControlScroller
this.nblockincrement = _nblockincrement;
Helper.setUnoPropertyValues(UnoDialog.getModel(xScrollBar), new String[]
{
- "Enabled", "BlockIncrement", "ScrollValueMax"
+ PropertyNames.PROPERTY_ENABLED, "BlockIncrement", "ScrollValueMax"
}, new Object[]
{
new Boolean(ntotfieldcount > nblockincrement), new Integer(nblockincrement), new Integer(ntotfieldcount - nblockincrement)
diff --git a/wizards/com/sun/star/wizards/ui/FieldSelection.java b/wizards/com/sun/star/wizards/ui/FieldSelection.java
index ce3c7c8c4849..6ec242243adb 100644
--- a/wizards/com/sun/star/wizards/ui/FieldSelection.java
+++ b/wizards/com/sun/star/wizards/ui/FieldSelection.java
@@ -78,7 +78,7 @@ public class FieldSelection
public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject)
{
// int iPos;
- com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", Boolean.FALSE);
+ com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
switch (iKey)
{
@@ -93,7 +93,7 @@ public class FieldSelection
default:
break;
}
- com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", Boolean.TRUE);
+ com.sun.star.wizards.common.Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
}
public void disposing(com.sun.star.lang.EventObject eventObject)
@@ -226,7 +226,7 @@ public class FieldSelection
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblFields" + sIncSuffix,
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -237,7 +237,7 @@ public class FieldSelection
xFieldsListBox = CurUnoDialog.insertListBox("lstFields" + sIncSuffix, SOFLDSLST, new ActionListenerImpl(), new ItemListenerImpl(),
new String[]
{
- "Height", "HelpURL", "MultiSelection", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "MultiSelection", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -247,7 +247,7 @@ public class FieldSelection
Object btnmoveselected = CurUnoDialog.insertButton("cmdMoveSelected" + sIncSuffix, SOCMDMOVESEL, new ActionListenerImpl(),
new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -259,7 +259,7 @@ public class FieldSelection
btnmoveall = CurUnoDialog.insertButton("cmdMoveAll" + sIncSuffix, SOCMDMOVEALL, new ActionListenerImpl(),
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -269,7 +269,7 @@ public class FieldSelection
Object btnremoveselected = CurUnoDialog.insertButton("cmdRemoveSelected" + sIncSuffix, SOCMDREMOVESEL, new ActionListenerImpl(),
new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -281,7 +281,7 @@ public class FieldSelection
btnremoveall = CurUnoDialog.insertButton("cmdRemoveAll" + sIncSuffix, SOCMDREMOVEALL, new ActionListenerImpl(),
new String[]
{
- "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -296,7 +296,7 @@ public class FieldSelection
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblSelFields" + sIncSuffix,
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -307,7 +307,7 @@ public class FieldSelection
xSelectedFieldsListBox = CurUnoDialog.insertListBox("lstSelFields" + sIncSuffix, SOSELFLDSLST, new ActionListenerImpl(), new ItemListenerImpl(),
new String[]
{
- "Height", "HelpURL", "MultiSelection", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "MultiSelection", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -317,7 +317,7 @@ public class FieldSelection
Object btnmoveup = CurUnoDialog.insertButton("cmdMoveUp" + sIncSuffix, SOCMDMOVEUP, new ActionListenerImpl(),
new String[]
{
- "Enabled", "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -327,7 +327,7 @@ public class FieldSelection
Object btnmovedown = CurUnoDialog.insertButton("cmdMoveDown" + sIncSuffix, SOCMDMOVEDOWN, new ActionListenerImpl(),
new String[]
{
- "Enabled", "FontDescriptor", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -422,10 +422,10 @@ public class FieldSelection
{
try
{
- CurUnoDialog.setControlProperty("lblFields" + sIncSuffix, "Enabled", BDoEnable);
- CurUnoDialog.setControlProperty("lblSelFields" + sIncSuffix, "Enabled", BDoEnable);
- CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, "Enabled", BDoEnable);
- CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, "Enabled", BDoEnable);
+ CurUnoDialog.setControlProperty("lblFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable);
+ CurUnoDialog.setControlProperty("lblSelFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable);
+ CurUnoDialog.setControlProperty("lstFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable);
+ CurUnoDialog.setControlProperty("lstSelFields" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable);
if (BDoEnable.booleanValue() == true)
{
@@ -433,8 +433,8 @@ public class FieldSelection
}
else
{
- CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, "Enabled", BDoEnable);
- CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, "Enabled", BDoEnable);
+ CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable);
+ CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, BDoEnable);
toggleMoveButtons(BDoEnable.booleanValue(), BDoEnable.booleanValue());
}
}
@@ -466,11 +466,11 @@ public class FieldSelection
bmoveUpenabled = ((iSelIndices[0] > 0) && (iSelIndices.length == 1));
bmoveDownenabled = (((iSelIndices[SelListBoxSelLength - 1]) < (short) (SelectCount - 1)) && (iSelIndices.length == 1));
}
- CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, "Enabled", new Boolean(SelectCount >= 1));
- CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, "Enabled", new Boolean(bSelectSelected));
+ CurUnoDialog.setControlProperty("cmdRemoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(SelectCount >= 1));
+ CurUnoDialog.setControlProperty("cmdRemoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bSelectSelected));
toggleMoveButtons((FieldCount >= 1), bIsFieldSelected);
- CurUnoDialog.setControlProperty("cmdMoveUp" + sIncSuffix, "Enabled", new Boolean(bmoveUpenabled));
- CurUnoDialog.setControlProperty("cmdMoveDown" + sIncSuffix, "Enabled", new Boolean(bmoveDownenabled));
+ CurUnoDialog.setControlProperty("cmdMoveUp" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bmoveUpenabled));
+ CurUnoDialog.setControlProperty("cmdMoveDown" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(bmoveDownenabled));
}
catch (Exception exception)
{
@@ -482,8 +482,8 @@ public class FieldSelection
{
boolean btoggleMoveAll = (((xFieldsListBox.getItemCount() + xSelectedFieldsListBox.getItemCount()) < maxfieldcount) && (_btoggleMoveAll));
boolean btoggleMoveSelected = (((xFieldsListBox.getSelectedItems().length + xSelectedFieldsListBox.getItemCount()) < maxfieldcount) && (_btoggleMoveSelected));
- CurUnoDialog.setControlProperty("cmdMoveAll" + sIncSuffix, "Enabled", new Boolean(btoggleMoveAll));
- CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, "Enabled", new Boolean(btoggleMoveSelected));
+ CurUnoDialog.setControlProperty("cmdMoveAll" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(btoggleMoveAll));
+ CurUnoDialog.setControlProperty("cmdMoveSelected" + sIncSuffix, PropertyNames.PROPERTY_ENABLED, new Boolean(btoggleMoveSelected));
}
public void setMultipleMode(boolean _bisMultiple)
diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java
index e53f0792e268..8dfc12e21fb3 100644
--- a/wizards/com/sun/star/wizards/ui/FilterComponent.java
+++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java
@@ -52,6 +52,7 @@ import com.sun.star.wizards.common.NumberFormatter;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.HelpIds;
import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.db.FieldColumn;
import com.sun.star.wizards.db.QueryMetaData;
import com.sun.star.wizards.db.SQLQueryComposer;
@@ -111,6 +112,7 @@ public class FilterComponent
final int SO_THIRDBOOLFIELDNAME = 256 + 3;
final int SO_FOURTHBOOLFIELDNAME = 256 + 4;
int SO_BOOLEANLIST[] =
+
{
SO_FIRSTBOOLFIELDNAME, SO_SECONDBOOLFIELDNAME, SO_THIRDBOOLFIELDNAME, SO_FOURTHBOOLFIELDNAME
};
@@ -121,6 +123,7 @@ public class FilterComponent
class ItemListenerImpl implements com.sun.star.awt.XItemListener
{
+
public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject)
{
int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
@@ -221,7 +224,7 @@ public class FilterComponent
{
XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, _oSourceevent);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel());
- final String sName = AnyConverter.toString(xPSet.getPropertyValue("Name"));
+ final String sName = AnyConverter.toString(xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME));
return sName;
}
catch (Exception e)
@@ -245,11 +248,11 @@ public class FilterComponent
final XPropertyContainer column = (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, oQueryMetaData.xMSF.createInstance(serviceName));
column.addProperty("Type", PropertyAttribute.BOUND, DataType.VARCHAR);
- column.addProperty("Name", PropertyAttribute.BOUND, "");
- column.addProperty("Value", (short)( PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE ), null );
+ column.addProperty(PropertyNames.PROPERTY_NAME, PropertyAttribute.BOUND, "");
+ column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), null);
final XPropertySet columnSet = UnoRuntime.queryInterface(XPropertySet.class, column);
- if ( composer.getQuery().length() == 0)
+ if (composer.getQuery().length() == 0)
{
final String fromClause = composer.getFromClause();
StringBuilder sql = new StringBuilder();
@@ -258,7 +261,9 @@ public class FilterComponent
sql.append(fromClause);
composer.getQueryComposer().setElementaryQuery(sql.toString());
}
- composer.getQueryComposer().setStructuredFilter( new PropertyValue[][] {} );
+ composer.getQueryComposer().setStructuredFilter(new PropertyValue[][]
+ {
+ });
for (int i = 0; i < RowCount; i++)
{
ControlRow currentControlRow = oControlRows[i];
@@ -269,30 +274,31 @@ public class FilterComponent
String sFieldName = currentControlRow.getSelectedFieldName();
int nOperator = (int) currentControlRow.getSelectedOperator();
FieldColumn aFieldColumn = oQueryMetaData.getFieldColumnByDisplayName(sFieldName);
- columnSet.setPropertyValue("Name", aFieldColumn.getFieldName());
+ columnSet.setPropertyValue(PropertyNames.PROPERTY_NAME, aFieldColumn.getFieldName());
columnSet.setPropertyValue("Type", aFieldColumn.getXColumnPropertySet().getPropertyValue("Type"));
Object value = currentControlRow.getValue();
- switch(aFieldColumn.getFieldType())
+ switch (aFieldColumn.getFieldType())
{
case DataType.TIMESTAMP:
case DataType.DATE:
- value = ((Double)value) - oQueryMetaData.getNullDateCorrection();
+ value = ((Double) value) - oQueryMetaData.getNullDateCorrection();
break;
}
- column.removeProperty( "Value" );
+ column.removeProperty("Value");
final short operator = currentControlRow.getSelectedOperator();
- if ( ( operator == SQLFilterOperator.SQLNULL )
- || ( operator == SQLFilterOperator.NOT_SQLNULL )
- || AnyConverter.isVoid( value )
- )
+ if ((operator == SQLFilterOperator.SQLNULL)
+ || (operator == SQLFilterOperator.NOT_SQLNULL)
+ || AnyConverter.isVoid(value))
{
- column.addProperty("Value", (short)( PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE ), new String() );
- value = new Any( new Type( TypeClass.VOID ), null );
+ column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), new String());
+ value = new Any(new Type(TypeClass.VOID), null);
}
else
- column.addProperty("Value", (short)( PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE ), value );
+ {
+ column.addProperty("Value", (short) (PropertyAttribute.MAYBEVOID | PropertyAttribute.REMOVABLE), value);
+ }
columnSet.setPropertyValue("Value", value);
- composer.getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL,nOperator);
+ composer.getQueryComposer().appendFilterByColumn(columnSet, getfilterstate() == this.SOI_MATCHALL, nOperator);
}
}
}
@@ -304,7 +310,9 @@ public class FilterComponent
String smsgDuplicateCondition = getDisplayCondition(sDuplicateCondition, aduplicatecondition, null);
CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, smsgDuplicateCondition);
CurUnoDialog.vetoableChange(new java.beans.PropertyChangeEvent(CurUnoDialog, "Steps", Integer.valueOf(1), Integer.valueOf(2)));
- return new PropertyValue[][]{};
+ return new PropertyValue[][]
+ {
+ };
}
}
catch (Exception ex)
@@ -334,10 +342,12 @@ public class FilterComponent
FieldName = _filtercondition.Name;
}
String sreturn = JavaTools.replaceSubString(_BaseString, FieldName, "<FIELDNAME>");
- String soperator = sLogicOperators[_filtercondition.Handle - 1];
+ String soperator = sLogicOperators[_filtercondition.Handle-1];
sreturn = JavaTools.replaceSubString(sreturn, soperator, "<LOGICOPERATOR>");
String sDisplayValue = "";
- if (!AnyConverter.isVoid(_filtercondition.Value))
+ if ((_filtercondition.Handle != SQLFilterOperator.SQLNULL)
+ && (_filtercondition.Handle != SQLFilterOperator.NOT_SQLNULL)
+ && !AnyConverter.isVoid(_filtercondition.Value))
{
sDisplayValue = AnyConverter.toString(_filtercondition.Value);
}
@@ -419,15 +429,15 @@ public class FilterComponent
CurUnoDialog.insertRadioButton("optMatchAll" + sIncSuffix, SOOPTANDMODE, new ItemListenerImpl(),
new String[]
{
- "Height",
- "HelpURL",
- "Label",
- "PositionX",
- "PositionY",
- "State",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ PropertyNames.PROPERTY_LABEL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STATE,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -444,14 +454,14 @@ public class FilterComponent
optMatchAny = CurUnoDialog.insertRadioButton("optMatchAny" + sIncSuffix, SOOPTORMODE, new ItemListenerImpl(),
new String[]
{
- "Height",
- "HelpURL",
- "Label",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ PropertyNames.PROPERTY_LABEL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -531,6 +541,7 @@ public class FilterComponent
// -------------------------------------------------------------------------
final class ControlRow
{
+
private final static int SOLSTFIELDNAME = 3;
private final static int SOLSTOPERATOR = 4;
private final static int SOTXTVALUE = 5;
@@ -558,14 +569,14 @@ public class FilterComponent
ControlElements[0] = (XInterface) CurUnoDialog.insertLabel("lblFieldNames" + sCompSuffix,
new String[]
{
- "Enabled",
- "Height",
- "Label",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_ENABLED,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_LABEL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -583,14 +594,14 @@ public class FilterComponent
ControlElements[1] = (XInterface) CurUnoDialog.insertLabel("lblOperators" + sCompSuffix,
new String[]
{
- "Enabled",
- "Height",
- "Label",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_ENABLED,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_LABEL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -608,14 +619,14 @@ public class FilterComponent
ControlElements[2] = (XInterface) CurUnoDialog.insertLabel("lblValue" + sCompSuffix,
new String[]
{
- "Enabled",
- "Height",
- "Label",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_ENABLED,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_LABEL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -633,16 +644,16 @@ public class FilterComponent
ControlElements[SOLSTFIELDNAME] = (XInterface) CurUnoDialog.insertListBox("lstFieldName" + sCompSuffix, SO_FIELDNAMELIST[Index], null, new ItemListenerImpl(),
new String[]
{
- "Enabled",
+ PropertyNames.PROPERTY_ENABLED,
"Dropdown",
- "Height",
- "HelpURL",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
"LineCount",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -662,17 +673,17 @@ public class FilterComponent
ControlElements[SOLSTOPERATOR] = (XInterface) CurUnoDialog.insertListBox("lstOperator" + sCompSuffix, SO_CONDITIONLIST[Index], null, new ItemListenerImpl(),
new String[]
{
- "Enabled",
+ PropertyNames.PROPERTY_ENABLED,
"Dropdown",
- "Height",
- "HelpURL",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
"LineCount",
- "PositionX",
- "PositionY",
- "Step",
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
"StringItemList",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -691,14 +702,14 @@ public class FilterComponent
ControlElements[SOTXTVALUE] = (XInterface) CurUnoDialog.insertFormattedField("txtValue" + sCompSuffix, SO_TEXTFIELDLIST[Index], new TextListenerImpl(),
new String[]
{
- "Enabled",
- "Height",
- "HelpURL",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
- "Width"
+ PropertyNames.PROPERTY_ENABLED,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -736,16 +747,16 @@ public class FilterComponent
{
// disable value field
- Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), "Enabled", Boolean.FALSE);
- Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "Enabled", Boolean.FALSE);
+ Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
+ Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
return true;
}
else
{
// enable value field
- Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), "Enabled", Boolean.TRUE);
- Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), "Enabled", Boolean.TRUE);
+ Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[2]), PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
+ Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[SOTXTVALUE]), PropertyNames.PROPERTY_ENABLED, Boolean.TRUE);
}
if (nSelOperator != -1)
{
@@ -849,7 +860,7 @@ public class FilterComponent
// enable all Controls Fieldname, operator, value
for (int i = 0; i < ControlElements.length; i++)
{
- Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[i]), "Enabled", Boolean.valueOf(_bEnabled));
+ Helper.setUnoPropertyValue(UnoDialog.getModel(ControlElements[i]), PropertyNames.PROPERTY_ENABLED, Boolean.valueOf(_bEnabled));
}
m_bEnabled = _bEnabled;
if (isEnabled())
diff --git a/wizards/com/sun/star/wizards/ui/ImageList.java b/wizards/com/sun/star/wizards/ui/ImageList.java
index 56e2edb3172f..9d42aa45599e 100644
--- a/wizards/com/sun/star/wizards/ui/ImageList.java
+++ b/wizards/com/sun/star/wizards/ui/ImageList.java
@@ -45,6 +45,7 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.HelpIds;
import com.sun.star.wizards.common.IRenderer;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.event.*;
@@ -163,11 +164,11 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
{
"BackgroundColor",
"Border",
- "Height",
- "PositionX",
- "PositionY",
- "Step",
- "Width"
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -190,7 +191,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
//XWindow win = (XWindow)UnoRuntime.queryInterface(XWindow.class,lblContainer);
/*dialog.xWindow.addWindowListener(uiEventListener);
- String dName = (String)Helper.getUnoPropertyValue(dialog.xDialogModel,"Name");
+ String dName = (String)Helper.getUnoPropertyValue(dialog.xDialogModel,PropertyNames.PROPERTY_NAME);
uiEventListener.add(dName,EventNames.EVENT_WINDOW_SHOWN,"disableContainerMouseEvents",this);
*/
@@ -202,12 +203,12 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
{
"BackgroundColor",
"Border",
- "Height",
- "PositionX",
- "PositionY",
- "Step",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
"Tabstop",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
TRANSPARENT,
@@ -226,14 +227,14 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
final String[] pNames1 = new String[]
{
- "Height",
- "HelpURL",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
"Tabstop",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
};
lblImageText = dialog.insertLabel(name + "_imageText", pNames1, new Object[]
@@ -290,8 +291,8 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
});
Helper.setUnoPropertyValue(getModel(lblCounter), "Align", new Short((short) 1));
- Helper.setUnoPropertyValue(getModel(btnBack), "Label", "<");
- Helper.setUnoPropertyValue(getModel(btnNext), "Label", ">");
+ Helper.setUnoPropertyValue(getModel(btnBack), PropertyNames.PROPERTY_LABEL, "<");
+ Helper.setUnoPropertyValue(getModel(btnNext), PropertyNames.PROPERTY_LABEL, ">");
}
@@ -332,15 +333,15 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
{
"Border",
"BackgroundColor",
- "Height",
- "HelpURL",
- "PositionX",
- "PositionY",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
"ScaleImage",
- "Step",
- "TabIndex",
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
"Tabstop",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
};
//used for optimization
private Short m_tabIndex;
@@ -407,7 +408,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
{
if (oResources.length == 1)
{
- Helper.setUnoPropertyValue(m_aImages[i].getModel(), "ImageURL", (String) oResources[0]);
+ Helper.setUnoPropertyValue(m_aImages[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, (String) oResources[0]);
}
else if (oResources.length == 2)
{
@@ -426,7 +427,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
private void refreshCounterText()
{
- Helper.setUnoPropertyValue(getModel(lblCounter), "Label", counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize())));
+ Helper.setUnoPropertyValue(getModel(lblCounter), PropertyNames.PROPERTY_LABEL, counterRenderer.render(new Counter(pageStart + 1, pageEnd(), listModel.getSize())));
}
private int pageEnd()
@@ -456,12 +457,12 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
private void hideSelection()
{
- Helper.setUnoPropertyValue(getModel(grbxSelectedImage), "Step", HIDE_PAGE);
+ Helper.setUnoPropertyValue(getModel(grbxSelectedImage), PropertyNames.PROPERTY_STEP, HIDE_PAGE);
setVisible(grbxSelectedImage, false);
}
private final static String[] MOVE_SELECTION = new String[]
{
- "PositionX", "PositionY", "Step"
+ PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP
};
private Object[] MOVE_SELECTION_VALS = new Object[3];
/** Utility field holding list of ItemListeners. */
@@ -480,7 +481,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
Helper.setUnoPropertyValues(getModel(grbxSelectedImage), MOVE_SELECTION, MOVE_SELECTION_VALS);
- if (((Number) Helper.getUnoPropertyValue(dialogModel, "Step")).shortValue() == step.shortValue())
+ if (((Number) Helper.getUnoPropertyValue(dialogModel, PropertyNames.PROPERTY_STEP)).shortValue() == step.shortValue())
{
setVisible(grbxSelectedImage, true); //now focus...
}
@@ -817,7 +818,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
private void refreshImageText()
{
Object item = selected >= 0 ? getListModel().getElementAt(selected) : null;
- Helper.setUnoPropertyValue(getModel(lblImageText), "Label", " " + renderer.render(item));
+ Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, " " + renderer.render(item));
}
/**
@@ -866,7 +867,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
private void enable(Object control, Boolean enable)
{
- Helper.setUnoPropertyValue(getModel(control), "Enabled", enable);
+ Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enable);
}
private Object getModel(Object control)
@@ -901,7 +902,7 @@ public class ImageList implements XItemEventBroadcaster, ListDataListener
private int getImageFromEvent(Object event)
{
Object image = ((EventObject) event).Source;
- String controlName = (String) Helper.getUnoPropertyValue(getModel(image), "Name");
+ String controlName = (String) Helper.getUnoPropertyValue(getModel(image), PropertyNames.PROPERTY_NAME);
return Integer.valueOf(controlName.substring(6 + name.length())).intValue();
}
diff --git a/wizards/com/sun/star/wizards/ui/PathSelection.java b/wizards/com/sun/star/wizards/ui/PathSelection.java
index 4cb101382c6d..6b50127017e1 100755
--- a/wizards/com/sun/star/wizards/ui/PathSelection.java
+++ b/wizards/com/sun/star/wizards/ui/PathSelection.java
@@ -31,6 +31,7 @@ import com.sun.star.awt.XTextComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.Exception;
import com.sun.star.wizards.common.FileAccess;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.SystemDialog;
public class PathSelection
@@ -77,7 +78,7 @@ public class PathSelection
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblSaveAs", new String[]
{
- "Enabled", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Boolean(Enabled), new Integer(8), LabelText, new Integer(XPos), new Integer(YPos), new Integer(DialogStep), new Short(CurTabIndex), new Integer(Width)
@@ -85,16 +86,16 @@ public class PathSelection
xSaveTextBox = CurUnoDialog.insertTextField("txtSavePath", "callXPathSelectionListener", this, new String[]
{
- "Enabled", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Boolean(Enabled), new Integer(12), TxtHelpURL, new Integer(XPos), new Integer(YPos + 10), new Integer(DialogStep), new Short((short) (CurTabIndex + 1)), new Integer(Width - 26)
});
//CurUnoDialog.setControlProperty("txtSavePath", "ReadOnly", Boolean.TRUE);
- CurUnoDialog.setControlProperty("txtSavePath", "Enabled", Boolean.FALSE);
+ CurUnoDialog.setControlProperty("txtSavePath", PropertyNames.PROPERTY_ENABLED, Boolean.FALSE);
CurUnoDialog.insertButton("cmdSelectPath", "triggerPathPicker", this, new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Boolean(Enabled), new Integer(14), BtnHelpURL, "...", new Integer(XPos + Width - 16), new Integer(YPos + 9), new Integer(DialogStep), new Short((short) (CurTabIndex + 2)), new Integer(16)
diff --git a/wizards/com/sun/star/wizards/ui/PeerConfig.java b/wizards/com/sun/star/wizards/ui/PeerConfig.java
index d3871ee62a5b..19617b593bd6 100644
--- a/wizards/com/sun/star/wizards/ui/PeerConfig.java
+++ b/wizards/com/sun/star/wizards/ui/PeerConfig.java
@@ -33,6 +33,7 @@ import com.sun.star.lang.EventObject;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
/**
* @author rpiterman
@@ -139,7 +140,7 @@ public class PeerConfig implements XWindowListener
}
if (!sImageUrl.equals(""))
{
- Helper.setUnoPropertyValue(aImageUrlTask.oModel, "ImageURL", sImageUrl);
+ Helper.setUnoPropertyValue(aImageUrlTask.oModel, PropertyNames.PROPERTY_IMAGEURL, sImageUrl);
}
}
diff --git a/wizards/com/sun/star/wizards/ui/SortingComponent.java b/wizards/com/sun/star/wizards/ui/SortingComponent.java
index 75194d21b199..3b57ca3f670a 100644
--- a/wizards/com/sun/star/wizards/ui/SortingComponent.java
+++ b/wizards/com/sun/star/wizards/ui/SortingComponent.java
@@ -28,9 +28,9 @@ package com.sun.star.wizards.ui;
import java.beans.PropertyChangeEvent;
-import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.*;
import com.sun.star.awt.*;
+import java.util.ArrayList;
public class SortingComponent
{
@@ -61,10 +61,10 @@ public class SortingComponent
public void itemStateChanged(ItemEvent EventObject)
{
- Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(false));
+ Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(false));
int ikey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
enableNextSortListBox(ikey);
- Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, "Enabled", new Boolean(true));
+ Helper.setUnoPropertyValue(CurUnoDialog.xDialogModel, PropertyNames.PROPERTY_ENABLED, new Boolean(true));
}
public void disposing(com.sun.star.lang.EventObject eventObject)
@@ -99,7 +99,7 @@ public class SortingComponent
bDoEnable = (i < 2);
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lblSort" + new Integer(i + 1).toString(), new String[]
{
- "Enabled", "Height", "Label", "Orientation", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Boolean(bDoEnable), new Integer(8), sSortHeader[i], new Integer(0), ICompPosX, new Integer(iCurPosY), IStep, new Short(curtabindex++), ICompWidth
@@ -108,7 +108,7 @@ public class SortingComponent
HIDString = HelpIds.getHelpIdString(FirstHelpIndex);
xSortListBox[i] = CurUnoDialog.insertListBox("lstSort" + new Integer(i + 1).toString(), SOSORTLST[i], null, new ItemListenerImpl(), new String[]
{
- "Dropdown", "Enabled", "Height", "HelpURL", "LineCount", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Boolean(true), new Boolean(bDoEnable), new Integer(12), HIDString, new Short(UnoDialog.getListBoxLineCount()), "lstSort" + new Integer(i + 1), IListBoxPosX, new Integer(iCurPosY + 14), IStep, new Short(curtabindex++), IListBoxWidth
@@ -117,7 +117,7 @@ public class SortingComponent
HIDString = HelpIds.getHelpIdString(FirstHelpIndex + 1);
XRadioButton xRadioButtonAsc = CurUnoDialog.insertRadioButton("optAscend" + Integer.toString(i + 1), 0, new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Tag", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Boolean(bDoEnable), new Integer(10), HIDString, sSortAscend[i], IOptButtonPosX, new Integer(iCurPosY + 10), new Short((short) 1), IStep, new Short(curtabindex++), new String("ASC"), IOptButtonWidth
@@ -126,7 +126,7 @@ public class SortingComponent
HIDString = HelpIds.getHelpIdString(FirstHelpIndex + 2);
XRadioButton xRadioButtonDesc = CurUnoDialog.insertRadioButton("optDescend" + Integer.toString(i + 1), 0, new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Tag", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Boolean(bDoEnable), new Integer(10), HIDString, sSortDescend[i], IOptButtonPosX, new Integer(iCurPosY + 24), new Short((short) 0), IStep, new Short(curtabindex++), new String("DESC"), IOptButtonWidth
@@ -255,32 +255,26 @@ public class SortingComponent
{
short iCurState;
String CurFieldName;
- String CurFieldTitle;
setMaxSortIndex();
- String[][] SortFieldNames = new String[MaxSortIndex + 1][2];
- String[] SortDescriptions = new String[MaxSortIndex + 1];
+ // String[][] SortFieldNames = new String[MaxSortIndex + 1][2];
+ ArrayList<String[]> SortFieldNames = new ArrayList<String[]>();
+ ArrayList<String> SortDescriptions = new ArrayList<String>();
for (int i = 0; i <= MaxSortIndex; i++)
{
- CurFieldName = xSortListBox[i].getSelectedItem();
- SortFieldNames[i][0] = CurFieldName;
- SortDescriptions[i] = CurFieldName;
- iCurState = ((Short) CurUnoDialog.getControlProperty("optAscend" + new Integer(i + 1).toString(), "State")).shortValue();
- SortFieldNames[i][0] = CurFieldName;
- if (iCurState == 1)
+ if (!((Boolean) CurUnoDialog.getControlProperty("lstSort" + (i + 1), "ReadOnly")))
{
- SortFieldNames[i][1] = "ASC";
- }
- else
- {
- SortFieldNames[i][1] = "DESC";
+ CurFieldName = xSortListBox[i].getSelectedItem();
+ SortDescriptions.add(CurFieldName);
+ iCurState = ((Short) CurUnoDialog.getControlProperty("optAscend" + new Integer(i + 1).toString(), PropertyNames.PROPERTY_STATE)).shortValue();
+ SortFieldNames.add(new String[]{CurFieldName,iCurState == 1 ? "ASC" :"DESC" });
}
}
// When searching for a duplicate entry we can neglect wether the entries are to be sorted ascending or descending
// TODO for the future we should deliver a messagebox when two different sorting modes have been applied to one field
- int iduplicate = JavaTools.getDuplicateFieldIndex(SortDescriptions);
+ int iduplicate = JavaTools.getDuplicateFieldIndex(SortDescriptions.toArray(new String[SortDescriptions.size()]));
if (iduplicate != -1)
{
- String sLocSortCriteriaisduplicate = JavaTools.replaceSubString(sSortCriteriaisduplicate, SortFieldNames[iduplicate][0], "<FIELDNAME>");
+ String sLocSortCriteriaisduplicate = JavaTools.replaceSubString(sSortCriteriaisduplicate, SortFieldNames.get(iduplicate)[0], "<FIELDNAME>");
CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, sLocSortCriteriaisduplicate);
CurUnoDialog.vetoableChange(new PropertyChangeEvent(CurUnoDialog, "Steps", new Integer(1), new Integer(2)));
CurUnoDialog.setFocus("lstSort" + (iduplicate + 1));
@@ -290,7 +284,7 @@ public class SortingComponent
}
else
{
- return SortFieldNames;
+ return SortFieldNames.toArray(new String[SortFieldNames.size()][2]);
}
}
catch (Exception exception)
@@ -314,7 +308,7 @@ public class SortingComponent
0
});
}
- // xSortListBox[i+1].selectItemPos((short)0, true);
+ // xSortListBox[i+1].selectItemPos((short)0, true);
}
CurUnoDialog.setFocus("lblSort" + new Integer(CurIndex + 1));
MaxSortIndex = CurIndex - 1;
@@ -363,10 +357,10 @@ public class SortingComponent
{
if (CurIndex < xSortListBox.length)
{
- CurUnoDialog.setControlProperty("lblSort" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable));
- CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable));
- CurUnoDialog.setControlProperty("optAscend" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable));
- CurUnoDialog.setControlProperty("optDescend" + new Integer(CurIndex + 1).toString(), "Enabled", new Boolean(bDoEnable));
+ CurUnoDialog.setControlProperty("lblSort" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
+ CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
+ CurUnoDialog.setControlProperty("optAscend" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
+ CurUnoDialog.setControlProperty("optDescend" + new Integer(CurIndex + 1).toString(), PropertyNames.PROPERTY_ENABLED, new Boolean(bDoEnable));
if (bDoEnable == false)
{
CurUnoDialog.setControlProperty("lstSort" + new Integer(CurIndex + 1).toString(), "SelectedItems", new short[]
diff --git a/wizards/com/sun/star/wizards/ui/TitlesComponent.java b/wizards/com/sun/star/wizards/ui/TitlesComponent.java
index 892a59c669f8..ef9a568d2e01 100644
--- a/wizards/com/sun/star/wizards/ui/TitlesComponent.java
+++ b/wizards/com/sun/star/wizards/ui/TitlesComponent.java
@@ -52,14 +52,14 @@ public class TitlesComponent extends ControlScroller
super(_CurUnoDialog, null, _iStep, _iCompPosX, _iCompPosY, _iCompWidth, _uitextfieldcount, 18, _firsthelpindex);
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblColumnNames", new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Integer(8), _slblColumnNames, new Integer(iLabelPosX), new Integer(iCompPosY - 10), IStep, new Integer(60)
});
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", "lblColumnTitles", new String[]
{
- "Height", "Label", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
new Integer(8), _slblColumnTitles, new Integer(90), new Integer(iCompPosY - 10), IStep, new Integer(152)
@@ -107,7 +107,7 @@ public class TitlesComponent extends ControlScroller
CurUnoDialog.insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", slabelname,
new String[]
{
- "Height", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -117,7 +117,7 @@ public class TitlesComponent extends ControlScroller
xTextComponent = CurUnoDialog.insertTextField(stextfieldname, 0, null,
new String[]
{
- "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -158,17 +158,17 @@ public class TitlesComponent extends ControlScroller
Integer TitleWidth = new Integer(iCompPosX + iCompWidth - TitlePosX.intValue() - iScrollBarWidth - 6);
for (short i = 0; i <= ncurfieldcount; i++)
{
- CurUnoDialog.setControlProperty(getColumnName(i), "Width", FieldNameWidth);
+ CurUnoDialog.setControlProperty(getColumnName(i), PropertyNames.PROPERTY_WIDTH, FieldNameWidth);
CurUnoDialog.setControlProperties(getTitleName(i), new String[]
{
- "PositionX", "Width"
+ PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_WIDTH
}, new Object[]
{
TitlePosX, TitleWidth
});
}
- CurUnoDialog.setControlProperty("lblColumnNames", "Width", FieldNameWidth);
- CurUnoDialog.setControlProperty("lblColumnTitles", "PositionX", TitlePosX);
+ CurUnoDialog.setControlProperty("lblColumnNames", PropertyNames.PROPERTY_WIDTH, FieldNameWidth);
+ CurUnoDialog.setControlProperty("lblColumnTitles", PropertyNames.PROPERTY_POSITION_X, TitlePosX);
}
public void initialize(String[] _fieldnames, Map _fieldtitleset)
@@ -208,9 +208,9 @@ public class TitlesComponent extends ControlScroller
public String getFieldNameByTitleControl(Object _fieldtitlemodel)
{
- String sTitleModelName = (String) Helper.getUnoPropertyValue(_fieldtitlemodel, "Name");
+ String sTitleModelName = (String) Helper.getUnoPropertyValue(_fieldtitlemodel, PropertyNames.PROPERTY_NAME);
String sindex = JavaTools.getSuffixNumber(sTitleModelName);
- return (String) CurUnoDialog.getControlProperty(this.SOLABELPREFIX + sindex, "Label");
+ return (String) CurUnoDialog.getControlProperty(this.SOLABELPREFIX + sindex, PropertyNames.PROPERTY_LABEL);
}
public String[] getFieldTitles()
diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.java b/wizards/com/sun/star/wizards/ui/UnoDialog.java
index 5a181b84c4b5..e372a843a56a 100644
--- a/wizards/com/sun/star/wizards/ui/UnoDialog.java
+++ b/wizards/com/sun/star/wizards/ui/UnoDialog.java
@@ -112,7 +112,7 @@ public class UnoDialog implements EventNames
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControlModel);
try
{
- String sName = (String) xPSet.getPropertyValue("Name");
+ String sName = (String) xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME);
Integer KeyObject = (Integer) ControlList.get(sName);
iKey = KeyObject.intValue();
}
@@ -245,7 +245,7 @@ public class UnoDialog implements EventNames
XControl xControl2 = xDlgContainer.getControl(ControlName);
XView xView = (XView) UnoRuntime.queryInterface(XView.class, xControl2);
Size aSize = xView.getSize();
- double dblMAPWidth = (double) (((Integer) Helper.getUnoPropertyValue(xControl2.getModel(), "Width")).intValue());
+ double dblMAPWidth = (double) (((Integer) Helper.getUnoPropertyValue(xControl2.getModel(), PropertyNames.PROPERTY_WIDTH)).intValue());
double dblFactor = (((double) (aSize.Width)) / dblMAPWidth);
return dblFactor;
}
@@ -308,7 +308,7 @@ public class UnoDialog implements EventNames
{
Object oFixedText = insertControlModel("com.sun.star.awt.UnoControlFixedTextModel", sName, sPropNames, oPropValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFixedText);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
Object oLabel = xDlgContainer.getControl(new String(sName));
return (XFixedText) UnoRuntime.queryInterface(XFixedText.class, oLabel);
}
@@ -322,7 +322,7 @@ public class UnoDialog implements EventNames
/* public XButton insertButton(String sName, int iControlKey, XActionListener xActionListener, String[] sProperties, Object[] sValues) throws com.sun.star.uno.Exception{
Object oButtonModel = insertControlModel("com.sun.star.awt.UnoControlButtonModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oButtonModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
Object objectButton = xDlgContainer.getControl( new String(sName));
XButton xButton = ( XButton ) UnoRuntime.queryInterface( XButton.class, objectButton );
xButton.addActionListener(xActionListener);
@@ -335,7 +335,7 @@ public class UnoDialog implements EventNames
{
Object oButtonModel = insertControlModel("com.sun.star.awt.UnoControlButtonModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oButtonModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
Object objectButton = xDlgContainer.getControl(new String(sName));
XButton xButton = (XButton) UnoRuntime.queryInterface(XButton.class, objectButton);
if (xActionListener != null)
@@ -354,7 +354,7 @@ public class UnoDialog implements EventNames
{
Object oButtonModel = insertControlModel("com.sun.star.awt.UnoControlCheckBoxModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oButtonModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
Object objectCheckBox = xDlgContainer.getControl(new String(sName));
XCheckBox xCheckBox = (XCheckBox) UnoRuntime.queryInterface(XCheckBox.class, objectCheckBox);
if (xItemListener != null)
@@ -372,7 +372,7 @@ public class UnoDialog implements EventNames
{
Object oNumericFieldModel = insertControlModel("com.sun.star.awt.UnoControlNumericFieldModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oNumericFieldModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
Object objectNumericField = xDlgContainer.getControl(new String(sName));
XTextComponent xNumericField = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, objectNumericField);
if (xTextListener != null)
@@ -392,7 +392,7 @@ public class UnoDialog implements EventNames
{
Object oScrollModel = insertControlModel("com.sun.star.awt.UnoControlScrollBarModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oScrollModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
Object oScrollBar = xDlgContainer.getControl(new String(sName));
XScrollBar xScrollBar = (XScrollBar) UnoRuntime.queryInterface(XScrollBar.class, oScrollBar);
if (xAdjustmentListener != null)
@@ -431,7 +431,7 @@ public class UnoDialog implements EventNames
{
XInterface xTextModel = insertControlModel(ServiceName, sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
XControl xTextField = xDlgContainer.getControl(new String(sName));
XTextComponent xTextBox = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xTextField);
if (xTextListener != null)
@@ -453,7 +453,7 @@ public class UnoDialog implements EventNames
{
XInterface xListBoxModel = insertControlModel("com.sun.star.awt.UnoControlListBoxModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xListBoxModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
XControl xControlListBox = xDlgContainer.getControl(new String(sName));
XListBox xListBox = (XListBox) UnoRuntime.queryInterface(XListBox.class, xControlListBox);
if (xItemListener != null)
@@ -473,7 +473,7 @@ public class UnoDialog implements EventNames
{
XInterface xComboBoxModel = insertControlModel("com.sun.star.awt.UnoControlComboBoxModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xComboBoxModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
XControl xControlComboBox = xDlgContainer.getControl(new String(sName));
XComboBox xComboBox = (XComboBox) UnoRuntime.queryInterface(XComboBox.class, xControlComboBox);
if (xItemListener != null)
@@ -545,7 +545,7 @@ public class UnoDialog implements EventNames
{
XInterface oRadioButtonModel = insertControlModel("com.sun.star.awt.UnoControlRadioButtonModel", sName, sProperties, sValues);
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRadioButtonModel);
- xPSet.setPropertyValue("Name", sName);
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName);
XControl xControlRadioButton = xDlgContainer.getControl(new String(sName));
XRadioButton xRadioButton = (XRadioButton) UnoRuntime.queryInterface(XRadioButton.class, xControlRadioButton);
return xRadioButton;
@@ -560,7 +560,7 @@ public class UnoDialog implements EventNames
/**
* @author bc93774
* The problem with setting the visibility of controls is that changing the current step
- * of a dialog will automatically make all controls visible. The "Step" property always wins against
+ * of a dialog will automatically make all controls visible. The PropertyNames.PROPERTY_STEP property always wins against
* the property "visible". Therfor a control meant to be invisible is placed on a step far far away.
* @param the name of the control
* @param iStep change the step if you want to make the control invisible
@@ -569,8 +569,8 @@ public class UnoDialog implements EventNames
{
try
{
- int iCurStep = AnyConverter.toInt(getControlProperty(controlname, "Step"));
- setControlProperty(controlname, "Step", new Integer(iStep));
+ int iCurStep = AnyConverter.toInt(getControlProperty(controlname, PropertyNames.PROPERTY_STEP));
+ setControlProperty(controlname, PropertyNames.PROPERTY_STEP, new Integer(iStep));
}
catch (com.sun.star.uno.Exception exception)
{
@@ -581,7 +581,7 @@ public class UnoDialog implements EventNames
/**
* @author bc93774
* The problem with setting the visibility of controls is that changing the current step
- * of a dialog will automatically make all controls visible. The "Step" property always wins against
+ * of a dialog will automatically make all controls visible. The PropertyNames.PROPERTY_STEP property always wins against
* the property "visible". Therfor a control meant to be invisible is placed on a step far far away.
* Afterwards the step property of the dialog has to be set with "repaintDialogStep". As the performance
* of that method is very bad it should be used only once for all controls
@@ -592,16 +592,16 @@ public class UnoDialog implements EventNames
{
try
{
- int iCurControlStep = AnyConverter.toInt(getControlProperty(controlname, "Step"));
- int iCurDialogStep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, "Step"));
+ int iCurControlStep = AnyConverter.toInt(getControlProperty(controlname, PropertyNames.PROPERTY_STEP));
+ int iCurDialogStep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_STEP));
int iNewStep;
if (bIsVisible)
{
- setControlProperty(controlname, "Step", new Integer(iCurDialogStep));
+ setControlProperty(controlname, PropertyNames.PROPERTY_STEP, new Integer(iCurDialogStep));
}
else
{
- setControlProperty(controlname, "Step", UIConsts.INVISIBLESTEP);
+ setControlProperty(controlname, PropertyNames.PROPERTY_STEP, UIConsts.INVISIBLESTEP);
}
}
catch (com.sun.star.uno.Exception exception)
@@ -618,9 +618,9 @@ public class UnoDialog implements EventNames
{
try
{
- int ncurstep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, "Step"));
- Helper.setUnoPropertyValue(xDialogModel, "Step", new Integer(99));
- Helper.setUnoPropertyValue(xDialogModel, "Step", new Integer(ncurstep));
+ int ncurstep = AnyConverter.toInt(Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_STEP));
+ Helper.setUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP, new Integer(99));
+ Helper.setUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP, new Integer(ncurstep));
}
catch (com.sun.star.uno.Exception exception)
{
@@ -892,7 +892,7 @@ public class UnoDialog implements EventNames
public static void setEnabled(Object control, Boolean enabled)
{
- Helper.setUnoPropertyValue(getModel(control), "Enabled", enabled);
+ Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enabled);
}
/**
@@ -1004,11 +1004,11 @@ public class UnoDialog implements EventNames
switch (itype)
{
case UIConsts.CONTROLTYPE.FIXEDTEXT:
- return "Label";
+ return PropertyNames.PROPERTY_LABEL;
case UIConsts.CONTROLTYPE.BUTTON:
- return "Label";
+ return PropertyNames.PROPERTY_LABEL;
case UIConsts.CONTROLTYPE.FIXEDLINE:
- return "Label";
+ return PropertyNames.PROPERTY_LABEL;
case UIConsts.CONTROLTYPE.NUMERICFIELD:
return "Value";
case UIConsts.CONTROLTYPE.CURRENCYFIELD:
@@ -1024,11 +1024,11 @@ public class UnoDialog implements EventNames
case UIConsts.CONTROLTYPE.PROGRESSBAR:
return "ProgressValue";
case UIConsts.CONTROLTYPE.IMAGECONTROL:
- return "ImageURL";
+ return PropertyNames.PROPERTY_IMAGEURL;
case UIConsts.CONTROLTYPE.RADIOBUTTON:
- return "State";
+ return PropertyNames.PROPERTY_STATE;
case UIConsts.CONTROLTYPE.CHECKBOX:
- return "State";
+ return PropertyNames.PROPERTY_STATE;
case UIConsts.CONTROLTYPE.EDITCONTROL:
return "Text";
case UIConsts.CONTROLTYPE.COMBOBOX:
diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog2.java b/wizards/com/sun/star/wizards/ui/UnoDialog2.java
index 184a4a354b0c..0769e1d23b38 100644
--- a/wizards/com/sun/star/wizards/ui/UnoDialog2.java
+++ b/wizards/com/sun/star/wizards/ui/UnoDialog2.java
@@ -32,6 +32,7 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.SystemDialog;
import com.sun.star.wizards.ui.event.*;
@@ -208,7 +209,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames
XControl xImgControl = insertImage(Desktop.getUniqueName(getDlgNameAccess(), "imgHint"),
new String[]
{
- "Border", "Height", "ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -340,7 +341,7 @@ public class UnoDialog2 extends UnoDialog implements EventNames
Helper.setUnoPropertyValues(xControlModel, sPropNames, oPropValues);
//setControlPropertiesDebug(xControlModel, sPropNames, oPropValues);
//System.out.println(" Setting props successfull !");
- Helper.setUnoPropertyValue(xControlModel, "Name", componentName);
+ Helper.setUnoPropertyValue(xControlModel, PropertyNames.PROPERTY_NAME, componentName);
}
catch (Exception ex)
{
diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java
index 50ff51c5bbd4..c03ceb2dc257 100644
--- a/wizards/com/sun/star/wizards/ui/WizardDialog.java
+++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java
@@ -47,6 +47,7 @@ import com.sun.star.frame.TerminationVetoException;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.beans.*;
import com.sun.star.wizards.common.HelpIds;
+import com.sun.star.wizards.common.PropertyNames;
public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeListener, XTerminateListener, XCompletion
{
@@ -163,7 +164,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
try
{
nNewStep = itemEvent.ItemId;
- nOldStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, "Step"));
+ nOldStep = AnyConverter.toInt(Helper.getUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP));
if (nNewStep != nOldStep)
{
switchToStep();
@@ -227,7 +228,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
{
try
{
- int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, "Height")).intValue();
+ int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_HEIGHT)).intValue();
// the roadmap control has got no real TabIndex ever
// that is not correct, but changing this would need time, so it is used
@@ -235,13 +236,13 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
oRoadmap = insertControlModel("com.sun.star.awt.UnoControlRoadmapModel", "rdmNavi",
new String[]
{
- "Height",
- "PositionX",
- "PositionY",
- "Step",
- "TabIndex",
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP,
+ PropertyNames.PROPERTY_TABINDEX,
"Tabstop",
- "Width"
+ PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -254,7 +255,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
new Integer(85)
});
XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRoadmap);
- xPSet.setPropertyValue("Name", "rdmNavi");
+ xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, "rdmNavi");
xSSFRoadmap = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, oRoadmap);
xIndexContRoadmap = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, oRoadmap);
@@ -308,8 +309,8 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
try
{
Object oRoadmapItem = xSSFRoadmap.createInstance();
- Helper.setUnoPropertyValue(oRoadmapItem, "Label", _sLabel);
- Helper.setUnoPropertyValue(oRoadmapItem, "Enabled", new Boolean(_bEnabled));
+ Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_LABEL, _sLabel);
+ Helper.setUnoPropertyValue(oRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(_bEnabled));
Helper.setUnoPropertyValue(oRoadmapItem, "ID", new Integer(_CurItemID));
xIndexContRoadmap.insertByIndex(Index, oRoadmapItem);
int NextIndex = Index + 1;
@@ -386,7 +387,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
protected void changeToStep(int nNewStep)
{
- Helper.setUnoPropertyValue(xDialogModel, "Step", new Integer(nNewStep));
+ Helper.setUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_STEP, new Integer(nNewStep));
setCurrentRoadmapItemID((short) (nNewStep));
enableNextButton(getNextAvailableStep() > 0);
enableBackButton(nNewStep != 1);
@@ -454,8 +455,8 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
int iButtonHeight = 14;
Integer IButtonHeight = new Integer(iButtonHeight);
Integer ICurStep = new Integer(0);
- int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, "Height")).intValue();
- int iDialogWidth = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, "Width")).intValue();
+ int iDialogHeight = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_HEIGHT)).intValue();
+ int iDialogWidth = ((Integer) Helper.getUnoPropertyValue(this.xDialogModel, PropertyNames.PROPERTY_WIDTH)).intValue();
int iHelpPosX = 8;
int iBtnPosY = iDialogHeight - iButtonHeight - 6;
int iCancelPosX = iDialogWidth - iButtonWidth - 6;
@@ -466,7 +467,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lnNaviSep",
new String[]
{
- "Height", "Orientation", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -476,7 +477,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
insertControlModel("com.sun.star.awt.UnoControlFixedLineModel", "lnRoadSep",
new String[]
{
- "Height", "Orientation", "PositionX", "PositionY", "Step", "Width"
+ PropertyNames.PROPERTY_HEIGHT, "Orientation", PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -485,13 +486,13 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
String[] propNames = new String[]
{
- "Enabled", "Height", "HelpURL", "Label", "PositionX", "PositionY", "PushButtonType", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "PushButtonType", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
- Helper.setUnoPropertyValue(super.xDialogModel, "HelpURL", HelpIds.getHelpIdString(hid));
+ Helper.setUnoPropertyValue(super.xDialogModel, PropertyNames.PROPERTY_HELPURL, HelpIds.getHelpIdString(hid));
insertButton("btnWizardHelp", HELP_ACTION_PERFORMED, new String[]
{
- "Enabled", "Height", "Label", "PositionX", "PositionY", "PushButtonType", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "PushButtonType", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -527,7 +528,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
// close the dialog.
MethodInvocation windowHidden = new MethodInvocation("windowHidden", this);
xWindow.addWindowListener((CommonListener) getGuiEventListener());
- String dialogName = (String) Helper.getUnoPropertyValue(xDialogModel, "Name");
+ String dialogName = (String) Helper.getUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_NAME);
getGuiEventListener().add(dialogName, EVENT_ACTION_PERFORMED, windowHidden);
}
@@ -569,17 +570,17 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
public void enableBackButton(boolean enabled)
{
- setControlProperty("btnWizardBack", "Enabled", enabled ? Boolean.TRUE : Boolean.FALSE);
+ setControlProperty("btnWizardBack", PropertyNames.PROPERTY_ENABLED, enabled ? Boolean.TRUE : Boolean.FALSE);
}
public void enableNextButton(boolean enabled)
{
- setControlProperty("btnWizardNext", "Enabled", enabled ? Boolean.TRUE : Boolean.FALSE);
+ setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, enabled ? Boolean.TRUE : Boolean.FALSE);
}
public void enableFinishButton(boolean enabled)
{
- setControlProperty("btnWizardFinish", "Enabled", enabled ? Boolean.TRUE : Boolean.FALSE);
+ setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, enabled ? Boolean.TRUE : Boolean.FALSE);
}
public void setStepEnabled(int _nStep, boolean bEnabled)
@@ -587,7 +588,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
XInterface xRoadmapItem = getRoadmapItemByID(_nStep);
if (xRoadmapItem != null)
{
- Helper.setUnoPropertyValue(xRoadmapItem, "Enabled", new Boolean(bEnabled));
+ Helper.setUnoPropertyValue(xRoadmapItem, PropertyNames.PROPERTY_ENABLED, new Boolean(bEnabled));
}
}
@@ -622,7 +623,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
{
return false;
}
- bIsEnabled = AnyConverter.toBoolean(Helper.getUnoPropertyValue(xRoadmapItem, "Enabled"));
+ bIsEnabled = AnyConverter.toBoolean(Helper.getUnoPropertyValue(xRoadmapItem, PropertyNames.PROPERTY_ENABLED));
return bIsEnabled;
}
catch (com.sun.star.uno.Exception exception)
@@ -713,7 +714,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
{
try
{
- return AnyConverter.toInt(Helper.getUnoPropertyValue(this.MSFDialogModel, "Step"));
+ return AnyConverter.toInt(Helper.getUnoPropertyValue(this.MSFDialogModel, PropertyNames.PROPERTY_STEP));
}
catch (com.sun.star.uno.Exception exception)
{
@@ -746,7 +747,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
insertLabel("lblQueryTitle" + String.valueOf(i),
new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/ui/event/AbstractListener.java b/wizards/com/sun/star/wizards/ui/event/AbstractListener.java
index ebbcba96f58c..bbe9cee2eb86 100644
--- a/wizards/com/sun/star/wizards/ui/event/AbstractListener.java
+++ b/wizards/com/sun/star/wizards/ui/event/AbstractListener.java
@@ -30,6 +30,7 @@ import com.sun.star.awt.XControl;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
import java.lang.reflect.InvocationTargetException;
import java.util.Hashtable;
@@ -128,6 +129,6 @@ public class AbstractListener
public static String getEventSourceName(EventObject eventObject)
{
XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, eventObject.Source);
- return (String) Helper.getUnoPropertyValue(xControl.getModel(), "Name", String.class);
+ return (String) Helper.getUnoPropertyValue(xControl.getModel(), PropertyNames.PROPERTY_NAME, String.class);
}
}
diff --git a/wizards/com/sun/star/wizards/ui/event/DataAware.java b/wizards/com/sun/star/wizards/ui/event/DataAware.java
index b81b8e71bcdb..62eaaf657447 100644
--- a/wizards/com/sun/star/wizards/ui/event/DataAware.java
+++ b/wizards/com/sun/star/wizards/ui/event/DataAware.java
@@ -31,6 +31,7 @@ import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
+import com.sun.star.wizards.common.PropertyNames;
/**
* @author rpiterman
@@ -275,7 +276,7 @@ public abstract class DataAware {
/**
* creates a PropertyValue for the property with
* the given name, of the given JavaBean object.
- * @param propertyName the property to access. Must be a Cup letter (e.g. "Name" for getName() and setName("..."). )
+ * @param propertyName the property to access. Must be a Cup letter (e.g. PropertyNames.PROPERTY_NAME for getName() and setName("..."). )
* @param propertyOwner the object which "own" or "contains" the property.
*/
public PropertyValue(String propertyName, Object propertyOwner) {
diff --git a/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java b/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java
index 74881d7b1f23..119b2b6e1e51 100644
--- a/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java
+++ b/wizards/com/sun/star/wizards/ui/event/DataAwareFields.java
@@ -27,7 +27,7 @@
package com.sun.star.wizards.ui.event;
import java.lang.reflect.Field;
-
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.uno.Any;
/**
diff --git a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java
index c45a496c7849..86c50b13ce02 100644
--- a/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java
+++ b/wizards/com/sun/star/wizards/ui/event/MethodInvocation.java
@@ -28,6 +28,7 @@ package com.sun.star.wizards.ui.event;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import com.sun.star.wizards.common.PropertyNames;
/**
* Encapsulate a Method invocation.
diff --git a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java
index 632609d85f05..b8024fb4f9c9 100644
--- a/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java
+++ b/wizards/com/sun/star/wizards/ui/event/UnoDataAware.java
@@ -30,6 +30,7 @@ import com.sun.star.awt.*;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.wizards.common.Helper;
+import com.sun.star.wizards.common.PropertyNames;
/**
* @author rpiterman
@@ -79,7 +80,7 @@ public class UnoDataAware extends DataAware
protected void setToUI(Object value)
{
- //System.out.println("Settings uno property : "+ Helper.getUnoPropertyValue(this.unoModel,"Name") + "<-" +stringof(value));
+ //System.out.println("Settings uno property : "+ Helper.getUnoPropertyValue(this.unoModel,PropertyNames.PROPERTY_NAME) + "<-" +stringof(value));
Helper.setUnoPropertyValue(unoModel, unoPropName, value);
}
@@ -203,7 +204,7 @@ public class UnoDataAware extends DataAware
field
? DataAwareFields.getFieldValueFor(data, prop, new Short((short) 0))
: new DataAware.PropertyValue(prop, data),
- checkBox, "State");
+ checkBox, PropertyNames.PROPERTY_STATE);
xcheckBox.addItemListener(itemListener(uda, listener));
return uda;
}
@@ -233,7 +234,7 @@ public class UnoDataAware extends DataAware
return new UnoDataAware(data,
field ? DataAwareFields.getFieldValueFor(data, prop, "")
: new DataAware.PropertyValue(prop, data),
- label, "Label");
+ label, PropertyNames.PROPERTY_LABEL);
}
public static UnoDataAware attachListBox(Object data, String prop, Object listBox, final Listener listener, boolean field)
@@ -260,6 +261,6 @@ public class UnoDataAware extends DataAware
public static void setEnabled(Object control, Boolean enabled)
{
- Helper.setUnoPropertyValue(getModel(control), "Enabled", enabled);
+ Helper.setUnoPropertyValue(getModel(control), PropertyNames.PROPERTY_ENABLED, enabled);
}
}
diff --git a/wizards/com/sun/star/wizards/web/FTPDialog.java b/wizards/com/sun/star/wizards/web/FTPDialog.java
index ca6f70add7b6..f958d9016833 100644
--- a/wizards/com/sun/star/wizards/web/FTPDialog.java
+++ b/wizards/com/sun/star/wizards/web/FTPDialog.java
@@ -45,6 +45,7 @@ import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.SystemDialog;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.UCB;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.UnoDialog;
@@ -197,7 +198,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Closeable", "Height", "HelpURL", "Moveable", "Name", "PositionX", "PositionY", "Title", "Width"
+ "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -219,15 +220,15 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
{
final String[] PROPNAMES_LABEL = new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
final String[] PROPNAMES_BUTTON = new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
final String[] PROPNAMES_BUTTON2 = new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "PushButtonType", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "PushButtonType", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
ln1 = insertFixedLine("ln1",
@@ -245,7 +246,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
txtHost = insertTextField("txtHost", "disconnect",
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -260,7 +261,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
txtUsername = insertTextField("txtUsername", "disconnect",
new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -275,7 +276,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
txtPassword = insertTextField("txtPassword", "disconnect",
new String[]
{
- "EchoChar", "Height", "HelpURL", "Name", "PositionX", "PositionY", "TabIndex", "Width"
+ "EchoChar", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -297,7 +298,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
imgStatus = insertImage("imgStatus",
new String[]
{
- "Border", "Height", "PositionX", "PositionY", "ScaleImage", "Tabstop", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", "Tabstop", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -321,7 +322,7 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
txtDir = insertTextField("txtDir",
null, new String[]
{
- "Enabled", "Height", "HelpURL", "Name", "PositionX", "PositionY", "TabIndex", "Text", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -701,8 +702,8 @@ public class FTPDialog extends UnoDialog2 implements UIConsts, WWHID
*/
private void setLabel(String label, String image)
{
- Helper.setUnoPropertyValue(getModel(lblStatus), "Label", label);
- Helper.setUnoPropertyValue(getModel(imgStatus), "ImageURL", imageUrl(image));
+ Helper.setUnoPropertyValue(getModel(lblStatus), PropertyNames.PROPERTY_LABEL, label);
+ Helper.setUnoPropertyValue(getModel(imgStatus), PropertyNames.PROPERTY_IMAGEURL, imageUrl(image));
}
private String imageUrl(String s)
diff --git a/wizards/com/sun/star/wizards/web/ImageListDialog.java b/wizards/com/sun/star/wizards/web/ImageListDialog.java
index c3ea98688c64..df4f4142f858 100644
--- a/wizards/com/sun/star/wizards/web/ImageListDialog.java
+++ b/wizards/com/sun/star/wizards/web/ImageListDialog.java
@@ -35,6 +35,7 @@ import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.HelpIds;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.IRenderer;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.ImageList;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.UnoDialog2;
@@ -132,7 +133,7 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Closeable", "Height", "HelpURL", "Moveable", "Name", "PositionX", "PositionY", "Step", "Title", "Width"
+ "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -143,7 +144,7 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts
final String[] PROPNAMES = new String[]
{
- "DefaultButton", "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "PushButtonType", "TabIndex", "Width"
+ "DefaultButton", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "PushButtonType", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
Integer iButtonsX = new Integer(6 + ilWidth + 6);
@@ -200,14 +201,14 @@ public abstract class ImageListDialog extends UnoDialog2 implements UIConsts
il.create(this);
/*lblContainer = insertLabel("lblContainer",
- new String[] {"Height", "Name", "PositionX", "PositionY", "TabIndex", "Width"},
+ new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH},
new Object[] { new Integer(176),"lblContainer",new Integer(6),new Integer(17),new Short((short)5),new Integer(214)}
);*/
lblTitle = insertLabel("lblTitle",
new String[]
{
- "FontDescriptor", "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
diff --git a/wizards/com/sun/star/wizards/web/StatusDialog.java b/wizards/com/sun/star/wizards/web/StatusDialog.java
index ab1e7a0b6bc7..c765e2410312 100644
--- a/wizards/com/sun/star/wizards/web/StatusDialog.java
+++ b/wizards/com/sun/star/wizards/web/StatusDialog.java
@@ -32,6 +32,7 @@ import com.sun.star.awt.XProgressBar;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.IRenderer;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.UnoDialog;
import com.sun.star.wizards.ui.UnoDialog2;
import com.sun.star.wizards.ui.event.MethodInvocation;
@@ -83,7 +84,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Closeable", "Height", "HelpURL", "Moveable", "Name", "PositionX", "PositionY", "Step", "Title", "Width"
+ "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -95,7 +96,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener
lblTaskName = insertLabel("lblTask",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -104,7 +105,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener
lblCounter = insertLabel("lblCounter",
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -113,7 +114,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener
progressBar = insertProgressBar("progress",
new String[]
{
- "Height", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -126,7 +127,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener
btnCancel = insertButton("btnCancel", "performCancel", this,
new String[]
{
- "Height", "Label", "PositionX", "PositionY", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -158,7 +159,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener
public void setLabel(String s)
{
// lblTaskName.setText(s);
- Helper.setUnoPropertyValue(UnoDialog.getModel(lblTaskName), "Label", s);
+ Helper.setUnoPropertyValue(UnoDialog.getModel(lblTaskName), PropertyNames.PROPERTY_LABEL, s);
xReschedule.reschedule();
}
@@ -208,7 +209,7 @@ public class StatusDialog extends UnoDialog2 implements TaskListener
}
else
{
- Helper.setUnoPropertyValue(getModel(btnCancel), "Label", res[2]);
+ Helper.setUnoPropertyValue(getModel(btnCancel), PropertyNames.PROPERTY_LABEL, res[2]);
}
}
diff --git a/wizards/com/sun/star/wizards/web/WWD_Events.java b/wizards/com/sun/star/wizards/web/WWD_Events.java
index 6e8d0f2e614e..26f518c4e6c8 100644
--- a/wizards/com/sun/star/wizards/web/WWD_Events.java
+++ b/wizards/com/sun/star/wizards/web/WWD_Events.java
@@ -42,6 +42,7 @@ import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.SystemDialog;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.UnoDialog;
import com.sun.star.wizards.ui.event.DataAware;
import com.sun.star.wizards.ui.event.ListModelBinder;
@@ -251,7 +252,7 @@ public abstract class WWD_Events extends WWD_Startup
}
if (nextSelected[0] == 0)
{
- Helper.setUnoPropertyValue(getModel(btnDelSession), "Enabled", Boolean.FALSE); // select...
+ Helper.setUnoPropertyValue(getModel(btnDelSession), PropertyNames.PROPERTY_ENABLED, Boolean.FALSE); // select...
}
Helper.setUnoPropertyValue(getModel(lstLoadSettings), "SelectedItems", nextSelected);
@@ -1116,7 +1117,7 @@ public abstract class WWD_Events extends WWD_Startup
}
else if (ke.KeyChar == '%' && ((System.currentTimeMillis() - time) < 300))
{
- Boolean b = (Boolean) getControlProperty("btnWizardFinish", "Enabled");
+ Boolean b = (Boolean) getControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED);
if (b.booleanValue())
{
finishWizard(false);
diff --git a/wizards/com/sun/star/wizards/web/WWD_General.java b/wizards/com/sun/star/wizards/web/WWD_General.java
index 551a4b1437f2..fd716e1b9c06 100644
--- a/wizards/com/sun/star/wizards/web/WWD_General.java
+++ b/wizards/com/sun/star/wizards/web/WWD_General.java
@@ -33,6 +33,7 @@ import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.HelpIds;
import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.SystemDialog;
import com.sun.star.wizards.ui.event.ListModelBinder;
import com.sun.star.wizards.web.data.CGDocument;
@@ -215,7 +216,7 @@ public abstract class WWD_General extends WebWizardDialog
protected boolean isSaveSession()
{
return (((Number) Helper.getUnoPropertyValue(
- getModel(chkSaveSettings), "State")).intValue() == 1);
+ getModel(chkSaveSettings), PropertyNames.PROPERTY_STATE)).intValue() == 1);
}
/**
@@ -343,7 +344,7 @@ public abstract class WWD_General extends WebWizardDialog
{
try
{
- return (checkPublish(LOCAL_PUBLISHER, txtLocalDir, "Text") | (!proxies && checkPublish(FTP_PUBLISHER, lblFTP, "Label")) | checkPublish(ZIP_PUBLISHER, txtZip, "Text")) && checkSaveSession();
+ return (checkPublish(LOCAL_PUBLISHER, txtLocalDir, "Text") | (!proxies && checkPublish(FTP_PUBLISHER, lblFTP, PropertyNames.PROPERTY_LABEL)) | checkPublish(ZIP_PUBLISHER, txtZip, "Text")) && checkSaveSession();
}
catch (IllegalArgumentException ex)
{
diff --git a/wizards/com/sun/star/wizards/web/WWD_Startup.java b/wizards/com/sun/star/wizards/web/WWD_Startup.java
index 200f70a32383..2a250c84c266 100644
--- a/wizards/com/sun/star/wizards/web/WWD_Startup.java
+++ b/wizards/com/sun/star/wizards/web/WWD_Startup.java
@@ -50,6 +50,7 @@ import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.SystemDialog;
import com.sun.star.wizards.document.OfficeDocument;
import com.sun.star.wizards.ui.DocumentPreview;
@@ -727,7 +728,7 @@ public abstract class WWD_Startup extends WWD_General
task.advance(true);
sessionNameDA.setDataObject(session, true);
- Helper.setUnoPropertyValue(getModel(chkSaveSettings), "State", new Short((short) 1));
+ Helper.setUnoPropertyValue(getModel(chkSaveSettings), PropertyNames.PROPERTY_STATE, new Short((short) 1));
docListDA.updateUI();
task.advance(true);
@@ -914,7 +915,7 @@ public abstract class WWD_Startup extends WWD_General
{
bg = FileAccess.getPathFilename(getFileAccess().getPath(bg, null));
}
- Helper.setUnoPropertyValue(getModel(txtBackground), "Label", bg);
+ Helper.setUnoPropertyValue(getModel(txtBackground), PropertyNames.PROPERTY_LABEL, bg);
}
void updateIconsetText()
@@ -938,7 +939,7 @@ public abstract class WWD_Startup extends WWD_General
}
}
- Helper.setUnoPropertyValue(getModel(txtIconset), "Label", iconsetName);
+ Helper.setUnoPropertyValue(getModel(txtIconset), PropertyNames.PROPERTY_LABEL, iconsetName);
}
/**
diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialog.java b/wizards/com/sun/star/wizards/web/WebWizardDialog.java
index 23adc86dfca1..e9d1d2fd7a87 100644
--- a/wizards/com/sun/star/wizards/web/WebWizardDialog.java
+++ b/wizards/com/sun/star/wizards/web/WebWizardDialog.java
@@ -40,6 +40,7 @@ import com.sun.star.awt.XTextComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.wizards.common.Helper;
import com.sun.star.wizards.common.HelpIds;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.ImageList;
import com.sun.star.wizards.ui.UIConsts;
import com.sun.star.wizards.ui.WizardDialog;
@@ -176,30 +177,30 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
FontDescriptor fontDescriptor4 = new FontDescriptor();
FontDescriptor fontDescriptor5 = new FontDescriptor();
FontDescriptor fontDescriptor6 = new FontDescriptor();
- FontDescriptor fontDescriptor7 = new FontDescriptor(); //private static String[] PROPNAMES_LBL_NOFOCUS = new String[] {"Height", "Label", "Name", "PositionX", "PositionY", "Step", "Width"};
+ FontDescriptor fontDescriptor7 = new FontDescriptor(); //private static String[] PROPNAMES_LBL_NOFOCUS = new String[] {PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH};
private static String[] PROPNAMES_LBL = new String[]
{
- "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
private static String[] PROPNAMES_CHKBOX = new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STATE, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
private static String[] PROPNAMES_BUTTON = new String[]
{
- "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
private static String[] PROPNAMES_TXT = new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
private static String[] PROPNAMES_TXT_2 = new String[]
{
- "Height", "HelpURL", "Name", "PositionX", "PositionY", "ReadOnly", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ReadOnly", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
private static String[] PROPNAMES_TITLE = new String[]
{
- "FontDescriptor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
};
private static Integer INTEGER_91 = new Integer(91);
private static Integer INTEGER_97 = new Integer(97);
@@ -218,7 +219,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
Helper.setUnoPropertyValues(xDialogModel,
new String[]
{
- "Closeable", "Height", "HelpURL", "Moveable", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width"
+ "Closeable", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "Moveable", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Title", PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -258,7 +259,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lblIntroduction = insertLabel("lblIntroduction",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -274,7 +275,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lblLoadSettings = insertLabel("lblLoadSettings",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -283,7 +284,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lstLoadSettings = insertListBox("lstLoadSettings", null, LSTLOADSETTINGS_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "LineCount", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -292,7 +293,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
btnDelSession = insertButton("btnDelSession", BTNDELSESSION_ACTION_PERFORMED,
new String[]
{
- "Enabled", "Height", "HelpURL", "ImageAlign", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "ImageAlign", PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -319,7 +320,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lstDocuments = insertListBox("lstDocuments", null, null,
new String[]
{
- "Height", "HelpURL", "LineCount", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -340,7 +341,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
btnDocUp = insertButton("btnDocUp", BTNDOCUP_ACTION_PERFORMED,
new String[]
{
- "FontDescriptor", "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -349,7 +350,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
btnDocDown = insertButton("btnDocDown", BTNDOCDOWN_ACTION_PERFORMED,
new String[]
{
- "FontDescriptor", "Height", "HelpURL", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "FontDescriptor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -365,7 +366,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lstDocTargetType = insertListBox("lstDocTargetType", null, null,
new String[]
{
- "Dropdown", "Height", "HelpURL", "LineCount", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -402,7 +403,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
txtDocInfo = insertTextField("txtDocInfo", null,
new String[]
{
- "Height", "HelpURL", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -450,7 +451,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lnDisplay = insertLabel("lblDisplay",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -554,7 +555,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lstStyles = insertListBox("lstStyles", null, LSTSTYLES_ITEM_CHANGED,
new String[]
{
- "Dropdown", "Height", "HelpURL", "LineCount", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -569,7 +570,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
txtBackground = insertLabel("txtBackground",
new String[]
{
- "Border", "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -589,7 +590,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
txtIconset = insertLabel("txtIconset",
new String[]
{
- "Border", "Height", "Label", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -604,7 +605,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
insertLabel("lblIconsetInfo",
new String[]
{
- "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -615,7 +616,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
imgPreview = insertImage("imgPreview",
new String[]
{
- "BackgroundColor", "Enabled", "Height", "ImageURL", "Name", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"
+ "BackgroundColor", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -700,7 +701,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
dateSiteCreated = insertDateField("dateSiteCreated", null,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -716,7 +717,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
dateSiteUpdate = insertDateField("dateSiteUpdate", null,
new String[]
{
- "Dropdown", "Height", "HelpURL", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -809,7 +810,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
lblFTP = insertLabel("lblFTP",
new String[]
{
- "Border", "Height", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -829,7 +830,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
insertImage("imgFTPDisabled",
new String[]
{
- "BackgroundColor", "Border", "Enabled", "Height", "ImageURL", "Name", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"
+ "BackgroundColor", "Border", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -838,7 +839,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
insertLabel("lblFTPDisabled",
new String[]
{
- "BackgroundColor", "Height", "Label", "MultiLine", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "BackgroundColor", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -869,7 +870,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
cbSaveSettings = insertComboBox("txtSaveSettings", TXTSAVESETTINGS_TEXT_CHANGED, TXTSAVESETTINGS_TEXT_CHANGED, TXTSAVESETTINGS_TEXT_CHANGED,
new String[]
{
- "Autocomplete", "Dropdown", "Height", "HelpURL", "LineCount", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ "Autocomplete", "Dropdown", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, "LineCount", PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
},
new Object[]
{
@@ -899,7 +900,7 @@ public abstract class WebWizardDialog extends WizardDialog implements WebWizardC
/*for (int i = 0; i<8; i++)
imgIconsPrev[i] = insertImage("imgIconPrev" + i,
- new String[] { "BackgroundColor","Border","Height","ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "Tabstop", "Width"},
+ new String[] { "BackgroundColor","Border",PropertyNames.PROPERTY_HEIGHT,PropertyNames.PROPERTY_IMAGEURL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", PropertyNames.PROPERTY_STEP, "Tabstop", PropertyNames.PROPERTY_WIDTH},
new Object[] { new Integer(-1), new Short((short)0),new Integer(14),"file:///c:/bludisk.gif", new Integer(97 + i * 20 + 7 ),new Integer(147),Boolean.FALSE,INTEGERS[5],Boolean.FALSE,new Integer(14)});
*/
}
diff --git a/wizards/com/sun/star/wizards/web/data/CGDocument.java b/wizards/com/sun/star/wizards/web/data/CGDocument.java
index 177355612675..765e49d1f6ee 100644
--- a/wizards/com/sun/star/wizards/web/data/CGDocument.java
+++ b/wizards/com/sun/star/wizards/web/data/CGDocument.java
@@ -46,6 +46,7 @@ import com.sun.star.wizards.common.Desktop;
import com.sun.star.wizards.common.FileAccess;
import com.sun.star.wizards.common.JavaTools;
import com.sun.star.wizards.common.Properties;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.common.XMLHelper;
import com.sun.star.wizards.common.XMLProvider;
import com.sun.star.wizards.document.OfficeDocument;
@@ -236,7 +237,7 @@ public class CGDocument extends ConfigSetItem implements XMLProvider
}
String media = (mediaDesc == null)
- ? "" : (String) Properties.getPropertyValue(mediaDescriptor, "Name");
+ ? "" : (String) Properties.getPropertyValue(mediaDescriptor, PropertyNames.PROPERTY_NAME);
appType = getDocType(media);
//System.out.println(appType);
diff --git a/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java b/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java
index 07a79e15040e..698bf7f44c53 100644
--- a/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java
+++ b/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java
@@ -28,6 +28,7 @@ package com.sun.star.wizards.web.export;
import com.sun.star.io.IOException;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.wizards.common.PropertyNames;
import com.sun.star.wizards.ui.event.Task;
import com.sun.star.wizards.web.data.CGDocument;
import com.sun.star.wizards.web.data.CGSession;
@@ -61,7 +62,7 @@ public class ImpressHTMLExporter extends ConfiguredExporter
props.put("HomepageURL", getHomepageURL(session));
props.put("UserText", source.cp_Title);
- props.put("Width", getImageWidth(session));
+ props.put(PropertyNames.PROPERTY_WIDTH, getImageWidth(session));
/*
* props.put("BackColor",...);
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx
index 99602ceab924..d7f6c005a5c4 100644
--- a/writerfilter/inc/dmapper/DomainMapper.hxx
+++ b/writerfilter/inc/dmapper/DomainMapper.hxx
@@ -28,7 +28,7 @@
#define INCLUDED_DOMAINMAPPER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/text/FontEmphasis.hpp>
#include <com/sun/star/style/TabAlign.hpp>
@@ -77,8 +77,8 @@ enum SourceDocumentType
DOCUMENT_OOXML,
DOCUMENT_RTF
};
-class WRITERFILTER_DLLPUBLIC DomainMapper : public Properties, public Table,
- public BinaryObj, public Stream
+class WRITERFILTER_DLLPUBLIC DomainMapper : public LoggedProperties, public LoggedTable,
+ public BinaryObj, public LoggedStream
{
DomainMapper_Impl *m_pImpl;
@@ -89,38 +89,14 @@ public:
SourceDocumentType eDocumentType );
virtual ~DomainMapper();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+ // Stream
+ virtual void markLastParagraphInSection();
// BinaryObj
virtual void data(const sal_uInt8* buf, size_t len,
writerfilter::Reference<Properties>::Pointer_t ref);
- // Stream
- virtual void startSectionGroup();
- virtual void endSectionGroup();
- virtual void startParagraphGroup();
- virtual void endParagraphGroup();
- virtual void markLastParagraphInSection();
- virtual void startCharacterGroup();
- virtual void endCharacterGroup();
- virtual void startShape( ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
- virtual void endShape( );
-
- virtual void text(const sal_uInt8 * data, size_t len);
- virtual void utext(const sal_uInt8 * data, size_t len);
- virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
- virtual void table(Id name,
- writerfilter::Reference<Table>::Pointer_t ref);
- virtual void substream(Id name,
- ::writerfilter::Reference<Stream>::Pointer_t ref);
- virtual void info(const string & info);
-
- void sprm( Sprm& sprm, ::boost::shared_ptr<PropertyMap> pContext, SprmType = SPRM_DEFAULT );
+ void sprmWithProps( Sprm& sprm, ::boost::shared_ptr<PropertyMap> pContext, SprmType = SPRM_DEFAULT );
void PushStyleSheetProperties( ::boost::shared_ptr<PropertyMap> pStyleProperties, bool bAffectTableMngr = false );
void PopStyleSheetProperties( bool bAffectTableMngr = false );
@@ -138,6 +114,32 @@ public:
boost::shared_ptr< StyleSheetTable > GetStyleSheetTable( );
private:
+ // Stream
+ virtual void lcl_startSectionGroup();
+ virtual void lcl_endSectionGroup();
+ virtual void lcl_startParagraphGroup();
+ virtual void lcl_endParagraphGroup();
+ virtual void lcl_startCharacterGroup();
+ virtual void lcl_endCharacterGroup();
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
+ virtual void lcl_endShape( );
+
+ virtual void lcl_text(const sal_uInt8 * data, size_t len);
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len);
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_table(Id name,
+ writerfilter::Reference<Table>::Pointer_t ref);
+ virtual void lcl_substream(Id name,
+ ::writerfilter::Reference<Stream>::Pointer_t ref);
+ virtual void lcl_info(const string & info);
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
void handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext);
void handleParaJustification(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext, const bool bExchangeLeftRight);
bool getColorFromIndex(const sal_Int32 nIndex, sal_Int32 &nColor);
diff --git a/writerfilter/inc/resourcemodel/Fraction.hxx b/writerfilter/inc/resourcemodel/Fraction.hxx
new file mode 100644
index 000000000000..a038d25c98f1
--- /dev/null
+++ b/writerfilter/inc/resourcemodel/Fraction.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 INCLUDED_FRACTION_HXX
+#define INCLUDED_FRACTION_HXX
+
+#include <sal/types.h>
+
+namespace writerfilter {
+namespace resourcemodel {
+
+class Fraction
+{
+public:
+ explicit Fraction(sal_Int32 nNumerator, sal_Int32 nDenominator = 1);
+ explicit Fraction(const Fraction & a, const Fraction & b);
+ virtual ~Fraction();
+
+ void init(sal_Int32 nNumerator, sal_Int32 nDenominator);
+ void assign(const Fraction & rFraction);
+
+ Fraction inverse() const;
+
+ Fraction operator=(const Fraction & rFraction);
+ Fraction operator+(const Fraction & rFraction) const;
+ Fraction operator-(const Fraction & rFraction) const;
+ Fraction operator*(const Fraction & rFraction) const;
+ Fraction operator/(const Fraction & rFraction) const;
+ operator sal_Int32() const;
+ operator float() const;
+
+private:
+ sal_Int32 mnNumerator;
+ sal_Int32 mnDenominator;
+};
+}}
+#endif // INCLUDED_FRACTION_HXX
diff --git a/writerfilter/inc/resourcemodel/LoggedResources.hxx b/writerfilter/inc/resourcemodel/LoggedResources.hxx
new file mode 100644
index 000000000000..be30c32fd85e
--- /dev/null
+++ b/writerfilter/inc/resourcemodel/LoggedResources.hxx
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_LOGGED_RESOURCES_HXX
+#define INCLUDED_LOGGED_RESOURCES_HXX
+
+#include "WW8ResourceModel.hxx"
+#include "TagLogger.hxx"
+
+namespace writerfilter
+{
+
+class LoggedResourcesHelper
+{
+public:
+ explicit LoggedResourcesHelper(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedResourcesHelper();
+
+ void startElement(const string & sElement);
+ void endElement(const string & sElement);
+ void chars(const ::rtl::OUString & rChars);
+ void chars(const string & rChars);
+ void attribute(const string & rName, const string & rValue);
+ void attribute(const string & rName, sal_uInt32 nValue);
+
+ void setPrefix(const string & rPrefix);
+
+private:
+ TagLogger::Pointer_t mpLogger;
+ string msPrefix;
+};
+
+class LoggedStream : public Stream
+{
+public:
+ explicit LoggedStream(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedStream();
+
+ void startSectionGroup();
+ void endSectionGroup();
+ void startParagraphGroup();
+ void endParagraphGroup();
+ void startCharacterGroup();
+ void endCharacterGroup();
+ void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ void endShape();
+ void text(const sal_uInt8 * data, size_t len);
+ void utext(const sal_uInt8 * data, size_t len);
+ void props(writerfilter::Reference<Properties>::Pointer_t ref);
+ void table(Id name, writerfilter::Reference<Table>::Pointer_t ref);
+ void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref);
+ void info(const string & info);
+
+protected:
+ virtual void lcl_startSectionGroup() = 0;
+ virtual void lcl_endSectionGroup() = 0;
+ virtual void lcl_startParagraphGroup() = 0;
+ virtual void lcl_endParagraphGroup() = 0;
+ virtual void lcl_startCharacterGroup() = 0;
+ virtual void lcl_endCharacterGroup() = 0;
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) = 0;
+ virtual void lcl_endShape() = 0;
+ virtual void lcl_text(const sal_uInt8 * data, size_t len) = 0;
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len) = 0;
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref) = 0;
+ virtual void lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref) = 0;
+ virtual void lcl_substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) = 0;
+ virtual void lcl_info(const string & info) = 0;
+
+ LoggedResourcesHelper mHelper;
+};
+
+class LoggedProperties : public Properties
+{
+public:
+ explicit LoggedProperties(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedProperties();
+
+ void attribute(Id name, Value & val);
+ void sprm(Sprm & sprm);
+
+protected:
+ virtual void lcl_attribute(Id name, Value & val) = 0;
+ virtual void lcl_sprm(Sprm & sprm) = 0;
+
+ LoggedResourcesHelper mHelper;
+};
+
+class LoggedTable : public Table
+{
+public:
+ explicit LoggedTable(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedTable();
+
+ void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
+protected:
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) = 0;
+
+ LoggedResourcesHelper mHelper;
+};
+
+}
+#endif // INCLUDED_LOGGED_RESOURCES_HXX
diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx
index 055656832761..a2c8290e0c4b 100644
--- a/writerfilter/inc/resourcemodel/TagLogger.hxx
+++ b/writerfilter/inc/resourcemodel/TagLogger.hxx
@@ -28,8 +28,6 @@
#ifndef INCLUDED_TAG_LOGGER_HXX
#define INCLUDED_TAG_LOGGER_HXX
-#ifdef DEBUG
-
#include <rtl/ustring.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <WriterFilterDllApi.hxx>
@@ -86,7 +84,7 @@ namespace writerfilter
const string & getTag() const;
string toString() const;
- ostream & output(ostream & o) const;
+ ostream & output(ostream & o, const string & sIndent = "") const;
};
class WRITERFILTER_DLLPUBLIC TagLogger
@@ -139,8 +137,7 @@ namespace writerfilter
IdToString::Pointer_t mpIdToString;
public:
- PropertySetToTagHandler(IdToString::Pointer_t pIdToString)
- : mpTag(new XMLTag("propertyset")), mpIdToString(pIdToString) {}
+ PropertySetToTagHandler(IdToString::Pointer_t pIdToString);
virtual ~PropertySetToTagHandler();
XMLTag::Pointer_t getTag() const { return mpTag; }
@@ -155,5 +152,4 @@ namespace writerfilter
WRITERFILTER_DLLPUBLIC XMLTag::Pointer_t unoPropertySetToTag(uno::Reference<beans::XPropertySet> rPropSet);
}
-#endif // DEBUG
#endif // INCLUDED_TAG_LOGGER_HXX
diff --git a/writerfilter/inc/resourcemodel/XPathLogger.hxx b/writerfilter/inc/resourcemodel/XPathLogger.hxx
new file mode 100644
index 000000000000..22e50fc15bb9
--- /dev/null
+++ b/writerfilter/inc/resourcemodel/XPathLogger.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_XPATH_LOGGER_HXX
+#define INCLUDED_XPATH_LOGGER_HXX
+
+#include <hash_map>
+#include <stack>
+#include <string>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <WriterFilterDllApi.hxx>
+
+namespace writerfilter
+{
+using ::std::hash_map;
+using ::std::stack;
+using ::std::string;
+using ::std::vector;
+
+class WRITERFILTER_DLLPUBLIC XPathLogger
+{
+ typedef hash_map<string, unsigned int> TokenMap_t;
+ typedef boost::shared_ptr<TokenMap_t> TokenMapPointer_t;
+
+ TokenMapPointer_t mp_tokenMap;
+ stack<TokenMapPointer_t> m_tokenMapStack;
+ vector<string> m_path;
+ string m_currentPath;
+
+ void updateCurrentPath();
+
+public:
+ explicit XPathLogger();
+ virtual ~XPathLogger();
+
+ string getXPath() const;
+ void startElement(string _token);
+ void endElement();
+};
+}
+#endif // INCLUDED_XPATH_LOGGER_HXX
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docx b/writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docx
new file mode 100644
index 000000000000..6b278175601b
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docx
Binary files differ
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docx b/writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docx
new file mode 100644
index 000000000000..0503327ddecd
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docx
Binary files differ
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docx b/writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docx
new file mode 100644
index 000000000000..719b3888a018
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docx
Binary files differ
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docx b/writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docx
new file mode 100644
index 000000000000..775d63c97b34
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docx
Binary files differ
diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx
index 9fa737f47de2..67f8e65bafb6 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -44,12 +44,13 @@ using namespace ::com::sun::star;
-----------------------------------------------------------------------*/
BorderHandler::BorderHandler( bool bOOXML ) :
- m_nCurrentBorderPosition( BORDER_TOP ),
- m_nLineWidth(0),
- m_nLineType(0),
- m_nLineColor(0),
- m_nLineDistance(0),
- m_bOOXML( bOOXML )
+LoggedProperties(dmapper_logger, "BorderHandler"),
+m_nCurrentBorderPosition( BORDER_TOP ),
+m_nLineWidth(0),
+m_nLineType(0),
+m_nLineColor(0),
+m_nLineDistance(0),
+m_bOOXML( bOOXML )
{
const int nBorderCount(BORDER_COUNT);
std::fill_n(m_aFilledLines, nBorderCount, false);
@@ -64,14 +65,8 @@ BorderHandler::~BorderHandler()
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void BorderHandler::attribute(Id rName, Value & rVal)
+void BorderHandler::lcl_attribute(Id rName, Value & rVal)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("BorderHandler.attribute");
- dmapper_logger->attribute("id", (*QNameToString::Instance())(rName));
- dmapper_logger->endElement("BorderHandler.attribute");
-#endif
-
sal_Int32 nIntValue = rVal.getInt();
/* WRITERFILTERSTATUS: table: BorderHandler_attributedata */
switch( rName )
@@ -123,13 +118,8 @@ void BorderHandler::attribute(Id rName, Value & rVal)
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void BorderHandler::sprm(Sprm & rSprm)
+void BorderHandler::lcl_sprm(Sprm & rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("BorderHandler.sprm");
- dmapper_logger->attribute("sprm", rSprm.toString());
-#endif
-
/* WRITERFILTERSTATUS: table: BorderHandler_sprm */
switch( rSprm.getId())
{
@@ -157,11 +147,6 @@ void BorderHandler::sprm(Sprm & rSprm)
break;
default:;
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("BorderHandler.sprm");
-#endif
-
}
/*-- 24.04.2007 09:09:01---------------------------------------------------
diff --git a/writerfilter/source/dmapper/BorderHandler.hxx b/writerfilter/source/dmapper/BorderHandler.hxx
index 0fc722227191..fe6e3549feba 100644
--- a/writerfilter/source/dmapper/BorderHandler.hxx
+++ b/writerfilter/source/dmapper/BorderHandler.hxx
@@ -28,7 +28,7 @@
#define INCLUDED_BORDERHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/table/BorderLine.hpp>
@@ -36,7 +36,7 @@ namespace writerfilter {
namespace dmapper
{
class PropertyMap;
-class WRITERFILTER_DLLPRIVATE BorderHandler : public Properties
+class WRITERFILTER_DLLPRIVATE BorderHandler : public LoggedProperties
{
public:
//todo: order is a guess
@@ -63,14 +63,14 @@ private:
bool m_aFilledLines[BORDER_COUNT];
::com::sun::star::table::BorderLine m_aBorderLines[BORDER_COUNT];
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
BorderHandler( bool bOOXML );
virtual ~BorderHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
::boost::shared_ptr<PropertyMap> getProperties();
::com::sun::star::table::BorderLine getBorderLine();
sal_Int32 getLineDistance() const { return m_nLineDistance;}
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx
index 2de4554e06dc..f72d4dd0d66b 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -29,6 +29,7 @@
#include <doctok/resourceids.hxx>
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
+#include "dmapperLoggers.hxx"
#define OOXML_COLOR_AUTO 0x0a //todo: AutoColor needs symbol
@@ -43,10 +44,11 @@ using namespace ::writerfilter;
-----------------------------------------------------------------------*/
CellColorHandler::CellColorHandler() :
- m_nShadowType( 0 ),
- m_nColor( 0xffffffff ),
- m_nFillColor( 0xffffffff ),
- m_bParagraph( false )
+LoggedProperties(dmapper_logger, "CellColorHandler"),
+m_nShadowType( 0 ),
+m_nColor( 0xffffffff ),
+m_nFillColor( 0xffffffff ),
+m_bParagraph( false )
{
}
/*-- 24.04.2007 09:06:35---------------------------------------------------
@@ -58,7 +60,7 @@ CellColorHandler::~CellColorHandler()
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void CellColorHandler::attribute(Id rName, Value & rVal)
+void CellColorHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)nIntValue;
@@ -119,7 +121,7 @@ void CellColorHandler::attribute(Id rName, Value & rVal)
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void CellColorHandler::sprm(Sprm & rSprm)
+void CellColorHandler::lcl_sprm(Sprm & rSprm)
{
(void)rSprm;
}
diff --git a/writerfilter/source/dmapper/CellColorHandler.hxx b/writerfilter/source/dmapper/CellColorHandler.hxx
index 3e6b1bb2db70..102449258550 100644
--- a/writerfilter/source/dmapper/CellColorHandler.hxx
+++ b/writerfilter/source/dmapper/CellColorHandler.hxx
@@ -28,7 +28,7 @@
#define INCLUDED_CELLCOLORHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
//#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/BorderLine.hpp>
@@ -37,23 +37,23 @@ namespace writerfilter {
namespace dmapper
{
class TablePropertyMap;
-class WRITERFILTER_DLLPRIVATE CellColorHandler : public Properties
+class WRITERFILTER_DLLPRIVATE CellColorHandler : public LoggedProperties
{
public:
sal_Int32 m_nShadowType;
sal_Int32 m_nColor;
sal_Int32 m_nFillColor;
bool m_bParagraph;
+
private:
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
public:
CellColorHandler( );
virtual ~CellColorHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
::boost::shared_ptr<TablePropertyMap> getProperties();
void setParagraph() { m_bParagraph = true; }
diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx
index bfea8a6b25f9..645755cc4c63 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.cxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.cxx
@@ -29,6 +29,7 @@
#include <doctok/resourceids.hxx>
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
+#include "dmapperLoggers.hxx"
namespace writerfilter {
namespace dmapper {
@@ -41,15 +42,16 @@ using namespace ::writerfilter;
-----------------------------------------------------------------------*/
CellMarginHandler::CellMarginHandler() :
- m_nValue( 0 ),
- m_nLeftMargin( 0 ),
- m_bLeftMarginValid( false ),
- m_nRightMargin( 0 ),
- m_bRightMarginValid( false ),
- m_nTopMargin( 0 ),
- m_bTopMarginValid( false ),
- m_nBottomMargin( 0 ),
- m_bBottomMarginValid( false )
+LoggedProperties(dmapper_logger, "CellMarginHandler"),
+m_nValue( 0 ),
+m_nLeftMargin( 0 ),
+m_bLeftMarginValid( false ),
+m_nRightMargin( 0 ),
+m_bRightMarginValid( false ),
+m_nTopMargin( 0 ),
+m_bTopMarginValid( false ),
+m_nBottomMargin( 0 ),
+m_bBottomMarginValid( false )
{
}
/*-- 18.02.2008 12:36:51---------------------------------------------------
@@ -61,7 +63,7 @@ CellMarginHandler::~CellMarginHandler()
/*-- 18.02.2008 12:36:51---------------------------------------------------
-----------------------------------------------------------------------*/
-void CellMarginHandler::attribute(Id rName, Value & rVal)
+void CellMarginHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)nIntValue;
@@ -82,7 +84,7 @@ void CellMarginHandler::attribute(Id rName, Value & rVal)
/*-- 18.02.2008 12:36:51---------------------------------------------------
-----------------------------------------------------------------------*/
-void CellMarginHandler::sprm(Sprm & rSprm)
+void CellMarginHandler::lcl_sprm(Sprm & rSprm)
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
if( pProperties.get())
diff --git a/writerfilter/source/dmapper/CellMarginHandler.hxx b/writerfilter/source/dmapper/CellMarginHandler.hxx
index 5f01df47a347..3d2512675683 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.hxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.hxx
@@ -30,18 +30,22 @@
#ifndef INCLUDED_WRITERFILTERDLLAPI_H
#include <WriterFilterDllApi.hxx>
#endif
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace writerfilter {
namespace dmapper
{
class TablePropertyMap;
-class WRITERFILTER_DLLPRIVATE CellMarginHandler : public Properties
+class WRITERFILTER_DLLPRIVATE CellMarginHandler : public LoggedProperties
{
private:
sal_Int32 m_nValue;
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
sal_Int32 m_nLeftMargin;
bool m_bLeftMarginValid;
@@ -56,10 +60,6 @@ public:
CellMarginHandler( );
virtual ~CellMarginHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
::boost::shared_ptr<TablePropertyMap> getProperties();
};
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 65dfb4c5fcec..fb36455fcd97 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -86,15 +86,11 @@
#include <vector>
#include <iostream>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/QNameToString.hxx>
-#include <resourcemodel/util.hxx>
-#include <resourcemodel/TagLogger.hxx>
-#endif
#if OSL_DEBUG_LEVEL > 0
#include <resourcemodel/QNameToString.hxx>
#endif
+#include <resourcemodel/TagLogger.hxx>
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -106,9 +102,7 @@ using resourcemodel::resolveAttributeProperties;
namespace dmapper{
-#ifdef DEBUG_DOMAINMAPPER
TagLogger::Pointer_t dmapper_logger(TagLogger::getInstance("DOMAINMAPPER"));
-#endif
/* ---- Fridrich's mess begins here ---- */
struct _PageSz
@@ -129,6 +123,9 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
uno::Reference< io::XInputStream > xInputStream,
uno::Reference< lang::XComponent > xModel,
SourceDocumentType eDocumentType) :
+LoggedProperties(dmapper_logger, "DomainMapper"),
+LoggedTable(dmapper_logger, "DomainMapper"),
+LoggedStream(dmapper_logger, "DomainMapper"),
m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )),
mnBackgroundColor(0), mbIsHighlightSet(false)
{
@@ -193,14 +190,8 @@ DomainMapper::~DomainMapper()
/*-- 09.06.2006 09:52:12---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::attribute(Id nName, Value & val)
+void DomainMapper::lcl_attribute(Id nName, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
- dmapper_logger->attribute("value", val.toString());
- dmapper_logger->endElement("attribute");
-#endif
static ::rtl::OUString sLocalBookmarkName;
sal_Int32 nIntValue = val.getInt();
rtl::OUString sStringValue = val.getString();
@@ -2195,20 +2186,16 @@ void DomainMapper::attribute(Id nName, Value & val)
/*-- 09.06.2006 09:52:12---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::sprm(Sprm & rSprm)
+void DomainMapper::lcl_sprm(Sprm & rSprm)
{
if( !m_pImpl->getTableManager().sprm(rSprm))
- DomainMapper::sprm( rSprm, m_pImpl->GetTopContext() );
+ sprmWithProps( rSprm, m_pImpl->GetTopContext() );
}
/*-- 20.06.2006 09:58:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType )
+void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("DomainMapper.sprm");
- dmapper_logger->chars(rSprm.toString());
-#endif
OSL_ENSURE(rContext.get(), "PropertyMap has to be valid!");
if(!rContext.get())
return ;
@@ -2885,12 +2872,6 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
{
uno::Any aBold( uno::makeAny( nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ) );
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("charWeight");
- dmapper_logger->attribute("weight", nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL);
- dmapper_logger->endElement("charWeight");
-#endif
-
rContext->Insert(ePropertyId, true, aBold );
if( nSprmId != NS_sprm::LN_CFBoldBi ) // sprmCFBoldBi
rContext->Insert(PROP_CHAR_WEIGHT_ASIAN, true, aBold );
@@ -4246,27 +4227,14 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
#endif
}
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->addTag(rContext->toTag());
- dmapper_logger->endElement("DomainMapper.sprm");
-#endif
}
/*-- 09.06.2006 09:52:13---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::entry(int /*pos*/,
+void DomainMapper::lcl_entry(int /*pos*/,
writerfilter::Reference<Properties>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("DomainMapper.entry");
-#endif
-
ref->resolve(*this);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("DomainMapper.entry");
-#endif
}
/*-- 09.06.2006 09:52:13---------------------------------------------------
@@ -4278,17 +4246,14 @@ void DomainMapper::data(const sal_uInt8* /*buf*/, size_t /*len*/,
/*-- 09.06.2006 09:52:13---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::startSectionGroup()
+void DomainMapper::lcl_startSectionGroup()
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("section");
-#endif
m_pImpl->PushProperties(CONTEXT_SECTION);
}
/*-- 09.06.2006 09:52:13---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::endSectionGroup()
+void DomainMapper::lcl_endSectionGroup()
{
PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
@@ -4296,20 +4261,12 @@ void DomainMapper::endSectionGroup()
if(pSectionContext)
pSectionContext->CloseSectionGroup( *m_pImpl );
m_pImpl->PopProperties(CONTEXT_SECTION);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("section");
-#endif
}
/*-- 09.06.2006 09:52:13---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::startParagraphGroup()
+void DomainMapper::lcl_startParagraphGroup()
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("paragraph");
-#endif
-
m_pImpl->getTableManager().startParagraphGroup();
m_pImpl->PushProperties(CONTEXT_PARAGRAPH);
static ::rtl::OUString sDefault( ::rtl::OUString::createFromAscii("Standard") );
@@ -4326,40 +4283,27 @@ void DomainMapper::startParagraphGroup()
/*-- 09.06.2006 09:52:14---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::endParagraphGroup()
+void DomainMapper::lcl_endParagraphGroup()
{
m_pImpl->PopProperties(CONTEXT_PARAGRAPH);
m_pImpl->getTableManager().endParagraphGroup();
//frame conversion has to be executed after table conversion
m_pImpl->ExecuteFrameConversion();
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("paragraph");
-#endif
}
void DomainMapper::markLastParagraphInSection( )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->element( "markLastParagraphInSection" );
-#endif
m_pImpl->SetIsLastParagraphInSection( true );
}
-void DomainMapper::startShape( uno::Reference< drawing::XShape > xShape )
+void DomainMapper::lcl_startShape( uno::Reference< drawing::XShape > xShape )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("shape");
-#endif
m_pImpl->PushShapeContext( xShape );
}
-void DomainMapper::endShape( )
+void DomainMapper::lcl_endShape( )
{
m_pImpl->PopShapeContext( );
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("shape");
-#endif
}
/*-- 13.06.2007 16:15:55---------------------------------------------------
@@ -4401,12 +4345,8 @@ void DomainMapper::PopListProperties()
-----------------------------------------------------------------------*/
-void DomainMapper::startCharacterGroup()
+void DomainMapper::lcl_startCharacterGroup()
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("charactergroup");
-#endif
-
m_pImpl->PushProperties(CONTEXT_CHARACTER);
DomainMapperTableManager& rTableManager = m_pImpl->getTableManager();
if( rTableManager.getTableStyleName().getLength() )
@@ -4418,18 +4358,14 @@ void DomainMapper::startCharacterGroup()
/*-- 09.06.2006 09:52:14---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::endCharacterGroup()
+void DomainMapper::lcl_endCharacterGroup()
{
m_pImpl->PopProperties(CONTEXT_CHARACTER);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("charactergroup");
-#endif
}
/*-- 09.06.2006 09:52:14---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::text(const sal_uInt8 * data_, size_t len)
+void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len)
{
//TODO: Determine the right text encoding (FIB?)
::rtl::OUString sText( (const sal_Char*) data_, len, RTL_TEXTENCODING_MS_1252 );
@@ -4515,19 +4451,13 @@ void DomainMapper::text(const sal_uInt8 * data_, size_t len)
/*-- 09.06.2006 09:52:15---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::utext(const sal_uInt8 * data_, size_t len)
+void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
{
OUString sText;
OUStringBuffer aBuffer = OUStringBuffer(len);
aBuffer.append( (const sal_Unicode *) data_, len);
sText = aBuffer.makeStringAndClear();
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("utext");
- dmapper_logger->chars(sText);
- dmapper_logger->endElement("utext");
-#endif
-
try
{
m_pImpl->getTableManager().utext(data_, len);
@@ -4585,12 +4515,8 @@ void DomainMapper::utext(const sal_uInt8 * data_, size_t len)
/*-- 09.06.2006 09:52:15---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::props(writerfilter::Reference<Properties>::Pointer_t ref)
+void DomainMapper::lcl_props(writerfilter::Reference<Properties>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("props");
-#endif
-
string sType = ref->getType();
if( sType == "PICF" )
{
@@ -4602,21 +4528,12 @@ void DomainMapper::props(writerfilter::Reference<Properties>::Pointer_t ref)
}
else
ref->resolve(*this);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("props");
-#endif
}
/*-- 09.06.2006 09:52:15---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
+void DomainMapper::lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("table");
- dmapper_logger->attribute("id", (*QNameToString::Instance())(name));
-#endif
-
// printf ( "DomainMapper::table(0x%.4x)\n", (unsigned int)name);
m_pImpl->SetAnyTableImport(true);
/* WRITERFILTERSTATUS: table: attributedata */
@@ -4666,20 +4583,12 @@ void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
OSL_ENSURE( false, "which table is to be filled here?");
}
m_pImpl->SetAnyTableImport(false);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("table");
-#endif
}
/*-- 09.06.2006 09:52:16---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
+void DomainMapper::lcl_substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("substream");
-#endif
-
m_pImpl->appendTableManager( );
m_pImpl->getTableManager().startLevel();
@@ -4751,15 +4660,11 @@ void DomainMapper::substream(Id rName, ::writerfilter::Reference<Stream>::Pointe
m_pImpl->getTableManager().endLevel();
m_pImpl->popTableManager( );
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("substream");
-#endif
}
/*-- 09.06.2006 09:52:16---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper::info(const string & /*info_*/)
+void DomainMapper::lcl_info(const string & /*info_*/)
{
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 958a96fbff7d..c6869aca5f2b 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <dmapperLoggers.hxx>
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
#include <PropertyMapHelper.hxx>
#endif
@@ -45,7 +45,7 @@ using namespace ::std;
#define DEF_BORDER_DIST 190 //0,19cm
#define DEFAULT_CELL_MARGIN 108 //default cell margin, not documented
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
static void lcl_printProperties( PropertyMapPtr pProps )
{
if( pProps.get() )
@@ -104,7 +104,7 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
m_pTableSeq = TableSequencePointer_t(new TableSequence_t(nRows));
m_nRowIndex = 0;
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("tablehandler.table");
dmapper_logger->attribute("rows", nRows);
@@ -118,11 +118,6 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
-----------------------------------------------------------------------*/
PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntryPtr pStyleSheet, StyleSheetTablePtr pStyleSheetTable)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("lcl_SearchParentStyleSheetAndMergeProperties");
- dmapper_logger->addTag(pStyleSheet->toTag());
-#endif
-
PropertyMapPtr pRet;
if( pStyleSheet->sBaseStyleIdentifier.getLength())
{
@@ -136,10 +131,6 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr
pRet->insert( pStyleSheet->pProperties, true );
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("lcl_SearchParentStyleSheetAndMergeProperties");
-#endif
-
return pRet;
}
@@ -241,7 +232,7 @@ void lcl_computeCellBorders( PropertyMapPtr pTableBorders, PropertyMapPtr pCellP
}
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
void lcl_debug_BorderLine(table::BorderLine & rLine)
{
@@ -334,7 +325,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
PropertyMapPtr pMergedProperties = lcl_SearchParentStyleSheetAndMergeProperties(pStyleSheet, pStyleSheetTable);
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("mergedProps");
dmapper_logger->addTag(pMergedProperties->toTag());
dmapper_logger->endElement("mergedProps");
@@ -343,7 +334,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
m_aTableProperties->insert( pMergedProperties );
m_aTableProperties->insert( pTableProps );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("TableProperties");
dmapper_logger->addTag(m_aTableProperties->toTag());
dmapper_logger->endElement("TableProperties");
@@ -354,7 +345,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
// Set the table default attributes for the cells
rInfo.pTableDefaults->insert( m_aTableProperties );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("TableDefaults");
dmapper_logger->addTag(rInfo.pTableDefaults->toTag());
dmapper_logger->endElement("TableDefaults");
@@ -472,7 +463,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
m_aTableProperties->Insert( PROP_TABLE_BORDER, false, uno::makeAny( aTableBorder ) );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
lcl_debug_TableBorder(aTableBorder);
#endif
@@ -501,7 +492,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
rInfo.aTableProperties = m_aTableProperties->GetPropertyValues();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("debug.tableprops");
dmapper_logger->addTag(m_aTableProperties->toTag());
dmapper_logger->endElement("debug.tableprops");
@@ -514,7 +505,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(TableInfo & rInfo)
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("getCellProperties");
#endif
@@ -593,7 +584,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
pAllCellProps->insert( *aCellIterator );
aCellIterator->get( )->swap( *pAllCellProps.get( ) );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("cell");
dmapper_logger->attribute("cell", nCell);
dmapper_logger->attribute("row", nRow);
@@ -626,14 +617,14 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
uno::makeAny((sal_Int32) rInfo.nBottomBorderDistance ) );
pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement("cell");
#endif
}
++nCell;
++aCellIterator;
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
//-->debug cell properties
{
::rtl::OUString sNames;
@@ -660,7 +651,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
++aRowOfCellsIterator;
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement("getCellProperties");
#endif
@@ -669,7 +660,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("getRowProperties");
#endif
@@ -679,7 +670,7 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
sal_Int32 nRow = 0;
while( aRowIter != aRowIterEnd )
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("rowProps.row");
#endif
if( aRowIter->get() )
@@ -689,19 +680,19 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
aRowIter->get()->Insert( PROP_IS_SPLIT_ALLOWED, false, uno::makeAny(sal_True ) );
aRowProperties[nRow] = (*aRowIter)->GetPropertyValues();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->addTag((*aRowIter)->toTag());
dmapper_logger->addTag(lcl_PropertyValuesToTag(aRowProperties[nRow]));
#endif
}
++nRow;
++aRowIter;
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement("rowProps.row");
#endif
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement("getRowProperties");
#endif
@@ -710,7 +701,7 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
void DomainMapperTableHandler::endTable()
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("tablehandler.endTable");
#endif
@@ -722,7 +713,7 @@ void DomainMapperTableHandler::endTable()
RowPropertyValuesSeq_t aRowProperties = endTableGetRowProperties();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->addTag(lcl_PropertyValueSeqToTag(aRowProperties));
#endif
@@ -739,25 +730,25 @@ void DomainMapperTableHandler::endTable()
}
catch (lang::IllegalArgumentException e)
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->chars("failed to import table!");
#endif
}
-#ifdef DEBUG_DOMAINMAPPER
catch ( uno::Exception e )
{
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("exception");
dmapper_logger->chars(rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ));
dmapper_logger->endElement("exeception");
- }
#endif
+ }
}
m_aTableProperties.reset();
m_aCellProperties.clear();
m_aRowProperties.clear();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement("tablehandler.endTable");
dmapper_logger->endElement("tablehandler.table");
#endif
@@ -769,7 +760,7 @@ void DomainMapperTableHandler::startRow(unsigned int nCells,
m_aRowProperties.push_back( pProps );
m_aCellProperties.push_back( PropertyMapVector1() );
-#if DEBUG_DOMAINMAPPER
+#if DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("table.row");
dmapper_logger->attribute("cells", nCells);
if (pProps != NULL)
@@ -785,7 +776,7 @@ void DomainMapperTableHandler::endRow()
(*m_pTableSeq)[m_nRowIndex] = *m_pRowSeq;
++m_nRowIndex;
m_nCellIndex = 0;
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement("table.row");
#endif
}
@@ -804,7 +795,7 @@ void DomainMapperTableHandler::startCell(const Handle_t & start,
m_aCellProperties[nRow - 1].push_back( pEmptyProps );
}
-#if DEBUG_DOMAINMAPPER
+#if DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("table.cell");
dmapper_logger->startElement("table.cell.start");
dmapper_logger->chars(toString(start));
@@ -824,7 +815,7 @@ void DomainMapperTableHandler::startCell(const Handle_t & start,
void DomainMapperTableHandler::endCell(const Handle_t & end)
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("table.cell.end");
dmapper_logger->chars(toString(end));
dmapper_logger->endElement("table.cell.end");
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 301774dc2b96..11d03655b5db 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -627,10 +627,9 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->attribute("isTextAppend", xTextAppend.is());
- dmapper_logger->attribute("isIgnor", getTableManager().isIgnore());
#endif
- if(xTextAppend.is() && ! getTableManager( ).isIgnore())
+ if(xTextAppend.is() && ! getTableManager( ).isIgnore() && pParaContext != NULL)
{
try
{
@@ -649,7 +648,10 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
old _and_ new DropCap must not occur
*/
- bool bIsDropCap = pParaContext->IsFrameMode() && sal::static_int_cast<Id>(pParaContext->GetDropCap()) != NS_ooxml::LN_Value_wordprocessingml_ST_DropCap_none;
+ bool bIsDropCap =
+ pParaContext->IsFrameMode() &&
+ sal::static_int_cast<Id>(pParaContext->GetDropCap()) != NS_ooxml::LN_Value_wordprocessingml_ST_DropCap_none;
+
style::DropCapFormat aDrop;
ParagraphPropertiesPtr pToBeSavedProperties;
bool bKeepLastParagraphProperties = false;
diff --git a/writerfilter/source/dmapper/FFDataHandler.cxx b/writerfilter/source/dmapper/FFDataHandler.cxx
index 9f9430401161..6decd84d2786 100644
--- a/writerfilter/source/dmapper/FFDataHandler.cxx
+++ b/writerfilter/source/dmapper/FFDataHandler.cxx
@@ -30,10 +30,8 @@
#include "FFDataHandler.hxx"
#include <ooxml/resourceids.hxx>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/QNameToString.hxx>
#include "dmapperLoggers.hxx"
-#endif
+
namespace writerfilter {
namespace dmapper {
@@ -41,17 +39,18 @@ namespace dmapper {
* class: FFDataHandler *
************************/
-FFDataHandler::FFDataHandler()
-: m_bEnabled(false),
- m_bCalcOnExit(false),
- m_nHelpTextType(0),
- m_nStatusTextType(0),
- m_nCheckboxHeight(0),
- m_bCheckboxAutoHeight(false),
- m_bCheckboxDefault(false),
- m_bCheckboxChecked(false),
- m_nTextType(0),
- m_nTextMaxLength(0)
+FFDataHandler::FFDataHandler() :
+LoggedProperties(dmapper_logger, "FFDataHandler"),
+m_bEnabled(false),
+m_bCalcOnExit(false),
+m_nHelpTextType(0),
+m_nStatusTextType(0),
+m_nCheckboxHeight(0),
+m_bCheckboxAutoHeight(false),
+m_bCheckboxDefault(false),
+m_bCheckboxChecked(false),
+m_nTextType(0),
+m_nTextMaxLength(0)
{
}
@@ -286,12 +285,8 @@ const rtl::OUString & FFDataHandler::getTextFormat() const
}
-void FFDataHandler::sprm(Sprm & r_Sprm)
+void FFDataHandler::lcl_sprm(Sprm & r_Sprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("FFDataHandler.sprm");
- dmapper_logger->chars(r_Sprm.toString());
-#endif
switch(r_Sprm.getId())
{
case NS_ooxml::LN_CT_FFData_name:
@@ -426,9 +421,6 @@ void FFDataHandler::sprm(Sprm & r_Sprm)
#endif
break;
}
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("FFDataHandler.sprm");
-#endif
}
void FFDataHandler::resolveSprm(Sprm & r_Sprm)
@@ -438,14 +430,8 @@ void FFDataHandler::resolveSprm(Sprm & r_Sprm)
pProperties->resolve(*this);
}
-void FFDataHandler::attribute(Id name, Value & val)
+void FFDataHandler::lcl_attribute(Id name, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("FFDataHandler.attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(name));
- dmapper_logger->attribute("value", val.toString());
- dmapper_logger->endElement("FFDataHandler.attribute");
-#endif
switch (name)
{
case NS_ooxml::LN_CT_FFHelpText_type:
diff --git a/writerfilter/source/dmapper/FFDataHandler.hxx b/writerfilter/source/dmapper/FFDataHandler.hxx
index fb7a4ccee950..b1c7ff2ea7fb 100644
--- a/writerfilter/source/dmapper/FFDataHandler.hxx
+++ b/writerfilter/source/dmapper/FFDataHandler.hxx
@@ -29,11 +29,11 @@
************************************************************************/
#ifndef INCLUDED_FFDataHandler_HXX
#define INCLUDED_FFDataHandler_HXX
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <rtl/ustring.hxx>
namespace writerfilter {
namespace dmapper {
-class FFDataHandler : public Properties
+class FFDataHandler : public LoggedProperties
{
public:
// typedefs
@@ -127,12 +127,8 @@ public:
const rtl::OUString & getTextFormat() const;
// sprm
- void sprm(Sprm & r_sprm);
void resolveSprm(Sprm & r_sprm);
- // attribute
- void attribute(Id name, Value & val);
-
private:
rtl::OUString m_sName;
bool m_bEnabled;
@@ -154,6 +150,12 @@ private:
sal_uInt32 m_nTextMaxLength;
rtl::OUString m_sTextDefault;
rtl::OUString m_sTextFormat;
+
+ // sprm
+ void lcl_sprm(Sprm & r_sprm);
+
+ // attribute
+ void lcl_attribute(Id name, Value & val);
};
diff --git a/writerfilter/source/dmapper/FontTable.cxx b/writerfilter/source/dmapper/FontTable.cxx
index 4bde0ac275b5..fd6f15660557 100644
--- a/writerfilter/source/dmapper/FontTable.cxx
+++ b/writerfilter/source/dmapper/FontTable.cxx
@@ -33,6 +33,8 @@
#include <vector>
#include <stdio.h>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper
{
@@ -46,8 +48,11 @@ struct FontTable_Impl
/*-- 19.06.2006 12:04:32---------------------------------------------------
-----------------------------------------------------------------------*/
-FontTable::FontTable() :
- m_pImpl( new FontTable_Impl )
+FontTable::FontTable()
+: LoggedProperties(dmapper_logger, "FontTable")
+, LoggedTable(dmapper_logger, "FontTable")
+, LoggedStream(dmapper_logger, "FontTable")
+, m_pImpl( new FontTable_Impl )
{
}
/*-- 19.06.2006 12:04:33---------------------------------------------------
@@ -60,7 +65,7 @@ FontTable::~FontTable()
/*-- 19.06.2006 12:04:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::attribute(Id Name, Value & val)
+void FontTable::lcl_attribute(Id Name, Value & val)
{
OSL_ENSURE( m_pImpl->pCurrentEntry, "current entry has to be set here");
if(!m_pImpl->pCurrentEntry)
@@ -533,7 +538,7 @@ void FontTable::attribute(Id Name, Value & val)
/*-- 19.06.2006 12:04:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::sprm(Sprm& rSprm)
+void FontTable::lcl_sprm(Sprm& rSprm)
{
OSL_ENSURE( m_pImpl->pCurrentEntry, "current entry has to be set here");
if(!m_pImpl->pCurrentEntry)
@@ -561,7 +566,7 @@ void FontTable::sprm(Sprm& rSprm)
/*-- 19.06.2006 12:04:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void FontTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
//create a new font entry
OSL_ENSURE( !m_pImpl->pCurrentEntry, "current entry has to be NULL here");
@@ -574,81 +579,81 @@ void FontTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_
/*-- 19.06.2006 12:04:34---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::startSectionGroup()
+void FontTable::lcl_startSectionGroup()
{
}
/*-- 19.06.2006 12:04:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::endSectionGroup()
+void FontTable::lcl_endSectionGroup()
{
}
/*-- 19.06.2006 12:04:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::startParagraphGroup()
+void FontTable::lcl_startParagraphGroup()
{
}
/*-- 19.06.2006 12:04:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::endParagraphGroup()
+void FontTable::lcl_endParagraphGroup()
{
}
/*-- 19.06.2006 12:04:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::startCharacterGroup()
+void FontTable::lcl_startCharacterGroup()
{
}
/*-- 19.06.2006 12:04:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::endCharacterGroup()
+void FontTable::lcl_endCharacterGroup()
{
}
/*-- 19.06.2006 12:04:36---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::text(const sal_uInt8*, size_t )
+void FontTable::lcl_text(const sal_uInt8*, size_t )
{
}
/*-- 19.06.2006 12:04:36---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::utext(const sal_uInt8* , size_t)
+void FontTable::lcl_utext(const sal_uInt8* , size_t)
{
}
/*-- 19.06.2006 12:04:37---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::props(writerfilter::Reference<Properties>::Pointer_t)
+void FontTable::lcl_props(writerfilter::Reference<Properties>::Pointer_t)
{
}
/*-- 19.06.2006 12:04:37---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::table(Id, writerfilter::Reference<Table>::Pointer_t)
+void FontTable::lcl_table(Id, writerfilter::Reference<Table>::Pointer_t)
{
}
/*-- 19.06.2006 12:04:38---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::substream(Id, ::writerfilter::Reference<Stream>::Pointer_t)
+void FontTable::lcl_substream(Id, ::writerfilter::Reference<Stream>::Pointer_t)
{
}
/*-- 19.06.2006 12:04:39---------------------------------------------------
-----------------------------------------------------------------------*/
-void FontTable::info(const string& )
+void FontTable::lcl_info(const string& )
{
}
-void FontTable::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > )
+void FontTable::lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > )
{
}
-void FontTable::endShape( )
+void FontTable::lcl_endShape( )
{
}
diff --git a/writerfilter/source/dmapper/FontTable.hxx b/writerfilter/source/dmapper/FontTable.hxx
index a2fa967d85fe..cc8e9458f7da 100644
--- a/writerfilter/source/dmapper/FontTable.hxx
+++ b/writerfilter/source/dmapper/FontTable.hxx
@@ -30,7 +30,7 @@
#include <boost/shared_ptr.hpp>
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
namespace writerfilter {
@@ -62,46 +62,45 @@ struct FontEntry
nAltFontIndex( 0 )
{}
};
-class WRITERFILTER_DLLPRIVATE FontTable : public Properties, public Table
- /*,public BinaryObj*/, public Stream
+
+class WRITERFILTER_DLLPRIVATE FontTable : public LoggedProperties, public LoggedTable
+ /*,public BinaryObj*/, public LoggedStream
{
FontTable_Impl *m_pImpl;
-public:
+ public:
FontTable();
virtual ~FontTable();
+ sal_uInt32 size();
+ const FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex);
+
+ private:
// Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
// Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
- // BinaryObj
-// virtual void data(const sal_Int8* buf, size_t len,
-// writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
// Stream
- virtual void startSectionGroup();
- virtual void endSectionGroup();
- virtual void startParagraphGroup();
- virtual void endParagraphGroup();
- virtual void startCharacterGroup();
- virtual void endCharacterGroup();
- virtual void text(const sal_uInt8 * data, size_t len);
- virtual void utext(const sal_uInt8 * data, size_t len);
- virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
- virtual void table(Id name,
- writerfilter::Reference<Table>::Pointer_t ref);
- virtual void substream(Id name,
- ::writerfilter::Reference<Stream>::Pointer_t ref);
- virtual void info(const string & info);
- virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
- virtual void endShape( );
+ virtual void lcl_startSectionGroup();
+ virtual void lcl_endSectionGroup();
+ virtual void lcl_startParagraphGroup();
+ virtual void lcl_endParagraphGroup();
+ virtual void lcl_startCharacterGroup();
+ virtual void lcl_endCharacterGroup();
+ virtual void lcl_text(const sal_uInt8 * data, size_t len);
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len);
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_table(Id name,
+ writerfilter::Reference<Table>::Pointer_t ref);
+ virtual void lcl_substream(Id name,
+ ::writerfilter::Reference<Stream>::Pointer_t ref);
+ virtual void lcl_info(const string & info);
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void lcl_endShape( );
- const FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex);
- sal_uInt32 size();
};
typedef boost::shared_ptr< FontTable > FontTablePtr;
}}
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index c77f2dd55d3e..76ef4c7257ff 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -8,6 +8,8 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
+#include "dmapperLoggers.hxx"
+
#include <iostream>
using namespace std;
@@ -17,7 +19,7 @@ namespace dmapper {
using namespace com::sun::star;
PositionHandler::PositionHandler( ) :
- Properties( )
+LoggedProperties(dmapper_logger, "PositionHandler")
{
m_nOrient = text::VertOrientation::NONE;
m_nRelation = text::RelOrientation::FRAME;
@@ -28,7 +30,7 @@ PositionHandler::~PositionHandler( )
{
}
-void PositionHandler::attribute( Id aName, Value& rVal )
+void PositionHandler::lcl_attribute( Id aName, Value& rVal )
{
sal_Int32 nIntValue = rVal.getInt( );
switch ( aName )
@@ -85,11 +87,15 @@ void PositionHandler::attribute( Id aName, Value& rVal )
}
}
break;
- default:;
+ default:
+#ifdef DEBUG_DOMAINMAPPER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
}
}
-void PositionHandler::sprm( Sprm& rSprm )
+void PositionHandler::lcl_sprm( Sprm& rSprm )
{
Value::Pointer_t pValue = rSprm.getValue();
sal_Int32 nIntValue = pValue->getInt();
@@ -153,12 +159,16 @@ void PositionHandler::sprm( Sprm& rSprm )
case NS_ooxml::LN_CT_PosH_posOffset:
case NS_ooxml::LN_CT_PosV_posOffset:
m_nPosition = ConversionHelper::convertEMUToMM100( nIntValue );
- default:;
+ default:
+#ifdef DEBUG_DOMAINMAPPER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
}
}
WrapHandler::WrapHandler( ) :
- Properties( ),
+LoggedProperties(dmapper_logger, "WrapHandler"),
m_nType( 0 ),
m_nSide( 0 )
{
@@ -168,7 +178,7 @@ WrapHandler::~WrapHandler( )
{
}
-void WrapHandler::attribute( Id aName, Value& rVal )
+void WrapHandler::lcl_attribute( Id aName, Value& rVal )
{
switch ( aName )
{
@@ -182,7 +192,7 @@ void WrapHandler::attribute( Id aName, Value& rVal )
}
}
-void WrapHandler::sprm( Sprm& )
+void WrapHandler::lcl_sprm( Sprm& )
{
}
diff --git a/writerfilter/source/dmapper/GraphicHelpers.hxx b/writerfilter/source/dmapper/GraphicHelpers.hxx
index fb8f8b2455ee..7127ccf22c1f 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.hxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.hxx
@@ -4,7 +4,7 @@
#include "PropertyMap.hxx"
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
@@ -12,7 +12,7 @@ namespace writerfilter {
namespace dmapper
{
-class WRITERFILTER_DLLPRIVATE PositionHandler: public Properties
+class WRITERFILTER_DLLPRIVATE PositionHandler: public LoggedProperties
{
public:
PositionHandler( );
@@ -22,12 +22,13 @@ public:
sal_Int16 m_nRelation;
sal_Int32 m_nPosition;
- virtual void attribute( Id aName, Value& rVal );
- virtual void sprm( Sprm& rSprm );
+ private:
+ virtual void lcl_attribute( Id aName, Value& rVal );
+ virtual void lcl_sprm( Sprm& rSprm );
};
typedef boost::shared_ptr<PositionHandler> PositionHandlerPtr;
-class WRITERFILTER_DLLPRIVATE WrapHandler: public Properties
+class WRITERFILTER_DLLPRIVATE WrapHandler: public LoggedProperties
{
public:
WrapHandler( );
@@ -38,8 +39,9 @@ public:
sal_Int32 getWrapMode( );
- virtual void attribute( Id aName, Value& rVal );
- virtual void sprm( Sprm& rSprm );
+ private:
+ virtual void lcl_attribute( Id aName, Value& rVal );
+ virtual void lcl_sprm( Sprm& rSprm );
};
typedef boost::shared_ptr<WrapHandler> WrapHandlerPtr;
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 14a54c640626..beae39a68a29 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -25,54 +25,51 @@
*
************************************************************************/
-#include "GraphicImport.hxx"
-#include "GraphicHelpers.hxx"
+#include <string.h>
-#include <dmapper/DomainMapper.hxx>
-#include <PropertyMap.hxx>
-#include <doctok/resourceids.hxx>
-#include <ooxml/resourceids.hxx>
-#include <ConversionHelper.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/drawing/ColorMode.hpp>
-
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/table/BorderLine.hpp>
#include <com/sun/star/text/GraphicCrop.hpp>
-#include <com/sun/star/text/XTextContent.hpp>
-#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
-#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/ustrbuf.hxx>
-#include <iostream>
-#include <resourcemodel/QNameToString.hxx>
-#include <string.h>
+#include <dmapper/DomainMapper.hxx>
+#include <doctok/resourceids.hxx>
+#include <ooxml/resourceids.hxx>
+#include <resourcemodel/ResourceModelHelper.hxx>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/TagLogger.hxx>
-#endif
+#include "ConversionHelper.hxx"
+#include "GraphicHelpers.hxx"
+#include "GraphicImport.hxx"
+#include "PropertyMap.hxx"
+#include "WrapPolygonHandler.hxx"
+#include "dmapperLoggers.hxx"
namespace writerfilter {
+
+using resourcemodel::resolveSprmProps;
+
namespace dmapper
{
using namespace ::std;
using namespace ::com::sun::star;
-#ifdef DEBUG_DOMAINMAPPER
-extern TagLogger::Pointer_t dmapper_logger;
-#endif
-
class XInputStreamHelper : public cppu::WeakImplHelper1
< io::XInputStream >
{
@@ -230,6 +227,8 @@ public:
sal_Int32 nWrap;
bool bOpaque;
bool bContour;
+ bool bContourOutside;
+ WrapPolygon::Pointer_t mpWrapPolygon;
bool bIgnoreWRK;
sal_Int32 nLeftMargin;
@@ -292,6 +291,7 @@ public:
,nWrap(0)
,bOpaque( true )
,bContour(false)
+ ,bContourOutside(true)
,bIgnoreWRK(true)
,nLeftMargin(319)
,nRightMargin(319)
@@ -354,9 +354,12 @@ GraphicImport::GraphicImport(uno::Reference < uno::XComponentContext > xCompo
uno::Reference< lang::XMultiServiceFactory > xTextFactory,
DomainMapper& rDMapper,
GraphicImportType eImportType )
-: m_pImpl( new GraphicImport_Impl( eImportType, rDMapper ))
- ,m_xComponentContext( xComponentContext )
- ,m_xTextFactory( xTextFactory)
+: LoggedProperties(dmapper_logger, "GraphicImport")
+, LoggedTable(dmapper_logger, "GraphicImport")
+, LoggedStream(dmapper_logger, "GraphicImport")
+, m_pImpl( new GraphicImport_Impl( eImportType, rDMapper ))
+, m_xComponentContext( xComponentContext )
+, m_xTextFactory( xTextFactory)
{
}
/*-- 01.11.2006 09:42:42---------------------------------------------------
@@ -366,15 +369,32 @@ GraphicImport::~GraphicImport()
{
delete m_pImpl;
}
+
+void GraphicImport::handleWrapTextValue(sal_uInt32 nVal)
+{
+ switch (nVal)
+ {
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_bothSides: // 90920;
+ m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_left: // 90921;
+ m_pImpl->nWrap = text::WrapTextMode_LEFT;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_right: // 90922;
+ m_pImpl->nWrap = text::WrapTextMode_RIGHT;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_largest: // 90923;
+ m_pImpl->nWrap = text::WrapTextMode_DYNAMIC;
+ break;
+ default:;
+ }
+}
+
/*-- 01.11.2006 09:45:01---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::attribute(Id nName, Value & val)
+void GraphicImport::lcl_attribute(Id nName, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
-#endif
sal_Int32 nIntValue = val.getInt();
/* WRITERFILTERSTATUS: table: PICFattribute */
switch( nName )
@@ -1018,26 +1038,24 @@ void GraphicImport::attribute(Id nName, Value & val)
case NS_ooxml::LN_CT_WrapTight_wrapText: // 90934;
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
m_pImpl->bContour = true;
- //no break;
+ m_pImpl->bContourOutside = true;
+
+ handleWrapTextValue(val.getInt());
+
+ break;
+ case NS_ooxml::LN_CT_WrapThrough_wrapText:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ m_pImpl->bContour = true;
+ m_pImpl->bContourOutside = false;
+
+ handleWrapTextValue(val.getInt());
+
+ break;
case NS_ooxml::LN_CT_WrapSquare_wrapText: //90928;
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
- switch ( val.getInt() )
- {
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_bothSides: // 90920;
- m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
- break;
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_left: // 90921;
- m_pImpl->nWrap = text::WrapTextMode_LEFT;
- break;
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_right: // 90922;
- m_pImpl->nWrap = text::WrapTextMode_RIGHT;
- break;
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_largest: // 90923;
- m_pImpl->nWrap = text::WrapTextMode_DYNAMIC;
- break;
- default:;
- }
- break;
+
+ handleWrapTextValue(val.getInt());
+ break;
case NS_ooxml::LN_shape:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
{
@@ -1130,18 +1148,11 @@ void GraphicImport::attribute(Id nName, Value & val)
//TODO: does it need to be handled?
break;
default:
-#if OSL_DEBUG_LEVEL > 0
- ::rtl::OString sMessage( "GraphicImport::attribute() - Id: ");
- sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 10 );
- sMessage += ::rtl::OString(" / 0x");
- sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 16 );
- OSL_ENSURE( false, sMessage.getStr())
+#ifdef DEBUG_DMAPPER_GRAPHIC_IMPORT
+ dmapper_logger->element("unhandled");
#endif
;
}
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("attribute");
-#endif
}
uno::Reference<text::XTextContent> GraphicImport::GetGraphicObject()
@@ -1357,13 +1368,8 @@ void GraphicImport::ProcessShapeOptions(Value& val)
/*-- 01.11.2006 09:45:02---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::sprm(Sprm & rSprm)
+void GraphicImport::lcl_sprm(Sprm & rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("sprm");
- dmapper_logger->chars(rSprm.toString());
-#endif
-
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
@@ -1386,12 +1392,12 @@ void GraphicImport::sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_Anchor_effectExtent: // 90979;
case NS_ooxml::LN_EG_WrapType_wrapSquare: // 90945;
case NS_ooxml::LN_EG_WrapType_wrapTight: // 90946;
+ case NS_ooxml::LN_EG_WrapType_wrapThrough:
case NS_ooxml::LN_CT_Anchor_docPr: // 90980;
case NS_ooxml::LN_CT_Anchor_cNvGraphicFramePr: // 90981;
case NS_ooxml::LN_CT_Anchor_a_graphic: // 90982;
case NS_ooxml::LN_CT_WrapPath_start: // 90924;
case NS_ooxml::LN_CT_WrapPath_lineTo: // 90925;
- case NS_ooxml::LN_CT_WrapTight_wrapPolygon: // 90933;
case NS_ooxml::LN_graphic_graphic:
case NS_ooxml::LN_pic_pic:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
@@ -1403,6 +1409,17 @@ void GraphicImport::sprm(Sprm & rSprm)
}
}
break;
+ case NS_ooxml::LN_CT_WrapTight_wrapPolygon:
+ case NS_ooxml::LN_CT_WrapThrough_wrapPolygon:
+ /* WRITERFILTERSTATUS: done: 100, planned: 4, spent: 2 */
+ {
+ WrapPolygonHandler aHandler;
+
+ resolveSprmProps(aHandler, rSprm);
+
+ m_pImpl->mpWrapPolygon = aHandler.getPolygon();
+ }
+ break;
case NS_ooxml::LN_CT_Anchor_positionH: // 90976;
{
// Use a special handler for the positionning
@@ -1453,10 +1470,6 @@ void GraphicImport::sprm(Sprm & rSprm)
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
m_pImpl->nWrap = text::WrapTextMode_NONE;
break;
- case NS_ooxml::LN_EG_WrapType_wrapThrough: // 90947;
- /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
- m_pImpl->nWrap = text::WrapTextMode_THROUGHT;
- break;
case 0xf010:
case 0xf011:
//ignore - doesn't contain useful members
@@ -1481,17 +1494,11 @@ void GraphicImport::sprm(Sprm & rSprm)
#endif
;
}
-
-
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("sprm");
-#endif
}
/*-- 01.11.2006 09:45:02---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
+void GraphicImport::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
{
}
/*-- 16.11.2006 16:14:32---------------------------------------------------
@@ -1640,7 +1647,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND_CONTOUR ),
uno::makeAny(m_pImpl->bContour));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_OUTSIDE ),
- uno::makeAny(true));
+ uno::makeAny(m_pImpl->bContourOutside));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_LEFT_MARGIN ),
uno::makeAny(m_pImpl->nLeftMargin));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_RIGHT_MARGIN ),
@@ -1650,8 +1657,6 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ),
uno::makeAny(m_pImpl->nBottomMargin));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_POLY_POLYGON),
- uno::Any());
if( m_pImpl->eColorMode == drawing::ColorMode_STANDARD &&
m_pImpl->nContrast == -70 &&
m_pImpl->nBrightness == 70 )
@@ -1679,16 +1684,31 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_MIRRORED_ON_ODD_PAGES ),
uno::makeAny( m_pImpl->bHoriFlip ));
}
+
if( m_pImpl->bVertFlip )
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_MIRRORED ),
uno::makeAny( m_pImpl->bVertFlip ));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BACK_COLOR ),
uno::makeAny( m_pImpl->nFillColor ));
+
//there seems to be no way to detect the original size via _real_ API
uno::Reference< beans::XPropertySet > xGraphicProperties( xGraphic, uno::UNO_QUERY_THROW );
awt::Size aGraphicSize, aGraphicSizePixel;
xGraphicProperties->getPropertyValue(rPropNameSupplier.GetName( PROP_SIZE100th_M_M )) >>= aGraphicSize;
xGraphicProperties->getPropertyValue(rPropNameSupplier.GetName( PROP_SIZE_PIXEL )) >>= aGraphicSizePixel;
+
+ uno::Any aContourPolyPolygon;
+ if( aGraphicSize.Width && aGraphicSize.Height &&
+ m_pImpl->mpWrapPolygon.get() != NULL)
+ {
+ awt::Size aDstSize(m_pImpl->getXSize(), m_pImpl->getYSize());
+ WrapPolygon::Pointer_t pCorrected = m_pImpl->mpWrapPolygon->correctWordWrapPolygon(aGraphicSize, aDstSize);
+ aContourPolyPolygon <<= pCorrected->getPointSequenceSequence();
+ }
+
+ xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_POLY_POLYGON),
+ aContourPolyPolygon);
+
if( aGraphicSize.Width && aGraphicSize.Height )
{
//todo: i71651 graphic size is not provided by the GraphicDescriptor
@@ -1697,9 +1717,11 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
lcl_CalcCrop( m_pImpl->nLeftCrop, aGraphicSize.Width );
lcl_CalcCrop( m_pImpl->nRightCrop, aGraphicSize.Width );
+
xGraphicProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_GRAPHIC_CROP ),
uno::makeAny(text::GraphicCrop(m_pImpl->nTopCrop, m_pImpl->nBottomCrop, m_pImpl->nLeftCrop, m_pImpl->nRightCrop)));
}
+
}
if(m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_INLINE || m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR)
@@ -1747,81 +1769,81 @@ void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Referen
/*-- 01.11.2006 09:45:03---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::startSectionGroup()
+void GraphicImport::lcl_startSectionGroup()
{
}
/*-- 01.11.2006 09:45:03---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::endSectionGroup()
+void GraphicImport::lcl_endSectionGroup()
{
}
/*-- 01.11.2006 09:45:03---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::startParagraphGroup()
+void GraphicImport::lcl_startParagraphGroup()
{
}
/*-- 01.11.2006 09:45:03---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::endParagraphGroup()
+void GraphicImport::lcl_endParagraphGroup()
{
}
/*-- 01.11.2006 09:45:03---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::startCharacterGroup()
+void GraphicImport::lcl_startCharacterGroup()
{
}
/*-- 01.11.2006 09:45:04---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::endCharacterGroup()
+void GraphicImport::lcl_endCharacterGroup()
{
}
/*-- 01.11.2006 09:45:04---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::text(const sal_uInt8 * /*_data*/, size_t /*len*/)
+void GraphicImport::lcl_text(const sal_uInt8 * /*_data*/, size_t /*len*/)
{
}
/*-- 01.11.2006 09:45:05---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::utext(const sal_uInt8 * /*_data*/, size_t /*len*/)
+void GraphicImport::lcl_utext(const sal_uInt8 * /*_data*/, size_t /*len*/)
{
}
/*-- 01.11.2006 09:45:05---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::props(writerfilter::Reference<Properties>::Pointer_t /*ref*/)
+void GraphicImport::lcl_props(writerfilter::Reference<Properties>::Pointer_t /*ref*/)
{
}
/*-- 01.11.2006 09:45:06---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::table(Id /*name*/, writerfilter::Reference<Table>::Pointer_t /*ref*/)
+void GraphicImport::lcl_table(Id /*name*/, writerfilter::Reference<Table>::Pointer_t /*ref*/)
{
}
/*-- 01.11.2006 09:45:07---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::substream(Id /*name*/, ::writerfilter::Reference<Stream>::Pointer_t /*ref*/)
+void GraphicImport::lcl_substream(Id /*name*/, ::writerfilter::Reference<Stream>::Pointer_t /*ref*/)
{
}
/*-- 01.11.2006 09:45:07---------------------------------------------------
-----------------------------------------------------------------------*/
-void GraphicImport::info(const string & /*info*/)
+void GraphicImport::lcl_info(const string & /*info*/)
{
}
-void GraphicImport::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
+void GraphicImport::lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
{
}
-void GraphicImport::endShape( )
+void GraphicImport::lcl_endShape( )
{
}
diff --git a/writerfilter/source/dmapper/GraphicImport.hxx b/writerfilter/source/dmapper/GraphicImport.hxx
index 14f512a3d4ee..87e99ce975b6 100644
--- a/writerfilter/source/dmapper/GraphicImport.hxx
+++ b/writerfilter/source/dmapper/GraphicImport.hxx
@@ -30,7 +30,7 @@
//#ifndef INCLUDED_WRITERFILTERDLLAPI_H
//#include <WriterFilterDllApi.hxx>
//#endif
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
//#include <com/sun/star/lang/XComponent.hpp>
namespace com{ namespace sun { namespace star {
namespace uno{
@@ -69,8 +69,8 @@ enum GraphicImportType
IMPORT_AS_DETECTED_ANCHOR
};
-class WRITERFILTER_DLLPRIVATE GraphicImport : public Properties, public Table
- ,public BinaryObj, public Stream
+class WRITERFILTER_DLLPRIVATE GraphicImport : public LoggedProperties, public LoggedTable
+ ,public BinaryObj, public LoggedStream
{
GraphicImport_Impl* m_pImpl;
::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext > m_xComponentContext;
@@ -91,37 +91,41 @@ public:
GraphicImportType eGraphicImportType);
virtual ~GraphicImport();
+ // BinaryObj
+ virtual void data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t ref);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > GetGraphicObject();
+ bool IsGraphic() const;
+
+ private:
// Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
// Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
- // BinaryObj
- virtual void data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
// Stream
- virtual void startSectionGroup();
- virtual void endSectionGroup();
- virtual void startParagraphGroup();
- virtual void endParagraphGroup();
- virtual void startCharacterGroup();
- virtual void endCharacterGroup();
- virtual void text(const sal_uInt8 * data, size_t len);
- virtual void utext(const sal_uInt8 * data, size_t len);
- virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
- virtual void table(Id name,
- writerfilter::Reference<Table>::Pointer_t ref);
- virtual void substream(Id name,
- ::writerfilter::Reference<Stream>::Pointer_t ref);
- virtual void info(const string & info);
- virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
- virtual void endShape( );
+ virtual void lcl_startSectionGroup();
+ virtual void lcl_endSectionGroup();
+ virtual void lcl_startParagraphGroup();
+ virtual void lcl_endParagraphGroup();
+ virtual void lcl_startCharacterGroup();
+ virtual void lcl_endCharacterGroup();
+ virtual void lcl_text(const sal_uInt8 * data, size_t len);
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len);
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_table(Id name,
+ writerfilter::Reference<Table>::Pointer_t ref);
+ virtual void lcl_substream(Id name,
+ ::writerfilter::Reference<Stream>::Pointer_t ref);
+ virtual void lcl_info(const string & info);
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void lcl_endShape( );
- ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > GetGraphicObject();
- bool IsGraphic() const;
+ void handleWrapTextValue(sal_uInt32 nVal);
};
+
typedef boost::shared_ptr< GraphicImport > GraphicImportPtr;
}}
diff --git a/writerfilter/source/dmapper/MeasureHandler.cxx b/writerfilter/source/dmapper/MeasureHandler.cxx
index 58f3980063ee..e34a6896ea0d 100644
--- a/writerfilter/source/dmapper/MeasureHandler.cxx
+++ b/writerfilter/source/dmapper/MeasureHandler.cxx
@@ -30,6 +30,7 @@
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
#include <com/sun/star/text/SizeType.hpp>
+#include "dmapperLoggers.hxx"
namespace writerfilter {
namespace dmapper {
@@ -40,9 +41,10 @@ using namespace ::com::sun::star;
-----------------------------------------------------------------------*/
MeasureHandler::MeasureHandler() :
- m_nMeasureValue( 0 ),
- m_nUnit( -1 ),
- m_nRowHeightSizeType( text::SizeType::MIN )
+LoggedProperties(dmapper_logger, "MeasureHandler"),
+m_nMeasureValue( 0 ),
+m_nUnit( -1 ),
+m_nRowHeightSizeType( text::SizeType::MIN )
{
}
/*-- 24.04.2007 09:06:35---------------------------------------------------
@@ -54,7 +56,7 @@ MeasureHandler::~MeasureHandler()
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void MeasureHandler::attribute(Id rName, Value & rVal)
+void MeasureHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)rName;
@@ -99,7 +101,7 @@ void MeasureHandler::attribute(Id rName, Value & rVal)
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void MeasureHandler::sprm(Sprm & rSprm)
+void MeasureHandler::lcl_sprm(Sprm & rSprm)
{
(void)rSprm;
}
diff --git a/writerfilter/source/dmapper/MeasureHandler.hxx b/writerfilter/source/dmapper/MeasureHandler.hxx
index 574685f8ed27..25a38a4862f3 100644
--- a/writerfilter/source/dmapper/MeasureHandler.hxx
+++ b/writerfilter/source/dmapper/MeasureHandler.hxx
@@ -28,7 +28,7 @@
#define INCLUDED_MEASUREHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace writerfilter {
@@ -39,20 +39,20 @@ class PropertyMap;
- Left indent of tables
- Preferred width of tables
*/
-class WRITERFILTER_DLLPRIVATE MeasureHandler : public Properties
+class WRITERFILTER_DLLPRIVATE MeasureHandler : public LoggedProperties
{
sal_Int32 m_nMeasureValue;
sal_Int32 m_nUnit;
sal_Int16 m_nRowHeightSizeType; //table row height type
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
MeasureHandler();
virtual ~MeasureHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
sal_Int32 getMeasureValue() const;
//at least tables can have automatic width
bool isAutoWidth() const;
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 8cc031ea1d09..9e66e1a467c3 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -1,3 +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 "ConversionHelper.hxx"
#include "NumberingManager.hxx"
#include "StyleSheetTable.hxx"
@@ -19,6 +45,8 @@
#include <stdio.h>
#endif
+#include "dmapperLoggers.hxx"
+
using namespace rtl;
using namespace com::sun::star;
@@ -614,10 +642,12 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
//------------------------------------- NumberingManager implementation
-ListsManager::ListsManager( DomainMapper& rDMapper,
- const uno::Reference< lang::XMultiServiceFactory > xFactory ) :
- m_rDMapper( rDMapper ),
- m_xFactory( xFactory )
+ListsManager::ListsManager(DomainMapper& rDMapper,
+ const uno::Reference< lang::XMultiServiceFactory > xFactory) :
+LoggedProperties(dmapper_logger, "ListsManager"),
+LoggedTable(dmapper_logger, "ListsManager"),
+m_rDMapper( rDMapper ),
+m_xFactory( xFactory )
{
}
@@ -625,7 +655,7 @@ ListsManager::~ListsManager( )
{
}
-void ListsManager::attribute( Id nName, Value& rVal )
+void ListsManager::lcl_attribute( Id nName, Value& rVal )
{
OSL_ENSURE( m_pCurrentDefinition.get(), "current entry has to be set here");
if(!m_pCurrentDefinition.get())
@@ -764,7 +794,7 @@ void ListsManager::attribute( Id nName, Value& rVal )
}
}
-void ListsManager::sprm( Sprm& rSprm )
+void ListsManager::lcl_sprm( Sprm& rSprm )
{
//fill the attributes of the style sheet
sal_uInt32 nSprmId = rSprm.getId();
@@ -939,8 +969,8 @@ void ListsManager::sprm( Sprm& rSprm )
}
}
-void ListsManager::entry( int /* pos */,
- writerfilter::Reference<Properties>::Pointer_t ref )
+void ListsManager::lcl_entry( int /* pos */,
+ writerfilter::Reference<Properties>::Pointer_t ref )
{
if( m_rDMapper.IsOOXMLImport() )
{
diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx
index a7970fca531c..3285bc85f416 100644
--- a/writerfilter/source/dmapper/NumberingManager.hxx
+++ b/writerfilter/source/dmapper/NumberingManager.hxx
@@ -1,3 +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.
+ *
+ ************************************************************************/
#ifndef INCLUDED_NUMBERINGMANAGER_HXX
#define INCLUDED_NUMBERINGMANAGER_HXX
@@ -5,7 +31,7 @@
#include <WriterFilterDllApi.hxx>
#include <dmapper/DomainMapper.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/container/XIndexReplace.hpp>
@@ -170,8 +196,8 @@ public:
/** This class provides access to the defined numbering styles.
*/
class ListsManager :
- public Properties,
- public Table
+ public LoggedProperties,
+ public LoggedTable
{
private:
@@ -190,6 +216,13 @@ private:
AbstractListDef::Pointer GetAbstractList( sal_Int32 nId );
+ // Properties
+ virtual void lcl_attribute( Id nName, Value & rVal );
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
public:
ListsManager(
@@ -199,13 +232,6 @@ public:
typedef boost::shared_ptr< ListsManager > Pointer;
- // Properties
- virtual void attribute( Id nName, Value & rVal );
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
// Config methods
void SetLFOImport( bool bLFOImport ) { m_bIsLFOImport = bLFOImport; };
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx
index 65f76f11cbfc..89ee01ecb9a0 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -44,6 +44,8 @@
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -52,9 +54,10 @@ using namespace ::com::sun::star;
-----------------------------------------------------------------------*/
OLEHandler::OLEHandler() :
- m_nDxaOrig(0),
- m_nDyaOrig(0),
- m_nWrapMode(0)
+LoggedProperties(dmapper_logger, "OLEHandler"),
+m_nDxaOrig(0),
+m_nDyaOrig(0),
+m_nWrapMode(0)
{
}
/*-- 23.04.2008 10:46:14---------------------------------------------------
@@ -66,7 +69,7 @@ OLEHandler::~OLEHandler()
/*-- 23.04.2008 10:46:14---------------------------------------------------
-----------------------------------------------------------------------*/
-void OLEHandler::attribute(Id rName, Value & rVal)
+void OLEHandler::lcl_attribute(Id rName, Value & rVal)
{
rtl::OUString sStringValue = rVal.getString();
(void)rName;
@@ -141,7 +144,7 @@ void OLEHandler::attribute(Id rName, Value & rVal)
/*-- 23.04.2008 10:46:14---------------------------------------------------
-----------------------------------------------------------------------*/
-void OLEHandler::sprm(Sprm & rSprm)
+void OLEHandler::lcl_sprm(Sprm & rSprm)
{
sal_uInt32 nSprmId = rSprm.getId();
switch( nSprmId )
diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx
index f9059fb6a35a..cddbac5475bc 100644
--- a/writerfilter/source/dmapper/OLEHandler.hxx
+++ b/writerfilter/source/dmapper/OLEHandler.hxx
@@ -30,7 +30,7 @@
#ifndef INCLUDED_WRITERFILTERDLLAPI_H
#include <WriterFilterDllApi.hxx>
#endif
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
@@ -60,7 +60,7 @@ namespace dmapper
//class PropertyMap;
/** Handler for OLE objects
*/
-class WRITERFILTER_DLLPRIVATE OLEHandler : public Properties
+class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties
{
::rtl::OUString m_sObjectType;
::rtl::OUString m_sProgId;
@@ -81,14 +81,15 @@ class WRITERFILTER_DLLPRIVATE OLEHandler : public Properties
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement;
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream;
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
OLEHandler();
virtual ~OLEHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; };
inline bool isOLEObject( ) { return m_xInputStream.is( ); };
diff --git a/writerfilter/source/dmapper/PageBordersHandler.cxx b/writerfilter/source/dmapper/PageBordersHandler.cxx
index 725502843982..21798d684b5d 100644
--- a/writerfilter/source/dmapper/PageBordersHandler.cxx
+++ b/writerfilter/source/dmapper/PageBordersHandler.cxx
@@ -2,6 +2,8 @@
#include <ooxml/resourceids.hxx>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -16,8 +18,9 @@ _PgBorder::~_PgBorder( )
}
PageBordersHandler::PageBordersHandler( ) :
- m_nDisplay( 0 ),
- m_nOffset( 0 )
+LoggedProperties(dmapper_logger, "PageBordersHandler"),
+m_nDisplay( 0 ),
+m_nOffset( 0 )
{
}
@@ -25,7 +28,7 @@ PageBordersHandler::~PageBordersHandler( )
{
}
-void PageBordersHandler::attribute( Id eName, Value& rVal )
+void PageBordersHandler::lcl_attribute( Id eName, Value& rVal )
{
int nIntValue = rVal.getInt( );
switch ( eName )
@@ -65,7 +68,7 @@ void PageBordersHandler::attribute( Id eName, Value& rVal )
}
}
-void PageBordersHandler::sprm( Sprm& rSprm )
+void PageBordersHandler::lcl_sprm( Sprm& rSprm )
{
switch ( rSprm.getId( ) )
{
diff --git a/writerfilter/source/dmapper/PageBordersHandler.hxx b/writerfilter/source/dmapper/PageBordersHandler.hxx
index 327ccfc4f8d6..621f239b3038 100644
--- a/writerfilter/source/dmapper/PageBordersHandler.hxx
+++ b/writerfilter/source/dmapper/PageBordersHandler.hxx
@@ -5,7 +5,7 @@
#include "PropertyMap.hxx"
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/table/BorderLine.hpp>
@@ -27,7 +27,7 @@ public:
~_PgBorder( );
};
-class WRITERFILTER_DLLPRIVATE PageBordersHandler : public Properties
+class WRITERFILTER_DLLPRIVATE PageBordersHandler : public LoggedProperties
{
private:
@@ -36,14 +36,14 @@ private:
sal_Int32 m_nOffset;
vector<_PgBorder> m_aBorders;
+ // Properties
+ virtual void lcl_attribute( Id eName, Value& rVal );
+ virtual void lcl_sprm( Sprm& rSprm );
+
public:
PageBordersHandler( );
~PageBordersHandler( );
- // Properties
- virtual void attribute( Id eName, Value& rVal );
- virtual void sprm( Sprm& rSprm );
-
inline sal_Int32 GetDisplayOffset( )
{
return ( m_nOffset << 5 ) + m_nDisplay;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 2066cf58f530..33107e7356d3 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -32,261 +32,261 @@ namespace rtl{ class OUString;}
namespace writerfilter {
namespace dmapper{
enum PropertyIds
-{
+ {
PROP_ID_START = 1
- /* 1*/ ,PROP_CHAR_WEIGHT = PROP_ID_START
- /* 2*/ ,PROP_CHAR_POSTURE
- /* 3*/ ,PROP_CHAR_STRIKEOUT
- /* 4*/ ,PROP_CHAR_CONTOURED
- /* 5*/ ,PROP_CHAR_SHADOWED
- /* 6*/ ,PROP_CHAR_CASE_MAP
- /* 7*/ ,PROP_CHAR_COLOR
- /* 8*/ ,PROP_CHAR_RELIEF
- /* 9*/ ,PROP_CHAR_UNDERLINE
- /*10*/ ,PROP_CHAR_WORD_MODE
- /*11*/ ,PROP_CHAR_ESCAPEMENT
- /*12*/ ,PROP_CHAR_ESCAPEMENT_HEIGHT
- /*13*/ ,PROP_CHAR_HEIGHT
- /*14*/ ,PROP_CHAR_HEIGHT_COMPLEX
- /*15*/ ,PROP_CHAR_LOCALE
- /*16*/ ,PROP_CHAR_LOCALE_ASIAN
- /*17*/ ,PROP_CHAR_WEIGHT_COMPLEX
- /*18*/ ,PROP_CHAR_POSTURE_COMPLEX
- /*19*/ ,PROP_CHAR_AUTO_KERNING
- /*20*/ ,PROP_CHAR_CHAR_KERNING
- /*21*/ ,PROP_CHAR_SCALE_WIDTH
- /*22*/ ,PROP_CHAR_LOCALE_COMPLEX
- /*23*/ ,PROP_CHAR_UNDERLINE_COLOR
-/*24*/ , PROP_CHAR_UNDERLINE_HAS_COLOR
-/*25*/ , PROP_CHAR_FONT_NAME
-/*26*/ , PROP_CHAR_FONT_STYLE
-/*27*/ , PROP_CHAR_FONT_FAMILY
-/*28*/ , PROP_CHAR_FONT_CHAR_SET
-/*29*/ , PROP_CHAR_FONT_PITCH
-/*30*/ , PROP_CHAR_FONT_NAME_ASIAN
-/*31*/ , PROP_CHAR_HEIGHT_ASIAN
-/*32*/ , PROP_CHAR_FONT_STYLE_ASIAN
-/*33*/ , PROP_CHAR_FONT_FAMILY_ASIAN
-/*34*/ , PROP_CHAR_FONT_CHAR_SET_ASIAN
-/*35*/ , PROP_CHAR_FONT_PITCH_ASIAN
-/*36*/ , PROP_CHAR_FONT_NAME_COMPLEX
-/*37*/ , PROP_CHAR_FONT_STYLE_COMPLEX
-/*38*/ , PROP_CHAR_FONT_FAMILY_COMPLEX
-/*39*/ , PROP_CHAR_FONT_CHAR_SET_COMPLEX
-/*40*/ , PROP_CHAR_FONT_PITCH_COMPLEX
-/*41*/ , PROP_CHAR_HIDDEN
-/*42*/ , PROP_CHAR_WEIGHT_ASIAN
-/*43*/ , PROP_CHAR_POSTURE_ASIAN
-/*44*/ , PROP_PARA_STYLE_NAME
-/*45*/ , PROP_CHAR_STYLE_NAME
-/*46*/ , PROP_PARA_ADJUST
-/*47*/ , PROP_PARA_LAST_LINE_ADJUST
-/*48*/ , PROP_PARA_RIGHT_MARGIN
-/*49*/ , PROP_PARA_LEFT_MARGIN
-/*50*/ , PROP_PARA_FIRST_LINE_INDENT
-/*51*/ , PROP_PARA_KEEP_TOGETHER
-/*52*/ , PROP_PARA_TOP_MARGIN
-/*53*/ , PROP_PARA_BOTTOM_MARGIN
-/*54*/ , PROP_PARA_IS_HYPHENATION
-/*55*/ , PROP_PARA_LINE_NUMBER_COUNT
-/*56*/ , PROP_PARA_IS_HANGING_PUNCTUATION
-/*57*/ , PROP_PARA_LINE_SPACING
-/*58*/ , PROP_PARA_TAB_STOPS
-/*59*/ , PROP_PARA_WIDOWS
-/*60*/ , PROP_PARA_ORPHANS
-/*61*/ , PROP_PARA_LINE_NUMBER_START_VALUE
-/*62*/ , PROP_NUMBERING_LEVEL
-/*63*/ , PROP_NUMBERING_RULES
-/*64*/ , PROP_NUMBERING_TYPE
-/*65*/ , PROP_START_WITH
-/*66*/ , PROP_ADJUST
-/*67*/ , PROP_PARENT_NUMBERING
-/*68*/ , PROP_LEFT_MARGIN
-/*69*/ , PROP_RIGHT_MARGIN
-/*70*/ , PROP_TOP_MARGIN
-/*71*/ , PROP_BOTTOM_MARGIN
-/*72*/ , PROP_FIRST_LINE_OFFSET
-/*73*/ , PROP_LEFT_BORDER
-/*74*/ , PROP_RIGHT_BORDER
-/*75*/ , PROP_TOP_BORDER
-/*76*/ , PROP_BOTTOM_BORDER
-/*77*/ , PROP_TABLE_BORDER
-/*78*/ , PROP_LEFT_BORDER_DISTANCE
-/*79*/ , PROP_RIGHT_BORDER_DISTANCE
-/*80*/ , PROP_TOP_BORDER_DISTANCE
-/*81*/ , PROP_BOTTOM_BORDER_DISTANCE
-/*82*/ , PROP_CURRENT_PRESENTATION
-/*83*/ , PROP_IS_FIXED
-/*84*/ , PROP_SUB_TYPE
-/*85*/ , PROP_FILE_FORMAT
-/*86*/ , PROP_HYPER_LINK_U_R_L
-/*87*/ , PROP_NUMBER_FORMAT
-/*88*/ , PROP_NAME
-/*89*/ , PROP_IS_INPUT
-/*90*/ , PROP_HINT
-/*91*/ , PROP_FULL_NAME
-/*92*/ , PROP_KEYWORDS
-/*93*/ , PROP_DESCRIPTION
-/*94*/ , PROP_MACRO_NAME
-/*95*/ , PROP_SUBJECT
-/*96*/ , PROP_USER_DATA_TYPE
-/*97*/ , PROP_TITLE
-/*98*/ , PROP_CONTENT
-/*99*/ , PROP_DATA_COLUMN_NAME
-/*100*/, PROP_INPUT_STREAM
-/*101*/, PROP_GRAPHIC
-/*102*/, PROP_ANCHOR_TYPE
-/*103*/ ,PROP_SIZE
-/*104*/ ,PROP_HORI_ORIENT
-/*105*/ ,PROP_HORI_ORIENT_POSITION
-/*106*/ ,PROP_HORI_ORIENT_RELATION
-/*107*/ ,PROP_VERT_ORIENT
-/*108*/ ,PROP_VERT_ORIENT_POSITION
-/*109*/ ,PROP_VERT_ORIENT_RELATION
-/*110*/ ,PROP_GRAPHIC_CROP
-/*111*/ ,PROP_SIZE100th_M_M
-/*112*/ ,PROP_SIZE_PIXEL
-/*113*/ ,PROP_SURROUND
-/*114*/ ,PROP_SURROUND_CONTOUR
-/*115*/ ,PROP_ADJUST_CONTRAST
-/*116*/ ,PROP_ADJUST_LUMINANCE
-/*117*/ ,PROP_GRAPHIC_COLOR_MODE
-/*118*/ ,PROP_GAMMA
-/*119*/ ,PROP_HORI_MIRRORED_ON_EVEN_PAGES
-/*120*/ ,PROP_HORI_MIRRORED_ON_ODD_PAGES
-/*121*/ ,PROP_VERT_MIRRORED
-/*122*/ ,PROP_CONTOUR_OUTSIDE
-/*123*/ ,PROP_CONTOUR_POLY_POLYGON
-/*124*/ ,PROP_PAGE_TOGGLE
-/*125*/ ,PROP_BACK_COLOR
-/*126*/ ,PROP_ALTERNATIVE_TEXT
-/*127*/ ,PROP_HEADER_TEXT_LEFT
-/*128*/ ,PROP_HEADER_TEXT
-/*129*/ ,PROP_HEADER_IS_SHARED
-/*130*/ ,PROP_HEADER_IS_ON
-/*131*/ ,PROP_FOOTER_TEXT_LEFT
-/*132*/ ,PROP_FOOTER_TEXT
-/*133*/ ,PROP_FOOTER_IS_SHARED
-/*134*/ ,PROP_FOOTER_IS_ON
-/*135*/ ,PROP_WIDTH
-/*136*/ ,PROP_HEIGHT
-/*137*/ ,PROP_SEPARATOR_LINE_IS_ON
-/*138*/ ,PROP_TEXT_COLUMNS
-/*139*/ ,PROP_AUTOMATIC_DISTANCE
-/*140*/ ,PROP_IS_LANDSCAPE
-/*141*/ ,PROP_PRINTER_PAPER_TRAY_INDEX
-/*142*/ ,PROP_FIRST_PAGE
-/*143*/ ,PROP_DEFAULT
-/*144*/ ,PROP_PAGE_DESC_NAME
-/*145*/ ,PROP_PAGE_NUMBER_OFFSET
-/*146*/ ,PROP_BREAK_TYPE
-/*147*/ ,PROP_FOOTER_IS_DYNAMIC_HEIGHT
-/*148*/ ,PROP_FOOTER_DYNAMIC_SPACING
-/*149*/ ,PROP_FOOTER_HEIGHT
-/*150*/ ,PROP_FOOTER_BODY_DISTANCE
-/*151*/ ,PROP_HEADER_IS_DYNAMIC_HEIGHT
-/*152*/ ,PROP_HEADER_DYNAMIC_SPACING
-/*153*/ ,PROP_HEADER_HEIGHT
-/*154*/ ,PROP_HEADER_BODY_DISTANCE
-/*155*/ ,PROP_WRITING_MODE
-/*156*/ ,PROP_GRID_MODE
-/*157*/ ,PROP_GRID_DISPLAY
-/*158*/ ,PROP_GRID_PRINT
-/*159*/ ,PROP_ADD_EXTERNAL_LEADING
-/*160*/ ,PROP_GRID_LINES
-/*161*/ ,PROP_GRID_BASE_HEIGHT
-/*162*/ ,PROP_GRID_RUBY_HEIGHT
-/*163*/ ,PROP_IS_ON
-/*164*/ ,PROP_RESTART_AT_EACH_PAGE
-/*165*/ ,PROP_COUNT_EMPTY_LINES
-/*166*/ ,PROP_COUNT_LINES_IN_FRAMES
-/*167*/ ,PROP_INTERVAL
-/*168*/ ,PROP_DISTANCE
-/*169*/ ,PROP_NUMBER_POSITION
-/*170*/ ,PROP_LEVEL
-/*171*/ ,PROP_LEVEL_PARAGRAPH_STYLES
-/*172*/ ,PROP_LEVEL_FORMAT
-/*173*/ ,PROP_TOKEN_TYPE
-/*174*/ ,PROP_TOKEN_HYPERLINK_START
-/*175*/ ,PROP_TOKEN_HYPERLINK_END
-/*176*/ ,PROP_TOKEN_CHAPTER_INFO
-/*177*/ ,PROP_CHAPTER_FORMAT
-/*178*/ ,PROP_TOKEN_TEXT
-/*179*/ ,PROP_TEXT
-/*180*/ ,PROP_CREATE_FROM_OUTLINE
-/*181*/ ,PROP_CREATE_FROM_MARKS
-/*182*/ ,PROP_STANDARD
-/*183*/ ,PROP_CHAR_BACK_COLOR
-/*184*/ ,PROP_CHAR_EMPHASIS
-/*185*/ ,PROP_CHAR_COMBINE_IS_ON
-/*186*/ ,PROP_CHAR_COMBINE_PREFIX
-/*187*/ ,PROP_CHAR_COMBINE_SUFFIX
-/*188*/ ,PROP_CHAR_ROTATION
-/*189*/ ,PROP_CHAR_ROTATION_IS_FIT_TO_LINE
-/*190*/ ,PROP_CHAR_FLASH
-/*191*/ ,PROP_IS_SPLIT_ALLOWED
-/*192*/ ,META_PROP_VERTICAL_BORDER
-/*193*/ ,META_PROP_HORIZONTAL_BORDER
-/*194*/ ,PROP_HEADER_ROW_COUNT
-/*195*/ ,PROP_IS_AUTO_HEIGHT
-/*196*/ ,PROP_SIZE_TYPE
-/*197*/ ,PROP_TABLE_COLUMN_SEPARATORS
-/*198*/ ,META_PROP_TABLE_STYLE_NAME
-/*199*/ ,PROP_REDLINE_AUTHOR
-/*200*/ ,PROP_REDLINE_DATE_TIME
-/*201*/ ,PROP_REDLINE_COMMENT
-/*202*/ ,PROP_REDLINE_TYPE
-/*203*/ ,PROP_REDLINE_SUCCESSOR_DATA
-/*204*/ ,PROP_REDLINE_IDENTIFIER
-/*205*/ ,PROP_SIZE_PROTECTED
-/*206*/ ,PROP_POSITION_PROTECTED
-/*207*/ ,PROP_OPAQUE
-/*208*/ ,PROP_VERTICAL_MERGE
-/*209*/ ,PROP_BULLET_CHAR
-/*210*/ ,PROP_BULLET_FONT_NAME
-/*211*/ ,PROP_PARA_BACK_COLOR
-/*212*/ ,PROP_TABS_RELATIVE_TO_INDENT
-/*213*/ ,PROP_PREFIX
-/*214*/ ,PROP_SUFFIX
-/*215*/ ,PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES
-/*216*/ ,PROP_DROP_CAP_FORMAT
-/*217*/ , PROP_REFERENCE_FIELD_PART
-/*218*/ ,PROP_SOURCE_NAME
-/*219*/ ,PROP_REFERENCE_FIELD_SOURCE
-/*220*/ ,PROP_WIDTH_TYPE
-/*221*/ ,PROP_TEXT_RANGE
-/*222*/ ,PROP_SERVICE_CHAR_STYLE
-/*223*/ ,PROP_SERVICE_PARA_STYLE
-/*224*/ ,PROP_CHARACTER_STYLES
-/*225*/ ,PROP_PARAGRAPH_STYLES
-/*226*/ ,PROP_TABLE_BORDER_DISTANCES
-/*227*/ ,META_PROP_CELL_MAR_TOP
-/*228*/ ,META_PROP_CELL_MAR_BOTTOM
-/*229*/ ,META_PROP_CELL_MAR_LEFT
-/*230*/ ,META_PROP_CELL_MAR_RIGHT
-/*231*/ ,PROP_START_AT
-/*232*/ ,PROP_ADD_PARA_TABLE_SPACING
-/*233*/ ,PROP_CHAR_PROP_HEIGHT
-/*234*/ ,PROP_CHAR_PROP_HEIGHT_ASIAN
-/*235*/ ,PROP_CHAR_PROP_HEIGHT_COMPLEX
-/*236*/ ,PROP_FORMAT
-/*237*/ ,PROP_INSERT
-/*238*/ ,PROP_DELETE
-/*239*/ ,PROP_STREAM_NAME
-/*240*/ ,PROP_BITMAP
-/*241*/ ,PROP_IS_DATE
-/*242*/ ,PROP_TAB_STOP_DISTANCE
-/*243*/ ,PROP_CNF_STYLE
-/*244*/ ,PROP_INDENT_AT
-/*245*/ ,PROP_FIRST_LINE_INDENT
-/*246*/ ,PROP_NUMBERING_STYLE_NAME
-/*247*/ ,PROP_OUTLINE_LEVEL
-/*248*/ ,PROP_LISTTAB_STOP_POSITION
-/*249*/ ,PROP_POSITION_AND_SPACE_MODE
-/*250*/ ,PROP_HEADING_STYLE_NAME
-/*251*/ ,PROP_PARA_SPLIT
-/*252*/ ,PROP_HELP
-};
+ ,META_PROP_CELL_MAR_BOTTOM = PROP_ID_START
+ ,META_PROP_CELL_MAR_LEFT
+ ,META_PROP_CELL_MAR_RIGHT
+ ,META_PROP_CELL_MAR_TOP
+ ,META_PROP_HORIZONTAL_BORDER
+ ,META_PROP_TABLE_STYLE_NAME
+ ,META_PROP_VERTICAL_BORDER
+ ,PROP_ADD_EXTERNAL_LEADING
+ ,PROP_ADD_PARA_TABLE_SPACING
+ ,PROP_ADJUST
+ ,PROP_ADJUST_CONTRAST
+ ,PROP_ADJUST_LUMINANCE
+ ,PROP_ALTERNATIVE_TEXT
+ ,PROP_ANCHOR_TYPE
+ ,PROP_AUTOMATIC_DISTANCE
+ ,PROP_BACK_COLOR
+ ,PROP_BITMAP
+ ,PROP_BOTTOM_BORDER
+ ,PROP_BOTTOM_BORDER_DISTANCE
+ ,PROP_BOTTOM_MARGIN
+ ,PROP_BREAK_TYPE
+ ,PROP_BULLET_CHAR
+ ,PROP_BULLET_FONT_NAME
+ ,PROP_CHAPTER_FORMAT
+ ,PROP_CHARACTER_STYLES
+ ,PROP_CHAR_AUTO_KERNING
+ ,PROP_CHAR_BACK_COLOR
+ ,PROP_CHAR_CASE_MAP
+ ,PROP_CHAR_CHAR_KERNING
+ ,PROP_CHAR_COLOR
+ ,PROP_CHAR_COMBINE_IS_ON
+ ,PROP_CHAR_COMBINE_PREFIX
+ ,PROP_CHAR_COMBINE_SUFFIX
+ ,PROP_CHAR_CONTOURED
+ ,PROP_CHAR_EMPHASIS
+ ,PROP_CHAR_ESCAPEMENT
+ ,PROP_CHAR_ESCAPEMENT_HEIGHT
+ ,PROP_CHAR_FLASH
+ ,PROP_CHAR_FONT_CHAR_SET
+ ,PROP_CHAR_FONT_CHAR_SET_ASIAN
+ ,PROP_CHAR_FONT_CHAR_SET_COMPLEX
+ ,PROP_CHAR_FONT_FAMILY
+ ,PROP_CHAR_FONT_FAMILY_ASIAN
+ ,PROP_CHAR_FONT_FAMILY_COMPLEX
+ ,PROP_CHAR_FONT_NAME
+ ,PROP_CHAR_FONT_NAME_ASIAN
+ ,PROP_CHAR_FONT_NAME_COMPLEX
+ ,PROP_CHAR_FONT_PITCH
+ ,PROP_CHAR_FONT_PITCH_ASIAN
+ ,PROP_CHAR_FONT_PITCH_COMPLEX
+ ,PROP_CHAR_FONT_STYLE
+ ,PROP_CHAR_FONT_STYLE_ASIAN
+ ,PROP_CHAR_FONT_STYLE_COMPLEX
+ ,PROP_CHAR_HEIGHT
+ ,PROP_CHAR_HEIGHT_ASIAN
+ ,PROP_CHAR_HEIGHT_COMPLEX
+ ,PROP_CHAR_HIDDEN
+ ,PROP_CHAR_LOCALE
+ ,PROP_CHAR_LOCALE_ASIAN
+ ,PROP_CHAR_LOCALE_COMPLEX
+ ,PROP_CHAR_POSTURE
+ ,PROP_CHAR_POSTURE_ASIAN
+ ,PROP_CHAR_POSTURE_COMPLEX
+ ,PROP_CHAR_PROP_HEIGHT
+ ,PROP_CHAR_PROP_HEIGHT_ASIAN
+ ,PROP_CHAR_PROP_HEIGHT_COMPLEX
+ ,PROP_CHAR_RELIEF
+ ,PROP_CHAR_ROTATION
+ ,PROP_CHAR_ROTATION_IS_FIT_TO_LINE
+ ,PROP_CHAR_SCALE_WIDTH
+ ,PROP_CHAR_SHADOWED
+ ,PROP_CHAR_STRIKEOUT
+ ,PROP_CHAR_STYLE_NAME
+ ,PROP_CHAR_UNDERLINE
+ ,PROP_CHAR_UNDERLINE_COLOR
+ ,PROP_CHAR_UNDERLINE_HAS_COLOR
+ ,PROP_CHAR_WEIGHT
+ ,PROP_CHAR_WEIGHT_ASIAN
+ ,PROP_CHAR_WEIGHT_COMPLEX
+ ,PROP_CHAR_WORD_MODE
+ ,PROP_CNF_STYLE
+ ,PROP_CONTENT
+ ,PROP_CONTOUR_OUTSIDE
+ ,PROP_CONTOUR_POLY_POLYGON
+ ,PROP_COUNT_EMPTY_LINES
+ ,PROP_COUNT_LINES_IN_FRAMES
+ ,PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES
+ ,PROP_CREATE_FROM_MARKS
+ ,PROP_CREATE_FROM_OUTLINE
+ ,PROP_CURRENT_PRESENTATION
+ ,PROP_DATA_COLUMN_NAME
+ ,PROP_DEFAULT
+ ,PROP_DELETE
+ ,PROP_DESCRIPTION
+ ,PROP_DISTANCE
+ ,PROP_DROP_CAP_FORMAT
+ ,PROP_FILE_FORMAT
+ ,PROP_FIRST_LINE_INDENT
+ ,PROP_FIRST_LINE_OFFSET
+ ,PROP_FIRST_PAGE
+ ,PROP_FOOTER_BODY_DISTANCE
+ ,PROP_FOOTER_DYNAMIC_SPACING
+ ,PROP_FOOTER_HEIGHT
+ ,PROP_FOOTER_IS_DYNAMIC_HEIGHT
+ ,PROP_FOOTER_IS_ON
+ ,PROP_FOOTER_IS_SHARED
+ ,PROP_FOOTER_TEXT
+ ,PROP_FOOTER_TEXT_LEFT
+ ,PROP_FORMAT
+ ,PROP_FULL_NAME
+ ,PROP_GAMMA
+ ,PROP_GRAPHIC
+ ,PROP_GRAPHIC_COLOR_MODE
+ ,PROP_GRAPHIC_CROP
+ ,PROP_GRID_BASE_HEIGHT
+ ,PROP_GRID_DISPLAY
+ ,PROP_GRID_LINES
+ ,PROP_GRID_MODE
+ ,PROP_GRID_PRINT
+ ,PROP_GRID_RUBY_HEIGHT
+ ,PROP_HEADER_BODY_DISTANCE
+ ,PROP_HEADER_DYNAMIC_SPACING
+ ,PROP_HEADER_HEIGHT
+ ,PROP_HEADER_IS_DYNAMIC_HEIGHT
+ ,PROP_HEADER_IS_ON
+ ,PROP_HEADER_IS_SHARED
+ ,PROP_HEADER_ROW_COUNT
+ ,PROP_HEADER_TEXT
+ ,PROP_HEADER_TEXT_LEFT
+ ,PROP_HEADING_STYLE_NAME
+ ,PROP_HEIGHT
+ ,PROP_HELP
+ ,PROP_HINT
+ ,PROP_HORI_MIRRORED_ON_EVEN_PAGES
+ ,PROP_HORI_MIRRORED_ON_ODD_PAGES
+ ,PROP_HORI_ORIENT
+ ,PROP_HORI_ORIENT_POSITION
+ ,PROP_HORI_ORIENT_RELATION
+ ,PROP_HYPER_LINK_U_R_L
+ ,PROP_INDENT_AT
+ ,PROP_INPUT_STREAM
+ ,PROP_INSERT
+ ,PROP_INTERVAL
+ ,PROP_IS_AUTO_HEIGHT
+ ,PROP_IS_DATE
+ ,PROP_IS_FIXED
+ ,PROP_IS_INPUT
+ ,PROP_IS_LANDSCAPE
+ ,PROP_IS_ON
+ ,PROP_IS_SPLIT_ALLOWED
+ ,PROP_KEYWORDS
+ ,PROP_LEFT_BORDER
+ ,PROP_LEFT_BORDER_DISTANCE
+ ,PROP_LEFT_MARGIN
+ ,PROP_LEVEL
+ ,PROP_LEVEL_FORMAT
+ ,PROP_LEVEL_PARAGRAPH_STYLES
+ ,PROP_LISTTAB_STOP_POSITION
+ ,PROP_MACRO_NAME
+ ,PROP_NAME
+ ,PROP_NUMBERING_LEVEL
+ ,PROP_NUMBERING_RULES
+ ,PROP_NUMBERING_STYLE_NAME
+ ,PROP_NUMBERING_TYPE
+ ,PROP_NUMBER_FORMAT
+ ,PROP_NUMBER_POSITION
+ ,PROP_OPAQUE
+ ,PROP_OUTLINE_LEVEL
+ ,PROP_PAGE_DESC_NAME
+ ,PROP_PAGE_NUMBER_OFFSET
+ ,PROP_PAGE_TOGGLE
+ ,PROP_PARAGRAPH_STYLES
+ ,PROP_PARA_ADJUST
+ ,PROP_PARA_BACK_COLOR
+ ,PROP_PARA_BOTTOM_MARGIN
+ ,PROP_PARA_FIRST_LINE_INDENT
+ ,PROP_PARA_IS_HANGING_PUNCTUATION
+ ,PROP_PARA_IS_HYPHENATION
+ ,PROP_PARA_KEEP_TOGETHER
+ ,PROP_PARA_LAST_LINE_ADJUST
+ ,PROP_PARA_LEFT_MARGIN
+ ,PROP_PARA_LINE_NUMBER_COUNT
+ ,PROP_PARA_LINE_NUMBER_START_VALUE
+ ,PROP_PARA_LINE_SPACING
+ ,PROP_PARA_ORPHANS
+ ,PROP_PARA_RIGHT_MARGIN
+ ,PROP_PARA_SPLIT
+ ,PROP_PARA_STYLE_NAME
+ ,PROP_PARA_TAB_STOPS
+ ,PROP_PARA_TOP_MARGIN
+ ,PROP_PARA_WIDOWS
+ ,PROP_PARENT_NUMBERING
+ ,PROP_POSITION_AND_SPACE_MODE
+ ,PROP_POSITION_PROTECTED
+ ,PROP_PREFIX
+ ,PROP_PRINTER_PAPER_TRAY_INDEX
+ ,PROP_REDLINE_AUTHOR
+ ,PROP_REDLINE_COMMENT
+ ,PROP_REDLINE_DATE_TIME
+ ,PROP_REDLINE_IDENTIFIER
+ ,PROP_REDLINE_SUCCESSOR_DATA
+ ,PROP_REDLINE_TYPE
+ ,PROP_REFERENCE_FIELD_PART
+ ,PROP_REFERENCE_FIELD_SOURCE
+ ,PROP_RESTART_AT_EACH_PAGE
+ ,PROP_RIGHT_BORDER
+ ,PROP_RIGHT_BORDER_DISTANCE
+ ,PROP_RIGHT_MARGIN
+ ,PROP_SEPARATOR_LINE_IS_ON
+ ,PROP_SERVICE_CHAR_STYLE
+ ,PROP_SERVICE_PARA_STYLE
+ ,PROP_SIZE
+ ,PROP_SIZE100th_M_M
+ ,PROP_SIZE_PIXEL
+ ,PROP_SIZE_PROTECTED
+ ,PROP_SIZE_TYPE
+ ,PROP_SOURCE_NAME
+ ,PROP_STANDARD
+ ,PROP_START_AT
+ ,PROP_START_WITH
+ ,PROP_STREAM_NAME
+ ,PROP_SUBJECT
+ ,PROP_SUB_TYPE
+ ,PROP_SUFFIX
+ ,PROP_SURROUND
+ ,PROP_SURROUND_CONTOUR
+ ,PROP_TABLE_BORDER
+ ,PROP_TABLE_BORDER_DISTANCES
+ ,PROP_TABLE_COLUMN_SEPARATORS
+ ,PROP_TABS_RELATIVE_TO_INDENT
+ ,PROP_TAB_STOP_DISTANCE
+ ,PROP_TEXT
+ ,PROP_TEXT_COLUMNS
+ ,PROP_TEXT_RANGE
+ ,PROP_TITLE
+ ,PROP_TOKEN_CHAPTER_INFO
+ ,PROP_TOKEN_HYPERLINK_END
+ ,PROP_TOKEN_HYPERLINK_START
+ ,PROP_TOKEN_TEXT
+ ,PROP_TOKEN_TYPE
+ ,PROP_TOP_BORDER
+ ,PROP_TOP_BORDER_DISTANCE
+ ,PROP_TOP_MARGIN
+ ,PROP_USER_DATA_TYPE
+ ,PROP_VERTICAL_MERGE
+ ,PROP_VERT_MIRRORED
+ ,PROP_VERT_ORIENT
+ ,PROP_VERT_ORIENT_POSITION
+ ,PROP_VERT_ORIENT_RELATION
+ ,PROP_WIDTH
+ ,PROP_WIDTH_TYPE
+ ,PROP_WRITING_MODE
+ };
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier
{
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 11930fb01972..f8dcb0592cee 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -112,13 +112,43 @@ uno::Sequence< beans::PropertyValue > PropertyMap::GetPropertyValues()
}
return m_aValues;
}
-/*-------------------------------------------------------------------------
- -----------------------------------------------------------------------*/
+void lcl_AnyToTag(XMLTag::Pointer_t pTag, const uno::Any & rAny)
+{
+ try {
+ sal_Int32 aInt = 0;
+ rAny >>= aInt;
+ pTag->addAttr("value", aInt);
+
+ sal_uInt32 auInt = 0;
+ rAny >>= auInt;
+ pTag->addAttr("unsignedValue", auInt);
+
+ float aFloat = 0.0f;
+ rAny >>= aFloat;
+ pTag->addAttr("floatValue", aFloat);
+
+ ::rtl::OUString aStr;
+ rAny >>= aStr;
+ pTag->addAttr("stringValue", aStr);
+ }
+ catch (...) {
+ }
+}
+
void PropertyMap::Insert( PropertyIds eId, bool bIsTextProperty, const uno::Any& rAny, bool bOverwrite )
{
-// const ::rtl::OUString& rInsert = PropertyNameSupplier::
-// GetPropertyNameSupplier().GetName(eId);
+#ifdef DEBUG_DMAPPER_PROPERTY_MAP
+ const ::rtl::OUString& rInsert = PropertyNameSupplier::
+ GetPropertyNameSupplier().GetName(eId);
+
+ XMLTag::Pointer_t pTag(new XMLTag("propertyMap.insert"));
+ pTag->addAttr("name", rInsert);
+ lcl_AnyToTag(pTag, rAny);
+
+ dmapper_logger->addTag(pTag);
+#endif
+
PropertyMap::iterator aElement = find(PropertyDefinition( eId, bIsTextProperty ) );
if( aElement != end())
{
@@ -132,7 +162,6 @@ void PropertyMap::Insert( PropertyIds eId, bool bIsTextProperty, const uno::Any&
Invalidate();
}
-#ifdef DEBUG_DOMAINMAPPER
XMLTag::Pointer_t PropertyMap::toTag() const
{
XMLTag::Pointer_t pResult(new XMLTag("PropertyMap"));
@@ -153,15 +182,15 @@ XMLTag::Pointer_t PropertyMap::toTag() const
default:
{
try {
- sal_Int32 aInt;
+ sal_Int32 aInt = 0;
aMapIter->second >>= aInt;
pTag->addAttr("value", aInt);
- sal_uInt32 auInt;
+ sal_uInt32 auInt = 0;
aMapIter->second >>= auInt;
pTag->addAttr("unsignedValue", auInt);
- float aFloat;
+ float aFloat = 0.0;
aMapIter->second >>= aFloat;
pTag->addAttr("floatValue", aFloat);
@@ -182,7 +211,6 @@ XMLTag::Pointer_t PropertyMap::toTag() const
return pResult;
}
-#endif
/*-- 13.12.2006 10:46:42---------------------------------------------------
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 16886530f324..b6dcad6d63b2 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -39,9 +39,7 @@
#include <map>
#include <vector>
-#ifdef DEBUG_DOMAINMAPPER
#include <resourcemodel/TagLogger.hxx>
-#endif
namespace com{namespace sun{namespace star{
namespace beans{
@@ -136,10 +134,7 @@ public:
virtual void insertTableProperties( const PropertyMap* );
-#ifdef DEBUG_DOMAINMAPPER
virtual XMLTag::Pointer_t toTag() const;
-#endif
-
};
typedef boost::shared_ptr<PropertyMap> PropertyMapPtr;
diff --git a/writerfilter/source/dmapper/PropertyMapHelper.cxx b/writerfilter/source/dmapper/PropertyMapHelper.cxx
index 4fb4c759289d..3496c5e04f44 100644
--- a/writerfilter/source/dmapper/PropertyMapHelper.cxx
+++ b/writerfilter/source/dmapper/PropertyMapHelper.cxx
@@ -32,7 +32,6 @@
#include <resourcemodel/TagLogger.hxx>
#include "PropertyMapHelper.hxx"
-#ifdef DEBUG
namespace writerfilter
{
namespace dmapper
@@ -128,4 +127,3 @@ XMLTag::Pointer_t lcl_PropertyValueSeqSeqToTag(PropertyValueSeqSeq_t rPropValSeq
}
}
-#endif // DEBUG
diff --git a/writerfilter/source/dmapper/PropertyMapHelper.hxx b/writerfilter/source/dmapper/PropertyMapHelper.hxx
index 4a528f1736c0..fc9ea0a85bb4 100644
--- a/writerfilter/source/dmapper/PropertyMapHelper.hxx
+++ b/writerfilter/source/dmapper/PropertyMapHelper.hxx
@@ -28,7 +28,6 @@
*
************************************************************************/
-#ifdef DEBUG
#include "PropertyMap.hxx"
#include <com/sun/star/beans/PropertyValues.hpp>
@@ -47,4 +46,3 @@ typedef uno::Sequence<PropertyValueSeq_t> PropertyValueSeqSeq_t;
XMLTag::Pointer_t lcl_PropertyValueSeqSeqToTag(PropertyValueSeqSeq_t & rPropValSeqSeq);
}
}
-#endif // DEBUG
diff --git a/writerfilter/source/dmapper/SectionColumnHandler.cxx b/writerfilter/source/dmapper/SectionColumnHandler.cxx
index 5ad3e51fb8b7..e00b0c7558fa 100644
--- a/writerfilter/source/dmapper/SectionColumnHandler.cxx
+++ b/writerfilter/source/dmapper/SectionColumnHandler.cxx
@@ -30,6 +30,8 @@
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -40,10 +42,11 @@ using namespace ::com::sun::star;
-----------------------------------------------------------------------*/
SectionColumnHandler::SectionColumnHandler() :
- bEqualWidth( false ),
- nSpace( 0 ),
- nNum( 0 ),
- bSep( false )
+LoggedProperties(dmapper_logger, "SectionColumnHandler"),
+bEqualWidth( false ),
+nSpace( 0 ),
+nNum( 0 ),
+bSep( false )
{
}
/*-- 02.06.2008 13:36:24---------------------------------------------------
@@ -55,7 +58,7 @@ SectionColumnHandler::~SectionColumnHandler()
/*-- 02.06.2008 13:36:24---------------------------------------------------
-----------------------------------------------------------------------*/
-void SectionColumnHandler::attribute(Id rName, Value & rVal)
+void SectionColumnHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
/* WRITERFILTERSTATUS: table: SectionColumnHandler_attributedata */
@@ -93,7 +96,7 @@ void SectionColumnHandler::attribute(Id rName, Value & rVal)
/*-- 02.06.2008 13:36:24---------------------------------------------------
-----------------------------------------------------------------------*/
-void SectionColumnHandler::sprm(Sprm & rSprm)
+void SectionColumnHandler::lcl_sprm(Sprm & rSprm)
{
/* WRITERFILTERSTATUS: table: SectionColumnHandler_sprm */
switch( rSprm.getId())
diff --git a/writerfilter/source/dmapper/SectionColumnHandler.hxx b/writerfilter/source/dmapper/SectionColumnHandler.hxx
index 452895b50194..7742f5d4a22b 100644
--- a/writerfilter/source/dmapper/SectionColumnHandler.hxx
+++ b/writerfilter/source/dmapper/SectionColumnHandler.hxx
@@ -28,7 +28,7 @@
#define INCLUDED_SECTIONCOLUMNHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
@@ -44,7 +44,7 @@ struct _Column
};
-class WRITERFILTER_DLLPRIVATE SectionColumnHandler : public Properties
+class WRITERFILTER_DLLPRIVATE SectionColumnHandler : public LoggedProperties
{
bool bEqualWidth;
sal_Int32 nSpace;
@@ -54,14 +54,14 @@ class WRITERFILTER_DLLPRIVATE SectionColumnHandler : public Properties
_Column aTempColumn;
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
SectionColumnHandler();
virtual ~SectionColumnHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
bool IsEqualWidth() const { return bEqualWidth; }
sal_Int32 GetSpace() const { return nSpace; }
sal_Int32 GetNum() const { return nNum; }
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index e711240b65d0..6065d33ddb17 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -28,20 +28,17 @@
*
************************************************************************/
+#include <stdio.h>
+#include <rtl/ustring.hxx>
#include <resourcemodel/ResourceModelHelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-
#include <SettingsTable.hxx>
+#include <resourcemodel/ResourceModelHelper.hxx>
#include <doctok/resourceids.hxx>
#include <ooxml/resourceids.hxx>
-#include <stdio.h>
#include <ConversionHelper.hxx>
-#include <rtl/ustring.hxx>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/QNameToString.hxx>
#include "dmapperLoggers.hxx"
-#endif
namespace writerfilter {
@@ -97,10 +94,13 @@ struct SettingsTable_Impl
, m_nCryptAlgorithmType(NS_ooxml::LN_Value_wordprocessingml_ST_AlgType_typeAny)
, m_nCryptSpinCount(0)
{}
+
};
-SettingsTable::SettingsTable(DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory) :
-m_pImpl( new SettingsTable_Impl(rDMapper, xTextFactory) )
+SettingsTable::SettingsTable(DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory)
+: LoggedProperties(dmapper_logger, "SettingsTable")
+, LoggedTable(dmapper_logger, "SettingsTable")
+, m_pImpl( new SettingsTable_Impl(rDMapper, xTextFactory) )
{
// printf("SettingsTable::SettingsTable()\n");
}
@@ -110,14 +110,8 @@ SettingsTable::~SettingsTable()
delete m_pImpl;
}
-void SettingsTable::attribute(Id nName, Value & val)
+void SettingsTable::lcl_attribute(Id nName, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("SettingsTable.attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
- dmapper_logger->attribute("value", val.toString());
-#endif
-
(void) nName;
int nIntValue = val.getInt();
(void)nIntValue;
@@ -137,18 +131,10 @@ void SettingsTable::attribute(Id nName, Value & val)
}
}
#endif
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("SettingsTable.attribute");
-#endif
}
-void SettingsTable::sprm(Sprm& rSprm)
+void SettingsTable::lcl_sprm(Sprm& rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("SettingsTable.sprm");
- dmapper_logger->chars(rSprm.toString());
-#endif
-
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
@@ -237,16 +223,14 @@ void SettingsTable::sprm(Sprm& rSprm)
break;
default:
{
- OSL_ENSURE( false, "unknown sprmid in SettingsTable::sprm()");
+#ifdef DEBUG_DMAPPER_SETTINGS_TABLE
+ dmapper_logger->element("unhandled");
+#endif
}
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("SettingsTable.sprm");
-#endif
}
-void SettingsTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void SettingsTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
// printf ( "SettingsTable::entry\n");
ref->resolve(*this);
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index cb3e7913c5e7..64034c83559b 100755..100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -32,7 +32,7 @@
#define INCLUDED_SETTINGSTABLE_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <map>
@@ -53,7 +53,7 @@ using namespace std;
struct SettingsTable_Impl;
-class WRITERFILTER_DLLPRIVATE SettingsTable : public Properties, public Table
+class WRITERFILTER_DLLPRIVATE SettingsTable : public LoggedProperties, public LoggedTable
{
SettingsTable_Impl *m_pImpl;
@@ -63,18 +63,19 @@ class WRITERFILTER_DLLPRIVATE SettingsTable : public Properties, public Table
);
virtual ~SettingsTable();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
//returns default TabStop in 1/100th mm
int GetDefaultTabStop() const;
void ApplyProperties( uno::Reference< text::XTextDocument > xDoc );
+ private:
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
};
typedef boost::shared_ptr< SettingsTable > SettingsTablePtr;
}}
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 5088e8729577..a0d5039a155b 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -47,10 +47,7 @@
#include <stdio.h>
#include <rtl/ustrbuf.hxx>
-#ifdef DEBUG_DOMAINMAPPER
#include <dmapperLoggers.hxx>
-#include <resourcemodel/QNameToString.hxx>
-#endif
using namespace ::com::sun::star;
namespace writerfilter {
@@ -82,32 +79,11 @@ StyleSheetEntry::~StyleSheetEntry()
{
}
-#ifdef DEBUG_DOMAINMAPPER
-XMLTag::Pointer_t StyleSheetEntry::toTag()
-{
- XMLTag::Pointer_t pResult(new XMLTag("StyleSheetEntry"));
-
- pResult->addAttr("identifierI", sStyleIdentifierI);
- pResult->addAttr("identifierD", sStyleIdentifierD);
- pResult->addAttr("default", bIsDefaultStyle ? "true" : "false");
- pResult->addAttr("invalidHeight", bInvalidHeight ? "true" : "false");
- pResult->addAttr("hasUPE", bHasUPE ? "true" : "false");
- pResult->addAttr("styleType", nStyleTypeCode);
- pResult->addAttr("baseStyle", sBaseStyleIdentifier);
- pResult->addAttr("nextStyle", sNextStyleIdentifier);
- pResult->addAttr("styleName", sStyleName);
- pResult->addAttr("styleName1", sStyleName1);
- pResult->addAttr("convertedName", sConvertedStyleName);
- pResult->addTag(pProperties->toTag());
-
- return pResult;
-}
-#endif
-
TableStyleSheetEntry::TableStyleSheetEntry( StyleSheetEntry& rEntry, StyleSheetTable* pStyles ):
StyleSheetEntry( ),
m_pStyleSheet( pStyles )
{
+
bIsDefaultStyle = rEntry.bIsDefaultStyle;
bInvalidHeight = rEntry.bInvalidHeight;
bHasUPE = rEntry.bHasUPE;
@@ -128,13 +104,6 @@ TableStyleSheetEntry::~TableStyleSheetEntry( )
void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, PropertyMapPtr pProps )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("AddTblStylePr");
- dmapper_logger->attribute("type", nType);
- dmapper_logger->addTag(pProps->toTag());
- dmapper_logger->endElement("AddTblStylePr");
-#endif
-
static TblStyleType pTypesToFix[] =
{
TBL_STYLE_FIRSTROW,
@@ -180,7 +149,7 @@ void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, PropertyMapPtr pPr
m_aStyles[nType] = pProps;
}
-PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask )
+PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetEntryDequePtr pStack )
{
PropertyMapPtr pProps( new PropertyMap );
@@ -189,8 +158,20 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask )
if ( pEntry.get( ) )
{
+ if (pStack.get() == NULL)
+ pStack.reset(new StyleSheetEntryDeque());
+
+ StyleSheetEntryDeque::const_iterator aIt = find(pStack->begin(), pStack->end(), pEntry);
+
+ if (aIt != pStack->end())
+ {
+ pStack->push_back(pEntry);
+
TableStyleSheetEntry* pParent = static_cast<TableStyleSheetEntry *>( pEntry.get( ) );
- pProps->insert( pParent->GetProperties( nMask ) );
+ pProps->insert( pParent->GetProperties( nMask ), pStack );
+
+ pStack->pop_back();
+ }
}
// And finally get the mask ones
@@ -199,24 +180,6 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask )
return pProps;
}
-#ifdef DEBUG_DOMAINMAPPER
-XMLTag::Pointer_t TableStyleSheetEntry::toTag()
-{
- XMLTag::Pointer_t pResult(StyleSheetEntry::toTag());
-
- for (sal_Int32 nBit = 0; nBit < 13; ++nBit)
- {
- PropertyMapPtr pMap = GetProperties(1 << nBit);
-
- XMLTag::Pointer_t pTag = pMap->toTag();
- pTag->addAttr("kind", nBit);
- pResult->addTag(pTag);
- }
-
- return pResult;
-}
-#endif
-
void lcl_mergeProps( PropertyMapPtr pToFill, PropertyMapPtr pToAdd, TblStyleType nStyleId )
{
static PropertyIds pPropsToCheck[] =
@@ -398,8 +361,10 @@ StyleSheetTable_Impl::StyleSheetTable_Impl(DomainMapper& rDMapper, uno::Referenc
/*-- 19.06.2006 12:04:32---------------------------------------------------
-----------------------------------------------------------------------*/
-StyleSheetTable::StyleSheetTable(DomainMapper& rDMapper, uno::Reference< text::XTextDocument> xTextDocument) :
- m_pImpl( new StyleSheetTable_Impl(rDMapper, xTextDocument) )
+StyleSheetTable::StyleSheetTable(DomainMapper& rDMapper, uno::Reference< text::XTextDocument> xTextDocument)
+: LoggedProperties(dmapper_logger, "StyleSheetTable")
+, LoggedTable(dmapper_logger, "StyleSheetTable")
+, m_pImpl( new StyleSheetTable_Impl(rDMapper, xTextDocument) )
{
}
/*-- 19.06.2006 12:04:33---------------------------------------------------
@@ -412,14 +377,8 @@ StyleSheetTable::~StyleSheetTable()
/*-- 19.06.2006 12:04:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void StyleSheetTable::attribute(Id Name, Value & val)
+void StyleSheetTable::lcl_attribute(Id Name, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("StyleSheetTable.attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(Name));
- dmapper_logger->attribute("value", val.toString());
-#endif
-
OSL_ENSURE( m_pImpl->m_pCurrentEntry, "current entry has to be set here");
if(!m_pImpl->m_pCurrentEntry)
return ;
@@ -541,21 +500,12 @@ void StyleSheetTable::attribute(Id Name, Value & val)
}
break;
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("StyleSheetTable.attribute");
-#endif
}
/*-- 19.06.2006 12:04:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void StyleSheetTable::sprm(Sprm & rSprm)
+void StyleSheetTable::lcl_sprm(Sprm & rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("StyleSheetTable.sprm");
- dmapper_logger->attribute("sprm", rSprm.toString());
-#endif
-
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
sal_Int32 nIntValue = pValue.get() ? pValue->getInt() : 0;
@@ -599,7 +549,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
break;
case NS_ooxml::LN_CT_Style_tblPr: //contains table properties
case NS_ooxml::LN_CT_Style_tblStylePr: //contains to table properties
- case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
+
case NS_ooxml::LN_CT_TblPrBase_tblInd: //table properties - at least width value and type
case NS_ooxml::LN_EG_RPrBase_rFonts: //table fonts
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
@@ -629,6 +579,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
break;
}
case NS_ooxml::LN_CT_PPrDefault_pPr:
+ case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pDefaultParaProps );
m_pImpl->m_rDMapper.sprm( rSprm );
@@ -636,6 +587,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
applyDefaults( true );
break;
case NS_ooxml::LN_CT_RPrDefault_rPr:
+ case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
/* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pDefaultCharProps );
m_pImpl->m_rDMapper.sprm( rSprm );
@@ -676,6 +628,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
pTEntry->m_nColBandSize = nIntValue;
}
}
+ break;
case NS_ooxml::LN_CT_TblPrBase_tblCellMar:
//no cell margins in styles
break;
@@ -697,7 +650,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pCurrentEntry->pProperties );
PropertyMapPtr pProps(new PropertyMap());
- m_pImpl->m_rDMapper.sprm( rSprm, pProps );
+ m_pImpl->m_rDMapper.sprmWithProps( rSprm, pProps );
m_pImpl->m_pCurrentEntry->pProperties->insert(pProps);
@@ -705,21 +658,13 @@ void StyleSheetTable::sprm(Sprm & rSprm)
}
}
break;
- }
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("StyleSheetTable.sprm");
-#endif
+}
}
/*-- 19.06.2006 12:04:33---------------------------------------------------
-----------------------------------------------------------------------*/
-void StyleSheetTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void StyleSheetTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("StyleSheetTable.entry");
-#endif
-
//create a new style entry
// printf("StyleSheetTable::entry(...)\n");
OSL_ENSURE( !m_pImpl->m_pCurrentEntry, "current entry has to be NULL here");
@@ -739,16 +684,8 @@ void StyleSheetTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Po
//TODO: this entry contains the default settings - they have to be added to the settings
}
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->addTag(m_pImpl->m_pCurrentEntry->toTag());
-#endif
-
StyleSheetEntryPtr pEmptyEntry;
m_pImpl->m_pCurrentEntry = pEmptyEntry;
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("StyleSheetTable.entry");
-#endif
}
/*-- 21.06.2006 15:34:49---------------------------------------------------
sorting helper
@@ -808,10 +745,6 @@ uno::Sequence< ::rtl::OUString > PropValVector::getNames()
-----------------------------------------------------------------------*/
void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("applyStyleSheets");
-#endif
-
try
{
uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( m_pImpl->m_xTextDocument, uno::UNO_QUERY_THROW );
@@ -970,24 +903,13 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
PropValVector aSortedPropVals;
for( sal_Int32 nProp = 0; nProp < aPropValues.getLength(); ++nProp)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("propvalue");
- dmapper_logger->attribute("name", aPropValues[nProp].Name);
- dmapper_logger->attribute("value", aPropValues[nProp].Value);
-#endif
// Don't add the style name properties
bool bIsParaStyleName = aPropValues[nProp].Name.equalsAscii( "ParaStyleName" );
bool bIsCharStyleName = aPropValues[nProp].Name.equalsAscii( "CharStyleName" );
if ( !bIsParaStyleName && !bIsCharStyleName )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->element("insert");
-#endif
aSortedPropVals.Insert( aPropValues[nProp] );
}
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("propvalue");
-#endif
}
if(bAddFollowStyle)
{
@@ -1038,12 +960,6 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
if(bInsert)
{
xStyles->insertByName( sConvertedStyleName, uno::makeAny( xStyle) );
-#ifdef DEBUG_DOMAINMAPPER
- uno::Reference<beans::XPropertySet> xProps(xStyle, uno::UNO_QUERY);
- dmapper_logger->startElement("insertStyle");
- dmapper_logger->addTag(unoPropertySetToTag(xProps));
- dmapper_logger->endElement("insertStyle");
-#endif
}
}
++aIt;
@@ -1055,10 +971,6 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
(void)rEx;
OSL_ENSURE( false, "Styles could not be imported completely");
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement("applyStyleSheets");
-#endif
}
/*-- 22.06.2006 15:56:56---------------------------------------------------
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx
index e4441bcb05fe..f6a8b44efa5d 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -34,11 +34,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <PropertyMap.hxx>
#include <FontTable.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
-
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/TagLogger.hxx>
-#endif
+#include <resourcemodel/LoggedResources.hxx>
namespace com{ namespace sun { namespace star { namespace text{
class XTextDocument;
@@ -76,20 +72,18 @@ public:
PropertyMapPtr pProperties;
::rtl::OUString sConvertedStyleName;
-#ifdef DEBUG_DOMAINMAPPER
- virtual XMLTag::Pointer_t toTag();
-#endif
-
StyleSheetEntry();
virtual ~StyleSheetEntry();
};
typedef boost::shared_ptr<StyleSheetEntry> StyleSheetEntryPtr;
+typedef ::std::deque<StyleSheetEntryPtr> StyleSheetEntryDeque;
+typedef boost::shared_ptr<StyleSheetEntryDeque> StyleSheetEntryDequePtr;
class DomainMapper;
class StyleSheetTable :
- public Properties,
- public Table
+ public LoggedProperties,
+ public LoggedTable
{
StyleSheetTable_Impl *m_pImpl;
@@ -98,13 +92,6 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument> xTextDocument );
virtual ~StyleSheetTable();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
void ApplyStyleSheets( FontTablePtr rFontTable );
const StyleSheetEntryPtr FindStyleSheetByISTD(const ::rtl::OUString& sIndex);
const StyleSheetEntryPtr FindStyleSheetByStyleName(const ::rtl::OUString& rIndex);
@@ -118,6 +105,13 @@ public:
::rtl::OUString getOrCreateCharStyle( PropertyValueVector_t& rCharProperties );
private:
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
void resolveAttributeProperties(Value & val);
void resolveSprmProps(Sprm & sprm_);
void applyDefaults(bool bParaProperties);
@@ -146,11 +140,10 @@ public:
// Gets all the properties
// + corresponding to the mask,
// + from the parent styles
- PropertyMapPtr GetProperties( sal_Int32 nMask );
-
-#ifdef DEBUG_DOMAINMAPPER
- virtual XMLTag::Pointer_t toTag();
-#endif
+ //
+ // @param mask mask describing which properties to return
+ // @param pStack already processed StyleSheetEntries
+ PropertyMapPtr GetProperties( sal_Int32 nMask, StyleSheetEntryDequePtr pStack = StyleSheetEntryDequePtr());
TableStyleSheetEntry( StyleSheetEntry& aEntry, StyleSheetTable* pStyles );
virtual ~TableStyleSheetEntry( );
diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx b/writerfilter/source/dmapper/TDefTableHandler.cxx
index c65ce2cdb784..fd63fe378c76 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.cxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.cxx
@@ -33,6 +33,8 @@
#include <com/sun/star/text/TableColumnSeparator.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -42,11 +44,12 @@ using namespace ::com::sun::star;
-----------------------------------------------------------------------*/
TDefTableHandler::TDefTableHandler(bool bOOXML) :
- m_nLineWidth(0),
- m_nLineType(0),
- m_nLineColor(0),
- m_nLineDistance(0),
- m_bOOXML( bOOXML )
+LoggedProperties(dmapper_logger, "TDefTableHandler"),
+m_nLineWidth(0),
+m_nLineType(0),
+m_nLineColor(0),
+m_nLineDistance(0),
+m_bOOXML( bOOXML )
{
}
/*-- 24.04.2007 09:06:35---------------------------------------------------
@@ -58,7 +61,7 @@ TDefTableHandler::~TDefTableHandler()
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void TDefTableHandler::attribute(Id rName, Value & rVal)
+void TDefTableHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)nIntValue;
@@ -214,7 +217,7 @@ void TDefTableHandler::localResolve(Id rName, writerfilter::Reference<Properties
/*-- 24.04.2007 09:06:35---------------------------------------------------
-----------------------------------------------------------------------*/
-void TDefTableHandler::sprm(Sprm & rSprm)
+void TDefTableHandler::lcl_sprm(Sprm & rSprm)
{
/* WRITERFILTERSTATUS: table: TDefTable_sprm */
switch( rSprm.getId() )
diff --git a/writerfilter/source/dmapper/TDefTableHandler.hxx b/writerfilter/source/dmapper/TDefTableHandler.hxx
index 993b49251a77..3bd25adeb6ea 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.hxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.hxx
@@ -28,7 +28,7 @@
#define INCLUDED_TDEFTABLEHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/table/BorderLine.hpp>
#include <vector>
@@ -41,7 +41,7 @@ namespace dmapper
{
class PropertyMap;
class TablePropertyMap;
-class WRITERFILTER_DLLPRIVATE TDefTableHandler : public Properties
+class WRITERFILTER_DLLPRIVATE TDefTableHandler : public LoggedProperties
{
public:
@@ -67,14 +67,15 @@ private:
bool m_bOOXML;
void localResolve(Id Name, writerfilter::Reference<Properties>::Pointer_t pProperties);
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
TDefTableHandler( bool bOOXML );
virtual ~TDefTableHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
size_t getCellCount() const;
void fillCellProperties( size_t nCell, ::boost::shared_ptr< TablePropertyMap > pCellProperties) const;
::boost::shared_ptr<PropertyMap> getRowProperties() const;
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx
index 53838353c3b0..02d134786357 100644
--- a/writerfilter/source/dmapper/TblStylePrHandler.cxx
+++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx
@@ -4,14 +4,17 @@
#include <dmapperLoggers.hxx>
#include <resourcemodel/QNameToString.hxx>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
TblStylePrHandler::TblStylePrHandler( DomainMapper & rDMapper ) :
- m_rDMapper( rDMapper ),
- m_pTablePropsHandler( new TablePropertiesHandler( true ) ),
- m_nType( TBL_STYLE_UNKNOWN ),
- m_pProperties( new PropertyMap )
+LoggedProperties(dmapper_logger, "TblStylePrHandler"),
+m_rDMapper( rDMapper ),
+m_pTablePropsHandler( new TablePropertiesHandler( true ) ),
+m_nType( TBL_STYLE_UNKNOWN ),
+m_pProperties( new PropertyMap )
{
}
@@ -20,7 +23,7 @@ TblStylePrHandler::~TblStylePrHandler( )
delete m_pTablePropsHandler, m_pTablePropsHandler = NULL;
}
-void TblStylePrHandler::attribute(Id rName, Value & rVal)
+void TblStylePrHandler::lcl_attribute(Id rName, Value & rVal)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TblStylePrHandler.attribute");
@@ -41,7 +44,7 @@ void TblStylePrHandler::attribute(Id rName, Value & rVal)
}
}
-void TblStylePrHandler::sprm(Sprm & rSprm)
+void TblStylePrHandler::lcl_sprm(Sprm & rSprm)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TblStylePrHandler.sprm");
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.hxx b/writerfilter/source/dmapper/TblStylePrHandler.hxx
index dd8d2da97690..b76782b0edfe 100644
--- a/writerfilter/source/dmapper/TblStylePrHandler.hxx
+++ b/writerfilter/source/dmapper/TblStylePrHandler.hxx
@@ -5,7 +5,7 @@
#include <dmapper/DomainMapper.hxx>
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace writerfilter {
@@ -32,7 +32,7 @@ enum TblStyleType
TBL_STYLE_SWCELL
};
-class WRITERFILTER_DLLPRIVATE TblStylePrHandler : public Properties
+class WRITERFILTER_DLLPRIVATE TblStylePrHandler : public LoggedProperties
{
private:
DomainMapper & m_rDMapper;
@@ -41,14 +41,14 @@ private:
TblStyleType m_nType;
PropertyMapPtr m_pProperties;
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
TblStylePrHandler( DomainMapper & rDMapper );
virtual ~TblStylePrHandler( );
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
inline PropertyMapPtr getProperties() { return m_pProperties; };
inline TblStyleType getType() { return m_nType; };
diff --git a/writerfilter/source/dmapper/ThemeTable.cxx b/writerfilter/source/dmapper/ThemeTable.cxx
index 0f0becf06552..74f166dcf313 100644
--- a/writerfilter/source/dmapper/ThemeTable.cxx
+++ b/writerfilter/source/dmapper/ThemeTable.cxx
@@ -30,11 +30,7 @@
#include <doctok/resourceids.hxx>
#include <ooxml/resourceids.hxx>
#endif
-#include <stdio.h>
-#ifdef DEBUG_DOMAINMAPPER
#include "dmapperLoggers.hxx"
-#include <resourcemodel/QNameToString.hxx>
-#endif
namespace writerfilter {
namespace dmapper
@@ -50,8 +46,10 @@ struct ThemeTable_Impl
std::map<sal_uInt32, ::rtl::OUString> m_currentFontThemeEntry;
};
-ThemeTable::ThemeTable() :
- m_pImpl( new ThemeTable_Impl )
+ThemeTable::ThemeTable()
+: LoggedProperties(dmapper_logger, "ThemeTable")
+, LoggedTable(dmapper_logger, "ThemeTable")
+, m_pImpl( new ThemeTable_Impl )
{
// printf("ThemeTable::ThemeTable()\n");
}
@@ -61,7 +59,7 @@ ThemeTable::~ThemeTable()
delete m_pImpl;
}
-void ThemeTable::attribute(Id Name, Value & val)
+void ThemeTable::lcl_attribute(Id Name, Value & val)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("ThemeTable.attribute");
@@ -91,7 +89,7 @@ void ThemeTable::attribute(Id Name, Value & val)
#endif
}
-void ThemeTable::sprm(Sprm& rSprm)
+void ThemeTable::lcl_sprm(Sprm& rSprm)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("ThemeTable.sprm");
@@ -156,7 +154,7 @@ void ThemeTable::sprm(Sprm& rSprm)
#endif
}
-void ThemeTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void ThemeTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("ThemeTable.entry");
diff --git a/writerfilter/source/dmapper/ThemeTable.hxx b/writerfilter/source/dmapper/ThemeTable.hxx
index b79877703c58..1396c4cee8c9 100644
--- a/writerfilter/source/dmapper/ThemeTable.hxx
+++ b/writerfilter/source/dmapper/ThemeTable.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_THEMETABLE_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <map>
@@ -39,7 +39,7 @@ namespace dmapper
struct ThemeTable_Impl;
-class WRITERFILTER_DLLPRIVATE ThemeTable : public Properties, public Table
+class WRITERFILTER_DLLPRIVATE ThemeTable : public LoggedProperties, public LoggedTable
{
ThemeTable_Impl *m_pImpl;
@@ -47,14 +47,15 @@ public:
ThemeTable();
virtual ~ThemeTable();
+ const ::rtl::OUString getFontNameForTheme(const Id id) const;
+
+ private:
// Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
// Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
- const ::rtl::OUString getFontNameForTheme(const Id id) const;
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
};
typedef boost::shared_ptr< ThemeTable > ThemeTablePtr;
}}
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.cxx b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
new file mode 100644
index 000000000000..2aabc1a375a9
--- /dev/null
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/drawing/PointSequence.hpp>
+
+#include <ooxml/resourceids.hxx>
+#include <resourcemodel/ResourceModelHelper.hxx>
+
+#include "ConversionHelper.hxx"
+#include "WrapPolygonHandler.hxx"
+#include "dmapperLoggers.hxx"
+
+namespace writerfilter {
+
+using resourcemodel::resolveSprmProps;
+
+namespace dmapper {
+
+WrapPolygon::WrapPolygon()
+{
+}
+
+WrapPolygon::~WrapPolygon()
+{
+}
+
+void WrapPolygon::addPoint(const awt::Point & rPoint)
+{
+ mPoints.push_back(rPoint);
+}
+
+WrapPolygon::Points_t::const_iterator WrapPolygon::begin() const
+{
+ return mPoints.begin();
+}
+
+WrapPolygon::Points_t::const_iterator WrapPolygon::end() const
+{
+ return mPoints.end();
+}
+
+WrapPolygon::Points_t::iterator WrapPolygon::begin()
+{
+ return mPoints.begin();
+}
+
+WrapPolygon::Points_t::iterator WrapPolygon::end()
+{
+ return mPoints.end();
+}
+
+size_t WrapPolygon::size() const
+{
+ return mPoints.size();
+}
+
+WrapPolygon::Pointer_t WrapPolygon::move(const awt::Point & rPoint)
+{
+ WrapPolygon::Pointer_t pResult(new WrapPolygon);
+
+ Points_t::iterator aIt = begin();
+ Points_t::iterator aItEnd = end();
+
+ while (aIt != aItEnd)
+ {
+ awt::Point aPoint(aIt->X + rPoint.X, aIt->Y + rPoint.Y);
+ pResult->addPoint(aPoint);
+ aIt++;
+ }
+
+ return pResult;
+}
+
+WrapPolygon::Pointer_t WrapPolygon::scale(const Fraction & rFractionX, const Fraction & rFractionY)
+{
+ WrapPolygon::Pointer_t pResult(new WrapPolygon);
+
+ Points_t::iterator aIt = begin();
+ Points_t::iterator aItEnd = end();
+
+ while (aIt != aItEnd)
+ {
+ awt::Point aPoint(Fraction(aIt->X) * rFractionX, Fraction(aIt->Y) * rFractionY);
+ pResult->addPoint(aPoint);
+ aIt++;
+ }
+
+ return pResult;
+}
+
+WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize)
+{
+ WrapPolygon::Pointer_t pResult;
+
+ const sal_uInt32 nWrap100Percent = 21600;
+
+ Fraction aMove(nWrap100Percent, rSrcSize.Width);
+ aMove = aMove * Fraction(15, 1);
+ awt::Point aMovePoint(aMove, 0);
+ pResult = move(aMovePoint);
+
+ Fraction aScaleX(nWrap100Percent, Fraction(nWrap100Percent) + aMove);
+ Fraction aScaleY(nWrap100Percent, Fraction(nWrap100Percent) - aMove);
+ pResult = pResult->scale(aScaleX, aScaleY);
+
+ Fraction aScaleDestX(rDstSize.Width, nWrap100Percent);
+ Fraction aScaleDestY(rDstSize.Height, nWrap100Percent);
+ pResult = pResult->scale(aScaleDestX, aScaleDestY);
+
+ return pResult;
+}
+
+drawing::PointSequenceSequence WrapPolygon::getPointSequenceSequence() const
+{
+ drawing::PointSequenceSequence aPolyPolygon(1L);
+ drawing::PointSequence * pPolygon = aPolyPolygon.getArray();
+ pPolygon->realloc(size());
+
+ sal_uInt32 n = 0;
+ Points_t::const_iterator aIt = begin();
+ Points_t::const_iterator aItEnd = end();
+
+ while (aIt != aItEnd)
+ {
+ (*pPolygon)[n] = *aIt;
+ ++n;
+ aIt++;
+ }
+
+ return aPolyPolygon;
+}
+
+WrapPolygonHandler::WrapPolygonHandler()
+: LoggedProperties(dmapper_logger, "WrapPolygonHandler")
+, mpPolygon(new WrapPolygon)
+{
+}
+
+WrapPolygonHandler::~WrapPolygonHandler()
+{
+}
+
+void WrapPolygonHandler::lcl_attribute(Id Name, Value & val)
+{
+ sal_Int32 nIntValue = val.getInt();
+
+ switch(Name)
+ {
+ case NS_ooxml::LN_CT_Point2D_x:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ mnX = nIntValue;
+ break;
+ case NS_ooxml::LN_CT_Point2D_y:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ mnY = nIntValue;
+ break;
+ default:
+#ifdef DEBUG_WRAP_POLYGON_HANDLER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
+ }
+}
+
+void WrapPolygonHandler::lcl_sprm(Sprm & _sprm)
+{
+ switch (_sprm.getId())
+ {
+ case NS_ooxml::LN_CT_WrapPath_lineTo:
+ case NS_ooxml::LN_CT_WrapPath_start:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ {
+ resolveSprmProps(*this, _sprm);
+
+ awt::Point aPoint(mnX, mnY);
+ mpPolygon->addPoint(aPoint);
+ }
+ break;
+ default:
+#ifdef DEBUG_WRAP_POLYGON_HANDLER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
+ }
+}
+
+WrapPolygon::Pointer_t WrapPolygonHandler::getPolygon()
+{
+ return mpPolygon;
+}
+
+}}
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.hxx b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
new file mode 100644
index 000000000000..05161096f81a
--- /dev/null
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.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 WRAP_POLYGON_HANDLER_HXX
+#define WRAP_POLYGON_HANDLER_HXX
+
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <resourcemodel/LoggedResources.hxx>
+#include <resourcemodel/Fraction.hxx>
+
+namespace writerfilter {
+namespace dmapper {
+
+using namespace ::com::sun::star;
+using resourcemodel::Fraction;
+
+class WrapPolygon
+{
+public:
+ typedef ::std::deque<awt::Point> Points_t;
+ typedef ::boost::shared_ptr<WrapPolygon> Pointer_t;
+
+private:
+ Points_t mPoints;
+
+public:
+ WrapPolygon();
+ virtual ~WrapPolygon();
+
+ void addPoint(const awt::Point & rPoint);
+
+ Points_t::const_iterator begin() const;
+ Points_t::const_iterator end() const;
+ Points_t::iterator begin();
+ Points_t::iterator end();
+
+ size_t size() const;
+
+ WrapPolygon::Pointer_t move(const awt::Point & rMove);
+ WrapPolygon::Pointer_t scale(const Fraction & rFractionX, const Fraction & rFractionY);
+ WrapPolygon::Pointer_t correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize);
+ drawing::PointSequenceSequence getPointSequenceSequence() const;
+};
+
+class WrapPolygonHandler : public LoggedProperties
+{
+public:
+ WrapPolygonHandler();
+ virtual ~WrapPolygonHandler();
+
+ WrapPolygon::Pointer_t getPolygon();
+
+private:
+ WrapPolygon::Pointer_t mpPolygon;
+
+ sal_uInt32 mnX;
+ sal_uInt32 mnY;
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+};
+
+}}
+
+#endif // WRAP_POLYGON_HANDLER_HXX
diff --git a/writerfilter/source/dmapper/dmapperLoggers.hxx b/writerfilter/source/dmapper/dmapperLoggers.hxx
index fd9ed722de4a..8b30c491c384 100644
--- a/writerfilter/source/dmapper/dmapperLoggers.hxx
+++ b/writerfilter/source/dmapper/dmapperLoggers.hxx
@@ -31,7 +31,6 @@
#ifndef INCLUDED_DMAPPER_LOGGERS_HXX
#define INCLUDED_DMAPPER_LOGGERS_HXX
-#ifdef DEBUG
#include <resourcemodel/TagLogger.hxx>
namespace writerfilter {
@@ -39,5 +38,5 @@ namespace writerfilter {
extern TagLogger::Pointer_t dmapper_logger;
}
}
-#endif // DEBUG
+
#endif // INCLUDED_DMAPPER_LOGGERS_HXX
diff --git a/writerfilter/source/dmapper/makefile.mk b/writerfilter/source/dmapper/makefile.mk
index 300dfb31d959..a4b000411b4e 100644
--- a/writerfilter/source/dmapper/makefile.mk
+++ b/writerfilter/source/dmapper/makefile.mk
@@ -48,13 +48,13 @@ SLOFILES= \
$(SLO)$/DomainMapperTableManager.obj \
$(SLO)$/DomainMapper_Impl.obj \
$(SLO)$/FFDataHandler.obj \
- $(SLO)$/FormControlHelper.obj \
$(SLO)$/FontTable.obj \
+ $(SLO)$/FormControlHelper.obj \
$(SLO)$/GraphicHelpers.obj \
$(SLO)$/GraphicImport.obj \
- $(SLO)$/NumberingManager.obj \
$(SLO)$/MeasureHandler.obj \
$(SLO)$/ModelEventListener.obj \
+ $(SLO)$/NumberingManager.obj \
$(SLO)$/OLEHandler.obj \
$(SLO)$/PageBordersHandler.obj \
$(SLO)$/PropertyIds.obj \
@@ -66,7 +66,9 @@ SLOFILES= \
$(SLO)$/TDefTableHandler.obj \
$(SLO)$/TablePropertiesHandler.obj \
$(SLO)$/TblStylePrHandler.obj \
- $(SLO)$/ThemeTable.obj
+ $(SLO)$/ThemeTable.obj \
+ $(SLO)$/WrapPolygonHandler.obj \
+
# --- Targets ----------------------------------
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 0f7221552923..199c91f3a48f 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -85,7 +85,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
return sal_False;
}
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_IMPORT
OUString sURL = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_URL(), OUString() );
::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr();
@@ -130,7 +130,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
pDocument->resolve(*pStream);
}
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_IMPORT
writerfilter::TagLogger::dump("DOMAINMAPPER");
dmapperLogger->endDocument();
writerfilter::TagLogger::dump("DEBUG");
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index a277d5928af6..9188bef6e8cb 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -131,8 +131,8 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
if (pFactory.get() != NULL)
{
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->startElement("attributes");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.attributes");
debug_logger->attribute("define", pFactory->getDefineName(nDefine));
char sBuffer[256];
snprintf(sBuffer, sizeof(sBuffer), "%08" SAL_PRIxUINT32, nDefine);
@@ -148,8 +148,8 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
for (aIt = pMap->begin(); aIt != aEndIt; aIt++)
{
Id nId = (*pTokenToIdMap)[aIt->first];
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->startElement("attribute");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.attribute");
debug_logger->attribute("name", fastTokenToId(aIt->first));
debug_logger->attribute("tokenid", (*QNameToString::Instance())(nId));
snprintf(sBuffer, sizeof(sBuffer), "%08" SAL_PRIxUINT32, nId);
@@ -161,7 +161,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
{
case RT_Boolean:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("boolean");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -173,7 +173,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_String:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("string");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -186,7 +186,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_Integer:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("integer");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -199,7 +199,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_Hex:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("hex");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -212,7 +212,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_List:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->startElement("list");
#endif
ListValueMapPointer pListValueMap =
@@ -223,7 +223,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
::rtl::OUString aValue(Attribs->getValue(aIt->first));
sal_uInt32 nValue = (*pListValueMap)[aValue];
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->attribute("value", aValue);
debug_logger->attribute("value-num", nValue);
#endif
@@ -234,25 +234,25 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(nValue));
pFactory->attributeAction(pHandler, aIt->first, pValue);
}
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->endElement("list");
#endif
}
break;
default:
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("unknown-attribute-type");
#endif
break;
}
}
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->endElement("attribute");
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.attribute");
#endif
}
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->endElement("attributes");
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.attributes");
#endif
}
}
@@ -261,6 +261,11 @@ uno::Reference< xml::sax::XFastContextHandler>
OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
Token_t Element)
{
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.createFastChildContext");
+ debug_logger->attribute("token", fastTokenToId(Element));
+#endif
+
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
@@ -271,12 +276,21 @@ OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
if ((Element & 0xffff) < OOXML_FAST_TOKENS_END)
ret = createFastChildContextFromFactory(pHandler, pFactory, Element);
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.createFastChildContext");
+#endif
+
return ret;
}
void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
const ::rtl::OUString & rString)
{
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.characters");
+ debug_logger->chars(rString);
+#endif
+
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
@@ -284,6 +298,10 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
{
pFactory->charactersAction(pHandler, rString);
}
+
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.characters");
+#endif
}
void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nToken*/)
@@ -294,11 +312,11 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nTo
if (pFactory.get() != NULL)
{
#ifdef DEBUG_ELEMENT
- debug_logger->startElement("factory-startAction");
+ debug_logger->startElement("factory.startAction");
#endif
pFactory->startAction(pHandler);
#ifdef DEBUG_ELEMENT
- debug_logger->endElement("factory-startAction");
+ debug_logger->endElement("factory.startAction");
#endif
}
}
@@ -311,11 +329,11 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t /*nToke
if (pFactory.get() != NULL)
{
#ifdef DEBUG_ELEMENT
- debug_logger->startElement("factory-endAction");
+ debug_logger->startElement("factory.endAction");
#endif
pFactory->endAction(pHandler);
#ifdef DEBUG_ELEMENT
- debug_logger->endElement("factory-endAction");
+ debug_logger->endElement("factory.endAction");
#endif
}
}
@@ -336,6 +354,13 @@ void OOXMLFactory_ns::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLV
{
}
+#ifdef DEBUG_FACTORY
+string OOXMLFactory_ns::getName() const
+{
+ return "noname";
+}
+#endif
+
}
}
diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx b/writerfilter/source/ooxml/OOXMLFactory.hxx
index 0558436ab793..753fb3f658f7 100755..100644
--- a/writerfilter/source/ooxml/OOXMLFactory.hxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.hxx
@@ -114,6 +114,9 @@ public:
virtual void endAction(OOXMLFastContextHandler * pHandler);
virtual void attributeAction(OOXMLFastContextHandler * pHandler, Token_t nToken, OOXMLValue::Pointer_t pValue);
virtual string getDefineName(Id nId) const;
+#ifdef DEBUG_FACTORY
+ virtual string getName() const;
+#endif
AttributeToResourceMapPointer getAttributeToResourceMap(Id nId);
ListValueMapPointer getListValueMap(Id nId);
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 20ee49258c00..5e4d5604527f 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -31,6 +31,7 @@
#include <rtl/uuid.h>
#include <com/sun/star/drawing/XShapes.hpp>
#include <resourcemodel/QNameToString.hxx>
+#include <resourcemodel/XPathLogger.hxx>
#include <resourcemodel/util.hxx>
#include <ooxml/resourceids.hxx>
#include <doctok/sprmids.hxx>
@@ -182,52 +183,23 @@ OOXMLFastContextHandler::~OOXMLFastContextHandler()
aSetContexts.erase(this);
}
-#ifdef DEBUG_MEMORY
-void SAL_CALL OOXMLFastContextHandler::acquire()
- throw ()
-{
- mnRefCount++;
-
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%ld: %s: aquire(%ld)", mnInstanceNumber,
- getType().c_str(), mnRefCount);
- logger("MEMORY", buffer);
-
- cppu::WeakImplHelper1<com::sun::star::xml::sax::XFastContextHandler>::acquire();
-}
-
-void SAL_CALL OOXMLFastContextHandler::release()
- throw ()
-{
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%s: release(%ld)", mnInstanceNumber,
- getType().c_str(), mnRefCount);
- logger("MEMORY", buffer);
-
- cppu::WeakImplHelper1<com::sun::star::xml::sax::XFastContextHandler>::release();
- mnRefCount--;
-}
-#endif
-
// ::com::sun::star::xml::sax::XFastContextHandler:
void SAL_CALL OOXMLFastContextHandler::startFastElement
(Token_t Element,
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("element");
- debug_logger->attribute("token", fastTokenToId(Element));
- debug_logger->attribute("type",getType());
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.element");
+ string sToken = fastTokenToId(Element);
+ mpParserState->getXPathLogger().startElement(sToken);
+ debug_logger->attribute("token", sToken);
+ debug_logger->attribute("type", getType());
+ debug_logger->attribute("xpath", mpParserState->getXPathLogger().getXPath());
debug_logger->startElement("at-start");
debug_logger->addTag(toTag());
debug_logger->endElement("at-start");
#endif
-#ifdef DEBUG_MEMORY
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%ld: startFastElement", mnInstanceNumber);
- logger("MEMORY", buffer);
-#endif
attributes(Attribs);
lcl_startFastElement(Element, Attribs);
}
@@ -237,10 +209,11 @@ void SAL_CALL OOXMLFastContextHandler::startUnknownElement
const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_CONTEXT_STACK
- debug_logger->startElement("unknown-element");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.unknown-element");
debug_logger->attribute("namespace", Namespace);
debug_logger->attribute("name", Name);
+ mpParserState->getXPathLogger().startElement("unknown");
#else
(void) Namespace;
(void) Name;
@@ -250,19 +223,19 @@ throw (uno::RuntimeException, xml::sax::SAXException)
void SAL_CALL OOXMLFastContextHandler::endFastElement(Token_t Element)
throw (uno::RuntimeException, xml::sax::SAXException)
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ string sToken = fastTokenToId(Element);
+ (void) sToken;
+#endif
+
lcl_endFastElement(Element);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->startElement("at-end");
debug_logger->addTag(toTag());
debug_logger->endElement("at-end");
- debug_logger->endElement("element");
-#endif
-#ifdef DEBUG_MEMORY
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%ld: %s:endFastElement", mnInstanceNumber,
- getType().c_str());
- logger("MEMORY", buffer);
+ debug_logger->endElement("contexthandler.element");
+ mpParserState->getXPathLogger().endElement();
#endif
}
@@ -278,14 +251,6 @@ void OOXMLFastContextHandler::lcl_endFastElement
(Token_t Element)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_CONTEXT_STACK
- debug_logger->startElement("endAction");
- debug_logger->endElement("endAction");
- debug_logger->startElement("token");
- debug_logger->chars(fastTokenToId(Element));
- debug_logger->endElement("token");
-#endif
-
OOXMLFactory::getInstance()->endAction(this, Element);
}
@@ -293,9 +258,9 @@ void SAL_CALL OOXMLFastContextHandler::endUnknownElement
(const ::rtl::OUString & , const ::rtl::OUString & )
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("unknown-element");
- debug_logger->endElement("unknown-element");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.unknown-element");
+ mpParserState->getXPathLogger().endElement();
#endif
}
@@ -305,8 +270,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_CONTEXT_STACK
- debug_logger->startElement("createFastChildContext");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.createFastChildContext");
debug_logger->attribute("token", fastTokenToId(Element));
debug_logger->attribute("type", getType());
#endif
@@ -314,8 +279,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
uno::Reference< xml::sax::XFastContextHandler > xResult
(lcl_createFastChildContext(Element, Attribs));
-#ifdef DEBUG_CONTEXT_STACK
- debug_logger->endElement("createFastChildContext");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.createFastChildContext");
#endif
return xResult;
@@ -337,11 +302,11 @@ OOXMLFastContextHandler::createUnknownChildContext
const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("createUnknownChildContext");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.createUnknownChildContext");
debug_logger->attribute("namespace", Namespace);
debug_logger->attribute("name", Name);
- debug_logger->endElement("createUnknownChildContext");
+ debug_logger->endElement("contexthandler.createUnknownChildContext");
#else
(void) Namespace;
(void) Name;
@@ -404,12 +369,12 @@ void OOXMLFastContextHandler::attributes
void OOXMLFastContextHandler::startAction(Token_t Element)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("startAction");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.startAction");
#endif
lcl_startAction(Element);
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("startAction");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.startAction");
#endif
}
@@ -420,12 +385,12 @@ void OOXMLFastContextHandler::lcl_startAction(Token_t Element)
void OOXMLFastContextHandler::endAction(Token_t Element)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("endAction");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.endAction");
#endif
lcl_endAction(Element);
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("endAction");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.endAction");
#endif
}
@@ -493,15 +458,15 @@ string OOXMLFastContextHandler::getResourceString() const
void OOXMLFastContextHandler::setId(Id rId)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("setId");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.setId");
static char sBuffer[256];
snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIuUINT32, rId);
debug_logger->attribute("id", sBuffer);
- debug_logger->chars((*QNameToString::Instance())(rId));
- debug_logger->endElement("setId");
+ debug_logger->attribute("name", (*QNameToString::Instance())(rId));
+ debug_logger->endElement("contexthandler.setId");
#endif
mId = rId;
@@ -531,7 +496,7 @@ void OOXMLFastContextHandler::setToken(Token_t nToken)
{
mnToken = nToken;
-#ifdef DEBUG_CONTEXT_STACK
+#ifdef DEBUG_CONTEXT_HANDLER
msTokenString = fastTokenToId(mnToken);
#endif
}
@@ -547,11 +512,6 @@ void OOXMLFastContextHandler::mark(const Id & rId, OOXMLValue::Pointer_t pVal)
OOXMLPropertyImpl::Pointer_t pProperty
(new OOXMLPropertyImpl(rId, pVal, OOXMLPropertyImpl::ATTRIBUTE));
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("mark");
- debug_logger->chars(xmlify(pProperty->toString()));
- debug_logger->endElement("mark");
-#endif
pPropSet->add(pProperty);
mpStream->props(pPropSet);
}
@@ -571,8 +531,8 @@ OOXMLPropertySet * OOXMLFastContextHandler::getPicturePropSet
void OOXMLFastContextHandler::sendTableDepth() const
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendTableDepth");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendTableDepth");
#endif
if (mnTableDepth > 0)
@@ -593,15 +553,10 @@ void OOXMLFastContextHandler::sendTableDepth() const
pProps->add(pProp);
}
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("props");
- debug_logger->chars(pProps->toString());
- debug_logger->endElement("props");
-#endif
mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps));
}
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("sendTableDepth");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.sendTableDepth");
#endif
}
@@ -613,6 +568,10 @@ void OOXMLFastContextHandler::setHandle()
void OOXMLFastContextHandler::startCharacterGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startCharacterGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInCharacterGroup())
@@ -623,10 +582,6 @@ void OOXMLFastContextHandler::startCharacterGroup()
if (! mpParserState->isInCharacterGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startCharacterGroup");
-#endif
-
mpStream->startCharacterGroup();
mpParserState->setInCharacterGroup(true);
mpParserState->resolveCharacterProperties(*mpStream);
@@ -636,12 +591,12 @@ void OOXMLFastContextHandler::startCharacterGroup()
void OOXMLFastContextHandler::endCharacterGroup()
{
- if (isForwardEvents() && mpParserState->isInCharacterGroup())
- {
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endCharacterGroup");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endCharacterGroup");
#endif
+ if (isForwardEvents() && mpParserState->isInCharacterGroup())
+ {
mpStream->endCharacterGroup();
mpParserState->setInCharacterGroup(false);
}
@@ -649,6 +604,10 @@ void OOXMLFastContextHandler::endCharacterGroup()
void OOXMLFastContextHandler::startParagraphGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startParagraphGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInParagraphGroup())
@@ -659,10 +618,6 @@ void OOXMLFastContextHandler::startParagraphGroup()
if (! mpParserState->isInParagraphGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startParagraphGroup");
-#endif
-
mpStream->startParagraphGroup();
mpParserState->setInParagraphGroup(true);
}
@@ -671,6 +626,10 @@ void OOXMLFastContextHandler::startParagraphGroup()
void OOXMLFastContextHandler::endParagraphGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endParagraphGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInCharacterGroup())
@@ -678,9 +637,6 @@ void OOXMLFastContextHandler::endParagraphGroup()
if (mpParserState->isInParagraphGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endParagraphGroup");
-#endif
mpStream->endParagraphGroup();
mpParserState->setInParagraphGroup(false);
}
@@ -689,6 +645,10 @@ void OOXMLFastContextHandler::endParagraphGroup()
void OOXMLFastContextHandler::startSectionGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startSectionGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInSectionGroup())
@@ -696,9 +656,6 @@ void OOXMLFastContextHandler::startSectionGroup()
if (! mpParserState->isInSectionGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startSectionGroup");
-#endif
mpStream->info(mpParserState->getHandle());
mpStream->startSectionGroup();
mpParserState->setInSectionGroup(true);
@@ -708,6 +665,10 @@ void OOXMLFastContextHandler::startSectionGroup()
void OOXMLFastContextHandler::endSectionGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endSectionGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInParagraphGroup())
@@ -715,9 +676,6 @@ void OOXMLFastContextHandler::endSectionGroup()
if (mpParserState->isInSectionGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endSectionGroup");
-#endif
mpStream->endSectionGroup();
mpParserState->setInSectionGroup(false);
}
@@ -726,10 +684,6 @@ void OOXMLFastContextHandler::endSectionGroup()
void OOXMLFastContextHandler::setLastParagraphInSection()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("setLastParagraphInSection");
-#endif
-
mpParserState->setLastParagraphInSection(true);
mpStream->markLastParagraphInSection( );
}
@@ -751,8 +705,8 @@ OOXMLPropertySet::Pointer_t OOXMLFastContextHandler::getPropertySet() const
void OOXMLFastContextHandler::startField()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startField");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startField");
#endif
startCharacterGroup();
if (isForwardEvents())
@@ -762,8 +716,8 @@ void OOXMLFastContextHandler::startField()
void OOXMLFastContextHandler::fieldSeparator()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("fieldSeparator");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.fieldSeparator");
#endif
startCharacterGroup();
if (isForwardEvents())
@@ -773,8 +727,8 @@ void OOXMLFastContextHandler::fieldSeparator()
void OOXMLFastContextHandler::endField()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endField");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endField");
#endif
startCharacterGroup();
if (isForwardEvents())
@@ -784,8 +738,8 @@ void OOXMLFastContextHandler::endField()
void OOXMLFastContextHandler::ftnednref()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("ftnednref");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.ftnednref");
#endif
if (isForwardEvents())
mpStream->utext(sFtnEdnRef, 1);
@@ -793,8 +747,8 @@ void OOXMLFastContextHandler::ftnednref()
void OOXMLFastContextHandler::ftnednsep()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("ftnednsep");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.ftnednsep");
#endif
if (isForwardEvents())
mpStream->utext(sFtnEdnSep, 1);
@@ -802,8 +756,8 @@ void OOXMLFastContextHandler::ftnednsep()
void OOXMLFastContextHandler::ftnedncont()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("ftnedncont");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.ftnedncont");
#endif
if (isForwardEvents())
mpStream->text(sFtnEdnCont, 1);
@@ -811,8 +765,8 @@ void OOXMLFastContextHandler::ftnedncont()
void OOXMLFastContextHandler::pgNum()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("pgNum");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.pgNum");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sPgNum, 1);
@@ -820,8 +774,8 @@ void OOXMLFastContextHandler::pgNum()
void OOXMLFastContextHandler::tab()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("tab");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.tab");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sTab, 1);
@@ -829,8 +783,8 @@ void OOXMLFastContextHandler::tab()
void OOXMLFastContextHandler::cr()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("cr");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.cr");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sCR, 1);
@@ -838,8 +792,8 @@ void OOXMLFastContextHandler::cr()
void OOXMLFastContextHandler::noBreakHyphen()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("noBreakHyphen");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.noBreakHyphen");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sNoBreakHyphen, 1);
@@ -847,8 +801,8 @@ void OOXMLFastContextHandler::noBreakHyphen()
void OOXMLFastContextHandler::softHyphen()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("softHyphen");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.softHyphen");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sSoftHyphen, 1);
@@ -856,8 +810,8 @@ void OOXMLFastContextHandler::softHyphen()
void OOXMLFastContextHandler::handleLastParagraphInSection()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("handleLastParagraphInSection");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.handleLastParagraphInSection");
#endif
if (mpParserState->isLastParagraphInSection())
@@ -869,8 +823,8 @@ void OOXMLFastContextHandler::handleLastParagraphInSection()
void OOXMLFastContextHandler::endOfParagraph()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endOfParagraph");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endOfParagraph");
#endif
if (! mpParserState->isInCharacterGroup())
startCharacterGroup();
@@ -880,10 +834,10 @@ void OOXMLFastContextHandler::endOfParagraph()
void OOXMLFastContextHandler::text(const ::rtl::OUString & sText)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("text");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.text");
debug_logger->chars(sText);
- debug_logger->endElement("text");
+ debug_logger->endElement("contexthandler.text");
#endif
if (isForwardEvents())
mpStream->utext(reinterpret_cast < const sal_uInt8 * >
@@ -893,10 +847,10 @@ void OOXMLFastContextHandler::text(const ::rtl::OUString & sText)
void OOXMLFastContextHandler::propagateCharacterProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propagateCharacterProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.propagateCharacterProperties");
debug_logger->addTag(toPropertiesTag(getPropertySet()));
- debug_logger->endElement("propagateCharacterProperties");
+ debug_logger->endElement("contexthandler.propagateCharacterProperties");
#endif
mpParserState->setCharacterProperties(getPropertySet());
@@ -904,10 +858,10 @@ void OOXMLFastContextHandler::propagateCharacterProperties()
void OOXMLFastContextHandler::propagateCharacterPropertiesAsSet(const Id & rId)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propagateCharacterPropertiesAsSet");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.propagateCharacterPropertiesAsSet");
debug_logger->addTag(toPropertiesTag(getPropertySet()));
- debug_logger->endElement("propagateCharacterPropertiesAsSet");
+ debug_logger->endElement("contexthandler.propagateCharacterPropertiesAsSet");
#endif
OOXMLValue::Pointer_t pValue(new OOXMLPropertySetValue(getPropertySet()));
@@ -927,8 +881,8 @@ bool OOXMLFastContextHandler::propagatesProperties() const
void OOXMLFastContextHandler::propagateCellProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("propagateCellProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.propagateCellProperties");
#endif
mpParserState->setCellProperties(getPropertySet());
@@ -936,8 +890,8 @@ void OOXMLFastContextHandler::propagateCellProperties()
void OOXMLFastContextHandler::propagateRowProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("propagateRowProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.propagateRowProperties");
#endif
mpParserState->setRowProperties(getPropertySet());
@@ -946,10 +900,10 @@ void OOXMLFastContextHandler::propagateRowProperties()
void OOXMLFastContextHandler::propagateTableProperties()
{
OOXMLPropertySet::Pointer_t pProps = getPropertySet();
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propagateTableProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.propagateTableProperties");
debug_logger->addTag(toPropertiesTag(pProps));
- debug_logger->endElement("propagateTableProperties");
+ debug_logger->endElement("contexthandler.propagateTableProperties");
#endif
mpParserState->setTableProperties(pProps);
@@ -957,47 +911,47 @@ void OOXMLFastContextHandler::propagateTableProperties()
void OOXMLFastContextHandler::sendCellProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendCellProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendCellProperties");
#endif
mpParserState->resolveCellProperties(*mpStream);
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("sendCellProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.sendCellProperties");
#endif
}
void OOXMLFastContextHandler::sendRowProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendRowProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendRowProperties");
#endif
mpParserState->resolveRowProperties(*mpStream);
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("sendRowProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.sendRowProperties");
#endif
}
void OOXMLFastContextHandler::sendTableProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendTableProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendTableProperties");
#endif
mpParserState->resolveTableProperties(*mpStream);
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("sendTableProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.sendTableProperties");
#endif
}
void OOXMLFastContextHandler::clearTableProps()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("clearTableProps");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.clearTableProps");
#endif
mpParserState->setTableProperties(OOXMLPropertySet::Pointer_t
@@ -1006,8 +960,8 @@ void OOXMLFastContextHandler::clearTableProps()
void OOXMLFastContextHandler::sendPropertiesWithId(const Id & rId)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendPropertiesWithId");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendPropertiesWithId");
debug_logger->attribute("id", fastTokenToId(rId));
#endif
@@ -1020,16 +974,16 @@ void OOXMLFastContextHandler::sendPropertiesWithId(const Id & rId)
pPropertySet->add(pProp);
mpStream->props(pPropertySet);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->addTag(toPropertiesTag(pPropertySet));
- debug_logger->endElement("sendPropertiesWithId");
+ debug_logger->endElement("contexthandler.sendPropertiesWithId");
#endif
}
void OOXMLFastContextHandler::clearProps()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("clearProps");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.clearProps");
#endif
setPropertySet(OOXMLPropertySet::Pointer_t(new OOXMLPropertySetImpl()));
@@ -1063,15 +1017,15 @@ OOXMLDocument * OOXMLFastContextHandler::getDocument()
void OOXMLFastContextHandler::setForwardEvents(bool bForwardEvents)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("setForwardEvents");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.setForwardEvents");
if (bForwardEvents)
debug_logger->chars("true");
else
debug_logger->chars("false");
- debug_logger->endElement("setForwardEvents");
+ debug_logger->endElement("contexthandler.setForwardEvents");
#endif
mpParserState->setForwardEvents(bForwardEvents);
@@ -1154,8 +1108,8 @@ void OOXMLFastContextHandler::resolvePropertySetAttrs()
void OOXMLFastContextHandler::sendPropertyToParent()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendPropertyToParent");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendPropertyToParent");
#endif
if (mpParent != NULL)
@@ -1169,21 +1123,21 @@ void OOXMLFastContextHandler::sendPropertyToParent()
OOXMLPropertyImpl::SPRM));
pProps->add(pProp);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->addTag(toPropertiesTag(pProps));
#endif
}
}
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("sendPropertyToParent");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.sendPropertyToParent");
#endif
}
void OOXMLFastContextHandler::sendPropertiesToParent()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendPropertiesToParent");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendPropertiesToParent");
#endif
if (mpParent != NULL)
{
@@ -1193,12 +1147,6 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
{
OOXMLPropertySet::Pointer_t pProps(getPropertySet());
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("me");
- debug_logger->addTag(toPropertiesTag(pProps));
- debug_logger->endElement("me");
-#endif
-
if (pProps.get() != NULL)
{
OOXMLValue::Pointer_t pValue
@@ -1207,24 +1155,12 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
OOXMLProperty::Pointer_t pProp
(new OOXMLPropertyImpl(getId(), pValue, OOXMLPropertyImpl::SPRM));
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propertyForSet");
- debug_logger->chars(pProp->toString());
- debug_logger->endElement("propertyForSet");
-#endif
-
pParentProps->add(pProp);
-
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("parent");
- debug_logger->addTag(toPropertiesTag(pParentProps));
- debug_logger->endElement("parent");
-#endif
}
}
}
-#ifdef DEBUG_ELEMENT
- debug_logger->endElement("sendPropertiesToParent");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.sendPropertiesToParent");
#endif
}
@@ -1263,11 +1199,11 @@ void OOXMLFastContextHandlerStream::newProperty(const Id & rId,
void OOXMLFastContextHandlerStream::sendProperty(Id nId)
{
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("sendProperty");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendProperty");
debug_logger->attribute("id", (*QNameToString::Instance())(nId));
debug_logger->chars(xmlify(getPropertySetAttrs()->toString()));
- debug_logger->endElement("sendProperty");
+ debug_logger->endElement("contexthandler.sendProperty");
#endif
OOXMLPropertySetEntryToString aHandler(nId);
@@ -1286,10 +1222,10 @@ OOXMLFastContextHandlerStream::getPropertySetAttrs() const
void OOXMLFastContextHandlerStream::resolvePropertySetAttrs()
{
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("resolvePropertySetAttrs");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.resolvePropertySetAttrs");
debug_logger->chars(mpPropertySetAttrs->toString());
- debug_logger->endElement("resolvePropertySetAttrs");
+ debug_logger->endElement("contexthandler.resolvePropertySetAttrs");
#endif
mpStream->props(mpPropertySetAttrs);
}
@@ -1339,13 +1275,7 @@ void OOXMLFastContextHandlerProperties::lcl_endFastElement
{
if (isForwardEvents())
{
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("sendproperties");
-#endif
mpStream->props(mpPropertySet);
-#ifdef DEBUG_PROPERTIES
- debug_logger->endElement("sendproperties");
-#endif
}
}
else
@@ -1544,7 +1474,16 @@ OOXMLFastContextHandlerValue::~OOXMLFastContextHandlerValue()
void OOXMLFastContextHandlerValue::setValue(OOXMLValue::Pointer_t pValue)
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.setValue");
+ debug_logger->attribute("value", pValue->toString());
+#endif
+
mpValue = pValue;
+
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.setValue");
+#endif
}
OOXMLValue::Pointer_t OOXMLFastContextHandlerValue::getValue() const
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index 0c441f62a180..59ee2cc42080 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -230,18 +230,13 @@ public:
virtual string toString() const;
#endif
-#ifdef DEBUG_MEMORY
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-#endif
-
protected:
OOXMLFastContextHandler * mpParent;
Id mId;
Id mnDefine;
Token_t mnToken;
-#ifdef DEBUG_CONTEXT_STACK
+#ifdef DEBUG_CONTEXT_HANDLER
string msTokenString;
#endif
diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
index 5d4587922a54..961b4660f036 100644
--- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
@@ -74,6 +74,12 @@ uno::Reference<XFastContextHandler>
OOXMLFastHelper<T>::createAndSetParent
(OOXMLFastContextHandler * pHandler, sal_uInt32 nToken, Id nId)
{
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.createAndSetParent");
+ debug_logger->attribute("context", pHandler->getType());
+ debug_logger->attribute("id", (*QNameToString::Instance())(nId));
+#endif
+
OOXMLFastContextHandler * pTmp = new T(pHandler);
pTmp->setToken(nToken);
@@ -88,7 +94,7 @@ OOXMLFastHelper<T>::createAndSetParent
debug_logger->startElement("created");
debug_logger->addTag(pTmp->toTag());
debug_logger->endElement("created");
- debug_logger->endElement("createAndSetParent");
+ debug_logger->endElement("helper.createAndSetParent");
#endif
uno::Reference<XFastContextHandler> aResult(pTmp);
@@ -101,27 +107,29 @@ uno::Reference<XFastContextHandler>
OOXMLFastHelper<T>::createAndSetParentAndDefine
(OOXMLFastContextHandler * pHandler, sal_uInt32 nToken, Id nId, Id nDefine)
{
- OOXMLFastContextHandler * pTmp = new T(pHandler);
-
- pTmp->setToken(nToken);
- pTmp->setId(nId);
- pTmp->setDefine(nDefine);
-
-#ifdef DEBUG_CREATE
- debug_logger->startElement("createAndSetParentAndDefine");
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.createAndSetParentAndDefine");
debug_logger->attribute("context", pHandler->getType());
- debug_logger->attribute("token", fastTokenToId(pTmp->getToken()));
debug_logger->attribute("id", (*QNameToString::Instance())(nId));
static char buffer[16];
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIxUINT32, nId);
debug_logger->attribute("idnum", buffer);
+#endif
+
+ OOXMLFastContextHandler * pTmp = new T(pHandler);
+
+ pTmp->setToken(nToken);
+ pTmp->setId(nId);
+ pTmp->setDefine(nDefine);
+
+#ifdef DEBUG_HELPER
debug_logger->startElement("created");
debug_logger->addTag(pTmp->toTag());
debug_logger->endElement("created");
- debug_logger->endElement("createAndSetParentAndDefine");
+ debug_logger->endElement("helper.createAndSetParentAndDefine");
#endif
uno::Reference<XFastContextHandler> aResult(pTmp);
@@ -135,6 +143,12 @@ OOXMLFastHelper<T>::createAndSetParentRef
(OOXMLFastContextHandler * pHandler, sal_uInt32 nToken,
const uno::Reference < xml::sax::XFastAttributeList > & Attribs)
{
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.createAndSetParentRef");
+ debug_logger->attribute("context", pHandler->getType());
+ debug_logger->attribute("type", fastTokenToId(nToken));
+#endif
+
boost::shared_ptr<OOXMLFastContextHandler> pTmp(new T(pHandler));
uno::Reference<XFastContextHandler> xChild =
@@ -149,15 +163,11 @@ OOXMLFastHelper<T>::createAndSetParentRef
}
-#ifdef DEBUG_CREATE
- debug_logger->startElement("createAndSetParentRef");
- debug_logger->attribute("context", pHandler->getType());
- debug_logger->attribute("type", fastTokenToId(nToken));
-
+#ifdef DEBUG_HELPER
debug_logger->startElement("created");
- debug_logger->chars(pTmp->getType());
+ debug_logger->addTag(pTmp->toTag());
debug_logger->endElement("created");
- debug_logger->endElement("createAndSetParentRef");
+ debug_logger->endElement("helper.createAndSetParentRef");
#endif
return xChild;
@@ -170,7 +180,7 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
{
OOXMLValue::Pointer_t pVal(new T(rValue));
-#ifdef DEBUG_PROPERTIES
+#ifdef DEBUG_HELPER
string aStr = (*QNameToString::Instance())(nId);
debug_logger->startElement("newProperty-from-string");
@@ -182,11 +192,14 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
if (aStr.size() == 0)
debug_logger->addTag(XMLTag::Pointer_t(new XMLTag("unknown-qname")));
+#endif
+ pHandler->newProperty(nId, pVal);
+
+#ifdef DEBUG_HELPER
debug_logger->endElement("newProperty-from-string");
#endif
- pHandler->newProperty(nId, pVal);
}
template <class T>
@@ -196,17 +209,17 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
{
OOXMLValue::Pointer_t pVal(new T(nVal));
-#ifdef DEBUG_PROPERTIES
+#ifdef DEBUG_HELPER
string aStr = (*QNameToString::Instance())(nId);
- debug_logger->startElement("newProperty-from-int");
+ debug_logger->startElement("helper.newProperty-from-int");
debug_logger->attribute("name", aStr);
debug_logger->attribute("value", pVal->toString());
if (aStr.size() == 0)
debug_logger->addTag(XMLTag::Pointer_t(new XMLTag("unknown-qname")));
- debug_logger->endElement("newProperty-from-int");
+ debug_logger->endElement("helper.newProperty-from-int");
#endif
pHandler->newProperty(nId, pVal);
@@ -221,8 +234,8 @@ void OOXMLFastHelper<T>::mark(OOXMLFastContextHandler * pHandler,
string aStr = (*QNameToString::Instance())(nId);
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("mark");
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.mark");
debug_logger->attribute("name", aStr);
debug_logger->attribute
("value",
@@ -232,22 +245,10 @@ void OOXMLFastHelper<T>::mark(OOXMLFastContextHandler * pHandler,
if (aStr.size() == 0)
debug_logger->addTag(XMLTag::Pointer_t(new XMLTag("unknown-qname")));
- debug_logger->endElement("mark");
+ debug_logger->endElement("helper.mark");
#endif
pHandler->mark(nId, pVal);
}
-
-template <class T>
-void OOXMLFastHelper<T>::attributes
-(OOXMLFastContextHandler * pContext,
- const uno::Reference < xml::sax::XFastAttributeList > & Attribs)
- {
- T aContext(pContext);
-
- aContext.setPropertySet(pContext->getPropertySet());
- aContext.attributes(Attribs);
-}
-
}}
#endif // INCLUDED_FAST_HELPER_HXX
diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx
index fb347d02048e..41a3738ee7ab 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -320,6 +320,11 @@ XMLTag::Pointer_t OOXMLParserState::toTag() const
return pTag;
}
+
+XPathLogger & OOXMLParserState::getXPathLogger()
+{
+ return m_xPathLogger;
+}
#endif
}}
diff --git a/writerfilter/source/ooxml/OOXMLParserState.hxx b/writerfilter/source/ooxml/OOXMLParserState.hxx
index 2dd118a5b96b..12a9876ce6eb 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.hxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.hxx
@@ -33,6 +33,7 @@
#ifdef DEBUG
#include <resourcemodel/TagLogger.hxx>
+#include <resourcemodel/XPathLogger.hxx>
#endif
namespace writerfilter {
@@ -57,6 +58,9 @@ class OOXMLParserState
stack<OOXMLPropertySet::Pointer_t> mCellProps;
stack<OOXMLPropertySet::Pointer_t> mRowProps;
stack<OOXMLPropertySet::Pointer_t> mTableProps;
+#ifdef DEBUG
+ XPathLogger m_xPathLogger;
+#endif
public:
typedef boost::shared_ptr<OOXMLParserState> Pointer_t;
@@ -109,6 +113,7 @@ public:
unsigned int getContextCount() const;
string toString() const;
XMLTag::Pointer_t toTag() const;
+ XPathLogger & getXPathLogger();
#endif
};
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index f106972b23c0..6e0bcaf763cd 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -34,8 +34,6 @@
#include <ooxml/OOXMLFastTokens.hxx>
#include "ooxmlLoggers.hxx"
-//#define DEBUG_RESOLVE
-
namespace writerfilter {
namespace ooxml
{
@@ -474,15 +472,22 @@ string OOXMLPropertySetImpl::getType() const
void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
{
+#ifdef DEBUG_PROPERTY_SET
+ debug_logger->startElement("propertyset.add");
+ debug_logger->chars(pProperty->toString());
+#endif
+
if (pProperty.get() != NULL && pProperty->getId() != 0x0)
{
mProperties.push_back(pProperty);
}
-#ifdef DEBUG_PROPERTIES
+#ifdef DEBUG_PROPERTY_SET
else
{
debug_logger->element("warning.property_not_added");
}
+
+ debug_logger->endElement("propertyset.add");
#endif
}
diff --git a/writerfilter/source/ooxml/analyzemodel.xsl b/writerfilter/source/ooxml/analyzemodel.xsl
index d887a9a178a6..3cce9795a947 100644
--- a/writerfilter/source/ooxml/analyzemodel.xsl
+++ b/writerfilter/source/ooxml/analyzemodel.xsl
@@ -98,6 +98,7 @@
</xsl:for-each>
</xsl:when>
</xsl:choose>
+ <xsl:copy-of select="@tag"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> \ No newline at end of file
diff --git a/writerfilter/source/ooxml/effort.xsl b/writerfilter/source/ooxml/effort.xsl
index 47f278a63f4f..3dfc102e0780 100644
--- a/writerfilter/source/ooxml/effort.xsl
+++ b/writerfilter/source/ooxml/effort.xsl
@@ -7,33 +7,40 @@
<xsl:output method="text"/>
<xsl:template match="/">
- <xsl:text>Namespace,Define,Name,Done,Planned,qname-count&#xa;</xsl:text>
- <xsl:for-each select="/todo/attribute|/todo/element">
- <xsl:for-each select=".//status">
- <xsl:for-each select="ancestor::attribute|ancestor::element">
- <xsl:value-of select="@namespace"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@define"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>,</xsl:text>
- </xsl:for-each>
- <xsl:value-of select="@done"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@planned"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@qname-count"/>
- <xsl:text>&#xa;</xsl:text>
- </xsl:for-each>
- <xsl:if test="not(.//status)">
- <xsl:value-of select="@namespace"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@define"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>,0,0.5,1&#xa;</xsl:text>
- </xsl:if>
+ <xsl:text>Namespace,Define,Name,Tag,Done,Planned,qname-count&#xa;</xsl:text>
+ <xsl:for-each select="/todo/attribute|/todo/element">
+ <xsl:variable name="namespace" select="@namespace"/>
+ <xsl:variable name="define" select="@define"/>
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="tag" select="@tag"/>
+
+ <xsl:for-each select=".//status">
+ <xsl:value-of select="$namespace"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$define"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$tag"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="@done"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="@planned"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="@qname-count"/>
+ <xsl:text>&#xa;</xsl:text>
</xsl:for-each>
+ <xsl:if test="not(.//status)">
+ <xsl:value-of select="$namespace"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$define"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$tag"/>
+ <xsl:text>,0,0.5,1&#xa;</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
</xsl:template>
</xsl:stylesheet> \ No newline at end of file
diff --git a/writerfilter/source/ooxml/factory_ns.xsl b/writerfilter/source/ooxml/factory_ns.xsl
index 44b5c824859f..0349d832128d 100644
--- a/writerfilter/source/ooxml/factory_ns.xsl
+++ b/writerfilter/source/ooxml/factory_ns.xsl
@@ -69,19 +69,18 @@
<xsl:template name="factoryactiondecls">
<xsl:variable name="ns" select="@name"/>
- <xsl:for-each select="resource/action">
+ <xsl:for-each select="resource/action[not(@name='characters')]">
<xsl:sort select="@name"/>
<xsl:if test="generate-id(key('actions', @name)[ancestor::namespace/@name=$ns][1]) = generate-id(.)">
<xsl:text>
void </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>Action(OOXMLFastContextHandler * pHandler</xsl:text>
- <xsl:if test="@name='characters'">
- <xsl:text>, const ::rtl::OUString &amp; sText</xsl:text>
- </xsl:if>
<xsl:text>);</xsl:text>
</xsl:if>
</xsl:for-each>
+ <xsl:text>
+ virtual void charactersAction(OOXMLFastContextHandler * pHandler, const ::rtl::OUString &amp; sText);</xsl:text>
</xsl:template>
<!-- factorydecl -->
@@ -106,6 +105,10 @@ public:
virtual string getDefineName(Id nId) const;</xsl:text>
<xsl:call-template name="factoryactiondecls"/>
virtual void attributeAction(OOXMLFastContextHandler * pHandler, Token_t nToken, OOXMLValue::Pointer_t pValue);
+
+#ifdef DEBUG_FACTORY
+ virtual string getName() const;
+#endif
<xsl:text>
virtual ~</xsl:text>
diff --git a/writerfilter/source/ooxml/factoryimpl.xsl b/writerfilter/source/ooxml/factoryimpl.xsl
index 8eecf4aba813..781883b761e5 100644
--- a/writerfilter/source/ooxml/factoryimpl.xsl
+++ b/writerfilter/source/ooxml/factoryimpl.xsl
@@ -78,6 +78,10 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult;
Id nDefine = pHandler->getDefine();
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.createFastChildContextFromFactory");
+#endif
+
if (pFactory.get() != NULL)
{
CreateElementMapPointer pMap = pFactory-&gt;getCreateElementMap(nDefine);
@@ -86,12 +90,13 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
if (pMap.get() != NULL)
{
Id nId = (*pTokenMap)[Element];
-#ifdef DEBUG_CREATE
+#ifdef DEBUG_FACTORY
+ string sFactoryName(pFactory->getName());
string sDefine(pFactory->getDefineName(nDefine));
string sElement(fastTokenToId(Element));
string sQName((*QNameToString::Instance())(nId));
- debug_logger->startElement("createFastChildContextFromFactory");
+ debug_logger->attribute("factory-name", sFactoryName);
debug_logger->attribute("define", sDefine);
debug_logger->attribute("element", sElement);
debug_logger->attribute("qname", sQName);
@@ -134,12 +139,13 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
break;
}
-#ifdef DEBUG_CREATE
- debug_logger->endElement("createFastChildContextFromFactory");
-#endif
}
}
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.createFastChildContextFromFactory");
+#endif
+
return aResult;
}
</xsl:text>
@@ -178,8 +184,8 @@ OOXMLFactory_ns::Pointer_t OOXMLFactory::getFactoryForNamespace(Id nId)
uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastChildContextFromStart
(OOXMLFastContextHandler * pHandler, Token_t Element)
{
-#ifdef DEBUG_CREATE
- debug_logger->startElement("createFastChildContextFromStart");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.createFastChildContextFromStart");
#endif
uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult;
@@ -198,8 +204,8 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
</xsl:for-each>
<xsl:text>
-#ifdef DEBUG_CREATE
- debug_logger->endElement("createFastChildContextFromStart");
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.createFastChildContextFromStart");
#endif
return aResult;
}
diff --git a/writerfilter/source/ooxml/factoryimpl_ns.xsl b/writerfilter/source/ooxml/factoryimpl_ns.xsl
index 533c3d16ae23..adc4c977e1f9 100644
--- a/writerfilter/source/ooxml/factoryimpl_ns.xsl
+++ b/writerfilter/source/ooxml/factoryimpl_ns.xsl
@@ -143,6 +143,47 @@ OOXMLFactory_ns::Pointer_t </xsl:text>
</xsl:text>
</xsl:template>
+<!--
+ Returns resource for attribute.
+-->
+
+<xsl:template name="resourceforattribute">
+ <xsl:variable name="mynsid" select="generate-id(ancestor::namespace)"/>
+ <xsl:for-each select="rng:ref">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="resource1">
+ <xsl:for-each select="key('context-resource', @name)[generate-id(ancestor::namespace) = $mynsid]">
+ <xsl:value-of select="@resource"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($resource1) > 0">
+ <xsl:value-of select="$resource1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="ancestor::namespace/rng:grammar/rng:define[@name=$name]">
+ <xsl:call-template name="resourceforattribute"/>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:text">
+ <xsl:text>String</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='base64Binary']">
+ <xsl:text>String</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='boolean']">
+ <xsl:text>Boolean</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='unsignedInt']">
+ <xsl:text>Integer</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='int']">
+ <xsl:text>Integer</xsl:text>
+ </xsl:for-each>
+</xsl:template>
+
<!--
creates code block in OOXMLFactory_<namespace>::createAttributeToResourceMap
@@ -164,42 +205,30 @@ for a rng:define
// </xsl:text>
<xsl:value-of select="$defname"/>
</xsl:if>
- <xsl:variable name="mynsid" select="generate-id(ancestor::namespace)"/>
<xsl:variable name="resource">
- <xsl:for-each select="rng:ref">
- <xsl:for-each select="key('context-resource', @name)[generate-id(ancestor::namespace) = $mynsid]">
- <xsl:value-of select="@resource"/>
- </xsl:for-each>
- </xsl:for-each>
- <xsl:for-each select=".//rng:text">
- <xsl:text>String</xsl:text>
- </xsl:for-each>
- <xsl:for-each select=".//rng:data[@type='base64Binary']">
- <xsl:text>String</xsl:text>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:variable name="refdefine1">
- <xsl:for-each select="rng:ref">
- <xsl:variable name="refname" select="@name"/>
- <xsl:for-each select="ancestor::rng:grammar/rng:define[@name=$refname]">
- <xsl:call-template name="idfordefine"/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="refdefine">
- <xsl:choose>
- <xsl:when test="string-length($refdefine1) > 0">
- <xsl:value-of select="$refdefine1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>0</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="resourceforattribute"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($resource) > 0">
+ <xsl:variable name="refdefine1">
+ <xsl:for-each select="rng:ref">
+ <xsl:variable name="refname" select="@name"/>
+ <xsl:for-each select="ancestor::rng:grammar/rng:define[@name=$refname]">
+ <xsl:call-template name="idfordefine"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="refdefine">
+ <xsl:choose>
+ <xsl:when test="string-length($refdefine1) > 0">
+ <xsl:value-of select="$refdefine1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>0</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:text>
(*pMap)[</xsl:text>
<xsl:call-template name="fasttoken"/>
@@ -541,42 +570,103 @@ CreateElementMapPointer </xsl:text>
<!-- factoryaction -->
<xsl:template name="factoryaction">
- <xsl:param name="action"/>
- <xsl:text>
-void </xsl:text>
- <xsl:call-template name="factoryclassname"/>
- <xsl:text>::</xsl:text>
- <xsl:value-of select="$action"/>
- <xsl:text>Action(OOXMLFastContextHandler * pHandler</xsl:text>
+ <xsl:param name="action"/>
+ <xsl:variable name="switchblock1">
+ <xsl:for-each select="resource[action/@name=$action]">
+ <xsl:text>
+ </xsl:text>
+ <xsl:call-template name="caselabeldefine"/>
+ <xsl:for-each select="action[@name=$action]">
+ <xsl:call-template name="factorychooseaction"/>
+ </xsl:for-each>
+ <xsl:text> break;&#xa;</xsl:text>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="switchblock2">
<xsl:if test="$action='characters'">
- <xsl:text>, const ::rtl::OUString &amp; sText</xsl:text>
+ <xsl:for-each select="resource[@resource='Value']">
+ <xsl:if test="count(attribute) = 0">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="caselabeldefine"/>
+ <xsl:text>&#xa;</xsl:text>
+ <xsl:for-each select="ancestor::namespace/rng:grammar/rng:define[@name=$name]">
+ <xsl:for-each select="rng:ref">
+ <xsl:call-template name="charactersactionforvalues"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ <xsl:text> break;&#xa;</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
</xsl:if>
- <xsl:text>)
-{
- switch (pHandler->getDefine())
- {</xsl:text>
- <xsl:for-each select="resource[action/@name=$action]">
- <xsl:text>
- </xsl:text>
- <xsl:call-template name="caselabeldefine"/>
- <xsl:for-each select="action[@name=$action]">
- <xsl:call-template name="factorychooseaction"/>
- </xsl:for-each>
- <xsl:text>
- break;</xsl:text>
+ </xsl:variable>
+ <xsl:text>&#xa;&#xa;</xsl:text>
+ <xsl:text>void </xsl:text>
+ <xsl:call-template name="factoryclassname"/>
+ <xsl:text>::</xsl:text>
+ <xsl:value-of select="$action"/>
+ <xsl:text>Action(OOXMLFastContextHandler*</xsl:text>
+ <xsl:if test="string-length($switchblock1) &gt; 0 or string-length($switchblock2) &gt; 0">
+ <xsl:text> pHandler</xsl:text>
+ </xsl:if>
+ <xsl:if test="$action='characters'">
+ <xsl:text>, const ::rtl::OUString &amp;</xsl:text>
+ <xsl:if test="contains($switchblock1, 'sText') or contains($switchblock2, 'sText')">
+ <xsl:text> sText</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:text>)&#xa;</xsl:text>
+ <xsl:text>{&#xa;</xsl:text>
+ <xsl:if test="string-length($switchblock1) > 0 or string-length($switchblock2) > 0">
+ <xsl:text> sal_uInt32 nDefine = pHandler->getDefine();&#xa;</xsl:text>
+ </xsl:if>
+ <xsl:if test="string-length($switchblock1) > 0">
+ <xsl:text> switch (nDefine)&#xa;</xsl:text>
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:value-of select="$switchblock1"/>
+ <xsl:text> default:&#xa;</xsl:text>
+ <xsl:text> break;&#xa;</xsl:text>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:if>
+ <xsl:if test="string-length($switchblock2) > 0">
+ <xsl:text> OOXMLFastContextHandlerValue * pValueHandler = dynamic_cast&lt;OOXMLFastContextHandlerValue *&gt;(pHandler);&#xa;</xsl:text>
+ <xsl:text> switch (nDefine)&#xa;</xsl:text>
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:value-of select="$switchblock2"/>
+ <xsl:text> default:&#xa;</xsl:text>
+ <xsl:text> break;&#xa;</xsl:text>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:if>
+ <xsl:text>}&#xa;</xsl:text>
+</xsl:template>
+
+<xsl:template name="charactersactionforvalues">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:for-each select="ancestor::namespace/rng:grammar/rng:define[@name=$name]">
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:text> // </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#xa;</xsl:text>
+ <xsl:for-each select="rng:data[@type='int']">
+ <xsl:text> OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(sText));&#xa;</xsl:text>
+ <xsl:text> pValueHandler->setValue(pValue);&#xa;</xsl:text>
</xsl:for-each>
- <xsl:text>
- default:
- break;
- }
-}
-</xsl:text>
+ <xsl:for-each select="rng:list">
+ <xsl:text> ListValueMapPointer pListValueMap = getListValueMap(nDefine);&#xa;</xsl:text>
+ <xsl:text> if (pListValueMap.get() != NULL)&#xa;</xsl:text>
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:text> OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue((*pListValueMap)[sText]));&#xa;</xsl:text>
+ <xsl:text> pValueHandler->setValue(pValue);</xsl:text>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:for-each>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:for-each>
</xsl:template>
<!-- factoryactions -->
<xsl:template name="factoryactions">
<xsl:variable name="ns" select="@name"/>
- <xsl:for-each select="resource/action">
+ <xsl:for-each select="resource/action[not(@name='characters')]">
<xsl:sort select="@name"/>
<xsl:if test="generate-id(key('actions', @name)[ancestor::namespace/@name=$ns][1]) = generate-id(.)">
<xsl:variable name="name" select="@name"/>
@@ -587,6 +677,9 @@ void </xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
+ <xsl:call-template name="factoryaction">
+ <xsl:with-param name="action">characters</xsl:with-param>
+ </xsl:call-template>
</xsl:template>
<xsl:template name="factorygetdefinename">
@@ -794,6 +887,22 @@ void </xsl:text>
</xsl:choose>
</xsl:template>
+<xsl:template name="factorygetname">
+ <xsl:param name="ns"/>
+ <xsl:text>
+#ifdef DEBUG_FACTORY
+string </xsl:text>
+<xsl:call-template name="factoryclassname"/>
+<xsl:text>::getName() const
+{
+ return "</xsl:text>
+ <xsl:value-of select="$ns"/>
+ <xsl:text>";
+}
+#endif
+</xsl:text>
+</xsl:template>
+
<xsl:template match="/">
<xsl:variable name="ns" select="substring-before(substring-after($file, 'OOXMLFactory_'), '.cxx')"/>
<xsl:text>
@@ -823,6 +932,9 @@ namespace ooxml {
<xsl:call-template name="factorygetdefinename"/>
<xsl:call-template name="factorytokentoidmap"/>
<xsl:call-template name="factoryattributeaction"/>
+ <xsl:call-template name="factorygetname">
+ <xsl:with-param name="ns" select="$ns"/>
+ </xsl:call-template>
</xsl:for-each>
<xsl:text>
/// @endcond
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index b00fd433c884..49998622e65d 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -191,11 +191,11 @@
</define>
</grammar>
<resource name="CT_OfficeStyleSheet" resource="Table" tokenid="ooxml:THEMETABLE"/>
- <resource name="theme" resource="Stream">
+ <resource name="theme" resource="Stream" tag="theme">
<element name="theme" tokenid="ooxml:THEMETABLE"/>
</resource>
- <resource name="themeOverride" resource="Stream"/>
- <resource name="themeManager" resource="Stream"/>
+ <resource name="themeOverride" resource="Stream" tag="theme"/>
+ <resource name="themeManager" resource="Stream" tag="theme"/>
</namespace>
<namespace name="dml-styleDefaults" file="dml-styleDefaults">
<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="http://schemas.openxmlformats.org/drawingml/2006/main">
@@ -1114,7 +1114,7 @@
<value name="hlink" tokenid="ooxml:Value_drawingml_ST_ColorSchemeIndex_hlink">hlink</value>
<value name="folHlink" tokenid="ooxml:Value_drawingml_ST_ColorSchemeIndex_folHlink">folHlink</value>
</resource>
- <resource name="CT_ColorScheme" resource="Properties">
+ <resource name="CT_ColorScheme" resource="Properties" tag="theme">
<element name="dk1" tokenid="ooxml:CT_ColorScheme_dk1"/>
<element name="lt1" tokenid="ooxml:CT_ColorScheme_lt1"/>
<element name="dk2" tokenid="ooxml:CT_ColorScheme_dk2"/>
@@ -1130,39 +1130,39 @@
<element name="extLst" tokenid="ooxml:CT_ColorScheme_extLst"/>
<attribute name="name" tokenid="ooxml:CT_ColorScheme_name"/>
</resource>
- <resource name="CT_SupplementalFont" resource="Properties">
+ <resource name="CT_SupplementalFont" resource="Properties" tag="theme">
<attribute name="script" tokenid="ooxml:CT_SupplementalFont_script"/>
<attribute name="typeface" tokenid="ooxml:CT_SupplementalFont_typeface"/>
</resource>
- <resource name="CT_FontCollection" resource="Properties">
+ <resource name="CT_FontCollection" resource="Properties" tag="theme">
<element name="latin" tokenid="ooxml:CT_FontCollection_latin"/>
<element name="ea" tokenid="ooxml:CT_FontCollection_ea"/>
<element name="cs" tokenid="ooxml:CT_FontCollection_cs"/>
<element name="font" tokenid="ooxml:CT_FontCollection_font"/>
<element name="extLst" tokenid="ooxml:CT_FontCollection_extLst"/>
</resource>
- <resource name="CT_FontScheme" resource="Properties">
+ <resource name="CT_FontScheme" resource="Properties" tag="theme">
<element name="majorFont" tokenid="ooxml:CT_FontScheme_majorFont"/>
<element name="minorFont" tokenid="ooxml:CT_FontScheme_minorFont"/>
<element name="extLst" tokenid="ooxml:CT_FontScheme_extLst"/>
<attribute name="name" tokenid="ooxml:CT_FontScheme_name"/>
</resource>
- <resource name="CT_FillStyleList" resource="Properties"/>
- <resource name="CT_LineStyleList" resource="Properties">
+ <resource name="CT_FillStyleList" resource="Properties" tag="theme"/>
+ <resource name="CT_LineStyleList" resource="Properties" tag="theme">
<element name="ln" tokenid="ooxml:CT_LineStyleList_ln"/>
</resource>
- <resource name="CT_EffectStyleList" resource="Properties">
+ <resource name="CT_EffectStyleList" resource="Properties" tag="theme">
<element name="effectStyle" tokenid="ooxml:CT_EffectStyleList_effectStyle"/>
</resource>
- <resource name="CT_BackgroundFillStyleList" resource="Properties"/>
- <resource name="CT_StyleMatrix" resource="Properties">
+ <resource name="CT_BackgroundFillStyleList" resource="Properties" tag="theme"/>
+ <resource name="CT_StyleMatrix" resource="Properties" tag="theme">
<element name="fillStyleLst" tokenid="ooxml:CT_StyleMatrix_fillStyleLst"/>
<element name="lnStyleLst" tokenid="ooxml:CT_StyleMatrix_lnStyleLst"/>
<element name="effectStyleLst" tokenid="ooxml:CT_StyleMatrix_effectStyleLst"/>
<element name="bgFillStyleLst" tokenid="ooxml:CT_StyleMatrix_bgFillStyleLst"/>
<attribute name="name" tokenid="ooxml:CT_StyleMatrix_name"/>
</resource>
- <resource name="CT_BaseStyles" resource="Properties">
+ <resource name="CT_BaseStyles" resource="Properties" tag="theme">
<element name="clrScheme" tokenid="ooxml:CT_BaseStyles_clrScheme"/>
<element name="fontScheme" tokenid="ooxml:CT_BaseStyles_fontScheme"/>
<element name="fmtScheme" tokenid="ooxml:CT_BaseStyles_fmtScheme"/>
@@ -1541,7 +1541,7 @@
<resource name="ST_TextFontSize" resource="Integer" generated="yes"/>
<resource name="ST_Panose" resource="Hex" generated="yes"/>
<resource name="ST_TextTypeface" resource="String" generated="yes"/>
- <resource name="CT_TextFont" resource="Properties">
+ <resource name="CT_TextFont" resource="Properties" tag="character">
<attribute name="typeface" tokenid="ooxml:CT_TextFont_typeface"/>
<attribute name="panose" tokenid="ooxml:CT_TextFont_panose"/>
<attribute name="pitchFamily" tokenid="ooxml:CT_TextFont_pitchFamily"/>
@@ -2738,7 +2738,7 @@
<value name="shdw19" tokenid="ooxml:Value_drawingml_ST_PresetShadowVal_shdw19">shdw19</value>
<value name="shdw20" tokenid="ooxml:Value_drawingml_ST_PresetShadowVal_shdw20">shdw20</value>
</resource>
- <resource name="CT_SolidColorFillProperties" resource="Properties"/>
+ <resource name="CT_SolidColorFillProperties" resource="Properties" tag="shape"/>
<resource name="ST_PathShadeType" resource="List" generated="yes">
<value name="shape" tokenid="ooxml:Value_drawingml_ST_PathShadeType_shape">shape</value>
<value name="circle" tokenid="ooxml:Value_drawingml_ST_PathShadeType_circle">circle</value>
@@ -2750,7 +2750,7 @@
<value name="y" tokenid="ooxml:Value_drawingml_ST_TileFlipMode_y">y</value>
<value name="xy" tokenid="ooxml:Value_drawingml_ST_TileFlipMode_xy">xy</value>
</resource>
- <resource name="CT_GradientStop" resource="Properties">
+ <resource name="CT_GradientStop" resource="Properties" tag="shape">
<attribute name="pos" tokenid="ooxml:CT_GradientStop_pos"/>
</resource>
<resource name="CT_TileInfoProperties" resource="Properties">
@@ -2761,10 +2761,10 @@
<attribute name="flip" tokenid="ooxml:CT_TileInfoProperties_flip"/>
<attribute name="algn" tokenid="ooxml:CT_TileInfoProperties_algn"/>
</resource>
- <resource name="CT_StretchInfoProperties" resource="Properties">
+ <resource name="CT_StretchInfoProperties" resource="Properties" tag="shape">
<element name="fillRect" tokenid="ooxml:CT_StretchInfoProperties_fillRect"/>
</resource>
- <resource name="EG_FillModeProperties" resource="Properties">
+ <resource name="EG_FillModeProperties" resource="Properties" tag="shape">
<element name="tile" tokenid="ooxml:EG_FillModeProperties_tile"/>
<element name="stretch" tokenid="ooxml:EG_FillModeProperties_stretch"/>
</resource>
@@ -2775,7 +2775,7 @@
<value name="hqprint" tokenid="ooxml:Value_drawingml_ST_BlipCompression_hqprint">hqprint</value>
<value name="none" tokenid="ooxml:Value_drawingml_ST_BlipCompression_none">none</value>
</resource>
- <resource name="CT_Blip" resource="Properties">
+ <resource name="CT_Blip" resource="Properties" tag="shape">
<element name="alphaBiLevel" tokenid="ooxml:CT_Blip_alphaBiLevel"/>
<element name="alphaCeiling" tokenid="ooxml:CT_Blip_alphaCeiling"/>
<element name="alphaFloor" tokenid="ooxml:CT_Blip_alphaFloor"/>
@@ -2796,7 +2796,7 @@
<element name="extLst" tokenid="ooxml:CT_Blip_extLst"/>
<attribute name="cstate" tokenid="ooxml:CT_Blip_cstate"/>
</resource>
- <resource name="CT_BlipFillProperties" resource="Properties">
+ <resource name="CT_BlipFillProperties" resource="Properties" tag="shape">
<element name="blip" tokenid="ooxml:CT_BlipFillProperties_blip"/>
<element name="srcRect" tokenid="ooxml:CT_BlipFillProperties_srcRect"/>
<attribute name="dpi" tokenid="ooxml:CT_BlipFillProperties_dpi"/>
@@ -2865,7 +2865,7 @@
<value name="darken" tokenid="ooxml:Value_drawingml_ST_BlendMode_darken">darken</value>
<value name="lighten" tokenid="ooxml:Value_drawingml_ST_BlendMode_lighten">lighten</value>
</resource>
- <resource name="EG_Effect" resource="Properties">
+ <resource name="EG_Effect" resource="Properties" tag="shape">
<element name="cont" tokenid="ooxml:EG_Effect_cont"/>
<element name="effect" tokenid="ooxml:EG_Effect_effect"/>
<element name="alphaBiLevel" tokenid="ooxml:EG_Effect_alphaBiLevel"/>
@@ -2901,7 +2901,7 @@
<value name="sib" tokenid="ooxml:Value_drawingml_ST_EffectContainerType_sib">sib</value>
<value name="tree" tokenid="ooxml:Value_drawingml_ST_EffectContainerType_tree">tree</value>
</resource>
- <resource name="CT_EffectContainer" resource="Properties">
+ <resource name="CT_EffectContainer" resource="Properties" tag="shape">
<attribute name="type" tokenid="ooxml:CT_EffectContainer_type"/>
<attribute name="name" tokenid="ooxml:CT_EffectContainer_name"/>
</resource>
@@ -3197,12 +3197,12 @@
<value name="med" tokenid="ooxml:Value_drawingml_ST_LineEndLength_med">med</value>
<value name="lg" tokenid="ooxml:Value_drawingml_ST_LineEndLength_lg">lg</value>
</resource>
- <resource name="CT_LineEndProperties" resource="Properties">
+ <resource name="CT_LineEndProperties" resource="Properties" tag="shape">
<attribute name="type" tokenid="ooxml:CT_LineEndProperties_type"/>
<attribute name="w" tokenid="ooxml:CT_LineEndProperties_w"/>
<attribute name="len" tokenid="ooxml:CT_LineEndProperties_len"/>
</resource>
- <resource name="EG_LineFillProperties" resource="Properties">
+ <resource name="EG_LineFillProperties" resource="Properties" tag="shape">
<element name="noFill" tokenid="ooxml:EG_LineFillProperties_noFill"/>
<element name="solidFill" tokenid="ooxml:EG_LineFillProperties_solidFill"/>
<element name="gradFill" tokenid="ooxml:EG_LineFillProperties_gradFill"/>
@@ -3237,7 +3237,7 @@
<value name="thinThick" tokenid="ooxml:Value_drawingml_ST_CompoundLine_thinThick">thinThick</value>
<value name="tri" tokenid="ooxml:Value_drawingml_ST_CompoundLine_tri">tri</value>
</resource>
- <resource name="CT_LineProperties" resource="Properties">
+ <resource name="CT_LineProperties" resource="Properties" tag="shape">
<element name="headEnd" tokenid="ooxml:CT_LineProperties_headEnd"/>
<element name="tailEnd" tokenid="ooxml:CT_LineProperties_tailEnd"/>
<element name="extLst" tokenid="ooxml:CT_LineProperties_extLst"/>
@@ -3331,7 +3331,7 @@
</optional>
</define>
</grammar>
- <resource name="CT_ShapeProperties" resource="Properties">
+ <resource name="CT_ShapeProperties" resource="Properties" tag="shape">
<element name="xfrm" tokenid="ooxml:CT_ShapeProperties_xfrm"/>
<element name="ln" tokenid="ooxml:CT_ShapeProperties_ln"/>
<element name="scene3d" tokenid="ooxml:CT_ShapeProperties_scene3d"/>
@@ -4429,41 +4429,41 @@
<attribute name="val" tokenid="ooxml:CT_Angle_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
- <resource name="CT_PositiveFixedAngle" resource="Value" generated="yes">
+ <resource name="CT_PositiveFixedAngle" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PositiveFixedAngle_val" action="setValue"/>
</resource>
<resource name="ST_Percentage" resource="Integer" generated="yes"/>
- <resource name="CT_Percentage" resource="Value" generated="yes">
+ <resource name="CT_Percentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Percentage_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
- <resource name="CT_PositivePercentage" resource="Value" generated="yes">
+ <resource name="CT_PositivePercentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PositivePercentage_val" action="setValue"/>
</resource>
- <resource name="CT_FixedPercentage" resource="Value" generated="yes">
+ <resource name="CT_FixedPercentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_FixedPercentage_val" action="setValue"/>
</resource>
- <resource name="CT_PositiveFixedPercentage" resource="Value" generated="yes">
+ <resource name="CT_PositiveFixedPercentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PositiveFixedPercentage_val" action="setValue"/>
</resource>
- <resource name="CT_Point2D" resource="Properties">
+ <resource name="CT_Point2D" resource="Properties" tag="shape">
<attribute name="x" tokenid="ooxml:CT_Point2D_x"/>
<attribute name="y" tokenid="ooxml:CT_Point2D_y"/>
</resource>
- <resource name="CT_PositiveSize2D" resource="Properties">
+ <resource name="CT_PositiveSize2D" resource="Properties" tag="shape">
<attribute name="cx" tokenid="ooxml:CT_PositiveSize2D_cx"/>
<attribute name="cy" tokenid="ooxml:CT_PositiveSize2D_cy"/>
</resource>
- <resource name="CT_ScRgbColor" resource="Properties">
+ <resource name="CT_ScRgbColor" resource="Properties" tag="shape">
<attribute name="r" tokenid="ooxml:CT_ScRgbColor_r"/>
<attribute name="g" tokenid="ooxml:CT_ScRgbColor_g"/>
<attribute name="b" tokenid="ooxml:CT_ScRgbColor_b"/>
</resource>
<resource name="ST_HexBinary3" resource="Hex" generated="yes"/>
- <resource name="CT_SRgbColor" resource="Properties">
+ <resource name="CT_SRgbColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_SRgbColor_val"/>
</resource>
- <resource name="CT_HslColor" resource="Properties">
+ <resource name="CT_HslColor" resource="Properties" tag="shape">
<attribute name="hue" tokenid="ooxml:CT_HslColor_hue"/>
<attribute name="sat" tokenid="ooxml:CT_HslColor_sat"/>
<attribute name="lum" tokenid="ooxml:CT_HslColor_lum"/>
@@ -4500,7 +4500,7 @@
<value name="menuHighlight" tokenid="ooxml:Value_drawingml_ST_SystemColorVal_menuHighlight">menuHighlight</value>
<value name="menuBar" tokenid="ooxml:Value_drawingml_ST_SystemColorVal_menuBar">menuBar</value>
</resource>
- <resource name="CT_SystemColor" resource="Properties">
+ <resource name="CT_SystemColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_SystemColor_val"/>
<attribute name="lastClr" tokenid="ooxml:CT_SytemColor_lastClr"/>
</resource>
@@ -4523,7 +4523,7 @@
<value name="dk2" tokenid="ooxml:Value_drawingml_ST_SchemeColorVal_dk2">dk2</value>
<value name="lt2" tokenid="ooxml:Value_drawingml_ST_SchemeColorVal_lt2">lt2</value>
</resource>
- <resource name="CT_SchemeColor" resource="Properties">
+ <resource name="CT_SchemeColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_SchemeColor_val"/>
</resource>
<resource name="ST_PresetColorVal" resource="List">
@@ -4668,10 +4668,10 @@
<value tokenid="0xffff00">yellow</value>
<value tokenid="0x9acd32">yellowGreen</value>
</resource>
- <resource name="CT_PresetColor" resource="Properties">
+ <resource name="CT_PresetColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_PresetColor_val"/>
</resource>
- <resource name="CT_Transform2D" resource="Properties">
+ <resource name="CT_Transform2D" resource="Properties" tag="shape">
<element name="off" tokenid="ooxml:CT_Transform2D_off"/>
<element name="ext" tokenid="ooxml:CT_Transform2D_ext"/>
<attribute name="rot" tokenid="ooxml:CT_Transform2D_rot"/>
@@ -4690,7 +4690,7 @@
<value name="br" tokenid="ooxml:Value_drawingml_ST_RectAlignment_br">br</value>
</resource>
<resource name="ST_Guid" resource="String" generated="yes"/>
- <resource name="EG_ColorChoice" resource="Properties">
+ <resource name="EG_ColorChoice" resource="Properties" tag="shape">
<element name="scrgbClr" tokenid="ooxml:EG_ColorChoice_scrgbClr"/>
<element name="srgbClr" tokenid="ooxml:EG_ColorChoice_srgbClr"/>
<element name="hslClr" tokenid="ooxml:EG_ColorChoice_hslClr"/>
@@ -4698,8 +4698,8 @@
<element name="schemeClr" tokenid="ooxml:EG_ColorChoice_schemeClr"/>
<element name="prstClr" tokenid="ooxml:EG_ColorChoice_prstClr"/>
</resource>
- <resource name="CT_Color" resource="Properties"/>
- <resource name="CT_ColorMRU" resource="Properties"/>
+ <resource name="CT_Color" resource="Properties" tag="shape"/>
+ <resource name="CT_ColorMRU" resource="Properties" tag="shape"/>
<resource name="ST_BlackWhiteMode" resource="List" generated="yes">
<value name="clr" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_clr">clr</value>
<value name="auto" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_auto">auto</value>
@@ -4713,7 +4713,7 @@
<value name="white" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_white">white</value>
<value name="hidden" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_hidden">hidden</value>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="AG_Blob" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="AG_Blob" resource="Properties" tag="shape">
<attribute name="r:embed" tokenid="ooxml:AG_Blob_r_embed"/>
<attribute name="r:link" tokenid="ooxml:AG_Blob_r_link"/>
</resource>
@@ -5100,7 +5100,7 @@
</optional>
</define>
</grammar>
- <resource name="CT_GraphicalObjectFrameLocking" resource="Properties">
+ <resource name="CT_GraphicalObjectFrameLocking" resource="Properties" tag="shape">
<element name="extLst" tokenid="ooxml:CT_GraphicalObjectFrameLocking_extLst"/>
<attribute name="noGrp" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noGrp"/>
<attribute name="noDrilldown" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noDrilldown"/>
@@ -5109,7 +5109,7 @@
<attribute name="noMove" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noMove"/>
<attribute name="noResize" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noResize"/>
</resource>
- <resource name="CT_NonVisualDrawingProps" resource="Properties">
+ <resource name="CT_NonVisualDrawingProps" resource="Properties" tag="shape">
<element name="hlinkClick" tokenid="ooxml:CT_NonVisualDrawingProps_hlinkClick"/>
<element name="hlinkHover" tokenid="ooxml:CT_NonVisualDrawingProps_hlinkHover"/>
<element name="extLst" tokenid="ooxml:CT_NonVisualDrawingProps_extLst"/>
@@ -5118,12 +5118,12 @@
<attribute name="descr" tokenid="ooxml:CT_NonVisualDrawingProps_descr"/>
<attribute name="hidden" tokenid="ooxml:CT_NonVisualDrawingProps_hidden"/>
</resource>
- <resource name="CT_NonVisualPictureProperties" resource="Properties">
+ <resource name="CT_NonVisualPictureProperties" resource="Properties" tag="shape">
<element name="picLocks" tokenid="ooxml:CT_NonVisualPictureProperties_picLocks"/>
<element name="extLst" tokenid="ooxml:CT_NonVisualPictureProperties_extLst"/>
<attribute name="preferRelativeResize" tokenid="ooxml:CT_NonVisualPictureProperties_preferRelativeResize"/>
</resource>
- <resource name="CT_NonVisualGraphicFrameProperties" resource="Properties">
+ <resource name="CT_NonVisualGraphicFrameProperties" resource="Properties" tag="shape">
<element name="graphicFrameLocks" tokenid="ooxml:CT_NonVisualGraphicFrameProperties_graphicFrameLocks"/>
<element name="extLst" tokenid="ooxml:CT_NonVisualGraphicFrameProperties_extLst"/>
</resource>
@@ -5159,14 +5159,14 @@
</element>
</define>
</grammar>
- <resource name="CT_GraphicalObjectData" resource="Properties">
+ <resource name="CT_GraphicalObjectData" resource="Properties" tag="shape">
<element name="pic" tokenid="ooxml:CT_GraphicalObjectData_pic"/>
<attribute name="uri" tokenid="ooxml:CT_GraphicalObjectData_uri"/>
</resource>
- <resource name="CT_GraphicalObject" resource="Properties">
+ <resource name="CT_GraphicalObject" resource="Properties" tag="shape">
<element name="graphicData" tokenid="ooxml:CT_GraphicalObject_graphicData"/>
</resource>
- <resource name="graphic" resource="Properties">
+ <resource name="graphic" resource="Properties" tag="shape">
<element name="graphic" tokenid="ooxml:graphic_graphic"/>
</resource>
</namespace>
@@ -6271,7 +6271,7 @@
</resource>
<resource name="ST_GeomGuideName" resource="String" generated="yes"/>
<resource name="ST_GeomGuideFormula" resource="String" generated="yes"/>
- <resource name="CT_GeomGuideList" resource="Properties">
+ <resource name="CT_GeomGuideList" resource="Properties" tag="shape">
<element name="gd" tokenid="ooxml:CT_GeomGuideList_gd"/>
</resource>
<resource name="ST_PathFillMode" resource="List" generated="yes">
@@ -6282,11 +6282,11 @@
<value name="darken" tokenid="ooxml:Value_drawingml_ST_PathFillMode_darken">darken</value>
<value name="darkenLess" tokenid="ooxml:Value_drawingml_ST_PathFillMode_darkenLess">darkenLess</value>
</resource>
- <resource name="CT_PresetGeometry2D" resource="Properties">
+ <resource name="CT_PresetGeometry2D" resource="Properties" tag="shape">
<element name="avLst" tokenid="ooxml:CT_PresetGeometry2D_avLst"/>
<attribute name="prst" tokenid="ooxml:CT_PresetGeometry2D_prst"/>
</resource>
- <resource name="CT_CustomGeometry2D" resource="Properties">
+ <resource name="CT_CustomGeometry2D" resource="Properties" tag="shape">
<element name="avLst" tokenid="ooxml:CT_CustomGeometry2D_avLst"/>
<element name="gdLst" tokenid="ooxml:CT_CustomGeometry2D_gdLst"/>
<element name="ahLst" tokenid="ooxml:CT_CustomGeometry2D_ahLst"/>
@@ -6294,7 +6294,7 @@
<element name="rect" tokenid="ooxml:CT_CustomGeometry2D_rect"/>
<element name="pathLst" tokenid="ooxml:CT_CustomGeometry2D_pathLst"/>
</resource>
- <resource name="EG_Geometry" resource="Properties">
+ <resource name="EG_Geometry" resource="Properties" tag="shape">
<element name="custGeom" tokenid="ooxml:EG_Geometry_custGeom"/>
<element name="prstGeom" tokenid="ooxml:EG_Geometry_prstGeom"/>
</resource>
@@ -6764,14 +6764,14 @@
</element>
</define>
</grammar>
- <resource name="CT_EffectExtent" resource="Properties">
+ <resource name="CT_EffectExtent" resource="Properties" tag="shape">
<attribute name="l" tokenid="ooxml:CT_EffectExtent_l"/>
<attribute name="t" tokenid="ooxml:CT_EffectExtent_t"/>
<attribute name="r" tokenid="ooxml:CT_EffectExtent_r"/>
<attribute name="b" tokenid="ooxml:CT_EffectExtent_b"/>
</resource>
<resource name="ST_WrapDistance" resource="Integer" generated="yes"/>
- <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Inline" resource="Properties">
+ <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Inline" resource="Properties" tag="shape">
<element name="extent" tokenid="ooxml:CT_Inline_extent"/>
<element name="effectExtent" tokenid="ooxml:CT_Inline_effectExtent"/>
<element name="docPr" tokenid="ooxml:CT_Inline_docPr"/>
@@ -6788,13 +6788,13 @@
<value name="right" tokenid="ooxml:Value_wordprocessingDrawing_ST_WrapText_right">right</value>
<value name="largest" tokenid="ooxml:Value_wordprocessingDrawing_ST_WrapText_largest">largest</value>
</resource>
- <resource name="CT_WrapPath" resource="Properties">
+ <resource name="CT_WrapPath" resource="Properties" tag="shape">
<element name="start" tokenid="ooxml:CT_WrapPath_start"/>
<element name="lineTo" tokenid="ooxml:CT_WrapPath_lineTo"/>
<attribute name="edited" tokenid="ooxml:CT_WrapPath_edited"/>
</resource>
- <resource name="CT_WrapNone" resource="Properties"/>
- <resource name="CT_WrapSquare" resource="Properties">
+ <resource name="CT_WrapNone" resource="Properties" tag="shape"/>
+ <resource name="CT_WrapSquare" resource="Properties" tag="shape">
<element name="effectExtent" tokenid="ooxml:CT_WrapSquare_effectExtent"/>
<attribute name="wrapText" tokenid="ooxml:CT_WrapSquare_wrapText"/>
<attribute name="distT" tokenid="ooxml:CT_WrapSquare_distT"/>
@@ -6802,34 +6802,34 @@
<attribute name="distL" tokenid="ooxml:CT_WrapSquare_distL"/>
<attribute name="distR" tokenid="ooxml:CT_WrapSquare_distR"/>
</resource>
- <resource name="CT_WrapTight" resource="Properties">
+ <resource name="CT_WrapTight" resource="Properties" tag="shape">
<element name="wrapPolygon" tokenid="ooxml:CT_WrapTight_wrapPolygon"/>
<attribute name="wrapText" tokenid="ooxml:CT_WrapTight_wrapText"/>
<attribute name="distL" tokenid="ooxml:CT_WrapTight_distL"/>
<attribute name="distR" tokenid="ooxml:CT_WrapTight_distR"/>
</resource>
- <resource name="CT_WrapThrough" resource="Properties">
+ <resource name="CT_WrapThrough" resource="Properties" tag="shape">
<element name="wrapPolygon" tokenid="ooxml:CT_WrapThrough_wrapPolygon"/>
<attribute name="wrapText" tokenid="ooxml:CT_WrapThrough_wrapText"/>
<attribute name="distL" tokenid="ooxml:CT_WrapThrough_distL"/>
<attribute name="distR" tokenid="ooxml:CT_WrapThrough_distR"/>
</resource>
- <resource name="CT_WrapTopBottom" resource="Properties">
+ <resource name="CT_WrapTopBottom" resource="Properties" tag="shape">
<element name="effectExtent" tokenid="ooxml:CT_WrapTopBottom_effectExtent"/>
<attribute name="distT" tokenid="ooxml:CT_WrapTopBottom_distT"/>
<attribute name="distB" tokenid="ooxml:CT_WrapTopBottom_distB"/>
</resource>
- <resource name="EG_WrapType" resource="Properties">
+ <resource name="EG_WrapType" resource="Properties" tag="shape">
<element name="wrapNone" tokenid="ooxml:EG_WrapType_wrapNone"/>
<element name="wrapSquare" tokenid="ooxml:EG_WrapType_wrapSquare"/>
<element name="wrapTight" tokenid="ooxml:EG_WrapType_wrapTight"/>
<element name="wrapThrough" tokenid="ooxml:EG_WrapType_wrapThrough"/>
<element name="wrapTopAndBottom" tokenid="ooxml:EG_WrapType_wrapTopAndBottom"/>
</resource>
- <resource name="CT_PositionOffset" resource="Value"/>
+ <resource name="CT_PositionOffset" resource="Value" tag="shape"/>
<resource name="ST_PositionOffset" resource="Integer" generated="yes"/>
- <resource name="CT_AlignH" resource="Value"/>
- <resource name="ST_AlignH" resource="List" generated="yes">
+ <resource name="CT_AlignH" resource="Value" tag="shape"/>
+ <resource name="ST_AlignH" resource="List" generated="yes" tag="shape">
<value name="left" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_left">left</value>
<value name="right" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_right">right</value>
<value name="center" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_center">center</value>
@@ -6846,12 +6846,12 @@
<value name="insideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromH_insideMargin">insideMargin</value>
<value name="outsideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromH_outsideMargin">outsideMargin</value>
</resource>
- <resource name="CT_PosH" resource="Properties">
+ <resource name="CT_PosH" resource="Properties" tag="shape">
<element name="align" tokenid="ooxml:CT_PosH_align"/>
<element name="posOffset" tokenid="ooxml:CT_PosH_posOffset"/>
<attribute name="relativeFrom" tokenid="ooxml:CT_PosH_relativeFrom"/>
</resource>
- <resource name="CT_AlignV" resource="Value"/>
+ <resource name="CT_AlignV" resource="Value" tag="shape"/>
<resource name="ST_AlignV" resource="List" generated="yes">
<value name="top" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignV_top">top</value>
<value name="bottom" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignV_bottom">bottom</value>
@@ -6869,12 +6869,12 @@
<value name="insideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromV_insideMargin">insideMargin</value>
<value name="outsideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromV_outsideMargin">outsideMargin</value>
</resource>
- <resource name="CT_PosV" resource="Properties">
+ <resource name="CT_PosV" resource="Properties" tag="shape">
<element name="align" tokenid="ooxml:CT_PosV_align"/>
<element name="posOffset" tokenid="ooxml:CT_PosV_posOffset"/>
<attribute name="relativeFrom" tokenid="ooxml:CT_PosV_relativeFrom"/>
</resource>
- <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Anchor" resource="Properties">
+ <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Anchor" resource="Properties" tag="shape">
<element name="simplePos" tokenid="ooxml:CT_Anchor_simplePos_elem"/>
<element name="positionH" tokenid="ooxml:CT_Anchor_positionH"/>
<element name="positionV" tokenid="ooxml:CT_Anchor_positionV"/>
@@ -6895,10 +6895,10 @@
<attribute name="hidden" tokenid="ooxml:CT_Anchor_hidden"/>
<attribute name="allowOverlap" tokenid="ooxml:CT_Anchor_allowOverlap"/>
</resource>
- <resource name="inline" resource="Properties">
+ <resource name="inline" resource="Properties" tag="shape">
<element name="inline" tokenid="ooxml:inline_inline"/>
</resource>
- <resource name="anchor" resource="Properties">
+ <resource name="anchor" resource="Properties" tag="shape">
<element name="anchor" tokenid="ooxml:anchor_anchor"/>
</resource>
</namespace>
@@ -8202,27 +8202,27 @@
</define>
</grammar>
<resource name="ST_Integer255" resource="Integer" generated="yes"/>
- <resource name="CT_Integer255" resource="Value" generated="yes">
+ <resource name="CT_Integer255" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Integer255_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_Integer2" resource="Integer" generated="yes"/>
- <resource name="CT_Integer2" resource="Value" generated="yes">
+ <resource name="CT_Integer2" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Integer2_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_SpacingRule" resource="Integer" generated="yes"/>
- <resource name="CT_SpacingRule" resource="Value" generated="yes">
+ <resource name="CT_SpacingRule" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_SpacingRule_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_UnSignedInteger" resource="Integer" generated="yes"/>
- <resource name="CT_UnSignedInteger" resource="Value" generated="yes">
+ <resource name="CT_UnSignedInteger" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_UnSignedInteger_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_Char" resource="String" generated="yes"/>
- <resource name="CT_Char" resource="Value" generated="yes">
+ <resource name="CT_Char" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Char_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -8230,12 +8230,12 @@
<value name="on" tokenid="ooxml:Value_math_ST_OnOff_on">on</value>
<value name="off" tokenid="ooxml:Value_math_ST_OnOff_off">off</value>
</resource>
- <resource name="CT_OnOff" resource="Value">
+ <resource name="CT_OnOff" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_OnOff_val" action="setValue"/>
<action name="start" action="setDefaultBooleanValue"/>
</resource>
<resource name="ST_String" resource="String" generated="yes"/>
- <resource name="CT_String" resource="Value" generated="yes">
+ <resource name="CT_String" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_String_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -8244,7 +8244,7 @@
<value name="center" tokenid="ooxml:Value_math_ST_XAlign_center">center</value>
<value name="right" tokenid="ooxml:Value_math_ST_XAlign_right">right</value>
</resource>
- <resource name="CT_XAlign" resource="Value" generated="yes">
+ <resource name="CT_XAlign" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_XAlign_val" action="setValue"/>
</resource>
<resource name="ST_YAlign" resource="List" generated="yes">
@@ -8252,14 +8252,14 @@
<value name="center" tokenid="ooxml:Value_math_ST_YAlign_center">center</value>
<value name="bot" tokenid="ooxml:Value_math_ST_YAlign_bot">bot</value>
</resource>
- <resource name="CT_YAlign" resource="Value" generated="yes">
+ <resource name="CT_YAlign" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_YAlign_val" action="setValue"/>
</resource>
<resource name="ST_Shp" resource="List" generated="yes">
<value name="centered" tokenid="ooxml:Value_math_ST_Shp_centered">centered</value>
<value name="match" tokenid="ooxml:Value_math_ST_Shp_match">match</value>
</resource>
- <resource name="CT_Shp" resource="Value" generated="yes">
+ <resource name="CT_Shp" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_Shp_val" action="setValue"/>
</resource>
<resource name="ST_FType" resource="List" generated="yes">
@@ -8268,21 +8268,21 @@
<value name="lin" tokenid="ooxml:Value_math_ST_FType_lin">lin</value>
<value name="noBar" tokenid="ooxml:Value_math_ST_FType_noBar">noBar</value>
</resource>
- <resource name="CT_FType" resource="Value" generated="yes">
+ <resource name="CT_FType" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_FType_val" action="setValue"/>
</resource>
<resource name="ST_LimLoc" resource="List" generated="yes">
<value name="undOvr" tokenid="ooxml:Value_math_ST_LimLoc_undOvr">undOvr</value>
<value name="subSup" tokenid="ooxml:Value_math_ST_LimLoc_subSup">subSup</value>
</resource>
- <resource name="CT_LimLoc" resource="Value" generated="yes">
+ <resource name="CT_LimLoc" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_LimLoc_val" action="setValue"/>
</resource>
<resource name="ST_TopBot" resource="List" generated="yes">
<value name="top" tokenid="ooxml:Value_math_ST_TopBot_top">top</value>
<value name="bot" tokenid="ooxml:Value_math_ST_TopBot_bot">bot</value>
</resource>
- <resource name="CT_TopBot" resource="Value" generated="yes">
+ <resource name="CT_TopBot" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_TopBot_val" action="setValue"/>
</resource>
<resource name="ST_Script" resource="List" generated="yes">
@@ -8293,7 +8293,7 @@
<value name="sansmserif" tokenid="ooxml:Value_math_ST_Script_sansmserif">sans-serif</value>
<value name="monospace" tokenid="ooxml:Value_math_ST_Script_monospace">monospace</value>
</resource>
- <resource name="CT_Script" resource="Value" generated="yes">
+ <resource name="CT_Script" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_Script_val" action="setValue"/>
</resource>
<resource name="ST_Style" resource="List">
@@ -8302,7 +8302,7 @@
<value tokenid="ooxml:Value_ST_Style_i">i</value>
<value tokenid="ooxml:Value_ST_Style_p">p</value>
</resource>
- <resource name="CT_Style" resource="Value">
+ <resource name="CT_Style" resource="Value" tag="math">
<attribute name="val" tokenid="ooxml:CT_Style_val" action="setValue"/>
</resource>
<resource name="ST_Jc" resource="List" generated="yes">
@@ -8311,11 +8311,11 @@
<value name="center" tokenid="ooxml:Value_math_ST_Jc_center">center</value>
<value name="centerGroup" tokenid="ooxml:Value_math_ST_Jc_centerGroup">centerGroup</value>
</resource>
- <resource name="CT_OMathJc" resource="Value" generated="yes">
+ <resource name="CT_OMathJc" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_OMathJc_val" action="setValue"/>
</resource>
<resource name="ST_TwipsMeasure" resource="Integer" generated="yes"/>
- <resource name="CT_TwipsMeasure" resource="Value" generated="yes">
+ <resource name="CT_TwipsMeasure" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_TwipsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
@@ -8324,7 +8324,7 @@
<value name="after" tokenid="ooxml:Value_math_ST_BreakBin_after">after</value>
<value name="repeat" tokenid="ooxml:Value_math_ST_BreakBin_repeat">repeat</value>
</resource>
- <resource name="CT_BreakBin" resource="Value" generated="yes">
+ <resource name="CT_BreakBin" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_BreakBin_val" action="setValue"/>
</resource>
<resource name="ST_BreakBinSub" resource="List" generated="yes">
@@ -8332,7 +8332,7 @@
<value name="mp" tokenid="ooxml:Value_math_ST_BreakBinSub_mp">-+</value>
<value name="pm" tokenid="ooxml:Value_math_ST_BreakBinSub_pm">+-</value>
</resource>
- <resource name="CT_BreakBinSub" resource="Value" generated="yes">
+ <resource name="CT_BreakBinSub" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_BreakBinSub_val" action="setValue"/>
</resource>
</namespace>
@@ -8418,16 +8418,16 @@
</element>
</define>
</grammar>
- <resource name="CT_PictureNonVisual" resource="Properties">
+ <resource name="CT_PictureNonVisual" resource="Properties" tag="shape">
<element name="cNvPr" tokenid="ooxml:CT_PictureNonVisual_cNvPr"/>
<element name="cNvPicPr" tokenid="ooxml:CT_PictureNonVisual_cNvPicPr"/>
</resource>
- <resource name="CT_Picture" resource="Shape">
+ <resource name="CT_Picture" resource="Shape" tag="shape">
<element name="nvPicPr" tokenid="ooxml:CT_Picture_nvPicPr"/>
<element name="blipFill" tokenid="ooxml:CT_Picture_blipFill"/>
<element name="spPr" tokenid="ooxml:CT_Picture_spPr"/>
</resource>
- <resource name="pic" resource="Properties">
+ <resource name="pic" resource="Properties" tag="shape">
<element name="pic" tokenid="ooxml:pic_pic"/>
</resource>
</namespace>
@@ -11939,10 +11939,10 @@
</zeroOrMore>
</define>
</grammar>
- <resource name="OLEObject" resource="Properties">
+ <resource name="OLEObject" resource="Properties" tag="ole">
<element name="OLEObject" tokenid="ooxml:OLEObject_OLEObject"/>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_OLEObject" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_OLEObject" resource="Properties" tag="ole">
<element name="LinkType" tokenid="ooxml:CT_OLEObject_LinkType"/>
<element name="LockedField" tokenid="ooxml:CT_OLEObject_LockedField"/>
<element name="FieldCodes" tokenid="ooxml:CT_OLEObject_FieldCodes"/>
@@ -12320,10 +12320,10 @@
</list>
</define>
</grammar>
- <resource name="wrap" resource="Properties">
+ <resource name="wrap" resource="Properties" tag="shape">
<element name="wrap" tokenid="ooxml:wrap_wrap"/>
</resource>
- <resource name="CT_Wrap" resource="Properties">
+ <resource name="CT_Wrap" resource="Properties" tag="shape">
<attribute name="type" tokenid="ooxml:CT_Wrap_type"/>
<attribute name="side" tokenid="ooxml:CT_Wrap_side"/>
<attribute name="anchorx" tokenid="ooxml:CT_Wrap_anchorx"/>
@@ -13962,6 +13962,11 @@
</choice>
</list>
</define>
+ <define name="ST_Percentage">
+ <data type="int">
+ <xs:documentation>Percentage</xs:documentation>
+ </data>
+ </define>
<define name="CT_Zoom">
<optional>
<attribute name="val">
@@ -21043,77 +21048,77 @@
</zeroOrMore>
</define>
</grammar>
- <resource name="CT_Empty" resource="Stream">
+ <resource name="CT_Empty" resource="Stream" tag="content">
<action name="end" tokenid="ooxml:EG_RunInnerContent_noBreakHyphen" action="noBreakHyphen"/>
<action name="end" tokenid="ooxml:EG_RunInnerContent_softHyphen" action="softHyphen"/>
<action name="end" tokenid="ooxml:EG_RunInnerContent_cr" action="cr"/>
</resource>
<resource name="ST_OnOff" resource="Boolean"/>
- <resource name="CT_OnOff" resource="Value">
+ <resource name="CT_OnOff" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_OnOff_val" action="setValue"/>
<action name="start" action="setDefaultBooleanValue"/>
</resource>
<resource name="ST_LongHexNumber" resource="Hex"/>
- <resource name="CT_LongHexNumber" resource="Value">
+ <resource name="CT_LongHexNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_LongHexNumber_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
<resource name="ST_ShortHexNumber" resource="Hex"/>
- <resource name="CT_ShortHexNumber" resource="Value">
+ <resource name="CT_ShortHexNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_ShortHexNumber_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
<resource name="ST_UcharHexNumber" resource="Hex"/>
- <resource name="CT_UcharHexNumber" resource="Value">
+ <resource name="CT_UcharHexNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_UcharHexNumber_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
<resource name="ST_DecimalNumber" resource="Integer"/>
- <resource name="CT_DecimalNumber" resource="Value">
+ <resource name="CT_DecimalNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_DecimalNumber_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_UnsignedDecimalNumber" resource="Integer" generated="yes"/>
<resource name="ST_TwipsMeasure" resource="Integer"/>
- <resource name="CT_TwipsMeasure" resource="Value">
+ <resource name="CT_TwipsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_TwipsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_SignedTwipsMeasure" resource="Integer"/>
- <resource name="CT_SignedTwipsMeasure" resource="Value">
+ <resource name="CT_SignedTwipsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_SignedTwipsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_PixelsMeasure" resource="Integer" generated="yes"/>
- <resource name="CT_PixelsMeasure" resource="Value">
+ <resource name="CT_PixelsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PixelsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_HpsMeasure" resource="Integer"/>
- <resource name="CT_HpsMeasure" resource="Value">
+ <resource name="CT_HpsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_HpsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_SignedHpsMeasure" resource="Integer"/>
- <resource name="CT_SignedHpsMeasure" resource="Value">
+ <resource name="CT_SignedHpsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_SignedHpsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_DateTime" resource="String" generated="yes"/>
<resource name="ST_MacroName" resource="String" generated="yes"/>
- <resource name="CT_MacroName" resource="Value" generated="yes">
+ <resource name="CT_MacroName" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_MacroName_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
<resource name="ST_EighthPointMeasure" resource="Integer"/>
<resource name="ST_PointMeasure" resource="Integer"/>
<resource name="ST_String" resource="String"/>
- <resource name="CT_String" resource="Value">
+ <resource name="CT_String" resource="Value" tag="attribute" >
<attribute name="val" tokenid="ooxml:CT_String_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
<resource name="ST_TextScale" resource="Integer"/>
- <resource name="CT_TextScale" resource="Value">
+ <resource name="CT_TextScale" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_TextScale_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
@@ -21136,7 +21141,7 @@
<value tokenid="16">lightGray</value>
<value tokenid="0">none</value>
</resource>
- <resource name="CT_Highlight" resource="Value">
+ <resource name="CT_Highlight" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Highlight_val" action="setValue"/>
</resource>
<resource name="ST_HexColorAuto" resource="List">
@@ -21144,7 +21149,7 @@
</resource>
<resource name="ST_HexColorRGB" resource="Hex"/>
<resource name="ST_HexColor" resource="Hex"/>
- <resource name="CT_Color" resource="Properties">
+ <resource name="CT_Color" resource="Properties" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Color_val"/>
<attribute name="themeColor" tokenid="ooxml:CT_Color_themeColor"/>
<attribute name="themeTint" tokenid="ooxml:CT_Color_themeTint"/>
@@ -21152,12 +21157,12 @@
</resource>
<resource name="ST_LangCode" resource="Hex" generated="yes"/>
<resource name="ST_Lang" resource="String"/>
- <resource name="CT_Lang" resource="Value">
+ <resource name="CT_Lang" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Lang_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_Guid" resource="String"/>
- <resource name="CT_Guid" resource="Value">
+ <resource name="CT_Guid" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Guid_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21181,7 +21186,7 @@
<value tokenid="43">wavyDouble</value>
<value tokenid="0">none</value>
</resource>
- <resource name="CT_Underline" resource="Properties">
+ <resource name="CT_Underline" resource="Properties" tag="character">
<attribute name="val" tokenid="ooxml:CT_Underline_val" default="single"/>
<attribute name="color" tokenid="ooxml:CT_Underline_color"/>
<attribute name="themeColor" tokenid="ooxml:CT_Underline_themeColor"/>
@@ -21197,7 +21202,7 @@
<value tokenid="5">antsRed</value>
<value tokenid="6">shimmer</value>
</resource>
- <resource name="CT_TextEffect" resource="Value">
+ <resource name="CT_TextEffect" resource="Value" tag="character">
<attribute name="val" tokenid="ooxml:CT_TextEffect_val" action="setValue"/>
</resource>
<resource name="ST_Border" resource="List">
@@ -21393,7 +21398,7 @@
<value tokenid="226">zigZag</value>
<value tokenid="227">zigZagStitch</value>
</resource>
- <resource name="CT_Border" resource="Properties">
+ <resource name="CT_Border" resource="Properties" tag="attribute">
<attribute name="val" tokenid="rtf:BRCTYPE"/>
<attribute name="color" tokenid="ooxml:CT_Border_color"/>
<attribute name="themeColor" tokenid="ooxml:CT_Border_themeColor"/>
@@ -21444,7 +21449,7 @@
<value tokenid="13">pct90</value>
<value tokenid="60">pct95</value>
</resource>
- <resource name="CT_Shd" resource="Properties">
+ <resource name="CT_Shd" resource="Properties" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Shd_val"/>
<attribute name="color" tokenid="ooxml:CT_Shd_color"/>
<attribute name="themeColor" tokenid="ooxml:CT_Shd_themeColor"/>
@@ -21455,16 +21460,16 @@
<attribute name="themeFillTint" tokenid="ooxml:CT_Shd_themeFillTint"/>
<attribute name="themeFillShade" tokenid="ooxml:CT_Shd_themeFillShade"/>
</resource>
- <resource name="ST_VerticalAlignRun" resource="List" generated="yes">
+ <resource name="ST_VerticalAlignRun" resource="List" generated="yes" tag="character">
<value name="baseline" tokenid="ooxml:Value_wordprocessingml_ST_VerticalAlignRun_baseline">baseline</value>
<value name="superscript" tokenid="ooxml:Value_wordprocessingml_ST_VerticalAlignRun_superscript">superscript</value>
<value name="subscript" tokenid="ooxml:Value_wordprocessingml_ST_VerticalAlignRun_subscript">subscript</value>
</resource>
- <resource name="CT_VerticalAlignRun" resource="Value" generated="yes">
+ <resource name="CT_VerticalAlignRun" resource="Value" generated="yes" tag="character">
<attribute name="val" tokenid="ooxml:CT_VerticalAlignRun_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_FitText" resource="Properties">
+ <resource name="CT_FitText" resource="Properties" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_FitText_val"/>
<attribute name="id" tokenid="ooxml:CT_FitText_id"/>
</resource>
@@ -21475,10 +21480,10 @@
<value tokenid="3">circle</value>
<value tokenid="4">underDot</value>
</resource>
- <resource name="CT_Em" resource="Value">
+ <resource name="CT_Em" resource="Value" tag="character">
<attribute name="val" tokenid="ooxml:CT_Em_val" action="setValue"/>
</resource>
- <resource name="CT_Language" resource="Properties">
+ <resource name="CT_Language" resource="Properties" tag="character">
<attribute name="val" tokenid="ooxml:CT_Language_val"/>
<attribute name="eastAsia" tokenid="ooxml:CT_Language_eastAsia"/>
<attribute name="bidi" tokenid="ooxml:CT_Language_bidi"/>
@@ -21490,7 +21495,7 @@
<value tokenid="3">angle</value>
<value tokenid="4">curly</value>
</resource>
- <resource name="CT_EastAsianLayout" resource="Properties">
+ <resource name="CT_EastAsianLayout" resource="Properties" tag="character">
<attribute name="id" tokenid="ooxml:CT_EastAsianLayout_id"/>
<attribute name="combine" tokenid="ooxml:CT_EastAsianLayout_combine"/>
<attribute name="combineBrackets" tokenid="ooxml:CT_EastAsianLayout_combineBrackets"/>
@@ -21540,7 +21545,7 @@
<value name="drop" tokenid="ooxml:Value_wordprocessingml_ST_DropCap_drop">drop</value>
<value name="margin" tokenid="ooxml:Value_wordprocessingml_ST_DropCap_margin">margin</value>
</resource>
- <resource name="CT_FramePr" resource="Properties">
+ <resource name="CT_FramePr" resource="Properties" tag="frame">
<kind name="paragraph"/>
<attribute name="dropCap" tokenid="ooxml:CT_FramePr_dropCap"/>
<attribute name="lines" tokenid="ooxml:CT_FramePr_lines"/>
@@ -21575,7 +21580,7 @@
<value tokenid="4">heavy</value>
<value tokenid="ooxml:Value_ST_TabTlc_middleDot">middleDot</value>
</resource>
- <resource name="CT_TabStop" resource="Properties">
+ <resource name="CT_TabStop" resource="Properties" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_TabStop_val"/>
<attribute name="leader" tokenid="ooxml:CT_TabStop_leader"/>
<attribute name="pos" tokenid="ooxml:CT_TabStop_pos"/>
@@ -21585,7 +21590,7 @@
<value name="exact" tokenid="ooxml:Value_wordprocessingml_ST_LineSpacingRule_exact">exact</value>
<value name="atLeast" tokenid="ooxml:Value_wordprocessingml_ST_LineSpacingRule_atLeast">atLeast</value>
</resource>
- <resource name="CT_Spacing" resource="Properties">
+ <resource name="CT_Spacing" resource="Properties" tag="paragraüh">
<attribute name="before" tokenid="ooxml:CT_Spacing_before"/>
<attribute name="beforeLines" tokenid="ooxml:CT_Spacing_beforeLines"/>
<attribute name="beforeAutospacing" tokenid="ooxml:CT_Spacing_beforeAutospacing"/>
@@ -21595,7 +21600,7 @@
<attribute name="line" tokenid="ooxml:CT_Spacing_line"/>
<attribute name="lineRule" tokenid="ooxml:CT_Spacing_lineRule"/>
</resource>
- <resource name="CT_Ind" resource="Properties">
+ <resource name="CT_Ind" resource="Properties" tag="paragraph">
<attribute name="left" tokenid="ooxml:CT_Ind_left"/>
<attribute name="leftChars" tokenid="ooxml:CT_Ind_leftChars"/>
<attribute name="right" tokenid="ooxml:CT_Ind_right"/>
@@ -21617,7 +21622,7 @@
<value tokenid="ooxml:Value_ST_Jc_lowKashida">lowKashida</value>
<value tokenid="ooxml:Value_ST_Jc_thaiDistribute">thaiDistribute</value>
</resource>
- <resource name="CT_Jc" resource="Value">
+ <resource name="CT_Jc" resource="Value" tag="character">
<attribute name="val" tokenid="ooxml:CT_Jc_val" action="setValue"/>
</resource>
<resource name="ST_View" resource="List" generated="yes">
@@ -21628,7 +21633,7 @@
<value name="normal" tokenid="ooxml:Value_wordprocessingml_ST_View_normal">normal</value>
<value name="web" tokenid="ooxml:Value_wordprocessingml_ST_View_web">web</value>
</resource>
- <resource name="CT_View" resource="Properties">
+ <resource name="CT_View" resource="Properties" tag="settings">
<attribute name="val" tokenid="ooxml:CT_View_val"/>
</resource>
<resource name="ST_Zoom" resource="List" generated="yes">
@@ -21637,11 +21642,11 @@
<value name="bestFit" tokenid="ooxml:Value_wordprocessingml_ST_Zoom_bestFit">bestFit</value>
<value name="textFit" tokenid="ooxml:Value_wordprocessingml_ST_Zoom_textFit">textFit</value>
</resource>
- <resource name="CT_Zoom" resource="Properties">
+ <resource name="CT_Zoom" resource="Properties" tag="settings">
<attribute name="val" tokenid="ooxml:CT_Zoom_val"/>
<attribute name="percent" tokenid="ooxml:CT_Zoom_percent"/>
</resource>
- <resource name="CT_WritingStyle" resource="Properties">
+ <resource name="CT_WritingStyle" resource="Properties" tag="settings">
<attribute name="lang" tokenid="ooxml:CT_WritingStyle_lang"/>
<attribute name="vendorID" tokenid="ooxml:CT_WritingStyle_vendorID"/>
<attribute name="dllVersion" tokenid="ooxml:CT_WritingStyle_dllVersion"/>
@@ -21653,7 +21658,7 @@
<value name="clean" tokenid="ooxml:Value_wordprocessingml_ST_Proof_clean">clean</value>
<value name="dirty" tokenid="ooxml:Value_wordprocessingml_ST_Proof_dirty">dirty</value>
</resource>
- <resource name="CT_Proof" resource="Properties">
+ <resource name="CT_Proof" resource="Properties" tag="redline">
<attribute name="spelling" tokenid="ooxml:CT_Proof_spelling"/>
<attribute name="grammar" tokenid="ooxml:CT_Proof_grammar"/>
</resource>
@@ -21662,7 +21667,7 @@
<value name="letter" tokenid="ooxml:Value_wordprocessingml_ST_DocType_letter">letter</value>
<value name="eMail" tokenid="ooxml:Value_wordprocessingml_ST_DocType_eMail">eMail</value>
</resource>
- <resource name="CT_DocType" resource="Properties">
+ <resource name="CT_DocType" resource="Properties" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocType_val"/>
</resource>
<resource name="ST_DocProtect" resource="List" generated="yes">
@@ -21696,7 +21701,7 @@
<attribute name="hash" tokenid="ooxml:AG_Password_hash"/>
<attribute name="salt" tokenid="ooxml:AG_Password_salt"/>
</resource>
- <resource name="CT_DocProtect" resource="Properties">
+ <resource name="CT_DocProtect" resource="Properties" tag="document">
<attribute name="edit" tokenid="ooxml:CT_DocProtect_edit"/>
<attribute name="formatting" tokenid="ooxml:CT_DocProtect_formatting"/>
<attribute name="enforcement" tokenid="ooxml:CT_DocProtect_enforcement"/>
@@ -21709,7 +21714,7 @@
<value name="email" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDocType_email">email</value>
<value name="fax" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDocType_fax">fax</value>
</resource>
- <resource name="CT_MailMergeDocType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeDocType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeDocType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21721,7 +21726,7 @@
<value name="odbc" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDataType_odbc">odbc</value>
<value name="native" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDataType_native">native</value>
</resource>
- <resource name="CT_MailMergeDataType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeDataType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeDataType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21731,7 +21736,7 @@
<value name="email" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDest_email">email</value>
<value name="fax" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDest_fax">fax</value>
</resource>
- <resource name="CT_MailMergeDest" resource="Value" generated="yes">
+ <resource name="CT_MailMergeDest" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeDest_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21739,18 +21744,18 @@
<value name="null" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeOdsoFMDFieldType_null">null</value>
<value name="dbColumn" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeOdsoFMDFieldType_dbColumn">dbColumn</value>
</resource>
- <resource name="CT_MailMergeOdsoFMDFieldType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeOdsoFMDFieldType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeOdsoFMDFieldType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_TrackChangesView" resource="Properties">
+ <resource name="CT_TrackChangesView" resource="Properties" tag="redline">
<attribute name="markup" tokenid="ooxml:CT_TrackChangesView_markup"/>
<attribute name="comments" tokenid="ooxml:CT_TrackChangesView_comments"/>
<attribute name="insDel" tokenid="ooxml:CT_TrackChangesView_insDel"/>
<attribute name="formatting" tokenid="ooxml:CT_TrackChangesView_formatting"/>
<attribute name="inkAnnotations" tokenid="ooxml:CT_TrackChangesView_inkAnnotations"/>
</resource>
- <resource name="CT_Kinsoku" resource="Properties">
+ <resource name="CT_Kinsoku" resource="Properties" tag="character">
<attribute name="lang" tokenid="ooxml:CT_Kinsoku_lang"/>
<attribute name="val" tokenid="ooxml:CT_Kinsoku_val"/>
</resource>
@@ -21762,7 +21767,7 @@
<value tokenid="5">tbRlV</value>
<value tokenid="ooxml:Value_ST_TextDirection_tbLrV">tbLrV</value>
</resource>
- <resource name="CT_TextDirection" resource="Value">
+ <resource name="CT_TextDirection" resource="Value" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_TextDirection_val" action="setValue"/>
</resource>
<resource name="ST_TextAlignment" resource="List" generated="yes">
@@ -21772,7 +21777,7 @@
<value name="bottom" tokenid="ooxml:Value_wordprocessingml_ST_TextAlignment_bottom">bottom</value>
<value name="auto" tokenid="ooxml:Value_wordprocessingml_ST_TextAlignment_auto">auto</value>
</resource>
- <resource name="CT_TextAlignment" resource="Value" generated="yes">
+ <resource name="CT_TextAlignment" resource="Value" generated="yes" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_TextAlignment_val" action="setValue"/>
</resource>
<resource name="ST_DisplacedByCustomXml" resource="List" generated="yes">
@@ -21783,80 +21788,80 @@
<value name="cont" tokenid="ooxml:Value_wordprocessingml_ST_AnnotationVMerge_cont">cont</value>
<value name="rest" tokenid="ooxml:Value_wordprocessingml_ST_AnnotationVMerge_rest">rest</value>
</resource>
- <resource name="CT_Markup" resource="Properties">
+ <resource name="CT_Markup" resource="Properties" tag="redline">
<attribute name="id" tokenid="ooxml:CT_Markup_id"/>
</resource>
- <resource name="CT_TrackChange" resource="Properties">
+ <resource name="CT_TrackChange" resource="Properties" tag="redline">
<attribute name="author" tokenid="ooxml:CT_TrackChange_author"/>
<attribute name="date" tokenid="ooxml:CT_TrackChange_date"/>
</resource>
- <resource name="CT_CellMergeTrackChange" resource="Properties">
+ <resource name="CT_CellMergeTrackChange" resource="Properties" tag="redline">
<attribute name="vMerge" tokenid="ooxml:CT_CellMergeTrackChange_vMerge"/>
<attribute name="vMergeOrig" tokenid="ooxml:CT_CellMergeTrackChange_vMergeOrig"/>
</resource>
- <resource name="CT_TrackChangeRange" resource="Properties">
+ <resource name="CT_TrackChangeRange" resource="Properties" tag="redline">
<attribute name="displacedByCustomXml" tokenid="ooxml:CT_TrackChangeRange_displacedByCustomXml"/>
</resource>
- <resource name="CT_MarkupRange" resource="Properties">
+ <resource name="CT_MarkupRange" resource="Properties" tag="redline">
<attribute name="displacedByCustomXml" tokenid="ooxml:CT_MarkupRange_displacedByCustomXml"/>
</resource>
- <resource name="CT_MarkupRangeBookmark" resource="Properties">
+ <resource name="CT_MarkupRangeBookmark" resource="Properties" tag="redline">
<attribute name="id" tokenid="rtf:IBKL"/>
</resource>
- <resource name="CT_BookmarkRange" resource="Properties">
+ <resource name="CT_BookmarkRange" resource="Properties" tag="reference">
<type name="Bookmark"/>
<attribute name="colFirst" tokenid="ooxml:CT_BookmarkRange_colFirst"/>
<attribute name="colLast" tokenid="ooxml:CT_BookmarkRange_colLast"/>
</resource>
- <resource name="CT_Bookmark" resource="Properties">
+ <resource name="CT_Bookmark" resource="Properties" tag="reference">
<type name="Bookmark"/>
<attribute name="name" tokenid="rtf:BOOKMARKNAME"/>
</resource>
- <resource name="CT_MoveBookmark" resource="Properties">
+ <resource name="CT_MoveBookmark" resource="Properties" tag="reference">
<attribute name="author" tokenid="ooxml:CT_MoveBookmark_author"/>
<attribute name="date" tokenid="ooxml:CT_MoveBookmark_date"/>
</resource>
- <resource name="CT_Comment" resource="XNote">
+ <resource name="CT_Comment" resource="XNote" tag="content">
<attribute name="id" action="checkId"/>
<attribute name="initials" tokenid="ooxml:CT_Comment_initials"/>
</resource>
- <resource name="CT_TrackChangeNumbering" resource="Properties">
+ <resource name="CT_TrackChangeNumbering" resource="Properties" tag="numbering">
<attribute name="original" tokenid="ooxml:CT_TrackChangeNumbering_original"/>
</resource>
- <resource name="CT_TblPrExChange" resource="Properties">
+ <resource name="CT_TblPrExChange" resource="Properties" tag="table">
<element name="tblPrEx" tokenid="ooxml:CT_TblPrExChange_tblPrEx"/>
</resource>
- <resource name="CT_TcPrChange" resource="Properties">
+ <resource name="CT_TcPrChange" resource="Properties" tag="table">
<element name="tcPr" tokenid="ooxml:CT_TcPrChange_tcPr"/>
</resource>
- <resource name="CT_TrPrChange" resource="Properties">
+ <resource name="CT_TrPrChange" resource="Properties" tag="table">
<element name="trPr" tokenid="ooxml:CT_TrPrChange_trPr"/>
</resource>
- <resource name="CT_TblGridChange" resource="Properties">
+ <resource name="CT_TblGridChange" resource="Properties" tag="table">
<element name="tblGrid" tokenid="ooxml:CT_TblGridChange_tblGrid"/>
</resource>
- <resource name="CT_TblPrChange" resource="Properties">
+ <resource name="CT_TblPrChange" resource="Properties" tag="table">
<element name="tblPr" tokenid="ooxml:CT_TblPrChange_tblPr"/>
</resource>
- <resource name="CT_SectPrChange" resource="Properties">
+ <resource name="CT_SectPrChange" resource="Properties" tag="section">
<element name="sectPr" tokenid="ooxml:CT_SectPrChange_sectPr"/>
</resource>
- <resource name="CT_PPrChange" resource="Properties">
+ <resource name="CT_PPrChange" resource="Properties" tag="paragraph">
<element name="pPr" tokenid="ooxml:CT_PPrChange_pPr"/>
</resource>
- <resource name="CT_RPrChange" resource="Properties">
+ <resource name="CT_RPrChange" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_RPrChange_rPr"/>
</resource>
- <resource name="CT_ParaRPrChange" resource="Properties">
+ <resource name="CT_ParaRPrChange" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_ParaRPrChange_rPr"/>
</resource>
- <resource name="CT_RunTrackChange" resource="Stream">
+ <resource name="CT_RunTrackChange" resource="Stream" tag="redlines">
<action name="start" action="tokenproperty"/>
<action name="start" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:trackchange"/>
<action name="start" action="clearProps"/>
<action name="end" action="mark" sendtokenid="ooxml:endtrackchange"/>
</resource>
- <resource name="EG_RangeMarkupElements" resource="Properties">
+ <resource name="EG_RangeMarkupElements" resource="Properties" tag="redlines">
<element name="bookmarkStart" tokenid="ooxml:EG_RangeMarkupElements_bookmarkStart"/>
<element name="bookmarkEnd" tokenid="ooxml:EG_RangeMarkupElements_bookmarkEnd"/>
<element name="moveFromRangeStart" tokenid="ooxml:EG_RangeMarkupElements_moveFromRangeStart"/>
@@ -21874,14 +21879,14 @@
<element name="customXmlMoveToRangeStart" tokenid="ooxml:EG_RangeMarkupElements_customXmlMoveToRangeStart"/>
<element name="customXmlMoveToRangeEnd" tokenid="ooxml:EG_RangeMarkupElements_customXmlMoveToRangeEnd"/>
</resource>
- <resource name="CT_NumPr" resource="Properties">
+ <resource name="CT_NumPr" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="ilvl" tokenid="sprm:PIlvl"/>
<element name="numId" tokenid="sprm:PIlfo"/>
<element name="numberingChange" tokenid="ooxml:CT_NumPr_numberingChange"/>
<element name="ins" tokenid="ooxml:CT_NumPr_ins"/>
</resource>
- <resource name="CT_PBdr" resource="Properties">
+ <resource name="CT_PBdr" resource="Properties" tag="paragraph">
<kind name="paragraph"/>
<element name="top" tokenid="sprm:PBrcTop"/>
<element name="left" tokenid="sprm:PBrcLeft"/>
@@ -21890,7 +21895,7 @@
<element name="between" tokenid="sprm:PBrcBetween"/>
<element name="bar" tokenid="sprm:PBrcBar"/>
</resource>
- <resource name="CT_Tabs" resource="Properties">
+ <resource name="CT_Tabs" resource="Properties" tag="paragraph">
<element name="tab" tokenid="ooxml:CT_Tabs_tab"/>
</resource>
<resource name="ST_TextboxTightWrap" resource="List" generated="yes">
@@ -21900,11 +21905,11 @@
<value name="firstLineOnly" tokenid="ooxml:Value_wordprocessingml_ST_TextboxTightWrap_firstLineOnly">firstLineOnly</value>
<value name="lastLineOnly" tokenid="ooxml:Value_wordprocessingml_ST_TextboxTightWrap_lastLineOnly">lastLineOnly</value>
</resource>
- <resource name="CT_TextboxTightWrap" resource="Value" generated="yes">
+ <resource name="CT_TextboxTightWrap" resource="Value" generated="yes" tag="textbox">
<attribute name="val" tokenid="ooxml:CT_TextboxTightWrap_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_PPrBase" resource="Properties">
+ <resource name="CT_PPrBase" resource="Properties" tag="paragraph">
<kind name="paragraph"/>
<element name="pStyle" tokenid="ooxml:CT_PPrBase_pStyle"/>
<element name="keepNext" tokenid="sprm:PFKeepFollow"/>
@@ -21940,12 +21945,12 @@
<element name="divId" tokenid="ooxml:CT_PPrBase_divId"/>
<element name="cnfStyle" tokenid="ooxml:CT_PPrBase_cnfStyle"/>
</resource>
- <resource name="CT_PPr" resource="Properties">
+ <resource name="CT_PPr" resource="Properties" tag="paragraph">
<element name="rPr" tokenid="ooxml:CT_PPr_rPr"/>
<element name="sectPr" tokenid="ooxml:CT_PPr_sectPr"/>
<element name="pPrChange" tokenid="ooxml:CT_PPr_pPrChange"/>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Control" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Control" resource="Properties" tag="control">
<attribute name="name" tokenid="ooxml:CT_Control_name"/>
<attribute name="shapeid" tokenid="ooxml:CT_Control_shapeid"/>
<attribute name="r:id" tokenid="ooxml:CT_Control_r_id"/>
@@ -21959,24 +21964,24 @@
<resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Rel" resource="Properties">
<attribute name="r:id" tokenid="ooxml:CT_Rel_id"/>
</resource>
- <resource name="CT_PictureBase" resource="Properties"/>
- <resource name="CT_Object" resource="Shape">
+ <resource name="CT_PictureBase" resource="Properties" tag="shape"/>
+ <resource name="CT_Object" resource="Shape" tag="shape">
<element name="control" tokenid="ooxml:CT_Object_control"/>
<attribute name="dxaOrig" tokenid="ooxml:CT_Object_dxaOrig"/>
<attribute name="dyaOrig" tokenid="ooxml:CT_Object_dyaOrig"/>
<action name="end" action="sendPropertiesWithId" sendtokenid="ooxml:object"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Picture" resource="Shape">
+ <resource name="CT_Picture" resource="Shape" tag="shape">
<element name="movie" tokenid="ooxml:CT_Picture_movie"/>
<element name="control" tokenid="ooxml:CT_Picture_control"/>
<action name="end" action="sendPropertiesWithId" sendtokenid="ooxml:object"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Drawing" resource="Properties">
+ <resource name="CT_Drawing" resource="Properties" tag="shape">
<action name="end" action="handlePicture"/>
</resource>
- <resource name="CT_SimpleField" resource="Stream">
+ <resource name="CT_SimpleField" resource="Stream" tag="field">
<element name="fldData" tokenid="ooxml:CT_SimpleField_fldData"/>
<attribute name="instr" tokenid="ooxml:CT_SimpleField_instr"/>
<attribute name="fldLock" tokenid="ooxml:CT_SimpleField_fldLock"/>
@@ -22008,15 +22013,15 @@
<value name="currentDate" tokenid="ooxml:Value_wordprocessingml_ST_FFTextType_currentDate">currentDate</value>
<value name="calculated" tokenid="ooxml:Value_wordprocessingml_ST_FFTextType_calculated">calculated</value>
</resource>
- <resource name="CT_FFTextType" resource="Value" generated="yes">
+ <resource name="CT_FFTextType" resource="Value" generated="yes" tag="field">
<attribute name="val" tokenid="ooxml:CT_FFTextType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_FFName" resource="Value" generated="yes">
+ <resource name="CT_FFName" resource="Value" generated="yes" tag="field">
<attribute name="val" tokenid="ooxml:CT_FFName_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_FldChar" resource="Stream">
+ <resource name="CT_FldChar" resource="Stream" tag="field">
<element name="fldData" tokenid="ooxml:CT_FldChar_fldData"/>
<element name="ffData" tokenid="ooxml:CT_FldChar_ffData"/>
<element name="numberingChange" tokenid="ooxml:CT_FldChar_numberingChange"/>
@@ -22033,7 +22038,7 @@
<cond tokenid="ooxml:CT_FldChar_fldCharType" value="ooxml:Value_ST_FldCharType_end"/>
</action>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Hyperlink" resource="Stream">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Hyperlink" resource="Stream" tag="link">
<attribute name="tgtFrame" tokenid="ooxml:CT_Hyperlink_tgtFrame"/>
<attribute name="tooltip" tokenid="ooxml:CT_Hyperlink_tooltip"/>
<attribute name="docLocation" tokenid="ooxml:CT_Hyperlink_docLocation"/>
@@ -22045,7 +22050,7 @@
<action name="start" action="fieldsep"/>
<action name="end" action="fieldend"/>
</resource>
- <resource name="CT_FFData" resource="Properties">
+ <resource name="CT_FFData" resource="Properties" tag="field">
<element name="name" tokenid="ooxml:CT_FFData_name"/>
<element name="enabled" tokenid="ooxml:CT_FFData_enabled"/>
<element name="calcOnExit" tokenid="ooxml:CT_FFData_calcOnExit"/>
@@ -22059,39 +22064,39 @@
<action name="end" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:ffdata"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_FFHelpText" resource="Properties">
+ <resource name="CT_FFHelpText" resource="Properties" tag="field">
<attribute name="type" tokenid="ooxml:CT_FFHelpText_type"/>
<attribute name="val" tokenid="ooxml:CT_FFHelpText_val"/>
</resource>
- <resource name="CT_FFStatusText" resource="Properties">
+ <resource name="CT_FFStatusText" resource="Properties" tag="field">
<attribute name="type" tokenid="ooxml:CT_FFStatusText_type"/>
<attribute name="val" tokenid="ooxml:CT_FFStatusText_val"/>
</resource>
- <resource name="CT_FFCheckBox" resource="Properties">
+ <resource name="CT_FFCheckBox" resource="Properties" tag="field">
<element name="size" tokenid="ooxml:CT_FFCheckBox_size"/>
<element name="sizeAuto" tokenid="ooxml:CT_FFCheckBox_sizeAuto"/>
<element name="default" tokenid="ooxml:CT_FFCheckBox_default"/>
<element name="checked" tokenid="ooxml:CT_FFCheckBox_checked"/>
</resource>
- <resource name="CT_FFDDList" resource="Properties">
+ <resource name="CT_FFDDList" resource="Properties" tag="field">
<element name="result" tokenid="ooxml:CT_FFDDList_result"/>
<element name="default" tokenid="ooxml:CT_FFDDList_default"/>
<element name="listEntry" tokenid="ooxml:CT_FFDDList_listEntry"/>
</resource>
- <resource name="CT_FFTextInput" resource="Properties">
+ <resource name="CT_FFTextInput" resource="Properties" tag="field">
<element name="type" tokenid="ooxml:CT_FFTextInput_type"/>
<element name="default" tokenid="ooxml:CT_FFTextInput_default"/>
<element name="maxLength" tokenid="ooxml:CT_FFTextInput_maxLength"/>
<element name="format" tokenid="ooxml:CT_FFTextInput_format"/>
</resource>
- <resource name="ST_SectionMark" resource="List">
+ <resource name="ST_SectionMark" resource="List" tag="section">
<value tokenid="0">continuous</value>
<value tokenid="1">nextColumn</value>
<value tokenid="2">nextPage</value>
<value tokenid="3">evenPage</value>
<value tokenid="4">oddPage</value>
</resource>
- <resource name="CT_SectType" resource="Value">
+ <resource name="CT_SectType" resource="Value" tag="section">
<attribute name="val" tokenid="ooxml:CT_SectType_val" action="setValue"/>
</resource>
<resource name="ST_NumberFormat" resource="List">
@@ -22160,13 +22165,13 @@
<value tokenid="0">portrait</value>
<value tokenid="1">landscape</value>
</resource>
- <resource name="CT_PageSz" resource="Properties">
+ <resource name="CT_PageSz" resource="Properties" tag="page">
<attribute name="w" tokenid="ooxml:CT_PageSz_w"/>
<attribute name="h" tokenid="ooxml:CT_PageSz_h"/>
<attribute name="orient" tokenid="ooxml:CT_PageSz_orient"/>
<attribute name="code" tokenid="ooxml:CT_PageSz_code"/>
</resource>
- <resource name="CT_PageMar" resource="Properties">
+ <resource name="CT_PageMar" resource="Properties" tag="page">
<attribute name="top" tokenid="ooxml:CT_PageMar_top"/>
<attribute name="right" tokenid="ooxml:CT_PageMar_right"/>
<attribute name="bottom" tokenid="ooxml:CT_PageMar_bottom"/>
@@ -22188,7 +22193,7 @@
<value name="page" tokenid="ooxml:Value_wordprocessingml_ST_PageBorderOffset_page">page</value>
<value name="text" tokenid="ooxml:Value_wordprocessingml_ST_PageBorderOffset_text">text</value>
</resource>
- <resource name="CT_PageBorders" resource="Properties">
+ <resource name="CT_PageBorders" resource="Properties" tag="page">
<element name="top" tokenid="ooxml:CT_PageBorders_top"/>
<element name="left" tokenid="ooxml:CT_PageBorders_left"/>
<element name="bottom" tokenid="ooxml:CT_PageBorders_bottom"/>
@@ -22209,23 +22214,23 @@
<value tokenid="1">newSection</value>
<value tokenid="2">continuous</value>
</resource>
- <resource name="CT_LineNumber" resource="Properties">
+ <resource name="CT_LineNumber" resource="Properties" tag="section">
<attribute name="countBy" tokenid="ooxml:CT_LineNumber_countBy"/>
<attribute name="start" tokenid="ooxml:CT_LineNumber_start"/>
<attribute name="distance" tokenid="ooxml:CT_LineNumber_distance"/>
<attribute name="restart" tokenid="ooxml:CT_LineNumber_restart"/>
</resource>
- <resource name="CT_PageNumber" resource="Properties">
+ <resource name="CT_PageNumber" resource="Properties" tag="page">
<attribute name="fmt" tokenid="ooxml:CT_PageNumber_fmt"/>
<attribute name="start" tokenid="ooxml:CT_PageNumber_start"/>
<attribute name="chapStyle" tokenid="ooxml:CT_PageNumber_chapStyle"/>
<attribute name="chapSep" tokenid="ooxml:CT_PageNumber_chapSep"/>
</resource>
- <resource name="CT_Column" resource="Properties">
+ <resource name="CT_Column" resource="Properties" tag="page">
<attribute name="space" tokenid="ooxml:CT_Column_space"/>
<attribute name="w" tokenid="ooxml:CT_Column_w"/>
</resource>
- <resource name="CT_Columns" resource="Properties">
+ <resource name="CT_Columns" resource="Properties" tag="page">
<attribute name="equalWidth" tokenid="ooxml:CT_Columns_equalWidth"/>
<attribute name="space" tokenid="ooxml:CT_Columns_space"/>
<attribute name="num" tokenid="ooxml:CT_Columns_num"/>
@@ -22238,7 +22243,7 @@
<value tokenid="2">both</value>
<value tokenid="3">bottom</value>
</resource>
- <resource name="CT_VerticalJc" resource="Value">
+ <resource name="CT_VerticalJc" resource="Value" tag="page">
<attribute name="val" tokenid="ooxml:CT_VerticalJc_val" action="setValue"/>
</resource>
<resource name="ST_DocGrid" resource="List" generated="yes">
@@ -22247,7 +22252,7 @@
<value name="linesAndChars" tokenid="ooxml:Value_wordprocessingml_ST_DocGrid_linesAndChars">linesAndChars</value>
<value name="snapToChars" tokenid="ooxml:Value_wordprocessingml_ST_DocGrid_snapToChars">snapToChars</value>
</resource>
- <resource name="CT_DocGrid" resource="Properties">
+ <resource name="CT_DocGrid" resource="Properties" tag="document">
<attribute name="type" tokenid="ooxml:CT_DocGrid_type"/>
<attribute name="linePitch" tokenid="ooxml:CT_DocGrid_linePitch"/>
<attribute name="charSpace" tokenid="ooxml:CT_DocGrid_charSpace"/>
@@ -22263,17 +22268,17 @@
<value name="continuationSeparator" tokenid="ooxml:Value_wordprocessingml_ST_FtnEdn_continuationSeparator">continuationSeparator</value>
<value name="continuationNotice" tokenid="ooxml:Value_wordprocessingml_ST_FtnEdn_continuationNotice">continuationNotice</value>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_HdrFtrRef" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_HdrFtrRef" resource="Properties" tag="header">
<attribute name="type" tokenid="ooxml:CT_HdrFtrRef_type"/>
<attribute name="r:id" tokenid="ooxml:CT_HdrFtrRef_id"/>
<action name="end" action="handleHdrFtr"/>
</resource>
- <resource name="EG_HdrFtrReferences" resource="Properties">
+ <resource name="EG_HdrFtrReferences" resource="Properties" tag="header">
<element name="headerReference" tokenid="ooxml:EG_HdrFtrReferences_headerReference"/>
<element name="footerReference" tokenid="ooxml:EG_HdrFtrReferences_footerReference"/>
</resource>
- <resource name="CT_HdrFtr" resource="Stream"/>
- <resource name="EG_SectPrContents" resource="Properties">
+ <resource name="CT_HdrFtr" resource="Stream" tag="header"/>
+ <resource name="EG_SectPrContents" resource="Properties" tag="section">
<element name="bidi" tokenid="ooxml:EG_SectPrContents_bidi"/>
<element name="cols" tokenid="ooxml:EG_SectPrContents_cols"/>
<element name="docGrid" tokenid="ooxml:EG_SectPrContents_docGrid"/>
@@ -22294,8 +22299,8 @@
<element name="type" tokenid="sprm:SBkc"/>
<element name="vAlign" tokenid="ooxml:EG_SectPrContents_vAlign"/>
</resource>
- <resource name="CT_SectPrBase" resource="Properties"/>
- <resource name="CT_SectPr" resource="Properties">
+ <resource name="CT_SectPrBase" resource="Properties" tag="section"/>
+ <resource name="CT_SectPr" resource="Properties" tag="section">
<element name="sectPrChange" tokenid="ooxml:CT_SectPr_sectPrChange"/>
<action name="start" action="setLastParagraphInSection"/>
</resource>
@@ -22310,7 +22315,7 @@
<value tokenid="ooxml:Value_ST_BrClear_right">right</value>
<value tokenid="ooxml:Value_ST_BrClear_all">all</value>
</resource>
- <resource name="CT_Br" resource="Properties">
+ <resource name="CT_Br" resource="Properties" tag="content">
<attribute name="type" tokenid="ooxml:CT_Br_type"/>
<attribute name="clear" tokenid="ooxml:CT_Br_clear"/>
<action name="end" action="handleBreak"/>
@@ -22331,13 +22336,13 @@
<value tokenid="ooxml:Value_ST_PTabLeader_underscore">underscore</value>
<value tokenid="ooxml:Value_ST_PTabLeader_middleDot">middleDot</value>
</resource>
- <resource name="CT_PTab" resource="Stream">
+ <resource name="CT_PTab" resource="Stream" tag="paragraph">
<attribute name="alignment" tokenid="ooxml:CT_PTab_alignment"/>
<attribute name="relativeTo" tokenid="ooxml:CT_PTab_relativeTo"/>
<attribute name="leader" tokenid="ooxml:CT_PTab_leader"/>
<action name="end" action="tab"/>
</resource>
- <resource name="CT_Sym" resource="Properties">
+ <resource name="CT_Sym" resource="Properties" tag="character">
<attribute name="font" tokenid="ooxml:CT_Sym_font"/>
<attribute name="char" tokenid="ooxml:CT_Sym_char"/>
</resource>
@@ -22356,29 +22361,29 @@
<value name="owners" tokenid="ooxml:Value_wordprocessingml_ST_EdGrp_owners">owners</value>
<value name="current" tokenid="ooxml:Value_wordprocessingml_ST_EdGrp_current">current</value>
</resource>
- <resource name="CT_Text" resource="Stream">
+ <resource name="CT_Text" resource="Stream" tag="content">
<attribute name="xml:space" tokenid="ooxml:CT_Text_space"/>
<action name="characters" action="text"/>
</resource>
- <resource name="CT_FtnEdnRefChar" resource="Stream">
+ <resource name="CT_FtnEdnRefChar" resource="Stream" tag="reference">
<action name="end" action="ftnednref"/>
</resource>
- <resource name="CT_FtnEdnSep" resource="Stream">
+ <resource name="CT_FtnEdnSep" resource="Stream" tag="reference">
<action name="end" action="ftnednsep"/>
</resource>
- <resource name="CT_FtnEdnCont" resource="Stream">
+ <resource name="CT_FtnEdnCont" resource="Stream" tag="reference">
<action name="end" action="ftnedncont"/>
</resource>
- <resource name="CT_PgNum" resource="Stream">
+ <resource name="CT_PgNum" resource="Stream" tag="reference">
<action name="end" action="pgNum"/>
</resource>
- <resource name="CT_Cr" resource="Stream">
+ <resource name="CT_Cr" resource="Stream" tag="content">
<action name="end" action="endOfParagraph"/>
</resource>
- <resource name="CT_Tab" resource="Stream">
+ <resource name="CT_Tab" resource="Stream" tag="content">
<action name="end" action="tab"/>
</resource>
- <resource name="EG_RunInnerContent" resource="Stream">
+ <resource name="EG_RunInnerContent" resource="Stream" tag="content">
<element name="br" tokenid="ooxml:EG_RunInnerContent_br"/>
<element name="t" tokenid="ooxml:EG_RunInnerContent_t"/>
<element name="delText" tokenid="ooxml:EG_RunInnerContent_delText"/>
@@ -22412,7 +22417,7 @@
<element name="ptab" tokenid="ooxml:EG_RunInnerContent_ptab"/>
<element name="lastRenderedPageBreak" tokenid="ooxml:EG_RunInnerContent_lastRenderedPageBreak"/>
</resource>
- <resource name="CT_R" resource="Stream">
+ <resource name="CT_R" resource="Stream" tag="content">
<action name="start" action="startCharacterGroup"/>
</resource>
<resource name="ST_Hint" resource="List">
@@ -22430,7 +22435,7 @@
<value tokenid="ooxml:Value_ST_Theme_minorAscii">minorAscii</value>
<value tokenid="ooxml:Value_ST_Theme_minorHAnsi">minorHAnsi</value>
</resource>
- <resource name="CT_Fonts" resource="Properties">
+ <resource name="CT_Fonts" resource="Properties" tag="font">
<attribute name="hint" tokenid="ooxml:CT_Fonts_hint"/>
<attribute name="ascii" tokenid="ooxml:CT_Fonts_ascii"/>
<attribute name="hAnsi" tokenid="ooxml:CT_Fonts_hAnsi"/>
@@ -22441,7 +22446,7 @@
<attribute name="eastAsiaTheme" tokenid="ooxml:CT_Fonts_eastAsiaTheme"/>
<attribute name="cstheme" tokenid="ooxml:CT_Fonts_cstheme"/>
</resource>
- <resource name="EG_RPrBase" resource="Properties">
+ <resource name="EG_RPrBase" resource="Properties" tag="paragraph">
<kind name="paragraph"/>
<element name="rStyle" tokenid="ooxml:EG_RPrBase_rStyle"/>
<element name="rFonts" tokenid="ooxml:EG_RPrBase_rFonts"/>
@@ -22483,19 +22488,19 @@
<element name="specVanish" tokenid="0x818"/>
<element name="oMath" tokenid="ooxml:EG_RPrBase_oMath"/>
</resource>
- <resource name="EG_RPrContent" resource="Properties">
+ <resource name="EG_RPrContent" resource="Properties" tag="character">
<element name="rPrChange" tokenid="ooxml:EG_RPrContent_rPrChange"/>
</resource>
- <resource name="CT_RPr" resource="Properties">
+ <resource name="CT_RPr" resource="Properties" tag="character">
</resource>
- <resource name="CT_RPrOriginal" resource="Properties"/>
- <resource name="CT_ParaRPrOriginal" resource="Properties"/>
- <resource name="CT_ParaRPr" resource="Properties">
+ <resource name="CT_RPrOriginal" resource="Properties" tag="character"/>
+ <resource name="CT_ParaRPrOriginal" resource="Properties" tag="paragraph"/>
+ <resource name="CT_ParaRPr" resource="Properties" tag="redline">
<element name="ins" tokenid="ooxml:CT_ParaRPr_ins"/>
<element name="del" tokenid="ooxml:CT_ParaRPr_del"/>
<element name="rPrChange" tokenid="ooxml:CT_ParaRPr_rPrChange"/>
</resource>
- <resource name="CT_ParaTrackChange" resource="Properties">
+ <resource name="CT_ParaTrackChange" resource="Properties" tag="redline">
<action name="start" action="tokenproperty"/>
<action name="start" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:paratrackchange"/>
<action name="start" action="clearProps"/>
@@ -22508,7 +22513,7 @@
<value name="right" tokenid="ooxml:Value_wordprocessingml_ST_RubyAlign_right">right</value>
<value name="rightVertical" tokenid="ooxml:Value_wordprocessingml_ST_RubyAlign_rightVertical">rightVertical</value>
</resource>
- <resource name="CT_RubyAlign" resource="Value" generated="yes">
+ <resource name="CT_RubyAlign" resource="Value" generated="yes" tag="character">
<attribute name="val" tokenid="ooxml:CT_RubyAlign_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -22518,7 +22523,7 @@
<value name="unlocked" tokenid="ooxml:Value_wordprocessingml_ST_Lock_unlocked">unlocked</value>
<value name="sdtContentLocked" tokenid="ooxml:Value_wordprocessingml_ST_Lock_sdtContentLocked">sdtContentLocked</value>
</resource>
- <resource name="CT_Lock" resource="Value" generated="yes">
+ <resource name="CT_Lock" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_Lock_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -22527,7 +22532,7 @@
<value name="date" tokenid="ooxml:Value_wordprocessingml_ST_SdtDateMappingType_date">date</value>
<value name="dateTime" tokenid="ooxml:Value_wordprocessingml_ST_SdtDateMappingType_dateTime">dateTime</value>
</resource>
- <resource name="CT_SdtDateMappingType" resource="Value" generated="yes">
+ <resource name="CT_SdtDateMappingType" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_SdtDateMappingType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -22543,32 +22548,32 @@
<value name="gregorianXlitEnglish" tokenid="ooxml:Value_wordprocessingml_ST_CalendarType_gregorianXlitEnglish">gregorianXlitEnglish</value>
<value name="gregorianXlitFrench" tokenid="ooxml:Value_wordprocessingml_ST_CalendarType_gregorianXlitFrench">gregorianXlitFrench</value>
</resource>
- <resource name="CT_CalendarType" resource="Value" generated="yes">
+ <resource name="CT_CalendarType" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_CalendarType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_SdtContentRun" resource="Properties"/>
- <resource name="CT_Attr" resource="Properties">
+ <resource name="CT_SdtContentRun" resource="Properties" tag="content"/>
+ <resource name="CT_Attr" resource="Properties" tag="content">
<attribute name="uri" tokenid="ooxml:CT_Attr_uri"/>
<attribute name="name" tokenid="ooxml:CT_Attr_name"/>
<attribute name="val" tokenid="ooxml:CT_Attr_val"/>
</resource>
- <resource name="CT_CustomXmlRun" resource="Properties">
+ <resource name="CT_CustomXmlRun" resource="Properties" tag="content">
<element name="customXmlPr" tokenid="ooxml:CT_CustomXmlRun_customXmlPr"/>
<attribute name="uri" tokenid="ooxml:CT_CustomXmlRun_uri"/>
<attribute name="element" tokenid="ooxml:CT_CustomXmlRun_element"/>
</resource>
- <resource name="CT_SmartTagRun" resource="Properties">
+ <resource name="CT_SmartTagRun" resource="Properties" tag="content">
<element name="smartTagPr" tokenid="ooxml:CT_SmartTagRun_smartTagPr"/>
<attribute name="uri" tokenid="ooxml:CT_SmartTagRun_uri"/>
<attribute name="element" tokenid="ooxml:CT_SmartTagRun_element"/>
</resource>
- <resource name="EG_PContent" resource="Properties">
+ <resource name="EG_PContent" resource="Properties" tag="content">
<element name="fldSimple" tokenid="ooxml:EG_PContent_fldSimple"/>
<element name="hyperlink" tokenid="ooxml:EG_PContent_hyperlink"/>
<element name="subDoc" tokenid="ooxml:EG_PContent_subDoc"/>
</resource>
- <resource name="CT_P" resource="Stream">
+ <resource name="CT_P" resource="Stream" tag="content">
<action name="start" action="handleLastParagraphInSection"/>
<action name="start" action="startParagraphGroup"/>
<action name="start" action="setHandle"/>
@@ -22581,27 +22586,27 @@
<value tokenid="ooxml:Value_ST_TblWidth_dxa">dxa</value>
<value tokenid="ooxml:Value_ST_TblWidth_auto">auto</value>
</resource>
- <resource name="CT_Height" resource="Properties">
+ <resource name="CT_Height" resource="Properties" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Height_val"/>
<attribute name="hRule" tokenid="ooxml:CT_Height_hRule"/>
</resource>
- <resource name="CT_TblWidth" resource="Properties">
+ <resource name="CT_TblWidth" resource="Properties" tag="table">
<attribute name="w" tokenid="ooxml:CT_TblWidth_w"/>
<attribute name="type" tokenid="ooxml:CT_TblWidth_type"/>
</resource>
- <resource name="CT_TblGridCol" resource="Value">
+ <resource name="CT_TblGridCol" resource="Value" tag="table">
<attribute name="w" tokenid="ooxml:CT_TblGridCol_w" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
- <resource name="CT_TblGridBase" resource="Properties">
+ <resource name="CT_TblGridBase" resource="Properties" tag="table">
<element name="gridCol" tokenid="ooxml:CT_TblGridBase_gridCol"/>
</resource>
- <resource name="CT_TblGrid" resource="Properties">
+ <resource name="CT_TblGrid" resource="Properties" tag="table">
<element name="tblGridChange" tokenid="ooxml:CT_TblGrid_tblGridChange"/>
<action name="end" action="propagateTableProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_TcBorders" resource="Properties">
+ <resource name="CT_TcBorders" resource="Properties" tag="table">
<kind name="table"/>
<element name="top" tokenid="ooxml:CT_TcBorders_top"/>
<element name="left" tokenid="ooxml:CT_TcBorders_left"/>
@@ -22612,7 +22617,7 @@
<element name="tl2br" tokenid="ooxml:CT_TcBorders_tl2br"/>
<element name="tr2bl" tokenid="ooxml:CT_TcBorders_tr2bl"/>
</resource>
- <resource name="CT_TcMar" resource="Properties">
+ <resource name="CT_TcMar" resource="Properties" tag="table">
<kind name="table"/>
<element name="top" tokenid="ooxml:CT_TcMar_top"/>
<element name="left" tokenid="ooxml:CT_TcMar_left"/>
@@ -22624,13 +22629,13 @@
<value tokenid="ooxml:Value_ST_Merge_restart">restart</value>
<default tokenid="ooxml:Value_ST_Merge_continue"/>
</resource>
- <resource name="CT_VMerge" resource="Value">
+ <resource name="CT_VMerge" resource="Value" tag="table">
<attribute name="val" tokenid="ooxml:CT_VMerge_val" action="setValue"/>
</resource>
- <resource name="CT_HMerge" resource="Value">
+ <resource name="CT_HMerge" resource="Value" tag="table">
<attribute name="val" tokenid="ooxml:CT_HMerge_val" action="setValue"/>
</resource>
- <resource name="CT_TcPrBase" resource="Properties">
+ <resource name="CT_TcPrBase" resource="Properties" tag="table">
<kind name="table"/>
<element name="cnfStyle" tokenid="ooxml:CT_TcPrBase_cnfStyle"/>
<element name="tcW" tokenid="ooxml:CT_TcPrBase_tcW"/>
@@ -22646,12 +22651,12 @@
<element name="vAlign" tokenid="ooxml:CT_TcPrBase_vAlign"/>
<element name="hideMark" tokenid="ooxml:CT_TcPrBase_hideMark"/>
</resource>
- <resource name="CT_TcPr" resource="Properties">
+ <resource name="CT_TcPr" resource="Properties" tag="table">
<element name="tcPrChange" tokenid="ooxml:CT_TcPr_tcPrChange"/>
<action name="end" action="propagateCellProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_TcPrInner" resource="Properties"/>
+ <resource name="CT_TcPrInner" resource="Properties" tag="table"/>
<resource name="CT_Tc" resource="TextTableCell">
<action name="start" action="startCell"/>
<action name="end" action="endCell"/>
@@ -22659,11 +22664,11 @@
<action name="end" action="endParagraphGroup"/>
</resource>
<resource name="ST_Cnf" resource="String" generated="yes"/>
- <resource name="CT_Cnf" resource="Value" generated="yes">
+ <resource name="CT_Cnf" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_Cnf_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_TrPrBase" resource="Properties">
+ <resource name="CT_TrPrBase" resource="Properties" tag="table">
<kind name="table"/>
<element name="cnfStyle" tokenid="ooxml:CT_TrPrBase_cnfStyle"/>
<element name="divId" tokenid="ooxml:CT_TrPrBase_divId"/>
@@ -22678,7 +22683,7 @@
<element name="jc" tokenid="ooxml:CT_TrPrBase_jc"/>
<element name="hidden" tokenid="ooxml:CT_TrPrBase_hidden"/>
</resource>
- <resource name="CT_TrPr" resource="Properties">
+ <resource name="CT_TrPr" resource="Properties" tag="table">
<kind name="table"/>
<element name="ins" tokenid="ooxml:CT_TrPr_ins"/>
<element name="del" tokenid="ooxml:CT_TrPr_del"/>
@@ -22686,7 +22691,7 @@
<action name="end" action="propagateRowProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Row" resource="TextTableRow">
+ <resource name="CT_Row" resource="TextTableRow" tag="table">
<action name="start" action="startRow"/>
<action name="end" action="sendRowProperties"/>
<action name="end" action="sendTableProperties"/>
@@ -22700,16 +22705,16 @@
<value tokenid="ooxml:Value_ST_TblOverlap_never">never</value>
<value tokenid="ooxml:Value_ST_TblOverlap_overlap">overlap</value>
</resource>
- <resource name="CT_TblOverlap" resource="Value">
+ <resource name="CT_TblOverlap" resource="Value" tag="table">
<attribute name="val" tokenid="ooxml:CT_TblOverlap_val" action="setValue"/>
</resource>
- <resource name="CT_TblCellMar" resource="Properties">
+ <resource name="CT_TblCellMar" resource="Properties" tag="table">
<element name="top" tokenid="ooxml:CT_TblCellMar_top"/>
<element name="left" tokenid="ooxml:CT_TblCellMar_left"/>
<element name="bottom" tokenid="ooxml:CT_TblCellMar_bottom"/>
<element name="right" tokenid="ooxml:CT_TblCellMar_right"/>
</resource>
- <resource name="CT_TblBorders" resource="Properties">
+ <resource name="CT_TblBorders" resource="Properties" tag="table">
<kind name="table"/>
<element name="top" tokenid="ooxml:CT_TblBorders_top"/>
<element name="left" tokenid="ooxml:CT_TblBorders_left"/>
@@ -22718,7 +22723,7 @@
<element name="insideH" tokenid="ooxml:CT_TblBorders_insideH"/>
<element name="insideV" tokenid="ooxml:CT_TblBorders_insideV"/>
</resource>
- <resource name="CT_TblPrBase" resource="Properties">
+ <resource name="CT_TblPrBase" resource="Properties" tag="table">
<kind name="table"/>
<element name="tblStyle" tokenid="ooxml:CT_TblPrBase_tblStyle"/>
<element name="tblpPr" tokenid="ooxml:CT_TblPrBase_tblpPr"/>
@@ -22736,30 +22741,30 @@
<element name="tblCellMar" tokenid="ooxml:CT_TblPrBase_tblCellMar"/>
<element name="tblLook" tokenid="ooxml:CT_TblPrBase_tblLook"/>
</resource>
- <resource name="CT_TblPr" resource="Properties">
+ <resource name="CT_TblPr" resource="Properties" tag="table">
<kind name="table"/>
<element name="tblPrChange" tokenid="ooxml:CT_TblPr_tblPrChange"/>
<action name="end" action="propagateTableProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Tbl" resource="TextTable"/>
+ <resource name="CT_Tbl" resource="TextTable" tag="table"/>
<resource name="ST_FtnPos" resource="List">
<value tokenid="ooxml:Value_ST_FtnPos_pageBottom">pageBottom</value>
<value tokenid="ooxml:Value_ST_FtnPos_beneathText">beneathText</value>
<value tokenid="ooxml:Value_ST_FtnPos_sectEnd">sectEnd</value>
<value tokenid="ooxml:Value_ST_FtnPos_docEnd">docEnd</value>
</resource>
- <resource name="CT_FtnPos" resource="Value">
+ <resource name="CT_FtnPos" resource="Value" tag="reference">
<attribute name="val" tokenid="ooxml:CT_FtnPos_val" action="setValue"/>
</resource>
<resource name="ST_EdnPos" resource="List">
<value tokenid="ooxml:Value_ST_EdnPos_sectEnd">sectEnd</value>
<value tokenid="ooxml:Value_ST_EdnPos_docEnd">docEnd</value>
</resource>
- <resource name="CT_EdnPos" resource="Value">
+ <resource name="CT_EdnPos" resource="Value" tag="reference">
<attribute name="val" tokenid="ooxml:CT_EdnPos_val" action="setValue"/>
</resource>
- <resource name="CT_NumFmt" resource="Value">
+ <resource name="CT_NumFmt" resource="Value" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_NumFmt_val" action="setValue"/>
</resource>
<resource name="ST_RestartNumber" resource="List">
@@ -22767,42 +22772,42 @@
<value tokenid="ooxml:Value_ST_RestartNumber_eachSect">eachSect</value>
<value tokenid="ooxml:Value_ST_RestartNumber_eachPage">eachPage</value>
</resource>
- <resource name="CT_NumRestart" resource="Value">
+ <resource name="CT_NumRestart" resource="Value" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_NumRestart_val" action="setValue"/>
</resource>
- <resource name="CT_FtnEdnRef" resource="Properties">
+ <resource name="CT_FtnEdnRef" resource="Properties" tag="reference">
<attribute name="customMarkFollows" tokenid="ooxml:CT_FtnEdnRef_customMarkFollows"/>
<attribute name="id" tokenid="ooxml:CT_FtnEdnRef_id" action="setXNoteId"/>
<action name="end" action="handleXNotes"/>
</resource>
- <resource name="CT_FtnEdnSepRef" resource="Properties">
+ <resource name="CT_FtnEdnSepRef" resource="Properties" tag="reference">
<attribute name="id" tokenid="ooxml:CT_FtnEdnSepRef_id"/>
</resource>
- <resource name="CT_FtnEdn" resource="XNote">
+ <resource name="CT_FtnEdn" resource="XNote" tag="reference">
<attribute name="type" tokenid="ooxml:CT_FtnEdn_type"/>
<attribute name="id" tokenid="ooxml:CT_FtnEdn_id" action="checkId"/>
<action name="start" action="propagateCharacterProperties"/>
<action name="end" action="endSectionGroup"/>
</resource>
- <resource name="CT_CommentRef" resource="Properties">
+ <resource name="CT_CommentRef" resource="Properties" tag="reference">
<action name="end" action="handleComment"/>
</resource>
- <resource name="EG_FtnEdnNumProps" resource="Properties">
+ <resource name="EG_FtnEdnNumProps" resource="Properties" tag="reference">
<element name="numStart" tokenid="ooxml:EG_FtnEdnNumProps_numStart"/>
<element name="numRestart" tokenid="ooxml:EG_FtnEdnNumProps_numRestart"/>
</resource>
- <resource name="CT_FtnProps" resource="Properties">
+ <resource name="CT_FtnProps" resource="Properties" tag="reference">
<element name="pos" tokenid="ooxml:CT_FtnProps_pos"/>
<element name="numFmt" tokenid="ooxml:CT_FtnProps_numFmt"/>
</resource>
- <resource name="CT_EdnProps" resource="Properties">
+ <resource name="CT_EdnProps" resource="Properties" tag="reference">
<element name="pos" tokenid="ooxml:CT_EdnProps_pos"/>
<element name="numFmt" tokenid="ooxml:CT_EdnProps_numFmt"/>
</resource>
- <resource name="CT_FtnDocProps" resource="Properties">
+ <resource name="CT_FtnDocProps" resource="Properties" tag="reference">
<element name="footnote" tokenid="ooxml:CT_FtnDocProps_footnote"/>
</resource>
- <resource name="CT_EdnDocProps" resource="Properties">
+ <resource name="CT_EdnDocProps" resource="Properties" tag="reference">
<element name="endnote" tokenid="ooxml:CT_EdnDocProps_endnote"/>
</resource>
<resource name="ST_MailMergeSourceType" resource="List" generated="yes">
@@ -22816,11 +22821,11 @@
<value name="legacy" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeSourceType_legacy">legacy</value>
<value name="master" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeSourceType_master">master</value>
</resource>
- <resource name="CT_MailMergeSourceType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeSourceType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeSourceType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_MailMerge" resource="Properties">
+ <resource name="CT_MailMerge" resource="Properties" tag="mailmerge">
<element name="mainDocumentType" tokenid="ooxml:CT_MailMerge_mainDocumentType"/>
<element name="linkToQuery" tokenid="ooxml:CT_MailMerge_linkToQuery"/>
<element name="dataType" tokenid="ooxml:CT_MailMerge_dataType"/>
@@ -22851,11 +22856,11 @@
<value name="1800x1440" tokenid="ooxml:Value_wordprocessingml_ST_TargetScreenSz_1800x1440">1800x1440</value>
<value name="1920x1200" tokenid="ooxml:Value_wordprocessingml_ST_TargetScreenSz_1920x1200">1920x1200</value>
</resource>
- <resource name="CT_TargetScreenSz" resource="Value" generated="yes">
+ <resource name="CT_TargetScreenSz" resource="Value" generated="yes" tag="settings">
<attribute name="val" tokenid="ooxml:CT_TargetScreenSz_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_Compat" resource="Properties">
+ <resource name="CT_Compat" resource="Properties" tag="settings">
<element name="useSingleBorderforContiguousCells" tokenid="ooxml:CT_Compat_useSingleBorderforContiguousCells"/>
<element name="wpJustification" tokenid="ooxml:CT_Compat_wpJustification"/>
<element name="noTabHangInd" tokenid="ooxml:CT_Compat_noTabHangInd"/>
@@ -22922,11 +22927,11 @@
<element name="useAnsiKerningPairs" tokenid="ooxml:CT_Compat_useAnsiKerningPairs"/>
<element name="cachedColBalance" tokenid="ooxml:CT_Compat_cachedColBalance"/>
</resource>
- <resource name="CT_DocVar" resource="Properties">
+ <resource name="CT_DocVar" resource="Properties" tag="document">
<attribute name="name" tokenid="ooxml:CT_DocVar_name"/>
<attribute name="val" tokenid="ooxml:CT_DocVar_val"/>
</resource>
- <resource name="CT_DocRsids" resource="Properties">
+ <resource name="CT_DocRsids" resource="Properties" tag="redline">
<element name="rsidRoot" tokenid="ooxml:CT_DocRsids_rsidRoot"/>
<element name="rsid" tokenid="ooxml:CT_DocRsids_rsid"/>
</resource>
@@ -22935,21 +22940,21 @@
<value name="compressPunctuation" tokenid="ooxml:Value_wordprocessingml_ST_CharacterSpacing_compressPunctuation">compressPunctuation</value>
<value name="compressPunctuationAndJapaneseKana" tokenid="ooxml:Value_wordprocessingml_ST_CharacterSpacing_compressPunctuationAndJapaneseKana">compressPunctuationAndJapaneseKana</value>
</resource>
- <resource name="CT_CharacterSpacing" resource="Value" generated="yes">
+ <resource name="CT_CharacterSpacing" resource="Value" generated="yes" tag="character">
<attribute name="val" tokenid="ooxml:CT_CharacterSpacing_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_SaveThroughXslt" resource="Properties">
+ <resource name="CT_SaveThroughXslt" resource="Properties" tag="settings">
<attribute name="r:id" tokenid="ooxml:CT_SaveThroughXslt_r_id"/>
<attribute name="solutionID" tokenid="ooxml:CT_SaveThroughXslt_solutionID"/>
</resource>
- <resource name="CT_RPrDefault" resource="Properties">
+ <resource name="CT_RPrDefault" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_RPrDefault_rPr"/>
</resource>
- <resource name="CT_PPrDefault" resource="Properties">
+ <resource name="CT_PPrDefault" resource="Properties" tag="paragraph">
<element name="pPr" tokenid="ooxml:CT_PPrDefault_pPr"/>
</resource>
- <resource name="CT_DocDefaults" resource="Properties">
+ <resource name="CT_DocDefaults" resource="Properties" tag="document">
<element name="pPrDefault" tokenid="ooxml:CT_DocDefaults_pPrDefault"/>
<element name="rPrDefault" tokenid="ooxml:CT_DocDefaults_rPrDefault"/>
</resource>
@@ -22973,10 +22978,10 @@
<attribute name="h" tokenid="ooxml:CT_ReadingModeInkLockDown_h"/>
<attribute name="fontSz" tokenid="ooxml:CT_ReadingModeInkLockDown_fontSz"/>
</resource>
- <resource name="CT_WriteProtection" resource="Properties">
+ <resource name="CT_WriteProtection" resource="Properties" tag="document">
<attribute name="recommended" tokenid="ooxml:CT_WriteProtection_recommended"/>
</resource>
- <resource name="CT_Settings" resource="PropertyTable" tokenid="ooxml:SETTINGS">
+ <resource name="CT_Settings" resource="PropertyTable" tokenid="ooxml:SETTINGS" tag="settings">
<element name="writeProtection" tokenid="ooxml:CT_Settings_writeProtection"/>
<element name="view" tokenid="ooxml:CT_Settings_view"/>
<element name="zoom" tokenid="ooxml:CT_Settings_zoom"/>
@@ -23080,7 +23085,7 @@
<value name="off" tokenid="ooxml:Value_wordprocessingml_ST_FrameScrollbar_off">off</value>
<value name="auto" tokenid="ooxml:Value_wordprocessingml_ST_FrameScrollbar_auto">auto</value>
</resource>
- <resource name="CT_FrameScrollbar" resource="Value" generated="yes">
+ <resource name="CT_FrameScrollbar" resource="Value" generated="yes" tag="frame">
<attribute name="val" tokenid="ooxml:CT_FrameScrollbar_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23089,7 +23094,7 @@
<value name="cols" tokenid="ooxml:Value_wordprocessingml_ST_FrameLayout_cols">cols</value>
<value name="none" tokenid="ooxml:Value_wordprocessingml_ST_FrameLayout_none">none</value>
</resource>
- <resource name="CT_FrameLayout" resource="Value" generated="yes">
+ <resource name="CT_FrameLayout" resource="Value" generated="yes" tag="frame">
<attribute name="val" tokenid="ooxml:CT_FrameLayout_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23098,20 +23103,20 @@
<value name="space" tokenid="ooxml:Value_wordprocessingml_ST_LevelSuffix_space">space</value>
<value name="nothing" tokenid="ooxml:Value_wordprocessingml_ST_LevelSuffix_nothing">nothing</value>
</resource>
- <resource name="CT_LevelSuffix" resource="Value" generated="yes">
+ <resource name="CT_LevelSuffix" resource="Value" generated="yes" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_LevelSuffix_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_LevelText" resource="Properties">
+ <resource name="CT_LevelText" resource="Properties" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_LevelText_val"/>
<attribute name="null" tokenid="ooxml:CT_LevelText_null"/>
</resource>
- <resource name="CT_LvlLegacy" resource="Properties">
+ <resource name="CT_LvlLegacy" resource="Properties" tag="numbering">
<attribute name="legacy" tokenid="ooxml:CT_LvlLegacy_legacy"/>
<attribute name="legacySpace" tokenid="ooxml:CT_LvlLegacy_legacySpace"/>
<attribute name="legacyIndent" tokenid="ooxml:CT_LvlLegacy_legacyIndent"/>
</resource>
- <resource name="CT_Lvl" resource="Properties">
+ <resource name="CT_Lvl" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="start" tokenid="rtf:ISTARTAT"/>
<element name="numFmt" tokenid="rtf:NFC"/>
@@ -23129,15 +23134,15 @@
<attribute name="tplc" tokenid="ooxml:CT_Lvl_tplc"/>
<attribute name="tentative" tokenid="ooxml:CT_Lvl_tentative"/>
</resource>
- <resource name="ST_MultiLevelType" resource="List">
+ <resource name="ST_MultiLevelType" resource="List" tag="numbering">
<value tokenid="ooxml:Value_ST_MultiLevelType_singleLevel">singleLevel</value>
<value tokenid="ooxml:Value_ST_MultiLevelType_multilevel">multilevel</value>
<value tokenid="ooxml:Value_ST_MultiLevelType_hybridMultilevel">hybridMultilevel</value>
</resource>
- <resource name="CT_MultiLevelType" resource="Value">
+ <resource name="CT_MultiLevelType" resource="Value" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_MultiLevelType_val" action="setValue"/>
</resource>
- <resource name="CT_AbstractNum" resource="Properties">
+ <resource name="CT_AbstractNum" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="nsid" tokenid="rtf:LSID"/>
<element name="multiLevelType" tokenid="ooxml:CT_AbstractNum_multiLevelType"/>
@@ -23148,19 +23153,19 @@
<element name="lvl" tokenid="ooxml:CT_AbstractNum_lvl"/>
<attribute name="abstractNumId" tokenid="ooxml:CT_AbstractNum_abstractNumId"/>
</resource>
- <resource name="CT_NumLvl" resource="Properties">
+ <resource name="CT_NumLvl" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="startOverride" tokenid="ooxml:CT_NumLvl_startOverride"/>
<element name="lvl" tokenid="ooxml:CT_NumLvl_lvl"/>
<attribute name="ilvl" tokenid="ooxml:CT_NumLvl_ilvl"/>
</resource>
- <resource name="CT_Num" resource="Properties">
+ <resource name="CT_Num" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="abstractNumId" tokenid="ooxml:CT_Num_abstractNumId"/>
<element name="lvlOverride" tokenid="ooxml:CT_Num_lvlOverride"/>
<attribute name="numId" tokenid="ooxml:CT_Num_numId"/>
</resource>
- <resource name="CT_Numbering" resource="PropertyTable" tokenid="ooxml:NUMBERING">
+ <resource name="CT_Numbering" resource="PropertyTable" tokenid="ooxml:NUMBERING" tag="numbering">
<kind name="paragraph"/>
<element name="numPicBullet" tokenid="ooxml:CT_Numbering_numPicBullet"/>
<element name="abstractNum" tokenid="ooxml:CT_Numbering_abstractNum"/>
@@ -23182,7 +23187,7 @@
<value tokenid="12">seCell</value>
<value tokenid="13">swCell</value>
</resource>
- <resource name="CT_Style_tblStylePr" resource="Properties">
+ <resource name="CT_Style_tblStylePr" resource="Properties" tag="style">
<element name="pPr" tokenid="ooxml:CT_PPrBase"/>
<element name="rPr" tokenid="ooxml:EG_RPrBase"/>
<element name="tblPr" tokenid="ooxml:CT_TblPrBase"/>
@@ -23196,7 +23201,7 @@
<value tokenid="3">table</value>
<value tokenid="4">numbering</value>
</resource>
- <resource name="CT_Style" resource="Properties">
+ <resource name="CT_Style" resource="Properties" tag="style">
<element name="name" tokenid="ooxml:CT_Style_name"/>
<element name="aliases" tokenid="ooxml:CT_Style_aliases"/>
<element name="basedOn" tokenid="ooxml:CT_Style_basedOn"/>
@@ -23224,9 +23229,9 @@
<attribute name="default" tokenid="ooxml:CT_Style_default"/>
<attribute name="customStyle" tokenid="ooxml:CT_Style_customStyle"/>
</resource>
- <resource name="CT_Styles" resource="Table" tokenid="rtf:STYLESHEET"/>
+ <resource name="CT_Styles" resource="Table" tokenid="rtf:STYLESHEET" tag="style"/>
<resource name="ST_Panose" resource="Hex"/>
- <resource name="CT_Panose" resource="Value">
+ <resource name="CT_Panose" resource="Value" tag="font">
<attribute name="val" tokenid="ooxml:CT_Panose_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
@@ -23238,7 +23243,7 @@
<value tokenid="ooxml:Value_ST_FontFamily_swiss">swiss</value>
<value tokenid="ooxml:Value_ST_FontFamily_auto">auto</value>
</resource>
- <resource name="CT_FontFamily" resource="Value">
+ <resource name="CT_FontFamily" resource="Value" tag="font">
<attribute name="val" tokenid="ooxml:CT_FontFamily_val" action="setValue"/>
</resource>
<resource name="ST_Pitch" resource="List">
@@ -23246,10 +23251,10 @@
<value tokenid="ooxml:Value_ST_Pitch_variable">variable</value>
<value tokenid="ooxml:Value_ST_Pitch_default">default</value>
</resource>
- <resource name="CT_Pitch" resource="Value">
+ <resource name="CT_Pitch" resource="Value" tag="font">
<attribute name="val" tokenid="ooxml:CT_Pitch_val" action="setValue"/>
</resource>
- <resource name="CT_FontSig" resource="Properties">
+ <resource name="CT_FontSig" resource="Properties" tag="font">
<attribute name="usb0" tokenid="ooxml:CT_FontSig_usb0"/>
<attribute name="usb1" tokenid="ooxml:CT_FontSig_usb1"/>
<attribute name="usb2" tokenid="ooxml:CT_FontSig_usb2"/>
@@ -23257,11 +23262,11 @@
<attribute name="csb0" tokenid="ooxml:CT_FontSig_csb0"/>
<attribute name="csb1" tokenid="ooxml:CT_FontSig_csb1"/>
</resource>
- <resource name="CT_FontRel" resource="Properties">
+ <resource name="CT_FontRel" resource="Properties" tag="font">
<attribute name="fontKey" tokenid="ooxml:CT_FontRel_fontKey"/>
<attribute name="subsetted" tokenid="ooxml:CT_FontRel_subsetted"/>
</resource>
- <resource name="CT_Font" resource="Properties">
+ <resource name="CT_Font" resource="Properties" tag="font">
<kind name="character"/>
<element name="altName" tokenid="ooxml:CT_Font_altName"/>
<element name="panose1" tokenid="ooxml:CT_Font_panose1"/>
@@ -23276,8 +23281,8 @@
<element name="embedBoldItalic" tokenid="ooxml:CT_Font_embedBoldItalic"/>
<attribute name="name" tokenid="ooxml:CT_Font_name"/>
</resource>
- <resource name="CT_FontsList" resource="Table" tokenid="rtf:FONTTABLE"/>
- <resource name="EG_RunLevelElts" resource="Stream">
+ <resource name="CT_FontsList" resource="Table" tokenid="rtf:FONTTABLE" tag="font"/>
+ <resource name="EG_RunLevelElts" resource="Stream" tag="character">
<element name="proofErr" tokenid="ooxml:EG_RunLevelElts_proofErr"/>
<element name="permStart" tokenid="ooxml:EG_RunLevelElts_permStart"/>
<element name="permEnd" tokenid="ooxml:EG_RunLevelElts_permEnd"/>
@@ -23288,7 +23293,7 @@
<element name="moveFrom" tokenid="ooxml:EG_RunLevelElts_moveFrom"/>
<element name="moveTo" tokenid="ooxml:EG_RunLevelElts_moveTo"/>
</resource>
- <resource name="CT_Body" resource="Stream">
+ <resource name="CT_Body" resource="Stream" tag="content">
<action name="start" action="startSectionGroup"/>
<!--
<action name="start" action="footnoteSeparator"/>
@@ -23300,7 +23305,7 @@
<action name="end" action="endParagraphGroup"/>
<action name="end" action="endSectionGroup"/>
</resource>
- <resource xmlns:v="urn:schemas-microsoft-com:vml" name="CT_ShapeDefaults" resource="Properties">
+ <resource xmlns:v="urn:schemas-microsoft-com:vml" name="CT_ShapeDefaults" resource="Properties" tag="shape">
<element name="v:fill" tokenid="ooxml:CT_ShapeDefaults_v_fill"/>
<element name="v:stroke" tokenid="ooxml:CT_ShapeDefaults_v_stroke"/>
<element name="v:textbox" tokenid="ooxml:CT_ShapeDefaults_v_textbox"/>
@@ -23315,15 +23320,15 @@
<attribute name="strokecolor" tokenid="ooxml:CT_ShapeDefaults_strokecolor"/>
<attribute name="allowincell" tokenid="ooxml:CT_ShapeDefaults_allowincell"/>
</resource>
- <resource name="CT_Comments" resource="Stream">
+ <resource name="CT_Comments" resource="Stream" tag="content">
<action name="start" action="startSectionGroup"/>
<action name="end" action="endSectionGroup"/>
</resource>
- <resource name="CT_Footnotes" resource="Stream"/>
- <resource name="footnotes" resource="Stream"/>
- <resource name="CT_Endnotes" resource="Stream"/>
- <resource name="endnotes" resource="Stream"/>
- <resource name="CT_SmartTagType" resource="Properties">
+ <resource name="CT_Footnotes" resource="Stream" tag="reference"/>
+ <resource name="footnotes" resource="Stream" tag="reference"/>
+ <resource name="CT_Endnotes" resource="Stream" tag="reference"/>
+ <resource name="endnotes" resource="Stream" tag="reference"/>
+ <resource name="CT_SmartTagType" resource="Properties" tag="content">
<attribute name="namespaceuri" tokenid="ooxml:CT_SmartTagType_namespaceuri"/>
<attribute name="name" tokenid="ooxml:CT_SmartTagType_name"/>
<attribute name="url" tokenid="ooxml:CT_SmartTagType_url"/>
@@ -23352,7 +23357,7 @@
<value name="p" tokenid="ooxml:Value_wordprocessingml_ST_DocPartBehavior_p">p</value>
<value name="pg" tokenid="ooxml:Value_wordprocessingml_ST_DocPartBehavior_pg">pg</value>
</resource>
- <resource name="CT_DocPartBehavior" resource="Value" generated="yes">
+ <resource name="CT_DocPartBehavior" resource="Value" generated="yes" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartBehavior_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23365,7 +23370,7 @@
<value name="formFld" tokenid="ooxml:Value_wordprocessingml_ST_DocPartType_formFld">formFld</value>
<value name="bbPlcHdr" tokenid="ooxml:Value_wordprocessingml_ST_DocPartType_bbPlcHdr">bbPlcHdr</value>
</resource>
- <resource name="CT_DocPartType" resource="Value" generated="yes">
+ <resource name="CT_DocPartType" resource="Value" generated="yes" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23409,24 +23414,24 @@
<value name="custom4" tokenid="ooxml:Value_wordprocessingml_ST_DocPartGallery_custom4">custom4</value>
<value name="custom5" tokenid="ooxml:Value_wordprocessingml_ST_DocPartGallery_custom5">custom5</value>
</resource>
- <resource name="CT_DocPartGallery" resource="Value" generated="yes">
+ <resource name="CT_DocPartGallery" resource="Value" generated="yes" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartGallery_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_DocPartName" resource="Properties">
+ <resource name="CT_DocPartName" resource="Properties" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartName_val"/>
<attribute name="decorated" tokenid="ooxml:CT_DocPartName_decorated"/>
</resource>
- <resource name="settings" resource="Stream">
+ <resource name="settings" resource="Stream" tag="settings">
<element name="settings" tokenid="ooxml:settings_settings"/>
</resource>
- <resource name="fonts" resource="Stream">
+ <resource name="fonts" resource="Stream" tag="font">
<element name="fonts" tokenid="rtf:FONTTABLE"/>
</resource>
- <resource name="numbering" resource="Stream">
+ <resource name="numbering" resource="Stream" tag="numbering">
<element name="numbering" tokenid="ooxml:NUMBERING"/>
</resource>
- <resource name="styles" resource="Stream">
+ <resource name="styles" resource="Stream" tag="style">
<element name="styles" tokenid="rtf:STYLESHEET"/>
</resource>
<resource name="ST_CaptionPos" resource="List" generated="yes">
@@ -23435,7 +23440,7 @@
<value name="left" tokenid="ooxml:Value_wordprocessingml_ST_CaptionPos_left">left</value>
<value name="right" tokenid="ooxml:Value_wordprocessingml_ST_CaptionPos_right">right</value>
</resource>
- <resource name="CT_Caption" resource="Properties">
+ <resource name="CT_Caption" resource="Properties" tag="content">
<attribute name="name" tokenid="ooxml:CT_Caption_name"/>
<attribute name="pos" tokenid="ooxml:CT_Caption_pos"/>
<attribute name="chapNum" tokenid="ooxml:CT_Caption_chapNum"/>
@@ -23444,23 +23449,23 @@
<attribute name="numFmt" tokenid="ooxml:CT_Caption_numFmt"/>
<attribute name="sep" tokenid="ooxml:CT_Caption_sep"/>
</resource>
- <resource name="CT_AutoCaption" resource="Properties">
+ <resource name="CT_AutoCaption" resource="Properties" tag="content">
<attribute name="name" tokenid="ooxml:CT_AutoCaption_name"/>
<attribute name="caption" tokenid="ooxml:CT_AutoCaption_caption"/>
</resource>
- <resource name="CT_AutoCaptions" resource="Properties">
+ <resource name="CT_AutoCaptions" resource="Properties" tag="content">
<element name="autoCaption" tokenid="ooxml:CT_AutoCaptions_autoCaption"/>
</resource>
- <resource name="CT_Captions" resource="Properties">
+ <resource name="CT_Captions" resource="Properties" tag="content">
<element name="caption" tokenid="ooxml:CT_Captions_caption"/>
<element name="autoCaptions" tokenid="ooxml:CT_Captions_autoCaptions"/>
</resource>
- <resource name="CT_DocumentBase" resource="Properties">
+ <resource name="CT_DocumentBase" resource="Properties" tag="content">
<element name="background" tokenid="ooxml:CT_DocumentBase_background"/>
</resource>
- <resource name="CT_Document" resource="Stream"/>
- <resource name="CT_GlossaryDocument" resource="Stream"/>
- <resource name="document" resource="Stream"/>
- <resource name="glossaryDocument" resource="Stream"/>
+ <resource name="CT_Document" resource="Stream" tag="content"/>
+ <resource name="CT_GlossaryDocument" resource="Stream" tag="content"/>
+ <resource name="document" resource="Stream" tag="content"/>
+ <resource name="glossaryDocument" resource="Stream" tag="content"/>
</namespace>
</model>
diff --git a/writerfilter/source/resourcemodel/Fraction.cxx b/writerfilter/source/resourcemodel/Fraction.cxx
new file mode 100644
index 000000000000..c50668a7db03
--- /dev/null
+++ b/writerfilter/source/resourcemodel/Fraction.cxx
@@ -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.
+ *
+ ************************************************************************/
+
+#include <resourcemodel/Fraction.hxx>
+
+namespace writerfilter {
+namespace resourcemodel {
+
+sal_uInt32 gcd(sal_uInt32 a, sal_uInt32 b)
+{
+ if (a == 0 || b == 0)
+ return a | b;
+
+ sal_uInt32 nShift = 0;
+ while (((a | b) & 1) == 0)
+ {
+ a >>= 1;
+ b >>= 1;
+ ++nShift;
+ }
+
+ while ((a & 1) == 0)
+ a >>= 1;
+
+ do
+ {
+ while ((b & 1) == 0)
+ b >>= 1;
+
+ if (a < b)
+ {
+ b -= a;
+ }
+ else
+ {
+ sal_uInt32 nDiff = a - b;
+ a = b;
+ b = nDiff;
+ }
+
+ b >>= 1;
+ }
+ while (b != 0);
+
+ return a << nShift;
+}
+
+sal_uInt32 lcm(sal_Int32 a, sal_Int32 b)
+{
+ return abs(a * b) / gcd(abs(a), abs(b));
+}
+
+Fraction::Fraction(sal_Int32 nNumerator, sal_Int32 nDenominator)
+{
+ init(nNumerator, nDenominator);
+}
+
+Fraction::Fraction(const Fraction & a, const Fraction & b)
+{
+ init(a.mnNumerator * b.mnDenominator, a.mnDenominator * b.mnNumerator);
+}
+
+Fraction::~Fraction()
+{
+}
+
+void Fraction::init(sal_Int32 nNumerator, sal_Int32 nDenominator)
+{
+ sal_uInt32 nGCD = gcd(nNumerator, nDenominator);
+
+ mnNumerator = nNumerator/ nGCD;
+ mnDenominator = nDenominator / nGCD;
+}
+
+void Fraction::assign(const Fraction & rFraction)
+{
+ init(rFraction.mnNumerator, rFraction.mnDenominator);
+}
+
+Fraction Fraction::inverse() const
+{
+ return Fraction(mnDenominator, mnNumerator);
+}
+
+Fraction Fraction::operator + (const Fraction & rFraction) const
+{
+ sal_uInt32 nLCM = lcm(mnDenominator, rFraction.mnDenominator);
+
+ return Fraction(mnNumerator * nLCM / mnDenominator + rFraction.mnNumerator * nLCM / rFraction.mnDenominator, nLCM);
+}
+
+Fraction Fraction::operator - (const Fraction & rFraction) const
+{
+ sal_uInt32 nLCM = lcm(mnDenominator, rFraction.mnDenominator);
+
+ return Fraction(mnNumerator * nLCM / mnDenominator - rFraction.mnNumerator * nLCM / rFraction.mnDenominator, nLCM);
+}
+
+Fraction Fraction::operator * (const Fraction & rFraction) const
+{
+ return Fraction(mnNumerator * rFraction.mnNumerator, mnDenominator * rFraction.mnDenominator);
+}
+
+Fraction Fraction::operator / (const Fraction & rFraction) const
+{
+ return *this * rFraction.inverse();
+}
+
+Fraction Fraction::operator = (const Fraction & rFraction)
+{
+ assign(rFraction);
+
+ return *this;
+}
+
+Fraction::operator sal_Int32() const
+{
+ return mnNumerator / mnDenominator;
+}
+
+Fraction::operator float() const
+{
+ return static_cast<float>(mnNumerator) / static_cast<float>(mnDenominator);
+}
+
+}}
diff --git a/writerfilter/source/resourcemodel/LoggedResources.cxx b/writerfilter/source/resourcemodel/LoggedResources.cxx
new file mode 100644
index 000000000000..f60b48b82b5b
--- /dev/null
+++ b/writerfilter/source/resourcemodel/LoggedResources.cxx
@@ -0,0 +1,322 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <rtl/ustrbuf.hxx>
+#include <resourcemodel/LoggedResources.hxx>
+#include <resourcemodel/QNameToString.hxx>
+
+namespace writerfilter
+{
+
+// class: LoggedResourcesHelper
+
+LoggedResourcesHelper::LoggedResourcesHelper(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mpLogger(pLogger), msPrefix(sPrefix)
+{
+}
+
+LoggedResourcesHelper::~LoggedResourcesHelper()
+{
+}
+
+void LoggedResourcesHelper::startElement(const string & sElement)
+{
+ mpLogger->startElement(msPrefix + "." + sElement);
+}
+
+void LoggedResourcesHelper::endElement(const string & sElement)
+{
+ mpLogger->endElement(msPrefix + "." + sElement);
+}
+
+void LoggedResourcesHelper::chars(const ::rtl::OUString & rChars)
+{
+ mpLogger->chars(rChars);
+}
+
+void LoggedResourcesHelper::chars(const string & rChars)
+{
+ mpLogger->chars(rChars);
+}
+
+void LoggedResourcesHelper::attribute(const string & rName, const string & rValue)
+{
+ mpLogger->attribute(rName, rValue);
+}
+
+void LoggedResourcesHelper::attribute(const string & rName, sal_uInt32 nValue)
+{
+ mpLogger->attribute(rName, nValue);
+}
+
+void LoggedResourcesHelper::setPrefix(const string & rPrefix)
+{
+ msPrefix = rPrefix;
+}
+
+// class: LoggedStream
+
+LoggedStream::LoggedStream(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mHelper(pLogger, sPrefix)
+{
+}
+
+LoggedStream::~LoggedStream()
+{
+}
+
+void LoggedStream::startSectionGroup()
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("section");
+#endif
+
+ lcl_startSectionGroup();
+}
+
+void LoggedStream::endSectionGroup()
+{
+ lcl_endSectionGroup();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("section");
+#endif
+}
+
+void LoggedStream::startParagraphGroup()
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("paragraph");
+#endif
+
+ lcl_startParagraphGroup();
+}
+
+void LoggedStream::endParagraphGroup()
+{
+ lcl_endParagraphGroup();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("paragraph");
+#endif
+}
+
+
+void LoggedStream::startCharacterGroup()
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("charactergroup");
+#endif
+
+ lcl_startCharacterGroup();
+}
+
+void LoggedStream::endCharacterGroup()
+{
+ lcl_endCharacterGroup();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("charactergroup");
+#endif
+}
+
+void LoggedStream::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape )
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("shape");
+#endif
+
+ lcl_startShape(xShape);
+}
+
+void LoggedStream::endShape()
+{
+ lcl_endShape();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("shape");
+#endif
+}
+
+void LoggedStream::text(const sal_uInt8 * data, size_t len)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("text");
+
+ ::rtl::OUString sText( (const sal_Char*) data, len, RTL_TEXTENCODING_MS_1252 );
+
+ mHelper.startElement("data");
+ mHelper.chars(sText);
+ mHelper.endElement("data");
+#endif
+
+ lcl_text(data, len);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("text");
+#endif
+}
+
+void LoggedStream::utext(const sal_uInt8 * data, size_t len)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("utext");
+ mHelper.startElement("data");
+
+ ::rtl::OUString sText;
+ ::rtl::OUStringBuffer aBuffer = ::rtl::OUStringBuffer(len);
+ aBuffer.append( (const sal_Unicode *) data, len);
+ sText = aBuffer.makeStringAndClear();
+
+ mHelper.chars(sText);
+
+ mHelper.endElement("data");
+#endif
+
+ lcl_utext(data, len);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("utext");
+#endif
+}
+
+void LoggedStream::props(writerfilter::Reference<Properties>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("props");
+#endif
+
+ lcl_props(ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("props");
+#endif
+}
+
+void LoggedStream::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("table");
+ mHelper.attribute("name", (*QNameToString::Instance())(name));
+#endif
+
+ lcl_table(name, ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("table");
+#endif
+}
+
+void LoggedStream::substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("substream");
+ mHelper.attribute("name", (*QNameToString::Instance())(name));
+#endif
+
+ lcl_substream(name, ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("substream");
+#endif
+}
+
+void LoggedStream::info(const string & _info)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("info");
+ mHelper.attribute("text", _info);
+#endif
+
+ lcl_info(_info);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("info");
+#endif
+}
+
+// class LoggedProperties
+LoggedProperties::LoggedProperties(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mHelper(pLogger, sPrefix)
+{
+}
+
+LoggedProperties::~LoggedProperties()
+{
+}
+
+void LoggedProperties::attribute(Id name, Value & val)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("attribute");
+ mHelper.attribute("name", (*QNameToString::Instance())(name));
+ mHelper.attribute("value", val.toString());
+ mHelper.endElement("attribute");
+#endif
+
+ lcl_attribute(name, val);
+}
+
+void LoggedProperties::sprm(Sprm & _sprm)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("sprm");
+ mHelper.attribute("name", (*QNameToString::Instance())(_sprm.getId()));
+ mHelper.chars(sprm.toString());
+#endif
+
+ lcl_sprm(_sprm);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("sprm");
+#endif
+}
+
+LoggedTable::LoggedTable(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mHelper(pLogger, sPrefix)
+{
+}
+
+LoggedTable::~LoggedTable()
+{
+}
+
+void LoggedTable::entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("entry");
+ mHelper.attribute("pos", pos);
+#endif
+
+ lcl_entry(pos, ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("entry");
+#endif
+}
+
+}
diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx
index f19bef7c01d1..ebb28aa0148b 100644
--- a/writerfilter/source/resourcemodel/TagLogger.cxx
+++ b/writerfilter/source/resourcemodel/TagLogger.cxx
@@ -25,7 +25,6 @@
*
************************************************************************/
-#ifdef DEBUG
#include <fstream>
#include <string.h>
#include <resourcemodel/TagLogger.hxx>
@@ -34,28 +33,28 @@
namespace writerfilter
{
- XMLTag::Pointer_t XMLTag::NIL(new XMLTag("NIL"));
+XMLTag::Pointer_t XMLTag::NIL(new XMLTag("NIL"));
- void XMLTag::addAttr(string sName, string sValue)
- {
- XMLAttribute aAttr(sName, sValue);
+void XMLTag::addAttr(string sName, string sValue)
+{
+ XMLAttribute aAttr(sName, sValue);
- mAttrs.push_back(aAttr);
- }
+ mAttrs.push_back(aAttr);
+}
- void XMLTag::addAttr(string sName, const ::rtl::OUString & sValue)
- {
- addAttr(sName,
- OUStringToOString
- (sValue, RTL_TEXTENCODING_ASCII_US).getStr());
- }
+void XMLTag::addAttr(string sName, const ::rtl::OUString & sValue)
+{
+ addAttr(sName,
+ OUStringToOString
+ (sValue, RTL_TEXTENCODING_ASCII_US).getStr());
+}
- void XMLTag::addAttr(string sName, sal_uInt32 nValue)
- {
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%" SAL_PRIdINT32, nValue);
- addAttr(sName, buffer);
- }
+void XMLTag::addAttr(string sName, sal_uInt32 nValue)
+{
+ static char buffer[256];
+ snprintf(buffer, sizeof(buffer), "%" SAL_PRIdINT32, nValue);
+ addAttr(sName, buffer);
+}
void XMLTag::addAttr(string sName, uno::Any aAny)
{
@@ -111,322 +110,346 @@ void XMLTag::addAttr(string sName, uno::Any aAny)
aTmpStrString);
}
- void XMLTag::addTag(XMLTag::Pointer_t pTag)
- {
- if (pTag != XMLTag::Pointer_t())
- mTags.push_back(pTag);
- }
+void XMLTag::addTag(XMLTag::Pointer_t pTag)
+{
+ if (pTag != XMLTag::Pointer_t())
+ mTags.push_back(pTag);
+}
- void XMLTag::chars(const string & rChars)
- {
- mChars += rChars;
- }
+void XMLTag::chars(const string & rChars)
+{
+ mChars += rChars;
+}
void XMLTag::chars(const ::rtl::OUString & rChars)
{
chars(OUStringToOString(rChars, RTL_TEXTENCODING_ASCII_US).getStr());
}
- const string & XMLTag::getTag() const
- {
- return mTag;
- }
+const string & XMLTag::getTag() const
+{
+ return mTag;
+}
- string XMLTag::toString() const
- {
- if (mChars.length() > 0)
- return mChars;
+string XMLTag::toString() const
+{
+ if (mChars.length() > 0)
+ return mChars;
- string sResult;
+ string sResult;
- if (mMode == START || mMode == COMPLETE)
- {
- sResult += "<" + mTag;
+ if (mMode == START || mMode == COMPLETE)
+ {
+ sResult += "<" + mTag;
- XMLAttributes_t::const_iterator aIt = mAttrs.begin();
- while (aIt != mAttrs.end())
- {
- sResult += " ";
- sResult += aIt->mName;
- sResult += "=\"";
- sResult += xmlify(aIt->mValue);
- sResult += "\"";
+ XMLAttributes_t::const_iterator aIt = mAttrs.begin();
+ while (aIt != mAttrs.end())
+ {
+ sResult += " ";
+ sResult += aIt->mName;
+ sResult += "=\"";
+ sResult += xmlify(aIt->mValue);
+ sResult += "\"";
- aIt++;
- }
+ aIt++;
+ }
- sResult +=">";
+ sResult +=">";
- if (mTags.size() > 0)
+ if (mTags.size() > 0)
+ {
+ XMLTags_t::const_iterator aItTags = mTags.begin();
+ while (aItTags != mTags.end())
{
- XMLTags_t::const_iterator aItTags = mTags.begin();
- while (aItTags != mTags.end())
- {
- if ((*aItTags).get() != NULL)
- sResult += (*aItTags)->toString();
-
- aItTags++;
- }
+ if ((*aItTags).get() != NULL)
+ sResult += (*aItTags)->toString();
+
+ aItTags++;
}
}
+ }
- if (mMode == END || mMode == COMPLETE)
- sResult += "</" + mTag + ">";
+ if (mMode == END || mMode == COMPLETE)
+ sResult += "</" + mTag + ">";
- return sResult;
- }
+ return sResult;
+}
+
+ostream & XMLTag::output(ostream & o, const string & sIndent) const
+{
+ bool bHasContent = mChars.size() > 0 || mTags.size() > 0;
- ostream & XMLTag::output(ostream & o) const
+ if (mMode == START || mMode == COMPLETE)
{
- if (mMode == START || mMode == COMPLETE)
- {
- o << "<" << mTag;
+ o << sIndent << "<" << mTag;
- XMLAttributes_t::const_iterator aItAttrs(mAttrs.begin());
- while (aItAttrs != mAttrs.end())
- {
- o << " " << aItAttrs->mName << "=\""
- << xmlify(aItAttrs->mValue)
- << "\"";
+ XMLAttributes_t::const_iterator aItAttrs(mAttrs.begin());
+ while (aItAttrs != mAttrs.end())
+ {
+ o << " " << aItAttrs->mName << "=\""
+ << xmlify(aItAttrs->mValue)
+ << "\"";
- aItAttrs++;
- }
+ aItAttrs++;
+ }
+ if (bHasContent)
+ {
o << ">";
+ string sNewIndent = sIndent + " ";
XMLTags_t::const_iterator aItTags(mTags.begin());
while (aItTags != mTags.end())
{
- (*aItTags)->output(o);
+ if (aItTags == mTags.begin())
+ o << endl;
+
+ (*aItTags)->output(o, sNewIndent);
aItTags++;
}
o << mChars;
}
-
- if (mMode == END || mMode == COMPLETE)
- o << "</" << mTag << ">";
-
- return o;
}
- struct eqstr
+ if (mMode == END || mMode == COMPLETE)
{
- bool operator()(const char* s1, const char* s2) const
+ if (bHasContent)
{
- return strcmp(s1, s2) == 0;
- }
- };
-
- typedef hash_map<const char *, TagLogger::Pointer_t, hash<const char *>, eqstr> TagLoggerHashMap_t;
- static TagLoggerHashMap_t * tagLoggers = NULL;
+ if (mTags.size() > 0)
+ o << sIndent;
- TagLogger::TagLogger()
- : mFileName("writerfilter")
- {
+ o << "</" << mTag << ">" << endl;
+ }
+ else
+ o << "/>" << endl;
}
- TagLogger::~TagLogger()
- {
- }
+ return o;
+}
- void TagLogger::setFileName(const string & rName)
+struct eqstr
+{
+ bool operator()(const char* s1, const char* s2) const
{
- mFileName = rName;
+ return strcmp(s1, s2) == 0;
}
+};
- TagLogger::Pointer_t TagLogger::getInstance(const char * name)
- {
- if (tagLoggers == NULL)
- tagLoggers = new TagLoggerHashMap_t();
+typedef hash_map<const char *, TagLogger::Pointer_t, hash<const char *>, eqstr> TagLoggerHashMap_t;
+static TagLoggerHashMap_t * tagLoggers = NULL;
- TagLoggerHashMap_t::iterator aIt = tagLoggers->end();
+TagLogger::TagLogger()
+: mFileName("writerfilter")
+{
+}
- if (! tagLoggers->empty())
- aIt = tagLoggers->find(name);
+TagLogger::~TagLogger()
+{
+}
- if (aIt == tagLoggers->end())
- {
- TagLogger::Pointer_t pTagLogger(new TagLogger());
- pair<const char *, TagLogger::Pointer_t> entry(name, pTagLogger);
- aIt = tagLoggers->insert(entry).first;
- }
+void TagLogger::setFileName(const string & rName)
+{
+ mFileName = rName;
+}
- return aIt->second;
- }
+TagLogger::Pointer_t TagLogger::getInstance(const char * name)
+{
+ if (tagLoggers == NULL)
+ tagLoggers = new TagLoggerHashMap_t();
- XMLTag::Pointer_t TagLogger::currentTag() const
- {
- bool bEmpty=mTags.empty();
- if (!bEmpty)
- return mTags.top();
+ TagLoggerHashMap_t::iterator aIt = tagLoggers->end();
- return XMLTag::NIL;
- }
+ if (! tagLoggers->empty())
+ aIt = tagLoggers->find(name);
- void TagLogger::startDocument()
+ if (aIt == tagLoggers->end())
{
- XMLTag::Pointer_t pTag(new XMLTag("root"));
- mTags.push(pTag);
- mpRoot = pTag;
+ TagLogger::Pointer_t pTagLogger(new TagLogger());
+ pair<const char *, TagLogger::Pointer_t> entry(name, pTagLogger);
+ aIt = tagLoggers->insert(entry).first;
}
- void TagLogger::element(const string & name)
- {
- startElement(name);
- endElement(name);
- }
+ return aIt->second;
+}
- void TagLogger::startElement(const string & name)
- {
- XMLTag::Pointer_t pTag(new XMLTag(name));
- currentTag()->addTag(pTag);
- mTags.push(pTag);
- }
+XMLTag::Pointer_t TagLogger::currentTag() const
+{
+ bool bEmpty=mTags.empty();
+ if (!bEmpty)
+ return mTags.top();
- void TagLogger::attribute(const string & name, const string & value)
- {
- currentTag()->addAttr(name, value);
- }
+ return XMLTag::NIL;
+}
- void TagLogger::attribute(const string & name, const ::rtl::OUString & value)
- {
- currentTag()->addAttr(name, value);
- }
+void TagLogger::startDocument()
+{
+ XMLTag::Pointer_t pTag(new XMLTag("root"));
+ mTags.push(pTag);
+ mpRoot = pTag;
+}
- void TagLogger::attribute(const string & name, sal_uInt32 value)
- {
- currentTag()->addAttr(name, value);
- }
+void TagLogger::element(const string & name)
+{
+ startElement(name);
+ endElement(name);
+}
-void TagLogger::attribute(const string & name, const uno::Any aAny)
+void TagLogger::startElement(const string & name)
{
- currentTag()->addAttr(name, aAny);
+ XMLTag::Pointer_t pTag(new XMLTag(name));
+ currentTag()->addTag(pTag);
+ mTags.push(pTag);
}
- void TagLogger::addTag(XMLTag::Pointer_t pTag)
- {
- currentTag()->addTag(pTag);
- }
+void TagLogger::attribute(const string & name, const string & value)
+{
+ currentTag()->addAttr(name, value);
+}
- void TagLogger::chars(const string & rChars)
- {
- currentTag()->chars(xmlify(rChars));
- }
+void TagLogger::attribute(const string & name, const ::rtl::OUString & value)
+{
+ currentTag()->addAttr(name, value);
+}
- void TagLogger::chars(const ::rtl::OUString & rChars)
- {
- chars(OUStringToOString(rChars, RTL_TEXTENCODING_ASCII_US).getStr());
- }
+void TagLogger::attribute(const string & name, sal_uInt32 value)
+{
+ currentTag()->addAttr(name, value);
+}
- void TagLogger::endElement(const string & name)
- {
- string nameRemoved = currentTag()->getTag();
+void TagLogger::attribute(const string & name, const uno::Any aAny)
+{
+ currentTag()->addAttr(name, aAny);
+}
- if (name == nameRemoved)
- mTags.pop();
- else {
- XMLTag::Pointer_t pTag(new XMLTag("end.mismatch"));
- pTag->addAttr("name", name);
- pTag->addAttr("top", nameRemoved);
+void TagLogger::addTag(XMLTag::Pointer_t pTag)
+{
+ currentTag()->addTag(pTag);
+}
- currentTag()->addTag(pTag);
- }
+void TagLogger::chars(const string & rChars)
+{
+ currentTag()->chars(xmlify(rChars));
+}
- }
+void TagLogger::chars(const ::rtl::OUString & rChars)
+{
+ chars(OUStringToOString(rChars, RTL_TEXTENCODING_ASCII_US).getStr());
+}
- void TagLogger::endDocument()
- {
+void TagLogger::endElement(const string & name)
+{
+ string nameRemoved = currentTag()->getTag();
+
+ if (name == nameRemoved)
mTags.pop();
- }
+ else {
+ XMLTag::Pointer_t pTag(new XMLTag("end.mismatch"));
+ pTag->addAttr("name", name);
+ pTag->addAttr("top", nameRemoved);
- ostream & TagLogger::output(ostream & o) const
- {
- return mpRoot->output(o);
+ currentTag()->addTag(pTag);
}
- void TagLogger::dump(const char * name)
- {
- TagLoggerHashMap_t::iterator aIt(tagLoggers->find(name));
- if (aIt != tagLoggers->end())
- {
- string fileName;
- char * temp = getenv("TAGLOGGERTMP");
-
- if (temp != NULL)
- fileName += temp;
- else
- fileName += "/tmp";
-
- string sPrefix = aIt->second->mFileName;
- size_t nLastSlash = sPrefix.find_last_of('/');
- size_t nLastBackslash = sPrefix.find_last_of('\\');
- size_t nCutPos = nLastSlash;
- if (nLastBackslash < nCutPos)
- nCutPos = nLastBackslash;
- if (nCutPos < sPrefix.size())
- sPrefix = sPrefix.substr(nCutPos + 1);
-
- fileName += "/";
- fileName += sPrefix;
- fileName +=".";
- fileName += name;
- fileName += ".xml";
-
- ofstream dumpStream(fileName.c_str());
- aIt->second->output(dumpStream);
- }
- }
+}
- PropertySetToTagHandler::~PropertySetToTagHandler()
- {
+void TagLogger::endDocument()
+{
+ mTags.pop();
+}
+
+ostream & TagLogger::output(ostream & o) const
+{
+ return mpRoot->output(o);
+}
+
+void TagLogger::dump(const char * name)
+{
+ TagLoggerHashMap_t::iterator aIt(tagLoggers->find(name));
+ if (aIt != tagLoggers->end())
+ {
+ string fileName;
+ char * temp = getenv("TAGLOGGERTMP");
+
+ if (temp != NULL)
+ fileName += temp;
+ else
+ fileName += "/tmp";
+
+ string sPrefix = aIt->second->mFileName;
+ size_t nLastSlash = sPrefix.find_last_of('/');
+ size_t nLastBackslash = sPrefix.find_last_of('\\');
+ size_t nCutPos = nLastSlash;
+ if (nLastBackslash < nCutPos)
+ nCutPos = nLastBackslash;
+ if (nCutPos < sPrefix.size())
+ sPrefix = sPrefix.substr(nCutPos + 1);
+
+ fileName += "/";
+ fileName += sPrefix;
+ fileName +=".";
+ fileName += name;
+ fileName += ".xml";
+
+ ofstream dumpStream(fileName.c_str());
+ aIt->second->output(dumpStream);
}
+}
+
+PropertySetToTagHandler::PropertySetToTagHandler(IdToString::Pointer_t pIdToString)
+ : mpTag(new XMLTag("propertyset")), mpIdToString(pIdToString)
+{
+}
+
+PropertySetToTagHandler::~PropertySetToTagHandler()
+{
+}
- void PropertySetToTagHandler::resolve
- (XMLTag & rTag, writerfilter::Reference<Properties>::Pointer_t pProps)
+void PropertySetToTagHandler::resolve
+(XMLTag & rTag, writerfilter::Reference<Properties>::Pointer_t pProps)
+{
+ if (pProps.get() != NULL)
{
- if (pProps.get() != NULL)
- {
- PropertySetToTagHandler aHandler(mpIdToString);
- pProps->resolve(aHandler);
- rTag.addTag(aHandler.getTag());
- }
+ PropertySetToTagHandler aHandler(mpIdToString);
+ pProps->resolve(aHandler);
+ rTag.addTag(aHandler.getTag());
}
+}
- void PropertySetToTagHandler::attribute(Id name, Value & val)
- {
- XMLTag::Pointer_t pTag(new XMLTag("attribute"));
+void PropertySetToTagHandler::attribute(Id name, Value & val)
+{
+ XMLTag::Pointer_t pTag(new XMLTag("attribute"));
- pTag->addAttr("name", (*QNameToString::Instance())(name));
- pTag->addAttr("value", val.toString());
+ pTag->addAttr("name", (*QNameToString::Instance())(name));
+ pTag->addAttr("value", val.toString());
- resolve(*pTag, val.getProperties());
+ resolve(*pTag, val.getProperties());
- mpTag->addTag(pTag);
- }
+ mpTag->addTag(pTag);
+}
- void PropertySetToTagHandler::sprm(Sprm & rSprm)
- {
- XMLTag::Pointer_t pTag(new XMLTag("sprm"));
+void PropertySetToTagHandler::sprm(Sprm & rSprm)
+{
+ XMLTag::Pointer_t pTag(new XMLTag("sprm"));
- string sName;
+ string sName;
- if (mpIdToString != IdToString::Pointer_t())
- sName = mpIdToString->toString(rSprm.getId());
+ if (mpIdToString != IdToString::Pointer_t())
+ sName = mpIdToString->toString(rSprm.getId());
- pTag->addAttr("name", sName);
+ pTag->addAttr("name", sName);
- static char sBuffer[256];
- snprintf(sBuffer, sizeof(sBuffer),
- "0x%" SAL_PRIxUINT32 ", %" SAL_PRIuUINT32, rSprm.getId(),
- rSprm.getId());
- pTag->addAttr("id", sBuffer);
- pTag->addAttr("value", rSprm.getValue()->toString());
+ static char sBuffer[256];
+ snprintf(sBuffer, sizeof(sBuffer),
+ "0x%" SAL_PRIxUINT32 ", %" SAL_PRIuUINT32, rSprm.getId(),
+ rSprm.getId());
+ pTag->addAttr("id", sBuffer);
+ pTag->addAttr("value", rSprm.getValue()->toString());
- resolve(*pTag, rSprm.getProps());
+ resolve(*pTag, rSprm.getProps());
- mpTag->addTag(pTag);
- }
+ mpTag->addTag(pTag);
+}
XMLTag::Pointer_t unoPropertySetToTag(uno::Reference<beans::XPropertySet> rPropSet)
@@ -464,4 +487,3 @@ XMLTag::Pointer_t unoPropertySetToTag(uno::Reference<beans::XPropertySet> rPropS
}
}
-#endif // DEBUG
diff --git a/writerfilter/source/resourcemodel/XPathLogger.cxx b/writerfilter/source/resourcemodel/XPathLogger.cxx
new file mode 100644
index 000000000000..89255c8311f8
--- /dev/null
+++ b/writerfilter/source/resourcemodel/XPathLogger.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 <stdio.h>
+#include <resourcemodel/XPathLogger.hxx>
+
+namespace writerfilter
+{
+XPathLogger::XPathLogger()
+: mp_tokenMap(new TokenMap_t)
+{
+}
+
+XPathLogger::~XPathLogger()
+{
+}
+
+string XPathLogger::getXPath() const
+{
+ return m_currentPath;
+}
+
+void XPathLogger::updateCurrentPath()
+{
+ m_currentPath = "";
+
+ for (vector<string>::const_iterator aIt = m_path.begin();
+ aIt != m_path.end();
+ aIt++)
+ {
+ if (m_currentPath.size() > 0)
+ m_currentPath += "/";
+
+ m_currentPath += *aIt;
+ }
+}
+
+void XPathLogger::startElement(string _token)
+{
+ TokenMap_t::const_iterator aIt = mp_tokenMap->find(_token);
+
+ if (aIt == mp_tokenMap->end())
+ (*mp_tokenMap)[_token] = 1;
+ else
+ (*mp_tokenMap)[_token]++;
+
+ static char sBuffer[256];
+ snprintf(sBuffer, sizeof(sBuffer), "[%d]", (*mp_tokenMap)[_token]);
+ m_path.push_back(_token + sBuffer);
+
+ m_tokenMapStack.push(mp_tokenMap);
+ mp_tokenMap.reset(new TokenMap_t);
+
+ updateCurrentPath();
+}
+
+void XPathLogger::endElement()
+{
+ mp_tokenMap = m_tokenMapStack.top();
+ m_tokenMapStack.pop();
+ m_path.pop_back();
+
+ updateCurrentPath();
+}
+
+}
diff --git a/writerfilter/source/resourcemodel/makefile.mk b/writerfilter/source/resourcemodel/makefile.mk
index bb5bc05ac1bd..1bc260455813 100644
--- a/writerfilter/source/resourcemodel/makefile.mk
+++ b/writerfilter/source/resourcemodel/makefile.mk
@@ -49,14 +49,17 @@ NOOPTFILES= \
$(SLO)$/qnametostr.obj
SLOFILES= \
+ $(SLO)$/Fraction.obj \
+ $(SLO)$/LoggedResources.obj \
+ $(SLO)$/Protocol.obj \
+ $(SLO)$/ResourceModelHelper.obj \
+ $(SLO)$/TagLogger.obj \
+ $(SLO)$/WW8Analyzer.obj \
+ $(SLO)$/XPathLogger.obj \
$(SLO)$/qnametostr.obj \
- $(SLO)$/sprmcodetostr.obj \
$(SLO)$/resourcemodel.obj \
+ $(SLO)$/sprmcodetostr.obj \
$(SLO)$/util.obj \
- $(SLO)$/TagLogger.obj \
- $(SLO)$/ResourceModelHelper.obj \
- $(SLO)$/WW8Analyzer.obj \
- $(SLO)$/Protocol.obj
# linux 64 bit: compiler (gcc 4.2.3) fails with 'out of memory'
.IF "$(OUTPATH)"=="unxlngx6"
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index ddd7a21c8fb4..b8cd18a64684 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -67,6 +67,7 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
xmloff/source/chart/ColorPropertySet \
xmloff/source/chart/PropertyMaps \
xmloff/source/chart/SchXMLAutoStylePoolP \
+ xmloff/source/chart/SchXMLAxisContext \
xmloff/source/chart/SchXMLCalculationSettingsContext \
xmloff/source/chart/SchXMLChartContext \
xmloff/source/chart/SchXMLExport \
diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx
index 7168b2b811a8..936217fb8dc5 100644
--- a/xmloff/inc/SchXMLImport.hxx
+++ b/xmloff/inc/SchXMLImport.hxx
@@ -90,13 +90,6 @@ enum SchXMLSeriesElemTokenMap
XML_TOK_SERIES_ERROR_INDICATOR
};
-enum SchXMLAxisElemTokenMap
-{
- XML_TOK_AXIS_TITLE,
- XML_TOK_AXIS_CATEGORIES,
- XML_TOK_AXIS_GRID
-};
-
// ----------------------------------------
enum SchXMLChartAttrMap
@@ -134,13 +127,6 @@ enum SchXMLPlotAreaAttrTokenMap
XML_TOK_PA_LIGHTING_MODE
};
-enum SchXMLAxisAttrTokenMap
-{
- XML_TOK_AXIS_DIMENSION,
- XML_TOK_AXIS_NAME,
- XML_TOK_AXIS_STYLE_NAME
-};
-
enum SchXMLLegendAttrMap
{
XML_TOK_LEGEND_POSITION,
diff --git a/xmloff/inc/xmloff/SchXMLImportHelper.hxx b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
index 03fa8c8e16c0..d15b19ee5d38 100644
--- a/xmloff/inc/xmloff/SchXMLImportHelper.hxx
+++ b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
@@ -80,11 +80,9 @@ private:
SvXMLTokenMap* mpChartElemTokenMap;
SvXMLTokenMap* mpPlotAreaElemTokenMap;
SvXMLTokenMap* mpSeriesElemTokenMap;
- SvXMLTokenMap* mpAxisElemTokenMap;
SvXMLTokenMap* mpChartAttrTokenMap;
SvXMLTokenMap* mpPlotAreaAttrTokenMap;
- SvXMLTokenMap* mpAxisAttrTokenMap;
SvXMLTokenMap* mpLegendAttrTokenMap;
SvXMLTokenMap* mpAutoStyleAttrTokenMap;
SvXMLTokenMap* mpCellAttrTokenMap;
@@ -123,11 +121,9 @@ public:
const SvXMLTokenMap& GetChartElemTokenMap();
const SvXMLTokenMap& GetPlotAreaElemTokenMap();
const SvXMLTokenMap& GetSeriesElemTokenMap();
- const SvXMLTokenMap& GetAxisElemTokenMap();
const SvXMLTokenMap& GetChartAttrTokenMap();
const SvXMLTokenMap& GetPlotAreaAttrTokenMap();
- const SvXMLTokenMap& GetAxisAttrTokenMap();
const SvXMLTokenMap& GetLegendAttrTokenMap();
const SvXMLTokenMap& GetAutoStyleAttrTokenMap();
const SvXMLTokenMap& GetCellAttrTokenMap();
diff --git a/xmloff/inc/xmloff/formlayerexport.hxx b/xmloff/inc/xmloff/formlayerexport.hxx
index c9325139474f..476b2f9d8272 100644
--- a/xmloff/inc/xmloff/formlayerexport.hxx
+++ b/xmloff/inc/xmloff/formlayerexport.hxx
@@ -165,9 +165,6 @@ namespace xmloff
*/
bool documentContainsXForms() const;
- /// retrieves the property mapper for control styles
- ::vos::ORef< SvXMLExportPropertyMapper > getStylePropertyMapper();
-
/** exports the controls number styles
*/
void exportControlNumberStyles();
diff --git a/xmloff/inc/xmloff/formlayerimport.hxx b/xmloff/inc/xmloff/formlayerimport.hxx
index 36a2a87a7ad3..37aa8e440444 100644
--- a/xmloff/inc/xmloff/formlayerimport.hxx
+++ b/xmloff/inc/xmloff/formlayerimport.hxx
@@ -62,11 +62,6 @@ namespace xmloff
OFormLayerXMLImport(SvXMLImport& _rImporter);
~OFormLayerXMLImport();
- /** retrieves the property mapper form form related auto styles.
- */
- ::vos::ORef< SvXMLImportPropertyMapper >
- getStylePropertyMapper() const;
-
/** start importing the forms of the given page
<p>starting the import of a new page (by using this method) invalidates the current page position
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 291c99c7be21..ecadbbdc196f 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3113,6 +3113,14 @@ namespace xmloff { namespace token {
XML_OUTSIDE_MINIMUM,//#i114142#
XML_OUTSIDE_MAXIMUM,//#i114142#
+ XML_AXIS_TYPE, //#i25706#
+ XML_DATE_SCALE,
+ XML_BASE_TIME_UNIT,
+ XML_MAJOR_INTERVAL_VALUE,
+ XML_MINOR_INTERVAL_VALUE,
+ XML_MAJOR_INTERVAL_UNIT,
+ XML_MINOR_INTERVAL_UNIT,
+
XML_MIN_VALUE,
XML_MAX_VALUE,
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
new file mode 100755
index 000000000000..d08e4937ff22
--- /dev/null
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -0,0 +1,1053 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_xmloff.hxx"
+
+#include "SchXMLAxisContext.hxx"
+#include "SchXMLChartContext.hxx"
+#include "SchXMLTools.hxx"
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmlement.hxx>
+#include <xmloff/xmlstyle.hxx>
+#include <xmloff/prstylei.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+
+#include <tools/debug.hxx>
+
+#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
+#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
+#include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart/ChartAxisType.hpp>
+#include <com/sun/star/chart/TimeIncrement.hpp>
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <com/sun/star/chart/XAxis.hpp>
+#include <com/sun/star/chart/XAxisSupplier.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
+
+#include <com/sun/star/drawing/LineStyle.hpp>
+
+using namespace ::xmloff::token;
+using namespace com::sun::star;
+
+using rtl::OUString;
+using com::sun::star::uno::Reference;
+
+//----------------------------------------
+//----------------------------------------
+
+static SvXMLEnumMapEntry aXMLAxisDimensionMap[] =
+{
+ { XML_X, SCH_XML_AXIS_X },
+ { XML_Y, SCH_XML_AXIS_Y },
+ { XML_Z, SCH_XML_AXIS_Z },
+ { XML_TOKEN_INVALID, 0 }
+};
+
+static SvXMLEnumMapEntry aXMLAxisTypeMap[] =
+{
+ { XML_AUTO, ::com::sun::star::chart::ChartAxisType::AUTOMATIC },
+ { XML_TEXT, ::com::sun::star::chart::ChartAxisType::CATEGORY },
+ { XML_DATE, ::com::sun::star::chart::ChartAxisType::DATE },
+ { XML_TOKEN_INVALID, 0 }
+};
+
+//----------------------------------------
+//----------------------------------------
+
+class SchXMLCategoriesContext : public SvXMLImportContext
+{
+private:
+ SchXMLImportHelper& m_rImportHelper;
+ OUString& mrAddress;
+
+public:
+ SchXMLCategoriesContext( SchXMLImportHelper& rImpHelper,
+ SvXMLImport& rImport,
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ OUString& rAddress );
+ virtual ~SchXMLCategoriesContext();
+ virtual void StartElement( const Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+};
+
+//----------------------------------------
+//----------------------------------------
+
+
+class DateScaleContext : public SvXMLImportContext
+{
+public:
+ DateScaleContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport,
+ sal_uInt16 nPrefix, const OUString& rLocalName,
+ const Reference< beans::XPropertySet > xAxisProps );
+
+ virtual ~DateScaleContext();
+ virtual void StartElement( const Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+private:
+ SchXMLImportHelper& m_rImportHelper;
+ Reference< beans::XPropertySet > m_xAxisProps;
+};
+
+
+//----------------------------------------
+//----------------------------------------
+
+SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
+ SvXMLImport& rImport, const OUString& rLocalName,
+ Reference< chart::XDiagram > xDiagram,
+ std::vector< SchXMLAxis >& rAxes,
+ OUString & rCategoriesAddress,
+ bool bAddMissingXAxisForNetCharts,
+ bool bAdaptWrongPercentScaleValues,
+ bool bAdaptXAxisOrientationForOld2DBarCharts,
+ bool& rbAxisPositionAttributeImported ) :
+ SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
+ m_rImportHelper( rImpHelper ),
+ m_xDiagram( xDiagram ),
+ m_rAxes( rAxes ),
+ m_rCategoriesAddress( rCategoriesAddress ),
+ m_nAxisType(chart::ChartAxisType::AUTOMATIC),
+ m_bAxisTypeImported(false),
+ m_bDateScaleImported(false),
+ m_bAddMissingXAxisForNetCharts( bAddMissingXAxisForNetCharts ),
+ m_bAdaptWrongPercentScaleValues( bAdaptWrongPercentScaleValues ),
+ m_bAdaptXAxisOrientationForOld2DBarCharts( bAdaptXAxisOrientationForOld2DBarCharts ),
+ m_rbAxisPositionAttributeImported( rbAxisPositionAttributeImported )
+{
+}
+
+SchXMLAxisContext::~SchXMLAxisContext()
+{}
+
+Reference< chart::XAxis > lcl_getChartAxis( SchXMLAxis aCurrentAxis, const Reference< chart::XDiagram > xDiagram )
+{
+ Reference< chart::XAxis > xAxis;
+ Reference< chart::XAxisSupplier > xAxisSuppl( xDiagram, uno::UNO_QUERY );
+ if( !xAxisSuppl.is() )
+ return xAxis;
+ if( aCurrentAxis.nAxisIndex == 0 )
+ xAxis = xAxisSuppl->getAxis(aCurrentAxis.eDimension);
+ else
+ xAxis = xAxisSuppl->getSecondaryAxis(aCurrentAxis.eDimension);
+ return xAxis;
+}
+
+/* returns a shape for the current axis's title. The property
+ "Has...AxisTitle" is set to "True" to get the shape
+ */
+Reference< drawing::XShape > SchXMLAxisContext::getTitleShape()
+{
+ Reference< drawing::XShape > xResult;
+ Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY );
+ Reference< chart::XAxis > xAxis( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ) );
+ if( !xDiaProp.is() || !xAxis.is() )
+ return xResult;
+
+ rtl::OUString aPropName;
+ switch( m_aCurrentAxis.eDimension )
+ {
+ case SCH_XML_AXIS_X:
+ if( m_aCurrentAxis.nAxisIndex == 0 )
+ aPropName = OUString::createFromAscii( "HasXAxisTitle" );
+ else
+ aPropName = OUString::createFromAscii( "HasSecondaryXAxisTitle" );
+ break;
+ case SCH_XML_AXIS_Y:
+ if( m_aCurrentAxis.nAxisIndex == 0 )
+ aPropName = OUString::createFromAscii( "HasYAxisTitle" );
+ else
+ aPropName = OUString::createFromAscii( "HasSecondaryYAxisTitle" );
+ break;
+ case SCH_XML_AXIS_Z:
+ aPropName = OUString::createFromAscii( "HasZAxisTitle" );
+ break;
+ case SCH_XML_AXIS_UNDEF:
+ DBG_ERROR( "Invalid axis" );
+ break;
+ }
+ xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) );
+ xResult = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xResult;
+}
+
+void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor )
+{
+ Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY );
+ Reference< chart::XAxis > xAxis( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ) );
+ if( !xDiaProp.is() || !xAxis.is() )
+ return;
+
+ rtl::OUString aPropName;
+ switch( m_aCurrentAxis.eDimension )
+ {
+ case SCH_XML_AXIS_X:
+ if( bIsMajor )
+ aPropName = OUString::createFromAscii("HasXAxisGrid");
+ else
+ aPropName = OUString::createFromAscii("HasXAxisHelpGrid");
+ break;
+ case SCH_XML_AXIS_Y:
+ if( bIsMajor )
+ aPropName = OUString::createFromAscii("HasYAxisGrid");
+ else
+ aPropName = OUString::createFromAscii("HasYAxisHelpGrid");
+ break;
+ case SCH_XML_AXIS_Z:
+ if( bIsMajor )
+ aPropName = OUString::createFromAscii("HasZAxisGrid");
+ else
+ aPropName = OUString::createFromAscii("HasZAxisHelpGrid");
+ break;
+ case SCH_XML_AXIS_UNDEF:
+ DBG_ERROR( "Invalid axis" );
+ break;
+ }
+ xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) );
+
+ Reference< beans::XPropertySet > xGridProp;
+ if( bIsMajor )
+ xGridProp = xAxis->getMajorGrid();
+ else
+ xGridProp = xAxis->getMinorGrid();
+
+ // set properties
+ if( xGridProp.is())
+ {
+ // the line color is black as default, in the model it is a light gray
+ xGridProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )),
+ uno::makeAny( COL_BLACK ));
+ if( sAutoStyleName.getLength())
+ {
+ const SvXMLStylesContext* pStylesCtxt = m_rImportHelper.GetAutoStylesContext();
+ if( pStylesCtxt )
+ {
+ const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
+ m_rImportHelper.GetChartFamilyID(), sAutoStyleName );
+
+ if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ (( XMLPropStyleContext* )pStyle )->FillPropertySet( xGridProp );
+ }
+ }
+ }
+}
+
+namespace
+{
+enum AxisAttributeTokens
+{
+ XML_TOK_AXIS_DIMENSION,
+ XML_TOK_AXIS_NAME,
+ XML_TOK_AXIS_STYLE_NAME,
+ XML_TOK_AXIS_TYPE,
+ XML_TOK_AXIS_TYPE_EXT
+};
+
+SvXMLTokenMapEntry aAxisAttributeTokenMap[] =
+{
+ { XML_NAMESPACE_CHART, XML_DIMENSION, XML_TOK_AXIS_DIMENSION },
+ { XML_NAMESPACE_CHART, XML_NAME, XML_TOK_AXIS_NAME },
+ { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_AXIS_STYLE_NAME },
+ { XML_NAMESPACE_CHART, XML_AXIS_TYPE, XML_TOK_AXIS_TYPE },
+ { XML_NAMESPACE_CHART_EXT, XML_AXIS_TYPE, XML_TOK_AXIS_TYPE_EXT },
+ XML_TOKEN_MAP_END
+};
+
+class AxisAttributeTokenMap : public SvXMLTokenMap
+{
+public:
+ AxisAttributeTokenMap(): SvXMLTokenMap( aAxisAttributeTokenMap ) {}
+ virtual ~AxisAttributeTokenMap() {}
+};
+
+//a AxisAttributeTokenMap Singleton
+struct theAxisAttributeTokenMap : public rtl::Static< AxisAttributeTokenMap, theAxisAttributeTokenMap > {};
+}
+
+void SchXMLAxisContext::StartElement( const Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ // parse attributes
+ sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+ SchXMLImport& rImport = ( SchXMLImport& )GetImport();
+ const SvXMLTokenMap& rAttrTokenMap = theAxisAttributeTokenMap::get();
+
+ for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ {
+ OUString sAttrName = xAttrList->getNameByIndex( i );
+ OUString aLocalName;
+ OUString aValue = xAttrList->getValueByIndex( i );
+ USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
+
+ switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
+ {
+ case XML_TOK_AXIS_DIMENSION:
+ {
+ USHORT nEnumVal;
+ if( rImport.GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLAxisDimensionMap ))
+ m_aCurrentAxis.eDimension = ( SchXMLAxisDimension )nEnumVal;
+ }
+ break;
+ case XML_TOK_AXIS_NAME:
+ m_aCurrentAxis.aName = aValue;
+ break;
+ case XML_TOK_AXIS_TYPE:
+ case XML_TOK_AXIS_TYPE_EXT:
+ USHORT nEnumVal;
+ if( rImport.GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLAxisTypeMap ))
+ {
+ m_nAxisType = nEnumVal;
+ m_bAxisTypeImported = true;
+ }
+ break;
+ case XML_TOK_AXIS_STYLE_NAME:
+ m_aAutoStyleName = aValue;
+ break;
+ }
+ }
+
+ // check for number of axes with same dimension
+ m_aCurrentAxis.nAxisIndex = 0;
+ sal_Int32 nNumOfAxes = m_rAxes.size();
+ for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ )
+ {
+ if( m_rAxes[ nCurrent ].eDimension == m_aCurrentAxis.eDimension )
+ m_aCurrentAxis.nAxisIndex++;
+ }
+ CreateAxis();
+}
+namespace
+{
+
+Reference< chart2::XAxis > lcl_getAxis( const Reference< frame::XModel >& xChartModel,
+ sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
+{
+ Reference< chart2::XAxis > xAxis;
+
+ try
+ {
+ Reference< chart2::XChartDocument > xChart2Document( xChartModel, uno::UNO_QUERY );
+ if( xChart2Document.is() )
+ {
+ Reference< chart2::XDiagram > xDiagram( xChart2Document->getFirstDiagram());
+ Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
+ uno::Sequence< Reference< chart2::XCoordinateSystem > >
+ aCooSysSeq( xCooSysCnt->getCoordinateSystems());
+ sal_Int32 nCooSysIndex = 0;
+ if( nCooSysIndex < aCooSysSeq.getLength() )
+ {
+ Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] );
+ if( xCooSys.is() && nDimensionIndex < xCooSys->getDimension() )
+ {
+ const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
+ if( nAxisIndex <= nMaxAxisIndex )
+ xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex );
+ }
+ }
+ }
+ }
+ catch( uno::Exception & )
+ {
+ DBG_ERROR( "Couldn't get axis" );
+ }
+
+ return xAxis;
+}
+
+bool lcl_divideBy100( uno::Any& rDoubleAny )
+{
+ bool bChanged = false;
+ double fValue=0.0;
+ if( (rDoubleAny>>=fValue) && (fValue!=0.0) )
+ {
+ fValue/=100.0;
+ rDoubleAny = uno::makeAny(fValue);
+ bChanged = true;
+ }
+ return bChanged;
+}
+
+bool lcl_AdaptWrongPercentScaleValues(chart2::ScaleData& rScaleData)
+{
+ bool bChanged = lcl_divideBy100( rScaleData.Minimum );
+ bChanged = lcl_divideBy100( rScaleData.Maximum ) || bChanged;
+ bChanged = lcl_divideBy100( rScaleData.Origin ) || bChanged;
+ bChanged = lcl_divideBy100( rScaleData.IncrementData.Distance ) || bChanged;
+ return bChanged;
+}
+
+}//end anonymous namespace
+
+void SchXMLAxisContext::CreateAxis()
+{
+ m_rAxes.push_back( m_aCurrentAxis );
+
+ Reference< beans::XPropertySet > xDiaProp( m_rImportHelper.GetChartDocument()->getDiagram(), uno::UNO_QUERY );
+ if( !xDiaProp.is() )
+ return;
+ rtl::OUString aPropName;
+ switch( m_aCurrentAxis.eDimension )
+ {
+ case SCH_XML_AXIS_X:
+ if( m_aCurrentAxis.nAxisIndex == 0 )
+ aPropName = OUString::createFromAscii("HasXAxis");
+ else
+ aPropName = OUString::createFromAscii("HasSecondaryXAxis");
+ break;
+ case SCH_XML_AXIS_Y:
+ if( m_aCurrentAxis.nAxisIndex == 0 )
+ aPropName = OUString::createFromAscii("HasYAxis");
+ else
+ aPropName = OUString::createFromAscii("HasSecondaryYAxis");
+ break;
+ case SCH_XML_AXIS_Z:
+ if( m_aCurrentAxis.nAxisIndex == 0 )
+ aPropName = OUString::createFromAscii("HasXAxis");
+ else
+ aPropName = OUString::createFromAscii("HasSecondaryXAxis");
+ break;
+ case SCH_XML_AXIS_UNDEF:
+ DBG_ERROR( "Invalid axis" );
+ break;
+ }
+ try
+ {
+ xDiaProp->setPropertyValue( aPropName, uno::makeAny(sal_True) );
+ }
+ catch( beans::UnknownPropertyException & )
+ {
+ DBG_ERROR( "Couldn't turn on axis" );
+ }
+ if( m_aCurrentAxis.eDimension==SCH_XML_AXIS_Z )
+ {
+ bool bSettingZAxisSuccedded = false;
+ try
+ {
+ xDiaProp->getPropertyValue( aPropName ) >>= bSettingZAxisSuccedded;
+ }
+ catch( beans::UnknownPropertyException & )
+ {
+ DBG_ERROR( "Couldn't turn on z axis" );
+ }
+ if( !bSettingZAxisSuccedded )
+ return;
+ }
+
+
+ m_xAxisProps = Reference<beans::XPropertySet>( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ), uno::UNO_QUERY );
+
+ if( m_bAddMissingXAxisForNetCharts && m_aCurrentAxis.eDimension==SCH_XML_AXIS_Y && m_aCurrentAxis.nAxisIndex==0 )
+ {
+ try
+ {
+ xDiaProp->setPropertyValue( OUString::createFromAscii( "HasXAxis" ), uno::makeAny(sal_True) );
+ }
+ catch( beans::UnknownPropertyException & )
+ {
+ DBG_ERROR( "Couldn't turn on x axis" );
+ }
+ }
+
+ // set properties
+ if( m_xAxisProps.is())
+ {
+ uno::Any aTrueBool( uno::makeAny( sal_True ));
+ uno::Any aFalseBool( uno::makeAny( sal_False ));
+
+ // #i109879# the line color is black as default, in the model it is a light gray
+ m_xAxisProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )),
+ uno::makeAny( COL_BLACK ));
+
+ m_xAxisProps->setPropertyValue( OUString::createFromAscii( "DisplayLabels" ), aFalseBool );
+
+ // #88077# AutoOrigin 'on' is default
+ m_xAxisProps->setPropertyValue( OUString::createFromAscii( "AutoOrigin" ), aTrueBool );
+
+ if( m_bAxisTypeImported )
+ m_xAxisProps->setPropertyValue( OUString::createFromAscii( "AxisType" ), uno::makeAny(m_nAxisType) );
+
+ if( m_aAutoStyleName.getLength())
+ {
+ const SvXMLStylesContext* pStylesCtxt = m_rImportHelper.GetAutoStylesContext();
+ if( pStylesCtxt )
+ {
+ const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
+ m_rImportHelper.GetChartFamilyID(), m_aAutoStyleName );
+
+ if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ {
+ // note: SvXMLStyleContext::FillPropertySet is not const
+ XMLPropStyleContext * pPropStyleContext = const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle ));
+ if( pPropStyleContext )
+ pPropStyleContext->FillPropertySet( m_xAxisProps );
+
+ if( m_bAdaptWrongPercentScaleValues && m_aCurrentAxis.eDimension==SCH_XML_AXIS_Y )
+ {
+ //set scale data of added x axis back to default
+ Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(),
+ m_aCurrentAxis.eDimension, m_aCurrentAxis.nAxisIndex ) );
+ if( xAxis.is() )
+ {
+ chart2::ScaleData aScaleData( xAxis->getScaleData());
+ if( lcl_AdaptWrongPercentScaleValues(aScaleData) )
+ xAxis->setScaleData( aScaleData );
+ }
+ }
+
+ if( m_bAddMissingXAxisForNetCharts )
+ {
+ //copy style from y axis to added x axis:
+
+ Reference< chart::XAxisSupplier > xAxisSuppl( xDiaProp, uno::UNO_QUERY );
+ if( xAxisSuppl.is() )
+ {
+ Reference< beans::XPropertySet > xXAxisProp( xAxisSuppl->getAxis(0), uno::UNO_QUERY );
+ (( XMLPropStyleContext* )pStyle )->FillPropertySet( xXAxisProp );
+ }
+
+ //set scale data of added x axis back to default
+ Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(),
+ 0 /*nDimensionIndex*/, 0 /*nAxisIndex*/ ) );
+ if( xAxis.is() )
+ {
+ chart2::ScaleData aScaleData;
+ aScaleData.AxisType = chart2::AxisType::CATEGORY;
+ aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
+ xAxis->setScaleData( aScaleData );
+ }
+
+ //set line style of added x axis to invisible
+ Reference< beans::XPropertySet > xNewAxisProp( xAxis, uno::UNO_QUERY );
+ if( xNewAxisProp.is() )
+ {
+ xNewAxisProp->setPropertyValue( OUString::createFromAscii("LineStyle")
+ , uno::makeAny(drawing::LineStyle_NONE));
+ }
+ }
+
+ if( m_bAdaptXAxisOrientationForOld2DBarCharts && m_aCurrentAxis.eDimension == SCH_XML_AXIS_X )
+ {
+ bool bIs3DChart = false;
+ if( xDiaProp.is() && ( xDiaProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Dim3D"))) >>= bIs3DChart )
+ && !bIs3DChart )
+ {
+ Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY );
+ if( xChart2Document.is() )
+ {
+ Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChart2Document->getFirstDiagram(), uno::UNO_QUERY );
+ if( xCooSysCnt.is() )
+ {
+ uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() );
+ if( aCooSysSeq.getLength() )
+ {
+ bool bSwapXandYAxis = false;
+ Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] );
+ Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY );
+ if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXandYAxis )
+ && bSwapXandYAxis )
+ {
+ Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, m_aCurrentAxis.nAxisIndex );
+ if( xAxis.is() )
+ {
+ chart2::ScaleData aScaleData = xAxis->getScaleData();
+ aScaleData.Orientation = chart2::AxisOrientation_REVERSE;
+ xAxis->setScaleData( aScaleData );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ m_rbAxisPositionAttributeImported = m_rbAxisPositionAttributeImported || SchXMLTools::getPropertyFromContext(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")), pPropStyleContext, pStylesCtxt ).hasValue();
+ }
+ }
+ }
+ }
+}
+
+void SchXMLAxisContext::SetAxisTitle()
+{
+ if( !m_aCurrentAxis.aTitle.getLength() )
+ return;
+
+ Reference< chart::XAxis > xAxis( lcl_getChartAxis( m_aCurrentAxis, m_xDiagram ) );
+ if( !xAxis.is() )
+ return;
+
+ Reference< beans::XPropertySet > xTitleProp( xAxis->getAxisTitle() );
+ if( xTitleProp.is() )
+ {
+ try
+ {
+ xTitleProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), uno::makeAny(m_aCurrentAxis.aTitle) );
+ }
+ catch( beans::UnknownPropertyException & )
+ {
+ DBG_ERROR( "Property String for Title not available" );
+ }
+ }
+}
+
+//-----------------------------------------------------------------------
+namespace
+{
+enum AxisChildTokens
+{
+ XML_TOK_AXIS_TITLE,
+ XML_TOK_AXIS_CATEGORIES,
+ XML_TOK_AXIS_GRID,
+ XML_TOK_AXIS_DATE_SCALE,
+ XML_TOK_AXIS_DATE_SCALE_EXT
+};
+
+SvXMLTokenMapEntry aAxisChildTokenMap[] =
+{
+ { XML_NAMESPACE_CHART, XML_TITLE, XML_TOK_AXIS_TITLE },
+ { XML_NAMESPACE_CHART, XML_CATEGORIES, XML_TOK_AXIS_CATEGORIES },
+ { XML_NAMESPACE_CHART, XML_GRID, XML_TOK_AXIS_GRID },
+ { XML_NAMESPACE_CHART, XML_DATE_SCALE, XML_TOK_AXIS_DATE_SCALE },
+ { XML_NAMESPACE_CHART_EXT, XML_DATE_SCALE, XML_TOK_AXIS_DATE_SCALE_EXT },
+ XML_TOKEN_MAP_END
+};
+
+class AxisChildTokenMap : public SvXMLTokenMap
+{
+public:
+ AxisChildTokenMap(): SvXMLTokenMap( aAxisChildTokenMap ) {}
+ virtual ~AxisChildTokenMap() {}
+};
+
+//a AxisChildTokenMap Singleton
+struct theAxisChildTokenMap : public rtl::Static< AxisChildTokenMap, theAxisChildTokenMap > {};
+}
+
+SvXMLImportContext* SchXMLAxisContext::CreateChildContext(
+ USHORT p_nPrefix,
+ const OUString& rLocalName,
+ const Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ SvXMLImportContext* pContext = 0;
+ const SvXMLTokenMap& rTokenMap = theAxisChildTokenMap::get();
+
+ switch( rTokenMap.Get( p_nPrefix, rLocalName ))
+ {
+ case XML_TOK_AXIS_TITLE:
+ {
+ Reference< drawing::XShape > xTitleShape = getTitleShape();
+ pContext = new SchXMLTitleContext( m_rImportHelper, GetImport(), rLocalName,
+ m_aCurrentAxis.aTitle,
+ xTitleShape );
+ }
+ break;
+
+ case XML_TOK_AXIS_CATEGORIES:
+ pContext = new SchXMLCategoriesContext( m_rImportHelper, GetImport(),
+ p_nPrefix, rLocalName,
+ m_rCategoriesAddress );
+ m_aCurrentAxis.bHasCategories = true;
+ break;
+
+ case XML_TOK_AXIS_DATE_SCALE:
+ case XML_TOK_AXIS_DATE_SCALE_EXT:
+ pContext = new DateScaleContext( m_rImportHelper, GetImport(),
+ p_nPrefix, rLocalName, m_xAxisProps );
+ m_bDateScaleImported = true;
+ break;
+
+ case XML_TOK_AXIS_GRID:
+ {
+ sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+ bool bIsMajor = true; // default value for class is "major"
+ OUString sAutoStyleName;
+
+ for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ {
+ OUString sAttrName = xAttrList->getNameByIndex( i );
+ OUString aLocalName;
+ USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
+
+ if( nPrefix == XML_NAMESPACE_CHART )
+ {
+ if( IsXMLToken( aLocalName, XML_CLASS ) )
+ {
+ if( IsXMLToken( xAttrList->getValueByIndex( i ), XML_MINOR ) )
+ bIsMajor = false;
+ }
+ else if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
+ sAutoStyleName = xAttrList->getValueByIndex( i );
+ }
+ }
+
+ CreateGrid( sAutoStyleName, bIsMajor );
+
+ // don't create a context => use default context. grid elements are empty
+ pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
+ }
+ break;
+
+ default:
+ pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
+ break;
+ }
+
+ return pContext;
+}
+
+void SchXMLAxisContext::EndElement()
+{
+ if( !m_bDateScaleImported && m_nAxisType==chart::ChartAxisType::AUTOMATIC )
+ {
+ Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(), m_aCurrentAxis.eDimension, m_aCurrentAxis.nAxisIndex ) );
+ if( xAxis.is() )
+ {
+ chart2::ScaleData aScaleData( xAxis->getScaleData());
+ aScaleData.AutoDateAxis = false;//different default for older documents
+ xAxis->setScaleData( aScaleData );
+ }
+ }
+
+ SetAxisTitle();
+}
+
+// ========================================
+
+namespace
+{
+
+Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem > xCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
+{
+ Reference< chart2::XAxis > xAxis;
+ try
+ {
+ xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex );
+ }
+ catch( uno::Exception & )
+ {
+ }
+ return xAxis;
+}
+
+} // anonymous namespace
+
+void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDocument >& xNewDoc,
+ const OUString& rChartTypeServiceName,
+ const OUString& rODFVersionOfFile,
+ bool bAxisPositionAttributeImported )
+{
+ if( ( !rODFVersionOfFile.getLength() || rODFVersionOfFile.equalsAscii("1.0")
+ || rODFVersionOfFile.equalsAscii("1.1")
+ || ( rODFVersionOfFile.equalsAscii("1.2") && !bAxisPositionAttributeImported ) ) )
+ {
+ try
+ {
+ Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDoc->getFirstDiagram(), uno::UNO_QUERY_THROW );
+ uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
+ if( aCooSysSeq.getLength() )
+ {
+ Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] );
+ if( xCooSys.is() )
+ {
+ Reference< chart2::XAxis > xMainXAxis = lcl_getAxis( xCooSys, 0, 0 );
+ Reference< chart2::XAxis > xMainYAxis = lcl_getAxis( xCooSys, 1, 0 );
+ //Reference< chart2::XAxis > xMajorZAxis = lcl_getAxis( xCooSys, 2, 0 );
+ Reference< chart2::XAxis > xSecondaryXAxis = lcl_getAxis( xCooSys, 0, 1 );
+ Reference< chart2::XAxis > xSecondaryYAxis = lcl_getAxis( xCooSys, 1, 1 );
+
+ Reference< beans::XPropertySet > xMainXAxisProp( xMainXAxis, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xMainYAxisProp( xMainYAxis, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xSecondaryXAxisProp( xSecondaryXAxis, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xSecondaryYAxisProp( xSecondaryYAxis, uno::UNO_QUERY );
+
+ if( xMainXAxisProp.is() && xMainYAxisProp.is() )
+ {
+ chart2::ScaleData aMainXScale = xMainXAxis->getScaleData();
+ if( 0 == rChartTypeServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ScatterChartType" ) ) )
+ {
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) );
+ double fCrossoverValue = 0.0;
+ aMainXScale.Origin >>= fCrossoverValue;
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverValue")
+ , uno::makeAny( fCrossoverValue ) );
+
+ if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE )
+ {
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) );
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
+ if( xSecondaryYAxisProp.is() )
+ xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
+ }
+ else
+ {
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) );
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
+ if( xSecondaryYAxisProp.is() )
+ xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
+ }
+ }
+ else
+ {
+ if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE )
+ {
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
+ if( xSecondaryYAxisProp.is() )
+ xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
+ }
+ else
+ {
+ xMainYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
+ if( xSecondaryYAxisProp.is() )
+ xSecondaryYAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
+ }
+ }
+
+ chart2::ScaleData aMainYScale = xMainYAxis->getScaleData();
+ xMainXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) );
+ double fCrossoverValue = 0.0;
+ aMainYScale.Origin >>= fCrossoverValue;
+ xMainXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverValue")
+ , uno::makeAny( fCrossoverValue ) );
+
+ if( aMainYScale.Orientation == chart2::AxisOrientation_REVERSE )
+ {
+ xMainXAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) );
+ xMainXAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
+ if( xSecondaryXAxisProp.is() )
+ xSecondaryXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
+ }
+ else
+ {
+ xMainXAxisProp->setPropertyValue( OUString::createFromAscii("LabelPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) );
+ xMainXAxisProp->setPropertyValue( OUString::createFromAscii("MarkPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
+ if( xSecondaryXAxisProp.is() )
+ xSecondaryXAxisProp->setPropertyValue( OUString::createFromAscii("CrossoverPosition")
+ , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
+ }
+ }
+ }
+ }
+ }
+ catch( uno::Exception & )
+ {
+ }
+ }
+}
+
+// ========================================
+
+SchXMLCategoriesContext::SchXMLCategoriesContext(
+ SchXMLImportHelper& rImpHelper,
+ SvXMLImport& rImport,
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ OUString& rAddress ) :
+ SvXMLImportContext( rImport, nPrefix, rLocalName ),
+ m_rImportHelper( rImpHelper ),
+ mrAddress( rAddress )
+{
+}
+
+SchXMLCategoriesContext::~SchXMLCategoriesContext()
+{
+}
+
+void SchXMLCategoriesContext::StartElement( const Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+
+ for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ {
+ OUString sAttrName = xAttrList->getNameByIndex( i );
+ OUString aLocalName;
+ USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
+
+ if( nPrefix == XML_NAMESPACE_TABLE &&
+ IsXMLToken( aLocalName, XML_CELL_RANGE_ADDRESS ) )
+ {
+ Reference< chart2::XChartDocument > xNewDoc( GetImport().GetModel(), uno::UNO_QUERY );
+ mrAddress = xAttrList->getValueByIndex( i );
+ }
+ }
+}
+
+// ========================================
+
+DateScaleContext::DateScaleContext(
+ SchXMLImportHelper& rImpHelper,
+ SvXMLImport& rImport,
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< beans::XPropertySet > xAxisProps ) :
+ SvXMLImportContext( rImport, nPrefix, rLocalName ),
+ m_rImportHelper( rImpHelper ),
+ m_xAxisProps( xAxisProps )
+{
+}
+
+DateScaleContext::~DateScaleContext()
+{
+}
+
+namespace
+{
+enum DateScaleAttributeTokens
+{
+ XML_TOK_DATESCALE_BASE_TIME_UNIT,
+ XML_TOK_DATESCALE_MAJOR_INTERVAL_VALUE,
+ XML_TOK_DATESCALE_MAJOR_INTERVAL_UNIT,
+ XML_TOK_DATESCALE_MINOR_INTERVAL_VALUE,
+ XML_TOK_DATESCALE_MINOR_INTERVAL_UNIT
+};
+
+SvXMLTokenMapEntry aDateScaleAttributeTokenMap[] =
+{
+ { XML_NAMESPACE_CHART, XML_BASE_TIME_UNIT, XML_TOK_DATESCALE_BASE_TIME_UNIT },
+ { XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_VALUE, XML_TOK_DATESCALE_MAJOR_INTERVAL_VALUE },
+ { XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_UNIT, XML_TOK_DATESCALE_MAJOR_INTERVAL_UNIT },
+ { XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_VALUE, XML_TOK_DATESCALE_MINOR_INTERVAL_VALUE },
+ { XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_UNIT, XML_TOK_DATESCALE_MINOR_INTERVAL_UNIT },
+ XML_TOKEN_MAP_END
+};
+
+class DateScaleAttributeTokenMap : public SvXMLTokenMap
+{
+public:
+ DateScaleAttributeTokenMap(): SvXMLTokenMap( aDateScaleAttributeTokenMap ) {}
+ virtual ~DateScaleAttributeTokenMap() {}
+};
+
+struct theDateScaleAttributeTokenMap : public rtl::Static< DateScaleAttributeTokenMap, theDateScaleAttributeTokenMap > {};
+
+sal_Int32 lcl_getTimeUnit( const OUString& rValue )
+{
+ sal_Int32 nTimeUnit = ::com::sun::star::chart::TimeUnit::DAY;
+ if( IsXMLToken( rValue, XML_DAYS ) )
+ nTimeUnit = ::com::sun::star::chart::TimeUnit::DAY;
+ else if( IsXMLToken( rValue, XML_MONTHS ) )
+ nTimeUnit = ::com::sun::star::chart::TimeUnit::MONTH;
+ else if( IsXMLToken( rValue, XML_YEARS ) )
+ nTimeUnit = ::com::sun::star::chart::TimeUnit::YEAR;
+ return nTimeUnit;
+}
+
+}
+
+void DateScaleContext::StartElement( const Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ if( !m_xAxisProps.is() )
+ return;
+
+ // parse attributes
+ sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+ const SvXMLTokenMap& rAttrTokenMap = theDateScaleAttributeTokenMap::get();
+
+ bool bSetNewIncrement=false;
+ chart::TimeIncrement aIncrement;
+ m_xAxisProps->getPropertyValue( OUString::createFromAscii( "TimeIncrement" )) >>= aIncrement;
+
+ for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ {
+ OUString sAttrName = xAttrList->getNameByIndex( i );
+ OUString aLocalName;
+ OUString aValue = xAttrList->getValueByIndex( i );
+ USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
+
+ switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
+ {
+ case XML_TOK_DATESCALE_BASE_TIME_UNIT:
+ {
+ aIncrement.TimeResolution = uno::makeAny( lcl_getTimeUnit(aValue) );
+ bSetNewIncrement = true;
+ }
+ break;
+ case XML_TOK_DATESCALE_MAJOR_INTERVAL_VALUE:
+ {
+ chart::TimeInterval aInterval(1,0);
+ aIncrement.MajorTimeInterval >>= aInterval;
+ SvXMLUnitConverter::convertNumber( aInterval.Number, aValue );
+ aIncrement.MajorTimeInterval = uno::makeAny(aInterval);
+ bSetNewIncrement = true;
+ }
+ break;
+ case XML_TOK_DATESCALE_MAJOR_INTERVAL_UNIT:
+ {
+ chart::TimeInterval aInterval(1,0);
+ aIncrement.MajorTimeInterval >>= aInterval;
+ aInterval.TimeUnit = lcl_getTimeUnit(aValue);
+ aIncrement.MajorTimeInterval = uno::makeAny(aInterval);
+ bSetNewIncrement = true;
+ }
+ break;
+ case XML_TOK_DATESCALE_MINOR_INTERVAL_VALUE:
+ {
+ chart::TimeInterval aInterval(1,0);
+ aIncrement.MinorTimeInterval >>= aInterval;
+ SvXMLUnitConverter::convertNumber( aInterval.Number, aValue );
+ aIncrement.MinorTimeInterval = uno::makeAny(aInterval);
+ bSetNewIncrement = true;
+ }
+ break;
+ case XML_TOK_DATESCALE_MINOR_INTERVAL_UNIT:
+ {
+ chart::TimeInterval aInterval(1,0);
+ aIncrement.MinorTimeInterval >>= aInterval;
+ aInterval.TimeUnit = lcl_getTimeUnit(aValue);
+ aIncrement.MinorTimeInterval = uno::makeAny(aInterval);
+ bSetNewIncrement = true;
+ }
+ break;
+ }
+ }
+
+ if( bSetNewIncrement )
+ m_xAxisProps->setPropertyValue( OUString::createFromAscii( "TimeIncrement" ), uno::makeAny( aIncrement ) );
+}
+
+// ========================================
diff --git a/xmloff/source/chart/SchXMLAxisContext.hxx b/xmloff/source/chart/SchXMLAxisContext.hxx
new file mode 100755
index 000000000000..78ce22415630
--- /dev/null
+++ b/xmloff/source/chart/SchXMLAxisContext.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SCH_XMLAXISCONTEXT_HXX_
+#define _SCH_XMLAXISCONTEXT_HXX_
+
+#include "SchXMLImport.hxx"
+#include "transporttypes.hxx"
+
+// ----------------------------------------
+
+class SchXMLAxisContext : public SvXMLImportContext
+{
+public:
+ SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
+ SvXMLImport& rImport, const rtl::OUString& rLocalName,
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram,
+ std::vector< SchXMLAxis >& aAxes,
+ ::rtl::OUString& rCategoriesAddress,
+ bool bAddMissingXAxisForNetCharts,
+ bool bAdaptWrongPercentScaleValues,
+ bool bAdaptXAxisOrientationForOld2DBarCharts,
+ bool& rbAxisPositionAttributeImported );
+ virtual ~SchXMLAxisContext();
+
+ virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+ virtual void EndElement();
+ virtual SvXMLImportContext* CreateChildContext(
+ USHORT nPrefix,
+ const rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ static void CorrectAxisPositions( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xNewDoc,
+ const ::rtl::OUString& rChartTypeServiceName,
+ const ::rtl::OUString& rODFVersionOfFile,
+ bool bAxisPositionAttributeImported );
+
+private:
+ SchXMLImportHelper& m_rImportHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > m_xDiagram;
+ SchXMLAxis m_aCurrentAxis;
+ std::vector< SchXMLAxis >& m_rAxes;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xAxisProps;
+ rtl::OUString m_aAutoStyleName;
+ rtl::OUString& m_rCategoriesAddress;
+ sal_Int32 m_nAxisType;//::com::sun::star::chart::ChartAxisType
+ bool m_bAxisTypeImported;
+ bool m_bDateScaleImported;
+ bool m_bAddMissingXAxisForNetCharts; //to correct errors from older versions
+ bool m_bAdaptWrongPercentScaleValues; //to correct errors from older versions
+ bool m_bAdaptXAxisOrientationForOld2DBarCharts; //to correct different behaviour from older versions
+ bool& m_rbAxisPositionAttributeImported;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape();
+ void CreateGrid( ::rtl::OUString sAutoStyleName, bool bIsMajor );
+ void CreateAxis();
+ void SetAxisTitle();
+};
+
+#endif // _SCH_XMLAXISCONTEXT_HXX_
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 9df601407199..2a19d2949ff9 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -63,7 +63,6 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -78,48 +77,6 @@ using namespace ::SchXMLTools;
namespace
{
-uno::Reference< chart2::XChartTypeTemplate > lcl_getTemplate( const uno::Reference< chart2::XChartDocument > & xDoc )
-{
- uno::Reference< chart2::XChartTypeTemplate > xResult;
- try
- {
- if( !xDoc.is())
- return xResult;
- uno::Reference< lang::XMultiServiceFactory > xChartTypeManager( xDoc->getChartTypeManager(), uno::UNO_QUERY );
- if( !xChartTypeManager.is())
- return xResult;
- uno::Reference< chart2::XDiagram > xDiagram( xDoc->getFirstDiagram());
- if( !xDiagram.is())
- return xResult;
-
- uno::Sequence< ::rtl::OUString > aServiceNames( xChartTypeManager->getAvailableServiceNames());
- const sal_Int32 nLength = aServiceNames.getLength();
-
- for( sal_Int32 i = 0; i < nLength; ++i )
- {
- try
- {
- uno::Reference< chart2::XChartTypeTemplate > xTempl(
- xChartTypeManager->createInstance( aServiceNames[ i ] ), uno::UNO_QUERY_THROW );
-
- if( xTempl->matchesTemplate( xDiagram, sal_True ))
- {
- xResult.set( xTempl );
- break;
- }
- }
- catch( uno::Exception & )
- {
- DBG_ERROR( "Exception during determination of chart type template" );
- }
- }
- }
- catch( uno::Exception & )
- {
- DBG_ERROR( "Exception during import lcl_getTemplate" );
- }
- return xResult;
-}
void lcl_setRoleAtLabeledSequence(
const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq,
@@ -685,10 +642,6 @@ void lcl_ApplyDataFromRectangularRangeToDiagram(
if( !xNewDia.is() || !xDataProvider.is() )
return;
- uno::Reference< chart2::XChartTypeTemplate > xTemplate( lcl_getTemplate( xNewDoc ));
- if(!xTemplate.is())
- return;
-
sal_Bool bFirstCellAsLabel =
(eDataRowSource==chart::ChartDataRowSource_COLUMNS)? bRowHasLabels : bColHasLabels;
sal_Bool bHasCateories =
@@ -754,13 +707,17 @@ void lcl_ApplyDataFromRectangularRangeToDiagram(
uno::Reference< chart2::data::XDataSource > xDataSource(
xDataProvider->createDataSource( aArgs ));
- aArgs.realloc( aArgs.getLength() + 1 );
- aArgs[ aArgs.getLength() - 1 ] = beans::PropertyValue(
+ aArgs.realloc( aArgs.getLength() + 2 );
+ aArgs[ aArgs.getLength() - 2 ] = beans::PropertyValue(
::rtl::OUString::createFromAscii("HasCategories"),
-1, uno::makeAny( bHasCateories ),
beans::PropertyState_DIRECT_VALUE );
+ aArgs[ aArgs.getLength() - 1 ] = beans::PropertyValue(
+ ::rtl::OUString::createFromAscii("UseCategoriesAsX"),
+ -1, uno::makeAny( sal_False ),//categories in ODF files are not to be used as x values (independent from what is offered in our ui)
+ beans::PropertyState_DIRECT_VALUE );
- xTemplate->changeDiagramData( xNewDia, xDataSource, aArgs );
+ xNewDia->setDiagramData( xDataSource, aArgs );
}
void SchXMLChartContext::EndElement()
@@ -810,8 +767,7 @@ void SchXMLChartContext::EndElement()
// cleanup: remove empty chart type groups
lcl_removeEmptyChartTypeGroups( xNewDoc );
- // set stack mode before a potential template detection (in case we have a
- // rectangular range)
+ // set stack mode before a potential chart type detection (in case we have a rectangular range)
uno::Reference< chart::XDiagram > xDiagram( xDoc->getDiagram() );
uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
if( xDiaProp.is())
@@ -890,8 +846,7 @@ void SchXMLChartContext::EndElement()
{
//apply data from rectangular range
- // create datasource from data provider with rectangular range
- // parameters and change the diagram via template mechanism
+ // create datasource from data provider with rectangular range parameters and change the diagram setDiagramData
try
{
if( bOlderThan2_3 && xDiaProp.is() )//for older charts the hidden cells were removed by calc on the fly
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 3b28fb4839bd..cc13eb2de733 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -64,20 +64,24 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
+#include <com/sun/star/chart/XAxis.hpp>
+#include <com/sun/star/chart/XAxisSupplier.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/ChartLegendPosition.hpp>
-#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
-#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
-#include <com/sun/star/chart/XAxisZSupplier.hpp>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/ChartAxisAssign.hpp>
+#include <com/sun/star/chart/ChartAxisType.hpp>
+#include <com/sun/star/chart/TimeIncrement.hpp>
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
#include <com/sun/star/chart/X3DDisplay.hpp>
#include <com/sun/star/chart/XStatisticDisplay.hpp>
#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
@@ -201,6 +205,13 @@ public:
void exportAxes( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > & xDiagram,
const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram,
sal_Bool bExportContent );
+ void exportAxis( enum XMLTokenEnum eDimension, enum XMLTokenEnum eAxisName,
+ const Reference< beans::XPropertySet > xAxisProps, const Reference< chart2::XAxis >& xChart2Axis,
+ const OUString& rCategoriesRanges,
+ bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid, bool bExportContent );
+ void exportGrid( const Reference< beans::XPropertySet > xGridProperties, bool bMajor, bool bExportContent );
+ void exportDateScale( const Reference< beans::XPropertySet > xAxisProps );
+ void exportAxisTitle( const Reference< beans::XPropertySet > xTitleProps, bool bExportContent );
void exportSeries(
const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram,
@@ -694,6 +705,7 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque
}
typedef vector< OUString > tStringVector;
+typedef vector< double > tDoubleVector;
typedef vector< vector< OUString > > t2DStringVector;
typedef vector< vector< double > > t2DNumberContainer;
@@ -708,8 +720,8 @@ struct lcl_TableData
tStringVector aRowDescriptions;
tStringVector aRowDescriptions_Ranges;
- Sequence< Sequence< OUString > > aComplexColumnDescriptions;//outer index is columns - inner index is level
- Sequence< Sequence< OUString > > aComplexRowDescriptions;//outer index is rows - inner index is level
+ Sequence< Sequence< uno::Any > > aComplexColumnDescriptions;//outer index is columns - inner index is level
+ Sequence< Sequence< uno::Any > > aComplexRowDescriptions;//outer index is rows - inner index is level
::std::vector< sal_Int32 > aHiddenColumns;
};
@@ -776,7 +788,7 @@ void lcl_ReorderInternalSequencesAccordingToTheirRangeName(
lcl_TableData lcl_getDataForLocalTable(
const SchXMLExportHelper_Impl::tDataSequenceCont & aSequencesToExport,
- const Reference< chart::XComplexDescriptionAccess >& xComplexDescriptionAccess,
+ const Reference< chart2::XAnyDescriptionAccess >& xAnyDescriptionAccess,
const OUString& rCategoriesRange,
bool bSeriesFromColumns,
const Reference< chart2::data::XRangeXMLConversion > & xRangeConversion )
@@ -786,15 +798,15 @@ lcl_TableData lcl_getDataForLocalTable(
try
{
Sequence< OUString > aSimpleCategories;
- if( xComplexDescriptionAccess.is() )
+ if( xAnyDescriptionAccess.is() )
{
if( bSeriesFromColumns )
- aSimpleCategories = xComplexDescriptionAccess->getRowDescriptions();
+ aSimpleCategories = xAnyDescriptionAccess->getRowDescriptions();
else
- aSimpleCategories = xComplexDescriptionAccess->getColumnDescriptions();
+ aSimpleCategories = xAnyDescriptionAccess->getColumnDescriptions();
- aResult.aComplexColumnDescriptions = xComplexDescriptionAccess->getComplexColumnDescriptions();
- aResult.aComplexRowDescriptions = xComplexDescriptionAccess->getComplexRowDescriptions();
+ aResult.aComplexColumnDescriptions = xAnyDescriptionAccess->getAnyColumnDescriptions();
+ aResult.aComplexRowDescriptions = xAnyDescriptionAccess->getAnyRowDescriptions();
}
SchXMLExportHelper_Impl::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size();
@@ -1580,7 +1592,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >&
delete pElChart;
}
-void lcl_exportComplexLabel( const Sequence< OUString >& rComplexLabel, SvXMLExport& rExport )
+void lcl_exportComplexLabel( const Sequence< uno::Any >& rComplexLabel, SvXMLExport& rExport )
{
sal_Int32 nLength = rComplexLabel.getLength();
if( nLength<=1 )
@@ -1589,7 +1601,12 @@ void lcl_exportComplexLabel( const Sequence< OUString >& rComplexLabel, SvXMLExp
for(sal_Int32 nN=0; nN<nLength; nN++)
{
SvXMLElementExport aListItem( rExport, XML_NAMESPACE_TEXT, XML_LIST_ITEM, sal_True, sal_True );
- SchXMLTools::exportText( rExport, rComplexLabel[nN], false /*bConvertTabsLFs*/ );
+ OUString aString;
+ if( !(rComplexLabel[nN]>>=aString) )
+ {
+ //todo?
+ }
+ SchXMLTools::exportText( rExport, aString, false /*bConvertTabsLFs*/ );
}
}
@@ -1624,17 +1641,17 @@ void SchXMLExportHelper_Impl::exportTable()
xRangeConversion.set( xNewDoc->getDataProvider(), uno::UNO_QUERY );
}
- Reference< chart::XComplexDescriptionAccess > xComplexDescriptionAccess;
+ Reference< chart2::XAnyDescriptionAccess > xAnyDescriptionAccess;
{
Reference< chart::XChartDocument > xChartDoc( mrExport.GetModel(), uno::UNO_QUERY );
if( xChartDoc.is() )
- xComplexDescriptionAccess = Reference< chart::XComplexDescriptionAccess >( xChartDoc->getData(), uno::UNO_QUERY );
+ xAnyDescriptionAccess = Reference< chart2::XAnyDescriptionAccess >( xChartDoc->getData(), uno::UNO_QUERY );
}
if( bHasOwnData )
lcl_ReorderInternalSequencesAccordingToTheirRangeName( m_aDataSequencesToExport );
lcl_TableData aData( lcl_getDataForLocalTable( m_aDataSequencesToExport
- , xComplexDescriptionAccess, maCategoriesRange
+ , xAnyDescriptionAccess, maCategoriesRange
, mbRowSourceColumns, xRangeConversion ));
tStringVector::const_iterator aDataRangeIter( aData.aDataRangeRepresentations.begin());
@@ -1695,17 +1712,40 @@ void SchXMLExportHelper_Impl::exportTable()
//export column descriptions
tStringVector::const_iterator aColumnDescriptions_RangeIter( aData.aColumnDescriptions_Ranges.begin());
const tStringVector::const_iterator aColumnDescriptions_RangeEnd( aData.aColumnDescriptions_Ranges.end());
- const Sequence< Sequence< OUString > >& rComplexColumnDescriptions = aData.aComplexColumnDescriptions;
+ const Sequence< Sequence< uno::Any > >& rComplexColumnDescriptions = aData.aComplexColumnDescriptions;
sal_Int32 nComplexCount = rComplexColumnDescriptions.getLength();
sal_Int32 nC = 0;
- for( tStringVector::const_iterator aIt( aData.aColumnDescriptions.begin());
- aIt != aData.aColumnDescriptions.end(); ++aIt )
+ for( tStringVector::const_iterator aIt( aData.aColumnDescriptions.begin())
+ ; (aIt != aData.aColumnDescriptions.end())
+ ; aIt++, nC++ )
{
- mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
+ bool bExportString = true;
+ if( nC < nComplexCount )
+ {
+ const Sequence< uno::Any >& rComplexLabel = rComplexColumnDescriptions[nC];
+ if( rComplexLabel.getLength()>0 )
+ {
+ double fValue=0.0;
+ if( rComplexLabel[0] >>=fValue )
+ {
+ bExportString = false;
+
+ SvXMLUnitConverter::convertDouble( msStringBuffer, fValue );
+ msString = msStringBuffer.makeStringAndClear();
+ mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT );
+ mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString );
+ }
+ }
+ }
+ if( bExportString )
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
+ }
+
SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
exportText( *aIt );
if( nC < nComplexCount )
- lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport );
+ lcl_exportComplexLabel( rComplexColumnDescriptions[nC], mrExport );
if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd )
{
// remind the original range to allow a correct re-association when copying via clipboard
@@ -1721,25 +1761,47 @@ void SchXMLExportHelper_Impl::exportTable()
{
SvXMLElementExport aRows( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROWS, sal_True, sal_True );
tStringVector::const_iterator aRowDescriptionsIter( aData.aRowDescriptions.begin());
- const Sequence< Sequence< OUString > >& rComplexRowDescriptions = aData.aComplexRowDescriptions;
+ const Sequence< Sequence< uno::Any > >& rComplexRowDescriptions = aData.aComplexRowDescriptions;
sal_Int32 nComplexCount = rComplexRowDescriptions.getLength();
sal_Int32 nC = 0;
- for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin());
- aRowIt != aData.aDataInRows.end(); ++aRowIt )
+ for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin())
+ ; aRowIt != aData.aDataInRows.end()
+ ; aRowIt++, nC++, aRowDescriptionsIter++ )
{
SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );
//export row descriptions
{
- mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
+ bool bExportString = true;
+ if( nC < nComplexCount )
+ {
+ const Sequence< uno::Any >& rComplexLabel = rComplexRowDescriptions[nC];
+ if( rComplexLabel.getLength()>0 )
+ {
+ double fValue=0.0;
+ if( rComplexLabel[0] >>=fValue )
+ {
+ bExportString = false;
+
+ SvXMLUnitConverter::convertDouble( msStringBuffer, fValue );
+ msString = msStringBuffer.makeStringAndClear();
+ mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT );
+ mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString );
+ }
+ }
+ }
+ if( bExportString )
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
+ }
+
SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
if( aRowDescriptionsIter != aData.aRowDescriptions.end())
{
exportText( *aRowDescriptionsIter );
- ++aRowDescriptionsIter;
if( nC < nComplexCount )
- lcl_exportComplexLabel( rComplexRowDescriptions[nC++], mrExport );
+ lcl_exportComplexLabel( rComplexRowDescriptions[nC], mrExport );
if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd )
{
// remind the original range to allow a correct re-association when copying via clipboard
@@ -1775,6 +1837,57 @@ void SchXMLExportHelper_Impl::exportTable()
OSL_ASSERT( bHasOwnData || (aRowDescriptions_RangeIter == aRowDescriptions_RangeEnd) );
}
+namespace
+{
+
+Reference< chart2::XCoordinateSystem > lcl_getCooSys( const Reference< chart2::XDiagram > & xNewDiagram )
+{
+ Reference< chart2::XCoordinateSystem > xCooSys;
+ Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDiagram, uno::UNO_QUERY );
+ if(xCooSysCnt.is())
+ {
+ Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() );
+ if(aCooSysSeq.getLength()>0)
+ xCooSys = aCooSysSeq[0];
+ }
+ return xCooSys;
+}
+
+Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem >& xCooSys,
+ enum XMLTokenEnum eDimension, bool bPrimary=true )
+{
+ Reference< chart2::XAxis > xNewAxis;
+ try
+ {
+ if( xCooSys.is() )
+ {
+ sal_Int32 nDimensionIndex=0;
+ switch( eDimension )
+ {
+ case XML_X:
+ nDimensionIndex=0;
+ break;
+ case XML_Y:
+ nDimensionIndex=1;
+ break;
+ case XML_Z:
+ nDimensionIndex=2;
+ break;
+ default:
+ break;
+ }
+
+ xNewAxis = xCooSys->getAxisByDimension( nDimensionIndex, bPrimary ? 0 : 1 );
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ }
+ return xNewAxis;
+}
+
+}
+
void SchXMLExportHelper_Impl::exportPlotArea(
Reference< chart::XDiagram > xDiagram,
Reference< chart2::XDiagram > xNewDiagram,
@@ -1790,8 +1903,6 @@ void SchXMLExportHelper_Impl::exportPlotArea(
Reference< beans::XPropertySet > xPropSet;
std::vector< XMLPropertyState > aPropertyStates;
- OUString aASName;
- sal_Bool bHasTwoYAxes = sal_False;
sal_Bool bIs3DChart = sal_False;
drawing::HomogenMatrix aTransMatrix;
@@ -1899,16 +2010,6 @@ void SchXMLExportHelper_Impl::exportPlotArea(
if( xPropSet.is())
{
Any aAny;
- try
- {
- aAny = xPropSet->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "HasSecondaryYAxis" )));
- aAny >>= bHasTwoYAxes;
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Property HasSecondaryYAxis not found in Diagram" );
- }
// 3d attributes
try
@@ -1959,7 +2060,8 @@ void SchXMLExportHelper_Impl::exportPlotArea(
// series elements
// ---------------
- exportSeries( xNewDiagram, rPageSize, bExportContent, bHasTwoYAxes );
+ Reference< chart2::XAxis > xSecondYAxis = lcl_getAxis( lcl_getCooSys( xNewDiagram ), XML_Y, false );
+ exportSeries( xNewDiagram, rPageSize, bExportContent, xSecondYAxis.is() );
// stock-chart elements
OUString sChartType ( xDiagram->getDiagramType());
@@ -2121,6 +2223,222 @@ void SchXMLExportHelper_Impl::exportCoordinateRegion( const uno::Reference< char
SvXMLElementExport aCoordinateRegion( mrExport, XML_NAMESPACE_CHART_EXT, XML_COORDINATE_REGION, sal_True, sal_True );//#i100778# todo: change to chart namespace in future - dependent on fileformat
}
+namespace
+{
+ XMLTokenEnum lcl_getTimeUnitToken( sal_Int32 nTimeUnit )
+ {
+ XMLTokenEnum eToken = XML_DAYS;
+ switch( nTimeUnit )
+ {
+ case ::com::sun::star::chart::TimeUnit::YEAR:
+ eToken = XML_YEARS;
+ break;
+ case ::com::sun::star::chart::TimeUnit::MONTH:
+ eToken = XML_MONTHS;
+ break;
+ default://days
+ break;
+ }
+ return eToken;
+ }
+}
+
+void SchXMLExportHelper_Impl::exportDateScale( const Reference< beans::XPropertySet > xAxisProps )
+{
+ if( !xAxisProps.is() )
+ return;
+
+ chart::TimeIncrement aIncrement;
+ if( (xAxisProps->getPropertyValue( OUString::createFromAscii( "TimeIncrement" )) >>= aIncrement) )
+ {
+ sal_Int32 nTimeResolution = ::com::sun::star::chart::TimeUnit::DAY;
+ if( aIncrement.TimeResolution >>= nTimeResolution )
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_BASE_TIME_UNIT, lcl_getTimeUnitToken( nTimeResolution ) );
+
+ OUStringBuffer aValue;
+ chart::TimeInterval aInterval;
+ if( aIncrement.MajorTimeInterval >>= aInterval )
+ {
+ SvXMLUnitConverter::convertNumber( aValue, aInterval.Number );
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_VALUE, aValue.makeStringAndClear() );
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MAJOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) );
+ }
+ if( aIncrement.MinorTimeInterval >>= aInterval )
+ {
+ SvXMLUnitConverter::convertNumber( aValue, aInterval.Number );
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_VALUE, aValue.makeStringAndClear() );
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_MINOR_INTERVAL_UNIT, lcl_getTimeUnitToken( aInterval.TimeUnit ) );
+ }
+
+ SvXMLElementExport aDateScale( mrExport, XML_NAMESPACE_CHART_EXT, XML_DATE_SCALE, sal_True, sal_True );//#i25706#todo: change namespace for next ODF version
+ }
+}
+
+void SchXMLExportHelper_Impl::exportAxisTitle( const Reference< beans::XPropertySet > xTitleProps, bool bExportContent )
+{
+ if( !xTitleProps.is() )
+ return;
+ std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xTitleProps );
+ if( bExportContent )
+ {
+ OUString aText;
+ Any aAny( xTitleProps->getPropertyValue(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
+ aAny >>= aText;
+
+ Reference< drawing::XShape > xShape( xTitleProps, uno::UNO_QUERY );
+ if( xShape.is())
+ addPosition( xShape );
+
+ AddAutoStyleAttribute( aPropertyStates );
+ SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
+
+ // paragraph containing title
+ exportText( aText );
+ }
+ else
+ {
+ CollectAutoStyle( aPropertyStates );
+ }
+ aPropertyStates.clear();
+}
+
+void SchXMLExportHelper_Impl::exportGrid( const Reference< beans::XPropertySet > xGridProperties, bool bMajor, bool bExportContent )
+{
+ if( !xGridProperties.is() )
+ return;
+ std::vector< XMLPropertyState > aPropertyStates = mxExpPropMapper->Filter( xGridProperties );
+ if( bExportContent )
+ {
+ AddAutoStyleAttribute( aPropertyStates );
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, bMajor ? XML_MAJOR : XML_MINOR );
+ SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
+ }
+ else
+ {
+ CollectAutoStyle( aPropertyStates );
+ }
+ aPropertyStates.clear();
+}
+
+namespace
+{
+
+//returns true if a date scale needs to be exported
+bool lcl_exportAxisType( const Reference< chart2::XAxis > xChart2Axis, SvXMLExport& rExport)
+{
+ bool bExportDateScale = false;
+ if( !xChart2Axis.is() )
+ return bExportDateScale;
+
+ const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
+ if( nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST ) //#i25706#todo: change version for next ODF version
+ return bExportDateScale;
+
+ chart2::ScaleData aScale( xChart2Axis->getScaleData() );
+ //#i25706#todo: change namespace for next ODF version
+ sal_uInt16 nNameSpace = XML_NAMESPACE_CHART_EXT;
+
+ switch(aScale.AxisType)
+ {
+ case chart2::AxisType::CATEGORY:
+ if( aScale.AutoDateAxis )
+ {
+ rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_AUTO );
+ bExportDateScale = true;
+ }
+ else
+ rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_TEXT );
+ break;
+ case chart2::AxisType::DATE:
+ rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_DATE );
+ bExportDateScale = true;
+ break;
+ default: //AUTOMATIC
+ rExport.AddAttribute( nNameSpace, XML_AXIS_TYPE, XML_AUTO );
+ break;
+ }
+
+ return bExportDateScale;
+}
+
+}
+
+void SchXMLExportHelper_Impl::exportAxis(
+ enum XMLTokenEnum eDimension,
+ enum XMLTokenEnum eAxisName,
+ const Reference< beans::XPropertySet > xAxisProps,
+ const Reference< chart2::XAxis >& xChart2Axis,
+ const OUString& rCategoriesRange,
+ bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid,
+ bool bExportContent )
+{
+ static const OUString sNumFormat( OUString::createFromAscii( "NumberFormat" ));
+ std::vector< XMLPropertyState > aPropertyStates;
+ SvXMLElementExport* pAxis = NULL;
+
+ // get property states for autostyles
+ if( xAxisProps.is() && mxExpPropMapper.is() )
+ {
+ lcl_exportNumberFormat( sNumFormat, xAxisProps, mrExport );
+ aPropertyStates = mxExpPropMapper->Filter( xAxisProps );
+ }
+
+ bool bExportDateScale = false;
+ if( bExportContent )
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, eDimension );
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, eAxisName );
+ AddAutoStyleAttribute( aPropertyStates ); // write style name
+ if( rCategoriesRange.getLength() )
+ bExportDateScale = lcl_exportAxisType( xChart2Axis, mrExport );
+
+ // open axis element
+ pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
+ }
+ else
+ {
+ CollectAutoStyle( aPropertyStates );
+ }
+ aPropertyStates.clear();
+
+ //date scale
+ if( bExportDateScale )
+ exportDateScale( xAxisProps );
+
+ Reference< beans::XPropertySet > xTitleProps;
+ Reference< beans::XPropertySet > xMajorGridProps;
+ Reference< beans::XPropertySet > xMinorGridProps;
+ Reference< chart::XAxis > xAxis( xAxisProps, uno::UNO_QUERY );
+ if( xAxis.is() )
+ {
+ xTitleProps = bHasTitle ? xAxis->getAxisTitle() : 0;
+ xMajorGridProps = bHasMajorGrid ? xAxis->getMajorGrid() : 0;
+ xMinorGridProps = bHasMinorGrid ? xAxis->getMinorGrid() : 0;
+ }
+
+ // axis-title
+ exportAxisTitle( xTitleProps , bExportContent );
+
+ // categories if we have a categories chart
+ if( bExportContent && rCategoriesRange.getLength() )
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, rCategoriesRange );
+ SvXMLElementExport aCategories( mrExport, XML_NAMESPACE_CHART, XML_CATEGORIES, sal_True, sal_True );
+ }
+
+ // grid
+ exportGrid( xMajorGridProps, true, bExportContent );
+ exportGrid( xMinorGridProps, false, bExportContent );
+
+ if( pAxis )
+ {
+ //close axis element
+ delete pAxis;
+ pAxis = NULL;
+ }
+}
+
void SchXMLExportHelper_Impl::exportAxes(
const Reference< chart::XDiagram > & xDiagram,
const Reference< chart2::XDiagram > & xNewDiagram,
@@ -2130,13 +2448,6 @@ void SchXMLExportHelper_Impl::exportAxes(
if( ! xDiagram.is())
return;
- // variables for autostyles
- const OUString sNumFormat( OUString::createFromAscii( "NumberFormat" ));
- Reference< beans::XPropertySet > xPropSet;
- std::vector< XMLPropertyState > aPropertyStates;
-
- OUString aASName;
-
// get some properties from document first
sal_Bool bHasXAxis = sal_False,
bHasYAxis = sal_False,
@@ -2154,46 +2465,20 @@ void SchXMLExportHelper_Impl::exportAxes(
bHasYAxisMinorGrid = sal_False,
bHasZAxisMajorGrid = sal_False,
bHasZAxisMinorGrid = sal_False;
- sal_Bool bIs3DChart = sal_False;
// get multiple properties using XMultiPropertySet
MultiPropertySetHandler aDiagramProperties (xDiagram);
- // Check for supported services and then the properties provided by this service.
- Reference<lang::XServiceInfo> xServiceInfo (xDiagram, uno::UNO_QUERY);
- if (xServiceInfo.is())
- {
- if (xServiceInfo->supportsService(
- OUString::createFromAscii ("com.sun.star.chart.ChartAxisXSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")), bHasXAxis);
- }
- if (xServiceInfo->supportsService(
- OUString::createFromAscii ("com.sun.star.chart.ChartAxisYSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxis")), bHasYAxis);
- }
- if (xServiceInfo->supportsService(
- OUString::createFromAscii ("com.sun.star.chart.ChartAxisZSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxis")), bHasZAxis);
- }
- if (xServiceInfo->supportsService(
- OUString::createFromAscii ("com.sun.star.chart.ChartTwoAxisXSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")), bHasSecondaryXAxis);
- }
- if (xServiceInfo->supportsService(
- OUString::createFromAscii ("com.sun.star.chart.ChartTwoAxisYSupplier")))
- {
- aDiagramProperties.Add (
- OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryYAxis")), bHasSecondaryYAxis);
- }
- }
+ aDiagramProperties.Add (
+ OUString(RTL_CONSTASCII_USTRINGPARAM("HasXAxis")), bHasXAxis);
+ aDiagramProperties.Add (
+ OUString(RTL_CONSTASCII_USTRINGPARAM("HasYAxis")), bHasYAxis);
+ aDiagramProperties.Add (
+ OUString(RTL_CONSTASCII_USTRINGPARAM("HasZAxis")), bHasZAxis);
+ aDiagramProperties.Add (
+ OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryXAxis")), bHasSecondaryXAxis);
+ aDiagramProperties.Add (
+ OUString(RTL_CONSTASCII_USTRINGPARAM("HasSecondaryYAxis")), bHasSecondaryYAxis);
aDiagramProperties.Add (
OUString (RTL_CONSTASCII_USTRINGPARAM ("HasXAxisTitle")), bHasXAxisTitle);
@@ -2220,506 +2505,139 @@ void SchXMLExportHelper_Impl::exportAxes(
aDiagramProperties.Add (
OUString (RTL_CONSTASCII_USTRINGPARAM ("HasZAxisHelpGrid")), bHasZAxisMinorGrid);
- aDiagramProperties.Add(
- OUString (RTL_CONSTASCII_USTRINGPARAM ("Dim3D")), bIs3DChart);
-
if ( ! aDiagramProperties.GetProperties ())
{
DBG_WARNING ("Required properties not found in Chart diagram");
}
- SvXMLElementExport* pAxis = NULL;
+ Reference< chart2::XCoordinateSystem > xCooSys( lcl_getCooSys(xNewDiagram) );
+
+ // write an axis element also if the axis itself is not visible, but a grid or a title
+
+ OUString aCategoriesRange;
+ Reference< chart::XAxisSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
// x axis
// -------
-
- // write axis element also if the axis itself is not visible, but a grid or
- // title
- Reference< chart::XAxisXSupplier > xAxisXSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisXSupp.is())
+ Reference< ::com::sun::star::chart2::XAxis > xNewAxis = lcl_getAxis( xCooSys, XML_X );
+ if( xNewAxis.is() )
{
- bool bHasAxisProperties = false;
- // get property states for autostyles
- if( mxExpPropMapper.is())
+ Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getAxis(0) : 0, uno::UNO_QUERY );
+ if( mbHasCategoryLabels && bExportContent )
{
- xPropSet = xAxisXSupp->getXAxis();
- if( xPropSet.is())
+ Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) );
+ if( xCategories.is() )
{
- bHasAxisProperties = true;
- lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
-
- if( bHasXAxis ||
- bHasXAxisTitle || bHasXAxisMajorGrid || bHasXAxisMinorGrid ||
- mbHasCategoryLabels || bHasAxisProperties )
- {
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_X );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_X );
-
- // write style name
- AddAutoStyleAttribute( aPropertyStates );
-
- // element
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
-
- // axis-title
- if( bHasXAxisTitle )
- {
- Reference< beans::XPropertySet > xTitleProp( xAxisXSupp->getXAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
+ Reference< chart2::data::XDataSequence > xValues( xCategories->getValues() );
+ if( xValues.is() )
{
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- OUString aText;
- Any aAny( xTitleProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- // paragraph containing title
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
+ Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY );
+ maCategoriesRange = xValues->getSourceRangeRepresentation();
+ aCategoriesRange = lcl_ConvertRange( maCategoriesRange, xNewDoc );
}
}
-
- // categories if we have a categories chart
- if( bExportContent &&
- mbHasCategoryLabels )
- {
- OUString aCategoriesRange;
- // fill msString with cell-range-address of categories
- // export own table references
- if( xNewDiagram.is())
- {
- Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) );
- if( xCategories.is() )
- {
- Reference< chart2::data::XDataSequence > xValues( xCategories->getValues() );
- if( xValues.is())
- {
- Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY );
- maCategoriesRange = xValues->getSourceRangeRepresentation();
- aCategoriesRange = lcl_ConvertRange( maCategoriesRange, xNewDoc );
- }
- }
- }
-
- if( aCategoriesRange.getLength())
- mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, aCategoriesRange );
- SvXMLElementExport aCategories( mrExport, XML_NAMESPACE_CHART, XML_CATEGORIES, sal_True, sal_True );
- }
-
- // grid
- Reference< beans::XPropertySet > xMajorGrid( xAxisXSupp->getXMainGrid(), uno::UNO_QUERY );
- if( bHasXAxisMajorGrid && xMajorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMajorGrid );
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- Reference< beans::XPropertySet > xMinorGrid( xAxisXSupp->getXHelpGrid(), uno::UNO_QUERY );
- if( bHasXAxisMinorGrid && xMinorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMinorGrid );
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
}
+ exportAxis( XML_X, XML_PRIMARY_X, xAxisProps, xNewAxis, aCategoriesRange, bHasXAxisTitle, bHasXAxisMajorGrid, bHasXAxisMinorGrid, bExportContent );
+ aCategoriesRange = OUString();
}
// secondary x axis
- if( bHasSecondaryXAxis || bHasSecondaryXAxisTitle )
+ // -------
+ Reference< chart::XSecondAxisTitleSupplier > xSecondTitleSupp( xDiagram, uno::UNO_QUERY );
+ xNewAxis = lcl_getAxis( xCooSys, XML_X, false );
+ if( xNewAxis.is() )
{
- Reference< chart::XTwoAxisXSupplier > xAxisTwoXSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisTwoXSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisTwoXSupp->getSecondaryXAxis();
- lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_X );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_SECONDARY_X );
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
-
- if( bHasSecondaryXAxisTitle )
- {
- Reference< chart::XSecondAxisTitleSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
- Reference< beans::XPropertySet > xTitleProp( xAxisSupp->getSecondXAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- OUString aText;
- Any aAny( xTitleProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- }
-
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
+ Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getSecondaryAxis(0) : 0, uno::UNO_QUERY );
+ exportAxis( XML_X, XML_SECONDARY_X, xAxisProps, xNewAxis, aCategoriesRange, bHasSecondaryXAxisTitle, false, false, bExportContent );
}
// y axis
// -------
-
- // write axis element also if the axis itself is not visible, but a grid or
- // title
- Reference< chart::XAxisYSupplier > xAxisYSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisYSupp.is())
+ xNewAxis = lcl_getAxis( xCooSys, XML_Y );
+ if( xNewAxis.is() )
{
- bool bHasAxisProperties = false;
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisYSupp->getYAxis();
- if( xPropSet.is())
- {
- bHasAxisProperties = true;
- lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- }
-
- if( bHasYAxis ||
- bHasYAxisTitle || bHasYAxisMajorGrid || bHasYAxisMinorGrid || bHasAxisProperties )
- {
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_Y );
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
-
- // axis-title
- if( bHasYAxisTitle )
- {
- Reference< beans::XPropertySet > xTitleProp( xAxisYSupp->getYAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- OUString aText;
- Any aAny( xTitleProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- // paragraph containing title
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- }
-
- // grid
- Reference< beans::XPropertySet > xMajorGrid( xAxisYSupp->getYMainGrid(), uno::UNO_QUERY );
- if( bHasYAxisMajorGrid && xMajorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMajorGrid );
-
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- // minor grid
- Reference< beans::XPropertySet > xMinorGrid( xAxisYSupp->getYHelpGrid(), uno::UNO_QUERY );
- if( bHasYAxisMinorGrid && xMinorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMinorGrid );
-
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
+ Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getAxis(1) : 0, uno::UNO_QUERY );
+ exportAxis( XML_Y, XML_PRIMARY_Y, xAxisProps, xNewAxis, aCategoriesRange, bHasYAxisTitle, bHasYAxisMajorGrid, bHasYAxisMinorGrid, bExportContent );
}
- if( bHasSecondaryYAxis || bHasSecondaryYAxisTitle )
+ // secondary y axis
+ // -------
+ xNewAxis = lcl_getAxis( xCooSys, XML_Y, false );
+ if( xNewAxis.is() )
{
- Reference< chart::XTwoAxisYSupplier > xAxisTwoYSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisTwoYSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisTwoYSupp->getSecondaryYAxis();
- lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_SECONDARY_Y );
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else // autostyles
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- if( bHasSecondaryYAxisTitle )
- {
- Reference< chart::XSecondAxisTitleSupplier > xAxisSupp( xDiagram, uno::UNO_QUERY );
- Reference< beans::XPropertySet > xTitleProp( xAxisSupp->getSecondYAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- OUString aText;
- Any aAny( xTitleProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- }
-
- if( pAxis )
- {
- delete pAxis;
- pAxis = NULL;
- }
- }
+ Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getSecondaryAxis(1) : 0, uno::UNO_QUERY );
+ exportAxis( XML_Y, XML_SECONDARY_Y, xAxisProps, xNewAxis, aCategoriesRange, bHasSecondaryYAxisTitle, false, false, bExportContent );
}
// z axis
// -------
+ xNewAxis = lcl_getAxis( xCooSys, XML_Z );
+ if( xNewAxis.is() )
+ {
+ Reference< beans::XPropertySet > xAxisProps( xAxisSupp.is() ? xAxisSupp->getAxis(2) : 0, uno::UNO_QUERY );
+ exportAxis( XML_Z, XML_PRIMARY_Z, xAxisProps, xNewAxis, aCategoriesRange, bHasZAxisTitle, bHasZAxisMajorGrid, bHasZAxisMinorGrid, bExportContent );
+ }
+}
- if( bHasZAxis &&
- bIs3DChart )
+namespace
+{
+ bool lcl_hasNoValuesButText( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
{
- Reference< chart::XAxisZSupplier > xAxisZSupp( xDiagram, uno::UNO_QUERY );
- if( xAxisZSupp.is())
- {
- // get property states for autostyles
- if( mxExpPropMapper.is())
- {
- xPropSet = xAxisZSupp->getZAxis();
- lcl_exportNumberFormat( sNumFormat, xPropSet, mrExport );
- if( xPropSet.is())
- aPropertyStates = mxExpPropMapper->Filter( xPropSet );
- }
- if( bExportContent )
- {
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Z );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_NAME, XML_PRIMARY_Z );
+ if( !xDataSequence.is() )
+ return false;//have no data
- AddAutoStyleAttribute( aPropertyStates );
- pAxis = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_AXIS, sal_True, sal_True );
- }
- else
+ Sequence< uno::Any > aData;
+ Reference< chart2::data::XNumericalDataSequence > xNumericalDataSequence( xDataSequence, uno::UNO_QUERY );
+ if( xNumericalDataSequence.is() )
+ {
+ Sequence< double > aDoubles( xNumericalDataSequence->getNumericalData() );
+ sal_Int32 nCount = aDoubles.getLength();
+ for( sal_Int32 i = 0; i < nCount; ++i )
{
- CollectAutoStyle( aPropertyStates );
+ if( !::rtl::math::isNan( aDoubles[i] ) )
+ return false;//have double value
}
- aPropertyStates.clear();
-
- // axis-title
- if( bHasZAxisTitle )
+ }
+ else
+ {
+ aData = xDataSequence->getData();
+ double fDouble = 0.0;
+ sal_Int32 nCount = aData.getLength();
+ for( sal_Int32 i = 0; i < nCount; ++i )
{
- Reference< beans::XPropertySet > xTitleProp( xAxisZSupp->getZAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xTitleProp );
- if( bExportContent )
- {
- OUString aText;
- Any aAny( xTitleProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "String" ))));
- aAny >>= aText;
-
- Reference< drawing::XShape > xShape( xTitleProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
-
- AddAutoStyleAttribute( aPropertyStates );
- SvXMLElementExport aTitle( mrExport, XML_NAMESPACE_CHART, XML_TITLE, sal_True, sal_True );
-
- // paragraph containing title
- exportText( aText );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
+ if( (aData[i] >>= fDouble) && !::rtl::math::isNan( fDouble ) )
+ return false;//have double value
}
- // grid
- Reference< beans::XPropertySet > xMajorGrid( xAxisZSupp->getZMainGrid(), uno::UNO_QUERY );
- if( bHasZAxisMajorGrid && xMajorGrid.is())
- {
- aPropertyStates = mxExpPropMapper->Filter( xMajorGrid );
+ }
+ //no values found
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MAJOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
- }
- // minor grid
- Reference< beans::XPropertySet > xMinorGrid( xAxisZSupp->getZHelpGrid(), uno::UNO_QUERY );
- if( bHasZAxisMinorGrid && xMinorGrid.is())
+ Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY );
+ if( xTextualDataSequence.is() )
+ {
+ uno::Sequence< rtl::OUString > aStrings( xTextualDataSequence->getTextualData() );
+ sal_Int32 nCount = aStrings.getLength();
+ for( sal_Int32 i = 0; i < nCount; ++i )
{
- aPropertyStates = mxExpPropMapper->Filter( xMinorGrid );
-
- if( bExportContent )
- {
- AddAutoStyleAttribute( aPropertyStates );
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_CLASS, XML_MINOR );
- SvXMLElementExport aGrid( mrExport, XML_NAMESPACE_CHART, XML_GRID, sal_True, sal_True );
- }
- else
- {
- CollectAutoStyle( aPropertyStates );
- }
- aPropertyStates.clear();
+ if( aStrings[i].getLength() )
+ return true;//have text
}
}
- if( pAxis )
+ else
{
- delete pAxis;
- pAxis = NULL;
+ if( !aData.getLength() )
+ aData = xDataSequence->getData();
+ uno::Any aAny;
+ OUString aString;
+ sal_Int32 nCount = aData.getLength();
+ for( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ if( (aData[i]>>=aString) && aString.getLength() )
+ return true;//have text
+ }
}
+ //no doubles and no texts
+ return false;
}
}
@@ -2964,6 +2882,17 @@ void SchXMLExportHelper_Impl::exportSeries(
if( lcl_exportDomainForThisSequence( xValues, aFirstXDomainRange, mrExport ) )
m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xValues ));
}
+ else if( nSeriesIdx==0 )
+ {
+ //might be that the categories are used as x-values (e.g. for date axis) -> export them accordingly
+ Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xNewDiagram ) );
+ if( xCategories.is() )
+ {
+ Reference< chart2::data::XDataSequence > xValues( xCategories->getValues() );
+ if( !lcl_hasNoValuesButText( xValues ) )
+ lcl_exportDomainForThisSequence( xValues, aFirstXDomainRange, mrExport );
+ }
+ }
}
if( xYValuesForBubbleChart.is() )
m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xYValuesForBubbleChart ));
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 338b9c23a004..72a324fe772b 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -143,11 +143,9 @@ SchXMLImportHelper::SchXMLImportHelper() :
mpChartElemTokenMap( 0 ),
mpPlotAreaElemTokenMap( 0 ),
mpSeriesElemTokenMap( 0 ),
- mpAxisElemTokenMap( 0 ),
mpChartAttrTokenMap( 0 ),
mpPlotAreaAttrTokenMap( 0 ),
- mpAxisAttrTokenMap( 0 ),
mpLegendAttrTokenMap( 0 ),
mpAutoStyleAttrTokenMap( 0 ),
mpCellAttrTokenMap( 0 ),
@@ -169,15 +167,11 @@ SchXMLImportHelper::~SchXMLImportHelper()
delete mpPlotAreaElemTokenMap;
if( mpSeriesElemTokenMap )
delete mpSeriesElemTokenMap;
- if( mpAxisElemTokenMap )
- delete mpAxisElemTokenMap;
if( mpChartAttrTokenMap )
delete mpChartAttrTokenMap;
if( mpPlotAreaAttrTokenMap )
delete mpPlotAreaAttrTokenMap;
- if( mpAxisAttrTokenMap )
- delete mpAxisAttrTokenMap;
if( mpLegendAttrTokenMap )
delete mpLegendAttrTokenMap;
if( mpAutoStyleAttrTokenMap )
@@ -320,24 +314,6 @@ const SvXMLTokenMap& SchXMLImportHelper::GetSeriesElemTokenMap()
return *mpSeriesElemTokenMap;
}
-const SvXMLTokenMap& SchXMLImportHelper::GetAxisElemTokenMap()
-{
- if( ! mpAxisElemTokenMap )
- {
- static __FAR_DATA SvXMLTokenMapEntry aAxisElemTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_TITLE, XML_TOK_AXIS_TITLE },
- { XML_NAMESPACE_CHART, XML_CATEGORIES, XML_TOK_AXIS_CATEGORIES },
- { XML_NAMESPACE_CHART, XML_GRID, XML_TOK_AXIS_GRID },
- XML_TOKEN_MAP_END
-};
-
- mpAxisElemTokenMap = new SvXMLTokenMap( aAxisElemTokenMap );
- } // if( ! mpAxisElemTokenMap )
-
- return *mpAxisElemTokenMap;
-}
-
// ----------------------------------------
const SvXMLTokenMap& SchXMLImportHelper::GetChartAttrTokenMap()
@@ -395,24 +371,6 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaAttrTokenMap()
return *mpPlotAreaAttrTokenMap;
}
-const SvXMLTokenMap& SchXMLImportHelper::GetAxisAttrTokenMap()
-{
- if( ! mpAxisAttrTokenMap )
- {
- static __FAR_DATA SvXMLTokenMapEntry aAxisAttrTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_DIMENSION, XML_TOK_AXIS_DIMENSION },
- { XML_NAMESPACE_CHART, XML_NAME, XML_TOK_AXIS_NAME },
- { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_AXIS_STYLE_NAME },
- XML_TOKEN_MAP_END
-};
-
- mpAxisAttrTokenMap = new SvXMLTokenMap( aAxisAttrTokenMap );
- } // if( ! mpAxisAttrTokenMap )
-
- return *mpAxisAttrTokenMap;
-}
-
const SvXMLTokenMap& SchXMLImportHelper::GetLegendAttrTokenMap()
{
if( ! mpLegendAttrTokenMap )
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index ef1544b4a280..91b99bb1ff2d 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -30,6 +30,7 @@
#include "SchXMLPlotAreaContext.hxx"
#include "SchXMLImport.hxx"
+#include "SchXMLAxisContext.hxx"
#include "SchXMLSeries2Context.hxx"
#include "SchXMLTools.hxx"
#include <tools/debug.hxx>
@@ -39,7 +40,6 @@
#include <comphelper/processfactory.hxx>
#include "xmloff/xmlnmspe.hxx"
-#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlement.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmluconv.hxx>
@@ -51,29 +51,18 @@
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
-#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
-#include <com/sun/star/chart/ChartAxisPosition.hpp>
-#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
-#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
-#include <com/sun/star/chart/XAxisZSupplier.hpp>
-#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/X3DDisplay.hpp>
#include <com/sun/star/chart/XStatisticDisplay.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/drawing/CameraGeometry.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XStringMapping.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
@@ -84,14 +73,6 @@ using namespace ::xmloff::token;
using ::rtl::OUString;
using com::sun::star::uno::Reference;
-static __FAR_DATA SvXMLEnumMapEntry aXMLAxisClassMap[] =
-{
- { XML_X, SCH_XML_AXIS_X },
- { XML_Y, SCH_XML_AXIS_Y },
- { XML_Z, SCH_XML_AXIS_Z },
- { XML_TOKEN_INVALID, 0 }
-};
-
namespace
{
@@ -115,19 +96,6 @@ OUString lcl_ConvertRange( const ::rtl::OUString & rRange, const uno::Reference<
return aResult;
}
-Reference< chart2::XAxis > lcl_getAxis( const Reference< chart2::XCoordinateSystem > xCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
-{
- Reference< chart2::XAxis > xAxis;
- try
- {
- xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex );
- }
- catch( uno::Exception & )
- {
- }
- return xAxis;
-}
-
} // anonymous namespace
SchXML3DSceneAttributesHelper::SchXML3DSceneAttributesHelper( SvXMLImport& rImporter )
@@ -239,47 +207,33 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
{
try
{
- if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisXSupplier" )))
- {
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasXAxis" ), aFalseBool );
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasXAxisGrid" ), aFalseBool );
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasXAxisDescription" ), aFalseBool );
- }
- if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTwoAxisXSupplier" )))
- {
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aFalseBool );
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasSecondaryXAxisDescription" ), aFalseBool );
- }
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasXAxis" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasXAxisGrid" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasXAxisDescription" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasSecondaryXAxisDescription" ), aFalseBool );
+
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasYAxis" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasYAxisGrid" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasYAxisDescription" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasSecondaryYAxisDescription" ), aFalseBool );
+
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasZAxis" ), aFalseBool );
+ xProp->setPropertyValue(
+ rtl::OUString::createFromAscii( "HasZAxisDescription" ), aFalseBool );
- if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisYSupplier" )))
- {
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasYAxis" ), aFalseBool );
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasYAxisGrid" ), aFalseBool );
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasYAxisDescription" ), aFalseBool );
- }
- if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTwoAxisYSupplier" )))
- {
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aFalseBool );
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasSecondaryYAxisDescription" ), aFalseBool );
- }
-
- if( xInfo->supportsService( rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxisZSupplier" )))
- {
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasZAxis" ), aFalseBool );
- xProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasZAxisDescription" ), aFalseBool );
- }
uno::Any aAny;
chart::ChartDataRowSource eSource = chart::ChartDataRowSource_COLUMNS;
aAny <<= eSource;
@@ -623,7 +577,7 @@ void SchXMLPlotAreaContext::EndElement()
::std::vector< SchXMLAxis >::const_iterator aIt(
::std::find_if( maAxes.begin(), maAxes.end(), lcl_AxisHasCategories()));
if( aIt != maAxes.end())
- nDimension = static_cast< sal_Int32 >( (*aIt).eClass );
+ nDimension = static_cast< sal_Int32 >( (*aIt).eDimension );
SchXMLTools::CreateCategories(
xDataProvider, mxNewDoc, mrCategoriesAddress,
0 /* nCooSysIndex */,
@@ -708,875 +662,7 @@ void SchXMLPlotAreaContext::EndElement()
}
}
- CorrectAxisPositions();
-}
-
-void SchXMLPlotAreaContext::CorrectAxisPositions()
-{
- ::rtl::OUString aODFVersionOfFile( GetImport().GetODFVersion() );
-
- if( ( !aODFVersionOfFile.getLength() || aODFVersionOfFile.equalsAscii("1.0")
- || aODFVersionOfFile.equalsAscii("1.1")
- || ( aODFVersionOfFile.equalsAscii("1.2") && !m_bAxisPositionAttributeImported ) ) )
- {
- uno::Reference< chart2::XChartDocument > xNewDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
-
- try
- {
- Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDoc->getFirstDiagram(), uno::UNO_QUERY_THROW );
- uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
- if( aCooSysSeq.getLength() )
- {
- Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] );
- if( xCooSys.is() )
- {
- Reference< chart2::XAxis > xMainXAxis = lcl_getAxis( xCooSys, 0, 0 );
- Reference< chart2::XAxis > xMainYAxis = lcl_getAxis( xCooSys, 1, 0 );
- //Reference< chart2::XAxis > xMajorZAxis = lcl_getAxis( xCooSys, 2, 0 );
- Reference< chart2::XAxis > xSecondaryXAxis = lcl_getAxis( xCooSys, 0, 1 );
- Reference< chart2::XAxis > xSecondaryYAxis = lcl_getAxis( xCooSys, 1, 1 );
-
- uno::Reference< beans::XPropertySet > xMainXAxisProp( xMainXAxis, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xMainYAxisProp( xMainYAxis, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xSecondaryXAxisProp( xSecondaryXAxis, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xSecondaryYAxisProp( xSecondaryYAxis, uno::UNO_QUERY );
-
- if( xMainXAxisProp.is() && xMainYAxisProp.is() )
- {
- chart2::ScaleData aMainXScale = xMainXAxis->getScaleData();
- if( 0 == maChartTypeServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ScatterChartType" ) ) )
- {
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) );
- double fCrossoverValue = 0.0;
- aMainXScale.Origin >>= fCrossoverValue;
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverValue")
- , uno::makeAny( fCrossoverValue ) );
-
- if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE )
- {
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) );
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
- if( xSecondaryYAxisProp.is() )
- xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
- }
- else
- {
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) );
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
- if( xSecondaryYAxisProp.is() )
- xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
- }
- }
- else
- {
- if( aMainXScale.Orientation == chart2::AxisOrientation_REVERSE )
- {
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
- if( xSecondaryYAxisProp.is() )
- xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
- }
- else
- {
- xMainYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
- if( xSecondaryYAxisProp.is() )
- xSecondaryYAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
- }
- }
-
- chart2::ScaleData aMainYScale = xMainYAxis->getScaleData();
- xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_VALUE) );
- double fCrossoverValue = 0.0;
- aMainYScale.Origin >>= fCrossoverValue;
- xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverValue")
- , uno::makeAny( fCrossoverValue ) );
-
- if( aMainYScale.Orientation == chart2::AxisOrientation_REVERSE )
- {
- xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END) );
- xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
- if( xSecondaryXAxisProp.is() )
- xSecondaryXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_START) );
- }
- else
- {
- xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LabelPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START) );
- xMainXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("MarkPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS) );
- if( xSecondaryXAxisProp.is() )
- xSecondaryXAxisProp->setPropertyValue( rtl::OUString::createFromAscii("CrossoverPosition")
- , uno::makeAny( ::com::sun::star::chart::ChartAxisPosition_END) );
- }
- }
- }
- }
- }
- catch( uno::Exception & )
- {
- }
- }
-}
-
-// ========================================
-
-SchXMLAxisContext::SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const rtl::OUString& rLocalName,
- uno::Reference< chart::XDiagram > xDiagram,
- std::vector< SchXMLAxis >& aAxes,
- ::rtl::OUString & rCategoriesAddress,
- bool bAddMissingXAxisForNetCharts,
- bool bAdaptWrongPercentScaleValues,
- bool bAdaptXAxisOrientationForOld2DBarCharts,
- bool& rbAxisPositionAttributeImported ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper ),
- mxDiagram( xDiagram ),
- maAxes( aAxes ),
- mrCategoriesAddress( rCategoriesAddress ),
- mbAddMissingXAxisForNetCharts( bAddMissingXAxisForNetCharts ),
- mbAdaptWrongPercentScaleValues( bAdaptWrongPercentScaleValues ),
- mbAdaptXAxisOrientationForOld2DBarCharts( bAdaptXAxisOrientationForOld2DBarCharts ),
- m_rbAxisPositionAttributeImported( rbAxisPositionAttributeImported )
-{
-}
-
-SchXMLAxisContext::~SchXMLAxisContext()
-{}
-
-/* returns a shape for the current axis's title. The property
- "Has...AxisTitle" is set to "True" to get the shape
- */
-uno::Reference< drawing::XShape > SchXMLAxisContext::getTitleShape()
-{
- uno::Reference< drawing::XShape > xResult;
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- uno::Reference< beans::XPropertySet > xDiaProp( mxDiagram, uno::UNO_QUERY );
-
- switch( maCurrentAxis.eClass )
- {
- case SCH_XML_AXIS_X:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasXAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getXAxisTitle(), uno::UNO_QUERY );
- }
- }
- else
- {
- uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() )
- {
- if( xDiaProp.is() )
- xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasSecondaryXAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getSecondXAxisTitle(), uno::UNO_QUERY );
- }
- }
- break;
- case SCH_XML_AXIS_Y:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasYAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getYAxisTitle(), uno::UNO_QUERY );
- }
- }
- else
- {
- uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() )
- {
- if( xDiaProp.is() )
- xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasSecondaryYAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getSecondYAxisTitle(), uno::UNO_QUERY );
- }
- }
- break;
- case SCH_XML_AXIS_Z:
- {
- uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( rtl::OUString::createFromAscii( "HasZAxisTitle" ), aTrueBool );
- xResult = uno::Reference< drawing::XShape >( xSuppl->getZAxisTitle(), uno::UNO_QUERY );
- }
- break;
- }
- case SCH_XML_AXIS_UNDEF:
- DBG_ERROR( "Invalid axis" );
- break;
- }
-
- return xResult;
-}
-
-void SchXMLAxisContext::CreateGrid( ::rtl::OUString sAutoStyleName,
- sal_Bool bIsMajor )
-{
- uno::Reference< chart::XDiagram > xDia = mrImportHelper.GetChartDocument()->getDiagram();
- uno::Reference< beans::XPropertySet > xGridProp;
- ::rtl::OUString sPropertyName;
- DBG_ASSERT( xDia.is(), "diagram object is invalid!" );
-
- uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY );
- uno::Any aTrueBool( uno::makeAny( true ));
-
- switch( maCurrentAxis.eClass )
- {
- case SCH_XML_AXIS_X:
- {
- uno::Reference< chart::XAxisXSupplier > xSuppl( xDia, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( bIsMajor )
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasXAxisGrid"), aTrueBool );
- xGridProp = xSuppl->getXMainGrid();
- }
- else
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasXAxisHelpGrid"), aTrueBool );
- xGridProp = xSuppl->getXHelpGrid();
- }
- }
- }
- break;
- case SCH_XML_AXIS_Y:
- {
- uno::Reference< chart::XAxisYSupplier > xSuppl( xDia, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( bIsMajor )
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasYAxisGrid"), aTrueBool );
- xGridProp = xSuppl->getYMainGrid();
- }
- else
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasYAxisHelpGrid"), aTrueBool );
- xGridProp = xSuppl->getYHelpGrid();
- }
- }
- }
- break;
- case SCH_XML_AXIS_Z:
- {
- uno::Reference< chart::XAxisZSupplier > xSuppl( xDia, uno::UNO_QUERY );
- if( xSuppl.is())
- {
- if( bIsMajor )
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasZAxisGrid"), aTrueBool );
- xGridProp = xSuppl->getZMainGrid();
- }
- else
- {
- if( xDiaProp.is())
- xDiaProp->setPropertyValue( ::rtl::OUString::createFromAscii("HasZAxisHelpGrid"), aTrueBool );
- xGridProp = xSuppl->getZHelpGrid();
- }
- }
- }
- break;
- case SCH_XML_AXIS_UNDEF:
- DBG_ERROR( "Invalid axis" );
- break;
- }
-
- // set properties
- if( xGridProp.is())
- {
- // the line color is black as default, in the model it is a light gray
- xGridProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )),
- uno::makeAny( COL_BLACK ));
- if( sAutoStyleName.getLength())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xGridProp );
- }
- }
- }
-}
-
-void SchXMLAxisContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- // parse attributes
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- SchXMLImport& rImport = ( SchXMLImport& )GetImport();
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetAxisAttrTokenMap();
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- rtl::OUString aLocalName;
- rtl::OUString aValue = xAttrList->getValueByIndex( i );
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_AXIS_DIMENSION:
- {
- USHORT nEnumVal;
- if( rImport.GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLAxisClassMap ))
- maCurrentAxis.eClass = ( SchXMLAxisClass )nEnumVal;
- }
- break;
- case XML_TOK_AXIS_NAME:
- maCurrentAxis.aName = aValue;
- break;
- case XML_TOK_AXIS_STYLE_NAME:
- msAutoStyleName = aValue;
- break;
- }
- }
-
- // check for number of axes with same category
- maCurrentAxis.nIndexInCategory = 0;
- sal_Int32 nNumOfAxes = maAxes.size();
- for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ )
- {
- if( maAxes[ nCurrent ].eClass == maCurrentAxis.eClass )
- maCurrentAxis.nIndexInCategory++;
- }
- CreateAxis();
-}
-namespace
-{
-
-uno::Reference< chart2::XAxis > lcl_getAxis( const uno::Reference< frame::XModel >& xChartModel,
- sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
-{
- uno::Reference< chart2::XAxis > xAxis;
-
- try
- {
- uno::Reference< chart2::XChartDocument > xChart2Document( xChartModel, uno::UNO_QUERY );
- if( xChart2Document.is() )
- {
- uno::Reference< chart2::XDiagram > xDiagram( xChart2Document->getFirstDiagram());
- uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
- uno::Sequence< uno::Reference< chart2::XCoordinateSystem > >
- aCooSysSeq( xCooSysCnt->getCoordinateSystems());
- sal_Int32 nCooSysIndex = 0;
- if( nCooSysIndex < aCooSysSeq.getLength() )
- {
- uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] );
- if( xCooSys.is() && nDimensionIndex < xCooSys->getDimension() )
- {
- const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
- if( nAxisIndex <= nMaxAxisIndex )
- xAxis = xCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex );
- }
- }
- }
- }
- catch( uno::Exception & )
- {
- DBG_ERROR( "Couldn't get axis" );
- }
-
- return xAxis;
-}
-
-bool lcl_divideBy100( uno::Any& rDoubleAny )
-{
- bool bChanged = false;
- double fValue=0.0;
- if( (rDoubleAny>>=fValue) && (fValue!=0.0) )
- {
- fValue/=100.0;
- rDoubleAny = uno::makeAny(fValue);
- bChanged = true;
- }
- return bChanged;
-}
-
-bool lcl_AdaptWrongPercentScaleValues(chart2::ScaleData& rScaleData)
-{
- bool bChanged = lcl_divideBy100( rScaleData.Minimum );
- bChanged = lcl_divideBy100( rScaleData.Maximum ) || bChanged;
- bChanged = lcl_divideBy100( rScaleData.Origin ) || bChanged;
- bChanged = lcl_divideBy100( rScaleData.IncrementData.Distance ) || bChanged;
- return bChanged;
-}
-
-}//end anonymous namespace
-
-void SchXMLAxisContext::CreateAxis()
-{
- // add new Axis to list
- maAxes.push_back( maCurrentAxis );
-
- // set axis at chart
- uno::Reference< beans::XPropertySet > xDiaProp( mxDiagram, uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xProp;
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- uno::Any aFalseBool;
- aFalseBool <<= (sal_Bool)(sal_False);
- uno::Reference< frame::XModel > xDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
-
- switch( maCurrentAxis.eClass )
- {
- case SCH_XML_AXIS_X:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- try
- {
- xDiaProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasXAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Couldn't turn on x axis" );
- }
- uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getXAxis();
- }
- else
- {
- try
- {
- xDiaProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasSecondaryXAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Couldn't turn on second x axis" );
- }
- uno::Reference< chart::XTwoAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getSecondaryXAxis();
- }
- break;
-
- case SCH_XML_AXIS_Y:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- try
- {
- xDiaProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasYAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Couldn't turn on y axis" );
- }
- uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getYAxis();
-
-
- if( mbAddMissingXAxisForNetCharts )
- {
- if( xDiaProp.is() )
- {
- try
- {
- xDiaProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasXAxis" ), uno::makeAny(sal_True) );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Couldn't turn on x axis" );
- }
- }
- }
- }
- else
- {
- try
- {
- xDiaProp->setPropertyValue(
- rtl::OUString::createFromAscii( "HasSecondaryYAxis" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Couldn't turn on second y axis" );
- }
- uno::Reference< chart::XTwoAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getSecondaryYAxis();
- }
- break;
-
- case SCH_XML_AXIS_Z:
- {
- bool bSettingZAxisSuccedded = false;
- try
- {
- rtl::OUString sHasZAxis( rtl::OUString::createFromAscii( "HasZAxis" ) );
- xDiaProp->setPropertyValue( sHasZAxis, aTrueBool );
- xDiaProp->getPropertyValue( sHasZAxis ) >>= bSettingZAxisSuccedded;
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Couldn't turn on z axis" );
- }
- if( bSettingZAxisSuccedded )
- {
- uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is())
- xProp = xSuppl->getZAxis();
- }
- }
- break;
- case SCH_XML_AXIS_UNDEF:
- // nothing
- break;
- }
-
- // set properties
- if( xProp.is())
- {
- // #i109879# the line color is black as default, in the model it is a light gray
- xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LineColor" )),
- uno::makeAny( COL_BLACK ));
-
- xProp->setPropertyValue( rtl::OUString::createFromAscii( "DisplayLabels" ), aFalseBool );
-
- // #88077# AutoOrigin 'on' is default
- xProp->setPropertyValue( rtl::OUString::createFromAscii( "AutoOrigin" ), aTrueBool );
-
- if( msAutoStyleName.getLength())
- {
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), msAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- {
- // note: SvXMLStyleContext::FillPropertySet is not const
- XMLPropStyleContext * pPropStyleContext = const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle ));
- if( pPropStyleContext )
- pPropStyleContext->FillPropertySet( xProp );
-
- if( mbAdaptWrongPercentScaleValues && maCurrentAxis.eClass==SCH_XML_AXIS_Y )
- {
- //set scale data of added x axis back to default
- uno::Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(),
- 1 /*nDimensionIndex*/, maCurrentAxis.nIndexInCategory /*nAxisIndex*/ ) );
- if( xAxis.is() )
- {
- chart2::ScaleData aScaleData( xAxis->getScaleData());
- if( lcl_AdaptWrongPercentScaleValues(aScaleData) )
- xAxis->setScaleData( aScaleData );
- }
- }
-
- if( mbAddMissingXAxisForNetCharts )
- {
- //copy style from y axis to added x axis:
-
- uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() )
- {
- uno::Reference< beans::XPropertySet > xXAxisProp( xSuppl->getXAxis() );
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xXAxisProp );
- }
-
- //set scale data of added x axis back to default
- uno::Reference< chart2::XAxis > xAxis( lcl_getAxis( GetImport().GetModel(),
- 0 /*nDimensionIndex*/, 0 /*nAxisIndex*/ ) );
- if( xAxis.is() )
- {
- chart2::ScaleData aScaleData;
- aScaleData.AxisType = chart2::AxisType::CATEGORY;
- aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
- xAxis->setScaleData( aScaleData );
- }
-
- //set line style of added x axis to invisible
- uno::Reference< beans::XPropertySet > xNewAxisProp( xAxis, uno::UNO_QUERY );
- if( xNewAxisProp.is() )
- {
- xNewAxisProp->setPropertyValue( rtl::OUString::createFromAscii("LineStyle")
- , uno::makeAny(drawing::LineStyle_NONE));
- }
- }
-
- if( mbAdaptXAxisOrientationForOld2DBarCharts && maCurrentAxis.eClass == SCH_XML_AXIS_X )
- {
- bool bIs3DChart = false;
- if( xDiaProp.is() && ( xDiaProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dim3D"))) >>= bIs3DChart )
- && !bIs3DChart )
- {
- uno::Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY );
- if( xChart2Document.is() )
- {
- uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChart2Document->getFirstDiagram(), uno::UNO_QUERY );
- if( xCooSysCnt.is() )
- {
- uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() );
- if( aCooSysSeq.getLength() )
- {
- bool bSwapXandYAxis = false;
- uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] );
- uno::Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY );
- if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXandYAxis )
- && bSwapXandYAxis )
- {
- uno::Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, maCurrentAxis.nIndexInCategory );
- if( xAxis.is() )
- {
- chart2::ScaleData aScaleData = xAxis->getScaleData();
- aScaleData.Orientation = chart2::AxisOrientation_REVERSE;
- xAxis->setScaleData( aScaleData );
- }
- }
- }
- }
- }
- }
- }
-
- m_rbAxisPositionAttributeImported = m_rbAxisPositionAttributeImported || SchXMLTools::getPropertyFromContext(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CrossoverPosition")), pPropStyleContext, pStylesCtxt ).hasValue();
- }
- }
- }
- }
-}
-
-void SchXMLAxisContext::SetAxisTitle()
-{
- // add new Axis to list
- maAxes.push_back( maCurrentAxis );
-
- // set axis at chart
- sal_Bool bHasTitle = ( maCurrentAxis.aTitle.getLength() > 0 );
- uno::Reference< frame::XModel > xDoc( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
-
- switch( maCurrentAxis.eClass )
- {
- case SCH_XML_AXIS_X:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- uno::Reference< chart::XAxisXSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() &&
- bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getXAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- }
- }
- }
- else
- {
- uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() &&
- bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getSecondXAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- }
- }
- }
- break;
-
- case SCH_XML_AXIS_Y:
- if( maCurrentAxis.nIndexInCategory == 0 )
- {
- uno::Reference< chart::XAxisYSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() &&
- bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getYAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- }
- }
- }
- else
- {
- uno::Reference< chart::XSecondAxisTitleSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() &&
- bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getSecondYAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- }
- }
- }
- break;
-
- case SCH_XML_AXIS_Z:
- {
- uno::Reference< chart::XAxisZSupplier > xSuppl( mxDiagram, uno::UNO_QUERY );
- if( xSuppl.is() &&
- bHasTitle )
- {
- uno::Reference< beans::XPropertySet > xTitleProp( xSuppl->getZAxisTitle(), uno::UNO_QUERY );
- if( xTitleProp.is())
- {
- try
- {
- uno::Any aAny;
- aAny <<= maCurrentAxis.aTitle;
- xTitleProp->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "String" )), aAny );
- }
- catch( beans::UnknownPropertyException & )
- {
- DBG_ERROR( "Property String for Title not available" );
- }
- }
- }
- }
- break;
- case SCH_XML_AXIS_UNDEF:
- // nothing
- break;
- }
-}
-
-SvXMLImportContext* SchXMLAxisContext::CreateChildContext(
- USHORT p_nPrefix,
- const rtl::OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- SvXMLImportContext* pContext = 0;
- const SvXMLTokenMap& rTokenMap = mrImportHelper.GetAxisElemTokenMap();
-
- switch( rTokenMap.Get( p_nPrefix, rLocalName ))
- {
- case XML_TOK_AXIS_TITLE:
- {
- uno::Reference< drawing::XShape > xTitleShape = getTitleShape();
- pContext = new SchXMLTitleContext( mrImportHelper, GetImport(), rLocalName,
- maCurrentAxis.aTitle,
- xTitleShape );
- }
- break;
-
- case XML_TOK_AXIS_CATEGORIES:
- pContext = new SchXMLCategoriesContext( mrImportHelper, GetImport(),
- p_nPrefix, rLocalName,
- mrCategoriesAddress );
- maCurrentAxis.bHasCategories = true;
- break;
-
- case XML_TOK_AXIS_GRID:
- {
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- sal_Bool bIsMajor = sal_True; // default value for class is "major"
- rtl::OUString sAutoStyleName;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_CHART )
- {
- if( IsXMLToken( aLocalName, XML_CLASS ) )
- {
- if( IsXMLToken( xAttrList->getValueByIndex( i ), XML_MINOR ) )
- bIsMajor = sal_False;
- }
- else if( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
- sAutoStyleName = xAttrList->getValueByIndex( i );
- }
- }
-
- CreateGrid( sAutoStyleName, bIsMajor );
-
- // don't create a context => use default context. grid elements are empty
- pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
- }
- break;
-
- default:
- pContext = new SvXMLImportContext( GetImport(), p_nPrefix, rLocalName );
- break;
- }
-
- return pContext;
-}
-
-void SchXMLAxisContext::EndElement()
-{
- SetAxisTitle();
+ SchXMLAxisContext::CorrectAxisPositions( uno::Reference< chart2::XChartDocument >( mrImportHelper.GetChartDocument(), uno::UNO_QUERY ), maChartTypeServiceName, GetImport().GetODFVersion(), m_bAxisPositionAttributeImported );
}
// ========================================
@@ -1636,44 +722,6 @@ void SchXMLDataPointContext::StartElement( const uno::Reference< xml::sax::XAttr
// ========================================
-SchXMLCategoriesContext::SchXMLCategoriesContext(
- SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const rtl::OUString& rLocalName,
- rtl::OUString& rAddress ) :
- SvXMLImportContext( rImport, nPrefix, rLocalName ),
- mrImportHelper( rImpHelper ),
- mrAddress( rAddress )
-{
-}
-
-SchXMLCategoriesContext::~SchXMLCategoriesContext()
-{
-}
-
-void SchXMLCategoriesContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- rtl::OUString aLocalName;
- USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- if( nPrefix == XML_NAMESPACE_TABLE &&
- IsXMLToken( aLocalName, XML_CELL_RANGE_ADDRESS ) )
- {
- uno::Reference< chart2::XChartDocument > xNewDoc( GetImport().GetModel(), uno::UNO_QUERY );
- mrAddress = xAttrList->getValueByIndex( i );
- // lcl_ConvertRange( xAttrList->getValueByIndex( i ), xNewDoc );
- }
- }
-}
-
-// ========================================
-
SchXMLPositonAttributesHelper::SchXMLPositonAttributesHelper( SvXMLImport& rImporter )
: m_rImport( rImporter )
, m_aPosition(0,0)
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
index 1f0de466dcb1..ca44e127cfb8 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx
@@ -131,8 +131,6 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual void EndElement();
- void CorrectAxisPositions();
-
private:
SchXMLImportHelper& mrImportHelper;
::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
@@ -166,47 +164,6 @@ private:
::com::sun::star::awt::Size maChartSize;
};
-// ----------------------------------------
-
-class SchXMLAxisContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
- SchXMLAxis maCurrentAxis;
- std::vector< SchXMLAxis >& maAxes;
- rtl::OUString msAutoStyleName;
- rtl::OUString& mrCategoriesAddress;
- bool mbAddMissingXAxisForNetCharts; //to correct errors from older versions
- bool mbAdaptWrongPercentScaleValues; //to correct errors from older versions
- bool mbAdaptXAxisOrientationForOld2DBarCharts; //to correct different behaviour from older versions
- bool& m_rbAxisPositionAttributeImported;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape();
- void CreateGrid( ::rtl::OUString sAutoStyleName, sal_Bool bIsMajor );
- void CreateAxis();
- void SetAxisTitle();
-
-public:
- SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const rtl::OUString& rLocalName,
- ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram,
- std::vector< SchXMLAxis >& aAxes,
- ::rtl::OUString& rCategoriesAddress,
- bool bAddMissingXAxisForNetCharts,
- bool bAdaptWrongPercentScaleValues,
- bool bAdaptXAxisOrientationForOld2DBarCharts,
- bool& rbAxisPositionAttributeImported );
- virtual ~SchXMLAxisContext();
-
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
- virtual void EndElement();
- virtual SvXMLImportContext* CreateChildContext(
- USHORT nPrefix,
- const rtl::OUString& rLocalName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
//----------------------------------------
class SchXMLDataPointContext : public SvXMLImportContext
@@ -233,24 +190,6 @@ public:
// ----------------------------------------
-class SchXMLCategoriesContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
- rtl::OUString& mrAddress;
-
-public:
- SchXMLCategoriesContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport,
- sal_uInt16 nPrefix,
- const rtl::OUString& rLocalName,
- rtl::OUString& rAddress );
- virtual ~SchXMLCategoriesContext();
- virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
-// ----------------------------------------
-
class SchXMLCoordinateRegionContext : public SvXMLImportContext
{
public:
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index b3b322568ea6..f42154b056c9 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -336,7 +336,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
for( sal_Int32 nCurrent = 0; nCurrent < nNumOfAxes; nCurrent++ )
{
if( aValue.equals( mrAxes[ nCurrent ].aName ) &&
- mrAxes[ nCurrent ].eClass == SCH_XML_AXIS_Y )
+ mrAxes[ nCurrent ].eDimension == SCH_XML_AXIS_Y )
{
mpAttachedAxis = &( mrAxes[ nCurrent ] );
}
@@ -364,7 +364,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
if( mpAttachedAxis )
{
- if( mpAttachedAxis->nIndexInCategory > 0 )
+ if( mpAttachedAxis->nAxisIndex > 0 )
{
// secondary axis => property has to be set (primary is default)
mnAttachedAxis = 2;
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 8f584bb5d6ac..a7214fa558bd 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -42,11 +42,11 @@
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmluconv.hxx>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
@@ -846,15 +846,25 @@ void SchXMLTableCellContext::EndElement()
// ========================================
-void lcl_ApplyCellToComplexLabel( const SchXMLCell& rCell, Sequence< OUString >& rComplexLabel )
+void lcl_ApplyCellToComplexLabel( const SchXMLCell& rCell, Sequence< uno::Any >& rComplexLabel )
{
if( rCell.eType == SCH_CELL_TYPE_STRING )
{
rComplexLabel.realloc(1);
- rComplexLabel[0] = rCell.aString;
+ rComplexLabel[0] = uno::makeAny( rCell.aString );
}
else if( rCell.pComplexString && rCell.eType == SCH_CELL_TYPE_COMPLEX_STRING )
- rComplexLabel = *rCell.pComplexString;
+ {
+ sal_Int32 nCount = rCell.pComplexString->getLength();
+ rComplexLabel.realloc( nCount );
+ for( sal_Int32 nN=0; nN<nCount; nN++)
+ rComplexLabel[nN] = uno::makeAny((*rCell.pComplexString)[nN]);
+ }
+ else if( rCell.eType == SCH_CELL_TYPE_FLOAT )
+ {
+ rComplexLabel.realloc(1);
+ rComplexLabel[0] = uno::makeAny( rCell.fValue );
+ }
}
void SchXMLTableHelper::applyTableToInternalDataProvider(
@@ -885,8 +895,8 @@ void SchXMLTableHelper::applyTableToInternalDataProvider(
}
Sequence< Sequence< double > > aDataInRows( nNumRows );
- Sequence< Sequence< OUString > > aComplexRowDescriptions( nNumRows );
- Sequence< Sequence< OUString > > aComplexColumnDescriptions( nNumColumns );
+ Sequence< Sequence< uno::Any > > aComplexRowDescriptions( nNumRows );
+ Sequence< Sequence< uno::Any > > aComplexColumnDescriptions( nNumColumns );
for( sal_Int32 i=0; i<nNumRows; ++i )
aDataInRows[i].realloc( nNumColumns );
@@ -926,15 +936,15 @@ void SchXMLTableHelper::applyTableToInternalDataProvider(
}
//apply the collected data to the chart
- Reference< chart::XComplexDescriptionAccess > xDataAccess( xDataProv, uno::UNO_QUERY );
+ Reference< chart2::XAnyDescriptionAccess > xDataAccess( xDataProv, uno::UNO_QUERY );
if( !xDataAccess.is() )
return;
xDataAccess->setData( aDataInRows );
if( rTable.bHasHeaderColumn )
- xDataAccess->setComplexRowDescriptions( aComplexRowDescriptions );
+ xDataAccess->setAnyRowDescriptions( aComplexRowDescriptions );
if( rTable.bHasHeaderRow )
- xDataAccess->setComplexColumnDescriptions( aComplexColumnDescriptions );
+ xDataAccess->setAnyColumnDescriptions( aComplexColumnDescriptions );
if ( rTable.bProtected )
{
diff --git a/xmloff/source/chart/makefile.mk b/xmloff/source/chart/makefile.mk
new file mode 100644
index 000000000000..2f61a3d6f0e5
--- /dev/null
+++ b/xmloff/source/chart/makefile.mk
@@ -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.
+#
+#*************************************************************************
+
+PRJ = ..$/..
+PRJNAME = xmloff
+TARGET = chart
+AUTOSEG = true
+ENABLE_EXCEPTIONS = TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE: $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES = $(SLO)$/ColorPropertySet.obj \
+ $(SLO)$/SchXMLTools.obj \
+ $(SLO)$/SchXMLExport.obj \
+ $(SLO)$/SchXMLImport.obj \
+ $(SLO)$/contexts.obj \
+ $(SLO)$/SchXMLTableContext.obj \
+ $(SLO)$/SchXMLChartContext.obj \
+ $(SLO)$/SchXMLPlotAreaContext.obj \
+ $(SLO)$/SchXMLAxisContext.obj \
+ $(SLO)$/SchXMLParagraphContext.obj \
+ $(SLO)$/SchXMLTextListContext.obj \
+ $(SLO)$/SchXMLSeriesHelper.obj \
+ $(SLO)$/SchXMLSeries2Context.obj \
+ $(SLO)$/PropertyMaps.obj \
+ $(SLO)$/XMLChartStyleContext.obj \
+ $(SLO)$/XMLErrorIndicatorPropertyHdl.obj \
+ $(SLO)$/XMLErrorBarStylePropertyHdl.obj \
+ $(SLO)$/SchXMLAutoStylePoolP.obj \
+ $(SLO)$/XMLChartPropertyContext.obj \
+ $(SLO)$/XMLSymbolImageContext.obj \
+ $(SLO)$/XMLLabelSeparatorContext.obj \
+ $(SLO)$/XMLTextOrientationHdl.obj \
+ $(SLO)$/XMLSymbolTypePropertyHdl.obj \
+ $(SLO)$/XMLAxisPositionPropertyHdl.obj \
+ $(SLO)$/SchXMLCalculationSettingsContext.obj \
+ $(SLO)$/transporttypes.obj
+
+# --- Targets --------------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/xmloff/source/chart/transporttypes.hxx b/xmloff/source/chart/transporttypes.hxx
index 599741dfe273..30f70d882ed0 100644
--- a/xmloff/source/chart/transporttypes.hxx
+++ b/xmloff/source/chart/transporttypes.hxx
@@ -135,7 +135,7 @@ struct SchNumericCellRangeAddress
// ----------------------------------------
-enum SchXMLAxisClass
+enum SchXMLAxisDimension
{
SCH_XML_AXIS_X = 0,
SCH_XML_AXIS_Y,
@@ -145,13 +145,13 @@ enum SchXMLAxisClass
struct SchXMLAxis
{
- enum SchXMLAxisClass eClass;
- sal_Int8 nIndexInCategory;
+ enum SchXMLAxisDimension eDimension;
+ sal_Int8 nAxisIndex;//0->primary axis; 1->secondary axis
rtl::OUString aName;
rtl::OUString aTitle;
bool bHasCategories;
- SchXMLAxis() : eClass( SCH_XML_AXIS_UNDEF ), nIndexInCategory( 0 ), bHasCategories( false ) {}
+ SchXMLAxis() : eDimension( SCH_XML_AXIS_UNDEF ), nAxisIndex( 0 ), bHasCategories( false ) {}
};
// ----------------------------------------
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 6cfacbd93905..824d28a51a5c 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3113,6 +3113,14 @@ namespace xmloff { namespace token {
TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ),
TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ),
+ TOKEN( "axis-type", XML_AXIS_TYPE ), //#i25706#
+ TOKEN( "date-scale", XML_DATE_SCALE ),
+ TOKEN( "base-time-unit", XML_BASE_TIME_UNIT ),
+ TOKEN( "major-interval-value", XML_MAJOR_INTERVAL_VALUE ),
+ TOKEN( "minor-interval-value", XML_MINOR_INTERVAL_VALUE ),
+ TOKEN( "major-interval-unit", XML_MAJOR_INTERVAL_UNIT ),
+ TOKEN( "minor-interval-unit", XML_MINOR_INTERVAL_UNIT ),
+
TOKEN( "min-value", XML_MIN_VALUE ),
TOKEN( "max-value", XML_MAX_VALUE ),
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 45411162a183..bd79d4d2cbde 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -183,12 +183,6 @@ XMLShapeImportHelper::XMLShapeImportHelper(
mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(rImporter));
mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaDefaultExtPropMapper(rImporter));
-/*
- // chain form attributes
- const UniReference< SvXMLImportPropertyMapper> xFormMapper( rImporter.GetFormImport()->getStylePropertyMapper().getBodyPtr() );
- mpPropertySetMapper->ChainImportMapper(xFormMapper);
-*/
-
// construct PresPagePropsMapper
xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory);
mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter );
diff --git a/xmloff/source/forms/formlayerexport.cxx b/xmloff/source/forms/formlayerexport.cxx
index 50245fad1d2a..517c499595ca 100644
--- a/xmloff/source/forms/formlayerexport.cxx
+++ b/xmloff/source/forms/formlayerexport.cxx
@@ -93,12 +93,6 @@ namespace xmloff
}
//---------------------------------------------------------------------
- ::vos::ORef< SvXMLExportPropertyMapper > OFormLayerXMLExport::getStylePropertyMapper()
- {
- return m_pImpl->getStylePropertyMapper();
- }
-
- //---------------------------------------------------------------------
void OFormLayerXMLExport::initialize()
{
m_pImpl->clear();
diff --git a/xmloff/source/forms/formlayerimport.cxx b/xmloff/source/forms/formlayerimport.cxx
index a31b6397f51f..17a0a3bc9bb3 100644
--- a/xmloff/source/forms/formlayerimport.cxx
+++ b/xmloff/source/forms/formlayerimport.cxx
@@ -60,12 +60,6 @@ namespace xmloff
}
//---------------------------------------------------------------------
- ::vos::ORef< SvXMLImportPropertyMapper > OFormLayerXMLImport::getStylePropertyMapper() const
- {
- return m_pImpl->getStylePropertyMapper();
- }
-
- //---------------------------------------------------------------------
void OFormLayerXMLImport::setAutoStyleContext(SvXMLStylesContext* _pNewContext)
{
m_pImpl->setAutoStyleContext(_pNewContext);
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index cf5155f6a9a1..4a4bc4e7f942 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -237,11 +237,6 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
TabulatorCycle_RECORDS, OEnumMapper::getEnumMap(OEnumMapper::epTabCyle),
&::getCppuType( static_cast<TabulatorCycle*>(NULL) ));
- // initialize our style map
- m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory();
- ::vos::ORef< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper(getControlStylePropertyMap(), m_xPropertyHandlerFactory.getBodyPtr());
- m_xImportMapper = new SvXMLImportPropertyMapper(xStylePropertiesMapper.getBodyPtr(), _rImporter);
-
// 'initialize'
m_aCurrentPageIds = m_aControlIds.end();
}
@@ -416,12 +411,6 @@ void OFormLayerXMLImport_Impl::registerControlReferences(const Reference< XPrope
}
//---------------------------------------------------------------------
-::vos::ORef< SvXMLImportPropertyMapper > OFormLayerXMLImport_Impl::getStylePropertyMapper() const
-{
- return m_xImportMapper;
-}
-
-//---------------------------------------------------------------------
void OFormLayerXMLImport_Impl::startPage(const Reference< XDrawPage >& _rxDrawPage)
{
m_xCurrentPageFormsSupp.clear();
diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx
index bd88a67975fd..9bbc4c53d9df 100644
--- a/xmloff/source/forms/layerimport.hxx
+++ b/xmloff/source/forms/layerimport.hxx
@@ -92,10 +92,6 @@ namespace xmloff
SvXMLStylesContext* m_pAutoStyles;
protected:
- // style handling
- ::vos::ORef< XMLPropertyHandlerFactory > m_xPropertyHandlerFactory;
- ::vos::ORef< SvXMLImportPropertyMapper > m_xImportMapper;
-
DECLARE_STL_USTRINGACCESS_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, MapString2PropertySet );
DECLARE_STL_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >, MapString2PropertySet, ODrawPageCompare, MapDrawPage2Map);
@@ -168,10 +164,6 @@ namespace xmloff
OFormLayerXMLImport_Impl(SvXMLImport& _rImporter);
virtual ~OFormLayerXMLImport_Impl();
- /** retrieves the property mapper form form related auto styles.
- */
- ::vos::ORef< SvXMLImportPropertyMapper > getStylePropertyMapper() const;
-
/** start importing the forms of the given page
*/
void startPage(
diff --git a/xpdf/makefile.mk b/xpdf/makefile.mk
index 452ab84fd0e4..c3dea0f006d5 100644
--- a/xpdf/makefile.mk
+++ b/xpdf/makefile.mk
@@ -48,7 +48,7 @@ dummy:
TARFILE_NAME=xpdf-3.02
TARFILE_MD5=599dc4cc65a07ee868cf92a667a913d2
-PATCH_FILES=$(TARFILE_NAME).patch xpdf-3.02-sec.patch
+PATCH_FILES=$(TARFILE_NAME).patch
CONFIGURE_DIR=
BUILD_DIR=$(CONFIGURE_DIR)
diff --git a/xpdf/xpdf-3.02-sec.patch b/xpdf/xpdf-3.02-sec.patch
deleted file mode 100644
index a33b85e8ab17..000000000000
--- a/xpdf/xpdf-3.02-sec.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- misc/xpdf-3.02/fofi/FoFiType1.cc 2007-02-27 23:05:51.000000000 +0100
-+++ misc/build/xpdf-3.02/fofi/FoFiType1.cc 2010-10-20 18:10:09.000000000 +0200
-@@ -224,7 +224,7 @@
- code = code * 8 + (*p2 - '0');
- }
- }
-- if (code < 256) {
-+ if (code < 256 && code >= 0) {
- for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
- if (*p == '/') {
- ++p;
---- misc/xpdf-3.02/xpdf/Gfx.cc 2007-02-27 23:05:52.000000000 +0100
-+++ misc/build/xpdf-3.02/xpdf/Gfx.cc 2010-10-20 18:14:32.000000000 +0200
-@@ -444,6 +444,7 @@
- xref = xrefA;
- subPage = gFalse;
- printCommands = globalParams->getPrintCommands();
-+ parser = NULL;
-
- // start the resource stack
- res = new GfxResources(xref, resDict, NULL);
-@@ -486,6 +487,7 @@
- xref = xrefA;
- subPage = gTrue;
- printCommands = globalParams->getPrintCommands();
-+ parser = NULL;
-
- // start the resource stack
- res = new GfxResources(xref, resDict, NULL);
diff --git a/xpdf/xpdf-3.02.patch b/xpdf/xpdf-3.02.patch
index 341ad73132a2..9477f7a31d4a 100644
--- a/xpdf/xpdf-3.02.patch
+++ b/xpdf/xpdf-3.02.patch
@@ -1870,3 +1870,32 @@
}
objStr->getObject(e->gen, num, obj);
break;
+--- misc/xpdf-3.02/fofi/FoFiType1.cc 2007-02-27 23:05:51.000000000 +0100
++++ misc/build/xpdf-3.02/fofi/FoFiType1.cc 2011-01-04 13:41:06.871136746 +0100
+@@ -224,7 +224,7 @@
+ code = code * 8 + (*p2 - '0');
+ }
+ }
+- if (code < 256) {
++ if (code < 256 && code >= 0) {
+ for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
+ if (*p == '/') {
+ ++p;
+--- misc/xpdf-3.02/xpdf/Gfx.cc 2007-02-27 23:05:52.000000000 +0100
++++ misc/build/xpdf-3.02/xpdf/Gfx.cc 2011-01-04 13:41:19.847501431 +0100
+@@ -441,6 +441,7 @@
+ void *abortCheckCbkDataA) {
+ int i;
+
++ parser = NULL;
+ xref = xrefA;
+ subPage = gFalse;
+ printCommands = globalParams->getPrintCommands();
+@@ -483,6 +484,7 @@
+ void *abortCheckCbkDataA) {
+ int i;
+
++ parser = NULL;
+ xref = xrefA;
+ subPage = gTrue;
+ printCommands = globalParams->getPrintCommands();