summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Module_ooo.mk1
-rw-r--r--Repository.mk6
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx112
-rwxr-xr-xaccessibility/prj/build.lst2
-rwxr-xr-xaccessibility/source/extended/AccessibleGridControlTable.cxx6
-rw-r--r--[-rwxr-xr-x]accessibility/source/extended/AccessibleGridControlTableBase.cxx5
-rw-r--r--accessibility/source/standard/vclxaccessiblebox.cxx1
-rw-r--r--automation/source/server/statemnt.cxx17
-rw-r--r--avmedia/prj/build.lst2
-rw-r--r--basctl/prj/build.lst2
-rw-r--r--basctl/source/basicide/baside2b.cxx6
-rw-r--r--basctl/source/basicide/moduldl2.cxx2
-rw-r--r--basctl/source/basicide/moduldlg.hxx2
-rw-r--r--basctl/source/basicide/objdlg.cxx4
-rw-r--r--basctl/source/basicide/objdlg.hrc2
-rw-r--r--basctl/source/basicide/objdlg.src6
-rw-r--r--basic/inc/basic/sbstar.hxx2
-rwxr-xr-xbasic/inc/basic/vbahelper.hxx86
-rw-r--r--basic/prj/build.lst2
-rw-r--r--basic/source/basmgr/makefile.mk3
-rwxr-xr-xbasic/source/basmgr/vbahelper.cxx212
-rw-r--r--basic/source/classes/sb.cxx193
-rwxr-xr-xbasic/source/classes/sbxmod.cxx103
-rw-r--r--basic/source/comp/scanner.cxx20
-rw-r--r--binaryurp/prj/build.lst3
-rw-r--r--binaryurp/prj/d.lst4
-rw-r--r--binaryurp/qa/makefile.mk77
-rw-r--r--binaryurp/qa/test-cache.cxx84
-rw-r--r--binaryurp/qa/test-unmarshal.cxx112
-rw-r--r--binaryurp/qa/version.map34
-rw-r--r--binaryurp/source/binaryany.cxx98
-rw-r--r--binaryurp/source/binaryany.hxx73
-rw-r--r--binaryurp/source/binaryurp.component (renamed from remotebridges/source/factory/bridgefac.component)4
-rw-r--r--binaryurp/source/bridge.cxx978
-rw-r--r--binaryurp/source/bridge.hxx287
-rw-r--r--binaryurp/source/bridgefactory.cxx232
-rwxr-xr-xbinaryurp/source/bridgefactory.hxx144
-rwxr-xr-xbinaryurp/source/cache.hxx134
-rw-r--r--binaryurp/source/currentcontext.cxx80
-rw-r--r--binaryurp/source/currentcontext.hxx49
-rw-r--r--binaryurp/source/incomingreply.hxx58
-rw-r--r--binaryurp/source/incomingrequest.cxx300
-rw-r--r--binaryurp/source/incomingrequest.hxx86
-rw-r--r--binaryurp/source/lessoperators.cxx71
-rw-r--r--binaryurp/source/lessoperators.hxx50
-rw-r--r--binaryurp/source/makefile.mk (renamed from remotebridges/source/factory/makefile.mk)74
-rw-r--r--binaryurp/source/marshal.cxx314
-rwxr-xr-xbinaryurp/source/marshal.hxx95
-rw-r--r--binaryurp/source/outgoingrequest.hxx55
-rw-r--r--binaryurp/source/outgoingrequests.cxx80
-rw-r--r--binaryurp/source/outgoingrequests.hxx65
-rw-r--r--binaryurp/source/proxy.cxx260
-rw-r--r--binaryurp/source/proxy.hxx92
-rwxr-xr-xbinaryurp/source/reader.cxx553
-rw-r--r--binaryurp/source/reader.hxx89
-rw-r--r--binaryurp/source/readerstate.hxx52
-rw-r--r--binaryurp/source/specialfunctionids.hxx (renamed from remotebridges/source/bridge/remotebridge.component)37
-rwxr-xr-xbinaryurp/source/unmarshal.cxx563
-rw-r--r--binaryurp/source/unmarshal.hxx106
-rwxr-xr-xbinaryurp/source/writer.cxx476
-rw-r--r--binaryurp/source/writer.hxx185
-rw-r--r--binaryurp/source/writerstate.hxx55
-rw-r--r--bridges/inc/bridges/remote/bridgeimpl.hxx94
-rw-r--r--bridges/inc/bridges/remote/connection.h67
-rw-r--r--bridges/inc/bridges/remote/context.h260
-rw-r--r--bridges/inc/bridges/remote/counter.hxx57
-rw-r--r--bridges/inc/bridges/remote/helper.hxx68
-rw-r--r--bridges/inc/bridges/remote/mapping.hxx69
-rw-r--r--bridges/inc/bridges/remote/proxy.hxx91
-rw-r--r--bridges/inc/bridges/remote/remote.h93
-rw-r--r--bridges/inc/bridges/remote/remote.hxx73
-rw-r--r--bridges/inc/bridges/remote/stub.hxx64
-rw-r--r--bridges/inc/pch/precompiled_bridges.hxx4
-rw-r--r--bridges/prj/build.lst3
-rw-r--r--bridges/prj/d.lst18
-rw-r--r--bridges/source/remote/context/context.cxx484
-rw-r--r--bridges/source/remote/context/exports.dxp5
-rwxr-xr-xbridges/source/remote/context/rmcxt.map10
-rw-r--r--bridges/source/remote/idl/corba.idl88
-rw-r--r--bridges/source/remote/static/helper.cxx209
-rw-r--r--bridges/source/remote/static/mapping.cxx218
-rw-r--r--bridges/source/remote/static/proxy.cxx338
-rw-r--r--bridges/source/remote/static/remote.cxx161
-rw-r--r--bridges/source/remote/static/remote_types.cxx96
-rw-r--r--bridges/source/remote/static/remote_types.hxx89
-rw-r--r--bridges/source/remote/static/stub.cxx336
-rw-r--r--bridges/source/remote/urp/makefile.mk78
-rw-r--r--bridges/source/remote/urp/urp_bridgeimpl.cxx250
-rw-r--r--bridges/source/remote/urp/urp_bridgeimpl.hxx133
-rw-r--r--bridges/source/remote/urp/urp_cache.h57
-rw-r--r--bridges/source/remote/urp/urp_cache.hxx160
-rw-r--r--bridges/source/remote/urp/urp_dispatch.cxx116
-rw-r--r--bridges/source/remote/urp/urp_dispatch.hxx78
-rw-r--r--bridges/source/remote/urp/urp_environment.cxx551
-rw-r--r--bridges/source/remote/urp/urp_job.cxx939
-rw-r--r--bridges/source/remote/urp/urp_job.hxx379
-rw-r--r--bridges/source/remote/urp/urp_log.cxx147
-rw-r--r--bridges/source/remote/urp/urp_log.hxx50
-rw-r--r--bridges/source/remote/urp/urp_marshal.cxx235
-rw-r--r--bridges/source/remote/urp/urp_marshal.hxx343
-rw-r--r--bridges/source/remote/urp/urp_marshal_decl.hxx106
-rw-r--r--bridges/source/remote/urp/urp_property.hxx93
-rw-r--r--bridges/source/remote/urp/urp_propertyobject.cxx793
-rw-r--r--bridges/source/remote/urp/urp_propertyobject.hxx108
-rw-r--r--bridges/source/remote/urp/urp_reader.cxx832
-rw-r--r--bridges/source/remote/urp/urp_reader.hxx78
-rw-r--r--bridges/source/remote/urp/urp_replycontainer.hxx75
-rw-r--r--bridges/source/remote/urp/urp_threadid.cxx48
-rw-r--r--bridges/source/remote/urp/urp_threadid.hxx59
-rw-r--r--bridges/source/remote/urp/urp_unmarshal.cxx707
-rw-r--r--bridges/source/remote/urp/urp_unmarshal.hxx280
-rw-r--r--bridges/source/remote/urp/urp_writer.cxx269
-rw-r--r--bridges/source/remote/urp/urp_writer.hxx83
-rw-r--r--bridges/unotypes/makefile.mk13
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx311
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx4
-rwxr-xr-x[-rw-r--r--]canvas/source/vcl/spritehelper.cxx17
-rw-r--r--chart2/prj/build.lst2
-rwxr-xr-xchart2/source/controller/chartapiwrapper/LegendWrapper.cxx21
-rw-r--r--chart2/source/controller/dialogs/ChartTypeDialogController.cxx2
-rw-r--r--chart2/source/controller/dialogs/Strings.src9
-rw-r--r--chart2/source/controller/dialogs/Strings_Statistic.src12
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.cxx2
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.cxx93
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.hxx5
-rw-r--r--chart2/source/controller/dialogs/res_TextSeparator.cxx3
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx9
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.src5
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.cxx11
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.cxx1
-rw-r--r--chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx133
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx14
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx9
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx16
-rw-r--r--chart2/source/controller/main/PositionAndSizeHelper.cxx59
-rw-r--r--chart2/source/controller/main/SelectionHelper.cxx20
-rw-r--r--chart2/source/inc/Strings.hrc7
-rw-r--r--chart2/source/inc/chartview/ChartSfxItemIds.hxx3
-rwxr-xr-xchart2/source/model/main/Legend.cxx70
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Legend.hxx19
-rwxr-xr-xchart2/source/model/template/BubbleChartTypeTemplate.cxx2
-rwxr-xr-xchart2/source/model/template/StockChartTypeTemplate.cxx1
-rwxr-xr-xchart2/source/tools/LegendHelper.cxx8
-rwxr-xr-xchart2/source/tools/RegressionCurveHelper.cxx4
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx6
-rw-r--r--chart2/source/view/charttypes/AreaChart.hxx2
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx2
-rw-r--r--chart2/source/view/charttypes/BubbleChart.hxx2
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx2
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.hxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/view/charttypes/VSeriesPlotter.cxx215
-rw-r--r--chart2/source/view/inc/LegendEntryProvider.hxx57
-rw-r--r--chart2/source/view/inc/VLegendSymbolFactory.hxx12
-rw-r--r--chart2/source/view/inc/VSeriesPlotter.hxx36
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx5
-rw-r--r--chart2/source/view/main/VLegend.cxx495
-rw-r--r--chart2/source/view/main/VLegendSymbolFactory.cxx288
-rw-r--r--comphelper/Library_comphelp.mk1
-rw-r--r--comphelper/Package_inc.mk2
-rwxr-xr-xcomphelper/inc/comphelper/anycompare.hxx226
-rwxr-xr-xcomphelper/inc/comphelper/componentguard.hxx70
-rw-r--r--comphelper/source/container/enumerablemap.cxx205
-rwxr-xr-xcomphelper/source/misc/anycompare.cxx131
-rw-r--r--configmgr/source/access.cxx100
-rw-r--r--configmgr/source/xcuparser.cxx26
-rw-r--r--configure.in26
-rw-r--r--connectivity/prj/build.lst2
-rw-r--r--cppu/source/uno/data.cxx11
-rw-r--r--cpputools/source/unoexe/unoexe.cxx17
-rwxr-xr-xcrashrep/prj/build.lst2
-rw-r--r--cui/source/customize/cfg.cxx12
-rw-r--r--cui/source/customize/cfg.hrc5
-rw-r--r--cui/source/customize/cfg.src8
-rw-r--r--cui/source/dialogs/commonlingui.cxx1
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx21
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx10
-rw-r--r--cui/source/dialogs/gallery.src4
-rw-r--r--cui/source/dialogs/hldocntp.cxx3
-rw-r--r--cui/source/dialogs/hldoctp.cxx4
-rw-r--r--cui/source/dialogs/hlinettp.cxx11
-rw-r--r--cui/source/dialogs/hlmailtp.cxx3
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx3
-rw-r--r--cui/source/dialogs/hlmarkwn.hrc3
-rw-r--r--cui/source/dialogs/hlmarkwn.src19
-rw-r--r--cui/source/dialogs/hltpbase.cxx3
-rw-r--r--cui/source/dialogs/insdlg.cxx23
-rw-r--r--cui/source/dialogs/linkdlg.cxx28
-rw-r--r--cui/source/dialogs/multipat.cxx3
-rw-r--r--cui/source/dialogs/pastedlg.cxx4
-rw-r--r--cui/source/dialogs/postdlg.cxx4
-rw-r--r--cui/source/dialogs/splitcelldlg.cxx4
-rw-r--r--cui/source/dialogs/zoom.cxx8
-rw-r--r--cui/source/inc/backgrnd.hxx25
-rw-r--r--cui/source/inc/cuigaldlg.hxx6
-rw-r--r--cui/source/inc/cuigrfflt.hxx10
-rw-r--r--cui/source/inc/cuitabline.hxx10
-rw-r--r--cui/source/inc/gallery.hrc1
-rw-r--r--cui/source/inc/hlinettp.hxx4
-rw-r--r--cui/source/inc/insdlg.hxx13
-rw-r--r--cui/source/inc/linkdlg.hxx20
-rw-r--r--cui/source/inc/numfmt.hxx7
-rw-r--r--cui/source/inc/optdict.hxx4
-rw-r--r--cui/source/inc/page.hxx2
-rw-r--r--cui/source/inc/paragrph.hxx10
-rw-r--r--cui/source/inc/pastedlg.hxx2
-rw-r--r--cui/source/inc/splitcelldlg.hxx4
-rw-r--r--cui/source/inc/tabstpge.hxx7
-rwxr-xr-xcui/source/options/optdict.cxx10
-rw-r--r--cui/source/options/optlingu.cxx7
-rw-r--r--cui/source/options/optlingu.hrc6
-rwxr-xr-xcui/source/options/optlingu.src13
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--cui/source/tabpages/align.cxx4
-rw-r--r--cui/source/tabpages/autocdlg.cxx27
-rw-r--r--cui/source/tabpages/autocdlg.hrc12
-rw-r--r--cui/source/tabpages/autocdlg.src40
-rw-r--r--cui/source/tabpages/backgrnd.cxx35
-rw-r--r--cui/source/tabpages/connect.cxx3
-rw-r--r--cui/source/tabpages/grfpage.cxx2
-rw-r--r--cui/source/tabpages/measure.cxx4
-rw-r--r--cui/source/tabpages/numfmt.cxx21
-rw-r--r--cui/source/tabpages/numpages.cxx9
-rw-r--r--cui/source/tabpages/page.cxx9
-rw-r--r--cui/source/tabpages/paragrph.cxx22
-rw-r--r--cui/source/tabpages/paragrph.hrc4
-rw-r--r--cui/source/tabpages/paragrph.src43
-rw-r--r--cui/source/tabpages/tabarea.hrc4
-rw-r--r--cui/source/tabpages/tabarea.src62
-rw-r--r--cui/source/tabpages/tabline.hrc26
-rw-r--r--cui/source/tabpages/tabline.src52
-rw-r--r--cui/source/tabpages/tabstpge.cxx23
-rw-r--r--cui/source/tabpages/tabstpge.hrc3
-rw-r--r--cui/source/tabpages/tabstpge.src39
-rw-r--r--cui/source/tabpages/textanim.cxx18
-rw-r--r--cui/source/tabpages/textattr.cxx2
-rw-r--r--cui/source/tabpages/tparea.cxx20
-rw-r--r--cui/source/tabpages/tpbitmap.cxx11
-rw-r--r--cui/source/tabpages/tpcolor.cxx11
-rw-r--r--cui/source/tabpages/tpgradnt.cxx10
-rw-r--r--cui/source/tabpages/tphatch.cxx10
-rw-r--r--cui/source/tabpages/tpline.cxx21
-rw-r--r--cui/source/tabpages/tplnedef.cxx13
-rw-r--r--cui/source/tabpages/tplneend.cxx3
-rw-r--r--cui/source/tabpages/tpshadow.cxx4
-rw-r--r--cui/source/tabpages/transfrm.cxx9
-rw-r--r--dbaccess/prj/build.lst2
-rw-r--r--dbaccess/source/ui/uno/ColumnControl.cxx4
-rw-r--r--dbaccess/source/ui/uno/ColumnControl.hxx1
-rw-r--r--desktop/prj/build.lst2
-rw-r--r--editeng/inc/editeng/editrids.hrc39
-rw-r--r--editeng/prj/build.lst2
-rw-r--r--editeng/source/items/page.src148
-rw-r--r--editeng/source/items/paperinf.cxx46
-rw-r--r--extensions/prj/build.lst2
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx8
-rw-r--r--extensions/source/ole/unoobjw.cxx2
-rw-r--r--extensions/source/oooimprovement/onlogrotate_job.cxx44
-rw-r--r--filter/prj/build.lst2
-rw-r--r--filter/source/pdf/impdialog.cxx48
-rw-r--r--filter/source/pdf/impdialog.hrc4
-rw-r--r--filter/source/pdf/impdialog.hxx3
-rw-r--r--filter/source/pdf/impdialog.src16
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx2
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.hrc2
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.src5
-rw-r--r--forms/prj/build.lst2
-rw-r--r--forms/source/component/Filter.cxx14
-rw-r--r--forms/source/component/Filter.hxx1
-rw-r--r--forms/source/richtext/richtextcontrol.cxx2
-rw-r--r--forms/source/richtext/richtextcontrol.hxx4
-rw-r--r--forms/source/solar/component/navbarcontrol.cxx4
-rw-r--r--forms/source/solar/component/navbarcontrol.hxx4
-rw-r--r--formula/source/ui/dlg/formula.cxx5
-rw-r--r--formula/source/ui/dlg/parawin.cxx24
-rw-r--r--formula/source/ui/dlg/parawin.hxx26
-rw-r--r--fpicker/prj/build.lst2
-rw-r--r--fpicker/source/office/iodlg.cxx1
-rw-r--r--fpicker/source/office/iodlg.hrc1
-rw-r--r--fpicker/source/office/iodlg.src4
-rw-r--r--framework/prj/build.lst2
-rw-r--r--framework/source/classes/fwktabwindow.cxx3
-rw-r--r--framework/util/fwk.component3
-rw-r--r--framework/util/fwl.component3
-rw-r--r--i18npool/inc/i18npool/lang.h5
-rw-r--r--i18npool/source/breakiterator/makefile.mk12
-rw-r--r--i18npool/source/calendar/calendar_gregorian.cxx6
-rw-r--r--i18npool/source/isolang/isolang.cxx9
-rw-r--r--i18npool/source/isolang/mslangid.cxx2
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx77
-rw-r--r--i18npool/source/localedata/data/dsb_DE.xml350
-rw-r--r--i18npool/source/localedata/data/fi_FI.xml2
-rw-r--r--i18npool/source/localedata/data/haw_US.xml358
-rw-r--r--i18npool/source/localedata/data/hsb_DE.xml2
-rw-r--r--i18npool/source/localedata/data/ht_HT.xml358
-rw-r--r--i18npool/source/localedata/data/jbo.xml358
-rw-r--r--i18npool/source/localedata/data/lif_NP.xml357
-rw-r--r--i18npool/source/localedata/data/localedata_euro.map17
-rw-r--r--i18npool/source/localedata/data/localedata_others.map104
-rw-r--r--[-rwxr-xr-x]i18npool/source/localedata/data/makefile.mk7
-rw-r--r--i18npool/source/localedata/data/no_NO.xml2
-rw-r--r--i18npool/source/localedata/data/sv_SE.xml2
-rw-r--r--i18npool/source/localedata/data/ur_PK.xml358
-rw-r--r--i18npool/source/localedata/data/yi_US.xml163
-rw-r--r--i18npool/source/localedata/localedata.cxx7
-rwxr-xr-xicu/icuversion.mk6
-rw-r--r--instsetoo_native/prj/build.lst2
-rw-r--r--instsetoo_native/util/openoffice.lst2
-rw-r--r--io/source/acceptor/acc_pipe.cxx10
-rwxr-xr-xjavainstaller2/prj/build.lst2
-rw-r--r--jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java17
-rw-r--r--jurt/com/sun/star/lib/uno/environments/remote/IProtocol.java2
-rw-r--r--jurt/com/sun/star/lib/uno/environments/remote/IThreadPool.java6
-rw-r--r--jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java9
-rw-r--r--jurt/com/sun/star/lib/uno/protocols/urp/urp.java16
-rwxr-xr-xl10ntools/scripts/localize.pl2
-rw-r--r--l10ntools/scripts/tool/l10ntool.py5
-rw-r--r--neon/neon.patch57
-rw-r--r--odk/util/check.pl12
-rw-r--r--odk/util/makefile.pmk1
-rw-r--r--offapi/com/sun/star/awt/UnoControlDialog.idl6
-rw-r--r--offapi/com/sun/star/awt/XDialog2.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl15
-rw-r--r--offapi/com/sun/star/awt/grid/GridColumnEvent.idl10
-rw-r--r--offapi/com/sun/star/awt/grid/GridControlEvent.idl54
-rw-r--r--offapi/com/sun/star/awt/grid/GridDataEvent.idl45
-rwxr-xr-xoffapi/com/sun/star/awt/grid/SortableGridDataModel.idl102
-rw-r--r--offapi/com/sun/star/awt/grid/UnoControlGridModel.idl109
-rw-r--r--offapi/com/sun/star/awt/grid/XGridCell.idl56
-rw-r--r--offapi/com/sun/star/awt/grid/XGridCellRenderer.idl52
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumn.idl106
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumnListener.idl25
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumnModel.idl82
-rw-r--r--offapi/com/sun/star/awt/grid/XGridControl.idl45
-rw-r--r--offapi/com/sun/star/awt/grid/XGridDataListener.idl17
-rw-r--r--offapi/com/sun/star/awt/grid/XGridDataModel.idl94
-rw-r--r--offapi/com/sun/star/awt/grid/XGridSelection.idl48
-rwxr-xr-xoffapi/com/sun/star/awt/grid/XMutableGridDataModel.idl163
-rwxr-xr-xoffapi/com/sun/star/awt/grid/XSortableGridData.idl77
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/awt/grid/XSortableMutableGridDataModel.idl (renamed from offapi/com/sun/star/awt/grid/ScrollBarMode.idl)51
-rw-r--r--offapi/com/sun/star/awt/grid/makefile.mk12
-rw-r--r--offapi/com/sun/star/awt/tree/XTreeControl.idl2
-rwxr-xr-x[-rw-r--r--]offapi/com/sun/star/chart/ChartLegendExpansion.idl (renamed from offapi/com/sun/star/chart2/LegendExpansion.idl)24
-rw-r--r--offapi/com/sun/star/chart/makefile.mk1
-rw-r--r--offapi/com/sun/star/chart2/CustomLegendEntry.idl50
-rw-r--r--offapi/com/sun/star/chart2/Legend.idl6
-rw-r--r--offapi/com/sun/star/chart2/LegendSymbolStyle.idl107
-rw-r--r--offapi/com/sun/star/chart2/ViewLegendEntry.idl58
-rw-r--r--offapi/com/sun/star/chart2/XLegend.idl33
-rw-r--r--offapi/com/sun/star/chart2/XLegendEntry.idl30
-rw-r--r--offapi/com/sun/star/chart2/XLegendSymbolProvider.idl35
-rw-r--r--offapi/com/sun/star/chart2/makefile.mk5
-rw-r--r--offapi/com/sun/star/i18n/TransliterationModules.idl8
-rw-r--r--offapi/com/sun/star/sdb/XSubDocument.idl8
-rw-r--r--offapi/com/sun/star/util/XTextSearch.idl150
-rw-r--r--offapi/com/sun/star/view/XMultiSelectionSupplier.idl4
-rw-r--r--offapi/com/sun/star/xml/sax/XFastAttributeList.idl4
-rw-r--r--offapi/type_reference/typelibrary_history.txt4
-rw-r--r--offapi/type_reference/types.rdbbin7307264 -> 7307264 bytes
-rw-r--r--officecfg/prj/build.lst2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu12
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Calc.xcs2
-rw-r--r--officecfg/util/makefile.mk1
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx5
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx43
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx38
-rw-r--r--oox/source/token/properties.txt1
-rw-r--r--padmin/AllLangResTarget_spa.mk48
-rw-r--r--padmin/Executable_spadmin.bin.mk70
-rw-r--r--padmin/Library_spa.mk76
-rw-r--r--[-rwxr-xr-x]padmin/Makefile (renamed from remotebridges/source/dynamicloader/makefile.mk)47
-rw-r--r--padmin/Module_padmin.mk (renamed from bridges/source/remote/context/makefile.mk)44
-rw-r--r--padmin/Package_inc.mk30
-rw-r--r--padmin/prj/build.lst2
-rw-r--r--padmin/prj/d.lst7
-rw-r--r--padmin/prj/makefile.mk (renamed from bridges/source/remote/static/makefile.mk)41
-rw-r--r--padmin/source/helper.hxx7
-rw-r--r--padmin/source/makefile.mk115
-rw-r--r--padmin/source/padialog.hxx2
-rw-r--r--padmin/source/padialog.src18
-rw-r--r--padmin/source/prtsetup.cxx6
-rw-r--r--postprocess/packcomponents/makefile.mk5
-rw-r--r--readlicense_oo/prj/build.lst2
-rw-r--r--remotebridges/prj/build.lst6
-rwxr-xr-x[-rw-r--r--]remotebridges/prj/d.lst20
-rw-r--r--remotebridges/source/bridge/bridge_connection.cxx139
-rw-r--r--remotebridges/source/bridge/bridge_connection.hxx57
-rw-r--r--remotebridges/source/bridge/bridge_provider.cxx179
-rw-r--r--remotebridges/source/bridge/makefile.mk72
-rw-r--r--remotebridges/source/bridge/remote_bridge.cxx470
-rw-r--r--remotebridges/source/bridge/remote_bridge.hxx147
-rw-r--r--remotebridges/source/bridge/remotebridge.xml47
-rw-r--r--remotebridges/source/dynamicloader/dynamicloader.cxx403
-rw-r--r--remotebridges/source/dynamicloader/dynamicloader.xml36
-rw-r--r--remotebridges/source/factory/brdgfctr.xml44
-rw-r--r--remotebridges/source/factory/bridgefactory.cxx493
-rw-r--r--remotebridges/source/factory/bridgeimpl.cxx270
-rw-r--r--remotebridges/source/factory/bridgeimpl.hxx106
-rw-r--r--reportdesign/prj/build.lst2
-rw-r--r--sal/inc/osl/thread.h12
-rw-r--r--sal/inc/osl/thread.hxx3
-rw-r--r--sal/osl/os2/thread.c4
-rw-r--r--sal/osl/unx/pipe.c2
-rw-r--r--sal/osl/unx/thread.c16
-rwxr-xr-x[-rw-r--r--]sal/osl/w32/thread.c25
-rw-r--r--sal/prj/build.lst1
-rw-r--r--sal/qa/osl/setthreadname/makefile.mk57
-rwxr-xr-xsal/qa/osl/setthreadname/test-setthreadname.cxx87
-rw-r--r--sal/qa/osl/setthreadname/version.map34
-rwxr-xr-xsal/util/sal.map1
-rw-r--r--sc/inc/dpglobal.hxx2
-rw-r--r--sc/inc/dpobject.hxx12
-rw-r--r--sc/inc/global.hxx4
-rw-r--r--sc/inc/pivot.hxx124
-rw-r--r--sc/inc/sc.hrc8
-rw-r--r--sc/inc/scabstdlg.hxx8
-rw-r--r--sc/prj/build.lst2
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/core/data/dpobject.cxx159
-rw-r--r--sc/source/core/data/global2.cxx178
-rw-r--r--sc/source/core/data/makefile.mk1
-rw-r--r--sc/source/core/data/pivot2.cxx55
-rw-r--r--sc/source/filter/dif/difimp.cxx3
-rw-r--r--sc/source/filter/excel/xechart.cxx56
-rw-r--r--sc/source/filter/excel/xichart.cxx83
-rw-r--r--sc/source/filter/inc/xechart.hxx2
-rw-r--r--sc/source/filter/inc/xichart.hxx5
-rwxr-xr-xsc/source/filter/inc/xlchart.hxx1
-rw-r--r--sc/source/filter/inc/xlconst.hxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx130
-rw-r--r--sc/source/ui/app/inputhdl.cxx7
-rwxr-xr-xsc/source/ui/app/inputwin.cxx1
-rw-r--r--sc/source/ui/attrdlg/condfrmt.cxx30
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx6
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx6
-rw-r--r--sc/source/ui/dbgui/asciiopt.cxx6
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx1
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx1191
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx59
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx35
-rw-r--r--sc/source/ui/dbgui/imoptdlg.hrc1
-rw-r--r--sc/source/ui/dbgui/imoptdlg.src12
-rw-r--r--sc/source/ui/dbgui/pivot.hrc7
-rw-r--r--sc/source/ui/dbgui/pivot.src131
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx12
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx2099
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx5
-rw-r--r--sc/source/ui/dbgui/scendlg.hrc3
-rw-r--r--sc/source/ui/dbgui/scendlg.src4
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx67
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx10
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx7
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx7
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx3
-rw-r--r--sc/source/ui/docshell/docsh.cxx41
-rw-r--r--sc/source/ui/docshell/impex.cxx6
-rw-r--r--sc/source/ui/inc/AccessibleDataPilotControl.hxx6
-rw-r--r--sc/source/ui/inc/areasdlg.hxx6
-rw-r--r--sc/source/ui/inc/condfrmt.hrc6
-rw-r--r--sc/source/ui/inc/condfrmt.hxx7
-rw-r--r--sc/source/ui/inc/fieldwnd.hxx368
-rw-r--r--sc/source/ui/inc/filldlg.hxx21
-rw-r--r--sc/source/ui/inc/filtdlg.hxx2
-rw-r--r--sc/source/ui/inc/filter.hrc7
-rw-r--r--sc/source/ui/inc/imoptdlg.hxx18
-rw-r--r--sc/source/ui/inc/instbdlg.hxx4
-rw-r--r--sc/source/ui/inc/pvfundlg.hxx22
-rw-r--r--sc/source/ui/inc/pvlaydlg.hxx283
-rw-r--r--sc/source/ui/inc/scuiimoptdlg.hxx3
-rw-r--r--sc/source/ui/inc/shtabdlg.hxx2
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx3
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx18
-rw-r--r--sc/source/ui/miscdlgs/highred.cxx1
-rw-r--r--sc/source/ui/miscdlgs/highred.src2
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx5
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx3
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx13
-rw-r--r--sc/source/ui/miscdlgs/shtabdlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/solvrdlg.cxx3
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx2
-rw-r--r--sc/source/ui/navipi/navipi.cxx4
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx6
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx2
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx3
-rw-r--r--sc/source/ui/src/condfrmt.src49
-rw-r--r--sc/source/ui/src/filter.src20
-rw-r--r--sc/source/ui/src/globstr.src38
-rw-r--r--sc/source/ui/src/popup.src4
-rw-r--r--sc/source/ui/src/scfuncs.src8
-rw-r--r--sc/source/ui/src/scstring.src25
-rw-r--r--sc/source/ui/view/gridwin2.cxx6
-rw-r--r--sc/source/ui/view/tabvwshc.cxx2
-rw-r--r--scaddins/prj/build.lst2
-rw-r--r--sccomp/prj/build.lst2
-rw-r--r--scp2/prj/build.lst2
-rwxr-xr-xscp2/source/ooo/ure.scp42
-rw-r--r--sd/prj/build.lst2
-rwxr-xr-xsd/source/ui/app/strings.src7
-rwxr-xr-xsd/source/ui/dlg/animobjs.cxx12
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/animobjs.src4
-rwxr-xr-xsd/source/ui/dlg/copydlg.cxx6
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/custsdlg.src3
-rwxr-xr-xsd/source/ui/dlg/dlgfield.cxx2
-rwxr-xr-xsd/source/ui/dlg/headerfooterdlg.cxx13
-rwxr-xr-xsd/source/ui/dlg/navigatr.cxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/navigatr.src5
-rwxr-xr-xsd/source/ui/dlg/present.cxx6
-rwxr-xr-xsd/source/ui/dlg/prntopts.cxx3
-rwxr-xr-xsd/source/ui/dlg/tpaction.cxx3
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/tpaction.src5
-rwxr-xr-xsd/source/ui/dlg/vectdlg.cxx3
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/vectdlg.src3
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/animobjs.hrc3
-rwxr-xr-xsd/source/ui/inc/animobjs.hxx5
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/copydlg.hxx6
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/dlgfield.hxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/navigatr.hrc7
-rwxr-xr-xsd/source/ui/inc/strings.hrc3
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/tpaction.hrc3
-rw-r--r--sdext/prj/build.lst2
-rw-r--r--set_soenv.in16
-rw-r--r--setup_native/prj/build.lst2
-rw-r--r--setup_native/source/mac/ooo3_installer.icnsbin49809 -> 56605 bytes
-rwxr-xr-xsetup_native/source/packinfo/packinfo_office.txt6
-rw-r--r--setup_native/source/win32/msi-encodinglist.txt27
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx2
-rw-r--r--sfx2/inc/sfx2/mgetempl.hxx2
-rwxr-xr-xsfx2/inc/sfx2/sfx.hrc3
-rw-r--r--sfx2/prj/build.lst2
-rw-r--r--sfx2/source/appl/sfx.src5
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx15
-rw-r--r--sfx2/source/dialog/dinfdlg.hrc4
-rw-r--r--sfx2/source/dialog/dinfdlg.src4
-rw-r--r--sfx2/source/dialog/mgetempl.cxx2
-rw-r--r--sfx2/source/dialog/newstyle.cxx1
-rw-r--r--sfx2/source/dialog/passwd.cxx1
-rw-r--r--sfx2/source/dialog/passwd.hrc3
-rw-r--r--sfx2/source/dialog/passwd.src37
-rw-r--r--sfx2/source/dialog/tabdlg.cxx5
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
-rw-r--r--sfx2/source/dialog/templdlg.hrc3
-rw-r--r--sfx2/source/dialog/templdlg.src4
-rwxr-xr-xshell/prj/build.lst2
-rwxr-xr-xsolenv/bin/build.pl18
-rw-r--r--solenv/bin/cws.pl74
-rw-r--r--solenv/bin/make_installer.pl3
-rw-r--r--solenv/bin/modules/CwsConfig.pm107
-rw-r--r--solenv/bin/modules/installer/globals.pm7
-rw-r--r--solenv/bin/modules/installer/windows/component.pm16
-rw-r--r--solenv/bin/modules/installer/windows/directory.pm107
-rw-r--r--solenv/bin/modules/installer/windows/file.pm232
-rw-r--r--solenv/bin/modules/installer/windows/idtglobal.pm22
-rw-r--r--solenv/bin/modules/installer/windows/msiglobal.pm109
-rw-r--r--solenv/config/sdev300.ini13
-rw-r--r--solenv/gbuild/AllLangResTarget.mk5
-rw-r--r--solenv/gbuild/SdiTarget.mk3
-rwxr-xr-xsolenv/gbuild/platform/linux.mk2
-rwxr-xr-xsolenv/gbuild/platform/solaris.mk2
-rw-r--r--solenv/inc/_cppunit.mk20
-rw-r--r--solenv/inc/cppunit.mk2
-rw-r--r--solenv/inc/extension_post.mk15
-rw-r--r--solenv/inc/langlist.mk2
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--solenv/inc/settings.mk2
-rw-r--r--solenv/inc/tg_ext.mk4
-rw-r--r--starmath/prj/build.lst2
-rw-r--r--stoc/source/corereflection/crefl.cxx2
-rw-r--r--stoc/source/corereflection/lrucache.hxx3
-rw-r--r--stoc/source/security/file_policy.cxx1
-rw-r--r--svl/prj/build.lst2
-rw-r--r--svtools/Library_svt.mk3
-rw-r--r--svtools/Package_inc.mk4
-rwxr-xr-xsvtools/inc/svtools/accessiblefactory.hxx15
-rw-r--r--svtools/inc/svtools/accessibletable.hxx10
-rw-r--r--svtools/inc/svtools/svtools.hrc9
-rw-r--r--svtools/inc/svtools/table/abstracttablecontrol.hxx134
-rw-r--r--svtools/inc/svtools/table/defaultinputhandler.hxx41
-rw-r--r--svtools/inc/svtools/table/gridtablerenderer.hxx50
-rw-r--r--svtools/inc/svtools/table/tablecontrol.hxx165
-rw-r--r--svtools/inc/svtools/table/tablecontrolinterface.hxx254
-rw-r--r--svtools/inc/svtools/table/tableinputhandler.hxx22
-rwxr-xr-x[-rw-r--r--]svtools/inc/svtools/table/tablemodel.hxx331
-rw-r--r--svtools/inc/svtools/table/tablerenderer.hxx79
-rwxr-xr-xsvtools/inc/svtools/table/tablesort.hxx91
-rw-r--r--svtools/inc/svtools/table/tabletypes.hxx7
-rw-r--r--svtools/prj/build.lst2
-rw-r--r--svtools/source/brwbox/datwin.cxx9
-rw-r--r--svtools/source/contnr/svcontnr.src27
-rwxr-xr-x[-rw-r--r--]svtools/source/control/filectrl.src40
-rwxr-xr-xsvtools/source/control/ruler.cxx1
-rwxr-xr-xsvtools/source/control/tabbar.cxx13
-rw-r--r--svtools/source/control/toolbarmenuacc.cxx2
-rw-r--r--svtools/source/control/valueacc.cxx2
-rw-r--r--svtools/source/dialogs/colrdlg.hrc2
-rw-r--r--svtools/source/dialogs/colrdlg.src38
-rw-r--r--svtools/source/inc/filectrl.hrc7
-rw-r--r--svtools/source/misc/langtab.src8
-rwxr-xr-xsvtools/source/table/cellvalueconversion.cxx77
-rwxr-xr-x[-rw-r--r--]svtools/source/table/cellvalueconversion.hxx (renamed from svtools/source/inc/accessibletableimp.hxx)48
-rw-r--r--svtools/source/table/defaultinputhandler.cxx197
-rw-r--r--svtools/source/table/gridtablerenderer.cxx663
-rwxr-xr-xsvtools/source/table/mousefunction.cxx320
-rwxr-xr-xsvtools/source/table/mousefunction.hxx161
-rw-r--r--svtools/source/table/tablecontrol.cxx788
-rwxr-xr-x[-rw-r--r--]svtools/source/table/tablecontrol_impl.cxx2601
-rwxr-xr-x[-rw-r--r--]svtools/source/table/tablecontrol_impl.hxx315
-rw-r--r--svtools/source/table/tabledatawindow.cxx199
-rw-r--r--svtools/source/table/tabledatawindow.hxx (renamed from svtools/inc/svtools/table/tabledatawindow.hxx)11
-rw-r--r--svtools/source/table/tablegeometry.cxx132
-rw-r--r--svtools/source/table/tablegeometry.hxx44
-rw-r--r--[-rwxr-xr-x]svtools/source/uno/svtxgridcontrol.cxx1045
-rwxr-xr-xsvtools/source/uno/svtxgridcontrol.hxx88
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx4
-rw-r--r--svtools/source/uno/unocontroltablemodel.cxx980
-rw-r--r--svtools/source/uno/unocontroltablemodel.hxx240
-rwxr-xr-xsvtools/source/uno/unogridcolumnfacade.cxx427
-rwxr-xr-xsvtools/source/uno/unogridcolumnfacade.hxx114
-rw-r--r--svx/inc/float3d.hrc4
-rw-r--r--svx/inc/svx/bmpmask.hxx7
-rw-r--r--svx/inc/svx/chrtitem.hxx34
-rwxr-xr-xsvx/inc/svx/dialogs.hrc16
-rw-r--r--svx/inc/svx/float3d.hxx26
-rw-r--r--svx/inc/svx/fontworkgallery.hxx2
-rw-r--r--svx/inc/svx/hdft.hxx2
-rw-r--r--svx/inc/svx/svdstr.hrc8
-rw-r--r--svx/prj/build.lst2
-rw-r--r--svx/source/dialog/_bmpmask.cxx43
-rw-r--r--svx/source/dialog/bmpmask.hrc6
-rw-r--r--svx/source/dialog/bmpmask.src55
-rw-r--r--svx/source/dialog/ctredlin.cxx18
-rw-r--r--svx/source/dialog/ctredlin.hrc9
-rw-r--r--svx/source/dialog/ctredlin.src36
-rw-r--r--svx/source/dialog/dlgctl3d.cxx2
-rw-r--r--svx/source/dialog/dlgctrl.src7
-rw-r--r--svx/source/dialog/hdft.cxx16
-rw-r--r--svx/source/dialog/optgrid.cxx11
-rw-r--r--svx/source/dialog/rubydialog.cxx8
-rw-r--r--svx/source/dialog/sdstring.src121
-rw-r--r--svx/source/dialog/srchdlg.cxx8
-rw-r--r--svx/source/engine3d/float3d.cxx110
-rw-r--r--svx/source/engine3d/float3d.src55
-rw-r--r--svx/source/fmcomp/fmgridif.cxx3
-rw-r--r--svx/source/form/formcontroller.cxx7
-rw-r--r--svx/source/gallery2/galbrws1.cxx3
-rw-r--r--svx/source/gallery2/galbrws2.cxx24
-rw-r--r--svx/source/gallery2/gallery.src82
-rw-r--r--svx/source/items/chrtitem.cxx34
-rw-r--r--svx/source/svdraw/svdstr.src82
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx2
-rw-r--r--svx/source/tbxctrls/colrctrl.src33
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx8
-rw-r--r--svx/source/tbxctrls/tbcontrl.src6
-rw-r--r--sw/Module_sw.mk6
-rw-r--r--sw/inc/access.hrc15
-rw-r--r--sw/inc/colwd.hxx2
-rw-r--r--sw/inc/fesh.hxx5
-rw-r--r--sw/inc/poolfmt.hrc9
-rw-r--r--sw/inc/unomap.hxx6
-rw-r--r--sw/prj/build.lst2
-rw-r--r--sw/source/core/doc/docdraw.cxx20
-rw-r--r--sw/source/core/draw/dflyobj.cxx29
-rw-r--r--sw/source/core/draw/dview.cxx10
-rw-r--r--sw/source/core/frmedt/fews.cxx170
-rw-r--r--sw/source/core/inc/anchoredobjectposition.hxx60
-rw-r--r--sw/source/core/inc/frame.hxx48
-rw-r--r--sw/source/core/layout/calcmove.cxx17
-rw-r--r--sw/source/core/layout/colfrm.cxx3
-rw-r--r--sw/source/core/layout/findfrm.cxx3
-rw-r--r--sw/source/core/layout/fly.cxx12
-rw-r--r--sw/source/core/layout/flycnt.cxx169
-rw-r--r--sw/source/core/layout/ftnfrm.cxx6
-rw-r--r--sw/source/core/layout/layact.cxx10
-rw-r--r--sw/source/core/layout/newfrm.cxx58
-rw-r--r--sw/source/core/layout/pagechg.cxx13
-rw-r--r--sw/source/core/layout/paintfrm.cxx20
-rw-r--r--sw/source/core/layout/ssfrm.cxx13
-rw-r--r--sw/source/core/layout/tabfrm.cxx6
-rw-r--r--sw/source/core/layout/trvlfrm.cxx3
-rw-r--r--sw/source/core/layout/wsfrm.cxx54
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx102
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx109
-rw-r--r--sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx12
-rw-r--r--sw/source/core/text/frmcrsr.cxx13
-rw-r--r--sw/source/core/text/frmform.cxx18
-rw-r--r--sw/source/core/text/frmpaint.cxx4
-rw-r--r--sw/source/core/text/inftxt.cxx6
-rw-r--r--sw/source/core/text/itrtxt.cxx6
-rw-r--r--sw/source/core/text/txtfrm.cxx89
-rw-r--r--sw/source/core/text/txttab.cxx7
-rw-r--r--sw/source/core/text/widorp.cxx10
-rw-r--r--sw/source/filter/ascii/parasc.cxx2
-rw-r--r--sw/source/ui/chrdlg/break.cxx5
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx2
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx4
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx6
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx4
-rw-r--r--sw/source/ui/config/optpage.cxx9
-rw-r--r--sw/source/ui/dialog/docstdlg.cxx18
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx10
-rw-r--r--sw/source/ui/docvw/access.src19
-rw-r--r--sw/source/ui/docvw/edtwin.cxx8
-rw-r--r--sw/source/ui/envelp/label1.cxx10
-rw-r--r--sw/source/ui/envelp/labprt.cxx6
-rw-r--r--sw/source/ui/envelp/labprt.hxx4
-rw-r--r--sw/source/ui/envelp/swuilabimp.hxx7
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx16
-rw-r--r--sw/source/ui/frmdlg/column.cxx43
-rw-r--r--sw/source/ui/frmdlg/column.hrc1
-rw-r--r--sw/source/ui/frmdlg/column.src12
-rw-r--r--sw/source/ui/frmdlg/frmmgr.cxx18
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx112
-rw-r--r--sw/source/ui/inc/bookmark.hxx2
-rw-r--r--sw/source/ui/inc/break.hxx2
-rw-r--r--sw/source/ui/inc/column.hxx6
-rw-r--r--sw/source/ui/inc/docstdlg.hxx17
-rw-r--r--sw/source/ui/inc/drpcps.hxx4
-rw-r--r--sw/source/ui/inc/frmmgr.hxx3
-rw-r--r--sw/source/ui/inc/frmpage.hxx15
-rw-r--r--sw/source/ui/inc/glosbib.hxx7
-rw-r--r--sw/source/ui/inc/insfnote.hxx8
-rw-r--r--sw/source/ui/inc/linenum.hxx6
-rw-r--r--sw/source/ui/inc/num.hxx4
-rw-r--r--sw/source/ui/inc/numpara.hxx2
-rw-r--r--sw/source/ui/inc/optpage.hxx2
-rw-r--r--sw/source/ui/inc/outline.hxx4
-rw-r--r--sw/source/ui/inc/pgfnote.hxx4
-rw-r--r--sw/source/ui/inc/rowht.hxx2
-rw-r--r--sw/source/ui/inc/split.hxx4
-rw-r--r--sw/source/ui/inc/srtdlg.hxx4
-rw-r--r--sw/source/ui/inc/swrenamexnameddlg.hxx2
-rw-r--r--sw/source/ui/inc/swuicnttab.hxx10
-rw-r--r--sw/source/ui/inc/swuiidxmrk.hxx2
-rw-r--r--sw/source/ui/inc/tautofmt.hxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx38
-rw-r--r--sw/source/ui/index/cnttab.hrc1
-rw-r--r--sw/source/ui/index/cnttab.src6
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx4
-rw-r--r--sw/source/ui/misc/bookmark.cxx3
-rw-r--r--sw/source/ui/misc/docfnote.cxx11
-rw-r--r--sw/source/ui/misc/glosbib.cxx7
-rw-r--r--sw/source/ui/misc/glossary.cxx11
-rw-r--r--sw/source/ui/misc/glossary.src8
-rw-r--r--sw/source/ui/misc/impfnote.hxx8
-rw-r--r--sw/source/ui/misc/insfnote.cxx8
-rw-r--r--sw/source/ui/misc/insfnote.hrc4
-rw-r--r--sw/source/ui/misc/insfnote.src6
-rw-r--r--sw/source/ui/misc/linenum.cxx19
-rw-r--r--sw/source/ui/misc/num.cxx5
-rw-r--r--sw/source/ui/misc/outline.cxx13
-rw-r--r--sw/source/ui/misc/pgfnote.cxx10
-rw-r--r--sw/source/ui/misc/srtdlg.cxx44
-rw-r--r--sw/source/ui/shells/drwbassh.cxx11
-rw-r--r--sw/source/ui/table/colwd.cxx2
-rw-r--r--sw/source/ui/table/convert.cxx2
-rw-r--r--sw/source/ui/table/convert.hrc3
-rw-r--r--sw/source/ui/table/convert.src6
-rw-r--r--sw/source/ui/table/rowht.cxx2
-rw-r--r--sw/source/ui/table/tabledlg.cxx24
-rw-r--r--sw/source/ui/table/tabledlg.hrc1
-rw-r--r--sw/source/ui/table/tabledlg.src1
-rw-r--r--sw/source/ui/table/tablepg.hxx3
-rw-r--r--sw/source/ui/table/tautofmt.cxx2
-rw-r--r--sw/source/ui/uiview/viewtab.cxx33
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx17
-rw-r--r--sw/source/ui/utlui/navipi.cxx8
-rw-r--r--sw/source/ui/utlui/navipi.hrc1
-rw-r--r--sw/source/ui/utlui/navipi.src13
-rw-r--r--sw/source/ui/utlui/poolfmt.src23
-rw-r--r--sw/source/ui/utlui/swrenamexnameddlg.cxx4
-rw-r--r--swext/prj/build.lst2
-rw-r--r--sysui/prj/build.lst2
-rwxr-xr-xtestautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc17
-rw-r--r--testautomation/framework/optional/includes/configuration.inc66
-rw-r--r--testautomation/framework/optional/includes/options_loadsave_general.inc3
-rw-r--r--testautomation/framework/optional/includes/options_ooo_colors.inc10
-rw-r--r--testautomation/framework/optional/includes/options_ooo_general.inc6
-rw-r--r--testautomation/global/required/includes/g_printing.inc4
-rw-r--r--testautomation/global/system/includes/iniinfo.inc36
-rwxr-xr-xtestautomation/global/win/dial_d_h.win1
-rwxr-xr-xtestautomation/global/win/edia_p_s.win2
-rw-r--r--testautomation/math/optional/includes/m_101_.inc3
-rw-r--r--testautomation/math/optional/includes/m_105.inc10
-rwxr-xr-xtestautomation/math/required/includes/m_001_.inc6
-rw-r--r--testautomation/math/required/includes/m_005_.inc3
-rw-r--r--testautomation/math/required/includes/m_007_.inc3
-rw-r--r--testautomation/spreadsheet/required/includes/c_upd_filemenu.inc64
-rw-r--r--toolkit/Library_tk.mk2
-rw-r--r--toolkit/inc/toolkit/awt/vclxcontainer.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxtopwindow.hxx2
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindows.hxx2
-rwxr-xr-xtoolkit/inc/toolkit/controls/animatedimages.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx7
-rw-r--r--toolkit/inc/toolkit/controls/dialogcontrol.hxx6
-rw-r--r--toolkit/inc/toolkit/controls/formattedcontrol.hxx9
-rw-r--r--toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx3
-rw-r--r--toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx16
-rw-r--r--toolkit/inc/toolkit/controls/roadmapcontrol.hxx38
-rwxr-xr-xtoolkit/inc/toolkit/controls/spinningprogress.hxx2
-rw-r--r--toolkit/inc/toolkit/controls/tabpagecontainer.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/tabpagemodel.hxx5
-rw-r--r--toolkit/inc/toolkit/controls/tkscrollbar.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/tksimpleanimation.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/tkspinbutton.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/tkthrobber.hxx4
-rw-r--r--toolkit/inc/toolkit/controls/unocontrol.hxx7
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolbase.hxx8
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolcontainer.hxx5
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx2
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolmodel.hxx49
-rw-r--r--toolkit/inc/toolkit/controls/unocontrols.hxx95
-rw-r--r--toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx6
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx13
-rw-r--r--toolkit/inc/toolkit/helper/servicenames.hxx1
-rw-r--r--toolkit/prj/build.lst5
-rwxr-xr-xtoolkit/qa/complex/toolkit/AccessibleStatusBar.java (renamed from toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java)107
-rwxr-xr-xtoolkit/qa/complex/toolkit/AccessibleStatusBarItem.java (renamed from toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java)122
-rwxr-xr-xtoolkit/qa/complex/toolkit/Assert.java234
-rw-r--r--toolkit/qa/complex/toolkit/CallbackClass.java67
-rw-r--r--toolkit/qa/complex/toolkit/CheckAsyncCallback.java156
-rwxr-xr-xtoolkit/qa/complex/toolkit/GridControl.java687
-rw-r--r--toolkit/qa/complex/toolkit/UnitConversion.java247
-rw-r--r--toolkit/qa/complex/toolkit/_XRequestCallback.java88
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java (renamed from toolkit/qa/complex/toolkit/_XAccessibleComponent.java)3
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java (renamed from toolkit/qa/complex/toolkit/_XAccessibleContext.java)2
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java (renamed from toolkit/qa/complex/toolkit/_XAccessibleEventBroadcaster.java)14
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java (renamed from toolkit/qa/complex/toolkit/_XAccessibleExtendedComponent.java)2
-rwxr-xr-xtoolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java (renamed from toolkit/qa/complex/toolkit/_XAccessibleText.java)2
-rwxr-xr-xtoolkit/qa/complex/toolkit/awtgrid/DummyColumn.java180
-rwxr-xr-xtoolkit/qa/complex/toolkit/awtgrid/GridDataListener.java98
-rwxr-xr-xtoolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java314
-rwxr-xr-xtoolkit/qa/complex/toolkit/makefile.mk97
-rw-r--r--toolkit/qa/complex/xunitconversion/XUnitConversionTest.java250
-rw-r--r--toolkit/source/awt/vclxaccessiblecomponent.cxx4
-rwxr-xr-xtoolkit/source/controls/animatedimages.cxx10
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx129
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx13
-rw-r--r--toolkit/source/controls/formattedcontrol.cxx8
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx460
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.hxx81
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx567
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.hxx99
-rw-r--r--toolkit/source/controls/grid/gridcolumn.cxx480
-rw-r--r--toolkit/source/controls/grid/gridcolumn.hxx114
-rw-r--r--toolkit/source/controls/grid/gridcontrol.cxx313
-rw-r--r--toolkit/source/controls/grid/gridcontrol.hxx55
-rwxr-xr-xtoolkit/source/controls/grid/grideventforwarder.cxx149
-rwxr-xr-xtoolkit/source/controls/grid/grideventforwarder.hxx85
-rwxr-xr-xtoolkit/source/controls/grid/initguard.hxx64
-rwxr-xr-xtoolkit/source/controls/grid/sortablegriddatamodel.cxx877
-rwxr-xr-xtoolkit/source/controls/grid/sortablegriddatamodel.hxx198
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx8
-rwxr-xr-xtoolkit/source/controls/spinningprogress.cxx4
-rw-r--r--toolkit/source/controls/tabpagecontainer.cxx18
-rw-r--r--toolkit/source/controls/tabpagemodel.cxx20
-rw-r--r--toolkit/source/controls/tkscrollbar.cxx8
-rw-r--r--toolkit/source/controls/tksimpleanimation.cxx6
-rw-r--r--toolkit/source/controls/tkspinbutton.cxx8
-rw-r--r--toolkit/source/controls/tkthrobber.cxx6
-rw-r--r--toolkit/source/controls/tree/treecontrol.cxx20
-rw-r--r--toolkit/source/controls/tree/treecontrol.hxx7
-rw-r--r--toolkit/source/controls/unocontrol.cxx22
-rw-r--r--toolkit/source/controls/unocontrolbase.cxx9
-rw-r--r--toolkit/source/controls/unocontrolcontainer.cxx9
-rw-r--r--toolkit/source/controls/unocontrolcontainermodel.cxx3
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx64
-rw-r--r--toolkit/source/controls/unocontrols.cxx157
-rw-r--r--toolkit/source/helper/property.cxx22
-rw-r--r--toolkit/source/helper/registerservices.cxx299
-rw-r--r--toolkit/source/helper/servicenames.cxx1
-rw-r--r--toolkit/source/helper/unowrapper.cxx1
-rw-r--r--toolkit/source/helper/vclunohelper.cxx5
-rw-r--r--toolkit/util/tk.component5
-rw-r--r--tools/inc/tools/stream.hxx17
-rw-r--r--tools/inc/tools/wintypes.hxx3
-rwxr-xr-xtools/source/stream/stream.cxx46
-rw-r--r--ucb/source/ucp/tdoc/tdoc_docmgr.cxx105
-rw-r--r--ucb/source/ucp/tdoc/tdoc_docmgr.hxx34
-rw-r--r--unotools/inc/unotools/textsearch.hxx9
-rw-r--r--unotools/source/i18n/textsearch.cxx37
-rw-r--r--ure/prj/build.lst2
-rw-r--r--ure/source/README10
-rw-r--r--ure/source/makefile.mk3
-rw-r--r--uui/prj/build.lst2
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx13
-rw-r--r--vbahelper/source/vbahelper/vbadocumentbase.cxx13
-rw-r--r--vbahelper/source/vbahelper/vbadocumentsbase.cxx61
-rw-r--r--vcl/aqua/inc/salgdi.h8
-rw-r--r--vcl/aqua/source/dtrans/DragSource.cxx13
-rw-r--r--vcl/aqua/source/dtrans/service_entry.cxx14
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm8
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx59
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx10
-rw-r--r--vcl/inc/vcl/cvtsvm.hxx2
-rw-r--r--vcl/inc/vcl/displayconnectiondispatch.hxx52
-rw-r--r--vcl/inc/vcl/dllapi.h6
-rw-r--r--vcl/inc/vcl/fontcache.hxx2
-rw-r--r--vcl/inc/vcl/fontmanager.hxx2
-rw-r--r--vcl/inc/vcl/glyphcache.hxx12
-rw-r--r--vcl/inc/vcl/graphite_adaptors.hxx2
-rw-r--r--vcl/inc/vcl/graphite_layout.hxx6
-rw-r--r--vcl/inc/vcl/graphite_serverfont.hxx8
-rw-r--r--vcl/inc/vcl/help.hxx38
-rw-r--r--vcl/inc/vcl/helpwin.hxx3
-rw-r--r--vcl/inc/vcl/impfont.hxx8
-rw-r--r--vcl/inc/vcl/lineinfo.hxx2
-rw-r--r--vcl/inc/vcl/octree.hxx6
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/outdev.hxx6
-rw-r--r--vcl/inc/vcl/outfont.hxx6
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx9
-rw-r--r--vcl/inc/vcl/print.h2
-rw-r--r--vcl/inc/vcl/print.hxx17
-rw-r--r--vcl/inc/vcl/prndlg.hxx6
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/region.hxx13
-rw-r--r--vcl/inc/vcl/salbmp.hxx2
-rw-r--r--vcl/inc/vcl/saldatabasic.hxx2
-rw-r--r--vcl/inc/vcl/salframe.hxx2
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/salgdi.hxx15
-rw-r--r--vcl/inc/vcl/salimestatus.hxx2
-rw-r--r--vcl/inc/vcl/salinst.hxx38
-rwxr-xr-xvcl/inc/vcl/sallayout.hxx12
-rw-r--r--vcl/inc/vcl/salmenu.hxx4
-rwxr-xr-xvcl/inc/vcl/salnativewidgets.hxx2
-rw-r--r--vcl/inc/vcl/salobj.hxx2
-rw-r--r--vcl/inc/vcl/salprn.hxx6
-rw-r--r--vcl/inc/vcl/salsession.hxx2
-rw-r--r--vcl/inc/vcl/salsys.hxx2
-rw-r--r--vcl/inc/vcl/saltimer.hxx2
-rw-r--r--vcl/inc/vcl/salvd.hxx2
-rw-r--r--vcl/inc/vcl/svdata.hxx18
-rw-r--r--vcl/inc/vcl/svids.hrc4
-rw-r--r--vcl/inc/vcl/sysdata.hxx5
-rw-r--r--vcl/inc/vcl/syswin.hxx2
-rw-r--r--vcl/inc/vcl/window.h18
-rwxr-xr-xvcl/inc/vcl/window.hxx14
-rw-r--r--vcl/inc/vcl/xconnection.hxx15
-rw-r--r--vcl/os2/inc/salgdi.h8
-rw-r--r--vcl/os2/source/gdi/salgdi.cxx50
-rw-r--r--vcl/prj/build.lst2
-rw-r--r--vcl/source/app/help.cxx47
-rw-r--r--vcl/source/app/session.cxx36
-rw-r--r--vcl/source/app/svapp.cxx5
-rw-r--r--vcl/source/app/svdata.cxx15
-rw-r--r--vcl/source/app/svmain.cxx16
-rwxr-xr-xvcl/source/control/edit.cxx24
-rw-r--r--vcl/source/control/tabctrl.cxx19
-rw-r--r--vcl/source/gdi/bitmap.cxx10
-rw-r--r--vcl/source/gdi/lineinfo.cxx22
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdev.cxx847
-rw-r--r--vcl/source/gdi/outdev3.cxx8
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx307
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx11
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx511
-rw-r--r--vcl/source/gdi/print.cxx44
-rw-r--r--vcl/source/gdi/print2.cxx35
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/region.cxx193
-rwxr-xr-xvcl/source/gdi/salgdilayout.cxx60
-rw-r--r--vcl/source/helper/xconnection.cxx77
-rw-r--r--vcl/source/src/print.src60
-rw-r--r--vcl/source/window/dlgctrl.cxx73
-rw-r--r--vcl/source/window/msgbox.cxx2
-rw-r--r--vcl/source/window/printdlg.cxx32
-rw-r--r--vcl/source/window/window.cxx151
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx6
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx25
-rw-r--r--vcl/unx/headless/svpgdi.cxx50
-rw-r--r--vcl/unx/headless/svpgdi.hxx5
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx36
-rw-r--r--vcl/unx/headless/svppspgraphics.hxx5
-rw-r--r--vcl/unx/inc/dtint.hxx2
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkgdi.hxx5
-rw-r--r--vcl/unx/inc/pspgraphics.h5
-rw-r--r--vcl/unx/inc/salgdi.h8
-rw-r--r--vcl/unx/source/dtrans/X11_clipboard.hxx26
-rw-r--r--vcl/unx/source/dtrans/X11_dndcontext.hxx6
-rw-r--r--vcl/unx/source/dtrans/X11_selection.cxx68
-rw-r--r--vcl/unx/source/dtrans/X11_selection.hxx39
-rw-r--r--vcl/unx/source/dtrans/X11_service.cxx24
-rw-r--r--vcl/unx/source/dtrans/X11_transferable.hxx4
-rw-r--r--vcl/unx/source/fontmanager/fontmanager.cxx10
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx36
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx84
-rw-r--r--vcl/unx/source/gdi/salgdi2.cxx12
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx24
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx2
-rwxr-xr-xvcl/win/inc/salgdi.h10
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/salgdi.cxx213
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/salgdi2.cxx3
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/salprn.cxx9
-rwxr-xr-xvcl/win/source/window/salframe.cxx7
-rw-r--r--wizards/prj/build.lst2
-rw-r--r--xmloff/Library_xo.mk2
-rw-r--r--xmloff/inc/SchXMLImport.hxx8
-rw-r--r--xmloff/inc/xmloff/SchXMLImportHelper.hxx2
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx6
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx128
-rw-r--r--xmloff/source/chart/SchXMLChartContext.hxx15
-rwxr-xr-xxmloff/source/chart/SchXMLEnumConverter.cxx104
-rwxr-xr-x[-rw-r--r--]xmloff/source/chart/SchXMLEnumConverter.hxx (renamed from sc/source/ui/dbgui/pvglob.hxx)17
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx89
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx22
-rwxr-xr-xxmloff/source/chart/SchXMLLegendContext.cxx229
-rwxr-xr-x[-rw-r--r--]xmloff/source/chart/SchXMLLegendContext.hxx (renamed from offapi/com/sun/star/awt/grid/XGridControlListener.idl)29
-rw-r--r--xmloff/source/chart/makefile.mk2
-rw-r--r--xmloff/source/core/xmltoken.cxx6
-rw-r--r--xmlsecurity/prj/build.lst2
1011 files changed, 32637 insertions, 28154 deletions
diff --git a/Module_ooo.mk b/Module_ooo.mk
index b2605d0b909a..307daf7c4b00 100644
--- a/Module_ooo.mk
+++ b/Module_ooo.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\
comphelper \
editeng \
framework \
+ padmin \
sfx2 \
sot \
svl \
diff --git a/Repository.mk b/Repository.mk
index cc14cc00b6eb..87bbafa59baf 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -38,6 +38,10 @@ $(eval $(call gb_Helper_register_executables,NONE, \
sspretty \
))
+$(eval $(call gb_Helper_register_executables,OOO, \
+ spadmin.bin \
+))
+
$(eval $(call gb_Helper_register_libraries,OOOLIBS, \
avmedia \
basegfx \
@@ -59,6 +63,7 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \
sb \
sfx \
sot \
+ spa \
svl \
svt \
svx \
@@ -124,6 +129,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
jpeglib \
ooopathutils \
salcpprt \
+ vclmain \
zlib \
vclmain \
))
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx
deleted file mode 100644
index 829a4337e878..000000000000
--- a/accessibility/inc/accessibility/standard/vclxaccessiblelistboxlist.hxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOXLIST_HXX
-#define ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOXLIST_HXX
-
-#include <accessibility/standard/vclxaccessiblelist.hxx>
-#include <com/sun/star/accessibility/XAccessibleAction.hpp>
-#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
-#ifndef _COMPHELPER_BROADCASTHELPER_HXX
-#include <comphelper/broadcasthelper.hxx>
-#endif
-#ifndef _COMPHELPER_UNO3_HXX
-#include <comphelper/uno3.hxx>
-#endif
-#ifndef _CPPUHELPER_IMPLBASE1_HXX
-#include <cppuhelper/implbase1.hxx>
-#endif
-
-typedef ::cppu::ImplHelper1 < ::com::sun::star::accessibility::XAccessibleSelection
- > VCLXAccessibleListBoxList_BASE;
-
-
-class ListBox;
-/** This class extends the list of the <type>VCLXAccessibleList</type> class
- about selection.
-*/
-class VCLXAccessibleListBoxList :
- public VCLXAccessibleList,
- public VCLXAccessibleListBoxList_BASE
-{
-public:
- VCLXAccessibleListBoxList (VCLXWindow* pVCLXindow, BoxType aBoxType,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible >& _xParent);
-
- // XInterface
- DECLARE_XINTERFACE( )
-
- // XTypeProvider
- DECLARE_XTYPEPROVIDER( )
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName (void)
- throw (::com::sun::star::uno::RuntimeException);
- // Return list box list specific services.
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames (void)
- throw (::com::sun::star::uno::RuntimeException);
-
- // XAccessibleSelection
- void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException);
- void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException);
- sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
-
- /** Create the specified child and insert it into the list of children.
- Sets the child's states.
- */
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- CreateChild (sal_Int32 i);
-
-
-protected:
- virtual ~VCLXAccessibleListBoxList (void);
-
- virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent);
-
-private:
- sal_Int32 m_nLastTopEntry;
- sal_uInt16 m_nLastSelectedPos;
- bool m_bDisableProcessEvent;
-
- void UpdateEntryRange_Impl (void);
- using VCLXAccessibleList::UpdateSelection_Impl;
- void UpdateSelection_Impl (void);
- using VCLXAccessibleList::checkEntrySelected;
- sal_Bool checkEntrySelected(ListBox* _pListBox,
- sal_uInt16 _nPos,
- ::com::sun::star::uno::Any& _rNewValue,
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxNewAcc);
-};
-
-#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX
-
diff --git a/accessibility/prj/build.lst b/accessibility/prj/build.lst
index 4fbfe135137f..c9a8c345e056 100755
--- a/accessibility/prj/build.lst
+++ b/accessibility/prj/build.lst
@@ -1,4 +1,4 @@
-ac accessibility : l10n tools jurt offuh unoil vcl javaunohelper jvmaccess cppu sal toolkit svtools LIBXSLT:libxslt NULL
+ac accessibility : L10N:l10n tools jurt offuh unoil vcl javaunohelper jvmaccess cppu sal toolkit svtools LIBXSLT:libxslt NULL
ac accessibility usr1 - all ac_mkout NULL
ac accessibility\inc nmake - all ac_inc NULL
ac accessibility\bridge\org\openoffice\java\accessibility nmake - w ac_ooja ac_inc NULL
diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx
index 461e776f1392..406baeb2973c 100755
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -245,8 +245,7 @@ void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChil
ensureIsValidIndex( nChildIndex );
sal_Int32 nColumns = m_aTable.GetColumnCount();
sal_Int32 nRow = (nChildIndex / nColumns);
- std::vector< sal_Int32 > selectedRows = m_aTable.GetSelectedRows();
- selectedRows.push_back(nRow);
+ m_aTable.SelectRow( nRow, sal_True );
}
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleChildSelected( sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
@@ -265,8 +264,7 @@ void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection()
TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
- for(unsigned int i=0;i<m_aTable.GetSelectedRows().size();i++)
- m_aTable.RemoveSelectedRow((sal_Int32)i);
+ m_aTable.SelectAllRows( false );
}
void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren()
throw ( uno::RuntimeException )
diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
index f6d1147ad309..d97feb1277ec 100755..100644
--- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
@@ -245,7 +245,10 @@ sal_Int32 AccessibleGridControlTableBase::implGetChildIndex(
void AccessibleGridControlTableBase::implGetSelectedRows( Sequence< sal_Int32 >& rSeq )
{
- rSeq = comphelper::containerToSequence(m_aTable.GetSelectedRows());
+ sal_Int32 const selectionCount( m_aTable.GetSelectedRowCount() );
+ rSeq.realloc( selectionCount );
+ for ( sal_Int32 i=0; i<selectionCount; ++i )
+ rSeq[i] = m_aTable.GetSelectedRowIndex(i);
}
void AccessibleGridControlTableBase::ensureIsValidRow( sal_Int32 nRow )
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index 784588938bb8..86b98768736a 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -31,7 +31,6 @@
#include <accessibility/standard/vclxaccessibletextfield.hxx>
#include <accessibility/standard/vclxaccessibleedit.hxx>
#include <accessibility/standard/vclxaccessiblelist.hxx>
-#include <accessibility/standard/vclxaccessiblelistboxlist.hxx>
#include <accessibility/helper/listboxhelper.hxx>
#include <unotools/accessiblestatesethelper.hxx>
diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index 4b40f39a1d77..8b7a57bb4a47 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -82,6 +82,7 @@
#include <svtools/valueset.hxx>
#include <svtools/roadmap.hxx>
#include <svtools/table/tablecontrol.hxx>
+#include <svtools/table/tablecontrolinterface.hxx>
#include <svl/poolitem.hxx>
#include <svtools/extensionlistbox.hxx>
// Hat keinen Includeschutz
@@ -6111,7 +6112,8 @@ protected:
ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() ))
{
::svt::table::PTableModel pModel = pTC->GetModel();
- Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1];
+ Any aCell;
+ pModel->getCellContent( nNr1-1, nNr2-1, aCell );
pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() ));
}
}
@@ -6122,7 +6124,8 @@ protected:
ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() ))
{
::svt::table::PTableModel pModel = pTC->GetModel();
- Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1];
+ Any aCell;
+ pModel->getCellContent( nNr1-1, nNr2-1, aCell );
/* doesn't work ATM since it gets casted to SbxDATE in VCLTestTool unfortunately
SbxVariableRef xRes = new SbxVariable( SbxVARIANT );
unoToSbxValue( xRes, aCell );
@@ -6206,7 +6209,7 @@ protected:
Point aPos( aSize.Width() / 2, aSize.Height() / 2 );
long nStep = aSize.Height() / 4;
::svt::table::RowPos nLastPos;
- while ( ( nLastPos = pTC->GetCurrentRow( aPos ) ) != nNr1-1 && nStep > 0 )
+ while ( ( nLastPos = pTC->getTableControlInterface().hitTest( aPos ).nRow ) != nNr1-1 && nStep > 0 )
{
if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID )
aPos.Y() -= nStep;
@@ -6214,7 +6217,7 @@ protected:
aPos.Y() += nStep;
nStep /= 2;
}
- if ( pTC->GetCurrentRow( aPos ) == nNr1-1 )
+ if ( pTC->getTableControlInterface().hitTest( aPos ).nRow == nNr1-1 )
{
MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1);
pTC->getSelEngine()->SelMouseButtonDown( aMEvnt );
@@ -6231,13 +6234,13 @@ protected:
}
break;
case M_GetSelCount :
- pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows().size() ));
+ pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRowCount() ));
break;
case M_GetSelIndex :
if ( ! (nParams & PARAM_USHORT_1) )
nNr1 = 1;
- if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRows().size() ) )
- pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows()[nNr1-1] +1 ) );
+ if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRowCount() ) )
+ pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRowIndex( nNr1-1 ) +1 ) );
break;
/* case M_GetSelText :
if ( ! (nParams & PARAM_USHORT_1) )
diff --git a/avmedia/prj/build.lst b/avmedia/prj/build.lst
index 2348b606dcab..7d9343b916fd 100644
--- a/avmedia/prj/build.lst
+++ b/avmedia/prj/build.lst
@@ -1,4 +1,4 @@
-av avmedia : l10n tools sfx2 LIBXSLT:libxslt NULL
+av avmedia : L10N:l10n tools sfx2 LIBXSLT:libxslt NULL
av avmedia usr1 - all av_mkout NULL
av avmedia\prj get - all av_prj NULL
av avmedia\inc get - all av_inv NULL
diff --git a/basctl/prj/build.lst b/basctl/prj/build.lst
index 0c5283ff0aec..1f92577d2eae 100644
--- a/basctl/prj/build.lst
+++ b/basctl/prj/build.lst
@@ -1,4 +1,4 @@
-bc basctl : LIBXSLT:libxslt l10n svx NULL
+bc basctl : LIBXSLT:libxslt L10N:l10n svx NULL
bc basctl usr1 - all bc_mkout NULL
bc basctl\inc nmake - all bc_inc NULL
bc basctl\source\inc get - all bc_sinc NULL
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 8dcad1f5608b..25aa457cfcc2 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1183,6 +1183,9 @@ WatchWindow::WatchWindow( Window* pParent ) :
| WB_HASLINESATROOT | WB_HASBUTTONSATROOT ),
aHeaderBar( this, WB_BUTTONSTYLE | WB_BORDER )
{
+ aXEdit.SetAccessibleName(String(IDEResId( RID_STR_WATCHNAME)));
+ aTreeListBox.SetAccessibleName(String(IDEResId(RID_STR_WATCHNAME)));
+
nVirtToolBoxHeight = aXEdit.GetSizePixel().Height() + 7;
nHeaderBarHeight = 16;
@@ -1521,7 +1524,8 @@ StackWindow::StackWindow( Window* pParent ) :
aGotoCallButton( this, IDEResId( RID_IMGBTN_GOTOCALL ) ),
aStackStr( IDEResId( RID_STR_STACK ) )
{
- aTreeListBox.SetHelpId(HID_BASICIDE_STACKWINDOW_LIST);
+ aTreeListBox.SetHelpId(HID_BASICIDE_STACKWINDOW_LIST);
+ aTreeListBox.SetAccessibleName(String( IDEResId(RID_STR_STACKNAME)));
aTreeListBox.SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) );
aTreeListBox.SetHighlightRange();
aTreeListBox.SetSelectionMode( NO_SELECTION );
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 4d6bfa923f37..b6fef1100e4e 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -498,9 +498,9 @@ LibPage::LibPage( Window * pParent )
,aEditButton( this, IDEResId( RID_PB_EDIT ) )
,aCloseButton( this, IDEResId( RID_PB_CLOSE ) )
,aPasswordButton( this, IDEResId( RID_PB_PASSWORD ) )
- ,aExportButton( this, IDEResId( RID_PB_EXPORT ) )
,aNewLibButton( this, IDEResId( RID_PB_NEWLIB ) )
,aInsertLibButton( this, IDEResId( RID_PB_APPEND ) )
+ ,aExportButton( this, IDEResId( RID_PB_EXPORT ) )
,aDelButton( this, IDEResId( RID_PB_DELETE ) )
,m_aCurDocument( ScriptDocument::getApplicationScriptDocument() )
,m_eCurLocation( LIBRARY_LOCATION_UNKNOWN )
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index 93263b020453..7152e699da3b 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -229,9 +229,9 @@ protected:
PushButton aEditButton;
CancelButton aCloseButton;
PushButton aPasswordButton;
- PushButton aExportButton;
PushButton aNewLibButton;
PushButton aInsertLibButton;
+ PushButton aExportButton;
PushButton aDelButton;
ScriptDocument m_aCurDocument;
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index 9b9006953411..fbd1c8262669 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -108,8 +108,10 @@ ObjectCatalog::ObjectCatalog( Window * pParent )
WB_HSCROLL );
aMacroTreeList.SetSelectHdl( LINK( this, ObjectCatalog, TreeListHighlightHdl ) );
-
+ aMacroTreeList.SetAccessibleName(String(IDEResId(RID_STR_TLB_MACROS)));
aMacroTreeList.ScanAllEntries();
+ aMacroTreeList.GrabFocus();
+
CheckButtons();
Point aPos = IDE_DLL()->GetExtraData()->GetObjectCatalogPos();
diff --git a/basctl/source/basicide/objdlg.hrc b/basctl/source/basicide/objdlg.hrc
index 930ab31a4ae8..a090d45fc6e9 100644
--- a/basctl/source/basicide/objdlg.hrc
+++ b/basctl/source/basicide/objdlg.hrc
@@ -37,4 +37,6 @@
#define TBITEM_SHOW 1
+#define RID_STR_TLB_MACROS ( RID_BASICIDE_START + 71 )
+
#endif // _OBJDLG_HXX
diff --git a/basctl/source/basicide/objdlg.src b/basctl/source/basicide/objdlg.src
index 2d7981dd1c28..1331be5a992c 100644
--- a/basctl/source/basicide/objdlg.src
+++ b/basctl/source/basicide/objdlg.src
@@ -92,3 +92,9 @@ FloatingWindow RID_BASICIDE_OBJCAT
Size = MAP_APPFONT ( 185 , 18 ) ;
};
};
+
+String RID_STR_TLB_MACROS
+{
+ Text [ en-US ] = "Objects Tree";
+};
+
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index 9eeee5f71d7c..5b00fe68a421 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -48,6 +48,7 @@ class BasicLibInfo; // info block for basic manager
class SbTextPortions;
class SbMethod;
class BasicManager;
+class DocBasicItem;
class StarBASICImpl;
@@ -57,6 +58,7 @@ class StarBASIC : public SbxObject
friend class SbiExpression; // Access to RTL
friend class SbiInstance;
friend class SbiRuntime;
+ friend class DocBasicItem;
StarBASICImpl* mpStarBASICImpl;
diff --git a/basic/inc/basic/vbahelper.hxx b/basic/inc/basic/vbahelper.hxx
new file mode 100755
index 000000000000..0d99387965fe
--- /dev/null
+++ b/basic/inc/basic/vbahelper.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef BASIC_VBAHELPR_HXX
+#define BASIC_VBAHELPR_HXX
+
+#include <com/sun/star/frame/XModel.hpp>
+
+namespace basic {
+namespace vba {
+
+/* This header contains public helper functions for VBA used from this module
+ and from other VBA implementation modules such as vbahelper.
+ */
+
+// ============================================================================
+
+/** Locks or unlocks the controllers of all documents that have the same type
+ as the specified document.
+
+ First, the global module manager (com.sun.star.frame.ModuleManager) is
+ asked for the type of the passed model, and all open documents with the
+ same type will be locked or unlocked.
+
+ @param rxModel
+ A document model determining the type of the documents to be locked or
+ unlocked.
+
+ @param bLockControllers
+ Passing true will lock all controllers, passing false will unlock them.
+ */
+void lockControllersOfAllDocuments(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ sal_Bool bLockControllers );
+
+// ============================================================================
+
+/** Enables or disables the container windows of all controllers of all
+ documents that have the same type as the specified document.
+
+ First, the global module manager (com.sun.star.frame.ModuleManager) is
+ asked for the type of the passed model, and the container windows of all
+ open documents with the same type will be enabled or disabled.
+
+ @param rxModel
+ A document model determining the type of the documents to be enabled or
+ disabled.
+
+ @param bEnableWindows
+ Passing true will enable all container windows of all controllers,
+ passing false will disable them.
+ */
+void enableContainerWindowsOfAllDocuments(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ sal_Bool bEnableWindows );
+
+// ============================================================================
+
+} // namespace vba
+} // namespace basic
+
+#endif
diff --git a/basic/prj/build.lst b/basic/prj/build.lst
index 8eab007313ec..17a34fa5bd9f 100644
--- a/basic/prj/build.lst
+++ b/basic/prj/build.lst
@@ -1,4 +1,4 @@
-sb basic : l10n offuh oovbaapi svtools xmlscript framework salhelper LIBXSLT:libxslt NULL
+sb basic : L10N:l10n offuh oovbaapi svtools xmlscript framework salhelper LIBXSLT:libxslt NULL
sb basic usr1 - all sb_mkout NULL
sb basic\inc nmake - all sb_inc NULL
sb basic\source\app nmake - all sb_app sb_class sb_inc NULL
diff --git a/basic/source/basmgr/makefile.mk b/basic/source/basmgr/makefile.mk
index e08e9cc753bd..615a8e8465ef 100644
--- a/basic/source/basmgr/makefile.mk
+++ b/basic/source/basmgr/makefile.mk
@@ -39,7 +39,8 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES= \
$(SLO)$/basmgr.obj \
- $(SLO)$/basicmanagerrepository.obj
+ $(SLO)$/basicmanagerrepository.obj\
+ $(SLO)$/vbahelper.obj
# --- Targets -------------------------------------------------------------
diff --git a/basic/source/basmgr/vbahelper.cxx b/basic/source/basmgr/vbahelper.cxx
new file mode 100755
index 000000000000..a09446f2e40b
--- /dev/null
+++ b/basic/source/basmgr/vbahelper.cxx
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_basic.hxx"
+
+#include "basic/vbahelper.hxx"
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <comphelper/processfactory.hxx>
+
+namespace basic {
+namespace vba {
+
+using namespace ::com::sun::star;
+
+// ============================================================================
+
+namespace {
+
+/** Creates the global module manager needed to identify the type of documents.
+ */
+uno::Reference< frame::XModuleManager > lclCreateModuleManager()
+{
+ uno::Reference< frame::XModuleManager > xModuleManager;
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW );
+ xModuleManager.set( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ) ) ), uno::UNO_QUERY );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ OSL_ENSURE( xModuleManager.is(), "::basic::vba::lclCreateModuleManager - cannot create module manager" );
+ return xModuleManager;
+}
+
+// ----------------------------------------------------------------------------
+
+/** Returns the document service name of the specified document.
+ */
+::rtl::OUString lclIdentifyDocument( const uno::Reference< frame::XModuleManager >& rxModuleManager, const uno::Reference< frame::XModel >& rxModel )
+{
+ ::rtl::OUString aServiceName;
+ if( rxModuleManager.is() )
+ {
+ try
+ {
+ aServiceName = rxModuleManager->identify( rxModel );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ OSL_ENSURE( aServiceName.getLength() > 0, "::basic::vba::lclIdentifyDocument - cannot identify document" );
+ }
+ return aServiceName;
+}
+
+// ----------------------------------------------------------------------------
+
+/** Returns an enumeration of all open documents.
+ */
+uno::Reference< container::XEnumeration > lclCreateDocumentEnumeration()
+{
+ uno::Reference< container::XEnumeration > xEnumeration;
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW );
+ uno::Reference< frame::XDesktop > xDesktop( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XEnumerationAccess > xComponentsEA( xDesktop->getComponents(), uno::UNO_SET_THROW );
+ xEnumeration = xComponentsEA->createEnumeration();
+
+ }
+ catch( uno::Exception& )
+ {
+ }
+ OSL_ENSURE( xEnumeration.is(), "::basic::vba::lclCreateDocumentEnumeration - cannot create enumeration of all documents" );
+ return xEnumeration;
+}
+
+// ----------------------------------------------------------------------------
+
+/** Locks or unlocks the controllers of the specified document model.
+ */
+void lclLockControllers( const uno::Reference< frame::XModel >& rxModel, sal_Bool bLockControllers )
+{
+ if( rxModel.is() ) try
+ {
+ if( bLockControllers )
+ rxModel->lockControllers();
+ else
+ rxModel->unlockControllers();
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+/** Enables or disables the container windows of all controllers of the
+ specified document model.
+ */
+void lclEnableContainerWindows( const uno::Reference< frame::XModel >& rxModel, sal_Bool bEnableWindows )
+{
+ try
+ {
+ uno::Reference< frame::XModel2 > xModel2( rxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XEnumeration > xControllersEnum( xModel2->getControllers(), uno::UNO_SET_THROW );
+ // iterate over all controllers
+ while( xControllersEnum->hasMoreElements() )
+ {
+ try
+ {
+ uno::Reference< frame::XController > xController( xControllersEnum->nextElement(), uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW );
+ uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
+ xWindow->setEnable( bEnableWindows );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+typedef void (*ModifyDocumentFunc)( const uno::Reference< frame::XModel >&, sal_Bool );
+
+/** Implementation iterating over all documents that have the same type as the
+ specified model, and calling the passed functor.
+ */
+void lclIterateDocuments( ModifyDocumentFunc pModifyDocumentFunc, const uno::Reference< frame::XModel >& rxModel, sal_Bool bModificator )
+{
+ uno::Reference< frame::XModuleManager > xModuleManager = lclCreateModuleManager();
+ uno::Reference< container::XEnumeration > xDocumentsEnum = lclCreateDocumentEnumeration();
+ ::rtl::OUString aIdentifier = lclIdentifyDocument( xModuleManager, rxModel );
+ if( xModuleManager.is() && xDocumentsEnum.is() && (aIdentifier.getLength() > 0) )
+ {
+ // iterate over all open documents
+ while( xDocumentsEnum->hasMoreElements() )
+ {
+ try
+ {
+ uno::Reference< frame::XModel > xCurrModel( xDocumentsEnum->nextElement(), uno::UNO_QUERY_THROW );
+ ::rtl::OUString aCurrIdentifier = lclIdentifyDocument( xModuleManager, xCurrModel );
+ if( aCurrIdentifier == aIdentifier )
+ pModifyDocumentFunc( xCurrModel, bModificator );
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ }
+ else
+ {
+ // no module manager, no documents enumeration, no identifier -> at least process the passed document
+ pModifyDocumentFunc( rxModel, bModificator );
+ }
+}
+
+} // namespace
+
+// ============================================================================
+
+void lockControllersOfAllDocuments( const uno::Reference< frame::XModel >& rxModel, sal_Bool bLockControllers )
+{
+ lclIterateDocuments( &lclLockControllers, rxModel, bLockControllers );
+}
+
+// ============================================================================
+
+void enableContainerWindowsOfAllDocuments( const uno::Reference< frame::XModel >& rxModel, sal_Bool bEnableWindows )
+{
+ lclIterateDocuments( &lclEnableContainerWindows, rxModel, bEnableWindows );
+}
+
+// ============================================================================
+
+} // namespace vba
+} // namespace basic
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index e2f53dd8ed8e..f8ffa46d48a5 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -55,8 +55,12 @@
#include "sb.hrc"
#include <basrid.hxx>
#include <vos/mutex.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/XCloseBroadcaster.hpp>
+#include <com/sun/star/util/XCloseListener.hpp>
#include "errobject.hxx"
+#include <map>
#include <hash_map>
#include <com/sun/star/script/ModuleType.hpp>
@@ -80,6 +84,143 @@ using com::sun::star::lang::XMultiServiceFactory;
const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
+// ============================================================================
+
+class DocBasicItem : public ::cppu::WeakImplHelper1< util::XCloseListener >
+{
+public:
+ explicit DocBasicItem( StarBASIC& rDocBasic );
+ virtual ~DocBasicItem();
+
+ inline const SbxObjectRef& getClassModules() const { return mxClassModules; }
+ inline bool isDocClosed() const { return mbDocClosed; }
+
+ void clearDependingVarsOnDelete( StarBASIC& rDeletedBasic );
+
+ void startListening();
+ void stopListening();
+
+ virtual void SAL_CALL queryClosing( const lang::EventObject& rSource, sal_Bool bGetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException);
+ virtual void SAL_CALL notifyClosing( const lang::EventObject& rSource ) throw (uno::RuntimeException);
+ virtual void SAL_CALL disposing( const lang::EventObject& rSource ) throw (uno::RuntimeException);
+
+private:
+ StarBASIC& mrDocBasic;
+ SbxObjectRef mxClassModules;
+ bool mbDocClosed;
+ bool mbDisposed;
+};
+
+// ----------------------------------------------------------------------------
+
+DocBasicItem::DocBasicItem( StarBASIC& rDocBasic ) :
+ mrDocBasic( rDocBasic ),
+ mxClassModules( new SbxObject( String() ) ),
+ mbDocClosed( false ),
+ mbDisposed( false )
+{
+}
+
+DocBasicItem::~DocBasicItem()
+{
+ stopListening();
+}
+
+void DocBasicItem::clearDependingVarsOnDelete( StarBASIC& rDeletedBasic )
+{
+ mrDocBasic.implClearDependingVarsOnDelete( &rDeletedBasic );
+}
+
+void DocBasicItem::startListening()
+{
+ Any aThisComp;
+ mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp );
+ Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY );
+ if( xCloseBC.is() )
+ try { xCloseBC->addCloseListener( this ); } catch( uno::Exception& ) {}
+}
+
+void DocBasicItem::stopListening()
+{
+ if( mbDisposed ) return;
+ mbDisposed = true;
+ Any aThisComp;
+ mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp );
+ Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY );
+ if( xCloseBC.is() )
+ try { xCloseBC->removeCloseListener( this ); } catch( uno::Exception& ) {}
+}
+
+void SAL_CALL DocBasicItem::queryClosing( const lang::EventObject& /*rSource*/, sal_Bool /*bGetsOwnership*/ ) throw (util::CloseVetoException, uno::RuntimeException)
+{
+}
+
+void SAL_CALL DocBasicItem::notifyClosing( const lang::EventObject& /*rEvent*/ ) throw (uno::RuntimeException)
+{
+ stopListening();
+ mbDocClosed = true;
+}
+
+void SAL_CALL DocBasicItem::disposing( const lang::EventObject& /*rEvent*/ ) throw (uno::RuntimeException)
+{
+ stopListening();
+}
+
+// ----------------------------------------------------------------------------
+
+namespace {
+
+typedef ::rtl::Reference< DocBasicItem > DocBasicItemRef;
+typedef std::map< const StarBASIC*, DocBasicItemRef > DocBasicItemMap;
+static DocBasicItemMap GaDocBasicItems;
+
+const DocBasicItem* lclFindDocBasicItem( const StarBASIC* pDocBasic )
+{
+ DocBasicItemMap::iterator it = GaDocBasicItems.find( pDocBasic );
+ return (it != GaDocBasicItems.end()) ? it->second.get() : 0;
+}
+
+void lclInsertDocBasicItem( StarBASIC& rDocBasic )
+{
+ DocBasicItemRef& rxDocBasicItem = GaDocBasicItems[ &rDocBasic ];
+ rxDocBasicItem.set( new DocBasicItem( rDocBasic ) );
+ rxDocBasicItem->startListening();
+}
+
+void lclRemoveDocBasicItem( StarBASIC& rDocBasic )
+{
+ DocBasicItemMap::iterator it = GaDocBasicItems.find( &rDocBasic );
+ if( it != GaDocBasicItems.end() )
+ {
+ it->second->stopListening();
+ GaDocBasicItems.erase( it );
+ }
+ DocBasicItemMap::iterator it_end = GaDocBasicItems.end();
+ for( it = GaDocBasicItems.begin(); it != it_end; ++it )
+ it->second->clearDependingVarsOnDelete( rDocBasic );
+}
+
+StarBASIC* lclGetDocBasicForModule( SbModule* pModule )
+{
+ StarBASIC* pRetBasic = NULL;
+ SbxObject* pCurParent = pModule;
+ while( pCurParent->GetParent() != NULL )
+ {
+ pCurParent = pCurParent->GetParent();
+ StarBASIC* pDocBasic = PTR_CAST( StarBASIC, pCurParent );
+ if( pDocBasic != NULL && pDocBasic->IsDocBasic() )
+ {
+ pRetBasic = pDocBasic;
+ break;
+ }
+ }
+ return pRetBasic;
+}
+
+} // namespace
+
+// ============================================================================
+
SbxObject* StarBASIC::getVBAGlobals( )
{
if ( !pVBAGlobals )
@@ -461,6 +602,7 @@ SbxObject* createUserTypeImpl( const String& rClassName )
return pRetObj;
}
+
TYPEINIT1(SbClassModuleObject,SbModule)
SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
@@ -610,8 +752,12 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbClassModuleObject::~SbClassModuleObject()
{
+ // do not trigger termination event when document is already closed
if( StarBASIC::IsRunning() )
- triggerTerminateEvent();
+ if( StarBASIC* pDocBasic = lclGetDocBasicForModule( this ) )
+ if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) )
+ if( !pDocBasicItem->isDocClosed() )
+ triggerTerminateEvent();
// Must be deleted by base class dtor because this data
// is not owned by the SbClassModuleObject object
@@ -699,8 +845,14 @@ SbClassFactory::~SbClassFactory()
void SbClassFactory::AddClassModule( SbModule* pClassModule )
{
+ SbxObjectRef xToUseClassModules = xClassModules;
+
+ if( StarBASIC* pDocBasic = lclGetDocBasicForModule( pClassModule ) )
+ if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) )
+ xToUseClassModules = pDocBasicItem->getClassModules();
+
SbxObject* pParent = pClassModule->GetParent();
- xClassModules->Insert( pClassModule );
+ xToUseClassModules->Insert( pClassModule );
pClassModule->SetParent( pParent );
}
@@ -717,12 +869,19 @@ SbxBase* SbClassFactory::Create( sal_uInt16, sal_uInt32 )
SbxObject* SbClassFactory::CreateObject( const String& rClassName )
{
- SbxVariable* pVar = xClassModules->Find( rClassName, SbxCLASS_DONTCARE );
+ SbxObjectRef xToUseClassModules = xClassModules;
+
+ if( SbModule* pMod = pMOD )
+ if( StarBASIC* pDocBasic = lclGetDocBasicForModule( pMod ) )
+ if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) )
+ xToUseClassModules = pDocBasicItem->getClassModules();
+
+ SbxVariable* pVar = xToUseClassModules->Find( rClassName, SbxCLASS_OBJECT );
SbxObject* pRet = NULL;
if( pVar )
{
- SbModule* pMod = (SbModule*)pVar;
- pRet = new SbClassModuleObject( pMod );
+ SbModule* pVarMod = (SbModule*)pVar;
+ pRet = new SbClassModuleObject( pVarMod );
}
return pRet;
}
@@ -734,9 +893,6 @@ SbModule* SbClassFactory::FindClass( const String& rClassName )
return pMod;
}
-typedef std::vector< StarBASIC* > DocBasicVector;
-static DocBasicVector GaDocBasics;
-
StarBASIC::StarBASIC( StarBASIC* p, sal_Bool bIsDocBasic )
: SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ), bDocBasic( bIsDocBasic )
{
@@ -768,7 +924,7 @@ StarBASIC::StarBASIC( StarBASIC* p, sal_Bool bIsDocBasic )
bQuit = sal_False;
if( bDocBasic )
- GaDocBasics.push_back( this );
+ lclInsertDocBasicItem( *this );
}
// #51727 Override SetModified so that the modified state
@@ -780,6 +936,9 @@ void StarBASIC::SetModified( sal_Bool b )
StarBASIC::~StarBASIC()
{
+ // Needs to be first action as it can trigger events
+ disposeComVariablesForBasic( this );
+
if( !--GetSbData()->nInst )
{
RemoveFactory( pSBFAC );
@@ -812,20 +971,7 @@ StarBASIC::~StarBASIC()
{
SbxError eOld = SbxBase::GetError();
- DocBasicVector::iterator it;
- for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it )
- {
- if( *it == this )
- {
- GaDocBasics.erase( it );
- break;
- }
- }
- for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it )
- {
- StarBASIC* pBasic = *it;
- pBasic->implClearDependingVarsOnDelete( this );
- }
+ lclRemoveDocBasicItem( *this );
SbxBase::ResetError();
if( eOld != SbxERR_OK )
@@ -845,7 +991,6 @@ StarBASIC::~StarBASIC()
}
clearUnoMethodsForBasic( this );
- disposeComVariablesForBasic( this );
}
// Override new() operator, so that everyone can create a new instance
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index a268568a410d..592d69c514a0 100755
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -54,11 +54,15 @@
#include <basic/basrdll.hxx>
#include <vos/mutex.hxx>
#include <basic/sbobjmod.hxx>
-#include <cppuhelper/implbase2.hxx>
+#include <basic/vbahelper.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <unotools/eventcfg.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
using namespace com::sun::star;
@@ -496,24 +500,18 @@ IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ )
return 0L;
}
-bool VBAUnlockControllers( StarBASIC* pBasic )
+void VBAUnlockDocuments( StarBASIC* pBasic )
{
- bool bRes = false;
if ( pBasic && pBasic->IsDocBasic() )
{
SbUnoObject* pGlobs = dynamic_cast< SbUnoObject* >( pBasic->Find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) ), SbxCLASS_DONTCARE ) );
- if ( pGlobs ) try
- {
- uno::Reference< frame::XModel > xModel( pGlobs->getUnoAny(), uno::UNO_QUERY_THROW );
- if ( xModel->hasControllersLocked() )
- xModel->unlockControllers();
- bRes = true;
- }
- catch( uno::Exception& )
+ if ( pGlobs )
{
+ uno::Reference< frame::XModel > xModel( pGlobs->getUnoAny(), uno::UNO_QUERY );
+ ::basic::vba::lockControllersOfAllDocuments( xModel, sal_False );
+ ::basic::vba::enableContainerWindowsOfAllDocuments( xModel, sal_True );
}
}
- return bRes;
}
/////////////////////////////////////////////////////////////////////////////
@@ -1182,7 +1180,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
// VBA always ensures screenupdating is enabled after completing
if ( mbVBACompat )
- VBAUnlockControllers( PTR_CAST( StarBASIC, GetParent() ) );
+ VBAUnlockDocuments( PTR_CAST( StarBASIC, GetParent() ) );
#ifdef DBG_TRACE_BASIC
dbg_DeInitTrace();
@@ -2162,22 +2160,27 @@ void SbObjModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
}
-typedef ::cppu::WeakImplHelper2< awt::XTopWindowListener, awt::XWindowListener > FormObjEventListener_BASE;
+typedef ::cppu::WeakImplHelper3<
+ awt::XTopWindowListener,
+ awt::XWindowListener,
+ document::XEventListener > FormObjEventListener_BASE;
class FormObjEventListenerImpl : public FormObjEventListener_BASE
{
SbUserFormModule* mpUserForm;
uno::Reference< lang::XComponent > mxComponent;
+ uno::Reference< frame::XModel > mxModel;
bool mbDisposed;
sal_Bool mbOpened;
sal_Bool mbActivated;
sal_Bool mbShowing;
- FormObjEventListenerImpl(); // not defined
+
FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined
+ FormObjEventListenerImpl& operator=(const FormObjEventListenerImpl&); // not defined
public:
- FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) :
- mpUserForm( pUserForm ), mxComponent( xComponent) ,
+ FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent, const uno::Reference< frame::XModel >& xModel ) :
+ mpUserForm( pUserForm ), mxComponent( xComponent), mxModel( xModel ),
mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False )
{
if ( mxComponent.is() )
@@ -2194,6 +2197,15 @@ public:
}
catch( uno::Exception& ) {}
}
+
+ if ( mxModel.is() )
+ {
+ try
+ {
+ uno::Reference< document::XEventBroadcaster >( mxModel, uno::UNO_QUERY_THROW )->addEventListener( this );
+ }
+ catch( uno::Exception& ) {}
+ }
}
virtual ~FormObjEventListenerImpl()
@@ -2220,6 +2232,16 @@ public:
catch( uno::Exception& ) {}
}
mxComponent.clear();
+
+ if ( mxModel.is() && !mbDisposed )
+ {
+ try
+ {
+ uno::Reference< document::XEventBroadcaster >( mxModel, uno::UNO_QUERY_THROW )->removeEventListener( this );
+ }
+ catch( uno::Exception& ) {}
+ }
+ mxModel.clear();
}
virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
@@ -2327,13 +2349,25 @@ public:
{
}
+ virtual void SAL_CALL notifyEvent( const document::EventObject& rEvent ) throw (uno::RuntimeException)
+ {
+ // early dosposing on document event "OnUnload", to be sure Basic still exists when calling VBA "UserForm_Terminate"
+ if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) )
+ {
+ removeListener();
+ mbDisposed = true;
+ if ( mpUserForm )
+ mpUserForm->ResetApiObj(); // will trigger "UserForm_Terminate"
+ }
+ }
+
virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException)
{
OSL_TRACE("** Userform/Dialog disposing");
+ removeListener();
mbDisposed = true;
- mxComponent.clear();
if ( mpUserForm )
- mpUserForm->ResetApiObj();
+ mpUserForm->ResetApiObj( false ); // pass false (too late to trigger VBA events here)
}
};
@@ -2567,30 +2601,27 @@ void SbUserFormModule::InitObject()
aArgs[ 2 ] <<= m_xModel;
aArgs[ 3 ] <<= rtl::OUString( GetParent()->GetName() );
pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.UserForm")), aArgs ) ) );
- uno::Reference< lang::XComponent > xComponent( aArgs[ 1 ], uno::UNO_QUERY_THROW );
+
+ uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW );
// the dialog must be disposed at the end!
- if( xComponent.is() )
+ StarBASIC* pParentBasic = NULL;
+ SbxObject* pCurObject = this;
+ do
{
- StarBASIC* pParentBasic = NULL;
- SbxObject* pCurObject = this;
- do
- {
- SbxObject* pObjParent = pCurObject->GetParent();
- pParentBasic = PTR_CAST( StarBASIC, pObjParent );
- pCurObject = pObjParent;
- }
- while( pParentBasic == NULL && pCurObject != NULL );
-
- OSL_ASSERT( pParentBasic != NULL );
- registerComponentToBeDisposedForBasic( xComponent, pParentBasic );
+ SbxObject* pObjParent = pCurObject->GetParent();
+ pParentBasic = PTR_CAST( StarBASIC, pObjParent );
+ pCurObject = pObjParent;
}
+ while( pParentBasic == NULL && pCurObject != NULL );
+ OSL_ASSERT( pParentBasic != NULL );
+ registerComponentToBeDisposedForBasic( xComponent, pParentBasic );
- // remove old listener if it exists
- if ( m_DialogListener.get() )
+ // if old listener object exists, remove it from dialog and document model
+ if( m_DialogListener.is() )
m_DialogListener->removeListener();
- m_DialogListener = new FormObjEventListenerImpl( this, xComponent );
+ m_DialogListener.set( new FormObjEventListenerImpl( this, xComponent, m_xModel ) );
triggerInitializeEvent();
}
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index e518779b78d5..ad94bbe842c8 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -152,6 +152,16 @@ static SbxDataType GetSuffixType( sal_Unicode c )
// Returnwert ist sal_False bei EOF oder Fehlern
#define BUF_SIZE 80
+namespace {
+
+/** Returns true, if the passed character is a white space character. */
+inline bool lclIsWhitespace( sal_Unicode cChar )
+{
+ return (cChar == ' ') || (cChar == '\t') || (cChar == '\f');
+}
+
+} // namespace
+
sal_Bool SbiScanner::NextSym()
{
// Fuer den EOLN-Fall merken
@@ -177,7 +187,11 @@ sal_Bool SbiScanner::NextSym()
p2 += n;
while( ( n < nLen ) && ( *p2 != '\n' ) && ( *p2 != '\r' ) )
p2++, n++;
- aLine = aBuf.copy( nBufPos, n - nBufPos );
+ // #163944# ignore trailing whitespace
+ sal_Int32 nCopyEndPos = n;
+ while( (nBufPos < nCopyEndPos) && lclIsWhitespace( aBuf[ nCopyEndPos - 1 ] ) )
+ --nCopyEndPos;
+ aLine = aBuf.copy( nBufPos, nCopyEndPos - nBufPos );
if( n < nLen )
{
if( *p2 == '\r' && *( p2+1 ) == '\n' )
@@ -193,7 +207,7 @@ sal_Bool SbiScanner::NextSym()
}
// Leerstellen weg:
- while( *pLine && (( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' )) )
+ while( lclIsWhitespace( *pLine ) )
pLine++, nCol++, bSpaces = sal_True;
nCol1 = nCol;
@@ -230,7 +244,7 @@ sal_Bool SbiScanner::NextSym()
{
const sal_Unicode* pTestLine = pLine;
short nTestCol = nCol;
- while( *pTestLine && (( *pTestLine == ' ' ) || ( *pTestLine == '\t' )) )
+ while( lclIsWhitespace( *pTestLine ) )
{
pTestLine++;
nTestCol++;
diff --git a/binaryurp/prj/build.lst b/binaryurp/prj/build.lst
new file mode 100644
index 000000000000..230b323f0a35
--- /dev/null
+++ b/binaryurp/prj/build.lst
@@ -0,0 +1,3 @@
+bu binaryurp : BOOST:boost LIBXSLT:libxslt cppu cppuhelper offuh sal salhelper stlport NULL
+bu binaryurp\source nmake - all bu_source NULL
+bu binaryurp\qa nmake - all bu_qa bu_source NULL
diff --git a/binaryurp/prj/d.lst b/binaryurp/prj/d.lst
new file mode 100644
index 000000000000..48ebd3be806f
--- /dev/null
+++ b/binaryurp/prj/d.lst
@@ -0,0 +1,4 @@
+..\%__SRC%\bin\binaryurp.uno.dll %_DEST%\bin%_EXT%\binaryurp.uno.dll
+..\%__SRC%\lib\binaryurp.uno.dylib %_DEST%\lib%_EXT%\binaryurp.uno.dylib
+..\%__SRC%\lib\binaryurp.uno.so %_DEST%\lib%_EXT%\binaryurp.uno.so
+..\%__SRC%\misc\binaryurp.component %_DEST%\xml%_EXT%\binaryurp.component
diff --git a/binaryurp/qa/makefile.mk b/binaryurp/qa/makefile.mk
new file mode 100644
index 000000000000..14b80c86cfaf
--- /dev/null
+++ b/binaryurp/qa/makefile.mk
@@ -0,0 +1,77 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General 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 = binaryurp
+TARGET = qa
+
+ENABLE_EXCEPTIONS = TRUE
+
+.INCLUDE: settings.mk
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
+DLLPRE =
+
+SLOFILES = $(SLO)/test-cache.obj $(SLO)/test-unmarshal.obj
+
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLO)/test-cache.obj
+SHL1RPATH = NONE
+SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
+SHL1TARGET = test-cache
+SHL1VERSIONMAP = version.map
+DEF1NAME = $(SHL1TARGET)
+
+SHL2IMPLIB = i$(SHL2TARGET)
+SHL2OBJS = \
+ $(SLO)/test-unmarshal.obj \
+ $(SLO)/binaryany.obj \
+ $(SLO)/bridge.obj \
+ $(SLO)/bridgefactory.obj \
+ $(SLO)/currentcontext.obj \
+ $(SLO)/incomingrequest.obj \
+ $(SLO)/lessoperators.obj \
+ $(SLO)/marshal.obj \
+ $(SLO)/outgoingrequests.obj \
+ $(SLO)/proxy.obj \
+ $(SLO)/reader.obj \
+ $(SLO)/unmarshal.obj \
+ $(SLO)/writer.obj
+SHL2RPATH = NONE
+SHL2STDLIBS = \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(CPPUNITLIB) \
+ $(SALHELPERLIB) \
+ $(SALLIB)
+SHL2TARGET = test-unmarshal
+SHL2VERSIONMAP = version.map
+DEF2NAME = $(SHL2TARGET)
+
+.INCLUDE: target.mk
+.INCLUDE: _cppunit.mk
diff --git a/binaryurp/qa/test-cache.cxx b/binaryurp/qa/test-cache.cxx
new file mode 100644
index 000000000000..f9a3946c0df9
--- /dev/null
+++ b/binaryurp/qa/test-cache.cxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+
+#include "../source/cache.hxx"
+
+namespace {
+
+class Test: public CppUnit::TestFixture {
+private:
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(testNothingLostFromLruList);
+ CPPUNIT_TEST_SUITE_END();
+
+ void testNothingLostFromLruList();
+};
+
+// cf. jurt/test/com/sun/star/lib/uno/protocols/urp/Cache_Test.java:
+void Test::testNothingLostFromLruList() {
+ int a[8];
+ for (int i = 0; i != sizeof a / sizeof a[0]; ++i) {
+ for (int j = 0; j != i; ++j) {
+ a[j] = 0;
+ }
+ for (;;) {
+ binaryurp::Cache< int > c(4);
+ for (int k = 0; k != i; ++k) {
+ bool f;
+ c.add(a[k], &f);
+ }
+ bool f;
+ CPPUNIT_ASSERT_EQUAL(
+ 6,
+ c.add(-1, &f) + c.add(-2, &f) + c.add(-3, &f) + c.add(-4, &f));
+ int j = i - 1;
+ while (j >= 0 && a[j] == 3) {
+ --j;
+ }
+ if (j < 0) {
+ break;
+ }
+ ++a[j];
+ for (int k = j + 1; k != i; ++k) {
+ a[k] = 0;
+ }
+ }
+ }
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/binaryurp/qa/test-unmarshal.cxx b/binaryurp/qa/test-unmarshal.cxx
new file mode 100644
index 000000000000..3d3c1795a724
--- /dev/null
+++ b/binaryurp/qa/test-unmarshal.cxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 "com/sun/star/io/IOException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppu/unotype.hxx"
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "sal/types.h"
+#include "typelib/typedescription.hxx"
+
+#include "../source/bridge.hxx"
+#include "../source/cache.hxx"
+#include "../source/readerstate.hxx"
+#include "../source/unmarshal.hxx"
+
+namespace {
+
+namespace css = com::sun::star;
+
+class Test: public CppUnit::TestFixture {
+private:
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(testTypeOfBooleanSequence);
+ CPPUNIT_TEST(testTypeOfVoidSequence);
+ CPPUNIT_TEST_SUITE_END();
+
+ void testTypeOfBooleanSequence();
+
+ void testTypeOfVoidSequence();
+};
+
+void Test::testTypeOfBooleanSequence() {
+ binaryurp::ReaderState state;
+ css::uno::Sequence< sal_Int8 > buf(13);
+ buf[0] = static_cast< sal_Int8 >(20 | 0x80); // sequence type | cache flag
+ buf[1] = static_cast< sal_Int8 >(binaryurp::cache::ignore >> 8);
+ buf[2] = static_cast< sal_Int8 >(binaryurp::cache::ignore & 0xFF);
+ buf[3] = RTL_CONSTASCII_LENGTH("[]boolean");
+ buf[4] = '[';
+ buf[5] = ']';
+ buf[6] = 'b';
+ buf[7] = 'o';
+ buf[8] = 'o';
+ buf[9] = 'l';
+ buf[10] = 'e';
+ buf[11] = 'a';
+ buf[12] = 'n';
+ binaryurp::Unmarshal m(rtl::Reference< binaryurp::Bridge >(), state, buf);
+ css::uno::TypeDescription t(m.readType());
+ CPPUNIT_ASSERT(
+ t.equals(
+ css::uno::TypeDescription(
+ cppu::UnoType< css::uno::Sequence< bool > >::get())));
+ m.done();
+}
+
+void Test::testTypeOfVoidSequence() {
+ binaryurp::ReaderState state;
+ css::uno::Sequence< sal_Int8 > buf(10);
+ buf[0] = static_cast< sal_Int8 >(20 | 0x80); // sequence type | cache flag
+ buf[1] = static_cast< sal_Int8 >(binaryurp::cache::ignore >> 8);
+ buf[2] = static_cast< sal_Int8 >(binaryurp::cache::ignore & 0xFF);
+ buf[3] = RTL_CONSTASCII_LENGTH("[]void");
+ buf[4] = '[';
+ buf[5] = ']';
+ buf[6] = 'v';
+ buf[7] = 'o';
+ buf[8] = 'i';
+ buf[9] = 'd';
+ binaryurp::Unmarshal m(rtl::Reference< binaryurp::Bridge >(), state, buf);
+ try {
+ m.readType();
+ CPPUNIT_FAIL("exception expected");
+ } catch (css::io::IOException &) {}
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/binaryurp/qa/version.map b/binaryurp/qa/version.map
new file mode 100644
index 000000000000..ef2ab497cb5e
--- /dev/null
+++ b/binaryurp/qa/version.map
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+UDK_3_0_0 {
+ global:
+ cppunitTestPlugIn;
+
+ local:
+ *;
+};
diff --git a/binaryurp/source/binaryany.cxx b/binaryurp/source/binaryany.cxx
new file mode 100644
index 000000000000..c5b8b1a3cb3d
--- /dev/null
+++ b/binaryurp/source/binaryany.cxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 "osl/diagnose.h"
+#include "typelib/typeclass.h"
+#include "typelib/typedescription.hxx"
+#include "uno/any2.h"
+
+#include "binaryany.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+BinaryAny::BinaryAny() throw () {
+ uno_any_construct(&data_, 0, 0, 0);
+}
+
+BinaryAny::BinaryAny(css::uno::TypeDescription const & type, void * value)
+ throw ()
+{
+ OSL_ASSERT(type.is());
+ uno_any_construct(&data_, value, type.get(), 0);
+}
+
+BinaryAny::BinaryAny(uno_Any const & raw) throw () {
+ OSL_ASSERT(raw.pType != 0);
+ data_.pType = raw.pType;
+ typelib_typedescriptionreference_acquire(data_.pType);
+ data_.pData = raw.pData == &raw.pReserved ? &data_.pReserved : raw.pData;
+ data_.pReserved = raw.pReserved;
+}
+
+BinaryAny::BinaryAny(BinaryAny const & other) throw () {
+ uno_type_any_construct(&data_, other.data_.pData, other.data_.pType, 0);
+}
+
+BinaryAny::~BinaryAny() throw () {
+ uno_any_destruct(&data_, 0);
+}
+
+BinaryAny & BinaryAny::operator =(BinaryAny const & other) throw () {
+ if (&other != this) {
+ uno_type_any_assign(&data_, other.data_.pData, other.data_.pType, 0, 0);
+ }
+ return *this;
+}
+
+uno_Any * BinaryAny::get() throw () {
+ return &data_;
+}
+
+css::uno::TypeDescription BinaryAny::getType() const throw () {
+ return css::uno::TypeDescription(data_.pType);
+}
+
+void * BinaryAny::getValue(css::uno::TypeDescription const & type) const
+ throw ()
+{
+ OSL_ASSERT(
+ type.is() &&
+ (type.get()->eTypeClass == typelib_TypeClass_ANY ||
+ type.equals(css::uno::TypeDescription(data_.pType))));
+ return type.get()->eTypeClass == typelib_TypeClass_ANY
+ ? &data_ : data_.pData;
+}
+
+}
diff --git a/binaryurp/source/binaryany.hxx b/binaryurp/source/binaryany.hxx
new file mode 100644
index 000000000000..4dd6112b5c57
--- /dev/null
+++ b/binaryurp/source/binaryany.hxx
@@ -0,0 +1,73 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_BINARYANY_HXX
+#define INCLUDED_BINARYURP_SOURCE_BINARYANY_HXX
+
+#include "sal/config.h"
+
+#include "uno/any2.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class TypeDescription;
+} } } }
+
+namespace binaryurp {
+
+class BinaryAny {
+public:
+ BinaryAny() throw ();
+
+ BinaryAny(com::sun::star::uno::TypeDescription const & type, void * value)
+ throw ();
+
+ explicit BinaryAny(uno_Any const & raw) throw ();
+ // takes over raw.pData (but copies raw.pType); raw must not be passed
+ // to uno_any_destruct
+
+ BinaryAny(BinaryAny const & other) throw ();
+
+ ~BinaryAny() throw ();
+
+ BinaryAny & operator =(BinaryAny const & other) throw ();
+
+ uno_Any * get() throw ();
+
+ com::sun::star::uno::TypeDescription getType() const throw ();
+
+ void * getValue(com::sun::star::uno::TypeDescription const & type) const
+ throw ();
+
+private:
+ mutable uno_Any data_;
+ // mutable so that getValue() can return a non-const void *, as in turn
+ // required at various places in binary UNO
+};
+
+}
+
+#endif
diff --git a/remotebridges/source/factory/bridgefac.component b/binaryurp/source/binaryurp.component
index e20bc34250ca..19554bcc088b 100644
--- a/remotebridges/source/factory/bridgefac.component
+++ b/binaryurp/source/binaryurp.component
@@ -3,7 +3,7 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
+* Copyright 2000, 2011 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
@@ -28,7 +28,7 @@
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.remotebridges.BridgeFactory">
+ <implementation name="com.sun.star.comp.bridge.BridgeFactory">
<service name="com.sun.star.bridge.BridgeFactory"/>
</implementation>
</component>
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
new file mode 100644
index 000000000000..dcf77662c56d
--- /dev/null
+++ b/binaryurp/source/bridge.cxx
@@ -0,0 +1,978 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <algorithm>
+#include <cstddef>
+#include <limits>
+#include <memory>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/bridge/InvalidProtocolChangeException.hpp"
+#include "com/sun/star/bridge/XBridge.hpp"
+#include "com/sun/star/bridge/XInstanceProvider.hpp"
+#include "com/sun/star/bridge/XProtocolProperties.hpp"
+#include "com/sun/star/connection/XConnection.hpp"
+#include "com/sun/star/io/IOException.hpp"
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/exc_hlp.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "osl/thread.hxx"
+#include "rtl/byteseq.hxx"
+#include "rtl/random.h"
+#include "rtl/ref.hxx"
+#include "rtl/textenc.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typeclass.h"
+#include "typelib/typedescription.h"
+#include "typelib/typedescription.hxx"
+#include "uno/dispatcher.hxx"
+#include "uno/environment.hxx"
+#include "uno/lbnames.h"
+
+#include "binaryany.hxx"
+#include "bridge.hxx"
+#include "bridgefactory.hxx"
+#include "incomingreply.hxx"
+#include "lessoperators.hxx"
+#include "outgoingrequest.hxx"
+#include "outgoingrequests.hxx"
+#include "proxy.hxx"
+#include "reader.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+sal_Int32 random() {
+ sal_Int32 n;
+ rtlRandomPool pool = rtl_random_createPool();
+ rtl_random_getBytes(pool, &n, sizeof n);
+ rtl_random_destroyPool(pool);
+ return n;
+}
+
+extern "C" void SAL_CALL freeProxyCallback(uno_ExtEnvironment *, void * pProxy)
+{
+ OSL_ASSERT(pProxy != 0);
+ static_cast< Proxy * >(pProxy)->do_free();
+}
+
+void joinThread(osl::Thread * thread) {
+ OSL_ASSERT(thread != 0);
+ if (thread->getIdentifier() != osl::Thread::getCurrentIdentifier()) {
+ thread->join();
+ }
+}
+
+class AttachThread: private boost::noncopyable {
+public:
+ explicit AttachThread(uno_ThreadPool threadPool);
+
+ ~AttachThread();
+
+ rtl::ByteSequence getTid() throw ();
+
+private:
+ uno_ThreadPool threadPool_;
+ rtl::ByteSequence tid_;
+};
+
+AttachThread::AttachThread(uno_ThreadPool threadPool): threadPool_(threadPool) {
+ sal_Sequence * s = 0;
+ uno_getIdOfCurrentThread(&s);
+ tid_ = rtl::ByteSequence(s, rtl::BYTESEQ_NOACQUIRE);
+ uno_threadpool_attach(threadPool_);
+}
+
+AttachThread::~AttachThread() {
+ uno_threadpool_detach(threadPool_);
+ uno_releaseIdFromCurrentThread();
+}
+
+rtl::ByteSequence AttachThread::getTid() throw () {
+ return tid_;
+}
+
+class PopOutgoingRequest: private boost::noncopyable {
+public:
+ PopOutgoingRequest(
+ OutgoingRequests & requests, rtl::ByteSequence const & tid,
+ OutgoingRequest const & request);
+
+ ~PopOutgoingRequest();
+
+ void clear();
+
+private:
+ OutgoingRequests & requests_;
+ rtl::ByteSequence tid_;
+ bool cleared_;
+};
+
+PopOutgoingRequest::PopOutgoingRequest(
+ OutgoingRequests & requests, rtl::ByteSequence const & tid,
+ OutgoingRequest const & request):
+ requests_(requests), tid_(tid), cleared_(false)
+{
+ requests_.push(tid_, request);
+}
+
+PopOutgoingRequest::~PopOutgoingRequest() {
+ if (!cleared_) {
+ requests_.pop(tid_);
+ }
+}
+
+void PopOutgoingRequest::clear() {
+ cleared_ = true;
+}
+
+}
+
+struct Bridge::SubStub {
+ com::sun::star::uno::UnoInterfaceReference object;
+
+ sal_uInt32 references;
+};
+
+Bridge::Bridge(
+ rtl::Reference< BridgeFactory > const & factory, rtl::OUString const & name,
+ css::uno::Reference< css::connection::XConnection > const & connection,
+ css::uno::Reference< css::bridge::XInstanceProvider > const & provider):
+ factory_(factory), name_(name), connection_(connection),
+ provider_(provider),
+ binaryUno_(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))),
+ cppToBinaryMapping_(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME)),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO))),
+ binaryToCppMapping_(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME))),
+ protPropTid_(
+ reinterpret_cast< sal_Int8 const * >(".UrpProtocolPropertiesTid"),
+ RTL_CONSTASCII_LENGTH(".UrpProtocolPropertiesTid")),
+ protPropOid_(RTL_CONSTASCII_USTRINGPARAM("UrpProtocolProperties")),
+ protPropType_(
+ cppu::UnoType<
+ css::uno::Reference< css::bridge::XProtocolProperties > >::get()),
+ protPropRequest_(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.bridge.XProtocolProperties::requestChange"))),
+ protPropCommit_(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.bridge.XProtocolProperties::commitChange"))),
+ threadPool_(0), currentContextMode_(false), proxies_(0), calls_(0),
+ normalCall_(false), activeCalls_(0), terminated_(false),
+ mode_(MODE_REQUESTED)
+{
+ OSL_ASSERT(factory.is() && connection.is());
+ if (!binaryUno_.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("URP: no binary UNO environment")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (!(cppToBinaryMapping_.is() && binaryToCppMapping_.is())) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("URP: no C++ UNO mapping")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ passive_.set();
+}
+
+void Bridge::start() {
+ OSL_ASSERT(threadPool_ == 0 && !writer_.is() && !reader_.is());
+ threadPool_ = uno_threadpool_create();
+ OSL_ASSERT(threadPool_ != 0);
+ writer_.set(new Writer(this));
+ writer_->create();
+ reader_.set(new Reader(this));
+ reader_->create();
+}
+
+void Bridge::terminate() {
+ rtl::Reference< Reader > r;
+ rtl::Reference< Writer > w;
+ Listeners ls;
+ {
+ osl::MutexGuard g(mutex_);
+ if (terminated_) {
+ return;
+ }
+ std::swap(reader_, r);
+ std::swap(writer_, w);
+ ls.swap(listeners_);
+ terminated_ = true;
+ }
+ try {
+ connection_->close();
+ } catch (css::io::IOException & e) {
+ OSL_TRACE(
+ OSL_LOG_PREFIX "caught IO exception '%s'",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ OSL_ASSERT(w.is());
+ w->stop();
+ joinThread(r.get());
+ joinThread(w.get());
+ OSL_ASSERT(threadPool_ != 0);
+ uno_threadpool_dispose(threadPool_);
+ Stubs s;
+ {
+ osl::MutexGuard g(mutex_);
+ s.swap(stubs_);
+ }
+ for (Stubs::iterator i(s.begin()); i != s.end(); ++i) {
+ for (Stub::iterator j(i->second.begin()); j != i->second.end(); ++j) {
+ binaryUno_.get()->pExtEnv->revokeInterface(
+ binaryUno_.get()->pExtEnv, j->second.object.get());
+ }
+ }
+ factory_->removeBridge(this);
+ for (Listeners::iterator i(ls.begin()); i != ls.end(); ++i) {
+ try {
+ (*i)->disposing(
+ css::lang::EventObject(
+ static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::uno::RuntimeException & e) {
+ OSL_TRACE(
+ OSL_LOG_PREFIX "caught runtime exception '%s'",
+ rtl::OUStringToOString(
+ e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ }
+}
+
+css::uno::Reference< css::connection::XConnection > Bridge::getConnection()
+ const
+{
+ return connection_;
+}
+
+css::uno::Reference< css::bridge::XInstanceProvider > Bridge::getProvider()
+ const
+{
+ return provider_;
+}
+
+css::uno::Mapping & Bridge::getCppToBinaryMapping() {
+ return cppToBinaryMapping_;
+}
+
+BinaryAny Bridge::mapCppToBinaryAny(css::uno::Any const & cppAny) {
+ css::uno::Any in(cppAny);
+ BinaryAny out;
+ out.~BinaryAny();
+ uno_copyAndConvertData(
+ out.get(), &in,
+ css::uno::TypeDescription(cppu::UnoType< css::uno::Any >::get()).get(),
+ cppToBinaryMapping_.get());
+ return out;
+}
+
+uno_ThreadPool Bridge::getThreadPool() const {
+ OSL_ASSERT(threadPool_ != 0);
+ return threadPool_;
+}
+
+rtl::Reference< Writer > Bridge::getWriter() {
+ osl::MutexGuard g(mutex_);
+ if (terminated_) {
+ throw css::lang::DisposedException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "Binary URP bridge already disposed")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ OSL_ASSERT(writer_.is());
+ return writer_;
+}
+
+css::uno::UnoInterfaceReference Bridge::registerIncomingInterface(
+ rtl::OUString const & oid, css::uno::TypeDescription const & type)
+{
+ OSL_ASSERT(type.is());
+ if (oid.getLength() == 0) {
+ return css::uno::UnoInterfaceReference();
+ }
+ css::uno::UnoInterfaceReference obj(findStub(oid, type));
+ if (!obj.is()) {
+ binaryUno_.get()->pExtEnv->getRegisteredInterface(
+ binaryUno_.get()->pExtEnv,
+ reinterpret_cast< void ** >(&obj.m_pUnoI), oid.pData,
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(type.get()));
+ if (obj.is()) {
+ makeReleaseCall(oid, type);
+ } else {
+ obj.set(new Proxy(this, oid, type), SAL_NO_ACQUIRE);
+ {
+ osl::MutexGuard g(mutex_);
+ OSL_ASSERT(
+ proxies_ < std::numeric_limits< std::size_t >::max());
+ ++proxies_;
+ }
+ binaryUno_.get()->pExtEnv->registerProxyInterface(
+ binaryUno_.get()->pExtEnv,
+ reinterpret_cast< void ** >(&obj.m_pUnoI), &freeProxyCallback,
+ oid.pData,
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(
+ type.get()));
+ }
+ }
+ return obj;
+}
+
+rtl::OUString Bridge::registerOutgoingInterface(
+ css::uno::UnoInterfaceReference const & object,
+ css::uno::TypeDescription const & type)
+{
+ OSL_ASSERT(type.is());
+ if (!object.is()) {
+ return rtl::OUString();
+ }
+ rtl::OUString oid;
+ if (!Proxy::isProxy(this, object, &oid)) {
+ binaryUno_.get()->pExtEnv->getObjectIdentifier(
+ binaryUno_.get()->pExtEnv, &oid.pData, object.get());
+ osl::MutexGuard g(mutex_);
+ Stubs::iterator i(stubs_.find(oid));
+ Stub newStub;
+ Stub * stub = i == stubs_.end() ? &newStub : &i->second;
+ Stub::iterator j(stub->find(type));
+ //TODO: Release sub-stub if it is not successfully sent to remote side
+ // (otherwise, stub will leak until terminate()):
+ if (j == stub->end()) {
+ j = stub->insert(Stub::value_type(type, SubStub())).first;
+ if (stub == &newStub) {
+ i = stubs_.insert(Stubs::value_type(oid, Stub())).first;
+ std::swap(i->second, newStub);
+ j = i->second.find(type);
+ OSL_ASSERT(j != i->second.end());
+ }
+ j->second.object = object;
+ j->second.references = 1;
+ binaryUno_.get()->pExtEnv->registerInterface(
+ binaryUno_.get()->pExtEnv,
+ reinterpret_cast< void ** >(&j->second.object.m_pUnoI),
+ oid.pData,
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(
+ type.get()));
+ } else {
+ OSL_ASSERT(stub != &newStub);
+ if (j->second.references == SAL_MAX_UINT32) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: stub reference count overflow")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ ++j->second.references;
+ }
+ }
+ return oid;
+}
+
+css::uno::UnoInterfaceReference Bridge::findStub(
+ rtl::OUString const & oid, css::uno::TypeDescription const & type)
+{
+ OSL_ASSERT(oid.getLength() != 0 && type.is());
+ osl::MutexGuard g(mutex_);
+ Stubs::iterator i(stubs_.find(oid));
+ if (i != stubs_.end()) {
+ Stub::iterator j(i->second.find(type));
+ if (j != i->second.end()) {
+ return j->second.object;
+ }
+ for (j = i->second.begin(); j != i->second.end(); ++j) {
+ if (typelib_typedescription_isAssignableFrom(
+ type.get(), j->first.get()))
+ {
+ return j->second.object;
+ }
+ }
+ }
+ return css::uno::UnoInterfaceReference();
+}
+
+void Bridge::releaseStub(
+ rtl::OUString const & oid, css::uno::TypeDescription const & type)
+{
+ OSL_ASSERT(oid.getLength() != 0 && type.is());
+ css::uno::UnoInterfaceReference obj;
+ bool unused;
+ {
+ osl::MutexGuard g(mutex_);
+ Stubs::iterator i(stubs_.find(oid));
+ if (i == stubs_.end()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("URP: release unknown stub")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ Stub::iterator j(i->second.find(type));
+ if (j == i->second.end()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("URP: release unknown stub")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ OSL_ASSERT(j->second.references > 0);
+ --j->second.references;
+ if (j->second.references == 0) {
+ obj = j->second.object;
+ i->second.erase(j);
+ if (i->second.empty()) {
+ stubs_.erase(i);
+ }
+ }
+ unused = becameUnused();
+ }
+ if (obj.is()) {
+ binaryUno_.get()->pExtEnv->revokeInterface(
+ binaryUno_.get()->pExtEnv, obj.get());
+ }
+ terminateWhenUnused(unused);
+}
+
+void Bridge::resurrectProxy(Proxy & proxy) {
+ uno_Interface * p = &proxy;
+ binaryUno_.get()->pExtEnv->registerProxyInterface(
+ binaryUno_.get()->pExtEnv,
+ reinterpret_cast< void ** >(&p), &freeProxyCallback,
+ proxy.getOid().pData,
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(
+ proxy.getType().get()));
+ OSL_ASSERT(p == &proxy);
+}
+
+void Bridge::revokeProxy(Proxy & proxy) {
+ binaryUno_.get()->pExtEnv->revokeInterface(
+ binaryUno_.get()->pExtEnv, &proxy);
+}
+
+void Bridge::freeProxy(Proxy & proxy) {
+ try {
+ makeReleaseCall(proxy.getOid(), proxy.getType());
+ } catch (css::uno::RuntimeException & e) {
+ OSL_TRACE(
+ OSL_LOG_PREFIX "caught runtime exception '%s'",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ } catch (std::exception & e) {
+ OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what());
+ }
+ bool unused;
+ {
+ osl::MutexGuard g(mutex_);
+ OSL_ASSERT(proxies_ > 0);
+ --proxies_;
+ unused = becameUnused();
+ }
+ terminateWhenUnused(unused);
+}
+
+void Bridge::incrementCalls(bool normalCall) throw () {
+ osl::MutexGuard g(mutex_);
+ OSL_ASSERT(calls_ < std::numeric_limits< std::size_t >::max());
+ ++calls_;
+ normalCall_ |= normalCall;
+}
+
+void Bridge::decrementCalls() {
+ bool unused;
+ {
+ osl::MutexGuard g(mutex_);
+ OSL_ASSERT(calls_ > 0);
+ --calls_;
+ unused = becameUnused();
+ }
+ terminateWhenUnused(unused);
+}
+
+void Bridge::incrementActiveCalls() throw () {
+ osl::MutexGuard g(mutex_);
+ OSL_ASSERT(
+ activeCalls_ <= calls_ &&
+ activeCalls_ < std::numeric_limits< std::size_t >::max());
+ ++activeCalls_;
+ passive_.reset();
+}
+
+void Bridge::decrementActiveCalls() throw () {
+ osl::MutexGuard g(mutex_);
+ OSL_ASSERT(activeCalls_ <= calls_ && activeCalls_ > 0);
+ --activeCalls_;
+ if (activeCalls_ == 0) {
+ passive_.set();
+ }
+}
+
+bool Bridge::makeCall(
+ rtl::OUString const & oid, css::uno::TypeDescription const & member,
+ bool setter, std::vector< BinaryAny > const & inArguments,
+ BinaryAny * returnValue, std::vector< BinaryAny > * outArguments)
+{
+ std::auto_ptr< IncomingReply > resp;
+ {
+ AttachThread att(threadPool_);
+ PopOutgoingRequest pop(
+ outgoingRequests_, att.getTid(),
+ OutgoingRequest(OutgoingRequest::KIND_NORMAL, member, setter));
+ sendRequest(
+ att.getTid(), oid, css::uno::TypeDescription(), member,
+ inArguments);
+ pop.clear();
+ incrementCalls(true);
+ incrementActiveCalls();
+ void * job;
+ uno_threadpool_enter(threadPool_, &job);
+ resp.reset(static_cast< IncomingReply * >(job));
+ decrementActiveCalls();
+ decrementCalls();
+ }
+ if (resp.get() == 0) {
+ throw css::lang::DisposedException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "Binary URP bridge disposed during call")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ *returnValue = resp->returnValue;
+ if (!resp->exception) {
+ *outArguments = resp->outArguments;
+ }
+ return resp->exception;
+}
+
+void Bridge::sendRequestChangeRequest() {
+ OSL_ASSERT(mode_ == MODE_REQUESTED);
+ random_ = random();
+ std::vector< BinaryAny > a;
+ a.push_back(
+ BinaryAny(
+ css::uno::TypeDescription(cppu::UnoType< sal_Int32 >::get()),
+ &random_));
+ sendProtPropRequest(OutgoingRequest::KIND_REQUEST_CHANGE, a);
+}
+
+void Bridge::handleRequestChangeReply(
+ bool exception, BinaryAny const & returnValue)
+{
+ throwException(exception, returnValue);
+ sal_Int32 n = *static_cast< sal_Int32 * >(
+ returnValue.getValue(
+ css::uno::TypeDescription(cppu::UnoType< sal_Int32 >::get())));
+ sal_Int32 exp = 0;
+ switch (mode_) {
+ case MODE_REQUESTED:
+ case MODE_REPLY_1:
+ exp = 1;
+ break;
+ case MODE_REPLY_MINUS1:
+ exp = -1;
+ mode_ = MODE_REQUESTED;
+ break;
+ case MODE_REPLY_0:
+ exp = 0;
+ mode_ = MODE_WAIT;
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ if (n != exp) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: requestChange reply with unexpected return value"
+ " received")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ decrementCalls();
+ switch (exp) {
+ case -1:
+ sendRequestChangeRequest();
+ break;
+ case 0:
+ break;
+ case 1:
+ sendCommitChangeRequest();
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+}
+
+void Bridge::handleCommitChangeReply(
+ bool exception, BinaryAny const & returnValue)
+{
+ bool ccMode = true;
+ try {
+ throwException(exception, returnValue);
+ } catch (css::bridge::InvalidProtocolChangeException &) {
+ ccMode = false;
+ }
+ if (ccMode) {
+ setCurrentContextMode();
+ }
+ OSL_ASSERT(mode_ == MODE_REQUESTED || mode_ == MODE_REPLY_1);
+ mode_ = MODE_NORMAL;
+ getWriter()->unblock();
+ decrementCalls();
+}
+
+void Bridge::handleRequestChangeRequest(
+ rtl::ByteSequence const & tid, std::vector< BinaryAny > const & inArguments)
+{
+ OSL_ASSERT(inArguments.size() == 1);
+ switch (mode_) {
+ case MODE_REQUESTED:
+ {
+ sal_Int32 n2 = *static_cast< sal_Int32 * >(
+ inArguments[0].getValue(
+ css::uno::TypeDescription(
+ cppu::UnoType< sal_Int32 >::get())));
+ sal_Int32 ret;
+ if (n2 > random_) {
+ ret = 1;
+ mode_ = MODE_REPLY_0;
+ } else if (n2 == random_) {
+ ret = -1;
+ mode_ = MODE_REPLY_MINUS1;
+ } else {
+ ret = 0;
+ mode_ = MODE_REPLY_1;
+ }
+ getWriter()->sendDirectReply(
+ tid, protPropRequest_, false,
+ BinaryAny(
+ css::uno::TypeDescription(
+ cppu::UnoType< sal_Int32 >::get()),
+ &ret),
+ std::vector< BinaryAny >());
+ break;
+ }
+ case MODE_NORMAL:
+ {
+ mode_ = MODE_NORMAL_WAIT;
+ sal_Int32 ret = 1;
+ getWriter()->queueReply(
+ tid, protPropRequest_, false, false,
+ BinaryAny(
+ css::uno::TypeDescription(
+ cppu::UnoType< sal_Int32 >::get()),
+ &ret),
+ std::vector< BinaryAny >(), false);
+ break;
+ }
+ default:
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: unexpected requestChange request received")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+void Bridge::handleCommitChangeRequest(
+ rtl::ByteSequence const & tid, std::vector< BinaryAny > const & inArguments)
+{
+ bool ccMode = false;
+ bool exc = false;
+ BinaryAny ret;
+ OSL_ASSERT(inArguments.size() == 1);
+ css::uno::Sequence< css::bridge::ProtocolProperty > s;
+ OSL_VERIFY(mapBinaryToCppAny(inArguments[0]) >>= s);
+ for (sal_Int32 i = 0; i != s.getLength(); ++i) {
+ if (s[i].Name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("CurrentContext")))
+ {
+ ccMode = true;
+ } else {
+ ccMode = false;
+ exc = true;
+ ret = mapCppToBinaryAny(
+ css::uno::makeAny(
+ css::bridge::InvalidProtocolChangeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "InvalidProtocolChangeException")),
+ css::uno::Reference< css::uno::XInterface >(), s[i],
+ 1)));
+ break;
+ }
+ }
+ switch (mode_) {
+ case MODE_WAIT:
+ getWriter()->sendDirectReply(
+ tid, protPropCommit_, exc, ret, std::vector< BinaryAny >());
+ if (ccMode) {
+ setCurrentContextMode();
+ mode_ = MODE_NORMAL;
+ getWriter()->unblock();
+ } else {
+ mode_ = MODE_REQUESTED;
+ sendRequestChangeRequest();
+ }
+ break;
+ case MODE_NORMAL_WAIT:
+ getWriter()->queueReply(
+ tid, protPropCommit_, false, false, ret, std::vector< BinaryAny >(),
+ ccMode);
+ mode_ = MODE_NORMAL;
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: unexpected commitChange request received")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+OutgoingRequest Bridge::lastOutgoingRequest(rtl::ByteSequence const & tid) {
+ OutgoingRequest req(outgoingRequests_.top(tid));
+ outgoingRequests_.pop(tid);
+ return req;
+}
+
+bool Bridge::isProtocolPropertiesRequest(
+ rtl::OUString const & oid, css::uno::TypeDescription const & type) const
+{
+ return oid == protPropOid_ && type.equals(protPropType_);
+}
+
+void Bridge::setCurrentContextMode() {
+ osl::MutexGuard g(mutex_);
+ currentContextMode_ = true;
+}
+
+bool Bridge::isCurrentContextMode() {
+ osl::MutexGuard g(mutex_);
+ return currentContextMode_;
+}
+
+Bridge::~Bridge() {
+ if (threadPool_ != 0) {
+ uno_threadpool_destroy(threadPool_);
+ }
+}
+
+css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
+ rtl::OUString const & sInstanceName) throw (css::uno::RuntimeException)
+{
+ if (sInstanceName.getLength() == 0) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "XBridge::getInstance sInstanceName must be non-empty")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ for (sal_Int32 i = 0; i != sInstanceName.getLength(); ++i) {
+ if (sInstanceName[i] > 0x7F) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "XBridge::getInstance sInstanceName contains non-ASCII"
+ " character")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ css::uno::TypeDescription ifc(
+ cppu::UnoType< css::uno::Reference< css::uno::XInterface > >::get());
+ typelib_TypeDescription * p = ifc.get();
+ std::vector< BinaryAny > inArgs;
+ inArgs.push_back(
+ BinaryAny(
+ css::uno::TypeDescription(cppu::UnoType< css::uno::Type >::get()),
+ &p));
+ BinaryAny ret;
+ std::vector< BinaryAny> outArgs;
+ bool exc = makeCall(
+ sInstanceName,
+ css::uno::TypeDescription(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.uno.XInterface::queryInterface"))),
+ false, inArgs, &ret, &outArgs);
+ throwException(exc, ret);
+ return css::uno::Reference< css::uno::XInterface >(
+ static_cast< css::uno::XInterface * >(
+ binaryToCppMapping_.mapInterface(
+ *static_cast< uno_Interface ** >(ret.getValue(ifc)),
+ ifc.get())),
+ css::uno::UNO_REF_NO_ACQUIRE);
+}
+
+rtl::OUString Bridge::getName() throw (css::uno::RuntimeException) {
+ return name_;
+}
+
+rtl::OUString Bridge::getDescription() throw (css::uno::RuntimeException) {
+ rtl::OUStringBuffer b(name_);
+ b.append(sal_Unicode(':'));
+ b.append(connection_->getDescription());
+ return b.makeStringAndClear();
+}
+
+void Bridge::dispose() throw (css::uno::RuntimeException) {
+ terminate();
+ // OOo expects dispose to not return while there are still remote calls in
+ // progress; an external protocol must ensure that dispose is not called
+ // from within an incoming or outgoing remote call, as passive_.wait() would
+ // otherwise deadlock:
+ passive_.wait();
+}
+
+void Bridge::addEventListener(
+ css::uno::Reference< css::lang::XEventListener > const & xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(xListener.is());
+ {
+ osl::MutexGuard g(mutex_);
+ if (!terminated_) {
+ listeners_.push_back(xListener);
+ return;
+ }
+ }
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+}
+
+void Bridge::removeEventListener(
+ css::uno::Reference< css::lang::XEventListener > const & aListener)
+ throw (css::uno::RuntimeException)
+{
+ osl::MutexGuard g(mutex_);
+ Listeners::iterator i(
+ std::find(listeners_.begin(), listeners_.end(), aListener));
+ if (i != listeners_.end()) {
+ listeners_.erase(i);
+ }
+}
+
+void Bridge::sendCommitChangeRequest() {
+ OSL_ASSERT(mode_ == MODE_REQUESTED || mode_ == MODE_REPLY_1);
+ css::uno::Sequence< css::bridge::ProtocolProperty > s(1);
+ s[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CurrentContext"));
+ std::vector< BinaryAny > a;
+ a.push_back(mapCppToBinaryAny(css::uno::makeAny(s)));
+ sendProtPropRequest(OutgoingRequest::KIND_COMMIT_CHANGE, a);
+}
+
+void Bridge::sendProtPropRequest(
+ OutgoingRequest::Kind kind, std::vector< BinaryAny > const & inArguments)
+{
+ OSL_ASSERT(
+ kind == OutgoingRequest::KIND_REQUEST_CHANGE ||
+ kind == OutgoingRequest::KIND_COMMIT_CHANGE);
+ incrementCalls(false);
+ css::uno::TypeDescription member(
+ kind == OutgoingRequest::KIND_REQUEST_CHANGE
+ ? protPropRequest_ : protPropCommit_);
+ PopOutgoingRequest pop(
+ outgoingRequests_, protPropTid_, OutgoingRequest(kind, member, false));
+ getWriter()->sendDirectRequest(
+ protPropTid_, protPropOid_, protPropType_, member, inArguments);
+ pop.clear();
+}
+
+void Bridge::makeReleaseCall(
+ rtl::OUString const & oid, css::uno::TypeDescription const & type)
+{
+ AttachThread att(threadPool_);
+ sendRequest(
+ att.getTid(), oid, type,
+ css::uno::TypeDescription(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.uno.XInterface::release"))),
+ std::vector< BinaryAny >());
+}
+
+void Bridge::sendRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ css::uno::TypeDescription const & type,
+ css::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments)
+{
+ getWriter()->queueRequest(tid, oid, type, member, inArguments);
+}
+
+void Bridge::throwException(bool exception, BinaryAny const & value) {
+ if (exception) {
+ cppu::throwException(mapBinaryToCppAny(value));
+ }
+}
+
+css::uno::Any Bridge::mapBinaryToCppAny(BinaryAny const & binaryAny) {
+ BinaryAny in(binaryAny);
+ css::uno::Any out;
+ out.~Any();
+ uno_copyAndConvertData(
+ &out, in.get(),
+ css::uno::TypeDescription(cppu::UnoType< css::uno::Any >::get()).get(),
+ binaryToCppMapping_.get());
+ return out;
+}
+
+bool Bridge::becameUnused() const {
+ return stubs_.empty() && proxies_ == 0 && calls_ == 0 && normalCall_;
+}
+
+void Bridge::terminateWhenUnused(bool unused) {
+ if (unused) {
+ // That the current thread considers the bridge unused implies that it
+ // is not within an incoming or outgoing remote call (so calling
+ // terminate cannot lead to deadlock):
+ terminate();
+ }
+}
+
+}
diff --git a/binaryurp/source/bridge.hxx b/binaryurp/source/bridge.hxx
new file mode 100644
index 000000000000..73e32aac0cac
--- /dev/null
+++ b/binaryurp/source/bridge.hxx
@@ -0,0 +1,287 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_BRIDGE_HXX
+#define INCLUDED_BINARYURP_SOURCE_BRIDGE_HXX
+
+#include "sal/config.h"
+
+#include <cstddef>
+#include <list>
+#include <map>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/bridge/XBridge.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "cppuhelper/implbase2.hxx"
+#include "osl/conditn.hxx"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/environment.hxx"
+#include "uno/mapping.hxx"
+#include "uno/threadpool.h"
+
+#include "outgoingrequest.hxx"
+#include "outgoingrequests.hxx"
+#include "writer.hxx"
+
+namespace binaryurp {
+ class BinaryAny;
+ class BridgeFactory;
+ class Proxy;
+ class Reader;
+}
+namespace com { namespace sun { namespace star {
+ namespace bridge { class XInstanceProvider; }
+ namespace connection { class XConnection; }
+ namespace lang { class XEventListener; }
+ namespace uno {
+ class Any;
+ class TypeDescription;
+ class UnoInterfaceReference;
+ class XInterface;
+ }
+} } }
+namespace rtl { class ByteSequence; }
+
+namespace binaryurp {
+
+class Bridge:
+ public cppu::WeakImplHelper2<
+ com::sun::star::bridge::XBridge, com::sun::star::lang::XComponent >,
+ private boost::noncopyable
+{
+public:
+ Bridge(
+ rtl::Reference< BridgeFactory > const & factory,
+ rtl::OUString const & name,
+ com::sun::star::uno::Reference<
+ com::sun::star::connection::XConnection > const & connection,
+ com::sun::star::uno::Reference<
+ com::sun::star::bridge::XInstanceProvider > const & provider);
+
+ void start();
+
+ // Internally waits for all incoming and outgoing remote calls to terminate,
+ // so must not be called from within such a call:
+ void terminate();
+
+ com::sun::star::uno::Reference< com::sun::star::connection::XConnection >
+ getConnection() const;
+
+ com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider >
+ getProvider() const;
+
+ com::sun::star::uno::Mapping & getCppToBinaryMapping();
+
+ BinaryAny mapCppToBinaryAny(com::sun::star::uno::Any const & cppAny);
+
+ uno_ThreadPool getThreadPool() const;
+
+ rtl::Reference< Writer > getWriter();
+
+ com::sun::star::uno::UnoInterfaceReference registerIncomingInterface(
+ rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type);
+
+ rtl::OUString registerOutgoingInterface(
+ com::sun::star::uno::UnoInterfaceReference const & object,
+ com::sun::star::uno::TypeDescription const & type);
+
+ com::sun::star::uno::UnoInterfaceReference findStub(
+ rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type);
+
+ void releaseStub(
+ rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type);
+
+ void resurrectProxy(Proxy & proxy);
+
+ void revokeProxy(Proxy & proxy);
+
+ void freeProxy(Proxy & proxy);
+
+ void incrementCalls(bool normalCall) throw ();
+
+ void decrementCalls();
+
+ void incrementActiveCalls() throw ();
+
+ void decrementActiveCalls() throw ();
+
+ bool makeCall(
+ rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & member, bool setter,
+ std::vector< BinaryAny > const & inArguments, BinaryAny * returnValue,
+ std::vector< BinaryAny > * outArguments);
+
+ // Only called from reader_ thread:
+ void sendRequestChangeRequest();
+
+ // Only called from reader_ thread:
+ void handleRequestChangeReply(
+ bool exception, BinaryAny const & returnValue);
+
+ // Only called from reader_ thread:
+ void handleCommitChangeReply(bool exception, BinaryAny const & returnValue);
+
+ // Only called from reader_ thread:
+ void handleRequestChangeRequest(
+ rtl::ByteSequence const & tid,
+ std::vector< BinaryAny > const & inArguments);
+
+ // Only called from reader_ thread:
+ void handleCommitChangeRequest(
+ rtl::ByteSequence const & tid,
+ std::vector< BinaryAny > const & inArguments);
+
+ OutgoingRequest lastOutgoingRequest(rtl::ByteSequence const & tid);
+
+ bool isProtocolPropertiesRequest(
+ rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type) const;
+
+ void setCurrentContextMode();
+
+ bool isCurrentContextMode();
+
+private:
+ virtual ~Bridge();
+
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ SAL_CALL getInstance(rtl::OUString const & sInstanceName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getDescription()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL dispose()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addEventListener(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeEventListener(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & aListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ // Only called from reader_ thread:
+ void sendCommitChangeRequest();
+
+ // Only called from reader_ thread:
+ void sendProtPropRequest(
+ OutgoingRequest::Kind kind,
+ std::vector< BinaryAny > const & inArguments);
+
+ void makeReleaseCall(
+ rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type);
+
+ void sendRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type,
+ com::sun::star::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments);
+
+ void throwException(bool exception, BinaryAny const & value);
+
+ com::sun::star::uno::Any mapBinaryToCppAny(BinaryAny const & binaryAny);
+
+ bool becameUnused() const;
+
+ void terminateWhenUnused(bool unused);
+
+ typedef
+ std::list<
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener > >
+ Listeners;
+
+ struct SubStub;
+
+ typedef std::map< com::sun::star::uno::TypeDescription, SubStub > Stub;
+
+ typedef std::map< rtl::OUString, Stub > Stubs;
+
+ enum Mode {
+ MODE_REQUESTED, MODE_REPLY_MINUS1, MODE_REPLY_0, MODE_REPLY_1,
+ MODE_WAIT, MODE_NORMAL, MODE_NORMAL_WAIT };
+
+ rtl::Reference< BridgeFactory > factory_;
+ rtl::OUString name_;
+ com::sun::star::uno::Reference< com::sun::star::connection::XConnection >
+ connection_;
+ com::sun::star::uno::Reference< com::sun::star::bridge::XInstanceProvider >
+ provider_;
+ com::sun::star::uno::Environment binaryUno_;
+ com::sun::star::uno::Mapping cppToBinaryMapping_;
+ com::sun::star::uno::Mapping binaryToCppMapping_;
+ rtl::ByteSequence protPropTid_;
+ rtl::OUString protPropOid_;
+ com::sun::star::uno::TypeDescription protPropType_;
+ com::sun::star::uno::TypeDescription protPropRequest_;
+ com::sun::star::uno::TypeDescription protPropCommit_;
+ uno_ThreadPool threadPool_;
+ OutgoingRequests outgoingRequests_;
+
+ osl::Mutex mutex_;
+ Listeners listeners_;
+ rtl::Reference< Writer > writer_;
+ rtl::Reference< Reader > reader_;
+ bool currentContextMode_;
+ Stubs stubs_;
+ std::size_t proxies_;
+ std::size_t calls_;
+ bool normalCall_;
+ std::size_t activeCalls_;
+ osl::Condition passive_;
+ // to guarantee that passive_ is eventually set (to avoid deadlock, see
+ // dispose), activeCalls_ only counts those calls for which it can be
+ // guaranteed that incrementActiveCalls is indeed followed by
+ // decrementActiveCalls, without an intervening exception
+ bool terminated_;
+
+ // Only accessed from reader_ thread:
+ Mode mode_;
+ sal_Int32 random_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/bridgefactory.cxx b/binaryurp/source/bridgefactory.cxx
new file mode 100644
index 000000000000..16bd9cf1b6f3
--- /dev/null
+++ b/binaryurp/source/bridgefactory.cxx
@@ -0,0 +1,232 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <algorithm>
+
+#include "com/sun/star/connection/XConnection.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+#include "uno/lbnames.h"
+
+#include "bridge.hxx"
+#include "bridgefactory.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+css::uno::Reference< css::uno::XInterface > BridgeFactory::static_create(
+ css::uno::Reference< css::uno::XComponentContext > const & xContext)
+ SAL_THROW((css::uno::Exception))
+{
+ return static_cast< cppu::OWeakObject * >(new BridgeFactory(xContext));
+}
+
+rtl::OUString BridgeFactory::static_getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.bridge.BridgeFactory"));
+}
+
+css::uno::Sequence< rtl::OUString >
+BridgeFactory::static_getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.BridgeFactory"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+void BridgeFactory::removeBridge(
+ css::uno::Reference< css::bridge::XBridge > const & bridge)
+{
+ OSL_ASSERT(bridge.is());
+ rtl::OUString n(bridge->getName());
+ osl::MutexGuard g(*this);
+ if (n.getLength() == 0) {
+ BridgeList::iterator i(
+ std::find(unnamed_.begin(), unnamed_.end(), bridge));
+ if (i != unnamed_.end()) {
+ unnamed_.erase(i);
+ }
+ } else {
+ BridgeMap::iterator i(named_.find(n));
+ if (i != named_.end() && i->second == bridge) {
+ named_.erase(i);
+ }
+ }
+}
+
+BridgeFactory::BridgeFactory(
+ css::uno::Reference< css::uno::XComponentContext > const & context):
+ BridgeFactoryBase(*static_cast< osl::Mutex * >(this)), context_(context)
+{
+ OSL_ASSERT(context.is());
+}
+
+BridgeFactory::~BridgeFactory() {}
+
+rtl::OUString BridgeFactory::getImplementationName()
+ throw (css::uno::RuntimeException)
+{
+ return static_getImplementationName();
+}
+
+sal_Bool BridgeFactory::supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Sequence< rtl::OUString > s(getSupportedServiceNames());
+ for (sal_Int32 i = 0; i != s.getLength(); ++i) {
+ if (ServiceName == s[i]) {
+ return true;
+ }
+ }
+ return false;
+}
+
+css::uno::Sequence< rtl::OUString > BridgeFactory::getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+{
+ return static_getSupportedServiceNames();
+}
+
+css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge(
+ rtl::OUString const & sName, rtl::OUString const & sProtocol,
+ css::uno::Reference< css::connection::XConnection > const & aConnection,
+ css::uno::Reference< css::bridge::XInstanceProvider > const &
+ anInstanceProvider)
+ throw (
+ css::bridge::BridgeExistsException, css::lang::IllegalArgumentException,
+ css::uno::RuntimeException)
+{
+ rtl::Reference< Bridge > b;
+ {
+ osl::MutexGuard g(*this);
+ if (named_.find(sName) != named_.end()) {
+ throw css::bridge::BridgeExistsException(
+ sName, static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!(sProtocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("urp")) &&
+ aConnection.is()))
+ {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "BridgeFactory::createBridge: sProtocol != urp ||"
+ " aConnection == null")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ b.set(new Bridge(this, sName, aConnection, anInstanceProvider));
+ if (sName.getLength() == 0) {
+ unnamed_.push_back(
+ css::uno::Reference< css::bridge::XBridge >(b.get()));
+ } else {
+ named_[sName] = b.get();
+ }
+ }
+ b->start();
+ return css::uno::Reference< css::bridge::XBridge >(b.get());
+}
+
+css::uno::Reference< css::bridge::XBridge > BridgeFactory::getBridge(
+ rtl::OUString const & sName) throw (css::uno::RuntimeException)
+{
+ osl::MutexGuard g(*this);
+ BridgeMap::iterator i(named_.find(sName));
+ return i == named_.end()
+ ? css::uno::Reference< css::bridge::XBridge >() : i->second;
+}
+
+css::uno::Sequence< css::uno::Reference< css::bridge::XBridge > >
+BridgeFactory::getExistingBridges() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(*this);
+ if (unnamed_.size() > SAL_MAX_INT32) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "BridgeFactory::getExistingBridges: too many")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ sal_Int32 n = static_cast< sal_Int32 >(unnamed_.size());
+ if (named_.size() > static_cast< sal_uInt32 >(SAL_MAX_INT32 - n)) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "BridgeFactory::getExistingBridges: too many")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ n = static_cast< sal_Int32 >(n + named_.size());
+ css::uno::Sequence< css::uno::Reference< css::bridge::XBridge > > s(n);
+ sal_Int32 i = 0;
+ for (BridgeList::iterator j(unnamed_.begin()); j != unnamed_.end(); ++j) {
+ s[i++] = *j;
+ }
+ for (BridgeMap::iterator j(named_.begin()); j != named_.end(); ++j) {
+ s[i++] = j->second;
+ }
+ return s;
+}
+
+}
+
+namespace {
+
+static cppu::ImplementationEntry const services[] = {
+ { &binaryurp::BridgeFactory::static_create,
+ &binaryurp::BridgeFactory::static_getImplementationName,
+ &binaryurp::BridgeFactory::static_getSupportedServiceNames,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
diff --git a/binaryurp/source/bridgefactory.hxx b/binaryurp/source/bridgefactory.hxx
new file mode 100755
index 000000000000..af6499d61bd0
--- /dev/null
+++ b/binaryurp/source/bridgefactory.hxx
@@ -0,0 +1,144 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_BRIDGEFACTORY_HXX
+#define INCLUDED_BINARYURP_SOURCE_BRIDGEFACTORY_HXX
+
+#include "sal/config.h"
+
+#include <list>
+#include <map>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/bridge/XBridgeFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "cppuhelper/compbase2.hxx"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star {
+ namespace connection { class XConnection; }
+ namespace uno {
+ class XComponentContext;
+ class XInterface;
+ }
+} } }
+
+namespace binaryurp {
+
+// That BridgeFactory derives from XComponent appears to be a historic mistake;
+// the implementation does not care about a disposed state:
+
+typedef
+ cppu::WeakComponentImplHelper2<
+ com::sun::star::lang::XServiceInfo,
+ com::sun::star::bridge::XBridgeFactory >
+ BridgeFactoryBase;
+
+class BridgeFactory:
+ private osl::Mutex, public BridgeFactoryBase, private boost::noncopyable
+{
+public:
+ static com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ SAL_CALL static_create(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & xContext)
+ SAL_THROW((com::sun::star::uno::Exception));
+
+ static rtl::OUString SAL_CALL static_getImplementationName();
+
+ static com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ static_getSupportedServiceNames();
+
+ void removeBridge(
+ com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
+ const & bridge);
+
+ using BridgeFactoryBase::acquire;
+ using BridgeFactoryBase::release;
+
+private:
+ explicit BridgeFactory(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ virtual ~BridgeFactory();
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
+ SAL_CALL createBridge(
+ rtl::OUString const & sName, rtl::OUString const & sProtocol,
+ com::sun::star::uno::Reference<
+ com::sun::star::connection::XConnection > const & aConnection,
+ com::sun::star::uno::Reference<
+ com::sun::star::bridge::XInstanceProvider > const &
+ anInstanceProvider)
+ throw (
+ com::sun::star::bridge::BridgeExistsException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
+ SAL_CALL getBridge(
+ rtl::OUString const & sName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference< com::sun::star::bridge::XBridge > >
+ SAL_CALL getExistingBridges() throw (com::sun::star::uno::RuntimeException);
+
+ typedef
+ std::list<
+ com::sun::star::uno::Reference< com::sun::star::bridge::XBridge > >
+ BridgeList;
+
+ typedef
+ std::map<
+ rtl::OUString,
+ com::sun::star::uno::Reference< com::sun::star::bridge::XBridge > >
+ BridgeMap;
+
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ context_;
+ BridgeList unnamed_;
+ BridgeMap named_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/cache.hxx b/binaryurp/source/cache.hxx
new file mode 100755
index 000000000000..118b8a07b98d
--- /dev/null
+++ b/binaryurp/source/cache.hxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_CACHE_HXX
+#define INCLUDED_BINARYURP_SOURCE_CACHE_HXX
+
+#include "sal/config.h"
+
+#include <cstddef>
+#include <map>
+
+#include "boost/noncopyable.hpp"
+#include "osl/diagnose.h"
+#include "sal/types.h"
+
+namespace binaryurp {
+
+namespace cache {
+
+enum { size = 256, ignore = 0xFFFF };
+
+}
+
+template< typename T > class Cache: private boost::noncopyable {
+public:
+ explicit Cache(std::size_t size):
+ size_(size), first_(map_.end()), last_(map_.end())
+ {
+ OSL_ASSERT(size < cache::ignore);
+ }
+
+ sal_uInt16 add(T const & content, bool * found) {
+ OSL_ASSERT(found != 0);
+ typename Map::iterator i(map_.find(content));
+ *found = i != map_.end();
+ if (i == map_.end()) {
+ typename Map::size_type n = map_.size();
+ if (n < size_) {
+ i =
+ (map_.insert(
+ typename Map::value_type(
+ content,
+ Entry(
+ static_cast< sal_uInt16 >(n), map_.end(),
+ first_)))).
+ first;
+ if (first_ == map_.end()) {
+ last_ = i;
+ } else {
+ first_->second.prev = i;
+ }
+ first_ = i;
+ } else if (last_ != map_.end()) {
+ i =
+ (map_.insert(
+ typename Map::value_type(
+ content,
+ Entry(last_->second.index, map_.end(), first_)))).
+ first;
+ first_->second.prev = i;
+ first_ = i;
+ typename Map::iterator j(last_);
+ last_ = last_->second.prev;
+ last_->second.next = map_.end();
+ map_.erase(j);
+ } else {
+ // Reached iff size_ == 0:
+ return cache::ignore;
+ }
+ } else if (i != first_) {
+ // Move to front (reached only if size_ > 1):
+ i->second.prev->second.next = i->second.next;
+ if (i->second.next == map_.end()) {
+ last_ = i->second.prev;
+ } else {
+ i->second.next->second.prev = i->second.prev;
+ }
+ i->second.prev = map_.end();
+ i->second.next = first_;
+ first_->second.prev = i;
+ first_ = i;
+ }
+ return i->second.index;
+ }
+
+private:
+ struct Entry;
+
+ typedef std::map< T, Entry > Map;
+
+ struct Entry {
+ sal_uInt16 index;
+ typename Map::iterator prev;
+ typename Map::iterator next;
+
+ Entry(
+ sal_uInt16 theIndex, typename Map::iterator thePrev,
+ typename Map::iterator theNext):
+ index(theIndex), prev(thePrev), next(theNext) {}
+ };
+
+ std::size_t size_;
+ Map map_;
+ typename Map::iterator first_;
+ typename Map::iterator last_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/currentcontext.cxx b/binaryurp/source/currentcontext.cxx
new file mode 100644
index 000000000000..aed9640d84a0
--- /dev/null
+++ b/binaryurp/source/currentcontext.cxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "uno/current_context.h"
+#include "uno/dispatcher.hxx"
+#include "uno/lbnames.h"
+
+#include "currentcontext.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+namespace current_context {
+
+css::uno::UnoInterfaceReference get() {
+ css::uno::UnoInterfaceReference cc;
+ if (!uno_getCurrentContext(
+ reinterpret_cast< void ** >(&cc.m_pUnoI),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)).pData, 0))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("uno_getCurrentContext failed")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return cc;
+}
+
+void set(css::uno::UnoInterfaceReference const & value) {
+ css::uno::UnoInterfaceReference cc(value);
+ if (!uno_setCurrentContext(
+ cc.m_pUnoI,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO)).pData, 0))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("uno_setCurrentContext failed")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+}
+
+}
diff --git a/binaryurp/source/currentcontext.hxx b/binaryurp/source/currentcontext.hxx
new file mode 100644
index 000000000000..558d9ac04d5c
--- /dev/null
+++ b/binaryurp/source/currentcontext.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_CURRENTCONTEXT_HXX
+#define INCLUDED_BINARYURP_SOURCE_CURRENTCONTEXT_HXX
+
+#include "sal/config.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class UnoInterfaceReference;
+} } } }
+
+namespace binaryurp {
+
+namespace current_context {
+
+com::sun::star::uno::UnoInterfaceReference get();
+
+void set(com::sun::star::uno::UnoInterfaceReference const & value);
+
+}
+
+}
+
+#endif
diff --git a/binaryurp/source/incomingreply.hxx b/binaryurp/source/incomingreply.hxx
new file mode 100644
index 000000000000..654542f701fa
--- /dev/null
+++ b/binaryurp/source/incomingreply.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_INCOMINGREPLY_HXX
+#define INCLUDED_BINARYURP_SOURCE_INCOMINGREPLY_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+
+#include "binaryany.hxx"
+
+namespace binaryurp {
+
+struct IncomingReply: private boost::noncopyable {
+ IncomingReply(
+ bool theException, BinaryAny const & theReturnValue,
+ std::vector< BinaryAny > const & theOutArguments):
+ exception(theException), returnValue(theReturnValue),
+ outArguments(theOutArguments)
+ {}
+
+ bool exception;
+
+ BinaryAny returnValue;
+
+ std::vector< BinaryAny > outArguments;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx
new file mode 100644
index 000000000000..646a868f66fd
--- /dev/null
+++ b/binaryurp/source/incomingrequest.cxx
@@ -0,0 +1,300 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <list>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/bridge/XInstanceProvider.hpp"
+#include "cppuhelper/exc_hlp.hxx"
+#include "rtl/byteseq.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typedescription.hxx"
+#include "uno/dispatcher.hxx"
+
+#include "binaryany.hxx"
+#include "bridge.hxx"
+#include "currentcontext.hxx"
+#include "incomingrequest.hxx"
+#include "specialfunctionids.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+IncomingRequest::IncomingRequest(
+ rtl::Reference< Bridge > const & bridge, rtl::ByteSequence const & tid,
+ rtl::OUString const & oid, css::uno::UnoInterfaceReference const & object,
+ css::uno::TypeDescription const & type, sal_uInt16 functionId,
+ bool synchronous, css::uno::TypeDescription const & member, bool setter,
+ std::vector< BinaryAny > const & inArguments, bool currentContextMode,
+ css::uno::UnoInterfaceReference const & currentContext):
+ bridge_(bridge), tid_(tid), oid_(oid), object_(object), type_(type),
+ functionId_(functionId), synchronous_(synchronous), member_(member),
+ setter_(setter), inArguments_(inArguments),
+ currentContextMode_(currentContextMode), currentContext_(currentContext)
+{
+ OSL_ASSERT(bridge.is() && member.is() && member.get()->bComplete);
+}
+
+IncomingRequest::~IncomingRequest() {}
+
+void IncomingRequest::execute() const {
+ BinaryAny ret;
+ std::vector< BinaryAny > outArgs;
+ bool isExc;
+ try {
+ bool resetCc = false;
+ css::uno::UnoInterfaceReference oldCc;
+ if (currentContextMode_) {
+ oldCc = current_context::get();
+ current_context::set(currentContext_);
+ resetCc = true;
+ }
+ try {
+ try {
+ isExc = !execute_throw(&ret, &outArgs);
+ } catch (std::exception & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("caught C++ exception: ")) +
+ rtl::OStringToOUString(
+ rtl::OString(e.what()), RTL_TEXTENCODING_ASCII_US)),
+ css::uno::Reference< css::uno::XInterface >());
+ // best-effort string conversion
+ }
+ } catch (css::uno::RuntimeException &) {
+ css::uno::Any exc(cppu::getCaughtException());
+ ret = bridge_->mapCppToBinaryAny(exc);
+ isExc = true;
+ }
+ if (resetCc) {
+ current_context::set(oldCc);
+ }
+ } catch (css::uno::RuntimeException &) {
+ css::uno::Any exc(cppu::getCaughtException());
+ ret = bridge_->mapCppToBinaryAny(exc);
+ isExc = true;
+ }
+ if (synchronous_) {
+ bridge_->decrementActiveCalls();
+ try {
+ bridge_->getWriter()->queueReply(
+ tid_, member_, setter_, isExc, ret, outArgs, false);
+ return;
+ } catch (css::uno::RuntimeException & e) {
+ OSL_TRACE(
+ OSL_LOG_PREFIX "caught UNO runtime exception '%s'",
+ (rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).
+ getStr()));
+ } catch (std::exception & e) {
+ OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what());
+ }
+ bridge_->terminate();
+ } else {
+ if (isExc) {
+ OSL_TRACE(OSL_LOG_PREFIX "oneway method raised exception");
+ }
+ bridge_->decrementCalls();
+ }
+}
+
+bool IncomingRequest::execute_throw(
+ BinaryAny * returnValue, std::vector< BinaryAny > * outArguments) const
+{
+ OSL_ASSERT(
+ returnValue != 0 &&
+ returnValue->getType().equals(
+ css::uno::TypeDescription(
+ cppu::UnoType< cppu::UnoVoidType >::get())) &&
+ outArguments != 0 && outArguments->empty());
+ bool isExc = false;
+ switch (functionId_) {
+ case SPECIAL_FUNCTION_ID_RESERVED:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ case SPECIAL_FUNCTION_ID_RELEASE:
+ bridge_->releaseStub(oid_, type_);
+ break;
+ case SPECIAL_FUNCTION_ID_QUERY_INTERFACE:
+ if (!object_.is()) {
+ css::uno::Reference< css::uno::XInterface > ifc;
+ css::uno::Reference< css::bridge::XInstanceProvider > prov(
+ bridge_->getProvider());
+ if (prov.is()) {
+ try {
+ ifc = prov->getInstance(oid_);
+ } catch (css::container::NoSuchElementException & e) {
+ OSL_TRACE(
+ (OSL_LOG_PREFIX "initial element '%s':"
+ " NoSuchElementException '%s'"),
+ (rtl::OUStringToOString(oid_, RTL_TEXTENCODING_UTF8).
+ getStr()),
+ (rtl::OUStringToOString(
+ e.Message, RTL_TEXTENCODING_UTF8).
+ getStr()));
+ }
+ }
+ if (ifc.is()) {
+ css::uno::UnoInterfaceReference unoIfc(
+ static_cast< uno_Interface * >(
+ bridge_->getCppToBinaryMapping().mapInterface(
+ ifc.get(),
+ (css::uno::TypeDescription(
+ cppu::UnoType<
+ css::uno::Reference<
+ css::uno::XInterface > >::get()).
+ get()))),
+ SAL_NO_ACQUIRE);
+ *returnValue = BinaryAny(
+ css::uno::TypeDescription(
+ cppu::UnoType<
+ css::uno::Reference<
+ css::uno::XInterface > >::get()),
+ &unoIfc.m_pUnoI);
+ }
+ break;
+ }
+ // fall through
+ default:
+ {
+ OSL_ASSERT(object_.is());
+ css::uno::TypeDescription retType;
+ std::list< std::vector< char > > outBufs;
+ std::vector< void * > args;
+ switch (member_.get()->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+ css::uno::TypeDescription t(
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ member_.get())->
+ pAttributeTypeRef);
+ if (setter_) {
+ OSL_ASSERT(inArguments_.size() == 1);
+ args.push_back(inArguments_[0].getValue(t));
+ } else {
+ OSL_ASSERT(inArguments_.empty());
+ retType = t;
+ }
+ break;
+ }
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast<
+ typelib_InterfaceMethodTypeDescription * >(
+ member_.get());
+ retType = css::uno::TypeDescription(mtd->pReturnTypeRef);
+ std::vector< BinaryAny >::const_iterator i(
+ inArguments_.begin());
+ for (sal_Int32 j = 0; j != mtd->nParams; ++j) {
+ void * p;
+ if (mtd->pParams[j].bIn) {
+ p = i++->getValue(
+ css::uno::TypeDescription(
+ mtd->pParams[j].pTypeRef));
+ } else {
+ outBufs.push_back(
+ std::vector< char >(
+ css::uno::TypeDescription(
+ mtd->pParams[j].pTypeRef).
+ get()->nSize));
+ p = &outBufs.back()[0];
+ }
+ args.push_back(p);
+ if (mtd->pParams[j].bOut) {
+ outArguments->push_back(BinaryAny());
+ }
+ }
+ OSL_ASSERT(i == inArguments_.end());
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ std::vector< char > retBuf(retType.is() ? retType.get()->nSize : 0);
+ uno_Any exc;
+ uno_Any * pexc = &exc;
+ (*object_.get()->pDispatcher)(
+ object_.get(), member_.get(), retBuf.empty() ? 0 : &retBuf[0],
+ args.empty() ? 0 : &args[0], &pexc);
+ isExc = pexc != 0;
+ if (isExc) {
+ *returnValue = BinaryAny(
+ css::uno::TypeDescription(
+ cppu::UnoType< css::uno::Any >::get()),
+ &exc);
+ uno_any_destruct(&exc, 0);
+ } else {
+ if (!retBuf.empty()) {
+ *returnValue = BinaryAny(retType, &retBuf[0]);
+ uno_destructData(&retBuf[0], retType.get(), 0);
+ }
+ if (!outArguments->empty()) {
+ OSL_ASSERT(
+ member_.get()->eTypeClass ==
+ typelib_TypeClass_INTERFACE_METHOD);
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast<
+ typelib_InterfaceMethodTypeDescription * >(
+ member_.get());
+ std::vector< BinaryAny >::iterator i(outArguments->begin());
+ std::list< std::vector< char > >::iterator j(
+ outBufs.begin());
+ for (sal_Int32 k = 0; k != mtd->nParams; ++k) {
+ if (mtd->pParams[k].bOut) {
+ *i++ = BinaryAny(
+ css::uno::TypeDescription(
+ mtd->pParams[k].pTypeRef),
+ args[k]);
+ }
+ if (!mtd->pParams[k].bIn) {
+ uno_type_destructData(
+ &(*j++)[0], mtd->pParams[k].pTypeRef, 0);
+ }
+ }
+ OSL_ASSERT(i == outArguments->end());
+ OSL_ASSERT(j == outBufs.end());
+ }
+ }
+ break;
+ }
+ }
+ return !isExc;
+}
+
+}
diff --git a/binaryurp/source/incomingrequest.hxx b/binaryurp/source/incomingrequest.hxx
new file mode 100644
index 000000000000..ead7067f8ae9
--- /dev/null
+++ b/binaryurp/source/incomingrequest.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_INCOMINGREQUEST_HXX
+#define INCLUDED_BINARYURP_SOURCE_INCOMINGREQUEST_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "rtl/byteseq.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typedescription.hxx"
+#include "uno/dispatcher.hxx"
+
+namespace binaryurp {
+ class BinaryAny;
+ class Bridge;
+}
+
+namespace binaryurp {
+
+class IncomingRequest: private boost::noncopyable {
+public:
+ IncomingRequest(
+ rtl::Reference< Bridge > const & bridge, rtl::ByteSequence const & tid,
+ rtl::OUString const & oid,
+ com::sun::star::uno::UnoInterfaceReference const & object,
+ com::sun::star::uno::TypeDescription const & type,
+ sal_uInt16 functionId, bool synchronous,
+ com::sun::star::uno::TypeDescription const & member, bool setter,
+ std::vector< BinaryAny > const & inArguments, bool currentContextMode,
+ com::sun::star::uno::UnoInterfaceReference const & currentContext);
+
+ ~IncomingRequest();
+
+ void execute() const;
+
+private:
+ bool execute_throw(
+ BinaryAny * returnValue, std::vector< BinaryAny > * outArguments) const;
+
+ rtl::Reference< Bridge > bridge_;
+ rtl::ByteSequence tid_;
+ rtl::OUString oid_; // initial object queryInterface; release
+ com::sun::star::uno::UnoInterfaceReference object_;
+ com::sun::star::uno::TypeDescription type_;
+ sal_uInt16 functionId_;
+ bool synchronous_;
+ com::sun::star::uno::TypeDescription member_;
+ bool setter_;
+ std::vector< BinaryAny > inArguments_;
+ bool currentContextMode_;
+ com::sun::star::uno::UnoInterfaceReference currentContext_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/lessoperators.cxx b/binaryurp/source/lessoperators.cxx
new file mode 100644
index 000000000000..354118625ce8
--- /dev/null
+++ b/binaryurp/source/lessoperators.cxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <algorithm>
+
+#include "osl/diagnose.h"
+#include "rtl/byteseq.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typeclass.h"
+#include "typelib/typedescription.hxx"
+
+#include "lessoperators.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+
+bool operator <(TypeDescription const & left, TypeDescription const & right) {
+ OSL_ASSERT(left.is() && right.is());
+ typelib_TypeClass tc1 = left.get()->eTypeClass;
+ typelib_TypeClass tc2 = right.get()->eTypeClass;
+ return tc1 < tc2 ||
+ (tc1 == tc2 &&
+ (rtl::OUString(left.get()->pTypeName) <
+ rtl::OUString(right.get()->pTypeName)));
+}
+
+} } } }
+
+namespace rtl {
+
+bool operator <(ByteSequence const & left, ByteSequence const & right) {
+ for (sal_Int32 i = 0; i != std::min(left.getLength(), right.getLength());
+ ++i)
+ {
+ if (left[i] < right[i]) {
+ return true;
+ }
+ if (right[i] < left[i]) {
+ return false;
+ }
+ }
+ return left.getLength() < right.getLength();
+}
+
+}
diff --git a/binaryurp/source/lessoperators.hxx b/binaryurp/source/lessoperators.hxx
new file mode 100644
index 000000000000..014f0f4d56bf
--- /dev/null
+++ b/binaryurp/source/lessoperators.hxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_LESSOPERATORS_HXX
+#define INCLUDED_BINARYURP_SOURCE_LESSOPERATORS_HXX
+
+#include "sal/config.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class TypeDescription;
+} } } }
+namespace rtl { class ByteSequence; }
+
+namespace com { namespace sun { namespace star { namespace uno {
+
+bool operator <(TypeDescription const & left, TypeDescription const & right);
+
+} } } }
+
+namespace rtl {
+
+bool operator <(ByteSequence const & left, ByteSequence const & right);
+
+}
+
+#endif
diff --git a/remotebridges/source/factory/makefile.mk b/binaryurp/source/makefile.mk
index b47207077fff..ca9e7c72b65d 100644
--- a/remotebridges/source/factory/makefile.mk
+++ b/binaryurp/source/makefile.mk
@@ -1,8 +1,8 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -23,51 +23,47 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+PRJ = ..
+PRJNAME = binaryurp
+TARGET = binaryurp
-PRJNAME=remotebridges
-TARGET = bridgefac.uno
-ENABLE_EXCEPTIONS=TRUE
-COMP1TYPELIST = brdgfctr
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-DLLPRE =
-# ------------------------------------------------------------------
+ENABLE_EXCEPTIONS = TRUE
+VISIBILITY_HIDDEN = TRUE
-SLOFILES= \
- $(SLO)$/bridgefactory.obj\
- $(SLO)$/bridgeimpl.obj
+.INCLUDE: settings.mk
-SHL1TARGET= $(TARGET)
-SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map
-
-SHL1STDLIBS= \
- $(SALLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(RMCXTLIB)
-
-#SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-SHL1RPATH= URELIB
+DLLPRE =
-DEF1NAME= $(SHL1TARGET)
-.ENDIF # L10N_framework
+SLOFILES = \
+ $(SLO)/binaryany.obj \
+ $(SLO)/bridge.obj \
+ $(SLO)/bridgefactory.obj \
+ $(SLO)/currentcontext.obj \
+ $(SLO)/incomingrequest.obj \
+ $(SLO)/lessoperators.obj \
+ $(SLO)/marshal.obj \
+ $(SLO)/outgoingrequests.obj \
+ $(SLO)/proxy.obj \
+ $(SLO)/reader.obj \
+ $(SLO)/unmarshal.obj \
+ $(SLO)/writer.obj
-# --- Targets ------------------------------------------------------
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLOFILES)
+SHL1RPATH = URELIB
+SHL1STDLIBS = $(CPPUHELPERLIB) $(CPPULIB) $(SALHELPERLIB) $(SALLIB)
+SHL1TARGET = binaryurp.uno
+SHL1USE_EXPORTS = name
+DEF1NAME = $(SHL1TARGET)
-.INCLUDE : target.mk
+.INCLUDE: target.mk
-ALLTAR : $(MISC)/bridgefac.component
+ALLTAR : $(MISC)/binaryurp.component
-$(MISC)/bridgefac.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- bridgefac.component
+$(MISC)/binaryurp.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ binaryurp.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_URE_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt bridgefac.component
+ $(SOLARENV)/bin/createcomponent.xslt binaryurp.component
diff --git a/binaryurp/source/marshal.cxx b/binaryurp/source/marshal.cxx
new file mode 100644
index 000000000000..ce520382efac
--- /dev/null
+++ b/binaryurp/source/marshal.cxx
@@ -0,0 +1,314 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "rtl/byteseq.hxx"
+#include "rtl/string.hxx"
+#include "rtl/textcvt.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typeclass.h"
+#include "typelib/typedescription.h"
+#include "typelib/typedescription.hxx"
+#include "uno/dispatcher.hxx"
+
+#include "binaryany.hxx"
+#include "bridge.hxx"
+#include "cache.hxx"
+#include "lessoperators.hxx"
+#include "marshal.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+void write64(std::vector< unsigned char > * buffer, sal_uInt64 value) {
+ Marshal::write8(buffer, value >> 56);
+ Marshal::write8(buffer, (value >> 48) & 0xFF);
+ Marshal::write8(buffer, (value >> 40) & 0xFF);
+ Marshal::write8(buffer, (value >> 32) & 0xFF);
+ Marshal::write8(buffer, (value >> 24) & 0xFF);
+ Marshal::write8(buffer, (value >> 16) & 0xFF);
+ Marshal::write8(buffer, (value >> 8) & 0xFF);
+ Marshal::write8(buffer, value & 0xFF);
+}
+
+void writeCompressed(std::vector< unsigned char > * buffer, sal_uInt32 value) {
+ if (value < 0xFF) {
+ Marshal::write8(buffer, static_cast< sal_uInt8 >(value));
+ } else {
+ Marshal::write8(buffer, 0xFF);
+ Marshal::write32(buffer, value);
+ }
+}
+
+void writeString(
+ std::vector< unsigned char > * buffer, rtl::OUString const & value)
+{
+ OSL_ASSERT(buffer != 0);
+ rtl::OString v;
+ if (!value.convertToString(
+ &v, RTL_TEXTENCODING_UTF8,
+ (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "UNO string contains invalid UTF-16 sequence")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ writeCompressed(buffer, static_cast< sal_uInt32 >(v.getLength()));
+ buffer->insert(buffer->end(), v.getStr(), v.getStr() + v.getLength());
+}
+
+}
+
+Marshal::Marshal(rtl::Reference< Bridge > const & bridge, WriterState & state):
+ bridge_(bridge), state_(state)
+{
+ OSL_ASSERT(bridge.is());
+}
+
+Marshal::~Marshal() {}
+
+void Marshal::write8(std::vector< unsigned char > * buffer, sal_uInt8 value) {
+ OSL_ASSERT(buffer != 0);
+ buffer->push_back(value);
+}
+
+void Marshal::write16(std::vector< unsigned char > * buffer, sal_uInt16 value) {
+ write8(buffer, value >> 8);
+ write8(buffer, value & 0xFF);
+}
+
+void Marshal::write32(std::vector< unsigned char > * buffer, sal_uInt32 value) {
+ write8(buffer, value >> 24);
+ write8(buffer, (value >> 16) & 0xFF);
+ write8(buffer, (value >> 8) & 0xFF);
+ write8(buffer, value & 0xFF);
+}
+
+void Marshal::writeValue(
+ std::vector< unsigned char > * buffer,
+ css::uno::TypeDescription const & type, BinaryAny const & value)
+{
+ OSL_ASSERT(
+ type.is() &&
+ (type.get()->eTypeClass == typelib_TypeClass_ANY ||
+ value.getType().equals(type)));
+ writeValue(buffer, type, value.getValue(type));
+}
+
+void Marshal::writeType(
+ std::vector< unsigned char > * buffer,
+ css::uno::TypeDescription const & value)
+{
+ value.makeComplete();
+ OSL_ASSERT(value.is());
+ typelib_TypeClass tc = value.get()->eTypeClass;
+ if (tc <= typelib_TypeClass_ANY) {
+ write8(buffer, static_cast< sal_uInt8 >(tc));
+ } else {
+ bool found;
+ sal_uInt16 idx = state_.typeCache.add(value, &found);
+ if (found) {
+ write8(buffer, static_cast< sal_uInt8 >(tc));
+ write16(buffer, idx);
+ } else {
+ write8(buffer, static_cast< sal_uInt8 >(tc) | 0x80);
+ write16(buffer, idx);
+ writeString(buffer, rtl::OUString(value.get()->pTypeName));
+ }
+ }
+}
+
+void Marshal::writeOid(
+ std::vector< unsigned char > * buffer, rtl::OUString const & oid)
+{
+ bool found;
+ sal_uInt16 idx;
+ if (oid.getLength() == 0) {
+ found = true;
+ idx = cache::ignore;
+ } else {
+ idx = state_.oidCache.add(oid, &found);
+ }
+ if (found) {
+ write8(buffer, 0);
+ } else {
+ writeString(buffer, oid);
+ }
+ write16(buffer, idx);
+}
+
+void Marshal::writeTid(
+ std::vector< unsigned char > * buffer, rtl::ByteSequence const & tid)
+{
+ bool found;
+ sal_uInt16 idx = state_.tidCache.add(tid, &found);
+ if (found) {
+ write8(buffer, 0);
+ } else {
+ sal_Sequence * p = tid.getHandle();
+ writeValue(
+ buffer,
+ css::uno::TypeDescription(
+ cppu::UnoType< css::uno::Sequence< sal_Int8 > >::get()), &p);
+ }
+ write16(buffer, idx);
+}
+
+void Marshal::writeValue(
+ std::vector< unsigned char > * buffer,
+ css::uno::TypeDescription const & type, void const * value)
+{
+ OSL_ASSERT(buffer != 0 && type.is());
+ type.makeComplete();
+ switch (type.get()->eTypeClass) {
+ case typelib_TypeClass_VOID:
+ break;
+ case typelib_TypeClass_BOOLEAN:
+ OSL_ASSERT(*static_cast< sal_uInt8 const * >(value) <= 1);
+ // fall through
+ case typelib_TypeClass_BYTE:
+ write8(buffer, *static_cast< sal_uInt8 const * >(value));
+ break;
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ case typelib_TypeClass_CHAR:
+ write16(buffer, *static_cast< sal_uInt16 const * >(value));
+ break;
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_FLOAT:
+ case typelib_TypeClass_ENUM:
+ write32(buffer, *static_cast< sal_uInt32 const * >(value));
+ break;
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+ case typelib_TypeClass_DOUBLE:
+ write64(buffer, *static_cast< sal_uInt64 const * >(value));
+ break;
+ case typelib_TypeClass_STRING:
+ writeString(
+ buffer,
+ rtl::OUString(*static_cast< rtl_uString * const * >(value)));
+ break;
+ case typelib_TypeClass_TYPE:
+ writeType(
+ buffer,
+ css::uno::TypeDescription(
+ *static_cast< typelib_TypeDescriptionReference * const * >(
+ value)));
+ break;
+ case typelib_TypeClass_ANY:
+ {
+ uno_Any const * p = static_cast< uno_Any const * >(value);
+ css::uno::TypeDescription t(p->pType);
+ writeType(buffer, t);
+ writeValue(buffer, t, p->pData);
+ break;
+ }
+ case typelib_TypeClass_SEQUENCE:
+ {
+ sal_Sequence * p = *static_cast< sal_Sequence * const * >(value);
+ writeCompressed(buffer, static_cast< sal_uInt32 >(p->nElements));
+ css::uno::TypeDescription ctd(
+ reinterpret_cast< typelib_IndirectTypeDescription * >(
+ type.get())->
+ pType);
+ OSL_ASSERT(ctd.is());
+ if (ctd.get()->eTypeClass == typelib_TypeClass_BYTE) {
+ buffer->insert(
+ buffer->end(), p->elements, p->elements + p->nElements);
+ } else {
+ for (sal_Int32 i = 0; i != p->nElements; ++i) {
+ writeValue(buffer, ctd, p->elements + i * ctd.get()->nSize);
+ }
+ }
+ break;
+ }
+ case typelib_TypeClass_STRUCT:
+ case typelib_TypeClass_EXCEPTION:
+ writeMemberValues(buffer, type, value);
+ break;
+ case typelib_TypeClass_INTERFACE:
+ writeOid(
+ buffer,
+ bridge_->registerOutgoingInterface(
+ css::uno::UnoInterfaceReference(
+ *static_cast< uno_Interface * const * >(value)),
+ type));
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+}
+
+void Marshal::writeMemberValues(
+ std::vector< unsigned char > * buffer,
+ css::uno::TypeDescription const & type, void const * aggregateValue)
+{
+ OSL_ASSERT(
+ type.is() &&
+ (type.get()->eTypeClass == typelib_TypeClass_STRUCT ||
+ type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) &&
+ aggregateValue != 0);
+ type.makeComplete();
+ typelib_CompoundTypeDescription * ctd =
+ reinterpret_cast< typelib_CompoundTypeDescription * >(type.get());
+ if (ctd->pBaseTypeDescription != 0) {
+ writeMemberValues(
+ buffer,
+ css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase),
+ aggregateValue);
+ }
+ for (sal_Int32 i = 0; i != ctd->nMembers; ++i) {
+ writeValue(
+ buffer, css::uno::TypeDescription(ctd->ppTypeRefs[i]),
+ (static_cast< char const * >(aggregateValue) +
+ ctd->pMemberOffsets[i]));
+ }
+}
+
+}
diff --git a/binaryurp/source/marshal.hxx b/binaryurp/source/marshal.hxx
new file mode 100755
index 000000000000..a922ec1008f6
--- /dev/null
+++ b/binaryurp/source/marshal.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_MARSHAL_HXX
+#define INCLUDED_BINARYURP_SOURCE_MARSHAL_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "rtl/byteseq.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typedescription.hxx"
+
+namespace binaryurp {
+ class BinaryAny;
+ class Bridge;
+ struct WriterState;
+}
+
+namespace binaryurp {
+
+class Marshal: private boost::noncopyable {
+public:
+ Marshal(rtl::Reference< Bridge > const & bridge, WriterState & state);
+
+ ~Marshal();
+
+ static void write8(std::vector< unsigned char > * buffer, sal_uInt8 value);
+
+ static void write16(
+ std::vector< unsigned char > * buffer, sal_uInt16 value);
+
+ static void write32(
+ std::vector< unsigned char > * buffer, sal_uInt32 value);
+
+ void writeValue(
+ std::vector< unsigned char > * buffer,
+ com::sun::star::uno::TypeDescription const & type,
+ BinaryAny const & value);
+
+ void writeType(
+ std::vector< unsigned char > * buffer,
+ com::sun::star::uno::TypeDescription const & value);
+
+ void writeOid(
+ std::vector< unsigned char > * buffer, rtl::OUString const & oid);
+
+ void writeTid(
+ std::vector< unsigned char > * buffer, rtl::ByteSequence const & tid);
+
+private:
+ void writeValue(
+ std::vector< unsigned char > * buffer,
+ com::sun::star::uno::TypeDescription const & type, void const * value);
+
+ void writeMemberValues(
+ std::vector< unsigned char > * buffer,
+ com::sun::star::uno::TypeDescription const & type,
+ void const * aggregateValue);
+
+ rtl::Reference< Bridge > bridge_;
+ WriterState & state_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/outgoingrequest.hxx b/binaryurp/source/outgoingrequest.hxx
new file mode 100644
index 000000000000..7fe67bf96a3b
--- /dev/null
+++ b/binaryurp/source/outgoingrequest.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_OUTGOINGREQUEST_HXX
+#define INCLUDED_BINARYURP_SOURCE_OUTGOINGREQUEST_HXX
+
+#include "sal/config.h"
+
+#include "typelib/typedescription.hxx"
+
+namespace binaryurp {
+
+struct OutgoingRequest {
+ enum Kind { KIND_NORMAL, KIND_REQUEST_CHANGE, KIND_COMMIT_CHANGE };
+
+ OutgoingRequest(
+ Kind theKind, com::sun::star::uno::TypeDescription const & theMember,
+ bool theSetter):
+ kind(theKind), member(theMember), setter(theSetter)
+ {}
+
+ Kind kind;
+
+ com::sun::star::uno::TypeDescription member;
+
+ bool setter;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/outgoingrequests.cxx b/binaryurp/source/outgoingrequests.cxx
new file mode 100644
index 000000000000..388b7755466f
--- /dev/null
+++ b/binaryurp/source/outgoingrequests.cxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 "com/sun/star/uno/RuntimeException.hpp"
+#include "rtl/byteseq.hxx"
+#include "osl/mutex.hxx"
+
+#include "lessoperators.hxx"
+#include "outgoingrequest.hxx"
+#include "outgoingrequests.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+OutgoingRequests::OutgoingRequests() {}
+
+OutgoingRequests::~OutgoingRequests() {}
+
+void OutgoingRequests::push(
+ rtl::ByteSequence const & tid, OutgoingRequest const & request)
+{
+ osl::MutexGuard g(mutex_);
+ map_[tid].push_back(request);
+}
+
+OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) {
+ osl::MutexGuard g(mutex_);
+ Map::iterator i(map_.find(tid));
+ if (i == map_.end()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("URP: reply for unknown TID")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ OSL_ASSERT(!i->second.empty());
+ return i->second.back();
+}
+
+void OutgoingRequests::pop(rtl::ByteSequence const & tid) throw () {
+ osl::MutexGuard g(mutex_);
+ Map::iterator i(map_.find(tid));
+ OSL_ASSERT(i != map_.end());
+ i->second.pop_back();
+ if (i->second.empty()) {
+ map_.erase(i);
+ }
+}
+
+}
diff --git a/binaryurp/source/outgoingrequests.hxx b/binaryurp/source/outgoingrequests.hxx
new file mode 100644
index 000000000000..92ee622bf682
--- /dev/null
+++ b/binaryurp/source/outgoingrequests.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_OUTGOINGREQUESTS_HXX
+#define INCLUDED_BINARYURP_SOURCE_OUTGOINGREQUESTS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "osl/mutex.hxx"
+
+namespace binaryurp { struct OutgoingRequest; }
+namespace rtl { class ByteSequence; }
+
+namespace binaryurp {
+
+class OutgoingRequests: private boost::noncopyable {
+public:
+ OutgoingRequests();
+
+ ~OutgoingRequests();
+
+ void push(rtl::ByteSequence const & tid, OutgoingRequest const & request);
+
+ OutgoingRequest top(rtl::ByteSequence const & tid);
+
+ void pop(rtl::ByteSequence const & tid) throw ();
+
+private:
+ typedef std::map< rtl::ByteSequence, std::vector< OutgoingRequest > > Map;
+
+ osl::Mutex mutex_;
+ Map map_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/proxy.cxx b/binaryurp/source/proxy.cxx
new file mode 100644
index 000000000000..876199e7bc17
--- /dev/null
+++ b/binaryurp/source/proxy.cxx
@@ -0,0 +1,260 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <exception>
+#include <vector>
+
+#include "cppuhelper/exc_hlp.hxx"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typedescription.h"
+#include "typelib/typedescription.hxx"
+#include "uno/any2.h"
+#include "uno/dispatcher.h"
+#include "uno/dispatcher.hxx"
+
+#include "binaryany.hxx"
+#include "bridge.hxx"
+#include "proxy.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+extern "C" void SAL_CALL proxy_acquireInterface(uno_Interface * pInterface) {
+ OSL_ASSERT(pInterface != 0);
+ static_cast< Proxy * >(pInterface)->do_acquire();
+}
+
+extern "C" void SAL_CALL proxy_releaseInterface(uno_Interface * pInterface) {
+ OSL_ASSERT(pInterface != 0);
+ static_cast< Proxy * >(pInterface)->do_release();
+}
+
+extern "C" void SAL_CALL proxy_dispatchInterface(
+ uno_Interface * pUnoI, typelib_TypeDescription const * pMemberType,
+ void * pReturn, void ** pArgs, uno_Any ** ppException)
+{
+ OSL_ASSERT(pUnoI != 0);
+ static_cast< Proxy * >(pUnoI)->do_dispatch(
+ pMemberType, pReturn, pArgs, ppException);
+}
+
+}
+
+Proxy::Proxy(
+ rtl::Reference< Bridge > const & bridge, rtl::OUString const & oid,
+ css::uno::TypeDescription const & type):
+ bridge_(bridge), oid_(oid), type_(type), references_(1)
+{
+ OSL_ASSERT(bridge.is());
+ acquire = &proxy_acquireInterface;
+ release = &proxy_releaseInterface;
+ pDispatcher = &proxy_dispatchInterface;
+}
+
+rtl::OUString Proxy::getOid() const {
+ return oid_;
+}
+
+css::uno::TypeDescription Proxy::getType() const {
+ return type_;
+}
+
+void Proxy::do_acquire() {
+ if (osl_incrementInterlockedCount(&references_) == 1) {
+ bridge_->resurrectProxy(*this);
+ }
+}
+
+void Proxy::do_release() {
+ if (osl_decrementInterlockedCount(&references_) == 0) {
+ bridge_->revokeProxy(*this);
+ }
+}
+
+void Proxy::do_free() {
+ bridge_->freeProxy(*this);
+ delete this;
+}
+
+void Proxy::do_dispatch(
+ typelib_TypeDescription const * member, void * returnValue,
+ void ** arguments, uno_Any ** exception) const
+{
+ try {
+ try {
+ do_dispatch_throw(member, returnValue, arguments, exception);
+ } catch (std::exception & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("caught C++ exception: ")) +
+ rtl::OStringToOUString(
+ rtl::OString(e.what()), RTL_TEXTENCODING_ASCII_US)),
+ css::uno::Reference< css::uno::XInterface >());
+ // best-effort string conversion
+ }
+ } catch (css::uno::RuntimeException &) {
+ css::uno::Any exc(cppu::getCaughtException());
+ uno_copyAndConvertData(
+ *exception, &exc,
+ (css::uno::TypeDescription(cppu::UnoType< css::uno::Any >::get()).
+ get()),
+ bridge_->getCppToBinaryMapping().get());
+ }
+}
+
+bool Proxy::isProxy(
+ rtl::Reference< Bridge > const & bridge,
+ css::uno::UnoInterfaceReference const & object, rtl::OUString * oid)
+{
+ OSL_ASSERT(object.is());
+ return object.m_pUnoI->acquire == &proxy_acquireInterface &&
+ static_cast< Proxy * >(object.m_pUnoI)->isProxy(bridge, oid);
+}
+
+Proxy::~Proxy() {}
+
+void Proxy::do_dispatch_throw(
+ typelib_TypeDescription const * member, void * returnValue,
+ void ** arguments, uno_Any ** exception) const
+{
+ //TODO: Optimize queryInterface:
+ OSL_ASSERT(member != 0);
+ bool setter = false;
+ std::vector< BinaryAny > inArgs;
+ switch (member->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ setter = returnValue == 0;
+ if (setter) {
+ inArgs.push_back(
+ BinaryAny(
+ css::uno::TypeDescription(
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription const * >(
+ member)->
+ pAttributeTypeRef),
+ arguments[0]));
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription const * mtd =
+ reinterpret_cast<
+ typelib_InterfaceMethodTypeDescription const * >(member);
+ for (sal_Int32 i = 0; i != mtd->nParams; ++i) {
+ if (mtd->pParams[i].bIn) {
+ inArgs.push_back(
+ BinaryAny(
+ css::uno::TypeDescription(mtd->pParams[i].pTypeRef),
+ arguments[i]));
+ }
+ }
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ BinaryAny ret;
+ std::vector< BinaryAny > outArgs;
+ if (bridge_->makeCall(
+ oid_,
+ css::uno::TypeDescription(
+ const_cast< typelib_TypeDescription * >(member)),
+ setter, inArgs, &ret, &outArgs))
+ {
+ OSL_ASSERT(
+ ret.getType().get()->eTypeClass == typelib_TypeClass_EXCEPTION);
+ uno_any_construct(
+ *exception, ret.getValue(ret.getType()), ret.getType().get(), 0);
+ } else {
+ switch (member->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ if (!setter) {
+ css::uno::TypeDescription t(
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription const * >(
+ member)->
+ pAttributeTypeRef);
+ uno_copyData(returnValue, ret.getValue(t), t.get(), 0);
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription const * mtd =
+ reinterpret_cast<
+ typelib_InterfaceMethodTypeDescription const * >(
+ member);
+ css::uno::TypeDescription t(mtd->pReturnTypeRef);
+ if (t.get()->eTypeClass != typelib_TypeClass_VOID) {
+ uno_copyData(returnValue, ret.getValue(t), t.get(), 0);
+ }
+ std::vector< BinaryAny >::iterator i(outArgs.begin());
+ for (sal_Int32 j = 0; j != mtd->nParams; ++j) {
+ if (mtd->pParams[j].bOut) {
+ css::uno::TypeDescription pt(mtd->pParams[j].pTypeRef);
+ if (mtd->pParams[j].bIn) {
+ uno_assignData(
+ arguments[j], pt.get(), i++->getValue(pt),
+ pt.get(), 0, 0, 0);
+ } else {
+ uno_copyData(
+ arguments[j], i++->getValue(pt), pt.get(), 0);
+ }
+ }
+ }
+ OSL_ASSERT(i == outArgs.end());
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ *exception = 0;
+ }
+}
+
+bool Proxy::isProxy(
+ rtl::Reference< Bridge > const & bridge, rtl::OUString * oid) const
+{
+ OSL_ASSERT(oid != 0);
+ if (bridge == bridge_) {
+ *oid = oid_;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+}
diff --git a/binaryurp/source/proxy.hxx b/binaryurp/source/proxy.hxx
new file mode 100644
index 000000000000..c67ab4eb522a
--- /dev/null
+++ b/binaryurp/source/proxy.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_PROXY_HXX
+#define INCLUDED_BINARYURP_SOURCE_PROXY_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "osl/interlck.h"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "typelib/typedescription.h"
+#include "typelib/typedescription.hxx"
+#include "uno/any2.h"
+#include "uno/dispatcher.h"
+
+namespace binaryurp { class Bridge; }
+namespace com { namespace sun { namespace star { namespace uno {
+ class UnoInterfaceReference;
+} } } }
+
+namespace binaryurp {
+
+class Proxy: public uno_Interface, private boost::noncopyable {
+public:
+ Proxy(
+ rtl::Reference< Bridge > const & bridge, rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type);
+
+ rtl::OUString getOid() const;
+
+ com::sun::star::uno::TypeDescription getType() const;
+
+ void do_acquire();
+
+ void do_release();
+
+ void do_free();
+
+ void do_dispatch(
+ typelib_TypeDescription const * member, void * returnValue,
+ void ** arguments, uno_Any ** exception) const;
+
+ static bool isProxy(
+ rtl::Reference< Bridge > const & bridge,
+ com::sun::star::uno::UnoInterfaceReference const & object,
+ rtl::OUString * oid);
+
+private:
+ ~Proxy();
+
+ void do_dispatch_throw(
+ typelib_TypeDescription const * member, void * returnValue,
+ void ** arguments, uno_Any ** exception) const;
+
+ bool isProxy(rtl::Reference< Bridge > const & bridge, rtl::OUString * oid)
+ const;
+
+ rtl::Reference< Bridge > bridge_;
+ rtl::OUString oid_;
+ com::sun::star::uno::TypeDescription type_;
+ oslInterlockedCount references_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx
new file mode 100755
index 000000000000..f622fb5b0c42
--- /dev/null
+++ b/binaryurp/source/reader.cxx
@@ -0,0 +1,553 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <exception>
+#include <memory>
+#include <vector>
+
+#include "com/sun/star/connection/XConnection.hpp"
+#include "com/sun/star/io/IOException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "rtl/byteseq.h"
+#include "rtl/string.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typeclass.h"
+#include "typelib/typedescription.h"
+#include "typelib/typedescription.hxx"
+#include "uno/lbnames.h"
+
+#include "binaryany.hxx"
+#include "bridge.hxx"
+#include "incomingreply.hxx"
+#include "incomingrequest.hxx"
+#include "outgoingrequest.hxx"
+#include "reader.hxx"
+#include "specialfunctionids.hxx"
+#include "unmarshal.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+css::uno::Sequence< sal_Int8 > read(
+ css::uno::Reference< css::connection::XConnection > const & connection,
+ sal_uInt32 size, bool eofOk)
+{
+ OSL_ASSERT(connection.is());
+ if (size > SAL_MAX_INT32) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Reader: block size too large")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ css::uno::Sequence< sal_Int8 > buf;
+ sal_Int32 n = connection->read(buf, static_cast< sal_Int32 >(size));
+ if (n == 0 && eofOk) {
+ return css::uno::Sequence< sal_Int8 >();
+ }
+ if (n != static_cast< sal_Int32 >(size)) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Reader: premature end of input")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ OSL_ASSERT(buf.getLength() == static_cast< sal_Int32 >(size));
+ return buf;
+}
+
+extern "C" void SAL_CALL request(void * pThreadSpecificData) {
+ OSL_ASSERT(pThreadSpecificData != 0);
+ std::auto_ptr< IncomingRequest >(
+ static_cast< IncomingRequest * >(pThreadSpecificData))->
+ execute();
+}
+
+}
+
+Reader::Reader(rtl::Reference< Bridge > const & bridge): bridge_(bridge) {
+ OSL_ASSERT(bridge.is());
+ acquire();
+}
+
+Reader::~Reader() {}
+
+void Reader::run() {
+ setName("binaryurpReader");
+ try {
+ bridge_->sendRequestChangeRequest();
+ css::uno::Reference< css::connection::XConnection > con(
+ bridge_->getConnection());
+ for (;;) {
+ css::uno::Sequence< sal_Int8 > s(read(con, 8, true));
+ if (s.getLength() == 0) {
+ break;
+ }
+ Unmarshal header(bridge_, state_, s);
+ sal_uInt32 size = header.read32();
+ sal_uInt32 count = header.read32();
+ header.done();
+ if (count == 0) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Reader: block with zero message count"
+ " received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ Unmarshal block(bridge_, state_, read(con, size, false));
+ for (sal_uInt32 i = 0; i != count; ++i) {
+ readMessage(block);
+ }
+ block.done();
+ }
+ } catch (css::uno::Exception & e) {
+ OSL_TRACE(
+ OSL_LOG_PREFIX "caught UNO exception '%s'",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ } catch (std::exception & e) {
+ OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what());
+ }
+ bridge_->terminate();
+}
+
+void Reader::onTerminated() {
+ release();
+}
+
+void Reader::readMessage(Unmarshal & unmarshal) {
+ sal_uInt8 flags1 = unmarshal.read8();
+ bool newType;
+ bool newOid;
+ bool newTid;
+ bool forceSynchronous;
+ sal_uInt16 functionId;
+ if ((flags1 & 0x80) != 0) { // bit 7: LONGHEADER
+ if ((flags1 & 0x40) == 0) { // bit 6: REQUEST
+ readReplyMessage(unmarshal, flags1);
+ return;
+ }
+ newType = (flags1 & 0x20) != 0; // bit 5: NEWTYPE
+ newOid = (flags1 & 0x10) != 0; // bit 4: NEWOID
+ newTid = (flags1 & 0x08) != 0; // bit 3: NEWTID
+ if ((flags1 & 0x01) != 0) { // bit 0: MOREFLAGSS
+ sal_uInt8 flags2 = unmarshal.read8();
+ forceSynchronous = (flags2 & 0x80) != 0; // bit 7: MUSTREPLY
+ if (((flags2 & 0x40) != 0) != forceSynchronous) {
+ // bit 6: SYNCHRONOUS
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with MUSTREPLY != SYNCHRONOUS"
+ " received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else {
+ forceSynchronous = false;
+ }
+ functionId = ((flags1 & 0x04) != 0) // bit 2: FUNCTIONID16
+ ? unmarshal.read16() : unmarshal.read8();
+ } else {
+ newType = false;
+ newOid = false;
+ newTid = false;
+ forceSynchronous = false;
+ functionId = ((flags1 & 0x40) != 0) // bit 6: FUNCTIONID14
+ ? ((flags1 & 0x3F) << 8) | unmarshal.read8() : flags1 & 0x3F;
+ }
+ css::uno::TypeDescription type;
+ if (newType) {
+ type = unmarshal.readType();
+ lastType_ = type;
+ } else {
+ if (!lastType_.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with NEWTYPE received when last"
+ " interface type has not yet been set")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ type = lastType_;
+ }
+ rtl::OUString oid;
+ if (newOid) {
+ oid = unmarshal.readOid();
+ if (oid.getLength() == 0) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: emtpy OID")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ lastOid_ = oid;
+ } else {
+ if (lastOid_.getLength() == 0) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with NEWOID received when last"
+ " OID has not yet been set")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ oid = lastOid_;
+ }
+ rtl::ByteSequence tid(getTid(unmarshal, newTid));
+ lastTid_ = tid;
+ type.makeComplete();
+ if (type.get()->eTypeClass != typelib_TypeClass_INTERFACE) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with non-interface interface type"
+ " received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ typelib_InterfaceTypeDescription * itd =
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(type.get());
+ if (functionId >= itd->nMapFunctionIndexToMemberIndex) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with unknown function ID received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ sal_Int32 memberId = itd->pMapFunctionIndexToMemberIndex[functionId];
+ css::uno::TypeDescription memberTd(itd->ppAllMembers[memberId]);
+ memberTd.makeComplete();
+ OSL_ASSERT(memberTd.is());
+ bool protProps = bridge_->isProtocolPropertiesRequest(oid, type);
+ bool ccMode = !protProps && functionId != SPECIAL_FUNCTION_ID_RELEASE &&
+ bridge_->isCurrentContextMode();
+ css::uno::UnoInterfaceReference cc;
+ if (ccMode) {
+ css::uno::TypeDescription t(
+ cppu::UnoType< css::uno::Reference< css::uno::XCurrentContext > >::
+ get());
+ cc.set(
+ *static_cast< uno_Interface ** >(
+ unmarshal.readValue(t).getValue(t)));
+ }
+ bool synchronous;
+ if (memberTd.get()->eTypeClass == typelib_TypeClass_INTERFACE_METHOD &&
+ (reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
+ memberTd.get())->
+ bOneWay))
+ {
+ synchronous = forceSynchronous;
+ } else {
+ if (forceSynchronous) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: synchronous request message with non-oneway"
+ " function ID received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ synchronous = true;
+ }
+ bool setter = false;
+ std::vector< BinaryAny > inArgs;
+ switch (memberTd.get()->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ setter = itd->pMapMemberIndexToFunctionIndex[memberId] != functionId;
+ // pMapMemberIndexToFunctionIndex contains function index of
+ // attribute getter
+ if (setter) {
+ inArgs.push_back(
+ unmarshal.readValue(
+ css::uno::TypeDescription(
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ memberTd.get())->
+ pAttributeTypeRef)));
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
+ memberTd.get());
+ for (sal_Int32 i = 0; i != mtd->nParams; ++i) {
+ if (mtd->pParams[i].bIn) {
+ inArgs.push_back(
+ unmarshal.readValue(
+ css::uno::TypeDescription(
+ mtd->pParams[i].pTypeRef)));
+ }
+ }
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ bridge_->incrementCalls(
+ !protProps && functionId != SPECIAL_FUNCTION_ID_RELEASE);
+ if (protProps) {
+ switch (functionId) {
+ case SPECIAL_FUNCTION_ID_REQUEST_CHANGE:
+ bridge_->handleRequestChangeRequest(tid, inArgs);
+ break;
+ case SPECIAL_FUNCTION_ID_COMMIT_CHANGE:
+ bridge_->handleCommitChangeRequest(tid, inArgs);
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with UrpProtocolProperties OID"
+ " and unknown function ID received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else {
+ css::uno::UnoInterfaceReference obj;
+ switch (functionId) {
+ case SPECIAL_FUNCTION_ID_QUERY_INTERFACE:
+ obj = bridge_->findStub(oid, type);
+ if (!obj.is()) {
+ OSL_ASSERT(
+ inArgs.size() == 1
+ && inArgs[0].getType().equals(
+ css::uno::TypeDescription(
+ cppu::UnoType< css::uno::Type >::get())));
+ if (!(type.equals(
+ css::uno::TypeDescription(
+ cppu::UnoType<
+ css::uno::Reference<
+ css::uno::XInterface > >::get()))
+ && (css::uno::TypeDescription(
+ *static_cast<
+ typelib_TypeDescriptionReference ** >(
+ inArgs[0].getValue(inArgs[0].getType()))).
+ equals(
+ css::uno::TypeDescription(
+ cppu::UnoType<
+ css::uno::Reference<
+ css::uno::XInterface > >::get())))))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: queryInterface request message with"
+ " unknown OID received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ break;
+ case SPECIAL_FUNCTION_ID_RESERVED:
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with unknown function ID 1"
+ " received")),
+ css::uno::Reference< css::uno::XInterface >());
+ case SPECIAL_FUNCTION_ID_RELEASE:
+ break;
+ default:
+ obj = bridge_->findStub(oid, type);
+ if (!obj.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: request message with unknown OID received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ }
+ std::auto_ptr< IncomingRequest > req(
+ new IncomingRequest(
+ bridge_, tid, oid, obj, type, functionId, synchronous, memberTd,
+ setter, inArgs, ccMode, cc));
+ if (synchronous) {
+ bridge_->incrementActiveCalls();
+ }
+ uno_threadpool_putJob(
+ bridge_->getThreadPool(), tid.getHandle(), req.get(), &request,
+ !synchronous);
+ req.release();
+ }
+}
+
+void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) {
+ rtl::ByteSequence tid(getTid(unmarshal, (flags1 & 0x08) != 0));
+ // bit 3: NEWTID
+ lastTid_ = tid;
+ OutgoingRequest req(bridge_->lastOutgoingRequest(tid));
+ bool exc = (flags1 & 0x20) != 0; // bit 5: EXCEPTION
+ BinaryAny ret;
+ std::vector< BinaryAny > outArgs;
+ if (exc) {
+ ret = unmarshal.readValue(
+ css::uno::TypeDescription(cppu::UnoType< css::uno::Any >::get()));
+ if (!typelib_typedescription_isAssignableFrom(
+ (css::uno::TypeDescription(
+ cppu::UnoType< css::uno::RuntimeException >::get()).
+ get()),
+ ret.getType().get()))
+ {
+ sal_Int32 n = 0;
+ typelib_TypeDescriptionReference ** p = 0;
+ switch (req.member.get()->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+ typelib_InterfaceAttributeTypeDescription * atd =
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ req.member.get());
+ n = req.setter ? atd->nSetExceptions : atd->nGetExceptions;
+ p = req.setter
+ ? atd->ppSetExceptions : atd->ppGetExceptions;
+ break;
+ }
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast<
+ typelib_InterfaceMethodTypeDescription * >(
+ req.member.get());
+ n = mtd->nExceptions;
+ p = mtd->ppExceptions;
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ bool ok = false;
+ for (sal_Int32 i = 0; i != n; ++i) {
+ if (typelib_typedescriptionreference_isAssignableFrom(
+ p[i],
+ reinterpret_cast< typelib_TypeDescriptionReference * >(
+ ret.getType().get())))
+ {
+ ok = true;
+ break;
+ }
+ }
+ if (!ok) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: reply message with bad exception type"
+ " received")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ } else {
+ switch (req.member.get()->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ if (!req.setter) {
+ ret = unmarshal.readValue(
+ css::uno::TypeDescription(
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ req.member.get())->
+ pAttributeTypeRef));
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast<
+ typelib_InterfaceMethodTypeDescription * >(
+ req.member.get());
+ ret = unmarshal.readValue(
+ css::uno::TypeDescription(mtd->pReturnTypeRef));
+ for (sal_Int32 i = 0; i != mtd->nParams; ++i) {
+ if (mtd->pParams[i].bOut) {
+ outArgs.push_back(
+ unmarshal.readValue(
+ css::uno::TypeDescription(
+ mtd->pParams[i].pTypeRef)));
+ }
+ }
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ switch (req.kind) {
+ case OutgoingRequest::KIND_NORMAL:
+ {
+ std::auto_ptr< IncomingReply > resp(
+ new IncomingReply(exc, ret, outArgs));
+ uno_threadpool_putJob(
+ bridge_->getThreadPool(), tid.getHandle(), resp.get(), 0,
+ false);
+ resp.release();
+ break;
+ }
+ case OutgoingRequest::KIND_REQUEST_CHANGE:
+ OSL_ASSERT(outArgs.empty());
+ bridge_->handleRequestChangeReply(exc, ret);
+ break;
+ case OutgoingRequest::KIND_COMMIT_CHANGE:
+ OSL_ASSERT(outArgs.empty());
+ bridge_->handleCommitChangeReply(exc, ret);
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+}
+
+rtl::ByteSequence Reader::getTid(Unmarshal & unmarshal, bool newTid) const {
+ if (newTid) {
+ return unmarshal.readTid();
+ }
+ if (lastTid_.getLength() == 0) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "URP: message with NEWTID received when last TID has not"
+ " yet been set")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return lastTid_;
+}
+
+}
diff --git a/binaryurp/source/reader.hxx b/binaryurp/source/reader.hxx
new file mode 100644
index 000000000000..37d0b9462ae4
--- /dev/null
+++ b/binaryurp/source/reader.hxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_READER_HXX
+#define INCLUDED_BINARYURP_SOURCE_READER_HXX
+
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "boost/noncopyable.hpp"
+#include "osl/thread.hxx"
+#include "rtl/byteseq.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "salhelper/simplereferenceobject.hxx"
+#include "typelib/typedescription.hxx"
+
+#include "readerstate.hxx"
+
+namespace binaryurp {
+ class BinaryAny;
+ class Bridge;
+ class Unmarshal;
+}
+
+namespace binaryurp {
+
+class Reader:
+ public osl::Thread, public salhelper::SimpleReferenceObject,
+ private boost::noncopyable
+{
+public:
+ static void * operator new(std::size_t size)
+ { return Thread::operator new(size); }
+
+ static void operator delete(void * pointer)
+ { Thread::operator delete(pointer); }
+
+ explicit Reader(rtl::Reference< Bridge > const & bridge);
+
+private:
+ virtual ~Reader();
+
+ virtual void SAL_CALL run();
+
+ virtual void SAL_CALL onTerminated();
+
+ void readMessage(Unmarshal & unmarshal);
+
+ void readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1);
+
+ rtl::ByteSequence getTid(Unmarshal & unmarshal, bool newTid) const;
+
+ rtl::Reference< Bridge > bridge_;
+ com::sun::star::uno::TypeDescription lastType_;
+ rtl::OUString lastOid_;
+ rtl::ByteSequence lastTid_;
+ ReaderState state_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/readerstate.hxx b/binaryurp/source/readerstate.hxx
new file mode 100644
index 000000000000..ef7ed4d7196f
--- /dev/null
+++ b/binaryurp/source/readerstate.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_READERSTATE_HXX
+#define INCLUDED_BINARYURP_SOURCE_READERSTATE_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "rtl/byteseq.hxx"
+#include "rtl/ustring.hxx"
+#include "typelib/typedescription.hxx"
+
+#include "cache.hxx"
+
+namespace binaryurp {
+
+struct ReaderState: private boost::noncopyable {
+ com::sun::star::uno::TypeDescription typeCache[cache::size];
+
+ rtl::OUString oidCache[cache::size];
+
+ rtl::ByteSequence tidCache[cache::size];
+};
+
+}
+
+#endif
diff --git a/remotebridges/source/bridge/remotebridge.component b/binaryurp/source/specialfunctionids.hxx
index bbc6bede1360..a2a59791ba09 100644
--- a/remotebridges/source/bridge/remotebridge.component
+++ b/binaryurp/source/specialfunctionids.hxx
@@ -1,9 +1,8 @@
-<?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.
+* Copyright 2000, 2011 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
@@ -24,13 +23,27 @@
* <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.remotebridges.Bridge.various">
- <service name="com.sun.star.bridge.Bridge"/>
- <service name="com.sun.star.bridge.IiopBridge"/>
- <service name="com.sun.star.bridge.UrpBridge"/>
- </implementation>
-</component>
+#ifndef INCLUDED_BINARYURP_SOURCE_SPECIALFUNCTIONIDS_HXX
+#define INCLUDED_BINARYURP_SOURCE_SPECIALFUNCTIONIDS_HXX
+
+#include "sal/config.h"
+
+namespace binaryurp {
+
+enum SpecialFunctionIds {
+ SPECIAL_FUNCTION_ID_QUERY_INTERFACE = 0,
+
+ SPECIAL_FUNCTION_ID_RESERVED = 1,
+
+ SPECIAL_FUNCTION_ID_RELEASE = 2,
+
+ SPECIAL_FUNCTION_ID_REQUEST_CHANGE = 4,
+
+ SPECIAL_FUNCTION_ID_COMMIT_CHANGE = 5
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/unmarshal.cxx b/binaryurp/source/unmarshal.cxx
new file mode 100755
index 000000000000..62f8683e33ad
--- /dev/null
+++ b/binaryurp/source/unmarshal.cxx
@@ -0,0 +1,563 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <cstdlib>
+#include <new>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/io/IOException.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "rtl/byteseq.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/textcvt.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "typelib/typeclass.h"
+#include "typelib/typedescription.h"
+#include "typelib/typedescription.hxx"
+#include "uno/any2.h"
+#include "uno/data.h"
+#include "uno/dispatcher.hxx"
+
+#include "binaryany.hxx"
+#include "bridge.hxx"
+#include "cache.hxx"
+#include "readerstate.hxx"
+#include "unmarshal.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+void * allocate(sal_Size size) {
+ void * p = rtl_allocateMemory(size);
+ if (p == 0) {
+ throw std::bad_alloc();
+ }
+ return p;
+}
+
+std::vector< BinaryAny >::iterator copyMemberValues(
+ css::uno::TypeDescription const & type,
+ std::vector< BinaryAny >::iterator const & it, void * buffer) throw ()
+{
+ OSL_ASSERT(
+ type.is() &&
+ (type.get()->eTypeClass == typelib_TypeClass_STRUCT ||
+ type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) &&
+ buffer != 0);
+ type.makeComplete();
+ std::vector< BinaryAny >::iterator i(it);
+ typelib_CompoundTypeDescription * ctd =
+ reinterpret_cast< typelib_CompoundTypeDescription * >(type.get());
+ if (ctd->pBaseTypeDescription != 0) {
+ i = copyMemberValues(
+ css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase), i,
+ buffer);
+ }
+ for (sal_Int32 j = 0; j != ctd->nMembers; ++j) {
+ uno_type_copyData(
+ static_cast< char * >(buffer) + ctd->pMemberOffsets[j],
+ const_cast< void * >(
+ i++->getValue(css::uno::TypeDescription(ctd->ppTypeRefs[j]))),
+ ctd->ppTypeRefs[j], 0);
+ }
+ return i;
+}
+
+}
+
+Unmarshal::Unmarshal(
+ rtl::Reference< Bridge > const & bridge, ReaderState & state,
+ css::uno::Sequence< sal_Int8 > const & buffer):
+ bridge_(bridge), state_(state), buffer_(buffer)
+{
+ data_ = reinterpret_cast< sal_uInt8 const * >(buffer_.getConstArray());
+ end_ = data_ + buffer_.getLength();
+}
+
+Unmarshal::~Unmarshal() {}
+
+sal_uInt8 Unmarshal::read8() {
+ check(1);
+ return *data_++;
+}
+
+sal_uInt16 Unmarshal::read16() {
+ check(2);
+ sal_uInt16 n = static_cast< sal_uInt16 >(*data_++) << 8;
+ return n | *data_++;
+}
+
+sal_uInt32 Unmarshal::read32() {
+ check(4);
+ sal_uInt32 n = static_cast< sal_uInt32 >(*data_++) << 24;
+ n |= static_cast< sal_uInt32 >(*data_++) << 16;
+ n |= static_cast< sal_uInt32 >(*data_++) << 8;
+ return n | *data_++;
+}
+
+css::uno::TypeDescription Unmarshal::readType() {
+ sal_uInt8 flags = read8();
+ typelib_TypeClass tc = static_cast< typelib_TypeClass >(flags & 0x7F);
+ switch (tc) {
+ case typelib_TypeClass_VOID:
+ case typelib_TypeClass_BOOLEAN:
+ case typelib_TypeClass_BYTE:
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+ case typelib_TypeClass_FLOAT:
+ case typelib_TypeClass_DOUBLE:
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_STRING:
+ case typelib_TypeClass_TYPE:
+ case typelib_TypeClass_ANY:
+ if ((flags & 0x80) != 0) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: cache flag of simple type is"
+ " set")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return css::uno::TypeDescription(
+ *typelib_static_type_getByTypeClass(
+ static_cast< typelib_TypeClass >(tc)));
+ case typelib_TypeClass_SEQUENCE:
+ case typelib_TypeClass_ENUM:
+ case typelib_TypeClass_STRUCT:
+ case typelib_TypeClass_EXCEPTION:
+ case typelib_TypeClass_INTERFACE:
+ {
+ sal_uInt16 idx = readCacheIndex();
+ if ((flags & 0x80) == 0) {
+ if (idx == cache::ignore || !state_.typeCache[idx].is()) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: unknown type cache"
+ " index")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return state_.typeCache[idx];
+ } else {
+ css::uno::TypeDescription t(readString());
+ if (!t.is() ||
+ t.get()->eTypeClass != static_cast< typelib_TypeClass >(tc))
+ {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: type with unknown"
+ " name")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ for (css::uno::TypeDescription t2(t);
+ t2.get()->eTypeClass == typelib_TypeClass_SEQUENCE;)
+ {
+ t2.makeComplete();
+ t2 = css::uno::TypeDescription(
+ reinterpret_cast< typelib_IndirectTypeDescription * >(
+ t2.get())->pType);
+ if (!t2.is()) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: sequence type with"
+ " unknown component type")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ switch (t2.get()->eTypeClass) {
+ case typelib_TypeClass_VOID:
+ case typelib_TypeClass_EXCEPTION:
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: sequence type with"
+ " bad component type")),
+ css::uno::Reference< css::uno::XInterface >());
+ default:
+ break;
+ }
+ }
+ if (idx != cache::ignore) {
+ state_.typeCache[idx] = t;
+ }
+ return t;
+ }
+ }
+ default:
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: type of unknown type class")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+rtl::OUString Unmarshal::readOid() {
+ rtl::OUString oid(readString());
+ for (sal_Int32 i = 0; i != oid.getLength(); ++i) {
+ if (oid[i] > 0x7F) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: OID contains non-ASCII"
+ " character")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ sal_uInt16 idx = readCacheIndex();
+ if (oid.getLength() == 0 && idx != cache::ignore) {
+ if (state_.oidCache[idx].getLength() == 0) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: unknown OID cache index")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return state_.oidCache[idx];
+ }
+ if (idx != cache::ignore) {
+ state_.oidCache[idx] = oid;
+ }
+ return oid;
+}
+
+rtl::ByteSequence Unmarshal::readTid() {
+ rtl::ByteSequence tid(
+ *static_cast< sal_Sequence * const * >(
+ readSequence(
+ css::uno::TypeDescription(
+ cppu::UnoType< css::uno::Sequence< sal_Int8 > >::get())).
+ getValue(
+ css::uno::TypeDescription(
+ cppu::UnoType< css::uno::Sequence< sal_Int8 > >::get()))));
+ sal_uInt16 idx = readCacheIndex();
+ if (tid.getLength() == 0) {
+ if (idx == cache::ignore || state_.tidCache[idx].getLength() == 0) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: unknown TID cache index")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return state_.tidCache[idx];
+ }
+ if (idx != cache::ignore) {
+ state_.tidCache[idx] = tid;
+ }
+ return tid;
+}
+
+BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
+ OSL_ASSERT(type.is());
+ switch (type.get()->eTypeClass) {
+ default:
+ std::abort(); // this cannot happen
+ // pseudo fall-through to avoid compiler warnings
+ case typelib_TypeClass_VOID:
+ return BinaryAny();
+ case typelib_TypeClass_BOOLEAN:
+ {
+ sal_uInt8 v = read8();
+ if (v > 1) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: boolean of unknown value")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return BinaryAny(type, &v);
+ }
+ case typelib_TypeClass_BYTE:
+ {
+ sal_uInt8 v = read8();
+ return BinaryAny(type, &v);
+ }
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ case typelib_TypeClass_CHAR:
+ {
+ sal_uInt16 v = read16();
+ return BinaryAny(type, &v);
+ }
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_FLOAT:
+ {
+ sal_uInt32 v = read32();
+ return BinaryAny(type, &v);
+ }
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+ case typelib_TypeClass_DOUBLE:
+ {
+ sal_uInt64 v = read64();
+ return BinaryAny(type, &v);
+ }
+ case typelib_TypeClass_STRING:
+ {
+ rtl::OUString v(readString());
+ return BinaryAny(type, &v.pData);
+ }
+ case typelib_TypeClass_TYPE:
+ {
+ css::uno::TypeDescription v(readType());
+ typelib_TypeDescription * p = v.get();
+ return BinaryAny(type, &p);
+ }
+ case typelib_TypeClass_ANY:
+ {
+ css::uno::TypeDescription t(readType());
+ if (t.get()->eTypeClass == typelib_TypeClass_ANY) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: any of type ANY")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return readValue(t);
+ }
+ case typelib_TypeClass_SEQUENCE:
+ type.makeComplete();
+ return readSequence(type);
+ case typelib_TypeClass_ENUM:
+ {
+ sal_Int32 v = static_cast< sal_Int32 >(read32());
+ type.makeComplete();
+ typelib_EnumTypeDescription * etd =
+ reinterpret_cast< typelib_EnumTypeDescription * >(type.get());
+ bool found = false;
+ for (sal_Int32 i = 0; i != etd->nEnumValues; ++i) {
+ if (etd->pEnumValues[i] == v) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: unknown enum value")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return BinaryAny(type, &v);
+ }
+ case typelib_TypeClass_STRUCT:
+ case typelib_TypeClass_EXCEPTION:
+ {
+ std::vector< BinaryAny > as;
+ readMemberValues(type, &as);
+ void * buf = allocate(type.get()->nSize);
+ copyMemberValues(type, as.begin(), buf);
+ uno_Any raw;
+ raw.pType = reinterpret_cast< typelib_TypeDescriptionReference * >(
+ type.get());
+ raw.pData = buf;
+ raw.pReserved = 0;
+ return BinaryAny(raw);
+ }
+ case typelib_TypeClass_INTERFACE:
+ {
+ css::uno::UnoInterfaceReference obj(
+ bridge_->registerIncomingInterface(readOid(), type));
+ return BinaryAny(type, &obj.m_pUnoI);
+ }
+ }
+}
+
+void Unmarshal::done() const {
+ if (data_ != end_) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: block contains excess data")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void Unmarshal::check(sal_Int32 size) const {
+ if (end_ - data_ < size) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: trying to read past end of block")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+sal_uInt32 Unmarshal::readCompressed() {
+ sal_uInt8 n = read8();
+ return n == 0xFF ? read32() : n;
+}
+
+sal_uInt16 Unmarshal::readCacheIndex() {
+ sal_uInt16 idx = read16();
+ if (idx >= cache::size && idx != cache::ignore) {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: cache index out of range")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return idx;
+}
+
+sal_uInt64 Unmarshal::read64() {
+ check(8);
+ sal_uInt64 n = static_cast< sal_uInt64 >(*data_++) << 56;
+ n |= static_cast< sal_uInt64 >(*data_++) << 48;
+ n |= static_cast< sal_uInt64 >(*data_++) << 40;
+ n |= static_cast< sal_uInt64 >(*data_++) << 32;
+ n |= static_cast< sal_uInt64 >(*data_++) << 24;
+ n |= static_cast< sal_uInt64 >(*data_++) << 16;
+ n |= static_cast< sal_uInt64 >(*data_++) << 8;
+ return n | *data_++;
+}
+
+rtl::OUString Unmarshal::readString() {
+ sal_uInt32 n = readCompressed();
+ if (n > SAL_MAX_INT32) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: string size too large")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ check(static_cast< sal_Int32 >(n));
+ rtl::OUString s;
+ if (!rtl_convertStringToUString(
+ &s.pData, reinterpret_cast< char const * >(data_),
+ static_cast< sal_Int32 >(n), RTL_TEXTENCODING_UTF8,
+ (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
+ {
+ throw css::io::IOException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: string does not contain UTF-8")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ data_ += n;
+ return s;
+}
+
+BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
+ OSL_ASSERT(
+ type.is() && type.get()->eTypeClass == typelib_TypeClass_SEQUENCE);
+ sal_uInt32 n = readCompressed();
+ if (n > SAL_MAX_INT32) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: sequence size too large")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (n == 0) {
+ return BinaryAny(type, 0);
+ }
+ css::uno::TypeDescription ctd(
+ reinterpret_cast< typelib_IndirectTypeDescription * >(
+ type.get())->pType);
+ if (ctd.get()->eTypeClass == typelib_TypeClass_BYTE) {
+ check(static_cast< sal_Int32 >(n));
+ rtl::ByteSequence s(
+ reinterpret_cast< sal_Int8 const * >(data_),
+ static_cast< sal_Int32 >(n));
+ data_ += n;
+ sal_Sequence * p = s.getHandle();
+ return BinaryAny(type, &p);
+ }
+ std::vector< BinaryAny > as;
+ for (sal_uInt32 i = 0; i != n; ++i) {
+ as.push_back(readValue(ctd));
+ }
+ OSL_ASSERT(ctd.get()->nSize >= 0);
+ sal_uInt64 size = static_cast< sal_uInt64 >(n) *
+ static_cast< sal_uInt64 >(ctd.get()->nSize);
+ // sal_uInt32 * sal_Int32 -> sal_uInt64 cannot overflow
+ if (size > SAL_MAX_SIZE - SAL_SEQUENCE_HEADER_SIZE) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "binaryurp::Unmarshal: sequence size too large")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ void * buf = allocate(
+ SAL_SEQUENCE_HEADER_SIZE + static_cast< sal_Size >(size));
+ static_cast< sal_Sequence * >(buf)->nRefCount = 0;
+ static_cast< sal_Sequence * >(buf)->nElements =
+ static_cast< sal_Int32 >(n);
+ for (sal_uInt32 i = 0; i != n; ++i) {
+ uno_copyData(
+ static_cast< sal_Sequence * >(buf)->elements + i * ctd.get()->nSize,
+ const_cast< void * >(as[i].getValue(ctd)), ctd.get(), 0);
+ }
+ return BinaryAny(type, reinterpret_cast< sal_Sequence ** >(&buf));
+}
+
+void Unmarshal::readMemberValues(
+ css::uno::TypeDescription const & type, std::vector< BinaryAny > * values)
+{
+ OSL_ASSERT(
+ type.is() &&
+ (type.get()->eTypeClass == typelib_TypeClass_STRUCT ||
+ type.get()->eTypeClass == typelib_TypeClass_EXCEPTION) &&
+ values != 0);
+ type.makeComplete();
+ typelib_CompoundTypeDescription * ctd =
+ reinterpret_cast< typelib_CompoundTypeDescription * >(type.get());
+ if (ctd->pBaseTypeDescription != 0) {
+ readMemberValues(
+ css::uno::TypeDescription(&ctd->pBaseTypeDescription->aBase),
+ values);
+ }
+ for (sal_Int32 i = 0; i != ctd->nMembers; ++i) {
+ values->push_back(
+ readValue(css::uno::TypeDescription(ctd->ppTypeRefs[i])));
+ }
+}
+
+}
diff --git a/binaryurp/source/unmarshal.hxx b/binaryurp/source/unmarshal.hxx
new file mode 100644
index 000000000000..33a4aafec75e
--- /dev/null
+++ b/binaryurp/source/unmarshal.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_UNMARSHAL_HXX
+#define INCLUDED_BINARYURP_SOURCE_UNMARSHAL_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+#include "typelib/typedescription.hxx"
+
+namespace binaryurp {
+ class BinaryAny;
+ class Bridge;
+ struct ReaderState;
+}
+namespace com { namespace sun { namespace star { namespace uno {
+ class TypeDescription;
+} } } }
+namespace rtl {
+ class ByteSequecne;
+ class OUString;
+}
+
+namespace binaryurp {
+
+class Unmarshal: private boost::noncopyable {
+public:
+ Unmarshal(
+ rtl::Reference< Bridge > const & bridge, ReaderState & state,
+ com::sun::star::uno::Sequence< sal_Int8 > const & buffer);
+
+ ~Unmarshal();
+
+ sal_uInt8 read8();
+
+ sal_uInt16 read16();
+
+ sal_uInt32 read32();
+
+ com::sun::star::uno::TypeDescription readType();
+
+ rtl::OUString readOid();
+
+ rtl::ByteSequence readTid();
+
+ BinaryAny readValue(com::sun::star::uno::TypeDescription const & type);
+
+ void done() const;
+
+private:
+ void check(sal_Int32 size) const;
+
+ sal_uInt32 readCompressed();
+
+ sal_uInt16 readCacheIndex();
+
+ sal_uInt64 read64();
+
+ rtl::OUString readString();
+
+ BinaryAny readSequence(com::sun::star::uno::TypeDescription const & type);
+
+ void readMemberValues(
+ com::sun::star::uno::TypeDescription const & type,
+ std::vector< BinaryAny > * values);
+
+ rtl::Reference< Bridge > bridge_;
+ ReaderState & state_;
+ com::sun::star::uno::Sequence< sal_Int8 > buffer_;
+ sal_uInt8 const * data_;
+ sal_uInt8 const * end_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
new file mode 100755
index 000000000000..97a60157eb6f
--- /dev/null
+++ b/binaryurp/source/writer.cxx
@@ -0,0 +1,476 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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 <exception>
+#include <vector>
+
+#include "com/sun/star/connection/XConnection.hpp"
+#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/exc_hlp.hxx"
+#include "osl/mutex.hxx"
+#include "rtl/memory.h"
+#include "uno/dispatcher.hxx"
+
+#include "binaryany.hxx"
+#include "bridge.hxx"
+#include "currentcontext.hxx"
+#include "specialfunctionids.hxx"
+#include "writer.hxx"
+
+namespace binaryurp {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool isProtocolPropertyMessage(rtl::OUString const & oid) {
+ return oid.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("UrpProtocolProperties"));
+}
+
+}
+
+Writer::Item::Item() {}
+
+Writer::Item::Item(
+ rtl::ByteSequence const & theTid, rtl::OUString const & theOid,
+ css::uno::TypeDescription const & theType,
+ css::uno::TypeDescription const & theMember,
+ std::vector< BinaryAny > const & inArguments,
+ css::uno::UnoInterfaceReference const & theCurrentContext):
+ request(true), tid(theTid), oid(theOid), type(theType), member(theMember),
+ arguments(inArguments), currentContext(theCurrentContext)
+{}
+
+Writer::Item::Item(
+ rtl::ByteSequence const & theTid,
+ css::uno::TypeDescription const & theMember, bool theSetter,
+ bool theException, BinaryAny const & theReturnValue,
+ std::vector< BinaryAny > const & outArguments,
+ bool theSetCurrentContextMode):
+ request(false), tid(theTid), member(theMember), setter(theSetter),
+ arguments(outArguments), exception(theException),
+ returnValue(theReturnValue), setCurrentContextMode(theSetCurrentContextMode)
+{}
+
+Writer::Writer(rtl::Reference< Bridge > const & bridge):
+ bridge_(bridge), marshal_(bridge, state_), stop_(false)
+{
+ OSL_ASSERT(bridge.is());
+ acquire();
+}
+
+void Writer::sendDirectRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ css::uno::TypeDescription const & type,
+ css::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments)
+{
+ OSL_ASSERT(!unblocked_.check());
+ sendRequest(
+ tid, oid, type, member, inArguments, false,
+ css::uno::UnoInterfaceReference());
+}
+
+void Writer::sendDirectReply(
+ rtl::ByteSequence const & tid, css::uno::TypeDescription const & member,
+ bool exception, BinaryAny const & returnValue,
+ std::vector< BinaryAny > const & outArguments)
+{
+ OSL_ASSERT(!unblocked_.check());
+ sendReply(tid, member, false, exception, returnValue,outArguments);
+}
+
+void Writer::queueRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ css::uno::TypeDescription const & type,
+ css::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments)
+{
+ css::uno::UnoInterfaceReference cc(current_context::get());
+ osl::MutexGuard g(mutex_);
+ queue_.push_back(Item(tid, oid, type, member, inArguments, cc));
+ items_.set();
+}
+
+void Writer::queueReply(
+ rtl::ByteSequence const & tid,
+ com::sun::star::uno::TypeDescription const & member, bool setter,
+ bool exception, BinaryAny const & returnValue,
+ std::vector< BinaryAny > const & outArguments, bool setCurrentContextMode)
+{
+ osl::MutexGuard g(mutex_);
+ queue_.push_back(
+ Item(
+ tid, member, setter, exception, returnValue, outArguments,
+ setCurrentContextMode));
+ items_.set();
+}
+
+void Writer::unblock() {
+ // Assumes that osl::Condition::set works as a memory barrier, so that
+ // changes made by preceeding sendDirectRequest/Reply calls are visible to
+ // subsequent sendRequest/Reply calls:
+ unblocked_.set();
+}
+
+void Writer::stop() {
+ {
+ osl::MutexGuard g(mutex_);
+ stop_ = true;
+ }
+ unblocked_.set();
+ items_.set();
+}
+
+Writer::~Writer() {}
+
+void Writer::run() {
+ setName("binaryurpWriter");
+ try {
+ unblocked_.wait();
+ for (;;) {
+ items_.wait();
+ Item item;
+ {
+ osl::MutexGuard g(mutex_);
+ if (stop_) {
+ return;
+ }
+ OSL_ASSERT(!queue_.empty());
+ item = queue_.front();
+ queue_.pop_front();
+ if (queue_.empty()) {
+ items_.reset();
+ }
+ }
+ if (item.request) {
+ sendRequest(
+ item.tid, item.oid, item.type, item.member, item.arguments,
+ (!item.oid.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("UrpProtocolProperties")) &&
+ !item.member.equals(
+ css::uno::TypeDescription(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.uno.XInterface::"
+ "release")))) &&
+ bridge_->isCurrentContextMode()),
+ item.currentContext);
+ } else {
+ sendReply(
+ item.tid, item.member, item.setter, item.exception,
+ item.returnValue, item.arguments);
+ if (item.setCurrentContextMode) {
+ bridge_->setCurrentContextMode();
+ }
+ }
+ }
+ } catch (css::uno::Exception & e) {
+ OSL_TRACE(
+ OSL_LOG_PREFIX "caught UNO exception '%s'",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ } catch (std::exception & e) {
+ OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what());
+ }
+ bridge_->terminate();
+}
+
+void Writer::onTerminated() {
+ release();
+}
+
+void Writer::sendRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ css::uno::TypeDescription const & type,
+ css::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments, bool currentContextMode,
+ css::uno::UnoInterfaceReference const & currentContext)
+{
+ OSL_ASSERT(tid.getLength() != 0 && oid.getLength() != 0 && member.is());
+ css::uno::TypeDescription t(type);
+ sal_Int32 functionId = 0;
+ bool forceSynchronous = false;
+ member.makeComplete();
+ switch (member.get()->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+ typelib_InterfaceAttributeTypeDescription * atd =
+ reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
+ member.get());
+ OSL_ASSERT(atd->pInterface != 0);
+ if (!t.is()) {
+ t = css::uno::TypeDescription(&atd->pInterface->aBase);
+ }
+ t.makeComplete();
+ functionId = atd->pInterface->pMapMemberIndexToFunctionIndex[
+ atd->aBase.nPosition];
+ if (!inArguments.empty()) { // setter
+ ++functionId;
+ }
+ break;
+ }
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
+ member.get());
+ OSL_ASSERT(mtd->pInterface != 0);
+ if (!t.is()) {
+ t = css::uno::TypeDescription(&mtd->pInterface->aBase);
+ }
+ t.makeComplete();
+ functionId = mtd->pInterface->pMapMemberIndexToFunctionIndex[
+ mtd->aBase.nPosition];
+ forceSynchronous = mtd->bOneWay &&
+ functionId != SPECIAL_FUNCTION_ID_RELEASE;
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ OSL_ASSERT(functionId >= 0);
+ if (functionId > SAL_MAX_UINT16) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("function ID too large for URP")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ std::vector< unsigned char > buf;
+ bool newType = !(lastType_.is() && t.equals(lastType_));
+ bool newOid = oid != lastOid_;
+ bool newTid = tid != lastTid_;
+ if (newType || newOid || newTid || forceSynchronous || functionId > 0x3FFF)
+ // > 14 bit function ID
+ {
+ Marshal::write8(
+ &buf,
+ (0xC0 | (newType ? 0x20 : 0) | (newOid ? 0x10 : 0) |
+ (newTid ? 0x08 : 0) | (functionId > 0xFF ? 0x04 : 0) |
+ (forceSynchronous ? 0x01 : 0)));
+ // bit 7: LONGHEADER, bit 6: REQUEST, bit 5: NEWTYPE, bit 4: NEWOID,
+ // bit 3: NEWTID, bit 2: FUNCTIONID16, bit 0: MOREFLAGS
+ if (forceSynchronous) {
+ Marshal::write8(&buf, 0xC0); // bit 7: MUSTREPLY, bit 6: SYNCHRONOUS
+ }
+ if (functionId <= 0xFF) {
+ Marshal::write8(&buf, static_cast< sal_uInt8 >(functionId));
+ } else {
+ Marshal::write16(&buf, static_cast< sal_uInt16 >(functionId));
+ }
+ if (newType) {
+ marshal_.writeType(&buf, t);
+ }
+ if (newOid) {
+ marshal_.writeOid(&buf, oid);
+ }
+ if (newTid) {
+ marshal_.writeTid(&buf, tid);
+ }
+ } else if (functionId <= 0x3F) { // <= 6 bit function ID
+ Marshal::write8(&buf, static_cast< sal_uInt8 >(functionId));
+ // bit 7: !LONGHEADER, bit 6: !FUNCTIONID14
+ } else {
+ Marshal::write8(
+ &buf, static_cast< sal_uInt8 >(0x40 | (functionId >> 8)));
+ // bit 7: !LONGHEADER, bit 6: FUNCTIONID14
+ Marshal::write8(&buf, functionId & 0xFF);
+ }
+ if (currentContextMode) {
+ css::uno::UnoInterfaceReference cc(currentContext);
+ marshal_.writeValue(
+ &buf,
+ css::uno::TypeDescription(
+ cppu::UnoType<
+ css::uno::Reference< css::uno::XCurrentContext > >::get()),
+ BinaryAny(
+ css::uno::TypeDescription(
+ cppu::UnoType<
+ css::uno::Reference<
+ css::uno::XCurrentContext > >::get()),
+ &cc.m_pUnoI));
+ }
+ switch (member.get()->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ if (!inArguments.empty()) { // setter
+ OSL_ASSERT(inArguments.size() == 1);
+ marshal_.writeValue(
+ &buf,
+ css::uno::TypeDescription(
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ member.get())->
+ pAttributeTypeRef),
+ inArguments.front());
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
+ member.get());
+ std::vector< BinaryAny >::const_iterator i(inArguments.begin());
+ for (sal_Int32 j = 0; j != mtd->nParams; ++j) {
+ if (mtd->pParams[j].bIn) {
+ marshal_.writeValue(
+ &buf,
+ css::uno::TypeDescription(mtd->pParams[j].pTypeRef),
+ *i++);
+ }
+ }
+ OSL_ASSERT(i == inArguments.end());
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ sendMessage(buf);
+ lastType_ = t;
+ lastOid_ = oid;
+ lastTid_ = tid;
+}
+
+void Writer::sendReply(
+ rtl::ByteSequence const & tid,
+ com::sun::star::uno::TypeDescription const & member, bool setter,
+ bool exception, BinaryAny const & returnValue,
+ std::vector< BinaryAny > const & outArguments)
+{
+ OSL_ASSERT(tid.getLength() != 0 && member.is() && member.get()->bComplete);
+ std::vector< unsigned char > buf;
+ bool newTid = tid != lastTid_;
+ Marshal::write8(&buf, 0x80 | (exception ? 0x20 : 0) | (newTid ? 0x08 : 0));
+ // bit 7: LONGHEADER; bit 6: !REQUEST; bit 5: EXCEPTION; bit 3: NEWTID
+ if (newTid) {
+ marshal_.writeTid(&buf, tid);
+ }
+ if (exception) {
+ marshal_.writeValue(
+ &buf,
+ css::uno::TypeDescription(cppu::UnoType< css::uno::Any >::get()),
+ returnValue);
+ } else {
+ switch (member.get()->eTypeClass) {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ if (!setter) {
+ marshal_.writeValue(
+ &buf,
+ css::uno::TypeDescription(
+ reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ member.get())->
+ pAttributeTypeRef),
+ returnValue);
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ typelib_InterfaceMethodTypeDescription * mtd =
+ reinterpret_cast<
+ typelib_InterfaceMethodTypeDescription * >(
+ member.get());
+ marshal_.writeValue(
+ &buf, css::uno::TypeDescription(mtd->pReturnTypeRef),
+ returnValue);
+ std::vector< BinaryAny >::const_iterator i(
+ outArguments.begin());
+ for (sal_Int32 j = 0; j != mtd->nParams; ++j) {
+ if (mtd->pParams[j].bOut) {
+ marshal_.writeValue(
+ &buf,
+ css::uno::TypeDescription(mtd->pParams[j].pTypeRef),
+ *i++);
+ }
+ }
+ OSL_ASSERT(i == outArguments.end());
+ break;
+ }
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ sendMessage(buf);
+ lastTid_ = tid;
+ bridge_->decrementCalls();
+}
+
+void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
+ std::vector< unsigned char > header;
+ if (buffer.size() > SAL_MAX_UINT32) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("message too large for URP")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ Marshal::write32(&header, static_cast< sal_uInt32 >(buffer.size()));
+ Marshal::write32(&header, 1);
+ OSL_ASSERT(!buffer.empty());
+ unsigned char const * p = &buffer[0];
+ std::vector< unsigned char >::size_type n = buffer.size();
+ OSL_ASSERT(header.size() <= SAL_MAX_INT32 && SAL_MAX_INT32 <= SAL_MAX_SIZE);
+ sal_Size k = SAL_MAX_INT32 - header.size();
+ if (n < k) {
+ k = static_cast< sal_Size >(n);
+ }
+ css::uno::Sequence< sal_Int8 > s(
+ static_cast< sal_Int32 >(header.size() + k));
+ OSL_ASSERT(!header.empty());
+ rtl_copyMemory(
+ s.getArray(), &header[0], static_cast< sal_Size >(header.size()));
+ for (;;) {
+ rtl_copyMemory(s.getArray() + s.getLength() - k, p, k);
+ try {
+ bridge_->getConnection()->write(s);
+ } catch (css::io::IOException & e) {
+ css::uno::Any exc(cppu::getCaughtException());
+ throw css::lang::WrappedTargetRuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "Binary URP write raised IO exception: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >(), exc);
+ }
+ n = static_cast< std::vector< unsigned char >::size_type >(n - k);
+ if (n == 0) {
+ break;
+ }
+ p += k;
+ k = SAL_MAX_INT32;
+ if (n < k) {
+ k = static_cast< sal_Size >(n);
+ }
+ s.realloc(k);
+ }
+}
+
+}
diff --git a/binaryurp/source/writer.hxx b/binaryurp/source/writer.hxx
new file mode 100644
index 000000000000..fe5dba2cc1d9
--- /dev/null
+++ b/binaryurp/source/writer.hxx
@@ -0,0 +1,185 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_WRITER_HXX
+#define INCLUDED_BINARYURP_SOURCE_WRITER_HXX
+
+#include "sal/config.h"
+
+#include <cstddef>
+#include <deque>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "osl/conditn.hxx"
+#include "osl/mutex.hxx"
+#include "osl/thread.hxx"
+#include "rtl/byteseq.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "salhelper/simplereferenceobject.hxx"
+#include "typelib/typedescription.hxx"
+#include "uno/dispatcher.hxx"
+
+#include "binaryany.hxx"
+#include "marshal.hxx"
+#include "writerstate.hxx"
+
+namespace binaryurp { class Bridge; }
+
+namespace binaryurp {
+
+class Writer:
+ public osl::Thread, public salhelper::SimpleReferenceObject,
+ private boost::noncopyable
+{
+public:
+ static void * operator new(std::size_t size)
+ { return Thread::operator new(size); }
+
+ static void operator delete(void * pointer)
+ { Thread::operator delete(pointer); }
+
+ explicit Writer(rtl::Reference< Bridge > const & bridge);
+
+ // Only called from Bridge::reader_ thread, and only before Bridge::writer_
+ // thread is unblocked:
+ void sendDirectRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type,
+ com::sun::star::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments);
+
+ // Only called from Bridge::reader_ thread, and only before Bridge::writer_
+ // thread is unblocked:
+ void sendDirectReply(
+ rtl::ByteSequence const & tid,
+ com::sun::star::uno::TypeDescription const & member,
+ bool exception, BinaryAny const & returnValue,
+ std::vector< BinaryAny > const & outArguments);
+
+ void queueRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type,
+ com::sun::star::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments);
+
+ void queueReply(
+ rtl::ByteSequence const & tid,
+ com::sun::star::uno::TypeDescription const & member, bool setter,
+ bool exception, BinaryAny const & returnValue,
+ std::vector< BinaryAny > const & outArguments,
+ bool setCurrentContextMode);
+
+ void unblock();
+
+ void stop();
+
+private:
+ virtual ~Writer();
+
+ virtual void SAL_CALL run();
+
+ virtual void SAL_CALL onTerminated();
+
+ void sendRequest(
+ rtl::ByteSequence const & tid, rtl::OUString const & oid,
+ com::sun::star::uno::TypeDescription const & type,
+ com::sun::star::uno::TypeDescription const & member,
+ std::vector< BinaryAny > const & inArguments, bool currentContextMode,
+ com::sun::star::uno::UnoInterfaceReference const & currentContext);
+
+ void sendReply(
+ rtl::ByteSequence const & tid,
+ com::sun::star::uno::TypeDescription const & member, bool setter,
+ bool exception, BinaryAny const & returnValue,
+ std::vector< BinaryAny > const & outArguments);
+
+ void sendMessage(std::vector< unsigned char > const & buffer);
+
+ struct Item {
+ Item();
+
+ // Request:
+ Item(
+ rtl::ByteSequence const & theTid, rtl::OUString const & theOid,
+ com::sun::star::uno::TypeDescription const & theType,
+ com::sun::star::uno::TypeDescription const & theMember,
+ std::vector< BinaryAny > const & inArguments,
+ com::sun::star::uno::UnoInterfaceReference const &
+ theCurrentContext);
+
+ // Reply:
+ Item(
+ rtl::ByteSequence const & theTid,
+ com::sun::star::uno::TypeDescription const & theMember,
+ bool theSetter, bool theException, BinaryAny const & theReturnValue,
+ std::vector< BinaryAny > const & outArguments,
+ bool theSetCurrentContextMode);
+
+ bool request;
+
+ rtl::ByteSequence tid; // request + reply
+
+ rtl::OUString oid; // request
+
+ com::sun::star::uno::TypeDescription type; // request
+
+ com::sun::star::uno::TypeDescription member; // request + reply
+
+ bool setter; // reply
+
+ std::vector< BinaryAny > arguments;
+ // request: inArguments; reply: outArguments
+
+ bool exception; // reply
+
+ BinaryAny returnValue; // reply
+
+ com::sun::star::uno::UnoInterfaceReference currentContext; // request
+
+ bool setCurrentContextMode; // reply
+ };
+
+ rtl::Reference< Bridge > bridge_;
+ WriterState state_;
+ Marshal marshal_;
+ com::sun::star::uno::TypeDescription lastType_;
+ rtl::OUString lastOid_;
+ rtl::ByteSequence lastTid_;
+ osl::Condition unblocked_;
+ osl::Condition items_;
+
+ osl::Mutex mutex_;
+ std::deque< Item > queue_;
+ bool stop_;
+};
+
+}
+
+#endif
diff --git a/binaryurp/source/writerstate.hxx b/binaryurp/source/writerstate.hxx
new file mode 100644
index 000000000000..cbb0208ba019
--- /dev/null
+++ b/binaryurp/source/writerstate.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_BINARYURP_SOURCE_WRITERSTATE_HXX
+#define INCLUDED_BINARYURP_SOURCE_WRITERSTATE_HXX
+
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "rtl/byteseq.hxx"
+#include "rtl/ustring.hxx"
+#include "typelib/typedescription.hxx"
+
+#include "cache.hxx"
+
+namespace binaryurp {
+
+struct WriterState: private boost::noncopyable {
+ WriterState():
+ typeCache(cache::size), oidCache(cache::size), tidCache(cache::size) {}
+
+ Cache< com::sun::star::uno::TypeDescription > typeCache;
+
+ Cache< rtl::OUString > oidCache;
+
+ Cache< rtl::ByteSequence > tidCache;
+};
+
+}
+
+#endif
diff --git a/bridges/inc/bridges/remote/bridgeimpl.hxx b/bridges/inc/bridges/remote/bridgeimpl.hxx
deleted file mode 100644
index 0257dd5f879a..000000000000
--- a/bridges/inc/bridges/remote/bridgeimpl.hxx
+++ /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.
- *
- ************************************************************************/
-#ifndef _BRIDGES_REMOTE_BRIDGEIMPL_HXX_
-#define _BRIDGES_REMOTE_BRIDGEIMPL_HXX_
-#include <osl/interlck.h>
-
-#include <uno/environment.h>
-
-#include <bridges/remote/context.h>
-#include <bridges/remote/remote.h>
-
-
-struct remote_BridgeImpl
-{
- void (SAL_CALL * m_allThreadsAreGone ) ( uno_Environment * );
- requestClientSideDispatcher m_sendRequest;
- oslInterlockedCount m_nRemoteThreads;
- sal_Bool m_bDisposed;
- sal_Bool m_bReleaseStubsCalled;
-};
-
-namespace bridges_remote {
-
- enum RemoteThreadCounter_HoldEnvWeak
- {
- RTC_HOLDENVWEAK = 0x1
- };
-
- class RemoteThreadCounter
- {
- public:
- // performance optimization. In some cases, it is not necessary to acquire the
- // environment.
- RemoteThreadCounter( uno_Environment *pEnvRemote, RemoteThreadCounter_HoldEnvWeak )
- : m_bReleaseEnvironment( sal_False )
- , m_pEnvRemote( pEnvRemote )
- {
- remote_Context *pContext = ((remote_Context *) m_pEnvRemote->pContext );
- osl_incrementInterlockedCount( &( pContext->m_pBridgeImpl->m_nRemoteThreads ) );
- }
-
- RemoteThreadCounter( uno_Environment *pEnvRemote )
- : m_bReleaseEnvironment( sal_True )
- , m_pEnvRemote( pEnvRemote )
- {
- m_pEnvRemote->acquire( m_pEnvRemote );
-
- remote_Context *pContext = ((remote_Context *) m_pEnvRemote->pContext );
- osl_incrementInterlockedCount( &( pContext->m_pBridgeImpl->m_nRemoteThreads ) );
- }
-
- ~RemoteThreadCounter( )
- {
- remote_Context *pContext = ((remote_Context *) m_pEnvRemote->pContext );
- if( 0 == osl_decrementInterlockedCount( &( pContext->m_pBridgeImpl->m_nRemoteThreads)) &&
- pContext->m_pBridgeImpl->m_bDisposed &&
- ! pContext->m_pBridgeImpl->m_bReleaseStubsCalled )
- {
- pContext->m_pBridgeImpl->m_allThreadsAreGone( m_pEnvRemote );
- }
- if( m_bReleaseEnvironment )
- m_pEnvRemote->release( m_pEnvRemote );
- }
-
- sal_Bool m_bReleaseEnvironment;
- uno_Environment *m_pEnvRemote;
- };
-}
-
-#endif
diff --git a/bridges/inc/bridges/remote/connection.h b/bridges/inc/bridges/remote/connection.h
deleted file mode 100644
index b374b73bc8cf..000000000000
--- a/bridges/inc/bridges/remote/connection.h
+++ /dev/null
@@ -1,67 +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 _BRIDGES_REMOTE_CONNECTION_H_
-#define _BRIDGES_REMOTE_CONNECTION_H_
-#include <sal/types.h>
-
-/** Specfies a C-interface for a bidirectional bytestream,
- which is used by a UNO remote environment.
- */
-struct remote_Connection
-{
- void ( SAL_CALL * acquire ) ( remote_Connection *);
-
- void ( SAL_CALL * release ) ( remote_Connection *);
-
- /**
- reads nSize bytes from the connection. This method blocks, until
- all bytes are available or an error occurs.
- @return Number of bytes read.
- If the return value is less than nSize, an unrecoverable
- i/o error has occured or the connection was closed.
-
- */
- sal_Int32 (SAL_CALL * read)(remote_Connection *, sal_Int8 *pDest, sal_Int32 nSize );
-
- /**
- @return Number of bytes written.
- if the return value is less than nSize an unrecoverable
- i/o error has occured or the connection was closed.
- */
- sal_Int32 (SAL_CALL * write)(remote_Connection *, const sal_Int8 *pSource, sal_Int32 nSize );
-
- void ( SAL_CALL * flush ) ( remote_Connection * );
-
- /** closes the connection.
- Any read or write operation after this call shall not be served
- anymore. Any ongoing read or write operation must return immeadiatly after this call.
- The implementation should cope with multiple calls to this method.
- */
- void (SAL_CALL * close) ( remote_Connection * );
-};
-
-#endif
diff --git a/bridges/inc/bridges/remote/context.h b/bridges/inc/bridges/remote/context.h
deleted file mode 100644
index e03310ce5e27..000000000000
--- a/bridges/inc/bridges/remote/context.h
+++ /dev/null
@@ -1,260 +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 _BRIDGES_REMOTE_CONTEXT_H_
-#define _BRIDGES_REMOTE_CONTEXT_H_
-#include <osl/interlck.h>
-#include <osl/conditn.h>
-
-#include <typelib/typedescription.h>
-
-#include <uno/environment.h>
-#include <uno/any2.h>
-
-
-/** Interface for refcounted contexts of uno-environments.
-
- Not all uno_Contexts need to be refcounted, in case they are,
- they should be 'derived' from this struct.
- This is used as a base class for the remote_Context.
- @see uno_Environment
- @see uno_getEnvironment()
- @see remote_Context
- */
-struct uno_Context
-{
- /** increase the refcount of the context
- */
- void (SAL_CALL * acquire)( uno_Context *pContext );
-
- /** decrements the recount of the context. In case the recount drops to zero,
- the context gets destroye.
- */
- void (SAL_CALL * release)( uno_Context *pContext);
-
- /** Allows to query for a different interface of the uno_Context.
- The result of the void pointer is unspecified and depends on the concrete context.
- */
- void * (SAL_CALL *query ) ( uno_Context *pContext , rtl_uString *pId);
-};
-
-struct remote_Connection;
-struct remote_Context;
-struct remote_Interface;
-
-
-
-/** performs a query-interface for a certain interface via the remote connection !
-
- @param pEnvRemote The environment, that shall perform the call.
- @param ppRemoteI in/out parameter contains the interface returned by queryInterface
- @param pOid the oid of the 'ghost' object on which the call must be done.
- ***/
-typedef void ( SAL_CALL * remote_getInstanceFunc ) (
- uno_Environment *pEnvRemote,
- remote_Interface **ppRemoteI,
- rtl_uString *pOid,
- typelib_TypeDescriptionReference *pInterfaceTypeRef,
- uno_Any **ppException );
-
-
-/** refcounted C-interface, which provides object by name.
- */
-struct remote_InstanceProvider
-{
- void (SAL_CALL * acquire ) ( remote_InstanceProvider * pProvider );
- void (SAL_CALL * release ) ( remote_InstanceProvider * pProvider );
- void (SAL_CALL * getInstance ) ( remote_InstanceProvider * pProvider ,
- uno_Environment *pEnvRemote,
- remote_Interface **ppRemoteI,
- rtl_uString *pInstanceName,
- typelib_InterfaceTypeDescription *pType,
- uno_Any **ppException );
-};
-
-/** refcounted C-interface, which allows to register a listener to an
- remote bridge to be informed when the bridge gets disposed.
-
- @see remote_Context
- */
-struct remote_DisposingListener
-{
- void (SAL_CALL * acquire ) ( remote_DisposingListener * pProvider );
- void (SAL_CALL * release ) ( remote_DisposingListener * pProvider );
- void (SAL_CALL * disposing ) ( remote_DisposingListener * pProvider,
- rtl_uString *pBridgeName );
-};
-
-
-/**
- Try to get an existing context characterized by the pIdString. Each ID-String must
- uniquely charcterize a certain connection. The context can't be retrieved via this
- function anymore, after it got disposed.
-
- @return 0 when such a context does not exist, otherwise
- a pointer to an acquired remote_Context.
- **/
-extern "C" remote_Context * SAL_CALL
-remote_getContext( rtl_uString *pIdString );
-
-/**
- Create an acquired remote context. The Context is weakly held by the context administration
- and can be accessed later through remote_getContext() (using the same id-string).
-
- @param pIdString A string, that uniquely describes the connection. For e.g. a socket connection,
- host and port of the local and remote host should be in the string.
-
- @param pDescription
- Description of the connection, that may brought up to the user.
-
- @param pProtocol
- The protocol, that the environment uses for
- communicating with the remote process.
- The format of the protocol string is : "protocolname,para1=para1value,..."
- @return 0, when a context with this name already exists.
-
- @see remote_getContext()
- @see remote_Context
- */
-extern "C" remote_Context * SAL_CALL
-remote_createContext( remote_Connection *pConnection,
- rtl_uString *pIdStr,
- rtl_uString *pDescription,
- rtl_uString *pProtocol,
- remote_InstanceProvider *);
-
-const sal_Int32 REMOTE_CONTEXT_CREATE = 1;
-const sal_Int32 REMOTE_CONTEXT_DESTROY = 2;
-
-typedef void ( SAL_CALL * remote_contextListenerFunc ) (
- void *pThis,
- sal_Int32 nRemoteContextMode,
- rtl_uString *sName,
- rtl_uString *sDescription
- );
-
-/** Registers a listener at the context administration, which allows to keep
- track of existing remote connections.
- @param pObject object which is handed to the listener function, when called.
- */
-extern "C" void SAL_CALL
-remote_addContextListener( remote_contextListenerFunc listener, void *pObject );
-
-
-/** Removes a listener from the context administration.
- */
-extern "C" void SAL_CALL
-remote_removeContextListener( remote_contextListenerFunc listener , void *pObject );
-
-/** Allows to retrieve all existing context strings.
-
- @param pnStringCount out parameter. Contains the number of rtl_uStrings in the array
- @param memAlloc a memory allocation function for the array of pointers to rtl_uStrings
-
- @return array of rtl strings. The caller must call release on all rtl_uString s and must free
- the pointer array.
- */
-extern "C" rtl_uString ** SAL_CALL
-remote_getContextList(
- sal_Int32 *pnStringCount,
- void * ( SAL_CALL * memAlloc ) ( sal_Size nBytesToAlloc ) );
-
-
-struct remote_BridgeImpl;
-
-/** The context structure for a remote bridge.
-
- @see uno_getEnvironment()
- */
-struct remote_Context
-{
- struct uno_Context aBase;
-
- /**
- These methods are implemented by context administration
- */
- void ( SAL_CALL * addDisposingListener ) ( remote_Context *,
- remote_DisposingListener * );
- void ( SAL_CALL * removeDisposingListener ) ( remote_Context *,
- remote_DisposingListener * );
- /**
- will be called by the environment when it gets disposed
- */
- void ( SAL_CALL * dispose ) ( remote_Context * );
-
- /** The method is set by the remote-environment during environment initialization.
- @see remote_getInstanceFunc
- */
- remote_getInstanceFunc getRemoteInstance;
-
- /**
- The protocol, that the environment uses for communicating with the remote process.
- The format of the protocol string is : "protocolname,para1=para1value,..."
- The parameters are protocol dependend
- */
- rtl_uString *m_pProtocol;
-
- /**
- It may be the same as m_pName.
- Livetime is handled by the context administration.
- */
- rtl_uString *m_pDescription;
-
- /**
- The name of this context at context administration.
- A string, that uniquely describes this environment.
- Livetime is handled by the context administration.
- */
- rtl_uString *m_pName;
-
- /** The instance-provider, which is used to look up unknown object identifiers.
- Is usually called on server side, when the first client request comes in.
- Maybe 0. Livetime is handled by the context administration.
- */
- remote_InstanceProvider *m_pInstanceProvider;
-
- /**
- The connection of this context.
- Livetime is handled by the context administration.
- */
- remote_Connection *m_pConnection;
-
- /**
- Here arbitrary data may be stored. It may be used by a connection
- service to store environment specific data. The bridge does not
- use it.
- */
- void *m_pAdditionalInformation;
-
- /**
- here the bridge stores its private per environment data.
- */
- struct remote_BridgeImpl *m_pBridgeImpl;
-};
-
-#endif
-
diff --git a/bridges/inc/bridges/remote/counter.hxx b/bridges/inc/bridges/remote/counter.hxx
deleted file mode 100644
index deead1d2cb1e..000000000000
--- a/bridges/inc/bridges/remote/counter.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _BRIDGES_REMOTE_COUNTER_H_
-#define _BRIDGES_REMOTE_COUNTER_H_
-#include <stdio.h>
-#if OSL_DEBUG_LEVEL > 1
-struct MyCounter
-{
- MyCounter( sal_Char const *pName ) :
- m_nCounter( 0 ),
- m_pName ( pName )
- {
- }
- ~MyCounter()
- {
- if( m_nCounter ) {
- printf(
- "%s : %ld left\n", m_pName,
- sal::static_int_cast< long >(m_nCounter) );
- }
- }
- void acquire()
- { m_nCounter ++; }
- void release()
- { m_nCounter --; }
-
-
- sal_Int32 m_nCounter;
- sal_Char const *m_pName;
-};
-#endif
-
-#endif
diff --git a/bridges/inc/bridges/remote/helper.hxx b/bridges/inc/bridges/remote/helper.hxx
deleted file mode 100644
index 081e47a5c855..000000000000
--- a/bridges/inc/bridges/remote/helper.hxx
+++ /dev/null
@@ -1,68 +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 <bridges/remote/bridgeimpl.hxx>
-
-typedef void ( SAL_CALL * ReleaseRemoteCallbackFunc ) (
- remote_Interface *ppRemoteI,
- rtl_uString *pOid,
- typelib_TypeDescriptionReference *pTypeRef,
- uno_Environment *pEnvRemote
- );
-
-typedef void ( SAL_CALL * remote_createStubFunc ) (
- remote_Interface **ppRemoteI,
- rtl_uString *pOid ,
- typelib_TypeDescriptionReference *pTypeRef,
- uno_Environment *pEnvRemote,
- ReleaseRemoteCallbackFunc callback
- );
-namespace bridges_remote
-{
-
- /** @param callback If the bridge implementation wants to handle the remote release call,
- it can do it giving this callback. If callback == 0, the releaseRemote
- method of the stub is called.
- */
- void SAL_CALL remote_createStub (
- remote_Interface **ppRemoteI,
- rtl_uString *pOid ,
- typelib_TypeDescriptionReference *pType,
- uno_Environment *pEnvRemote,
- ReleaseRemoteCallbackFunc callback );
-
- void SAL_CALL remote_retrieveOidFromProxy(
- remote_Interface *pRemtoeI,
- rtl_uString **ppOid );
-
- void SAL_CALL remote_sendQueryInterface(
- uno_Environment *pEnvRemote,
- remote_Interface **ppRemoteI,
- rtl_uString *pOid ,
- typelib_TypeDescriptionReference *pType,
- uno_Any **ppException
- );
-}
diff --git a/bridges/inc/bridges/remote/mapping.hxx b/bridges/inc/bridges/remote/mapping.hxx
deleted file mode 100644
index 4247c6cc9b65..000000000000
--- a/bridges/inc/bridges/remote/mapping.hxx
+++ /dev/null
@@ -1,69 +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 _BRIDGES_REMOTE_MAPPING_HXX_
-#define _BRIDGES_REMOTE_MAPPING_HXX_
-
-#include <osl/interlck.h>
-#include <rtl/ustring.hxx>
-
-#include <typelib/typedescription.h>
-
-#include <bridges/remote/remote.h>
-
-typedef struct _uno_Environment uno_Environment;
-
-namespace bridges_remote
-{
- extern "C" typedef void SAL_CALL RemoteToUno(
- uno_Mapping *pMapping, void **ppOut, void *pInterface,
- typelib_InterfaceTypeDescription *pInterfaceTypeDescr );
- RemoteToUno remoteToUno;
-
- extern "C" typedef void SAL_CALL UnoToRemote(
- uno_Mapping *pMapping, void **ppOut, void *pInterface,
- typelib_InterfaceTypeDescription *pInterfaceTypeDescr );
- UnoToRemote unoToRemote;
-
- extern "C" typedef void SAL_CALL FreeRemoteMapping(uno_Mapping * mapping);
- FreeRemoteMapping freeRemoteMapping;
-
- class RemoteMapping :
- public remote_Mapping
- {
- public:
- RemoteMapping( uno_Environment *pEnvUno ,
- uno_Environment *pEnvRemote,
- uno_MapInterfaceFunc func ,
- const ::rtl::OUString sPurpose);
- ~RemoteMapping();
-
- oslInterlockedCount m_nRef;
- ::rtl::OUString m_sPurpose;
- };
-
-}
-#endif
diff --git a/bridges/inc/bridges/remote/proxy.hxx b/bridges/inc/bridges/remote/proxy.hxx
deleted file mode 100644
index fd1e919b902a..000000000000
--- a/bridges/inc/bridges/remote/proxy.hxx
+++ /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.
- *
- ************************************************************************/
-#include <osl/interlck.h>
-
-#include <uno/environment.h>
-#include <uno/dispatcher.h>
-#include <uno/mapping.hxx>
-
-#include <bridges/remote/remote.h>
-
-namespace bridges_remote {
-
-extern "C" typedef void SAL_CALL FreeRemote2UnoProxy(
- uno_ExtEnvironment * environment, void * proxy);
-FreeRemote2UnoProxy freeRemote2UnoProxy;
-
-// private:
-extern "C" typedef void SAL_CALL AcquireRemote2UnoProxy(uno_Interface *);
-AcquireRemote2UnoProxy acquireRemote2UnoProxy;
-
-// private:
-extern "C" typedef void SAL_CALL ReleaseRemote2UnoProxy(uno_Interface *);
-ReleaseRemote2UnoProxy releaseRemote2UnoProxy;
-
-// private:
-extern "C" typedef void SAL_CALL DispatchRemote2UnoProxy(
- uno_Interface *, typelib_TypeDescription const *, void *, void **,
- uno_Any **);
-DispatchRemote2UnoProxy dispatchRemote2UnoProxy;
-
-extern "C" void SAL_CALL remote_release( void * );
-
-class Remote2UnoProxy :
- public uno_Interface
-{
-public:
- Remote2UnoProxy(
- remote_Interface *pRemoteI,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pType ,
- uno_Environment *pEnvUno,
- uno_Environment *pEnvRemote
- );
-
- ~Remote2UnoProxy();
-
-private:
- ::rtl::OUString m_sOid;
- typelib_InterfaceTypeDescription *m_pType;
- remote_Interface *m_pRemoteI;
- uno_Environment *m_pEnvUno;
- uno_Environment *m_pEnvRemote;
- ::com::sun::star::uno::Mapping m_mapRemote2Uno;
- ::com::sun::star::uno::Mapping m_mapUno2Remote;
-
- oslInterlockedCount m_nRef;
-
- friend void SAL_CALL acquireRemote2UnoProxy(uno_Interface *);
-
- friend void SAL_CALL releaseRemote2UnoProxy(uno_Interface *);
-
- friend void SAL_CALL dispatchRemote2UnoProxy(
- uno_Interface *, typelib_TypeDescription const *, void *, void **,
- uno_Any **);
-};
-
-}
diff --git a/bridges/inc/bridges/remote/remote.h b/bridges/inc/bridges/remote/remote.h
deleted file mode 100644
index 0cc4071eab8a..000000000000
--- a/bridges/inc/bridges/remote/remote.h
+++ /dev/null
@@ -1,93 +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 _BRIDGES_REMOTE_REMOTE_H
-#define _BRIDGES_REMOTE_REMOTE_H
-#include <uno/mapping.h>
-#include <uno/any2.h>
-
-#include <typelib/typedescription.h>
-#include <uno/environment.h>
-
-#define CORBA_STRING8_NAME "com.sun.star.corba.CorbaString8"
-#define CORBA_STRING8_NAME_LENGTH (sizeof(CORBA_STRING8_NAME)-1)
-
-#define CORBA_UNION_NAME "com.sun.star.corba.CorbaUnion"
-#define CORBA_UNION_NAME_LENGTH (sizeof(CORBA_UNION_NAME)-1)
-
-#define REMOTE_MARSHALED_MSGHDR_SIZE 12
-#define REMOTE_RELEASE_METHOD_INDEX 2
-#define REMOTE_RELEASE_METHOD_NAME "release"
-
-#define CURRENT_IIOP_PROTOCOL_MAJOR 1
-#define CURRENT_IIOP_PROTOCOL_MINOR 2
-
-extern "C" {
-
-struct remote_Interface;
-
-/** @internal
- */
-typedef void (SAL_CALL * remote_DispatchMethod)(
- remote_Interface * pRemoteI, typelib_TypeDescription const * pMemberType,
- void * pReturn, void * pArgs[], uno_Any ** ppException );
-
-/**
- @internal
- */
-typedef void ( SAL_CALL * requestClientSideDispatcher ) (
- uno_Environment *pEnvRemote,
- typelib_TypeDescription const * pMemberType,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pInterfaceType,
- void *pReturn,
- void *ppArgs[],
- uno_Any **ppException );
-
-/** The base class of an UNO interface in a remote environment.
- */
-struct remote_Interface
-{
- void (SAL_CALL * acquire)( remote_Interface * pInterface );
-
- void (SAL_CALL * release)( remote_Interface * pInterface );
-
- remote_DispatchMethod pDispatcher;
-};
-
-/** The mapping between an binary-c-uno and a remote environment.
- @internal
- */
-struct remote_Mapping
-{
- uno_Mapping aBase;
- uno_Environment *pEnvRemote;
- uno_Environment *pEnvUno;
-};
-
-}
-
-#endif
diff --git a/bridges/inc/bridges/remote/remote.hxx b/bridges/inc/bridges/remote/remote.hxx
deleted file mode 100644
index d5e5397e35cd..000000000000
--- a/bridges/inc/bridges/remote/remote.hxx
+++ /dev/null
@@ -1,73 +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 _BRIDGES_REMOTE_REMOTE_HXX_
-#define _BRIDGES_REMOTE_REMOTE_HXX_
-#include <list>
-
-#include <osl/mutex.hxx>
-#include <osl/conditn.h>
-#include <osl/interlck.h>
-
-#include <uno/environment.h>
-
-#include <bridges/remote/remote.h>
-#include <bridges/remote/connection.h>
-
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace bridges_remote {
-
-extern "C" typedef void SAL_CALL AcquireRemote2RemoteStub(
- remote_Interface * pThis);
-AcquireRemote2RemoteStub acquireRemote2RemoteStub;
-
-extern "C" typedef void SAL_CALL FreeRemote2RemoteStub(
- uno_ExtEnvironment * environment, void * stub);
-FreeRemote2RemoteStub freeRemote2RemoteStub;
-
-class Remote2RemoteStub :
- public remote_Interface
-{
-public:
- Remote2RemoteStub(rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pType,
- uno_Environment *pEnvRemote,
- requestClientSideDispatcher dispatch );
- ~Remote2RemoteStub();
-
- void releaseRemote();
-public:
- ::rtl::OUString m_sOid;
- typelib_InterfaceTypeDescription *m_pType;
- oslInterlockedCount m_nRef;
- uno_Environment *m_pEnvRemote;
- requestClientSideDispatcher m_dispatch;
- oslInterlockedCount m_nReleaseRemote;
-};
-
-}
-#endif
diff --git a/bridges/inc/bridges/remote/stub.hxx b/bridges/inc/bridges/remote/stub.hxx
deleted file mode 100644
index 5eb21ff37a10..000000000000
--- a/bridges/inc/bridges/remote/stub.hxx
+++ /dev/null
@@ -1,64 +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 <bridges/remote/remote.hxx>
-
-#include <uno/dispatcher.h>
-#include <uno/mapping.hxx>
-
-namespace bridges_remote {
-
-extern "C" typedef void SAL_CALL AcquireUno2RemoteStub( remote_Interface *pThis );
-AcquireUno2RemoteStub acquireUno2RemoteStub;
-
-extern "C" typedef void SAL_CALL FreeUno2RemoteStub(
- uno_ExtEnvironment * environment, void * stub);
-FreeUno2RemoteStub freeUno2RemoteStub;
-
-class Uno2RemoteStub :
- public remote_Interface
-{
-public:
- Uno2RemoteStub( uno_Interface *pUnoI,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pType,
- uno_Environment *pEnvUno,
- uno_Environment *pEnvRemote );
- ~Uno2RemoteStub();
-
-public:
- ::rtl::OUString m_sOid;
- typelib_InterfaceTypeDescription *m_pType;
- uno_Interface *m_pUnoI;
- oslInterlockedCount m_nRef;
-
- uno_Environment *m_pEnvUno;
- uno_Environment *m_pEnvRemote;
- ::com::sun::star::uno::Mapping m_mapRemote2Uno;
- ::com::sun::star::uno::Mapping m_mapUno2Remote;
-};
-
-}
diff --git a/bridges/inc/pch/precompiled_bridges.hxx b/bridges/inc/pch/precompiled_bridges.hxx
index 33d5e5f8971f..3c52aed395d2 100644
--- a/bridges/inc/pch/precompiled_bridges.hxx
+++ b/bridges/inc/pch/precompiled_bridges.hxx
@@ -38,8 +38,6 @@
#include "com/sun/star/bridge/XBridge.hpp"
#include "com/sun/star/bridge/XBridgeFactory.hpp"
#include "com/sun/star/bridge/XInstanceProvider.hpp"
-#include "com/sun/star/bridge/XProtocolProperties.hdl"
-#include "com/sun/star/bridge/XProtocolProperties.hpp"
#include "com/sun/star/bridge/XUnoUrlResolver.hpp"
#include "com/sun/star/connection/ConnectionSetupException.hpp"
#include "com/sun/star/connection/NoConnectException.hpp"
@@ -49,8 +47,6 @@
#include "com/sun/star/frame/XComponentLoader.hpp"
#include "com/sun/star/io/XInputStream.hpp"
#include "com/sun/star/io/XOutputStream.hpp"
-#include "com/sun/star/lang/DisposedException.hdl"
-#include "com/sun/star/lang/DisposedException.hpp"
#include "com/sun/star/lang/IllegalArgumentException.hpp"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/lang/XComponent.hpp"
diff --git a/bridges/prj/build.lst b/bridges/prj/build.lst
index 0e7979742562..d6e6d864db04 100644
--- a/bridges/prj/build.lst
+++ b/bridges/prj/build.lst
@@ -2,9 +2,6 @@ br bridges : cppuhelper jurt jvmaccess salhelper NULL
br bridges usr1 - all br_mkout NULL
br bridges\inc nmake - all br_inc NULL
br bridges\unotypes nmake - all br_unotypes NULL
-br bridges\source\remote\static nmake - all br_rem_static br_unotypes br_inc NULL
-br bridges\source\remote\urp nmake - all br_rem_urp br_rem_static br_inc NULL
-br bridges\source\remote\context nmake - all br_rcon br_unotypes br_inc NULL
br bridges\source\cpp_uno\mingw_intel nmake - w br_gcc3i br_cppuno_shared br_unotypes br_inc NULL
br bridges\source\cpp_uno\msvc_win32_intel nmake - w br_msci br_cppuno_shared br_unotypes br_inc NULL
br bridges\source\cpp_uno\gcc3_linux_intel nmake - u br_gcc3li br_cppuno_shared br_unotypes br_inc NULL
diff --git a/bridges/prj/d.lst b/bridges/prj/d.lst
index 0b3dd93370d4..1ca453a83c1d 100644
--- a/bridges/prj/d.lst
+++ b/bridges/prj/d.lst
@@ -1,16 +1,3 @@
-mkdir: %_DEST%\inc%_EXT%\bridges
-mkdir: %_DEST%\inc%_EXT%\bridges\remote
-
-..\inc\bridges\remote\connection.h %_DEST%\inc%_EXT%\bridges\remote\connection.h
-..\inc\bridges\remote\context.h %_DEST%\inc%_EXT%\bridges\remote\context.h
-..\inc\bridges\remote\remote.h %_DEST%\inc%_EXT%\bridges\remote\remote.h
-
-..\%__SRC%\lib\irmcxt* %_DEST%\lib%_EXT%\*
-..\%__SRC%\lib\librmcxt.*.* %_DEST%\lib%_EXT%\*
-..\%__SRC%\bin\rmcxt*.dll %_DEST%\bin%_EXT%\*
-
-..\%__SRC%\lib\liburp_uno* %_DEST%\lib%_EXT%\liburp_uno*
-..\%__SRC%\bin\urp_uno* %_DEST%\bin%_EXT%\urp_uno*
..\%__SRC%\lib\libjava_uno* %_DEST%\lib%_EXT%\libjava_uno*
..\%__SRC%\bin\java_uno* %_DEST%\bin%_EXT%\java_uno*
..\%__SRC%\class\java_uno*.jar %_DEST%\bin%_EXT%\java_uno*.jar
@@ -21,8 +8,3 @@ mkdir: %_DEST%\inc%_EXT%\bridges\remote
..\%__SRC%\lib\libgcc3_uno.* %_DEST%\lib%_EXT%\libgcc3_uno.*
..\%__SRC%\bin\gcc3_uno.* %_DEST%\bin%_EXT%\gcc3_uno.*
..\%__SRC%\lib\libsunpro5_uno.* %_DEST%\lib%_EXT%\libsunpro5_uno.*
-
-..\%__SRC%\lib\rmcxt3.lib %_DEST%\lib%_EXT%\rmcxt.lib
-
-
-linklib: librmcxt.*.*
diff --git a/bridges/source/remote/context/context.cxx b/bridges/source/remote/context/context.cxx
deleted file mode 100644
index 7a2f3e6e6f66..000000000000
--- a/bridges/source/remote/context/context.cxx
+++ /dev/null
@@ -1,484 +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_bridges.hxx"
-#include <stdio.h>
-#include <string.h>
-#include <list>
-#include <hash_map>
-#include <utility>
-
-#include <osl/diagnose.h>
-#include <osl/interlck.h>
-#include <osl/mutex.hxx>
-
-#include "rtl/ustring.hxx"
-#include "rtl/instance.hxx"
-
-#include <bridges/remote/context.h>
-#include <bridges/remote/remote.h>
-#include <bridges/remote/connection.h>
-#include <bridges/remote/counter.hxx>
-
-using namespace ::std;
-using namespace ::osl;
-using namespace ::rtl;
-
-namespace {
-
-extern "C" typedef void * (SAL_CALL * MemAlloc)(sal_Size);
-
-}
-
-namespace remote_context
-{
-
-class remote_ContextImpl :
- public remote_Context
-{
-public:
- remote_ContextImpl( remote_Connection *pConnection,
- rtl_uString *pIdStr,
- rtl_uString *pDescription,
- rtl_uString *pProtocol,
- remote_InstanceProvider *pProvider );
- ~remote_ContextImpl();
-
- static void SAL_CALL thisAcquire( uno_Context * );
- static void SAL_CALL thisRelease( uno_Context * );
- static void * SAL_CALL thisQuery( uno_Context * , rtl_uString * );
- static void SAL_CALL thisAddDisposingListener( remote_Context * , remote_DisposingListener * );
- static void SAL_CALL thisRemoveDisposingListener( remote_Context *, remote_DisposingListener *);
- static void SAL_CALL thisDispose( remote_Context *);
-public:
- oslInterlockedCount m_nRef;
- sal_Bool m_bDisposed;
- list < remote_DisposingListener * > m_lstListener;
- Mutex m_mutex;
-};
-
-
-
-
-struct equalOUString_Impl
-{
- sal_Bool operator()(const OUString & s1, const OUString & s2) const
- { return s1 == s2; }
-};
-
-struct hashOUString_Impl
-{
- size_t operator()(const OUString & rName) const
- { return rName.hashCode(); }
-};
-
-typedef hash_map
-<
- OUString,
- void *,
- hashOUString_Impl,
- equalOUString_Impl
->
-ContextMap;
-
-#if OSL_DEBUG_LEVEL > 1
-static MyCounter thisCounter( "DEBUG : Context" );
-#endif
-
-class ContextAdmin
-{
-public:
- // listener administration
- void addContextListener( remote_contextListenerFunc listener , void *pObject );
- void removeContextListener( remote_contextListenerFunc listener , void *pObject );
-
- void fire( sal_Int32 nRemoteContextMode,
- rtl_uString *sName,
- rtl_uString *sDescription );
-
- // context administration
- uno_Context *createAndRegisterContext(
- remote_Connection *pConnection,
- rtl_uString *pIdStr,
- rtl_uString *pDescription,
- rtl_uString *pProtocol,
- remote_InstanceProvider *pInstanceProvider );
-
- void revokeContext( uno_Context *pRemoteContext );
-
- uno_Context *getContext( rtl_uString *pHost );
-
- rtl_uString ** getConnectionList(
- sal_Int32 *pnStringCount, MemAlloc memAlloc );
-
-private:
- ::osl::Mutex m_mutex;
-
- ContextMap m_mapContext;
-
- typedef std::list< std::pair< remote_contextListenerFunc, void * > > List;
- List m_lstListener;
-};
-
-void ContextAdmin::addContextListener( remote_contextListenerFunc listener , void *pObject )
-{
- ::osl::MutexGuard guard( m_mutex );
-
- m_lstListener.push_back( std::make_pair( listener, pObject ) );
-}
-
-void ContextAdmin::removeContextListener( remote_contextListenerFunc listener , void *pObject )
-{
- ::osl::MutexGuard guard( m_mutex );
-
- for (List::iterator ii(m_lstListener.begin()); ii != m_lstListener.end();
- ++ii)
- {
- if (ii->first == listener && ii->second == pObject) {
- m_lstListener.erase( ii );
- break;
- }
- }
-}
-
-void ContextAdmin::fire(
- sal_Int32 nRemoteContextMode,
- rtl_uString *pName,
- rtl_uString *sDescription )
-{
- List lst;
- {
- ::osl::MutexGuard guard( m_mutex );
- lst = m_lstListener;
- }
- for (List::iterator i(lst.begin()); i != lst.end(); ++i) {
- (i->first)(i->second, nRemoteContextMode, pName, sDescription);
- }
-}
-
-uno_Context *ContextAdmin::createAndRegisterContext( remote_Connection *pConnection,
- rtl_uString *pIdStr,
- rtl_uString *pDescription,
- rtl_uString *pProtocol,
- remote_InstanceProvider *pInstanceProvider )
-{
- ::osl::MutexGuard guard( m_mutex );
-
- uno_Context *pContext = getContext( pIdStr );
- if( pContext )
- {
- pContext->release( pContext );
- return 0;
- }
-
- remote_ContextImpl *p = new remote_ContextImpl( pConnection,
- pIdStr,
- pDescription,
- pProtocol,
- pInstanceProvider );
-
- p->aBase.acquire( (uno_Context*) p );
-
- m_mapContext[ OUString( pIdStr) ] = (void*) p;
-
- fire( REMOTE_CONTEXT_CREATE , pIdStr , pDescription );
- return ( uno_Context * )p;
-}
-
-
-void ContextAdmin::revokeContext( uno_Context *pRemoteContext )
-{
- ::osl::MutexGuard guard( m_mutex );
-
- remote_ContextImpl *p = ( remote_ContextImpl * ) pRemoteContext;
-
- ContextMap::iterator ii = m_mapContext.find( p->m_pName );
- OSL_ASSERT( ii != m_mapContext.end() );
- m_mapContext.erase( ii );
-
- fire( REMOTE_CONTEXT_DESTROY , p->m_pName , p->m_pDescription );
-
-}
-
-uno_Context *ContextAdmin::getContext( rtl_uString *pHost )
-{
- ::osl::MutexGuard guard( m_mutex );
-
- ContextMap::iterator ii = m_mapContext.find( OUString( (rtl_uString*)pHost ) );
- if( ii == m_mapContext.end() )
- {
- return 0;
- }
-
- uno_Context *p = ( uno_Context * ) (*ii).second;
- p->acquire( p );
- return p;
-}
-
-
-rtl_uString ** ContextAdmin::getConnectionList(
- sal_Int32 *pnStringCount, MemAlloc memAlloc )
-{
- ::osl::MutexGuard guard( m_mutex );
-
- *pnStringCount = m_mapContext.size();
-
- if (*pnStringCount == 0)
- return NULL;
-
- rtl_uString **ppReturn = ( rtl_uString ** )
- memAlloc( sizeof( rtl_uString * ) * m_mapContext.size() );
- memset( ppReturn , 0 , sizeof( rtl_uString * ) * m_mapContext.size() );
-
- sal_Int32 i = 0;
- for( ContextMap::iterator ii = m_mapContext.begin() ;
- ii != m_mapContext.end();
- ++ii, i++ )
- {
- rtl_uString_assign( &( ppReturn[i] ), (*ii).first.pData );
- }
-
- return ppReturn;
-}
-
-
-struct theContextAdmin : public rtl::Static<ContextAdmin, theContextAdmin> {};
-
-/*****************************
- * remote_ContextImpl implementation
- ****************************/
-
-
-
-remote_ContextImpl::remote_ContextImpl( remote_Connection *pConnection ,
- rtl_uString *pIdStr,
- rtl_uString *pDescription,
- rtl_uString *pProtocol,
- remote_InstanceProvider *pProvider ) :
- m_nRef( 0 ),
- m_bDisposed( sal_False )
-{
- m_pConnection = pConnection;
- m_pConnection->acquire( m_pConnection );
-
- m_pInstanceProvider = pProvider;
- if( m_pInstanceProvider )
- {
- m_pInstanceProvider->acquire( pProvider );
- }
-
- m_pName = pIdStr;
- rtl_uString_acquire( m_pName );
-
- m_pDescription = pDescription;
- rtl_uString_acquire( m_pDescription );
-
- m_pProtocol = pProtocol;
- rtl_uString_acquire( pProtocol );
-
- aBase.acquire = thisAcquire;
- aBase.release = thisRelease;
- addDisposingListener = thisAddDisposingListener;
- removeDisposingListener = thisRemoveDisposingListener;
- dispose = thisDispose;
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.acquire();
-#endif
-}
-
-remote_ContextImpl::~remote_ContextImpl()
-{
- // disposed must have been called
- OSL_ASSERT( m_bDisposed );
-
- rtl_uString_release( m_pName );
- rtl_uString_release( m_pDescription );
- rtl_uString_release( m_pProtocol );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.release();
-#endif
-
-}
-
-
-void remote_ContextImpl::thisAddDisposingListener( remote_Context *pRemoteC ,
- remote_DisposingListener *pListener )
-{
- remote_ContextImpl *pImpl = (remote_ContextImpl * ) pRemoteC;
-
- ::osl::MutexGuard guard( pImpl->m_mutex );
-
- pListener->acquire( pListener );
- pImpl->m_lstListener.push_back( pListener );
-}
-
-void remote_ContextImpl::thisRemoveDisposingListener( remote_Context *pRemoteC,
- remote_DisposingListener *pListener)
-{
- remote_ContextImpl *pImpl = (remote_ContextImpl * ) pRemoteC;
- MutexGuard guard( pImpl->m_mutex );
-
- for( list< remote_DisposingListener * >::iterator ii = pImpl->m_lstListener.begin() ;
- ii != pImpl->m_lstListener.end();
- ++ii )
- {
- if( (*ii) == pListener )
- {
- pImpl->m_lstListener.erase( ii );
- pListener->release( pListener );
- break;
- }
- }
-}
-
-void remote_ContextImpl::thisDispose( remote_Context *pRemoteC )
-{
- remote_ContextImpl *pImpl = ( remote_ContextImpl * )pRemoteC;
-
- MutexGuard guard( pImpl->m_mutex );
- if( ! pImpl->m_bDisposed )
- {
- pImpl->m_bDisposed = sal_True;
- theContextAdmin::get().revokeContext( (uno_Context * ) pRemoteC );
-
- if( pImpl->m_pInstanceProvider )
- {
- pImpl->m_pInstanceProvider->release( pImpl->m_pInstanceProvider );
- pImpl->m_pInstanceProvider = 0;
- }
-
- pImpl->m_pConnection->release( pImpl->m_pConnection );
- pImpl->m_pConnection = 0;
-
- list< remote_DisposingListener * > lst = pImpl->m_lstListener;
- pImpl->m_lstListener.clear();
-
- for( list < remote_DisposingListener * >::iterator ii = lst.begin();
- ii != lst.end();
- ++ii )
- {
- (*ii)->disposing( (*ii) , pImpl->m_pName );
- (*ii)->release( (*ii) );
- }
-
- }
-}
-
-
-
-void remote_ContextImpl::thisAcquire( uno_Context *pRemoteC )
-{
- remote_ContextImpl *p = SAL_REINTERPRET_CAST(remote_ContextImpl * ,pRemoteC );
- osl_incrementInterlockedCount( &(p->m_nRef) );
-}
-
-void remote_ContextImpl::thisRelease( uno_Context *pRemoteC )
-{
- remote_ContextImpl *p = SAL_REINTERPRET_CAST( remote_ContextImpl * , pRemoteC );
- if (! osl_decrementInterlockedCount( &(p->m_nRef) ))
- {
- // enshure, that this piece of code is not reentered
- osl_incrementInterlockedCount( &(p->m_nRef) );
-
- // dispose, if necessary
- p->dispose( p );
-
- // restore the counter
- osl_decrementInterlockedCount( &(p->m_nRef) );
-
- if( 0 == p->m_nRef )
- {
- delete p;
- }
- else
- {
- // reanimated, but disposed !
- }
- }
-}
-
-void *remote_ContextImpl::thisQuery( uno_Context * , rtl_uString * )
-{
- return 0;
-}
-
-
-} // end namespace remote_context
-
-
-using namespace remote_context;
-
-//-----------------------
-//
-// C-Interface
-//
-//-----------------------
-extern "C" remote_Context * SAL_CALL
-remote_getContext( rtl_uString *pIdString )
-{
- return (remote_Context *) theContextAdmin::get().getContext(pIdString);
-}
-
-
-
-extern "C" remote_Context * SAL_CALL
-remote_createContext( remote_Connection *pConnection,
- rtl_uString *pIdStr,
- rtl_uString *pDescription,
- rtl_uString *pProtocol,
- remote_InstanceProvider *pProvider )
-{
- remote_ContextImpl *p = (remote_ContextImpl * )
- theContextAdmin::get().createAndRegisterContext(
- pConnection ,
- pIdStr ,
- pDescription,
- pProtocol,
- pProvider );
-
- return (remote_Context * )p;
-}
-
-
-extern "C" void SAL_CALL
-remote_addContextListener( remote_contextListenerFunc listener, void *pObject )
-{
- theContextAdmin::get().addContextListener( listener , pObject );
-}
-
-extern "C" void SAL_CALL
-remote_removeContextListener( remote_contextListenerFunc listener , void *pObject )
-{
- theContextAdmin::get().removeContextListener( listener , pObject );
-}
-
-extern "C" rtl_uString ** SAL_CALL
-remote_getContextList( sal_Int32 *pnStringCount, MemAlloc memAlloc )
-{
- return theContextAdmin::get().getConnectionList( pnStringCount , memAlloc );
-}
diff --git a/bridges/source/remote/context/exports.dxp b/bridges/source/remote/context/exports.dxp
deleted file mode 100644
index dcef3c369b10..000000000000
--- a/bridges/source/remote/context/exports.dxp
+++ /dev/null
@@ -1,5 +0,0 @@
-remote_getContext
-remote_createContext
-remote_getContextList
-remote_removeContextListener
-remote_addContextListener \ No newline at end of file
diff --git a/bridges/source/remote/context/rmcxt.map b/bridges/source/remote/context/rmcxt.map
deleted file mode 100755
index 182f6495ea9d..000000000000
--- a/bridges/source/remote/context/rmcxt.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- remote_getContext;
- remote_createContext;
- remote_getContextList;
- remote_removeContextListener;
- remote_addContextListener;
- local:
- *;
-};
diff --git a/bridges/source/remote/idl/corba.idl b/bridges/source/remote/idl/corba.idl
deleted file mode 100644
index b71d16e2eff1..000000000000
--- a/bridges/source/remote/idl/corba.idl
+++ /dev/null
@@ -1,88 +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.
- *
- ************************************************************************/
-module com
-{
-module sun
-{
-module star
-{
-
-module corba
-{
-
- // CosBridging module
- typedef unsigned long ObjectSystemID;
- typedef sequence< byte > OpaqueData;
-
- struct OneThreadID
- {
- ObjectSystemID objSysID;
- OpaqueData threadID;
- };
-
- typedef sequence<OneThreadID> ThreadIDs;
-
- struct LogicalThreadID // Service context
- {
- ThreadIDs IDs;
- };
-
- struct CorbaString8
- {
- string theString;
- };
-
- struct CorbaUnion
- {
- long dummy;
- };
-
- struct ObjectKey
- {
- CorbaString8 sOid;
- CorbaString8 sType;
- };
-
- enum TCKind
- {
- tk_null, tk_void,
- tk_short, tk_long, tk_ushort, tk_ulong,
- tk_float, tk_double, tk_boolean, tk_char,
- tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref,
- tk_struct, tk_union, tk_enum, tk_string,
- tk_sequence, tk_array, tk_alias, tk_except,
- tk_longlong, tk_ulonglong, tk_longdouble,
- tk_wchar, tk_wstring, tk_fixed,
- tk_value, tk_value_box,
- tk_native,
- tk_abstract_interface
- };
-};
-
-};
-};
-};
diff --git a/bridges/source/remote/static/helper.cxx b/bridges/source/remote/static/helper.cxx
deleted file mode 100644
index 1ad421cedecc..000000000000
--- a/bridges/source/remote/static/helper.cxx
+++ /dev/null
@@ -1,209 +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_bridges.hxx"
-#include <rtl/alloc.h>
-#include <osl/diagnose.h>
-
-#include <bridges/remote/helper.hxx>
-
-#include <bridges/remote/stub.hxx>
-#include <bridges/remote/proxy.hxx>
-#include <bridges/remote/remote.hxx>
-
-#include <com/sun/star/uno/Sequence.hxx>
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-namespace bridges_remote
-{
-
-void SAL_CALL remote_createStub (
- remote_Interface **ppRemoteI,
- rtl_uString *pOid ,
- typelib_TypeDescriptionReference *pTypeRef,
- uno_Environment *pEnvRemote,
- ReleaseRemoteCallbackFunc releaseRemoteCallback )
-{
- typelib_TypeDescription *pType = 0;
- typelib_typedescriptionreference_getDescription( &pType, pTypeRef );
-
- (void) pEnvRemote->pExtEnv->getRegisteredInterface(
- pEnvRemote->pExtEnv,
- (void **)ppRemoteI,
- pOid,
- (typelib_InterfaceTypeDescription* )pType );
-
- if( *ppRemoteI )
- {
- if( (*ppRemoteI)->acquire == acquireRemote2RemoteStub ) {
-
- if( releaseRemoteCallback )
- {
- // use the callback handler, the bridge wants to send the call immeadiatly
- releaseRemoteCallback( *ppRemoteI , pOid, pTypeRef , pEnvRemote );
- }
- else
- {
- ((::bridges_remote::Remote2RemoteStub *)*ppRemoteI)->releaseRemote();
- }
- }
- else
- {
- // Uno2RemoteStub
- // no release necessary
- }
- }
- else
- {
- remote_BridgeImpl *pImpl = ((remote_Context *)pEnvRemote->pContext)->m_pBridgeImpl;
- *ppRemoteI =
- new ::bridges_remote::Remote2RemoteStub(
- pOid,
- (typelib_InterfaceTypeDescription * ) pType,
- pEnvRemote,
- pImpl->m_sendRequest);
-
- // ppRemoteI may change during registration
- pEnvRemote->pExtEnv->registerProxyInterface(
- pEnvRemote->pExtEnv,
- (void **) ppRemoteI,
- freeRemote2RemoteStub,
- pOid,
- (typelib_InterfaceTypeDescription * ) pType );
- }
-
- typelib_typedescription_release( pType );
-}
-
-void SAL_CALL remote_sendQueryInterface(
- uno_Environment *pEnvRemote,
- remote_Interface **ppRemoteI,
- rtl_uString *pOid ,
- typelib_TypeDescriptionReference *pTypeRef,
- uno_Any **ppException
- )
-{
- OSL_ASSERT( ppRemoteI );
-
- typelib_InterfaceTypeDescription *pType = 0;
- typelib_typedescriptionreference_getDescription( (typelib_TypeDescription ** )&pType, pTypeRef );
-
- if( *ppRemoteI )
- {
- (*ppRemoteI)->release( *ppRemoteI );
- (*ppRemoteI) = 0;
- }
-
- remote_BridgeImpl *pImpl = ((remote_Context *)pEnvRemote->pContext)->m_pBridgeImpl;
-
- Type type = ::getCppuType( (Reference < XInterface > *)0 );
-
- // get type for queryInterface
- OUString sCompleteMethodName = type.getTypeName();
- sCompleteMethodName += OUString::createFromAscii("::queryInterface");
-
- typelib_InterfaceMemberTypeDescription *pMemberType = 0;
- typelib_typedescription_getByName(
- (typelib_TypeDescription **) &pMemberType,
- sCompleteMethodName.pData );
-
- OSL_ASSERT( pMemberType );
-
- uno_Any anyInterface;
- anyInterface.pType = 0;
- anyInterface.pData = 0;
-
- void *pReturn = &anyInterface;
- void *ppArgs[1];
-
- ppArgs[0] = 0;
- typelib_TypeDescriptionReference *pRef = 0;
- typelib_typedescriptionreference_new( &pRef ,
- pType->aBase.eTypeClass,
- pType->aBase.pTypeName);
-
- ppArgs[0] = &pRef;
-
-// uno_Any anyException;
-// uno_Any *pAnyException = &anyException;
-
- // do the queryInterface
- pImpl->m_sendRequest(
- pEnvRemote,
- (typelib_TypeDescription * ) pMemberType,
- pOid,
- pType,
- pReturn,
- ppArgs,
- ppException );
-
-
- // now release everything
- typelib_typedescriptionreference_release( pRef );
- typelib_typedescription_release( (typelib_TypeDescription * ) pMemberType );
-
- if( *ppException )
- {
- *ppRemoteI = 0;
- }
- else
- {
- // set out parameter
- if( typelib_TypeClass_INTERFACE == anyInterface.pType->eTypeClass )
- {
- *ppRemoteI = ( remote_Interface * ) anyInterface.pReserved;
- }
- typelib_typedescriptionreference_release( anyInterface.pType );
- }
-
- typelib_typedescription_release( (typelib_TypeDescription * ) pType );
-}
-
-
-void SAL_CALL remote_retrieveOidFromProxy(
- remote_Interface *pRemoteI,
- rtl_uString **ppOid )
-{
- if( pRemoteI->acquire == acquireRemote2RemoteStub )
- {
- // Remote2RemoteStub
- ::bridges_remote::Remote2RemoteStub *pStub = (::bridges_remote::Remote2RemoteStub * ) pRemoteI;
- rtl_uString_newFromString( ppOid , pStub->m_sOid.pData );
- }
- else
- {
- // Uno2RemoteStub
- ::bridges_remote::Uno2RemoteStub *pStub = (::bridges_remote::Uno2RemoteStub * ) pRemoteI;
- rtl_uString_newFromString( ppOid , pStub->m_sOid.pData );
- pRemoteI->acquire( pRemoteI );
- }
-}
-
-}
diff --git a/bridges/source/remote/static/mapping.cxx b/bridges/source/remote/static/mapping.cxx
deleted file mode 100644
index 69e079d14eaf..000000000000
--- a/bridges/source/remote/static/mapping.cxx
+++ /dev/null
@@ -1,218 +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_bridges.hxx"
-#include <osl/diagnose.h>
-
-#include <bridges/remote/proxy.hxx>
-#include <bridges/remote/stub.hxx>
-#include <bridges/remote/counter.hxx>
-#include <bridges/remote/mapping.hxx>
-
-using namespace bridges_remote;
-
-extern "C" {
-
-static void SAL_CALL thisAcquire( uno_Mapping *pMap )
-{
- RemoteMapping *p = SAL_REINTERPRET_CAST( RemoteMapping * , pMap );
- if( 1 == osl_incrementInterlockedCount( &(p->m_nRef) ) )
- {
- if( remoteToUno == pMap->mapInterface )
- {
- uno_registerMapping( &pMap ,
- freeRemoteMapping,
- p->pEnvRemote ,
- p->pEnvUno ,
- p->m_sPurpose.pData );
- }
- else
- {
- uno_registerMapping( &pMap ,
- freeRemoteMapping,
- p->pEnvUno ,
- p->pEnvRemote ,
- p->m_sPurpose.pData );
- }
-
- }
-}
-
-static void SAL_CALL thisRelease( uno_Mapping *pMap )
-{
- RemoteMapping *p = SAL_REINTERPRET_CAST( RemoteMapping * , pMap );
- if (! osl_decrementInterlockedCount( &(p->m_nRef) ))
- {
- uno_revokeMapping( pMap );
- }
-}
-
-}
-
-namespace bridges_remote {
-
-void remoteToUno( uno_Mapping *pMapping, void **ppUnoI, void *pRemoteI,
- typelib_InterfaceTypeDescription *pTypeDescr )
-{
- remote_Mapping *pRemoteMapping = ( remote_Mapping * ) pMapping;
-
- OSL_ASSERT( ppUnoI && pTypeDescr );
- if (*ppUnoI)
- {
- ((uno_Interface *)*ppUnoI)->release( (uno_Interface *)*ppUnoI );
- *ppUnoI = 0;
- }
-
- if (pRemoteI && pTypeDescr)
- {
- // get object id of interface to be wrapped
- rtl_uString * pOid = 0;
- pRemoteMapping->pEnvRemote->pExtEnv->getObjectIdentifier(
- pRemoteMapping->pEnvRemote->pExtEnv,
- &pOid,
- pRemoteI );
-
- OSL_ASSERT(pOid);
- if( ! pOid )
- {
- return;
- }
-
- // try to get any known interface from target environment
- pRemoteMapping->pEnvUno->pExtEnv->getRegisteredInterface(
- pRemoteMapping->pEnvUno->pExtEnv,
- ppUnoI,
- pOid,
- pTypeDescr);
-
- if ( ! *ppUnoI) // already existing interface
- {
- // try to publish a new proxy; proxy may be exchanged during registration
- *ppUnoI = new Remote2UnoProxy(
- ( remote_Interface * ) pRemoteI,
- pOid,
- pTypeDescr ,
- pRemoteMapping->pEnvUno,
- pRemoteMapping->pEnvRemote);
-
- pRemoteMapping->pEnvUno->pExtEnv->registerProxyInterface(
- pRemoteMapping->pEnvUno->pExtEnv,
- ppUnoI,
- freeRemote2UnoProxy,
- pOid,
- pTypeDescr );
-
- OSL_ASSERT( *ppUnoI );
- }
- rtl_uString_release( pOid );
- }
-}
-
-void unoToRemote( uno_Mapping *pMapping, void **ppRemoteI, void *pUnoI,
- typelib_InterfaceTypeDescription *pTypeDescr )
-{
- remote_Mapping *pRemoteMapping = ( remote_Mapping * ) pMapping;
- OSL_ASSERT( ppRemoteI && pTypeDescr );
- if (*ppRemoteI)
- {
- ((remote_Interface *)*ppRemoteI)->release( (remote_Interface *)*ppRemoteI);
- *ppRemoteI = 0;
- }
- if (pUnoI && pTypeDescr)
- {
- // get object id of interface to be wrapped
- rtl_uString * pOid = 0;
- pRemoteMapping->pEnvUno->pExtEnv->getObjectIdentifier(
- pRemoteMapping->pEnvUno->pExtEnv,
- &pOid,
- pUnoI );
-
- OSL_ASSERT( pOid );
- if( ! pOid )
- {
- return;
- }
-
- pRemoteMapping->pEnvRemote->pExtEnv->getRegisteredInterface(
- pRemoteMapping->pEnvRemote->pExtEnv,
- (void**)ppRemoteI,
- pOid,
- pTypeDescr );
-
- if( !*ppRemoteI )
- {
- // try to publish a new proxy;
- *ppRemoteI = new Uno2RemoteStub(
- ( uno_Interface * ) pUnoI,
- pOid,
- pTypeDescr,
- pRemoteMapping->pEnvUno,
- pRemoteMapping->pEnvRemote );
-
- // note : ppRemoteI may change during registration
- pRemoteMapping->pEnvRemote->pExtEnv->registerProxyInterface(
- pRemoteMapping->pEnvRemote->pExtEnv,
- (void**) ppRemoteI,
- freeUno2RemoteStub,
- pOid,
- pTypeDescr );
- }
-
- rtl_uString_release( pOid );
- }
-}
-
-void freeRemoteMapping(uno_Mapping * mapping) {
- delete reinterpret_cast< RemoteMapping * >(mapping);
-}
-
-RemoteMapping::RemoteMapping( uno_Environment *pEnvUno_ ,
- uno_Environment *pEnvRemote_,
- uno_MapInterfaceFunc func,
- const ::rtl::OUString sPurpose) :
- m_nRef( 1 ),
- m_sPurpose( sPurpose )
-{
- pEnvUno = pEnvUno_;
- pEnvRemote = pEnvRemote_;
-
- pEnvUno->acquire( pEnvUno );
- pEnvRemote->acquire( pEnvRemote );
-
- aBase.mapInterface = func;
- aBase.acquire = thisAcquire;
- aBase.release = thisRelease;
-}
-
-RemoteMapping::~RemoteMapping( )
-{
- pEnvUno->release( pEnvUno );
- pEnvRemote->release( pEnvRemote );
-}
-
-}
diff --git a/bridges/source/remote/static/proxy.cxx b/bridges/source/remote/static/proxy.cxx
deleted file mode 100644
index da67e9bd17ec..000000000000
--- a/bridges/source/remote/static/proxy.cxx
+++ /dev/null
@@ -1,338 +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_bridges.hxx"
-#include <sal/alloca.h>
-#include <bridges/remote/proxy.hxx>
-#include <bridges/remote/context.h>
-
-#include <uno/data.h>
-#include <uno/mapping.hxx>
-#include <uno/environment.h>
-
-#include <com/sun/star/uno/Any.hxx>
-
-#include <bridges/remote/bridgeimpl.hxx>
-
-#include "remote_types.hxx"
-
-#if OSL_DEBUG_LEVEL > 1
-#include <bridges/remote/counter.hxx>
-static MyCounter thisCounter( "DEBUG : Remote2UnoProxy");
-#endif
-
-using namespace ::bridges_remote;
-using namespace ::com::sun::star::uno;
-
-extern "C" {
-
-void SAL_CALL remote_release( void *pRemoteI )
-{
- ((remote_Interface * )pRemoteI)->release( (remote_Interface * ) pRemoteI );
-}
-
-}
-
-namespace bridges_remote {
-
-void freeRemote2UnoProxy(uno_ExtEnvironment *, void * proxy) {
- delete static_cast< Remote2UnoProxy * >(proxy);
-}
-
-void acquireRemote2UnoProxy( uno_Interface *pThis )
-{
- Remote2UnoProxy *p = ( Remote2UnoProxy * ) pThis;
- if( 1 == osl_incrementInterlockedCount( &(p->m_nRef) ) )
- {
- p->m_pEnvUno->pExtEnv->registerProxyInterface(
- p->m_pEnvUno->pExtEnv,
- (void**)&pThis,
- freeRemote2UnoProxy,
- p->m_sOid.pData,
- p->m_pType );
- OSL_ASSERT( (uno_Interface *)p == pThis );
- }
-}
-
-void releaseRemote2UnoProxy( uno_Interface *pThis )
-{
- Remote2UnoProxy *p = ( Remote2UnoProxy * ) pThis;
- if ( 0 == osl_decrementInterlockedCount( &(p->m_nRef) ))
- {
- p->m_pEnvUno->pExtEnv->revokeInterface( p->m_pEnvUno->pExtEnv, p );
- }
-}
-
-void SAL_CALL dispatchRemote2UnoProxy(
- uno_Interface * pUnoI,
- typelib_TypeDescription const * pType,
- void * pReturn,
- void * ppArgs[],
- uno_Any ** ppException )
-{
- Remote2UnoProxy *p = ( Remote2UnoProxy * ) pUnoI;
- RemoteThreadCounter counter( p->m_pEnvRemote );
-
- typelib_InterfaceMethodTypeDescription *pMethodType = 0;
- typelib_InterfaceAttributeTypeDescription *pAttributeType = 0;
- typelib_TypeDescription *pReturnType = 0;
- typelib_TypeDescription **ppArgType = 0;
- sal_Int32 nArgCount = 0;
- sal_Bool *pbIsIn = 0;
- sal_Bool *pbIsOut = 0;
- sal_Bool *pbConversionNeeded = 0;
- sal_Bool bConversionNeededForReturn = 0;
-
- //--------------------------------
- // Collect all needed types !
- //--------------------------------
- if( typelib_TypeClass_INTERFACE_ATTRIBUTE == pType->eTypeClass )
- {
- pAttributeType = ( typelib_InterfaceAttributeTypeDescription * ) pType;
- if( pReturn )
- {
- TYPELIB_DANGER_GET( &pReturnType , pAttributeType->pAttributeTypeRef );
- bConversionNeededForReturn = remote_relatesToInterface( pReturnType );
- }
- else
- {
- nArgCount = 1;
- ppArgType = (typelib_TypeDescription **) alloca( sizeof( void * ) );
- pbIsIn = ( sal_Bool * ) alloca( sizeof( sal_Bool ) );
- pbIsOut = ( sal_Bool * ) alloca( sizeof( sal_Bool ) );
- pbConversionNeeded = ( sal_Bool *) alloca( sizeof( sal_Bool ) );
-
- pbIsIn[0] = sal_True;
- pbIsOut[0] = sal_False;
- ppArgType[0] = 0;
- TYPELIB_DANGER_GET( &( ppArgType[0] ) , pAttributeType->pAttributeTypeRef );
- pbConversionNeeded[0] = remote_relatesToInterface( ppArgType[0] );
-
- }
- }
- if( typelib_TypeClass_INTERFACE_METHOD == pType->eTypeClass )
- {
- pMethodType = ( typelib_InterfaceMethodTypeDescription * ) pType;
- TYPELIB_DANGER_GET( &pReturnType , pMethodType->pReturnTypeRef );
- bConversionNeededForReturn = remote_relatesToInterface( pReturnType );
- nArgCount = pMethodType->nParams;
- ppArgType = (typelib_TypeDescription **) alloca( sizeof( void * ) * nArgCount );
- pbIsIn = (sal_Bool * ) alloca( sizeof( sal_Bool ) * nArgCount );
- pbIsOut = (sal_Bool * ) alloca( sizeof( sal_Bool ) * nArgCount );
- pbConversionNeeded = ( sal_Bool *) alloca( sizeof( sal_Bool ) * nArgCount );
- sal_Int32 i;
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- ppArgType[i] = 0;
- TYPELIB_DANGER_GET( & (ppArgType[i]) , pMethodType->pParams[i].pTypeRef );
- pbIsIn[i] = pMethodType->pParams[i].bIn;
- pbIsOut[i] = pMethodType->pParams[i].bOut;
- pbConversionNeeded[i] = remote_relatesToInterface( ppArgType[i] );
- }
- }
-
- void *pRemoteReturn = 0;
- if( pReturnType )
- {
- if( bConversionNeededForReturn )
- {
- pRemoteReturn = alloca( pReturnType->nSize );
- }
- else
- {
- pRemoteReturn = pReturn;
- }
- }
-
- void ** ppRemoteArgs = 0;
- if( nArgCount )
- {
- ppRemoteArgs = (void**) alloca( sizeof( void * ) * nArgCount );
- }
-
- sal_Int32 i;
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- if( pbConversionNeeded[i] )
- {
- ppRemoteArgs[i] = alloca( ppArgType[i]->nSize );
-
- if( pbIsIn[i] ) {
- uno_copyAndConvertData(
- ppRemoteArgs[i],
- ppArgs[i],
- ppArgType[i],
- p->m_mapUno2Remote.get() );
- }
- }
- else
- {
- ppRemoteArgs[i] = ppArgs[i];
- }
- }
-
- uno_Any any;
- uno_Any *pAny = &any;
-
- p->m_pRemoteI->pDispatcher( p->m_pRemoteI,
- pType,
- pRemoteReturn,
- ppRemoteArgs,
- &pAny );
-
- if( ! pAny )
- {
- if( pReturn && bConversionNeededForReturn )
- {
- uno_copyAndConvertData(
- pReturn ,
- pRemoteReturn,
- pReturnType,
- p->m_mapRemote2Uno.get() );
- uno_destructData( pRemoteReturn , pReturnType , remote_release );
- }
-
- sal_Int32 j;
- for( j = 0 ; j < nArgCount ; j ++ )
- {
- if( pbConversionNeeded[j] )
- {
- if( pbIsIn[j] ) {
- if( pbIsOut[j] ) {
- uno_destructData( ppArgs[j] ,
- ppArgType[j] ,
- 0 );
- uno_copyAndConvertData( ppArgs[j] ,
- ppRemoteArgs[j],
- ppArgType[j],
- p->m_mapRemote2Uno.get() );
- }
- }
- else // pure out
- {
- uno_copyAndConvertData( ppArgs[j] ,
- ppRemoteArgs[j],
- ppArgType[j],
- p->m_mapRemote2Uno.get() );
- }
- uno_destructData( ppRemoteArgs[j],
- ppArgType[j],
- remote_release );
- }
- }
- *ppException = 0;
- }
- else
- {
- // -----------------------
- // an exception occured
- // -----------------------
- typelib_TypeDescription *pAnyType = 0;
- getCppuType( (::com::sun::star::uno::Any*) 0 ).getDescription( &pAnyType );
- uno_copyAndConvertData( *ppException ,
- pAny ,
- pAnyType,
- p->m_mapRemote2Uno.get() );
- uno_destructData( pAny , pAnyType , remote_release );
- typelib_typedescription_release( pAnyType );
-
- // destruct remote in parameters ( out parameters have not been constructed )
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- if( pbConversionNeeded[i] && pbIsIn[i] )
- {
- uno_destructData( ppRemoteArgs[i],
- ppArgType[i],
- remote_release );
- }
- }
- }
-
- //--------------------------
- // release all acquired types
- //--------------------------
- if( pReturnType )
- {
- TYPELIB_DANGER_RELEASE( pReturnType );
- }
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- TYPELIB_DANGER_RELEASE( ppArgType[ i] );
- }
-
-}
-
-Remote2UnoProxy::Remote2UnoProxy( remote_Interface *pRemoteI,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pType,
- uno_Environment *pEnvUno,
- uno_Environment *pEnvRemote ) :
- m_sOid( pOid ),
- m_pType( pType ),
- m_pRemoteI( pRemoteI ),
- m_pEnvUno( pEnvUno ),
- m_pEnvRemote( pEnvRemote ),
- m_mapRemote2Uno( pEnvRemote, pEnvUno ),
- m_mapUno2Remote( pEnvUno , pEnvRemote ),
- m_nRef( 1 )
-{
- typelib_typedescription_acquire( (typelib_TypeDescription * ) m_pType );
- m_pEnvUno->acquire( m_pEnvUno );
- m_pEnvRemote->acquire( m_pEnvRemote );
-
- acquire = acquireRemote2UnoProxy;
- release = releaseRemote2UnoProxy;
- pDispatcher = dispatchRemote2UnoProxy;
-
- m_pEnvRemote->pExtEnv->registerInterface(
- m_pEnvRemote->pExtEnv,
- (void**)&m_pRemoteI,
- m_sOid.pData,
- m_pType );
- m_pRemoteI->acquire( m_pRemoteI );
-
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.acquire();
-#endif
-}
-
-Remote2UnoProxy::~Remote2UnoProxy()
-{
- // revoke external ref (oid)
- m_pEnvRemote->pExtEnv->revokeInterface( m_pEnvRemote->pExtEnv , m_pRemoteI );
-
- typelib_typedescription_release( (typelib_TypeDescription * )m_pType );
- m_pRemoteI->release( m_pRemoteI );
- m_pEnvUno->release( m_pEnvUno );
- m_pEnvRemote->release( m_pEnvRemote );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.release();
-#endif
-}
-
-} // end namespace bridge_remote
diff --git a/bridges/source/remote/static/remote.cxx b/bridges/source/remote/static/remote.cxx
deleted file mode 100644
index 6129d91829ba..000000000000
--- a/bridges/source/remote/static/remote.cxx
+++ /dev/null
@@ -1,161 +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_bridges.hxx"
-#include <bridges/remote/remote.hxx>
-#include <bridges/remote/counter.hxx>
-
-#if OSL_DEBUG_LEVEL > 1
-static MyCounter thisCounter( "DEBUG : Remote2RemoteStub");
-#endif
-
-using namespace bridges_remote;
-
-extern "C" {
-
-static void SAL_CALL thisRelease( remote_Interface *pThis )
-{
- Remote2RemoteStub *p = ( Remote2RemoteStub * ) pThis;
- if (! osl_decrementInterlockedCount( &(p->m_nRef) ))
- {
- p->m_pEnvRemote->pExtEnv->revokeInterface( p->m_pEnvRemote->pExtEnv, pThis );
-
- }
-}
-
-static void SAL_CALL thisDispatch(
- remote_Interface * pRemoteI,
- typelib_TypeDescription const * pMemberType,
- void * pReturn,
- void * pArgs[],
- uno_Any ** ppException )
-{
- Remote2RemoteStub *pThis = ( Remote2RemoteStub * ) pRemoteI;
-
- pThis->m_dispatch( pThis->m_pEnvRemote,
- pMemberType,
- pThis->m_sOid.pData,
- pThis->m_pType,
- pReturn,
- pArgs,
- ppException );
-}
-
-}
-
-namespace bridges_remote {
-
-void acquireRemote2RemoteStub( remote_Interface *pThis )
-{
- Remote2RemoteStub *p = ( Remote2RemoteStub * ) pThis;
- if( 1 == osl_incrementInterlockedCount( &(p->m_nRef) ) )
- {
- p->m_pEnvRemote->pExtEnv->registerProxyInterface(
- p->m_pEnvRemote->pExtEnv,
- (void**)&pThis,
- freeRemote2RemoteStub,
- p->m_sOid.pData,
- p->m_pType );
- OSL_ASSERT( (remote_Interface *)p == pThis );
- }
-}
-
-void freeRemote2RemoteStub(uno_ExtEnvironment *, void * stub) {
- delete static_cast< Remote2RemoteStub * >(stub);
-}
-
-Remote2RemoteStub::Remote2RemoteStub( rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pType,
- uno_Environment *pEnvRemote,
- requestClientSideDispatcher dispatch ) :
- m_sOid( pOid ),
- m_pType( (typelib_InterfaceTypeDescription * ) pType ),
- m_nRef( 1 ),
- m_pEnvRemote( pEnvRemote ),
- m_dispatch( dispatch ),
- m_nReleaseRemote( 1 )
-{
- typelib_typedescription_acquire( ( typelib_TypeDescription * ) m_pType );
- m_pEnvRemote->acquire( m_pEnvRemote );
-
- acquire = acquireRemote2RemoteStub;
- release = thisRelease;
- pDispatcher = thisDispatch;
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.acquire();
-#endif
-}
-
-Remote2RemoteStub::~Remote2RemoteStub()
-{
-
- // send a release via the connection !
- sal_Bool bNeedsRelease = sal_False;
- if( ! m_pType->aBase.bComplete )
- {
- // m_pType may be exchanged during complete, so it needs to be acquired
- // (MT : Another thread may use m_pType during e.g. dispatch ! ).
- typelib_typedescription_acquire( (typelib_TypeDescription*)m_pType );
- bNeedsRelease = sal_True;
- typelib_typedescription_complete( (typelib_TypeDescription **) &m_pType );
- }
-
- uno_Any any;
- uno_Any *pAny = &any;
-
- typelib_TypeDescription *pReleaseMethod = 0;
- typelib_typedescriptionreference_getDescription(
- &pReleaseMethod ,
- m_pType->ppAllMembers[REMOTE_RELEASE_METHOD_INDEX] );
- for( int i = 0 ; i < m_nReleaseRemote ; i ++ )
- {
- thisDispatch( this,
- pReleaseMethod,
- 0,
- 0,
- &pAny );
- }
- typelib_typedescription_release( pReleaseMethod );
- if( bNeedsRelease )
- {
- typelib_typedescription_release( (typelib_TypeDescription * ) m_pType );
- }
-
- typelib_typedescription_release( (typelib_TypeDescription * ) m_pType );
- m_pEnvRemote->release( m_pEnvRemote );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.release();
-#endif
-}
-
-void Remote2RemoteStub::releaseRemote()
-{
- osl_incrementInterlockedCount( &m_nReleaseRemote );
-}
-
-} // end namespace bridges_remote
diff --git a/bridges/source/remote/static/remote_types.cxx b/bridges/source/remote/static/remote_types.cxx
deleted file mode 100644
index 0be511c987b0..000000000000
--- a/bridges/source/remote/static/remote_types.cxx
+++ /dev/null
@@ -1,96 +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_bridges.hxx"
-#include "remote_types.hxx"
-
-namespace bridges_remote {
-
-sal_Bool SAL_CALL remote_relatesToInterface2( typelib_TypeDescription * pTypeDescr )
-{
- switch (pTypeDescr->eTypeClass)
- {
- case typelib_TypeClass_SEQUENCE:
- {
- switch (((typelib_IndirectTypeDescription *)pTypeDescr)->pType->eTypeClass)
- {
- case typelib_TypeClass_SEQUENCE:
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_EXCEPTION:
- {
- typelib_TypeDescription * pTD = 0;
- TYPELIB_DANGER_GET( &pTD, ((typelib_IndirectTypeDescription *)pTypeDescr)->pType );
- sal_Bool bRel = remote_relatesToInterface( pTD );
- TYPELIB_DANGER_RELEASE( pTD );
- return bRel;
- }
- default:
- break;
- }
- }
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_EXCEPTION:
- {
- // ...optimized... to avoid getDescription() calls!
- typelib_CompoundTypeDescription * pComp = (typelib_CompoundTypeDescription *)pTypeDescr;
- typelib_TypeDescriptionReference ** pTypes = pComp->ppTypeRefs;
- for ( sal_Int32 nPos = pComp->nMembers; nPos--; )
- {
- switch (pTypes[nPos]->eTypeClass)
- {
- case typelib_TypeClass_INTERFACE:
- case typelib_TypeClass_UNION: // might relate to interface
- case typelib_TypeClass_ANY: // might relate to interface
- return sal_True;
- case typelib_TypeClass_SEQUENCE:
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_EXCEPTION:
- {
- typelib_TypeDescription * pTD = 0;
- TYPELIB_DANGER_GET( &pTD, pTypes[nPos] );
- sal_Bool bRel = remote_relatesToInterface( pTD );
- TYPELIB_DANGER_RELEASE( pTD );
- if (bRel)
- return sal_True;
- break;
- }
- default:
- break;
- }
- }
- if (pComp->pBaseTypeDescription)
- return remote_relatesToInterface( (typelib_TypeDescription *)pComp->pBaseTypeDescription );
- break;
- }
- default:
- OSL_ASSERT( 0 );
- }
- return sal_False;
-}
-
-}
diff --git a/bridges/source/remote/static/remote_types.hxx b/bridges/source/remote/static/remote_types.hxx
deleted file mode 100644
index bb7a908a01f9..000000000000
--- a/bridges/source/remote/static/remote_types.hxx
+++ /dev/null
@@ -1,89 +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 _BRIDGES_REMOTE_TYPES_HXX_
-#define _BRIDGES_REMOTE_TYPES_HXX_
-
-#include <osl/diagnose.h>
-#include <sal/types.h>
-#include <typelib/typedescription.h>
-
-namespace bridges_remote
-{
-
-inline sal_Bool SAL_CALL remote_relatesToInterface( typelib_TypeDescription *pTypeDescr );
-sal_Bool SAL_CALL remote_relatesToInterface2( typelib_TypeDescription * pTypeDescr );
-
-
-/** Determines whether given type might relate or relates to an interface,
- i.e. values of this type are interface or may contain interface(s).<br>
- @param pTypeDescr type description of type
- @return true if type might relate to an interface, false otherwise
-*/
-inline sal_Bool SAL_CALL remote_relatesToInterface( typelib_TypeDescription * pTypeDescr )
-{
- switch (pTypeDescr->eTypeClass)
- {
- case typelib_TypeClass_SEQUENCE:
- switch (((typelib_IndirectTypeDescription *)pTypeDescr)->pType->eTypeClass)
- {
- case typelib_TypeClass_INTERFACE:
- case typelib_TypeClass_UNION: // might relate to interface
- case typelib_TypeClass_ANY: // might relate to interface
- return sal_True;
- case typelib_TypeClass_SEQUENCE:
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_EXCEPTION:
- return remote_relatesToInterface2( pTypeDescr );
- default:
- return sal_False;
- }
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_EXCEPTION:
- return remote_relatesToInterface2( pTypeDescr );
- case typelib_TypeClass_UNION: // might relate to interface
- case typelib_TypeClass_ANY: // might relate to interface
- case typelib_TypeClass_INTERFACE:
- return sal_True;
- default:
- return sal_False;
- }
-}
-
-/** Determines whether given type is a cpp simple type, e.g. int, enum.<br>
- @param pTypeDescr type description of type
- @return true if type is a cpp simple type, false otherwise
-*/
-inline sal_Bool SAL_CALL remote_isSimpleType( typelib_TypeDescription * pTypeDescr )
-{
- return (pTypeDescr->eTypeClass <= typelib_TypeClass_ENUM &&
- pTypeDescr->eTypeClass != typelib_TypeClass_STRING &&
- pTypeDescr->eTypeClass != typelib_TypeClass_ANY &&
- pTypeDescr->eTypeClass != typelib_TypeClass_TYPE);
-}
-
-}
-#endif
diff --git a/bridges/source/remote/static/stub.cxx b/bridges/source/remote/static/stub.cxx
deleted file mode 100644
index ec276c801862..000000000000
--- a/bridges/source/remote/static/stub.cxx
+++ /dev/null
@@ -1,336 +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_bridges.hxx"
-#include <sal/alloca.h>
-#include <osl/diagnose.h>
-
-#include <uno/data.h>
-#include <uno/mapping.hxx>
-
-#include <bridges/remote/stub.hxx>
-#include <bridges/remote/proxy.hxx>
-#include <bridges/remote/context.h>
-#include <bridges/remote/bridgeimpl.hxx>
-
-#include "remote_types.hxx"
-
-#if OSL_DEBUG_LEVEL > 1
-#include <bridges/remote/counter.hxx>
-static MyCounter thisCounter( "DEBUG : Uno2RemoteStub");
-#endif
-
-using namespace ::com::sun::star::uno;
-using namespace bridges_remote;
-
-extern "C" {
-
-void SAL_CALL thisRelease( remote_Interface *pThis )
-{
- Uno2RemoteStub *p = ( Uno2RemoteStub * ) pThis;
- if (! osl_decrementInterlockedCount( &(p->m_nRef) ))
- {
- p->m_pEnvRemote->pExtEnv->revokeInterface( p->m_pEnvRemote->pExtEnv, pThis );
- }
-}
-
-void SAL_CALL thisDispatch(
- remote_Interface * pRemoteI,
- typelib_TypeDescription const * pType,
- void * pReturn,
- void * ppArgs[],
- uno_Any ** ppException )
-{
- Uno2RemoteStub *p = ( Uno2RemoteStub * ) pRemoteI;
-
- RemoteThreadCounter counter( p->m_pEnvRemote );
-
- typelib_InterfaceMethodTypeDescription *pMethodType = 0;
- typelib_InterfaceAttributeTypeDescription *pAttributeType = 0;
- typelib_TypeDescription *pReturnType = 0;
- typelib_TypeDescription **ppArgType = 0;
- sal_Int32 nArgCount = 0;
- sal_Bool *pbIsIn = 0;
- sal_Bool *pbIsOut = 0;
- sal_Bool bConversionNeededForReturn = sal_False;
- sal_Bool *pbConversionNeeded = 0;
-
- sal_Int32 i;
- //--------------------------------
- // Collect all needed types !
- //--------------------------------
- if( typelib_TypeClass_INTERFACE_ATTRIBUTE == pType->eTypeClass )
- {
- pAttributeType = ( typelib_InterfaceAttributeTypeDescription * ) pType;
- if( pReturn )
- {
- TYPELIB_DANGER_GET( &pReturnType , pAttributeType->pAttributeTypeRef );
- bConversionNeededForReturn = remote_relatesToInterface( pReturnType );
- }
- else
- {
- nArgCount = 1;
- ppArgType = (typelib_TypeDescription **) alloca( sizeof( void * ) );
- pbIsIn = ( sal_Bool * ) alloca( sizeof( sal_Bool ) );
- pbIsOut = ( sal_Bool * ) alloca( sizeof( sal_Bool ) );
- pbConversionNeeded = ( sal_Bool * ) alloca( sizeof( sal_Bool ) );
- pbIsIn[0] = sal_True;
- pbIsOut[0] = sal_False;
- ppArgType[0] = 0;
- TYPELIB_DANGER_GET( &( ppArgType[0] ) , pAttributeType->pAttributeTypeRef );
- pbConversionNeeded[0] = remote_relatesToInterface( ppArgType[0] );
- }
- }
- if( typelib_TypeClass_INTERFACE_METHOD == pType->eTypeClass )
- {
- pMethodType = ( typelib_InterfaceMethodTypeDescription * ) pType;
- TYPELIB_DANGER_GET( &pReturnType , pMethodType->pReturnTypeRef );
- bConversionNeededForReturn = remote_relatesToInterface( pReturnType );
- nArgCount = pMethodType->nParams;
- ppArgType = (typelib_TypeDescription **) alloca( sizeof( void * ) * nArgCount );
- pbIsIn = (sal_Bool * ) alloca( sizeof( sal_Bool ) * nArgCount );
- pbIsOut = (sal_Bool * ) alloca( sizeof( sal_Bool ) * nArgCount );
- pbConversionNeeded = ( sal_Bool * ) alloca( sizeof( sal_Bool ) * nArgCount );
-
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- ppArgType[i] = 0;
- TYPELIB_DANGER_GET( & (ppArgType[i]) , pMethodType->pParams[i].pTypeRef );
- pbIsIn[i] = pMethodType->pParams[i].bIn;
- pbIsOut[i] = pMethodType->pParams[i].bOut;
- pbConversionNeeded[i] = remote_relatesToInterface( ppArgType[i] );
- }
- }
-
- // create Mapping
-
- void *pUnoReturn = 0;
- void **ppUnoArgs = 0;
-
- if( pReturnType )
- {
- if( bConversionNeededForReturn )
- {
- pUnoReturn = alloca( pReturnType->nSize );
- }
- else
- {
- pUnoReturn = pReturn;
- }
- }
-
- ppUnoArgs = (void **) alloca( nArgCount * sizeof( void * ) );
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- if( pbConversionNeeded[i] )
- {
- ppUnoArgs[i] = alloca( ppArgType[i]->nSize );
- if( pbIsIn[i] )
- {
- uno_copyAndConvertData(
- ppUnoArgs[i],
- ppArgs[i],
- ppArgType[i],
- p->m_mapRemote2Uno.get()
- );
- }
- }
- else
- {
- ppUnoArgs[i] = ppArgs[i];
- }
- }
-
- // do the call
- uno_Any any;
- uno_Any *pAny = &any;
-
- p->m_pUnoI->pDispatcher( p->m_pUnoI,
- pType,
- pUnoReturn,
- ppUnoArgs,
- &pAny);
-
- if( ! pAny )
- {
- // ------------------
- // No Exception
- // ------------------
-
- // Map return value
- if( pReturnType && bConversionNeededForReturn )
- {
- uno_copyAndConvertData(
- pReturn ,
- pUnoReturn,
- pReturnType,
- p->m_mapUno2Remote.get() );
- uno_destructData( pUnoReturn , pReturnType, 0 );
- }
-
- // map arguments
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- if( pbConversionNeeded[i] )
- {
- if( pbIsIn[i] ) {
- if( pbIsOut[i] ) {
- uno_destructData(
- ppArgs[i] ,
- ppArgType[i] ,
- remote_release );
- uno_copyAndConvertData( ppArgs[i] ,
- ppUnoArgs[i],
- ppArgType[i],
- p->m_mapUno2Remote.get() );
- }
- }
- else // pure out
- {
- uno_copyAndConvertData( ppArgs[i] ,
- ppUnoArgs[i],
- ppArgType[i],
- p->m_mapUno2Remote.get() );
- }
- uno_destructData( ppUnoArgs[i],
- ppArgType[i],
- 0 );
- }
- }
- *ppException = 0;
- }
- else
- {
- // -----------------------
- // an exception occured
- // -----------------------
- typelib_TypeDescription *pAnyType = 0;
- getCppuType( (Any*) 0 ).getDescription( &pAnyType );
- uno_copyAndConvertData( *ppException ,
- pAny ,
- pAnyType,
- p->m_mapUno2Remote.get() );
- uno_destructData( pAny , pAnyType , 0 );
- typelib_typedescription_release( pAnyType );
-
- // destruct uno in parameters ( out parameters have not been constructed )
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- if( pbConversionNeeded[i] && pbIsIn[i] )
- {
- uno_destructData( ppUnoArgs[i],
- ppArgType[i],
- 0 );
- }
- }
- }
-
- //--------------------------
- // release all acquired types
- //--------------------------
- if( pReturnType )
- {
- TYPELIB_DANGER_RELEASE( pReturnType );
- }
- for( i = 0 ; i < nArgCount ; i ++ )
- {
- TYPELIB_DANGER_RELEASE( ppArgType[ i] );
- }
-}
-
-}
-
-namespace bridges_remote {
-
-void acquireUno2RemoteStub( remote_Interface *pThis )
-{
- Uno2RemoteStub *p = ( Uno2RemoteStub * ) pThis;
- if( 1 == osl_incrementInterlockedCount( &(p->m_nRef) ) )
- {
-
- p->m_pEnvRemote->pExtEnv->registerProxyInterface(
- p->m_pEnvRemote->pExtEnv,
- (void**)&pThis,
- freeUno2RemoteStub,
- p->m_sOid.pData,
- p->m_pType );
-
- OSL_ASSERT( (remote_Interface*) p == pThis );
- }
-}
-
-void freeUno2RemoteStub(uno_ExtEnvironment *, void * stub) {
- delete static_cast< Uno2RemoteStub * >(stub);
-}
-
-Uno2RemoteStub::Uno2RemoteStub( uno_Interface *pUnoI,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pType,
- uno_Environment *pEnvUno,
- uno_Environment *pEnvRemote ) :
- m_sOid( pOid ),
- m_pType( pType ),
- m_pUnoI( pUnoI ),
- m_nRef( 1 ),
- m_pEnvUno( pEnvUno ),
- m_pEnvRemote( pEnvRemote ),
- m_mapRemote2Uno( pEnvRemote, pEnvUno ),
- m_mapUno2Remote( pEnvUno, pEnvRemote )
-{
- typelib_typedescription_acquire( (typelib_TypeDescription * )m_pType );
- m_pEnvUno->acquire( m_pEnvUno );
- m_pEnvRemote->acquire( m_pEnvRemote );
-
- acquire = acquireUno2RemoteStub;
- release = thisRelease;
- pDispatcher = thisDispatch;
-
- m_pEnvUno->pExtEnv->registerInterface( m_pEnvUno->pExtEnv,
- (void **)&m_pUnoI,
- m_sOid.pData,
- m_pType );
- m_pUnoI->acquire( m_pUnoI );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.acquire();
-#endif
-}
-
-Uno2RemoteStub::~Uno2RemoteStub()
-{
- m_pEnvUno->pExtEnv->revokeInterface( m_pEnvUno->pExtEnv , m_pUnoI );
-
- typelib_typedescription_release( (typelib_TypeDescription * )m_pType );
- m_pUnoI->release( m_pUnoI );
- m_pEnvUno->release( m_pEnvUno );
- m_pEnvRemote->release( m_pEnvRemote );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.release();
-#endif
-}
-
-} // end namespace bridges_remote
diff --git a/bridges/source/remote/urp/makefile.mk b/bridges/source/remote/urp/makefile.mk
deleted file mode 100644
index eaa3f3a6f146..000000000000
--- a/bridges/source/remote/urp/makefile.mk
+++ /dev/null
@@ -1,78 +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=..$/..$/..
-
-PRJNAME=bridges
-TARGET=urp_uno
-ENABLE_EXCEPTIONS=TRUE
-USE_DEFFILE=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/urp_environment.obj \
- $(SLO)$/urp_marshal.obj \
- $(SLO)$/urp_unmarshal.obj \
- $(SLO)$/urp_dispatch.obj \
- $(SLO)$/urp_job.obj \
- $(SLO)$/urp_reader.obj \
- $(SLO)$/urp_writer.obj \
- $(SLO)$/urp_log.obj \
- $(SLO)$/urp_bridgeimpl.obj \
- $(SLO)$/urp_propertyobject.obj \
- $(SLO)$/urp_threadid.obj
-
-.IF "$(COM)"=="GCC"
-NOOPTFILES= \
- $(SLO)$/urp_reader.obj
-.ENDIF # "$(COM)"=="GCC"
-
-SHL1TARGET= $(TARGET)
-
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1VERSIONMAP=..$/..$/bridge_exports.map
-SHL1RPATH=URELIB
-
-SHL1STDLIBS=\
- $(SALLIB)\
- $(CPPULIB)
-
-SHL1LIBS=\
- $(SLB)$/$(TARGET).lib \
- $(SLB)$/bridges_remote_static.lib
-
-DEF1NAME= $(SHL1TARGET)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/bridges/source/remote/urp/urp_bridgeimpl.cxx b/bridges/source/remote/urp/urp_bridgeimpl.cxx
deleted file mode 100644
index af619c8f3c35..000000000000
--- a/bridges/source/remote/urp/urp_bridgeimpl.cxx
+++ /dev/null
@@ -1,250 +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_bridges.hxx"
-#include <osl/thread.h>
-#include <bridges/remote/helper.hxx>
-
-#include <algorithm>
-
-#include "urp_bridgeimpl.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::com::sun::star::uno;
-namespace bridges_urp
-{
-
-template < class t >
-inline t mymin( const t & val1, const t & val2 )
-{
- return val1 < val2 ? val1 : val2;
-}
-
-/***********
- * urp_BridgeImpl
- ***********/
-urp_BridgeImpl::urp_BridgeImpl( sal_Int32 nCacheSize , sal_uInt32 nInitialMarshalerSize ) :
- m_blockMarshaler( this , nInitialMarshalerSize , ::bridges_remote::remote_retrieveOidFromProxy),
- m_nMarshaledMessages( 0 ),
- m_oidCacheOut( (sal_uInt16)nCacheSize ),
- m_tidCacheOut( (sal_uInt16)nCacheSize ),
- m_typeCacheOut( (sal_uInt16)nCacheSize )
-{
- m_pOidIn = new OUString[ nCacheSize ];
- m_pTidIn = new ByteSequence[ nCacheSize ];
- m_pTypeIn = new Type[ nCacheSize ];
- m_nRemoteThreads = 0;
-}
-
-urp_BridgeImpl::~urp_BridgeImpl()
-{
- delete [] m_pOidIn;
- delete [] m_pTidIn;
- delete [] m_pTypeIn;
-}
-
-
-void urp_BridgeImpl::applyProtocolChanges( const Properties &props )
-{
- if( m_properties.nTypeCacheSize != props.nTypeCacheSize )
- {
- if( props.nTypeCacheSize == 0 )
- {
- delete [] m_pTypeIn;
- m_pTypeIn = 0;
- }
- else
- {
- Type *pNew = new Type[props.nTypeCacheSize];
- sal_Int32 i;
- sal_Int32 iMin = mymin( m_properties.nTypeCacheSize , props.nTypeCacheSize );
- for( i = 0; i < iMin ; i ++ )
- {
- pNew[i] = m_pTypeIn[i];
- }
- delete [] m_pTypeIn;
- m_pTypeIn = pNew;
- }
- OSL_ASSERT( props.nTypeCacheSize <= 0xffff );
- m_properties.nTypeCacheSize = props.nTypeCacheSize;
- m_typeCacheOut.resize( (sal_uInt16)props.nTypeCacheSize );
- }
-
- if( m_properties.nOidCacheSize != props.nOidCacheSize )
- {
- if( 0 == props.nOidCacheSize )
- {
- delete [] m_pOidIn;
- m_pOidIn = 0;
- }
- else
- {
- OUString *pNew = new OUString[props.nOidCacheSize];
- sal_Int32 i;
- sal_Int32 iMin = mymin( m_properties.nOidCacheSize , props.nOidCacheSize );
- for( i = 0; i < iMin ; i ++ )
- {
- pNew[i] = m_pOidIn[i];
- }
- delete [] m_pOidIn;
- m_pOidIn = pNew;
- }
- OSL_ASSERT( props.nOidCacheSize <= 0xffff );
- m_oidCacheOut.resize( (sal_uInt16)props.nOidCacheSize );
- m_properties.nOidCacheSize = props.nOidCacheSize;
- }
-
- if( m_properties.nTidCacheSize != props.nTidCacheSize )
- {
- if( 0 == props.nTidCacheSize )
- {
- delete [] m_pTidIn;
- m_pTidIn = 0;
- }
- else
- {
- ByteSequence *pNew = new ByteSequence[props.nTidCacheSize];
- sal_Int32 i;
- sal_Int32 iMin = mymin( m_properties.nTidCacheSize , props.nTidCacheSize );
- for( i = 0; i < iMin ; i ++ )
- {
- pNew[i] = m_pTidIn[i];
- }
- delete [] m_pTidIn;
- m_pTidIn = pNew;
- }
- OSL_ASSERT( props.nTidCacheSize <= 0xffff );
- m_tidCacheOut.resize( (sal_uInt16)props.nTidCacheSize );
- m_properties.nTidCacheSize = props.nTidCacheSize;
- }
-
- if( m_properties.sVersion != props.sVersion )
- {
- m_properties.sVersion = props.sVersion;
- }
-
- if( m_properties.nFlushBlockSize != props.nFlushBlockSize )
- {
- m_properties.nFlushBlockSize = props.nFlushBlockSize;
- }
-
- if( m_properties.nOnewayTimeoutMUSEC != props.nOnewayTimeoutMUSEC )
- {
- m_properties.nOnewayTimeoutMUSEC = props.nOnewayTimeoutMUSEC;
- }
-
- if( props.bClearCache )
- {
- if( m_properties.nTypeCacheSize )
- {
- delete [] m_pTypeIn;
- m_pTypeIn = new Type[m_properties.nTypeCacheSize];
- m_typeCacheOut.clear();
- }
- m_lastInType = Type();
- m_lastOutType = Type();
-
- if( m_properties.nOidCacheSize )
- {
- delete [] m_pOidIn;
- m_pOidIn = new OUString[ m_properties.nOidCacheSize];
- m_oidCacheOut.clear();
- }
- m_lastOutOid = OUString();
- m_lastInOid = OUString();
-
- if( m_properties.nTidCacheSize )
- {
- delete [] m_pTidIn;
- m_pTidIn = new ByteSequence[m_properties.nTidCacheSize];
- m_tidCacheOut.clear();
- }
- m_lastInTid = ByteSequence();
- m_lastOutTid = ByteSequence();
- }
-
- if( m_properties.bNegotiate != props.bNegotiate )
- {
- m_properties.bNegotiate = props.bNegotiate;
- }
-
- if( m_properties.bForceSynchronous != props.bForceSynchronous )
- {
- m_properties.bForceSynchronous = props.bForceSynchronous;
- }
-
- m_properties.bCurrentContext = props.bCurrentContext;
-}
-
-void urp_BridgeImpl::addError( char const *pError )
-{
- OUString message = OUString( RTL_CONSTASCII_USTRINGPARAM( "(tid=" ) );
- message += OUString::valueOf( (sal_Int32 ) osl_getThreadIdentifier( 0 ) );
- message += OUString::createFromAscii( ") " );
- message += OUString::createFromAscii( pError );
- MutexGuard guard( m_errorListMutex );
- m_lstErrors.push_back( message );
-}
-
-void urp_BridgeImpl::addError( const OUString & error )
-{
- OUString message = OUString( RTL_CONSTASCII_USTRINGPARAM( "(tid=" ) );
- message += OUString::valueOf( (sal_Int32 ) osl_getThreadIdentifier( 0 ) );
- message += OUString::createFromAscii( ") " );
- message += error;
- MutexGuard guard( m_errorListMutex );
- m_lstErrors.push_back( message );
-}
-
-void urp_BridgeImpl::dumpErrors( FILE * f)
-{
- MutexGuard guard( m_errorListMutex );
- for( ::std::list< OUString >::iterator ii = m_lstErrors.begin() ;
- ii != m_lstErrors.end() ;
- ++ii )
- {
- OString o = OUStringToOString( *ii , RTL_TEXTENCODING_UTF8 );
- fprintf( f, "%s\n" , o.getStr() );
- }
-}
-
-OUString urp_BridgeImpl::getErrorsAsString( )
-{
- MutexGuard guard( m_errorListMutex );
- OUString ret;
- for( ::std::list< OUString >::iterator ii = m_lstErrors.begin() ;
- ii != m_lstErrors.end() ;
- ++ii )
- {
- ret += *ii;
- }
- return ret;
-}
-
-}
diff --git a/bridges/source/remote/urp/urp_bridgeimpl.hxx b/bridges/source/remote/urp/urp_bridgeimpl.hxx
deleted file mode 100644
index 53d583bed48d..000000000000
--- a/bridges/source/remote/urp/urp_bridgeimpl.hxx
+++ /dev/null
@@ -1,133 +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 _URP_BRIDGEIMPL_HXX_
-#define _URP_BRIDGEIMPL_HXX_
-
-#include <stdio.h>
-#include <osl/mutex.hxx>
-#include <osl/conditn.hxx>
-#include <rtl/ustring.hxx>
-#include <rtl/byteseq.hxx>
-
-#ifndef _UNO_THREADPOOL_H_
-#include <uno/threadpool.h>
-#endif
-#include <bridges/remote/bridgeimpl.hxx>
-
-#ifndef _URP_CACHE_HXX_
-#include "urp_cache.hxx"
-#endif
-#include "urp_marshal_decl.hxx"
-
-#ifndef _URP_REPLYCONTAINER_HXX_
-#include "urp_replycontainer.hxx"
-#endif
-#include "urp_property.hxx"
-
-
-namespace bridges_urp
-{
-
-class PropertyObject;
-
-struct equalOUString
-{
- sal_Int32 operator() ( const ::rtl::OUString &s1, const ::rtl::OUString &s2 ) const
- {
- return s1 == s2;
- }
-};
-
-struct equalType
-{
- sal_Int32 operator() ( const ::com::sun::star::uno::Type &t1,
- const ::com::sun::star::uno::Type &t2 ) const
- {
- return t1 == t2;
- }
-};
-
-class OWriterThread;
-class OReaderThread;
-
-struct urp_BridgeImpl :
- public remote_BridgeImpl
-{
- urp_BridgeImpl( sal_Int32 nCacheSize , sal_uInt32 nInitialMarshalerSize );
- ~urp_BridgeImpl();
-
- void applyProtocolChanges( const Properties & );
-
- void startBlockBridge();
- void stopBlockBridge();
- void addError( char const *pError );
- void addError( const ::rtl::OUString &anError );
- void dumpErrors( FILE *f );
- ::rtl::OUString getErrorsAsString();
-
- ::osl::Mutex m_marshalingMutex;
- ::osl::Mutex m_disposingMutex;
- ::osl::Mutex m_errorListMutex;
- Marshal m_blockMarshaler;
- sal_Int32 m_nMarshaledMessages;
-
- // Caches for vars, that go from local process to the remote process
- Cache < ::rtl::OUString , equalOUString > m_oidCacheOut;
- Cache < ::rtl::ByteSequence , EqualThreadId > m_tidCacheOut;
- Cache < ::com::sun::star::uno::Type , equalType > m_typeCacheOut;
-
- ::com::sun::star::uno::Type m_lastOutType;
- ::rtl::ByteSequence m_lastOutTid;
- ::rtl::OUString m_lastOutOid;
-
- // Caches for vars, that come from the remote process to the local process
- ::rtl::OUString *m_pOidIn;
- ::rtl::ByteSequence *m_pTidIn;
- ::com::sun::star::uno::Type *m_pTypeIn;
-
- ::com::sun::star::uno::Type m_lastInType;
- ::rtl::ByteSequence m_lastInTid;
- ::rtl::OUString m_lastInOid;
-
- urp_ClientJobContainer m_clientJobContainer;
-
- OWriterThread *m_pWriter;
- OReaderThread *m_pReader;
- ::rtl::OString m_sLogFileName;
- FILE *m_pLogFile;
- ::osl::Condition m_initialized;
- ::osl::Condition m_cndWaitForThreads;
-
- struct Properties m_properties;
- class PropertyObject *m_pPropertyObject;
- ::std::list< ::rtl::OUString > m_lstErrors;
- uno_ThreadPool m_hThreadPool;
-};
-
-
-}
-#endif
diff --git a/bridges/source/remote/urp/urp_cache.h b/bridges/source/remote/urp/urp_cache.h
deleted file mode 100644
index fa06453ef524..000000000000
--- a/bridges/source/remote/urp/urp_cache.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-namespace bridges_urp
-{
- template < class t , class tequals >
- class Cache
- {
- public:
- inline Cache ( sal_uInt16 nMaxEntries );
- inline ~Cache();
-
- // puts the value t into the cache. Returns then entry,
- // that is used for this value.
- inline sal_uInt16 put( const t & );
-
- // lookup, if there is an entry for this value
- // returns 0xffff, when value cannot be found in the list
- inline sal_uInt16 seek( const t & );
-
- // resizes the cache, conserving overlapping values
- inline void resize( sal_uInt16 nNewMaxEntries );
-
- // empties the cache
- inline void clear();
- private:
- t *m_pCache;
- ::std::list< sal_uInt16 > m_lstLeastRecentlyUsed;
- sal_uInt16 m_nMaxEntries;
- sal_uInt16 m_nEntries;
- };
-}
diff --git a/bridges/source/remote/urp/urp_cache.hxx b/bridges/source/remote/urp/urp_cache.hxx
deleted file mode 100644
index aa366ddaeca7..000000000000
--- a/bridges/source/remote/urp/urp_cache.hxx
+++ /dev/null
@@ -1,160 +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 <stdio.h>
-#include <list>
-#include <algorithm>
-#include <rtl/ustring.hxx>
-
-#include "urp_threadid.hxx"
-#include "urp_cache.h"
-
-namespace bridges_urp
-{
-
- template < class t , class tequals >
- inline Cache< t , tequals >::Cache( sal_uInt16 nMaxEntries ) :
- m_pCache( new t[nMaxEntries] ),
- m_nMaxEntries( nMaxEntries ),
- m_nEntries( 0 )
- {
-
- }
-
- template < class t , class tequals >
- inline Cache< t , tequals >::~Cache( )
- {
- delete [] m_pCache;
- }
-
-
- template < class t , class tequals >
- inline sal_uInt16 Cache< t , tequals >::put( const t & value )
- {
- if( ! m_nMaxEntries )
- {
- return 0xffff;
- }
- sal_uInt16 nEntry = 0xffff;
- if( m_nEntries < m_nMaxEntries )
- {
- // cache has still empty places
- m_pCache[m_nEntries] = value;
- nEntry = m_nEntries;
- m_nEntries ++;
-
- // add it to the cache
- m_lstLeastRecentlyUsed.push_front( nEntry );
- }
- else
- {
- // cache is full, remove an element and insert the new one
- nEntry = m_lstLeastRecentlyUsed.back();
- m_lstLeastRecentlyUsed.pop_back();
- m_lstLeastRecentlyUsed.push_front( nEntry );
-
- m_pCache[nEntry] = value;
- }
- return nEntry;
- }
-
- template < class t , class tequals >
- inline sal_uInt16 Cache< t , tequals >::seek( const t & value )
- {
- for( ::std::list< sal_uInt16 >::iterator ii = m_lstLeastRecentlyUsed.begin() ;
- ii != m_lstLeastRecentlyUsed.end() ;
- ++ ii )
- {
- if( value == m_pCache[*ii] )
- {
- sal_uInt16 nEntry = *ii;
- m_lstLeastRecentlyUsed.erase( ii );
- m_lstLeastRecentlyUsed.push_front( nEntry );
- return nEntry;
- }
- }
- return 0xffff;
- }
-
- // helper predicate for element removal
- template < class t >
- struct PredicateOverMax
- {
- t m_;
- inline PredicateOverMax( const t &value ) : m_(value)
- {}
- sal_Int32 operator () ( const t &value ) const
- { return value >= m_; }
- };
-
- template < class t, class tequals >
- inline void Cache < t , tequals >::resize( sal_uInt16 nNewMaxEntries )
- {
- if( 0 == nNewMaxEntries )
- {
- m_lstLeastRecentlyUsed.clear();
- delete [] m_pCache;
- m_pCache = 0;
- m_nMaxEntries = 0;
- }
- else
- {
- // allocate
- t *pNew = new t[nNewMaxEntries];
- sal_Int32 nMin = nNewMaxEntries < m_nMaxEntries ? nNewMaxEntries : m_nMaxEntries;
-
- // copy
- for( sal_Int32 i = 0; i < nMin ; i ++ )
- {
- pNew[i] = m_pCache[i];
- }
- // delete
- delete [] m_pCache;
-
- // assign
- m_pCache = pNew;
-
- // remove overlapping lru cache entries
- ::std::remove_if(m_lstLeastRecentlyUsed.begin(),
- m_lstLeastRecentlyUsed.end(),
- PredicateOverMax< sal_Int32 > ( nMin ) );
- }
- m_nMaxEntries = nNewMaxEntries;
- m_nEntries = m_nEntries < m_nMaxEntries ?
- m_nEntries : m_nMaxEntries;
- }
-
- template < class t, class tequals >
- inline void Cache < t, tequals >:: clear()
- {
- for( sal_Int32 i = 0; i < m_nMaxEntries ; i ++ )
- {
- m_pCache[i] = t();
- }
- m_lstLeastRecentlyUsed.clear();
- m_nEntries = 0;
- }
-}
diff --git a/bridges/source/remote/urp/urp_dispatch.cxx b/bridges/source/remote/urp/urp_dispatch.cxx
deleted file mode 100644
index ae9f3dff9d54..000000000000
--- a/bridges/source/remote/urp/urp_dispatch.cxx
+++ /dev/null
@@ -1,116 +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_bridges.hxx"
-#include <sal/alloca.h>
-#include <osl/mutex.hxx>
-#include <osl/diagnose.h>
-
-#include <rtl/alloc.h>
-#include <rtl/ustrbuf.hxx>
-
-#include <uno/mapping.hxx>
-#include <uno/threadpool.h>
-
-#include <bridges/remote/remote.h>
-#include <bridges/remote/stub.hxx>
-#include <bridges/remote/proxy.hxx>
-#include <bridges/remote/remote.hxx>
-
-#include "urp_bridgeimpl.hxx"
-#include "urp_marshal.hxx"
-#include "urp_dispatch.hxx"
-#include "urp_job.hxx"
-#include "urp_writer.hxx"
-#include "urp_log.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::com::sun::star::uno;
-
-namespace bridges_urp
-{
-
-void SAL_CALL urp_sendCloseConnection( uno_Environment *pEnvRemote )
-{
- remote_Context *pContext = (remote_Context *) pEnvRemote->pContext;
- urp_BridgeImpl *pImpl = (urp_BridgeImpl*) ( pContext->m_pBridgeImpl );
-
- {
- MutexGuard guard( pImpl->m_marshalingMutex );
-
- // send immediately
- if( ! pImpl->m_blockMarshaler.empty() )
- {
- pImpl->m_pWriter->touch( sal_True );
- }
-
- pImpl->m_pWriter->sendEmptyMessage();
- }
-}
-extern "C" void SAL_CALL urp_sendRequest(
- uno_Environment *pEnvRemote,
- typelib_TypeDescription const * pMemberType,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pInterfaceType,
- void *pReturn,
- void *ppArgs[],
- uno_Any **ppException )
-{
- remote_Context *pContext = (remote_Context *) pEnvRemote->pContext;
- urp_BridgeImpl *pImpl = (urp_BridgeImpl*) ( pContext->m_pBridgeImpl );
- pImpl->m_initialized.wait();
- urp_sendRequest_internal(
- pEnvRemote, pMemberType, pOid, pInterfaceType, pReturn, ppArgs,
- ppException );
-}
-void SAL_CALL urp_sendRequest_internal(
- uno_Environment *pEnvRemote,
- typelib_TypeDescription const * pMemberType,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pInterfaceType,
- void *pReturn,
- void *ppArgs[],
- uno_Any **ppException )
-{
- remote_Context *pContext = (remote_Context *) pEnvRemote->pContext;
- urp_BridgeImpl *pImpl = (urp_BridgeImpl*) ( pContext->m_pBridgeImpl );
-
- ClientJob job(
- pEnvRemote, pContext, pImpl, pOid, pMemberType, pInterfaceType, pReturn,
- ppArgs, ppException);
-
- if( job.pack() && ! job.isOneway() )
- {
- job.wait();
- }
-}
-
-}
-
-
diff --git a/bridges/source/remote/urp/urp_dispatch.hxx b/bridges/source/remote/urp/urp_dispatch.hxx
deleted file mode 100644
index 2f14d89f75c2..000000000000
--- a/bridges/source/remote/urp/urp_dispatch.hxx
+++ /dev/null
@@ -1,78 +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 <rtl/ustring.hxx>
-
-#include <typelib/typedescription.h>
-
-#include <uno/any2.h>
-
-
-typedef struct _uno_Environment uno_Environment;
-struct remote_Interface;
-
-
-
-namespace bridges_urp {
-
- const sal_uInt8 HDRFLAG_LONGHEADER = 0x80;
- const sal_uInt8 HDRFLAG_REQUEST = 0x40;
- const sal_uInt8 HDRFLAG_NEWTYPE = 0x20;
- const sal_uInt8 HDRFLAG_NEWOID = 0x10;
- const sal_uInt8 HDRFLAG_NEWTID = 0x08;
- const sal_uInt8 HDRFLAG_LONGMETHODID = 0x04;
- const sal_uInt8 HDRFLAG_IGNORECACHE = 0x02;
- const sal_uInt8 HDRFLAG_MOREFLAGS = 0x01;
- const sal_uInt8 HDRFLAG_MUSTREPLY = 0x80;
- const sal_uInt8 HDRFLAG_SYNCHRONOUS = 0x40;
-
- const sal_uInt8 HDRFLAG_EXCEPTION = 0x20;
-
- void SAL_CALL urp_sendCloseConnection( uno_Environment *pEnvRemote );
-
- extern "C" void SAL_CALL urp_sendRequest(
- uno_Environment *pEnvRemote,
- typelib_TypeDescription const * pMemberType,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pInterfaceType,
- void *pReturn,
- void *ppArgs[],
- uno_Any **ppException
- );
-
- void SAL_CALL urp_sendRequest_internal(
- uno_Environment *pEnvRemote,
- typelib_TypeDescription const * pMemberType,
- rtl_uString *pOid,
- typelib_InterfaceTypeDescription *pInterfaceType,
- void *pReturn,
- void *ppArgs[],
- uno_Any **ppException
- );
-
-}
-
diff --git a/bridges/source/remote/urp/urp_environment.cxx b/bridges/source/remote/urp/urp_environment.cxx
deleted file mode 100644
index 1e4f2f3c805c..000000000000
--- a/bridges/source/remote/urp/urp_environment.cxx
+++ /dev/null
@@ -1,551 +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_bridges.hxx"
-
-#include <stdio.h>
-
-#include <osl/interlck.h>
-#include <osl/diagnose.h>
-#include <osl/conditn.h>
-#include <osl/mutex.hxx>
-#include <osl/process.h>
-
-#include <rtl/alloc.h>
-#include <rtl/uuid.h>
-#include <rtl/unload.h>
-
-#include <uno/environment.h>
-#include <uno/lbnames.h>
-#include <uno/mapping.hxx>
-#include <uno/threadpool.h>
-
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include <bridges/remote/proxy.hxx>
-#include <bridges/remote/stub.hxx>
-#include <bridges/remote/context.h>
-#include <bridges/remote/mapping.hxx>
-#include <bridges/remote/counter.hxx>
-#include <bridges/remote/bridgeimpl.hxx>
-#include <bridges/remote/helper.hxx>
-
-#include "urp_bridgeimpl.hxx"
-#include "urp_writer.hxx"
-#include "urp_reader.hxx"
-#include "urp_dispatch.hxx"
-#include "urp_log.hxx"
-#include "urp_propertyobject.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::com::sun::star::uno;
-
-namespace bridges_urp
-{
-rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
-
-// static void dumpProperties( struct Properties *p )
-// {
-// fprintf( stderr , "FlushBlockSize : %d\n" , p->nFlushBlockSize );
-// fprintf( stderr , "OnewayTimeoutMUSEC : %d\n" , p->nOnewayTimeoutMUSEC );
-// fprintf( stderr , "OidCacheSize : %d\n" , p->nOidCacheSize );
-// fprintf( stderr , "TypeCacheSize : %d\n" , p->nTypeCacheSize );
-// fprintf( stderr , "TidCacheSize : %d\n" , p->nTidCacheSize );
-// OString o = OUStringToOString( p->sSupportedVersions , RTL_TEXTENCODING_ASCII_US );
-// fprintf( stderr , "SupportedVersions : %s\n" , o.pData->buffer );
-// o = OUStringToOString( p->sVersion , RTL_TEXTENCODING_ASCII_US );
-// fprintf( stderr , "Version : %s\n" , o.pData->buffer );
-// fprintf( stderr , "SupportsMultipleSynchronous : %d\n" , p->bSupportsMultipleSynchronous );
-// fprintf( stderr , "SupportsMustReply : %d\n" , p->bSupportsMustReply );
-// fprintf( stderr , "SupportsSynchronous : %d\n" , p->bSupportsSynchronous );
-// }
-
-// PropertySetterThread
-//------------------------------------
-class PropertySetterThread : public ::osl::Thread
-{
- urp_BridgeImpl *m_pImpl;
- ::rtl::OUString m_sProps;
- uno_Environment *m_pEnvRemote;
-public:
- PropertySetterThread( uno_Environment *pEnvRemote,
- urp_BridgeImpl *pImpl,
- const ::rtl::OUString & props )
- : m_pImpl( pImpl )
- , m_sProps( props )
- , m_pEnvRemote( pEnvRemote )
- {
- if (m_sProps.getLength() > 0) {
- m_sProps += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
- m_sProps += rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("CurrentContext="));
- // hold the environment in case all references are released before this
- // thread terminates
- m_pEnvRemote->acquire( pEnvRemote );
- }
- ~PropertySetterThread()
- {
- m_pEnvRemote->release( m_pEnvRemote );
- }
-
- virtual void SAL_CALL run()
- {
- for (;;)
- {
- switch ( m_pImpl->m_pPropertyObject->localRequestChange( ) )
- {
- case 1:
- sal_Bool bExceptionThrown;
- m_pImpl->m_pPropertyObject->localCommitChange( m_sProps , &bExceptionThrown );
- OSL_ENSURE( !bExceptionThrown, "properties were not set\n" );
- goto done;
- case 0:
- OSL_TRACE( "urp-bridge : remote-counterpart won the changing-the-protocol-race\n" );
- goto done;
- }
- }
- done:
- m_pImpl->m_initialized.set();
- }
- virtual void SAL_CALL onTerminated()
- {
- delete this;
- }
-};
-//------------------------------------
-
-
-void test_cache()
-{
- OUString a = OUString( RTL_CONSTASCII_USTRINGPARAM( "a" ) );
- OUString b = OUString( RTL_CONSTASCII_USTRINGPARAM( "b" ) );
- OUString c = OUString( RTL_CONSTASCII_USTRINGPARAM( "c" ) );
- Cache < OUString , equalOUString > cache ( 2 );
-
- sal_Int32 n = cache.put( a );
- if (cache.seek( a ) != n)
- {
- OSL_ASSERT( false );
- }
- OSL_ASSERT( 0 == n );
-
- n = cache.put( b );
- OSL_ASSERT( 1 == n );
-
- cache.put( c );
-
- OSL_ASSERT( 0xffff == cache.seek( a ) );
- OSL_ASSERT( 1 == cache.seek( b ) );
- OSL_ASSERT( 0 == cache.seek( c ) );
-
- OSL_ASSERT( 1 == cache.put( a ) );
- OSL_ASSERT( 0xffff == cache.seek( b) );
- OSL_ASSERT( 1 == cache.seek( a ) );
- OSL_ASSERT( 0 == cache.seek( c ) );
-}
-
-/*******************
- * Are we within thread, that calls destructors of static objects ?
- *******************/
-sal_Bool g_bStaticDestructorsCalled = sal_False;
-struct StaticSingleton
-{
- ~StaticSingleton()
- {
- ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
- g_bStaticDestructorsCalled = sal_True;
- }
-};
-StaticSingleton singleton;
-
-#if OSL_DEBUG_LEVEL > 1
-static MyCounter thisCounter( "Remote Environment" );
-#endif
-
-void SAL_CALL allThreadsAreGone( uno_Environment * pEnvRemote )
-{
- remote_Context *pContext = (remote_Context *) pEnvRemote->pContext;
- urp_BridgeImpl *pImpl = ( urp_BridgeImpl *) pContext->m_pBridgeImpl;
-
- // if the current thread is not the writer thread, the writer thread
- // object is not destroyed up to now, though it may already have run out.
- // In both cases, it must be safe to cal pImpl->m_pWriter->getIdentifier()
- OSL_ASSERT( pImpl->m_pWriter );
- if( pImpl->m_pWriter->getIdentifier() == osl_getThreadIdentifier(0) )
- {
- // This is the writer thread. It has done some release calls,
- // and is now the last one, that was active. Because the writer
- // thread holds the environment weakly, there may also be a thread within
- // the dispose of the bridge ( because the enviroment may have a refcount == 0 ).
- // However, this thread MUST wait for the writer thread, so it is perfectly ok,
- // not to set m_cndWaitForThreads. ( The check for m_nRemoteThreads is done
- // after the join of the writer thread ).
- }
- else
- {
- pImpl->m_cndWaitForThreads.set();
- }
-
-}
-
-void SAL_CALL releaseStubs( uno_Environment *pEnvRemote )
-{
-
- ((remote_Context * ) pEnvRemote->pContext )->m_pBridgeImpl->m_bReleaseStubsCalled = sal_True;
-
- remote_Interface **ppInterfaces = 0;
- sal_Int32 nCount;
- pEnvRemote->pExtEnv->getRegisteredInterfaces( pEnvRemote->pExtEnv,
- (void***)&ppInterfaces,
- &nCount,
- rtl_allocateMemory );
-
- sal_Int32 i;
- for( i = 0 ; i < nCount ; i ++ )
- {
- if( ppInterfaces[i]->acquire == bridges_remote::acquireUno2RemoteStub )
- {
- // these are freed by the environment, so no release necessary
- pEnvRemote->pExtEnv->revokeInterface( pEnvRemote->pExtEnv, ppInterfaces[i] );
- }
- else
- {
- ppInterfaces[i]->release( ppInterfaces[i] );
- }
- }
-
- rtl_freeMemory( (void*) ppInterfaces );
-}
-
-} // end namespace bridges_urp
-
-using namespace bridges_urp;
-
-extern "C" {
-
-static void SAL_CALL RemoteEnvironment_thisDispose( uno_Environment *pEnvRemote )
-{
- remote_Context *pContext = (remote_Context *) pEnvRemote->pContext;
- urp_BridgeImpl *pImpl = ( urp_BridgeImpl *) pContext->m_pBridgeImpl;
-
- ::osl::ClearableMutexGuard guard( pImpl->m_disposingMutex );
- if( pContext->m_pBridgeImpl->m_bDisposed &&
- ( ! pImpl->m_pReader ||
- osl_getThreadIdentifier(0) ==
- (oslThreadIdentifier) pImpl->m_pReader->getIdentifier() ) )
- {
- return;
- }
- // in case, that the static destructors already have been called, no
- // tiding up is done.
- bool tidyUp;
- {
- ::osl::MutexGuard guard2( ::osl::Mutex::getGlobalMutex() );
- tidyUp = ! g_bStaticDestructorsCalled &&
- ! pContext->m_pBridgeImpl->m_bDisposed;
- }
- if( tidyUp )
- {
- // TODO : not threadsafe
- // synchronization with dispatch methods needed !
-
- pImpl->m_bDisposed = sal_True;
-
-
- // close the connection
- uno_threadpool_dispose( pImpl->m_hThreadPool );
- pImpl->m_pWriter->abortThread();
- pContext->m_pConnection->close( pContext->m_pConnection );
-
- if( osl_getThreadIdentifier(0) ==
- (oslThreadIdentifier) pImpl->m_pReader->getIdentifier() )
- {
- // This is the reader thread. Let the thread destroy itself
- // the reader thread object must also release the connection at this stage !
- pImpl->m_pReader->destroyYourself();
- pImpl->m_pReader = 0;
- }
- else
- {
- // wait for the reader thread
- // the reader thread object must also release the connection,
- // when terminating !!!!
- pImpl->m_pReader->join();
- }
-
- // wait for the writer thread
- pImpl->m_pWriter->join();
-
- // now let the context go !
- pContext->dispose( pContext );
-
- if( 0 != pImpl->m_nRemoteThreads )
- {
- // Wait for all threads
- guard.clear();
- pImpl->m_cndWaitForThreads.wait();
- OSL_ASSERT( ! pImpl->m_nRemoteThreads );
- }
- else
- {
- guard.clear();
- }
-#ifdef BRIDGES_URP_PROT
- if( pImpl->m_pLogFile )
- {
- fclose( pImpl->m_pLogFile );
- pImpl->m_pLogFile = 0;
- }
-#endif
-#if OSL_DEBUG_LEVEL > 1
- pImpl->dumpErrors( stderr );
-#endif
-
- // destroy the threads
- delete pImpl->m_pWriter;
- pImpl->m_pWriter = 0;
-
- if( pImpl->m_pReader != 0 )
- {
- // This is not the reader thread, so the thread object is deleted
- delete pImpl->m_pReader;
- pImpl->m_pReader = 0;
- }
-
- bool bReleaseStubs = false;
- {
- ::osl::MutexGuard guard2( ::osl::Mutex::getGlobalMutex() );
- bReleaseStubs = !g_bStaticDestructorsCalled;
- }
- if( bReleaseStubs )
- {
- releaseStubs( pEnvRemote );
- }
- }
-}
-
-static void SAL_CALL RemoteEnvironment_thisDisposing(
- uno_Environment *pEnvRemote )
-{
- remote_Context *pContext = (remote_Context * )pEnvRemote->pContext;
- urp_BridgeImpl *pImpl = ((urp_BridgeImpl*) pContext->m_pBridgeImpl);
-
- {
- ::osl::ClearableMutexGuard guard( pImpl->m_disposingMutex );
- if( ! pImpl->m_bDisposed )
- {
- guard.clear();
- urp_sendCloseConnection( pEnvRemote );
- RemoteEnvironment_thisDispose( pEnvRemote );
- }
- }
- pImpl->m_pPropertyObject->thisRelease();
- pImpl->m_pPropertyObject = 0;
-
- uno_threadpool_destroy( pImpl->m_hThreadPool );
-
- delete pImpl;
- pContext->aBase.release( (uno_Context * ) pContext );
- g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.release();
-#endif
-}
-
-static void SAL_CALL RemoteEnvironment_thisComputeObjectIdentifier(
- uno_ExtEnvironment *, rtl_uString **, void *)
-{
- OSL_ENSURE( 0, "RemoteEnvironment_thisComputeObjectIdentifier should never be called" );
-}
-
-static void SAL_CALL RemoteEnvironment_thisAcquireInterface(
- uno_ExtEnvironment *, void *pInterface )
-{
- ((remote_Interface *)pInterface)->acquire( ( remote_Interface *) pInterface );
-}
-
-static void SAL_CALL RemoteEnvironment_thisReleaseInterface(
- uno_ExtEnvironment *, void *pInterface )
-{
- ((remote_Interface *)pInterface)->release( ( remote_Interface *) pInterface );
-}
-
-//##################################################################################################
-void SAL_CALL uno_initEnvironment( uno_Environment * pEnvRemote )
-{
- g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
- // set C-virtual methods
- pEnvRemote->environmentDisposing = RemoteEnvironment_thisDisposing;
- pEnvRemote->pExtEnv->computeObjectIdentifier = RemoteEnvironment_thisComputeObjectIdentifier;
- pEnvRemote->pExtEnv->acquireInterface = RemoteEnvironment_thisAcquireInterface;
- pEnvRemote->pExtEnv->releaseInterface = RemoteEnvironment_thisReleaseInterface;
- pEnvRemote->dispose = RemoteEnvironment_thisDispose;
-
- remote_Context *pContext = ( remote_Context * ) pEnvRemote->pContext;
- pContext->aBase.acquire( ( uno_Context * ) pContext );
- pContext->getRemoteInstance = ::bridges_remote::remote_sendQueryInterface;
-
- // Initialize impl struct urp_BridgeImpl
- urp_BridgeImpl *pImpl = new ::bridges_urp::urp_BridgeImpl( 256, 8192 );
- pContext->m_pBridgeImpl = pImpl;
-
- // Initialize threadpool
- pImpl->m_hThreadPool = uno_threadpool_create();
-
- // take the bridgepointer as id
- pImpl->m_properties.seqBridgeID = ByteSequence( (sal_Int8*)&pEnvRemote , sizeof( pEnvRemote ) );
-
- pImpl->m_allThreadsAreGone = allThreadsAreGone;
- pImpl->m_sendRequest = urp_sendRequest;
- pImpl->m_nRemoteThreads = 0;
- pImpl->m_bDisposed = sal_False;
- pImpl->m_bReleaseStubsCalled = sal_False;
-
- pImpl->m_pPropertyObject = new PropertyObject( &(pImpl->m_properties ), pEnvRemote, pImpl );
- pImpl->m_pPropertyObject->thisAcquire();
-
- OUString sProtocolProperties;
- if( pContext->m_pProtocol->length > 3 )
- {
- sProtocolProperties = OUString( pContext->m_pProtocol ).copy( 4, pContext->m_pProtocol->length-4);
- }
- if( sProtocolProperties.getLength() )
- {
- struct Properties props = pImpl->m_properties;
- assignFromStringToStruct( sProtocolProperties , &props );
- if( ! props.bNegotiate )
- {
- // no negotiation takes place, the creator of the bridge knows the parameter
- // of the other side !
- pImpl->applyProtocolChanges( props );
- sProtocolProperties = OUString();
- }
- }
-
-#ifdef BRIDGES_URP_PROT
- char *p = getenv( "PROT_REMOTE" );
- pImpl->m_pLogFile = 0;
- if( p )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- static int counter;
- oslProcessInfo data;
- data.Size = sizeof( data );
- osl_getProcessInfo( 0 , osl_Process_HEAPUSAGE | osl_Process_IDENTIFIER , &data );
- OString s(p);
- s += "_pid";
- s += OString::valueOf( (sal_Int32) data.Ident );
- s += "_";
- s += OString::valueOf( (sal_Int32) counter );
- pImpl->m_sLogFileName = s;
- // clear the file
- FILE *f = fopen( s.getStr() , "w" );
- OSL_ASSERT( f );
- if( getenv( "PROT_REMOTE_FAST") )
- {
- pImpl->m_pLogFile = f;
- }
- else
- {
- fclose( f );
- }
- counter++;
- }
-#endif
-
- // start reader and writer threads
- pImpl->m_pWriter = new ::bridges_urp::OWriterThread( pContext->m_pConnection , pImpl,
- pEnvRemote);
- pImpl->m_pWriter->create();
-
- pImpl->m_pReader = new ::bridges_urp::OReaderThread( pContext->m_pConnection ,
- pEnvRemote,
- pImpl->m_pWriter );
- pImpl->m_pReader->create();
-
- PropertySetterThread *pPropsSetterThread =
- new PropertySetterThread( pEnvRemote, pImpl , sProtocolProperties );
- pPropsSetterThread->create();
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.acquire();
-#endif
-}
-
-
-//##################################################################################################
-void SAL_CALL uno_ext_getMapping(
- uno_Mapping ** ppMapping,
- uno_Environment * pFrom,
- uno_Environment * pTo )
-{
- OSL_ASSERT( ppMapping && pFrom && pTo );
- if (ppMapping && pFrom && pTo)
- {
- if (*ppMapping)
- ((*ppMapping)->release)( *ppMapping );
- bridges_remote::RemoteMapping * pMapping = 0;
-
- ::rtl::OUString sFromName = pFrom->pTypeName;
- ::rtl::OUString sToName = pTo->pTypeName;
- ::rtl::OUString sUno = OUString::createFromAscii( UNO_LB_UNO );
- ::rtl::OUString sRemote = OUString::createFromAscii( "urp" );
- if ( sFromName.equalsIgnoreAsciiCase( sRemote ) &&
- sToName.equalsIgnoreAsciiCase( sUno ) )
- {
- pMapping = new bridges_remote::RemoteMapping( pTo, /* Uno */
- pFrom, /*remote*/
- bridges_remote::remoteToUno,
- OUString() );
- }
- else if ( sFromName.equalsIgnoreAsciiCase( sUno ) &&
- sToName.equalsIgnoreAsciiCase( sRemote ) )
- {
- pMapping = new bridges_remote::RemoteMapping( pFrom ,
- pTo ,
- bridges_remote::unoToRemote,
- OUString() );
- }
-
- *ppMapping = (uno_Mapping * )pMapping;
- OUString dummy;
- uno_registerMapping( ppMapping ,
- bridges_remote::freeRemoteMapping,
- pFrom ,
- pTo ,
- dummy.pData );
- }
-}
-
-sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
-{
- return g_moduleCount.canUnload( &g_moduleCount , pTime );
-}
-
-}
diff --git a/bridges/source/remote/urp/urp_job.cxx b/bridges/source/remote/urp/urp_job.cxx
deleted file mode 100644
index 8828f7f37f64..000000000000
--- a/bridges/source/remote/urp/urp_job.cxx
+++ /dev/null
@@ -1,939 +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_bridges.hxx"
-#include <string.h>
-#include <stdio.h>
-#include <osl/diagnose.h>
-#include <osl/mutex.hxx>
-
-#include <rtl/alloc.h>
-#include <rtl/ustrbuf.hxx>
-
-#include <uno/current_context.h>
-#include <uno/current_context.hxx>
-#include <uno/threadpool.h>
-
-#include <bridges/cpp_uno/type_misc.hxx>
-#include <bridges/remote/proxy.hxx>
-
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/XCurrentContext.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-
-#include "urp_job.hxx"
-#include "urp_bridgeimpl.hxx"
-#include "urp_writer.hxx"
-#include "urp_dispatch.hxx"
-#include "urp_log.hxx"
-#include "urp_marshal.hxx"
-#include "urp_propertyobject.hxx"
-#include "urp_reader.hxx"
-
-using namespace ::std;
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::com::sun::star::uno;
-
-using namespace bridges_urp;
-
-extern "C" {
-
-static void SAL_CALL doit(void * job) {
- ServerMultiJob * p = static_cast< ServerMultiJob * >(job);
- p->execute();
- delete p;
-}
-
-}
-
-namespace bridges_urp
-{
- static sal_Bool isDisposedExceptionDescriptionAvail( const Type &type )
- {
- static sal_Bool bInit;
- static sal_Bool bReturn;
- // we don't care for thread safety here, as both threads must come
- // to the same result
- if( ! bInit )
- {
- typelib_TypeDescription *pTD = 0;
- typelib_typedescriptionreference_getDescription( & pTD, type.getTypeLibType() );
- if( pTD )
- {
- bReturn = sal_True;
- typelib_typedescription_release( pTD );
- }
- else
- {
- bReturn = sal_False;
- }
- bInit = sal_True;
- }
- return bReturn;
- }
-
- //--------------------------------------------------------------------------------------
- static void prepareRuntimeExceptionClientSide( uno_Any **ppException , const OUString &s)
- {
- com::sun::star::lang::DisposedException exception( s , Reference< XInterface > () );
- Type type = ::getCppuType( &exception );
- if( !isDisposedExceptionDescriptionAvail( type ) )
- {
- // if it is not available (probably missing type library),
- // then we are satisfied with throwing a normal runtime exception,
- // for which cppu provides a static description
- type = getCppuType( ( RuntimeException * ) 0 );
- }
- uno_type_any_construct( *ppException , &exception , type.getTypeLibType() , 0 );
- }
-
-
- Job::Job( uno_Environment *pEnvRemote,
- remote_Context *pContext,
- sal_Sequence *pTid,
- struct urp_BridgeImpl *pBridgeImpl,
- Unmarshal *pUnmarshal )
- : m_pContext( pContext )
- , m_pUnmarshal( pUnmarshal )
- , m_pBridgeImpl( pBridgeImpl )
- , m_pTid( pTid )
- , m_counter( pEnvRemote )
- {
- if ( m_pContext )
- {
- m_pContext->aBase.acquire( &m_pContext->aBase );
- }
- if( m_pTid )
- rtl_byte_sequence_acquire( pTid );
- }
-
- Job::~Job()
- {
- if( m_pTid )
- rtl_byte_sequence_release( m_pTid );
- if ( m_pContext )
- {
- m_pContext->aBase.release( &m_pContext->aBase );
- }
- }
-
-
-
-
- //--------------------------------------------------------------------------------------
- sal_Bool ClientJob::extract( )
- {
- sal_Bool bReturn = sal_True;
- //-------------------------------
- // Handle the reply, unpack data
- //-------------------------------
- if( m_bExceptionOccured )
- {
- bReturn = m_pUnmarshal->unpackAny( *m_ppException );
- }
- else
- {
- //---------------------------------
- // alles ist gut
- //---------------------------------
- if( m_pMethodType )
- {
- if( m_pMethodType->pReturnTypeRef->eTypeClass != typelib_TypeClass_VOID )
- {
- typelib_TypeDescription *pType = 0;
- TYPELIB_DANGER_GET( &pType , m_pMethodType->pReturnTypeRef );
- bReturn = m_pUnmarshal->unpack( m_pReturn , pType ) && bReturn;
- TYPELIB_DANGER_RELEASE( pType );
- }
-
- // out parameters
- sal_Int32 i;
- for( i = 0 ; i < m_pMethodType->nParams ; i ++ )
- {
- if( m_pMethodType->pParams[i].bOut )
- {
- typelib_TypeDescription *pType = 0;
- TYPELIB_DANGER_GET( &pType , m_pMethodType->pParams[i].pTypeRef );
- if( m_pMethodType->pParams[i].bIn )
- {
- uno_destructData( m_ppArgs[i] , pType , ::bridges_remote::remote_release );
- }
- bReturn = m_pUnmarshal->unpack( m_ppArgs[i] , pType ) && bReturn;
- TYPELIB_DANGER_RELEASE( pType );
- }
- }
- }
- else if( m_pAttributeType && m_pReturn )
- {
- typelib_TypeDescription *pType = 0;
- TYPELIB_DANGER_GET( &pType , m_pAttributeType->pAttributeTypeRef );
- bReturn = m_pUnmarshal->unpack( m_pReturn , pType ) && bReturn;
- TYPELIB_DANGER_RELEASE( pType );
- }
- else if( m_pAttributeType && m_ppArgs )
- {
- // nothing to do
- }
- else
- {
- OSL_ASSERT( 0 );
- }
- }
- return bReturn;
- }
-
- //-------------------------------------------------------------------------------------------
- void ClientJob::initiate()
- {
- uno_threadpool_putJob( m_pBridgeImpl->m_hThreadPool, m_pTid , this, 0, sal_False);
- }
-
- //--------------------------------------------------------------------------------------------
- sal_Bool ClientJob::pack()
- {
- sal_Bool bSuccess = sal_True;
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
-
- if( m_pMethodType &&
- REMOTE_RELEASE_METHOD_INDEX == m_pMethodType->aBase.nPosition &&
- ! m_pBridgeImpl->m_bDisposed &&
- m_pBridgeImpl->m_pWriter->getIdentifier() != ::osl::Thread::getCurrentIdentifier() )
- {
- // all release calls are delegated to the writer thread to avoid
- // multiple synchron calls with the same thread id and reentrant
- // marshaling (in case during destruction of parameters a release is
- // invoked ).
- m_pBridgeImpl->m_pWriter->insertReleaseRemoteCall(
- m_pOid, m_pInterfaceType->aBase.pWeakRef );
-
- // No waiting, please
- return sal_False;
- }
- else if ( m_pMethodType &&
- REMOTE_RELEASE_METHOD_INDEX == m_pMethodType->aBase.nPosition &&
- m_pBridgeImpl->m_bDisposed )
- {
- // no exception for release calls !
- return sal_False;
- }
- else if( m_pBridgeImpl->m_bDisposed )
- {
- OUStringBuffer buf( 128 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "URP-Bridge: disposed" ) );
- buf.append( m_pBridgeImpl->getErrorsAsString() );
- prepareRuntimeExceptionClientSide( m_ppException , buf.makeStringAndClear() );
- return sal_False;
- }
-
- // build up the flag byte
- sal_Bool bType = sal_False, bOid = sal_False, bTid = sal_False;
- sal_uInt8 nFlags = 0;
- if( m_pBridgeImpl->m_lastOutType.getTypeLibType() != m_pInterfaceType->aBase.pWeakRef &&
- ! typelib_typedescriptionreference_equals(
- m_pBridgeImpl->m_lastOutType.getTypeLibType(), m_pInterfaceType->aBase.pWeakRef ) )
- {
- //new type
- nFlags = nFlags | HDRFLAG_NEWTYPE;
- bType = sal_True;
- }
- if( m_pBridgeImpl->m_lastOutOid.pData != m_pOid &&
- rtl_ustr_compare_WithLength( m_pBridgeImpl->m_lastOutOid.pData->buffer,
- m_pBridgeImpl->m_lastOutOid.pData->length,
- m_pOid->buffer,
- m_pOid->length ) )
- {
- //new object id
- nFlags = nFlags | HDRFLAG_NEWOID;
- bOid = sal_True;
- }
- if( m_pBridgeImpl->m_lastOutTid.getHandle() != m_pTid &&
- !(m_pBridgeImpl->m_lastOutTid == *(ByteSequence*) &(m_pTid) ) )
- {
- // new threadid
- nFlags = nFlags | HDRFLAG_NEWTID;
- bTid = sal_True;
- }
-
- if( m_bCallingConventionForced )
- {
- nFlags = nFlags | HDRFLAG_MOREFLAGS;
- }
-#ifdef BRIDGES_URP_PROT
- sal_Int32 nLogStart = m_pBridgeImpl->m_blockMarshaler.getPos();
-#endif
- // Short request headers can only handle 14-bit method IDs, so
- // unconditionally use a long header for method IDs that are too large:
- if( nFlags || m_nMethodIndex >= 0xC000 )
- {
- // the flag byte is needed + request
- nFlags = nFlags | HDRFLAG_LONGHEADER | HDRFLAG_REQUEST; //
-
- // as long as we do not have customized calls, no MOREFLAGS must be set
- if( m_nMethodIndex >= 0x100 )
- {
- nFlags = nFlags | HDRFLAG_LONGMETHODID;
- }
- m_pBridgeImpl->m_blockMarshaler.packInt8( &nFlags );
-
- if( nFlags & HDRFLAG_MOREFLAGS )
- {
- sal_uInt8 nMoreFlags = 0;
- if( ! m_bOneway )
- {
- nMoreFlags = HDRFLAG_SYNCHRONOUS |HDRFLAG_MUSTREPLY;
- }
- m_pBridgeImpl->m_blockMarshaler.packInt8( &nMoreFlags );
- }
- if( nFlags & HDRFLAG_LONGMETHODID )
- {
- sal_uInt16 nMethod = (sal_uInt16 ) m_nMethodIndex;
- m_pBridgeImpl->m_blockMarshaler.packInt16( &nMethod );
- }
- else
- {
- sal_uInt8 nMethod = (sal_uInt8) m_nMethodIndex;
- m_pBridgeImpl->m_blockMarshaler.packInt8( &nMethod );
- }
- }
- else
- {
- // no flag byte needed, simply marshal the method index
- if( m_nMethodIndex >= 64 )
- {
- sal_uInt16 nMethod = ( sal_uInt16 ) m_nMethodIndex;
- nMethod = nMethod | 0x4000;
- m_pBridgeImpl->m_blockMarshaler.packInt16( &nMethod );
- }
- else
- {
- sal_uInt8 nMethod = (sal_uInt8 ) m_nMethodIndex;
- m_pBridgeImpl->m_blockMarshaler.packInt8( &nMethod );
- }
- }
-
- // marshal type,oid,tid
- if( bType )
- {
- m_pBridgeImpl->m_lastOutType = m_pInterfaceType->aBase.pWeakRef;
- m_pBridgeImpl->m_blockMarshaler.packType( &(m_pBridgeImpl->m_lastOutType) );
- }
- if( bOid )
- {
- m_pBridgeImpl->m_lastOutOid = *(OUString *)&m_pOid;
- m_pBridgeImpl->m_blockMarshaler.packOid( m_pBridgeImpl->m_lastOutOid );
- }
- if( bTid )
- {
- m_pBridgeImpl->m_lastOutTid = *(ByteSequence*)&(m_pTid);
- m_pBridgeImpl->m_blockMarshaler.packTid( m_pBridgeImpl->m_lastOutTid );
- }
-
- if ( m_pBridgeImpl->m_properties.bCurrentContext
- && m_nMethodIndex != REMOTE_RELEASE_METHOD_INDEX
- && m_pContext != 0 )
- {
- void * pCc = 0;
- rtl::OUString aEnvName( RTL_CONSTASCII_USTRINGPARAM( "urp" ) );
- bSuccess = bSuccess && uno_getCurrentContext(
- &pCc, aEnvName.pData, m_pContext );
- typelib_TypeDescription * pType = 0;
- TYPELIB_DANGER_GET(
- &pType, XCurrentContext::static_type().getTypeLibType() );
- bSuccess = bSuccess && m_pBridgeImpl->m_blockMarshaler.pack(
- &pCc, pType );
- TYPELIB_DANGER_RELEASE( pType );
- if ( pCc )
- {
- remote_Interface * p = static_cast< remote_Interface * >( pCc );
- p->release( p );
- }
- }
-
- // marshal arguments !
-#ifdef BRIDGES_URP_PROT
- sal_Int32 nLogHeader = m_pBridgeImpl->m_blockMarshaler.getPos();
-#endif
- if( m_pMethodType )
- {
- sal_Int32 i;
- for( i = 0 ; i < m_pMethodType->nParams ; i ++ )
- {
- if( m_pMethodType->pParams[i].bIn )
- {
- typelib_TypeDescription *pType = 0;
- TYPELIB_DANGER_GET( &pType , m_pMethodType->pParams[i].pTypeRef );
- if( pType )
- {
- bSuccess =
- bSuccess && m_pBridgeImpl->m_blockMarshaler.pack( m_ppArgs[i] , pType );
- TYPELIB_DANGER_RELEASE( pType );
- }
- else
- {
- bSuccess = sal_False;
- OUStringBuffer buffer( 128 );
- buffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "no typedescription available for type" ) );
- buffer.append( m_pMethodType->pParams[i].pTypeRef->pTypeName );
- m_pBridgeImpl->addError( buffer.makeStringAndClear() );
- }
- }
- }
- }
- else if( m_pAttributeType && m_pReturn )
- {
- // nothing to do !
- }
- else if( m_pAttributeType && m_ppArgs )
- {
- typelib_TypeDescription *pType = 0;
- TYPELIB_DANGER_GET( &pType , m_pAttributeType->pAttributeTypeRef );
- if( pType )
- {
- bSuccess = bSuccess && m_pBridgeImpl->m_blockMarshaler.pack( m_ppArgs[0] , pType );
- TYPELIB_DANGER_RELEASE( pType );
- }
- else
- {
- bSuccess = sal_False;
- OUStringBuffer buffer( 128 );
- buffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "no typedescription available for type" ) );
- buffer.append( m_pAttributeType->pAttributeTypeRef->pTypeName );
- m_pBridgeImpl->addError( buffer.makeStringAndClear() );
- }
- }
- else
- {
- OSL_ASSERT( 0 );
- }
-
-#ifdef BRIDGES_URP_PROT
- urp_logCall( m_pBridgeImpl, m_pBridgeImpl->m_blockMarshaler.getPos() - nLogStart,
- m_pBridgeImpl->m_blockMarshaler.getPos() - nLogHeader, ! m_bOneway,
- m_pMethodType ? m_pMethodType->aBase.pMemberName :
- m_pAttributeType->aBase.pMemberName );
-#endif
-
- if( bSuccess )
- {
- if( ! m_bOneway )
- {
- uno_threadpool_attach( m_pBridgeImpl->m_hThreadPool );
- m_pBridgeImpl->m_clientJobContainer.add( *(ByteSequence*)&(m_pTid), this );
- }
-
- m_pBridgeImpl->m_nMarshaledMessages ++;
- //---------------------------
- // Inform the writer thread, that there is some work to do
- //---------------------------
- m_pBridgeImpl->m_pWriter->touch( ! m_bOneway );
-
- if( m_bOneway )
- {
- *m_ppException = 0;
- }
- }
- else
- {
- // Something went wrong during packing, which means, that the caches may not be in sync
- // anymore. So we have no other choice than to dispose the environment.
- m_pEnvRemote->dispose( m_pEnvRemote );
- OUStringBuffer buf( 128 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Error during marshaling " ) );
- if( m_pMethodType )
- {
- buf.append( m_pMethodType->aBase.aBase.pTypeName );
- }
- else if( m_pAttributeType )
- {
- buf.append( m_pAttributeType->aBase.aBase.pTypeName );
- }
- buf.appendAscii( "\n" );
- buf.append( m_pBridgeImpl->getErrorsAsString() );
- prepareRuntimeExceptionClientSide( m_ppException , buf.makeStringAndClear() );
- }
- return bSuccess;
- // release the guard
- }
-
- //------------------------------------------------------------------------------------
- void ClientJob::wait()
- {
- //---------------------------
- // Wait for the reply
- //---------------------------
- void * pDisposeReason = 0;
-
- uno_threadpool_enter(m_pBridgeImpl->m_hThreadPool, &pDisposeReason );
-
- if( ! pDisposeReason )
- {
- // thread has been disposed !
- // avoid leak due continous calling on a disposed reference. The
- // reply may or may not be within the container. If the reader thread
- // got into problems during unmarshaling the reply for this request,
- // it won't be in the container anymore, but it is eiterway safe to call
- // the method
- ClientJob *pJob =
- m_pBridgeImpl->m_clientJobContainer.remove( *(ByteSequence*) &m_pTid );
- if( pJob != this )
- {
- // this is not our job, it is probably one of the callstack below, so
- // push it back
- m_pBridgeImpl->m_clientJobContainer.add( *(ByteSequence*) &m_pTid , pJob );
- }
-
- OUStringBuffer sMessage( 256 );
- sMessage.appendAscii( RTL_CONSTASCII_STRINGPARAM( "URP_Bridge : disposed\n" ) );
- sMessage.append( m_pBridgeImpl->getErrorsAsString() );
- prepareRuntimeExceptionClientSide( m_ppException, sMessage.makeStringAndClear() );
- m_bExceptionOccured = sal_True;
- }
- else
- {
- OSL_ASSERT( pDisposeReason == (void*)this );
- }
- if( !m_bExceptionOccured )
- {
- *m_ppException = 0;
- }
- uno_threadpool_detach( m_pBridgeImpl->m_hThreadPool );
- }
-
- //------------------------------------------------------------------------------------
- // ServerMultiJob
- //------------------------------------------------------------------------------------
- ServerMultiJob::ServerMultiJob(
- uno_Environment *pEnvRemote,
- remote_Context *pContext,
- sal_Sequence *pTid,
- struct urp_BridgeImpl *pBridgeImpl,
- Unmarshal *pUnmarshal,
- sal_Int32 nMaxMessages )
- : Job( pEnvRemote, pContext, pTid, pBridgeImpl, pUnmarshal )
- , m_pEnvRemote( pEnvRemote )
- , m_nCalls( 0 )
- , m_nMaxMessages( nMaxMessages )
- , m_nCurrentMemPosition( 0 )
- {
- m_pEnvRemote->acquire( m_pEnvRemote );
- m_nCurrentMemSize = MULTIJOB_STANDARD_MEMORY_SIZE + m_nMaxMessages * (
- MULTIJOB_PER_CALL_MEMORY_SIZE + sizeof(ServerJobEntry) + sizeof(MemberTypeInfo) );
- m_pCurrentMem = ( sal_Int8 * ) rtl_allocateMemory( m_nCurrentMemSize );
- m_aEntries = ( ServerJobEntry * ) getHeap( m_nMaxMessages * sizeof( ServerJobEntry ) );
- m_aTypeInfo = ( MemberTypeInfo * ) getHeap( m_nMaxMessages * sizeof( MemberTypeInfo ) );
- }
-
- ServerMultiJob::~ServerMultiJob()
- {
- sal_Int32 i;
- for( i = 0 ; i < m_nCalls ; i ++ )
- {
- struct MemberTypeInfo *const pMTI = &( m_aTypeInfo[i] );
- struct ServerJobEntry *const pSJE = &( m_aEntries[i] );
-
- if( pSJE->m_pRemoteI )
- pSJE->m_pRemoteI->release( pSJE->m_pRemoteI );
-
- if( pSJE->m_pOid )
- rtl_uString_release( pSJE->m_pOid );
-
- if( pSJE->m_pInterfaceTypeRef )
- typelib_typedescriptionreference_release( pSJE->m_pInterfaceTypeRef );
-
- if( pMTI->m_pInterfaceType )
- TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *)pMTI->m_pInterfaceType );
-
- for( sal_Int32 iArgs = 0 ; iArgs < pMTI->m_nArgCount ; iArgs ++ )
- {
- if( pMTI->m_ppArgType[iArgs] )
- TYPELIB_DANGER_RELEASE( pMTI->m_ppArgType [iArgs] );
- }
- if( pMTI->m_pReturnType )
- TYPELIB_DANGER_RELEASE( pMTI->m_pReturnType );
-
- if( pMTI->m_pMethodType )
- typelib_typedescription_release( (typelib_TypeDescription*)pMTI->m_pMethodType );
- if( pMTI->m_pAttributeType )
- typelib_typedescription_release( (typelib_TypeDescription*)pMTI->m_pAttributeType );
- }
-
- rtl_freeMemory( m_pCurrentMem );
- for( list< sal_Int8 *>::iterator ii = m_lstMem.begin() ; ii != m_lstMem.end() ; ++ii )
- rtl_freeMemory( *ii );
-
- if( m_pEnvRemote )
- m_pEnvRemote->release( m_pEnvRemote );
- }
-
- //-------------------------------------------------------------------------------------
- void ServerMultiJob::execute()
- {
- Reference< XCurrentContext > xOldCc;
- bool bHasOldCc = false;
- for( sal_Int32 i = 0; i < m_nCalls ; i ++ )
- {
- struct MemberTypeInfo * const pMTI = &( m_aTypeInfo[i] );
- struct ServerJobEntry * const pSJE = &( m_aEntries[i] );
-
- if ( pSJE->m_bHasCurrentContext )
- {
- if ( !bHasOldCc )
- {
- xOldCc = com::sun::star::uno::getCurrentContext();
- bHasOldCc = true;
- }
- rtl::OUString aEnvName( RTL_CONSTASCII_USTRINGPARAM( "urp" ) );
- if ( !uno_setCurrentContext(
- pSJE->m_pCurrentContext, aEnvName.pData, m_pContext ) )
- {
- throw RuntimeException(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "fatal: uno_setCurrentContext failed" ) ),
- Reference< XInterface >() );
- }
- if ( pSJE->m_pCurrentContext )
- {
- pSJE->m_pCurrentContext->release( pSJE->m_pCurrentContext );
- }
- }
-
- if( ! pSJE->m_pRemoteI )
- {
- // -------------------
- // Initial object ?
- // ------------------
- // be robust : Sending a release on a not constructed object
- // provokes an segfault. Make sure, the call
- // is not a release call.
- remote_Context *pRemoteC = ((remote_Context*)m_pEnvRemote->pContext);
-
- if( ! pMTI->m_bIsReleaseCall && pRemoteC->m_pInstanceProvider )
- {
- pSJE->m_pException = &(pSJE->m_exception);
-
- pRemoteC->m_pInstanceProvider->getInstance(
- pRemoteC->m_pInstanceProvider,
- m_pEnvRemote,
- &(pSJE->m_pRemoteI),
- pSJE->m_pOid,
- pMTI->m_pInterfaceType,
- &(pSJE->m_pException));
- }
- else
- {
- prepareRuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "urp: No instance provider set")),i);
- }
- }
-
- if( pSJE->m_pException )
- {
- // errors during extracting, do nothing
- }
- else if( ! pSJE->m_pRemoteI )
- {
- // May only occur during the queryInterface call on the initial object !!!
- // construct the return value
- uno_type_any_construct( (uno_Any*) pSJE->m_pReturn , 0 , 0 , 0 );
- }
- else
- {
- pSJE->m_pException = &(pSJE->m_exception );
-
- if( pMTI->m_bIsReleaseCall )
- {
- pSJE->m_pRemoteI->release( pSJE->m_pRemoteI );
- pSJE->m_pException = 0;
- }
- else
- {
- pSJE->m_pRemoteI->pDispatcher(
- pSJE->m_pRemoteI,
- pMTI->m_pMethodType ? (typelib_TypeDescription*) pMTI->m_pMethodType :
- (typelib_TypeDescription*) pMTI->m_pAttributeType,
- pSJE->m_pReturn,
- pSJE->m_ppArgs,
- &(pSJE->m_pException) );
- }
- }
- if( pSJE->m_pRemoteI )
- {
- /**
- Do the release here, in case of ForceSynchronous=1, calls
- originated by the destructor of an UNO object must be sent BEFORE the
- release returns ( otherwise we don't own the thread anymore ! )
- */
- pSJE->m_pRemoteI->release( pSJE->m_pRemoteI );
- pSJE->m_pRemoteI = 0;
- }
-
- // now destruct parameters and marshal replies
- // Note : when call is synchron => m_nCalls == 1
- if( pMTI->m_bIsOneway )
- {
- // Oneway call, destruct in parameters
- for( sal_Int32 j = 0 ; j < pMTI->m_pMethodType->nParams ; j ++ )
- {
- // usually all parameters must be in parameters, but to be robust ...
- if( pMTI->m_pbIsIn[j] && !cppu_isSimpleType( pMTI->m_ppArgType[j] ) )
- {
- uno_destructData( pSJE->m_ppArgs[j] , pMTI->m_ppArgType[j] , 0 );
- }
- }
-
- if( pSJE->m_pException )
- {
- uno_any_destruct( pSJE->m_pException, ::bridges_remote::remote_release );
- }
-
- }
- else
- {
- // synchron, get the mutex to marshal reply and send immeadiatly
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
-
- sal_Bool bTid = sal_False;
- sal_uInt8 nFlags = HDRFLAG_LONGHEADER;
- ByteSequence tid = m_pTid;
- if( !( tid == m_pBridgeImpl->m_lastOutTid ) || pSJE->m_bIgnoreCache )
- {
- // new threadid
- nFlags = nFlags | HDRFLAG_NEWTID;
- bTid = sal_True;
- }
-
- if( pSJE->m_pException )
- {
- nFlags = nFlags | HDRFLAG_EXCEPTION;
- }
-#ifdef BRIDGES_URP_PROT
- sal_Int32 nLogStart = m_pBridgeImpl->m_blockMarshaler.getPos();
-#endif
- m_pBridgeImpl->m_blockMarshaler.packInt8( &nFlags );
-
- if( bTid )
- {
- if( ! pSJE->m_bIgnoreCache )
- {
- m_pBridgeImpl->m_lastOutTid = tid;
- }
- m_pBridgeImpl->m_blockMarshaler.packTid( tid , pSJE->m_bIgnoreCache );
- }
-
-#ifdef BRIDGES_URP_PROT
- sal_Int32 nLogHeader = m_pBridgeImpl->m_blockMarshaler.getPos();
-#endif
-
- if( pSJE->m_pException )
- {
- //--------------------
- // an exception was thrown
- //--------------------
- m_pBridgeImpl->m_blockMarshaler.packAny( &(pSJE->m_exception) );
- uno_any_destruct( &(pSJE->m_exception) , ::bridges_remote::remote_release );
-
- // destroy in parameters
- for( sal_Int32 j = 0 ; j < pMTI->m_nArgCount ; j ++ )
- {
- if( pMTI->m_pbIsIn[j] && ! cppu_isSimpleType( pMTI->m_ppArgType[j] ))
- {
- uno_destructData( pSJE->m_ppArgs[j] , pMTI->m_ppArgType[j] ,
- ::bridges_remote::remote_release );
- }
- }
- }
- else
- {
- //---------------------------
- // alles ist gut ...
- //--------------------------
- if( pMTI->m_pReturnType )
- {
- m_pBridgeImpl->m_blockMarshaler.pack(
- pSJE->m_pReturn, pMTI->m_pReturnType );
- if( ! cppu_isSimpleType( pMTI->m_pReturnType ) )
- {
- uno_destructData( pSJE->m_pReturn , pMTI->m_pReturnType ,
- ::bridges_remote::remote_release );
- }
- }
- for( sal_Int32 j = 0 ; j < pMTI->m_nArgCount ; j ++ )
- {
- if( pMTI->m_pbIsOut[j] )
- {
- m_pBridgeImpl->m_blockMarshaler.pack(
- pSJE->m_ppArgs[j] , pMTI->m_ppArgType[j] );
- }
- if( ! cppu_isSimpleType( pMTI->m_ppArgType[j] ) )
- {
- uno_destructData( pSJE->m_ppArgs[j], pMTI->m_ppArgType[j] ,
- ::bridges_remote::remote_release );
- }
- }
- }
-
-#ifdef BRIDGES_URP_PROT
- {
- typelib_InterfaceMemberTypeDescription *pMemberType =
- pMTI->m_pMethodType ?
- (typelib_InterfaceMemberTypeDescription*)pMTI->m_pMethodType :
- (typelib_InterfaceMemberTypeDescription*)pMTI->m_pAttributeType;
-
- urp_logReplying( m_pBridgeImpl ,
- m_pBridgeImpl->m_blockMarshaler.getPos() - nLogStart,
- m_pBridgeImpl->m_blockMarshaler.getPos() - nLogHeader,
- pMemberType->pMemberName );
- }
-#endif
-
- m_pBridgeImpl->m_nMarshaledMessages ++;
- // put it on the wire
- m_pBridgeImpl->m_pWriter->touch( sal_True );
- } // MutexGuard marshalingMutex
- }
- if ( bHasOldCc )
- {
- if ( !com::sun::star::uno::setCurrentContext( xOldCc ) )
- {
- throw RuntimeException(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "fatal: com::sun::star::uno::setCurrentContext"
- " failed" ) ),
- Reference< XInterface >() );
- }
- }
- }
-
- //-------------------------------------------------------------------------------------
- void ServerMultiJob::prepareRuntimeException( const OUString & sMessage , sal_Int32 nCall )
- {
- // -------------------------------
- // Construct the DisposedException
- // -------------------------------
- com::sun::star::lang::DisposedException exception( sMessage , Reference< XInterface > () );
- Type type = getCppuType( &exception );
- if( !isDisposedExceptionDescriptionAvail( type ) )
- {
- // if it is not available (probably missing type library),
- // then we are satisfied with throwing a normal runtime exception,
- // for which cppu provides a static description
- type = getCppuType( ( RuntimeException * ) 0 );
- }
-
- m_aEntries[nCall].m_pException = &(m_aEntries[nCall].m_exception);
- uno_type_any_construct( m_aEntries[nCall].m_pException , &exception , type.getTypeLibType() , 0 );
- }
-
- //-------------------------------------------------------------------------------------
- void ServerMultiJob::initiate()
- {
- uno_threadpool_putJob(
- m_pBridgeImpl->m_hThreadPool,
- m_pTid,
- this,
- doit,
- m_aTypeInfo[0].m_bIsOneway );
- }
-
-
- //-------------------------------------------------------------------------------------
- sal_Bool ServerMultiJob::extract()
- {
- sal_Bool bContinue = sal_True;
- struct MemberTypeInfo * const pMTI = &(m_aTypeInfo[m_nCalls]);
- struct ServerJobEntry * const pSJE = &(m_aEntries[m_nCalls]);
-
- pSJE->m_pException = 0;
- pSJE->m_ppArgs = 0;
- pSJE->m_pReturn = 0;
- pMTI->m_pReturnType = 0;
-
- if( pMTI->m_nArgCount )
- {
- pMTI->m_ppArgType =
- ( typelib_TypeDescription ** ) getHeap( sizeof(void*) * pMTI->m_nArgCount );
- pSJE->m_ppArgs = (void**) getHeap( sizeof( void * ) * pMTI->m_nArgCount );
- pMTI->m_pbIsIn = (sal_Bool *) getHeap( sizeof( sal_Bool ) * pMTI->m_nArgCount );
- pMTI->m_pbIsOut = (sal_Bool *) getHeap( sizeof( sal_Bool ) * pMTI->m_nArgCount );
- }
- if( pMTI->m_pMethodType &&
- pMTI->m_pMethodType->pReturnTypeRef->eTypeClass != typelib_TypeClass_VOID )
- {
- TYPELIB_DANGER_GET( &(pMTI->m_pReturnType), pMTI->m_pMethodType->pReturnTypeRef );
- }
- else if( pMTI->m_pAttributeType && ! pMTI->m_nArgCount )
- {
- TYPELIB_DANGER_GET( &(pMTI->m_pReturnType) , pMTI->m_pAttributeType->pAttributeTypeRef );
- }
-
- // normal method
- if( pMTI->m_pMethodType )
- {
- for( sal_Int32 i = 0 ; i < pMTI->m_nArgCount ; i ++ )
- {
- pMTI->m_ppArgType[i] = 0;
- TYPELIB_DANGER_GET( & ( pMTI->m_ppArgType[i] ) , pMTI->m_pMethodType->pParams[i].pTypeRef);
- pMTI->m_pbIsIn[i] = pMTI->m_pMethodType->pParams[i].bIn;
- pMTI->m_pbIsOut[i] = pMTI->m_pMethodType->pParams[i].bOut;
-
- pSJE->m_ppArgs[i] = getHeap( pMTI->m_ppArgType[i]->nSize );
- if( pMTI->m_pbIsIn[i] )
- {
- // everything needs to be constructed
- bContinue = m_pUnmarshal->unpack(
- pSJE->m_ppArgs[i], pMTI->m_ppArgType[i] ) && bContinue;
- }
- }
- }
- else if( pMTI->m_nArgCount )
- {
- // set attribut
- pMTI->m_ppArgType[0] = 0;
- pMTI->m_pbIsIn[0] = sal_True;
- pMTI->m_pbIsOut[0] = sal_False;
- TYPELIB_DANGER_GET(
- & ( pMTI->m_ppArgType[0] ) , pMTI->m_pAttributeType->pAttributeTypeRef );
- pSJE->m_ppArgs[0] = getHeap( pMTI->m_ppArgType[0]->nSize );
- bContinue = m_pUnmarshal->unpack(
- pSJE->m_ppArgs[0], pMTI->m_ppArgType[0] ) && bContinue;
- }
-
- if( pMTI->m_pReturnType )
- {
- pSJE->m_pReturn = getHeap( pMTI->m_pReturnType->nSize );
- }
-
- m_nCalls ++;
- return bContinue;
- }
-}
-
-
diff --git a/bridges/source/remote/urp/urp_job.hxx b/bridges/source/remote/urp/urp_job.hxx
deleted file mode 100644
index 1bafaf9f5162..000000000000
--- a/bridges/source/remote/urp/urp_job.hxx
+++ /dev/null
@@ -1,379 +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 _URP_JOB_HXX_
-#define _URP_JOB_HXX_
-#include <list>
-#include <typelib/typedescription.hxx>
-#include <uno/any2.h>
-#include <uno/environment.h>
-#include <uno/threadpool.h>
-#include "urp_threadid.hxx"
-#include "urp_unmarshal.hxx"
-#include "urp_bridgeimpl.hxx"
-
-
-namespace bridges_urp
-{
-const sal_Int32 MULTIJOB_STANDARD_MEMORY_SIZE = 1024;
-const sal_Int32 MULTIJOB_PER_CALL_MEMORY_SIZE = 96;
-
-class Unmarshal;
-struct urp_BridgeImpl;
-
-template < class t >
-inline t mymax( const t &t1 , const t &t2 )
-{
- return t1 > t2 ? t1 : t2;
-}
-
-class Job
-{
-public:
- Job( uno_Environment *pEnvRemote,
- remote_Context *pContext,
- sal_Sequence *pTid,
- struct urp_BridgeImpl *pBridgeImpl,
- Unmarshal *pUnmarshal );
-
- Job( uno_Environment *pEnvRemote,
- remote_Context *pContext,
- struct urp_BridgeImpl *pBridgeImpl,
- ::bridges_remote::RemoteThreadCounter_HoldEnvWeak value )
- : m_pContext( pContext )
- , m_pBridgeImpl( pBridgeImpl )
- , m_pTid( 0 )
- , m_counter( pEnvRemote , value )
- {
- if ( m_pContext )
- {
- m_pContext->aBase.acquire( &m_pContext->aBase );
- }
- }
-
- ~Job();
-
-public:
- remote_Context *m_pContext;
- Unmarshal *m_pUnmarshal;
- struct urp_BridgeImpl *m_pBridgeImpl;
- sal_Sequence *m_pTid;
- ::bridges_remote::RemoteThreadCounter m_counter;
-};
-
-class ClientJob : private Job
-{
-public:
- // pContext is null for bridge-internal UrpProtocolProperties requests
- inline ClientJob( uno_Environment *pEnvRemote, // weak !
- remote_Context *pContext,
- struct urp_BridgeImpl *pBridgeImpl,
- rtl_uString *pOid, // weak
- typelib_TypeDescription const * pMemberType, // weak
- typelib_InterfaceTypeDescription *pInterfaceType, // weak
- void *pReturn,
- void *ppArgs[],
- uno_Any **ppException );
-
- // ~ClientJob
- // no release for method type and attribute type necessary, because
- // it was acquired by the caller of urp_sendRequest. The lifetime
- // of the ClientJob object is always shorter than the urp_sendRequest call.
- inline ~ClientJob()
- {
- if( m_bReleaseForTypeDescriptionNecessary )
- typelib_typedescription_release( (typelib_TypeDescription*) m_pInterfaceType );
- uno_releaseIdFromCurrentThread();
- }
-
- sal_Bool pack();
- void wait();
- sal_Bool extract( );
- void initiate();
-
- inline void setBridgePropertyCall()
- { m_bBridgePropertyCall = sal_True; }
- inline sal_Bool isBridgePropertyCall()
- { return m_bBridgePropertyCall; }
- inline sal_Bool isOneway()
- { return m_bOneway; }
-
- inline void setUnmarshal( Unmarshal *p )
- { m_pUnmarshal = p; }
-public:
- typelib_InterfaceMethodTypeDescription *m_pMethodType;
- typelib_InterfaceAttributeTypeDescription *m_pAttributeType;
- sal_Bool m_bExceptionOccured;
-
-private:
- void **m_ppArgs;
- void *m_pReturn;
- typelib_InterfaceTypeDescription *m_pInterfaceType;
- sal_Bool m_bReleaseForTypeDescriptionNecessary;
-
- uno_Any **m_ppException;
- sal_Bool m_bOneway;
- sal_Bool m_bBridgePropertyCall;
- sal_uInt16 m_nMethodIndex;
- uno_Environment *m_pEnvRemote;
- rtl_uString *m_pOid;
- sal_Bool m_bCallingConventionForced;
-};
-
-struct MemberTypeInfo
-{
- typelib_InterfaceTypeDescription *m_pInterfaceType;
- typelib_InterfaceMethodTypeDescription *m_pMethodType;
- typelib_InterfaceAttributeTypeDescription *m_pAttributeType;
- sal_Int32 m_nArgCount;
- sal_Bool m_bIsReleaseCall;
- sal_Bool *m_pbIsIn;
- sal_Bool *m_pbIsOut;
- sal_Bool m_bIsOneway;
- typelib_TypeDescription *m_pReturnType;
- typelib_TypeDescription **m_ppArgType;
-};
-
-
-struct ServerJobEntry
-{
- rtl_uString *m_pOid;
- remote_Interface *m_pRemoteI;
- typelib_TypeDescriptionReference *m_pInterfaceTypeRef;
- void **m_ppArgs;
- void *m_pReturn;
- uno_Any m_exception;
- uno_Any *m_pException;
- remote_Interface *m_pCurrentContext;
- sal_Bool m_bHasCurrentContext;
- sal_Bool m_bIgnoreCache;
-};
-
-class ServerMultiJob : private Job
-{
-public:
- ServerMultiJob( uno_Environment *pEnvRemote,
- remote_Context *pContext,
- sal_Sequence *pTid,
- struct urp_BridgeImpl *pBridgeImpl,
- Unmarshal *pUnmarshal,
- sal_Int32 nMaxMessages );
- ~ServerMultiJob();
-public:
- sal_Bool extract( );
- void initiate();
- void execute();
-
-public:
- // setMethodType or setAttributeType MUST be called before extract
- inline void setMethodType(
- typelib_InterfaceMethodTypeDescription *pMethodType,
- sal_Bool bIsReleaseCall,
- sal_Bool bIsOneway )
- {
- m_aTypeInfo[m_nCalls].m_pMethodType = pMethodType;
- m_aTypeInfo[m_nCalls].m_pAttributeType = 0;
- m_aTypeInfo[m_nCalls].m_nArgCount = pMethodType->nParams;
- m_aTypeInfo[m_nCalls].m_bIsReleaseCall = bIsReleaseCall;
- m_aTypeInfo[m_nCalls].m_bIsOneway = bIsOneway;
- }
-
- inline void setAttributeType(
- typelib_InterfaceAttributeTypeDescription *pAttributeType, sal_Bool bIsSetter, sal_Bool bIsOneway )
- {
- m_aTypeInfo[m_nCalls].m_pAttributeType = pAttributeType;
- m_aTypeInfo[m_nCalls].m_pMethodType = 0;
- m_aTypeInfo[m_nCalls].m_nArgCount = bIsSetter ? 1 : 0;
- m_aTypeInfo[m_nCalls].m_bIsReleaseCall = sal_False;
- m_aTypeInfo[m_nCalls].m_bIsOneway = bIsOneway;
- }
-
- inline void setType( typelib_TypeDescriptionReference *pTypeRef )
- {
- m_aEntries[m_nCalls].m_pInterfaceTypeRef = pTypeRef;
- typelib_typedescriptionreference_acquire( m_aEntries[m_nCalls].m_pInterfaceTypeRef );
- TYPELIB_DANGER_GET(
- (typelib_TypeDescription ** )&(m_aTypeInfo[m_nCalls].m_pInterfaceType) ,
- pTypeRef );
- }
- // setOid or setInterface MUST be called before extract
- inline void setOid( rtl_uString *pOid )
- {
- m_aEntries[m_nCalls].m_pOid = pOid;
- rtl_uString_acquire( m_aEntries[m_nCalls].m_pOid );
- m_aEntries[m_nCalls].m_pRemoteI = 0;
- }
-
- // setOid or setInterface MUST be called
- inline void setInterface( remote_Interface *pRemoteI )
- {
- m_aEntries[m_nCalls].m_pRemoteI = pRemoteI;
- pRemoteI->acquire( pRemoteI );
- m_aEntries[m_nCalls].m_pOid = 0;
- }
-
- inline void setCurrentContext(
- bool bHasCurrentContext, remote_Interface *pCurrentContext )
- {
- m_aEntries[m_nCalls].m_pCurrentContext = pCurrentContext;
- m_aEntries[m_nCalls].m_bHasCurrentContext = bHasCurrentContext;
- }
-
- inline void setIgnoreCache( sal_Bool bIgnoreCache )
- {
- m_aEntries[m_nCalls].m_bIgnoreCache = bIgnoreCache;
- }
-
- inline sal_Bool isFull()
- { return m_nCalls >= m_nMaxMessages; }
-
- inline sal_Int8 *getHeap( sal_Int32 nSizeToAlloc )
- {
- if( nSizeToAlloc + m_nCurrentMemPosition > m_nCurrentMemSize )
- {
- m_lstMem.push_back( m_pCurrentMem );
- m_nCurrentMemSize = mymax( nSizeToAlloc , MULTIJOB_STANDARD_MEMORY_SIZE ) +
- (m_nMaxMessages -m_nCalls)*MULTIJOB_PER_CALL_MEMORY_SIZE;
- m_pCurrentMem = (sal_Int8*) rtl_allocateMemory( m_nCurrentMemSize );
- m_nCurrentMemPosition = 0;
- }
- sal_Int8 *pHeap = m_pCurrentMem + m_nCurrentMemPosition;
- m_nCurrentMemPosition += nSizeToAlloc;
-
- // care for alignment
- if( m_nCurrentMemPosition & 0x7 )
- {
- m_nCurrentMemPosition = ( ((sal_uInt32)m_nCurrentMemPosition) & ( 0xffffffff - 0x7 )) + 8;
- }
- return pHeap;
- }
- void prepareRuntimeException( const ::rtl::OUString &sMessage, sal_Int32 nCall );
-
-private:
- uno_Environment *m_pEnvRemote;
- sal_Int32 m_nCalls;
- sal_Int32 m_nMaxMessages;
-
- ServerJobEntry *m_aEntries;
- MemberTypeInfo *m_aTypeInfo;
-
- sal_Int8 *m_pCurrentMem;
- sal_Int32 m_nCurrentMemSize;
- sal_Int32 m_nCurrentMemPosition;
-
- // list of memory pointers, that must be freed
- ::std::list< sal_Int8 * > m_lstMem;
-};
-
-
-
-//---------------------------------------------------------------------------------------------
-inline ClientJob::ClientJob(
- uno_Environment *pEnvRemote,
- remote_Context *pContext,
- struct urp_BridgeImpl *pBridgeImpl,
- rtl_uString *pOid,
- typelib_TypeDescription const * pMemberType,
- typelib_InterfaceTypeDescription *pInterfaceType,
- void *pReturn,
- void *ppArgs[],
- uno_Any **ppException )
- : Job(
- pEnvRemote, pContext, pBridgeImpl, ::bridges_remote::RTC_HOLDENVWEAK )
- , m_bExceptionOccured( false )
- , m_ppArgs( ppArgs )
- , m_pReturn( pReturn )
- , m_pInterfaceType( pInterfaceType ) // weak
- , m_bReleaseForTypeDescriptionNecessary( sal_False )
- , m_ppException( ppException )
- , m_bBridgePropertyCall( sal_False )
- , m_pEnvRemote( pEnvRemote ) // weak
- , m_pOid( pOid ) // weak
- , m_bCallingConventionForced( sal_False )
-{
- uno_getIdOfCurrentThread( &m_pTid );
-
- if( typelib_TypeClass_INTERFACE_METHOD == pMemberType->eTypeClass )
- {
- m_pMethodType = ( typelib_InterfaceMethodTypeDescription * ) pMemberType;
- m_pAttributeType = 0;
- }
- else if( typelib_TypeClass_INTERFACE_ATTRIBUTE == pMemberType->eTypeClass )
- {
- m_pAttributeType = ( typelib_InterfaceAttributeTypeDescription * ) pMemberType;
- m_pMethodType = 0;
- }
- else
- {
- OSL_ASSERT( ! "wrong member type" );
- }
-
- // calculate method index
- if( ! m_pInterfaceType->aBase.bComplete )
- {
- // must be acquired because typedescription may be exchanged
- typelib_typedescription_acquire((typelib_TypeDescription*) m_pInterfaceType );
- m_bReleaseForTypeDescriptionNecessary = sal_True;
- typelib_typedescription_complete( (typelib_TypeDescription ** ) &m_pInterfaceType );
- }
- m_nMethodIndex = (sal_uInt16) m_pInterfaceType->pMapMemberIndexToFunctionIndex[
- ((typelib_InterfaceMemberTypeDescription*)pMemberType)->nPosition ];
-
- if( m_pAttributeType && m_ppArgs )
- {
- // setter
- m_nMethodIndex ++;
- }
-
- if( typelib_TypeClass_INTERFACE_METHOD == pMemberType->eTypeClass )
- {
-// if( (( typelib_InterfaceMemberTypeDescription * ) pMemberType)->nPosition
-// == REMOTE_RELEASE_METHOD_INDEX )
-// {
-// m_bOneway = sal_True;
-// }
-// else
- if( pBridgeImpl->m_properties.bForceSynchronous )
- {
- m_bOneway = sal_False;
- if( (( typelib_InterfaceMethodTypeDescription * ) pMemberType)->bOneWay )
- {
- m_bCallingConventionForced = sal_True;
- }
- }
- else
- {
- m_bOneway = (( typelib_InterfaceMethodTypeDescription * ) pMemberType)->bOneWay;
- }
- }
- else
- {
- m_bOneway = sal_False;
- }
-}
-
-}
-#endif
diff --git a/bridges/source/remote/urp/urp_log.cxx b/bridges/source/remote/urp/urp_log.cxx
deleted file mode 100644
index 5813f917d7da..000000000000
--- a/bridges/source/remote/urp/urp_log.cxx
+++ /dev/null
@@ -1,147 +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_bridges.hxx"
-#include <osl/time.h>
-#include "urp_bridgeimpl.hxx"
-#include "urp_log.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-namespace bridges_urp
-{
-#ifdef BRIDGES_URP_PROT
- Mutex g_logFileMutex;
-
- class FileAccess
- {
- public:
- FileAccess( urp_BridgeImpl *pBridgeImpl_ ) :
- pBridgeImpl( pBridgeImpl_ ),
- guard( g_logFileMutex )
- {
- if( pBridgeImpl->m_pLogFile )
- {
- f = pBridgeImpl->m_pLogFile;
- }
- else
- {
- f = fopen( pBridgeImpl->m_sLogFileName.getStr() , "a" );
- }
- }
- ~FileAccess()
- {
- if( ! pBridgeImpl->m_pLogFile )
- {
- fclose( f );
- }
- }
- FILE *getFile()
- {
- return f;
- }
- private:
- urp_BridgeImpl *pBridgeImpl;
- MutexGuard guard;
- FILE *f;
- };
-
- void urp_logCall( urp_BridgeImpl *pBridgeImpl, sal_Int32 nSize, sal_Int32 nUseData, sal_Bool bSynchron ,
- const ::rtl::OUString &sMethodName )
- {
- if( pBridgeImpl->m_sLogFileName.getLength() && getenv( "PROT_REMOTE_ACTIVATE" ) )
- {
- OString sOperation = OUStringToOString( sMethodName,RTL_TEXTENCODING_ASCII_US );
-
- FileAccess access( pBridgeImpl );
- fprintf( access.getFile() ,
- "%06u: calling [size=%d(usedata=%d)] [synchron=%d] [name=%s]\n" ,
- static_cast< unsigned int > (osl_getGlobalTimer()),
- static_cast< int > (nSize),
- static_cast< int > (nUseData),
- bSynchron, sOperation.pData->buffer );
- }
- }
-
- void urp_logServingRequest( urp_BridgeImpl *pBridgeImpl,
- sal_Int32 nSize, sal_Int32 nUseData, sal_Bool bSynchron ,
- const ::rtl::OUString &sMethodName )
- {
- if( pBridgeImpl->m_sLogFileName.getLength() && getenv( "PROT_REMOTE_ACTIVATE" ) )
- {
- OString sOperation = OUStringToOString( sMethodName,RTL_TEXTENCODING_ASCII_US );
-
- FileAccess access( pBridgeImpl );
- fprintf(
- access.getFile(),
- "%06u: serving request [size=%d(usedata=%d)] [synchron=%d] [name=%s]\n",
- static_cast< unsigned int > (osl_getGlobalTimer()),
- static_cast< int > (nSize),
- static_cast< int > (nUseData),
- bSynchron,
- sOperation.pData->buffer
- );
- }
- }
-
- void urp_logGettingReply( urp_BridgeImpl *pBridgeImpl,
- sal_Int32 nSize, sal_Int32 nUseData,
- const ::rtl::OUString &sMethodName )
- {
- if( pBridgeImpl->m_sLogFileName.getLength() && getenv( "PROT_REMOTE_ACTIVATE" ) )
- {
- OString sOperation = OUStringToOString( sMethodName,RTL_TEXTENCODING_ASCII_US );
- FileAccess access( pBridgeImpl );
- fprintf( access.getFile(),
- "%06u: getting reply [size=%d(usedata=%d)][name=%s]\n" ,
- static_cast< unsigned int > (osl_getGlobalTimer()),
- static_cast< int > (nSize),
- static_cast< int > (nUseData),
- sOperation.pData->buffer);
- }
- }
-
- void urp_logReplying( urp_BridgeImpl *pBridgeImpl,
- sal_Int32 nSize , sal_Int32 nUseData,
- const ::rtl::OUString &sMethodName )
- {
- if( pBridgeImpl->m_sLogFileName.getLength() && getenv( "PROT_REMOTE_ACTIVATE" ) )
- {
- OString sOperation = OUStringToOString(sMethodName,RTL_TEXTENCODING_ASCII_US);
-
- FileAccess access( pBridgeImpl );
- fprintf( access.getFile(),
- "%06u: replying [size=%d(usedata=%d)] [name=%s]\n",
- static_cast< unsigned int > (osl_getGlobalTimer()),
- static_cast< int > (nSize),
- static_cast< int > (nUseData),
- sOperation.pData->buffer);
- }
- }
-#endif
-}
diff --git a/bridges/source/remote/urp/urp_log.hxx b/bridges/source/remote/urp/urp_log.hxx
deleted file mode 100644
index 486ff90c1e92..000000000000
--- a/bridges/source/remote/urp/urp_log.hxx
+++ /dev/null
@@ -1,50 +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.
- *
- ************************************************************************/
-namespace bridges_urp
-{
-#ifdef DBG_UTIL
-#define BRIDGES_URP_PROT
-#endif
-
-#ifdef BRIDGES_URP_PROT
- void urp_logCall( urp_BridgeImpl *pBridgeImpl ,
- sal_Int32 nSize, sal_Int32 nUseData, sal_Bool bSynchron ,
- const ::rtl::OUString &sMethodName );
-
- void urp_logServingRequest( urp_BridgeImpl *pBridgeImpl,
- sal_Int32 nSize, sal_Int32 nUseData, sal_Bool bSynchron ,
- const ::rtl::OUString &sMethodName );
-
- void urp_logGettingReply( urp_BridgeImpl *pBridgeImpl,
- sal_Int32 nSize, sal_Int32 nUseData,
- const ::rtl::OUString &sMethodName );
-
- void urp_logReplying( urp_BridgeImpl *pBridgeImpl,
- sal_Int32 nSize , sal_Int32 nUseData,
- const ::rtl::OUString &sMethodName );
-#endif
-}
diff --git a/bridges/source/remote/urp/urp_marshal.cxx b/bridges/source/remote/urp/urp_marshal.cxx
deleted file mode 100644
index 7545018ea57f..000000000000
--- a/bridges/source/remote/urp/urp_marshal.cxx
+++ /dev/null
@@ -1,235 +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_bridges.hxx"
-#include <string.h>
-#include <osl/diagnose.h>
-#include <rtl/alloc.h>
-
-#include <uno/any2.h>
-#include <uno/sequence2.h>
-
-#include "urp_marshal.hxx"
-
-using namespace ::rtl;
-
-using namespace ::com::sun::star::uno;
-
-namespace bridges_urp {
-
-static int g_nDetectLittleEndian = 1;
-char g_bMarshalSystemIsLittleEndian = ((char*)&g_nDetectLittleEndian)[0];
-
-Marshal::Marshal( urp_BridgeImpl *pBridgeImpl,
- sal_Int32 nBufferSize,
- urp_extractOidCallback callback) :
- m_nBufferSize( nBufferSize ),
- m_base( (sal_Int8*)rtl_allocateMemory( nBufferSize ) ),
- m_pos( m_base + 2*sizeof( sal_Int32 ) ),
- m_pBridgeImpl( pBridgeImpl ),
- m_callback( callback )
-{}
-
-Marshal::~Marshal( )
-{
- rtl_freeMemory( m_base );
-}
-
-void Marshal::packOid( const ::rtl::OUString & oid )
-{
- sal_uInt16 nIndex;
- if( oid.getLength() )
- {
- nIndex = m_pBridgeImpl->m_oidCacheOut.seek( oid );
- if( 0xffff == nIndex )
- {
- nIndex = m_pBridgeImpl->m_oidCacheOut.put( oid );
- packString( (void*)(&oid.pData) );
- }
- else
- {
- OUString dummy;
- packString( &dummy );
- }
- }
- else
- {
- // null reference
- nIndex = 0xffff;
- OUString dummy;
- packString( &dummy );
- }
- packInt16( &nIndex );
-}
-
-void Marshal::packTid( const ByteSequence & threadId, sal_Bool bIgnoreCache )
-{
-
- sal_uInt16 nIndex = 0xffff;
- if( ! bIgnoreCache )
- {
- nIndex = m_pBridgeImpl->m_tidCacheOut.seek( threadId );
- }
-
- if( 0xffff == nIndex )
- {
- if( ! bIgnoreCache )
- {
- nIndex = m_pBridgeImpl->m_tidCacheOut.put( threadId );
- }
- packByteSequence( (sal_Int8*) threadId.getConstArray() ,threadId.getLength());
- }
- else
- {
- packByteSequence( 0 , 0 );
- }
- packInt16( &nIndex );
-}
-
-
-void Marshal::packType( void *pSource )
-{
- typelib_TypeDescriptionReference *pRef =
- *(typelib_TypeDescriptionReference ** ) pSource;
-
- OSL_ASSERT( pRef );
-
- sal_uInt8 nTypeClass = ( sal_uInt8 ) pRef->eTypeClass;
-
- if( nTypeClass <= /* any*/ 14 )
- {
- packInt8( (sal_Int8*)&nTypeClass );
- }
- else
- {
- OUString sTypeName;
- sal_uInt16 nIndex = 0xffff;
-
- nIndex = m_pBridgeImpl->m_typeCacheOut.seek( *(Type*)&pRef );
- if( 0xffff == nIndex )
- {
- // put it into the cache
- nIndex = m_pBridgeImpl->m_typeCacheOut.put( *(Type*)&pRef );
- sTypeName = pRef->pTypeName;
- nTypeClass = nTypeClass | 0x80;
- }
- packInt8( &nTypeClass );
- packInt16( &nIndex );
- if( 0x80 & nTypeClass )
- {
- packString( &sTypeName );
- }
- }
-}
-
-sal_Bool Marshal::packRecursive( void *pSource , typelib_TypeDescription *pType )
-{
- sal_Bool bSuccess = sal_True;
- switch( pType->eTypeClass )
- {
- case typelib_TypeClass_EXCEPTION:
- case typelib_TypeClass_STRUCT:
- {
- typelib_CompoundTypeDescription * pCompType = (typelib_CompoundTypeDescription*)pType;
-
- if (pCompType->pBaseTypeDescription)
- {
- bSuccess = pack( pSource , (typelib_TypeDescription*) pCompType->pBaseTypeDescription );
- }
-
- // then construct members
- typelib_TypeDescriptionReference ** ppTypeRefs = pCompType->ppTypeRefs;
- sal_Int32 * pMemberOffsets = pCompType->pMemberOffsets;
- sal_Int32 nDescr = pCompType->nMembers;
-
- for ( sal_Int32 nPos = 0; nPos < nDescr; ++nPos )
- {
- typelib_TypeDescription * pMemberType = 0;
- TYPELIB_DANGER_GET( &pMemberType, ppTypeRefs[nPos] );
- if( pMemberType )
- {
- bSuccess = bSuccess && pack( (char*)pSource + pMemberOffsets[nPos] , pMemberType );
- TYPELIB_DANGER_RELEASE( pMemberType );
- }
- else
- {
- OUStringBuffer buf( 64 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("Couldn't get typedescription for type "));
- buf.append( ppTypeRefs[nPos]->pTypeName );
- m_pBridgeImpl->addError( buf.makeStringAndClear() );
- bSuccess = sal_False;
- }
- }
- break;
- }
- case typelib_TypeClass_SEQUENCE:
- {
- typelib_IndirectTypeDescription *pIndirectType =
- ( typelib_IndirectTypeDescription* ) pType;
-
- const sal_Int32 nElements = (*(uno_Sequence **)pSource)->nElements;
- char * pSourceElements = (char *)(*(uno_Sequence **)pSource)->elements;
-
- if( typelib_TypeClass_BYTE == pIndirectType->pType->eTypeClass )
- {
- // Byte sequences are optimized
- packByteSequence( (sal_Int8*)pSourceElements , nElements );
- }
- else
- {
- typelib_TypeDescription *pElementType = 0;
- TYPELIB_DANGER_GET( &pElementType, pIndirectType->pType );
- if( pElementType )
- {
- const sal_Int32 nElementSize = pElementType->nSize;
-
- packCompressedSize( nElements );
- for ( sal_Int32 i = 0 ; i < nElements; i++ )
- {
- bSuccess = bSuccess && pack( pSourceElements + (nElementSize*i) , pElementType );
- }
- TYPELIB_DANGER_RELEASE( pElementType );
- }
- else
- {
- bSuccess = sal_False;
- OUStringBuffer buf( 64 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("Couldn't get typedescription for type "));
- buf.append( pIndirectType->pType->pTypeName );
- m_pBridgeImpl->addError( buf.makeStringAndClear() );
- }
- }
- break;
- }
- default:
- OSL_ASSERT( 0 );
- }
- return bSuccess;
-}
-
-} // end namespace bridges
diff --git a/bridges/source/remote/urp/urp_marshal.hxx b/bridges/source/remote/urp/urp_marshal.hxx
deleted file mode 100644
index 95812b1a695d..000000000000
--- a/bridges/source/remote/urp/urp_marshal.hxx
+++ /dev/null
@@ -1,343 +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 _URP_MARSHAL_HXX_
-#define _URP_MARSHAL_HXX_
-#include <rtl/ustrbuf.hxx>
-#include <rtl/byteseq.hxx>
-#include <com/sun/star/uno/Type.hxx>
-#include "urp_bridgeimpl.hxx"
-#include "urp_marshal_decl.hxx"
-
-#include <string.h>
-
-struct remote_Interface;
-
-namespace bridges_urp
-{
- // methods for accessing marshaling buffer
- inline void Marshal::finish( sal_Int32 nMessageCount )
- {
- sal_Int32 nSize = getSize() - 2*sizeof( sal_Int32 );
-
- // save the state
- sal_Int8 *pos = m_pos;
- m_pos = m_base;
- packInt32( &nSize );
- packInt32( &nMessageCount );
-
- // reset the state
- m_pos = pos;
- }
-
- inline void Marshal::restart()
- {
- m_pos = m_base + 2*sizeof( sal_Int32 );
- }
-
- inline sal_Int8 *Marshal::getBuffer()
- {
- return m_base;
- }
-
- inline sal_Bool Marshal::empty() const
- {
- return ( m_pos - m_base ) == 2*sizeof( sal_Int32 );
- }
-
- inline sal_Int32 Marshal::getSize()
- {
- return ((sal_Int32) (m_pos - m_base));
- }
-
- inline void Marshal::ensureAdditionalMem( sal_Int32 nMemToAdd )
- {
- sal_Int32 nDiff = m_pos - m_base;
- if( nDiff + nMemToAdd > m_nBufferSize )
- {
- m_nBufferSize = m_nBufferSize * 2 > nDiff + nMemToAdd ?
- m_nBufferSize* 2 :
- nDiff + nMemToAdd;
-
- m_base = ( sal_Int8 * ) rtl_reallocateMemory( m_base , m_nBufferSize );
- m_pos = m_base + nDiff;
- }
- }
-
- // marshaling methods
- inline void Marshal::packInt8( void *pSource )
- {
- ensureAdditionalMem( 1 );
- *m_pos = *((sal_Int8*) pSource );
- m_pos++;
- }
-
- inline void Marshal::packInt16( void *pSource )
- {
- ensureAdditionalMem( 2 );
- if( isSystemLittleEndian() )
- {
- m_pos[0] = ((unsigned char *)pSource)[1];
- m_pos[1] = ((unsigned char *)pSource)[0];
- }
- else
- {
- m_pos[1] = ((unsigned char *)pSource)[1];
- m_pos[0] = ((unsigned char *)pSource)[0];
- }
- m_pos +=2;
- }
-
- inline void Marshal::packByteSequence( sal_Int8 *pData , sal_Int32 nLength )
- {
- packCompressedSize( nLength );
-
- ensureAdditionalMem( nLength );
- memcpy( m_pos , pData , nLength );
- m_pos += nLength;
- }
-
- inline void Marshal::packString( void *pSource )
- {
- rtl_uString *p = *( rtl_uString ** ) pSource;
-
- // to be optimized !
- // static buffer in marshal
- ::rtl::OString o = ::rtl::OUStringToOString( p , RTL_TEXTENCODING_UTF8 );
- sal_Int32 nLength = o.pData->length;
- packCompressedSize( nLength );
-
- ensureAdditionalMem( nLength );
-
- memcpy( m_pos , o.pData->buffer , nLength );
- m_pos += nLength;
- }
-
- inline sal_Bool Marshal::packAny( void *pSource )
- {
- sal_Bool bSuccess = sal_True;
- uno_Any *pAny = (uno_Any * ) pSource;
-
- // pack the type
- packType( &( pAny->pType ) );
- // pack the value
- typelib_TypeDescription *pType = 0;
- TYPELIB_DANGER_GET( &pType, pAny->pType );
- if( pType )
- {
- pack( pAny->pData , pType );
- TYPELIB_DANGER_RELEASE( pType );
- }
- else
- {
- rtl::OUStringBuffer buf( 128 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("couldn't get typedescription for type " ) );
- buf.append( pAny->pType->pTypeName );
- m_pBridgeImpl->addError( buf.makeStringAndClear() );
- bSuccess = sal_False;
- }
- return bSuccess;
- }
-
- inline void Marshal::packInt32( void *pSource )
- {
- ensureAdditionalMem( 4 );
- if( isSystemLittleEndian() )
- {
- m_pos[0] = ((unsigned char *)pSource)[3];
- m_pos[1] = ((unsigned char *)pSource)[2];
- m_pos[2] = ((unsigned char *)pSource)[1];
- m_pos[3] = ((unsigned char *)pSource)[0];
- }
- else {
- m_pos[3] = ((unsigned char *)pSource)[3];
- m_pos[2] = ((unsigned char *)pSource)[2];
- m_pos[1] = ((unsigned char *)pSource)[1];
- m_pos[0] = ((unsigned char *)pSource)[0];
- }
- m_pos +=4;
- }
-
- inline void Marshal::packCompressedSize( sal_Int32 nSize )
- {
- ensureAdditionalMem( 5 );
-
- if( nSize < 0xff )
- {
- *((sal_uInt8*)m_pos) = (sal_uInt8) nSize;
- m_pos ++;
- }
- else
- {
- *((sal_uInt8*)m_pos) = 0xff;
- m_pos ++;
- packInt32( &nSize );
- }
- }
-
- inline sal_Bool Marshal::pack( void *pSource , typelib_TypeDescription *pType )
- {
- sal_Bool bSuccess = sal_True;
- switch( pType->eTypeClass )
- {
- case typelib_TypeClass_BYTE:
- {
- packInt8( pSource );
- break;
- }
- case typelib_TypeClass_BOOLEAN:
- {
- ensureAdditionalMem( 1 );
- *m_pos = ( *((sal_Bool*) pSource ) ) ? 1 : 0;
- m_pos++;
- break;
- }
-
- case typelib_TypeClass_CHAR:
- case typelib_TypeClass_SHORT:
- case typelib_TypeClass_UNSIGNED_SHORT:
- {
- packInt16( pSource );
- break;
- }
- case typelib_TypeClass_ENUM:
- case typelib_TypeClass_LONG:
- case typelib_TypeClass_UNSIGNED_LONG:
- case typelib_TypeClass_FLOAT:
- {
- packInt32( pSource );
- break;
- }
- case typelib_TypeClass_DOUBLE:
- case typelib_TypeClass_HYPER:
- case typelib_TypeClass_UNSIGNED_HYPER:
- {
- ensureAdditionalMem( 8 );
- if( isSystemLittleEndian() )
- {
- m_pos[0] = ((unsigned char *)pSource)[7];
- m_pos[1] = ((unsigned char *)pSource)[6];
- m_pos[2] = ((unsigned char *)pSource)[5];
- m_pos[3] = ((unsigned char *)pSource)[4];
- m_pos[4] = ((unsigned char *)pSource)[3];
- m_pos[5] = ((unsigned char *)pSource)[2];
- m_pos[6] = ((unsigned char *)pSource)[1];
- m_pos[7] = ((unsigned char *)pSource)[0];
- }
- else
- {
- m_pos[7] = ((unsigned char *)pSource)[7];
- m_pos[6] = ((unsigned char *)pSource)[6];
- m_pos[5] = ((unsigned char *)pSource)[5];
- m_pos[4] = ((unsigned char *)pSource)[4];
- m_pos[3] = ((unsigned char *)pSource)[3];
- m_pos[2] = ((unsigned char *)pSource)[2];
- m_pos[1] = ((unsigned char *)pSource)[1];
- m_pos[0] = ((unsigned char *)pSource)[0];
- }
- m_pos += 8;
- break;
- }
-
- case typelib_TypeClass_STRING:
- {
- packString( pSource );
- break;
- }
- case typelib_TypeClass_TYPE:
- {
- packType( pSource );
- break;
- }
- case typelib_TypeClass_ANY:
- {
- bSuccess = packAny( pSource );
- break;
- }
- case typelib_TypeClass_TYPEDEF:
- {
- bSuccess = sal_False;
- m_pBridgeImpl->addError( "can't handle typedef typedescriptions" );
- break;
- }
- case typelib_TypeClass_INTERFACE:
- {
- remote_Interface *pRemoteI = *( remote_Interface ** )pSource;
-
- ::rtl::OUString sOid;
- sal_uInt16 nIndex = 0xffff;
- if( pRemoteI )
- {
- m_callback( pRemoteI , &(sOid.pData) );
-
- nIndex = m_pBridgeImpl->m_oidCacheOut.seek( sOid );
- if( 0xffff == nIndex )
- {
- nIndex = m_pBridgeImpl->m_oidCacheOut.put( sOid );
- }
- else
- {
- // cached !
- sOid = ::rtl::OUString();
- }
- }
- packString( &sOid );
- packInt16( &nIndex );
- break;
- }
- case typelib_TypeClass_VOID:
- {
- // do nothing
- break;
- }
- case typelib_TypeClass_EXCEPTION:
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_SEQUENCE:
- {
- bSuccess = packRecursive( pSource, pType );
- break;
- }
- default:
- {
- bSuccess = sal_False;
- rtl::OUStringBuffer buf( 128 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "can't handle values with typeclass " ) );
- buf.append( (sal_Int32 ) pType->eTypeClass , 10 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " (" ) );
- buf.append( pType->pTypeName );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ")" ) );
- m_pBridgeImpl->addError( buf.makeStringAndClear() );
- break;
- }
- }
- return bSuccess;
- }
-}
-
-
-
-#endif
-
diff --git a/bridges/source/remote/urp/urp_marshal_decl.hxx b/bridges/source/remote/urp/urp_marshal_decl.hxx
deleted file mode 100644
index 133760bb33e3..000000000000
--- a/bridges/source/remote/urp/urp_marshal_decl.hxx
+++ /dev/null
@@ -1,106 +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 _URP_MARSHAL_DECL_HXX_
-#define _URP_MARSHAL_DECL_HXX_
-
-#include <rtl/ustring.hxx>
-#include <rtl/byteseq.hxx>
-
-#include <com/sun/star/uno/Type.hxx>
-
-namespace bridges_urp
-{
- struct urp_BridgeImpl;
-
- typedef void
- ( SAL_CALL * urp_extractOidCallback )( remote_Interface *pRemoteI, rtl_uString **ppOid );
-
- extern char g_bMarshalSystemIsLittleEndian;
- class Marshal
- {
- public:
- Marshal( /* cache access */ struct urp_BridgeImpl *,
- sal_Int32 m_nBufferSize,
- urp_extractOidCallback callback = 0
- );
- ~Marshal( );
-
- inline sal_Bool pack( void *pSource , typelib_TypeDescription *pType );
-
- sal_Bool packRecursive( void *pSource, typelib_TypeDescription *pType );
-
- void packTid( const ::rtl::ByteSequence &id, sal_Bool bIgnoreCache = sal_False );
- void packOid( const ::rtl::OUString &oid );
- void packType( void *pSource );
-
- inline void packCompressedSize( sal_Int32 nSize );
- inline void packInt8( void *pSource );
- inline void packInt16( void *pSource );
- inline void packInt32( void *pSource );
- inline void packString( void *pSource );
- inline sal_Bool packAny( void *pSource );
- inline void packByteSequence( sal_Int8 *pBuffer , sal_Int32 nSize );
-
- // can be called during marshaling, but not between
- // finish and restart
- // returns true, when nothing has been marshaled
- inline sal_Bool empty() const;
-
- // stops marshaling, inserts size in front of the buffer
- // getStart and getSize can now be called
- inline void finish( sal_Int32 nMessageCount );
-
- // must be called after finish. After calling restart,
- // a new marshalling session is started invalidating
- // the previous bufer
- inline void restart();
-
- // is only valid, after finish has been called.
- // valid until destructed.
- inline sal_Int8 *getBuffer();
-
- // is only valid, after finish has been called.
- // valid until destructed.
- inline sal_Int32 getSize();
-
- inline sal_Int32 getPos()
- { return m_pos - m_base; }
-
- inline sal_Bool isSystemLittleEndian()
- { return g_bMarshalSystemIsLittleEndian; }
-
- private:
- inline void ensureAdditionalMem( sal_Int32 nMemToAdd );
- sal_Int32 m_nBufferSize;
- sal_Int8 *m_base;
- sal_Int8 *m_pos;
- struct urp_BridgeImpl *m_pBridgeImpl;
- urp_extractOidCallback m_callback;
- };
-}
-#endif
diff --git a/bridges/source/remote/urp/urp_property.hxx b/bridges/source/remote/urp/urp_property.hxx
deleted file mode 100644
index 59dbe3f22f93..000000000000
--- a/bridges/source/remote/urp/urp_property.hxx
+++ /dev/null
@@ -1,93 +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 _URP_PROPERTY_HXX_
-#define _URP_PROPERTY_HXX_
-#ifndef _BRIDGES_REMOTE_REMOTE_H_
-#include <bridges/remote/remote.h>
-#endif
-#include <rtl/ustring.hxx>
-#include <rtl/byteseq.hxx>
-
-namespace bridges_urp
-{
- struct Properties
- {
- ::rtl::ByteSequence seqBridgeID;
- sal_Int32 nTypeCacheSize;
- sal_Int32 nOidCacheSize;
- sal_Int32 nTidCacheSize;
- ::rtl::OUString sSupportedVersions;
- ::rtl::OUString sVersion;
- sal_Int32 nFlushBlockSize;
- sal_Int32 nOnewayTimeoutMUSEC;
- sal_Bool bSupportsMustReply;
- sal_Bool bSupportsSynchronous;
- sal_Bool bSupportsMultipleSynchronous;
- sal_Bool bClearCache;
- sal_Bool bNegotiate;
- sal_Bool bForceSynchronous;
- sal_Bool bCurrentContext;
-
- inline Properties()
- : nTypeCacheSize( 256 )
- , nOidCacheSize( 256 )
- , nTidCacheSize( 256 )
- , sSupportedVersions( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "1.0" ) ) )
- , sVersion( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "1.0" )))
- , nFlushBlockSize( 4*1024 )
- , nOnewayTimeoutMUSEC( 10000 )
- , bSupportsMustReply( sal_False )
- , bSupportsSynchronous( sal_False )
- , bSupportsMultipleSynchronous( sal_False )
- , bClearCache( sal_False )
- , bNegotiate( sal_True )
- , bForceSynchronous( sal_True )
- , bCurrentContext( sal_False )
- {}
-
- inline Properties & SAL_CALL operator = ( const Properties &props )
- {
- seqBridgeID = props.seqBridgeID;
- nTypeCacheSize = props.nTypeCacheSize;
- nOidCacheSize = props.nOidCacheSize;
- nTidCacheSize = props.nTidCacheSize;
- sSupportedVersions = props.sSupportedVersions;
- sVersion = props.sVersion;
- nFlushBlockSize = props.nFlushBlockSize;
- nOnewayTimeoutMUSEC = props.nOnewayTimeoutMUSEC;
- bSupportsMustReply = props.bSupportsMustReply;
- bSupportsSynchronous = props.bSupportsSynchronous;
- bSupportsMultipleSynchronous = props.bSupportsMultipleSynchronous;
- bClearCache = props.bClearCache;
- bNegotiate = props.bNegotiate;
- bForceSynchronous = props.bForceSynchronous;
- bCurrentContext = props.bCurrentContext;
- return *this;
- }
- };
-} // end namespace bridges_urp
-#endif
diff --git a/bridges/source/remote/urp/urp_propertyobject.cxx b/bridges/source/remote/urp/urp_propertyobject.cxx
deleted file mode 100644
index 94d3e7edee0a..000000000000
--- a/bridges/source/remote/urp/urp_propertyobject.cxx
+++ /dev/null
@@ -1,793 +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_bridges.hxx"
-#include <stdlib.h>
-#include <osl/diagnose.h>
-
-#include <rtl/random.h>
-
-#include <uno/data.h>
-
-#include "com/sun/star/bridge/InvalidProtocolChangeException.hpp"
-#include <com/sun/star/bridge/XProtocolProperties.hpp>
-
-#include "urp_propertyobject.hxx"
-#include "urp_dispatch.hxx"
-#include "urp_bridgeimpl.hxx"
-#include "urp_job.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::com::sun::star::bridge;
-using namespace ::com::sun::star::uno;
-
-using namespace bridges_urp;
-
-extern "C" {
-
-static void SAL_CALL staticAcquire( remote_Interface *pRemoteI )
-{
- PropertyObject *pProperties = (PropertyObject *) pRemoteI;
- pProperties->thisAcquire();
-}
-
-static void SAL_CALL staticRelease( remote_Interface *pRemoteI )
-{
- PropertyObject *pProperties = (PropertyObject *) pRemoteI;
- pProperties->thisRelease();
-}
-
-static void SAL_CALL staticDispatch(
- remote_Interface * pRemoteI, typelib_TypeDescription const * pMemberType,
- void * pReturn, void * pArgs[], uno_Any ** ppException )
-{
- PropertyObject *pProperties = (PropertyObject *) pRemoteI;
- pProperties->thisDispatch( pMemberType, pReturn, pArgs, ppException );
-}
-
-}
-
-namespace bridges_urp
-{
-// some nice constants ....
-static const sal_Int32 METHOD_QUERY_INTERFACE = 0;
-static const sal_Int32 METHOD_GET_PROPERTIES = 3;
-static const sal_Int32 METHOD_REQUEST_CHANGE = 4;
-static const sal_Int32 METHOD_COMMIT_CHANGE = 5;
-
-static const sal_Int32 PROPERTY_BRIDGEID = 0;
-static const sal_Int32 PROPERTY_TYPECACHESIZE = 1;
-static const sal_Int32 PROPERTY_OIDCACHESIZE = 2;
-static const sal_Int32 PROPERTY_TIDCACHESIZE = 3;
-static const sal_Int32 PROPERTY_SUPPORTEDVERSIONS = 4;
-static const sal_Int32 PROPERTY_VERSION =5;
-static const sal_Int32 PROPERTY_FLUSHBLOCKSIZE = 6;
-static const sal_Int32 PROPERTY_ONEWAYTIMEOUT_MUSEC = 7;
-static const sal_Int32 PROPERTY_SUPPORTSMUSTREPLY = 8;
-static const sal_Int32 PROPERTY_SUPPERTSSYNCHRONOUS = 9;
-static const sal_Int32 PROPERTY_SUPPORTSMULTIPLESYNCHRONOUS = 10;
-static const sal_Int32 PROPERTY_CLEARCACHE = 11;
-static const sal_Int32 PROPERTY_NEGOTIATE = 12;
-static const sal_Int32 PROPERTY_FORCESYNCHRONOUS = 13;
-static const sal_Int32 PROPERTY_CURRENTCONTEXT = 14;
-
-static const sal_Int32 MAX_PROPERTIES = PROPERTY_CURRENTCONTEXT +1;
-
-const sal_Char *g_aPropertyName[] =
-{
- "BridgeId",
- "TypeCacheSize",
- "OidCacheSize",
- "TidCacheSize",
- "SupportedVersion",
- "Version",
- "FlushBlockSize",
- "OnewayTimeoutMUSEC",
- "SupportsMustReply",
- "SupportsSynchronous",
- "SupportsMultipleSynchronous",
- "ClearCache",
- "Negotiate",
- "ForceSynchronous",
- "CurrentContext"
-};
-
-// nice little helper functions for conversion
-template< class t >
-void assignToIdl( ProtocolProperty *pIdl, sal_Int32 nIndex, const t &value )
-{
- pIdl->Name = OUString::createFromAscii( g_aPropertyName[nIndex] );
- ( *(::com::sun::star::uno::Any *)&(pIdl->Value) ) <<= value;
-}
-
-template< class t >
-void assignFromIdl( t * p, const ProtocolProperty & property )
-{
- property.Value >>=*p;
-}
-
-static sal_Int32 getIndexFromIdl( const ProtocolProperty & property )
-{
- sal_Int32 nResult = -1;
- for( sal_Int32 i = 0 ; i < MAX_PROPERTIES ; i ++ )
- {
- if( 0 == property.Name.compareToAscii( g_aPropertyName[i] ) )
- {
- nResult = i;
- break;
- }
- }
- return nResult;
-}
-
-static sal_Int32 getIndexFromString( const OUString & property )
-{
- sal_Int32 nResult = -1;
- for( sal_Int32 i = 0 ; i < MAX_PROPERTIES ; i ++ )
- {
- if( 0 == property.compareToAscii( g_aPropertyName[i] ) )
- {
- nResult = i;
- break;
- }
- }
- return nResult;
-}
-
-static sal_Bool assignFromIdlToStruct( Properties *pProps, const ProtocolProperty &idl )
-{
- sal_Bool bReturn = sal_True;
-
- sal_Int32 nIndex = getIndexFromIdl( idl );
- if( nIndex >= 0 )
- {
- switch( nIndex )
- {
- case PROPERTY_SUPPORTSMULTIPLESYNCHRONOUS:
- assignFromIdl( &(pProps->bSupportsMultipleSynchronous) , idl );
- break;
- case PROPERTY_SUPPERTSSYNCHRONOUS:
- assignFromIdl( &(pProps->bSupportsMustReply) , idl );
- break;
- case PROPERTY_SUPPORTSMUSTREPLY:
- assignFromIdl( &(pProps->bSupportsSynchronous) , idl );
- break;
- case PROPERTY_ONEWAYTIMEOUT_MUSEC:
- assignFromIdl( &(pProps->nOnewayTimeoutMUSEC) , idl );
- break;
- case PROPERTY_BRIDGEID:
- assignFromIdl( (Sequence< sal_Int8 > * )&(pProps->seqBridgeID), idl );
- break;
- case PROPERTY_TYPECACHESIZE:
- assignFromIdl( &(pProps->nTypeCacheSize) , idl );
- break;
- case PROPERTY_OIDCACHESIZE:
- assignFromIdl( &(pProps->nOidCacheSize) , idl );
- break;
- case PROPERTY_TIDCACHESIZE:
- assignFromIdl( &(pProps->nTidCacheSize), idl );
- break;
- case PROPERTY_SUPPORTEDVERSIONS:
- assignFromIdl( &(pProps->sSupportedVersions) , idl );
- break;
- case PROPERTY_VERSION:
- assignFromIdl( &(pProps->sVersion) , idl );
- break;
- case PROPERTY_FLUSHBLOCKSIZE:
- assignFromIdl( &(pProps->nFlushBlockSize) ,idl );
- break;
- case PROPERTY_CLEARCACHE:
- assignFromIdl( &(pProps->bClearCache) ,idl );
- break;
- case PROPERTY_NEGOTIATE:
- assignFromIdl( &(pProps->bNegotiate) ,idl );
- break;
- case PROPERTY_FORCESYNCHRONOUS:
- assignFromIdl( &(pProps->bForceSynchronous) ,idl );
- break;
- case PROPERTY_CURRENTCONTEXT:
- pProps->bCurrentContext = true;
- break;
- default:
- bReturn = sal_False;
- }
- }
- else
- {
- bReturn = sal_False;
- }
- return bReturn;
-}
-
-static void extractTokens(
- const ::rtl::OUString &sProps , ::std::list< OUString > &lst )
-{
- sal_Int32 nNext = 0;
- while ( sal_True )
- {
- sal_Int32 nStart = nNext;
- nNext = sProps.indexOf( ',' , nNext );
- if( -1 == nNext )
- {
- lst.push_back( sProps.copy( nStart, sProps.getLength() - nStart ) );
- break;
- }
- lst.push_back( sProps.copy( nStart , nNext - nStart ) );
- nNext ++;
- }
-}
-
-
-static void assignFromStringToPropSeq( const OUString &sProps, uno_Sequence **ppPropertySeq)
-{
- ::std::list< OUString > lst;
- extractTokens( sProps , lst );
-
- typelib_TypeDescription *pSequenceType = 0;
- getCppuType( (Sequence< ProtocolProperty > *)0).getDescription( &pSequenceType );
- uno_Sequence *pSeq = 0;
- uno_sequence_construct( &pSeq , pSequenceType , 0, lst.size() , 0 );
- ProtocolProperty *pElements = (ProtocolProperty * ) pSeq->elements;
-
- sal_Int32 i = 0;
- for( ::std::list< OUString >::iterator ii = lst.begin() ; ii != lst.end() ; ++ ii, i++ )
- {
- sal_Int32 nAssign = (*ii).indexOf( '=' );
- if( -1 == nAssign )
- {
- OString o = OUStringToOString( *ii, RTL_TEXTENCODING_ASCII_US );
- OSL_ENSURE( !"wrong protocol propertyt format, ignored", o.getStr() );
- }
- OUString sPropName = (*ii).copy( 0, nAssign );
- OUString sValue = (*ii).copy( nAssign +1, (*ii).getLength() - nAssign -1 );
-
- sal_Int32 nIndex = getIndexFromString( sPropName );
- if( -1 == nIndex )
- {
- OString o = OUStringToOString( sPropName , RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE( !"unknown protocol property, ignored", o.getStr() );
- }
- switch( nIndex )
- {
- // voids
- case PROPERTY_CURRENTCONTEXT:
- pElements[i].Name = OUString::createFromAscii(
- g_aPropertyName[nIndex] );
- break;
- // bools
- case PROPERTY_CLEARCACHE:
- case PROPERTY_NEGOTIATE:
- case PROPERTY_FORCESYNCHRONOUS:
- {
- sal_Bool bClearCache = (sal_Bool ) sValue.toInt32();
- assignToIdl( &(pElements[i]) , nIndex , bClearCache );
- break;
- }
- // ints
- case PROPERTY_TYPECACHESIZE:
- case PROPERTY_OIDCACHESIZE:
- case PROPERTY_TIDCACHESIZE:
- case PROPERTY_FLUSHBLOCKSIZE:
- case PROPERTY_ONEWAYTIMEOUT_MUSEC:
- {
- sal_Int32 nValue = sValue.toInt32();
- assignToIdl( &(pElements[i]) , nIndex , nValue );
- break;
- }
-
- // strings
- case PROPERTY_VERSION:
- assignToIdl( &(pElements[i]) , nIndex , sValue );
- break;
- default:
- OString o = OUStringToOString( sPropName, RTL_TEXTENCODING_ASCII_US );
- OSL_ENSURE( !"readonly protocol property, ignored" , o.getStr() );
- }
- }
- *ppPropertySeq = pSeq;
- typelib_typedescription_release( pSequenceType );
-}
-
-static void assignFromPropSeqToStruct( uno_Sequence *pSeq , struct Properties *pProps )
-{
- sal_Int32 i;
- ProtocolProperty *pElements = (ProtocolProperty *)pSeq->elements;
- for( i = 0 ; i < pSeq->nElements ; i ++ )
- {
- assignFromIdlToStruct( pProps , pElements[i] );
- }
-}
-
-void assignFromStringToStruct( const OUString & sProps , struct Properties *pProps )
-{
- uno_Sequence *pSeq = 0;
- assignFromStringToPropSeq( sProps , &pSeq );
- assignFromPropSeqToStruct( pSeq , pProps );
- uno_type_destructData( &pSeq, getCppuType( (Sequence< ProtocolProperty > *)0).getTypeLibType(),0);
-}
-
-
-//----------------------------------------------------------------------------------------------
-// PropertyObject implementation
-PropertyObject::PropertyObject(
- struct Properties *pLocalSetting , uno_Environment *pEnvRemote, urp_BridgeImpl *pImpl )
- : m_commitChangeCondition( osl_createCondition() )
- , m_nRefCount( 0 )
- , m_pBridgeImpl( pImpl )
- , m_pLocalSetting( pLocalSetting )
- , m_pEnvRemote( pEnvRemote )
- , m_bRequestChangeHasBeenCalled( sal_False )
- , m_bServerWaitingForCommit( sal_False )
- , m_bApplyProperties( sal_False )
-{
- acquire = staticAcquire;
- release = staticRelease;
- pDispatcher = staticDispatch;
-}
-
-PropertyObject::~PropertyObject()
-{
- osl_destroyCondition( m_commitChangeCondition );
-}
-
-void SAL_CALL PropertyObject::thisDispatch(
- typelib_TypeDescription const * pMemberType, void * pReturn, void * ppArgs[],
- uno_Any ** ppException )
-{
- OSL_ASSERT( pMemberType->eTypeClass == typelib_TypeClass_INTERFACE_METHOD );
-
- typelib_InterfaceMethodTypeDescription *pMethodType =
- ( typelib_InterfaceMethodTypeDescription * ) pMemberType;
-
- switch( pMethodType->aBase.nPosition )
- {
- case METHOD_QUERY_INTERFACE:
- OSL_ENSURE( 0 , "not implemented yet !" );
- break;
- case METHOD_GET_PROPERTIES:
- {
- implGetProperties( (uno_Sequence **) pReturn );
- *ppException = 0;
- break;
- }
- case METHOD_COMMIT_CHANGE:
- {
- implCommitChange( *(uno_Sequence ** ) ppArgs[0] , ppException );
- break;
- }
- case METHOD_REQUEST_CHANGE:
- {
- *(sal_Int32 *) pReturn = implRequestChange( *(sal_Int32 *)ppArgs[0], ppException );
- break;
- }
- default:
- OSL_ENSURE( 0 , "unkown method !" );
- }
-}
-
-void SAL_CALL PropertyObject::localGetPropertiesFromRemote( struct Properties *pR )
-{
- OUString oid = OUString::createFromAscii( g_NameOfUrpProtocolPropertiesObject );
-
- typelib_TypeDescription *pInterfaceType = 0;
- getCppuType( (Reference< XProtocolProperties > *) 0 ).getDescription( &pInterfaceType );
-
- if( !pInterfaceType->bComplete )
- {
- typelib_typedescription_complete( &pInterfaceType );
- }
-
- typelib_TypeDescription *pMethodType = 0;
- typelib_typedescriptionreference_getDescription(
- &pMethodType,
- ((typelib_InterfaceTypeDescription*) pInterfaceType)->ppAllMembers[METHOD_GET_PROPERTIES] );
-
-
- uno_Sequence *pResult = 0;
- uno_Any exception;
- uno_Any *pException = &exception;
- urp_sendRequest( m_pEnvRemote,
- pMethodType,
- oid.pData,
- (typelib_InterfaceTypeDescription*) pInterfaceType,
- &pResult,
- 0,
- &pException );
-
- if( pException )
- {
- OSL_ENSURE( 0 , "remote urp-bridge doesn't support property-object" );
- uno_any_destruct( pException , 0 );
- return;
- }
-
- ProtocolProperty *pP = (ProtocolProperty * ) pResult->elements;
- for( sal_Int32 i = 0; i < pResult->nElements ; i ++ )
- {
- if( ! assignFromIdlToStruct( pR , pP[i] ) )
- {
- OSL_ENSURE( 0 , "unknown property !!!!" );
- }
- }
-
- typelib_typedescription_release( pInterfaceType );
- typelib_typedescription_release( pMethodType );
-}
-
-
-// implementation for call from remote
-void SAL_CALL PropertyObject::implGetProperties( uno_Sequence **ppReturnValue )
-{
- typelib_TypeDescription *pElementType= 0;
- getCppuType( (Sequence< ProtocolProperty > *)0).getDescription( &pElementType );
-
- OSL_ENSURE( pElementType , "Couldn't get property type" );
-
- *ppReturnValue = 0;
- uno_sequence_construct( ppReturnValue , pElementType , 0, MAX_PROPERTIES , 0 );
- ProtocolProperty *pElements = (ProtocolProperty * ) ( *ppReturnValue )->elements;
- Properties *pP = m_pLocalSetting;
-
- assignToIdl( &(pElements[PROPERTY_BRIDGEID]),PROPERTY_BRIDGEID, *(Sequence< sal_Int8 > *)&(pP->seqBridgeID) );
- assignToIdl( &(pElements[PROPERTY_TYPECACHESIZE]),PROPERTY_TYPECACHESIZE,pP->nTypeCacheSize );
- assignToIdl( &(pElements[PROPERTY_OIDCACHESIZE]),PROPERTY_OIDCACHESIZE, pP->nOidCacheSize );
- assignToIdl( &(pElements[PROPERTY_TIDCACHESIZE]),PROPERTY_TIDCACHESIZE, pP->nTidCacheSize );
- assignToIdl( &(pElements[PROPERTY_SUPPORTEDVERSIONS]),PROPERTY_SUPPORTEDVERSIONS, pP->sSupportedVersions );
- assignToIdl( &(pElements[PROPERTY_VERSION]),PROPERTY_VERSION, pP->sVersion );
- assignToIdl( &(pElements[PROPERTY_FLUSHBLOCKSIZE]), PROPERTY_FLUSHBLOCKSIZE,pP->nFlushBlockSize );
- assignToIdl( &(pElements[PROPERTY_ONEWAYTIMEOUT_MUSEC]), PROPERTY_ONEWAYTIMEOUT_MUSEC, pP->nOnewayTimeoutMUSEC );
- assignToIdl( &(pElements[PROPERTY_SUPPORTSMUSTREPLY]), PROPERTY_SUPPORTSMUSTREPLY, pP->bSupportsMustReply );
- assignToIdl( &(pElements[PROPERTY_SUPPERTSSYNCHRONOUS]), PROPERTY_SUPPERTSSYNCHRONOUS, pP->bSupportsSynchronous );
- assignToIdl( &(pElements[PROPERTY_SUPPORTSMULTIPLESYNCHRONOUS]), PROPERTY_SUPPORTSMULTIPLESYNCHRONOUS, pP->bSupportsMultipleSynchronous );
- assignToIdl( &(pElements[PROPERTY_CLEARCACHE]), PROPERTY_CLEARCACHE, pP->bClearCache );
-
- typelib_typedescription_release( pElementType );
-}
-
-//----------------------------------------------------------------------------------------------
-sal_Int32 SAL_CALL PropertyObject::localRequestChange( )
-{
- sal_Int32 nResult = 0;
- sal_Bool bCall = sal_True;
-
- // disallow marshaling NOW !
- ClearableMutexGuard marshalingGuard( m_pBridgeImpl->m_marshalingMutex );
- {
- MutexGuard guard( m_mutex );
- if( m_bRequestChangeHasBeenCalled || m_bServerWaitingForCommit )
- {
- // another transaction is already underway
- // try again later !
- bCall = sal_False;
- }
- m_bRequestChangeHasBeenCalled = sal_True;
-
- if( bCall )
- {
- // calulate random number
- rtlRandomPool pool = rtl_random_createPool ();
- rtl_random_getBytes( pool , &m_nRandomNumberOfRequest, sizeof( m_nRandomNumberOfRequest ) );
- rtl_random_destroyPool( pool );
- }
- }
-
- if( bCall )
- {
- OUString oid = OUString::createFromAscii( g_NameOfUrpProtocolPropertiesObject );
-
- // gather types for calling
- typelib_TypeDescription *pInterfaceType = 0;
- getCppuType( (Reference< XProtocolProperties > *) 0 ).getDescription( &pInterfaceType );
-
- if( !pInterfaceType->bComplete )
- {
- typelib_typedescription_complete( &pInterfaceType );
- }
-
- typelib_TypeDescription *pMethodType = 0;
- typelib_typedescriptionreference_getDescription(
- &pMethodType,
- ((typelib_InterfaceTypeDescription*) pInterfaceType)->ppAllMembers[METHOD_REQUEST_CHANGE] );
-
- void *pArg1 = &m_nRandomNumberOfRequest;
- void **ppArgs = &pArg1;
-
- uno_Any exception;
- uno_Any *pException = &exception;
-
- ClientJob job( m_pEnvRemote,
- 0,
- m_pBridgeImpl,
- oid.pData,
- pMethodType,
- (typelib_InterfaceTypeDescription*) pInterfaceType,
- &nResult,
- ppArgs,
- &pException );
-
- // put the call on the line !
- sal_Bool bSuccess = job.pack();
-
- // now allow writing on wire again.
- // NOTE : this has been locked, because it is inevitable to set m_bRequestChangeHasBeenCalled
- // and call requestChange in an atomar operation. Otherwise, implRequestChange may be called
- // inbetween and reply, before the request is put on the wire. This certainly would
- // be confusing for the remote counterpart !
- marshalingGuard.clear();
-
- // wait for the reply ...
- if( bSuccess )
- {
- job.wait();
-
- if( pException )
- {
- // the object is unknown on the other side.
- uno_any_destruct( pException , 0 );
- nResult = 0;
- }
- }
- else
- {
- nResult = 0;
- }
- typelib_typedescription_release( pInterfaceType );
- typelib_typedescription_release( pMethodType );
- }
-
- {
- MutexGuard guard( m_mutex );
- m_bRequestChangeHasBeenCalled = sal_False;
- m_bServerWaitingForCommit = ( 0 == nResult );
- }
- return nResult;
-}
-
-// implementation for call from remote
-sal_Int32 SAL_CALL PropertyObject::implRequestChange( sal_Int32 nRandomNumber, uno_Any **ppException )
-{
- sal_Int32 nResult = 0;
- MutexGuard guard( m_mutex );
- if( m_bRequestChangeHasBeenCalled )
- {
- // this side has also called requestChange, now negotiate, which side is allowed
- // to commit the change !
- if( m_nRandomNumberOfRequest > nRandomNumber )
- {
- // this side may commit !!!!
- nResult = 0;
- }
- else if( m_nRandomNumberOfRequest == nRandomNumber )
- {
- // sorry, try again !
- nResult = -1;
- }
- else if( m_nRandomNumberOfRequest < nRandomNumber )
- {
- // the other side may commit !
- nResult = 1;
- // m_bServerWaitingForCommit will be set by localRequestChange
- }
- }
- else
- {
- // This side has NOT called requestChange, so the other side may commit
- nResult = 1;
- m_bServerWaitingForCommit = sal_True;
- }
-
- *ppException = 0;
- return nResult;
-}
-
-
-
-void SAL_CALL PropertyObject::localCommitChange( const ::rtl::OUString &sProps , sal_Bool *pbExceptionThrown )
-{
- // lock the bridge NOW !
- // NOTE: it is not allowed for other threads to call, when a commit change is underway.
- // The remote counterpart cannot if the call following the commit already uses
- // the new properties or not.
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
-
- OUString oid = OUString::createFromAscii( g_NameOfUrpProtocolPropertiesObject );
-
- osl_resetCondition( m_commitChangeCondition );
-
- Properties props = *m_pLocalSetting;
-
- typelib_TypeDescription *pInterfaceType = 0;
- getCppuType( (Reference< XProtocolProperties > *) 0 ).getDescription( &pInterfaceType );
-
- if( !pInterfaceType->bComplete )
- {
- typelib_typedescription_complete( &pInterfaceType );
- }
-
- typelib_TypeDescription *pMethodType = 0;
- typelib_typedescriptionreference_getDescription(
- &pMethodType,
- ((typelib_InterfaceTypeDescription*) pInterfaceType)->ppAllMembers[METHOD_COMMIT_CHANGE] );
-
-// typelib_TypeDescription *pSequenceType= 0;
-
-
- // extract name/value pairs
- uno_Sequence *pSeq = 0;
- assignFromStringToPropSeq( sProps, &pSeq );
- assignFromPropSeqToStruct( pSeq , &props );
-// ::std::list< OUString > lst;
-// extractTokens( sProps , lst );
-
-// getCppuType( (Sequence< ProtocolProperty > *)0).getDescription( &pSequenceType );
-// uno_sequence_construct( &pSeq , pSequenceType , 0, lst.size() , 0 );
-// ProtocolProperty *pElements = (ProtocolProperty * ) pSeq->elements;
-
-// sal_Int32 i = 0;
-// for( ::std::list< OUString >::iterator ii = lst.begin() ; ii != lst.end() ; ++ ii, i++ )
-// {
-// sal_Int32 nAssign = (*ii).indexOf( '=' );
-// if( -1 == nAssign )
-// {
-// OString o = OUStringToOString( *ii, RTL_TEXTENCODING_ASCII_US );
-// OSL_ENSURE( !"wrong protocol propertyt format, ignored", o.getStr() );
-// }
-// OUString sPropName = (*ii).copy( 0, nAssign );
-// OUString sValue = (*ii).copy( nAssign +1, (*ii).getLength() - nAssign -1 );
-
-// sal_Int32 nIndex = getIndexFromString( sPropName );
-// if( -1 == nIndex )
-// {
-// OString o = OUStringToOString( sPropName , RTL_TEXTENCODING_ASCII_US);
-// OSL_ENSURE( !"unknown protocol property, ignored", o.getStr() );
-// }
-// switch( nIndex )
-// {
-// // bools
-// case PROPERTY_CLEARCACHE:
-// {
-// sal_Bool bClearCache = (sal_Bool ) sValue.toInt32();
-// assignToIdl( &(pElements[i]) , nIndex , bClearCache );
-// break;
-// }
-// // ints
-// case PROPERTY_TYPECACHESIZE:
-// case PROPERTY_OIDCACHESIZE:
-// case PROPERTY_TIDCACHESIZE:
-// case PROPERTY_FLUSHBLOCKSIZE:
-// case PROPERTY_ONEWAYTIMEOUT_MUSEC:
-// {
-// sal_Int32 nValue = sValue.toInt32();
-// assignToIdl( &(pElements[i]) , nIndex , nValue );
-// break;
-// }
-
-// // strings
-// case PROPERTY_VERSION:
-// assignToIdl( &(pElements[i]) , nIndex , sValue );
-// break;
-// default:
-// OString o = OUStringToOString( sPropName, RTL_TEXTENCODING_ASCII_US );
-// OSL_ENSURE( !"readonly protocol property, ignored" , o.getStr() );
-// }
-// assignFromIdlToStruct( &props, pElements[i] );
-// }
-
- void *pArg1 = &pSeq;
- uno_Any exception;
- uno_Any *pException = &exception;
-
- ClientJob job( m_pEnvRemote,
- 0,
- m_pBridgeImpl,
- oid.pData,
- pMethodType,
- (typelib_InterfaceTypeDescription*) pInterfaceType,
- 0,
- &pArg1,
- &pException );
- job.setBridgePropertyCall();
- if( job.pack() )
- {
- job.wait();
- }
- else
- {
- OSL_ASSERT( pException != NULL );
- }
-
- ::uno_type_destructData(
- &pSeq, getCppuType( (Sequence< ProtocolProperty > *)0).getTypeLibType(), 0 );
-
- *pbExceptionThrown = pException ? sal_True : sal_False;
-
- if( pException )
- {
- OString o = OUStringToOString( ((com::sun::star::uno::Exception*)pException->pData)->Message,
- RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE( !"exception thrown during calling on PropertyObject",o.getStr() );
- uno_any_destruct( pException , 0 );
- }
- else
- {
- m_pBridgeImpl->applyProtocolChanges( props );
- m_bServerWaitingForCommit = sal_False;
- m_bApplyProperties = sal_False;
- }
-
- // let the reader thread go ...
- osl_setCondition( m_commitChangeCondition );
-
- typelib_typedescription_release( pMethodType );
- typelib_typedescription_release( pInterfaceType );
-}
-
-void SAL_CALL PropertyObject::implCommitChange( uno_Sequence *pSequence, uno_Any **ppException )
-{
- MutexGuard guard( m_mutex );
- m_propsToBeApplied = *m_pLocalSetting;
-
- ProtocolProperty *pP = (ProtocolProperty * ) pSequence->elements;
- for( sal_Int32 i = 0; i < pSequence->nElements ; i ++ )
- {
- if( ! assignFromIdlToStruct( &m_propsToBeApplied , pP[i] ) )
- {
- InvalidProtocolChangeException exception;
- Type type = getCppuType( &exception );
- exception.Message = OUString::createFromAscii( "urp: unknown Property " );
- exception.Message += pP[i].Name;
- exception.invalidProperty = pP[i];
- exception.reason = 1;
-
- uno_type_any_construct( *ppException, &exception, type.getTypeLibType() , 0 );
-
- m_bApplyProperties = sal_False;
- m_bServerWaitingForCommit = sal_False;
- return;
- }
- }
-
- m_bApplyProperties = sal_True;
- *ppException = 0;
-}
-
-Properties SAL_CALL PropertyObject::getCommitedChanges()
-{
- MutexGuard guard( m_mutex );
- OSL_ASSERT( m_bApplyProperties );
- m_bApplyProperties = sal_False;
- m_bServerWaitingForCommit = sal_False;
- return m_propsToBeApplied;
-}
-
-void SAL_CALL PropertyObject::waitUntilChangesAreCommitted()
-{
- osl_waitCondition( m_commitChangeCondition , 0 );
-}
-}
diff --git a/bridges/source/remote/urp/urp_propertyobject.hxx b/bridges/source/remote/urp/urp_propertyobject.hxx
deleted file mode 100644
index 3b6bd1824e27..000000000000
--- a/bridges/source/remote/urp/urp_propertyobject.hxx
+++ /dev/null
@@ -1,108 +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 <stdio.h>
-#include <osl/interlck.h>
-#include <osl/mutex.hxx>
-
-#ifndef _OSL_CONDITN_H_
-#include <osl/conditn.h>
-#endif
-#include <rtl/string.hxx>
-#include <uno/sequence2.h>
-
-#ifndef _BRIDGES_REMOTE_REMOTE_H_
-#include <bridges/remote/remote.h>
-#endif
-#include "urp_property.hxx"
-
-namespace bridges_urp {
-
-struct urp_BridgeImpl;
-const sal_Char g_NameOfUrpProtocolPropertiesObject[] = "UrpProtocolProperties";
-
-// helper functions
-void assignFromStringToStruct( const ::rtl::OUString & sProps , struct Properties *pProps );
-
-class PropertyObject : public remote_Interface
-{
-private:
- ::osl::Mutex m_mutex;
- oslCondition m_commitChangeCondition;
- oslInterlockedCount m_nRefCount;
- urp_BridgeImpl *m_pBridgeImpl;
- struct Properties *m_pLocalSetting;
- struct Properties m_propsToBeApplied;
-
- uno_Environment *m_pEnvRemote;
- sal_Int32 m_nRandomNumberOfRequest;
- sal_Bool m_bRequestChangeHasBeenCalled;
- sal_Bool m_bServerWaitingForCommit;
- sal_Bool m_bApplyProperties;
-
-public:
- PropertyObject(
- struct Properties *pLocalSetting , uno_Environment *pEnvRemote, urp_BridgeImpl *pImpl );
- ~PropertyObject();
-
- void SAL_CALL thisAcquire( )
- {
- osl_incrementInterlockedCount( &m_nRefCount );
- }
-
- void SAL_CALL thisRelease()
- {
- if( ! osl_decrementInterlockedCount( &m_nRefCount ) )
- {
- delete this;
- }
- }
-
- void SAL_CALL thisDispatch( typelib_TypeDescription const * pMemberType,
- void * pReturn,
- void * pArgs[],
- uno_Any ** ppException );
-
-public: // local
- sal_Int32 SAL_CALL localRequestChange( );
- void SAL_CALL localCommitChange( const ::rtl::OUString &properties, sal_Bool *pbExceptionThrown );
- void SAL_CALL localGetPropertiesFromRemote( struct Properties * );
-
- // returns 0, if nothing was commited.
- inline sal_Bool SAL_CALL changesHaveBeenCommited()
- { return m_bApplyProperties; }
- Properties SAL_CALL getCommitedChanges();
-
- void SAL_CALL waitUntilChangesAreCommitted();
-
-protected:
- // these methods are called by thisDispatch
- void SAL_CALL implGetProperties( uno_Sequence **ppReturnValue );
- sal_Int32 SAL_CALL implRequestChange( sal_Int32 nRandomNumber, uno_Any **ppException );
- void SAL_CALL implCommitChange( uno_Sequence *seqOfProperties, uno_Any **ppException );
-};
-
-}
diff --git a/bridges/source/remote/urp/urp_reader.cxx b/bridges/source/remote/urp/urp_reader.cxx
deleted file mode 100644
index fda6c5e322eb..000000000000
--- a/bridges/source/remote/urp/urp_reader.cxx
+++ /dev/null
@@ -1,832 +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_bridges.hxx"
-#include <string.h>
-
-#include <osl/diagnose.h>
-#include <rtl/ustrbuf.hxx>
-
-#include <bridges/remote/connection.h>
-#include <bridges/remote/counter.hxx>
-#include <bridges/remote/context.h>
-#include <bridges/remote/helper.hxx>
-
-#include <com/sun/star/uno/XCurrentContext.hpp>
-#include <uno/environment.h>
-
-#include "urp_reader.hxx"
-#include "urp_writer.hxx"
-#include "urp_dispatch.hxx"
-#include "urp_job.hxx"
-#include "urp_bridgeimpl.hxx"
-#include "urp_log.hxx"
-#include "urp_propertyobject.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::com::sun::star::uno;
-
-#if OSL_DEBUG_LEVEL > 1
-static MyCounter thisCounter( "DEBUG : ReaderThread" );
-#endif
-
-namespace bridges_urp
-{
-
- /**
- * This callback is used to ensure, that the release call is sent for the correct type.
- *
- ***/
- void SAL_CALL urp_releaseRemoteCallback (
- remote_Interface *, rtl_uString *pOid,
- typelib_TypeDescriptionReference *pTypeRef, uno_Environment *pEnvRemote )
- {
- remote_Context *pContext = (remote_Context *) pEnvRemote->pContext;
- urp_BridgeImpl *pImpl = (urp_BridgeImpl*) ( pContext->m_pBridgeImpl );
-
- pImpl->m_pWriter->insertReleaseRemoteCall( pOid , pTypeRef );
- }
-
-
- struct MessageFlags
- {
- sal_uInt16 nMethodId;
- sal_Bool bRequest;
- sal_Bool bType;
- sal_Bool bOid;
- sal_Bool bTid;
- sal_Bool bException;
- sal_Bool bMustReply;
- sal_Bool bSynchronous;
- sal_Bool bMoreFlags;
- sal_Bool bIgnoreCache;
- sal_Bool bBridgePropertyCall;
- ///--------------------------
- inline MessageFlags()
- {
- bTid = sal_False;
- bOid = sal_False;
- bType = sal_False;
- bException = sal_False;
- bMoreFlags = sal_False;
- bIgnoreCache = sal_False;
- bBridgePropertyCall = sal_False;
- }
- //---------------------------
- }; // end struct MessageFlags
-
-inline sal_Bool OReaderThread::getMemberTypeDescription(
- typelib_InterfaceAttributeTypeDescription **ppAttributeType,
- typelib_InterfaceMethodTypeDescription **ppMethodType,
- sal_Bool *pbIsSetter,
- sal_uInt16 nMethodId ,
- typelib_TypeDescriptionReference * pITypeRef )
-{
- if( pITypeRef->eTypeClass != typelib_TypeClass_INTERFACE )
- {
- OUStringBuffer sMessage;
- sMessage.appendAscii( "interface type is not of typeclass interface (" );
- sMessage.append( (sal_Int32) pITypeRef->eTypeClass );
- m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
- OSL_ENSURE( 0 , "type is not an interface" );
- return sal_False;
- }
-
- typelib_InterfaceTypeDescription *pInterfaceType = 0;
- TYPELIB_DANGER_GET(
- (typelib_TypeDescription **)&pInterfaceType , pITypeRef );
- if( ! pInterfaceType )
- {
- OUStringBuffer sMessage;
- sMessage.appendAscii( "No typedescription can be retrieved for type " );
- sMessage.append( OUString( pITypeRef->pTypeName ) );
- m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
- OSL_ENSURE( 0 , "urp: unknown type " );
- return sal_False;
- }
-
- if( ! pInterfaceType->aBase.bComplete )
- {
- typelib_typedescription_complete( (typelib_TypeDescription **) &pInterfaceType );
- }
-
- if ( nMethodId >= pInterfaceType->nMapFunctionIndexToMemberIndex )
- {
- OUStringBuffer sMessage;
- sMessage.appendAscii( "vtable out of range for type " );
- sMessage.append( OUString( pITypeRef->pTypeName ) );
- sMessage.appendAscii( " (" );
- sMessage.append( (sal_Int32) nMethodId );
- sMessage.appendAscii( " )" );
- m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
-
- OSL_ENSURE( 0 , "vtable index out of range" );
- return sal_False;
- }
-
- sal_Int32 nMemberIndex = pInterfaceType->pMapFunctionIndexToMemberIndex[ nMethodId ];
-
- if( !( pInterfaceType->nAllMembers > nMemberIndex && nMemberIndex >= 0 ) )
- {
- OUStringBuffer sMessage;
- sMessage.appendAscii( "vtable out of range for type " );
- sMessage.append( OUString( pITypeRef->pTypeName ) );
- sMessage.appendAscii( " (" );
- sMessage.append( (sal_Int32) nMethodId );
- sMessage.appendAscii( " )" );
- m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
-
- OSL_ENSURE( 0 , "vtable index out of range" );
- return sal_False;
- }
-
- typelib_InterfaceMemberTypeDescription *pMemberType = 0;
- typelib_typedescriptionreference_getDescription(
- (typelib_TypeDescription **) &pMemberType,pInterfaceType->ppAllMembers[nMemberIndex]);
-
- if(! pMemberType )
- {
- OUStringBuffer sMessage;
- sMessage.appendAscii( "unknown method type description for type" );
- sMessage.append( OUString( pITypeRef->pTypeName ) );
- sMessage.appendAscii( " (" );
- sMessage.append( (sal_Int32) nMethodId );
- sMessage.appendAscii( " )" );
- m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
-
- OSL_ENSURE( 0 , "unknown method type description" );
- return sal_False;
- }
-
- if( typelib_TypeClass_INTERFACE_ATTRIBUTE == pMemberType->aBase.eTypeClass )
- {
- // Note: pMapMemberIndexToFunctionIndex always contains the function
- // index of the attribute getter! setter function index is getter index
- // + 1.
- *ppAttributeType = (typelib_InterfaceAttributeTypeDescription *) pMemberType;
- *pbIsSetter = ! (
- pInterfaceType->pMapMemberIndexToFunctionIndex[nMemberIndex] == nMethodId );
- }
- else
- {
- *ppMethodType = (typelib_InterfaceMethodTypeDescription *) pMemberType;
- }
-
- TYPELIB_DANGER_RELEASE( (typelib_TypeDescription * )pInterfaceType );
- return sal_True;
-}
-
-OReaderThread::OReaderThread( remote_Connection *pConnection,
- uno_Environment *pEnvRemote,
- OWriterThread * pWriterThread ) :
- m_pConnection( pConnection ),
- m_pEnvRemote( pEnvRemote ),
- m_pWriterThread( pWriterThread ),
- m_bDestroyMyself( sal_False ),
- m_bContinue( sal_True ),
- m_pBridgeImpl((struct urp_BridgeImpl*)
- ((remote_Context *)pEnvRemote->pContext)->m_pBridgeImpl ),
- m_unmarshal( m_pBridgeImpl, m_pEnvRemote, ::bridges_remote::remote_createStub )
-{
- m_pEnvRemote->acquireWeak( m_pEnvRemote );
- m_pConnection->acquire( m_pConnection );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.acquire();
-#endif
-}
-
-
-OReaderThread::~OReaderThread( )
-{
- m_pEnvRemote->releaseWeak( m_pEnvRemote );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.release();
-#endif
-}
-
-// may only be called in the callstack of this thread !!!!!
-// run() -> dispose() -> destroyYourself()
-void OReaderThread::destroyYourself()
-{
- m_bDestroyMyself = sal_True;
- m_pConnection->release( m_pConnection );
- m_pConnection = 0;
- m_bContinue = sal_False;
-}
-
-void OReaderThread::onTerminated()
-{
- if( m_bDestroyMyself )
- {
- delete this;
- }
-}
-
-
-void OReaderThread::disposeEnvironment()
-{
- struct remote_Context *pContext =
- ( struct remote_Context * ) m_pEnvRemote->pContext;
- m_bContinue = sal_False;
- if( ! pContext->m_pBridgeImpl->m_bDisposed )
- {
- uno_Environment *pEnvRemote = 0;
- m_pEnvRemote->harden( &pEnvRemote , m_pEnvRemote );
- if( pEnvRemote )
- {
- pEnvRemote->dispose( m_pEnvRemote );
- pEnvRemote->release( m_pEnvRemote );
- }
- else
- {
- // environment has been disposed eitherway !
- }
- }
-}
-
-inline sal_Bool OReaderThread::readBlock( sal_Int32 *pnMessageCount )
-{
- m_unmarshal.setSize( 8 );
- if( 8 != m_pConnection->read( m_pConnection , m_unmarshal.getBuffer(), 8 ) )
- {
- OUString s( RTL_CONSTASCII_USTRINGPARAM( "Unexpected connection closure" ) );
- m_pBridgeImpl->addError( s );
- return sal_False;
- }
-
- sal_Int32 nSize;
- m_unmarshal.unpackInt32( &nSize );
- m_unmarshal.unpackInt32( pnMessageCount );
-
- if( nSize < 0 )
- {
- // buffer too big
- // no exception can be thrown, because there is no thread id, which could be
- // used. -> terminate !
- OUStringBuffer s;
- s.appendAscii( "Packet-size too big (" );
- s.append( (sal_Int64) (sal_uInt32 ) nSize );
- s.append( sal_Unicode( ')' ) );
- m_pBridgeImpl->addError( s.makeStringAndClear() );
- OSL_ENSURE( 0 , "urp bridge: Packet-size too big" );
- return sal_False;
- }
-
- if( 0 == nSize )
- {
- // normal termination !
- return sal_False;
- }
-
- // allocate the necessary memory
- if( ! m_unmarshal.setSize( nSize ) )
- {
- OUStringBuffer s;
- s.appendAscii( "Packet-size too big, couln't allocate necessary memory (" );
- s.append( (sal_Int64) (sal_uInt32 ) nSize );
- s.append( sal_Unicode( ')' ) );
- m_pBridgeImpl->addError( s.makeStringAndClear() );
- OSL_ENSURE( 0 , "urp bridge: messages size too large, terminating connection" );
- return sal_False;
- }
-
- sal_Int32 nRead = m_pConnection->read( m_pConnection , m_unmarshal.getBuffer() , nSize );
-
- if( nSize != nRead )
- {
- OUStringBuffer s;
- s.appendAscii( "Unexpected connection closure, inconsistent packet (" );
- s.append( (sal_Int64) (sal_uInt32 ) nSize );
- s.appendAscii( " asked, " );
- s.append( (sal_Int64) (sal_uInt32 ) nRead );
- s.appendAscii( " got )" );
- m_pBridgeImpl->addError( s.makeStringAndClear() );
- // couldn't get the asked amount of bytes, quit
- // should only occur, when the environment has already been disposed
- OSL_ENSURE( m_pBridgeImpl->m_bDisposed , "urp bridge: inconsistent packet, terminating connection." );
- return sal_False;
- }
- return sal_True;
-}
-
-inline sal_Bool OReaderThread::readFlags( struct MessageFlags *pFlags )
-{
- sal_uInt8 nBitField;
- if( ! m_unmarshal.unpackInt8( &nBitField ) )
- {
- m_pBridgeImpl->addError( "Unexpected end of message header (1)" );
- return sal_False;
- }
-
- if( HDRFLAG_LONGHEADER & nBitField )
- {
- // this is a long header, interpret the byte as bitfield
- pFlags->bTid = (HDRFLAG_NEWTID & nBitField );
- pFlags->bRequest = (HDRFLAG_REQUEST & nBitField);
-
- if( pFlags->bRequest )
- {
- // request
- pFlags->bType = ( HDRFLAG_NEWTYPE & nBitField );
- pFlags->bOid = ( HDRFLAG_NEWOID & nBitField );
- pFlags->bIgnoreCache = ( HDRFLAG_IGNORECACHE & nBitField );
- pFlags->bMoreFlags = ( HDRFLAG_MOREFLAGS & nBitField );
-
- if( pFlags->bMoreFlags )
- {
- // another byte with flags
- sal_Int8 moreFlags;
- if( ! m_unmarshal.unpackInt8( &moreFlags ) )
- {
- m_pBridgeImpl->addError( "Unexpected end of message header (2)" );
- return sal_False;
- }
- pFlags->bSynchronous = ( HDRFLAG_SYNCHRONOUS & moreFlags );
- pFlags->bMustReply = ( HDRFLAG_MUSTREPLY & moreFlags );
- OSL_ENSURE( (pFlags->bSynchronous && pFlags->bMustReply) ||
- (!pFlags->bSynchronous && !pFlags->bMustReply),
- "urp-bridge : customized calls currently not supported !");
- }
-
- if( HDRFLAG_LONGMETHODID & nBitField )
- {
- // methodid as unsigned short
- if( ! m_unmarshal.unpackInt16( &(pFlags->nMethodId )) )
- {
- m_pBridgeImpl->addError( "Unexpected end of message header (3)" );
- return sal_False;
- }
- }
- else
- {
- sal_uInt8 id;
- if( ! m_unmarshal.unpackInt8( &id ) )
- {
- m_pBridgeImpl->addError( "Unexpected end of message header (4)" );
- return sal_False;
- }
- pFlags->nMethodId = (sal_uInt16) id;
- }
- }
- else
- {
- // reply
- pFlags->bRequest = sal_False;
- pFlags->bException = ( HDRFLAG_EXCEPTION & nBitField );
- }
- }
- else
- {
- // short request
- pFlags->bRequest = sal_True;
- if( 0x40 & nBitField )
- {
- sal_uInt8 lower;
- if( ! m_unmarshal.unpackInt8( &lower ) )
- {
- m_pBridgeImpl->addError( "Unexpected end of message header (5)" );
- return sal_False;
- }
- pFlags->nMethodId = ( nBitField & 0x3f ) << 8 | lower;
- }
- else
- {
- pFlags->nMethodId = ( nBitField & 0x3f );
- }
- }
- return sal_True;
-}
-
-void OReaderThread::run()
-{
- // This vars are needed to hold oid,tid and type information, which should not be cached.
- Type lastTypeNoCache;
- OUString lastOidNoCache;
- ByteSequence lastTidNoCache;
-
- while( m_bContinue )
- {
- sal_Int32 nMessageCount;
- if( ! readBlock( &nMessageCount ) )
- {
- disposeEnvironment();
- break;
- }
-
- uno_Environment *pEnvRemote = 0;
- m_pEnvRemote->harden( &pEnvRemote , m_pEnvRemote );
- if( !pEnvRemote )
- {
- // environment has been disposed already, quit here
- break;
- }
- ServerMultiJob *pMultiJob = 0;
- remote_Interface *pLastRemoteI = 0;
- while( ! m_unmarshal.finished() )
- {
-#ifdef BRIDGES_URP_PROT
- sal_uInt32 nLogStart = m_unmarshal.getPos();
- sal_Bool bIsOneWay = sal_False;
- OUString sMemberName;
-#endif
- MessageFlags flags;
-
- if( ! readFlags( &flags ) )
- {
- m_pBridgeImpl->addError( "incomplete message, skipping block" );
- OSL_ENSURE ( 0 , "urp-bridge : incomplete message, skipping block" );
- break;
- }
-
- // use these ** to access the ids fast ( avoid acquire/release calls )
- sal_Sequence **ppLastTid = flags.bIgnoreCache ?
- (sal_Sequence **) &lastTidNoCache :
- (sal_Sequence **) &(m_pBridgeImpl->m_lastInTid);
- rtl_uString **ppLastOid = flags.bIgnoreCache ?
- (rtl_uString ** ) &lastOidNoCache :
- (rtl_uString ** ) &(m_pBridgeImpl->m_lastInOid);
- typelib_TypeDescriptionReference **ppLastType =
- flags.bIgnoreCache ?
- (typelib_TypeDescriptionReference ** ) &lastTypeNoCache :
- (typelib_TypeDescriptionReference ** ) &(m_pBridgeImpl->m_lastInType);
-
- // get new type
- if( flags.bType )
- {
- typelib_TypeDescriptionReference *pTypeRef = 0;
- if( m_unmarshal.unpackType( &pTypeRef ) )
- {
- // release the old type
- typelib_typedescriptionreference_release( *ppLastType );
- // set the new type
- *ppLastType = pTypeRef;
-
- // no release on pTypeRef necessary (will be released by type dtor)
- }
- else
- {
- typelib_typedescriptionreference_release( pTypeRef );
- m_pBridgeImpl->addError( "error during unpacking (maybe cached) interface type" );
- OSL_ENSURE( 0 , "urp-bridge : error during unpacking interface type, terminating connection" );
- disposeEnvironment();
- break;
- }
- if( m_pBridgeImpl->m_lastInType.getTypeClass() != TypeClass_INTERFACE )
- {
- OUStringBuffer sMessage;
- sMessage.appendAscii( "interface type is not of typeclass interface (" );
- sMessage.append( (sal_Int32) m_pBridgeImpl->m_lastInType.getTypeClass() );
- m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
- OSL_ENSURE( 0 , "urp-bridge : not an interface type" );
- disposeEnvironment();
- break;
- }
- }
- if( flags.bOid )
- {
- rtl_uString *pOid = 0;
- if( m_unmarshal.unpackOid( &pOid ) )
- {
- rtl_uString_release( *ppLastOid );
- *ppLastOid = pOid;
- }
- else
- {
- rtl_uString_release( pOid );
- m_pBridgeImpl->addError( "error during unpacking (maybe cached) oid" );
- OSL_ENSURE( 0 , "urp-bridge : error during unpacking cached data, terminating connection" );
- disposeEnvironment();
- break;
- }
- }
-
- if( flags.bTid )
- {
- sal_Sequence *pSeq = 0;
- if( m_unmarshal.unpackTid( &pSeq ) )
- {
- rtl_byte_sequence_release( *ppLastTid );
- *ppLastTid = pSeq;
- }
- else
- {
- rtl_byte_sequence_release( pSeq );
-
- m_pBridgeImpl->addError( "error during unpacking (maybe cached) tid" );
- OSL_ENSURE( 0 , "urp-bridge : error during unpacking cached data, terminating connection" );
- disposeEnvironment();
- break;
- }
- }
-
- // do the job
- if( flags.bRequest )
- {
- bool bHasCc = m_pBridgeImpl->m_properties.bCurrentContext
- && flags.nMethodId != REMOTE_RELEASE_METHOD_INDEX
- && !rtl::OUString( *ppLastOid ).equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM(
- g_NameOfUrpProtocolPropertiesObject ) );
- remote_Interface * pCc = 0;
- if ( bHasCc )
- {
- typelib_TypeDescription * pType = 0;
- TYPELIB_DANGER_GET(
- &pType,
- XCurrentContext::static_type().getTypeLibType() );
- bool ok = m_unmarshal.unpack( &pCc, pType );
- TYPELIB_DANGER_RELEASE( pType );
- if ( !ok )
- {
- OSL_ENSURE(
- false,
- ("urp_bridge: error while unpacking current"
- " context") );
- disposeEnvironment();
- break;
- }
- }
-
- //--------------------------
- // handle request
- //--------------------------
- // get the membertypedescription
- typelib_InterfaceMethodTypeDescription *pMethodType = 0;
- typelib_InterfaceAttributeTypeDescription *pAttributeType = 0;
- sal_Bool bIsSetter = sal_False;
-
- if( getMemberTypeDescription(
- &pAttributeType, &pMethodType, &bIsSetter,
- flags.nMethodId, *ppLastType ) )
- {
- if( ! pLastRemoteI || flags.bOid || flags.bType )
- {
- // a new interface must be retrieved
-
- // retrieve the interface NOW from the environment
- // (avoid race conditions : oneway followed by release )
- typelib_InterfaceTypeDescription *pInterfaceType = 0;
-
- TYPELIB_DANGER_GET(
- (typelib_TypeDescription ** ) &pInterfaceType ,
- *ppLastType );
- if( !pInterfaceType )
- {
- OUStringBuffer sMessage;
- sMessage.appendAscii( "Couldn't retrieve type description for type " );
- sMessage.append( OUString( (*ppLastType)->pTypeName ) );
- m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
- delete pMultiJob;
- pMultiJob = 0;
- disposeEnvironment();
- pLastRemoteI = 0; // stubs are released during dispose eitherway
- break;
- }
- pEnvRemote->pExtEnv->getRegisteredInterface(
- pEnvRemote->pExtEnv, ( void ** ) &pLastRemoteI,
- *ppLastOid, pInterfaceType );
- TYPELIB_DANGER_RELEASE( (typelib_TypeDescription * )pInterfaceType );
-
- if( !pLastRemoteI &&
- REMOTE_RELEASE_METHOD_INDEX != flags.nMethodId &&
- 0 == rtl_ustr_ascii_compare_WithLength(
- (*ppLastOid)->buffer, (*ppLastOid)->length, g_NameOfUrpProtocolPropertiesObject ) )
- {
- // check for bridge internal propertyobject
- pLastRemoteI = m_pBridgeImpl->m_pPropertyObject;
- pLastRemoteI->acquire( pLastRemoteI );
- flags.bBridgePropertyCall = sal_True;
- }
-
- // NOTE : Instance provider is called in the executing thread
- // Otherwise, instance provider may block the bridge
- }
-
- sal_Bool bCallIsOneway = sal_False;
- if( flags.bMoreFlags )
- {
- // flags override the default !
- bCallIsOneway = ! flags.bSynchronous;
- }
- else if( pMethodType && pMethodType->bOneWay )
- {
- bCallIsOneway = sal_True;
- }
-
- if( pMultiJob && ! flags.bTid && bCallIsOneway && ! pMultiJob->isFull())
- {
- // add to the existing multijob, nothing to do here
- }
- else
- {
- // create a new multijob
- if( pMultiJob )
- {
- // there exists an old one, start it first.
- pMultiJob->initiate();
- }
-
- pMultiJob = new ServerMultiJob(
- pEnvRemote,
- static_cast< remote_Context * >(
- pEnvRemote->pContext ),
- *ppLastTid, m_pBridgeImpl, &m_unmarshal,
- nMessageCount );
- }
-
- pMultiJob->setCurrentContext( bHasCc, pCc );
- pMultiJob->setIgnoreCache( flags.bIgnoreCache );
- pMultiJob->setType( *ppLastType );
- if( pMethodType )
- {
- pMultiJob->setMethodType( pMethodType ,
- REMOTE_RELEASE_METHOD_INDEX == flags.nMethodId,
- bCallIsOneway );
- }
- else if( pAttributeType )
- {
- pMultiJob->setAttributeType( pAttributeType, bIsSetter, bCallIsOneway );
- }
- else
- {
- OSL_ASSERT( 0 );
- }
-
- if( pLastRemoteI )
- pMultiJob->setInterface( pLastRemoteI );
- else
- pMultiJob->setOid( *ppLastOid );
- } /* getMemberTypeDescription */
- else
- {
- delete pMultiJob;
- pMultiJob = 0;
- pLastRemoteI = 0; // stubs are released during dispose eitherway
- disposeEnvironment();
- break;
- }
-#ifdef BRIDGES_URP_PROT
- bIsOneWay = pMethodType && pMethodType->bOneWay;
- sMemberName = pMethodType ?
- pMethodType->aBase.pMemberName :
- pAttributeType->aBase.pMemberName;
- sal_uInt32 nLogHeader = m_unmarshal.getPos();
-#endif
- if( ! pMultiJob->extract( ) )
- {
- // severe error during extracting, dispose
- delete pMultiJob;
- pMultiJob = 0;
- pLastRemoteI = 0; // stubs are released during dispose eitherway
- disposeEnvironment();
- break;
- }
-
-#ifdef BRIDGES_URP_PROT
- urp_logServingRequest(
- m_pBridgeImpl, m_unmarshal.getPos() - nLogStart,
- m_unmarshal.getPos() - nLogHeader,
- !bIsOneWay,
- sMemberName );
-#endif
- if ( flags.bBridgePropertyCall )
- {
- // call to the bridge internal object.
- // these calls MUST be executed within the dispatcher thread in order
- // to synchronize properly with protocol changes
- // NOTE : Threadid is not preserved for this call.
-
- // lock the marshaling NOW !
- {
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
-
- pMultiJob->execute();
-
- if( m_pBridgeImpl->m_pPropertyObject->changesHaveBeenCommited() )
- {
- Properties props;
- props = m_pBridgeImpl->m_pPropertyObject->getCommitedChanges();
-
- // This call modified the protocol, apply the changes NOW !
- m_pBridgeImpl->applyProtocolChanges( props );
- }
- }
- delete pMultiJob;
- pMultiJob = 0;
- }
- }
- else
- {
- //--------------------------
- // handle reply
- //--------------------------
- if( pMultiJob )
- {
- pMultiJob->initiate();
- pMultiJob = 0;
- }
- if( pLastRemoteI )
- {
- pLastRemoteI->release( pLastRemoteI );
- pLastRemoteI = 0;
- }
- ClientJob *pClientJob =
- m_pBridgeImpl->m_clientJobContainer.remove( *( ByteSequence * )ppLastTid );
-
- // Bridge MUST be already disposed, otherwise we got a wrong threadid
- // from remote !
- OSL_ASSERT( pClientJob || m_pBridgeImpl->m_bDisposed );
- if( ! pClientJob )
- {
- OUStringBuffer error( 128 );
- error.appendAscii( "ThreadID " );
- OString o = byteSequence2HumanReadableString( *(ByteSequence* )ppLastTid );
- error.appendAscii( o.getStr(), o.getLength() );
- error.appendAscii( " unknown, so couldn't unmarshal reply" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- pLastRemoteI = 0;
- disposeEnvironment();
- break;
- }
-
- pClientJob->m_bExceptionOccured = flags.bException;
-
- pClientJob->setUnmarshal( &m_unmarshal );
-#ifdef BRIDGES_URP_PROT
- sMemberName = pClientJob->m_pMethodType ?
- pClientJob->m_pMethodType->aBase.pMemberName :
- pClientJob->m_pAttributeType->aBase.pMemberName;
- sal_uInt32 nLogHeader = m_unmarshal.getPos();
-#endif
- if( ! pClientJob->extract( ) )
- {
- // severe error during extracting, dispose
- pLastRemoteI = 0; // stubs are released during dispose eitherway
- disposeEnvironment();
- break;
- }
-#ifdef BRIDGES_URP_PROT
- urp_logGettingReply(
- m_pBridgeImpl, m_unmarshal.getPos() - nLogStart,
- m_unmarshal.getPos() - nLogHeader, sMemberName );
-#endif
- sal_Bool bBridgePropertyCallAndWaitingForReply =
- pClientJob->isBridgePropertyCall();
-
- pClientJob->initiate();
-
- if( bBridgePropertyCallAndWaitingForReply )
- {
- // NOTE : This must be the reply for commit change. The new properties
- // are now applied by the clientJob thread, but the reader thread
- // must wait for it, because the next message on the wire already
- // uses the new protocol settings.
- // waiting for the commit change reply
- m_pBridgeImpl->m_pPropertyObject->waitUntilChangesAreCommitted();
- }
- }
- } // end while( !m_unmarshal.finished() )
-
- if( pLastRemoteI )
- pLastRemoteI->release( pLastRemoteI );
-
- if( pMultiJob )
- pMultiJob->initiate();
-
- if( pEnvRemote )
- pEnvRemote->release( pEnvRemote );
- }
-
- if( m_pConnection )
- {
- m_pConnection->release( m_pConnection );
- m_pConnection = 0;
- }
-}
-}
diff --git a/bridges/source/remote/urp/urp_reader.hxx b/bridges/source/remote/urp/urp_reader.hxx
deleted file mode 100644
index 85968a57f70d..000000000000
--- a/bridges/source/remote/urp/urp_reader.hxx
+++ /dev/null
@@ -1,78 +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 <osl/thread.hxx>
-
-#include "urp_unmarshal.hxx"
-
-struct remote_Connection;
-typedef struct _uno_Environment uno_Environment;
-
-namespace bridges_urp
-{
-
-class OWriterThread;
-struct MessageFlags;
-
-class OReaderThread :
- public ::osl::Thread
-{
-public:
- OReaderThread( remote_Connection *pConnection ,
- uno_Environment *pEnvRemote,
- OWriterThread *pWriterThread );
- ~OReaderThread();
-
- // may only be called in the callstack of this thread !!!!!
- // run() -> disposeEnvironment() -> dispose() -> destroyYourself()
- void destroyYourself();
-
-private:
- virtual void SAL_CALL run();
- virtual void SAL_CALL onTerminated();
-
- inline sal_Bool readBlock( sal_Int32 *pnMessageCount );
- inline sal_Bool readFlags( struct MessageFlags *pFlags );
-
- void disposeEnvironment();
-
- inline sal_Bool getMemberTypeDescription(
- typelib_InterfaceAttributeTypeDescription **ppAttributeType,
- typelib_InterfaceMethodTypeDescription **ppMethodType,
- sal_Bool *pbIsSetter,
- sal_uInt16 nMethodId ,
- typelib_TypeDescriptionReference *pITypeRef);
-
- remote_Connection *m_pConnection;
- uno_Environment *m_pEnvRemote;
- OWriterThread *m_pWriterThread;
- sal_Bool m_bDestroyMyself;
- sal_Bool m_bContinue;
- urp_BridgeImpl *m_pBridgeImpl;
- Unmarshal m_unmarshal;
-};
-
-}
diff --git a/bridges/source/remote/urp/urp_replycontainer.hxx b/bridges/source/remote/urp/urp_replycontainer.hxx
deleted file mode 100644
index afb1d951f5a0..000000000000
--- a/bridges/source/remote/urp/urp_replycontainer.hxx
+++ /dev/null
@@ -1,75 +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 <hash_map>
-#include <list>
-
-#include <osl/mutex.hxx>
-#include <osl/diagnose.h>
-
-#include "urp_threadid.hxx"
-
-namespace bridges_urp
-{
- class ClientJob;
- typedef ::std::hash_map< ::rtl::ByteSequence ,
- ::std::list < ClientJob * > ,
- HashThreadId ,
- EqualThreadId > Id2ClientJobStackMap;
-
- class urp_ClientJobContainer
- {
- public:
- void add( const ::rtl::ByteSequence &id , ClientJob *p )
- {
- ::osl::MutexGuard guard( m_mutex );
- m_map[id].push_back( p );
- }
-
- ClientJob *remove( const ::rtl::ByteSequence & id )
- {
- ::osl::MutexGuard guard( m_mutex );
- Id2ClientJobStackMap::iterator ii = m_map.find( id );
-
- ClientJob *p = 0;
- if( ii != m_map.end() )
- {
- p = (*ii).second.back();
- (*ii).second.pop_back();
- if( (*ii).second.empty() )
- {
- m_map.erase( ii );
- }
- }
-
- return p;
- }
-
- private:
- ::osl::Mutex m_mutex;
- Id2ClientJobStackMap m_map;
- };
-}
diff --git a/bridges/source/remote/urp/urp_threadid.cxx b/bridges/source/remote/urp/urp_threadid.cxx
deleted file mode 100644
index 6d8d165be26e..000000000000
--- a/bridges/source/remote/urp/urp_threadid.cxx
+++ /dev/null
@@ -1,48 +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_bridges.hxx"
-#include "urp_threadid.hxx"
-
-#include <rtl/strbuf.hxx>
-
-using namespace rtl;
-
-namespace bridges_urp
-{
- rtl::OString byteSequence2HumanReadableString( const rtl::ByteSequence &a )
- {
- const sal_uInt8 *p = (const sal_uInt8 * ) a.getConstArray();
- sal_Int32 nLength = a.getLength();
- OStringBuffer buf( a.getLength() * 2 + 2 );
- buf.append( RTL_CONSTASCII_STRINGPARAM( "0x" ) );
- for( sal_Int32 i = 0 ; i < nLength ; i ++ )
- buf.append( (sal_Int32) p[i] , 16 );
- return buf.makeStringAndClear();
- }
-}
diff --git a/bridges/source/remote/urp/urp_threadid.hxx b/bridges/source/remote/urp/urp_threadid.hxx
deleted file mode 100644
index cd95d89b2af2..000000000000
--- a/bridges/source/remote/urp/urp_threadid.hxx
+++ /dev/null
@@ -1,59 +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 _URP_THREADID_HXX_
-#define _URP_THREADID_HXX_
-
-#include <sal/types.h>
-#include <rtl/byteseq.hxx>
-#include <rtl/string.hxx>
-
-namespace bridges_urp
-{
-
- struct EqualThreadId
- {
- sal_Int32 operator () ( const ::rtl::ByteSequence &a , const ::rtl::ByteSequence &b ) const
- {
- return a == b;
- }
- };
-
- struct HashThreadId
- {
- sal_Int32 operator () ( const ::rtl::ByteSequence &a ) const
- {
- if( a.getLength() >= 4 )
- {
- return *(sal_Int32*) a.getConstArray();
- }
- return 0;
- }
- };
-
- rtl::OString byteSequence2HumanReadableString( const rtl::ByteSequence &a );
-}
-#endif
diff --git a/bridges/source/remote/urp/urp_unmarshal.cxx b/bridges/source/remote/urp/urp_unmarshal.cxx
deleted file mode 100644
index 79335bfeb6f0..000000000000
--- a/bridges/source/remote/urp/urp_unmarshal.cxx
+++ /dev/null
@@ -1,707 +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_bridges.hxx"
-#include <string.h>
-
-#include <osl/diagnose.h>
-
-#include <rtl/alloc.h>
-#include <rtl/ustrbuf.hxx>
-
-#include <uno/data.h>
-#include <uno/any2.h>
-#include <uno/sequence2.h>
-
-#include <com/sun/star/uno/Any.hxx>
-
-#include "urp_unmarshal.hxx"
-#include "urp_bridgeimpl.hxx"
-
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-
-namespace bridges_urp
-{
-static int g_nDetectLittleEndian = 1;
-char g_bSystemIsLittleEndian = ((char*)&g_nDetectLittleEndian)[0];
-
-
-Unmarshal::Unmarshal( struct urp_BridgeImpl *pBridgeImpl,
- uno_Environment *pEnvRemote,
- remote_createStubFunc callback ) :
- m_nBufferSize( 4096 ),
- m_base( (sal_Int8*) rtl_allocateMemory( m_nBufferSize ) ),
- m_pos( m_base ),
- m_nLength( 0 ),
- m_callback( callback ),
- m_pEnvRemote( pEnvRemote ),
- m_pBridgeImpl( pBridgeImpl )
-{
-}
-
-Unmarshal::~Unmarshal()
-{
- rtl_freeMemory( m_base );
-}
-
-// special unpacks
-sal_Bool Unmarshal::unpackTid( sal_Sequence **ppThreadId )
-{
- sal_Int32 nSize;
- sal_Bool bReturn = unpackCompressedSize( &nSize );
- if( bReturn )
- {
- if( nSize )
- {
- rtl_byte_sequence_constructFromArray( ppThreadId , m_pos , nSize );
- m_pos += nSize;
- sal_uInt16 nIndex;
- bReturn = unpackInt16( &nIndex );
- if( nIndex < m_pBridgeImpl->m_properties.nTidCacheSize )
- {
- m_pBridgeImpl->m_pTidIn[nIndex] = *(ByteSequence * )ppThreadId;
- }
- else if( 0xffff != nIndex )
- {
- bReturn = sal_False;
- rtl_byte_sequence_construct( ppThreadId , 0 );
-
- OUStringBuffer error( 128 );
- error.appendAscii( "cache index for tid " );
- OString o = byteSequence2HumanReadableString( *(ByteSequence * ) ppThreadId );
- error.appendAscii( o.getStr(), o.getLength() );
- error.appendAscii( "out of range(0x");
- error.append( (sal_Int32) nIndex ,16 );
- error.appendAscii( ")" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
- else
- {
- sal_uInt16 nIndex;
- bReturn = unpackInt16( &nIndex );
- if( nIndex < m_pBridgeImpl->m_properties.nTidCacheSize )
- {
- *ppThreadId = m_pBridgeImpl->m_pTidIn[nIndex].getHandle();
- rtl_byte_sequence_acquire( *ppThreadId );
- }
- else
- {
- bReturn = sal_False;
- rtl_byte_sequence_construct( ppThreadId , 0 );
- OUStringBuffer error(128);
- error.appendAscii( "cache index for tids out of range(0x" );
- error.append( (sal_Int32) nIndex ,16 );
- error.appendAscii( ")" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
- }
- else
- {
- m_pBridgeImpl->addError( "couldn't unpack thread id because of previous errors" );
- }
- return bReturn;
-}
-
-sal_Bool Unmarshal::unpackOid( rtl_uString **ppOid )
-{
- sal_Bool bReturn = sal_True;
- sal_uInt16 nCacheIndex = 0;
-
- bReturn = bReturn && unpackString( ppOid );
- bReturn = bReturn && unpackInt16( &nCacheIndex );
-
- if( bReturn &&
- ! ( 0xffff == nCacheIndex && 0 == (*ppOid)->length ) /* null reference */ )
- {
- if( (*ppOid)->length )
- {
- // new unknown reference
- if( 0xffff != nCacheIndex )
- {
- // oid should be cached ?
- if( nCacheIndex < m_pBridgeImpl->m_properties.nOidCacheSize )
- {
- m_pBridgeImpl->m_pOidIn[nCacheIndex] = *ppOid;
- }
- else
- {
- OUStringBuffer error( 128 );
- error.appendAscii( "new oid provided (" );
- error.append( *ppOid );
- error.appendAscii( "), but new cache index is out of range(0x");
- error.append( (sal_Int32) nCacheIndex ,16 );
- error.appendAscii( ")" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
-
- bReturn = sal_False;
- rtl_uString_new( ppOid );
- }
- }
- }
- else
- {
- // reference in cache !
- if( nCacheIndex < m_pBridgeImpl->m_properties.nOidCacheSize )
- {
- rtl_uString_assign( ppOid , m_pBridgeImpl->m_pOidIn[nCacheIndex].pData );
- }
- else
- {
- bReturn = sal_False;
- rtl_uString_new( ppOid );
-
- OUStringBuffer error( 128 );
- error.appendAscii( "cache index for oids out of range(0x");
- error.append( (sal_Int32) nCacheIndex ,16 );
- error.appendAscii( ")" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
- }
-
- return bReturn;
-}
-
-sal_Bool Unmarshal::unpack( void *pDestination ,
- typelib_TypeDescription *pTypeDescr )
-{
- // Note: We implement unpack functionality without recursions in order
- // to avoid stack overflows caused by rotten URP blocks.
-
- m_aItemsToUnpack.push( UnpackItem( pDestination, pTypeDescr ) );
-
- sal_Bool bReturn = sal_True;
- do
- {
- void * pDest = m_aItemsToUnpack.top().pDest;
- typelib_TypeDescription * pType = m_aItemsToUnpack.top().pType;
- m_aItemsToUnpack.pop();
-
- switch( pType->eTypeClass )
- {
- case typelib_TypeClass_VOID:
- // do nothing
- break;
- case typelib_TypeClass_BYTE:
- {
- bReturn = unpackInt8( pDest );
- break;
- }
- case typelib_TypeClass_BOOLEAN:
- {
- bReturn = ! checkOverflow( 1 );
- if( bReturn )
- {
- *((sal_Bool*)pDest) = (sal_Bool ) ( *m_pos);
- m_pos ++;
- }
- else
- {
- *((sal_Bool*)pDest) = 0;
- }
- break;
- }
-
- case typelib_TypeClass_CHAR:
- case typelib_TypeClass_SHORT:
- case typelib_TypeClass_UNSIGNED_SHORT:
- {
- unpackInt16( pDest );
- break;
- }
- case typelib_TypeClass_ENUM:
- case typelib_TypeClass_FLOAT:
- case typelib_TypeClass_LONG:
- case typelib_TypeClass_UNSIGNED_LONG:
- {
- bReturn = unpackInt32( pDest );
- break;
- }
- case typelib_TypeClass_DOUBLE:
- case typelib_TypeClass_HYPER:
- case typelib_TypeClass_UNSIGNED_HYPER:
- {
- sal_Int8 * p = static_cast< sal_Int8 * >(pDest);
- bReturn = ! checkOverflow( 8 );
- if( bReturn )
- {
- if( isSystemLittleEndian() )
- {
- p[7] = m_pos[0];
- p[6] = m_pos[1];
- p[5] = m_pos[2];
- p[4] = m_pos[3];
- p[3] = m_pos[4];
- p[2] = m_pos[5];
- p[1] = m_pos[6];
- p[0] = m_pos[7];
- }
- else
- {
- p[0] = m_pos[0];
- p[1] = m_pos[1];
- p[2] = m_pos[2];
- p[3] = m_pos[3];
- p[4] = m_pos[4];
- p[5] = m_pos[5];
- p[6] = m_pos[6];
- p[7] = m_pos[7];
- }
- m_pos += 8;
- }
- else
- {
- // Do not trigger alignment errors:
- p[0] = p[1] = p[2] = p[3] = p[4] = p[5] = p[6] = p[7] = 0;
- }
- break;
- }
- case typelib_TypeClass_STRING:
- {
- unpackString( pDest );
- break;
- }
- case typelib_TypeClass_ANY:
- {
- uno_Any *pAny = ( uno_Any * )pDest;
-
- pAny->pType = 0;
- // Type is acquired with typelib_typedescription_acquire
-
- bReturn = unpackType( &(pAny->pType) );
-
- typelib_TypeDescription *pDataType = 0;
- if( bReturn && pAny->pType )
- {
- typelib_typedescriptionreference_getDescription( &pDataType , pAny->pType );
-
- if( pDataType )
- {
- switch (pDataType->eTypeClass)
- {
- case typelib_TypeClass_HYPER:
- case typelib_TypeClass_UNSIGNED_HYPER:
- if (sizeof(void *) < sizeof(sal_Int64))
- {
- pAny->pData = rtl_allocateMemory( sizeof(sal_Int64) );
- }
- else
- {
- pAny->pData = &pAny->pReserved;
- }
- break;
- case typelib_TypeClass_FLOAT:
- if (sizeof(void *) < sizeof(float))
- {
- pAny->pData = rtl_allocateMemory( sizeof(float) );
- }
- else
- {
- pAny->pData = &pAny->pReserved;
- }
- break;
- case typelib_TypeClass_DOUBLE:
- if (sizeof(void *) < sizeof(double))
- {
- pAny->pData = rtl_allocateMemory( sizeof(double) );
- }
- else
- {
- pAny->pData = &pAny->pReserved;
- }
- break;
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_UNION:
- case typelib_TypeClass_EXCEPTION:
- case typelib_TypeClass_ARRAY:
- pAny->pData = rtl_allocateMemory( pDataType->nSize );
- break;
- case typelib_TypeClass_ANY:
- {
- m_pBridgeImpl->addError(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "can't unmarshal any: any in any not supported!" ) ) );
-
- pAny->pData = 0;
- Type type; // void
- pAny->pType = type.getTypeLibType();
- typelib_typedescriptionreference_acquire( pAny->pType );
-
- bReturn = sal_False;
- break;
- }
- default:
- pAny->pData = &pAny->pReserved;
- }
-
- if ( bReturn )
- {
- m_aItemsToUnpack.push(
- UnpackItem( pAny->pData, pDataType ) );
- }
- }
- else
- {
- OUStringBuffer error;
- error.appendAscii( "can't unmarshal any because typedescription for " );
- error.append( pAny->pType->pTypeName );
- error.appendAscii( " is missing" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
-
- if( pDataType )
- {
- typelib_typedescription_release( pDataType );
- }
- else
- {
- pAny->pData = 0;
- Type type; // void
- pAny->pType = type.getTypeLibType();
- typelib_typedescriptionreference_acquire( pAny->pType );
-
- bReturn = sal_False;
- }
-
- break;
- }
- case typelib_TypeClass_INTERFACE:
- {
- *(remote_Interface**)pDest = 0;
-
- rtl_uString *pString = 0;
- bReturn = unpackOid( &pString ) && bReturn;
-
- if( bReturn && pString && pString->length )
- {
- m_callback( (remote_Interface**) pDest ,
- pString,
- pType->pWeakRef ,
- m_pEnvRemote,
- urp_releaseRemoteCallback );
- }
- if( pString )
- {
- rtl_uString_release( pString );
- }
- break;
- }
- case typelib_TypeClass_TYPE:
- {
- bReturn = unpackType( pDest );
- break;
- }
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_EXCEPTION:
- {
- typelib_CompoundTypeDescription * pCompType =
- (typelib_CompoundTypeDescription *)pType;
-
- // direct members
- typelib_TypeDescriptionReference ** ppTypeRefs = pCompType->ppTypeRefs;
- sal_Int32 * pMemberOffsets = pCompType->pMemberOffsets;
- sal_Int32 nDescr = pCompType->nMembers;
-
- // at least assume 1 byte per member
- bReturn = bReturn && ! checkOverflow( nDescr * 1 );
- for ( sal_Int32 nPos = nDescr; nPos; --nPos )
- {
- typelib_TypeDescription * pMemberType = 0;
- typelib_typedescriptionreference_getDescription(
- &pMemberType, ppTypeRefs[ nPos - 1 ] );
-
- m_aItemsToUnpack.push(
- UnpackItem( (char*)pDest + pMemberOffsets[ nPos - 1 ],
- pMemberType,
- true /* construct even in error case */ ) );
-
- m_aTypesToRelease.push_back( pMemberType );
- }
-
- // parent
- if (pCompType->pBaseTypeDescription)
- {
- m_aItemsToUnpack.push(
- UnpackItem( pDest,
- (typelib_TypeDescription *)
- pCompType->pBaseTypeDescription ) );
- }
- break;
- }
- case typelib_TypeClass_SEQUENCE:
- {
- sal_Int32 nLen;
- bReturn = unpackCompressedSize( &nLen );
-
- // urp protocol does not allow to use the elementsize as a guess, if enough data
- // is available. However, at least one byte per member must be within the message
- bReturn = bReturn && ! checkOverflow( 1 * nLen );
- uno_Sequence *pSequence = 0;
- if( nLen && bReturn )
- {
- typelib_TypeDescriptionReference * pETRef =
- ((typelib_IndirectTypeDescription *)pType)->pType;
-
- typelib_TypeDescription * pET = 0;
- typelib_typedescriptionreference_getDescription( &pET , pETRef );
-
- if( pET )
- {
- sal_Int32 nElementSize = pET->nSize;
-
- pSequence = (uno_Sequence *)rtl_allocateMemory(
- SAL_SEQUENCE_HEADER_SIZE + nElementSize * nLen );
- pSequence->nRefCount = 1;
- pSequence->nElements = nLen;
-
- if( typelib_TypeClass_BYTE == pET->eTypeClass )
- {
- memcpy( pSequence->elements , m_pos , nLen );
- m_pos += nLen;
- }
- else
- {
- for ( sal_Int32 i = nLen; i; --i )
- {
- m_aItemsToUnpack.push(
- UnpackItem(
- ((char*)pSequence->elements)
- + (i - 1) * nElementSize,
- pET ) );
- }
- }
- m_aTypesToRelease.push_back( pET );
- }
- else
- {
- bReturn = sal_False;
- uno_constructData( &pSequence , pType );
- OUStringBuffer error;
- error.appendAscii( "can't unmarshal sequence, because there is no typedescription for element type " );
- error.append( pETRef->pTypeName );
- error.appendAscii( " available" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
- else
- {
- uno_constructData( &pSequence , pType );
- }
-
- *((uno_Sequence **)pDest) = pSequence;
- break;
- }
- case typelib_TypeClass_UNION:
- case typelib_TypeClass_ARRAY:
- case typelib_TypeClass_SERVICE:
- case typelib_TypeClass_MODULE:
- case typelib_TypeClass_INTERFACE_METHOD:
- case typelib_TypeClass_INTERFACE_ATTRIBUTE:
- case typelib_TypeClass_UNKNOWN:
- default:
- {
- ::rtl::OUStringBuffer buffer( 128 );
- buffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Unsupported typeclass during unmarshaling ("));
- buffer.append( ( sal_Int32 ) pType->eTypeClass , 10 );
- buffer.appendAscii( ")" );
- m_pBridgeImpl->addError( buffer.makeStringAndClear() );
- bReturn = sal_False;
- }
- }
-
- if ( !bReturn )
- {
- // construct default data for every remaining item.
- while ( !m_aItemsToUnpack.empty() )
- {
- const UnpackItem & rItem = m_aItemsToUnpack.top();
-
- if ( rItem.bMustBeConstructed )
- uno_constructData( rItem.pDest , rItem.pType );
-
- m_aItemsToUnpack.pop();
- }
- }
- }
- while ( !m_aItemsToUnpack.empty() );
-
- // release pending type descriptions
- TypeDescVector::const_iterator it = m_aTypesToRelease.begin();
- const TypeDescVector::const_iterator end = m_aTypesToRelease.end();
- while ( it != end )
- {
- typelib_typedescription_release( *it );
- it++;
- }
- m_aTypesToRelease.clear();
-
- return bReturn;
-}
-
-sal_Bool Unmarshal::unpackType( void *pDest )
-{
- *(typelib_TypeDescriptionReference **) pDest = 0;
-
- sal_uInt8 nTypeClass;
- sal_Bool bReturn = unpackInt8( &nTypeClass );
-
- typelib_TypeDescriptionReference *pTypeRef = 0;
- if( bReturn )
- {
- if( nTypeClass <= 14 /* any */ )
- {
- pTypeRef = * typelib_static_type_getByTypeClass((typelib_TypeClass )nTypeClass);
- typelib_typedescriptionreference_acquire( pTypeRef );
- }
- else
- {
- sal_uInt16 nCacheIndex = 0;
- bReturn = bReturn && unpackInt16( &nCacheIndex );
-
- if( bReturn )
- {
- if( nTypeClass & 0x80 )
- {
- // new type
- rtl_uString *pString = 0;
- bReturn = bReturn && unpackString( &pString );
- if( bReturn )
- {
- typelib_TypeDescription *pType = 0;
- typelib_typedescription_getByName( &pType, pString );
- if( pType )
- {
- // type is known in this process
- if( (typelib_TypeClass )(nTypeClass & 0x7f) == pType->eTypeClass )
- {
- //typename and typeclass match, this is as it should be
- pTypeRef = pType->pWeakRef;
- typelib_typedescriptionreference_acquire( pTypeRef );
- }
- else
- {
- // typename and typeclass do not match, dispose the bridge
- // as there must be inconsistent type base between both processes
- // or trash comes over the wire ...
- bReturn = sal_False;
- OUStringBuffer error( 128 );
- error.appendAscii( "it is tried to introduce type " );
- error.append( pString );
- error.appendAscii( "with typeclass " );
- error.append( (sal_Int32)( nTypeClass & 0x7f ) , 10 );
- error.appendAscii( " , which does not match with typeclass " );
- error.append( (sal_Int32) pType->eTypeClass ,10 );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- typelib_typedescription_release( pType );
- pType = 0;
- }
- else
- {
- // a type by this name is not known in the process.
- if( (nTypeClass & 0x7f) < typelib_TypeClass_UNKNOWN )
- {
- // typeclass is within a valid range, introduce the new
- // type.
- typelib_typedescriptionreference_new(
- &pTypeRef, (typelib_TypeClass )(nTypeClass & 0x7f), pString );
- }
- else
- {
- // typeclass is out of range !
- bReturn = sal_False;
- OUStringBuffer error( 128 );
- error.appendAscii( "it is tried to introduce type " );
- error.append( pString );
- error.appendAscii( "with an out of range typeclass " );
- error.append( (sal_Int32)( nTypeClass & 0x7f ) , 10 );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
-
- if( bReturn && nCacheIndex != 0xffff )
- {
- if( nCacheIndex < m_pBridgeImpl->m_properties.nTypeCacheSize )
- {
- m_pBridgeImpl->m_pTypeIn[nCacheIndex] = *( Type * )&pTypeRef;
- }
- else
- {
- bReturn = sal_False;
- OUStringBuffer error( 128 );
- error.appendAscii( "cache index for type " );
- error.append( pString );
- error.appendAscii( "out of range(0x" );
- error.append( (sal_Int32) nCacheIndex ,16 );
- error.appendAscii( ")" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
- }
- if( pString )
- {
- rtl_uString_release( pString );
- }
- }
- else
- {
- if( nCacheIndex < m_pBridgeImpl->m_properties.nTypeCacheSize )
- {
- pTypeRef = m_pBridgeImpl->m_pTypeIn[nCacheIndex].getTypeLibType();
- typelib_typedescriptionreference_acquire( pTypeRef );
- }
- else
- {
- bReturn = sal_False;
- OUStringBuffer error;
- error.appendAscii( "cache index for types out of range(0x" );
- error.append( (sal_Int32) nCacheIndex ,16 );
- error.appendAscii( ")" );
- m_pBridgeImpl->addError( error.makeStringAndClear() );
- }
- }
- }
- }
- }
- if( ! pTypeRef )
- {
- pTypeRef = * typelib_static_type_getByTypeClass(typelib_TypeClass_VOID);
- typelib_typedescriptionreference_acquire( pTypeRef );
- }
- // pTypeRef is already acquired
- *(typelib_TypeDescriptionReference**)pDest = pTypeRef;
- return bReturn;
-}
-
-}
-
diff --git a/bridges/source/remote/urp/urp_unmarshal.hxx b/bridges/source/remote/urp/urp_unmarshal.hxx
deleted file mode 100644
index 60da3f2d8b95..000000000000
--- a/bridges/source/remote/urp/urp_unmarshal.hxx
+++ /dev/null
@@ -1,280 +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 _URP_UNMARSHAL_HXX_
-#define _URP_UNMARSHAL_HXX_
-
-#include <stack>
-#include <vector>
-#include <rtl/byteseq.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <bridges/remote/context.h>
-
-#ifndef _BRIDGES_REMOTE_HELPER_HXX_
-#include <bridges/remote/helper.hxx>
-#endif
-#include <com/sun/star/uno/Type.hxx>
-#include "urp_bridgeimpl.hxx"
-
-typedef struct _uno_Environment uno_Environment;
-struct remote_Interface;
-
-namespace bridges_urp
-{
-
-extern char g_bSystemIsLittleEndian;
-class ThreadId;
-struct urp_BridgeImpl;
-void SAL_CALL urp_releaseRemoteCallback(
- remote_Interface *pRemoteI,rtl_uString *pOid,
- typelib_TypeDescriptionReference *pTypeRef,
- uno_Environment *pEnvRemote );
-
-struct UnpackItem
-{
- void * pDest;
- typelib_TypeDescription * pType;
- bool bMustBeConstructed;
-
- UnpackItem()
- : pDest( 0 ), pType( 0 ), bMustBeConstructed( false ) {}
- UnpackItem( void * d, typelib_TypeDescription * t, bool b = false )
- : pDest( d ), pType( t ), bMustBeConstructed( b ) {}
-};
-
-typedef std::stack< UnpackItem > UnpackItemStack;
-typedef std::vector< typelib_TypeDescription * > TypeDescVector;
-
-class Unmarshal
-{
-public:
- Unmarshal(
- struct urp_BridgeImpl *,
- uno_Environment *pEnvRemote,
- remote_createStubFunc callback );
- ~Unmarshal();
-
- inline sal_Bool finished()
- { return m_base + m_nLength == m_pos; }
- inline sal_uInt32 getPos()
- { return (sal_uInt32 ) (m_pos - m_base); }
-
- inline sal_Bool setSize( sal_Int32 nSize );
-
- sal_Bool unpack( void *pDest, typelib_TypeDescription *pType );
- inline sal_Bool unpackCompressedSize( sal_Int32 *pData );
- inline sal_Bool unpackInt8( void *pDest );
- inline sal_Bool unpackString( void *pDest );
- inline sal_Bool unpackInt16( void *pDest );
- inline sal_Bool unpackInt32( void *pDest );
- sal_Bool unpackType( void *pDest );
-
- inline sal_Bool unpackAny( void *pDest );
- sal_Bool unpackOid( rtl_uString **ppOid );
- sal_Bool unpackTid( sal_Sequence **ppThreadId );
-
- sal_Int8 *getBuffer()
- { return m_base; }
- inline sal_Bool isSystemLittleEndian()
- { return g_bSystemIsLittleEndian; }
-
-private:
- inline sal_Bool checkOverflow( sal_Int32 nNextMem );
-
- UnpackItemStack m_aItemsToUnpack;
- TypeDescVector m_aTypesToRelease;
-
- sal_Int32 m_nBufferSize;
- sal_Int8 *m_base;
- sal_Int8 *m_pos;
- sal_Int32 m_nLength;
-
- remote_createStubFunc m_callback;
- uno_Environment *m_pEnvRemote;
- urp_BridgeImpl *m_pBridgeImpl;
-};
-
-inline sal_Bool Unmarshal::setSize( sal_Int32 nSize )
-{
- if( nSize > m_nBufferSize )
- {
- // adjust buffer size and length.
- sal_Int8 * base =
- (sal_Int8*)rtl_reallocateMemory (m_base, sal_Size(nSize));
- if (base != 0)
- {
- m_base = base;
- m_nLength = m_nBufferSize = nSize;
- }
- }
- else
- {
- // adjust buffer length, only.
- m_nLength = nSize;
- }
-
- // reset buffer position, and leave.
- m_pos = m_base;
- return (m_nLength == nSize);
-}
-
-inline sal_Bool Unmarshal::checkOverflow( sal_Int32 nNextMem )
-{
- sal_Bool bOverflow = nNextMem < 0 ||
- (((sal_Int32)( m_pos - m_base )) + nNextMem ) > m_nLength;
- if( bOverflow )
- m_pBridgeImpl->addError( "message too short" );
- return bOverflow;
-}
-
-
-inline sal_Bool Unmarshal::unpackInt8( void *pDest )
-{
- sal_Bool bReturn = ! checkOverflow( 1 );
- if( bReturn )
- {
- *((sal_Int8*)pDest ) = *m_pos;
- m_pos++;
- }
- else
- {
- *((sal_Int8*)pDest ) = 0;
- }
- return bReturn;
-}
-
-inline sal_Bool Unmarshal::unpackInt32( void *pDest )
-{
- sal_uInt32 *p = ( sal_uInt32 * ) pDest;
- sal_Bool bReturn = ! checkOverflow(4);
- if( bReturn )
- {
- if( isSystemLittleEndian() )
- {
- ((sal_Int8*) p )[3] = m_pos[0];
- ((sal_Int8*) p )[2] = m_pos[1];
- ((sal_Int8*) p )[1] = m_pos[2];
- ((sal_Int8*) p )[0] = m_pos[3];
- }
- else
- {
- ((sal_Int8*) p )[3] = m_pos[3];
- ((sal_Int8*) p )[2] = m_pos[2];
- ((sal_Int8*) p )[1] = m_pos[1];
- ((sal_Int8*) p )[0] = m_pos[0];
- }
- m_pos += 4;
- }
- else
- {
- *p = 0;
- }
- return bReturn;
-}
-
-inline sal_Bool Unmarshal::unpackInt16( void *pDest )
-{
- sal_uInt16 *p = ( sal_uInt16 * ) pDest;
-
- sal_Bool bReturn = ! checkOverflow( 2 );
- if( bReturn )
- {
- if( isSystemLittleEndian() )
- {
- ((sal_Int8*) p )[1] = m_pos[0];
- ((sal_Int8*) p )[0] = m_pos[1];
- }
- else
- {
- ((sal_Int8*) p )[1] = m_pos[1];
- ((sal_Int8*) p )[0] = m_pos[0];
- }
- m_pos ++;
- m_pos ++;
- }
- else
- {
- *p = 0;
- }
- return bReturn;
-}
-
-inline sal_Bool Unmarshal::unpackString( void *pDest )
-{
- sal_Int32 nLength;
- sal_Bool bReturn = unpackCompressedSize( &nLength );
-
- bReturn = bReturn && ! checkOverflow( nLength );
- if( bReturn )
- {
- *(rtl_uString **) pDest = 0;
- rtl_string2UString( (rtl_uString**) pDest, (const sal_Char * )m_pos , nLength,
- RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS );
- m_pos += nLength;
- }
- else
- {
- *(rtl_uString ** ) pDest = 0;
- rtl_uString_new( (rtl_uString **) pDest );
- }
- return bReturn;
-}
-
-inline sal_Bool Unmarshal::unpackCompressedSize( sal_Int32 *pData )
-{
- sal_uInt8 n8Size;
- sal_Bool bReturn = unpackInt8( &n8Size );
- if( bReturn )
- {
- if( n8Size == 0xff )
- {
- unpackInt32( pData );
- }
- else
- {
- *pData = (sal_Int32 ) n8Size;
- }
- }
- return bReturn;
-}
-
-inline sal_Bool Unmarshal::unpackAny( void *pDest )
-{
- typelib_TypeDescriptionReference *pTypeRef =
- * typelib_static_type_getByTypeClass( typelib_TypeClass_ANY );
-
- typelib_TypeDescription * pTD = 0;
- typelib_typedescriptionreference_getDescription( &pTD, pTypeRef );
-
- sal_Bool bReturn = unpack( pDest, pTD );
-
- typelib_typedescription_release( pTD );
-
- return bReturn;
-}
-
-}
-#endif
diff --git a/bridges/source/remote/urp/urp_writer.cxx b/bridges/source/remote/urp/urp_writer.cxx
deleted file mode 100644
index 610b6653a06c..000000000000
--- a/bridges/source/remote/urp/urp_writer.cxx
+++ /dev/null
@@ -1,269 +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_bridges.hxx"
-#include <stdio.h>
-#include <osl/time.h>
-
-#include <osl/mutex.hxx>
-#include <osl/conditn.h>
-
-#include <typelib/typedescription.h>
-
-#include <bridges/remote/connection.h>
-#include <bridges/remote/remote.hxx>
-
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include <bridges/remote/counter.hxx>
-
-#include "urp_writer.hxx"
-#include "urp_bridgeimpl.hxx"
-#include "urp_marshal.hxx"
-#include "urp_dispatch.hxx"
-
-#if OSL_DEBUG_LEVEL > 1
-static MyCounter thisCounter( "DEBUG : WriterThread" );
-#endif
-
-using namespace ::osl;
-
-namespace bridges_urp {
-
-OWriterThread::OWriterThread( remote_Connection *pConnection, urp_BridgeImpl *pBridgeImpl,
- uno_Environment *pEnvRemote) :
- m_bAbort( sal_False ),
- m_bInBlockingWait( sal_False ),
- m_bEnterBlockingWait( sal_False ),
- m_pConnection( pConnection ),
- m_pBridgeImpl( pBridgeImpl ),
- m_pEnvRemote( pEnvRemote )
-
-{
- m_oslCondition = osl_createCondition();
- osl_resetCondition( m_oslCondition );
- m_pConnection->acquire( m_pConnection );
-
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.acquire();
-#endif
-}
-
-OWriterThread::~OWriterThread()
-{
- osl_destroyCondition( m_oslCondition );
- m_pConnection->release( m_pConnection );
-#if OSL_DEBUG_LEVEL > 1
- thisCounter.release();
-#endif
-}
-
-
-// touch is called with locked m_marshalingMutex
-void OWriterThread::touch( sal_Bool bImmediately )
-{
- if( bImmediately || m_pBridgeImpl->m_blockMarshaler.getPos() > m_pBridgeImpl->m_properties.nFlushBlockSize )
- {
- write();
- }
- else
- {
- // wake the writer thread up
- if( m_bInBlockingWait )
- {
- m_bInBlockingWait = sal_False;
- osl_setCondition( m_oslCondition );
- }
- else
- {
- // ensure, that the writing thread does not enter blocking mode
- m_bEnterBlockingWait = sal_False;
- }
- }
-}
-
-
-void OWriterThread::abortThread()
-{
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
-
- m_bAbort = sal_True;
- m_bEnterBlockingWait = sal_False;
- if( m_bInBlockingWait )
- {
- m_bInBlockingWait = sal_False;
- osl_setCondition( m_oslCondition );
- }
-}
-
-
-// must be called with locked marshaling mutex
-void OWriterThread::write()
-{
- if( ! m_pBridgeImpl->m_blockMarshaler.empty() && ! m_bAbort )
- {
- m_pBridgeImpl->m_blockMarshaler.finish( m_pBridgeImpl->m_nMarshaledMessages);
- m_pBridgeImpl->m_nMarshaledMessages = 0;
-
- sal_Int32 nLength = m_pBridgeImpl->m_blockMarshaler.getSize();
- sal_Int8 *pBuf = m_pBridgeImpl->m_blockMarshaler.getBuffer();
-
- if( nLength != m_pConnection->write( m_pConnection, pBuf, nLength ))
- {
- m_pBridgeImpl->m_blockMarshaler.restart();
- return;
- }
- m_pConnection->flush( m_pConnection );
- m_pBridgeImpl->m_blockMarshaler.restart();
- }
-}
-
-void OWriterThread::sendEmptyMessage()
-{
- // must be called with locked marshaling mutex
- sal_Int32 a[2] = {0,0};
- m_pConnection->write( m_pConnection , (sal_Int8*) a , sizeof( sal_Int32) *2 );
-}
-
-void OWriterThread::insertReleaseRemoteCall(
- rtl_uString *pOid,typelib_TypeDescriptionReference *pTypeRef)
-{
- {
- ::osl::MutexGuard guard( m_releaseCallMutex );
-
- struct RemoteReleaseCall call;
- call.sOid = pOid;
- call.typeInterface = pTypeRef;
- m_lstReleaseCalls.push_back( call );
- }
- {
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
- if( m_bInBlockingWait )
- {
- m_bInBlockingWait = sal_False;
- osl_setCondition( m_oslCondition );
- }
- else
- {
- // ensure, that the writing thread does not enter blocking mode
- m_bEnterBlockingWait = sal_False;
- }
- }
-}
-
-/* The release calls for doubled interfaces
- *
- *
- ***/
-void OWriterThread::executeReleaseRemoteCalls()
-{
- ::std::list< struct RemoteReleaseCall > lstReleaseCalls;
- {
- ::osl::MutexGuard guard( m_releaseCallMutex );
- lstReleaseCalls.swap( m_lstReleaseCalls );
- }
-
- for( ::std::list< struct RemoteReleaseCall >::iterator ii = lstReleaseCalls.begin();
- ii != lstReleaseCalls.end();
- ++ ii )
- {
- struct RemoteReleaseCall &call = (*ii) ;
-
- typelib_TypeDescription *pInterfaceTypeDesc = 0;
- typelib_TypeDescription *pReleaseMethod = 0;
-
- call.typeInterface.getDescription( &pInterfaceTypeDesc );
- if( ! pInterfaceTypeDesc->bComplete )
- {
- typelib_typedescription_complete( &pInterfaceTypeDesc );
- }
-
- uno_Any any;
- uno_Any *pAny = &any;
-
- typelib_typedescriptionreference_getDescription(
- &pReleaseMethod ,
- ((typelib_InterfaceTypeDescription*)pInterfaceTypeDesc)->ppAllMembers[REMOTE_RELEASE_METHOD_INDEX] );
-
- urp_sendRequest_internal(
- m_pEnvRemote , pReleaseMethod, call.sOid.pData,
- (typelib_InterfaceTypeDescription*) pInterfaceTypeDesc, 0, 0,
- &pAny );
-
- typelib_typedescription_release( pReleaseMethod );
- typelib_typedescription_release( pInterfaceTypeDesc );
- }
-}
-
-
-void OWriterThread::run()
-{
- while( ! m_bAbort )
- {
- sal_Bool bWait;
- {
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
- bWait = m_bEnterBlockingWait;
- if( bWait )
- {
- osl_resetCondition( m_oslCondition );
- m_bInBlockingWait = sal_True;
- }
- m_bEnterBlockingWait = sal_True;
- }
-
- // wait for some notification
- if( bWait )
- osl_waitCondition( m_oslCondition , 0 );
- // (m_bInBlockingWait = sal_False was set by the activating thread)
-
- if( m_bAbort )
- break;
-
- // Wait for the timeout
- TimeValue value = { 0 , 1000 * m_pBridgeImpl->m_properties.nOnewayTimeoutMUSEC };
- osl_resetCondition( m_oslCondition );
- osl_waitCondition( m_oslCondition , &value );
-
- // check if there are some release calls to be sent ....
- executeReleaseRemoteCalls();
-
- {
- // write to the socket
- MutexGuard guard( m_pBridgeImpl->m_marshalingMutex );
- if( ! m_pBridgeImpl->m_blockMarshaler.empty() )
- {
- write();
- }
- }
- }
-}
-
-
-}
-
diff --git a/bridges/source/remote/urp/urp_writer.hxx b/bridges/source/remote/urp/urp_writer.hxx
deleted file mode 100644
index f789c092fb98..000000000000
--- a/bridges/source/remote/urp/urp_writer.hxx
+++ /dev/null
@@ -1,83 +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 <list>
-
-#include <osl/conditn.h>
-#include <osl/mutex.hxx>
-
-#include <rtl/ustring.hxx>
-
-#include <osl/thread.hxx>
-
-#include <com/sun/star/uno/Type.hxx>
-
-struct remote_Connection;
-
-namespace bridges_urp
-{
- struct RemoteReleaseCall
- {
- ::rtl::OUString sOid;
- ::com::sun::star::uno::Type typeInterface;
- };
-
- struct urp_BridgeImpl;
- class OWriterThread :
- public ::osl::Thread
- {
- public:
- OWriterThread( remote_Connection *pConnection,
- urp_BridgeImpl *m_pBridgeImpl,
- uno_Environment *pEnvRemote);
- ~OWriterThread( );
-
- virtual void SAL_CALL run();
-
- void touch( sal_Bool bImmediately );
- void sendEmptyMessage();
-
- void abortThread();
-
- void SAL_CALL insertReleaseRemoteCall (
- rtl_uString *pOid,typelib_TypeDescriptionReference *pTypeRef);
- void SAL_CALL executeReleaseRemoteCalls();
-
- private:
- void write();
- oslCondition m_oslCondition;
- sal_Bool m_bAbort;
- sal_Bool m_bInBlockingWait;
- sal_Bool m_bEnterBlockingWait;
- remote_Connection *m_pConnection;
- urp_BridgeImpl *m_pBridgeImpl;
- uno_Environment *m_pEnvRemote; // this is held weak only
-
- ::osl::Mutex m_releaseCallMutex;
- ::std::list< struct RemoteReleaseCall > m_lstReleaseCalls;
- };
-}
-
diff --git a/bridges/unotypes/makefile.mk b/bridges/unotypes/makefile.mk
index d775638ac4af..d5b3bc970e51 100644
--- a/bridges/unotypes/makefile.mk
+++ b/bridges/unotypes/makefile.mk
@@ -41,20 +41,7 @@ UNOUCRRDB=$(SOLARBINDIR)$/udkapi.rdb
UNOUCROUT=$(OUT)$/inc
UNOTYPES = \
- com.sun.star.bridge.XProtocolProperties \
- com.sun.star.corba.giop.MessageHeader_1_2 \
- com.sun.star.corba.giop.MsgType_1_1 \
- com.sun.star.corba.iop.ServiceContextList \
- com.sun.star.corba.iop.ProfileIdGroup \
- com.sun.star.corba.iiop.ProfileBody_1_1 \
- com.sun.star.corba.LogicalThreadID \
- com.sun.star.corba.iop.ServiceIdGroup \
- com.sun.star.corba.giop.ReplyHeader_1_2 \
- com.sun.star.corba.giop.RequestHeader_1_2 \
- com.sun.star.corba.TCKind \
- com.sun.star.corba.ObjectKey \
com.sun.star.uno.XInterface \
- com.sun.star.lang.DisposedException \
com.sun.star.uno.TypeClass
# --- Targets ------------------------------------------------------
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 1da9197693ff..725a6ae0f2a6 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -105,6 +105,11 @@ namespace cairocanvas
// as required at the API spec
rOutDev.SetLayoutMode( nLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
}
+
+ bool compareFallbacks(const SystemGlyphData&rA, const SystemGlyphData &rB)
+ {
+ return rA.fallbacklevel < rB.fallbacklevel;
+ }
}
TextLayout::TextLayout( const rendering::StringContext& aText,
@@ -363,7 +368,6 @@ namespace cairocanvas
return true;
}
-
/**
* TextLayout::draw
*
@@ -404,18 +408,41 @@ namespace cairocanvas
::canvas::tools::numeric_cast<USHORT>(maText.Length),
maLogicalAdvancements.getLength() ? aOffsets.get() : NULL);
+ // Sort them so that all glyphs on the same glyph fallback level are consecutive
+ std::sort(aSysLayoutData.rGlyphData.begin(), aSysLayoutData.rGlyphData.end(), compareFallbacks);
+ bool bCairoRenderable = true;
+
+ //Pull all the fonts we need to render the text
+ typedef std::pair<SystemFontData,int> FontLevel;
+ typedef std::vector<FontLevel> FontLevelVector;
+ FontLevelVector aFontData;
+ SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
+ const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
+ for( ; aIter != aEnd; ++aIter )
+ {
+ if( aFontData.empty() || aIter->fallbacklevel != aFontData.back().second )
+ {
+ aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aIter->fallbacklevel),
+ aIter->fallbacklevel));
+ if( !isCairoRenderable(aFontData.back().first) )
+ {
+ bCairoRenderable = false;
+ OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): VCL FALLBACK %s%s%s%s - %s",
+ maLogicalAdvancements.getLength() ? "ADV " : "",
+ aFontData.back().first.bAntialias ? "AA " : "",
+ aFontData.back().first.bFakeBold ? "FB " : "",
+ aFontData.back().first.bFakeItalic ? "FI " : "",
+ ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
+ RTL_TEXTENCODING_UTF8 ).getStr());
+ break;
+ }
+ }
+ }
+
// The ::GetSysTextLayoutData(), i.e. layouting of text to glyphs can change the font being used.
// The fallback checks need to be done after final font is known.
- if (!isCairoRenderable(aSysLayoutData.aSysFontData)) // VCL FALLBACKS
+ if (!bCairoRenderable) // VCL FALLBACKS
{
- OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): VCL FALLBACK %s%s%s%s - %s",
- maLogicalAdvancements.getLength() ? "ADV " : "",
- aSysLayoutData.aSysFontData.bAntialias ? "AA " : "",
- aSysLayoutData.aSysFontData.bFakeBold ? "FB " : "",
- aSysLayoutData.aSysFontData.bFakeItalic ? "FI " : "",
- ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
- RTL_TEXTENCODING_UTF8 ).getStr());
-
if (maLogicalAdvancements.getLength()) // VCL FALLBACK - with glyph advances
{
rOutDev.DrawTextArray( rOutpos, maText.Text, aOffsets.get(),
@@ -438,144 +465,158 @@ namespace cairocanvas
* Setup platform independent glyph vector into cairo-based glyphs vector.
**/
- // setup glyphs
- std::vector<cairo_glyph_t> cairo_glyphs;
- cairo_glyphs.reserve( 256 );
-
- for( int nStart = 0; nStart < (int) aSysLayoutData.rGlyphData.size(); nStart++ )
+ // Loop through the fonts used and render the matching glyphs for each
+ FontLevelVector::const_iterator aFontDataIter = aFontData.begin();
+ const FontLevelVector::const_iterator aFontDataEnd = aFontData.end();
+ for( ; aFontDataIter != aFontDataEnd; ++aFontDataIter )
{
- cairo_glyph_t aGlyph;
- SystemGlyphData systemGlyph = aSysLayoutData.rGlyphData.at(nStart);
- aGlyph.index = systemGlyph.index;
-#ifdef CAIRO_HAS_WIN32_SURFACE
- // Cairo requires standard glyph indexes (ETO_GLYPH_INDEX), while vcl/win/* uses ucs4 chars.
- // Convert to standard indexes
- aGlyph.index = cairo::ucs4toindex((unsigned int) aGlyph.index, aSysLayoutData.aSysFontData.hFont);
-#endif
- aGlyph.x = systemGlyph.x;
- aGlyph.y = systemGlyph.y;
- cairo_glyphs.push_back(aGlyph);
- }
-
- if (cairo_glyphs.empty()) return true; //true or false??
-
- /**
- * Setup font
- **/
- cairo_font_face_t* font_face = NULL;
-
-#ifdef CAIRO_HAS_QUARTZ_SURFACE
- // TODO: use cairo_quartz_font_face_create_for_cgfont(cgFont)
- // when CGFont (Mac OS X 10.5 API) is provided by the AQUA VCL backend.
- font_face = cairo_quartz_font_face_create_for_atsu_font_id((ATSUFontID) aSysLayoutData.aSysFontData.aATSUFontID);
+ const SystemFontData &rSysFontData = aFontDataIter->first;
-#elif defined CAIRO_HAS_WIN32_SURFACE
- #if (OSL_DEBUG_LEVEL > 1)
- GetObjectW( aSysLayoutData.aSysFontData.hFont, sizeof(logfont), &logfont );
- #endif
- // Note: cairo library uses logfont fallbacks when lfEscapement, lfOrientation and lfWidth are not zero.
- // VCL always has non-zero value for lfWidth
- font_face = cairo_win32_font_face_create_for_hfont(aSysLayoutData.aSysFontData.hFont);
-
-#elif defined CAIRO_HAS_XLIB_SURFACE
- font_face = cairo_ft_font_face_create_for_ft_face((FT_Face)aSysLayoutData.aSysFontData.nFontId,
- aSysLayoutData.aSysFontData.nFontFlags);
-#else
-# error Native API needed.
-#endif
-
- CairoSharedPtr pSCairo = pSurface->getCairo();
-
- cairo_set_font_face( pSCairo.get(), font_face);
-
- // create default font options. cairo_get_font_options() does not retrieve the surface defaults,
- // only what has been set before with cairo_set_font_options()
- cairo_font_options_t* options = cairo_font_options_create();
- if (aSysLayoutData.aSysFontData.bAntialias) {
- // CAIRO_ANTIALIAS_GRAY provides more similar result to VCL Canvas,
- // so we're not using CAIRO_ANTIALIAS_SUBPIXEL
- cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);
- }
- cairo_set_font_options( pSCairo.get(), options);
-
- // Font color
- Color mTextColor = rOutDev.GetTextColor();
- cairo_set_source_rgb(pSCairo.get(),
- mTextColor.GetRed()/255.0,
- mTextColor.GetGreen()/255.0,
- mTextColor.GetBlue()/255.0);
-
- // Font rotation and scaling
- cairo_matrix_t m;
- Font aFont = rOutDev.GetFont();
- FontMetric aMetric( rOutDev.GetFontMetric(aFont) );
- long nWidth = 0;
-
- // width calculation is deep magic and platform/font dependant.
- // width == 0 means no scaling, and usually width == height means the same.
- // Other values mean horizontal scaling (narrow or stretching)
- // see issue #101566
-
- //proper scale calculation across platforms
- if (aFont.GetWidth() == 0) {
- nWidth = aFont.GetHeight();
- } else {
- // any scaling needs to be relative to the platform-dependent definition
- // of height of the font
- nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight();
- }
-
- cairo_matrix_init_identity(&m);
+ // setup glyphs
+ std::vector<cairo_glyph_t> cairo_glyphs;
+ cairo_glyphs.reserve( 256 );
- if (aSysLayoutData.orientation) cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0);
+ SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
+ const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
+ for( ; aIter != aEnd; ++aIter )
+ {
+ SystemGlyphData systemGlyph = *aIter;
+ if( systemGlyph.fallbacklevel != aFontDataIter->second )
+ continue;
+
+ cairo_glyph_t aGlyph;
+ aGlyph.index = systemGlyph.index;
+ #ifdef CAIRO_HAS_WIN32_SURFACE
+ // Cairo requires standard glyph indexes (ETO_GLYPH_INDEX), while vcl/win/* uses ucs4 chars.
+ // Convert to standard indexes
+ aGlyph.index = cairo::ucs4toindex((unsigned int) aGlyph.index, rSysFontData.hFont);
+ #endif
+ aGlyph.x = systemGlyph.x;
+ aGlyph.y = systemGlyph.y;
+ cairo_glyphs.push_back(aGlyph);
+ }
- cairo_matrix_scale(&m, nWidth, aFont.GetHeight());
+ if (cairo_glyphs.empty())
+ continue;
+
+ /**
+ * Setup font
+ **/
+ cairo_font_face_t* font_face = NULL;
+
+ #ifdef CAIRO_HAS_QUARTZ_SURFACE
+ // TODO: use cairo_quartz_font_face_create_for_cgfont(cgFont)
+ // when CGFont (Mac OS X 10.5 API) is provided by the AQUA VCL backend.
+ font_face = cairo_quartz_font_face_create_for_atsu_font_id((ATSUFontID) rSysFontData.aATSUFontID);
+
+ #elif defined CAIRO_HAS_WIN32_SURFACE
+ #if (OSL_DEBUG_LEVEL > 1)
+ GetObjectW( rSysFontData.hFont, sizeof(logfont), &logfont );
+ #endif
+ // Note: cairo library uses logfont fallbacks when lfEscapement, lfOrientation and lfWidth are not zero.
+ // VCL always has non-zero value for lfWidth
+ font_face = cairo_win32_font_face_create_for_hfont(rSysFontData.hFont);
+
+ #elif defined CAIRO_HAS_XLIB_SURFACE
+ font_face = cairo_ft_font_face_create_for_ft_face((FT_Face)rSysFontData.nFontId,
+ rSysFontData.nFontFlags);
+ #else
+ # error Native API needed.
+ #endif
+
+ CairoSharedPtr pSCairo = pSurface->getCairo();
+
+ cairo_set_font_face( pSCairo.get(), font_face);
+
+ // create default font options. cairo_get_font_options() does not retrieve the surface defaults,
+ // only what has been set before with cairo_set_font_options()
+ cairo_font_options_t* options = cairo_font_options_create();
+ if (rSysFontData.bAntialias) {
+ // CAIRO_ANTIALIAS_GRAY provides more similar result to VCL Canvas,
+ // so we're not using CAIRO_ANTIALIAS_SUBPIXEL
+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);
+ }
+ cairo_set_font_options( pSCairo.get(), options);
+
+ // Font color
+ Color mTextColor = rOutDev.GetTextColor();
+ cairo_set_source_rgb(pSCairo.get(),
+ mTextColor.GetRed()/255.0,
+ mTextColor.GetGreen()/255.0,
+ mTextColor.GetBlue()/255.0);
+
+ // Font rotation and scaling
+ cairo_matrix_t m;
+ Font aFont = rOutDev.GetFont();
+ FontMetric aMetric( rOutDev.GetFontMetric(aFont) );
+ long nWidth = 0;
+
+ // width calculation is deep magic and platform/font dependant.
+ // width == 0 means no scaling, and usually width == height means the same.
+ // Other values mean horizontal scaling (narrow or stretching)
+ // see issue #101566
+
+ //proper scale calculation across platforms
+ if (aFont.GetWidth() == 0) {
+ nWidth = aFont.GetHeight();
+ } else {
+ // any scaling needs to be relative to the platform-dependent definition
+ // of height of the font
+ nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight();
+ }
- //faux italics
- if (aSysLayoutData.aSysFontData.bFakeItalic) m.xy = -m.xx * 0x6000L / 0x10000L;
+ cairo_matrix_init_identity(&m);
- cairo_set_font_matrix(pSCairo.get(), &m);
+ if (aSysLayoutData.orientation) cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0);
- OSL_TRACE("\r\n:cairocanvas::TextLayout::draw(S,O,p,v,r): Size:(%d,%d), W:%d->%d, Pos (%d,%d), G(%d,%d,%d) %s%s%s%s || Name:%s - %s",
- aFont.GetWidth(),
- aFont.GetHeight(),
- aMetric.GetWidth(),
- nWidth,
- (int) rOutpos.X(),
- (int) rOutpos.Y(),
- cairo_glyphs[0].index, cairo_glyphs[1].index, cairo_glyphs[2].index,
- maLogicalAdvancements.getLength() ? "ADV " : "",
- aSysLayoutData.aSysFontData.bAntialias ? "AA " : "",
- aSysLayoutData.aSysFontData.bFakeBold ? "FB " : "",
- aSysLayoutData.aSysFontData.bFakeItalic ? "FI " : "",
-#if (defined CAIRO_HAS_WIN32_SURFACE) && (OSL_DEBUG_LEVEL > 1)
- ::rtl::OUStringToOString( reinterpret_cast<const sal_Unicode*> (logfont.lfFaceName), RTL_TEXTENCODING_UTF8 ).getStr(),
-#else
- ::rtl::OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
-#endif
- ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
- RTL_TEXTENCODING_UTF8 ).getStr()
- );
+ cairo_matrix_scale(&m, nWidth, aFont.GetHeight());
- cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
+ //faux italics
+ if (rSysFontData.bFakeItalic) m.xy = -m.xx * 0x6000L / 0x10000L;
- //faux bold
- if (aSysLayoutData.aSysFontData.bFakeBold) {
- double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
- int total_steps = 2 * ((int) (bold_dx + 0.5));
+ cairo_set_font_matrix(pSCairo.get(), &m);
- // loop to draw the text for every half pixel of displacement
- for (int nSteps = 0; nSteps < total_steps; nSteps++) {
- for(int nGlyphIdx = 0; nGlyphIdx < (int) cairo_glyphs.size(); nGlyphIdx++) {
- cairo_glyphs[nGlyphIdx].x += bold_dx * nSteps / total_steps;
+ OSL_TRACE("\r\n:cairocanvas::TextLayout::draw(S,O,p,v,r): Size:(%d,%d), W:%d->%d, Pos (%d,%d), G(%d,%d,%d) %s%s%s%s || Name:%s - %s",
+ aFont.GetWidth(),
+ aFont.GetHeight(),
+ aMetric.GetWidth(),
+ nWidth,
+ (int) rOutpos.X(),
+ (int) rOutpos.Y(),
+ cairo_glyphs[0].index, cairo_glyphs[1].index, cairo_glyphs[2].index,
+ maLogicalAdvancements.getLength() ? "ADV " : "",
+ rSysFontData.bAntialias ? "AA " : "",
+ rSysFontData.bFakeBold ? "FB " : "",
+ rSysFontData.bFakeItalic ? "FI " : "",
+ #if (defined CAIRO_HAS_WIN32_SURFACE) && (OSL_DEBUG_LEVEL > 1)
+ ::rtl::OUStringToOString( reinterpret_cast<const sal_Unicode*> (logfont.lfFaceName), RTL_TEXTENCODING_UTF8 ).getStr(),
+ #else
+ ::rtl::OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
+ #endif
+ ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
+ RTL_TEXTENCODING_UTF8 ).getStr()
+ );
+
+ cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
+
+ //faux bold
+ if (rSysFontData.bFakeBold) {
+ double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
+ int total_steps = 2 * ((int) (bold_dx + 0.5));
+
+ // loop to draw the text for every half pixel of displacement
+ for (int nSteps = 0; nSteps < total_steps; nSteps++) {
+ for(int nGlyphIdx = 0; nGlyphIdx < (int) cairo_glyphs.size(); nGlyphIdx++) {
+ cairo_glyphs[nGlyphIdx].x += bold_dx * nSteps / total_steps;
+ }
+ cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
}
- cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
+ OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): FAKEBOLD - dx:%d", (int) bold_dx);
}
- OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): FAKEBOLD - dx:%d", (int) bold_dx);
- }
- cairo_restore( pSCairo.get() );
- cairo_font_face_destroy(font_face);
+ cairo_restore( pSCairo.get() );
+ cairo_font_face_destroy(font_face);
+ }
return true;
}
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 077b30d5b904..00eb7c1ba071 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -211,6 +211,8 @@ namespace vclcanvas
if( (rColors.size() % 2) != (nStepCount % 2) )
++nStepCount;
+ rOutDev.SetLineColor();
+
basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
// only iterate nStepCount-1 steps, as the last strip is
@@ -366,6 +368,8 @@ namespace vclcanvas
// color).
++nStepCount;
+ rOutDev.SetLineColor();
+
basegfx::tools::KeyStopLerp aLerper(rValues.maStops);
if( !bFillNonOverlapping )
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 774a43ae3855..af1a2f9ccd4d 100644..100755
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -341,21 +341,8 @@ namespace vclcanvas
else
#endif
{
- // redraw is direcly on the front buffer,
- // or using alpha blending - cannot use
- // XOR, thus, employing the still somewhat
- // speedier triangle clip method
- ::basegfx::B2DPolygon aTriangulatedClip(::basegfx::triangulator::triangulate(aClipPoly));
-
- // restrict the clipping area to the visible portion of the output device.
- Size aSize(rTargetSurface.GetOutputSizePixel());
- ::basegfx::B2DRange aOutputRect(::basegfx::B2DPoint(0,0),::basegfx::B2DPoint(aSize.Width(),aSize.Height()));
- ::basegfx::B2DPolygon aClippedClip(::basegfx::tools::clipTriangleListOnRange(aTriangulatedClip,aOutputRect));
-
- // #i76339#
- const Polygon aPoly(aClippedClip);
- const PolyPolygon aPolyPoly(aPoly);
- rTargetSurface.SetTriangleClipRegion(aPolyPoly);
+ Region aClipRegion( aClipPoly );
+ rTargetSurface.SetClipRegion( aClipRegion );
}
}
}
diff --git a/chart2/prj/build.lst b/chart2/prj/build.lst
index ec6658d212c6..5b534700a4f0 100644
--- a/chart2/prj/build.lst
+++ b/chart2/prj/build.lst
@@ -1,4 +1,4 @@
-ch chart2 : offapi offuh l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 LIBXSLT:libxslt NULL
+ch chart2 : offapi offuh L10N: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/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
index 5b71c7d3e768..05848422f885 100755
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart/ChartLegendPosition.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
@@ -139,13 +139,13 @@ void WrappedLegendAlignmentProperty::setPropertyValue( const Any& rOuterValue, c
chart2::LegendPosition eNewInnerPos(chart2::LegendPosition_LINE_END);
if( aInnerValue >>= eNewInnerPos )
{
- chart2::LegendExpansion eNewExpansion =
+ ::com::sun::star::chart::ChartLegendExpansion eNewExpansion =
( eNewInnerPos == chart2::LegendPosition_LINE_END ||
eNewInnerPos == chart2::LegendPosition_LINE_START )
- ? chart2::LegendExpansion_HIGH
- : chart2::LegendExpansion_WIDE;
+ ? ::com::sun::star::chart::ChartLegendExpansion_HIGH
+ : ::com::sun::star::chart::ChartLegendExpansion_WIDE;
- chart2::LegendExpansion eOldExpansion( chart2::LegendExpansion_HIGH );
+ ::com::sun::star::chart::ChartLegendExpansion eOldExpansion( ::com::sun::star::chart::ChartLegendExpansion_HIGH );
bool bExpansionWasSet(
xInnerPropertySet->getPropertyValue( C2U( "Expansion" ) ) >>= eOldExpansion );
@@ -232,7 +232,8 @@ static const ::rtl::OUString lcl_aServiceName(
enum
{
- PROP_LEGEND_ALIGNMENT
+ PROP_LEGEND_ALIGNMENT,
+ PROP_LEGEND_EXPANSION
};
void lcl_AddPropertiesToVector(
@@ -244,6 +245,13 @@ void lcl_AddPropertiesToVector(
::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartLegendPosition * >(0)),
//#i111967# no PropertyChangeEvent is fired on change so far
beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( C2U( "Expansion" ),
+ PROP_LEGEND_EXPANSION,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartLegendExpansion * >(0)),
+ //#i111967# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEDEFAULT ));
}
struct StaticLegendWrapperPropertyArray_Initializer
@@ -429,6 +437,7 @@ const std::vector< WrappedProperty* > LegendWrapper::createWrappedProperties()
::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
aWrappedProperties.push_back( new WrappedLegendAlignmentProperty() );
+ aWrappedProperties.push_back( new WrappedProperty( C2U("Expansion"), C2U("Expansion") ));
WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
//same problem as for wall: thje defaults ion the old chart are different for different charttypes, so we need to export explicitly
aWrappedProperties.push_back( new WrappedDirectStateProperty( C2U("FillStyle"), C2U("FillStyle") ) );
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 5e8bd7336b86..4f52f7f23220 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -1173,6 +1173,8 @@ void CombiColumnLineChartDialogController::showExtraControls( Window* pParent, c
m_pFT_NumberOfLines->Show();
m_pMF_NumberOfLines->Show();
+ m_pMF_NumberOfLines->SetAccessibleName(m_pFT_NumberOfLines->GetText());
+ m_pMF_NumberOfLines->SetAccessibleRelationLabeledBy(m_pFT_NumberOfLines);
}
void CombiColumnLineChartDialogController::hideExtraControls() const
{
diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src
index 1c0a066df046..bb2538a97cad 100644
--- a/chart2/source/controller/dialogs/Strings.src
+++ b/chart2/source/controller/dialogs/Strings.src
@@ -101,6 +101,15 @@ String STR_PAGE_POSITION
Text [ en-US ] = "Position" ;
};
+String STR_BUTTON_UP
+{
+ Text [ en-US ] = "Up";
+};
+String STR_BUTTON_DOWN
+{
+ Text [ en-US ] = "Down";
+};
+
String STR_PAGE_LAYOUT
{
Text [ en-US ] = "Layout";
diff --git a/chart2/source/controller/dialogs/Strings_Statistic.src b/chart2/source/controller/dialogs/Strings_Statistic.src
index f2dc4235f783..10c59a4c9b1d 100644
--- a/chart2/source/controller/dialogs/Strings_Statistic.src
+++ b/chart2/source/controller/dialogs/Strings_Statistic.src
@@ -51,22 +51,22 @@ String STR_CONTROLTEXT_ERROR_BARS_FROM_DATA
String STR_REGRESSION_LINEAR
{
- Text [ en-US ] = "Linear Regression" ;
+ Text [ en-US ] = "Linear (%SERIESNAME)" ;
};
String STR_REGRESSION_LOG
{
- Text [ en-US ] = "Logarithmic Regression" ;
+ Text [ en-US ] = "Logarithmic (%SERIESNAME)" ;
};
String STR_REGRESSION_EXP
{
- Text [ en-US ] = "Exponential Regression" ;
+ Text [ en-US ] = "Exponential (%SERIESNAME)" ;
};
String STR_REGRESSION_POWER
{
- Text [ en-US ] = "Power Regression" ;
+ Text [ en-US ] = "Power (%SERIESNAME)" ;
};
-String STR_STATISTICS_IN_LEGEND
+String STR_REGRESSION_MEAN
{
- Text [ en-US ] = "%REGRESSIONCURVE for %SERIESNAME" ;
+ Text [ en-US ] = "Mean (%SERIESNAME)" ;
};
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx
index ee2278589b89..59beaf35a152 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.cxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx
@@ -48,6 +48,8 @@ BarGeometryResources::BarGeometryResources( Window* pWindow )
{
m_aFT_Geometry.SetText( String( SchResId( STR_BAR_GEOMETRY )) );
m_aFT_Geometry.SetSizePixel( m_aFT_Geometry.CalcMinimumSize() );
+ m_aLB_Geometry.SetAccessibleName(m_aFT_Geometry.GetText());
+ m_aLB_Geometry.SetAccessibleRelationLabeledBy(&m_aFT_Geometry);
}
void BarGeometryResources::SetPosPixel( const Point& rPosition )
{
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index 0bbfcb7eee68..4093cf34894f 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -41,13 +41,12 @@
#include <svtools/controldims.hrc>
#endif
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
//itemset stuff
#include "chartview/ChartSfxItemIds.hxx"
-#include <svx/chrtitem.hxx>
-// header for class SfxItemPool
-#include <svl/itempool.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
//.............................................................................
namespace chart
@@ -61,8 +60,8 @@ LegendPositionResources::LegendPositionResources( Window* pWindow )
: m_xCC() //unused in this scenario
, m_aCbxShow( pWindow ) //unused in this scenario
, m_aRbtLeft( pWindow, SchResId(RBT_LEFT) )
- , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtRight( pWindow, SchResId(RBT_RIGHT) )
+ , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtBottom( pWindow, SchResId(RBT_BOTTOM) )
{
m_aCbxShow.Check();//legend is assumed to be visible in this scenario
@@ -73,12 +72,17 @@ LegendPositionResources::LegendPositionResources( Window* pWindow, const uno::Re
: m_xCC( xCC )
, m_aCbxShow( pWindow, SchResId(CBX_SHOWLEGEND) )
, m_aRbtLeft( pWindow, SchResId(RBT_LEFT) )
- , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtRight( pWindow, SchResId(RBT_RIGHT) )
+ , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtBottom( pWindow, SchResId(RBT_BOTTOM) )
{
m_aCbxShow.SetToggleHdl( LINK( this, LegendPositionResources, PositionEnableHdl ) );
impl_setRadioButtonToggleHdl();
+ m_aCbxShow.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtLeft.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtRight.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtTop.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtBottom.SetAccessibleRelationMemberOf(&m_aCbxShow);
}
void LegendPositionResources::impl_setRadioButtonToggleHdl()
@@ -151,7 +155,7 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen
//position
chart2::LegendPosition eNewPos;
- chart2::LegendExpansion eExp = chart2::LegendExpansion_HIGH;
+ ::com::sun::star::chart::ChartLegendExpansion eExp = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
if( m_aRbtLeft.IsChecked() )
eNewPos = chart2::LegendPosition_LINE_START;
@@ -162,12 +166,12 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen
else if( m_aRbtTop.IsChecked() )
{
eNewPos = chart2::LegendPosition_PAGE_START;
- eExp = chart2::LegendExpansion_WIDE;
+ eExp = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
}
else if( m_aRbtBottom.IsChecked() )
{
eNewPos = chart2::LegendPosition_PAGE_END;
- eExp = chart2::LegendExpansion_WIDE;
+ eExp = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
}
xProp->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( eNewPos ));
@@ -197,51 +201,50 @@ IMPL_LINK( LegendPositionResources, PositionEnableHdl, void*, EMPTYARG )
void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
{
- SvxChartLegendPos ePos = CHLEGEND_NONE;
-
const SfxPoolItem* pPoolItem = NULL;
- if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS,
- sal_True, &pPoolItem ) != SFX_ITEM_SET )
- pPoolItem = &(rInAttrs.GetPool()->GetDefaultItem( SCHATTR_LEGEND_POS ));
-
- if( pPoolItem )
- ePos = ((const SvxChartLegendPosItem*)pPoolItem)->GetValue();
+ if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET )
+ {
+ sal_Int32 nLegendPosition = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ switch( nLegendPosition )
+ {
+ case chart2::LegendPosition_LINE_START:
+ m_aRbtLeft.Check(sal_True);
+ break;
+ case chart2::LegendPosition_PAGE_START:
+ m_aRbtTop.Check(sal_True);
+ break;
+ case chart2::LegendPosition_LINE_END:
+ m_aRbtRight.Check(sal_True);
+ break;
+ case chart2::LegendPosition_PAGE_END:
+ m_aRbtBottom.Check(sal_True);
+ break;
+ default:
+ break;
+ }
+ }
- switch( ePos )
+ if( rInAttrs.GetItemState( SCHATTR_LEGEND_SHOW, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
- case CHLEGEND_LEFT:
- m_aRbtLeft.Check(sal_True);
- break;
- case CHLEGEND_TOP:
- m_aRbtTop.Check(sal_True);
- break;
- case CHLEGEND_RIGHT:
- m_aRbtRight.Check(sal_True);
- break;
- case CHLEGEND_BOTTOM:
- m_aRbtBottom.Check(sal_True);
- break;
- default:
- break;
+ bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ m_aCbxShow.Check(bShow);
}
}
void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const
{
- SvxChartLegendPos ePos;
-
+ sal_Int32 nLegendPosition = chart2::LegendPosition_CUSTOM;
if( m_aRbtLeft.IsChecked() )
- ePos = CHLEGEND_LEFT;
+ nLegendPosition = chart2::LegendPosition_LINE_START;
else if( m_aRbtTop.IsChecked() )
- ePos = CHLEGEND_TOP;
+ nLegendPosition = chart2::LegendPosition_PAGE_START;
else if( m_aRbtRight.IsChecked() )
- ePos = CHLEGEND_RIGHT;
+ nLegendPosition = chart2::LegendPosition_LINE_END;
else if( m_aRbtBottom.IsChecked() )
- ePos = CHLEGEND_BOTTOM;
- else
- ePos = CHLEGEND_NONE;
+ nLegendPosition = chart2::LegendPosition_PAGE_END;
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_LEGEND_POS, nLegendPosition ));
- rOutAttrs.Put(SvxChartLegendPosItem( ePos, SCHATTR_LEGEND_POS ));
+ rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_aCbxShow.IsChecked()) );
}
IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio )
@@ -259,6 +262,14 @@ void LegendPositionResources::SetChangeHdl( const Link& rLink )
m_aChangeLink = rLink;
}
+void LegendPositionResources::SetAccessibleRelationMemberOf(Window* pMemberOf)
+{
+ m_aRbtLeft.SetAccessibleRelationMemberOf(pMemberOf);
+ m_aRbtRight.SetAccessibleRelationMemberOf(pMemberOf);
+ m_aRbtTop.SetAccessibleRelationMemberOf(pMemberOf);
+ m_aRbtBottom.SetAccessibleRelationMemberOf(pMemberOf);
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.hxx b/chart2/source/controller/dialogs/res_LegendPosition.hxx
index ee0ac5a7601c..a4809df97239 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.hxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.hxx
@@ -44,6 +44,7 @@ namespace chart
class LegendPositionResources
{
+
public:
//constructor without Display checkbox
LegendPositionResources( Window* pParent );
@@ -66,6 +67,8 @@ public:
DECL_LINK( PositionEnableHdl, void* );
DECL_LINK( PositionChangeHdl, RadioButton* );
+ void SetAccessibleRelationMemberOf(Window* pMemberOf); //IAccessibility2 Implementation 2009-----
+
private:
void impl_setRadioButtonToggleHdl();
@@ -76,8 +79,8 @@ private:
CheckBox m_aCbxShow;
RadioButton m_aRbtLeft;
- RadioButton m_aRbtTop;
RadioButton m_aRbtRight;
+ RadioButton m_aRbtTop;
RadioButton m_aRbtBottom;
Link m_aChangeLink;
diff --git a/chart2/source/controller/dialogs/res_TextSeparator.cxx b/chart2/source/controller/dialogs/res_TextSeparator.cxx
index 8878f5f77ffc..9cca483b711d 100644
--- a/chart2/source/controller/dialogs/res_TextSeparator.cxx
+++ b/chart2/source/controller/dialogs/res_TextSeparator.cxx
@@ -59,6 +59,9 @@ TextSeparatorResources::TextSeparatorResources( Window* pWindow )
m_aEntryMap[ C2U( ", " ) ] = 1;
m_aEntryMap[ C2U( "; " ) ] = 2;
m_aEntryMap[ C2U( "\n" ) ] = 3;
+
+ m_aLB_Separator.SetAccessibleName(m_aFT_Separator.GetText());
+ m_aLB_Separator.SetAccessibleRelationLabeledBy(&m_aFT_Separator);
}
TextSeparatorResources::~TextSeparatorResources()
{
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
index 8e32a4f6a262..be6500b54e93 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
@@ -110,9 +110,9 @@ ThreeD_SceneAppearance_TabPage::ThreeD_SceneAppearance_TabPage(
, m_aFT_Scheme ( this, SchResId( FT_SCHEME ) )
, m_aLB_Scheme ( this, SchResId( LB_SCHEME ) )
, m_aFL_Seperator ( this, SchResId( FL_SEPERATOR ) )
- , m_aCB_RoundedEdge ( this, SchResId( CB_ROUNDEDEDGE ) )
, m_aCB_Shading ( this, SchResId( CB_SHADING ) )
, m_aCB_ObjectLines ( this, SchResId( CB_OBJECTLINES ) )
+ , m_aCB_RoundedEdge ( this, SchResId( CB_ROUNDEDEDGE ) )
, m_bUpdateOtherControls( true )
, m_bCommitToModel( true )
, m_rControllerLockHelper( rControllerLockHelper )
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
index 252c5c21669b..0e119d959c66 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
@@ -82,9 +82,9 @@ private:
FixedLine m_aFL_Seperator;
- CheckBox m_aCB_RoundedEdge;
CheckBox m_aCB_Shading;
CheckBox m_aCB_ObjectLines;
+ CheckBox m_aCB_RoundedEdge;
bool m_bUpdateOtherControls;
bool m_bCommitToModel;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
index ff1e784b5ff9..0d3914460e78 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
@@ -162,6 +162,8 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( Window* pWindow
{
m_aCbxRightAngledAxes.Enable(false);
}
+ m_aMFPerspective.SetAccessibleName(m_aCbxPerspective.GetText());
+ m_aMFPerspective.SetAccessibleRelationLabeledBy(&m_aCbxPerspective);
}
ThreeD_SceneGeometry_TabPage::~ThreeD_SceneGeometry_TabPage()
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 2310e193e5ba..1c75fcab7a0f 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -357,6 +357,15 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin
//m_aDelyedModelChangeTimer.SetTimeout( 4*EDIT_UPDATEDATA_TIMEOUT );
m_aModelChangeListener.startListening( uno::Reference< util::XModifyBroadcaster >(m_xSceneProperties, uno::UNO_QUERY) );
+ m_aBtn_Light1.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light2.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light3.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light4.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light5.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light6.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light7.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light8.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aCtl_Preview.SetAccessibleName(String(SchResId( STR_LIGHT_PREVIEW )));
}
ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage()
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc
index e2d031955867..f5ae0dcda267 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc
@@ -42,5 +42,7 @@
#define BTN_LIGHT_6 8
#define BTN_LIGHT_7 9
#define BTN_LIGHT_8 10
-
+//IAccessibility2 Implementation 2009-----
+#define STR_LIGHT_PREVIEW 6000
+//-----IAccessibility2 Implementation 2009
#define CTL_LIGHT_PREVIEW 1
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src
index 0b052f4d00c6..cf5898af8c85 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src
@@ -173,3 +173,8 @@ TabPage TP_3D_SCENEILLUMINATION
};
};
+String STR_LIGHT_PREVIEW
+{
+ Text [ en-US ] = "Light Preview" ;
+};
+
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index 3538277c2004..508bec302bf2 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -222,6 +222,10 @@ AxisPositionsTabPage::AxisPositionsTabPage(Window* pWindow,const SfxItemSet& rIn
m_aLB_PlaceLabels.SetSelectHdl( LINK( this, AxisPositionsTabPage, PlaceLabelsSelectHdl ) );
m_aLB_PlaceLabels.SetDropDownLineCount( m_aLB_PlaceLabels.GetEntryCount() );
m_aLB_PlaceTicks.SetDropDownLineCount( m_aLB_PlaceTicks.GetEntryCount() );
+ m_aCB_TicksInner.SetAccessibleRelationLabeledBy(&m_aFT_Major);
+ m_aCB_TicksOuter.SetAccessibleRelationLabeledBy(&m_aFT_Major);
+ m_aCB_MinorInner.SetAccessibleRelationLabeledBy(&m_aFT_Minor);
+ m_aCB_MinorOuter.SetAccessibleRelationLabeledBy(&m_aFT_Minor);
}
SfxTabPage* AxisPositionsTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 0504ecee4161..7919820b2100 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -189,6 +189,8 @@ Dim3DLookResourceGroup::Dim3DLookResourceGroup( Window* pWindow )
m_aLB_Scheme.SetDropDownLineCount(2);
m_aLB_Scheme.SetSelectHdl( LINK( this, Dim3DLookResourceGroup, SelectSchemeHdl ) );
+ m_aLB_Scheme.SetAccessibleName(m_aCB_3DLook.GetText());
+ m_aLB_Scheme.SetAccessibleRelationLabeledBy(&m_aCB_3DLook);
}
Dim3DLookResourceGroup::~Dim3DLookResourceGroup()
{
@@ -344,6 +346,9 @@ StackingResourceGroup::StackingResourceGroup( Window* pWindow )
m_aRB_Stack_Y.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
m_aRB_Stack_Y_Percent.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
m_aRB_Stack_Z.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
+ m_aRB_Stack_Y.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
+ m_aRB_Stack_Y_Percent.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
+ m_aRB_Stack_Z.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
}
StackingResourceGroup::~StackingResourceGroup()
{
@@ -472,9 +477,9 @@ private:
MetricField m_aMF_SplineOrder;
FixedLine m_aFL_DialogButtons;
+ HelpButton m_aBP_Help;
OKButton m_aBP_OK;
CancelButton m_aBP_Cancel;
- HelpButton m_aBP_Help;
};
SplinePropertiesDialog::SplinePropertiesDialog( Window* pParent )
@@ -487,9 +492,9 @@ SplinePropertiesDialog::SplinePropertiesDialog( Window* pParent )
, m_aFT_SplineOrder( this, SchResId( FT_SPLINE_ORDER ) )
, m_aMF_SplineOrder( this, SchResId( MF_SPLINE_ORDER ) )
, m_aFL_DialogButtons( this, SchResId( FL_SPLINE_DIALOGBUTTONS ) )
+ , m_aBP_Help( this, SchResId(BTN_HELP) )
, m_aBP_OK( this, SchResId(BTN_OK) )
- , m_aBP_Cancel( this, SchResId(BTN_CANCEL) )
- , m_aBP_Help( this, SchResId(BTN_HELP) )
+ , m_aBP_Cancel( this, SchResId(BTN_CANCEL) )
{
FreeResource();
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index ed48747e5502..2eaf97767fa5 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -359,6 +359,8 @@ DataSourceTabPage::DataSourceTabPage(
if( m_apLB_SERIES->First())
m_apLB_SERIES->Select( m_apLB_SERIES->First());
m_apLB_SERIES->GrabFocus();
+ m_aBTN_UP.SetAccessibleName(String(SchResId(STR_BUTTON_UP)));
+ m_aBTN_DOWN.SetAccessibleName(String(SchResId(STR_BUTTON_DOWN)));
}
DataSourceTabPage::~DataSourceTabPage()
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index e08bd83f869d..049b78d9b6f5 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -51,6 +51,7 @@ SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow,
, m_aFtTextDirection( this, SchResId( FT_LEGEND_TEXTDIR ) )
, m_aLbTextDirection( this, SchResId( LB_LEGEND_TEXTDIR ), &m_aFlTextOrient, &m_aFtTextDirection )
{
+ m_apLegendPositionResources->SetAccessibleRelationMemberOf(&aGrpLegend);
FreeResource();
}
diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
index ae812d72d723..6fdf16bb73af 100644
--- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
@@ -33,10 +33,12 @@
#include "ItemPropertyMap.hxx"
#include "GraphicPropertyItemConverter.hxx"
#include "CharacterPropertyItemConverter.hxx"
-#include <svx/chrtitem.hxx>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
+
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
#include <functional>
#include <algorithm>
@@ -104,52 +106,19 @@ bool LegendItemConverter::GetItemProperty( tWhichIdType /*nWhichId*/, tPropertyN
}
-bool LegendItemConverter::ApplySpecialItem(
- sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
+bool LegendItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet& rInItemSet )
throw( uno::Exception )
{
bool bChanged = false;
switch( nWhichId )
{
- case SCHATTR_LEGEND_POS:
+ case SCHATTR_LEGEND_SHOW:
{
- chart2::LegendPosition eNewPos = chart2::LegendPosition_LINE_END;
- chart2::LegendPosition eOldPos;
- bool bIsWide = false;
- sal_Bool bShow = sal_True;
-
- SvxChartLegendPos eItemPos =
- static_cast< const SvxChartLegendPosItem & >(
- rItemSet.Get( nWhichId )).GetValue();
- switch( eItemPos )
- {
- case CHLEGEND_LEFT:
- eNewPos = chart2::LegendPosition_LINE_START;
- break;
- case CHLEGEND_RIGHT:
- eNewPos = chart2::LegendPosition_LINE_END;
- break;
- case CHLEGEND_TOP:
- eNewPos = chart2::LegendPosition_PAGE_START;
- bIsWide = true;
- break;
- case CHLEGEND_BOTTOM:
- eNewPos = chart2::LegendPosition_PAGE_END;
- bIsWide = true;
- break;
-
- case CHLEGEND_NONE:
- case CHLEGEND_NONE_LEFT:
- case CHLEGEND_NONE_RIGHT:
- case CHLEGEND_NONE_TOP:
- case CHLEGEND_NONE_BOTTOM:
- bShow = sal_False;
- break;
- }
-
- try
+ const SfxPoolItem* pPoolItem = NULL;
+ if( rInItemSet.GetItemState( SCHATTR_LEGEND_SHOW, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
+ sal_Bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
sal_Bool bWasShown = sal_True;
if( ! (GetPropertySet()->getPropertyValue( C2U("Show")) >>= bWasShown) ||
( bWasShown != bShow ))
@@ -157,25 +126,48 @@ bool LegendItemConverter::ApplySpecialItem(
GetPropertySet()->setPropertyValue( C2U("Show"), uno::makeAny( bShow ));
bChanged = true;
}
+ }
+
+ }
+ break;
+ case SCHATTR_LEGEND_POS:
+ {
+ const SfxPoolItem* pPoolItem = NULL;
+ if( rInItemSet.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET )
+ {
+ chart2::LegendPosition eNewPos = static_cast<chart2::LegendPosition>(((const SfxInt32Item*)pPoolItem)->GetValue());
- if( bShow )
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
+ switch( eNewPos )
{
+ case chart2::LegendPosition_LINE_START:
+ case chart2::LegendPosition_LINE_END:
+ eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
+ break;
+ case chart2::LegendPosition_PAGE_START:
+ case chart2::LegendPosition_PAGE_END:
+ eExpansion = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
+ break;
+ default:
+ break;
+ }
+
+ try
+ {
+ chart2::LegendPosition eOldPos;
if( ! ( GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= eOldPos ) ||
( eOldPos != eNewPos ))
{
GetPropertySet()->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( eNewPos ));
- chart2::LegendExpansion eExp = bIsWide
- ? chart2::LegendExpansion_WIDE
- : chart2::LegendExpansion_HIGH;
- GetPropertySet()->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExp ));
+ GetPropertySet()->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExpansion ));
GetPropertySet()->setPropertyValue( C2U( "RelativePosition" ), uno::Any());
bChanged = true;
}
}
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
}
}
break;
@@ -190,43 +182,18 @@ void LegendItemConverter::FillSpecialItem(
{
switch( nWhichId )
{
- case SCHATTR_LEGEND_POS:
+ case SCHATTR_LEGEND_SHOW:
{
- SvxChartLegendPos eItemPos( CHLEGEND_RIGHT );
- chart2::LegendPosition ePos;
-
sal_Bool bShow = sal_True;
GetPropertySet()->getPropertyValue( C2U( "Show" )) >>= bShow;
-
- if( ! bShow )
- {
- eItemPos = CHLEGEND_NONE;
- }
- else if( GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos )
- {
- switch( ePos )
- {
- case chart2::LegendPosition_LINE_START:
- eItemPos = CHLEGEND_LEFT;
- break;
- case chart2::LegendPosition_LINE_END:
- eItemPos = CHLEGEND_RIGHT;
- break;
- case chart2::LegendPosition_PAGE_START:
- eItemPos = CHLEGEND_TOP;
- break;
- case chart2::LegendPosition_PAGE_END:
- eItemPos = CHLEGEND_BOTTOM;
- break;
-
- case chart2::LegendPosition_CUSTOM:
- default:
- eItemPos = CHLEGEND_RIGHT;
- break;
- }
- }
-
- rOutItemSet.Put( SvxChartLegendPosItem( eItemPos, SCHATTR_LEGEND_POS ) );
+ rOutItemSet.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, bShow) );
+ }
+ break;
+ case SCHATTR_LEGEND_POS:
+ {
+ chart2::LegendPosition eLegendPos( chart2::LegendPosition_LINE_END );
+ GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= eLegendPos;
+ rOutItemSet.Put( SfxInt32Item(SCHATTR_LEGEND_POS, eLegendPos ) );
}
break;
}
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 0f2a722c2872..37cbdbb30f6b 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -37,6 +37,7 @@
#include "UndoGuard.hxx"
#include "Strings.hrc"
#include "ObjectNameProvider.hxx"
+#include "DiagramHelper.hxx"
#include "chartview/ExplicitValueProvider.hxx"
#include "CommonConverters.hxx"
#include <svx/ActionDescriptionProvider.hxx>
@@ -135,10 +136,12 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
if( pProvider )
aSelectedSize = ToSize( ( pProvider->getRectangleOfObject( aCID ) ) );
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID );
+
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::POS_SIZE,
- ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aCID ))),
+ ObjectNameProvider::getName( eObjectType)),
m_xUndoManager );
SfxAbstractTabDialog * pDlg = NULL;
@@ -169,11 +172,14 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
- bool bChanged = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
- , getModel()
+ bool bChanged = false;
+ if ( eObjectType == OBJECTTYPE_LEGEND )
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
+
+ bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getModel()
, awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
, awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
- if( bChanged )
+ if( bMoved || bChanged )
aUndoGuard.commit();
}
}
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 945ccf4b4b34..0282abcefdf7 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -251,7 +251,11 @@ void ChartController::executeDispatch_NewArrangement()
// legend
Reference< beans::XPropertyState > xLegendState( xDiagram->getLegend(), uno::UNO_QUERY );
if( xLegendState.is())
+ {
xLegendState->setPropertyToDefault( C2U("RelativePosition"));
+ xLegendState->setPropertyToDefault( C2U("RelativeSize"));
+ xLegendState->setPropertyToDefault( C2U("AnchorPosition"));
+ }
// titles
for( sal_Int32 eType = TitleHelper::TITLE_BEGIN;
@@ -696,6 +700,11 @@ bool ChartController::executeDispatch_Delete()
bReturn = lcl_deleteDataSeries( aCID, getModel(), m_xUndoManager );
else if( eParentObjectType == OBJECTTYPE_DATA_CURVE )
bReturn = lcl_deleteDataCurve( aCID, getModel(), m_xUndoManager );
+ else if( eParentObjectType == OBJECTTYPE_DATA_AVERAGE_LINE )
+ {
+ executeDispatch_DeleteMeanValue();
+ bReturn = true;
+ }
break;
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index bc06886f14a3..1692c5761ae9 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -871,16 +871,22 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if( !bIsMoveOnly && m_aSelection.isResizeableObjectSelected() )
eActionType = ActionDescriptionProvider::RESIZE;
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
+
UndoGuard aUndoGuard(
- ActionDescriptionProvider::createDescription(
- eActionType,
- ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() ))),
+ ActionDescriptionProvider::createDescription( eActionType, ObjectNameProvider::getName( eObjectType)),
m_xUndoManager );
- bool bChanged = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
+
+ bool bChanged = false;
+ if ( eObjectType == OBJECTTYPE_LEGEND )
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
+
+ bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
, getModel()
, awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
, awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
- if( bChanged )
+
+ if( bMoved || bChanged )
{
bDraggingDone = true;
aUndoGuard.commit();
diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx
index f0ce3eaaa04e..bdee4a14f66b 100644
--- a/chart2/source/controller/main/PositionAndSizeHelper.cxx
+++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx
@@ -33,6 +33,7 @@
#include "ChartModelHelper.hxx"
#include "ControllerLockGuard.hxx"
#include <com/sun/star/chart2/LegendPosition.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include "chartview/ExplicitValueProvider.hxx"
@@ -83,51 +84,12 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
}
else if(OBJECTTYPE_LEGEND==eObjectType)
{
- LegendPosition ePos = LegendPosition_LINE_END;
- xObjectProp->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos;
+ xObjectProp->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny(LegendPosition(LegendPosition_CUSTOM)));
+ xObjectProp->setPropertyValue( C2U( "Expansion" ), uno::makeAny(::com::sun::star::chart::ChartLegendExpansion_CUSTOM));
chart2::RelativePosition aRelativePosition;
+ chart2::RelativeSize aRelativeSize;
Point aAnchor = aObjectRect.TopLeft();
- switch( ePos )
- {
- case LegendPosition_LINE_START:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_LEFT;
- aAnchor = aObjectRect.LeftCenter();
- }
- break;
- case LegendPosition_LINE_END:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_RIGHT;
- aAnchor = aObjectRect.RightCenter();
- }
- break;
- case LegendPosition_PAGE_START:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_TOP;
- aAnchor = aObjectRect.TopCenter();
- }
- break;
- case LegendPosition_PAGE_END:
- //@todo language dependent positions ...
- {
- aRelativePosition.Anchor = drawing::Alignment_BOTTOM;
- aAnchor = aObjectRect.BottomCenter();
- }
- break;
- case LegendPosition_CUSTOM:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
- }
- break;
- case LegendPosition_MAKE_FIXED_SIZE:
- OSL_ASSERT( false );
- break;
- }
aRelativePosition.Primary =
static_cast< double >( aAnchor.X()) /
static_cast< double >( aPageRect.getWidth() );
@@ -136,6 +98,19 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
static_cast< double >( aPageRect.getHeight());
xObjectProp->setPropertyValue( C2U( "RelativePosition" ), uno::makeAny(aRelativePosition) );
+
+ aRelativeSize.Primary =
+ static_cast< double >( aObjectRect.getWidth()) /
+ static_cast< double >( aPageRect.getWidth() );
+ if (aRelativeSize.Primary > 1.0)
+ aRelativeSize.Primary = 1.0;
+ aRelativeSize.Secondary =
+ static_cast< double >( aObjectRect.getHeight()) /
+ static_cast< double >( aPageRect.getHeight());
+ if (aRelativeSize.Secondary > 1.0)
+ aRelativeSize.Secondary = 1.0;
+
+ xObjectProp->setPropertyValue( C2U( "RelativeSize" ), uno::makeAny(aRelativeSize) );
}
else if(OBJECTTYPE_DIAGRAM==eObjectType || OBJECTTYPE_DIAGRAM_WALL==eObjectType || OBJECTTYPE_DIAGRAM_FLOOR==eObjectType)
{
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx
index cd51adc7842e..d5dadcf1d800 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -276,10 +276,11 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
}
//check wether the diagram was hit but not selected (e.g. because it has no filling):
+ rtl::OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, rtl::OUString::valueOf( sal_Int32(0) ) );
rtl::OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() ) );//@todo read CID from model
- if ( m_aSelectedOID.getObjectCID().equals( aPageCID ) || m_aSelectedOID.getObjectCID().equals( aWallCID ) || !m_aSelectedOID.isAutoGeneratedObject() )
+ bool bBackGroundHit = m_aSelectedOID.getObjectCID().equals( aPageCID ) || m_aSelectedOID.getObjectCID().equals( aWallCID ) || !m_aSelectedOID.isAutoGeneratedObject();
+ if( bBackGroundHit )
{
- rtl::OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, rtl::OUString::valueOf( sal_Int32(0) ) );
//todo: if more than one diagram is available in future do chack the list of all diagrams here
SdrObject* pDiagram = pDrawViewWrapper->getNamedSdrObject( aDiagramCID );
if( pDiagram )
@@ -291,6 +292,20 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
}
}
}
+ //check wether the legend was hit but not selected (e.g. because it has no filling):
+ if( bBackGroundHit || m_aSelectedOID.getObjectCID().equals( aDiagramCID ) )
+ {
+ rtl::OUString aLegendCID( ObjectIdentifier::createClassifiedIdentifierForParticle( ObjectIdentifier::createParticleForLegend(0,0) ) );//@todo read CID from model
+ SdrObject* pLegend = pDrawViewWrapper->getNamedSdrObject( aLegendCID );
+ if( pLegend )
+ {
+ if( pDrawViewWrapper->IsObjectHit( pLegend, rMousePos ) )
+ {
+ m_aSelectedOID = ObjectIdentifier( aLegendCID );
+ pNewObj = pLegend;
+ }
+ }
+ }
}
}
@@ -309,6 +324,7 @@ bool Selection::isResizeableObjectSelected()
case OBJECTTYPE_DIAGRAM:
case OBJECTTYPE_DIAGRAM_WALL:
case OBJECTTYPE_SHAPE:
+ case OBJECTTYPE_LEGEND:
return true;
default:
return false;
diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc
index d7c490c1ca87..c5b03392cd8d 100644
--- a/chart2/source/inc/Strings.hrc
+++ b/chart2/source/inc/Strings.hrc
@@ -156,6 +156,7 @@
#define STR_REGRESSION_LOG (RID_APP_START + 136)
#define STR_REGRESSION_EXP (RID_APP_START + 137)
#define STR_REGRESSION_POWER (RID_APP_START + 138)
+#define STR_REGRESSION_MEAN (RID_APP_START + 180)
//-----------------------------------------------------------------------------
//for scale tab page
@@ -264,8 +265,6 @@
#define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS (RID_APP_START + 265)
#define STR_OBJECT_CURVE_EQUATION (RID_APP_START + 268)
-#define STR_STATISTICS_IN_LEGEND (RID_APP_START + 180)
-
#define STR_OBJECT_SHAPE (RID_APP_START + 290)
//-----------------------------------------------------------------------------
@@ -343,6 +342,10 @@
#define STR_TEXT_DIRECTION_RTL (RID_APP_START + 279)
#define STR_TEXT_DIRECTION_SUPER (RID_APP_START + 280)
+//IAccessibility2 Implementation 2009-----
+#define STR_BUTTON_UP (RID_APP_START + 500)
+#define STR_BUTTON_DOWN (RID_APP_START + 501)
+//-----IAccessibility2 Implementation 2009
//-----------------------------------------------------------------------------
/*
////#define STR_DIAGRAM_X_AXIS (RID_APP_START + 34)
diff --git a/chart2/source/inc/chartview/ChartSfxItemIds.hxx b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
index b6390ab12b22..e3846a1d0462 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -49,7 +49,8 @@
//legend
#define SCHATTR_LEGEND_START (SCHATTR_DATADESCR_END + 1)
#define SCHATTR_LEGEND_POS SCHATTR_LEGEND_START
-#define SCHATTR_LEGEND_END SCHATTR_LEGEND_POS
+#define SCHATTR_LEGEND_SHOW (SCHATTR_LEGEND_START + 1)
+#define SCHATTR_LEGEND_END SCHATTR_LEGEND_SHOW
//text
#define SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1)
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index e9f5f5324365..a7c2ab86f5c1 100755
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -40,8 +40,9 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
#include <algorithm>
@@ -63,10 +64,11 @@ static const OUString lcl_aServiceName(
enum
{
PROP_LEGEND_ANCHOR_POSITION,
- PROP_LEGEND_PREFERRED_EXPANSION,
+ PROP_LEGEND_EXPANSION,
PROP_LEGEND_SHOW,
PROP_LEGEND_REF_PAGE_SIZE,
- PROP_LEGEND_REL_POS
+ PROP_LEGEND_REL_POS,
+ PROP_LEGEND_REL_SIZE
};
void lcl_AddPropertiesToVector(
@@ -81,8 +83,8 @@ void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( C2U( "Expansion" ),
- PROP_LEGEND_PREFERRED_EXPANSION,
- ::getCppuType( reinterpret_cast< const chart2::LegendExpansion * >(0)),
+ PROP_LEGEND_EXPANSION,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartLegendExpansion * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
@@ -105,6 +107,14 @@ void lcl_AddPropertiesToVector(
::getCppuType( reinterpret_cast< const chart2::RelativePosition * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
+ Property( C2U( "RelativeSize" ),
+ PROP_LEGEND_REL_SIZE,
+ ::getCppuType( reinterpret_cast< const chart2::RelativeSize * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID ));
+
}
struct StaticLegendDefaults_Initializer
@@ -123,7 +133,7 @@ private:
::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_PREFERRED_EXPANSION, chart2::LegendExpansion_HIGH );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_EXPANSION, ::com::sun::star::chart::ChartLegendExpansion_HIGH );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
float fDefaultCharHeight = 10.0;
@@ -197,58 +207,10 @@ Legend::Legend( const Legend & rOther ) :
::property::OPropertySet( rOther, m_aMutex ),
m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
- CloneHelper::CloneRefVector< Reference< chart2::XLegendEntry > >( rOther.m_aLegendEntries, m_aLegendEntries );
- ModifyListenerHelper::addListenerToAllElements( m_aLegendEntries, m_xModifyEventForwarder );
}
Legend::~Legend()
{
- try
- {
- ModifyListenerHelper::removeListenerFromAllElements( m_aLegendEntries, m_xModifyEventForwarder );
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-}
-
-// ____ XLegend ____
-void SAL_CALL Legend::registerEntry( const Reference< chart2::XLegendEntry >& xEntry )
- throw (lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if( ::std::find( m_aLegendEntries.begin(),
- m_aLegendEntries.end(),
- xEntry ) != m_aLegendEntries.end())
- throw lang::IllegalArgumentException();
-
- m_aLegendEntries.push_back( xEntry );
- ModifyListenerHelper::addListener( xEntry, m_xModifyEventForwarder );
- fireModifyEvent();
-}
-
-void SAL_CALL Legend::revokeEntry( const Reference< chart2::XLegendEntry >& xEntry )
- throw (container::NoSuchElementException,
- uno::RuntimeException)
-{
- tLegendEntries::iterator aIt(
- ::std::find( m_aLegendEntries.begin(),
- m_aLegendEntries.end(),
- xEntry ));
-
- if( aIt == m_aLegendEntries.end())
- throw container::NoSuchElementException();
-
- m_aLegendEntries.erase( aIt );
- ModifyListenerHelper::removeListener( xEntry, m_xModifyEventForwarder );
- fireModifyEvent();
-}
-
-Sequence< Reference< chart2::XLegendEntry > > SAL_CALL Legend::getEntries()
- throw (uno::RuntimeException)
-{
- return ContainerHelper::ContainerToSequence( m_aLegendEntries );
}
// ____ XCloneable ____
diff --git a/chart2/source/model/main/Legend.hxx b/chart2/source/model/main/Legend.hxx
index 6b645828f4c1..56c41db2e38a 100644..100755
--- a/chart2/source/model/main/Legend.hxx
+++ b/chart2/source/model/main/Legend.hxx
@@ -97,20 +97,6 @@ protected:
// const ::com::sun::star::uno::Any& rValue )
// throw (::com::sun::star::lang::IllegalArgumentException);
- // ____ XLegend ____
- virtual void SAL_CALL registerEntry( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry >& xEntry )
- throw (::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokeEntry( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry >& xEntry )
- throw (::com::sun::star::container::NoSuchElementException,
- ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry > > SAL_CALL getEntries()
- throw (::com::sun::star::uno::RuntimeException);
-
// ____ XCloneable ____
virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
throw (::com::sun::star::uno::RuntimeException);
@@ -140,11 +126,6 @@ protected:
void fireModifyEvent();
private:
- typedef ::std::vector<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry > > tLegendEntries;
-
- tLegendEntries m_aLegendEntries;
::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
};
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
index e0e37e2c825a..bb7e4ab68d98 100755
--- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
@@ -36,8 +36,6 @@
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "DataSeriesHelper.hxx"
-#include <com/sun/star/chart2/SymbolStyle.hpp>
-#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include "PropertyHelper.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index b265561eca90..3f82f5b7bf68 100755
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -39,7 +39,6 @@
#include "ContainerHelper.hxx"
#include "AxisIndexDefines.hxx"
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/SymbolStyle.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
diff --git a/chart2/source/tools/LegendHelper.cxx b/chart2/source/tools/LegendHelper.cxx
index af170e971a5b..aceb033b7919 100755
--- a/chart2/source/tools/LegendHelper.cxx
+++ b/chart2/source/tools/LegendHelper.cxx
@@ -29,7 +29,7 @@
#include "precompiled_chart2.hxx"
#include "LegendHelper.hxx"
#include "macros.hxx"
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -62,11 +62,11 @@ Reference< chart2::XLegend > LegendHelper::showLegend( const Reference< frame::X
if( !(xProp->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos ) )
xProp->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( ePos ));
- chart2::LegendExpansion eExpansion =
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion =
( ePos == chart2::LegendPosition_LINE_END ||
ePos == chart2::LegendPosition_LINE_START )
- ? chart2::LegendExpansion_HIGH
- : chart2::LegendExpansion_WIDE;
+ ? ::com::sun::star::chart::ChartLegendExpansion_HIGH
+ : ::com::sun::star::chart::ChartLegendExpansion_WIDE;
if( !(xProp->getPropertyValue( C2U( "Expansion" )) >>= eExpansion ) )
xProp->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExpansion ));
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index df9c4bdadd65..0d5ceb36199a 100755
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -608,9 +608,7 @@ OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XR
if( aServiceName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.MeanValueRegressionCurve" )))
{
- OSL_ENSURE( false, "Meanvalue lines in legend not supported" );
- aResult = OUString();
- // aResult = ::chart::SchResId::getResString( STR_OBJECT_AVERAGE_LINE );
+ aResult = ::chart::SchResId::getResString( STR_REGRESSION_MEAN );
}
else if( aServiceName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.LinearRegressionCurve" )))
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 06e09d60fcf1..41bec1f9c331 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -48,9 +48,11 @@
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
+
#include <tools/debug.hxx>
#include <editeng/unoprnms.hxx>
#include <rtl/math.hxx>
+
#include <com/sun/star/drawing/DoubleSequence.hpp>
#include <com/sun/star/drawing/NormalsKind.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
@@ -152,8 +154,8 @@ bool AreaChart::isSeperateStackingForDifferentSigns( sal_Int32 /*nDimensionIndex
LegendSymbolStyle AreaChart::getLegendSymbolStyle()
{
if( m_bArea || m_nDimension == 3 )
- return chart2::LegendSymbolStyle_BOX;
- return chart2::LegendSymbolStyle_LINE_WITH_SYMBOL;
+ return LegendSymbolStyle_BOX;
+ return LegendSymbolStyle_LINE;
}
uno::Any AreaChart::getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex )
diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx
index 4b6ff3f45251..972d97fa75ac 100644
--- a/chart2/source/view/charttypes/AreaChart.hxx
+++ b/chart2/source/view/charttypes/AreaChart.hxx
@@ -71,7 +71,7 @@ public:
//-------------------------------------------------------------------------
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+ virtual LegendSymbolStyle getLegendSymbolStyle();
virtual ::com::sun::star::uno::Any getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex=-1/*-1 for series symbol*/ );
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index 0cbcff33bfcd..3dbbc0eaf3e2 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -175,7 +175,7 @@ bool BubbleChart::isSeperateStackingForDifferentSigns( sal_Int32 /*nDimensionInd
LegendSymbolStyle BubbleChart::getLegendSymbolStyle()
{
- return chart2::LegendSymbolStyle_CIRCLE;
+ return LegendSymbolStyle_CIRCLE;
}
drawing::Direction3D BubbleChart::getPreferredDiagramAspectRatio() const
diff --git a/chart2/source/view/charttypes/BubbleChart.hxx b/chart2/source/view/charttypes/BubbleChart.hxx
index ed3d9e051cc4..f94fe9e367e7 100644
--- a/chart2/source/view/charttypes/BubbleChart.hxx
+++ b/chart2/source/view/charttypes/BubbleChart.hxx
@@ -61,7 +61,7 @@ public:
//-------------------------------------------------------------------------
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+ virtual LegendSymbolStyle getLegendSymbolStyle();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 61c49c61d4a0..57d5a70e4080 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -86,7 +86,7 @@ bool CandleStickChart::isSeperateStackingForDifferentSigns( sal_Int32 /* nDimens
LegendSymbolStyle CandleStickChart::getLegendSymbolStyle()
{
- return chart2::LegendSymbolStyle_VERTICAL_LINE;
+ return LegendSymbolStyle_LINE;
}
//-----------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/CandleStickChart.hxx b/chart2/source/view/charttypes/CandleStickChart.hxx
index 6fbf980058e7..df9531ec71bf 100644
--- a/chart2/source/view/charttypes/CandleStickChart.hxx
+++ b/chart2/source/view/charttypes/CandleStickChart.hxx
@@ -59,7 +59,7 @@ public:
//-------------------------------------------------------------------------
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+ virtual LegendSymbolStyle getLegendSymbolStyle();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index c37842e19888..1077591dfce8 100644..100755
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -75,6 +75,7 @@
#include <rtl/math.hxx>
#include <tools/debug.hxx>
#include <basegfx/vector/b2dvector.hxx>
+#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <svx/unoshape.hxx>
@@ -107,7 +108,6 @@ VDataSeriesGroup::VDataSeriesGroup()
, m_bMaxPointCountDirty(true)
, m_nMaxPointCount(0)
, m_aListOfCachedYValues()
-
{
}
@@ -461,13 +461,30 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
//------------------------------------------------
//prepare legend symbol
+ float fViewFontSize( 10.0 );
+ {
+ uno::Reference< beans::XPropertySet > xProps( rDataSeries.getPropertiesOfPoint( nPointIndex ) );
+ if( xProps.is() )
+ xProps->getPropertyValue( C2U( "CharHeight" )) >>= fViewFontSize;
+ // pt -> 1/100th mm
+ fViewFontSize *= (2540.0 / 72.0);
+ }
Reference< drawing::XShape > xSymbol;
if(pLabel->ShowLegendSymbol)
{
+ sal_Int32 nSymbolHeigth = static_cast< sal_Int32 >( fViewFontSize * 0.6 );
+ awt::Size aCurrentRatio = this->getPreferredLegendKeyAspectRatio();
+ sal_Int32 nSymbolWidth = aCurrentRatio.Width;
+ if( aCurrentRatio.Height > 0 )
+ {
+ nSymbolWidth = nSymbolHeigth* aCurrentRatio.Width/aCurrentRatio.Height;
+ }
+ awt::Size aMaxSymbolExtent( nSymbolWidth, nSymbolHeigth );
+
if( rDataSeries.isVaryColorsByPoint() )
- xSymbol.set( VSeriesPlotter::createLegendSymbolForPoint( rDataSeries, nPointIndex, xTarget_, m_xShapeFactory ) );
+ xSymbol.set( VSeriesPlotter::createLegendSymbolForPoint( aMaxSymbolExtent, rDataSeries, nPointIndex, xTarget_, m_xShapeFactory ) );
else
- xSymbol.set( VSeriesPlotter::createLegendSymbolForSeries( rDataSeries, xTarget_, m_xShapeFactory ) );
+ xSymbol.set( VSeriesPlotter::createLegendSymbolForSeries( aMaxSymbolExtent, rDataSeries, xTarget_, m_xShapeFactory ) );
}
//prepare text
@@ -567,25 +584,14 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
const awt::Point aOldTextPos( xTextShape->getPosition() );
awt::Point aNewTextPos( aOldTextPos );
+ awt::Point aSymbolPosition( aUnrotatedTextPos );
awt::Size aSymbolSize( xSymbol->getSize() );
awt::Size aTextSize( xTextShape->getSize() );
+ sal_Int32 nXDiff = aSymbolSize.Width + static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.22 ) );//minimum 1mm
if( !bMultiLineLabel || nLineCountForSymbolsize <= 0 )
nLineCountForSymbolsize = 1;
- sal_Int32 nYDiff = aTextSize.Height/nLineCountForSymbolsize;
- sal_Int32 nXDiff = aSymbolSize.Width * nYDiff/aSymbolSize.Height;
-
- // #i109336# Improve auto positioning in chart
- nXDiff = nXDiff * 80 / 100;
- nYDiff = nYDiff * 80 / 100;
-
- aSymbolSize.Width = nXDiff * 75/100;
- aSymbolSize.Height = nYDiff * 75/100;
-
- awt::Point aSymbolPosition( aUnrotatedTextPos );
-
- // #i109336# Improve auto positioning in chart
- aSymbolPosition.Y += ( nYDiff / 4 );
+ aSymbolPosition.Y += ((aTextSize.Height/nLineCountForSymbolsize)/4);
if(LABEL_ALIGN_LEFT==eAlignment
|| LABEL_ALIGN_LEFT_TOP==eAlignment
@@ -607,10 +613,7 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
aNewTextPos.X += nXDiff/2;
}
- xSymbol->setSize( aSymbolSize );
xSymbol->setPosition( aSymbolPosition );
-
- //set position
xTextShape->setPosition( aNewTextPos );
}
}
@@ -1818,13 +1821,14 @@ bool VSeriesPlotter::shouldSnapRectToUsedArea()
return true;
}
-Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
- LegendExpansion eLegendExpansion
+std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries(
+ const awt::Size& rEntryKeyAspectRatio
+ , ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion
, const Reference< beans::XPropertySet >& xTextProperties
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory
, const Reference< uno::XComponentContext >& xContext
- ) throw (uno::RuntimeException)
+ )
{
std::vector< ViewLegendEntry > aResult;
@@ -1851,7 +1855,7 @@ Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
if(!pSeries)
continue;
- std::vector< ViewLegendEntry > aSeriesEntries( this->createLegendEntriesForSeries(
+ std::vector< ViewLegendEntry > aSeriesEntries( this->createLegendEntriesForSeries( rEntryKeyAspectRatio,
*pSeries, xTextProperties, xTarget, xShapeFactory, xContext ) );
//add series entries to the result now
@@ -1865,7 +1869,7 @@ Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
// If the legend is wide and we have a stacked bar-chart the normal order
// is the correct one
bool bReverse = false;
- if( eLegendExpansion != LegendExpansion_WIDE )
+ if( eLegendExpansion != ::com::sun::star::chart::ChartLegendExpansion_WIDE )
{
StackingDirection eStackingDirection( pSeries->getStackingDirection() );
bReverse = ( eStackingDirection == StackingDirection_Y_STACKING );
@@ -1880,24 +1884,119 @@ Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
}
}
}
+ }
- //add charttype specific entries if any
+ return aResult;
+}
+
+::std::vector< VDataSeries* > VSeriesPlotter::getAllSeries()
+{
+ ::std::vector< VDataSeries* > aAllSeries;
+ ::std::vector< ::std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
+ const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
+ for( ; aZSlotIter != aZSlotEnd; aZSlotIter++ )
+ {
+ ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
+ const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
+ for( ; aXSlotIter != aXSlotEnd; aXSlotIter++ )
{
- std::vector< ViewLegendEntry > aChartTypeEntries( this->createLegendEntriesForChartType(
- xTextProperties, xTarget, xShapeFactory, xContext ) );
- aResult.insert( aResult.end(), aChartTypeEntries.begin(), aChartTypeEntries.end() );
+ ::std::vector< VDataSeries* > aSeriesList = aXSlotIter->m_aSeriesVector;
+ aAllSeries.insert( aAllSeries.end(), aSeriesList.begin(), aSeriesList.end() );
}
}
-
- return ::chart::ContainerHelper::ContainerToSequence( aResult );
+ return aAllSeries;
}
+namespace
+{
+bool lcl_HasVisibleLine( const uno::Reference< beans::XPropertySet >& xProps, bool& rbHasDashedLine )
+{
+ bool bHasVisibleLine = false;
+ rbHasDashedLine = false;
+ drawing::LineStyle aLineStyle = drawing::LineStyle_NONE;
+ if( xProps.is() && ( xProps->getPropertyValue( C2U("LineStyle")) >>= aLineStyle ) )
+ {
+ if( aLineStyle != drawing::LineStyle_NONE )
+ bHasVisibleLine = true;
+ if( aLineStyle == drawing::LineStyle_DASH )
+ rbHasDashedLine = true;
+ }
+ return bHasVisibleLine;
+}
+bool lcl_HasRegressionCurves( const VDataSeries& rSeries, bool& rbHasDashedLine )
+{
+ bool bHasRegressionCurves = false;
+ Reference< XRegressionCurveContainer > xRegrCont( rSeries.getModel(), uno::UNO_QUERY );
+ if( xRegrCont.is())
+ {
+ Sequence< Reference< XRegressionCurve > > aCurves( xRegrCont->getRegressionCurves() );
+ sal_Int32 i = 0, nCount = aCurves.getLength();
+ for( i=0; i<nCount; ++i )
+ {
+ if( aCurves[i].is() )
+ {
+ bHasRegressionCurves = true;
+ lcl_HasVisibleLine( uno::Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ), rbHasDashedLine );
+ }
+ }
+ }
+ return bHasRegressionCurves;
+}
+}
LegendSymbolStyle VSeriesPlotter::getLegendSymbolStyle()
{
- return chart2::LegendSymbolStyle_BOX;
+ return LegendSymbolStyle_BOX;
}
+awt::Size VSeriesPlotter::getPreferredLegendKeyAspectRatio()
+{
+ awt::Size aRet(1000,1000);
+ if( m_nDimension==3 )
+ return aRet;
+
+ bool bSeriesAllowsLines = (getLegendSymbolStyle() == LegendSymbolStyle_LINE);
+ bool bHasLines = false;
+ bool bHasDashedLines = false;
+ ::std::vector< VDataSeries* > aAllSeries( getAllSeries() );
+ ::std::vector< VDataSeries* >::const_iterator aSeriesIter = aAllSeries.begin();
+ const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = aAllSeries.end();
+ //iterate through all series
+ for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
+ {
+ if( bSeriesAllowsLines )
+ {
+ bool bCurrentDashed = false;
+ if( lcl_HasVisibleLine( (*aSeriesIter)->getPropertiesOfSeries(), bCurrentDashed ) )
+ {
+ bHasLines = true;
+ if( bCurrentDashed )
+ {
+ bHasDashedLines = true;
+ break;
+ }
+ }
+ }
+ bool bRegressionHasDashedLines=false;
+ if( lcl_HasRegressionCurves( **aSeriesIter, bRegressionHasDashedLines ) )
+ {
+ bHasLines = true;
+ if( bRegressionHasDashedLines )
+ {
+ bHasDashedLines = true;
+ break;
+ }
+ }
+ }
+ if( bHasLines )
+ {
+ if( bHasDashedLines )
+ aRet = awt::Size(1600,-1);
+ else
+ aRet = awt::Size(800,-1);
+ }
+ return aRet;
+}
uno::Any VSeriesPlotter::getExplicitSymbol( const VDataSeries& /*rSeries*/, sal_Int32 /*nPointIndex*/ )
{
@@ -1905,7 +2004,8 @@ uno::Any VSeriesPlotter::getExplicitSymbol( const VDataSeries& /*rSeries*/, sal_
}
Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
- const VDataSeries& rSeries
+ const awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory )
{
@@ -1920,17 +2020,13 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
// legend-symbol type
switch( eLegendSymbolStyle )
{
- case LegendSymbolStyle_HORIZONTAL_LINE:
- case LegendSymbolStyle_VERTICAL_LINE:
- case LegendSymbolStyle_DIAGONAL_LINE:
- case LegendSymbolStyle_LINE_WITH_BOX:
- case LegendSymbolStyle_LINE_WITH_SYMBOL:
+ case LegendSymbolStyle_LINE:
ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES;
break;
default:
break;
};
- Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol(
+ Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
xTarget, eLegendSymbolStyle, xShapeFactory
, rSeries.getPropertiesOfSeries(), ePropType, aExplicitSymbol ));
@@ -1938,7 +2034,8 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
}
Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
- const VDataSeries& rSeries
+ const awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, sal_Int32 nPointIndex
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory )
@@ -1954,11 +2051,7 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
// legend-symbol type
switch( eLegendSymbolStyle )
{
- case LegendSymbolStyle_HORIZONTAL_LINE:
- case LegendSymbolStyle_VERTICAL_LINE:
- case LegendSymbolStyle_DIAGONAL_LINE:
- case LegendSymbolStyle_LINE_WITH_BOX:
- case LegendSymbolStyle_LINE_WITH_SYMBOL:
+ case LegendSymbolStyle_LINE:
ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES;
break;
default:
@@ -1989,14 +2082,15 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
}
}
- Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol(
+ Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
xTarget, eLegendSymbolStyle, xShapeFactory, xPointSet, ePropType, aExplicitSymbol ));
return xShape;
}
-std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSeries(
- const VDataSeries& rSeries
+std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
+ const awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, const Reference< beans::XPropertySet >& xTextProperties
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory
@@ -2025,7 +2119,7 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
uno::Reference< drawing::XShapes > xSymbolGroup( ShapeFactory(xShapeFactory).createGroup2D( xTarget ));
// create the symbol
- Reference< drawing::XShape > xShape( this->createLegendSymbolForPoint(
+ Reference< drawing::XShape > xShape( this->createLegendSymbolForPoint( rEntryKeyAspectRatio,
rSeries, nIdx, xSymbolGroup, xShapeFactory ) );
// set CID to symbol for selection
@@ -2055,7 +2149,7 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
// create the symbol
Reference< drawing::XShape > xShape( this->createLegendSymbolForSeries(
- rSeries, xSymbolGroup, xShapeFactory ) );
+ rEntryKeyAspectRatio, rSeries, xSymbolGroup, xShapeFactory ) );
// set CID to symbol for selection
if( xShape.is())
@@ -2085,11 +2179,10 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
sal_Int32 i = 0, nCount = aCurves.getLength();
for( i=0; i<nCount; ++i )
{
- if( aCurves[i].is() && !RegressionCurveHelper::isMeanValueLine( aCurves[i] ) )
+ if( aCurves[i].is() )
{
//label
- OUString aResStr( SchResId::getResString( STR_STATISTICS_IN_LEGEND ));
- replaceParamterInString( aResStr, C2U("%REGRESSIONCURVE"), RegressionCurveHelper::getUINameForRegressionCurve( aCurves[i] ));
+ OUString aResStr( RegressionCurveHelper::getUINameForRegressionCurve( aCurves[i] ) );
replaceParamterInString( aResStr, C2U("%SERIESNAME"), aLabelText );
aEntry.aLabel = FormattedStringHelper::createFormattedStringSequence( xContext, aResStr, xTextProperties );
@@ -2097,8 +2190,8 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
uno::Reference< drawing::XShapes > xSymbolGroup( ShapeFactory(xShapeFactory).createGroup2D( xTarget ));
// create the symbol
- Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol(
- xSymbolGroup, chart2::LegendSymbolStyle_DIAGONAL_LINE, xShapeFactory,
+ Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
+ xSymbolGroup, LegendSymbolStyle_LINE, xShapeFactory,
Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ),
VLegendSymbolFactory::PROP_TYPE_LINE, uno::Any() ));
@@ -2107,7 +2200,7 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
{
aEntry.aSymbol = uno::Reference< drawing::XShape >( xSymbolGroup, uno::UNO_QUERY );
- bool bAverageLine = false;//@todo find out wether this is an average line or a regression curve
+ bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurves[i] );
ObjectType eObjectType = bAverageLine ? OBJECTTYPE_DATA_AVERAGE_LINE : OBJECTTYPE_DATA_CURVE;
OUString aChildParticle( ObjectIdentifier::createChildParticleWithIndex( eObjectType, i ) );
aChildParticle = ObjectIdentifier::addChildParticle( aChildParticle, ObjectIdentifier::createChildParticleWithIndex( OBJECTTYPE_LEGEND_ENTRY, 0 ) );
@@ -2127,16 +2220,6 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
return aResult;
}
-std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForChartType(
- const Reference< beans::XPropertySet >& /* xTextProperties */,
- const Reference< drawing::XShapes >& /* xTarget */,
- const Reference< lang::XMultiServiceFactory >& /* xShapeFactory */,
- const Reference< uno::XComponentContext >& /* xContext */
- )
-{
- return std::vector< ViewLegendEntry >();
-}
-
VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
const uno::Reference<XChartType>& xChartTypeModel
, sal_Int32 nDimensionCount
diff --git a/chart2/source/view/inc/LegendEntryProvider.hxx b/chart2/source/view/inc/LegendEntryProvider.hxx
index 14b6cda47870..1ecc78107d2b 100644
--- a/chart2/source/view/inc/LegendEntryProvider.hxx
+++ b/chart2/source/view/inc/LegendEntryProvider.hxx
@@ -27,22 +27,58 @@
#ifndef CHART2_VIEW_LEGENDENTRYPROVIDER_HXX
#define CHART2_VIEW_LEGENDENTRYPROVIDER_HXX
-#include <com/sun/star/chart2/LegendExpansion.hpp>
-
-#ifndef _COM_SUN_STAR_CHART2_VIEWLEGENDENTRYP_HPP_
-#include <com/sun/star/chart2/ViewLegendEntry.hpp>
-#endif
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
+#include <com/sun/star/chart2/XFormattedString.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <vector>
+
namespace chart
{
+enum LegendSymbolStyle
+{
+ /** A square box with border.
+ */
+ LegendSymbolStyle_BOX,
+
+ /** A line like with a symbol.
+ */
+ LegendSymbolStyle_LINE,
+
+ /** A bordered circle which has the same bounding-box as the
+ <member>BOX</member>.
+ */
+ LegendSymbolStyle_CIRCLE
+};
+
+struct ViewLegendEntry
+{
+ /** The legend symbol that represents a data series or other
+ information contained in the legend
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > aSymbol;
+
+ /** The descriptive text for a legend entry.
+ */
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XFormattedString > > aLabel;
+};
+
class LegendEntryProvider
{
public:
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntries(
- ::com::sun::star::chart2::LegendExpansion eLegendExpansion,
+ virtual ::com::sun::star::awt::Size getPreferredLegendKeyAspectRatio()=0;
+
+ virtual std::vector< ViewLegendEntry > createLegendEntries(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
+ ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion,
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xTextProperties,
const ::com::sun::star::uno::Reference<
@@ -51,10 +87,7 @@ public:
::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory,
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext
- )
- throw (::com::sun::star::uno::RuntimeException) = 0;
-
-private:
+ ) = 0;
};
} // namespace chart
diff --git a/chart2/source/view/inc/VLegendSymbolFactory.hxx b/chart2/source/view/inc/VLegendSymbolFactory.hxx
index a568a9ef4a85..4ea3c67d5ece 100644
--- a/chart2/source/view/inc/VLegendSymbolFactory.hxx
+++ b/chart2/source/view/inc/VLegendSymbolFactory.hxx
@@ -27,7 +27,7 @@
#ifndef CHART2_VLEGENDSYMBOLFACTORY_HXX
#define CHART2_VLEGENDSYMBOLFACTORY_HXX
-#include <com/sun/star/chart2/LegendSymbolStyle.hpp>
+#include "LegendEntryProvider.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
@@ -50,9 +50,10 @@ public:
static ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape >
createSymbol(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes > xSymbolContainer,
- ::com::sun::star::chart2::LegendSymbolStyle eStyle,
+ LegendSymbolStyle eStyle,
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory > & xShapeFactory,
const ::com::sun::star::uno::Reference<
@@ -60,13 +61,6 @@ public:
tPropertyType ePropertyType,
const ::com::sun::star::uno::Any& rExplicitSymbol /*should contain a ::com::sun::star::chart2::Symbol without automatic symbol if the charttype does support symbols else empty*/);
- enum tStockLineType
- {
- STOCK_LINE_TYPE_VERT,
- STOCK_LINE_TYPE_OPEN,
- STOCK_LINE_TYPE_CLOSE
- };
-
private:
VLegendSymbolFactory();
};
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index 8147c3443ec6..9e427a5e2a81 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -33,7 +33,6 @@
#include "MinimumAndMaximumSupplier.hxx"
#include "LegendEntryProvider.hxx"
#include "ExplicitCategoriesProvider.hxx"
-#include <com/sun/star/chart2/LegendSymbolStyle.hpp>
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
@@ -207,9 +206,9 @@ public:
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntries(
- ::com::sun::star::chart2::LegendExpansion eLegendExpansion,
+ virtual std::vector< ViewLegendEntry > createLegendEntries(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
+ ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion,
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xTextProperties,
const ::com::sun::star::uno::Reference<
@@ -218,26 +217,29 @@ public:
::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory,
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext
- )
- throw (::com::sun::star::uno::RuntimeException);
+ );
+
+ virtual LegendSymbolStyle getLegendSymbolStyle();
+ virtual com::sun::star::awt::Size getPreferredLegendKeyAspectRatio();
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
virtual ::com::sun::star::uno::Any getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex=-1/*-1 for series symbol*/ );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLegendSymbolForSeries(
- const VDataSeries& rSeries
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLegendSymbolForPoint(
- const VDataSeries& rSeries
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, sal_Int32 nPointIndex
, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory );
- virtual std::vector<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntriesForSeries(
+ virtual std::vector< ViewLegendEntry > createLegendEntriesForSeries(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
const VDataSeries& rSeries,
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xTextProperties,
@@ -249,17 +251,7 @@ public:
::com::sun::star::uno::XComponentContext >& xContext
);
- virtual std::vector<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntriesForChartType(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xTextProperties,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShapes >& xTarget,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext >& xContext
- );
+ ::std::vector< VDataSeries* > getAllSeries();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 60e880ab311e..c66044b9aa0d 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -44,6 +44,8 @@
#include <editeng/editids.hrc>
#include <svx/svxids.hrc>
+#include <com/sun/star/chart2/LegendPosition.hpp>
+
namespace chart
{
@@ -69,7 +71,8 @@ ChartItemPool::ChartItemPool():
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_LEGEND_POS - SCHATTR_START] = new SfxInt32Item(SCHATTR_LEGEND_POS, ::com::sun::star::chart2::LegendPosition_LINE_END );
+ ppPoolDefaults[SCHATTR_LEGEND_SHOW - SCHATTR_START] = new SfxBoolItem(SCHATTR_LEGEND_SHOW, sal_True);
//text
ppPoolDefaults[SCHATTR_TEXT_DEGREES - SCHATTR_START] = new SfxInt32Item(SCHATTR_TEXT_DEGREES, 0);
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index fbc74bad05a5..33e1d1f26aa4 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -36,13 +36,14 @@
#include "ShapeFactory.hxx"
#include "RelativeSizeHelper.hxx"
#include "LegendEntryProvider.hxx"
+#include "chartview/DrawModelWrapper.hxx"
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <rtl/ustrbuf.hxx>
@@ -123,7 +124,6 @@ void lcl_getProperties(
const Reference< beans::XPropertySet > & xLegendProp,
tPropertyValues & rOutLineFillProperties,
tPropertyValues & rOutTextProperties,
- sal_Int32 nMaxLabelWidth,
const awt::Size & rReferenceSize )
{
// Get Line- and FillProperties from model legend
@@ -146,7 +146,7 @@ void lcl_getProperties(
aTextValueMap[ C2U("TextAutoGrowHeight") ] = uno::makeAny( sal_True );
aTextValueMap[ C2U("TextAutoGrowWidth") ] = uno::makeAny( sal_True );
aTextValueMap[ C2U("TextHorizontalAdjust") ] = uno::makeAny( eHorizAdjust );
- aTextValueMap[ C2U("TextMaximumFrameWidth") ] = uno::makeAny( nMaxLabelWidth );
+ aTextValueMap[ C2U("TextMaximumFrameWidth") ] = uno::makeAny( rReferenceSize.Width ); //needs to be overwritten by actual available space in the legend
// recalculate font size
awt::Size aPropRefSize;
@@ -193,16 +193,10 @@ awt::Size lcl_createTextShapes(
try
{
// create label shape
- Reference< drawing::XShape > xGroupShapeForSingleEntry(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.GroupShape" )), uno::UNO_QUERY_THROW );
- Reference< drawing::XShape >xEntry(
+ Reference< drawing::XShape > xEntry(
xShapeFactory->createInstance(
C2U( "com.sun.star.drawing.TextShape" )), uno::UNO_QUERY_THROW );
- xTarget->add( xGroupShapeForSingleEntry );
-
- Reference< drawing::XShapes > xGroup( xGroupShapeForSingleEntry, uno::UNO_QUERY_THROW );
- xGroup->add( xEntry );
+ xTarget->add( xEntry );
// set label text
Sequence< Reference< XFormattedString > > aLabelSeq = (*aIt).aLabel;
@@ -230,7 +224,7 @@ awt::Size lcl_createTextShapes(
aResult.Height = ::std::max( aResult.Height, aCurrSize.Height );
}
- rOutTextShapes.push_back( xGroupShapeForSingleEntry );
+ rOutTextShapes.push_back( xEntry );
}
catch( uno::Exception & ex )
{
@@ -241,57 +235,272 @@ awt::Size lcl_createTextShapes(
return aResult;
}
+void lcl_collectColumnWidths( std::vector< sal_Int32 >& rColumnWidths, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns
+ , const ::std::vector< Reference< drawing::XShape > > aTextShapes, sal_Int32 nSymbolPlusDistanceWidth )
+{
+ rColumnWidths.clear();
+ sal_Int32 nRow = 0;
+ sal_Int32 nColumn = 0;
+ sal_Int32 nNumberOfEntries = aTextShapes.size();
+ for( ; nRow < nNumberOfRows; ++nRow )
+ {
+ for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
+ {
+ sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
+ if( nEntry < nNumberOfEntries )
+ {
+ awt::Size aTextSize( aTextShapes[ nEntry ]->getSize() );
+ sal_Int32 nWidth = nSymbolPlusDistanceWidth + aTextSize.Width;
+ if( nRow==0 )
+ rColumnWidths.push_back( nWidth );
+ else
+ rColumnWidths[nColumn] = ::std::max( nWidth, rColumnWidths[nColumn] );
+ }
+ }
+ }
+}
-void lcl_placeLegendEntries(
- const tViewLegendEntryContainer & rEntries,
- LegendExpansion eExpansion,
+void lcl_collectRowHeighs( std::vector< sal_Int32 >& rRowHeights, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns
+ , const ::std::vector< Reference< drawing::XShape > > aTextShapes )
+{
+ // calculate maximum height for each row
+ // and collect column widths
+ rRowHeights.clear();
+ sal_Int32 nRow = 0;
+ sal_Int32 nColumn = 0;
+ sal_Int32 nNumberOfEntries = aTextShapes.size();
+ for( ; nRow < nNumberOfRows; ++nRow )
+ {
+ sal_Int32 nCurrentRowHeight = 0;
+ for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
+ {
+ sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
+ if( nEntry < nNumberOfEntries )
+ {
+ awt::Size aTextSize( aTextShapes[ nEntry ]->getSize() );
+ nCurrentRowHeight = ::std::max( nCurrentRowHeight, aTextSize.Height );
+ }
+ }
+ rRowHeights.push_back( nCurrentRowHeight );
+ }
+}
+
+sal_Int32 lcl_getTextLineHeight( const std::vector< sal_Int32 >& aRowHeights, const sal_Int32 nNumberOfRows, double fViewFontSize )
+{
+ const sal_Int32 nFontHeight = static_cast< sal_Int32 >( fViewFontSize );
+ sal_Int32 nTextLineHeight = nFontHeight;
+ for( sal_Int32 nR=0; nR<nNumberOfRows; nR++ )
+ {
+ sal_Int32 nFullTextHeight = aRowHeights[ nR ];
+ if( ( nFullTextHeight / nFontHeight ) <= 1 )
+ {
+ nTextLineHeight = nFullTextHeight;//found an entry with one line-> have real text height
+ break;
+ }
+ }
+ return nTextLineHeight;
+}
+
+//returns resulting legend size
+awt::Size lcl_placeLegendEntries(
+ tViewLegendEntryContainer & rEntries,
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion,
bool bSymbolsLeftSide,
- const Reference< beans::XPropertySet > & xProperties,
+ double fViewFontSize,
+ const awt::Size& rMaxSymbolExtent,
tPropertyValues & rTextProperties,
const Reference< drawing::XShapes > & xTarget,
const Reference< lang::XMultiServiceFactory > & xShapeFactory,
- const Reference< uno::XComponentContext > & /* xContext */,
- const awt::Size & rAvailableSpace,
- const awt::Size & rPageSize,
- awt::Size & rOutLegendSize )
+ const awt::Size & rAvailableSpace )
{
- double fViewFontSize = lcl_CalcViewFontSize( xProperties, rPageSize );
+ bool bIsCustomSize = (eExpansion == ::com::sun::star::chart::ChartLegendExpansion_CUSTOM);
+ awt::Size aResultingLegendSize(0,0);
+ if( bIsCustomSize )
+ aResultingLegendSize = rAvailableSpace;
- // padding as percentage of the font height
// #i109336# Improve auto positioning in chart
- double fXPadding = 0.1;
- double fYPadding = 0.2;
- double fXOffset = 0.15;
- double fYOffset = 0.15;
-
- const sal_Int32 nXPadding = static_cast< sal_Int32 >( fViewFontSize * fXPadding );
- const sal_Int32 nYPadding = static_cast< sal_Int32 >( fViewFontSize * fYPadding );
- const sal_Int32 nXOffset = static_cast< sal_Int32 >( fViewFontSize * fXOffset );
- const sal_Int32 nYOffset = static_cast< sal_Int32 >( fViewFontSize * fYOffset );
+ sal_Int32 nXPadding = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.33 ) );
+ //sal_Int32 nXPadding = static_cast< sal_Int32 >( std::max( 200.0, fViewFontSize * 0.33 ) );
+ sal_Int32 nXOffset = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.66 ) );
+ sal_Int32 nYPadding = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.2 ) );
+ sal_Int32 nYOffset = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.2 ) );
+ //sal_Int32 nYOffset = static_cast< sal_Int32 >( std::max( 230.0, fViewFontSize * 0.45 ) );
+
+ const sal_Int32 nSymbolToTextDistance = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.22 ) );//minimum 1mm
+ const sal_Int32 nSymbolPlusDistanceWidth = rMaxSymbolExtent.Width + nSymbolToTextDistance;
+ sal_Int32 nMaxTextWidth = rAvailableSpace.Width - (2 * nXPadding) - nSymbolPlusDistanceWidth;
+ rtl::OUString aPropNameTextMaximumFrameWidth( C2U("TextMaximumFrameWidth") );
+ uno::Any* pFrameWidthAny = PropertyMapper::getValuePointer( rTextProperties.second, rTextProperties.first, aPropNameTextMaximumFrameWidth);
+ if(pFrameWidthAny)
+ {
+ if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_HIGH )
+ {
+ // limit the width of texts to 30% of the total available width
+ // #i109336# Improve auto positioning in chart
+ nMaxTextWidth = rAvailableSpace.Width * 3 / 10;
+ }
+ *pFrameWidthAny = uno::makeAny(nMaxTextWidth);
+ }
::std::vector< Reference< drawing::XShape > > aTextShapes;
- awt::Size aMaxEntryExtent = lcl_createTextShapes(
- rEntries, xShapeFactory, xTarget, aTextShapes, rTextProperties );
+ awt::Size aMaxEntryExtent = lcl_createTextShapes( rEntries, xShapeFactory, xTarget, aTextShapes, rTextProperties );
OSL_ASSERT( aTextShapes.size() == rEntries.size());
- // #i109336# Improve auto positioning in chart
- double fSymbolSizeFraction = 0.8;
- awt::Size aMaxSymbolExtent( static_cast< sal_Int32 >( fViewFontSize * fSymbolSizeFraction * 3.0 / 2.0 ),
- static_cast< sal_Int32 >( fViewFontSize * fSymbolSizeFraction ) );
-
- sal_Int32 nCurrentXPos = nXPadding;
- sal_Int32 nCurrentYPos = nYPadding;
- sal_Int32 nMaxEntryWidth = 2 * nXOffset + aMaxSymbolExtent.Width + aMaxEntryExtent.Width;
+ sal_Int32 nMaxEntryWidth = nXOffset + nSymbolPlusDistanceWidth + aMaxEntryExtent.Width;
sal_Int32 nMaxEntryHeight = nYOffset + aMaxEntryExtent.Height;
sal_Int32 nNumberOfEntries = rEntries.size();
- if( !bSymbolsLeftSide )
- nCurrentXPos = -nXPadding;
-
sal_Int32 nNumberOfColumns = 0, nNumberOfRows = 0;
+ std::vector< sal_Int32 > aColumnWidths;
+ std::vector< sal_Int32 > aRowHeights;
+
+ sal_Int32 nTextLineHeight = static_cast< sal_Int32 >( fViewFontSize );
// determine layout depending on LegendExpansion
- if( eExpansion == LegendExpansion_HIGH )
+ if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_CUSTOM )
+ {
+ sal_Int32 nCurrentRow=0;
+ sal_Int32 nCurrentColumn=-1;
+ sal_Int32 nColumnCount=0;
+ sal_Int32 nMaxColumnCount=-1;
+ for( sal_Int32 nN=0; nN<static_cast<sal_Int32>(aTextShapes.size()); nN++ )
+ {
+ Reference< drawing::XShape > xShape( aTextShapes[nN] );
+ if( !xShape.is() )
+ continue;
+ awt::Size aSize( xShape->getSize() );
+ sal_Int32 nNewWidth = aSize.Width + nSymbolPlusDistanceWidth;
+ sal_Int32 nCurrentColumnCount = aColumnWidths.size();
+
+ //are we allowed to add a new column?
+ if( nMaxColumnCount==-1 || (nCurrentColumn+1) < nMaxColumnCount )
+ {
+ //try add a new column
+ nCurrentColumn++;
+ if( nCurrentColumn < nCurrentColumnCount )
+ {
+ //check wether the current column width is sufficient for the new entry
+ if( aColumnWidths[nCurrentColumn]>=nNewWidth )
+ {
+ //all good proceed with next entry
+ continue;
+ }
+ }
+ if( nCurrentColumn < nCurrentColumnCount )
+ aColumnWidths[nCurrentColumn] = std::max( nNewWidth, aColumnWidths[nCurrentColumn] );
+ else
+ aColumnWidths.push_back(nNewWidth);
+
+ //do the columns still fit into the given size?
+ nCurrentColumnCount = aColumnWidths.size();//update count
+ sal_Int32 nSumWidth = 0;
+ for( sal_Int32 nC=0; nC<nCurrentColumnCount; nC++ )
+ nSumWidth += aColumnWidths[nC];
+
+ if( nSumWidth <= rAvailableSpace.Width || nCurrentColumnCount==1 )
+ {
+ //all good proceed with next entry
+ continue;
+ }
+ else
+ {
+ //not enough space for the current amount of columns
+ //try again with less columns
+ nMaxColumnCount = nCurrentColumnCount-1;
+ nN=-1;
+ nCurrentRow=0;
+ nCurrentColumn=-1;
+ nColumnCount=0;
+ aColumnWidths.clear();
+ }
+ }
+ else
+ {
+ //add a new row and try the same entry again
+ nCurrentRow++;
+ nCurrentColumn=-1;
+ nN--;
+ }
+ }
+ nNumberOfColumns = aColumnWidths.size();
+ nNumberOfRows = nCurrentRow+1;
+
+ //check if there is not enough space so that some entries must be removed
+ lcl_collectRowHeighs( aRowHeights, nNumberOfRows, nNumberOfColumns, aTextShapes );
+ nTextLineHeight = lcl_getTextLineHeight( aRowHeights, nNumberOfRows, fViewFontSize );
+ sal_Int32 nSumHeight = 0;
+ for( sal_Int32 nR=0; nR<nNumberOfRows; nR++ )
+ nSumHeight += aRowHeights[nR];
+ sal_Int32 nRemainingSpace = rAvailableSpace.Height - nSumHeight;
+
+ if( nRemainingSpace<0 )
+ {
+ //remove entries that are too big
+ for( sal_Int32 nR=nNumberOfRows; nR--; )
+ {
+ for( sal_Int32 nC=nNumberOfColumns; nC--; )
+ {
+ sal_Int32 nEntry = (nC + nR * nNumberOfColumns);
+ if( nEntry < static_cast<sal_Int32>(aTextShapes.size()) )
+ {
+ DrawModelWrapper::removeShape( aTextShapes[nEntry] );
+ aTextShapes.pop_back();
+ }
+ if( nEntry < nNumberOfEntries )
+ {
+ DrawModelWrapper::removeShape( rEntries[ nEntry ].aSymbol );
+ rEntries.pop_back();
+ nNumberOfEntries--;
+ }
+ }
+ nSumHeight -= aRowHeights[nR];
+ aRowHeights.pop_back();
+ nRemainingSpace = rAvailableSpace.Height - nSumHeight;
+ if( nRemainingSpace>=0 )
+ break;
+ }
+ nNumberOfRows = static_cast<sal_Int32>(aRowHeights.size());
+ }
+ if( nRemainingSpace > 0 )
+ {
+ sal_Int32 nNormalSpacingHeight = 2*nYPadding+(nNumberOfRows-1)*nYOffset;
+ if( nRemainingSpace < nNormalSpacingHeight )
+ {
+ //reduce spacing between the entries
+ nYPadding = nYOffset = nRemainingSpace/(nNumberOfRows+1);
+ }
+ else
+ {
+ //we have some space left that should be spread equally between all rows
+ sal_Int32 nRemainingSingleSpace = (nRemainingSpace-nNormalSpacingHeight)/(nNumberOfRows+1);
+ nYPadding += nRemainingSingleSpace;
+ nYOffset += nRemainingSingleSpace;
+ }
+ }
+
+ //check spacing between columns
+ sal_Int32 nSumWidth = 0;
+ for( sal_Int32 nC=0; nC<nNumberOfColumns; nC++ )
+ nSumWidth += aColumnWidths[nC];
+ nRemainingSpace = rAvailableSpace.Width - nSumWidth;
+ if( nRemainingSpace>=0 )
+ {
+ sal_Int32 nNormalSpacingWidth = 2*nXPadding+(nNumberOfColumns-1)*nXOffset;
+ if( nRemainingSpace < nNormalSpacingWidth )
+ {
+ //reduce spacing between the entries
+ nXPadding = nXOffset = nRemainingSpace/(nNumberOfColumns+1);
+ }
+ else
+ {
+ //we have some space left that should be spread equally between all columns
+ sal_Int32 nRemainingSingleSpace = (nRemainingSpace-nNormalSpacingWidth)/(nNumberOfColumns+1);
+ nXPadding += nRemainingSingleSpace;
+ nXOffset += nRemainingSingleSpace;
+ }
+ }
+ }
+ else if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_HIGH )
{
sal_Int32 nMaxNumberOfRows = nMaxEntryHeight
? (rAvailableSpace.Height - 2*nYPadding ) / nMaxEntryHeight
@@ -308,7 +517,7 @@ void lcl_placeLegendEntries(
static_cast< double >( nNumberOfColumns ) ))
: 0;
}
- else if( eExpansion == LegendExpansion_WIDE )
+ else if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_WIDE )
{
sal_Int32 nMaxNumberOfColumns = nMaxEntryWidth
? (rAvailableSpace.Width - 2*nXPadding ) / nMaxEntryWidth
@@ -325,7 +534,7 @@ void lcl_placeLegendEntries(
static_cast< double >( nNumberOfRows ) ))
: 0;
}
- else // LegendExpansion_BALANCED
+ else // ::com::sun::star::chart::ChartLegendExpansion_BALANCED
{
double fAspect = nMaxEntryHeight
? static_cast< double >( nMaxEntryWidth ) / static_cast< double >( nMaxEntryHeight )
@@ -341,93 +550,90 @@ void lcl_placeLegendEntries(
}
if(nNumberOfRows<=0)
- return;
+ return aResultingLegendSize;
- // calculate maximum height for current row
- std::vector< sal_Int32 > nMaxHeights( nNumberOfRows );
- sal_Int32 nRow = 0;
- sal_Int32 nColumn = 0;
- for( ; nRow < nNumberOfRows; ++nRow )
+ if( eExpansion != ::com::sun::star::chart::ChartLegendExpansion_CUSTOM )
{
- sal_Int32 nMaxHeight = 0;
- for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
- {
- sal_Int32 nEntry = ( eExpansion == LegendExpansion_WIDE )
- ? (nColumn + nRow * nNumberOfColumns)
- // HIGH or BALANCED
- : (nRow + nColumn * nNumberOfRows);
- if( nEntry < nNumberOfEntries )
- nMaxHeight = ::std::max(
- nMaxHeight, nYOffset + aTextShapes[ nEntry ]->getSize().Height );
- }
- nMaxHeights[ nRow ] = nMaxHeight;
+ lcl_collectColumnWidths( aColumnWidths, nNumberOfRows, nNumberOfColumns, aTextShapes, nSymbolPlusDistanceWidth );
+ lcl_collectRowHeighs( aRowHeights, nNumberOfRows, nNumberOfColumns, aTextShapes );
+ nTextLineHeight = lcl_getTextLineHeight( aRowHeights, nNumberOfRows, fViewFontSize );
}
- // place entries ordered in optimal-width columns
+ sal_Int32 nCurrentXPos = nXPadding;
+ sal_Int32 nCurrentYPos = nYPadding;
+ if( !bSymbolsLeftSide )
+ nCurrentXPos = -nXPadding;
+
+ // place entries into column and rows
sal_Int32 nMaxYPos = 0;
+ sal_Int32 nRow = 0;
+ sal_Int32 nColumn = 0;
for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
{
- sal_Int32 nMaxWidth = 0;
nCurrentYPos = nYPadding;
-
for( nRow = 0; nRow < nNumberOfRows; ++nRow )
{
- sal_Int32 nEntry = ( eExpansion == LegendExpansion_WIDE )
- ? (nColumn + nRow * nNumberOfColumns)
- // HIGH or BALANCED
- : (nRow + nColumn * nNumberOfRows);
-
+ sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
if( nEntry >= nNumberOfEntries )
break;
+ // text shape
+ Reference< drawing::XShape > xTextShape( aTextShapes[nEntry] );
+ if( xTextShape.is() )
+ {
+ awt::Size aTextSize( xTextShape->getSize() );
+ sal_Int32 nTextXPos = nCurrentXPos + nSymbolPlusDistanceWidth;
+ if( !bSymbolsLeftSide )
+ nTextXPos = nCurrentXPos - nSymbolPlusDistanceWidth - aTextSize.Width;
+ xTextShape->setPosition( awt::Point( nTextXPos, nCurrentYPos ));
+ }
+
// symbol
Reference< drawing::XShape > xSymbol( rEntries[ nEntry ].aSymbol );
-
if( xSymbol.is() )
{
- // Note: aspect ratio should always be 3:2
-
- // set symbol size to 75% of maximum space
- awt::Size aSymbolSize(
- aMaxSymbolExtent.Width * 75 / 100,
- aMaxSymbolExtent.Height * 75 / 100 );
- xSymbol->setSize( aSymbolSize );
- sal_Int32 nSymbolXPos = nCurrentXPos + ((aMaxSymbolExtent.Width - aSymbolSize.Width) / 2);
+ awt::Size aSymbolSize( rMaxSymbolExtent );
+ sal_Int32 nSymbolXPos = nCurrentXPos;
if( !bSymbolsLeftSide )
- nSymbolXPos = nSymbolXPos - aMaxSymbolExtent.Width;
-
- // #i109336# Improve auto positioning in chart
- sal_Int32 nTextHeight = nMaxHeights[ nRow ] - nYOffset;
- sal_Int32 nFontSize = static_cast< sal_Int32 >( fViewFontSize );
- sal_Int32 nMaxRowHeight = ( ( ( nTextHeight / nFontSize ) <= 1 ) ? nTextHeight : nFontSize );
- sal_Int32 nSymbolYPos = nCurrentYPos + ( ( nMaxRowHeight - aSymbolSize.Height ) / 2 );
+ nSymbolXPos = nCurrentXPos - rMaxSymbolExtent.Width;
+ sal_Int32 nSymbolYPos = nCurrentYPos + ( ( nTextLineHeight - aSymbolSize.Height ) / 2 );
xSymbol->setPosition( awt::Point( nSymbolXPos, nSymbolYPos ) );
}
- // position text shape
- awt::Size aTextSize( aTextShapes[ nEntry ]->getSize());
- nMaxWidth = ::std::max( nMaxWidth, 2 * nXOffset + aMaxSymbolExtent.Width + aTextSize.Width );
- sal_Int32 nTextXPos = nCurrentXPos + aMaxSymbolExtent.Width;
- if( !bSymbolsLeftSide )
- nTextXPos = nCurrentXPos - aMaxSymbolExtent.Width - aTextSize.Width;
- aTextShapes[ nEntry ]->setPosition( awt::Point( nTextXPos, nCurrentYPos ));
-
- nCurrentYPos += nMaxHeights[ nRow ];
+ nCurrentYPos += aRowHeights[ nRow ];
+ if( nRow+1 < nNumberOfRows )
+ nCurrentYPos += nYOffset;
nMaxYPos = ::std::max( nMaxYPos, nCurrentYPos );
}
if( bSymbolsLeftSide )
- nCurrentXPos += nMaxWidth;
+ {
+ nCurrentXPos += aColumnWidths[nColumn];
+ if( nColumn+1 < nNumberOfColumns )
+ nCurrentXPos += nXOffset;
+ }
else
- nCurrentXPos -= nMaxWidth;
+ {
+ nCurrentXPos -= aColumnWidths[nColumn];
+ if( nColumn+1 < nNumberOfColumns )
+ nCurrentXPos -= nXOffset;
+ }
}
- if( bSymbolsLeftSide )
- rOutLegendSize.Width = nCurrentXPos + nXPadding;
- else
+ if( !bIsCustomSize )
{
- sal_Int32 nLegendWidth = -(nCurrentXPos-nXPadding);
- rOutLegendSize.Width = nLegendWidth;
+ if( bSymbolsLeftSide )
+ aResultingLegendSize.Width = nCurrentXPos + nXPadding;
+ else
+ {
+ sal_Int32 nLegendWidth = -(nCurrentXPos-nXPadding);
+ aResultingLegendSize.Width = nLegendWidth;
+ }
+ aResultingLegendSize.Height = nMaxYPos + nYPadding;
+ }
+ if( !bSymbolsLeftSide )
+ {
+ sal_Int32 nLegendWidth = aResultingLegendSize.Width;
awt::Point aPos(0,0);
for( sal_Int32 nEntry=0; nEntry<nNumberOfEntries; nEntry++ )
{
@@ -441,7 +647,8 @@ void lcl_placeLegendEntries(
xText->setPosition( aPos );
}
}
- rOutLegendSize.Height = nMaxYPos + nYPadding;
+
+ return aResultingLegendSize;
}
// #i109336# Improve auto positioning in chart
@@ -583,14 +790,6 @@ awt::Point lcl_calculatePositionAndRemainingSpace(
return aResult;
}
-template< class T >
-void lcl_appendSeqToVector( const Sequence< T > & rSource, ::std::vector< T > & rDest )
-{
- const sal_Int32 nCount = rSource.getLength();
- for( sal_Int32 i = 0; i < nCount; ++i )
- rDest.push_back( rSource[ i ] );
-}
-
bool lcl_shouldSymbolsBePlacedOnTheLeftSide( const Reference< beans::XPropertySet >& xLegendProp, sal_Int16 nDefaultWritingMode )
{
bool bSymbolsLeftSide = true;
@@ -706,23 +905,26 @@ void VLegend::createShapes(
tPropertyValues aLineFillProperties;
tPropertyValues aTextProperties;
- // limit the width of texts to 30% of the total available width
- // #i109336# Improve auto positioning in chart
- sal_Int32 nMaxLabelWidth = rAvailableSpace.Width * 3 / 10;
Reference< beans::XPropertySet > xLegendProp( m_xLegend, uno::UNO_QUERY );
- LegendExpansion eExpansion = LegendExpansion_HIGH;
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
+ awt::Size aLegendSize( rAvailableSpace );
+
if( xLegendProp.is())
{
// get Expansion property
xLegendProp->getPropertyValue( C2U( "Expansion" )) >>= eExpansion;
- if( eExpansion == LegendExpansion_WIDE )
+ if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_CUSTOM )
{
- //#i80377#
- nMaxLabelWidth = (rAvailableSpace.Width * 5) / 6;//completely correct would be available width minus symbol size minus distances to page ...
+ RelativeSize aRelativeSize;
+ if ((xLegendProp->getPropertyValue( C2U( "RelativeSize" )) >>= aRelativeSize))
+ {
+ aLegendSize.Width = aRelativeSize.Primary * rPageSize.Width;
+ aLegendSize.Height = aRelativeSize.Secondary * rPageSize.Height;
+ }
+ else
+ eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
}
-
- lcl_getProperties( xLegendProp, aLineFillProperties, aTextProperties, nMaxLabelWidth,
- rPageSize );
+ lcl_getProperties( xLegendProp, aLineFillProperties, aTextProperties, rPageSize );
}
if( xBorder.is())
@@ -739,32 +941,47 @@ void VLegend::createShapes(
}
// create entries
- tViewLegendEntryContainer aViewEntries;
+ double fViewFontSize = lcl_CalcViewFontSize( xLegendProp, rPageSize );//todo
+ // #i109336# Improve auto positioning in chart
+ sal_Int32 nSymbolHeigth = static_cast< sal_Int32 >( fViewFontSize * 0.6 );
+ sal_Int32 nSymbolWidth = static_cast< sal_Int32 >( nSymbolHeigth );
+
+ ::std::vector< LegendEntryProvider* >::const_iterator aIter = m_aLegendEntryProviderList.begin();
+ const ::std::vector< LegendEntryProvider* >::const_iterator aEnd = m_aLegendEntryProviderList.end();
+ for( aIter = m_aLegendEntryProviderList.begin(); aIter != aEnd; aIter++ )
{
- ::std::vector< LegendEntryProvider* >::const_iterator aIter = m_aLegendEntryProviderList.begin();
- const ::std::vector< LegendEntryProvider* >::const_iterator aEnd = m_aLegendEntryProviderList.end();
- for( ; aIter != aEnd; aIter++ )
+ LegendEntryProvider* pLegendEntryProvider( *aIter );
+ if( pLegendEntryProvider )
{
- LegendEntryProvider* pLegendEntryProvider( *aIter );
- if( pLegendEntryProvider )
+ awt::Size aCurrentRatio = pLegendEntryProvider->getPreferredLegendKeyAspectRatio();
+ sal_Int32 nCurrentWidth = aCurrentRatio.Width;
+ if( aCurrentRatio.Height > 0 )
{
- lcl_appendSeqToVector< ViewLegendEntry >(
- pLegendEntryProvider->createLegendEntries( eExpansion, xLegendProp, xLegendContainer, m_xShapeFactory, m_xContext )
- , aViewEntries );
+ nCurrentWidth = nSymbolHeigth* aCurrentRatio.Width/aCurrentRatio.Height;
}
+ nSymbolWidth = std::max( nSymbolWidth, nCurrentWidth );
+ }
+ }
+ awt::Size aMaxSymbolExtent( nSymbolWidth, nSymbolHeigth );
+
+ tViewLegendEntryContainer aViewEntries;
+ for( aIter = m_aLegendEntryProviderList.begin(); aIter != aEnd; aIter++ )
+ {
+ LegendEntryProvider* pLegendEntryProvider( *aIter );
+ if( pLegendEntryProvider )
+ {
+ std::vector< ViewLegendEntry > aNewEntries = pLegendEntryProvider->createLegendEntries( aMaxSymbolExtent, eExpansion, xLegendProp, xLegendContainer, m_xShapeFactory, m_xContext );
+ aViewEntries.insert( aViewEntries.end(), aNewEntries.begin(), aNewEntries.end() );
}
}
bool bSymbolsLeftSide = lcl_shouldSymbolsBePlacedOnTheLeftSide( xLegendProp, m_nDefaultWritingMode );
// place entries
- awt::Size aLegendSize;
- lcl_placeLegendEntries( aViewEntries, eExpansion, bSymbolsLeftSide
- , xLegendProp, aTextProperties
- , xLegendContainer, m_xShapeFactory, m_xContext
- , rAvailableSpace, rPageSize, aLegendSize );
+ aLegendSize = lcl_placeLegendEntries( aViewEntries, eExpansion, bSymbolsLeftSide, fViewFontSize, aMaxSymbolExtent
+ , aTextProperties, xLegendContainer, m_xShapeFactory, aLegendSize );
- if( xBorder.is())
+ if( xBorder.is() )
xBorder->setSize( aLegendSize );
}
}
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index d29b28e8dbe9..b7168bd7ee9f 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -38,9 +38,6 @@
// header for define DBG_ASSERT
#include <tools/debug.hxx>
-// uncomment to disable line dashes at the border of boxes
-// #define DISABLE_DASHES_AT_BORDER
-
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -105,16 +102,16 @@ namespace chart
{
Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
+ const awt::Size& rEntryKeyAspectRatio,
const Reference< drawing::XShapes > xSymbolContainer,
- chart2::LegendSymbolStyle eStyle,
+ LegendSymbolStyle eStyle,
const Reference< lang::XMultiServiceFactory > & xShapeFactory,
const Reference< beans::XPropertySet > & xLegendEntryProperties,
tPropertyType ePropertyType, const uno::Any& rExplicitSymbol )
{
Reference< drawing::XShape > xResult;
- if( ! (xSymbolContainer.is() &&
- xShapeFactory.is()))
+ if( ! (xSymbolContainer.is() && xShapeFactory.is()))
return xResult;
xResult.set( xShapeFactory->createInstance(
@@ -124,247 +121,92 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
if( ! xResultGroup.is())
return xResult;
- // aspect ratio of symbols is always 3:2
- awt::Size aBoundSize( 3000, 2000 );
- bool bUseBox = false;
-
// add an invisible square box to maintain aspect ratio
- switch( eStyle )
- {
- case chart2::LegendSymbolStyle_BOX:
- case chart2::LegendSymbolStyle_HORIZONTAL_LINE:
- case chart2::LegendSymbolStyle_VERTICAL_LINE:
- case chart2::LegendSymbolStyle_DIAGONAL_LINE:
- case chart2::LegendSymbolStyle_LINE_WITH_BOX:
- case chart2::LegendSymbolStyle_LINE_WITH_SYMBOL:
- case chart2::LegendSymbolStyle_CIRCLE:
- {
- Reference< drawing::XShape > xBound( ShapeFactory(xShapeFactory).createInvisibleRectangle(
- xResultGroup, aBoundSize ));
- break;
- }
-
- case chart2::LegendSymbolStyle_BAR:
- case chart2::LegendSymbolStyle_RECTANGLE:
- case chart2::LegendSymbolStyle_STRETCHED_RECTANGLE:
- case chart2::LegendSymbolStyle_USER_DEFINED:
- default:
- break;
- }
+ Reference< drawing::XShape > xBound( ShapeFactory(xShapeFactory).createInvisibleRectangle(
+ xResultGroup, rEntryKeyAspectRatio ));
// create symbol
- switch( eStyle )
+ try
{
- case chart2::LegendSymbolStyle_BOX:
- case chart2::LegendSymbolStyle_BAR:
- case chart2::LegendSymbolStyle_RECTANGLE:
- case chart2::LegendSymbolStyle_STRETCHED_RECTANGLE:
- case chart2::LegendSymbolStyle_CIRCLE:
+ if( eStyle == LegendSymbolStyle_LINE )
{
- try
+ Reference< drawing::XShape > xLine( xShapeFactory->createInstance(
+ C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
+ if( xLine.is())
{
- Reference< drawing::XShape > xShape;
+ xResultGroup->add( xLine );
+ xLine->setSize( awt::Size( rEntryKeyAspectRatio.Width, 0 ));
+ xLine->setPosition( awt::Point( 0, rEntryKeyAspectRatio.Height/2 ));
- if( eStyle == chart2::LegendSymbolStyle_CIRCLE )
- xShape.set( xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.EllipseShape" )), uno::UNO_QUERY );
- else
- xShape.set( xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.RectangleShape" )), uno::UNO_QUERY );
+ lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType );
+ }
- if( xShape.is())
+ Reference< drawing::XShape > xSymbol;
+ const sal_Int32 nSize = std::min(rEntryKeyAspectRatio.Width,rEntryKeyAspectRatio.Height);
+ chart2::Symbol aSymbol;
+ if( rExplicitSymbol >>= aSymbol )
+ {
+ drawing::Direction3D aSymbolSize( nSize, nSize, 0 );
+ drawing::Position3D aPos( rEntryKeyAspectRatio.Width/2, rEntryKeyAspectRatio.Height/2, 0 );
+ ShapeFactory aFactory( xShapeFactory );
+ if( aSymbol.Style == chart2::SymbolStyle_STANDARD )
{
- xResultGroup->add( xShape );
- if( eStyle == chart2::LegendSymbolStyle_BOX ||
- eStyle == chart2::LegendSymbolStyle_CIRCLE )
- {
- xShape->setSize( awt::Size( 2000, 2000 ));
- xShape->setPosition( awt::Point( 500, 0 ));
- }
- else
- {
- xShape->setSize( aBoundSize );
- }
+ // take series color as fill color
+ xLegendEntryProperties->getPropertyValue( C2U("Color")) >>= aSymbol.FillColor;
+ // border of symbols always same as fill color
+ aSymbol.BorderColor = aSymbol.FillColor;
+
+ xSymbol.set( aFactory.createSymbol2D(
+ xResultGroup,
+ aPos,
+ aSymbolSize,
+ aSymbol.StandardSymbol,
+ aSymbol.BorderColor,
+ aSymbol.FillColor ));
}
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xShape, ePropertyType ); // PROP_TYPE_FILLED_SERIES );
-
-#ifdef DISABLE_DASHES_AT_BORDER
- // don't allow dashed border style
- Reference< beans::XPropertySet > xShapeProp( xShape, uno::UNO_QUERY );
- if( xShapeProp.is())
+ else if( aSymbol.Style == chart2::SymbolStyle_GRAPHIC )
{
- drawing::LineStyle aLineStyle;
- if( ( xShapeProp->getPropertyValue( C2U("LineStyle")) >>= aLineStyle ) &&
- aLineStyle == drawing::LineStyle_DASH )
- {
- aLineStyle = drawing::LineStyle_SOLID;
- xShapeProp->setPropertyValue( C2U("LineStyle"), uno::makeAny( aLineStyle ));
- }
+ xSymbol.set( aFactory.createGraphic2D(
+ xResultGroup,
+ aPos,
+ aSymbolSize,
+ aSymbol.Graphic ));
}
-#endif
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- break;
- }
-
- case chart2::LegendSymbolStyle_HORIZONTAL_LINE:
- {
- try
- {
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
+ else if( aSymbol.Style == chart2::SymbolStyle_AUTO )
{
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 3000, 0 ));
- xLine->setPosition( awt::Point( 0, 1000 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType ); // PROP_TYPE_LINE_SERIES );
+ DBG_ERROR("the given parameter is not allowed to contain an automatic symbol style");
}
}
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- break;
}
-
- case chart2::LegendSymbolStyle_VERTICAL_LINE:
+ else if( eStyle == LegendSymbolStyle_CIRCLE )
{
- try
+ Reference< drawing::XShape > xShape( xShapeFactory->createInstance(
+ C2U( "com.sun.star.drawing.EllipseShape" )), uno::UNO_QUERY );
+ if( xShape.is() )
{
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
- {
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 0, 2000 ));
- xLine->setPosition( awt::Point( 1500, 0 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType ); // PROP_TYPE_LINE_SERIES );
- }
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
+ xResultGroup->add( xShape );
+ sal_Int32 nSize = std::min( rEntryKeyAspectRatio.Width, rEntryKeyAspectRatio.Height );
+ xShape->setSize( awt::Size( nSize, nSize ) );
+ xShape->setPosition( awt::Point( rEntryKeyAspectRatio.Width/2-nSize/2, rEntryKeyAspectRatio.Height/2-nSize/2 ) );
+ lcl_setPropetiesToShape( xLegendEntryProperties, xShape, ePropertyType ); // PROP_TYPE_FILLED_SERIES );
}
- break;
}
-
- case chart2::LegendSymbolStyle_DIAGONAL_LINE:
+ else // eStyle == LegendSymbolStyle_BOX
{
- try
+ Reference< drawing::XShape > xShape( xShapeFactory->createInstance(
+ C2U( "com.sun.star.drawing.RectangleShape" )), uno::UNO_QUERY );
+ if( xShape.is() )
{
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
- {
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 2000, 2000 ));
- xLine->setPosition( awt::Point( 500, 0 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType ); // PROP_TYPE_LINE_SERIES );
- }
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
+ xResultGroup->add( xShape );
+ xShape->setSize( rEntryKeyAspectRatio );
+ xShape->setPosition( awt::Point( 0, 0 ) );
+ lcl_setPropetiesToShape( xLegendEntryProperties, xShape, ePropertyType ); // PROP_TYPE_FILLED_SERIES );
}
- break;
}
-
- case chart2::LegendSymbolStyle_LINE_WITH_BOX:
- bUseBox = true;
- // fall-through intended
- case chart2::LegendSymbolStyle_LINE_WITH_SYMBOL:
- try
- {
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
- {
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 3000, 0 ));
- xLine->setPosition( awt::Point( 0, 1000 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType );
- }
-
- Reference< drawing::XShape > xSymbol;
- const sal_Int32 nSize = 1500;
- if( bUseBox )
- {
- xSymbol.set( xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.RectangleShape" )), uno::UNO_QUERY );
- xResultGroup->add( xSymbol );
-
- if( xSymbol.is())
- {
- xSymbol->setSize( awt::Size( nSize, nSize ));
- xSymbol->setPosition( awt::Point( 1500 - nSize/2, 1000 - nSize/2 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xSymbol, ePropertyType );
- }
- }
- else
- {
- chart2::Symbol aSymbol;
-
- if( rExplicitSymbol >>= aSymbol )
- {
- drawing::Direction3D aSymbolSize( nSize, nSize, 0 );
- drawing::Position3D aPos( 1500, 1000, 0 );
- ShapeFactory aFactory( xShapeFactory );
- if( aSymbol.Style == chart2::SymbolStyle_STANDARD )
- {
- // take series color as fill color
- xLegendEntryProperties->getPropertyValue( C2U("Color")) >>= aSymbol.FillColor;
- // border of symbols always same as fill color
- aSymbol.BorderColor = aSymbol.FillColor;
-
- xSymbol.set( aFactory.createSymbol2D(
- xResultGroup,
- aPos,
- aSymbolSize,
- aSymbol.StandardSymbol,
- aSymbol.BorderColor,
- aSymbol.FillColor ));
- }
- else if( aSymbol.Style == chart2::SymbolStyle_GRAPHIC )
- {
- xSymbol.set( aFactory.createGraphic2D(
- xResultGroup,
- aPos,
- aSymbolSize,
- aSymbol.Graphic ));
- }
- else if( aSymbol.Style == chart2::SymbolStyle_AUTO )
- {
- DBG_ERROR("the given parameter is not allowed to contain an automatic symbol style");
- }
- }
- }
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- break;
-
- case chart2::LegendSymbolStyle_USER_DEFINED:
- break;
-
- default:
- // just to remove warning (there is an auto-generated extra label)
- break;
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
}
return xResult;
diff --git a/comphelper/Library_comphelp.mk b/comphelper/Library_comphelp.mk
index f077c1db4973..0228d80b2f89 100644
--- a/comphelper/Library_comphelp.mk
+++ b/comphelper/Library_comphelp.mk
@@ -113,6 +113,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
comphelper/source/misc/serviceinfohelper \
comphelper/source/misc/sharedmutex \
comphelper/source/misc/stillreadwriteinteraction \
+ comphelper/source/misc/anycompare \
comphelper/source/misc/storagehelper \
comphelper/source/misc/string \
comphelper/source/misc/synchronousdispatch \
diff --git a/comphelper/Package_inc.mk b/comphelper/Package_inc.mk
index dcfb4954efb1..5794c56ab74d 100644
--- a/comphelper/Package_inc.mk
+++ b/comphelper/Package_inc.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/basicio.hxx,comp
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/classids.hxx,comphelper/classids.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/MasterPropertySet.hxx,comphelper/MasterPropertySet.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/stillreadwriteinteraction.hxx,comphelper/stillreadwriteinteraction.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/anycompare.hxx,comphelper/anycompare.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propagg.hxx,comphelper/propagg.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/scopeguard.hxx,comphelper/scopeguard.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/asyncnotification.hxx,comphelper/asyncnotification.hxx))
@@ -110,6 +111,7 @@ $(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/numbers.hxx,comp
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/evtlistenerhlp.hxx,comphelper/evtlistenerhlp.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/optional.hxx,comphelper/optional.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/componentbase.hxx,comphelper/componentbase.hxx))
+$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/componentguard.hxx,comphelper/componentguard.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/InlineContainer.hxx,comphelper/InlineContainer.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/propertybag.hxx,comphelper/propertybag.hxx))
$(eval $(call gb_Package_add_file,comphelper_inc,inc/comphelper/embeddedobjectcontainer.hxx,comphelper/embeddedobjectcontainer.hxx))
diff --git a/comphelper/inc/comphelper/anycompare.hxx b/comphelper/inc/comphelper/anycompare.hxx
new file mode 100755
index 000000000000..03f41e108ba9
--- /dev/null
+++ b/comphelper/inc/comphelper/anycompare.hxx
@@ -0,0 +1,226 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_ANYCOMPARE_HXX
+#define COMPHELPER_ANYCOMPARE_HXX
+
+#include "comphelper/comphelperdllapi.h"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/extract.hxx>
+
+#include <functional>
+#include <memory>
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= IKeyPredicateLess
+ //==================================================================================================================
+ class SAL_NO_VTABLE IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const = 0;
+ virtual ~IKeyPredicateLess() {}
+ };
+
+ //==================================================================================================================
+ //= LessPredicateAdapter
+ //==================================================================================================================
+ struct LessPredicateAdapter : public ::std::binary_function< ::com::sun::star::uno::Any, ::com::sun::star::uno::Any, bool >
+ {
+ LessPredicateAdapter( const IKeyPredicateLess& _predicate )
+ :m_predicate( _predicate )
+ {
+ }
+
+ bool operator()( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ return m_predicate.isLess( _lhs, _rhs );
+ }
+
+ private:
+ IKeyPredicateLess const & m_predicate;
+
+ private:
+ LessPredicateAdapter(); // never implemented
+ };
+
+ //==================================================================================================================
+ //= ScalarPredicateLess
+ //==================================================================================================================
+ template< typename SCALAR >
+ class ScalarPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ SCALAR lhs(0), rhs(0);
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+ };
+
+ //==================================================================================================================
+ //= StringPredicateLess
+ //==================================================================================================================
+ class StringPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ ::rtl::OUString lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+ };
+
+ //==================================================================================================================
+ //= StringCollationPredicateLess
+ //==================================================================================================================
+ class StringCollationPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ StringCollationPredicateLess( ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const & i_collator )
+ :m_collator( i_collator )
+ {
+ }
+
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ ::rtl::OUString lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return m_collator->compareString( lhs, rhs ) < 0;
+ }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const m_collator;
+ };
+
+ //==================================================================================================================
+ //= TypePredicateLess
+ //==================================================================================================================
+ class TypePredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ ::com::sun::star::uno::Type lhs, rhs;
+ if ( !( _lhs >>= lhs )
+ || !( _rhs >>= rhs )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs.getTypeName() < rhs.getTypeName();
+ }
+ };
+
+ //==================================================================================================================
+ //= EnumPredicateLess
+ //==================================================================================================================
+ class EnumPredicateLess : public IKeyPredicateLess
+ {
+ public:
+ EnumPredicateLess( ::com::sun::star::uno::Type const & _enumType )
+ :m_enumType( _enumType )
+ {
+ }
+
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ sal_Int32 lhs(0), rhs(0);
+ if ( !::cppu::enum2int( lhs, _lhs )
+ || !::cppu::enum2int( rhs, _rhs )
+ || !_lhs.getValueType().equals( m_enumType )
+ || !_rhs.getValueType().equals( m_enumType )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ return lhs < rhs;
+ }
+
+ private:
+ ::com::sun::star::uno::Type const m_enumType;
+ };
+
+ //==================================================================================================================
+ //= InterfacePredicateLess
+ //==================================================================================================================
+ class InterfacePredicateLess : public IKeyPredicateLess
+ {
+ public:
+ virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const
+ {
+ if ( ( _lhs.getValueTypeClass() != ::com::sun::star::uno::TypeClass_INTERFACE )
+ || ( _rhs.getValueTypeClass() != ::com::sun::star::uno::TypeClass_INTERFACE )
+ )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > lhs( _lhs, ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > rhs( _rhs, ::com::sun::star::uno::UNO_QUERY );
+ return lhs.get() < rhs.get();
+ }
+ };
+
+ //==================================================================================================================
+ //= getStandardLessPredicate
+ //==================================================================================================================
+ /** creates a default IKeyPredicateLess instance for the given UNO type
+ @param i_type
+ the type for which a predicate instance should be created
+ @param i_collator
+ specifies a collator instance to use, or <NULL/>. If <NULL/>, strings will be compared using the <code>&lt</code>
+ operator, otherwise the collator will be used. The parameter is ignored if <arg>i_type</arg> does not specify
+ the string type.
+ @return
+ a default implementation of IKeyPredicateLess, which is able to compare values of the given type. If no
+ such default implementation is known for the given type, then <NULL/> is returned.
+ */
+ ::std::auto_ptr< IKeyPredicateLess > COMPHELPER_DLLPUBLIC
+ getStandardLessPredicate(
+ ::com::sun::star::uno::Type const & i_type,
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > const & i_collator
+ );
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_ANYCOMPARE_HXX
diff --git a/comphelper/inc/comphelper/componentguard.hxx b/comphelper/inc/comphelper/componentguard.hxx
new file mode 100755
index 000000000000..820b901a5c55
--- /dev/null
+++ b/comphelper/inc/comphelper/componentguard.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 COMPHELPER_COMPONENTGUARD_HXX
+#define COMPHELPER_COMPONENTGUARD_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ComponentGuard
+ //==================================================================================================================
+ class ComponentGuard
+ {
+ public:
+ ComponentGuard( ::cppu::OWeakObject& i_component, ::cppu::OBroadcastHelper & i_broadcastHelper )
+ :m_aGuard( i_broadcastHelper.rMutex )
+ {
+ if ( i_broadcastHelper.bDisposed )
+ throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), &i_component );
+ }
+
+ ~ComponentGuard()
+ {
+ }
+
+ void clear() { m_aGuard.clear(); }
+ void reset() { m_aGuard.reset(); }
+
+ private:
+ ::osl::ResettableMutexGuard m_aGuard;
+ };
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
+
+#endif // COMPHELPER_COMPONENTGUARD_HXX
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index 15241cd72dd6..a73983517751 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -24,11 +24,11 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
#include "comphelper_module.hxx"
#include "comphelper/anytostring.hxx"
+#include "comphelper/anycompare.hxx"
#include "comphelper/componentbase.hxx"
#include "comphelper/componentcontext.hxx"
#include "comphelper/extract.hxx"
@@ -47,9 +47,7 @@
#include <rtl/ustrbuf.hxx>
#include <typelib/typedescription.hxx>
-#include <functional>
#include <map>
-#include <memory>
#include <boost/shared_ptr.hpp>
//........................................................................
@@ -79,26 +77,14 @@ namespace comphelper
using ::com::sun::star::beans::Pair;
using ::com::sun::star::uno::TypeClass;
using ::com::sun::star::uno::TypeClass_VOID;
- using ::com::sun::star::uno::TypeClass_CHAR;
- using ::com::sun::star::uno::TypeClass_BOOLEAN;
- using ::com::sun::star::uno::TypeClass_BYTE;
- using ::com::sun::star::uno::TypeClass_SHORT;
- using ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT;
- using ::com::sun::star::uno::TypeClass_LONG;
- using ::com::sun::star::uno::TypeClass_UNSIGNED_LONG;
- using ::com::sun::star::uno::TypeClass_HYPER;
- using ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER;
- using ::com::sun::star::uno::TypeClass_FLOAT;
- using ::com::sun::star::uno::TypeClass_DOUBLE;
- using ::com::sun::star::uno::TypeClass_STRING;
- using ::com::sun::star::uno::TypeClass_TYPE;
- using ::com::sun::star::uno::TypeClass_ENUM;
- using ::com::sun::star::uno::TypeClass_INTERFACE;
using ::com::sun::star::uno::TypeClass_UNKNOWN;
using ::com::sun::star::uno::TypeClass_ANY;
using ::com::sun::star::uno::TypeClass_EXCEPTION;
using ::com::sun::star::uno::TypeClass_STRUCT;
using ::com::sun::star::uno::TypeClass_UNION;
+ using ::com::sun::star::uno::TypeClass_FLOAT;
+ using ::com::sun::star::uno::TypeClass_DOUBLE;
+ using ::com::sun::star::uno::TypeClass_INTERFACE;
using ::com::sun::star::lang::XServiceInfo;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::container::XEnumeration;
@@ -108,136 +94,6 @@ namespace comphelper
/** === end UNO using === **/
//====================================================================
- //= IKeyPredicateLess
- //====================================================================
- class SAL_NO_VTABLE IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const = 0;
- virtual ~IKeyPredicateLess() {}
- };
-
- //====================================================================
- //= LessPredicateAdapter
- //====================================================================
- struct LessPredicateAdapter : public ::std::binary_function< Any, Any, bool >
- {
- LessPredicateAdapter( const IKeyPredicateLess& _predicate )
- :m_predicate( _predicate )
- {
- }
-
- bool operator()( const Any& _lhs, const Any& _rhs ) const
- {
- return m_predicate.isLess( _lhs, _rhs );
- }
-
- private:
- const IKeyPredicateLess& m_predicate;
-
- private:
- LessPredicateAdapter(); // never implemented
- };
-
- //====================================================================
- //= ScalarPredicateLess
- //====================================================================
- template< typename SCALAR >
- class ScalarPredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- SCALAR lhs(0), rhs(0);
- if ( !( _lhs >>= lhs )
- || !( _rhs >>= rhs )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs < rhs;
- }
- };
-
- //====================================================================
- //= StringPredicateLess
- //====================================================================
- class StringPredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- ::rtl::OUString lhs, rhs;
- if ( !( _lhs >>= lhs )
- || !( _rhs >>= rhs )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs < rhs;
- }
- };
-
- //====================================================================
- //= TypePredicateLess
- //====================================================================
- class TypePredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- Type lhs, rhs;
- if ( !( _lhs >>= lhs )
- || !( _rhs >>= rhs )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs.getTypeName() < rhs.getTypeName();
- }
- };
-
- //====================================================================
- //= EnumPredicateLess
- //====================================================================
- class EnumPredicateLess : public IKeyPredicateLess
- {
- public:
- EnumPredicateLess( const Type& _enumType )
- :m_enumType( _enumType )
- {
- }
-
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- sal_Int32 lhs(0), rhs(0);
- if ( !::cppu::enum2int( lhs, _lhs )
- || !::cppu::enum2int( rhs, _rhs )
- || !_lhs.getValueType().equals( m_enumType )
- || !_rhs.getValueType().equals( m_enumType )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
- return lhs < rhs;
- }
-
- private:
- const Type m_enumType;
- };
-
- //====================================================================
- //= InterfacePredicateLess
- //====================================================================
- class InterfacePredicateLess : public IKeyPredicateLess
- {
- public:
- virtual bool isLess( const Any& _lhs, const Any& _rhs ) const
- {
- if ( ( _lhs.getValueTypeClass() != TypeClass_INTERFACE )
- || ( _rhs.getValueTypeClass() != TypeClass_INTERFACE )
- )
- throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), NULL, 1 );
-
- Reference< XInterface > lhs( _lhs, UNO_QUERY );
- Reference< XInterface > rhs( _rhs, UNO_QUERY );
- return lhs.get() < rhs.get();
- }
- };
-
- //====================================================================
//= MapData
//====================================================================
class IMapModificationListener;
@@ -549,58 +405,9 @@ namespace comphelper
throw IllegalTypeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported value type." ) ), *this );
// create the comparator for the KeyType, and throw if the type is not supported
- TypeClass eKeyTypeClass = aKeyType.getTypeClass();
- ::std::auto_ptr< IKeyPredicateLess > pComparator;
- switch ( eKeyTypeClass )
- {
- case TypeClass_CHAR:
- pComparator.reset( new ScalarPredicateLess< sal_Unicode >() );
- break;
- case TypeClass_BOOLEAN:
- pComparator.reset( new ScalarPredicateLess< sal_Bool >() );
- break;
- case TypeClass_BYTE:
- pComparator.reset( new ScalarPredicateLess< sal_Int8 >() );
- break;
- case TypeClass_SHORT:
- pComparator.reset( new ScalarPredicateLess< sal_Int16 >() );
- break;
- case TypeClass_UNSIGNED_SHORT:
- pComparator.reset( new ScalarPredicateLess< sal_uInt16 >() );
- break;
- case TypeClass_LONG:
- pComparator.reset( new ScalarPredicateLess< sal_Int32 >() );
- break;
- case TypeClass_UNSIGNED_LONG:
- pComparator.reset( new ScalarPredicateLess< sal_uInt32 >() );
- break;
- case TypeClass_HYPER:
- pComparator.reset( new ScalarPredicateLess< sal_Int64 >() );
- break;
- case TypeClass_UNSIGNED_HYPER:
- pComparator.reset( new ScalarPredicateLess< sal_uInt64 >() );
- break;
- case TypeClass_FLOAT:
- pComparator.reset( new ScalarPredicateLess< float >() );
- break;
- case TypeClass_DOUBLE:
- pComparator.reset( new ScalarPredicateLess< double >() );
- break;
- case TypeClass_STRING:
- pComparator.reset( new StringPredicateLess() );
- break;
- case TypeClass_TYPE:
- pComparator.reset( new TypePredicateLess() );
- break;
- case TypeClass_ENUM:
- pComparator.reset( new EnumPredicateLess( aKeyType ) );
- break;
- case TypeClass_INTERFACE:
- pComparator.reset( new InterfacePredicateLess() );
- break;
- default:
+ ::std::auto_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, NULL ) );
+ if ( !pComparator.get() )
throw IllegalTypeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported key type." ) ), *this );
- }
// init members
m_aData.m_aKeyType = aKeyType;
diff --git a/comphelper/source/misc/anycompare.cxx b/comphelper/source/misc/anycompare.cxx
new file mode 100755
index 000000000000..a86174daf08e
--- /dev/null
+++ b/comphelper/source/misc/anycompare.cxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_comphelper.hxx"
+
+#include "comphelper/anycompare.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace comphelper
+{
+//......................................................................................................................
+
+ /** === 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::uno::TypeClass_CHAR;
+ using ::com::sun::star::uno::TypeClass_BOOLEAN;
+ using ::com::sun::star::uno::TypeClass_BYTE;
+ using ::com::sun::star::uno::TypeClass_SHORT;
+ using ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT;
+ using ::com::sun::star::uno::TypeClass_LONG;
+ using ::com::sun::star::uno::TypeClass_UNSIGNED_LONG;
+ using ::com::sun::star::uno::TypeClass_HYPER;
+ using ::com::sun::star::uno::TypeClass_UNSIGNED_HYPER;
+ using ::com::sun::star::uno::TypeClass_FLOAT;
+ using ::com::sun::star::uno::TypeClass_DOUBLE;
+ using ::com::sun::star::uno::TypeClass_STRING;
+ using ::com::sun::star::uno::TypeClass_TYPE;
+ using ::com::sun::star::uno::TypeClass_ENUM;
+ using ::com::sun::star::uno::TypeClass_INTERFACE;
+ using ::com::sun::star::i18n::XCollator;
+ /** === end UNO using === **/
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::std::auto_ptr< IKeyPredicateLess > getStandardLessPredicate( Type const & i_type, Reference< XCollator > const & i_collator )
+ {
+ ::std::auto_ptr< IKeyPredicateLess > pComparator;
+ switch ( i_type.getTypeClass() )
+ {
+ case TypeClass_CHAR:
+ pComparator.reset( new ScalarPredicateLess< sal_Unicode >() );
+ break;
+ case TypeClass_BOOLEAN:
+ pComparator.reset( new ScalarPredicateLess< sal_Bool >() );
+ break;
+ case TypeClass_BYTE:
+ pComparator.reset( new ScalarPredicateLess< sal_Int8 >() );
+ break;
+ case TypeClass_SHORT:
+ pComparator.reset( new ScalarPredicateLess< sal_Int16 >() );
+ break;
+ case TypeClass_UNSIGNED_SHORT:
+ pComparator.reset( new ScalarPredicateLess< sal_uInt16 >() );
+ break;
+ case TypeClass_LONG:
+ pComparator.reset( new ScalarPredicateLess< sal_Int32 >() );
+ break;
+ case TypeClass_UNSIGNED_LONG:
+ pComparator.reset( new ScalarPredicateLess< sal_uInt32 >() );
+ break;
+ case TypeClass_HYPER:
+ pComparator.reset( new ScalarPredicateLess< sal_Int64 >() );
+ break;
+ case TypeClass_UNSIGNED_HYPER:
+ pComparator.reset( new ScalarPredicateLess< sal_uInt64 >() );
+ break;
+ case TypeClass_FLOAT:
+ pComparator.reset( new ScalarPredicateLess< float >() );
+ break;
+ case TypeClass_DOUBLE:
+ pComparator.reset( new ScalarPredicateLess< double >() );
+ break;
+ case TypeClass_STRING:
+ if ( i_collator.is() )
+ pComparator.reset( new StringCollationPredicateLess( i_collator ) );
+ else
+ pComparator.reset( new StringPredicateLess() );
+ break;
+ case TypeClass_TYPE:
+ pComparator.reset( new TypePredicateLess() );
+ break;
+ case TypeClass_ENUM:
+ pComparator.reset( new EnumPredicateLess( i_type ) );
+ break;
+ case TypeClass_INTERFACE:
+ pComparator.reset( new InterfacePredicateLess() );
+ break;
+ default:
+ break;
+ }
+ return pComparator;
+ }
+
+//......................................................................................................................
+} // namespace comphelper
+//......................................................................................................................
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 933a414d331c..2548643c7ce1 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1993,45 +1993,83 @@ rtl::Reference< ChildAccess > Access::getUnmodifiedChild(
}
rtl::Reference< ChildAccess > Access::getSubChild(rtl::OUString const & path) {
- rtl::OUString name;
- bool setElement;
- rtl::OUString templateName;
- sal_Int32 i = Data::parseSegment(
- path, 0, &name, &setElement, &templateName);
- if (i == -1 || (i != path.getLength() && path[i] != '/')) {
- return rtl::Reference< ChildAccess >();
- }
- rtl::Reference< ChildAccess > child(getChild(name));
- if (!child.is()) {
- return rtl::Reference< ChildAccess >();
- }
- if (setElement) {
- rtl::Reference< Node > p(getNode());
- switch (p->kind()) {
- case Node::KIND_LOCALIZED_PROPERTY:
- if (!Components::allLocales(getRootAccess()->getLocale()) ||
- templateName.getLength() != 0)
- {
+ sal_Int32 i = 0;
+ // For backwards compatibility, allow absolute paths where meaningful:
+ if (path.getLength() != 0 && path[0] == '/') {
+ ++i;
+ if (!getRootAccess().is()) {
+ return rtl::Reference< ChildAccess >();
+ }
+ Path abs(getAbsolutePath());
+ for (Path::iterator j(abs.begin()); j != abs.end(); ++j) {
+ rtl::OUString name1;
+ bool setElement1;
+ rtl::OUString templateName1;
+ i = Data::parseSegment(
+ path, i, &name1, &setElement1, &templateName1);
+ if (i == -1 || (i != path.getLength() && path[i] != '/')) {
return rtl::Reference< ChildAccess >();
}
- break;
- case Node::KIND_SET:
- if (templateName.getLength() != 0 &&
- !dynamic_cast< SetNode * >(p.get())->isValidTemplate(
- templateName))
+ rtl::OUString name2;
+ bool setElement2;
+ rtl::OUString templateName2;
+ Data::parseSegment(*j, 0, &name2, &setElement2, &templateName2);
+ if (name1 != name2 || setElement1 != setElement2 ||
+ (setElement1 &&
+ !Data::equalTemplateNames(templateName1, templateName2)))
{
return rtl::Reference< ChildAccess >();
}
- break;
- default:
+ if (i != path.getLength()) {
+ ++i;
+ }
+ }
+ }
+ for (rtl::Reference< Access > parent(this);;) {
+ rtl::OUString name;
+ bool setElement;
+ rtl::OUString templateName;
+ i = Data::parseSegment(path, i, &name, &setElement, &templateName);
+ if (i == -1 || (i != path.getLength() && path[i] != '/')) {
return rtl::Reference< ChildAccess >();
}
+ rtl::Reference< ChildAccess > child(parent->getChild(name));
+ if (!child.is()) {
+ return rtl::Reference< ChildAccess >();
+ }
+ if (setElement) {
+ rtl::Reference< Node > p(parent->getNode());
+ switch (p->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (!Components::allLocales(getRootAccess()->getLocale()) ||
+ templateName.getLength() != 0)
+ {
+ return rtl::Reference< ChildAccess >();
+ }
+ break;
+ case Node::KIND_SET:
+ if (templateName.getLength() != 0 &&
+ !dynamic_cast< SetNode * >(p.get())->isValidTemplate(
+ templateName))
+ {
+ return rtl::Reference< ChildAccess >();
+ }
+ break;
+ default:
+ return rtl::Reference< ChildAccess >();
+ }
+ }
+ // For backwards compatibility, ignore a final slash after non-value
+ // nodes:
+ if (child->isValue()) {
+ return i == path.getLength()
+ ? child : rtl::Reference< ChildAccess >();
+ } else if (i >= path.getLength() - 1) {
+ return child;
+ }
+ ++i;
+ parent = child.get();
}
- // For backwards compatibility, ignore a final slash after non-value nodes:
- return child->isValue()
- ? (i == path.getLength() ? child : rtl::Reference< ChildAccess >())
- : (i >= path.getLength() - 1
- ? child : child->getSubChild(path.copy(i + 1)));
}
bool Access::setChildProperty(
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 1a9575bb6726..dc5d08cb4e08 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -1099,17 +1099,25 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) {
}
break;
case OPERATION_REMOVE:
- // Ignore removal of unknown members, members finalized in a lower
- // layer, and members made mandatory in this or a lower layer:
- if (i != set->getMembers().end() && !state_.top().locked &&
- finalizedLayer >= valueParser_.getLayer() &&
- mandatoryLayer > valueParser_.getLayer())
{
- set->getMembers().erase(i);
+ // Ignore removal of unknown members, members finalized in a lower
+ // layer, and members made mandatory in this or a lower layer;
+ // forget about user-layer removals that no longer remove anything
+ // (so that paired additions/removals in the user layer do not grow
+ // registrymodifications.xcu unbounded):
+ bool known = i != set->getMembers().end();
+ if (known && !state_.top().locked &&
+ finalizedLayer >= valueParser_.getLayer() &&
+ mandatoryLayer > valueParser_.getLayer())
+ {
+ set->getMembers().erase(i);
+ }
+ state_.push(State(true));
+ if (known) {
+ recordModification(false);
+ }
+ break;
}
- state_.push(State(true));
- recordModification(false);
- break;
}
}
diff --git a/configure.in b/configure.in
index 92add6148851..eca0540550a5 100644
--- a/configure.in
+++ b/configure.in
@@ -4657,6 +4657,7 @@ if test -n "$with_system_icu" -o -n "$with_system_libs" && \
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([for unicode/rbbi.h])
AC_TRY_CPP(unicode/rbbi.h, AC_MSG_RESULT([checked.]), AC_MSG_ERROR([icu headers not found.]))
+ AC_LANG_POP([C++])
AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
if test -z "$SYSTEM_GENBRK"; then
AC_MSG_ERROR([\"genbrk\" not found in \$PATH, install the icu development tool \"genbrk"\])
@@ -4669,18 +4670,20 @@ if test -n "$with_system_icu" -o -n "$with_system_libs" && \
if test -z "$SYSTEM_GENCMN"; then
AC_MSG_ERROR([\"gencmn\" not found in \$PATH, install the icu development tool \"gencmn"\])
fi
+
+ AC_PATH_PROG( ICUCONFIG, icu-config)
AC_MSG_CHECKING([ICU version])
- AC_TRY_RUN([
-#include <unicode/uversion.h>
+ ICU_VERSION=`$ICUCONFIG --version`
+ ICU_MAJOR=`$ICUCONFIG --version | cut -d"." -f1`
+ ICU_MINOR=`$ICUCONFIG --version | cut -d"." -f2`
+ ICU_MICRO=`$ICUCONFIG --version | cut -d"." -f3`
+
+ if test "$ICU_MAJOR" -ge "4"; then
+ AC_MSG_RESULT([OK])
+ else
+ AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
+ fi
-int main(int argc, char **argv) {
- if(U_ICU_VERSION_MAJOR_NUM < 4)
- return 1;
- else
- return 0;
-}
- ], [AC_MSG_RESULT(OK)], [AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])])
- AC_LANG_POP([C++])
else
AC_MSG_RESULT([internal])
SYSTEM_ICU=NO
@@ -4690,6 +4693,9 @@ AC_SUBST(SYSTEM_ICU)
AC_SUBST(SYSTEM_GENBRK)
AC_SUBST(SYSTEM_GENCCODE)
AC_SUBST(SYSTEM_GENCMN)
+AC_SUBST(ICU_MAJOR)
+AC_SUBST(ICU_MINOR)
+AC_SUBST(ICU_MICRO)
dnl ===================================================================
dnl Graphite
diff --git a/connectivity/prj/build.lst b/connectivity/prj/build.lst
index 8d16197961fa..509b61cc6f9a 100644
--- a/connectivity/prj/build.lst
+++ b/connectivity/prj/build.lst
@@ -1,4 +1,4 @@
-cn connectivity : shell l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss LIBXSLT:libxslt NULL
+cn connectivity : shell L10N:l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss LIBXSLT:libxslt NULL
cn connectivity usr1 - all cn_mkout NULL
cn connectivity\inc nmake - all cn_inc NULL
cn connectivity\com\sun\star\sdbcx\comp\hsqldb nmake - all cn_jhsqldbdb cn_hsqldb cn_inc NULL
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index 5b29637b581b..bb2869ca037f 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -28,6 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_cppu.hxx"
+#include <cstddef>
+#include <stdio.h>
+
#include "cppu/macros.hxx"
#include "osl/mutex.hxx"
@@ -350,8 +353,6 @@ sal_Bool SAL_CALL uno_type_isAssignableFromData(
#if OSL_DEBUG_LEVEL > 1
-#include <stdio.h>
-
#if defined( SAL_W32)
#pragma pack(push, 8)
#elif defined(SAL_OS2)
@@ -364,12 +365,12 @@ sal_Bool SAL_CALL uno_type_isAssignableFromData(
#define MAX_ALIGNMENT_4
#endif
-#define OFFSET_OF( s, m ) ((sal_Size)((char *)&((s *)16)->m -16))
+#define OFFSET_OF( s, m ) reinterpret_cast< std::size_t >((char *)&((s *)16)->m -16)
#define BINTEST_VERIFY( c ) \
- if (! (c)) { fprintf( stderr, "### binary compatibility test failed: " #c " [line %d]!!!\n", __LINE__ ); abort(); }
+ if (! (c)) { fprintf( stderr, "### binary compatibility test failed: %s [line %d]!!!\n", #c, __LINE__ ); abort(); }
#define BINTEST_VERIFYOFFSET( s, m, n ) \
- if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %d instead of expected %d!!!\n", OFFSET_OF(s, m), n ); abort(); }
+ if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %" SAL_PRI_SIZET "u instead of expected %d!!!\n", OFFSET_OF(s, m), n ); abort(); }
#if OSL_DEBUG_LEVEL > 1
#if defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD)) && (defined(INTEL) || defined(POWERPC) || defined(X86_64) || defined(S390))
diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx
index e45fb3c3784d..c546cdadedfc 100644
--- a/cpputools/source/unoexe/unoexe.cxx
+++ b/cpputools/source/unoexe/unoexe.cxx
@@ -275,23 +275,14 @@ void createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.comp.io.Connector") ),
xSF, Reference< XRegistryKey >() ) ) );
- // iiop bridge
- xSet->insert( makeAny( loadSharedLibComponentFactory(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "remotebridge.uno" SAL_DLLEXTENSION) ),
- OUString(),
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.remotebridges."
- "Bridge.various") ),
- xSF, Reference< XRegistryKey >() ) ) );
// bridge factory
xSet->insert( makeAny( loadSharedLibComponentFactory(
OUString( RTL_CONSTASCII_USTRINGPARAM(
- "bridgefac.uno" SAL_DLLEXTENSION) ),
+ "binaryurp.uno" SAL_DLLEXTENSION) ),
OUString(),
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.remotebridges."
- "BridgeFactory") ),
+ OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.bridge.BridgeFactory") ),
xSF, Reference< XRegistryKey >() ) ) );
}
s_bSet = sal_True;
diff --git a/crashrep/prj/build.lst b/crashrep/prj/build.lst
index ef1c85cc1c62..6e4b552c6585 100755
--- a/crashrep/prj/build.lst
+++ b/crashrep/prj/build.lst
@@ -1,4 +1,4 @@
-cr crashrep : l10n sal sysui SO:tools shell NULL
+cr crashrep : L10N:l10n sal sysui SO:tools shell NULL
cr crashrep usr1 - all cr_mkout NULL
cr crashrep\source\all nmake - all cr_sresource NULL
cr crashrep\source\unx nmake - u cr_sunx NULL
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 359d4417fae1..1da522170ab2 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1666,6 +1666,15 @@ SvxConfigPage::SvxConfigPage(
aDescriptionField.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() );
aDescriptionField.SetAutoScroll( sal_True );
aDescriptionField.EnableCursor( sal_False );
+
+ aMoveUpButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_UP)));
+ aMoveDownButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_DOWN)));
+ aMoveUpButton.SetAccessibleRelationMemberOf(&aContentsSeparator);
+ aMoveDownButton.SetAccessibleRelationMemberOf(&aContentsSeparator);
+ aNewTopLevelButton.SetAccessibleRelationMemberOf(&aTopLevelSeparator);
+ aModifyTopLevelButton.SetAccessibleRelationMemberOf(&aTopLevelSeparator);
+ aAddCommandsButton.SetAccessibleRelationMemberOf(&aContentsSeparator);
+ aModifyCommandButton.SetAccessibleRelationMemberOf(&aContentsSeparator);
}
SvxConfigPage::~SvxConfigPage()
@@ -2924,6 +2933,9 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog(
LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) );
aMoveDownButton.SetClickHdl (
LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) );
+
+ aMoveUpButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_UP)));
+ aMoveDownButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_DOWN)));
}
IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit)
diff --git a/cui/source/customize/cfg.hrc b/cui/source/customize/cfg.hrc
index 74d7804dce8e..302f226623a3 100644
--- a/cui/source/customize/cfg.hrc
+++ b/cui/source/customize/cfg.hrc
@@ -103,3 +103,8 @@
#define EDT_ADDR (121 + CFG_OFFSET)
#define MD_BTN_OK (122 + CFG_OFFSET)
#define FI_INFO (123 + CFG_OFFSET)
+
+//IAccessibility2 Implementation 2009-----
+#define BUTTON_STR_UP (130 + CFG_OFFSET)
+#define BUTTON_STR_DOWN (131 + CFG_OFFSET)
+//-----IAccessibility2 Implementation 2009
diff --git a/cui/source/customize/cfg.src b/cui/source/customize/cfg.src
index 743aa7009fbc..66ac237a523b 100644
--- a/cui/source/customize/cfg.src
+++ b/cui/source/customize/cfg.src
@@ -888,4 +888,12 @@ String RID_SVXSTR_RENAME_TOOLBAR
Text [ en-US ] = "Rename Toolbar";
};
+String BUTTON_STR_UP
+{
+ Text [ en-US ] = "Up";
+};
+String BUTTON_STR_DOWN
+{
+ Text [ en-US ] = "Down";
+};
diff --git a/cui/source/dialogs/commonlingui.cxx b/cui/source/dialogs/commonlingui.cxx
index 327ffd4cbc17..115630b86b68 100644
--- a/cui/source/dialogs/commonlingui.cxx
+++ b/cui/source/dialogs/commonlingui.cxx
@@ -109,6 +109,7 @@ SvxCommonLinguisticControl::SvxCommonLinguisticControl( ModalDialog* _pParent )
SetType( WINDOW_TABPAGE );
#endif
+ aAktWord.SetAccessibleName(aWordText.GetText());
SetPosSizePixel( Point( 0, 0 ), _pParent->GetOutputSizePixel() );
Show();
}
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index fcc4f002703d..98600eb765ff 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -54,6 +54,9 @@
#include <sfx2/sfxuno.hxx>
#include "dialmgr.hxx"
#include "gallery.hrc"
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+
// --------------
// - Namespaces -
@@ -662,6 +665,11 @@ TPGalleryThemeGeneral::TPGalleryThemeGeneral( Window* pParent, const SfxItemSet&
aFtMSShowChangeDate ( this, CUI_RES( FT_MS_SHOW_CHANGEDATE ) )
{
FreeResource();
+
+ String aAccName(SVX_RES(RID_SVXSTR_GALLERY_THEMENAME));
+ aEdtMSName.SetAccessibleName(aAccName);
+ aFiMSImage.SetAccessibleName(aAccName);
+ aEdtMSName.SetAccessibleRelationLabeledBy( &aFiMSImage );
}
// ------------------------------------------------------------------------
@@ -674,8 +682,8 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
String aOutStr( String::CreateFromInt32( pThm->GetObjectCount() ) );
String aObjStr( CUI_RES( RID_SVXSTR_GALLERYPROPS_OBJECT ) );
String aAccess;
- String aType( CUI_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) );
- sal_Bool bReadOnly = pThm->IsReadOnly() && !pThm->IsImported();
+ String aType( SVX_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) );
+ sal_Bool bReadOnly = pThm->IsReadOnly() && !pThm->IsImported();
aEdtMSName.SetHelpId( HID_GALLERY_EDIT_MSNAME );
aEdtMSName.SetText( pThm->GetName() );
@@ -748,13 +756,13 @@ SfxTabPage* TPGalleryThemeGeneral::Create( Window* pParent, const SfxItemSet& rS
TPGalleryThemeProperties::TPGalleryThemeProperties( Window* pWindow, const SfxItemSet& rSet ) :
SfxTabPage ( pWindow, CUI_RES( RID_SVXTABPAGE_GALLERYTHEME_FILES ), rSet ),
+ aFtFileType ( this, CUI_RES(FT_FILETYPE ) ),
+ aCbbFileType ( this, CUI_RES(CBB_FILETYPE ) ),
+ aLbxFound ( this, CUI_RES(LBX_FOUND ) ),
aBtnSearch ( this, CUI_RES(BTN_SEARCH ) ),
aBtnTake ( this, CUI_RES(BTN_TAKE ) ),
aBtnTakeAll ( this, CUI_RES(BTN_TAKEALL ) ),
aCbxPreview ( this, CUI_RES(CBX_PREVIEW ) ),
- aCbbFileType ( this, CUI_RES(CBB_FILETYPE ) ),
- aLbxFound ( this, CUI_RES(LBX_FOUND ) ),
- aFtFileType ( this, CUI_RES(FT_FILETYPE ) ),
aWndPreview ( this, CUI_RES( WND_BRSPRV ) ),
nCurFilterPos (0),
nFirstExtFilterPos (0),
@@ -766,6 +774,9 @@ TPGalleryThemeProperties::TPGalleryThemeProperties( Window* pWindow, const SfxIt
FreeResource();
xDialogListener->SetDialogClosedLink( LINK( this, TPGalleryThemeProperties, DialogClosedHdl ) );
+ aLbxFound.SetAccessibleName(String(SVX_RES(RID_SVXSTR_GALLERY_FILESFOUND)));
+ aWndPreview.SetAccessibleName(aCbxPreview.GetText());
+ aLbxFound.SetAccessibleRelationLabeledBy(&aLbxFound);
}
// ------------------------------------------------------------------------
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 572cb56c4512..eea084548b2b 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -369,10 +369,10 @@ GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId,
mfScaleY ( 0.0 ),
maSizePixel ( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ),
maPreview ( this, CUI_RES( CTL_PREVIEW ) ),
- maFlParameter ( this, CUI_RES( FL_PARAMETER ) ),
maBtnOK ( this, CUI_RES( BTN_OK ) ),
maBtnCancel ( this, CUI_RES( BTN_CANCEL ) ),
- maBtnHelp ( this, CUI_RES( BTN_HELP ) )
+ maBtnHelp ( this, CUI_RES( BTN_HELP ) ),
+ maFlParameter ( this, CUI_RES( FL_PARAMETER ) )
{
const Size aPreviewSize( maPreview.GetOutputSizePixel() );
Size aGrfSize( maSizePixel );
@@ -468,6 +468,12 @@ GraphicFilterMosaic::GraphicFilterMosaic( Window* pParent, const Graphic& rGraph
maCbxEdges.SetToggleHdl( GetModifyHdl() );
maMtrWidth.GrabFocus();
+
+ maFtWidth.SetAccessibleRelationMemberOf(&maFlParameter);
+ maMtrWidth.SetAccessibleRelationMemberOf(&maFlParameter);
+ maFtHeight.SetAccessibleRelationMemberOf(&maFlParameter);
+ maMtrHeight.SetAccessibleRelationMemberOf(&maFlParameter);
+ maCbxEdges.SetAccessibleRelationMemberOf(&maFlParameter);
}
// -----------------------------------------------------------------------------
diff --git a/cui/source/dialogs/gallery.src b/cui/source/dialogs/gallery.src
index f8d035528c71..b1c53e65c706 100644
--- a/cui/source/dialogs/gallery.src
+++ b/cui/source/dialogs/gallery.src
@@ -448,10 +448,6 @@ String RID_SVXSTR_GALLERYPROPS_OBJECT
{
Text [ en-US ] = "Object;Objects" ;
};
-String RID_SVXSTR_GALLERYPROPS_GALTHEME
-{
- Text [ en-US ] = "Gallery Theme" ;
-};
String RID_SVXSTR_GALLERY_READONLY
{
Text [ en-US ] = " (read-only)" ;
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 483f36a9e199..cc0bfdd4522f 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -142,6 +142,9 @@ SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( Window *pParent, const SfxItemSet&
maBtCreate.SetClickHdl ( LINK ( this, SvxHyperlinkNewDocTp, ClickNewHdl_Impl ) );
+ maBtCreate.SetAccessibleRelationMemberOf( &maGrpNewDoc );
+ maBtCreate.SetAccessibleRelationLabeledBy( &maFtPath );
+
FillDocumentList ();
}
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 526a44277e06..ab87245f293a 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -90,6 +90,10 @@ SvxHyperlinkDocTp::SvxHyperlinkDocTp ( Window *pParent, const SfxItemSet& rItemS
maCbbPath.SetLoseFocusHdl( LINK ( this, SvxHyperlinkDocTp, LostFocusPathHdl_Impl ) );
+ maBtBrowse.SetAccessibleRelationMemberOf( &maGrpTarget );
+ maBtBrowse.SetAccessibleRelationLabeledBy( &maFtTarget );
+ maBtFileopen.SetAccessibleRelationMemberOf( &maGrpDocument );
+ maBtFileopen.SetAccessibleRelationLabeledBy( &maFtPath );
maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkDocTp, TimeoutHdl_Impl ) );
}
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 9aefda6b44bb..9ce0de2ea801 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -61,13 +61,13 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( Window *pParent,
maRbtLinktypTelnet ( this, CUI_RES (RB_LINKTYP_TELNET) ),
maFtTarget ( this, CUI_RES (FT_TARGET_HTML) ),
maCbbTarget ( this, INET_PROT_HTTP ),
+ maBtBrowse ( this, CUI_RES (BTN_BROWSE) ),
maFtLogin ( this, CUI_RES (FT_LOGIN) ),
maEdLogin ( this, CUI_RES (ED_LOGIN) ),
+ maBtTarget ( this, CUI_RES (BTN_TARGET) ),
maFtPassword ( this, CUI_RES (FT_PASSWD) ),
maEdPassword ( this, CUI_RES (ED_PASSWD) ),
maCbAnonymous ( this, CUI_RES (CBX_ANONYMOUS) ),
- maBtBrowse ( this, CUI_RES (BTN_BROWSE) ),
- maBtTarget ( this, CUI_RES (BTN_TARGET) ),
mbMarkWndOpen ( sal_False )
{
// Set HC bitmaps and display display of bitmap names.
@@ -124,6 +124,13 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( Window *pParent,
maCbbTarget.SetLoseFocusHdl ( LINK ( this, SvxHyperlinkInternetTp, LostFocusTargetHdl_Impl ) );
maCbbTarget.SetModifyHdl ( LINK ( this, SvxHyperlinkInternetTp, ModifiedTargetHdl_Impl ) );
maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkInternetTp, TimeoutHdl_Impl ) );
+
+ maFtTarget.SetAccessibleRelationMemberOf( &maGrpLinkTyp );
+ maCbbTarget.SetAccessibleRelationMemberOf( &maGrpLinkTyp );
+ maBtTarget.SetAccessibleRelationMemberOf( &maGrpLinkTyp );
+ maBtTarget.SetAccessibleRelationLabeledBy( &maFtTarget );
+ maBtBrowse.SetAccessibleRelationMemberOf( &maGrpLinkTyp );
+ maBtBrowse.SetAccessibleRelationLabeledBy( &maFtTarget );
}
SvxHyperlinkInternetTp::~SvxHyperlinkInternetTp ()
diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx
index a7d34283face..bb856f596566 100644
--- a/cui/source/dialogs/hlmailtp.cxx
+++ b/cui/source/dialogs/hlmailtp.cxx
@@ -89,6 +89,9 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp ( Window *pParent, const SfxItemSet& rIte
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) )
maBtAdrBook.Hide();
+
+ maBtAdrBook.SetAccessibleRelationMemberOf( &maGrpMailNews );
+ maBtAdrBook.SetAccessibleRelationLabeledBy( &maFtReceiver );
}
SvxHyperlinkMailTp::~SvxHyperlinkMailTp ()
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index 9898eff9f36b..fc8e94e52885 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -148,6 +148,9 @@ SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd( SvxHyperlinkTabPageBase *pParent )
maLbTree.SetStyle( maLbTree.GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
WB_HASBUTTONS | //WB_HASLINESATROOT |
WB_HSCROLL | WB_HASBUTTONSATROOT );
+
+ maLbTree.SetAccessibleName(String(CUI_RES(STR_MARK_TREE)));
+
}
SvxHlinkDlgMarkWnd::~SvxHlinkDlgMarkWnd()
diff --git a/cui/source/dialogs/hlmarkwn.hrc b/cui/source/dialogs/hlmarkwn.hrc
index 1ac36dafa099..5fba2376eaf2 100644
--- a/cui/source/dialogs/hlmarkwn.hrc
+++ b/cui/source/dialogs/hlmarkwn.hrc
@@ -28,6 +28,9 @@
#define BT_APPLY 1
#define BT_CLOSE 2
#define TLB_MARK 3
+// IAccessibility2 implementation 2009. ------
+#define STR_MARK_TREE 5000
+// ------ IAccessibility2 implementation 2009.
//#define HYPERLINK_BMP_EXPAND 301
//#define HYPERLINK_BMP_COLLAPSE 302
diff --git a/cui/source/dialogs/hlmarkwn.src b/cui/source/dialogs/hlmarkwn.src
index 396e8cd573e0..450afc36758f 100644
--- a/cui/source/dialogs/hlmarkwn.src
+++ b/cui/source/dialogs/hlmarkwn.src
@@ -77,19 +77,8 @@ String RID_SVXSTR_HYPDLG_ERR_LERR_DOCNOTOPEN
Text [ en-US ] = "Couldn't open the document." ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String STR_MARK_TREE
+{
+ Text [ en-US ] = "Mark Tree" ;
+};
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 28bf46ce241e..cd8f1a3c123f 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -356,6 +356,9 @@ void SvxHyperlinkTabPageBase::InitStdControls ()
mpBtScript->SetModeImage( Image( ResId( IMG_SCRIPT_HC, *m_pResMgr ) ), BMP_COLOR_HIGHCONTRAST );
mpBtScript->EnableTextDisplay (sal_False);
+
+ mpBtScript->SetAccessibleRelationMemberOf( mpGrpMore );
+ mpBtScript->SetAccessibleRelationLabeledBy( mpFtForm );
}
mbStdControlsInit = sal_True;
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index 0173eb22d75d..0923f322e154 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -206,11 +206,11 @@ SvInsertOleDlg::SvInsertOleDlg
: InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OLEOBJECT ), xStorage ),
aRbNewObject( this, CUI_RES( RB_NEW_OBJECT ) ),
aRbObjectFromfile( this, CUI_RES( RB_OBJECT_FROMFILE ) ),
+ aGbObject( this, CUI_RES( GB_OBJECT ) ),
aLbObjecttype( this, CUI_RES( LB_OBJECTTYPE ) ),
aEdFilepath( this, CUI_RES( ED_FILEPATH ) ),
aBtnFilepath( this, CUI_RES( BTN_FILEPATH ) ),
aCbFilelink( this, CUI_RES( CB_FILELINK ) ),
- aGbObject( this, CUI_RES( GB_OBJECT ) ),
aOKButton1( this, CUI_RES( 1 ) ),
aCancelButton1( this, CUI_RES( 1 ) ),
aHelpButton1( this, CUI_RES( 1 ) ),
@@ -226,6 +226,7 @@ SvInsertOleDlg::SvInsertOleDlg
aRbObjectFromfile.SetClickHdl( aLink );
aRbNewObject.Check( sal_True );
RadioHdl( NULL );
+ aBtnFilepath.SetAccessibleRelationMemberOf(&aGbObject);
}
short SvInsertOleDlg::Execute()
@@ -449,11 +450,11 @@ IMPL_LINK( SvInsertPlugInDialog, BrowseHdl, PushButton *, EMPTYARG )
SvInsertPlugInDialog::SvInsertPlugInDialog( Window* pParent, const uno::Reference < embed::XStorage >& xStorage )
: InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OBJECT_PLUGIN ), xStorage ),
+ aGbFileurl( this, CUI_RES( GB_FILEURL ) ),
aEdFileurl( this, CUI_RES( ED_FILEURL ) ),
aBtnFileurl( this, CUI_RES( BTN_FILEURL ) ),
- aGbFileurl( this, CUI_RES( GB_FILEURL ) ),
- aEdPluginsOptions( this, CUI_RES( ED_PLUGINS_OPTIONS ) ),
aGbPluginsOptions( this, CUI_RES( GB_PLUGINS_OPTIONS ) ),
+ aEdPluginsOptions( this, CUI_RES( ED_PLUGINS_OPTIONS ) ),
aOKButton1( this, CUI_RES( 1 ) ),
aCancelButton1( this, CUI_RES( 1 ) ),
aHelpButton1( this, CUI_RES( 1 ) ),
@@ -739,22 +740,23 @@ SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( Window *pParent,
, aFTURL ( this, CUI_RES( FT_URL ) )
, aEDURL ( this, CUI_RES( ED_URL ) )
, aBTOpen ( this, CUI_RES(BT_FILEOPEN ) )
+
+ , aFLScrolling ( this, CUI_RES( GB_SCROLLING ) )
, aRBScrollingOn ( this, CUI_RES( RB_SCROLLINGON ) )
, aRBScrollingOff ( this, CUI_RES( RB_SCROLLINGOFF ) )
, aRBScrollingAuto ( this, CUI_RES( RB_SCROLLINGAUTO ) )
- , aFLScrolling ( this, CUI_RES( GB_SCROLLING ) )
, aFLSepLeft( this, CUI_RES( FL_SEP_LEFT ) )
+ , aFLFrameBorder( this, CUI_RES( GB_BORDER ) )
, aRBFrameBorderOn ( this, CUI_RES( RB_FRMBORDER_ON ) )
, aRBFrameBorderOff ( this, CUI_RES( RB_FRMBORDER_OFF ) )
- , aFLFrameBorder( this, CUI_RES( GB_BORDER ) )
, aFLSepRight( this, CUI_RES( FL_SEP_RIGHT ) )
+ , aFLMargin( this, CUI_RES( GB_MARGIN ) )
, aFTMarginWidth ( this, CUI_RES( FT_MARGINWIDTH ) )
, aNMMarginWidth ( this, CUI_RES( NM_MARGINWIDTH ) )
, aCBMarginWidthDefault( this, CUI_RES( CB_MARGINHEIGHTDEFAULT ) )
, aFTMarginHeight ( this, CUI_RES( FT_MARGINHEIGHT ) )
, aNMMarginHeight ( this, CUI_RES( NM_MARGINHEIGHT ) )
, aCBMarginHeightDefault( this, CUI_RES( CB_MARGINHEIGHTDEFAULT ) )
- , aFLMargin( this, CUI_RES( GB_MARGIN ) )
, aOKButton1( this, CUI_RES( 1 ) )
, aCancelButton1( this, CUI_RES( 1 ) )
, aHelpButton1( this, CUI_RES( 1 ) )
@@ -783,22 +785,25 @@ SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( Window *pParent, con
, aFTURL ( this, CUI_RES( FT_URL ) )
, aEDURL ( this, CUI_RES( ED_URL ) )
, aBTOpen ( this, CUI_RES(BT_FILEOPEN ) )
+
+ , aFLScrolling ( this, CUI_RES( GB_SCROLLING ) )
, aRBScrollingOn ( this, CUI_RES( RB_SCROLLINGON ) )
, aRBScrollingOff ( this, CUI_RES( RB_SCROLLINGOFF ) )
, aRBScrollingAuto ( this, CUI_RES( RB_SCROLLINGAUTO ) )
- , aFLScrolling ( this, CUI_RES( GB_SCROLLING ) )
+
, aFLSepLeft( this, CUI_RES( FL_SEP_LEFT ) )
+ , aFLFrameBorder( this, CUI_RES( GB_BORDER ) )
, aRBFrameBorderOn ( this, CUI_RES( RB_FRMBORDER_ON ) )
, aRBFrameBorderOff ( this, CUI_RES( RB_FRMBORDER_OFF ) )
- , aFLFrameBorder( this, CUI_RES( GB_BORDER ) )
+
, aFLSepRight( this, CUI_RES( FL_SEP_RIGHT ) )
+ , aFLMargin( this, CUI_RES( GB_MARGIN ) )
, aFTMarginWidth ( this, CUI_RES( FT_MARGINWIDTH ) )
, aNMMarginWidth ( this, CUI_RES( NM_MARGINWIDTH ) )
, aCBMarginWidthDefault( this, CUI_RES( CB_MARGINHEIGHTDEFAULT ) )
, aFTMarginHeight ( this, CUI_RES( FT_MARGINHEIGHT ) )
, aNMMarginHeight ( this, CUI_RES( NM_MARGINHEIGHT ) )
, aCBMarginHeightDefault( this, CUI_RES( CB_MARGINHEIGHTDEFAULT ) )
- , aFLMargin( this, CUI_RES( GB_MARGIN ) )
, aOKButton1( this, CUI_RES( 1 ) )
, aCancelButton1( this, CUI_RES( 1 ) )
, aHelpButton1( this, CUI_RES( 1 ) )
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 202e50134c9a..a991974bd914 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -80,21 +80,22 @@ SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, LinkManager* pMgr, sal_Bool bH
aFtLinks( this, CUI_RES( FT_LINKS ) ),
aFtType( this, CUI_RES( FT_TYPE ) ),
aFtStatus( this, CUI_RES( FT_STATUS ) ),
- aCancelButton1( this, CUI_RES( 1 ) ),
- aHelpButton1( this, CUI_RES( 1 ) ),
- aPbUpdateNow( this, CUI_RES( PB_UPDATE_NOW ) ),
- aPbOpenSource( this, CUI_RES( PB_OPEN_SOURCE ) ),
- aPbChangeSource( this, CUI_RES( PB_CHANGE_SOURCE ) ),
- aPbBreakLink( this, CUI_RES( PB_BREAK_LINK ) ),
+ aTbLinks( this, CUI_RES(TB_LINKS ) ),
aFtFiles2( this, CUI_RES( FT_FILES2 ) ),
+ aFtFullFileName( this, CUI_RES( FT_FULL_FILE_NAME ) ),
aFtSource2( this, CUI_RES( FT_SOURCE2 ) ),
+ aFtFullSourceName( this, CUI_RES( FT_FULL_SOURCE_NAME ) ),
aFtType2( this, CUI_RES( FT_TYPE2 ) ),
+ aFtFullTypeName( this, CUI_RES( FT_FULL_TYPE_NAME ) ),
aFtUpdate( this, CUI_RES( FT_UPDATE ) ),
aRbAutomatic( this, CUI_RES( RB_AUTOMATIC ) ),
aRbManual( this, CUI_RES( RB_MANUAL ) ),
- aFtFullFileName( this, CUI_RES( FT_FULL_FILE_NAME ) ),
- aFtFullSourceName( this, CUI_RES( FT_FULL_SOURCE_NAME ) ),
- aFtFullTypeName( this, CUI_RES( FT_FULL_TYPE_NAME ) ),
+ aCancelButton1( this, CUI_RES( 1 ) ),
+ aHelpButton1( this, CUI_RES( 1 ) ),
+ aPbUpdateNow( this, CUI_RES( PB_UPDATE_NOW ) ),
+ aPbOpenSource( this, CUI_RES( PB_OPEN_SOURCE ) ),
+ aPbChangeSource( this, CUI_RES( PB_CHANGE_SOURCE ) ),
+ aPbBreakLink( this, CUI_RES( PB_BREAK_LINK ) ),
aStrAutolink( CUI_RES( STR_AUTOLINK ) ),
aStrManuallink( CUI_RES( STR_MANUALLINK ) ),
aStrBrokenlink( CUI_RES( STR_BROKENLINK ) ),
@@ -104,8 +105,7 @@ SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, LinkManager* pMgr, sal_Bool bH
aStrCloselinkmsgMulti( CUI_RES( STR_CLOSELINKMSG_MULTI ) ),
aStrWaitinglink( CUI_RES( STR_WAITINGLINK ) ),
pLinkMgr( NULL ),
- bHtmlMode(bHtml),
- aTbLinks( this, CUI_RES(TB_LINKS ) )
+ bHtmlMode(bHtml)
{
FreeResource();
@@ -117,6 +117,12 @@ SvBaseLinksDlg::SvBaseLinksDlg( Window * pParent, LinkManager* pMgr, sal_Bool bH
//JP 24.02.99: UpdateTimer fuer DDE-/Grf-Links, auf die gewarted wird
aUpdateTimer.SetTimeoutHdl( LINK( this, SvBaseLinksDlg, UpdateWaitingHdl ) );
aUpdateTimer.SetTimeout( 1000 );
+ //IAccessibility2 Implementation 2009-----
+ // Set the ZOrder, and accessible name to the dialog's title
+ aTbLinks.SetZOrder(0, WINDOW_ZORDER_FIRST);
+ aTbLinks.SetAccessibleName(this->GetText());
+ aTbLinks.SetAccessibleRelationLabeledBy(&aFtFiles);
+ //-----IAccessibility2 Implementation 2009
OpenSource().Hide();
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index c378cc40e1ad..4585e7350c6d 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -220,6 +220,9 @@ SvxMultiPathDialog::SvxMultiPathDialog( Window* pParent, sal_Bool bEmptyAllowed
aDelBtn.SetClickHdl( LINK( this, SvxMultiPathDialog, DelHdl_Impl ) );
SelectHdl_Impl( NULL );
+
+ aAddBtn.SetAccessibleRelationMemberOf(&aPathLB);
+ aDelBtn.SetAccessibleRelationMemberOf(&aPathLB);
}
// -----------------------------------------------------------------------
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index be2a7b4cfdbb..2ae45c319e87 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -53,10 +53,10 @@ SvPasteObjectDialog::SvPasteObjectDialog( Window* pParent )
aFtObjectSource( this, CUI_RES( FT_OBJECT_SOURCE ) ),
aRbPaste( this, CUI_RES( RB_PASTE ) ),
aRbPasteLink( this, CUI_RES( RB_PASTE_LINK ) ),
- aLbInsertList( this, CUI_RES( LB_INSERT_LIST ) ),
aCbDisplayAsIcon( this, CUI_RES( CB_DISPLAY_AS_ICON ) ),
aPbChangeIcon( this, CUI_RES( PB_CHANGE_ICON ) ),
aFlChoice( this, CUI_RES( FL_CHOICE ) ),
+ aLbInsertList( this, CUI_RES( LB_INSERT_LIST ) ),
aOKButton1( this, CUI_RES( 1 ) ),
aCancelButton1( this, CUI_RES( 1 ) ),
aHelpButton1( this, CUI_RES( 1 ) ),
@@ -74,6 +74,8 @@ SvPasteObjectDialog::SvPasteObjectDialog( Window* pParent )
ObjectLB().SetSelectHdl( LINK( this, SvPasteObjectDialog, SelectHdl ) );
ObjectLB().SetDoubleClickHdl( LINK( this, SvPasteObjectDialog, DoubleClickHdl ) );
SetDefault();
+
+ aLbInsertList.SetAccessibleName(aFlChoice.GetText());
}
void SvPasteObjectDialog::SelectObject()
diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx
index b446be7118fc..67bcf17f68be 100644
--- a/cui/source/dialogs/postdlg.cxx
+++ b/cui/source/dialogs/postdlg.cxx
@@ -159,6 +159,10 @@ SvxPostItDialog::SvxPostItDialog( Window* pParent,
SetText( CUI_RESSTR( STR_NOTIZ_INSERT ) );
FreeResource();
+
+ aEditED.SetAccessibleRelationLabeledBy(&aEditFT);
+ aEditED.SetAccessibleRelationMemberOf(&aPostItFL);
+ aAuthorBtn.SetAccessibleRelationMemberOf(&aPostItFL);
}
// -----------------------------------------------------------------------
diff --git a/cui/source/dialogs/splitcelldlg.cxx b/cui/source/dialogs/splitcelldlg.cxx
index e10abfa475d7..8d3f034068f5 100644
--- a/cui/source/dialogs/splitcelldlg.cxx
+++ b/cui/source/dialogs/splitcelldlg.cxx
@@ -38,13 +38,13 @@
SvxSplitTableDlg::SvxSplitTableDlg( Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
: SvxStandardDialog(pParent, CUI_RES(RID_SVX_SPLITCELLDLG))
+, maCountFL(this, CUI_RES(FL_COUNT))
, maCountLbl(this, CUI_RES(FT_COUNT))
, maCountEdit(this, CUI_RES(ED_COUNT))
-, maCountFL(this, CUI_RES(FL_COUNT))
+, maDirFL(this, CUI_RES(FL_DIR))
, maHorzBox(this, CUI_RES(RB_HORZ))
, maVertBox(this, CUI_RES(RB_VERT))
, maPropCB(this, CUI_RES(CB_PROP))
-, maDirFL(this, CUI_RES(FL_DIR))
, maOKBtn(this, CUI_RES(BT_OK))
, maCancelBtn(this, CUI_RES(BT_CANCEL))
, maHelpBtn( this, CUI_RES( BT_HELP ) )
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index f537e6b152b3..15640292d951 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -230,6 +230,14 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
aUserEdit.SetLast( nMax );
aUserEdit.SetValue( nValue );
+ aUserEdit.SetAccessibleRelationLabeledBy( &aUserBtn );
+ aUserEdit.SetAccessibleName(aUserBtn.GetText());
+ aColumnsEdit.SetAccessibleRelationLabeledBy(&aColumnsBtn);
+ aColumnsEdit.SetAccessibleName(aColumnsBtn.GetText());
+ aColumnsEdit.SetAccessibleRelationMemberOf(&aColumnsBtn);
+ aBookModeChk.SetAccessibleRelationLabeledBy(&aColumnsBtn);
+ aBookModeChk.SetAccessibleRelationMemberOf(&aColumnsBtn);
+
const SfxPoolItem& rItem = rSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
if ( rItem.ISA(SvxZoomItem) )
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 01172af4a435..921e104110ec 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -84,6 +84,13 @@ private:
SvxBackgroundTabPage( Window* pParent, const SfxItemSet& rCoreSet );
~SvxBackgroundTabPage();
+ FixedText aSelectTxt;
+ ListBox aLbSelect;
+ const String aStrBrowse;
+ const String aStrUnlinked;
+ FixedText aTblDesc;
+ ListBox aTblLBox;
+ ListBox aParaLBox;
// Hintergrundfarbe ------------------------------------
Control aBorderWin;
ValueSet aBackgroundColorSet;
@@ -92,34 +99,24 @@ private:
//color transparency
FixedText aColTransFT;
MetricField aColTransMF;
+ CheckBox aBtnPreview;
// Hintergrund-Bitmap ----------------------------------
+ FixedLine aGbFile;
PushButton aBtnBrowse;
CheckBox aBtnLink;
- CheckBox aBtnPreview;
- FixedInfo aFtFile;
- FixedLine aGbFile;
+ FixedLine aGbPosition;
RadioButton aBtnPosition;
RadioButton aBtnArea;
RadioButton aBtnTile;
SvxRectCtl aWndPosition;
- FixedLine aGbPosition;
+ FixedInfo aFtFile;
//transparency of graphics
FixedLine aGraphTransFL;
MetricField aGraphTransMF;
BackgroundPreviewImpl* pPreviewWin2;
- // Selektor --------------------------------------------
- FixedText aSelectTxt;
- ListBox aLbSelect;
- const String aStrBrowse;
- const String aStrUnlinked;
// DDListBox fuer Writer -------------------------------
-
- FixedText aTblDesc;
- ListBox aTblLBox;
- ListBox aParaLBox;
-
//------------------------------------------------------
Color aBgdColor;
sal_uInt16 nHtmlMode;
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index 459e927eff3e..b3d426df7173 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -309,13 +309,13 @@ class TPGalleryThemeProperties : public SfxTabPage
friend class TakeProgress;
friend class TakeThread;
+ FixedText aFtFileType;
+ ComboBox aCbbFileType;
+ MultiListBox aLbxFound;
PushButton aBtnSearch;
PushButton aBtnTake;
PushButton aBtnTakeAll;
CheckBox aCbxPreview;
- ComboBox aCbbFileType;
- MultiListBox aLbxFound;
- FixedText aFtFileType;
GalleryPreview aWndPreview;
ExchangeData* pData;
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 455ebd021f4c..ea34511cb298 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -97,16 +97,16 @@ private:
double mfScaleX;
double mfScaleY;
Size maSizePixel;
- PreviewWindow maPreview;
- FixedLine maFlParameter;
- OKButton maBtnOK;
- CancelButton maBtnCancel;
- HelpButton maBtnHelp;
DECL_LINK( ImplPreviewTimeoutHdl, Timer* pTimer );
DECL_LINK( ImplModifyHdl, void* p );
protected:
+ PreviewWindow maPreview;
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+ FixedLine maFlParameter;
const Link& GetModifyHdl() const { return maModifyHdl; }
const Size& GetGraphicSizePixel() const { return maSizePixel; }
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 360c2bc99750..d80239da302c 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -104,6 +104,7 @@ class SvxLineTabPage : public SvxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
+ FixedLine aFlLine;
FixedText aFtLineStyle;
LineLB aLbLineStyle;
FixedText aFtColor;
@@ -112,19 +113,18 @@ private:
MetricField aMtrLineWidth;
FixedText aFtTransparent;
MetricField aMtrTransparent;
- FixedLine aFlLine;
- FixedText aFtLineEndsStyle;
+ FixedLine aFlLineEnds;
LineEndLB aLbStartStyle;
- FixedText aFtLineEndsWidth;
MetricField aMtrStartWidth;
TriStateBox aTsbCenterStart;
+ FixedText aFtLineEndsStyle;
LineEndLB aLbEndStyle;
+ FixedText aFtLineEndsWidth;
MetricField aMtrEndWidth;
TriStateBox aTsbCenterEnd;
CheckBox aCbxSynchronize;
- FixedLine aFlLineEnds;
- SvxXLinePreview aCtlPreview;
FixedLine aFLSeparator;
+ SvxXLinePreview aCtlPreview;
// #116827#
FixedLine maFLEdgeStyle;
diff --git a/cui/source/inc/gallery.hrc b/cui/source/inc/gallery.hrc
index c9d6729be447..d813fa7c7f56 100644
--- a/cui/source/inc/gallery.hrc
+++ b/cui/source/inc/gallery.hrc
@@ -44,7 +44,6 @@
#define RID_SVXSTR_GALLERY_NOFILES (RID_CUI_GALLERY_START + 12)
#define RID_SVXSTR_GALLERY_SEARCH (RID_CUI_GALLERY_START + 30)
#define RID_SVXSTR_GALLERYPROPS_OBJECT (RID_CUI_GALLERY_START + 39)
-#define RID_SVXSTR_GALLERYPROPS_GALTHEME (RID_CUI_GALLERY_START + 40)
#define RID_SVXSTR_GALLERY_READONLY (RID_CUI_GALLERY_START + 43)
#define RID_SVXSTR_GALLERY_ALLFILES (RID_CUI_GALLERY_START + 44)
#define RID_SVXSTR_GALLERY_ID_EXISTS (RID_CUI_GALLERY_START + 81)
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index 36f5919c02e7..c69e6021d215 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -46,13 +46,13 @@ private:
RadioButton maRbtLinktypTelnet;
FixedText maFtTarget;
SvxHyperURLBox maCbbTarget;
+ ImageButton maBtBrowse;
FixedText maFtLogin;
Edit maEdLogin;
+ ImageButton maBtTarget;
FixedText maFtPassword;
Edit maEdPassword;
CheckBox maCbAnonymous;
- ImageButton maBtBrowse;
- ImageButton maBtTarget;
String maStrOldUser;
String maStrOldPassword;
diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx
index aeab4d94dbf8..b6d8dbafd6d5 100644
--- a/cui/source/inc/insdlg.hxx
+++ b/cui/source/inc/insdlg.hxx
@@ -63,11 +63,11 @@ class SvInsertOleDlg : public InsertObjectDialog_Impl
{
RadioButton aRbNewObject;
RadioButton aRbObjectFromfile;
+ FixedLine aGbObject;
ListBox aLbObjecttype;
Edit aEdFilepath;
PushButton aBtnFilepath;
CheckBox aCbFilelink;
- FixedLine aGbObject;
OKButton aOKButton1;
CancelButton aCancelButton1;
HelpButton aHelpButton1;
@@ -103,11 +103,11 @@ public:
class SvInsertPlugInDialog : public InsertObjectDialog_Impl
{
private:
+ FixedLine aGbFileurl;
Edit aEdFileurl;
PushButton aBtnFileurl;
- FixedLine aGbFileurl;
- MultiLineEdit aEdPluginsOptions;
FixedLine aGbPluginsOptions;
+ MultiLineEdit aEdPluginsOptions;
OKButton aOKButton1;
CancelButton aCancelButton1;
HelpButton aHelpButton1;
@@ -174,24 +174,25 @@ private:
Edit aEDURL;
PushButton aBTOpen;
+ FixedLine aFLScrolling;
RadioButton aRBScrollingOn;
RadioButton aRBScrollingOff;
RadioButton aRBScrollingAuto;
- FixedLine aFLScrolling;
+
FixedLine aFLSepLeft;
+ FixedLine aFLFrameBorder;
RadioButton aRBFrameBorderOn;
RadioButton aRBFrameBorderOff;
- FixedLine aFLFrameBorder;
FixedLine aFLSepRight;
+ FixedLine aFLMargin;
FixedText aFTMarginWidth;
NumericField aNMMarginWidth;
CheckBox aCBMarginWidthDefault;
FixedText aFTMarginHeight;
NumericField aNMMarginHeight;
CheckBox aCBMarginHeightDefault;
- FixedLine aFLMargin;
OKButton aOKButton1;
CancelButton aCancelButton1;
diff --git a/cui/source/inc/linkdlg.hxx b/cui/source/inc/linkdlg.hxx
index 114e62679844..57cf02ec982d 100644
--- a/cui/source/inc/linkdlg.hxx
+++ b/cui/source/inc/linkdlg.hxx
@@ -57,21 +57,22 @@ class SvBaseLinksDlg : public ModalDialog
FixedText aFtLinks;
FixedText aFtType;
FixedText aFtStatus;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
- PushButton aPbUpdateNow;
- PushButton aPbOpenSource;
- PushButton aPbChangeSource;
- PushButton aPbBreakLink;
+ SvTabListBox aTbLinks;
FixedText aFtFiles2;
+ FixedText aFtFullFileName;
FixedText aFtSource2;
+ FixedText aFtFullSourceName;
FixedText aFtType2;
+ FixedText aFtFullTypeName;
FixedText aFtUpdate;
RadioButton aRbAutomatic;
RadioButton aRbManual;
- FixedText aFtFullFileName;
- FixedText aFtFullSourceName;
- FixedText aFtFullTypeName;
+ CancelButton aCancelButton1;
+ HelpButton aHelpButton1;
+ PushButton aPbUpdateNow;
+ PushButton aPbOpenSource;
+ PushButton aPbChangeSource;
+ PushButton aPbBreakLink;
String aStrAutolink;
String aStrManuallink;
String aStrBrokenlink;
@@ -82,7 +83,6 @@ class SvBaseLinksDlg : public ModalDialog
String aStrWaitinglink;
sfx2::LinkManager* pLinkMgr;
sal_Bool bHtmlMode;
- SvTabListBox aTbLinks;
Timer aUpdateTimer;
#if _SOLAR__PRIVATE
diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx
index b6f092788116..bc9fe65eaf48 100644
--- a/cui/source/inc/numfmt.hxx
+++ b/cui/source/inc/numfmt.hxx
@@ -116,14 +116,14 @@ private:
FixedText aFtLanguage;
SvxLanguageBox aLbLanguage;
CheckBox aCbSourceFormat;
-
+ SvxNumberPreviewImpl aWndPreview;
+ FixedLine aFlOptions;
FixedText aFtDecimals;
NumericField aEdDecimals;
+ CheckBox aBtnNegRed;
FixedText aFtLeadZeroes;
NumericField aEdLeadZeroes;
- CheckBox aBtnNegRed;
CheckBox aBtnThousand;
- FixedLine aFlOptions;
FixedText aFtEdFormat;
Edit aEdFormat;
@@ -135,7 +135,6 @@ private:
Edit aEdComment;
Timer aResetWinTimer;
- SvxNumberPreviewImpl aWndPreview;
SvxNumberInfoItem* pNumItem;
SvxNumberFormatShell* pNumFmtShell;
diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index 27627b96c9f3..295483f042e0 100644
--- a/cui/source/inc/optdict.hxx
+++ b/cui/source/inc/optdict.hxx
@@ -63,12 +63,12 @@ namespace linguistic2{
class SvxNewDictionaryDialog : public ModalDialog
{
private:
+ FixedLine aNewDictBox;
FixedText aNameText;
Edit aNameEdit;
FixedText aLanguageText;
SvxLanguageBox aLanguageLB;
CheckBox aExceptBtn;
- FixedLine aNewDictBox;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
@@ -132,8 +132,8 @@ private:
PushButton aDeletePB;
FixedLine aEditDictsBox;
- CancelButton aCloseBtn;
HelpButton aHelpBtn;
+ CancelButton aCloseBtn;
String sModify;
String sNew;
DecorationView aDecoView;
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index 053cbdcad8dc..87d02d36f860 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -125,6 +125,7 @@ class SvxPageDescPage : public SfxTabPage
FixedText aBottomMarginLbl;
MetricField aBottomMarginEdit;
+ FixedLine aBottomSeparatorFl;
// layout settings
FixedLine aLayoutFL;
FixedText aPageText;
@@ -132,7 +133,6 @@ class SvxPageDescPage : public SfxTabPage
FixedText aNumberFormatText;
ListBox aNumberFormatBox;
- FixedLine aBottomSeparatorFl;
//Extras Calc
FixedText aTblAlignFT;
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index 49778aec5e81..7f7eae0c2641 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -71,6 +71,7 @@ class SvxStdParagraphTabPage: public SfxTabPage
private:
SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
+ FixedLine aIndentFrm;
// Einzug
FixedText aLeftLabel;
SvxRelativeField aLeftIndent;
@@ -82,27 +83,26 @@ private:
SvxRelativeField aFLineIndent;
CheckBox aAutoCB;
- FixedLine aIndentFrm;
+ FixedLine aDistFrm;
// Abstaende
FixedText aTopLabel;
SvxRelativeField aTopDist;
FixedText aBottomLabel;
SvxRelativeField aBottomDist;
- FixedLine aDistFrm;
// Zeilenabstand
+ FixedLine aLineDistFrm;
ListBox aLineDist;
FixedText aLineDistAtLabel;
MetricField aLineDistAtPercentBox;
MetricField aLineDistAtMetricBox;
- FixedLine aLineDistFrm;
String sAbsDist;
SvxParaPrevWindow aExampleWin;
//Registerhaltigkeit - nur Writer
- CheckBox aRegisterCB;
FixedLine aRegisterFL;
+ CheckBox aRegisterCB;
Edit* pActLineDistFld;
long nAbst;
@@ -237,6 +237,7 @@ private:
SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
// Silbentrennung
+ FixedLine aExtFL;
TriStateBox aHyphenBox;
FixedText aBeforeText;
NumericField aExtHyphenBeforeBox;
@@ -246,7 +247,6 @@ private:
// FixedText aHyphenAfterLabel;
FixedText aMaxHyphenLabel;
NumericField aMaxHyphenEdit;
- FixedLine aExtFL;
// Seitenumbruch
FixedLine aBreaksFL;
diff --git a/cui/source/inc/pastedlg.hxx b/cui/source/inc/pastedlg.hxx
index f59c3612dc91..2568ab9b2b5e 100644
--- a/cui/source/inc/pastedlg.hxx
+++ b/cui/source/inc/pastedlg.hxx
@@ -54,10 +54,10 @@ class SvPasteObjectDialog : public ModalDialog
FixedText aFtObjectSource;
RadioButton aRbPaste;
RadioButton aRbPasteLink;
- ListBox aLbInsertList;
CheckBox aCbDisplayAsIcon;
PushButton aPbChangeIcon;
FixedLine aFlChoice;
+ ListBox aLbInsertList;
OKButton aOKButton1;
CancelButton aCancelButton1;
HelpButton aHelpButton1;
diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx
index 4e08cebf2866..b9aa0a030d20 100644
--- a/cui/source/inc/splitcelldlg.hxx
+++ b/cui/source/inc/splitcelldlg.hxx
@@ -37,13 +37,13 @@
class SvxSplitTableDlg : public SvxAbstractSplittTableDialog, public SvxStandardDialog
{
+ FixedLine maCountFL;
FixedText maCountLbl;
NumericField maCountEdit;
- FixedLine maCountFL;
+ FixedLine maDirFL;
ImageRadioButton maHorzBox;
ImageRadioButton maVertBox;
CheckBox maPropCB;
- FixedLine maDirFL;
OKButton maOKBtn;
CancelButton maCancelBtn;
HelpButton maHelpBtn;
diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx
index 5aa7703862b2..f195ccdc9ea6 100644
--- a/cui/source/inc/tabstpge.hxx
+++ b/cui/source/inc/tabstpge.hxx
@@ -94,10 +94,11 @@ private:
SvxTabulatorTabPage( Window* pParent, const SfxItemSet& rSet );
// Tabulatoren und Positionen
- MetricBox aTabBox;
FixedLine aTabLabel;
+ MetricBox aTabBox;
FixedLine aTabLabelVert;
+ FixedLine aTabTypeLabel;
// TabType
RadioButton aLeftTab;
RadioButton aRightTab;
@@ -111,8 +112,8 @@ private:
FixedText aDezCharLabel;
Edit aDezChar;
- FixedLine aTabTypeLabel;
+ FixedLine aFillLabel;
// Fuellzeichen
RadioButton aNoFillChar;
RadioButton aFillPoints;
@@ -120,8 +121,6 @@ private:
RadioButton aFillSolidLine;
RadioButton aFillSpecial;
Edit aFillChar;
- FixedLine aFillLabel;
-
// Buttons
PushButton aNewBtn;
PushButton aDelAllBtn;
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index be5750400b69..06906bc38b49 100755
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -101,12 +101,12 @@ SvxNewDictionaryDialog::SvxNewDictionaryDialog( Window* pParent,
ModalDialog( pParent, CUI_RES( RID_SFXDLG_NEWDICT ) ),
+ aNewDictBox ( this, CUI_RES( GB_NEWDICT ) ),
aNameText ( this, CUI_RES( FT_DICTNAME ) ),
aNameEdit ( this, CUI_RES( ED_DICTNAME ) ),
aLanguageText ( this, CUI_RES( FT_DICTLANG ) ),
aLanguageLB ( this, CUI_RES( LB_DICTLANG ) ),
aExceptBtn ( this, CUI_RES( BTN_EXCEPT ) ),
- aNewDictBox ( this, CUI_RES( GB_NEWDICT ) ),
aOKBtn ( this, CUI_RES( BTN_NEWDICT_OK ) ),
aCancelBtn ( this, CUI_RES( BTN_NEWDICT_ESC ) ),
aHelpBtn ( this, CUI_RES( BTN_NEWDICT_HLP ) ),
@@ -121,6 +121,11 @@ SvxNewDictionaryDialog::SvxNewDictionaryDialog( Window* pParent,
aLanguageLB.SetLanguageList( LANG_LIST_ALL, sal_True, sal_True );
aLanguageLB.SelectEntryPos(0);
+ aNameText.SetAccessibleRelationMemberOf( &aNewDictBox );
+ aNameEdit.SetAccessibleRelationMemberOf( &aNewDictBox );
+ aLanguageText.SetAccessibleRelationMemberOf( &aNewDictBox );
+ aLanguageLB.SetAccessibleRelationMemberOf( &aNewDictBox );
+
FreeResource();
}
@@ -230,6 +235,7 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
aAllDictsLB ( this, CUI_RES( LB_ALLDICTS ) ),
aLangFT ( this, CUI_RES( FT_DICTLANG ) ),
aLangLB ( this, CUI_RES( LB_DICTLANG ) ),
+
aWordFT ( this, CUI_RES( FT_WORD ) ),
aWordED ( this, CUI_RES( ED_WORD ) ),
aReplaceFT ( this, CUI_RES( FT_REPLACE ) ),
@@ -238,8 +244,8 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
aNewReplacePB ( this, CUI_RES( PB_NEW_REPLACE ) ),
aDeletePB ( this, CUI_RES( PB_DELETE_REPLACE ) ),
aEditDictsBox ( this, CUI_RES( GB_EDITDICTS ) ),
- aCloseBtn ( this, CUI_RES( BTN_EDITCLOSE ) ),
aHelpBtn ( this, CUI_RES( BTN_EDITHELP ) ),
+ aCloseBtn ( this, CUI_RES( BTN_EDITCLOSE ) ),
sModify (CUI_RES(STR_MODIFY)),
sNew (aNewReplacePB.GetText()),
aDecoView ( this),
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index f5fb40e917f6..c20db45248c9 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1176,6 +1176,13 @@ SvxLinguTabPage::SvxLinguTabPage( Window* pParent,
else
aMoreDictsLink.Hide();
+ String sAccessibleNameModuleEdit( CUI_RES( STR_LINGU_MODULES_EDIT ) );
+ String sAccessibleNameDicsEdit ( CUI_RES( STR_LINGU_DICS_EDIT_DIC ) );
+ String sAccessibleNameOptionEdit( CUI_RES( STR_LINGU_OPTIONS_EDIT ) );
+
+ aLinguModulesEditPB.SetAccessibleName(sAccessibleNameModuleEdit);
+ aLinguDicsEditPB.SetAccessibleName(sAccessibleNameDicsEdit);
+ aLinguOptionsEditPB.SetAccessibleName(sAccessibleNameOptionEdit);
// force recalculation of hash value used for checking the need of updating
// because new dictionaries might be installed / downloaded.
diff --git a/cui/source/options/optlingu.hrc b/cui/source/options/optlingu.hrc
index 6a73b7321235..824e2236e9c6 100644
--- a/cui/source/options/optlingu.hrc
+++ b/cui/source/options/optlingu.hrc
@@ -85,4 +85,8 @@
#define CLB_EDIT_MODULES_MODULES 320
#define FT_EDIT_MODULES_NEWDICTSLINK 321
#define FL_EDIT_MODULES_BUTTONS 322
-
+// IAccessibility2 implementation 2009. ------
+#define STR_LINGU_MODULES_EDIT 323
+#define STR_LINGU_DICS_EDIT_DIC 324
+#define STR_LINGU_OPTIONS_EDIT 325
+// ------ IAccessibility2 implementation 2009.
diff --git a/cui/source/options/optlingu.src b/cui/source/options/optlingu.src
index 12192ad8ac4b..1187295b2ac3 100755
--- a/cui/source/options/optlingu.src
+++ b/cui/source/options/optlingu.src
@@ -344,6 +344,19 @@ TabPage RID_SFXPAGE_LINGU
{
Text [ en-US ] = "Hyphenate special regions";
};
+ String STR_LINGU_MODULES_EDIT
+ {
+ Text [ en-US ] = "Edit Available language modules";
+ };
+ String STR_LINGU_DICS_EDIT_DIC
+ {
+ Text [ en-US ] = "Edit User-defined dictionaries";
+ };
+ String STR_LINGU_OPTIONS_EDIT
+ {
+ Text [ en-US ] = "Edit Options";
+ };
+ // ------ IAccessibility2 implementation 2009.
};
// end: TabPage RID_SFXPAGE_LINGU
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 49228356ef17..de26a157e21b 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -598,6 +598,8 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(
ResizeTreeLB();
if (bActivateLastSelection)
ActivateLastSelection();
+
+ aTreeLB.SetAccessibleName(GetDisplayText());
}
// Ctor() with ExtensionId -----------------------------------------------
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index bcf8dca6b7d1..d50ee7b5752d 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -197,6 +197,10 @@ AlignmentTabPage::AlignmentTabPage( Window* pParent, const SfxItemSet& rCoreAttr
AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_SHRINKTOFIT, maBtnShrink, sfx::ITEMCONN_HIDE_UNKNOWN ) );
AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_FRAMEDIRECTION, maFtFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) );
AddItemConnection( new FrameDirListBoxConnection( SID_ATTR_FRAMEDIRECTION, maLbFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) );
+
+ maLbHorAlign.SetAccessibleRelationMemberOf( &maFlAlignment );
+ maEdIndent.SetAccessibleRelationMemberOf( &maFlAlignment );
+ maLbVerAlign.SetAccessibleRelationMemberOf( &maFlAlignment );
}
AlignmentTabPage::~AlignmentTabPage()
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 420786ce52a2..afc38b00adb4 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1607,6 +1607,11 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage( Window* pParent,
aAutoCapsCB (this, CUI_RES(CB_AUTOCAPS )),
eLang(eLastDialogLanguage)
{
+ aNewAbbrevPB.SetAccessibleName(String(CUI_RES(STR_PB_NEWABBREV) ) );
+ aDelAbbrevPB.SetAccessibleName(String(CUI_RES(STR_PB_DELABBREV) ) );
+ aNewDoublePB.SetAccessibleName(String(CUI_RES(STR_PB_NEWDOUBLECAPS) ) );
+ aDelDoublePB.SetAccessibleName(String(CUI_RES(STR_PB_DELDOUBLECAPS) ) );
+
FreeResource();
::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage ));
@@ -1627,6 +1632,10 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage( Window* pParent,
aAbbrevED.SetActionHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
aDoubleCapsED.SetActionHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl));
+ aNewAbbrevPB.SetAccessibleRelationMemberOf(&aAbbrevFL);
+ aDelAbbrevPB.SetAccessibleRelationMemberOf(&aAbbrevFL);
+ aNewDoublePB.SetAccessibleRelationMemberOf(&aDoubleCapsFL);
+ aDelDoublePB.SetAccessibleRelationMemberOf(&aDoubleCapsFL);
}
/*-----------------14.10.96 15.58-------------------
@@ -2058,6 +2067,13 @@ OfaQuoteTabPage::OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet ) :
sStandard(CUI_RES(ST_STANDARD))
{
+ aSglStandardPB.SetAccessibleName(String(CUI_RES(STR_PB_SGL_STD) ) );
+ aDblStandardPB.SetAccessibleName(String(CUI_RES(STR_PB_DBL_STD) ) );
+ aStartQuotePB.SetAccessibleName( String(CUI_RES(STR_PB_DBL_START) ));
+ aEndQuotePB.SetAccessibleName(String(CUI_RES(STR_PB_DBL_END) ));
+ aSglStartQuotePB.SetAccessibleName(String(CUI_RES(STR_PB_SGL_START) ));
+ aSglEndQuotePB.SetAccessibleName(String(CUI_RES(STR_PB_SGL_END) ) );
+
FreeResource();
sal_Bool bShowSWOptions = sal_False;
@@ -2099,6 +2115,16 @@ OfaQuoteTabPage::OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet ) :
aDblStandardPB.SetClickHdl(LINK(this, OfaQuoteTabPage, StdQuoteHdl));
aSglStandardPB.SetClickHdl(LINK(this, OfaQuoteTabPage, StdQuoteHdl));
+ aSglStartQuotePB.SetAccessibleRelationLabeledBy( &aSglStartQuoteFT );
+ aSglEndQuotePB.SetAccessibleRelationLabeledBy( &aSglEndQuoteFT );
+ aSglStartQuotePB.SetAccessibleRelationMemberOf( &aSingleFL );
+ aSglEndQuotePB.SetAccessibleRelationMemberOf( &aSingleFL );
+ aStartQuotePB.SetAccessibleRelationLabeledBy( &aStartQuoteFT );
+ aEndQuotePB.SetAccessibleRelationLabeledBy( &aEndQuoteFT );
+ aStartQuotePB.SetAccessibleRelationMemberOf( &aDoubleFL );
+ aEndQuotePB.SetAccessibleRelationMemberOf( &aDoubleFL );
+ aSglStandardPB.SetAccessibleRelationMemberOf(&aSingleFL);
+ aDblStandardPB.SetAccessibleRelationMemberOf(&aDoubleFL);
}
/*-----------------03.07.97 13:17-------------------
@@ -2431,6 +2457,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage( Window* pParent,
aPBEntries.SetClickHdl(LINK(this, OfaAutoCompleteTabPage, DeleteHdl));
aCBActiv.SetToggleHdl(LINK(this, OfaAutoCompleteTabPage, CheckHdl));
aCBCollect.SetToggleHdl(LINK(this, OfaAutoCompleteTabPage, CheckHdl));
+ aLBEntries.SetAccessibleRelationLabeledBy(&aLBEntries);
}
OfaAutoCompleteTabPage::~OfaAutoCompleteTabPage()
diff --git a/cui/source/tabpages/autocdlg.hrc b/cui/source/tabpages/autocdlg.hrc
index 1e77c22b4fa9..8920dadd35a0 100644
--- a/cui/source/tabpages/autocdlg.hrc
+++ b/cui/source/tabpages/autocdlg.hrc
@@ -154,6 +154,18 @@
#define FT_SMARTTAGS 221
#define LB_SMARTTAGS 222
#define PB_SMARTTAGS 223
+//IAccessibility2 Implementation 2009-----
+#define STR_PB_NEWABBREV 224
+#define STR_PB_DELABBREV 225
+#define STR_PB_NEWDOUBLECAPS 226
+#define STR_PB_DELDOUBLECAPS 227
+#define STR_PB_SGL_STD 228
+#define STR_PB_DBL_STD 229
+#define STR_PB_SGL_START 230
+#define STR_PB_DBL_START 231
+#define STR_PB_SGL_END 232
+#define STR_PB_DBL_END 233
+//-----IAccessibility2 Implementation 2009
#endif
diff --git a/cui/source/tabpages/autocdlg.src b/cui/source/tabpages/autocdlg.src
index d698a8f8aa47..8a906cf54e45 100644
--- a/cui/source/tabpages/autocdlg.src
+++ b/cui/source/tabpages/autocdlg.src
@@ -483,6 +483,46 @@ TabPage RID_OFAPAGE_AUTOCORR_EXCEPT
Text [ en-US ] = "A~utoInclude";
Text [ en-US ] = "A~utoInclude" ;
};
+ String STR_PB_NEWABBREV
+ {
+ Text [ en-US ] = "New abbreviations" ;
+ };
+ String STR_PB_DELABBREV
+ {
+ Text [ en-US ] = "Delete abbreviations" ;
+ };
+ String STR_PB_NEWDOUBLECAPS
+ {
+ Text [ en-US ] = "New words with two initial capitals" ;
+ };
+ String STR_PB_DELDOUBLECAPS
+ {
+ Text [ en-US ] = "Delete words with two initial capitals" ;
+ };
+ String STR_PB_SGL_STD
+ {
+ Text [ en-US ] = "Single quotes default" ;
+ };
+ String STR_PB_DBL_STD
+ {
+ Text [ en-US ] = "Double quotes default" ;
+ };
+ String STR_PB_SGL_START
+ {
+ Text [ en-US ] = "Start quote of single quotes" ;
+ };
+ String STR_PB_DBL_START
+ {
+ Text [ en-US ] = "Start quote of double quotes" ;
+ };
+ String STR_PB_SGL_END
+ {
+ Text [ en-US ] = "End quote of single quotes" ;
+ };
+ String STR_PB_DBL_END
+ {
+ Text [ en-US ] = "End quote of double quotes" ;
+ };
};
/**************************************************************************/
/* */
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index e7639e34fe7d..2c7dcd315f3f 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -343,34 +343,36 @@ SvxBackgroundTabPage::SvxBackgroundTabPage( Window* pParent,
SvxTabPage( pParent, CUI_RES( RID_SVXPAGE_BACKGROUND ), rCoreSet ),
+ aSelectTxt ( this, CUI_RES( FT_SELECTOR ) ),
+ aLbSelect ( this, CUI_RES( LB_SELECTOR ) ),
+ aStrBrowse ( CUI_RES( STR_BROWSE ) ),
+ aStrUnlinked ( CUI_RES( STR_UNLINKED ) ),
+ aTblDesc ( this, CUI_RES( FT_TBL_DESC ) ),
+ aTblLBox ( this, CUI_RES( LB_TBL_BOX ) ),
+ aParaLBox ( this, CUI_RES( LB_PARA_BOX ) ),
+
aBorderWin ( this, CUI_RES(CT_BORDER) ),
aBackgroundColorSet ( &aBorderWin, CUI_RES( SET_BGDCOLOR ) ),
aBackgroundColorBox ( this, CUI_RES( GB_BGDCOLOR ) ),
- pPreviewWin1 ( new BackgroundPreviewImpl(
- this, CUI_RES( WIN_PREVIEW1 ), sal_False ) ),
+ pPreviewWin1 ( new BackgroundPreviewImpl( this, CUI_RES( WIN_PREVIEW1 ), sal_False ) ),
+
aColTransFT ( this, CUI_RES( FT_COL_TRANS ) ),
aColTransMF ( this, CUI_RES( MF_COL_TRANS ) ),
- aBtnBrowse ( this, CUI_RES( BTN_BROWSE ) ),
- aBtnLink ( this, CUI_RES( BTN_LINK ) ),
aBtnPreview ( this, CUI_RES( BTN_PREVIEW ) ),
- aFtFile ( this, CUI_RES( FT_FILE ) ),
aGbFile ( this, CUI_RES( GB_FILE ) ),
+ aBtnBrowse ( this, CUI_RES( BTN_BROWSE ) ),
+ aBtnLink ( this, CUI_RES( BTN_LINK ) ),
+ aGbPosition ( this, CUI_RES( GB_POSITION ) ),
aBtnPosition ( this, CUI_RES( BTN_POSITION ) ),
aBtnArea ( this, CUI_RES( BTN_AREA ) ),
aBtnTile ( this, CUI_RES( BTN_TILE ) ),
aWndPosition ( this, CUI_RES( WND_POSITION ), RP_MM ),
- aGbPosition ( this, CUI_RES( GB_POSITION ) ),
+ aFtFile ( this, CUI_RES( FT_FILE ) ),
aGraphTransFL ( this, CUI_RES( FL_GRAPH_TRANS ) ),
aGraphTransMF ( this, CUI_RES( MF_GRAPH_TRANS ) ),
pPreviewWin2 ( new BackgroundPreviewImpl(
this, CUI_RES( WIN_PREVIEW2 ), sal_True ) ),
- aSelectTxt ( this, CUI_RES( FT_SELECTOR ) ),
- aLbSelect ( this, CUI_RES( LB_SELECTOR ) ),
- aStrBrowse ( CUI_RES( STR_BROWSE ) ),
- aStrUnlinked ( CUI_RES( STR_UNLINKED ) ),
- aTblDesc ( this, CUI_RES( FT_TBL_DESC ) ),
- aTblLBox ( this, CUI_RES( LB_TBL_BOX ) ),
- aParaLBox ( this, CUI_RES( LB_PARA_BOX ) ),
+
nHtmlMode ( 0 ),
bAllowShowSelector ( sal_True ),
bIsGraphicValid ( sal_False ),
@@ -402,6 +404,11 @@ SvxBackgroundTabPage::SvxBackgroundTabPage( Window* pParent,
aBackgroundColorSet.SetSelectHdl( HDL(BackgroundColorHdl_Impl) );
FreeResource();
+
+ aBtnBrowse.SetAccessibleRelationMemberOf(&aGbFile);
+ aWndPosition.SetAccessibleRelationMemberOf(&aGbPosition);
+ aWndPosition.SetAccessibleRelationLabeledBy(&aBtnPosition);
+ aBackgroundColorSet.SetAccessibleRelationLabeledBy(&aBackgroundColorBox);
}
//------------------------------------------------------------------------
@@ -657,6 +664,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet& rSet )
aPos.Y() = nY;
pPreviewWin1->SetPosPixel(aPos);
aBackgroundColorBox.Hide();
+ aBackgroundColorSet.SetAccessibleRelationLabeledBy(&aBackgroundColorSet);
}
}
}
@@ -1211,6 +1219,7 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl()
WinBits nBits = ( aBackgroundColorSet.GetStyle() | WB_ITEMBORDER | WB_NAMEFIELD | WB_NONEFIELD );
aBackgroundColorSet.SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
aBackgroundColorSet.SetStyle( nBits );
+ aBackgroundColorSet.SetAccessibleName(aBackgroundColorBox.GetText());
for ( i = 0; i < nCount; i++ )
{
pEntry = pColorTable->GetColor(i);
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index 69e370be9f8b..f13d36697ca8 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -49,6 +49,7 @@
#include <dialmgr.hxx>
#include "svx/dlgutil.hxx"
+#include "paragrph.hrc"
#include <cuires.hrc>
static sal_uInt16 pRanges[] =
@@ -124,6 +125,8 @@ SvxConnectionPage::SvxConnectionPage( Window* pWindow, const SfxItemSet& rInAttr
{
FreeResource();
+ aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
+
SfxItemPool* pPool = rOutAttrs.GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
eUnit = pPool->GetMetric( SDRATTR_EDGENODE1HORZDIST );
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index c06d564e45dd..4267ce1a795d 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -134,6 +134,8 @@ SvxGrfCropPage::SvxGrfCropPage ( Window *pParent, const SfxItemSet &rSet )
aTimer.SetTimeoutHdl(LINK(this, SvxGrfCropPage, Timeout));
aTimer.SetTimeout( 1500 );
+
+ aOrigSizePB.SetAccessibleRelationLabeledBy( &aOrigSizeFT );
}
/*--------------------------------------------------------------------
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 2c90310dbf67..1ee81c946cfc 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -130,6 +130,7 @@ SvxMeasurePage::SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs ) :
bPositionModified ( sal_False )
{
+ aCtlPreview.SetAccessibleName(aCtlPreview.GetHelpText());
FillUnitLB();
FreeResource();
@@ -168,6 +169,9 @@ SvxMeasurePage::SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs ) :
aTsbParallel.SetClickHdl( aLink );
aTsbShowUnit.SetClickHdl( aLink );
aLbUnit.SetSelectHdl( aLink );
+ aLbUnit.SetAccessibleName(GetNonMnemonicString(aTsbShowUnit.GetText()));
+ aCtlPosition.SetAccessibleRelationMemberOf( &aFlLabel );
+ aLbUnit.SetAccessibleRelationLabeledBy( &aTsbShowUnit );
}
/*************************************************************************
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 4787f263657b..27678b02f50b 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -260,13 +260,18 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window* pParent,
aFtLanguage ( this, CUI_RES( FT_LANGUAGE ) ),
aLbLanguage ( this, CUI_RES( LB_LANGUAGE ), sal_False ),
aCbSourceFormat ( this, CUI_RES( CB_SOURCEFORMAT ) ),
+#if ENABLE_LAYOUT
+ aWndPreview ( LAYOUT_THIS_WINDOW(this), CUI_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
+#else
+ aWndPreview ( this, CUI_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
+#endif
+ aFlOptions ( this, CUI_RES( FL_OPTIONS ) ),
aFtDecimals ( this, CUI_RES( FT_DECIMALS ) ),
aEdDecimals ( this, CUI_RES( ED_DECIMALS ) ),
+ aBtnNegRed ( this, CUI_RES( BTN_NEGRED ) ),
aFtLeadZeroes ( this, CUI_RES( FT_LEADZEROES ) ),
aEdLeadZeroes ( this, CUI_RES( ED_LEADZEROES ) ),
- aBtnNegRed ( this, CUI_RES( BTN_NEGRED ) ),
aBtnThousand ( this, CUI_RES( BTN_THOUSAND ) ),
- aFlOptions ( this, CUI_RES( FL_OPTIONS ) ),
aFtEdFormat ( this, CUI_RES( FT_EDFORMAT ) ),
aEdFormat ( this, CUI_RES( ED_FORMAT ) ),
@@ -276,11 +281,6 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window* pParent,
aFtComment ( this, CUI_RES( FT_COMMENT ) ),
aEdComment ( this, CUI_RES( ED_COMMENT ) ),
-#if ENABLE_LAYOUT
- aWndPreview ( LAYOUT_THIS_WINDOW(this), CUI_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
-#else
- aWndPreview ( this, CUI_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
-#endif
pNumItem ( NULL ),
pNumFmtShell ( NULL ),
nInitFormat ( ULONG_MAX ),
@@ -380,6 +380,13 @@ void SvxNumberFormatTabPage::Init_Impl()
{
aLbLanguage.InsertLanguage( xLang[i] );
}
+
+ aIbAdd.SetAccessibleRelationLabeledBy( &aFtEdFormat );
+ aIbInfo.SetAccessibleRelationLabeledBy( &aFtEdFormat );
+ aIbRemove.SetAccessibleRelationLabeledBy( &aFtEdFormat );
+ aIbAdd.SetAccessibleRelationMemberOf( &aIbAdd );
+ aIbInfo.SetAccessibleRelationMemberOf( &aIbInfo );
+ aIbRemove.SetAccessibleRelationMemberOf( &aIbRemove );
}
/*************************************************************************
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index b624da8a509b..5d2e85da8a3b 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -989,6 +989,7 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent,
pExamplesVS->Format();
}
+ pExamplesVS->SetAccessibleRelationMemberOf( &aValuesFL );
}
/*-----------------12.02.97 07.46-------------------
@@ -1365,6 +1366,8 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(Window* pParent,
eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
+ aBitmapMB.SetAccessibleRelationLabeledBy( &aBitmapFT );
+
FreeResource();
//get advanced numbering types from the component
@@ -1421,6 +1424,10 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(Window* pParent,
aFmtLB.RemoveEntry( nPos);
}
}
+
+ aBulletPB.SetAccessibleRelationMemberOf(&aFormatFL);
+ aBulletPB.SetAccessibleRelationLabeledBy(&aStartFT);
+ aBulletPB.SetAccessibleName(aStartFT.GetText());
}
/*-----------------01.12.97 16:30-------------------
@@ -3096,6 +3103,8 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(Window* pParent,
pDebugFixedText->SetPosSizePixel(aPos, aSize);
pDebugFixedText->SetText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Das ist ein Debug-Text" ) ) );
#endif
+
+ aStandardPB.SetAccessibleRelationMemberOf(&aPositionFL);
}
/*-----------------03.12.97 10:02-------------------
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index fc9c4f70e621..5bc52b99f3a9 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -272,13 +272,12 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
aTopMarginEdit ( this, CUI_RES( ED_TOP_MARGIN ) ),
aBottomMarginLbl ( this, CUI_RES( FT_BOTTOM_MARGIN ) ),
aBottomMarginEdit ( this, CUI_RES( ED_BOTTOM_MARGIN ) ),
-
+ aBottomSeparatorFl ( this, CUI_RES( FL_BOTTOM_SEP ) ),
aLayoutFL ( this, CUI_RES( FL_LAYOUT ) ),
aPageText ( this, CUI_RES( FT_PAGELAYOUT ) ),
aLayoutBox ( this, CUI_RES( LB_LAYOUT ) ),
aNumberFormatText ( this, CUI_RES( FT_NUMBER_FORMAT ) ),
aNumberFormatBox ( this, CUI_RES( LB_NUMBER_FORMAT ) ),
- aBottomSeparatorFl ( this, CUI_RES( FL_BOTTOM_SEP ) ),
aTblAlignFT ( this, CUI_RES( FT_TBL_ALIGN ) ),
aHorzBox ( this, CUI_RES( CB_HORZ ) ),
aVertBox ( this, CUI_RES( CB_VERT ) ),
@@ -329,9 +328,10 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
if( !bWeb )
{
if( bCJK )
+ {
aTextFlowBox.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_RTL_VERT ), FRMDIR_VERT_TOP_RIGHT );
-// if( ... )
// aTextFlowBox.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_VERT ), FRMDIR_VERT_TOP_LEFT );
+ }
}
// #109989# show the text direction box in Writer/Web too, but only, if HTML export mode is not HTML3.2.
@@ -420,6 +420,9 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
aTopMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperTopMargin());
aBottomMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperBottomMargin());
aBottomMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperBottomMargin());
+
+ aPortraitBtn.SetAccessibleRelationMemberOf(&aOrientationFT);
+ aLandscapeBtn.SetAccessibleRelationMemberOf(&aOrientationFT);
}
// -----------------------------------------------------------------------
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 408a72d14765..81f898679984 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -637,6 +637,7 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent,
SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_STD_PARAGRAPH ), rAttr ),
+ aIndentFrm ( this, CUI_RES( FL_INDENT ) ),
aLeftLabel ( this, CUI_RES( FT_LEFTINDENT ) ),
aLeftIndent ( this, CUI_RES( ED_LEFTINDENT ) ),
aRightLabel ( this, CUI_RES( FT_RIGHTINDENT ) ),
@@ -645,21 +646,21 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent,
aFLineLabel ( this, CUI_RES( FT_FLINEINDENT ) ),
aFLineIndent ( this, CUI_RES( ED_FLINEINDENT ) ),
aAutoCB ( this, CUI_RES( CB_AUTO ) ),
- aIndentFrm ( this, CUI_RES( FL_INDENT ) ),
+ aDistFrm ( this, CUI_RES( FL_DIST ) ),
aTopLabel ( this, CUI_RES( FT_TOPDIST ) ),
aTopDist ( this, CUI_RES( ED_TOPDIST ) ),
aBottomLabel ( this, CUI_RES( FT_BOTTOMDIST ) ),
aBottomDist ( this, CUI_RES( ED_BOTTOMDIST ) ),
- aDistFrm ( this, CUI_RES( FL_DIST ) ),
+
+ aLineDistFrm ( this, CUI_RES( FL_LINEDIST ) ),
aLineDist ( this, CUI_RES( LB_LINEDIST ) ),
aLineDistAtLabel ( this, CUI_RES( FT_LINEDIST ) ),
aLineDistAtPercentBox ( this, CUI_RES( ED_LINEDISTPERCENT ) ),
aLineDistAtMetricBox ( this, CUI_RES( ED_LINEDISTMETRIC ) ),
- aLineDistFrm ( this, CUI_RES( FL_LINEDIST ) ),
sAbsDist ( CUI_RES(ST_LINEDIST_ABS) ),
aExampleWin ( this, CUI_RES( WN_EXAMPLE ) ),
- aRegisterCB ( this, CUI_RES( CB_REGISTER ) ),
aRegisterFL ( this, CUI_RES( FL_REGISTER ) ),
+ aRegisterCB ( this, CUI_RES( CB_REGISTER ) ),
pActLineDistFld ( &aLineDistAtPercentBox ),
nAbst ( MAX_DURCH ),
nWidth ( 11905 /*567 * 50*/ ),
@@ -676,6 +677,9 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent,
FreeResource();
Init_Impl();
aFLineIndent.SetMin(-9999); // wird default auf 0 gesetzt
+
+ aExampleWin.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
+
}
@@ -1093,6 +1097,9 @@ SvxParaAlignTabPage::SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSe
aTextDirectionLB.Show();
}
}
+
+ aExampleWin.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
+
}
/*-----------------16.01.97 19.33-------------------
@@ -1933,6 +1940,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSe
SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_EXT_PARAGRAPH ), rAttr ),
+ aExtFL ( this, CUI_RES( FL_HYPHEN ) ),
aHyphenBox ( this, CUI_RES( BTN_HYPHEN ) ),
aBeforeText ( this, CUI_RES( FT_HYPHENBEFORE ) ),
aExtHyphenBeforeBox ( this, CUI_RES( ED_HYPHENBEFORE ) ),
@@ -1940,7 +1948,6 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSe
aExtHyphenAfterBox ( this, CUI_RES( ED_HYPHENAFTER ) ),
aMaxHyphenLabel ( this, CUI_RES( FT_MAXHYPH ) ),
aMaxHyphenEdit ( this, CUI_RES( ED_MAXHYPH ) ),
- aExtFL ( this, CUI_RES( FL_HYPHEN ) ),
aBreaksFL ( this, CUI_RES( FL_BREAKS ) ),
aPageBreakBox ( this, CUI_RES( BTN_PAGEBREAK ) ),
aBreakTypeFT ( this, CUI_RES( FT_BREAKTYPE )),
@@ -1970,6 +1977,11 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSe
{
FreeResource();
+ aApplyCollBox.SetAccessibleRelationLabeledBy(&aApplyCollBtn);
+ aApplyCollBox.SetAccessibleName(String(CUI_RES(STR_PAGE_STYLE)));
+ aOrphanRowNo.SetAccessibleRelationLabeledBy(&aOrphanBox);
+ aWidowRowNo.SetAccessibleRelationLabeledBy(&aWidowBox);
+
// diese Page braucht ExchangeSupport
SetExchangeSupport();
diff --git a/cui/source/tabpages/paragrph.hrc b/cui/source/tabpages/paragrph.hrc
index 8a14407a9cd0..c6158a22ceda 100644
--- a/cui/source/tabpages/paragrph.hrc
+++ b/cui/source/tabpages/paragrph.hrc
@@ -117,5 +117,9 @@
#define CB_AS_SCRIPT_SPACE 7
+//IAccessibility2 Implementation 2009-----
+#define STR_EXAMPLE 5010
+#define STR_PAGE_STYLE 5011
+//-----IAccessibility2 Implementation 2009
#endif
diff --git a/cui/source/tabpages/paragrph.src b/cui/source/tabpages/paragrph.src
index e7e50842ba1c..cd13bdb12a6d 100644
--- a/cui/source/tabpages/paragrph.src
+++ b/cui/source/tabpages/paragrph.src
@@ -732,39 +732,12 @@ TabPage RID_SVXPAGE_PARA_ASIAN
};
};
-// ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String STR_EXAMPLE
+{
+ Text [ en-US ] = "Example" ;
+};
+String STR_PAGE_STYLE
+{
+ Text [ en-US ] = "Page Style" ;
+};
diff --git a/cui/source/tabpages/tabarea.hrc b/cui/source/tabpages/tabarea.hrc
index 10fe10f1495d..8e2f9b4344c2 100644
--- a/cui/source/tabpages/tabarea.hrc
+++ b/cui/source/tabpages/tabarea.hrc
@@ -185,3 +185,7 @@
#define IMG_LOAD_H 23
#define IMG_SAVE_H 24
+// IAccessibility2 implementation 2009 ------
+#define STR_CUI_COLORMODEL 5030
+#define STR_LB_HATCHINGSTYLE 5031
+// ------ IAccessibility2 implementation 2009.
diff --git a/cui/source/tabpages/tabarea.src b/cui/source/tabpages/tabarea.src
index a9e4ccd207a6..8303509d4c64 100644
--- a/cui/source/tabpages/tabarea.src
+++ b/cui/source/tabpages/tabarea.src
@@ -1563,59 +1563,13 @@ Image RID_SVXIMG_SAVE_H
MASKCOLOR
};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String STR_LB_HATCHINGSTYLE
+{
+ Text [ en-US ] = "Hatching Style" ;
+};
+String STR_CUI_COLORMODEL
+{
+ Text [ en-US ] = "Color Mode" ;
+};
diff --git a/cui/source/tabpages/tabline.hrc b/cui/source/tabpages/tabline.hrc
index 0034e2126bf5..81e9e99e5061 100644
--- a/cui/source/tabpages/tabline.hrc
+++ b/cui/source/tabpages/tabline.hrc
@@ -41,6 +41,21 @@
#define FT_LINE_ENDS_WIDTH 6
#define LB_START_STYLE 3
#define LB_END_STYLE 4
+//IAccessibility2 Impplementaton 2009-----
+#define STR_STYLE (LB_END_STYLE+1)
+#define STR_LB_START_STYLE 30
+#define STR_LB_END_STYLE 31
+#define STR_MTR_FLD_START_WIDTH 32
+#define STR_MTR_FLD_END_WIDTH 33
+#define STR_CENTER_START 34
+#define STR_CENTER_END 35
+#define STR_START_TYPE 36
+#define STR_END_TYPE 37
+#define STR_START_NUM 38
+#define STR_END_NUM 39
+#define STR_START_LENGTH 40
+#define STR_END_LENGTH 41
+//-----IAccessibility2 Impplementaton 2009
#define MTR_FLD_START_WIDTH 3
#define MTR_FLD_END_WIDTH 2
#define CBX_SYNCHRONIZE 1
@@ -103,4 +118,13 @@
#define MN_SYMBOLS_AUTO 5
#define MN_GALLERY_ENTRY 100
-
+/*
+//IAccessibility2 Implementation 2009-----
+#define STR_START_TYPE 1
+#define STR_END_TYPE 2
+#define STR_START_NUM 3
+#define STR_END_NUM 4
+#define STR_START_LENGTH 5
+#define STR_END_LENGTH 6
+//-----IAccessibility2 Implementation 2009
+*/
diff --git a/cui/source/tabpages/tabline.src b/cui/source/tabpages/tabline.src
index 4e40debbee6d..bdda4ebd1e54 100644
--- a/cui/source/tabpages/tabline.src
+++ b/cui/source/tabpages/tabline.src
@@ -385,6 +385,34 @@ TabPage RID_SVXPAGE_LINE
Size = MAP_APPFONT ( 118 , 10 ) ;
Text [ en-US ] = "Keep ratio" ;
};
+ String STR_STYLE
+ {
+ Text [ en-US ] = "Style" ;
+ };
+ String STR_LB_START_STYLE
+ {
+ Text [ en-US ] = "Start style" ;
+ };
+ String STR_LB_END_STYLE
+ {
+ Text [ en-US ] = "End style" ;
+ };
+ String STR_MTR_FLD_START_WIDTH
+ {
+ Text [ en-US ] = "Start width" ;
+ };
+ String STR_MTR_FLD_END_WIDTH
+ {
+ Text [ en-US ] = "End width" ;
+ };
+ String STR_CENTER_START
+ {
+ Text [ en-US ] = "Start with center" ;
+ };
+ String STR_CENTER_END
+ {
+ Text [ en-US ] = "End with center" ;
+ };
};
// Defining LineStyles --------------------
@@ -635,6 +663,30 @@ TabPage RID_SVXPAGE_LINE_DEF
Size = MAP_APPFONT ( 248 , 40 ) ;
};
+ String STR_START_TYPE
+ {
+ Text [ en-US ] = "Start type" ;
+ };
+ String STR_END_TYPE
+ {
+ Text [ en-US ] = "End type" ;
+ };
+ String STR_START_NUM
+ {
+ Text [ en-US ] = "Start number" ;
+ };
+ String STR_END_NUM
+ {
+ Text [ en-US ] = "End number" ;
+ };
+ String STR_START_LENGTH
+ {
+ Text [ en-US ] = "Start length" ;
+ };
+ String STR_END_LENGTH
+ {
+ Text [ en-US ] = "End length" ;
+ };
};
// Defining LineEnds --------------------
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 33e47e8c86ed..bc285bf18c31 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -106,9 +106,10 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent,
SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_TABULATOR ), rAttr ),
- aTabBox ( this, CUI_RES( ED_TABPOS ) ),
aTabLabel ( this, CUI_RES( FL_TABPOS ) ),
+ aTabBox ( this, CUI_RES( ED_TABPOS ) ),
aTabLabelVert ( this, CUI_RES( FL_TABPOS_VERT ) ),
+ aTabTypeLabel ( this, CUI_RES( FL_TABTYPE ) ),
aLeftTab ( this, CUI_RES( BTN_TABTYPE_LEFT ) ),
aRightTab ( this, CUI_RES( BTN_TABTYPE_RIGHT ) ),
aCenterTab ( this, CUI_RES( BTN_TABTYPE_CENTER ) ),
@@ -119,14 +120,13 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent,
pDezWin ( new TabWin_Impl( this, CUI_RES( WIN_TABDECIMAL ), (sal_uInt16)(RULER_TAB_DECIMAL|WB_HORZ) ) ),
aDezCharLabel ( this, CUI_RES( FT_TABTYPE_DECCHAR ) ),
aDezChar ( this, CUI_RES( ED_TABTYPE_DECCHAR ) ),
- aTabTypeLabel ( this, CUI_RES( FL_TABTYPE ) ),
+ aFillLabel ( this, CUI_RES( FL_FILLCHAR ) ),
aNoFillChar ( this, CUI_RES( BTN_FILLCHAR_NO ) ),
aFillPoints ( this, CUI_RES( BTN_FILLCHAR_POINTS ) ),
aFillDashLine ( this, CUI_RES( BTN_FILLCHAR_DASHLINE ) ),
aFillSolidLine ( this, CUI_RES( BTN_FILLCHAR_UNDERSCORE ) ),
aFillSpecial ( this, CUI_RES( BTN_FILLCHAR_OTHER ) ),
aFillChar ( this, CUI_RES( ED_FILLCHAR_OTHER ) ),
- aFillLabel ( this, CUI_RES( FL_FILLCHAR ) ),
aNewBtn ( this, CUI_RES( BTN_NEW ) ),
aDelAllBtn ( this, CUI_RES( BTN_DELALL ) ),
aDelBtn ( this, CUI_RES( BTN_DEL ) ),
@@ -145,6 +145,7 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent,
aRightTab .SetText(String(CUI_RES( ST_RIGHTTAB_ASIAN )));
}
+ aFillChar.SetAccessibleName(String(CUI_RES( ST_FILLCHAR_OTHER )));
// diese Page braucht ExchangeSupport
SetExchangeSupport();
@@ -182,6 +183,22 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent,
aTabBox.SetDoubleClickHdl( LINK( this, SvxTabulatorTabPage, SelectHdl_Impl ) );
aTabBox.SetModifyHdl( LINK( this, SvxTabulatorTabPage, ModifyHdl_Impl ) );
+ aLeftTab.SetAccessibleRelationMemberOf( &aTabTypeLabel );
+ aRightTab.SetAccessibleRelationMemberOf( &aTabTypeLabel );
+ aCenterTab.SetAccessibleRelationMemberOf( &aTabTypeLabel );
+ aDezTab.SetAccessibleRelationMemberOf( &aTabTypeLabel );
+ aDezCharLabel.SetAccessibleRelationMemberOf( &aTabTypeLabel );
+ aDezChar.SetAccessibleRelationMemberOf( &aTabTypeLabel );
+
+ aNoFillChar.SetAccessibleRelationMemberOf( &aFillLabel );
+ aFillPoints.SetAccessibleRelationMemberOf( &aFillLabel );
+ aFillDashLine.SetAccessibleRelationMemberOf( &aFillLabel );
+ aFillSolidLine.SetAccessibleRelationMemberOf( &aFillLabel );
+ aFillSpecial.SetAccessibleRelationMemberOf( &aFillLabel );
+ aFillChar.SetAccessibleRelationMemberOf( &aFillLabel );
+
+ aFillChar.SetAccessibleRelationLabeledBy(&aFillSpecial);
+
// das Default-Dezimalzeichen vom System holen
LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() );
aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep().GetChar(0);
diff --git a/cui/source/tabpages/tabstpge.hrc b/cui/source/tabpages/tabstpge.hrc
index be3823fd9cd4..40bcc35dba0d 100644
--- a/cui/source/tabpages/tabstpge.hrc
+++ b/cui/source/tabpages/tabstpge.hrc
@@ -59,5 +59,8 @@
#define BTN_DELALL 52
#define ST_LEFTTAB_ASIAN 53
#define ST_RIGHTTAB_ASIAN 54
+//IAccessibility2 Implementation 2009-----
+#define ST_FILLCHAR_OTHER 55
+//-----IAccessibility2 Implementation 2009
#endif
diff --git a/cui/source/tabpages/tabstpge.src b/cui/source/tabpages/tabstpge.src
index 6a92d21d3ad4..e4f2c600a87e 100644
--- a/cui/source/tabpages/tabstpge.src
+++ b/cui/source/tabpages/tabstpge.src
@@ -207,40 +207,9 @@ TabPage RID_SVXPAGE_TABULATOR
{
Text [ en-US ] = "Righ~t/Bottom" ;
};
+ String ST_FILLCHAR_OTHER
+ {
+ Text [ en-US ] = "Character" ;
+ };
};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index c41f8f3f40bf..e9a27adc2cd4 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -158,6 +158,24 @@ SvxTextAnimationPage::SvxTextAnimationPage( Window* pWindow, const SfxItemSet& r
aBtnLeft.SetClickHdl( aLink );
aBtnRight.SetClickHdl( aLink );
aBtnDown.SetClickHdl( aLink );
+
+ aNumFldCount.SetAccessibleRelationLabeledBy( &aTsbEndless );
+ aMtrFldAmount.SetAccessibleRelationLabeledBy( &aTsbPixel );
+ aMtrFldDelay.SetAccessibleRelationLabeledBy( &aTsbAuto );
+
+ aBtnUp.SetAccessibleRelationLabeledBy( &aFtDirection );
+ aBtnLeft.SetAccessibleRelationLabeledBy( &aFtDirection );
+ aBtnRight.SetAccessibleRelationLabeledBy( &aFtDirection );
+ aBtnDown.SetAccessibleRelationLabeledBy( &aFtDirection );
+
+ aBtnUp.SetAccessibleRelationMemberOf( &aFlEffect );
+ aBtnLeft.SetAccessibleRelationMemberOf( &aFlEffect );
+ aBtnRight.SetAccessibleRelationMemberOf( &aFlEffect );
+ aBtnDown.SetAccessibleRelationMemberOf( &aFlEffect );
+
+ aTsbEndless.SetAccessibleRelationLabeledBy( &aFtCount );
+ aTsbPixel.SetAccessibleRelationLabeledBy( &aFtAmount );
+ aTsbAuto.SetAccessibleRelationLabeledBy( &aFtDelay );
}
/*************************************************************************
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index bb13af3703ab..aa2eb7f30573 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -144,6 +144,8 @@ SvxTextAttrPage::SvxTextAttrPage( Window* pWindow, const SfxItemSet& rInAttrs )
aTsbFullWidth.SetClickHdl(
LINK( this, SvxTextAttrPage, ClickFullWidthHdl_Impl ) );
+
+ aCtlPosition.SetAccessibleRelationMemberOf( &aFlPosition );
}
/*************************************************************************
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 45469938b099..0cf286217982 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -57,7 +57,7 @@
#include "svx/dlgutil.hxx"
#include <svl/intitem.hxx> //add CHINA001
#include <sfx2/request.hxx>//add CHINA001
-
+#include "paragrph.hrc"
#define DLGWIN this->GetParent()->GetParent()
// static ----------------------------------------------------------------
@@ -288,6 +288,11 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(Window* pParent, const SfxItemSet
{
FreeResource();
+ String accName = String(CUI_RES(STR_EXAMPLE));
+ aCtlBitmapPreview.SetAccessibleName(accName);
+ aCtlXRectPreview.SetAccessibleName(accName);
+ aMtrTransparent.SetAccessibleRelationLabeledBy( &aRbtTransLinear );
+
// main selection
aRbtTransOff.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransOffHdl_Impl));
aRbtTransLinear.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransLinearHdl_Impl));
@@ -670,6 +675,10 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
{
FreeResource();
+ String accName = String(CUI_RES(STR_EXAMPLE));
+ aCtlXRectPreview.SetAccessibleName(accName);
+ aCtlBitmapPreview.SetAccessibleName(accName);
+
// Gruppen, die sich ueberlagern
aLbBitmap.Hide();
aCtlBitmapPreview.Hide();
@@ -766,6 +775,15 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
// #i76307# always paint the preview in LTR, because this is what the document does
aCtlXRectPreview.EnableRTL(sal_False);
+
+ aNumFldStepCount.SetAccessibleRelationLabeledBy( &aTsbStepCount );
+ aCtlPosition.SetAccessibleRelationMemberOf( &aFlPosition );
+ aLbHatchBckgrdColor.SetAccessibleRelationLabeledBy( &aCbxHatchBckgrd );
+ aLbHatchBckgrdColor.SetAccessibleName(aCbxHatchBckgrd.GetText());
+
+ aLbColor.SetAccessibleRelationMemberOf( &aFlProp );
+ aMtrFldOffset.SetAccessibleRelationLabeledBy(&aFlOffset);
+ aMtrFldOffset.SetAccessibleName(aFlOffset.GetText());
}
// -----------------------------------------------------------------------
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 640df280f066..131f6c5674f9 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -71,6 +71,7 @@
#include <svx/svxdlg.hxx> //CHINA001
#include <dialmgr.hxx>
#include "sfx2/opengrf.hxx"
+#include "paragrph.hrc"
#define DLGWIN this->GetParent()->GetParent()
@@ -148,6 +149,16 @@ SvxBitmapTabPage::SvxBitmapTabPage
aLbBackgroundColor.SetSelectHdl(
LINK( this, SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl ) );
+ String accName = String(SVX_RES(STR_EXAMPLE));
+ aCtlPreview.SetAccessibleName(accName);
+ aCtlPixel.SetAccessibleRelationMemberOf( &aFlProp );
+ aCtlPixel.SetAccessibleRelationLabeledBy( &aFtPixelEdit );
+ aLbBitmaps.SetAccessibleRelationLabeledBy(&aLbBitmaps);
+ aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnModify.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnImport.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp );
+
}
// -----------------------------------------------------------------------
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index d1e39b9cd8a0..2a34f5beb702 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -173,6 +173,11 @@ SvxColorTabPage::SvxColorTabPage
aValSetColorTable.SetExtraSpacing( 0 );
aValSetColorTable.Show();
+ aLbColorModel.SetAccessibleName( String( CUI_RES(STR_CUI_COLORMODEL) ) );
+ aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnModify.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnWorkOn.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp );
}
// -----------------------------------------------------------------------
@@ -1121,6 +1126,12 @@ IMPL_LINK( SvxColorTabPage, SelectColorModelHdl_Impl, void *, EMPTYARG )
aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) );
aMtrFldColorModel4.SetValue( ColorToPercent_Impl( aAktuellColor.GetTransparency() ) );
}
+
+ aMtrFldColorModel1.SetAccessibleName( GetNonMnemonicString(aFtColorModel1.GetText()) );
+ aMtrFldColorModel2.SetAccessibleName( GetNonMnemonicString(aFtColorModel2.GetText()) );
+ aMtrFldColorModel3.SetAccessibleName( GetNonMnemonicString(aFtColorModel3.GetText()) );
+ aMtrFldColorModel4.SetAccessibleName( GetNonMnemonicString(aFtColorModel4.GetText()) );
+
return( 0L );
}
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 63a2f3bbfd4e..3947a4d85aba 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -54,6 +54,7 @@
#include <dialmgr.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
+#include "paragrph.hrc"
#define DLGWIN this->GetParent()->GetParent()
@@ -114,6 +115,10 @@ SvxGradientTabPage::SvxGradientTabPage
FreeResource();
+ aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
+ aLbGradients.SetAccessibleName( GetText());
+
+
// diese Page braucht ExchangeSupport
SetExchangeSupport();
@@ -154,6 +159,11 @@ SvxGradientTabPage::SvxGradientTabPage
aBtnSave.SetClickHdl(
LINK( this, SvxGradientTabPage, ClickSaveHdl_Impl ) );
+ aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnModify.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp );
+ aLbGradients.SetAccessibleRelationLabeledBy(&aLbGradients);
+
// #i76307# always paint the preview in LTR, because this is what the document does
aCtlPreview.EnableRTL( sal_False );
}
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 556268f2e025..b05d32fbec1a 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -54,6 +54,7 @@
#include <dialmgr.hxx>
#include "svx/dlgutil.hxx"
#include <svx/dialmgr.hxx>
+#include "paragrph.hrc"
#include <svx/dialogs.hrc>
#define DLGWIN this->GetParent()->GetParent()
@@ -153,6 +154,15 @@ SvxHatchTabPage::SvxHatchTabPage
aBtnSave.SetClickHdl( LINK( this, SvxHatchTabPage, ClickSaveHdl_Impl ) );
aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+
+ aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
+ aLbHatchings.SetAccessibleName( String(CUI_RES(STR_LB_HATCHINGSTYLE)) );
+ aCtlAngle.SetAccessibleRelationMemberOf( &aFlProp );
+ aLbHatchings.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnModify.SetAccessibleRelationMemberOf( &aFlProp );
+ aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp );
+ aLbHatchings.SetAccessibleRelationLabeledBy(&aLbHatchings);
}
// -----------------------------------------------------------------------
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index f4edeaa6d392..7c4eea588c86 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -68,6 +68,7 @@
#include <svx/gallery.hxx>
#include <svx/xbitmap.hxx>
#include <unotools/localfilehelper.hxx>
+#include "paragrph.hrc"
#include "sfx2/opengrf.hxx"
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
@@ -105,6 +106,7 @@ SvxLineTabPage::SvxLineTabPage
const SfxItemSet& rInAttrs
) :
SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_LINE ), rInAttrs ),
+ aFlLine ( this, CUI_RES( FL_LINE ) ),
aFtLineStyle ( this, CUI_RES( FT_LINE_STYLE ) ),
aLbLineStyle ( this, CUI_RES( LB_LINE_STYLE ) ),
aFtColor ( this, CUI_RES( FT_COLOR ) ),
@@ -113,19 +115,18 @@ SvxLineTabPage::SvxLineTabPage
aMtrLineWidth ( this, CUI_RES( MTR_FLD_LINE_WIDTH ) ),
aFtTransparent ( this, CUI_RES( FT_TRANSPARENT ) ),
aMtrTransparent ( this, CUI_RES( MTR_LINE_TRANSPARENT ) ),
- aFlLine ( this, CUI_RES( FL_LINE ) ),
- aFtLineEndsStyle ( this, CUI_RES( FT_LINE_ENDS_STYLE ) ),
+ aFlLineEnds ( this, CUI_RES( FL_LINE_ENDS ) ),
aLbStartStyle ( this, CUI_RES( LB_START_STYLE ) ),
- aFtLineEndsWidth ( this, CUI_RES( FT_LINE_ENDS_WIDTH ) ),
aMtrStartWidth ( this, CUI_RES( MTR_FLD_START_WIDTH ) ),
aTsbCenterStart ( this, CUI_RES( TSB_CENTER_START ) ),
+ aFtLineEndsStyle ( this, CUI_RES( FT_LINE_ENDS_STYLE ) ),
aLbEndStyle ( this, CUI_RES( LB_END_STYLE ) ),
+ aFtLineEndsWidth ( this, CUI_RES( FT_LINE_ENDS_WIDTH ) ),
aMtrEndWidth ( this, CUI_RES( MTR_FLD_END_WIDTH ) ),
aTsbCenterEnd ( this, CUI_RES( TSB_CENTER_END ) ),
aCbxSynchronize ( this, CUI_RES( CBX_SYNCHRONIZE ) ),
- aFlLineEnds ( this, CUI_RES( FL_LINE_ENDS ) ),
- aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ),
aFLSeparator ( this, CUI_RES( FL_SEPARATOR ) ),
+ aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ),
// #116827#
maFLEdgeStyle ( this, CUI_RES( FL_EDGE_STYLE ) ),
@@ -165,8 +166,18 @@ SvxLineTabPage::SvxLineTabPage
pnColorTableState( 0 ),
nPageType ( 0 )//CHINA001 pPageType ( NULL ),
{
+ aLbEndStyle.SetAccessibleName(String(CUI_RES(STR_STYLE)));
+ aLbStartStyle.SetAccessibleName(String(CUI_RES( STR_LB_START_STYLE ) ) );
+ aMtrStartWidth.SetAccessibleName(String(CUI_RES( STR_MTR_FLD_START_WIDTH ) ) );
+ aLbEndStyle.SetAccessibleName(String(CUI_RES( STR_LB_END_STYLE ) ) );
+ aMtrEndWidth.SetAccessibleName(String(CUI_RES( STR_MTR_FLD_END_WIDTH ) ) );
+ aTsbCenterStart.SetAccessibleName(String(CUI_RES( STR_CENTER_START ) ) );
+ aTsbCenterEnd.SetAccessibleName(String(CUI_RES( STR_CENTER_END ) ) );
+
FreeResource();
+ aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
+
// diese Page braucht ExchangeSupport
SetExchangeSupport();
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index d70cb46fb1bc..7c61d05ed8f4 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -113,6 +113,13 @@ SvxLineDefTabPage::SvxLineDefTabPage
aBtnLoad.SetModeImage( Image( CUI_RES( RID_SVXIMG_LOAD_H ) ), BMP_COLOR_HIGHCONTRAST );
aBtnSave.SetModeImage( Image( CUI_RES( RID_SVXIMG_SAVE_H ) ), BMP_COLOR_HIGHCONTRAST );
+ aLbType1.SetAccessibleName(String(CUI_RES( STR_START_TYPE ) ) );
+ aLbType2.SetAccessibleName(String(CUI_RES( STR_END_TYPE ) ) );
+ aNumFldNumber1.SetAccessibleName(String(CUI_RES( STR_START_NUM ) ) );
+ aNumFldNumber2.SetAccessibleName(String(CUI_RES( STR_END_NUM ) ) );
+ aMtrLength1.SetAccessibleName(String(CUI_RES( STR_START_LENGTH ) ) );
+ aMtrLength2.SetAccessibleName(String(CUI_RES( STR_END_LENGTH ) ) );
+
FreeResource();
// diese Page braucht ExchangeSupport
@@ -175,6 +182,12 @@ SvxLineDefTabPage::SvxLineDefTabPage
aMtrDistance.SetModifyHdl( aLink );
pDashList = NULL;
+
+ aBtnAdd.SetAccessibleRelationMemberOf( &aFlDefinition );
+ aBtnModify.SetAccessibleRelationMemberOf( &aFlDefinition );
+ aBtnDelete.SetAccessibleRelationMemberOf( &aFlDefinition );
+ aBtnLoad.SetAccessibleRelationMemberOf( &aFlDefinition );
+ aBtnSave.SetAccessibleRelationMemberOf( &aFlDefinition );
}
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 4422d98247c1..4de0960a5610 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -135,6 +135,9 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage
aLbLineEnds.SetSelectHdl(
LINK( this, SvxLineEndDefTabPage, SelectLineEndHdl_Impl ) );
+ aBtnAdd.SetAccessibleRelationMemberOf(&aFlTip);
+ aBtnModify.SetAccessibleRelationMemberOf(&aFlTip);
+ aBtnDelete.SetAccessibleRelationMemberOf(&aFlTip);
}
//------------------------------------------------------------------------
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 7681bca4956a..b4ed21ef0aad 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -46,7 +46,7 @@
#include <dialmgr.hxx>
#include "svx/dlgutil.hxx"
#include <cuitabline.hxx>
-
+#include "paragrph.hrc"
#include <svx/xlineit0.hxx>
#include <sfx2/request.hxx> //add CHINA001
@@ -188,6 +188,8 @@ SvxShadowTabPage::SvxShadowTabPage( Window* pParent, const SfxItemSet& rInAttrs
aMtrTransparent.SetModifyHdl( aLink );
aMtrDistance.SetModifyHdl( aLink );
+ aCtlXRectPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE)));
+ aCtlPosition.SetAccessibleRelationMemberOf( &aFlProp );
}
// -----------------------------------------------------------------------
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index ab73b6329e15..3d8deb015039 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -249,6 +249,11 @@ SvxAngleTabPage::SvxAngleTabPage( Window* pParent, const SfxItemSet& rInAttrs )
ePoolUnit = pPool->GetMetric(SID_ATTR_TRANSFORM_POS_X);
aMtrAngle.SetModifyHdl(LINK( this, SvxAngleTabPage, ModifiedHdl));
+
+ aCtlRect.SetAccessibleRelationLabeledBy(&aFtPosPresets);
+ aCtlRect.SetAccessibleRelationMemberOf(&aFlPosition);
+ aCtlAngle.SetAccessibleRelationLabeledBy(&aFtAnglePresets);
+ aCtlAngle.SetAccessibleRelationMemberOf(&aFlAngle);
}
// -----------------------------------------------------------------------
@@ -765,6 +770,10 @@ SvxPositionSizeTabPage::SvxPositionSizeTabPage( Window* pParent, const SfxItemSe
maTsbPosProtect.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ChangePosProtectHdl ) );
maTsbSizeProtect.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ChangeSizeProtectHdl ) );
+ maCtlPos.SetAccessibleRelationMemberOf( &maFlPosition );
+ maCtlSize.SetAccessibleRelationMemberOf( &maFlSize );
+ maCtlPos.SetAccessibleRelationLabeledBy( &maFtPosReference );
+ maCtlSize.SetAccessibleRelationLabeledBy( &maFtSizeReference );
}
// -----------------------------------------------------------------------
diff --git a/dbaccess/prj/build.lst b/dbaccess/prj/build.lst
index 10227f111e60..ca2fa71856e7 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 test NULL
+ba dbaccess : L10N: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
diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx
index 6d9d1eba083a..53e6f5907401 100644
--- a/dbaccess/source/ui/uno/ColumnControl.cxx
+++ b/dbaccess/source/ui/uno/ColumnControl.cxx
@@ -61,7 +61,7 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sdbc;
OColumnControl::OColumnControl(const Reference<XMultiServiceFactory>& _rxFactory)
-: m_xORB(_rxFactory)
+ :UnoControl( _rxFactory )
{
}
// -----------------------------------------------------------------------------
@@ -87,7 +87,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit
pParentWin = pParent->GetWindow();
}
- OColumnPeer* pPeer = new OColumnPeer(pParentWin,m_xORB);
+ OColumnPeer* pPeer = new OColumnPeer( pParentWin, maContext.getLegacyServiceFactory() );
OSL_ENSURE(pPeer != NULL, "FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !");
setPeer( pPeer );
diff --git a/dbaccess/source/ui/uno/ColumnControl.hxx b/dbaccess/source/ui/uno/ColumnControl.hxx
index 866eba99b18c..4d2a7de9829d 100644
--- a/dbaccess/source/ui/uno/ColumnControl.hxx
+++ b/dbaccess/source/ui/uno/ColumnControl.hxx
@@ -38,7 +38,6 @@ namespace dbaui
{
class OColumnControl : public UnoControl
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xORB;
public:
OColumnControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index 146579cab8bc..fc782c35a71b 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh filter LIBXSLT:libxslt NULL
+dt desktop : L10N:l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh filter LIBXSLT:libxslt NULL
dt desktop usr1 - all dt_mkout NULL
dt desktop\inc nmake - all dt_inc NULL
dt desktop\prj get - all dt_prj NULL
diff --git a/editeng/inc/editeng/editrids.hrc b/editeng/inc/editeng/editrids.hrc
index dcef661d01b8..209d284a7fde 100644
--- a/editeng/inc/editeng/editrids.hrc
+++ b/editeng/inc/editeng/editrids.hrc
@@ -240,45 +240,6 @@
#define RID_SVXITEMS_WEIGHT_ULTRABOLD (RID_EDIT_START + 167)
#define RID_SVXITEMS_WEIGHT_BLACK (RID_EDIT_START + 168)
-// paper formats
-#define RID_SVXSTR_PAPER_A0 (RID_SVX_START + 169)
-#define RID_SVXSTR_PAPER_A1 (RID_SVX_START + 170)
-#define RID_SVXSTR_PAPER_A2 (RID_SVX_START + 171)
-#define RID_SVXSTR_PAPER_A3 (RID_SVX_START + 172)
-#define RID_SVXSTR_PAPER_A4 (RID_SVX_START + 173)
-#define RID_SVXSTR_PAPER_A5 (RID_SVX_START + 174)
-#define RID_SVXSTR_PAPER_B4_ISO (RID_SVX_START + 175)
-#define RID_SVXSTR_PAPER_B5_ISO (RID_SVX_START + 176)
-#define RID_SVXSTR_PAPER_LETTER (RID_SVX_START + 177)
-#define RID_SVXSTR_PAPER_LEGAL (RID_SVX_START + 178)
-#define RID_SVXSTR_PAPER_TABLOID (RID_SVX_START + 179)
-#define RID_SVXSTR_PAPER_USER (RID_SVX_START + 180)
-#define RID_SVXSTR_PAPER_B6_ISO (RID_SVX_START + 181)
-#define RID_SVXSTR_PAPER_C4 (RID_SVX_START + 182)
-#define RID_SVXSTR_PAPER_C5 (RID_SVX_START + 183)
-#define RID_SVXSTR_PAPER_C6 (RID_SVX_START + 184)
-#define RID_SVXSTR_PAPER_C65 (RID_SVX_START + 185)
-#define RID_SVXSTR_PAPER_DL (RID_SVX_START + 186)
-#define RID_SVXSTR_PAPER_DIA (RID_SVX_START + 187)
-#define RID_SVXSTR_PAPER_SCREEN (RID_SVX_START + 188)
-#define RID_SVXSTR_PAPER_C (RID_SVX_START + 189)
-#define RID_SVXSTR_PAPER_D (RID_SVX_START + 190)
-#define RID_SVXSTR_PAPER_E (RID_SVX_START + 191)
-#define RID_SVXSTR_PAPER_EXECUTIVE (RID_SVX_START + 192)
-#define RID_SVXSTR_PAPER_LEGAL2 (RID_SVX_START + 193)
-#define RID_SVXSTR_PAPER_MONARCH (RID_SVX_START + 194)
-#define RID_SVXSTR_PAPER_COM675 (RID_SVX_START + 195)
-#define RID_SVXSTR_PAPER_COM9 (RID_SVX_START + 196)
-#define RID_SVXSTR_PAPER_COM10 (RID_SVX_START + 197)
-#define RID_SVXSTR_PAPER_COM11 (RID_SVX_START + 198)
-#define RID_SVXSTR_PAPER_COM12 (RID_SVX_START + 199)
-#define RID_SVXSTR_PAPER_KAI16 (RID_SVX_START + 200)
-#define RID_SVXSTR_PAPER_KAI32 (RID_SVX_START + 201)
-#define RID_SVXSTR_PAPER_KAI32BIG (RID_SVX_START + 202)
-#define RID_SVXSTR_PAPER_B4_JIS (RID_SVX_START + 203)
-#define RID_SVXSTR_PAPER_B5_JIS (RID_SVX_START + 204)
-#define RID_SVXSTR_PAPER_B6_JIS (RID_SVX_START + 205)
-
// enum FontItalic -------------------------------------------------------
#define RID_SVXITEMS_ITALIC_BEGIN (RID_EDIT_START + 206)
#define RID_SVXITEMS_ITALIC_NONE (RID_EDIT_START + 206)
diff --git a/editeng/prj/build.lst b/editeng/prj/build.lst
index 3c714c6dac25..bba7f2666744 100644
--- a/editeng/prj/build.lst
+++ b/editeng/prj/build.lst
@@ -1,3 +1,3 @@
-ed editeng : l10n svtools xmloff linguistic NULL
+ed editeng : L10N:l10n svtools xmloff linguistic NULL
ed editeng\prj nmake - all ed_prj NULL
diff --git a/editeng/source/items/page.src b/editeng/source/items/page.src
index 9fe7f3013ce6..c528dc8b0bd0 100644
--- a/editeng/source/items/page.src
+++ b/editeng/source/items/page.src
@@ -29,154 +29,6 @@
#include <editeng/editrids.hrc>
-String RID_SVXSTR_PAPER_A0
-{
- Text = "A0" ;
-};
-String RID_SVXSTR_PAPER_A1
-{
- Text = "A1" ;
-};
-String RID_SVXSTR_PAPER_A2
-{
- Text = "A2" ;
-};
-String RID_SVXSTR_PAPER_A3
-{
- Text = "A3" ;
-};
-String RID_SVXSTR_PAPER_A4
-{
- Text = "A4" ;
-};
-String RID_SVXSTR_PAPER_A5
-{
- Text = "A5" ;
-};
-String RID_SVXSTR_PAPER_B4_ISO
-{
- Text = "B4 (ISO)" ;
-};
-String RID_SVXSTR_PAPER_B5_ISO
-{
- Text = "B5 (ISO)" ;
-};
-String RID_SVXSTR_PAPER_LETTER
-{
- Text = "Letter" ;
-};
-String RID_SVXSTR_PAPER_LEGAL
-{
- Text = "Legal" ;
-};
-String RID_SVXSTR_PAPER_TABLOID
-{
- Text = "Tabloid" ;
-};
-String RID_SVXSTR_PAPER_USER
-{
- Text [ en-US ] = "User Defined" ;
-};
-String RID_SVXSTR_PAPER_B6_ISO
-{
- Text = "B6 (ISO)" ;
-};
-String RID_SVXSTR_PAPER_C4
-{
- Text = "C4 Envelope" ;
-};
-String RID_SVXSTR_PAPER_C5
-{
- Text = "C5 Envelope" ;
-};
-String RID_SVXSTR_PAPER_C6
-{
- Text = "C6 Envelope" ;
-};
-String RID_SVXSTR_PAPER_C65
-{
- Text = "C6/5 Envelope" ;
-};
-String RID_SVXSTR_PAPER_DL
-{
- Text = "DL Envelope" ;
-};
-String RID_SVXSTR_PAPER_DIA
-{
- Text = "Dia Slide" ;
-};
-String RID_SVXSTR_PAPER_SCREEN
-{
- Text [ en-US ] = "Screen" ;
-};
-String RID_SVXSTR_PAPER_C
-{
- Text = "C" ;
-};
-String RID_SVXSTR_PAPER_D
-{
- Text = "D" ;
-};
-String RID_SVXSTR_PAPER_E
-{
- Text = "E" ;
-};
-String RID_SVXSTR_PAPER_EXECUTIVE
-{
- Text = "Executive" ;
-};
-String RID_SVXSTR_PAPER_LEGAL2
-{
- Text = "Long Bond" ;
-};
-String RID_SVXSTR_PAPER_MONARCH
-{
- Text = "#8 (Monarch) Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM675
-{
- Text = "#6 3/4 (Personal) Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM9
-{
- Text = "#9 Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM10
-{
- Text = "#10 Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM11
-{
- Text = "#11 Envelope" ;
-};
-String RID_SVXSTR_PAPER_COM12
-{
- Text = "#12 Envelope" ;
-};
-String RID_SVXSTR_PAPER_KAI16
-{
- Text = "16 Kai" ;
-};
-String RID_SVXSTR_PAPER_KAI32
-{
- Text = "32 Kai" ;
-};
-String RID_SVXSTR_PAPER_KAI32BIG
-{
- Text = "Big 32 Kai" ;
-};
-String RID_SVXSTR_PAPER_B4_JIS
-{
- Text = "B4 (JIS)" ;
-};
-String RID_SVXSTR_PAPER_B5_JIS
-{
- Text = "B5 (JIS)" ;
-};
-String RID_SVXSTR_PAPER_B6_JIS
-{
- Text = "B6 (JIS)" ;
-};
String RID_SVXSTR_PAPERBIN
{
Text [ en-US ] = "Paper tray" ;
diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx
index 3d79b980ec1d..8ba97193c3bc 100644
--- a/editeng/source/items/paperinf.cxx
+++ b/editeng/source/items/paperinf.cxx
@@ -135,51 +135,7 @@ Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit )
String SvxPaperInfo::GetName( Paper ePaper )
{
- sal_uInt16 nResId = 0;
-
- switch ( ePaper )
- {
- case PAPER_A0: nResId = RID_SVXSTR_PAPER_A0; break;
- case PAPER_A1: nResId = RID_SVXSTR_PAPER_A1; break;
- case PAPER_A2: nResId = RID_SVXSTR_PAPER_A2; break;
- case PAPER_A3: nResId = RID_SVXSTR_PAPER_A3; break;
- case PAPER_A4: nResId = RID_SVXSTR_PAPER_A4; break;
- case PAPER_A5: nResId = RID_SVXSTR_PAPER_A5; break;
- case PAPER_B4_ISO: nResId = RID_SVXSTR_PAPER_B4_ISO; break;
- case PAPER_B5_ISO: nResId = RID_SVXSTR_PAPER_B5_ISO; break;
- case PAPER_LETTER: nResId = RID_SVXSTR_PAPER_LETTER; break;
- case PAPER_LEGAL: nResId = RID_SVXSTR_PAPER_LEGAL; break;
- case PAPER_TABLOID: nResId = RID_SVXSTR_PAPER_TABLOID; break;
- case PAPER_USER: nResId = RID_SVXSTR_PAPER_USER; break;
- case PAPER_B6_ISO: nResId = RID_SVXSTR_PAPER_B6_ISO; break;
- case PAPER_ENV_C4: nResId = RID_SVXSTR_PAPER_C4; break;
- case PAPER_ENV_C5: nResId = RID_SVXSTR_PAPER_C5; break;
- case PAPER_ENV_C6: nResId = RID_SVXSTR_PAPER_C6; break;
- case PAPER_ENV_C65: nResId = RID_SVXSTR_PAPER_C65; break;
- case PAPER_ENV_DL: nResId = RID_SVXSTR_PAPER_DL; break;
- case PAPER_SLIDE_DIA: nResId = RID_SVXSTR_PAPER_DIA; break;
- case PAPER_SCREEN: nResId = RID_SVXSTR_PAPER_SCREEN; break;
- case PAPER_C: nResId = RID_SVXSTR_PAPER_C; break;
- case PAPER_D: nResId = RID_SVXSTR_PAPER_D; break;
- case PAPER_E: nResId = RID_SVXSTR_PAPER_E; break;
- case PAPER_EXECUTIVE: nResId = RID_SVXSTR_PAPER_EXECUTIVE;break;
- case PAPER_FANFOLD_LEGAL_DE: nResId = RID_SVXSTR_PAPER_LEGAL2; break;
- case PAPER_ENV_MONARCH: nResId = RID_SVXSTR_PAPER_MONARCH; break;
- case PAPER_ENV_PERSONAL: nResId = RID_SVXSTR_PAPER_COM675; break;
- case PAPER_ENV_9: nResId = RID_SVXSTR_PAPER_COM9; break;
- case PAPER_ENV_10: nResId = RID_SVXSTR_PAPER_COM10; break;
- case PAPER_ENV_11: nResId = RID_SVXSTR_PAPER_COM11; break;
- case PAPER_ENV_12: nResId = RID_SVXSTR_PAPER_COM12; break;
- case PAPER_KAI16: nResId = RID_SVXSTR_PAPER_KAI16; break;
- case PAPER_KAI32: nResId = RID_SVXSTR_PAPER_KAI32; break;
- case PAPER_KAI32BIG: nResId = RID_SVXSTR_PAPER_KAI32BIG; break;
- case PAPER_B4_JIS: nResId = RID_SVXSTR_PAPER_B4_JIS; break;
- case PAPER_B5_JIS: nResId = RID_SVXSTR_PAPER_B5_JIS; break;
- case PAPER_B6_JIS: nResId = RID_SVXSTR_PAPER_B6_JIS; break;
- default: DBG_ERRORFILE( "unknown papersize" );
- }
-
- return ( nResId > 0 ) ? String( EditResId( nResId ) ) : String();
+ return String( Printer::GetPaperName( ePaper ) );
}
diff --git a/extensions/prj/build.lst b/extensions/prj/build.lst
index f283da39a4af..e21035fe1163 100644
--- a/extensions/prj/build.lst
+++ b/extensions/prj/build.lst
@@ -1,4 +1,4 @@
-ex extensions : officecfg l10n rdbmaker svx SANE:sane TWAIN:twain np_sdk offuh stoc ZLIB:zlib CURL:curl LIBXSLT:libxslt NULL
+ex extensions : officecfg L10N:l10n rdbmaker svx SANE:sane TWAIN:twain np_sdk offuh stoc ZLIB:zlib CURL:curl LIBXSLT:libxslt NULL
ex extensions usr1 - all ex_mkout NULL
ex extensions\inc nmake - all ex_inc NULL
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 9956cfe86428..69d8835dcdd5 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -238,6 +238,9 @@ namespace dbp
m_aExistingRadios.EnableMultiSelection(sal_True);
getDialog()->defaultButton(&m_aMoveRight);
+
+ m_aExistingRadios.SetAccessibleRelationMemberOf(&m_aExistingRadios);
+ m_aExistingRadios.SetAccessibleRelationLabeledBy(&m_aExistingRadiosLabel);
}
//---------------------------------------------------------------------
@@ -368,6 +371,8 @@ namespace dbp
announceControls(m_aDefSelYes, m_aDefSelNo, m_aDefSelection);
m_aDefSelection.SetDropDownLineCount(10);
+ m_aDefSelection.SetAccessibleRelationLabeledBy( &m_aDefSelYes );
+ m_aDefSelection.SetAccessibleRelationMemberOf(&m_aDefaultSelectionLabel);
}
//---------------------------------------------------------------------
@@ -418,6 +423,9 @@ namespace dbp
FreeResource();
m_aOptions.SetSelectHdl(LINK(this, OOptionValuesPage, OnOptionSelected));
+
+ m_aOptions.SetAccessibleRelationMemberOf(&m_aOptions);
+ m_aOptions.SetAccessibleRelationLabeledBy(&m_aOptionsLabel);
}
//---------------------------------------------------------------------
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 5452a95129ff..496ec6fea8db 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -915,7 +915,7 @@ HRESULT InterfaceOleWrapper_Impl::doInvoke( DISPPARAMS * pdispparams, VARIANT *
HRESULT ret= S_OK;
try
{
- Sequence<INT16> outIndex;
+ Sequence<sal_Int16> outIndex;
Sequence<Any> outParams;
Any returnValue;
diff --git a/extensions/source/oooimprovement/onlogrotate_job.cxx b/extensions/source/oooimprovement/onlogrotate_job.cxx
index d83c43bfcfd8..e1f9cf717584 100644
--- a/extensions/source/oooimprovement/onlogrotate_job.cxx
+++ b/extensions/source/oooimprovement/onlogrotate_job.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <osl/mutex.hxx>
+#include <osl/conditn.hxx>
#include <osl/thread.hxx>
#include <osl/time.h>
#include <cppuhelper/implbase1.hxx>
@@ -108,49 +108,41 @@ namespace
public:
OnLogRotateThread(Reference<XMultiServiceFactory> sf);
virtual void SAL_CALL run();
- OnLogRotateThread* disposing();
+ void stop();
private:
Reference<XMultiServiceFactory> m_ServiceFactory;
- ::osl::Mutex m_ServiceFactoryMutex;
+ ::osl::Condition m_Stop;
};
OnLogRotateThread::OnLogRotateThread(Reference<XMultiServiceFactory> sf)
: m_ServiceFactory(sf)
- { }
+ {
+ OSL_ASSERT(sf.is());
+ }
void SAL_CALL OnLogRotateThread::run()
{
+ TimeValue wait_intervall = {30,0};
+ if (m_Stop.wait(&wait_intervall) == ::osl::Condition::result_timeout)
{
- ::osl::Thread::yield();
- TimeValue wait_intervall = {30,0};
- osl_waitThread(&wait_intervall);
- }
- {
- ::osl::Guard< ::osl::Mutex> service_factory_guard(m_ServiceFactoryMutex);
try
{
- if(m_ServiceFactory.is())
+ if(Config(m_ServiceFactory).getInvitationAccepted())
{
- if(Config(m_ServiceFactory).getInvitationAccepted())
- {
- packLogs(m_ServiceFactory);
- uploadLogs(m_ServiceFactory);
- }
- else
- LogStorage(m_ServiceFactory).clear();
+ packLogs(m_ServiceFactory);
+ uploadLogs(m_ServiceFactory);
}
- m_ServiceFactory.clear();
+ else
+ LogStorage(m_ServiceFactory).clear();
}
catch(...) {}
}
}
- OnLogRotateThread* OnLogRotateThread::disposing()
+ void OnLogRotateThread::stop()
{
- ::osl::Guard< ::osl::Mutex> service_factory_guard(m_ServiceFactoryMutex);
- m_ServiceFactory.clear();
- return this;
+ m_Stop.set();
}
class OnLogRotateThreadWatcher : public ::cppu::WeakImplHelper1<XTerminateListener>
@@ -163,7 +155,7 @@ namespace
}
virtual ~OnLogRotateThreadWatcher()
{
- m_Thread->disposing()->terminate();
+ m_Thread->stop();
m_Thread->join();
};
@@ -172,13 +164,13 @@ namespace
{ };
virtual void SAL_CALL notifyTermination(const EventObject&) throw(RuntimeException)
{
- m_Thread->disposing()->terminate();
+ m_Thread->stop();
m_Thread->join();
};
// XEventListener
virtual void SAL_CALL disposing(const EventObject&) throw(RuntimeException)
{
- m_Thread->disposing()->terminate();
+ m_Thread->stop();
m_Thread->join();
};
private:
diff --git a/filter/prj/build.lst b/filter/prj/build.lst
index 5617d28856f7..c8e839dcee5f 100644
--- a/filter/prj/build.lst
+++ b/filter/prj/build.lst
@@ -1,4 +1,4 @@
-fl filter : l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt basegfx NULL
+fl filter : L10N:l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt basegfx NULL
fl filter usr1 - all fl_mkout NULL
fl filter\prj get - all fl_prj NULL
fl filter\inc nmake - all fl_inc NULL
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 030e64ceaa65..3c81dbd778b9 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -473,6 +473,10 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent,
aNewPos.Y() -= nDelta;
maCbEmbedStandardFonts.SetPosPixel( aNewPos );
}
+
+ maEdPages.SetAccessibleName(maRbRange.GetText());
+ maEdPages.SetAccessibleRelationLabeledBy(&maRbRange);
+
maCbExportEmptyPages.SetStyle( maCbExportEmptyPages.GetStyle() | WB_VCENTER );
}
@@ -658,7 +662,8 @@ SfxTabPage* ImpPDFTabGeneralPage::Create( Window* pParent,
IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, EMPTYARG )
{
maEdPages.Enable( maRbRange.IsChecked() );
- maEdPages.SetReadOnly( !maRbRange.IsChecked() );
+ //Sym2_5805, When the control is disabled, it is also readonly. So here, it is not necessary to set it as readonly.
+ //maEdPages.SetReadOnly( !maRbRange.IsChecked() );
return 0;
}
@@ -695,7 +700,8 @@ IMPL_LINK( ImpPDFTabGeneralPage, ToggleAddStreamHdl, void*, EMPTYARG )
maRbRange.Enable( sal_False );
maRbSelection.Enable( sal_False );
maEdPages.Enable( sal_False );
- maEdPages.SetReadOnly( sal_True );
+ //Sym2_5805, When the control is disabled, it is also readonly. So here, it is not necessary to set it as readonly.
+ //maEdPages.SetReadOnly( sal_True );
maRbAll.Enable( sal_False );
}
else
@@ -711,9 +717,13 @@ IMPL_LINK( ImpPDFTabGeneralPage, ToggleAddStreamHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------------
IMPL_LINK( ImpPDFTabGeneralPage, ToggleExportPDFAHdl, void*, EMPTYARG )
{
+ ImpPDFTabSecurityPage* pSecPage = NULL;
//set the security page status (and its controls as well)
if( mpaParent && mpaParent->GetTabPage( RID_PDF_TAB_SECURITY ) )
- ( ( ImpPDFTabSecurityPage* )mpaParent->GetTabPage( RID_PDF_TAB_SECURITY ) )->ImplPDFASecurityControl( !maCbPDFA1b.IsChecked() );
+ {
+ pSecPage = static_cast<ImpPDFTabSecurityPage*>(mpaParent->GetTabPage( RID_PDF_TAB_SECURITY ));
+ pSecPage->ImplPDFASecurityControl( !maCbPDFA1b.IsChecked() );
+ }
//PDF/A-1 needs tagged PDF, so force disable the control, will be forced in pdfexport.
sal_Bool bPDFA1Sel = maCbPDFA1b.IsChecked();
@@ -748,6 +758,13 @@ IMPL_LINK( ImpPDFTabGeneralPage, ToggleExportPDFAHdl, void*, EMPTYARG )
if( mpaParent && mpaParent->GetTabPage( RID_PDF_TAB_LINKS ) )
( ( ImpPDFTabLinksPage* )mpaParent->GetTabPage( RID_PDF_TAB_LINKS ) )->ImplPDFALinkControl( !maCbPDFA1b.IsChecked() );
+ // if a password was set, inform the user that this will not be used in PDF/A case
+ if( maCbPDFA1b.IsChecked() && pSecPage && pSecPage->hasPassword() )
+ {
+ WarningBox aBox( this, PDFFilterResId( RID_PDF_WARNPDFAPASSWORD ) );
+ aBox.Execute();
+ }
+
return 0;
}
@@ -788,6 +805,8 @@ ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent,
maRbMagnFitWidth.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
maRbMagnFitVisible.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
maRbMagnZoom.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
+ maNumZoom.SetAccessibleName(maRbMagnZoom.GetText());
+ maNumZoom.SetAccessibleRelationLabeledBy(&maRbMagnZoom);
}
// -----------------------------------------------------------------------------
@@ -910,9 +929,8 @@ void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
}
}
-IMPL_LINK( ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl, void*, p )
+IMPL_LINK( ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl, void*, EMPTYARG )
{
- p = p; //for compiler warning
maCbPgLyFirstOnLeft.Enable( maRbPgLyContinueFacing.IsChecked() );
return 0;
}
@@ -951,6 +969,8 @@ ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent,
FreeResource();
maRbAllBookmarkLevels.SetToggleHdl( LINK( this, ImpPDFTabViewerPage, ToggleRbBookmarksHdl ) );
maRbVisibleBookmarkLevels.SetToggleHdl( LINK( this, ImpPDFTabViewerPage, ToggleRbBookmarksHdl ) );
+ maNumBookmarkLevels.SetAccessibleName(maRbVisibleBookmarkLevels.GetText());
+ maNumBookmarkLevels.SetAccessibleRelationLabeledBy(&maRbVisibleBookmarkLevels);
}
// -----------------------------------------------------------------------------
@@ -1024,10 +1044,13 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
maFtUserPwd( this, PDFFilterResId( FT_USER_PWD ) ),
maUserPwdSet( PDFFilterResId( STR_USER_PWD_SET ) ),
maUserPwdUnset( PDFFilterResId( STR_USER_PWD_UNSET ) ),
+ maUserPwdPdfa( PDFFilterResId( STR_USER_PWD_PDFA ) ),
+
maStrSetPwd( PDFFilterResId( STR_SET_PWD ) ),
maFtOwnerPwd( this, PDFFilterResId( FT_OWNER_PWD ) ),
maOwnerPwdSet( PDFFilterResId( STR_OWNER_PWD_SET ) ),
maOwnerPwdUnset( PDFFilterResId( STR_OWNER_PWD_UNSET ) ),
+ maOwnerPwdPdfa( PDFFilterResId( STR_OWNER_PWD_PDFA ) ),
maFlPrintPermissions( this, PDFFilterResId( FL_PRINT_PERMISSIONS ) ),
maRbPrintNone( this, PDFFilterResId( RB_PRINT_NONE ) ),
@@ -1219,10 +1242,21 @@ IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, void*, EMPTYARG )
void ImpPDFTabSecurityPage::enablePermissionControls()
{
- maFtUserPwd.SetText( (mbHaveUserPassword && IsEnabled()) ? maUserPwdSet : maUserPwdUnset );
+ sal_Bool bIsPDFASel = sal_False;
+ ImpPDFTabDialog* pParent = static_cast<ImpPDFTabDialog*>(GetTabDialog());
+ if( pParent && pParent->GetTabPage( RID_PDF_TAB_GENER ) )
+ bIsPDFASel = ( ( ImpPDFTabGeneralPage* )pParent->
+ GetTabPage( RID_PDF_TAB_GENER ) )->IsPdfaSelected();
+ if( bIsPDFASel )
+ maFtUserPwd.SetText( maUserPwdPdfa );
+ else
+ maFtUserPwd.SetText( (mbHaveUserPassword && IsEnabled()) ? maUserPwdSet : maUserPwdUnset );
sal_Bool bLocalEnable = mbHaveOwnerPassword && IsEnabled();
- maFtOwnerPwd.SetText( bLocalEnable ? maOwnerPwdSet : maOwnerPwdUnset );
+ if( bIsPDFASel )
+ maFtOwnerPwd.SetText( maOwnerPwdPdfa );
+ else
+ maFtOwnerPwd.SetText( bLocalEnable ? maOwnerPwdSet : maOwnerPwdUnset );
maFlPrintPermissions.Enable( bLocalEnable );
maRbPrintNone.Enable( bLocalEnable );
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index dccdc2cad11b..0946fe3197f8 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -33,6 +33,8 @@
#define RID_PDF_TAB_OPNFTR (RID_PDF_DIALOG_START + 3)
#define RID_PDF_TAB_SECURITY (RID_PDF_DIALOG_START + 4)
#define RID_PDF_TAB_LINKS (RID_PDF_DIALOG_START + 12)
+#define RID_PDF_WARNPDFAPASSWORD (RID_PDF_DIALOG_START + 6)
+
//strings
#define STR_PDF_EXPORT (RID_PDF_DIALOG_START + 5)
@@ -152,12 +154,14 @@
#define STR_USER_PWD_UNSET 124
#define STR_USER_PWD_UNENC 125
#define STR_SET_PWD 126
+#define STR_USER_PWD_PDFA 127
#define FT_OWNER_PWD 128
#define STR_OWNER_PWD_SET 129
#define STR_OWNER_PWD_REST 130
#define STR_OWNER_PWD_UNSET 131
#define STR_OWNER_PWD_UNREST 132
+#define STR_OWNER_PWD_PDFA 133
#define FL_PRINT_PERMISSIONS 133
#define RB_PRINT_NONE 134
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index fb13ac447587..9daa0391f6b7 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -321,11 +321,13 @@ class ImpPDFTabSecurityPage : public SfxTabPage
FixedText maFtUserPwd;
String maUserPwdSet;
String maUserPwdUnset;
+ String maUserPwdPdfa;
String maStrSetPwd;
FixedText maFtOwnerPwd;
String maOwnerPwdSet;
String maOwnerPwdUnset;
+ String maOwnerPwdPdfa;
FixedLine maFlPrintPermissions;
RadioButton maRbPrintNone;
@@ -370,6 +372,7 @@ public:
void GetFilterConfigItem( ImpPDFTabDialog* paParent);
void SetFilterConfigItem( const ImpPDFTabDialog* paParent );
void ImplPDFASecurityControl( sal_Bool bEnableSecurity );
+ bool hasPassword() const { return mbHaveOwnerPassword || mbHaveUserPassword; }
};
//class to implement the relative link stuff
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index 1c941d6a9972..35cfa93dd854 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -265,6 +265,12 @@ TabPage RID_PDF_TAB_GENER
};
};
+WarningBox RID_PDF_WARNPDFAPASSWORD
+{
+ Title[en-US] = "PDF/A Export";
+ Message[ en-US ] = "PDF/A does not allow encryption. The exported PDF file will not be password protected.";
+};
+
//----------------------------------------------------------
//tab page for PDF Export, opening features
TabPage RID_PDF_TAB_OPNFTR
@@ -607,6 +613,11 @@ TabPage RID_PDF_TAB_SECURITY
Text [ en-US ] = "PDF document will not be encrypted";
};
+ String STR_USER_PWD_PDFA
+ {
+ Text [en-US] = "PDF doument will not be encrypted due to PDF/A export.";
+ };
+
FixedText FT_OWNER_PWD
{
Pos = MAP_APPFONT( 12 , 65 );
@@ -633,6 +644,11 @@ TabPage RID_PDF_TAB_SECURITY
Text [ en-US ] = "PDF document will be unrestricted";
};
+ String STR_OWNER_PWD_PDFA
+ {
+ Text [en-US] = "PDF doument will not be restricted due to PDF/A export.";
+ };
+
//////////////////////////////
FixedLine FL_PRINT_PERMISSIONS
{
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index dd6498de4ab2..3b2a3806e1b6 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -91,6 +91,8 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog( Window* pParent, ResMgr& rResM
mpFilterListBox->SetSelectHdl( LINK( this, XMLFilterSettingsDialog, SelectionChangedHdl_Impl ) );
mpFilterListBox->SetDeselectHdl( LINK( this, XMLFilterSettingsDialog, SelectionChangedHdl_Impl ) );
mpFilterListBox->SetDoubleClickHdl( LINK( this, XMLFilterSettingsDialog, DoubleClickHdl_Impl ) );
+ mpFilterListBox->SetAccessibleName(String( RESID( STR_XML_FILTER_LISTBOX )));
+ maCtrlFilterList.SetAccessibleName(String( RESID( STR_XML_FILTER_LISTBOX )));
mpFilterListBox->SetHelpId( HID_XML_FILTER_LIST );
maPBNew.SetClickHdl(LINK( this, XMLFilterSettingsDialog, ClickHdl_Impl ) );
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc b/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc
index 48ed1a2a4ee7..d611e2d1a824 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc
@@ -39,5 +39,5 @@
#define PB_XML_FILTER_OPEN 7
#define BTN_XML_FILTER_HELP 8
#define PB_XML_FILTER_CLOSE 9
-
+#define STR_XML_FILTER_LISTBOX 10
#endif
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.src b/filter/source/xsltdialog/xmlfiltersettingsdialog.src
index b80dff3bfe50..deb15d18627d 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.src
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.src
@@ -126,6 +126,11 @@ WorkWindow DLG_XML_FILTER_SETTINGS_DIALOG
};
+String STR_XML_FILTER_LISTBOX
+{
+ Text [ en-US ] = "XML Filter List";
+};
+
diff --git a/forms/prj/build.lst b/forms/prj/build.lst
index 115c035edbbc..81b502832d42 100644
--- a/forms/prj/build.lst
+++ b/forms/prj/build.lst
@@ -1,4 +1,4 @@
-fm forms : l10n oovbaapi svx sfx2 qadevOOo LIBXSLT:libxslt NULL
+fm forms : L10N:l10n oovbaapi svx sfx2 qadevOOo LIBXSLT:libxslt NULL
fm forms usr1 - all fm_mkofrm NULL
fm forms\inc nmake - all fm_inc NULL
fm forms\source\inc get - all fm_sinc NULL
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index f9f17524756f..5f7a71df92da 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -104,8 +104,8 @@ namespace frm
//=====================================================================
//---------------------------------------------------------------------
OFilterControl::OFilterControl( const Reference< XMultiServiceFactory >& _rxORB )
- :m_aTextListeners( *this )
- ,m_aContext( _rxORB )
+ :UnoControl( _rxORB )
+ ,m_aTextListeners( *this )
,m_aParser( _rxORB )
,m_nControlClass( FormComponentType::TEXTFIELD )
,m_bFilterList( sal_False )
@@ -132,11 +132,11 @@ namespace frm
if ( !m_xFormatter.is() )
{
// we can create one from the connection, if it's an SDB connection
- Reference< XNumberFormatsSupplier > xFormatSupplier = ::dbtools::getNumberFormats( m_xConnection, sal_True, m_aContext.getLegacyServiceFactory() );
+ Reference< XNumberFormatsSupplier > xFormatSupplier = ::dbtools::getNumberFormats( m_xConnection, sal_True, maContext.getLegacyServiceFactory() );
if ( xFormatSupplier.is() )
{
- m_aContext.createComponent( "com.sun.star.util.NumberFormatter", m_xFormatter );
+ maContext.createComponent( "com.sun.star.util.NumberFormatter", m_xFormatter );
if ( m_xFormatter.is() )
m_xFormatter->attachNumberFormatsSupplier( xFormatSupplier );
}
@@ -354,7 +354,7 @@ namespace frm
sItemText = itemPos->second;
if ( sItemText.getLength() )
{
- ::dbtools::OPredicateInputController aPredicateInput( m_aContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
+ ::dbtools::OPredicateInputController aPredicateInput( maContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
::rtl::OUString sErrorMessage;
OSL_VERIFY( aPredicateInput.normalizePredicateString( sItemText, m_xField, &sErrorMessage ) );
}
@@ -539,7 +539,7 @@ namespace frm
aNewText.trim();
if ( aNewText.getLength() )
{
- ::dbtools::OPredicateInputController aPredicateInput( m_aContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
+ ::dbtools::OPredicateInputController aPredicateInput( maContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
::rtl::OUString sErrorMessage;
if ( !aPredicateInput.normalizePredicateString( aNewText, m_xField, &sErrorMessage ) )
{
@@ -743,7 +743,7 @@ namespace frm
static ::rtl::OUString s_sDialogServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.sdb.ErrorMessageDialog" );
- Reference< XExecutableDialog > xErrorDialog( m_aContext.createComponentWithArguments( s_sDialogServiceName, aArgs ), UNO_QUERY );
+ Reference< XExecutableDialog > xErrorDialog( maContext.createComponentWithArguments( s_sDialogServiceName, aArgs ), UNO_QUERY );
if ( xErrorDialog.is() )
xErrorDialog->execute();
else
diff --git a/forms/source/component/Filter.hxx b/forms/source/component/Filter.hxx
index 99c621d6cdf6..6ebc7c49df6b 100644
--- a/forms/source/component/Filter.hxx
+++ b/forms/source/component/Filter.hxx
@@ -68,7 +68,6 @@ namespace frm
{
TextListenerMultiplexer m_aTextListeners;
- ::comphelper::ComponentContext m_aContext;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xField;
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 0755510cdd48..9b37ba6d67c4 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -109,7 +109,7 @@ namespace frm
DBG_NAME( ORichTextControl )
//------------------------------------------------------------------
ORichTextControl::ORichTextControl( const Reference< XMultiServiceFactory >& _rxORB )
- :m_xORB( _rxORB )
+ :UnoEditControl( _rxORB )
{
DBG_CTOR( ORichTextControl, NULL );
}
diff --git a/forms/source/richtext/richtextcontrol.hxx b/forms/source/richtext/richtextcontrol.hxx
index e4dea25ec225..54f0b6e08966 100644
--- a/forms/source/richtext/richtextcontrol.hxx
+++ b/forms/source/richtext/richtextcontrol.hxx
@@ -59,10 +59,6 @@ namespace frm
class ORichTextControl :public UnoEditControl
,public ORichTextControl_Base
{
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
-
public:
ORichTextControl(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx
index 36b1f12eb6b2..622df5783715 100644
--- a/forms/source/solar/component/navbarcontrol.cxx
+++ b/forms/source/solar/component/navbarcontrol.cxx
@@ -106,7 +106,7 @@ namespace frm
DBG_NAME( ONavigationBarControl )
//------------------------------------------------------------------
ONavigationBarControl::ONavigationBarControl( const Reference< XMultiServiceFactory >& _rxORB )
- :m_xORB( _rxORB )
+ :UnoControl( _rxORB )
{
DBG_CTOR( ONavigationBarControl, NULL );
}
@@ -181,7 +181,7 @@ namespace frm
}
// create the peer
- ONavigationBarPeer* pPeer = ONavigationBarPeer::Create( m_xORB, pParentWin, getModel() );
+ ONavigationBarPeer* pPeer = ONavigationBarPeer::Create( maContext.getLegacyServiceFactory(), pParentWin, getModel() );
DBG_ASSERT( pPeer, "ONavigationBarControl::createPeer: invalid peer returned!" );
if ( pPeer )
// by definition, the returned component is aquired once
diff --git a/forms/source/solar/component/navbarcontrol.hxx b/forms/source/solar/component/navbarcontrol.hxx
index 0040d5d4e6ad..877aa55aaba2 100644
--- a/forms/source/solar/component/navbarcontrol.hxx
+++ b/forms/source/solar/component/navbarcontrol.hxx
@@ -56,10 +56,6 @@ namespace frm
:public UnoControl
,public ONavigationBarControl_Base
{
- private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
-
public:
ONavigationBarControl(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 54d1c102d5be..d782f0ee8dcd 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -313,6 +313,11 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
aRefBtn.Hide();
pMEdit = aMEFormula.GetEdit();
+ //IAccessibility2 Implementation 2009-----
+ aMEFormula.SetAccessibleName(aFtFormula.GetText());
+ if (pMEdit)
+ pMEdit->SetAccessibleName(aFtFormula.GetText());
+ //-----IAccessibility2 Implementation 2009
m_aEditHelpId = pMEdit->GetHelpId();
pMEdit->SetUniqueId( m_aEditHelpId );
diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx
index e51f9dc8a9c8..3a21a99b0da7 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -56,24 +56,24 @@ ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos):
aFtArgName ( this, ModuleRes( FT_PARNAME ) ),
aFtArgDesc ( this, ModuleRes( FT_PARDESC ) ),
+ aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ),
aFtArg1 ( this, ModuleRes( FT_ARG1 ) ),
- aFtArg2 ( this, ModuleRes( FT_ARG2 ) ),
- aFtArg3 ( this, ModuleRes( FT_ARG3 ) ),
- aFtArg4 ( this, ModuleRes( FT_ARG4 ) ),
+ aEdArg1 ( this, ModuleRes( ED_ARG1 ) ),
+ aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ),
- aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ),
aBtnFx2 ( this, ModuleRes( BTN_FX2 ) ),
- aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ),
- aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ),
-
- aEdArg1 ( this, ModuleRes( ED_ARG1 ) ),
+ aFtArg2 ( this, ModuleRes( FT_ARG2 ) ),
aEdArg2 ( this, ModuleRes( ED_ARG2 ) ),
- aEdArg3 ( this, ModuleRes( ED_ARG3 ) ),
- aEdArg4 ( this, ModuleRes( ED_ARG4 ) ),
-
- aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ),
aRefBtn2 ( this, ModuleRes( RB_ARG2 ) ),
+
+ aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ),
+ aFtArg3 ( this, ModuleRes( FT_ARG3 ) ),
+ aEdArg3 ( this, ModuleRes( ED_ARG3 ) ),
aRefBtn3 ( this, ModuleRes( RB_ARG3 ) ),
+
+ aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ),
+ aFtArg4 ( this, ModuleRes( FT_ARG4 ) ),
+ aEdArg4 ( this, ModuleRes( ED_ARG4 ) ),
aRefBtn4 ( this, ModuleRes( RB_ARG4 ) ),
aSlider ( this, ModuleRes( WND_SLIDER ) ),
diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx
index 990eafd28ba2..55c2bd7204b8 100644
--- a/formula/source/ui/dlg/parawin.hxx
+++ b/formula/source/ui/dlg/parawin.hxx
@@ -68,25 +68,25 @@ private:
FixedText aFtArgName;
FixedInfo aFtArgDesc;
+ ImageButton aBtnFx1;
FixedText aFtArg1;
- FixedText aFtArg2;
- FixedText aFtArg3;
- FixedText aFtArg4;
+ ArgEdit aEdArg1;
+ RefButton aRefBtn1;
- ImageButton aBtnFx1;
ImageButton aBtnFx2;
- ImageButton aBtnFx3;
- ImageButton aBtnFx4;
-
- ArgEdit aEdArg1;
+ FixedText aFtArg2;
ArgEdit aEdArg2;
+ RefButton aRefBtn2;
+
+ ImageButton aBtnFx3;
+ FixedText aFtArg3;
ArgEdit aEdArg3;
- ArgEdit aEdArg4;
+ RefButton aRefBtn3;
- RefButton aRefBtn1;
- RefButton aRefBtn2;
- RefButton aRefBtn3;
- RefButton aRefBtn4;
+ ImageButton aBtnFx4;
+ FixedText aFtArg4;
+ ArgEdit aEdArg4;
+ RefButton aRefBtn4;
ScrollBar aSlider;
String m_sOptional;
diff --git a/fpicker/prj/build.lst b/fpicker/prj/build.lst
index 52d99ec0759a..1be09c5d8fd1 100644
--- a/fpicker/prj/build.lst
+++ b/fpicker/prj/build.lst
@@ -1,4 +1,4 @@
-fp fpicker : LIBXSLT:libxslt l10n rdbmaker svtools NULL
+fp fpicker : LIBXSLT:libxslt L10N:l10n rdbmaker svtools NULL
fp fpicker\inc nmake - all fp_inc NULL
fp fpicker\source\generic nmake - all fp_generic fp_inc NULL
fp fpicker\source\office nmake - all fp_office fp_inc NULL
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 355203dbe767..13f427351411 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -3015,6 +3015,7 @@ void SvtFileDialog::AddControls_Impl( )
_pPrevBmp = new FixedBitmap( this, WinBits( WB_BORDER ) );
_pPrevBmp->SetBackground( Wallpaper( Color( COL_WHITE ) ) );
_pPrevBmp->Show();
+ _pPrevBmp->SetAccessibleName(SvtResId(STR_PREVIEW));
}
if ( _nExtraBits & SFX_EXTRA_AUTOEXTENSION )
diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc
index b87082b56cbd..42b235ee31af 100644
--- a/fpicker/source/office/iodlg.hrc
+++ b/fpicker/source/office/iodlg.hrc
@@ -70,6 +70,7 @@
#define STR_PATHSELECT 5
#define STR_BUTTONSELECT 6
#define STR_ACTUALVERSION 7
+#define STR_PREVIEW 8
// DLG_SVT_QUERYFOLDERNAME -----------------------
diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src
index da2d1cd926b6..2a460797fe56 100644
--- a/fpicker/source/office/iodlg.src
+++ b/fpicker/source/office/iodlg.src
@@ -251,6 +251,10 @@ ModalDialog DLG_SVT_EXPLORERFILE
{
Text [ en-US ] = "Current version";
};
+ String STR_PREVIEW
+ {
+ Text [ en-US ] = "File Preview";
+ };
};
// QueryFolderNameDialog ----------------------------------------------------------
diff --git a/framework/prj/build.lst b/framework/prj/build.lst
index 2c847918fee4..8fe5b3b2f0ef 100644
--- a/framework/prj/build.lst
+++ b/framework/prj/build.lst
@@ -1,2 +1,2 @@
-fr framework : LIBXSLT:libxslt l10n svtools NULL
+fr framework : LIBXSLT:libxslt L10N:l10n svtools NULL
fr framework\prj nmake - all fr_all NULL
diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx
index d7868a3a0857..b41797e63595 100644
--- a/framework/source/classes/fwktabwindow.cxx
+++ b/framework/source/classes/fwktabwindow.cxx
@@ -45,6 +45,7 @@
#include <comphelper/processfactory.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/stream.hxx>
+#include <tools/diagnose_ex.h>
#include <vcl/bitmap.hxx>
#include <vcl/image.hxx>
#include <vcl/msgbox.hxx>
@@ -156,7 +157,7 @@ sal_Bool FwkTabPage::CallMethod( const rtl::OUString& rMethod )
}
catch ( uno::Exception& )
{
- DBG_ERRORFILE( "FwkTabPage::CallMethod(): exception of XDialogEventHandler::callHandlerMethod()" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
return bRet;
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index e6ceb91e8090..c460ecbccd70 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -139,4 +139,7 @@
<implementation name="com.sun.star.comp.framework.jobs.JobDispatch">
<service name="com.sun.star.frame.ProtocolHandler"/>
</implementation>
+ <implementation name="com.sun.star.comp.framework.TabWindowService">
+ <service name="com.sun.star.ui.dialogs.TabContainerWindow"/>
+ </implementation>
</component>
diff --git a/framework/util/fwl.component b/framework/util/fwl.component
index aa124d1cdc4b..99c5ca7213e6 100644
--- a/framework/util/fwl.component
+++ b/framework/util/fwl.component
@@ -85,9 +85,6 @@
<implementation name="com.sun.star.comp.framework.SimpleTextStatusbarController">
<service name="com.sun.star.frame.StatusbarController"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.TabWindowService">
- <service name="com.sun.star.ui.dialogs.TabContainerWindow"/>
- </implementation>
<implementation name="com.sun.star.comp.framework.ToolBarsMenuController">
<service name="com.sun.star.frame.PopupMenuController"/>
</implementation>
diff --git a/i18npool/inc/i18npool/lang.h b/i18npool/inc/i18npool/lang.h
index 52e4e51d7a41..5d9c3cee878c 100644
--- a/i18npool/inc/i18npool/lang.h
+++ b/i18npool/inc/i18npool/lang.h
@@ -515,6 +515,11 @@ typedef unsigned short LanguageType;
#define LANGUAGE_USER_GIKUYU 0x0655
#define LANGUAGE_USER_RUSYN_UKRAINE 0x0656
#define LANGUAGE_USER_RUSYN_SLOVAKIA 0x8256 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_RUSYN_UKRAINE)) */
+#define LANGUAGE_USER_YIDDISH_US 0x083D /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_YIDDISH)) */
+#define LANGUAGE_USER_LIMBU 0x0657
+#define LANGUAGE_USER_LOJBAN 0x0658 /* no locale */
+#define LANGUAGE_USER_KABYLE 0x0659
+#define LANGUAGE_USER_HAITIAN 0x065A
#endif /* INCLUDED_I18NPOOL_LANG_H */
diff --git a/i18npool/source/breakiterator/makefile.mk b/i18npool/source/breakiterator/makefile.mk
index f3088125ecf1..fc6561c3e0aa 100644
--- a/i18npool/source/breakiterator/makefile.mk
+++ b/i18npool/source/breakiterator/makefile.mk
@@ -79,7 +79,17 @@ GENBRK:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genbrk
GENCCODE:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genccode
.ENDIF
-$(MISC)$/%.brk : data/%.txt
+.INCLUDE .IGNORE : icuversion.mk
+
+$(MISC)$/%.txt : data/%.txt
+# fdo#31271 ")" reclassified in more recent ICU/Unicode Standards
+.IF "$(ICU_MAJOR)" >= "5" || ("$(ICU_MAJOR)" == "4" && "$(ICU_MINOR)" >= "4")
+ $(SED) "s#\[:LineBreak = Close_Punctuation:\]#\[\[:LineBreak = Close_Punctuation:\] \[:LineBreak = Close_Parenthesis:\]\]#" $< > $@
+.ELSE
+ $(COPY) $< $@
+.ENDIF
+
+$(MISC)$/%.brk : $(MISC)/%.txt
$(WRAPCMD) $(GENBRK) -r $< -o $(MISC)$/$*.brk
$(MISC)$/%_brk.c : $(MISC)$/%.brk
diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx
index 727a6f601ba3..0ba91c0587d8 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -1003,9 +1003,11 @@ Calendar_gregorian::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16
sprintf(aStr, "%02d", value); // #100211# - checked
break;
case CalendarDisplayCode::SHORT_YEAR:
- // Take last 2 digits, or only one if vallue<10, for example,
+ // Take last 2 digits, or only one if value<10, for example,
// in case of the Gengou calendar.
- if (value < 100)
+ // #i116701# For values in non-Gregorian era years use all
+ // digits.
+ if (value < 100 || eraArray)
sprintf(aStr, "%d", value); // #100211# - checked
else
sprintf(aStr, "%02d", value % 100); // #100211# - checked
diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx
index 357be80a69ea..78a66c1cc79e 100644
--- a/i18npool/source/isolang/isolang.cxx
+++ b/i18npool/source/isolang/isolang.cxx
@@ -292,7 +292,6 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
// { LANGUAGE_USER_CATALAN_VALENCIAN, "ca", "ES" }, // In case MS format files escaped into the wild, map them back.
{ LANGUAGE_FRENCH_CAMEROON, "fr", "CM" },
{ LANGUAGE_FRENCH_COTE_D_IVOIRE, "fr", "CI" },
- { LANGUAGE_FRENCH_HAITI, "fr", "HT" },
{ LANGUAGE_FRENCH_MALI, "fr", "ML" },
{ LANGUAGE_FRENCH_SENEGAL, "fr", "SN" },
{ LANGUAGE_FRENCH_ZAIRE, "fr", "CD" }, // Democratic Republic Of Congo
@@ -353,6 +352,7 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
{ LANGUAGE_PAPIAMENTU, "pap", "AN" },
{ LANGUAGE_USER_PAPIAMENTU_ARUBA, "pap", "AW" },
{ LANGUAGE_ENGLISH_SINGAPORE, "en", "SG" },
+ { LANGUAGE_USER_YIDDISH_US, "yi", "US" },
{ LANGUAGE_YIDDISH, "yi", "IL" }, // new: old was "ji"
{ LANGUAGE_YIDDISH, "ji", "IL" }, // old: new is "yi"
{ LANGUAGE_SYRIAC, "syr", "TR" }, // "TR" according to http://www.ethnologue.com/show_language.asp?code=SYC
@@ -461,6 +461,11 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
{ LANGUAGE_USER_GIKUYU, "ki", "KE" },
{ LANGUAGE_USER_RUSYN_UKRAINE, "rue", "UA" },
{ LANGUAGE_USER_RUSYN_SLOVAKIA, "rue", "SK" },
+ { LANGUAGE_USER_LIMBU, "lif", "NP" },
+ { LANGUAGE_USER_LOJBAN, "jbo", "" },
+ { LANGUAGE_USER_KABYLE, "kab", "DZ" },
+ { LANGUAGE_USER_HAITIAN, "ht", "HT" },
+ { LANGUAGE_FRENCH_HAITI, "fr", "HT" },
{ LANGUAGE_NONE, "zxx", "" }, // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information
{ LANGUAGE_DONTKNOW, "", "" } // marks end of table
};
@@ -685,6 +690,7 @@ static const MsLangId::IsoLangEntry & lcl_lookupFallbackEntry( LanguageType nLan
case LANGUAGE_BASQUE:
case LANGUAGE_USER_ESPERANTO:
case LANGUAGE_USER_INTERLINGUA:
+ case LANGUAGE_USER_LOJBAN:
return *pEntry;
default:
; // nothing
@@ -765,6 +771,7 @@ static const MsLangId::IsoLangEntry & lcl_lookupFallbackEntry(
case LANGUAGE_BASQUE:
case LANGUAGE_USER_ESPERANTO:
case LANGUAGE_USER_INTERLINGUA:
+ case LANGUAGE_USER_LOJBAN:
return *pEntry;
default:
; // nothing
diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx
index a03d24e6fcdb..599299951164 100644
--- a/i18npool/source/isolang/mslangid.cxx
+++ b/i18npool/source/isolang/mslangid.cxx
@@ -339,6 +339,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang )
case LANGUAGE_FARSI:
case LANGUAGE_HEBREW:
case LANGUAGE_YIDDISH:
+ case LANGUAGE_USER_YIDDISH_US:
case LANGUAGE_MARATHI:
case LANGUAGE_PUNJABI:
case LANGUAGE_GUJARATI:
@@ -374,6 +375,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang )
case LANGUAGE_USER_DOGRI_INDIA:
case LANGUAGE_USER_MAITHILI_INDIA:
case LANGUAGE_UIGHUR_CHINA:
+ case LANGUAGE_USER_LIMBU:
nScript = ::com::sun::star::i18n::ScriptType::COMPLEX;
break;
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 7a520047637d..275fdf006d9f 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -160,9 +160,11 @@ LocaleNode* LocaleNode::createNode (const OUString& name, const Reference< XAttr
// printf(" name: '%s'\n", p->getName().pData->buffer );
// printf("value: '%s'\n", p->getValue().pData->buffer );
+#define OSTR(s) (OUStringToOString( (s), RTL_TEXTENCODING_UTF8).getStr())
+
void print_OUString( const OUString& s )
{
- printf( "%s", OUStringToOString( s, RTL_TEXTENCODING_UTF8).getStr());
+ printf( "%s", OSTR(s));
}
bool is_empty( const OUString& s )
@@ -266,16 +268,16 @@ void LocaleNode :: generateCode (const OFileWriter &of) const
fprintf( stderr, "Error: less than %ld character%s (%ld) in %s '%s'.\n",
sal::static_int_cast< long >(nMinLen), (nMinLen > 1 ? "s" : ""),
sal::static_int_cast< long >(nLen),
- (pNode ? OUStringToOString( pNode->getName(), RTL_TEXTENCODING_UTF8).getStr() : ""),
- OUStringToOString( aVal, RTL_TEXTENCODING_UTF8).getStr());
+ (pNode ? OSTR( pNode->getName()) : ""),
+ OSTR( aVal));
}
else if (nLen > nMaxLen && nMaxLen >= 0)
fprintf( stderr,
"Warning: more than %ld character%s (%ld) in %s %s not supported by application.\n",
sal::static_int_cast< long >(nMaxLen), (nMaxLen > 1 ? "s" : ""),
sal::static_int_cast< long >(nLen),
- (pNode ? OUStringToOString( pNode->getName(), RTL_TEXTENCODING_UTF8).getStr() : ""),
- OUStringToOString( aVal, RTL_TEXTENCODING_UTF8).getStr());
+ (pNode ? OSTR( pNode->getName()) : ""),
+ OSTR( aVal));
return aVal;
}
@@ -306,7 +308,7 @@ void LocaleNode::incError( const char* pStr ) const
void LocaleNode::incError( const ::rtl::OUString& rStr ) const
{
- incError( OUStringToOString( rStr, RTL_TEXTENCODING_UTF8).getStr());
+ incError( OSTR( rStr));
}
char* LocaleNode::prepareErrorFormat( const char* pFormat, const char* pDefaultConversion ) const
@@ -332,8 +334,7 @@ void LocaleNode::incErrorInt( const char* pStr, int nVal ) const
void LocaleNode::incErrorStr( const char* pStr, const ::rtl::OUString& rVal ) const
{
++nError;
- fprintf( stderr, prepareErrorFormat( pStr, ": %s"), OUStringToOString(
- rVal, RTL_TEXTENCODING_UTF8).getStr());
+ fprintf( stderr, prepareErrorFormat( pStr, ": %s"), OSTR( rVal));
}
void LCInfoNode::generateCode (const OFileWriter &of) const
@@ -501,6 +502,64 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
if (aQuoteEnd == aDoubleQuoteEnd)
fprintf( stderr, "Warning: %s\n",
"QuotationEnd equals DoubleQuotationEnd. Not necessarily an error, but unusual.");
+ // Known good values, exclude ASCII single (U+0027, ') and double (U+0022, ") quotes.
+ int ic;
+ switch (ic = aQuoteStart.toChar())
+ {
+ case 0x2018: // LEFT SINGLE QUOTATION MARK
+ case 0x201a: // SINGLE LOW-9 QUOTATION MARK
+ case 0x201b: // SINGLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x2039: // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+ case 0x203a: // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+ case 0x300c: // LEFT CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "QuotationStart may be wrong:", ic, OSTR( aQuoteStart));
+ }
+ switch (ic = aQuoteEnd.toChar())
+ {
+ case 0x2019: // RIGHT SINGLE QUOTATION MARK
+ case 0x201a: // SINGLE LOW-9 QUOTATION MARK
+ case 0x201b: // SINGLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x2039: // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+ case 0x203a: // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+ case 0x300d: // RIGHT CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "QuotationEnd may be wrong:", ic, OSTR( aQuoteEnd));
+ }
+ switch (ic = aDoubleQuoteStart.toChar())
+ {
+ case 0x00ab: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x00bb: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x201c: // LEFT DOUBLE QUOTATION MARK
+ case 0x201e: // DOUBLE LOW-9 QUOTATION MARK
+ case 0x201f: // DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x300e: // LEFT WHITE CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "DoubleQuotationStart may be wrong:", ic, OSTR( aDoubleQuoteStart));
+ }
+ switch (ic = aDoubleQuoteEnd.toChar())
+ {
+ case 0x00ab: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x00bb: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ case 0x201d: // RIGHT DOUBLE QUOTATION MARK
+ case 0x201e: // DOUBLE LOW-9 QUOTATION MARK
+ case 0x201f: // DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+ case 0x300f: // RIGHT WHITE CORNER BRACKET (Chinese)
+ ;
+ break;
+ default:
+ fprintf( stderr, "Warning: %s U+%04X %s\n",
+ "DoubleQuotationEnd may be wrong:", ic, OSTR( aDoubleQuoteEnd));
+ }
writeParameterCheckLen( of, "TimeAM", "timeAM", 1, -1);
writeParameterCheckLen( of, "TimePM", "timePM", 1, -1);
@@ -640,7 +699,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
fprintf( stderr,
"Warning: Can't check separators used in FormatCode due to LC_CTYPE ref=\"%s\".\n"
"If these two locales use identical format codes, you should consider to use the ref= mechanism also for the LC_FORMAT element, together with replaceFrom= and replaceTo= for the currency.\n",
- OUStringToOString( aRef, RTL_TEXTENCODING_UTF8).getStr());
+ OSTR( aRef));
bCtypeIsRef = true;
pCtype = 0;
}
diff --git a/i18npool/source/localedata/data/dsb_DE.xml b/i18npool/source/localedata/data/dsb_DE.xml
new file mode 100644
index 000000000000..fe953ec807c1
--- /dev/null
+++ b/i18npool/source/localedata/data/dsb_DE.xml
@@ -0,0 +1,350 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>dsb</LangID>
+ <DefaultName>Sorbian, Lower</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>DE</CountryID>
+ <DefaultName>Germany</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>.</DateSeparator>
+ <ThousandSeparator>&#160;</ThousandSeparator><!-- a non-breaking space (U+00A0) as a thousand separator; alternatively, there could be no separator at all -->
+ <DecimalSeparator>,</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>,</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>. </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‚</QuotationStart>
+ <QuotationEnd>‘</QuotationEnd>
+ <DoubleQuotationStart>„</DoubleQuotationStart>
+ <DoubleQuotationEnd>“</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>dopołdnja</TimeAM>
+ <TimePM>wótpołdnja</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-82E]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>Standard</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0,00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode># ##0</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode># ##0,00</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode># ###,00</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0,00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0,00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0,00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode># ##0 [CURRENCY];-# ##0 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode># ##0,00 [CURRENCY];-# ##0,00 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode># ##0 [CURRENCY];[RED]-# ##0 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode># ##0,00 [CURRENCY];[RED]-# ##0,00 [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC# ##0,00</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode># ##0,-- [CURRENCY];[RED]-# ##0,-- [CURRENCY]</FormatCode><!-- a non-breaking space (U+00A0) as a thousand separator -->
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D.MM.YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNND. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD.MM.YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD.MM.YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D. MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D. MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D. MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D. MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD. MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D. MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND. MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM.DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM.YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>D. MMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>H:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>H:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>H:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>H:MM:SS AM/PM</FormatCode><!-- with commonly used 24-hour time, the AM/PM indicator is not needed -->
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[H]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS,00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[H]:MM:SS,00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD.MM.YY H:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD.MM.YYYY H:MM:SS AM/PM</FormatCode><!-- with commonly used 24-hour time, the AM/PM indicator is useless (and also never used) -->
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey unoid="alphanumeric" default="true" phonetic="false">A-C Č Ć D E Ě F-H {Ch} I-K Ł L-N Ń O Ó P-R Ŕ S Š Ś T-Z Ž Ź</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <UnicodeScript>2</UnicodeScript>
+ <FollowPageWord>bok</FollowPageWord><!-- there's no conventional abbreviation -->
+ <FollowPageWord>boki</FollowPageWord><!-- there's no conventional abbreviation -->
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>nje.</DefaultAbbrvName>
+ <DefaultFullName>njeźela</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>pón.</DefaultAbbrvName>
+ <DefaultFullName>pónjeźela</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>wał.</DefaultAbbrvName>
+ <DefaultFullName>wałtora</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>srj.</DefaultAbbrvName>
+ <DefaultFullName>srjoda</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>stw.</DefaultAbbrvName>
+ <DefaultFullName>stwórtk</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>pět.</DefaultAbbrvName>
+ <DefaultFullName>pětk</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>sob.</DefaultAbbrvName>
+ <DefaultFullName>sobota</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>jan.</DefaultAbbrvName>
+ <DefaultFullName>januar</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>feb.</DefaultAbbrvName>
+ <DefaultFullName>februar</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>měr.</DefaultAbbrvName>
+ <DefaultFullName>měrc</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>apr.</DefaultAbbrvName>
+ <DefaultFullName>apryl</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>maj</DefaultAbbrvName>
+ <DefaultFullName>maj</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>jun.</DefaultAbbrvName>
+ <DefaultFullName>junij</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>jul.</DefaultAbbrvName>
+ <DefaultFullName>julij</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>awg.</DefaultAbbrvName>
+ <DefaultFullName>awgust</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>sep.</DefaultAbbrvName>
+ <DefaultFullName>september</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>okt.</DefaultAbbrvName>
+ <DefaultFullName>oktober</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>now.</DefaultAbbrvName>
+ <DefaultFullName>nowember</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>dec.</DefaultAbbrvName>
+ <DefaultFullName>december</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>pś. Kr.</DefaultAbbrvName>
+ <DefaultFullName>pśed Kristusom</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>pó Kr.</DefaultAbbrvName>
+ <DefaultFullName>pó Kristusu</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>mon</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>4</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>EUR</CurrencyID>
+ <CurrencySymbol>€</CurrencySymbol>
+ <BankSymbol>EUR</BankSymbol>
+ <CurrencyName>euro</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>wěrno</trueWord>
+ <falseWord>njewěrno</falseWord>
+ <quarter1Word>prědny kwartal</quarter1Word>
+ <quarter2Word>drugi kwartal</quarter2Word>
+ <quarter3Word>tśeśi kwartal</quarter3Word>
+ <quarter4Word>stwórty kwartal</quarter4Word>
+ <aboveWord>nad</aboveWord>
+ <belowWord>pód</belowWord>
+ <quarter1Abbreviation>K1</quarter1Abbreviation>
+ <quarter2Abbreviation>K2</quarter2Abbreviation>
+ <quarter3Abbreviation>K3</quarter3Abbreviation>
+ <quarter4Abbreviation>K4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel ref="en_US"/>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/fi_FI.xml b/i18npool/source/localedata/data/fi_FI.xml
index 432d5f155423..1f7747d8b97a 100644
--- a/i18npool/source/localedata/data/fi_FI.xml
+++ b/i18npool/source/localedata/data/fi_FI.xml
@@ -179,7 +179,7 @@
<LC_COLLATION ref="en_US" />
<LC_SEARCH ref="en_US"/>
<LC_INDEX>
- <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-V X-Z Ä Ö</IndexKey>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z Ä Ö</IndexKey>
<UnicodeScript>0</UnicodeScript>
<UnicodeScript>1</UnicodeScript>
<FollowPageWord>p.</FollowPageWord>
diff --git a/i18npool/source/localedata/data/haw_US.xml b/i18npool/source/localedata/data/haw_US.xml
new file mode 100644
index 000000000000..b9fd553e24ef
--- /dev/null
+++ b/i18npool/source/localedata/data/haw_US.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>haw</LangID>
+ <DefaultName>Hawaiian</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>US</CountryID>
+ <DefaultName>United States</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator> </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>AM</TimeAM>
+ <TimePM>PM</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$$-475]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;([CURRENCY]#,##0)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;([CURRENCY]#,##0.00)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]([CURRENCY]#,##0)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]([CURRENCY]#,##0.00)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]([CURRENCY]#,##0.--)</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>YYYY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>YY/MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>YY/MM/DD HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>YYYY/MM/DD HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A E I O U H K L M N P W</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>p.</FollowPageWord>
+ <FollowPageWord>pp.</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>LP</DefaultAbbrvName>
+ <DefaultFullName>Lāpule</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>P1</DefaultAbbrvName>
+ <DefaultFullName>Poʻakahi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>P2</DefaultAbbrvName>
+ <DefaultFullName>Poʻalua</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>P3</DefaultAbbrvName>
+ <DefaultFullName>Poʻakolu</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>P4</DefaultAbbrvName>
+ <DefaultFullName>Poʻahā</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>P5</DefaultAbbrvName>
+ <DefaultFullName>Poʻalima</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>P6</DefaultAbbrvName>
+ <DefaultFullName>Poʻaono</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>Ian.</DefaultAbbrvName>
+ <DefaultFullName>Ianuali</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>Pep.</DefaultAbbrvName>
+ <DefaultFullName>Pepeluali</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>Mal.</DefaultAbbrvName>
+ <DefaultFullName>Malaki</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>ʻAp.</DefaultAbbrvName>
+ <DefaultFullName>ʻApelila</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>Mei</DefaultAbbrvName>
+ <DefaultFullName>Mei</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>Iun.</DefaultAbbrvName>
+ <DefaultFullName>Iune</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>Iul.</DefaultAbbrvName>
+ <DefaultFullName>Iulai</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>ʻAuk.</DefaultAbbrvName>
+ <DefaultFullName>ʻAukake</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>Kep.</DefaultAbbrvName>
+ <DefaultFullName>Kepakemapa</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>ʻOk.</DefaultAbbrvName>
+ <DefaultFullName>ʻOkakopa</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>Now.</DefaultAbbrvName>
+ <DefaultFullName>Nowemapa</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>Kek.</DefaultAbbrvName>
+ <DefaultFullName>Kekemapa</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>BC</DefaultAbbrvName>
+ <DefaultFullName>BC</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>CE</DefaultAbbrvName>
+ <DefaultFullName>CE</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>mon</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>USD</CurrencyID>
+ <CurrencySymbol>$</CurrencySymbol>
+ <BankSymbol>USD</BankSymbol>
+ <CurrencyName>Kālā ʻAmelika</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>ʻOiaʻiʻo</trueWord>
+ <falseWord>Hewa</falseWord>
+ <quarter1Word>Kau Hapahā 1</quarter1Word>
+ <quarter2Word>Kau Hapaha 2</quarter2Word>
+ <quarter3Word>Kau Hapahā 3</quarter3Word>
+ <quarter4Word>Kau Hapahā 4</quarter4Word>
+ <aboveWord>Luna</aboveWord>
+ <belowWord>Lalo</belowWord>
+ <quarter1Abbreviation>KH1</quarter1Abbreviation>
+ <quarter2Abbreviation>KH2</quarter2Abbreviation>
+ <quarter3Abbreviation>KH3</quarter3Abbreviation>
+ <quarter4Abbreviation>KH4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/hsb_DE.xml b/i18npool/source/localedata/data/hsb_DE.xml
index 6513dad5f57e..1e4c70a26fd3 100644
--- a/i18npool/source/localedata/data/hsb_DE.xml
+++ b/i18npool/source/localedata/data/hsb_DE.xml
@@ -34,7 +34,7 @@
<TimePM>popołdnju</TimePM>
<MeasurementSystem>metric</MeasurementSystem>
</LC_CTYPE>
- <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-042E]">
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-42E]">
<FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
<FormatCode>Standard</FormatCode>
</FormatElement>
diff --git a/i18npool/source/localedata/data/ht_HT.xml b/i18npool/source/localedata/data/ht_HT.xml
new file mode 100644
index 000000000000..99109c72a909
--- /dev/null
+++ b/i18npool/source/localedata/data/ht_HT.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>ht</LangID>
+ <DefaultName>Haitian Creole</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>HT</CountryID>
+ <DefaultName>Haiti</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>AM</TimeAM>
+ <TimePM>PM</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$G-65A]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD/MM/YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD/MM/YY HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>s</FollowPageWord>
+ <FollowPageWord>pl</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>Dim</DefaultAbbrvName>
+ <DefaultFullName>Dimanch</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>Len</DefaultAbbrvName>
+ <DefaultFullName>Lendi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>Mad</DefaultAbbrvName>
+ <DefaultFullName>Madi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>Mèk</DefaultAbbrvName>
+ <DefaultFullName>Mèkredi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>Jed</DefaultAbbrvName>
+ <DefaultFullName>Jedi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>Van</DefaultAbbrvName>
+ <DefaultFullName>Vandredi</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>Sam</DefaultAbbrvName>
+ <DefaultFullName>Samdi</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>Jan</DefaultAbbrvName>
+ <DefaultFullName>Janvye</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>Fev</DefaultAbbrvName>
+ <DefaultFullName>Fevriye</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>Mas</DefaultAbbrvName>
+ <DefaultFullName>Mas</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>Avr</DefaultAbbrvName>
+ <DefaultFullName>Avril</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>Me</DefaultAbbrvName>
+ <DefaultFullName>Me</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>Jen</DefaultAbbrvName>
+ <DefaultFullName>Jen</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>Jiy</DefaultAbbrvName>
+ <DefaultFullName>Jiyè</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>Dao</DefaultAbbrvName>
+ <DefaultFullName>Daout</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>Sep</DefaultAbbrvName>
+ <DefaultFullName>Septanm</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>Okt</DefaultAbbrvName>
+ <DefaultFullName>Oktòb</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>Nov</DefaultAbbrvName>
+ <DefaultFullName>Novanm</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>Des</DefaultAbbrvName>
+ <DefaultFullName>Desanm</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>AJ</DefaultAbbrvName>
+ <DefaultFullName>Avan Jezikri</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>AP</DefaultAbbrvName>
+ <DefaultFullName>Apre Jezikri</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>HTG</CurrencyID>
+ <CurrencySymbol>G</CurrencySymbol>
+ <BankSymbol>HTG</BankSymbol>
+ <CurrencyName>Goud</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>Vre</trueWord>
+ <falseWord>Fo</falseWord>
+ <quarter1Word>Trimès 1</quarter1Word>
+ <quarter2Word>Trimès 2</quarter2Word>
+ <quarter3Word>Trimès 3</quarter3Word>
+ <quarter4Word>Trimès 4</quarter4Word>
+ <aboveWord>Anwo</aboveWord>
+ <belowWord>Anba</belowWord>
+ <quarter1Abbreviation>Trimès 1</quarter1Abbreviation>
+ <quarter2Abbreviation>Trimès 2</quarter2Abbreviation>
+ <quarter3Abbreviation>Trimès 3</quarter3Abbreviation>
+ <quarter4Abbreviation>Trimès 4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/jbo.xml b/i18npool/source/localedata/data/jbo.xml
new file mode 100644
index 000000000000..403442638bd0
--- /dev/null
+++ b/i18npool/source/localedata/data/jbo.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>jbo</LangID>
+ <DefaultName>Lojban</DefaultName>
+ </Language>
+ <Country>
+ <CountryID></CountryID>
+ <DefaultName></DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>PDM</TimeAM>
+ <TimePM>BDM</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-658]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD/MM/YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>DD/MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD/MM/YY HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>BP</FollowPageWord>
+ <FollowPageWord>BP</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>nondei</DefaultAbbrvName>
+ <DefaultFullName>nondei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>pavdei</DefaultAbbrvName>
+ <DefaultFullName>pavdei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>reldei</DefaultAbbrvName>
+ <DefaultFullName>reldei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>cibdei</DefaultAbbrvName>
+ <DefaultFullName>cibdei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>vondei</DefaultAbbrvName>
+ <DefaultFullName>vondei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>mumdei</DefaultAbbrvName>
+ <DefaultFullName>mumdei</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>xavdei</DefaultAbbrvName>
+ <DefaultFullName>xavdei</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>pavma'i</DefaultAbbrvName>
+ <DefaultFullName>pavmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>relma'i</DefaultAbbrvName>
+ <DefaultFullName>relmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>cibma'i</DefaultAbbrvName>
+ <DefaultFullName>cibmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>vonma'i</DefaultAbbrvName>
+ <DefaultFullName>vonmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>mumyma'i</DefaultAbbrvName>
+ <DefaultFullName>mumymasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>xavma'i</DefaultAbbrvName>
+ <DefaultFullName>xavmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>zelma'i</DefaultAbbrvName>
+ <DefaultFullName>zelmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>bivma'i</DefaultAbbrvName>
+ <DefaultFullName>bivmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>sozma'i</DefaultAbbrvName>
+ <DefaultFullName>sozmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>daurma'i</DefaultAbbrvName>
+ <DefaultFullName>daurmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>feirma'i</DefaultAbbrvName>
+ <DefaultFullName>feirmasti</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>gairma'i</DefaultAbbrvName>
+ <DefaultFullName>gairmasti</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>PLK</DefaultAbbrvName>
+ <DefaultFullName>purci la .kraist.</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>NLK</DefaultAbbrvName>
+ <DefaultFullName>nanca la .kraist.</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>mon</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>EUR</CurrencyID>
+ <CurrencySymbol>€</CurrencySymbol>
+ <BankSymbol>EUR</BankSymbol>
+ <CurrencyName>jdini</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>jetnu</trueWord>
+ <falseWord>jitfa</falseWord>
+ <quarter1Word>pa moi vo si'e</quarter1Word>
+ <quarter2Word>re moi vo si'e</quarter2Word>
+ <quarter3Word>ci moi vo si'e</quarter3Word>
+ <quarter4Word>vo moi vo si'e</quarter4Word>
+ <aboveWord>gapru</aboveWord>
+ <belowWord>cnita</belowWord>
+ <quarter1Abbreviation>1MVS</quarter1Abbreviation>
+ <quarter2Abbreviation>2MVS</quarter2Abbreviation>
+ <quarter3Abbreviation>3MVS</quarter3Abbreviation>
+ <quarter4Abbreviation>4MVS</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/lif_NP.xml b/i18npool/source/localedata/data/lif_NP.xml
new file mode 100644
index 000000000000..fadbfad11ff3
--- /dev/null
+++ b/i18npool/source/localedata/data/lif_NP.xml
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>lif</LangID>
+ <DefaultName>Limbu</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>NP</CountryID>
+ <DefaultName>Nepal</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>पूर्वान्ह</TimeAM>
+ <TimePM>अपरान्ह</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$रू-657]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY] #,##0;-[CURRENCY] #,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY] #,##0.00;-[CURRENCY] #,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY] #,##0;[RED]-[CURRENCY] #,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY] #,##0.00;[RED]-[CURRENCY] #,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY] #,##0.--;[RED]-[CURRENCY] #,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>YY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>YYYY/MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>YY/MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>YY/MM/DD HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>YYYY/MM/DD HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">ᤁ-ᤜ</IndexKey>
+ <UnicodeScript>85</UnicodeScript>
+ <FollowPageWord>p.</FollowPageWord>
+ <FollowPageWord>pp.</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>ᤋᤧᤏᤧᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤋᤧᤏᤧᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>ᤑᤥᤖᤠᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤑᤥᤖᤠᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>ᤔᤡᤰᤜᤠᤱᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤔᤡᤰᤜᤠᤱᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>ᤂᤧᤰᤛᤢᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤂᤧᤰᤛᤢᤒᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>ᤁᤢᤖᤢ᤺ᤵᤐᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤁᤢᤖᤢ᤺ᤵᤐᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>ᤑᤛᤢ᤺ᤵᤐᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤑᤛᤢ᤺ᤵᤐᤠ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>ᤛᤧᤴᤇᤪᤧᤱᤒᤠ</DefaultAbbrvName>
+ <DefaultFullName>ᤛᤧᤴᤇᤪᤧᤱᤒᤠ</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>जन</DefaultAbbrvName>
+ <DefaultFullName>जनवरी</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>फेब</DefaultAbbrvName>
+ <DefaultFullName>फेब्रुअरी</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>मार्च</DefaultAbbrvName>
+ <DefaultFullName>मार्च</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>अप्रि</DefaultAbbrvName>
+ <DefaultFullName>अप्रिल</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>मे</DefaultAbbrvName>
+ <DefaultFullName>मे</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>जुन</DefaultAbbrvName>
+ <DefaultFullName>जुन</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>जुला</DefaultAbbrvName>
+ <DefaultFullName>जुलाई</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>अग</DefaultAbbrvName>
+ <DefaultFullName>अगस्त</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>सेप्ट</DefaultAbbrvName>
+ <DefaultFullName>सेप्टेम्बर</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>अक्टो</DefaultAbbrvName>
+ <DefaultFullName>अक्टोबर</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>नोभे</DefaultAbbrvName>
+ <DefaultFullName>नोभेम्बर</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>डिसे</DefaultAbbrvName>
+ <DefaultFullName>डिसेम्बर</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>ईसापूर्व</DefaultAbbrvName>
+ <DefaultFullName>ईसापूर्व</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>सन्</DefaultAbbrvName>
+ <DefaultFullName>सन्</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>NPR</CurrencyID>
+ <CurrencySymbol>रू</CurrencySymbol>
+ <BankSymbol>NPR</BankSymbol>
+ <CurrencyName>Nepalese Rupee</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>ठीक</trueWord>
+ <falseWord>बेठीक</falseWord>
+ <quarter1Word>पहिलो सत्र</quarter1Word>
+ <quarter2Word>दोस्रो सत्र</quarter2Word>
+ <quarter3Word>तेस्रो सत्र</quarter3Word>
+ <quarter4Word>चौथो सत्र</quarter4Word>
+ <aboveWord>माथि</aboveWord>
+ <belowWord>तल</belowWord>
+ <quarter1Abbreviation>Q1</quarter1Abbreviation>
+ <quarter2Abbreviation>Q2</quarter2Abbreviation>
+ <quarter3Abbreviation>Q3</quarter3Abbreviation>
+ <quarter4Abbreviation>Q4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="12" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="12" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="12" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="12" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/localedata_euro.map b/i18npool/source/localedata/data/localedata_euro.map
index e0564b85ea25..b9dd20c724d7 100644
--- a/i18npool/source/localedata/data/localedata_euro.map
+++ b/i18npool/source/localedata/data/localedata_euro.map
@@ -16,6 +16,7 @@ getAllCalendars_de_CH;
getAllCalendars_de_DE;
getAllCalendars_de_LI;
getAllCalendars_de_LU;
+getAllCalendars_dsb_DE;
getAllCalendars_el_GR;
getAllCalendars_et_EE;
getAllCalendars_eu;
@@ -86,6 +87,7 @@ getAllCurrencies_de_CH;
getAllCurrencies_de_DE;
getAllCurrencies_de_LI;
getAllCurrencies_de_LU;
+getAllCurrencies_dsb_DE;
getAllCurrencies_el_GR;
getAllCurrencies_et_EE;
getAllCurrencies_eu;
@@ -156,6 +158,7 @@ getAllFormats0_de_CH;
getAllFormats0_de_DE;
getAllFormats0_de_LI;
getAllFormats0_de_LU;
+getAllFormats0_dsb_DE;
getAllFormats0_el_GR;
getAllFormats0_et_EE;
getAllFormats0_eu;
@@ -226,6 +229,7 @@ getBreakIteratorRules_de_CH;
getBreakIteratorRules_de_DE;
getBreakIteratorRules_de_LI;
getBreakIteratorRules_de_LU;
+getBreakIteratorRules_dsb_DE;
getBreakIteratorRules_el_GR;
getBreakIteratorRules_et_EE;
getBreakIteratorRules_eu;
@@ -296,6 +300,7 @@ getCollationOptions_de_CH;
getCollationOptions_de_DE;
getCollationOptions_de_LI;
getCollationOptions_de_LU;
+getCollationOptions_dsb_DE;
getCollationOptions_el_GR;
getCollationOptions_et_EE;
getCollationOptions_eu;
@@ -366,6 +371,7 @@ getCollatorImplementation_de_CH;
getCollatorImplementation_de_DE;
getCollatorImplementation_de_LI;
getCollatorImplementation_de_LU;
+getCollatorImplementation_dsb_DE;
getCollatorImplementation_el_GR;
getCollatorImplementation_et_EE;
getCollatorImplementation_eu;
@@ -436,6 +442,7 @@ getContinuousNumberingLevels_de_CH;
getContinuousNumberingLevels_de_DE;
getContinuousNumberingLevels_de_LI;
getContinuousNumberingLevels_de_LU;
+getContinuousNumberingLevels_dsb_DE;
getContinuousNumberingLevels_el_GR;
getContinuousNumberingLevels_et_EE;
getContinuousNumberingLevels_eu;
@@ -506,6 +513,7 @@ getFollowPageWords_de_CH;
getFollowPageWords_de_DE;
getFollowPageWords_de_LI;
getFollowPageWords_de_LU;
+getFollowPageWords_dsb_DE;
getFollowPageWords_el_GR;
getFollowPageWords_et_EE;
getFollowPageWords_eu;
@@ -576,6 +584,7 @@ getForbiddenCharacters_de_CH;
getForbiddenCharacters_de_DE;
getForbiddenCharacters_de_LI;
getForbiddenCharacters_de_LU;
+getForbiddenCharacters_dsb_DE;
getForbiddenCharacters_el_GR;
getForbiddenCharacters_et_EE;
getForbiddenCharacters_eu;
@@ -646,6 +655,7 @@ getIndexAlgorithm_de_CH;
getIndexAlgorithm_de_DE;
getIndexAlgorithm_de_LI;
getIndexAlgorithm_de_LU;
+getIndexAlgorithm_dsb_DE;
getIndexAlgorithm_el_GR;
getIndexAlgorithm_et_EE;
getIndexAlgorithm_eu;
@@ -716,6 +726,7 @@ getLCInfo_de_CH;
getLCInfo_de_DE;
getLCInfo_de_LI;
getLCInfo_de_LU;
+getLCInfo_dsb_DE;
getLCInfo_el_GR;
getLCInfo_et_EE;
getLCInfo_eu;
@@ -786,6 +797,7 @@ getLocaleItem_de_CH;
getLocaleItem_de_DE;
getLocaleItem_de_LI;
getLocaleItem_de_LU;
+getLocaleItem_dsb_DE;
getLocaleItem_el_GR;
getLocaleItem_et_EE;
getLocaleItem_eu;
@@ -856,6 +868,7 @@ getOutlineNumberingLevels_de_CH;
getOutlineNumberingLevels_de_DE;
getOutlineNumberingLevels_de_LI;
getOutlineNumberingLevels_de_LU;
+getOutlineNumberingLevels_dsb_DE;
getOutlineNumberingLevels_el_GR;
getOutlineNumberingLevels_et_EE;
getOutlineNumberingLevels_eu;
@@ -926,6 +939,7 @@ getReservedWords_de_CH;
getReservedWords_de_DE;
getReservedWords_de_LI;
getReservedWords_de_LU;
+getReservedWords_dsb_DE;
getReservedWords_el_GR;
getReservedWords_et_EE;
getReservedWords_eu;
@@ -996,6 +1010,7 @@ getSearchOptions_de_CH;
getSearchOptions_de_DE;
getSearchOptions_de_LI;
getSearchOptions_de_LU;
+getSearchOptions_dsb_DE;
getSearchOptions_el_GR;
getSearchOptions_et_EE;
getSearchOptions_eu;
@@ -1066,6 +1081,7 @@ getTransliterations_de_CH;
getTransliterations_de_DE;
getTransliterations_de_LI;
getTransliterations_de_LU;
+getTransliterations_dsb_DE;
getTransliterations_el_GR;
getTransliterations_et_EE;
getTransliterations_eu;
@@ -1136,6 +1152,7 @@ getUnicodeScripts_de_CH;
getUnicodeScripts_de_DE;
getUnicodeScripts_de_LI;
getUnicodeScripts_de_LU;
+getUnicodeScripts_dsb_DE;
getUnicodeScripts_el_GR;
getUnicodeScripts_et_EE;
getUnicodeScripts_eu;
diff --git a/i18npool/source/localedata/data/localedata_others.map b/i18npool/source/localedata/data/localedata_others.map
index e5de10cb68e5..46f4c4f74aea 100644
--- a/i18npool/source/localedata/data/localedata_others.map
+++ b/i18npool/source/localedata/data/localedata_others.map
@@ -1,5 +1,6 @@
UDK_3_0_0 {
global:
+GetVersionInfo;
getAllCalendars_af_NA;
getAllCalendars_af_ZA;
getAllCalendars_ak_GH;
@@ -21,14 +22,17 @@ getAllCalendars_fa_IR;
getAllCalendars_gug_PY;
getAllCalendars_gu_IN;
getAllCalendars_ha_GH;
+getAllCalendars_haw_US;
getAllCalendars_he_IL;
getAllCalendars_hi_IN;
getAllCalendars_hil_PH;
+getAllCalendars_ht_HT;
getAllCalendars_hu_HU;
getAllCalendars_hy_AM;
getAllCalendars_ia;
getAllCalendars_id_ID;
getAllCalendars_ja_JP;
+getAllCalendars_jbo;
getAllCalendars_kk_KZ;
getAllCalendars_km_KH;
getAllCalendars_kn_IN;
@@ -36,6 +40,7 @@ getAllCalendars_ko_KR;
getAllCalendars_ku_TR;
getAllCalendars_ky_KG;
getAllCalendars_lg_UG;
+getAllCalendars_lif_NP;
getAllCalendars_ln_CD;
getAllCalendars_lo_LA;
getAllCalendars_mai_IN;
@@ -68,10 +73,12 @@ getAllCalendars_tn_ZA;
getAllCalendars_tpi_PG;
getAllCalendars_ts_ZA;
getAllCalendars_ug_CN;
+getAllCalendars_ur_PK;
getAllCalendars_uz_UZ;
getAllCalendars_ve_ZA;
getAllCalendars_vi_VN;
getAllCalendars_xh_ZA;
+getAllCalendars_yi_US;
getAllCalendars_zh_CN;
getAllCalendars_zh_HK;
getAllCalendars_zh_MO;
@@ -99,14 +106,17 @@ getAllCurrencies_fa_IR;
getAllCurrencies_gug_PY;
getAllCurrencies_gu_IN;
getAllCurrencies_ha_GH;
+getAllCurrencies_haw_US;
getAllCurrencies_he_IL;
getAllCurrencies_hi_IN;
getAllCurrencies_hil_PH;
+getAllCurrencies_ht_HT;
getAllCurrencies_hu_HU;
getAllCurrencies_hy_AM;
getAllCurrencies_ia;
getAllCurrencies_id_ID;
getAllCurrencies_ja_JP;
+getAllCurrencies_jbo;
getAllCurrencies_kk_KZ;
getAllCurrencies_km_KH;
getAllCurrencies_kn_IN;
@@ -114,6 +124,7 @@ getAllCurrencies_ko_KR;
getAllCurrencies_ku_TR;
getAllCurrencies_ky_KG;
getAllCurrencies_lg_UG;
+getAllCurrencies_lif_NP;
getAllCurrencies_ln_CD;
getAllCurrencies_lo_LA;
getAllCurrencies_mai_IN;
@@ -146,10 +157,12 @@ getAllCurrencies_tn_ZA;
getAllCurrencies_tpi_PG;
getAllCurrencies_ts_ZA;
getAllCurrencies_ug_CN;
+getAllCurrencies_ur_PK;
getAllCurrencies_uz_UZ;
getAllCurrencies_ve_ZA;
getAllCurrencies_vi_VN;
getAllCurrencies_xh_ZA;
+getAllCurrencies_yi_US;
getAllCurrencies_zh_CN;
getAllCurrencies_zh_HK;
getAllCurrencies_zh_MO;
@@ -177,14 +190,17 @@ getAllFormats0_fa_IR;
getAllFormats0_gug_PY;
getAllFormats0_gu_IN;
getAllFormats0_ha_GH;
+getAllFormats0_haw_US;
getAllFormats0_he_IL;
getAllFormats0_hi_IN;
getAllFormats0_hil_PH;
+getAllFormats0_ht_HT;
getAllFormats0_hu_HU;
getAllFormats0_hy_AM;
getAllFormats0_ia;
getAllFormats0_id_ID;
getAllFormats0_ja_JP;
+getAllFormats0_jbo;
getAllFormats0_kk_KZ;
getAllFormats0_km_KH;
getAllFormats0_kn_IN;
@@ -192,6 +208,7 @@ getAllFormats0_ko_KR;
getAllFormats0_ku_TR;
getAllFormats0_ky_KG;
getAllFormats0_lg_UG;
+getAllFormats0_lif_NP;
getAllFormats0_ln_CD;
getAllFormats0_lo_LA;
getAllFormats0_mai_IN;
@@ -224,10 +241,12 @@ getAllFormats0_tn_ZA;
getAllFormats0_tpi_PG;
getAllFormats0_ts_ZA;
getAllFormats0_ug_CN;
+getAllFormats0_ur_PK;
getAllFormats0_uz_UZ;
getAllFormats0_ve_ZA;
getAllFormats0_vi_VN;
getAllFormats0_xh_ZA;
+getAllFormats0_yi_US;
getAllFormats0_zh_CN;
getAllFormats0_zh_HK;
getAllFormats0_zh_MO;
@@ -255,14 +274,17 @@ getBreakIteratorRules_fa_IR;
getBreakIteratorRules_gug_PY;
getBreakIteratorRules_gu_IN;
getBreakIteratorRules_ha_GH;
+getBreakIteratorRules_haw_US;
getBreakIteratorRules_he_IL;
getBreakIteratorRules_hi_IN;
getBreakIteratorRules_hil_PH;
+getBreakIteratorRules_ht_HT;
getBreakIteratorRules_hu_HU;
getBreakIteratorRules_hy_AM;
getBreakIteratorRules_ia;
getBreakIteratorRules_id_ID;
getBreakIteratorRules_ja_JP;
+getBreakIteratorRules_jbo;
getBreakIteratorRules_kk_KZ;
getBreakIteratorRules_km_KH;
getBreakIteratorRules_kn_IN;
@@ -270,6 +292,7 @@ getBreakIteratorRules_ko_KR;
getBreakIteratorRules_ku_TR;
getBreakIteratorRules_ky_KG;
getBreakIteratorRules_lg_UG;
+getBreakIteratorRules_lif_NP;
getBreakIteratorRules_ln_CD;
getBreakIteratorRules_lo_LA;
getBreakIteratorRules_mai_IN;
@@ -302,10 +325,12 @@ getBreakIteratorRules_tn_ZA;
getBreakIteratorRules_tpi_PG;
getBreakIteratorRules_ts_ZA;
getBreakIteratorRules_ug_CN;
+getBreakIteratorRules_ur_PK;
getBreakIteratorRules_uz_UZ;
getBreakIteratorRules_ve_ZA;
getBreakIteratorRules_vi_VN;
getBreakIteratorRules_xh_ZA;
+getBreakIteratorRules_yi_US;
getBreakIteratorRules_zh_CN;
getBreakIteratorRules_zh_HK;
getBreakIteratorRules_zh_MO;
@@ -333,14 +358,17 @@ getCollationOptions_fa_IR;
getCollationOptions_gug_PY;
getCollationOptions_gu_IN;
getCollationOptions_ha_GH;
+getCollationOptions_haw_US;
getCollationOptions_he_IL;
getCollationOptions_hi_IN;
getCollationOptions_hil_PH;
+getCollationOptions_ht_HT;
getCollationOptions_hu_HU;
getCollationOptions_hy_AM;
getCollationOptions_ia;
getCollationOptions_id_ID;
getCollationOptions_ja_JP;
+getCollationOptions_jbo;
getCollationOptions_kk_KZ;
getCollationOptions_km_KH;
getCollationOptions_kn_IN;
@@ -348,6 +376,7 @@ getCollationOptions_ko_KR;
getCollationOptions_ku_TR;
getCollationOptions_ky_KG;
getCollationOptions_lg_UG;
+getCollationOptions_lif_NP;
getCollationOptions_ln_CD;
getCollationOptions_lo_LA;
getCollationOptions_mai_IN;
@@ -380,10 +409,12 @@ getCollationOptions_tn_ZA;
getCollationOptions_tpi_PG;
getCollationOptions_ts_ZA;
getCollationOptions_ug_CN;
+getCollationOptions_ur_PK;
getCollationOptions_uz_UZ;
getCollationOptions_ve_ZA;
getCollationOptions_vi_VN;
getCollationOptions_xh_ZA;
+getCollationOptions_yi_US;
getCollationOptions_zh_CN;
getCollationOptions_zh_HK;
getCollationOptions_zh_MO;
@@ -411,14 +442,17 @@ getCollatorImplementation_fa_IR;
getCollatorImplementation_gug_PY;
getCollatorImplementation_gu_IN;
getCollatorImplementation_ha_GH;
+getCollatorImplementation_haw_US;
getCollatorImplementation_he_IL;
getCollatorImplementation_hi_IN;
getCollatorImplementation_hil_PH;
+getCollatorImplementation_ht_HT;
getCollatorImplementation_hu_HU;
getCollatorImplementation_hy_AM;
getCollatorImplementation_ia;
getCollatorImplementation_id_ID;
getCollatorImplementation_ja_JP;
+getCollatorImplementation_jbo;
getCollatorImplementation_kk_KZ;
getCollatorImplementation_km_KH;
getCollatorImplementation_kn_IN;
@@ -426,6 +460,7 @@ getCollatorImplementation_ko_KR;
getCollatorImplementation_ku_TR;
getCollatorImplementation_ky_KG;
getCollatorImplementation_lg_UG;
+getCollatorImplementation_lif_NP;
getCollatorImplementation_ln_CD;
getCollatorImplementation_lo_LA;
getCollatorImplementation_mai_IN;
@@ -458,10 +493,12 @@ getCollatorImplementation_tn_ZA;
getCollatorImplementation_tpi_PG;
getCollatorImplementation_ts_ZA;
getCollatorImplementation_ug_CN;
+getCollatorImplementation_ur_PK;
getCollatorImplementation_uz_UZ;
getCollatorImplementation_ve_ZA;
getCollatorImplementation_vi_VN;
getCollatorImplementation_xh_ZA;
+getCollatorImplementation_yi_US;
getCollatorImplementation_zh_CN;
getCollatorImplementation_zh_HK;
getCollatorImplementation_zh_MO;
@@ -489,14 +526,17 @@ getContinuousNumberingLevels_fa_IR;
getContinuousNumberingLevels_gug_PY;
getContinuousNumberingLevels_gu_IN;
getContinuousNumberingLevels_ha_GH;
+getContinuousNumberingLevels_haw_US;
getContinuousNumberingLevels_he_IL;
getContinuousNumberingLevels_hi_IN;
getContinuousNumberingLevels_hil_PH;
+getContinuousNumberingLevels_ht_HT;
getContinuousNumberingLevels_hu_HU;
getContinuousNumberingLevels_hy_AM;
getContinuousNumberingLevels_ia;
getContinuousNumberingLevels_id_ID;
getContinuousNumberingLevels_ja_JP;
+getContinuousNumberingLevels_jbo;
getContinuousNumberingLevels_kk_KZ;
getContinuousNumberingLevels_km_KH;
getContinuousNumberingLevels_kn_IN;
@@ -504,6 +544,7 @@ getContinuousNumberingLevels_ko_KR;
getContinuousNumberingLevels_ku_TR;
getContinuousNumberingLevels_ky_KG;
getContinuousNumberingLevels_lg_UG;
+getContinuousNumberingLevels_lif_NP;
getContinuousNumberingLevels_ln_CD;
getContinuousNumberingLevels_lo_LA;
getContinuousNumberingLevels_mai_IN;
@@ -536,10 +577,12 @@ getContinuousNumberingLevels_tn_ZA;
getContinuousNumberingLevels_tpi_PG;
getContinuousNumberingLevels_ts_ZA;
getContinuousNumberingLevels_ug_CN;
+getContinuousNumberingLevels_ur_PK;
getContinuousNumberingLevels_uz_UZ;
getContinuousNumberingLevels_ve_ZA;
getContinuousNumberingLevels_vi_VN;
getContinuousNumberingLevels_xh_ZA;
+getContinuousNumberingLevels_yi_US;
getContinuousNumberingLevels_zh_CN;
getContinuousNumberingLevels_zh_HK;
getContinuousNumberingLevels_zh_MO;
@@ -567,14 +610,17 @@ getFollowPageWords_fa_IR;
getFollowPageWords_gug_PY;
getFollowPageWords_gu_IN;
getFollowPageWords_ha_GH;
+getFollowPageWords_haw_US;
getFollowPageWords_he_IL;
getFollowPageWords_hi_IN;
getFollowPageWords_hil_PH;
+getFollowPageWords_ht_HT;
getFollowPageWords_hu_HU;
getFollowPageWords_hy_AM;
getFollowPageWords_ia;
getFollowPageWords_id_ID;
getFollowPageWords_ja_JP;
+getFollowPageWords_jbo;
getFollowPageWords_kk_KZ;
getFollowPageWords_km_KH;
getFollowPageWords_kn_IN;
@@ -582,6 +628,7 @@ getFollowPageWords_ko_KR;
getFollowPageWords_ku_TR;
getFollowPageWords_ky_KG;
getFollowPageWords_lg_UG;
+getFollowPageWords_lif_NP;
getFollowPageWords_ln_CD;
getFollowPageWords_lo_LA;
getFollowPageWords_mai_IN;
@@ -614,10 +661,12 @@ getFollowPageWords_tn_ZA;
getFollowPageWords_tpi_PG;
getFollowPageWords_ts_ZA;
getFollowPageWords_ug_CN;
+getFollowPageWords_ur_PK;
getFollowPageWords_uz_UZ;
getFollowPageWords_ve_ZA;
getFollowPageWords_vi_VN;
getFollowPageWords_xh_ZA;
+getFollowPageWords_yi_US;
getFollowPageWords_zh_CN;
getFollowPageWords_zh_HK;
getFollowPageWords_zh_MO;
@@ -645,14 +694,17 @@ getForbiddenCharacters_fa_IR;
getForbiddenCharacters_gug_PY;
getForbiddenCharacters_gu_IN;
getForbiddenCharacters_ha_GH;
+getForbiddenCharacters_haw_US;
getForbiddenCharacters_he_IL;
getForbiddenCharacters_hi_IN;
getForbiddenCharacters_hil_PH;
+getForbiddenCharacters_ht_HT;
getForbiddenCharacters_hu_HU;
getForbiddenCharacters_hy_AM;
getForbiddenCharacters_ia;
getForbiddenCharacters_id_ID;
getForbiddenCharacters_ja_JP;
+getForbiddenCharacters_jbo;
getForbiddenCharacters_kk_KZ;
getForbiddenCharacters_km_KH;
getForbiddenCharacters_kn_IN;
@@ -660,6 +712,7 @@ getForbiddenCharacters_ko_KR;
getForbiddenCharacters_ku_TR;
getForbiddenCharacters_ky_KG;
getForbiddenCharacters_lg_UG;
+getForbiddenCharacters_lif_NP;
getForbiddenCharacters_ln_CD;
getForbiddenCharacters_lo_LA;
getForbiddenCharacters_mai_IN;
@@ -692,10 +745,12 @@ getForbiddenCharacters_tn_ZA;
getForbiddenCharacters_tpi_PG;
getForbiddenCharacters_ts_ZA;
getForbiddenCharacters_ug_CN;
+getForbiddenCharacters_ur_PK;
getForbiddenCharacters_uz_UZ;
getForbiddenCharacters_ve_ZA;
getForbiddenCharacters_vi_VN;
getForbiddenCharacters_xh_ZA;
+getForbiddenCharacters_yi_US;
getForbiddenCharacters_zh_CN;
getForbiddenCharacters_zh_HK;
getForbiddenCharacters_zh_MO;
@@ -723,14 +778,17 @@ getIndexAlgorithm_fa_IR;
getIndexAlgorithm_gug_PY;
getIndexAlgorithm_gu_IN;
getIndexAlgorithm_ha_GH;
+getIndexAlgorithm_haw_US;
getIndexAlgorithm_he_IL;
getIndexAlgorithm_hi_IN;
getIndexAlgorithm_hil_PH;
+getIndexAlgorithm_ht_HT;
getIndexAlgorithm_hu_HU;
getIndexAlgorithm_hy_AM;
getIndexAlgorithm_ia;
getIndexAlgorithm_id_ID;
getIndexAlgorithm_ja_JP;
+getIndexAlgorithm_jbo;
getIndexAlgorithm_kk_KZ;
getIndexAlgorithm_km_KH;
getIndexAlgorithm_kn_IN;
@@ -738,6 +796,7 @@ getIndexAlgorithm_ko_KR;
getIndexAlgorithm_ku_TR;
getIndexAlgorithm_ky_KG;
getIndexAlgorithm_lg_UG;
+getIndexAlgorithm_lif_NP;
getIndexAlgorithm_ln_CD;
getIndexAlgorithm_lo_LA;
getIndexAlgorithm_mai_IN;
@@ -770,10 +829,12 @@ getIndexAlgorithm_tn_ZA;
getIndexAlgorithm_tpi_PG;
getIndexAlgorithm_ts_ZA;
getIndexAlgorithm_ug_CN;
+getIndexAlgorithm_ur_PK;
getIndexAlgorithm_uz_UZ;
getIndexAlgorithm_ve_ZA;
getIndexAlgorithm_vi_VN;
getIndexAlgorithm_xh_ZA;
+getIndexAlgorithm_yi_US;
getIndexAlgorithm_zh_CN;
getIndexAlgorithm_zh_HK;
getIndexAlgorithm_zh_MO;
@@ -801,14 +862,17 @@ getLCInfo_fa_IR;
getLCInfo_gug_PY;
getLCInfo_gu_IN;
getLCInfo_ha_GH;
+getLCInfo_haw_US;
getLCInfo_he_IL;
getLCInfo_hi_IN;
getLCInfo_hil_PH;
+getLCInfo_ht_HT;
getLCInfo_hu_HU;
getLCInfo_hy_AM;
getLCInfo_ia;
getLCInfo_id_ID;
getLCInfo_ja_JP;
+getLCInfo_jbo;
getLCInfo_kk_KZ;
getLCInfo_km_KH;
getLCInfo_kn_IN;
@@ -816,6 +880,7 @@ getLCInfo_ko_KR;
getLCInfo_ku_TR;
getLCInfo_ky_KG;
getLCInfo_lg_UG;
+getLCInfo_lif_NP;
getLCInfo_ln_CD;
getLCInfo_lo_LA;
getLCInfo_mai_IN;
@@ -848,10 +913,12 @@ getLCInfo_tn_ZA;
getLCInfo_tpi_PG;
getLCInfo_ts_ZA;
getLCInfo_ug_CN;
+getLCInfo_ur_PK;
getLCInfo_uz_UZ;
getLCInfo_ve_ZA;
getLCInfo_vi_VN;
getLCInfo_xh_ZA;
+getLCInfo_yi_US;
getLCInfo_zh_CN;
getLCInfo_zh_HK;
getLCInfo_zh_MO;
@@ -879,14 +946,17 @@ getLocaleItem_fa_IR;
getLocaleItem_gug_PY;
getLocaleItem_gu_IN;
getLocaleItem_ha_GH;
+getLocaleItem_haw_US;
getLocaleItem_he_IL;
getLocaleItem_hi_IN;
getLocaleItem_hil_PH;
+getLocaleItem_ht_HT;
getLocaleItem_hu_HU;
getLocaleItem_hy_AM;
getLocaleItem_ia;
getLocaleItem_id_ID;
getLocaleItem_ja_JP;
+getLocaleItem_jbo;
getLocaleItem_kk_KZ;
getLocaleItem_km_KH;
getLocaleItem_kn_IN;
@@ -894,6 +964,7 @@ getLocaleItem_ko_KR;
getLocaleItem_ku_TR;
getLocaleItem_ky_KG;
getLocaleItem_lg_UG;
+getLocaleItem_lif_NP;
getLocaleItem_ln_CD;
getLocaleItem_lo_LA;
getLocaleItem_mai_IN;
@@ -926,10 +997,12 @@ getLocaleItem_tn_ZA;
getLocaleItem_tpi_PG;
getLocaleItem_ts_ZA;
getLocaleItem_ug_CN;
+getLocaleItem_ur_PK;
getLocaleItem_uz_UZ;
getLocaleItem_ve_ZA;
getLocaleItem_vi_VN;
getLocaleItem_xh_ZA;
+getLocaleItem_yi_US;
getLocaleItem_zh_CN;
getLocaleItem_zh_HK;
getLocaleItem_zh_MO;
@@ -957,14 +1030,17 @@ getOutlineNumberingLevels_fa_IR;
getOutlineNumberingLevels_gug_PY;
getOutlineNumberingLevels_gu_IN;
getOutlineNumberingLevels_ha_GH;
+getOutlineNumberingLevels_haw_US;
getOutlineNumberingLevels_he_IL;
getOutlineNumberingLevels_hi_IN;
getOutlineNumberingLevels_hil_PH;
+getOutlineNumberingLevels_ht_HT;
getOutlineNumberingLevels_hu_HU;
getOutlineNumberingLevels_hy_AM;
getOutlineNumberingLevels_ia;
getOutlineNumberingLevels_id_ID;
getOutlineNumberingLevels_ja_JP;
+getOutlineNumberingLevels_jbo;
getOutlineNumberingLevels_kk_KZ;
getOutlineNumberingLevels_km_KH;
getOutlineNumberingLevels_kn_IN;
@@ -972,6 +1048,7 @@ getOutlineNumberingLevels_ko_KR;
getOutlineNumberingLevels_ku_TR;
getOutlineNumberingLevels_ky_KG;
getOutlineNumberingLevels_lg_UG;
+getOutlineNumberingLevels_lif_NP;
getOutlineNumberingLevels_ln_CD;
getOutlineNumberingLevels_lo_LA;
getOutlineNumberingLevels_mai_IN;
@@ -1004,10 +1081,12 @@ getOutlineNumberingLevels_tn_ZA;
getOutlineNumberingLevels_tpi_PG;
getOutlineNumberingLevels_ts_ZA;
getOutlineNumberingLevels_ug_CN;
+getOutlineNumberingLevels_ur_PK;
getOutlineNumberingLevels_uz_UZ;
getOutlineNumberingLevels_ve_ZA;
getOutlineNumberingLevels_vi_VN;
getOutlineNumberingLevels_xh_ZA;
+getOutlineNumberingLevels_yi_US;
getOutlineNumberingLevels_zh_CN;
getOutlineNumberingLevels_zh_HK;
getOutlineNumberingLevels_zh_MO;
@@ -1035,14 +1114,17 @@ getReservedWords_fa_IR;
getReservedWords_gug_PY;
getReservedWords_gu_IN;
getReservedWords_ha_GH;
+getReservedWords_haw_US;
getReservedWords_he_IL;
getReservedWords_hi_IN;
getReservedWords_hil_PH;
+getReservedWords_ht_HT;
getReservedWords_hu_HU;
getReservedWords_hy_AM;
getReservedWords_ia;
getReservedWords_id_ID;
getReservedWords_ja_JP;
+getReservedWords_jbo;
getReservedWords_kk_KZ;
getReservedWords_km_KH;
getReservedWords_kn_IN;
@@ -1050,6 +1132,7 @@ getReservedWords_ko_KR;
getReservedWords_ku_TR;
getReservedWords_ky_KG;
getReservedWords_lg_UG;
+getReservedWords_lif_NP;
getReservedWords_ln_CD;
getReservedWords_lo_LA;
getReservedWords_mai_IN;
@@ -1082,10 +1165,12 @@ getReservedWords_tn_ZA;
getReservedWords_tpi_PG;
getReservedWords_ts_ZA;
getReservedWords_ug_CN;
+getReservedWords_ur_PK;
getReservedWords_uz_UZ;
getReservedWords_ve_ZA;
getReservedWords_vi_VN;
getReservedWords_xh_ZA;
+getReservedWords_yi_US;
getReservedWords_zh_CN;
getReservedWords_zh_HK;
getReservedWords_zh_MO;
@@ -1113,14 +1198,17 @@ getSearchOptions_fa_IR;
getSearchOptions_gug_PY;
getSearchOptions_gu_IN;
getSearchOptions_ha_GH;
+getSearchOptions_haw_US;
getSearchOptions_he_IL;
getSearchOptions_hi_IN;
getSearchOptions_hil_PH;
+getSearchOptions_ht_HT;
getSearchOptions_hu_HU;
getSearchOptions_hy_AM;
getSearchOptions_ia;
getSearchOptions_id_ID;
getSearchOptions_ja_JP;
+getSearchOptions_jbo;
getSearchOptions_kk_KZ;
getSearchOptions_km_KH;
getSearchOptions_kn_IN;
@@ -1128,6 +1216,7 @@ getSearchOptions_ko_KR;
getSearchOptions_ku_TR;
getSearchOptions_ky_KG;
getSearchOptions_lg_UG;
+getSearchOptions_lif_NP;
getSearchOptions_ln_CD;
getSearchOptions_lo_LA;
getSearchOptions_mai_IN;
@@ -1160,10 +1249,12 @@ getSearchOptions_tn_ZA;
getSearchOptions_tpi_PG;
getSearchOptions_ts_ZA;
getSearchOptions_ug_CN;
+getSearchOptions_ur_PK;
getSearchOptions_uz_UZ;
getSearchOptions_ve_ZA;
getSearchOptions_vi_VN;
getSearchOptions_xh_ZA;
+getSearchOptions_yi_US;
getSearchOptions_zh_CN;
getSearchOptions_zh_HK;
getSearchOptions_zh_MO;
@@ -1191,14 +1282,17 @@ getTransliterations_fa_IR;
getTransliterations_gug_PY;
getTransliterations_gu_IN;
getTransliterations_ha_GH;
+getTransliterations_haw_US;
getTransliterations_he_IL;
getTransliterations_hi_IN;
getTransliterations_hil_PH;
+getTransliterations_ht_HT;
getTransliterations_hu_HU;
getTransliterations_hy_AM;
getTransliterations_ia;
getTransliterations_id_ID;
getTransliterations_ja_JP;
+getTransliterations_jbo;
getTransliterations_kk_KZ;
getTransliterations_km_KH;
getTransliterations_kn_IN;
@@ -1206,6 +1300,7 @@ getTransliterations_ko_KR;
getTransliterations_ku_TR;
getTransliterations_ky_KG;
getTransliterations_lg_UG;
+getTransliterations_lif_NP;
getTransliterations_ln_CD;
getTransliterations_lo_LA;
getTransliterations_mai_IN;
@@ -1238,10 +1333,12 @@ getTransliterations_tn_ZA;
getTransliterations_tpi_PG;
getTransliterations_ts_ZA;
getTransliterations_ug_CN;
+getTransliterations_ur_PK;
getTransliterations_uz_UZ;
getTransliterations_ve_ZA;
getTransliterations_vi_VN;
getTransliterations_xh_ZA;
+getTransliterations_yi_US;
getTransliterations_zh_CN;
getTransliterations_zh_HK;
getTransliterations_zh_MO;
@@ -1269,14 +1366,17 @@ getUnicodeScripts_fa_IR;
getUnicodeScripts_gug_PY;
getUnicodeScripts_gu_IN;
getUnicodeScripts_ha_GH;
+getUnicodeScripts_haw_US;
getUnicodeScripts_he_IL;
getUnicodeScripts_hi_IN;
getUnicodeScripts_hil_PH;
+getUnicodeScripts_ht_HT;
getUnicodeScripts_hu_HU;
getUnicodeScripts_hy_AM;
getUnicodeScripts_ia;
getUnicodeScripts_id_ID;
getUnicodeScripts_ja_JP;
+getUnicodeScripts_jbo;
getUnicodeScripts_kk_KZ;
getUnicodeScripts_km_KH;
getUnicodeScripts_kn_IN;
@@ -1284,6 +1384,7 @@ getUnicodeScripts_ko_KR;
getUnicodeScripts_ku_TR;
getUnicodeScripts_ky_KG;
getUnicodeScripts_lg_UG;
+getUnicodeScripts_lif_NP;
getUnicodeScripts_ln_CD;
getUnicodeScripts_lo_LA;
getUnicodeScripts_mai_IN;
@@ -1316,17 +1417,18 @@ getUnicodeScripts_tn_ZA;
getUnicodeScripts_tpi_PG;
getUnicodeScripts_ts_ZA;
getUnicodeScripts_ug_CN;
+getUnicodeScripts_ur_PK;
getUnicodeScripts_uz_UZ;
getUnicodeScripts_ve_ZA;
getUnicodeScripts_vi_VN;
getUnicodeScripts_xh_ZA;
+getUnicodeScripts_yi_US;
getUnicodeScripts_zh_CN;
getUnicodeScripts_zh_HK;
getUnicodeScripts_zh_MO;
getUnicodeScripts_zh_SG;
getUnicodeScripts_zh_TW;
getUnicodeScripts_zu_ZA;
-GetVersionInfo;
local:
*;
diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk
index 1034de7f11bf..54b412d75205 100755..100644
--- a/i18npool/source/localedata/data/makefile.mk
+++ b/i18npool/source/localedata/data/makefile.mk
@@ -167,6 +167,7 @@ SHL3OBJS= \
$(SLO)$/localedata_de_DE.obj \
$(SLO)$/localedata_de_LI.obj \
$(SLO)$/localedata_de_LU.obj \
+ $(SLO)$/localedata_dsb_DE.obj \
$(SLO)$/localedata_el_GR.obj \
$(SLO)$/localedata_et_EE.obj \
$(SLO)$/localedata_eu.obj \
@@ -260,15 +261,18 @@ SHL4OBJS= \
$(SLO)$/localedata_fa_IR.obj \
$(SLO)$/localedata_gu_IN.obj \
$(SLO)$/localedata_gug_PY.obj \
+ $(SLO)$/localedata_haw_US.obj \
$(SLO)$/localedata_ha_GH.obj \
$(SLO)$/localedata_he_IL.obj \
$(SLO)$/localedata_hi_IN.obj \
$(SLO)$/localedata_hil_PH.obj \
+ $(SLO)$/localedata_ht_HT.obj \
$(SLO)$/localedata_hu_HU.obj \
$(SLO)$/localedata_hy_AM.obj \
$(SLO)$/localedata_ia.obj \
$(SLO)$/localedata_id_ID.obj \
$(SLO)$/localedata_ja_JP.obj \
+ $(SLO)$/localedata_jbo.obj \
$(SLO)$/localedata_kk_KZ.obj \
$(SLO)$/localedata_km_KH.obj \
$(SLO)$/localedata_kn_IN.obj \
@@ -276,6 +280,7 @@ SHL4OBJS= \
$(SLO)$/localedata_ku_TR.obj \
$(SLO)$/localedata_ky_KG.obj \
$(SLO)$/localedata_lg_UG.obj \
+ $(SLO)$/localedata_lif_NP.obj \
$(SLO)$/localedata_ln_CD.obj \
$(SLO)$/localedata_lo_LA.obj \
$(SLO)$/localedata_mai_IN.obj \
@@ -308,10 +313,12 @@ SHL4OBJS= \
$(SLO)$/localedata_tpi_PG.obj \
$(SLO)$/localedata_ts_ZA.obj \
$(SLO)$/localedata_ug_CN.obj \
+ $(SLO)$/localedata_ur_PK.obj \
$(SLO)$/localedata_uz_UZ.obj \
$(SLO)$/localedata_ve_ZA.obj \
$(SLO)$/localedata_vi_VN.obj \
$(SLO)$/localedata_xh_ZA.obj \
+ $(SLO)$/localedata_yi_US.obj \
$(SLO)$/localedata_zh_CN.obj \
$(SLO)$/localedata_zh_HK.obj \
$(SLO)$/localedata_zh_MO.obj \
diff --git a/i18npool/source/localedata/data/no_NO.xml b/i18npool/source/localedata/data/no_NO.xml
index 21ac49181020..6df7b5e2d018 100644
--- a/i18npool/source/localedata/data/no_NO.xml
+++ b/i18npool/source/localedata/data/no_NO.xml
@@ -232,7 +232,7 @@
</SearchOptions>
</LC_SEARCH>
<LC_INDEX>
-<IndexKey unoid="alphanumeric" default="true" phonetic="false">A-V X-Z Æ Ø Å</IndexKey>
+<IndexKey unoid="alphanumeric" default="true" phonetic="false">A-Z Æ Ø Å</IndexKey>
<UnicodeScript>0</UnicodeScript>
<UnicodeScript>1</UnicodeScript>
<FollowPageWord>p.</FollowPageWord>
diff --git a/i18npool/source/localedata/data/sv_SE.xml b/i18npool/source/localedata/data/sv_SE.xml
index 211f95c3e894..4afefebfa661 100644
--- a/i18npool/source/localedata/data/sv_SE.xml
+++ b/i18npool/source/localedata/data/sv_SE.xml
@@ -179,7 +179,7 @@
<LC_COLLATION ref="en_US" />
<LC_SEARCH ref="en_US"/>
<LC_INDEX>
- <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-V X-Z Å Ä Ö</IndexKey>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z Å Ä Ö</IndexKey>
<UnicodeScript>0</UnicodeScript>
<UnicodeScript>1</UnicodeScript>
<FollowPageWord>f.</FollowPageWord>
diff --git a/i18npool/source/localedata/data/ur_PK.xml b/i18npool/source/localedata/data/ur_PK.xml
new file mode 100644
index 000000000000..53002e931068
--- /dev/null
+++ b/i18npool/source/localedata/data/ur_PK.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>ur</LangID>
+ <DefaultName>Urdu</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>PK</CountryID>
+ <DefaultName>Pakistan</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE unoid="generic">
+ <Separators>
+ <DateSeparator>/</DateSeparator>
+ <ThousandSeparator>,</ThousandSeparator>
+ <DecimalSeparator>.</DecimalSeparator>
+ <TimeSeparator>:</TimeSeparator>
+ <Time100SecSeparator>.</Time100SecSeparator>
+ <ListSeparator>;</ListSeparator>
+ <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
+ <LongDateDaySeparator>, </LongDateDaySeparator>
+ <LongDateMonthSeparator> </LongDateMonthSeparator>
+ <LongDateYearSeparator> </LongDateYearSeparator>
+ </Separators>
+ <Markers>
+ <QuotationStart>‘</QuotationStart>
+ <QuotationEnd>’</QuotationEnd>
+ <DoubleQuotationStart>“</DoubleQuotationStart>
+ <DoubleQuotationEnd>”</DoubleQuotationEnd>
+ </Markers>
+ <TimeAM>قبل دوپہر</TimeAM>
+ <TimePM>بعد دوپہر</TimePM>
+ <MeasurementSystem>metric</MeasurementSystem>
+ </LC_CTYPE>
+ <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$₨-420]">
+ <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
+ <FormatCode>General</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1">
+ <FormatCode>0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2">
+ <FormatCode>0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3">
+ <FormatCode>#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4">
+ <FormatCode>#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5">
+ <FormatCode>#,###.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6">
+ <FormatCode>0.00E+00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7">
+ <FormatCode>0.00E+000</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8">
+ <FormatCode>0%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9">
+ <FormatCode>0.00%</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
+ <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
+ <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
+ <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
+ <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
+ <FormatCode>CCC#,##0.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
+ <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18">
+ <FormatCode>D/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19">
+ <FormatCode>NNNNDD, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20">
+ <FormatCode>DD/MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21">
+ <FormatCode>DD/MM/YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22">
+ <FormatCode>D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24">
+ <FormatCode>D, MMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25">
+ <FormatCode>D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26">
+ <FormatCode>D, MMMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27">
+ <FormatCode>NN, DD/MMM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28">
+ <FormatCode>NN, D, MMM YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29">
+ <FormatCode>NN, D, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30">
+ <FormatCode>NNNND, MMMM YYYY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31">
+ <FormatCode>MM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32">
+ <FormatCode>YY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33">
+ <FormatCode>YYYY-MM-DD</FormatCode>
+ <DefaultName>ISO 8601</DefaultName>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
+ <FormatCode>MM/YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35">
+ <FormatCode>MMM/DD</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36">
+ <FormatCode>MMMM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37">
+ <FormatCode>QQ YY</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
+ <FormatCode>WW</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+ <FormatCode>HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+ <FormatCode>HH:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+ <FormatCode>HH:MM AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+ <FormatCode>HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
+ <FormatCode>[HH]:MM:SS</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44">
+ <FormatCode>MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45">
+ <FormatCode>[HH]:MM:SS.00</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46">
+ <FormatCode>DD/MM/YY HH:MM</FormatCode>
+ </FormatElement>
+ <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
+ <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode>
+ </FormatElement>
+ </LC_FORMAT>
+ <LC_COLLATION>
+ <Collator default="true" unoid="alphanumeric"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
+ <LC_SEARCH>
+ <SearchOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </SearchOptions>
+ </LC_SEARCH>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">أ ؤ ا آ ب پ ت ٹ ث ج چ ح خ د ڈ ذ ر ڑ ز ژ س ش ص ض ط ظ ع غ ف ق ک گ ل م ن ں و ہ ی ء ئ ے ٻ ة ٺ ټ ٽ ه ھ ي</IndexKey>
+ <UnicodeScript>0</UnicodeScript>
+ <UnicodeScript>1</UnicodeScript>
+ <FollowPageWord>صفحہ</FollowPageWord>
+ <FollowPageWord>صفحے</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اتوار</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>پ</DefaultAbbrvName>
+ <DefaultFullName>پير</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>م</DefaultAbbrvName>
+ <DefaultFullName>منگل</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>ب</DefaultAbbrvName>
+ <DefaultFullName>بده</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جمعرات</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جمعہ</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>ہ</DefaultAbbrvName>
+ <DefaultFullName>ہفتہ</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جنوری</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>ف</DefaultAbbrvName>
+ <DefaultFullName>فروری</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>م</DefaultAbbrvName>
+ <DefaultFullName>مار چ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اپريل</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>م</DefaultAbbrvName>
+ <DefaultFullName>مئ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جون</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>ج</DefaultAbbrvName>
+ <DefaultFullName>جولائ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اگست</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>س</DefaultAbbrvName>
+ <DefaultFullName>ستمبر</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>ا</DefaultAbbrvName>
+ <DefaultFullName>اکتوبر</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>ن</DefaultAbbrvName>
+ <DefaultFullName>نومبر</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>د</DefaultAbbrvName>
+ <DefaultFullName>دسمبر</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>ق م</DefaultAbbrvName>
+ <DefaultFullName>قبل مسيح</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>ء</DefaultAbbrvName>
+ <DefaultFullName>عيسوی سن</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY>
+ <Currency default="true" usedInCompatibleFormatCodes="true">
+ <CurrencyID>PKR</CurrencyID>
+ <CurrencySymbol>₨</CurrencySymbol>
+ <BankSymbol>PKR</BankSymbol>
+ <CurrencyName>پاکستانی روپیہ</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ </LC_CURRENCY>
+ <LC_TRANSLITERATION>
+ <Transliteration unoid="LOWERCASE_UPPERCASE"/>
+ <Transliteration unoid="UPPERCASE_LOWERCASE"/>
+ <Transliteration unoid="IGNORE_CASE"/>
+ </LC_TRANSLITERATION>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>راست</trueWord>
+ <falseWord>غلط</falseWord>
+ <quarter1Word>ایک چوتھائی</quarter1Word>
+ <quarter2Word>دو چوتھائی</quarter2Word>
+ <quarter3Word>تین چوتھائی</quarter3Word>
+ <quarter4Word>چار چوتھائی</quarter4Word>
+ <aboveWord>اوپر</aboveWord>
+ <belowWord>نیچے</belowWord>
+ <quarter1Abbreviation>چوتھائی 1</quarter1Abbreviation>
+ <quarter2Abbreviation>چوتھائی 2 </quarter2Abbreviation>
+ <quarter3Abbreviation>چوتھائی 3</quarter3Abbreviation>
+ <quarter4Abbreviation>چوتھائی 4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel>
+ <NumberingLevel NumType="4" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="4" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="4" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="2" Prefix=" " Suffix="."/>
+ <NumberingLevel NumType="0" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix=" " Suffix=")"/>
+ <NumberingLevel NumType="1" Prefix="(" Suffix=")"/>
+ <NumberingLevel NumType="3" Prefix=" " Suffix="."/>
+ </LC_NumberingLevel>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
+<!--Version 1.0 -->
diff --git a/i18npool/source/localedata/data/yi_US.xml b/i18npool/source/localedata/data/yi_US.xml
new file mode 100644
index 000000000000..cf52c1ae1fdf
--- /dev/null
+++ b/i18npool/source/localedata/data/yi_US.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE Locale SYSTEM 'locale.dtd'>
+<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0">
+ <LC_INFO>
+ <Language>
+ <LangID>yi</LangID>
+ <DefaultName>Yiddish</DefaultName>
+ </Language>
+ <Country>
+ <CountryID>US</CountryID>
+ <DefaultName>United States</DefaultName>
+ </Country>
+ </LC_INFO>
+ <LC_CTYPE ref="en_US"/>
+ <LC_FORMAT ref="en_US" replaceTo="[$$-83D]"/>
+ <LC_COLLATION ref="en_US"/>
+ <LC_SEARCH ref="en_US"/>
+ <LC_INDEX>
+ <IndexKey phonetic="false" default="true" unoid="alphanumeric">א-י כ ל מ נ ס ע פ צ-ת</IndexKey>
+ <UnicodeScript>10</UnicodeScript>
+ <FollowPageWord>ז“</FollowPageWord>
+ <FollowPageWord>ז“</FollowPageWord>
+ </LC_INDEX>
+ <LC_CALENDAR>
+ <Calendar unoid="gregorian" default="true">
+ <DaysOfWeek>
+ <Day>
+ <DayID>sun</DayID>
+ <DefaultAbbrvName>זונ'</DefaultAbbrvName>
+ <DefaultFullName>זונטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>mon</DayID>
+ <DefaultAbbrvName>מאָנ'</DefaultAbbrvName>
+ <DefaultFullName>מאָנטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>tue</DayID>
+ <DefaultAbbrvName>דינ'</DefaultAbbrvName>
+ <DefaultFullName>דינסטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>wed</DayID>
+ <DefaultAbbrvName>מיט'</DefaultAbbrvName>
+ <DefaultFullName>מיטװאָך</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>thu</DayID>
+ <DefaultAbbrvName>דאָנ'</DefaultAbbrvName>
+ <DefaultFullName>דאָנערשטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>fri</DayID>
+ <DefaultAbbrvName>פֿרײַ'</DefaultAbbrvName>
+ <DefaultFullName>פֿרײַטיק</DefaultFullName>
+ </Day>
+ <Day>
+ <DayID>sat</DayID>
+ <DefaultAbbrvName>שבת</DefaultAbbrvName>
+ <DefaultFullName>שבת</DefaultFullName>
+ </Day>
+ </DaysOfWeek>
+ <MonthsOfYear>
+ <Month>
+ <MonthID>jan</MonthID>
+ <DefaultAbbrvName>יאַנ</DefaultAbbrvName>
+ <DefaultFullName>יאַנואַר</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>feb</MonthID>
+ <DefaultAbbrvName>פֿעב</DefaultAbbrvName>
+ <DefaultFullName>פֿעברואַר</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>mar</MonthID>
+ <DefaultAbbrvName>מאַר</DefaultAbbrvName>
+ <DefaultFullName>מאַרץ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>apr</MonthID>
+ <DefaultAbbrvName>אַפּר</DefaultAbbrvName>
+ <DefaultFullName>אַפּריל</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>may</MonthID>
+ <DefaultAbbrvName>מײַ</DefaultAbbrvName>
+ <DefaultFullName>מײַ</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jun</MonthID>
+ <DefaultAbbrvName>יונ</DefaultAbbrvName>
+ <DefaultFullName>יוני</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>jul</MonthID>
+ <DefaultAbbrvName>יול</DefaultAbbrvName>
+ <DefaultFullName>יולי</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>aug</MonthID>
+ <DefaultAbbrvName>אױג</DefaultAbbrvName>
+ <DefaultFullName>אױגוסט</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>sep</MonthID>
+ <DefaultAbbrvName>סעפּ</DefaultAbbrvName>
+ <DefaultFullName>סעפּטעמבער</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>oct</MonthID>
+ <DefaultAbbrvName>אָקט</DefaultAbbrvName>
+ <DefaultFullName>אָקטאָבער</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>nov</MonthID>
+ <DefaultAbbrvName>נאָװ</DefaultAbbrvName>
+ <DefaultFullName>נאָװעמבער</DefaultFullName>
+ </Month>
+ <Month>
+ <MonthID>dec</MonthID>
+ <DefaultAbbrvName>דעצ</DefaultAbbrvName>
+ <DefaultFullName>דעצעמבער</DefaultFullName>
+ </Month>
+ </MonthsOfYear>
+ <Eras>
+ <Era>
+ <EraID>bc</EraID>
+ <DefaultAbbrvName>פֿ"ק</DefaultAbbrvName>
+ <DefaultFullName>פֿ"ק</DefaultFullName>
+ </Era>
+ <Era>
+ <EraID>ad</EraID>
+ <DefaultAbbrvName>אצ“ר</DefaultAbbrvName>
+ <DefaultFullName>אצ“ר</DefaultFullName>
+ </Era>
+ </Eras>
+ <StartDayOfWeek>
+ <DayID>sun</DayID>
+ </StartDayOfWeek>
+ <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek>
+ </Calendar>
+ </LC_CALENDAR>
+ <LC_CURRENCY ref="en_US"/>
+ <LC_TRANSLITERATION ref="en_US"/>
+ <LC_MISC>
+ <ReservedWords>
+ <trueWord>אמת</trueWord>
+ <falseWord>פֿאַלש</falseWord>
+ <quarter1Word>ערשט יאָרפֿערטל</quarter1Word>
+ <quarter2Word>צװײט יאָרפֿערטל</quarter2Word>
+ <quarter3Word>דריט יאָרפֿערטל</quarter3Word>
+ <quarter4Word>פֿערט יאָרפֿערטל</quarter4Word>
+ <aboveWord>אױבן</aboveWord>
+ <belowWord>אונטן</belowWord>
+ <quarter1Abbreviation>י“פֿ1</quarter1Abbreviation>
+ <quarter2Abbreviation>י“פֿ2</quarter2Abbreviation>
+ <quarter3Abbreviation>י“פֿ3</quarter3Abbreviation>
+ <quarter4Abbreviation>י“פֿ4</quarter4Abbreviation>
+ </ReservedWords>
+ </LC_MISC>
+ <LC_NumberingLevel ref="en_US"/>
+ <LC_OutLineNumberingLevel ref="en_US"/>
+</Locale>
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 34f4f6bbb520..8906a3433bea 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -169,6 +169,7 @@ static const struct {
{ "ast_ES", lcl_DATA_EURO },
{ "ltg_LV", lcl_DATA_EURO },
{ "hsb_DE", lcl_DATA_EURO },
+ { "dsb_DE", lcl_DATA_EURO },
{ "rue_SK", lcl_DATA_EURO },
{ "ja_JP", lcl_DATA_OTHERS },
@@ -251,6 +252,12 @@ static const struct {
{ "om_ET", lcl_DATA_OTHERS },
{ "plt_MG", lcl_DATA_OTHERS },
{ "mai_IN", lcl_DATA_OTHERS },
+ { "yi_US", lcl_DATA_OTHERS },
+ { "haw_US", lcl_DATA_OTHERS },
+ { "lif_NP", lcl_DATA_OTHERS },
+ { "ur_PK", lcl_DATA_OTHERS },
+ { "ht_HT", lcl_DATA_OTHERS },
+ { "jbo", lcl_DATA_OTHERS }
};
static const sal_Unicode under = sal_Unicode('_');
diff --git a/icu/icuversion.mk b/icu/icuversion.mk
index eedf6276e598..a170642b276c 100755
--- a/icu/icuversion.mk
+++ b/icu/icuversion.mk
@@ -25,9 +25,9 @@
#
#*************************************************************************
# major
-ICU_MAJOR=4
+ICU_MAJOR*=4
# minor
-ICU_MINOR=0
+ICU_MINOR*=0
# micro
-ICU_MICRO=1
+ICU_MICRO*=1
diff --git a/instsetoo_native/prj/build.lst b/instsetoo_native/prj/build.lst
index 68edddfe9b28..490d2e4a5c9b 100644
--- a/instsetoo_native/prj/build.lst
+++ b/instsetoo_native/prj/build.lst
@@ -1,4 +1,4 @@
-oon instsetoo_native :: l10n postprocess packimages testautomation ooo_custom_images NULL
+oon instsetoo_native :: L10N:l10n postprocess packimages testautomation ooo_custom_images NULL
oon instsetoo_native usr1 - all oon_mkout NULL
oon instsetoo_native\inc_openoffice\unix nmake - u oon_unix NULL
oon instsetoo_native\inc_openoffice\windows\msi_languages nmake - all oon_msilang NULL
diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index eb036d6864ff..caf297c6c470 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -312,6 +312,7 @@ OpenOffice_SDK
IGNOREDIRECTORYLAYER 1
NOVERSIONINDIRNAME 0
NOSPACEINDIRECTORYNAME 1
+ NOSHORTDIRECTORYNAMES 1
CHANGETARGETDIR 1
DOWNLOADBANNER ooosdkbanner.bmp
DOWNLOADBITMAP ooosdkbitmap.bmp
@@ -364,6 +365,7 @@ OpenOffice_Dev_SDK
IGNOREDIRECTORYLAYER 1
NOVERSIONINDIRNAME 0
NOSPACEINDIRECTORYNAME 1
+ NOSHORTDIRECTORYNAMES 1
CHANGETARGETDIR 1
DOWNLOADBANNER ooosdkbanner.bmp
DOWNLOADBITMAP ooosdkbitmap.bmp
diff --git a/io/source/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx
index 6d0b77484fef..63f688d32dca 100644
--- a/io/source/acceptor/acc_pipe.cxx
+++ b/io/source/acceptor/acc_pipe.cxx
@@ -101,11 +101,17 @@ namespace io_acceptor
{
if( ! m_nStatus )
{
- if( aReadBytes.getLength() != nBytesToRead )
+ if( aReadBytes.getLength() < nBytesToRead )
{
aReadBytes.realloc( nBytesToRead );
}
- return m_pipe.read( aReadBytes.getArray() , aReadBytes.getLength() );
+ sal_Int32 n = m_pipe.read( aReadBytes.getArray(), nBytesToRead );
+ OSL_ASSERT( n >= 0 && n <= aReadBytes.getLength() );
+ if( n < aReadBytes.getLength() )
+ {
+ aReadBytes.realloc( n );
+ }
+ return n;
}
else {
throw IOException();
diff --git a/javainstaller2/prj/build.lst b/javainstaller2/prj/build.lst
index f6a0ef5b6036..28ad41ba6c7b 100755
--- a/javainstaller2/prj/build.lst
+++ b/javainstaller2/prj/build.lst
@@ -1,4 +1,4 @@
-jl2 javainstaller2 : l10n setup_native NULL
+jl2 javainstaller2 : L10N:l10n setup_native NULL
jl2 javainstaller2\src\Localization nmake - u jl2_local NULL
jl2 javainstaller2\src\Properties nmake - u jl2_properties jl2_local.u NULL
jl2 javainstaller2\src\Helpfiles nmake - u jl2_helpfiles jl2_local.u NULL
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
index 267a84d7515f..221870b0b035 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
@@ -155,7 +155,7 @@ public class java_remote_bridge
new Job(obj, java_remote_bridge.this, msg));
}
} catch (Throwable e) {
- dispose(new DisposedException(e.toString()));
+ dispose(e);
}
}
@@ -478,12 +478,12 @@ public class java_remote_bridge
dispose = _life_count <= 0;
}
if (dispose) {
- dispose(new com.sun.star.uno.RuntimeException("end of life"));
+ dispose(new Throwable("end of life"));
}
}
public void dispose() {
- dispose(new com.sun.star.uno.RuntimeException("user dispose"));
+ dispose(new Throwable("user dispose"));
}
private void dispose(Throwable throwable) {
@@ -499,6 +499,8 @@ public class java_remote_bridge
((DisposeListener) i.next()).notifyDispose(this);
}
+ _iProtocol.terminate();
+
try {
_messageDispatcher.terminate();
@@ -602,7 +604,8 @@ public class java_remote_bridge
_iProtocol.writeReply(exception, threadId, result);
} catch (IOException e) {
dispose(e);
- throw new DisposedException("unexpected " + e);
+ throw (DisposedException)
+ (new DisposedException("unexpected " + e).initCause(e));
} catch (RuntimeException e) {
dispose(e);
throw e;
@@ -631,9 +634,9 @@ public class java_remote_bridge
oid, TypeDescription.getTypeDescription(type), operation,
threadId, params);
} catch (IOException e) {
- DisposedException d = new DisposedException(e.toString());
- dispose(d);
- throw d;
+ dispose(e);
+ throw (DisposedException)
+ new DisposedException(e.toString()).initCause(e);
}
if (sync && Thread.currentThread() != _messageDispatcher) {
result = _iThreadPool.enter(handle, threadId);
diff --git a/jurt/com/sun/star/lib/uno/environments/remote/IProtocol.java b/jurt/com/sun/star/lib/uno/environments/remote/IProtocol.java
index 1fae45e9ca23..de581ea86c7b 100644
--- a/jurt/com/sun/star/lib/uno/environments/remote/IProtocol.java
+++ b/jurt/com/sun/star/lib/uno/environments/remote/IProtocol.java
@@ -51,6 +51,8 @@ public interface IProtocol {
*/
void init() throws IOException;
+ void terminate();
+
/**
* Reads a request or reply message.
*
diff --git a/jurt/com/sun/star/lib/uno/environments/remote/IThreadPool.java b/jurt/com/sun/star/lib/uno/environments/remote/IThreadPool.java
index c70ccfa7e934..71961737fd55 100644
--- a/jurt/com/sun/star/lib/uno/environments/remote/IThreadPool.java
+++ b/jurt/com/sun/star/lib/uno/environments/remote/IThreadPool.java
@@ -110,10 +110,10 @@ public interface IThreadPool {
/**
* Disposes this thread pool, thus releasing
- * all threads by throwing the given
- * <code>Throwable</code>.
+ * all threads by throwing a <code>DisposedException</code> with the given
+ * <code>Throwable</code> cause.
* <p>
- * @param throwing the Throwable
+ * @param throwing the cause
*/
public void dispose(Throwable throwable);
diff --git a/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java b/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java
index f7568a30cef7..62e49cc44f16 100644
--- a/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java
+++ b/jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java
@@ -27,6 +27,7 @@
package com.sun.star.lib.uno.environments.remote;
+import com.sun.star.lang.DisposedException;
/**
* The <code>JobQueue</code> implements a queue for jobs.
@@ -200,7 +201,7 @@ public class JobQueue {
* @return a job or null if timed out
* @param waitTime the maximum amount of time to wait for a job
*/
- private Job removeJob(int waitTime) throws Throwable {
+ private Job removeJob(int waitTime) {
if(DEBUG) System.err.println("##### " + getClass().getName() + ".removeJob:" + _head + " " + _threadId);
Job job = null;
@@ -210,7 +211,8 @@ public class JobQueue {
while(_head == null && (waitTime == 0 || !waited)) {
if(_doDispose == _disposeId) {
_doDispose = null;
- throw _throwable;
+ throw (DisposedException)
+ new DisposedException().initCause(_throwable);
}
// notify sync queues
@@ -250,7 +252,8 @@ public class JobQueue {
if(_doDispose == _disposeId) {
_doDispose = null;
- throw _throwable;
+ throw (DisposedException)
+ new DisposedException().initCause(_throwable);
}
try {
diff --git a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
index da54bc7612a1..a158e1138db1 100644
--- a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
+++ b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
@@ -30,6 +30,7 @@ package com.sun.star.lib.uno.protocols.urp;
import com.sun.star.bridge.InvalidProtocolChangeException;
import com.sun.star.bridge.ProtocolProperty;
import com.sun.star.bridge.XProtocolProperties;
+import com.sun.star.lang.DisposedException;
import com.sun.star.lib.uno.environments.remote.IProtocol;
import com.sun.star.lib.uno.environments.remote.Message;
import com.sun.star.lib.uno.environments.remote.ThreadId;
@@ -79,6 +80,15 @@ public final class urp implements IProtocol {
}
}
+ // @see IProtocol#terminate
+ public void terminate() {
+ synchronized (monitor) {
+ state = STATE_TERMINATED;
+ initialized = true;
+ monitor.notifyAll();
+ }
+ }
+
// @see IProtocol#readMessage
public Message readMessage() throws IOException {
for (;;) {
@@ -125,6 +135,9 @@ public final class urp implements IProtocol {
throw new RuntimeException(e.toString());
}
}
+ if (state == STATE_TERMINATED) {
+ throw new DisposedException();
+ }
return writeRequest(false, oid, type, function, tid, arguments);
}
}
@@ -375,7 +388,6 @@ public final class urp implements IProtocol {
if ((header & HEADER_NEWTID) != 0) {
inL1Tid = unmarshal.readThreadId();
}
- //TODO: check HEADER_IGNORECACHE
return readRequest(funId, sync);
}
@@ -684,7 +696,6 @@ public final class urp implements IProtocol {
private static final int HEADER_NEWOID = 0x10;
private static final int HEADER_NEWTID = 0x08;
private static final int HEADER_FUNCTIONID16 = 0x04;
- private static final int HEADER_IGNORECACHE = 0x02;
private static final int HEADER_MOREFLAGS = 0x01;
private static final int HEADER_MUSTREPLY = 0x80;
private static final int HEADER_SYNCHRONOUS = 0x40;
@@ -701,6 +712,7 @@ public final class urp implements IProtocol {
private static final int STATE_REQUESTED = 2;
private static final int STATE_COMMITTED = 3;
private static final int STATE_WAIT = 4;
+ private static final int STATE_TERMINATED = 5;
private static final int MAX_RELEASE_QUEUE_SIZE = 100;
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 323f7fe549b6..e432869d3a7b 100755
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -175,7 +175,7 @@ sub splitfile{
exit( -1 );
}
my $src_root = $ENV{SOURCE_ROOT_DIR};
- my $ooo_src_root = $ENV{SRC_ROOT};
+ my $ooo_src_root = $src_root."/l10n/l10n";
my $so_l10n_path = $src_root."/sun/l10n_so/source";
my $ooo_l10n_path = $ooo_src_root."/l10n/source";
diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py
index b65c262b6020..126b991c377b 100644
--- a/l10ntools/scripts/tool/l10ntool.py
+++ b/l10ntools/scripts/tool/l10ntool.py
@@ -122,6 +122,11 @@ class AbstractL10nTool:
pass
try:
+ os.remove(outputfilename)
+ except:
+ pass
+
+ try:
shutil.copy(inputfilename, outputfilename)
except IOError:
print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'"
diff --git a/neon/neon.patch b/neon/neon.patch
index 51ec3a8d6d0b..473b88695ccc 100644
--- a/neon/neon.patch
+++ b/neon/neon.patch
@@ -1,5 +1,5 @@
---- 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
+--- misc/neon-0.29.5/src/config.h 2011-02-03 10:32:38.000000000 +0100
++++ misc/build/neon-0.29.5/src/config.h 2011-02-03 10:26:19.000000000 +0100
@@ -1 +1,488 @@
-dummy
+
@@ -490,8 +490,8 @@
+#else
+#define HAVE_NTLM 1
+#endif
---- 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
+--- misc/neon-0.29.5/src/makefile.mk 2011-02-03 10:32:38.000000000 +0100
++++ misc/build/neon-0.29.5/src/makefile.mk 2011-02-03 10:26:19.000000000 +0100
@@ -1 +1,102 @@
-dummy
+PRJ=..$/..$/..$/..$/..
@@ -597,7 +597,7 @@
+DEF1NAME=$(SHL1TARGET)
+.INCLUDE : target.mk
--- 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
++++ misc/build/neon-0.29.5/src/ne_auth.c 2011-02-03 10:31:22.000000000 +0100
@@ -367,7 +367,7 @@
static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt,
struct auth_challenge *chall, char *pwbuf)
@@ -607,7 +607,28 @@
chall->handler->attempt++, sess->username, pwbuf) == 0) {
return 0;
} else {
-@@ -610,10 +610,12 @@
+@@ -385,15 +385,19 @@
+ {
+ char *tmp, password[NE_ABUFSIZ];
+
++#if 0 /* Workaround - IIS sends challenge without realm. */
++
+ /* Verify challenge... must have a realm */
+ if (parms->realm == NULL) {
+ challenge_error(errmsg, _("missing realm in Basic challenge"));
+ return -1;
+ }
++#endif
+
+ clean_session(sess);
+
+- sess->realm = ne_strdup(parms->realm);
++ if (parms->realm != NULL)
++ sess->realm = ne_strdup(parms->realm);
+
+ if (get_credentials(sess, errmsg, attempt, parms, password)) {
+ /* Failed to get credentials */
+@@ -610,10 +614,12 @@
return NULL;
}
@@ -621,7 +642,7 @@
NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n");
-@@ -630,8 +632,17 @@
+@@ -630,8 +636,17 @@
return status;
}
}
@@ -641,7 +662,7 @@
if (status) {
return status;
}
-@@ -651,7 +662,7 @@
+@@ -651,7 +666,7 @@
{
int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0;
@@ -650,7 +671,7 @@
}
static int verify_sspi(struct auth_request *req, auth_session *sess,
-@@ -674,7 +685,7 @@
+@@ -674,7 +689,7 @@
return NE_OK;
}
@@ -660,7 +681,7 @@
#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
++++ misc/build/neon-0.29.5/src/ne_auth.h 2011-02-03 10:26:20.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
@@ -673,7 +694,7 @@
/* Set callbacks to provide credentials for server and proxy
* authentication, using the default set of authentication protocols.
--- 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
++++ misc/build/neon-0.29.5/src/ne_defs.h 2011-02-03 10:26:20.000000000 +0100
@@ -41,7 +41,7 @@
#endif
@@ -684,7 +705,7 @@
#endif
--- 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
++++ misc/build/neon-0.29.5/src/ne_locks.c 2011-02-03 10:26:21.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,
@@ -752,7 +773,7 @@
}
}
--- 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
++++ misc/build/neon-0.29.5/src/ne_locks.h 2011-02-03 10:26:21.000000000 +0100
@@ -22,6 +22,10 @@
#ifndef NE_LOCKS_H
#define NE_LOCKS_H
@@ -765,7 +786,7 @@
#include "ne_uri.h" /* for ne_uri */
--- 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
++++ misc/build/neon-0.29.5/src/ne_sspi.c 2011-02-03 10:26:21.000000000 +0100
@@ -206,6 +206,45 @@
}
@@ -852,7 +873,7 @@
securityStatus =
initializeSecurityContext(&sspiContext->credentials, NULL,
--- 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
++++ misc/build/neon-0.29.5/src/ne_sspi.h 2011-02-03 10:26:21.000000000 +0100
@@ -41,7 +41,7 @@
int ne_sspi_clear_context(void *context);
@@ -863,7 +884,7 @@
#endif /* HAVE_SSPI */
--- 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
++++ misc/build/neon-0.29.5/src/ne_uri.c 2011-02-03 10:26:21.000000000 +0100
@@ -42,7 +42,7 @@
#include "ne_alloc.h"
#include "ne_uri.h"
@@ -910,7 +931,7 @@
/* 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.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
++++ misc/build/neon-0.29.5/src/ne_utils.c 2011-02-03 10:26:21.000000000 +0100
@@ -118,6 +118,9 @@
#ifdef HAVE_GNUTLS
", GNU TLS " LIBGNUTLS_VERSION
@@ -941,7 +962,7 @@
#endif /* NE_HAVE_* */
default:
--- 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
++++ misc/build/neon-0.29.5/src/ne_utils.h 2011-02-03 10:26:21.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/odk/util/check.pl b/odk/util/check.pl
index 0ba7f05a6ed2..6bf3fdd62b2f 100644
--- a/odk/util/check.pl
+++ b/odk/util/check.pl
@@ -265,17 +265,17 @@ if (-d "$StartDir") {
"_typelib_InterfaceMethodTypeDescription","store","RegistryKey",
"_typelib_Union_Init","_sal_Sequence","_typelib_Parameter_Init",
"_typelib_TypeDescription","_uno_Environment",
- "_typelib_InterfaceAttributeTypeDescription","uno_Context",
+ "_typelib_InterfaceAttributeTypeDescription",
"_rtl_ModuleCount","_uno_ExtEnvironment",
- "_typelib_IndirectTypeDescription","remote_DisposingListener",
- "remote_Interface","Registry_Api","_oslFileStatus",
+ "_typelib_IndirectTypeDescription",
+ "Registry_Api","_oslFileStatus",
"_typelib_InterfaceMemberTypeDescription","RegistryValueList",
"RegistryTypeWriter_Api","_rtl_TextEncodingInfo",
- "namespace_anonymous_1","remote_Connection",
+ "namespace_anonymous_1",
"_oslVolumeInfo","_uno_Interface",
"_typelib_InterfaceTypeDescription","_uno_Mapping","Registry",
- "RegistryTypeReader_Api","remote_Context","_typelib_Uik",
- "remote_InstanceProvider","_typelib_ArrayTypeDescription",
+ "RegistryTypeReader_Api","_typelib_Uik",
+ "_typelib_ArrayTypeDescription",
"RegistryKeyArray","RegistryTypeReader","RegistryKeyNames",
"RTConstValueUnion","_typelib_UnionTypeDescription","_uno_Any",
"RegistryTypeWriter","_rtl_Locale","_typelib_CompoundMember_Init",
diff --git a/odk/util/makefile.pmk b/odk/util/makefile.pmk
index aa0f10ed035e..deb4e6d62c5e 100644
--- a/odk/util/makefile.pmk
+++ b/odk/util/makefile.pmk
@@ -188,7 +188,6 @@ INCLUDETOPDIRLIST= \
$(INCOUT)/uno \
$(INCOUT)/cppu \
$(INCOUT)/cppuhelper \
- $(INCOUT)/bridges \
$(INCOUT)/registry \
$(INCOUT)/stl
diff --git a/offapi/com/sun/star/awt/UnoControlDialog.idl b/offapi/com/sun/star/awt/UnoControlDialog.idl
index 443b0da18563..f2f1be2dc49c 100644
--- a/offapi/com/sun/star/awt/UnoControlDialog.idl
+++ b/offapi/com/sun/star/awt/UnoControlDialog.idl
@@ -35,8 +35,8 @@
#include <com/sun/star/awt/XTopWindow.idl>
#endif
-#ifndef __com_sun_star_awt_XDialog_idl__
-#include <com/sun/star/awt/XDialog.idl>
+#ifndef __com_sun_star_awt_XDialog2_idl__
+#include <com/sun/star/awt/XDialog2.idl>
#endif
@@ -54,7 +54,7 @@ published service UnoControlDialog
interface com::sun::star::awt::XTopWindow;
- interface com::sun::star::awt::XDialog;
+ interface com::sun::star::awt::XDialog2;
};
diff --git a/offapi/com/sun/star/awt/XDialog2.idl b/offapi/com/sun/star/awt/XDialog2.idl
index fbc5313aeb47..e937dea9bb24 100644
--- a/offapi/com/sun/star/awt/XDialog2.idl
+++ b/offapi/com/sun/star/awt/XDialog2.idl
@@ -16,7 +16,7 @@ module com { module sun { module star { module awt {
@since OOo 3.0
*/
-interface XDialog2: com::sun::star::awt::XDialog
+published interface XDialog2: com::sun::star::awt::XDialog
{
/** hides the dialog and then causes <member>XDialog::execute</member>
to return with the given result value.
diff --git a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
index c487afc79b49..8c2726f42851 100644
--- a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
+++ b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
@@ -27,9 +27,7 @@
#ifndef __com_sun_star_awt_DefaultGridDataModel_idl__
#define __com_sun_star_awt_DefaultGridDataModel_idl__
-#ifndef __com_sun_star_awt_grid_XGridDataModel_idl__
-#include <com/sun/star/awt/grid/XGridDataModel.idl>
-#endif
+#include <com/sun/star/awt/grid/XMutableGridDataModel.idl>
//=============================================================================
@@ -39,12 +37,15 @@
/** If you do not want to implement the <type>XGridDataModel</type> yourself, use this service.
+ <p>The <code>DefaultGridDataModel</code> implementation is a dumb container of tabular data. You can add
+ and remove rows, modify cell values, and the like.</p>
+
+ <p>The implementation will implicitly increase its column count if you add a row which has more values than
+ the current column count.</p>
+
@since OOo 3.3.0
*/
-service DefaultGridDataModel
-{
- interface com::sun::star::awt::grid::XGridDataModel;
-};
+service DefaultGridDataModel : ::com::sun::star::awt::grid::XMutableGridDataModel;
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
index caab721185a5..4ab6e71caf51 100644
--- a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
@@ -42,17 +42,17 @@ module com { module sun { module star { module awt { module grid {
*/
struct GridColumnEvent: com::sun::star::lang::EventObject
{
- /** Contains the property name of the changed value **/
- string valueName;
+ /** Contains the name of the attributes whose value changed. **/
+ string AttributeName;
/** Contains the old value **/
- any oldValue;
+ any OldValue;
/** Contains the new value **/
- any newValue;
+ any NewValue;
/** Contains the index of the changed column**/
- long index;
+ long ColumnIndex;
//-------------------------------------------------------------------------
};
diff --git a/offapi/com/sun/star/awt/grid/GridControlEvent.idl b/offapi/com/sun/star/awt/grid/GridControlEvent.idl
deleted file mode 100644
index ce8736fb1b93..000000000000
--- a/offapi/com/sun/star/awt/grid/GridControlEvent.idl
+++ /dev/null
@@ -1,54 +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_awt_GridControlEvent_idl__
-#define __com_sun_star_awt_GridControlEvent_idl__
-
-#ifndef __com_sun_star_lang_EventObject_idl__
-#include <com/sun/star/lang/EventObject.idl>
-#endif
-
-
-//=============================================================================
-
-module com { module sun { module star { module awt { module grid {
-
-//=============================================================================
-
-
-struct GridControlEvent: com::sun::star::lang::EventObject
-{
- //-------------------------------------------------------------------------
-
- string ActionCommand;
-
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl
index 1e0afb610f16..3ac05f0ec1ae 100644
--- a/offapi/com/sun/star/awt/grid/GridDataEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl
@@ -35,40 +35,39 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
-/** An event used by a <type>XGridDataModel</type> to notify changes in the data
- model to the <type>XGridControl</type>.
- You usually need to fill this event only if you implement the <type>XGridDataModel</type>
- yourself.
+/** used to notify changes in the data represented by an <type>XMutableGridDataModel</type>.
- @see XGridDataModel
- @see XGridControl
+ <p>Effectively, a <code>GridDataEvent</code> denotes a continuous two-dimensional cell range
+ within a grid's data model, which is affected by a certain change.</p>
+
+ @see XMutableGridDataModel
@see XGridDataListener
- @sonce OOo 3.3.0
+ @since OOo 3.3.0
*/
struct GridDataEvent: com::sun::star::lang::EventObject
{
- //-------------------------------------------------------------------------
-
- /** Contains the property name of the changed value **/
- string valueName;
-
- /** Contains the old value **/
- any oldValue;
-
- /** Contains the new value **/
- any newValue;
+ /** denotes the first column affected by a change.
- /** Contains the index of the changed row**/
- long index;
+ <p>If <code>FirstColumn</code> is -1, the listener should assume that all rows of a grid's data model
+ are affected.</p>
+ */
+ long FirstColumn;
- /** Contains the header name of the changed row**/
- string headerName;
+ /** denotes the last column affected by a change
+ */
+ long LastColumn;
- /** Contains the changed row**/
- sequence<any> rowData;
+ /** denotes the first row affected by a change.
+ <p>If <code>FirstRow</code> is -1, the listener should assume that all rows of a grid's data model
+ are affected.</p>
+ */
+ long FirstRow;
+ /** denotes the last row affected by a change
+ */
+ long LastRow;
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/SortableGridDataModel.idl b/offapi/com/sun/star/awt/grid/SortableGridDataModel.idl
new file mode 100755
index 000000000000..2b7aca1ca9f9
--- /dev/null
+++ b/offapi/com/sun/star/awt/grid/SortableGridDataModel.idl
@@ -0,0 +1,102 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_awt_grid_SortableGridDataModel_idl__
+#define __com_sun_star_awt_grid_SortableGridDataModel_idl__
+
+#include <com/sun/star/i18n/XCollator.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module awt { module grid {
+
+interface XSortableMutableGridDataModel;
+interface XMutableGridDataModel;
+
+//==================================================================================================================
+
+/** provides a default implementation of a <type>XSortableGridData</type>.
+
+ <p>This service must be created with a secondary grid data model, which all actual data requests are delegated to.
+ But before providing this data to the service's own clients, it is sorted, according to the sort order defined
+ via the <code>XSortableGridData</code> interface.</p>
+
+ <p>The service implementation is able to compare the default scalar types, plus strings.</p>
+
+ <p>For determining the data type of a column which the data should be sorted by, the first non-<VOID/> data encountered
+ in this column is taken into account. Further read requests to this column will assume that all non-<VOID/> data is of
+ the same type.</p>
+
+ <p>Consequently, you cannot use this service with data sets containing heterogenous data in a given column.</p>
+
+ <p>All requests made via the <type>XMutableGridDataModel</type> are delegated to the <code>XMutableGridDataModel</code>
+ instance passed in the service constructor.</p>
+
+ <p>Note that changing the data might result in the sort order being destroyed. If you want to ensure
+ that the data represented by the model is still sorted after your modifications, you should call
+ <member>XSortableGridData::sortByColumn</member>, again.</p>
+ */
+service SortableGridDataModel : XSortableMutableGridDataModel
+{
+ /** creates a new instance of the <code>SortableGridDataModel</code>
+
+ <p>For string comparison, a default <type scope="::com::sun::star::i18n">Collator</type>, based on the system's
+ locale, will be used.</p>
+
+ @param DelegatorModel
+ the data model to which read requests are delegated.
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given <code>DelegatorModel</code> is <NULL/>
+ */
+ create(
+ [in] XMutableGridDataModel DelegatorModel
+ )
+ raises ( ::com::sun::star::lang::IllegalArgumentException );
+
+ /** creates a new instance of the ScortableDefaultGridDataModel, passing a collator to be used for string comparison.
+
+ @param DelegatorModel
+ is the data model to which read requests are delegated
+ @param Collator
+ is the collator to be used for string comparison
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given <code>DelegatorModel</code> is <NULL/>
+ */
+ createWithCollator(
+ [in] XMutableGridDataModel DelegatorModel,
+ [in] ::com::sun::star::i18n::XCollator Collator
+ )
+ raises ( ::com::sun::star::lang::IllegalArgumentException );
+};
+
+//==================================================================================================================
+
+}; }; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
index b9cf8745d96e..a348d4b3e23c 100644
--- a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
+++ b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
@@ -28,19 +28,11 @@
#define __com_sun_star_awt_grid_UnoControlGridModel_idl__
#include <com/sun/star/awt/grid/XGridColumnModel.idl>
-
#include <com/sun/star/awt/grid/XGridDataModel.idl>
-
-#include <com/sun/star/awt/grid/ScrollBarMode.idl>
-
#include <com/sun/star/awt/UnoControlModel.idl>
-
#include <com/sun/star/view/SelectionType.idl>
-
#include <com/sun/star/awt/FontDescriptor.idl>
-
#include <com/sun/star/style/VerticalAlignment.idl>
-
#include <com/sun/star/util/Color.idl>
//=============================================================================
@@ -49,7 +41,7 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
-/** specifies the standard model of a <type>UnoControlGridModel</type>.
+/** specifies the standard model of a <type>UnoControlGrid</type> control.
@since OOo 3.3.0
*/
@@ -59,19 +51,51 @@ service UnoControlGridModel
service com::sun::star::awt::UnoControlModel;
/** Specifies whether the grid control should display a special header column.
- <p>The default value is <FALSE/></p>
+
+ <p>The default value is <FALSE/></p>
*/
[property] boolean ShowRowHeader;
+ /** specifies the width of the row header column, if applicable.
+
+ <p>The width is specified in application font units - see <type scope="com::sun::star::util">MeasureUnit</type>.</p>
+
+ <p>The value given here is ignored if <member>ShowRowHeader</member> is <FALSE/>.</p>
+ */
+ [property] long RowHeaderWidth;
+
/** Specifies whether the grid control should display a title row.
- <p>The default value is <TRUE/></p>
+
+ <p>The default value is <TRUE/></p>
*/
[property] boolean ShowColumnHeader;
+ /** specifies the height of the column header row, if applicable.
+
+ <p>The height is specified in application font units - see <type scope="com::sun::star::util">MeasureUnit</type>.</p>
+
+ <p>The value given here is ignored if <member>ShowColumnHeader</member> is <FALSE/>.</p>
+
+ <p>If the property is <void/>, the grid control shall automatically determine a height which conveniently allows,
+ according to the used font, to display one line of text.</p>
+ */
+ [property, maybevoid] long ColumnHeaderHeight;
+
+ /** Specifies the height of rows in the grid control.
+
+ <p>The height is specified in application font units - see <type scope="com::sun::star::util">MeasureUnit</type>.</p>
+ */
+ [property, maybevoid] long RowHeight;
+
/** Specifies the <type>XGridColumnModel</type> that is providing the column structure.
<p>You can implement your own instance of <type>XGridColumnModel</type> or use
the <type>DefaultGridColumnModel</type>.
+
+ <p>The column model is in the ownership of the grid model: When you set a new column model, or dispose
+ the grid model, then the (old) column model is disposed, too.</p>
+
+ <p>The default for this property is an empty instance of the <type>DefaultGridColumnModel</type>.</p>
*/
[property] XGridColumnModel ColumnModel;
@@ -79,6 +103,11 @@ service UnoControlGridModel
<p>You can implement your own instance of <type>XGridDataModel</type> or use
the <type>DefaultGridDataModel</type>.
+
+ <p>The data model is in the ownership of the grid model: When you set a new data model, or dispose
+ the grid model, then the (old) data model is disposed, too.</p>
+
+ <p>The default for this property is an empty instance of the <type>DefaultGridDataModel</type>.</p>
*/
[property] XGridDataModel GridDataModel;
@@ -101,26 +130,48 @@ service UnoControlGridModel
*/
[property] ::com::sun::star::view::SelectionType SelectionModel;
- /** Specifies the background color of rows. If color for even rows is set, then specifies
- the color of odd rows. Default value is white.
+ /** controls whether or not to paint horizontal and vertical lines between the grid cells.
+
+ @see LineColor
*/
- [property] ::com::sun::star::util::Color RowBackgroundColor;
+ [property] boolean UseGridLines;
+
+ /** specifies the color to be used when drawing lines between cells
- /** Specifies the background color of even rows. Default value is white.
+ <p>If this property has a value of <VOID/>, the grid control renderer will use some default color,
+ depending on the system's style settings.</p>
+
+ @see UseGridLines
*/
- [property] ::com::sun::star::util::Color EvenRowBackgroundColor;
+ [property, maybevoid] ::com::sun::star::util::Color GridLineColor;
+
+ /** specifies the color to be used when drawing the background of row or column headers
- /** Specifies the background color of header. Default value is white.
+ <p>If this property has a value of <VOID/>, the grid control renderer will use some default color,
+ depending on the system's style settings.</p>
*/
- [property] ::com::sun::star::util::Color HeaderBackgroundColor;
+ [property, maybevoid] ::com::sun::star::util::Color HeaderBackgroundColor;
- /** Specifies the text color. Default value is black.
+ /** specifies the color to be used when drawing the text within row or column headers
+
+ <p>If this property has a value of <VOID/>, the grid control renderer will use some default color,
+ depending on the system's style settings.</p>
*/
- [property] ::com::sun::star::util::Color TextColor;
+ [property, maybevoid] ::com::sun::star::util::Color HeaderTextColor;
+
+ /** specifies the colors to be used as background for data rows.
+
+ <p>If this sequence is non-empty, the data rows will be rendered with alternating background colors: Assuming
+ the sequence has <code>n</code> elements, each row will use the background color as specified by its number's
+ remainder modulo <code>n</code>.</p>
- /** Specifies the line color. Default value is white.
+ <p>If this sequence is empty, all rows will use the same background color as the control as whole.</p>
+
+ <p>If this property does not exist at a particular implementation, or is <VOID/>, rows will be painted
+ in alternating background colors, every second row having a background color derived from the control's
+ selection color.</p>
*/
- [property] ::com::sun::star::util::Color LineColor;
+ [property, maybevoid] sequence< ::com::sun::star::util::Color > RowBackgroundColors;
/** specifies the vertical alignment of the content in the control.
@@ -136,6 +187,20 @@ service UnoControlGridModel
*/
[property] com::sun::star::awt::FontDescriptor FontDescriptor;
+ /** specifies the color to be used when drawing cell texts
+
+ <p>If this property has a value of <VOID/>, the grid control renderer will use some default color,
+ depending on the system's style settings.</p>
+ */
+ [property, maybevoid] ::com::sun::star::util::Color TextColor;
+
+ /** specifies the color to be used when drawing text lines (underlining and strikethrough)
+
+ <p>If this property has a value of <VOID/>, the grid control renderer will use some default color,
+ depending on the system's style settings.</p>
+ */
+ [property, maybevoid] com::sun::star::util::Color TextLineColor;
+
/** specifies the <type scope="com::sun::star::text">FontEmphasis</type>
value of the text in the control.
*/
diff --git a/offapi/com/sun/star/awt/grid/XGridCell.idl b/offapi/com/sun/star/awt/grid/XGridCell.idl
deleted file mode 100644
index 08f3cfd1b2d5..000000000000
--- a/offapi/com/sun/star/awt/grid/XGridCell.idl
+++ /dev/null
@@ -1,56 +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_awt_grid_XGridCell_idl__
-#define __com_sun_star_awt_grid_XGridCell_idl__
-
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-
-
-//=============================================================================
-
-module com { module sun { module star { module awt { module grid {
-
-//=============================================================================
-
-interface XGridCell
-{
-
- [attribute] string Value;
-
- [attribute] boolean Editable;
-
- [attribute] any Data;
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl b/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl
deleted file mode 100644
index 7f9fa28c3307..000000000000
--- a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl
+++ /dev/null
@@ -1,52 +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_awt_grid_XGridCellRenderer_idl__
-#define __com_sun_star_awt_grid_XGridCellRenderer_idl__
-
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-//=============================================================================
-
-module com { module sun { module star { module awt { module grid {
-
-//=============================================================================
-
-/** renderer for cells
- */
-interface XGridCellRenderer
-{
- //-------------------------------------------------------------------------
-
-};
-
-//=============================================================================
-
-}; }; }; }; };
-
-#endif
diff --git a/offapi/com/sun/star/awt/grid/XGridColumn.idl b/offapi/com/sun/star/awt/grid/XGridColumn.idl
index d217ff5d4ac6..a73025d7715a 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumn.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumn.idl
@@ -27,12 +27,11 @@
#ifndef __com_sun_star_awt_grid_XGridColumn_idl__
#define __com_sun_star_awt_grid_XGridColumn_idl__
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
+#include <com/sun/star/lang/XComponent.idl>
#include <com/sun/star/style/HorizontalAlignment.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
#include <com/sun/star/awt/grid/XGridColumnListener.idl>
-
+#include <com/sun/star/util/XCloneable.idl>
//=============================================================================
@@ -45,42 +44,96 @@ module com { module sun { module star { module awt { module grid {
*/
interface XGridColumn
{
- /** Specifies the an idendifier of the colomn.**/
+ /** implements life time control for the component
+ */
+ interface ::com::sun::star::lang::XComponent;
+
+ /** allows cloning the complete grid column
+ */
+ interface ::com::sun::star::util::XCloneable;
+
+ /** specifies an identifier of the column
+
+ <p>This identifier will not be evaluated by the grid control, or its model. It is merely for clients
+ to identify particular columns.</p>
+ */
[attribute] any Identifier;
- /** Specifies the default column witdth. **/
+ /** specifies the current width of the column.
+ */
[attribute] long ColumnWidth;
- /** Specifies the preferred column witdth. **/
- [attribute] long PreferredWidth;
-
- /** Specifies the min column witdth. **/
+ /** specifies the minimal width the column can have.
+ */
[attribute] long MinWidth;
- /** Specifies the max column witdth. **/
+ /** specifies the maximal width the column can have.
+ */
[attribute] long MaxWidth;
- /** Specifies whether column has fixed size or not. **/
+ /** controls whether or not the column's width is fixed or not.
+
+ <p>If this is <TRUE/>, the user can interactively change the column's width. Also, the column is subject to
+ auto-resizing, if its <member>Flexibility</member> attribute is greater <code>0</code>.</p>
+ */
[attribute] boolean Resizeable;
- /** Specifies the horizontal alignment of the content in the control.
+ /** specifies the flexibility of the column when it is automatically resized due to the grid control as a whole
+ being resized.
+
+ <p>Specify <code>0</code> here if you do not want the column to be resized automatically.</p>
+
+ <p>If a column has a flexibility greater than 0, it is set in relationship to the flexibility of all
+ other such columns, and the respective widths of the columns are changed in the same relationship.</p>
+
+ <p>Note that a column's flexibility is ignored if its <member>Resizeable</member> attribute is
+ <FALSE/>.</p>
- <pre>
- LEFT
- CENTER
- RIGHT
- </pre>
+ <p>A column's flexibility cannot be negative, attempts to set a negative value will raise an exception.</p>
+ */
+ [attribute] long Flexibility
+ {
+ set raises ( ::com::sun::star::lang::IllegalArgumentException );
+ };
+
+ /** Specifies the horizontal alignment of the content in the control.
*/
[attribute] ::com::sun::star::style::HorizontalAlignment HorizontalAlign;
/** A title is displayed in the colum header row if <method>UnoControlGridModel::ShowRowHeader</method> is set to <true/>**/
[attribute] string Title;
+ /** is the help text associated with the column.
+
+ <p>A grid control will usually display a column's help text as tooltip.</p>
+ */
+ [attribute] string HelpText;
+
+ /** denotes the index of the column within the grid column model it belongs to
+
+ <p>If the column is not yet part of a column model, <code>Index</code> is -1.</p>
+ */
+ [attribute, readonly] long Index;
+
+ /** denotes the index of the data column which should be used to fetch this grid column's data
+
+ <p>A grid control has a column model and a data model, both containing a possibly different number of columns.
+ The <code>DataColumnIndex</code> attribute defines the index of the column within the data model, which should
+ be used to retrieve actual data.</p>
+
+ <p>Using this, you can do runtime changes to the column model, i.e. insertion and removal of columns, without
+ necessarily needing to adjust the data model, too.</p>
+
+ <p>If <code>DataColumnIndex</code> is negative, the it will be ignored, then the column's index within its
+ column model, as determined by the <member>Index</member> attribute, will be used.</p>
+ */
+ [attribute] long DataColumnIndex;
+
/** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes.
@param Listener
the listener to add.
*/
- [oneway] void addColumnListener( [in] XGridColumnListener listener);
+ void addGridColumnListener( [in] XGridColumnListener listener);
//-------------------------------------------------------------------------
@@ -88,20 +141,7 @@ interface XGridColumn
@param Listener
the listener to remove.
*/
- [oneway] void removeColumnListener( [in] XGridColumnListener listener);
-
- /**Updates changed column widths, when column widths are being resized.
- @param name
- can be PrefWidth or ColWidth, depending on which was changed
- @param width
- the new column width
- */
- void updateColumn( [in] string name, [in] long width);
- /**Sets column index
- @param index
- index, which is the index of the column in the column array of the column model
- */
- void setIndex( [in] long index );
+ void removeGridColumnListener( [in] XGridColumnListener listener);
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
index 8a2d044f33d5..9a8a02eca8f2 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
@@ -27,13 +27,8 @@
#ifndef __com_sun_star_awt_grid_XGridColumnListener_idl__
#define __com_sun_star_awt_grid_XGridColumnListener_idl__
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
-
-#ifndef __com_sun_star_awt_grid_GridColumnEvent_idl__
#include <com/sun/star/awt/grid/GridColumnEvent.idl>
-#endif
+#include <com/sun/star/lang/XEventListener.idl>
//=============================================================================
@@ -44,25 +39,11 @@ module com { module sun { module star { module awt { module grid {
/** An instance of this interface is used by the <type>XGridColumnModel</type> to
get notifications about column model changes.
- <p>Usually you must not implement this interface yourself, but you must notify it correctly if
- you implement the <type>XGridColumnModel</type> yourself</p>.
-
@since OOo 3.3.0
*/
-interface XGridColumnListener
+interface XGridColumnListener : ::com::sun::star::lang::XEventListener
{
- // /**
- // Invoked after a column was added to the column model.
- //*/
- //void columnAdded( [in] GridColumnEvent event );
- //
- // /**
- // Invoked after a column was removed from the column model.
- //*/
- //void columnRemoved( [in] GridColumnEvent event );
-
- /**
- Invoked after a column was modified.
+ /** Invoked after a column was modified.
*/
void columnChanged( [in] GridColumnEvent event );
};
diff --git a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
index 86e77680cd95..257f597fc7d2 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
@@ -28,10 +28,13 @@
#define __com_sun_star_awt_grid_XGridColumnModel_idl__
#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/lang/XComponent.idl>
+#include <com/sun/star/util/XCloneable.idl>
#include <com/sun/star/awt/grid/XGridColumn.idl>
-
-#include <com/sun/star/awt/grid/XGridColumnListener.idl>
+#include <com/sun/star/container/XContainer.idl>
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
//=============================================================================
@@ -48,37 +51,64 @@ module com { module sun { module star { module awt { module grid {
*/
interface XGridColumnModel
{
- ///** Specifies whether column selection is allowed
- //*/
- //[attribute] boolean ColumnSelectionAllowed;
+ /** implements life time control for the component
+ */
+ interface ::com::sun::star::lang::XComponent;
+
+ /** allows to register listeners to be notified when columns are inserted or removed
+ */
+ interface ::com::sun::star::container::XContainer;
- /**Specifies the height of column header.
+ /** allows cloning the complete column model
*/
- [attribute] long ColumnHeaderHeight;
+ interface ::com::sun::star::util::XCloneable;
/** Returns the number of columns.
+
@returns
the number of columns.
*/
long getColumnCount();
+ /** creates a new column for use with the column model.
+
+ <p>The newly created column is not yet inserted into the column container, you need to call <member>addColumn</member>
+ after you initialized the column object.</p>
+ */
+ XGridColumn
+ createColumn();
+
/** Adds a column to the model.
+
+ <p>You should use the <member>createColumn</member> member to create a new column. This gives
+ implementations of the <code>XGridColumnModel</code> interface the possibility to provide own column
+ implementations which extend the basic <type>GridColumn</type> type.</p>
+
+ <p>As soon as the column has been inserted into the model, the model takes ownership of it. This means when the
+ column is removed, or when the column model is disposed, the grid column is disposed as well.</p>
+
@param column
the column to add to the model.
-
@returns
- the index of new created column.
- */
- long addColumn( [in] XGridColumn column );
+ the index of new created column.
- /*
- long getSelectedCount();
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if the given column is not a valid element for the column container, or if it is <NULL/>.
+ */
+ long addColumn( [in] XGridColumn column )
+ raises ( ::com::sun::star::lang::IllegalArgumentException );
- sequence<XGridColumn> getSelectedColumns();
+ /** removes a column from the model
- sequence<long> getSelectedIndex();
+ <p>The column object will be disposed upon removal.</p>
+ @param ColumnIndex
+ denotes the index of the column to remove
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if <code>ColumnIndex</code> does not denote a valid column index.
*/
+ void removeColumn( [in] long ColumnIndex )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
/** Returns all columns of the model.
@returns
@@ -92,24 +122,20 @@ interface XGridColumnModel
@returns
the requested column.
*/
- XGridColumn getColumn( [in] long index);
+ XGridColumn getColumn( [in] long index)
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
+
+ /** Fills the model with the given number of default columns
+
+ <p>Existing columns will be removed before adding new columns. Listeners at the column model will
+ be notified one <member scope="com::sun::star::container">XContainerListener::elementRemoved</member> event
+ for each removed column, and one <member scope="com::sun::star::container">XContainerListener::elementInserted</member>
+ event for each insertion.</p>
- /** Sets default columns to the column model.
@param elements
the number of default columns that should be set.
*/
void setDefaultColumns([in] long elements);
-
- /**Creates new XGridColumn with the settings of other column. To be used if the columns which are added to
- the column model have the same settings.
- @param column
- the column, which is already created
- */
- XGridColumn copyColumn( [in] XGridColumn column );
-
- /*
- long getTotalColumnWidth();
- */
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl
index 5019a571663b..3c2c3d241528 100644
--- a/offapi/com/sun/star/awt/grid/XGridControl.idl
+++ b/offapi/com/sun/star/awt/grid/XGridControl.idl
@@ -28,9 +28,6 @@
#define __com_sun_star_awt_grid_XGridControl_idl__
#include <com/sun/star/awt/grid/XGridSelection.idl>
-#include <com/sun/star/awt/grid/XGridColumnModel.idl>
-#include <com/sun/star/awt/grid/XGridDataModel.idl>
-#include <com/sun/star/awt/XMouseListener.idl>
//=============================================================================
@@ -44,23 +41,43 @@ module com { module sun { module star { module awt { module grid {
@since OOo 3.3.0
*/
-interface XGridControl: XGridSelection
+interface XGridControl : XGridSelection
{
- /** Converting
+ /** retrieves the column which a given point belongs to
+
+ @param X
+ the ordinate of the point, in pixel coordinates.
+ @param Y
+ the abscissa of the point, in pixel coordinates.
+ @return
+ the index of the column which the point lies in, or -1 if no column is under the given point.
+ */
+ long getColumnAtPoint( [in] long X, [in] long Y );
+
+ /** retrieves the row which a given point belongs to
+
+ @param X
+ the ordinate of the point, in pixel coordinates.
+ @param Y
+ the abscissa of the point, in pixel coordinates.
+ @return
+ the index of the row which the point lies in, or -1 if no row is under the given point.
*/
+ long getRowAtPoint( [in] long X, [in] long Y );
- long getItemIndexAtPoint( [in] long x, [in] long y);
+ /** returns the column index of the currently active cell
- /** Sets tooltip for row
- @param textForTooltip
- text, which will be shown as tooltip.
- If only cell content should be displayed, leave sequence empty.
- @param columnsForTooltip
- column numbers, which define the cell content that should be shown in the tooltip.
- If only text should be shown, leave this sequence empty.
+ <p>If the grid control's does not contain any cells (which happens if the grid column model does not contain any
+ columns, or if grid data model does not contain any rows), then <code>-1</code> is returned.</p>
*/
- void setToolTip( [in] sequence< string > textForTooltip, [in] sequence< long > columnsForTooltip);
+ long getCurrentColumn();
+
+ /** returns the row index of the currently active cell
+ <p>If the grid control's does not contain any cells (which happens if the grid column model does not contain any
+ columns, or if grid data model does not contain any rows), then <code>-1</code> is returned.</p>
+ */
+ long getCurrentRow();
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl
index d6d0d930b331..709f048c08ce 100644
--- a/offapi/com/sun/star/awt/grid/XGridDataListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl
@@ -52,20 +52,21 @@ module com { module sun { module star { module awt { module grid {
interface XGridDataListener: com::sun::star::lang::XEventListener
{
- /**
- Invoked after a row was added to the data model.
+ /** is called when one or more rows of data have been inserted into a grid control's data model.
*/
- void rowAdded( [in] GridDataEvent Event );
+ void rowsInserted( [in] GridDataEvent Event );
- /**
- Invoked after a row was added to the data model.
+ /** is called when one or more rows of data have been removed from a grid control's data model.
*/
- void rowRemoved( [in] GridDataEvent Event );
+ void rowsRemoved( [in] GridDataEvent Event );
- /**
- Invoked after a row was added to the data model.
+ /** is called when existing data in a grid control's data model has been modified.
*/
void dataChanged( [in] GridDataEvent Event );
+
+ /** is called when the title of one or more rows changed.
+ */
+ void rowHeadingChanged( [in] GridDataEvent Event );
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridDataModel.idl b/offapi/com/sun/star/awt/grid/XGridDataModel.idl
index 5cc4085807e1..1ff15e1310e0 100644
--- a/offapi/com/sun/star/awt/grid/XGridDataModel.idl
+++ b/offapi/com/sun/star/awt/grid/XGridDataModel.idl
@@ -30,8 +30,9 @@
#include <com/sun/star/lang/XComponent.idl>
+#include <com/sun/star/util/XCloneable.idl>
#include <com/sun/star/awt/grid/XGridDataListener.idl>
-
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
//=============================================================================
@@ -45,86 +46,57 @@ module com { module sun { module star { module awt { module grid {
@since OOo 3.3.0
*/
-interface XGridDataModel: ::com::sun::star::lang::XComponent
+interface XGridDataModel
{
- /** Specifies the height of each row.
- */
- [attribute] long RowHeight;
-
- /** Contains the row header.
+ /** implements life time control for the component
*/
- [attribute] sequence< string > RowHeaders;
+ interface ::com::sun::star::lang::XComponent;
- /** Returns the content of each row.
+ /** allows cloning the complete column model
*/
- [attribute,readonly] sequence< sequence< any > > Data;
+ interface ::com::sun::star::util::XCloneable;
- /**Specifies the width of row header.
+ /** denotes the number of rows for which the model can provide data
*/
- [attribute] long RowHeaderWidth;
+ [attribute, readonly] long RowCount;
- /** Returns the number of rows in in the model.
- @returns
- the number of rows.
+ /** denotes the number of columns for which the model can provide data
*/
- long getRowCount();
+ [attribute, readonly] long ColumnCount;
- /** Adds a row to the model.
+ /** retrieves the data for a given cell
- @param headername
- specifies the name of the row.
- @param data
- the content of the row.
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the column or row index do not denote a valid cell position.
*/
- void addRow( [in] string headername, [in] sequence< any > data );
+ any getCellData( [in] long Column, [in] long Row )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
- /** Removes a row from the model.
+ /** retrieves the tool tip to be displayed when the mouse hovers over a given cell
- @param index
- the index of the row that should be removed.
- */
- void removeRow( [in] long index);
+ <p>At the moment, only string tool tips are supported.</p>
- /** Removes all rows from the model.
- */
- void removeAll();
-
- /**Updates the content of a given cell.
- @param row
- the row index
- @param column
- the column index
- @param value
- the new value of the cell.
- */
- void updateCell([in] long row, [in] long column, [in] any value );
-
- /**Updates the content of a given row.
- @param row
- the row index
- @param columns
- column indexes of the cells, which should be updated
- @param value
- the new values of the cells.
+ <p>If <VOID/> is returned here, the cell's content will be displayed as tip, but only if it does
+ not fit into the cell.</p>
+
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the column or row index do not denote a valid cell position.
*/
- void updateRow([in] long row, [in] sequence< long > columns, [in] sequence< any > values);
+ any getCellToolTip( [in] long Column, [in] long Row )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
- //-------------------------------------------------------------------------
+ /** retrieves the heading of a given row
- /** Adds a listener for the <type>GridDataEvent</type> posted after the grid changes.
- @param Listener
- the listener to add.
- */
- [oneway] void addDataListener( [in] XGridDataListener listener);
+ <p>A grid control will usually paint a row's title in the header column of the respective row.</p>
- //-------------------------------------------------------------------------
+ <p>At the moment, only strings are supported as row headings.</p>
- /** Removes a listener previously added with <method>addDataListener()</method>.
- @param Listener
- the listener to remove.
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the given index does not denote a valid row.
*/
- [oneway] void removeDataListener( [in] XGridDataListener listener);
-
+ any
+ getRowHeading( [in] long RowIndex )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridSelection.idl b/offapi/com/sun/star/awt/grid/XGridSelection.idl
index 5049426018b0..aa7fd5e42b4b 100644
--- a/offapi/com/sun/star/awt/grid/XGridSelection.idl
+++ b/offapi/com/sun/star/awt/grid/XGridSelection.idl
@@ -41,37 +41,27 @@ module com { module sun { module star { module awt { module grid {
*/
interface XGridSelection
{
- /** Returns the lowest index of the selection.
- @returns
- the lowest index.
- */
- long getMinSelectionIndex();
-
- /** Returns the highest index of the selection.
- @returns
- the highest index.
- */
- long getMaxSelectionIndex();
-
/** Selects all rows.
*/
- [oneway] void selectAllRows();
+ void selectAllRows();
+
+ /** selects a given row
- /** Selects multiple rows. Previous selections will be removed.
- @param rangeOfRows
- array of rows indexes, which will be selected.
+ @param RowIndex
+ denotes the index of the row to select
*/
- [oneway] void selectRows( [in] sequence< long > rangeOfRows);
+ void selectRow( [in] long RowIndex );
/** Deselects all selected rows.
*/
- [oneway] void deselectAllRows();
+ void deselectAllRows();
- /** Deselects selected rows. Selected rows, which aren't in the range remain selected.
- @param rangeOfRows
- array of rows indexes, which will be deselected.
+ /** removes the selection for a given row
+
+ @param RowIndex
+ denotes the index of the row to deselect
*/
- [oneway] void deselectRows( [in] sequence< long > rangeOfRows);
+ void deselectRow( [in] long RowIndex );
/** Returns the indicies of all selected rows.
@returns
@@ -93,21 +83,11 @@ interface XGridSelection
*/
boolean isSelectedIndex( [in] long index);
- /** Marks a row as selected.
- @param index
- the index of a row.
- */
- [oneway] void selectRow( [in] long index);
-
- /*
- [oneway] void selectColumn( [in] long x);
- */
-
/** Adds a listener for the <type>GridSelectionEvent</type> posted after the grid changes.
@param listener
the listener to add.
*/
- [oneway] void addSelectionListener( [in] XGridSelectionListener listener);
+ void addSelectionListener( [in] XGridSelectionListener listener);
//-------------------------------------------------------------------------
@@ -115,7 +95,7 @@ interface XGridSelection
@param listener
the listener to remove.
*/
- [oneway] void removeSelectionListener( [in] XGridSelectionListener listener);
+ void removeSelectionListener( [in] XGridSelectionListener listener);
};
diff --git a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl
new file mode 100755
index 000000000000..5e10820ff9ef
--- /dev/null
+++ b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl
@@ -0,0 +1,163 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_awt_grid_XMutableGridDataModel_idl__
+#define __com_sun_star_awt_grid_XMutableGridDataModel_idl__
+
+#include <com/sun/star/awt/grid/XGridDataModel.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module awt { module grid {
+
+//==================================================================================================================
+
+/** allows to modify the data represented by a <type>XGridDataModel</type>
+ */
+interface XMutableGridDataModel : XGridDataModel
+{
+ /** adds a row to the model.
+
+ @param Heading
+ denotes the heading of the row.
+ @param Data
+ specifies the content of the row.
+ */
+ void addRow( [in] any Heading, [in] sequence< any > Data );
+
+ /** adds multiple rows of data to the model.
+ @param Headings
+ denotes the headings of the to-be-added rows.
+ @param Data
+ specifies the data of the rows to be added.
+ @throws ::com::sun::star::lang::IllegalArgumentException
+ if <code>Titles</code> and <code>Data</code> are of different length.
+ */
+ void addRows( [in] sequence< any > Headings, [in] sequence< sequence< any > > Data )
+ raises ( ::com::sun::star::lang::IllegalArgumentException );
+
+ /** removes a row of data from the model
+
+ @param RowIndex
+ the index of the row that should be removed.
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the given index is invalid
+ */
+ void removeRow( [in] long RowIndex )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
+
+ /** Removes all rows from the model.
+ */
+ void removeAllRows();
+
+ /** updates the content of the given cell
+ @param ColumnIndex
+ the column index of the to-be-updated cell
+ @param RowIndex
+ the row index of the to-be-updated cell
+ @param Value
+ the new value of the cell.
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the row or column index is invalid
+ */
+ void updateCellData( [in] long ColumnIndex, [in] long RowIndex, [in] any Value )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
+
+ /** updates the content of a given row.
+
+ <p>The change in the data model will be notified to registered listeners via
+ <member">XGridDataListener::dataChanged</member>. The <member>GridDataEvent::FirstColumn</member> and
+ <member>GridDataEvent::LastColumn</member> will denote the smallest respectively largest column
+ index from <argColumnIndexes</arg>.</p>
+
+ @param ColumnIndexes
+ contains the column indexes of the cells, which should be updated
+ @param RowIndex
+ contains the index of the row whose data is to be updated
+ @param Values
+ specifies the new values of the cells.
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if one of the row indexes or the column index is invalid
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the lengths of the <code>ColumnIndexes</code> and <code>Values</code> sequences are not equal.
+ */
+ void updateRowData( [in] sequence< long > ColumnIndexes, [in] long RowIndex, [in] sequence< any > Values )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException
+ , ::com::sun::star::lang::IllegalArgumentException);
+
+ /** sets a new title for a given row.
+
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the given index does not denote a valid row.
+ */
+ void
+ updateRowHeading( [in] long RowIndex, [in] any Heading )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
+
+ /** updates the tooltip to be displayed for a given cell
+
+ @see XGridDataModel::getCellToolTip
+ */
+ void updateCellToolTip( [in] long ColumnIndex, [in] long RowIndex, [in] any Value )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
+
+ /** updates the tooltip for all cells of a given row
+
+ <p>Effectively this method is a shortcut for calling <member>updateCellToolTip</member> multiple
+ times in a row, for all cells of a given row.</p>
+
+ @see XGridDataModel::getCellToolTip
+ @see updateCellToolTip
+ */
+ void updateRowToolTip( [in] long RowIndex, [in] any Value )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
+
+ //-------------------------------------------------------------------------
+
+ /** registers listener to be notified of data changes in the model
+ @param Listener
+ specifies the listener to register
+ */
+ void addGridDataListener( [in] XGridDataListener Listener );
+
+ //-------------------------------------------------------------------------
+
+ /** revokes a listener which was previously registered via <member>addGridDataListener</member>
+ @param Listener
+ specifies the listener to revoke.
+ */
+ void removeGridDataListener( [in] XGridDataListener Listener );
+};
+
+//==================================================================================================================
+
+}; }; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/grid/XSortableGridData.idl b/offapi/com/sun/star/awt/grid/XSortableGridData.idl
new file mode 100755
index 000000000000..9dcf9d95fb85
--- /dev/null
+++ b/offapi/com/sun/star/awt/grid/XSortableGridData.idl
@@ -0,0 +1,77 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_awt_grid_XSortableGridData_idl__
+#define __com_sun_star_awt_grid_XSortableGridData_idl__
+
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+#include <com/sun/star/beans/Pair.idl>
+
+//==================================================================================================================
+
+module com { module sun { module star { module awt { module grid {
+
+//==================================================================================================================
+
+/** allows to sort the data represented by a <type>XGridDataModel</type>
+ */
+interface XSortableGridData
+{
+ /** sorts the rows represented by the model by a given column's data.
+
+ @param ColumnIndex
+ the index of the column whose data should be used as sort key
+ @param SortAscending
+ is <TRUE/> if the data should be sorted ascending, <FALSE/> otherwise.
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if <code>ColumnIndex</code> does not denote a valid column.
+ */
+ void sortByColumn( [in] long ColumnIndex, [in] boolean SortAscending )
+ raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
+
+ /** removes any possibly present sorting of the grid data
+ */
+ void removeColumnSort();
+
+ /** returns the current sort order.
+
+ @return
+ a structure describing the current sort order. <member scope="::com::sun::star::beans">Pair::First</member>
+ denotes the column by which the data is sorted, or -1 if the data is currently unsorted.
+ <member scope="::com::sun::star::beans">Pair::Second</member> is <TRUE/> if the data is sorted ascending,
+ <FALSE/> otherwise.
+ */
+ ::com::sun::star::beans::Pair< long, boolean >
+ getCurrentSortOrder();
+};
+
+//==================================================================================================================
+
+}; }; }; }; };
+
+//==================================================================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/grid/ScrollBarMode.idl b/offapi/com/sun/star/awt/grid/XSortableMutableGridDataModel.idl
index d22cd8f30c78..bbcd6bc29540 100644..100755
--- a/offapi/com/sun/star/awt/grid/ScrollBarMode.idl
+++ b/offapi/com/sun/star/awt/grid/XSortableMutableGridDataModel.idl
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -24,47 +23,39 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef __com_sun_star_awt_grid_ScrollBarMode_idl__
-#define __com_sun_star_awt_grid_ScrollBarMode_idl__
+#ifndef __com_sun_star_awt_grid_XSortableMutableGridDataModel_idl__
+#define __com_sun_star_awt_grid_XSortableMutableGridDataModel_idl__
+
+#include <com/sun/star/awt/grid/XMutableGridDataModel.idl>
+#include <com/sun/star/awt/grid/XSortableGridData.idl>
-//=============================================================================
+//==================================================================================================================
-module com { module sun { module star { module awt { module grid {
+module com { module sun { module star { module awt { module grid {
-//=============================================================================
+//==================================================================================================================
-/** specifies the adjustment type.
+/** describes a grid control data model whose data can be modified and sorted.
*/
-enum ScrollBarMode
+interface XSortableMutableGridDataModel
{
- //-------------------------------------------------------------------------
-
- /** adjustment is originated by a line jump.
-
- <p>A line jump can, for example, be caused by a click on
- one of the pointer buttons.</p>
- */
- AUTO,
-
- //-------------------------------------------------------------------------
-
- /** adjustment is originated by a page jump.
-
- <p>A page jump can, for example, be caused by a click in the
- background area of the scrollbar (neither one of the pointer
- buttons, nor the thumb).</p>
- */
- ON,
-
- OFF
-
+ /** provides access to the basic functionality of a grid data model, plus functions to modify it.
+ */
+ interface XMutableGridDataModel;
+ /** provides means to sort the data represented by the model.
+ <p>If you set a new column sort order, the implementation will notify the registered <type>XGridDataListener</type>s
+ via a call to its <member>XGridDataListener::dataChanged</member> method.</p>
+ */
+ interface XSortableGridData;
};
-//=============================================================================
+//==================================================================================================================
}; }; }; }; };
+//==================================================================================================================
+
#endif
diff --git a/offapi/com/sun/star/awt/grid/makefile.mk b/offapi/com/sun/star/awt/grid/makefile.mk
index 02c159f8ffec..8499dca27d82 100644
--- a/offapi/com/sun/star/awt/grid/makefile.mk
+++ b/offapi/com/sun/star/awt/grid/makefile.mk
@@ -39,27 +39,27 @@ PACKAGE=com$/sun$/star$/awt$/grid
# ------------------------------------------------------------------------
IDLFILES=\
GridColumnEvent.idl\
- GridControlEvent.idl\
GridDataEvent.idl\
SelectionEventType.idl\
GridSelectionEvent.idl\
- XGridControlListener.idl\
XGridSelectionListener.idl\
XGridSelection.idl\
XGridColumn.idl\
XGridColumnListener.idl\
XGridDataListener.idl\
- XGridCell.idl\
- XGridCellRenderer.idl\
DefaultGridDataModel.idl\
XGridDataModel.idl\
+ XMutableGridDataModel.idl\
XGridColumnModel.idl\
- ScrollBarMode.idl\
XGridControl.idl\
UnoControlGrid.idl\
UnoControlGridModel.idl\
GridInvalidDataException.idl\
- GridInvalidModelException.idl
+ GridInvalidModelException.idl\
+ XSortableGridData.idl\
+ SortableGridDataModel.idl\
+ XSortableMutableGridDataModel.idl\
+
# ------------------------------------------------------------------
.INCLUDE : target.mk
diff --git a/offapi/com/sun/star/awt/tree/XTreeControl.idl b/offapi/com/sun/star/awt/tree/XTreeControl.idl
index a5341257ba45..7a5e3c11af29 100644
--- a/offapi/com/sun/star/awt/tree/XTreeControl.idl
+++ b/offapi/com/sun/star/awt/tree/XTreeControl.idl
@@ -154,7 +154,7 @@ interface XTreeControl
@throws ::com::sun::star::lang::IllegalArgumentException
if <var>Node</var> is not a valid node of the corresponding <type>XTreeDataModel</type>.
- @raises ExpandVetoException
+ @throws ExpandVetoException
if collapsing <var>Node</var> failed because at least one of the registered
<type>XTreeExpansionListener</type> raised a <type>ExpandVetoException</type>.
*/
diff --git a/offapi/com/sun/star/chart2/LegendExpansion.idl b/offapi/com/sun/star/chart/ChartLegendExpansion.idl
index 8a51a47bb3a1..3808c7ea9ad1 100644..100755
--- a/offapi/com/sun/star/chart2/LegendExpansion.idl
+++ b/offapi/com/sun/star/chart/ChartLegendExpansion.idl
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef com_sun_star_chart_LegendExpansion_idl
-#define com_sun_star_chart_LegendExpansion_idl
+#ifndef com_sun_star_chart_ChartLegendExpansion_idl
+#define com_sun_star_chart_ChartLegendExpansion_idl
module com
{
@@ -33,41 +33,37 @@ module sun
{
module star
{
-module chart2
+module chart
{
-/**
+/** Specifies sizing aspects of the legend
*/
-enum LegendExpansion
+enum ChartLegendExpansion
{
- /** The legend is laid out such that it is wider that high. The
- aspect ratio is greater than 1.
+ /** The legend entries are arranged in a single row if possible. If not enough space is available further rows are added.
<p>This is usually used for legends that are displayed at the
top or bottom of the page.</p>
*/
WIDE,
- /** The legend is laid out such that it is higher that wide. The
- aspect ratio is less than 1.
+ /** The legend entries are stacked in a single column if possible. If not enough space is available further columns are added.
<p>This is usually used for legends that are displayed on the
left or right hand side of the page.</p>
*/
HIGH,
- /** The legend is laid out such that height and width are not
- differing too much. It is not guaranteed to have an aspect
- ratio of 1.
+ /** The legend entries are arranged in a way that the aspect ratio of the resulting legend is as near to 1 as possible.
*/
BALANCED,
- /** The aspect ratio of the legend is given explicitly
+ /** The size of the legend is given explicitly
*/
CUSTOM
};
-} ; // chart2
+} ; // chart
} ; // com
} ; // sun
} ; // star
diff --git a/offapi/com/sun/star/chart/makefile.mk b/offapi/com/sun/star/chart/makefile.mk
index 7c9d53e12eed..94592e0d70e9 100644
--- a/offapi/com/sun/star/chart/makefile.mk
+++ b/offapi/com/sun/star/chart/makefile.mk
@@ -73,6 +73,7 @@ IDLFILES=\
ChartGrid.idl\
ChartLegend.idl\
ChartLegendPosition.idl\
+ ChartLegendExpansion.idl \
ChartLine.idl\
ChartPieSegmentProperties.idl\
ChartRegressionCurveType.idl\
diff --git a/offapi/com/sun/star/chart2/CustomLegendEntry.idl b/offapi/com/sun/star/chart2/CustomLegendEntry.idl
deleted file mode 100644
index 9668eaf90de4..000000000000
--- a/offapi/com/sun/star/chart2/CustomLegendEntry.idl
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef com_sun_star_chart_CustomLegendEntry_idl
-#define com_sun_star_chart_CustomLegendEntry_idl
-
-#include <com/sun/star/beans/XPropertySet.idl>
-#include <com/sun/star/chart2/XLegendSymbolProvider.idl>
-
-module com
-{
-module sun
-{
-module star
-{
-module chart2
-{
-
-/** A legend entry that does not depend on data series or other chart
- objects. It may contain any text a user specifies.
- */
-service CustomLegendEntry
-{
- /** Is used to identify an object as one that may be shown in a
- legend.
- */
- interface XLegendEntry;
-
- /** Is used to display a legend text
- */
- interface XTitled;
-
- /** If the legend entry should contain a user-defined symbol, you
- have to implement this interface.
- */
- [optional] interface XLegendSymbolProvider;
-
- /** must be supported, if properties are implemented
- */
- [optional] service ::com::sun::star::beans::XPropertySet;
-
- /** determines what kind of symbol is displayed next to the entry
- in the legend.
- */
- [optional, property] LegendSymbolStyle SymbolStyle;
-};
-
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
-
-#endif
diff --git a/offapi/com/sun/star/chart2/Legend.idl b/offapi/com/sun/star/chart2/Legend.idl
index 0d51492ae4c2..32bd7aa7d85e 100644
--- a/offapi/com/sun/star/chart2/Legend.idl
+++ b/offapi/com/sun/star/chart2/Legend.idl
@@ -29,7 +29,7 @@
#include <com/sun/star/chart2/XLegend.idl>
#include <com/sun/star/chart2/LegendPosition.idl>
-#include <com/sun/star/chart2/LegendExpansion.idl>
+#include <com/sun/star/chart/ChartLegendExpansion.idl>
#include <com/sun/star/beans/PropertySet.idl>
#include <com/sun/star/drawing/LineProperties.idl>
@@ -63,12 +63,12 @@ service Legend
/** Determines how the aspect ratio of the legend should roughly
be.
- <p>Set the Expansion to <member>LegendExpansion::HIGH</member>
+ <p>Set the Expansion to <member>::com::sun::star::chart::ChartLegendExpansion::HIGH</member>
for a legend that is positioned on the right or left hand
side. Use <member>LegendExpansion::WIDE</member> for a legend
that is positioned on top or the bottom.</p>
*/
- [property] LegendExpansion Expansion;
+ [property] ::com::sun::star::chart::ChartLegendExpansion Expansion;
/** Determines, whether the legend should be redered by the view.
*/
diff --git a/offapi/com/sun/star/chart2/LegendSymbolStyle.idl b/offapi/com/sun/star/chart2/LegendSymbolStyle.idl
deleted file mode 100644
index 13d47ee3a7c9..000000000000
--- a/offapi/com/sun/star/chart2/LegendSymbolStyle.idl
+++ /dev/null
@@ -1,107 +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_chart_LegendSymbolStyle_idl
-#define com_sun_star_chart_LegendSymbolStyle_idl
-
-#include <com/sun/star/uno/XInterface.idl>
-
-#include <com/sun/star/chart2/XTitle.idl>
-
-module com
-{
-module sun
-{
-module star
-{
-module chart2
-{
-
-/**
- */
-enum LegendSymbolStyle
-{
- /** A square box with border.
- */
- BOX,
-
- /** A rectangle that is wider than high with border.
- */
- BAR,
-
- /** A square box with border, that may change its aspect ratio if
- the layout of the legend requires this.
- */
- RECTANGLE,
-
- /** A filled rectangle with no border that uses all the space
- available for the legend entry's symbol, leaving no padding
- space. This is especially useful for legends representing a
- color-scale.
- */
- STRETCHED_RECTANGLE,
-
- /** A line extending from the left edge to the right edge
- */
- HORIZONTAL_LINE,
-
- /** A line extending from the top edge to the bottom edge
- */
- VERTICAL_LINE,
-
- /** A line spanning the diagonal of the box you would get with
- <member>BOX</member>.
- */
- DIAGONAL_LINE,
-
- /** A line like with <member>LINE</member>, but with a small
- bordered square box in the middle.
- */
- LINE_WITH_BOX,
-
- /** A line like with <member>LINE</member>, but with the symbol
- that is returned by <member>XLegendEntry::getSymbol</member>
- (see also <member>USER_DEFINED</member>).
- */
- LINE_WITH_SYMBOL,
-
- /** A bordered circle which has the same bounding-box as the
- <member>BOX</member>.
- */
- CIRCLE,
-
- /** Use the symbol that is returned by
- <member>XLegendEntry::getSymbol</member>.
- */
- USER_DEFINED
-};
-
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
-
-#endif
diff --git a/offapi/com/sun/star/chart2/ViewLegendEntry.idl b/offapi/com/sun/star/chart2/ViewLegendEntry.idl
deleted file mode 100644
index 0e5ea231628c..000000000000
--- a/offapi/com/sun/star/chart2/ViewLegendEntry.idl
+++ /dev/null
@@ -1,58 +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_ViewLegendEntry_idl
-#define com_sun_star_chart2_ViewLegendEntry_idl
-
-#include <com/sun/star/drawing/XShape.idl>
-#include <com/sun/star/chart2/XFormattedString.idl>
-
-//=============================================================================
-
-module com { module sun { module star { module chart2 {
-
-//=============================================================================
-
-/**
- */
-struct ViewLegendEntry
-{
- /** The legend symbol that represents a data series or other
- information contained in the legend
- */
- ::com::sun::star::drawing::XShape aSymbol;
-
- /** The descriptive text for a legend entry.
- */
- sequence< XFormattedString > aLabel;
-};
-
-//=============================================================================
-
-}; }; }; };
-
-#endif
-
diff --git a/offapi/com/sun/star/chart2/XLegend.idl b/offapi/com/sun/star/chart2/XLegend.idl
index 309aa148dd2a..1cc8666ef20d 100644
--- a/offapi/com/sun/star/chart2/XLegend.idl
+++ b/offapi/com/sun/star/chart2/XLegend.idl
@@ -3,15 +3,6 @@
#include <com/sun/star/uno/XInterface.idl>
-#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
-#include <com/sun/star/lang/IllegalArgumentException.idl>
-#endif
-#ifndef __com_sun_star_container_NoSuchElementException_idl__
-#include <com/sun/star/container/NoSuchElementException.idl>
-#endif
-
-#include <com/sun/star/chart2/XLegendEntry.idl>
-
module com
{
module sun
@@ -25,30 +16,6 @@ module chart2
*/
interface XLegend : ::com::sun::star::uno::XInterface
{
- /** The entry added is appended to the list, such that it appears
- at the end of the legend.
-
- @param xEntry
-
- If it supports <type>CustomLegendEntry</type>,
- the <type>XTitle</type> is used for displaying a text, and
- the symbol is displayed according to the
- <member>CustomLegendEntry::SymbolStyle</member> property.
- */
- void registerEntry( [in] XLegendEntry xEntry )
- raises( com::sun::star::lang::IllegalArgumentException );
-
- /** Removes an entry that was registered before
-
- <p>(see <member>registerEntry</member>)</p>
- */
- void revokeEntry( [in] XLegendEntry xEntry )
- raises( com::sun::star::container::NoSuchElementException );
-
- /** Returns a list of all legend entries in the order in which
- they were registered.
- */
- sequence< XLegendEntry > getEntries();
};
} ; // chart2
diff --git a/offapi/com/sun/star/chart2/XLegendEntry.idl b/offapi/com/sun/star/chart2/XLegendEntry.idl
deleted file mode 100644
index 579c453dbd6a..000000000000
--- a/offapi/com/sun/star/chart2/XLegendEntry.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef com_sun_star_chart_XLegendEntry_idl
-#define com_sun_star_chart_XLegendEntry_idl
-
-#include <com/sun/star/uno/XInterface.idl>
-
-#include "com/sun/star/chart2/XTitle.idl"
-#include "com/sun/star/chart2/LegendSymbolStyle.idl"
-
-module com
-{
-module sun
-{
-module star
-{
-module chart2
-{
-
-/** Object type for Legend.
- */
-interface XLegendEntry : ::com::sun::star::uno::XInterface
-{
- // no methods, currently only used for type safety
-};
-
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
-
-#endif
diff --git a/offapi/com/sun/star/chart2/XLegendSymbolProvider.idl b/offapi/com/sun/star/chart2/XLegendSymbolProvider.idl
deleted file mode 100644
index 56b2b082d317..000000000000
--- a/offapi/com/sun/star/chart2/XLegendSymbolProvider.idl
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef com_sun_star_chart_XLegendSymbolProvider_idl
-#define com_sun_star_chart_XLegendSymbolProvider_idl
-
-#include <com/sun/star/uno/XInterface.idl>
-#include <com/sun/star/drawing/XShape.idl>
-
-module com
-{
-module sun
-{
-module star
-{
-module chart2
-{
-
-/**
- */
-interface XLegendSymbolProvider : ::com::sun::star::uno::XInterface
-{
- /** The returned shape is used for display in the legend. It may
- also be used for display at a data points.
-
- <p>The shape returned here, will be resized using
- <member scope="com::sun::star::drawing">XShape::setSize</member>
- to fit the available space in the legend.</p>
- */
- com::sun::star::drawing::XShape getSymbol();
-};
-
-} ; // chart2
-} ; // com
-} ; // sun
-} ; // star
-
-#endif
diff --git a/offapi/com/sun/star/chart2/makefile.mk b/offapi/com/sun/star/chart2/makefile.mk
index 60cc8393e193..873bb985d566 100644
--- a/offapi/com/sun/star/chart2/makefile.mk
+++ b/offapi/com/sun/star/chart2/makefile.mk
@@ -48,9 +48,7 @@ IDLFILES= \
FillBitmap.idl \
IncrementData.idl \
InterpretedData.idl \
- LegendExpansion.idl \
LegendPosition.idl \
- LegendSymbolStyle.idl \
LightSource.idl \
PieChartOffsetMode.idl \
RelativePosition.idl \
@@ -62,7 +60,6 @@ IDLFILES= \
SymbolStyle.idl \
TickmarkStyle.idl \
TransparencyStyle.idl \
- ViewLegendEntry.idl \
XAnyDescriptionAccess.idl\
XAxis.idl \
XCoordinateSystem.idl \
@@ -86,8 +83,6 @@ IDLFILES= \
XInternalDataProvider.idl \
XLabeled.idl \
XLegend.idl \
- XLegendEntry.idl \
- XLegendSymbolProvider.idl \
XRegressionCurve.idl \
XRegressionCurveCalculator.idl \
XRegressionCurveContainer.idl \
diff --git a/offapi/com/sun/star/i18n/TransliterationModules.idl b/offapi/com/sun/star/i18n/TransliterationModules.idl
index 1ac752d52fd8..69618dee0c9f 100644
--- a/offapi/com/sun/star/i18n/TransliterationModules.idl
+++ b/offapi/com/sun/star/i18n/TransliterationModules.idl
@@ -33,8 +33,12 @@ module com { module sun { module star { module i18n {
//=============================================================================
-/** Old transliteration module enumeration to use with
- <member>XTransliteration::loadModule()</member>
+/** Old transliteration module enumeration.
+
+ <p> Use with <member>XTransliteration::loadModule()</member> and
+ <member scope="com::sun::star::util">SearchOptions::transliterateFlags</member> </p>
+
+ <p> Note that values &gt;=0x100 are logically or'ed with other values! </p>
*/
published enum TransliterationModules
diff --git a/offapi/com/sun/star/sdb/XSubDocument.idl b/offapi/com/sun/star/sdb/XSubDocument.idl
index 0592c6cffa0a..120280fd7ef3 100644
--- a/offapi/com/sun/star/sdb/XSubDocument.idl
+++ b/offapi/com/sun/star/sdb/XSubDocument.idl
@@ -52,7 +52,7 @@ interface XSubDocument
or an <type scope="com::sun::star::frame">XController</type> if the sub document
does not have an own model.
- @raises ::com::sun::star::lang::WrappedTargetException
+ @throws ::com::sun::star::lang::WrappedTargetException
if an error occurs during opening the document
*/
::com::sun::star::lang::XComponent
@@ -66,7 +66,7 @@ interface XSubDocument
or an <type scope="com::sun::star::frame">XController</type> if the sub document
does not have an own model.
- @raises ::com::sun::star::lang::WrappedTargetException
+ @throws ::com::sun::star::lang::WrappedTargetException
if an error occurs during opening the document
*/
::com::sun::star::lang::XComponent
@@ -75,7 +75,7 @@ interface XSubDocument
/** stores the sub document, if it had previously been opened in either mode
- @raises ::com::sun::star::lang::WrappedTargetException
+ @throws ::com::sun::star::lang::WrappedTargetException
if an error occurs during storing the document
*/
void store()
@@ -86,7 +86,7 @@ interface XSubDocument
@return <TRUE/> if and only if the document could be closed, <FALSE/> otherwise,
e.g. if the closing has been vetoed by the user.
- @raises ::com::sun::star::lang::WrappedTargetException
+ @throws ::com::sun::star::lang::WrappedTargetException
if an error occurs during closing the document
*/
boolean close()
diff --git a/offapi/com/sun/star/util/XTextSearch.idl b/offapi/com/sun/star/util/XTextSearch.idl
index cc9e45058c47..3b0170c2ec26 100644
--- a/offapi/com/sun/star/util/XTextSearch.idl
+++ b/offapi/com/sun/star/util/XTextSearch.idl
@@ -40,97 +40,151 @@ module com { module sun { module star { module util {
//=============================================================================
-published enum SearchAlgorithms {
- ABSOLUTE, // "normal" a kind of Boyer-Moore
- REGEXP, // regular expression
- APPROXIMATE // Leveinstein distance
+published enum SearchAlgorithms
+{
+ /// Literal
+ ABSOLUTE, // implemented as a kind of Boyer-Moore
+ /// Regular expression
+ REGEXP,
+ /// Weighted Levenshtein Distance
+ APPROXIMATE
};
+/// Flags for search methods
published constants SearchFlags
{
- //Flag for all search methods
-
/**
- @deprecated : the constant ALL_IGNORE_CASE is never supported -
- it must use the transliteration flags of
- the SearchOptions.
- <p>@see TransliterationModulesNew
+ @deprecated The constant ALL_IGNORE_CASE is never supported - use
+ <const scope="com::sun::star::i18n">TransliterationModules::IGNORE_CASE</const>
+ with
+ <member>SearchOptions::transliterateFlags</member>
+ instead.
+
+ @see <type scope="com::sun::star::i18n">TransliterationModules</type>
*/
const long ALL_IGNORE_CASE = 0x00000001;
- /// Flag for normal (Boyer-Moore) search
+ /** Flag for normal (Boyer-Moore) search / Search for word only. */
const long NORM_WORD_ONLY = 0x00000010;
- /// Flag for "regular expression" search / interpret as extended regular expression
+ /** Flag for "regular expression" search / Interpret as extended
+ regular expression.
+
+ @deprecated The flag is currently not supported by OOo.
+ */
const long REG_EXTENDED = 0x00000100;
- /** Flag for "regular expression" search / No replace, i.e., avoid sub regular
- expresions, return true/false to match
-<!-- JRH: Check this for sense of the expression. -->
+ /** Flag for "regular expression" search / No register information
+ or backreferences, i.e., avoid sub expressions. Return only
+ true/false if matched or not.
+
+ @deprecated The flag is currently not supported by OOo.
+ */
+ const long REG_NOSUB = 0x00000200;
+
+ /** Flag for "regular expression" search / Special new line
+ treatment.
+
+ @deprecated The flag is currently not supported by OOo.
+
+ <p> A NEWLINE character in string will not be matched by a
+ period outside bracket expression or by any form of a non
+ matching list. </p>
+
+ <p> A circumflex (^) in pattern when used to specify expression
+ anchoring will match the zero length string immediately after a
+ newline in string, regardless of the setting of
+ REG_NOT_BEGINOFLINE. </p>
+
+ <p> A dollar-sign ($) in pattern when used to specify expression
+ anchoring, will match zero-length string immediately before a
+ new line in string, regardless of the setting of
+ REG_NOT_ENDOFLINE. </p>
+ */
+ const long REG_NEWLINE = 0x00000400;
+
+ /** The first character in the string is not the beginning of the
+ line therefore ^ will not match with first character of the
+ string.
*/
- const long REG_NOSUB = 0x00000200;
-
- /// Flag for "regular expression" search / Special new line treatment
- const long REG_NEWLINE = 0x00000400;
-
- /** A NEWLINE character in string will not be matched by a period outside bracket
- expression or by any form of a non matching list.
- A circumflex (^) in pattern when used to specify expression anchoring
-<!-- JRH: anhoring to anchoring. -->
- will match the zero length string immediately after a newline in string,
- regardless of the setting of REG_NOTBOL
- A dollar-sign ($) in pattern when used to specify expression anchoring,
- will match zero-length string immediately before a new line in string,
- regardless of the setting of REG_NOTEOL
-*/
const long REG_NOT_BEGINOFLINE = 0x00000800;
- /** The first character in the string is not the beginning of the line therefore ^ will not
- match with first character of the string
+ /** The last character in the string is not the end of the line
+ therefore $ will not match with last character of the string.
*/
const long REG_NOT_ENDOFLINE = 0x00001000;
-
- /// Flags for "Weight Levenshtein-Distance" search
+ /** Flag for "Weighted Levenshtein Distance" search / Relaxed
+ checking of limit, split weigh pools.
+
+ <p> If not specified (<b>strict</b>), the search is sucessful if
+ the WLD is within a calculated limit where each insertion,
+ deletion and replacement adds a weight to a common pool of
+ weights. This is the mathematically correct WLD. </p>
+
+ <p> From a user's point of view the strict WLD is an
+ exclusive-OR of the arguments given, for example if allowed
+ insertions=2 and allowed replacements=2, the search fails if 2
+ characters had been inserted and an additional operation would
+ be needed to match. Depending on the weights it may also fail if
+ 1 character was inserted and 1 character replaced and an
+ additional operation would be needed to match. The strict
+ algorithm may match less than expected from a first glance of
+ the specified arguments, but does not return false positives. </p>
+
+ <p> If specified (<b>relaxed</b>), the search is also successful
+ if the combined pool for insertions and deletions is below a
+ doubled calculated limit and replacements are treated
+ differently. Additionally, swapped characters are counted as one
+ replacement. </p>
+
+ <p> From a user's point of view the relaxed WLD is an
+ inclusive-OR of the arguments given, for example if allowed
+ insertions=2 and allowed replacements=2, the search succeeds if
+ 2 characters had been inserted and an additional replacement is
+ needed to match. The relaxed algorithm may return false
+ positives, but meets user expectation better. </p>
+ */
const long LEV_RELAXED = 0x00010000;
};
published struct SearchOptions {
//-------------------------------------------------------------------------
- /// search type, can be: ABSOLUTE, REGEXP, APPROXIMATE
+ /** search type */
SearchAlgorithms algorithmType;
/** some flags - can be mixed
- @see SearchFlags
+ @see <type>SearchFlags</type>
*/
long searchFlag;
- /// the search text
+ /** The text or pattern to be searched. */
string searchString;
- /** the replace text
- (is for optional replacing - SearchOption is only the data container for it)*/
+ /** The replacement text
+ (is for optional replacing - SearchOption is only the data container for it) */
string replaceString;
- /// this is the language for case insensitive search
+ /** The locale for case insensitive search. */
::com::sun::star::lang::Locale Locale;
- /** this many characters can be different between the found and search word
- in a "Weight Levenshtein-Distance"*/
+ /** This many characters can be different (as a replacement) between
+ the found word and the search pattern in a "Weighted Levenshtein
+ Distance" search. */
long changedChars;
- /** this many characters can be missed in the found word
- in a "Weight Levenshtein-Distance"*/
+ /** This many characters can be missing in the found word in a
+ "Weighted Levenshtein Distance" search. */
long deletedChars;
- /// this many characters can be additional in the found word in a "Weight Levenshtein-Distance"
+ /** This many characters can be additional in the found word in a
+ "Weighted Levenshtein Distance" search. */
long insertedChars;
- /** asian flags for the transliteration. Same meaning as the enum of TransliteratorModule
-
- @see com/sun/star/i18n/XTransliteration.idl
+ /** Flags for the transliteration. Same meaning as the enum of
+ <type scope="com::sun::star::i18n">TransliterationModules</type>
*/
long transliterateFlags;
};
diff --git a/offapi/com/sun/star/view/XMultiSelectionSupplier.idl b/offapi/com/sun/star/view/XMultiSelectionSupplier.idl
index 8d5d7e07fb52..3557b3c47fae 100644
--- a/offapi/com/sun/star/view/XMultiSelectionSupplier.idl
+++ b/offapi/com/sun/star/view/XMultiSelectionSupplier.idl
@@ -66,7 +66,7 @@ interface XMultiSelectionSupplier: XSelectionSupplier
added to the current selection. For example, if the selection already contains
objects that are forbidden to be selected together with <var>Selection</var>
- @raises com::sun::star::lang::IllegalArgumentException
+ @throws com::sun::star::lang::IllegalArgumentException
If <var>Selection</var> is not a selectable object for this <type>XMultiSelectionSupplier</type>.
<p>Adding an object to the selection that is already part of the selection should not raise this exception</p>
*/
@@ -87,7 +87,7 @@ interface XMultiSelectionSupplier: XSelectionSupplier
added to the current selection. For example, if the selection already contains
objects that are forbidden to be selected together with <var>Selection</var>.
- @raises com::sun::star::lang::IllegalArgumentException
+ @throws com::sun::star::lang::IllegalArgumentException
If <var>Selection</var> is not a selectable object for this <type>XMultiSelectionSupplier</type>.
<p>Removing an object from the selection that is not part of the selection should not raise this exception</p>
*/
diff --git a/offapi/com/sun/star/xml/sax/XFastAttributeList.idl b/offapi/com/sun/star/xml/sax/XFastAttributeList.idl
index a48e0e5b9337..5fa78b81d393 100644
--- a/offapi/com/sun/star/xml/sax/XFastAttributeList.idl
+++ b/offapi/com/sun/star/xml/sax/XFastAttributeList.idl
@@ -92,7 +92,7 @@ interface XFastAttributeList: com::sun::star::uno::XInterface
@returns
The integer token of the value from the attribute or <const>FastToken::Invalid</const>
- @raises SAXEXception
+ @throws SAXEXception
if the attribute is not available
*/
@@ -137,7 +137,7 @@ interface XFastAttributeList: com::sun::star::uno::XInterface
@returns
The string value from the attribute.
- @raises SAXEXception
+ @throws SAXEXception
if the attribute is not available
*/
diff --git a/offapi/type_reference/typelibrary_history.txt b/offapi/type_reference/typelibrary_history.txt
index 7dcd438d5517..16745ab9f7eb 100644
--- a/offapi/type_reference/typelibrary_history.txt
+++ b/offapi/type_reference/typelibrary_history.txt
@@ -158,3 +158,7 @@
Update reference type library with the version of OOo 3.2.1. The new
reference type library is taken from the release source tree OOO320 m19.
+01/28/11 (JSC): TaskID=116682
+ Update css.awt.UnoControlDialog to reflect the supported XDialog2 interface
+ additionally to XDialog
+
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 6d9f761331f4..02cd79c9eb4f 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/officecfg/prj/build.lst b/officecfg/prj/build.lst
index 04d2cfd87aef..b07a34aee982 100644
--- a/officecfg/prj/build.lst
+++ b/officecfg/prj/build.lst
@@ -1,4 +1,4 @@
-oc officecfg : l10n soltools solenv LIBXSLT:libxslt NULL
+oc officecfg : L10N:l10n soltools solenv LIBXSLT:libxslt NULL
oc officecfg usr1 - all oc_mkout NULL
oc officecfg\registry\schema nmake - all oc_reg_schema NULL
oc officecfg\registry nmake - all oc_reg NULL
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 5c72d948436f..a30d746d5043 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -170,7 +170,7 @@
</node>
<node oor:name=".uno:DataPilotFilter" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">DataPilot Filter</value>
+ <value xml:lang="en-US">Pivot Table Filter</value>
</prop>
</node>
<node oor:name=".uno:NextPage" oor:op="replace">
@@ -323,10 +323,10 @@
</node>
<node oor:name=".uno:DataDataPilotRun" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Start DataPilot...</value>
+ <value xml:lang="en-US">~Create Pivot Table...</value>
</prop>
<prop oor:name="ContextLabel" oor:type="xs:string">
- <value xml:lang="en-US">~Start...</value>
+ <value xml:lang="en-US">~Create...</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
@@ -1131,7 +1131,7 @@
</node>
<node oor:name=".uno:RecalcPivotTable" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Refresh DataPilot</value>
+ <value xml:lang="en-US">~Refresh Pivot Table</value>
</prop>
<prop oor:name="ContextLabel" oor:type="xs:string">
<value xml:lang="en-US">~Refresh</value>
@@ -1139,7 +1139,7 @@
</node>
<node oor:name=".uno:DeletePivotTable" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Delete DataPilot</value>
+ <value xml:lang="en-US">~Delete Pivot Table</value>
</prop>
<prop oor:name="ContextLabel" oor:type="xs:string">
<value xml:lang="en-US">~Delete</value>
@@ -1532,7 +1532,7 @@
</node>
<node oor:name=".uno:DataPilotMenu" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Data~Pilot</value>
+ <value xml:lang="en-US">~Pivot Table</value>
</prop>
</node>
<node oor:name=".uno:EditSheetMenu" oor:op="replace">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 913902731f29..aeddefb763c2 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1039,7 +1039,7 @@
with no exception.</desc>
<label>QuotedFieldAsText</label>
</info>
- <value>true</value>
+ <value>false</value>
</prop>
<prop oor:name="DetectSpecialNumbers" oor:type="xs:boolean">
<info>
diff --git a/officecfg/util/makefile.mk b/officecfg/util/makefile.mk
index 332ac90fe2ea..c1fa54277141 100644
--- a/officecfg/util/makefile.mk
+++ b/officecfg/util/makefile.mk
@@ -37,7 +37,6 @@ TARGET=util
$(MISC)$/$(TARGET)_delzip :
-$(RM) $(BIN)$/registry_{$(alllangiso)}.zip
- -$(RM) $(COMMON_OUTPUT)$/bin$/registry_{$(alllangiso)}.zip
$(BIN)$/registry_{$(alllangiso)}.zip : $(MISC)$/$(TARGET)_delzip
cd $(MISC)$/registry$/res$/$(@:b:s/registry_//) && zip -ru ..$/..$/..$/..$/bin$/registry_$(@:b:s/registry_//).zip org/*
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index aec646d4c610..12c6c2294b32 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -138,9 +138,10 @@ public:
OOXML layout model. Returns true, if returned rectangle is valid. */
bool calcAbsRectangle( ::com::sun::star::awt::Rectangle& orRect ) const;
- /** Tries to set the position from the contained OOXML layout model.
- Returns true, if a manual position could be calculated. */
+ /** Tries to set the position and size from the contained OOXML layout model.
+ Returns true, if a manual position and size could be calculated. */
bool convertFromModel( PropertySet& rPropSet );
+
/** Tries to set the position from the contained OOXML layout model.
Returns true, if a manual position could be calculated. */
bool convertFromModel(
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index df4d40e952ac..7e601ff016af 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -78,8 +79,7 @@ struct TitleLayoutInfo
{
typedef Reference< XShape > (*GetShapeFunc)( const Reference< cssc::XChartDocument >& );
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle >
- mxTitle; /// The API title object.
+ Reference< XTitle > mxTitle; /// The API title object.
ModelRef< LayoutModel > mxLayout; /// The layout model, if existing.
GetShapeFunc mpGetShape; /// Helper function to receive the title shape.
@@ -323,9 +323,9 @@ sal_Int32 lclCalcSize( sal_Int32 nPos, sal_Int32 nChartSize, double fSize, sal_I
sal_Int32 nValue = getLimitedValue< sal_Int32, double >( nChartSize * fSize + 0.5, 0, nChartSize );
switch( nSizeMode )
{
- case XML_factor: // size as factor of chart size
+ case XML_factor: // passed value is width/height
return nValue;
- case XML_edge: // absolute end position as factor of chart size
+ case XML_edge: // passed value is right/bottom position
return nValue - nPos + 1;
};
@@ -333,6 +333,23 @@ sal_Int32 lclCalcSize( sal_Int32 nPos, sal_Int32 nChartSize, double fSize, sal_I
return -1;
}
+/** Returns a relative size value in the chart area. */
+double lclCalcRelSize( double fPos, double fSize, sal_Int32 nSizeMode )
+{
+ switch( nSizeMode )
+ {
+ case XML_factor: // passed value is width/height
+ break;
+ case XML_edge: // passed value is right/bottom position
+ fSize -= fPos;
+ break;
+ default:
+ OSL_ENSURE( false, "lclCalcRelSize - unknown size mode" );
+ fSize = 0.0;
+ };
+ return getLimitedValue< double, double >( fSize, 0.0, 1.0 - fPos );
+}
+
} // namespace
// ----------------------------------------------------------------------------
@@ -369,12 +386,20 @@ bool LayoutConverter::convertFromModel( PropertySet& rPropSet )
(mrModel.mnXMode == XML_edge) && (mrModel.mfX >= 0.0) &&
(mrModel.mnYMode == XML_edge) && (mrModel.mfY >= 0.0) )
{
- RelativePosition aPos;
- aPos.Primary = getLimitedValue< double, double >( mrModel.mfX, 0.0, 1.0 );
- aPos.Secondary = getLimitedValue< double, double >( mrModel.mfY, 0.0, 1.0 );
- aPos.Anchor = ::com::sun::star::drawing::Alignment_TOP_LEFT;
+ RelativePosition aPos(
+ getLimitedValue< double, double >( mrModel.mfX, 0.0, 1.0 ),
+ getLimitedValue< double, double >( mrModel.mfY, 0.0, 1.0 ),
+ Alignment_TOP_LEFT );
rPropSet.setProperty( PROP_RelativePosition, aPos );
- return true;
+
+ RelativeSize aSize(
+ lclCalcRelSize( aPos.Primary, mrModel.mfW, mrModel.mnWMode ),
+ lclCalcRelSize( aPos.Secondary, mrModel.mfH, mrModel.mnHMode ) );
+ if( (aSize.Primary > 0.0) && (aSize.Secondary > 0.0) )
+ {
+ rPropSet.setProperty( PROP_RelativeSize, aSize );
+ return true;
+ }
}
return false;
}
diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index fdc4969f7c5e..8163241e5a31 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -27,7 +27,7 @@
#include "oox/drawingml/chart/titleconverter.hxx"
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XFormattedString.hpp>
@@ -198,6 +198,7 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
{
if( rxDiagram.is() ) try
{
+ namespace cssc = ::com::sun::star::chart;
namespace cssc2 = ::com::sun::star::chart2;
// create the legend
@@ -211,46 +212,35 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
// predefined legend position and expansion
cssc2::LegendPosition eLegendPos = cssc2::LegendPosition_CUSTOM;
- cssc2::LegendExpansion eLegendExpand = cssc2::LegendExpansion_HIGH;
+ cssc::ChartLegendExpansion eLegendExpand = cssc::ChartLegendExpansion_CUSTOM;
switch( mrModel.mnPosition )
{
case XML_l:
eLegendPos = cssc2::LegendPosition_LINE_START;
- eLegendExpand = cssc2::LegendExpansion_HIGH;
+ eLegendExpand = cssc::ChartLegendExpansion_HIGH;
break;
case XML_r:
+ case XML_tr: // top-right not supported
eLegendPos = cssc2::LegendPosition_LINE_END;
- eLegendExpand = cssc2::LegendExpansion_HIGH;
+ eLegendExpand = cssc::ChartLegendExpansion_HIGH;
break;
case XML_t:
eLegendPos = cssc2::LegendPosition_PAGE_START;
- eLegendExpand = cssc2::LegendExpansion_WIDE;
+ eLegendExpand = cssc::ChartLegendExpansion_WIDE;
break;
case XML_b:
eLegendPos = cssc2::LegendPosition_PAGE_END;
- eLegendExpand = cssc2::LegendExpansion_WIDE;
- break;
- case XML_tr:
- eLegendPos = cssc2::LegendPosition_LINE_END; // top-right not supported
- eLegendExpand = cssc2::LegendExpansion_HIGH;
+ eLegendExpand = cssc::ChartLegendExpansion_WIDE;
break;
}
- // manual positioning
- LayoutModel& rLayout = mrModel.mxLayout.getOrCreate();
- LayoutConverter aLayoutConv( *this, rLayout );
- aLayoutConv.convertFromModel( aPropSet );
- Rectangle aLegendRect;
- if( aLayoutConv.calcAbsRectangle( aLegendRect ) )
+ // manual positioning and size
+ if( mrModel.mxLayout.get() )
{
- // #i71697# it is not possible to set the size directly, do some magic here
- double fRatio = static_cast< double >( aLegendRect.Width ) / aLegendRect.Height;
- if( fRatio > 1.5 )
- eLegendExpand = cssc2::LegendExpansion_WIDE;
- else if( fRatio < 0.75 )
- eLegendExpand = cssc2::LegendExpansion_HIGH;
- else
- eLegendExpand = cssc2::LegendExpansion_BALANCED;
+ LayoutConverter aLayoutConv( *this, *mrModel.mxLayout );
+ // manual size needs ChartLegendExpansion_CUSTOM
+ if( aLayoutConv.convertFromModel( aPropSet ) )
+ eLegendExpand = cssc::ChartLegendExpansion_CUSTOM;
}
// set position and expansion properties
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 016ffc28bac5..b0726f86657e 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -348,6 +348,7 @@ RegularExpressions
RelId
RelativeHorizontalTabbarWidth
RelativePosition
+RelativeSize
Repeat
RepeatDelay
Representation
diff --git a/padmin/AllLangResTarget_spa.mk b/padmin/AllLangResTarget_spa.mk
new file mode 100644
index 000000000000..1fd6e42dad56
--- /dev/null
+++ b/padmin/AllLangResTarget_spa.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_AllLangResTarget_AllLangResTarget,spa))
+
+$(eval $(call gb_AllLangResTarget_set_reslocation,spa,padmin))
+
+$(eval $(call gb_AllLangResTarget_add_srs,spa,\
+ padmin/source \
+))
+
+$(eval $(call gb_SrsTarget_SrsTarget,padmin/source))
+
+$(eval $(call gb_SrsTarget_set_include,padmin/source,\
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_SrsTarget_add_files,padmin/source,\
+ padmin/source/padialog.src \
+ padmin/source/rtsetup.src \
+))
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/padmin/Executable_spadmin.bin.mk b/padmin/Executable_spadmin.bin.mk
new file mode 100644
index 000000000000..ae677c1c86b4
--- /dev/null
+++ b/padmin/Executable_spadmin.bin.mk
@@ -0,0 +1,70 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_Executable_Executable,spadmin.bin))
+
+$(eval $(call gb_Executable_set_include,spadmin.bin,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc \
+ -I$(OUTDIR)/inc/offuh \
+))
+
+$(eval $(call gb_Executable_set_cxxflags,spadmin.bin,\
+ $$(CXXFLAGS) \
+))
+
+$(eval $(call gb_Executable_add_linked_static_libs,spadmin.bin,\
+ vclmain \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,spadmin.bin,\
+ spa \
+ svt \
+ vcl \
+ utl \
+ ucbhelper \
+ comphelper \
+ tl \
+ cppuhelper \
+ cppu \
+ sal \
+ stl \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,spadmin.bin,\
+ padmin/source/desktopcontext \
+ padmin/source/pamain \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Executable_add_linked_libs,spadmin.bin,\
+ dl \
+ pthread \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/padmin/Library_spa.mk b/padmin/Library_spa.mk
new file mode 100644
index 000000000000..47618720d283
--- /dev/null
+++ b/padmin/Library_spa.mk
@@ -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.
+#
+#*************************************************************************
+
+$(eval $(call gb_Library_Library,spa))
+
+$(eval $(call gb_Library_set_include,spa,\
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(OUTDIR)/inc/stl \
+))
+
+$(eval $(call gb_Library_set_defs,spa,\
+ $$(DEFS) \
+ -DSPA_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_add_linked_libs,spa,\
+ svt \
+ vcl \
+ utl \
+ tl \
+ basegfx \
+ comphelper \
+ i18nisolang1 \
+ stl \
+ cppu \
+ sal \
+ vos3 \
+))
+
+
+$(eval $(call gb_Library_add_exception_objects,spa,\
+ padmin/source/adddlg \
+ padmin/source/cmddlg \
+ padmin/source/fontentry \
+ padmin/source/helper \
+ padmin/source/newppdlg \
+ padmin/source/padialog \
+ padmin/source/progress \
+ padmin/source/prtsetup \
+ padmin/source/titlectrl \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_linked_libs,spa,\
+ dl \
+ m \
+ pthread \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/remotebridges/source/dynamicloader/makefile.mk b/padmin/Makefile
index 9135d2fb26f3..a79aff831024 100755..100644
--- a/remotebridges/source/dynamicloader/makefile.mk
+++ b/padmin/Makefile
@@ -25,45 +25,14 @@
#
#*************************************************************************
-PRJ=..$/..
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
-PRJNAME=remotebridges
-TARGET = dynamicloader.uno
-ENABLE_EXCEPTIONS=TRUE
-COMP1TYPELIST = dynamicloader
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk)))
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-DLLPRE =
-
-# ------------------------------------------------------------------
-
-# use for types from COMP1TYPELIST
-NO_OFFUH=TRUE
-CPPUMAKERFLAGS += -C
-
-SLOFILES= \
- $(SLO)$/dynamicloader.obj
-
-SHL1TARGET= $(TARGET)
-SHL1VERSIONMAP = $(SOLARENV)$/src$/component.map
-
-SHL1STDLIBS=\
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1IMPLIB= i$(TARGET)
-SHL1LIBS=$(SLB)$/$(TARGET).lib
-
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-
-.ENDIF # L10N_framework
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
+# vim: set noet sw=4 ts=4:
diff --git a/bridges/source/remote/context/makefile.mk b/padmin/Module_padmin.mk
index cc2a52355d25..01fd4c99af19 100644
--- a/bridges/source/remote/context/makefile.mk
+++ b/padmin/Module_padmin.mk
@@ -25,41 +25,17 @@
#
#*************************************************************************
-PRJ=..$/..$/..
-PRJNAME=bridges
-TARGET=rmcxt
-ENABLE_EXCEPTIONS=TRUE
-USE_DEFFILE=TRUE
+$(eval $(call gb_Module_Module,padmin))
-UNIXVERSIONNAMES=UDK
+ifeq ($(GUIBASE),unx)
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-# ------------------------------------------------------------------
+$(eval $(call gb_Module_add_targets,padmin,\
+ Executable_spadmin.bin \
+ Library_spa \
+ AllLangResTarget_spa \
+ Package_inc \
+))
+endif
-UNOUCRDEP=$(SOLARUCRDIR)$/uce.rdb
-UNOUCRRDB=$(SOLARUCRDIR)$/uce.rdb
-
-SLOFILES= $(SLO)$/context.obj
-
-SHL1TARGET= $(TARGET)
-
-SHL1STDLIBS= \
- $(SALLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-SHL1RPATH=URELIB
-
-SHL1VERSIONMAP= $(TARGET).map
-
-DEF1NAME= $(SHL1TARGET)
-#DEF1EXPORTFILE= exports.dxp
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
+# vim: set noet sw=4 ts=4:
diff --git a/padmin/Package_inc.mk b/padmin/Package_inc.mk
new file mode 100644
index 000000000000..3a2a3a3177e1
--- /dev/null
+++ b/padmin/Package_inc.mk
@@ -0,0 +1,30 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$(eval $(call gb_Package_Package,padmin_src,$(SRCDIR)/padmin/source))
+$(eval $(call gb_Package_add_file,padmin_src,bin/spadmin,spadmin.sh))
+
diff --git a/padmin/prj/build.lst b/padmin/prj/build.lst
index 9aaab83cf7de..0e505f92f2a2 100644
--- a/padmin/prj/build.lst
+++ b/padmin/prj/build.lst
@@ -1,3 +1,3 @@
pd padmin : vcl svtools NULL
pd padmin usr1 - all pd_mkout NULL
-pd padmin\source nmake - all pd_source NULL
+pd padmin\prj nmake - all pd_prj NULL
diff --git a/padmin/prj/d.lst b/padmin/prj/d.lst
index 3b86822c24e8..8b137891791f 100644
--- a/padmin/prj/d.lst
+++ b/padmin/prj/d.lst
@@ -1,8 +1 @@
-mkdir: %COMMON_DEST%\bin%_EXT%\hid
-..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
-..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res
-..\%__SRC%\bin\*.bin %_DEST%\bin%_EXT%\*.bin
-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
-..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib
-..\%__SRC%\misc\spadmin.sh %_DEST%\bin%_EXT%\spadmin
diff --git a/bridges/source/remote/static/makefile.mk b/padmin/prj/makefile.mk
index 9b3c2b795f8d..c73a3d944bbf 100644
--- a/bridges/source/remote/static/makefile.mk
+++ b/padmin/prj/makefile.mk
@@ -25,37 +25,16 @@
#
#*************************************************************************
-PRJ=..$/..$/..
+PRJ=..
+TARGET=prj
-PRJNAME=bridges
-TARGET=bridges_remote_static
-ENABLE_EXCEPTIONS=TRUE
-USE_DEFFILE=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/proxy.obj \
- $(SLO)$/stub.obj \
- $(SLO)$/remote.obj \
- $(SLO)$/mapping.obj \
- $(SLO)$/helper.obj \
- $(SLO)$/remote_types.obj
-
-# Forte6 update 1 on Solaris Intel dies with internal compiler error
-# on stub.cxx if optimization is on. Switch it off for now.
-# To be reevaluated on compiler upgrade
-.IF "$(OS)$(CPU)"=="SOLARISI"
-NOOPTFILES=\
- $(SLO)$/stub.obj
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
+.INCLUDE : settings.mk
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+all:
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET)
diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx
index b78bee96672d..5b7b710679a8 100644
--- a/padmin/source/helper.hxx
+++ b/padmin/source/helper.hxx
@@ -46,6 +46,13 @@
#endif
#include <vcl/combobox.hxx>
+#if defined SPA_DLLIMPLEMENTATION
+#define SPA_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SPA_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
+
class Config;
#define PSPRINT_PPDDIR "driver"
diff --git a/padmin/source/makefile.mk b/padmin/source/makefile.mk
deleted file mode 100644
index 8bcbd51ef832..000000000000
--- a/padmin/source/makefile.mk
+++ /dev/null
@@ -1,115 +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.
-#
-#*************************************************************************
-
-.IF "$(GUIBASE)"=="aqua"
-
-dummy:
- @echo "Nothing to build for GUIBASE aqua."
-
-.ELSE
-
-PRJ=..
-PRJNAME=padmin
-TARGET=padmin
-TARGETTYPE=GUI
-ENABLE_EXCEPTIONS=TRUE
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-# --- Files --------------------------------------------------------
-
-SRS1NAME=$(TARGET)
-SRC1FILES=padialog.src rtsetup.src
-
-RESLIB1NAME=spa
-RESLIB1IMAGES=$(PRJ)$/source
-RESLIB1SRSFILES= $(SRS)$/padmin.srs
-RESLIB1DEPN=\
- padialog.src \
- padialog.hrc \
- rtsetup.src \
- rtsetup.hrc
-
-.IF "$(GUI)" == "UNX"
-
-SLOFILES=\
- $(SLO)$/padialog.obj \
- $(SLO)$/cmddlg.obj \
- $(SLO)$/progress.obj \
- $(SLO)$/newppdlg.obj \
- $(SLO)$/prtsetup.obj \
- $(SLO)$/fontentry.obj \
- $(SLO)$/helper.obj \
- $(SLO)$/adddlg.obj \
- $(SLO)$/titlectrl.obj
-
-
-OBJFILES=\
- $(OBJ)/pamain.obj
-
-SHL1TARGET= spa$(DLLPOSTFIX)
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(SVTOOLLIB) \
- $(VCLLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-APP1TARGET=spadmin.bin
-APP1DEPN+=$(SHL1TARGETN)
-
-APP1OBJS=\
- $(OBJ)$/desktopcontext.obj \
- $(OBJ)/pamain.obj
-
-APP1STDLIBS= \
- -l$(SHL1TARGET) \
- $(VCLLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-UNIXTEXT = $(MISC)$/spadmin.sh
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.ENDIF # GUIBASE==aqua
-
diff --git a/padmin/source/padialog.hxx b/padmin/source/padialog.hxx
index 88086e9497de..a0cee7b2af7d 100644
--- a/padmin/source/padialog.hxx
+++ b/padmin/source/padialog.hxx
@@ -50,7 +50,7 @@ class Printer;
namespace padmin {
- class PADialog : public ModalDialog
+ class SPA_DLLPUBLIC PADialog : public ModalDialog
{
private:
DelListBox m_aDevicesLB;
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index 09ce29a2c682..85191f3dddf9 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -483,47 +483,47 @@ String RID_YOU_SURE
Bitmap RID_BUTTERFLY
{
- File = "butter.png" ;
+ File = "source/butter.png" ;
};
Bitmap RID_BMP_SMALL_PRINTER
{
- File = "print.png";
+ File = "source/print.png";
};
Bitmap RID_BMP_SMALL_FAX
{
- File = "fax.png";
+ File = "source/fax.png";
};
Bitmap RID_BMP_SMALL_PDF
{
- File = "pdf.png";
+ File = "source/pdf.png";
};
Bitmap RID_BMP_PRINTER
{
- File = "printer_large.png";
+ File = "source/printer_large.png";
};
Bitmap RID_BMP_SMALL_PRINTER_HC
{
- File = "printer_16_h.png";
+ File = "source/printer_16_h.png";
};
Bitmap RID_BMP_SMALL_FAX_HC
{
- File = "fax_16_h.png";
+ File = "source/fax_16_h.png";
};
Bitmap RID_BMP_SMALL_PDF_HC
{
- File = "printpdf_16_h.png";
+ File = "source/printpdf_16_h.png";
};
Bitmap RID_BMP_PRINTER_HC
{
- File = "printer_40x48_h.png";
+ File = "source/printer_40x48_h.png";
};
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 2ec2707a2bcc..ad73d48ae48b 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -802,7 +802,7 @@ OString RTSPWDialog::getPassword() const
extern "C" {
- int Sal_SetupPrinterDriver( ::psp::PrinterInfo& rJobData )
+ int SPA_DLLPUBLIC Sal_SetupPrinterDriver( ::psp::PrinterInfo& rJobData )
{
int nRet = 0;
RTSDialog aDialog( rJobData, rJobData.m_aPrinterName, false );
@@ -816,14 +816,14 @@ extern "C" {
return nRet;
}
- int Sal_queryFaxNumber( String& rNumber )
+ int SPA_DLLPUBLIC Sal_queryFaxNumber( String& rNumber )
{
String aTmpString( PaResId( RID_TXT_QUERYFAXNUMBER ) );
QueryString aQuery( NULL, aTmpString, rNumber );
return aQuery.Execute();
}
- bool Sal_authenticateQuery( const OString& rServer, OString& rUserName, OString& rPassword )
+ bool SPA_DLLPUBLIC Sal_authenticateQuery( const OString& rServer, OString& rUserName, OString& rPassword )
{
bool bRet = false;
diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk
index 9fbfc70e11a2..49fa9e19d908 100644
--- a/postprocess/packcomponents/makefile.mk
+++ b/postprocess/packcomponents/makefile.mk
@@ -171,6 +171,7 @@ my_components = \
utl \
uui \
vbaobj \
+ vbaevents \
vcl \
vclcanvas \
wpft \
@@ -231,10 +232,6 @@ my_components += ogltrans
my_components += productregistration.jar
.END
-.IF "$(ENABLE_VBA)" == "YES"
-my_components += vbaevents
-.END
-
.IF "$(SOLAR_JAVA)" == "TRUE"
my_components += \
LuceneHelpWrapper \
diff --git a/readlicense_oo/prj/build.lst b/readlicense_oo/prj/build.lst
index 987672db4ebe..bf438e28fe1d 100644
--- a/readlicense_oo/prj/build.lst
+++ b/readlicense_oo/prj/build.lst
@@ -1,4 +1,4 @@
-ro readlicense_oo : l10n solenv LIBXSLT:libxslt NULL
+ro readlicense_oo : L10N:l10n solenv LIBXSLT:libxslt NULL
ro readlicense_oo usr1 - all ro_root NULL
ro readlicense_oo\docs\readme nmake - all ro_readme NULL
ro readlicense_oo\html nmake - all ro_html NULL
diff --git a/remotebridges/prj/build.lst b/remotebridges/prj/build.lst
index a1f16dbd60d2..5f2a661dd5de 100644
--- a/remotebridges/prj/build.lst
+++ b/remotebridges/prj/build.lst
@@ -1,6 +1,2 @@
-rb remotebridges : LIBXSLT:libxslt bridges rdbmaker NULL
-rb remotebridges usr1 - all rb_mkout NULL
-rb remotebridges\source\bridge nmake - all rb_iiop NULL
-rb remotebridges\source\factory nmake - all rb_factory NULL
+rb remotebridges : LIBXSLT:libxslt cppu cppuhelper offuh rdbmaker sal NULL
rb remotebridges\source\unourl_resolver nmake - all rb_urlresolv NULL
-rb remotebridges\source\dynamicloader nmake - all rb_dynloader NULL
diff --git a/remotebridges/prj/d.lst b/remotebridges/prj/d.lst
index b304680e2d6e..b8b46ae7089c 100644..100755
--- a/remotebridges/prj/d.lst
+++ b/remotebridges/prj/d.lst
@@ -1,20 +1,4 @@
-..\%__SRC%\bin\bridgefa*.dll %_DEST%\bin%_EXT%\bridgefa*.dll
-..\%__SRC%\bin\remotebr*.dll %_DEST%\bin%_EXT%\remotebr*.dll
-..\%__SRC%\bin\dynamicl*.dll %_DEST%\bin%_EXT%\dynamicl*.dll
-..\%__SRC%\bin\uuresolv*.dll %_DEST%\bin%_EXT%\uuresolv*.dll
-..\%__SRC%\bin\brdgfctr.rdb %_DEST%\rdb%_EXT%\brdgfctr.rdb
-..\%__SRC%\bin\remotebridge.rdb %_DEST%\rdb%_EXT%\remotebridge.rdb
-..\%__SRC%\bin\dynamicloader.rdb %_DEST%\rdb%_EXT%\dynamicloader.rdb
-..\%__SRC%\bin\uuresolver.rdb %_DEST%\rdb%_EXT%\uuresolver.rdb
-..\source\factory\brdgfctr.xml %_DEST%\xml%_EXT%\bridgefac.uno.xml
-..\source\bridge\remotebridge.xml %_DEST%\xml%_EXT%\remotebridge.uno.xml
-..\source\dynamicloader\dynamicloader.xml %_DEST%\xml%_EXT%\dynamicloader.uno.xml
-..\source\unourl_resolver\uuresolver.xml %_DEST%\xml%_EXT%\uuresolver.uno.xml
-..\%__SRC%\lib\bridgefac.uno.so %_DEST%\lib%_EXT%\bridgefac.uno.so
-..\%__SRC%\lib\remotebridge.uno.so %_DEST%\lib%_EXT%\remotebridge.uno.so
-..\%__SRC%\lib\dynamicloader.uno.so %_DEST%\lib%_EXT%\dynamicloader.uno.so
+..\%__SRC%\bin\uuresolver.uno.dll %_DEST%\bin%_EXT%\uuresolver.uno.dll
+..\%__SRC%\lib\uuresolver.uno.dylib %_DEST%\lib%_EXT%\uuresolver.uno.dylib
..\%__SRC%\lib\uuresolver.uno.so %_DEST%\lib%_EXT%\uuresolver.uno.so
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*
-..\%__SRC%\misc\bridgefac.component %_DEST%\xml%_EXT%\bridgefac.component
-..\%__SRC%\misc\remotebridge.component %_DEST%\xml%_EXT%\remotebridge.component
..\%__SRC%\misc\uuresolver.component %_DEST%\xml%_EXT%\uuresolver.component
diff --git a/remotebridges/source/bridge/bridge_connection.cxx b/remotebridges/source/bridge/bridge_connection.cxx
deleted file mode 100644
index 063b30af14bf..000000000000
--- a/remotebridges/source/bridge/bridge_connection.cxx
+++ /dev/null
@@ -1,139 +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 "bridge_connection.hxx"
-#include "remote_bridge.hxx"
-#include <rtl/byteseq.hxx>
-#include <string.h>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::connection;
-
-namespace remotebridges_bridge
-{
- OConnectionWrapper::OConnectionWrapper( const Reference < XConnection > &r ) :
- m_r( r ),
- m_nRef( 0 )
- {
- g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
- acquire = thisAcquire;
- release = thisRelease;
- read = thisRead;
- write = thisWrite;
- flush = thisFlush;
- close = thisClose;
- }
-
- OConnectionWrapper::~OConnectionWrapper()
- {
- g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
-}
-
- void OConnectionWrapper::thisAcquire( remote_Connection *p)
- {
- OConnectionWrapper * m = ( OConnectionWrapper * ) p;
- osl_incrementInterlockedCount( &(m->m_nRef ) );
- }
-
- void OConnectionWrapper::thisRelease( remote_Connection * p)
- {
- OConnectionWrapper * m = ( OConnectionWrapper * ) p;
- if( ! osl_decrementInterlockedCount( &( m->m_nRef ) ) )
- {
- delete m;
- }
- }
-
- sal_Int32 OConnectionWrapper::thisRead( remote_Connection *p , sal_Int8 *pDest , sal_Int32 nSize )
- {
- // guard the C-Code
- OConnectionWrapper * m = ( OConnectionWrapper * ) p;
- try
- {
- // TODO possible optimization : give
- Sequence<sal_Int8> seq = toUnoSequence( ::rtl::ByteSequence(nSize, ::rtl::BYTESEQ_NODEFAULT) );
- sal_Int32 nRead = m->m_r->read( seq , nSize );
- memcpy( pDest , seq.getConstArray() , nRead );
- return nRead;
- }
- catch ( Exception & )
- {
- return 0;
- }
- catch (::std::bad_alloc &)
- {
- return 0;
- }
- }
-
- sal_Int32 OConnectionWrapper::thisWrite( remote_Connection *p ,
- const sal_Int8 *pSource ,
- sal_Int32 nSize )
- {
- // guard the C-Code
- OConnectionWrapper * m = ( OConnectionWrapper * ) p;
- try
- {
- Sequence< sal_Int8 > seq( pSource , nSize );
- m->m_r->write( seq );
- return nSize;
- }
- catch ( Exception & )
- {
- return 0;
- }
- }
-
- void OConnectionWrapper::thisFlush( remote_Connection *p )
- {
- // guard the C-Code
- try
- {
- OConnectionWrapper * m = ( OConnectionWrapper * ) p;
- m->m_r->flush();
- }
- catch ( Exception & )
- {
- }
- }
-
- void OConnectionWrapper::thisClose( remote_Connection * p)
- {
- // guard the C-Code
- try
- {
- OConnectionWrapper * m = ( OConnectionWrapper * ) p;
- m->m_r->close();
- }
- catch( Exception & )
- {
-
- }
- }
-}
-
-
-
diff --git a/remotebridges/source/bridge/bridge_connection.hxx b/remotebridges/source/bridge/bridge_connection.hxx
deleted file mode 100644
index f105fd8e32ee..000000000000
--- a/remotebridges/source/bridge/bridge_connection.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <osl/interlck.h>
-
-#include <bridges/remote/connection.h>
-
-#include <com/sun/star/connection/XConnection.hpp>
-
-namespace remotebridges_bridge
-{
-
- class OConnectionWrapper :
- public remote_Connection
- {
- public:
- OConnectionWrapper( const ::com::sun::star::uno::Reference <
- ::com::sun::star::connection::XConnection > & );
- ~OConnectionWrapper();
-
- static void SAL_CALL thisAcquire( remote_Connection *);
- static void SAL_CALL thisRelease( remote_Connection *);
- static sal_Int32 SAL_CALL thisRead( remote_Connection * , sal_Int8 *pDest , sal_Int32 nSize );
- static sal_Int32 SAL_CALL thisWrite( remote_Connection * ,
- const sal_Int8 *pSource ,
- sal_Int32 nSize );
- static void SAL_CALL thisFlush( remote_Connection * );
- static void SAL_CALL thisClose( remote_Connection * );
-
- ::com::sun::star::uno::Reference < ::com::sun::star::connection::XConnection > m_r;
- oslInterlockedCount m_nRef;
- };
-}
-
diff --git a/remotebridges/source/bridge/bridge_provider.cxx b/remotebridges/source/bridge/bridge_provider.cxx
deleted file mode 100644
index 1915df35ab31..000000000000
--- a/remotebridges/source/bridge/bridge_provider.cxx
+++ /dev/null
@@ -1,179 +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 <stdio.h>
-
-#include "remote_bridge.hxx"
-
-#include <osl/diagnose.h>
-#include <rtl/ustrbuf.hxx>
-
-#include <uno/mapping.hxx>
-#include <uno/environment.h>
-
-#include <bridges/remote/remote.h>
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::bridge;
-
-namespace remotebridges_bridge
-{
-
- OInstanceProviderWrapper::OInstanceProviderWrapper(
- const Reference <XInstanceProvider > & rProvider,
- ORemoteBridge * pBridgeCallback ) :
- m_rProvider( rProvider ),
- m_nRef( 0 ),
- m_pBridgeCallback( pBridgeCallback )
- {
- g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
- acquire = thisAcquire;
- release = thisRelease;
- getInstance = thisGetInstance;
- }
-
- OInstanceProviderWrapper::~OInstanceProviderWrapper()
- {
- g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
- }
-
- void OInstanceProviderWrapper::thisAcquire( remote_InstanceProvider *p )
- {
- OInstanceProviderWrapper * m = (OInstanceProviderWrapper *) p;
- osl_incrementInterlockedCount( &(m->m_nRef ) );
- }
-
- void OInstanceProviderWrapper::thisRelease( remote_InstanceProvider *p )
- {
- OInstanceProviderWrapper * m = ( OInstanceProviderWrapper *) p;
- if( ! osl_decrementInterlockedCount( &(m->m_nRef ) ) )
- {
- delete m;
- }
- }
-
- static void convertToRemoteRuntimeException ( uno_Any **ppException,
- const ::rtl::OUString &sMessage,
- const Reference< XInterface > &rContext,
- Mapping &map )
- {
-
- uno_type_any_construct( *ppException ,
- 0 ,
- getCppuType( (RuntimeException *)0 ).getTypeLibType() ,
- 0 );
-
- typelib_CompoundTypeDescription * pCompType = 0 ;
- getCppuType( (Exception*)0 ).getDescription( (typelib_TypeDescription **) &pCompType );
- if( ! ((typelib_TypeDescription *)pCompType)->bComplete )
- {
- typelib_typedescription_complete( (typelib_TypeDescription**) &pCompType );
- }
-
- char *pValue = (char*) (*ppException)->pData;
- rtl_uString_assign( (rtl_uString ** ) pValue , sMessage.pData );
-
- *((remote_Interface**) pValue+pCompType->pMemberOffsets[1]) =
- (remote_Interface*) map.mapInterface(
- rContext.get(), getCppuType( &rContext) );
-
- typelib_typedescription_release( (typelib_TypeDescription *) pCompType );
- }
-
- void OInstanceProviderWrapper::thisGetInstance(
- remote_InstanceProvider * pProvider ,
- uno_Environment *pEnvRemote,
- remote_Interface **ppRemoteI,
- rtl_uString *pInstanceName,
- typelib_InterfaceTypeDescription *pType,
- uno_Any **ppException
- )
- {
- OInstanceProviderWrapper * m = (OInstanceProviderWrapper *)pProvider;
-
- OSL_ASSERT( ppRemoteI );
- if( *ppRemoteI )
- {
- (*ppRemoteI)->release( *ppRemoteI );
- *ppRemoteI = 0;
- }
-
- OUString sCppuName( RTL_CONSTASCII_USTRINGPARAM( CPPU_CURRENT_LANGUAGE_BINDING_NAME ) );
-
- uno_Environment *pEnvThis = 0;
- uno_getEnvironment( &pEnvThis ,
- sCppuName.pData ,
- 0 );
- Mapping map( pEnvThis , pEnvRemote );
- pEnvThis->release( pEnvThis );
-
- if( OUString( pType->aBase.pTypeName ) ==
- getCppuType( (Reference<XInterface>*)0).getTypeName() )
- {
- try
- {
- Reference< XInterface > r = m->m_rProvider->getInstance(
- OUString( pInstanceName ) );
-
- *ppRemoteI = (remote_Interface*) map.mapInterface (
- r.get(),
- getCppuType( (Reference< XInterface > *) 0 )
- );
-
- if( *ppRemoteI && m->m_pBridgeCallback )
- {
- m->m_pBridgeCallback->objectMappedSuccesfully();
- m->m_pBridgeCallback = 0;
- }
- *ppException = 0;
- }
- catch( ::com::sun::star::container::NoSuchElementException &e )
- {
- // NoSuchElementException not specified, so convert it to a runtime exception
- convertToRemoteRuntimeException(
- ppException , e.Message.pData , e.Context.get(), map );
- }
- catch( ::com::sun::star::uno::RuntimeException &e )
- {
- convertToRemoteRuntimeException(
- ppException , e.Message.pData , e.Context.get(), map );
- }
-
- }
- else
- {
- OUStringBuffer msg;
- msg.appendAscii(
- RTL_CONSTASCII_STRINGPARAM(
- "getInstance expected XInterface but got "));
- msg.append(pType->aBase.pTypeName);
- convertToRemoteRuntimeException(
- ppException, msg.getStr(), Reference< XInterface >(), map);
- }
- }
-}
diff --git a/remotebridges/source/bridge/makefile.mk b/remotebridges/source/bridge/makefile.mk
deleted file mode 100644
index 2a5ea130d744..000000000000
--- a/remotebridges/source/bridge/makefile.mk
+++ /dev/null
@@ -1,72 +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=..$/..
-
-PRJNAME=remotebridges
-TARGET = remotebridge.uno
-ENABLE_EXCEPTIONS=TRUE
-COMP1TYPELIST = remotebridge
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-DLLPRE =
-# ------------------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/remote_bridge.obj \
- $(SLO)$/bridge_connection.obj\
- $(SLO)$/bridge_provider.obj
-SHL1TARGET= $(TARGET)
-SHL1VERSIONMAP = $(SOLARENV)/src/unloadablecomponent.map
-
-SHL1STDLIBS= \
- $(SALLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(RMCXTLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(TARGET)
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-SHL1RPATH= URELIB
-
-DEF1NAME= $(SHL1TARGET)
-.ENDIF # L10N_framework
-
-# --- Targets ------------------------------------------------------
-.INCLUDE : target.mk
-
-ALLTAR : $(MISC)/remotebridge.component
-
-$(MISC)/remotebridge.component .ERRREMOVE : \
- $(SOLARENV)/bin/createcomponent.xslt remotebridge.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_URE_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt remotebridge.component
diff --git a/remotebridges/source/bridge/remote_bridge.cxx b/remotebridges/source/bridge/remote_bridge.cxx
deleted file mode 100644
index 5f2c9ce3bc0e..000000000000
--- a/remotebridges/source/bridge/remote_bridge.cxx
+++ /dev/null
@@ -1,470 +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 <stdio.h>
-
-#include "remote_bridge.hxx"
-#include "bridge_connection.hxx"
-#include <cppuhelper/implementationentry.hxx>
-
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/bridge/BridgeExistsException.hpp>
-
-#define IMPLEMENTATION_NAME "com.sun.star.comp.remotebridges.Bridge.various"
-
-
-using namespace ::rtl;
-using namespace ::cppu;
-using namespace ::osl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::bridge;
-using namespace ::com::sun::star::registry;
-using namespace ::com::sun::star::connection;
-
-namespace remotebridges_bridge
-{
- rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
-
- ORemoteBridge::ORemoteBridge() :
- OComponentHelper( m_mutex ),
- m_pContext( 0 ),
- m_pEnvRemote(0 )
- {
- g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
- remote_DisposingListener::acquire = thisAcquire;
- remote_DisposingListener::release = thisRelease;
- remote_DisposingListener::disposing = thisDisposing;
- }
-
- ORemoteBridge::~ORemoteBridge()
- {
- if( m_pContext )
- {
- m_pContext->aBase.release( (uno_Context *) m_pContext );
- }
- if( m_pEnvRemote )
- {
- m_pEnvRemote->release( m_pEnvRemote );
- }
- g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
- }
-
- void ORemoteBridge::objectMappedSuccesfully()
- {
- MutexGuard guard( m_mutex );
-
- if( m_pEnvRemote )
- {
- m_pEnvRemote->release( m_pEnvRemote );
- m_pEnvRemote = 0;
- }
- }
-
- Any ORemoteBridge::queryInterface( const Type & aType ) throw(RuntimeException)
- {
- Any a = ::cppu::queryInterface(
- aType ,
- SAL_STATIC_CAST( XInitialization * , this ) ,
- SAL_STATIC_CAST( XBridge * , this ),
- SAL_STATIC_CAST( XTypeProvider * , this ) );
- if( a.hasValue() )
- {
- return a;
- }
-
- return OComponentHelper::queryInterface( aType );
- }
-
-
- void ORemoteBridge::initialize( const Sequence< Any >& aArguments )
- throw( Exception, RuntimeException)
- {
-
- MutexGuard guard( m_mutex );
-
- if( 4 != aArguments.getLength() )
- {
- throw IllegalArgumentException( rtl::OUString::createFromAscii("wrong number of arguments") ,
- Reference< XInterface >(),
- 0 );
- }
-
- OUString swName;
- OUString swProtocol;
- Reference < XConnection > rConnection;
- Reference < XInstanceProvider > rProvider;
-
- aArguments.getConstArray()[0] >>= swName;
- aArguments.getConstArray()[1] >>= swProtocol;
- aArguments.getConstArray()[2] >>= rConnection;
- aArguments.getConstArray()[3] >>= rProvider;
-
- if( ! rConnection.is() )
- {
- throw IllegalArgumentException( rtl::OUString::createFromAscii("connection is missing") ,
- Reference < XInterface > (),
- 2 );
- }
-
- remote_Connection *pConnection = new OConnectionWrapper( rConnection );
- remote_InstanceProvider *pProvider = 0;
- if( rProvider.is( ))
- {
- pProvider = new OInstanceProviderWrapper( rProvider , this );
- }
-
- OUString sName = swName;
- m_sDescription = swProtocol;
- m_sDescription += OUString( RTL_CONSTASCII_USTRINGPARAM(":"));
- m_sDescription += rConnection->getDescription();
-
- if( 0 == sName.getLength() )
- {
- sName = m_sDescription;
- }
- else
- {
- m_sName = sName;
- }
-
- m_pContext = remote_createContext( pConnection,
- sName.pData,
- m_sDescription.pData,
- swProtocol.pData,
- pProvider );
- if( ! m_pContext )
- {
- throw BridgeExistsException();
- }
-
- m_pContext->addDisposingListener( m_pContext ,
- (remote_DisposingListener *) this );
-
- // environment will be released by the first succesfull mapping
- OUString sRemoteEnv;
- if( swProtocol.indexOf( ',') == -1 )
- {
- sRemoteEnv = swProtocol;
- }
- else
- {
- sRemoteEnv = swProtocol.copy( 0 , swProtocol.indexOf( ',' ) );
- }
- m_sProtocol = sRemoteEnv;
- uno_getEnvironment( &m_pEnvRemote ,
- sRemoteEnv.pData ,
- m_pContext );
- if( ! m_pEnvRemote )
- {
- m_pContext->removeDisposingListener( m_pContext ,
- (remote_DisposingListener*) this );
- m_pContext->aBase.release( (uno_Context * ) m_pContext );
- m_pContext = 0;
-
- // forgotten exception when specifying the interface
- throw RuntimeException( rtl::OUString::createFromAscii("couldn't create uno-remote-environment") ,
- Reference < XInterface > () );
- }
- }
-
- Reference< XInterface > ORemoteBridge::getInstance( const ::rtl::OUString& sInstanceName )
- throw(::com::sun::star::uno::RuntimeException)
- {
- Reference < XInterface > rReturn;
-
- remote_Context *pContext = 0;
- {
- MutexGuard guard( m_mutex );
- if( m_pContext && m_pContext->getRemoteInstance )
- {
- pContext = m_pContext;
- pContext->aBase.acquire( (uno_Context*)pContext );
- }
- }
- if( pContext )
- {
- // get the appropriate remote environment
- uno_Environment *pEnvRemote = 0;
- uno_getEnvironment( &pEnvRemote , m_sProtocol.pData , pContext );
-
- if( ! pEnvRemote )
- {
- pContext->aBase.release( (uno_Context*) pContext );
- throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "RemoteBridge: bridge already disposed" ) ),
- Reference< XInterface > () );
- }
-
- Type type = getCppuType( (Reference < XInterface > * ) 0 );
-
- remote_Interface *pRemoteI = 0;
- uno_Any exception;
- uno_Any *pException = &exception;
-
- pContext->getRemoteInstance(
- pEnvRemote,
- &pRemoteI,
- sInstanceName.pData,
- type.getTypeLibType(),
- &pException );
- pContext->aBase.release( (uno_Context*) pContext );
- pContext = 0;
-
- uno_Environment *pEnvCpp =0;
- OUString sCppuName( RTL_CONSTASCII_USTRINGPARAM( CPPU_CURRENT_LANGUAGE_BINDING_NAME ) );
- uno_getEnvironment( &pEnvCpp ,
- sCppuName.pData ,
- 0 );
- Mapping map( pEnvRemote , pEnvCpp );
-
- pEnvCpp->release( pEnvCpp );
- pEnvRemote->release( pEnvRemote );
-
- if( pException )
- {
- typelib_CompoundTypeDescription * pCompType = 0 ;
- getCppuType( (Exception*)0 ).getDescription( (typelib_TypeDescription **) &pCompType );
-
- if( ! ((typelib_TypeDescription *)pCompType)->bComplete )
- {
- typelib_typedescription_complete( (typelib_TypeDescription**) &pCompType );
- }
- XInterface *pXInterface = (XInterface *) map.mapInterface(
- *(remote_Interface**) ( ((char*)pException->pData)+pCompType->pMemberOffsets[1] ),
- getCppuType( (Reference< XInterface > *)0 ) );
- RuntimeException myException(
- *((rtl_uString **)pException->pData),
- Reference< XInterface > ( pXInterface , SAL_NO_ACQUIRE) );
- uno_any_destruct( pException , 0 );
-
- throw myException;
- }
- else if( pRemoteI )
- {
- // got an interface !
- XInterface * pCppI = ( XInterface * ) map.mapInterface( pRemoteI, type );
- rReturn = Reference<XInterface > ( pCppI, SAL_NO_ACQUIRE );
- pRemoteI->release( pRemoteI );
- objectMappedSuccesfully();
- }
- }
- else
- {
- throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "RemoteBridge: bridge already disposed." ) ),
- Reference< XInterface > () );
- }
-
- return rReturn;
- }
-
-
- ::rtl::OUString SAL_CALL ORemoteBridge::getName( )
- throw(::com::sun::star::uno::RuntimeException)
- {
- return m_sName;
- }
-
- ::rtl::OUString SAL_CALL ORemoteBridge::getDescription( )
- throw(::com::sun::star::uno::RuntimeException)
- {
- return m_sDescription;
- }
-
- // XTypeProvider
- Sequence< Type > SAL_CALL ORemoteBridge::getTypes(void) throw( RuntimeException )
- {
- static OTypeCollection *pCollection = 0;
- if( ! pCollection )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pCollection )
- {
- static OTypeCollection collection(
- getCppuType( (Reference< XTypeProvider> * )0),
- getCppuType( (Reference< XBridge > * ) 0 ),
- getCppuType( (Reference< XInitialization > * ) 0 ),
- OComponentHelper::getTypes() );
- pCollection = &collection;
- }
- }
-
- return (*pCollection).getTypes();
- }
-
- Sequence< sal_Int8 > SAL_CALL ORemoteBridge::getImplementationId( ) throw( RuntimeException)
- {
- static OImplementationId *pId = 0;
- if( ! pId )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pId )
- {
- static OImplementationId id( sal_False );
- pId = &id;
- }
- }
- return (*pId).getImplementationId();
- }
-
- void ORemoteBridge::disposing()
- {
- MutexGuard guard( m_mutex );
- if( m_pContext )
- {
- m_pContext->removeDisposingListener( m_pContext , ( remote_DisposingListener * )this);
- if( ! m_pEnvRemote )
- {
- if( m_pContext->m_pConnection )
- {
- sal_Int32 nIndex = 0;
- OUString sProtocol = OUString( m_pContext->m_pProtocol ).getToken( 0 , ',' , nIndex );
- uno_getEnvironment( &m_pEnvRemote , sProtocol.pData , m_pContext );
- OSL_ASSERT( m_pEnvRemote );
- }
- else
- {
- // within disposing from the context, no further dispose necessary !
- }
- }
-
- if( m_pEnvRemote )
- {
- m_pEnvRemote->dispose( m_pEnvRemote );
- m_pEnvRemote->release( m_pEnvRemote );
- m_pEnvRemote = 0;
- }
-
- m_pContext->aBase.release( (uno_Context*)m_pContext );
- m_pContext = 0;
- }
- }
-
-
- //----------------------
- // static methods
- //----------------------
- void ORemoteBridge::thisAcquire( remote_DisposingListener *p )
- {
- ORemoteBridge *m = (ORemoteBridge * ) p;
- m->acquire();
- }
-
- void ORemoteBridge::thisRelease( remote_DisposingListener *p )
- {
- ORemoteBridge *m = (ORemoteBridge * ) p;
- m->release();
- }
-
- void ORemoteBridge::thisDisposing( remote_DisposingListener * p,
- rtl_uString * )
- {
- ORemoteBridge *m = (ORemoteBridge * ) p;
- m->dispose();
- }
-
- //---------------------------------
- //
- //---------------------------------
- Reference< XInterface > SAL_CALL CreateInstance( const Reference< XComponentContext > &)
- {
- return Reference< XInterface > ( ( OWeakObject * ) new ORemoteBridge );
- }
-
- OUString getImplementationName()
- {
- static OUString *pImplName = 0;
- if( ! pImplName )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pImplName )
- {
- static OUString implName(
- RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
- pImplName = &implName;
- }
- }
- return *pImplName;
- }
-
- Sequence< OUString > getSupportedServiceNames()
- {
- static Sequence < OUString > *pNames = 0;
- if( ! pNames )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( !pNames )
- {
- static Sequence< OUString > seqNames(3);
- seqNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.bridge.Bridge" );
- seqNames.getArray()[1] = OUString::createFromAscii( "com.sun.star.bridge.IiopBridge" );
- seqNames.getArray()[2] = OUString::createFromAscii( "com.sun.star.bridge.UrpBridge" );
-
- pNames = &seqNames;
- }
- }
- return *pNames;
- }
-}
-
-using namespace remotebridges_bridge;
-
-static struct ImplementationEntry g_entries[] =
-{
- {
- remotebridges_bridge::CreateInstance, remotebridges_bridge::getImplementationName,
- remotebridges_bridge::getSupportedServiceNames, createSingleComponentFactory,
- &g_moduleCount.modCnt , 0
- },
- { 0, 0, 0, 0, 0, 0 }
-};
-
-extern "C"
-{
-sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
-{
- return g_moduleCount.canUnload( &g_moduleCount , pTime );
-}
-
-//==================================================================================================
-void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-//==================================================================================================
-void * SAL_CALL component_getFactory(
- const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
- return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
-}
-}
-
-
-
-
-
diff --git a/remotebridges/source/bridge/remote_bridge.hxx b/remotebridges/source/bridge/remote_bridge.hxx
deleted file mode 100644
index 20b5e1a31034..000000000000
--- a/remotebridges/source/bridge/remote_bridge.hxx
+++ /dev/null
@@ -1,147 +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 <osl/mutex.hxx>
-#include <osl/diagnose.h>
-
-#include <uno/mapping.hxx>
-#include <uno/environment.h>
-
-#include <bridges/remote/context.h>
-#include <bridges/remote/remote.h>
-
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/component.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-
-#include <com/sun/star/bridge/XBridge.hpp>
-#include <com/sun/star/bridge/XInstanceProvider.hpp>
-
-
-namespace remotebridges_bridge
-{
- extern rtl_StandardModuleCount g_moduleCount;
-
- struct MyMutex
- {
- ::osl::Mutex m_mutex;
- };
-
- class ORemoteBridge :
- public MyMutex,
- public remote_DisposingListener,
- public ::com::sun::star::lang::XInitialization,
- public ::com::sun::star::bridge::XBridge,
- public ::cppu::OComponentHelper
- {
- public:
- ORemoteBridge();
- ~ORemoteBridge();
-
- // XInterface
- public:
- ::com::sun::star::uno::Any SAL_CALL
- queryInterface( const ::com::sun::star::uno::Type & aType ) throw(::com::sun::star::uno::RuntimeException);
-
- void SAL_CALL acquire() throw()
- { OComponentHelper::acquire(); }
- void SAL_CALL release() throw()
- { OComponentHelper::release(); }
-
- public:
- virtual void SAL_CALL disposing(); // called by OComponentHelper
-
- public:
- // Methods
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& aArguments )
- throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- public:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
- getInstance( const ::rtl::OUString& sInstanceName )
- throw(::com::sun::star::uno::RuntimeException);
-
- virtual ::rtl::OUString SAL_CALL getName( )
- throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDescription( )
- throw(::com::sun::star::uno::RuntimeException);
-
- public:
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
- getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
- getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
-
- public:
- static void SAL_CALL thisAcquire( remote_DisposingListener * );
- static void SAL_CALL thisRelease( remote_DisposingListener * );
- static void SAL_CALL thisDisposing( remote_DisposingListener * ,
- rtl_uString * pBridgeName );
-
- public:
- void objectMappedSuccesfully();
-
- public:
- remote_Context *m_pContext;
- uno_Environment *m_pEnvRemote;
- ::rtl::OUString m_sName;
- ::rtl::OUString m_sDescription;
- ::rtl::OUString m_sProtocol;
- };
-
- class OInstanceProviderWrapper :
- public remote_InstanceProvider
- {
- public:
- OInstanceProviderWrapper( const ::com::sun::star::uno::Reference <
- ::com::sun::star::bridge::XInstanceProvider > & rProvider ,
- ORemoteBridge * pBridgeCallback );
-
- ~OInstanceProviderWrapper();
- public:
- static void SAL_CALL thisAcquire( remote_InstanceProvider * );
- static void SAL_CALL thisRelease( remote_InstanceProvider * );
- static void SAL_CALL thisGetInstance( remote_InstanceProvider * pProvider ,
- uno_Environment *pEnvRemote,
- remote_Interface **ppRemoteI,
- rtl_uString *pInstanceName,
- typelib_InterfaceTypeDescription *pType,
- uno_Any **ppException );
-
- private:
- ::com::sun::star::uno::Reference <
- ::com::sun::star::bridge::XInstanceProvider > m_rProvider;
- oslInterlockedCount m_nRef;
- ORemoteBridge *m_pBridgeCallback;
- };
-
-}
-
diff --git a/remotebridges/source/bridge/remotebridge.xml b/remotebridges/source/bridge/remotebridge.xml
deleted file mode 100644
index be5e60b59eef..000000000000
--- a/remotebridges/source/bridge/remotebridge.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> remotebridge.uno </module-name>
- <component-description>
- <author> Joerg Budischewski </author>
- <name> com.sun.star.comp.remotebridges.Bridge.various </name>
- <description>
- This component initializes the bridge between two processes
- using either iiop or urp (UnoRemoteProtocol) protocol.
- </description>
- <loader-name> com.sun.star.loader.SharedLibrary </loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.bridge.Bridge </supported-service>
- <supported-service> com.sun.star.bridge.IiopBridge </supported-service>
- <supported-service> com.sun.star.bridge.UrpBridge </supported-service>
- <service-dependency> ... </service-dependency>
- <type> com.sun.star.bridge.XBridgeFactory </type>
- <type> com.sun.star.bridge.XInstanceProvider </type>
- <type> com.sun.star.bridge.XBridge </type>
- <type> com.sun.star.bridge.BridgeExistsException </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.lang.XMultiServiceFactory </type>
- <type> com.sun.star.lang.XSingleServiceFactory </type>
- <type> com.sun.star.lang.XInitialization </type>
- <type> com.sun.star.lang.XComponent </type>
- <type> com.sun.star.lang.XServiceInfo </type>
- <type> com.sun.star.lang.XTypeProvider </type>
- <type> com.sun.star.lang.IllegalArgumentException </type>
- <type> com.sun.star.lang.XInitialization </type>
- <type> com.sun.star.registry.XRegistryKey </type>
- <type> com.sun.star.lang.XSingleComponentFactory </type>
- <type> com.sun.star.uno.XComponentContext </type>
- <type> com.sun.star.uno.XWeak </type>
- <type> com.sun.star.uno.TypeClass </type>
- <type> com.sun.star.uno.XAggregation </type>
- </component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> rmcxt </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3 </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
- <runtime-module-dependency> rmcxt3 </runtime-module-dependency>
-</module-description>
diff --git a/remotebridges/source/dynamicloader/dynamicloader.cxx b/remotebridges/source/dynamicloader/dynamicloader.cxx
deleted file mode 100644
index d6c46531346e..000000000000
--- a/remotebridges/source/dynamicloader/dynamicloader.cxx
+++ /dev/null
@@ -1,403 +0,0 @@
-
-#include <stdio.h>
-
-#include <cppuhelper/factory.hxx>
-
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-
-
-#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/loader/XImplementationLoader.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-
-using namespace ::com::sun::star::bridge;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::loader;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::registry;
-
-
-using namespace ::cppu;
-using namespace ::rtl;
-
-namespace dynamic_loader {
-
- class SingleServiceFactory : public WeakImplHelper2<XServiceInfo, XSingleServiceFactory> {
- Reference<XMultiServiceFactory> _xServiceManager;
- OUString _serviceName;
- OUString _link;
- OUString _resolver;
-
- Reference<XSingleServiceFactory> getRemoteFactory() throw(Exception, RuntimeException);
-
- public:
-
- SingleServiceFactory(const Reference<XMultiServiceFactory > & xServiceManager,
- const OUString & serviceName,
- const OUString & link,
- const OUString & resolver)
- : _xServiceManager(xServiceManager),
- _serviceName(serviceName),
- _link(link),
- _resolver(resolver)
- {}
-
- // XSingleServiceFactory
- Reference<XInterface> SAL_CALL createInstance() throw(Exception, RuntimeException);
- Reference<XInterface> SAL_CALL createInstanceWithArguments(const Sequence<Any>& Arguments)
- throw(::com::sun::star::uno::Exception,
- ::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo
- OUString SAL_CALL getImplementationName() throw(RuntimeException);
- sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(RuntimeException);
- Sequence<OUString> SAL_CALL getSupportedServiceNames(void) throw(RuntimeException);
- };
-
-
- Reference<XSingleServiceFactory> SingleServiceFactory::getRemoteFactory() throw(Exception, RuntimeException) {
- Reference<XUnoUrlResolver> xResolver(_xServiceManager->createInstance(_resolver), UNO_QUERY);
- if(!xResolver.is()) {
- OUString message(RTL_CONSTASCII_USTRINGPARAM("dynamic_loader::singleServiceFactory.createInstance - couldn't create resolver: "));
- message += _resolver;
-
- throw Exception(message, Reference<XInterface>());
- }
-
- Reference<XInterface> remoteObject = xResolver->resolve(_link);
- if(!remoteObject.is()) {
- OUString message(RTL_CONSTASCII_USTRINGPARAM("dynamic_loader::singleServiceFactory.createInstance - couldn't resolve link: "));
- message += _link;
-
- throw Exception(message, Reference<XInterface>());
- }
-
- Reference<XSingleServiceFactory> remoteFactory(remoteObject, UNO_QUERY);
- if(!remoteFactory.is()) {
- OUString message(RTL_CONSTASCII_USTRINGPARAM("dynamic_loader::singleServiceFactory.createInstance - couldn't get XSingleServiceFactory from: "));
- message += _link;
-
- throw Exception(message, Reference<XInterface>());
- }
-
- return remoteFactory;
- }
-
- // XSingleServiceFactory
- Reference<XInterface> SAL_CALL SingleServiceFactory::createInstance() throw(Exception, RuntimeException) {
- OSL_TRACE("dynamic_loader::singleServiceFactory::createInstance");
-
- return getRemoteFactory()->createInstance();
- }
-
- Reference<XInterface> SAL_CALL SingleServiceFactory::createInstanceWithArguments(const Sequence<Any>& Arguments)
- throw(Exception, RuntimeException)
- {
- OSL_TRACE("dynamic_loader::singleServiceFactory::createInstanceWithArguments");
-
- return getRemoteFactory()->createInstanceWithArguments(Arguments);
- }
-
- // XServiceInfo
- OUString SAL_CALL SingleServiceFactory::getImplementationName() throw(RuntimeException) {
- return _link;
- }
-
- sal_Bool SAL_CALL SingleServiceFactory::supportsService(const OUString & ServiceName) throw(RuntimeException) {
- return _serviceName.equals(ServiceName);
- }
-
- Sequence<OUString> SAL_CALL SingleServiceFactory::getSupportedServiceNames(void) throw(RuntimeException) {
- return Sequence<OUString>(&_serviceName, 1);
- }
-
-
-
- class DynamicLoader : public WeakImplHelper2<XImplementationLoader, XServiceInfo> {
- Reference<XMultiServiceFactory> _xSMgr;
-
- protected:
- DynamicLoader(const Reference<XMultiServiceFactory> & rXSMgr) throw(RuntimeException);
- ~DynamicLoader() throw();
-
- public:
- static const OUString implname;
- static const OUString servname;
-
- static Reference<XInterface> SAL_CALL createInstance(const Reference<XMultiServiceFactory> & rSMgr) throw(Exception);
- static Sequence<OUString> SAL_CALL getSupportedServiceNames_Static() throw();
-
- static void parseUrl(const OUString & url, OUString * serviceName, OUString * link, OUString * resolver) throw(RuntimeException);
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
- virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(RuntimeException);
- virtual Sequence<OUString> SAL_CALL getSupportedServiceNames() throw(RuntimeException);
-
- // XImplementationLoader
- virtual Reference<XInterface> SAL_CALL activate(const OUString & implementationName,
- const OUString & implementationLoaderUrl,
- const OUString& locationUrl,
- const Reference<XRegistryKey>& xKey) throw(CannotActivateFactoryException, RuntimeException);
- virtual sal_Bool SAL_CALL writeRegistryInfo(const Reference<XRegistryKey>& xKey,
- const OUString& implementationLoaderUrl,
- const OUString& locationUrl) throw(CannotRegisterImplementationException, RuntimeException);
- };
-
- const OUString DynamicLoader::implname = OUString::createFromAscii("com.sun.star.comp.stoc.DynamicLoader");
- const OUString DynamicLoader::servname = OUString::createFromAscii("com.sun.star.loader.Dynamic");
-
- Sequence<OUString> SAL_CALL DynamicLoader::getSupportedServiceNames_Static() throw() {
- return Sequence<OUString>(&servname, 1);
- }
-
- Reference<XInterface> SAL_CALL DynamicLoader::createInstance(const Reference<XMultiServiceFactory> & rSMgr) throw(Exception) {
- Reference<XInterface> xRet;
-
- try {
- XImplementationLoader *pXLoader = (XImplementationLoader *)new DynamicLoader(rSMgr);
-
- xRet = Reference<XInterface>::query(pXLoader);
- }
- catch(RuntimeException & runtimeException) {
- OString message = OUStringToOString(runtimeException.Message, RTL_TEXTENCODING_ASCII_US);
- osl_trace("dynamic loader - could not init cause of %s", message.getStr());
- }
-
- OSL_TRACE("DynamicLoader - createInstance: %d", xRet.is());
-
-
- return xRet;
- }
-
- DynamicLoader::DynamicLoader(const Reference<XMultiServiceFactory> & xSMgr) throw(RuntimeException)
- : _xSMgr(xSMgr)
- {
- }
-
-
- DynamicLoader::~DynamicLoader() throw() {
- }
-
- // XServiceInfo
- OUString SAL_CALL DynamicLoader::getImplementationName() throw(RuntimeException) {
- return implname;
- }
-
- sal_Bool SAL_CALL DynamicLoader::supportsService(const OUString & ServiceName) throw(RuntimeException) {
- sal_Bool bSupport = sal_False;
-
- Sequence<OUString> aSNL = getSupportedServiceNames();
- const OUString * pArray = aSNL.getArray();
- for(sal_Int32 i = 0; i < aSNL.getLength() && !bSupport; ++ i)
- bSupport = pArray[i] == ServiceName;
-
- return bSupport;
- }
-
- Sequence<OUString> SAL_CALL DynamicLoader::getSupportedServiceNames() throw(RuntimeException) {
- return getSupportedServiceNames_Static();
- }
-
-
- void DynamicLoader::parseUrl(const OUString & locationUrl, OUString * serviceName, OUString * link, OUString * resolver) throw(RuntimeException) {
-#if OSL_DEBUG_LEVEL > 1
- OString tmp = OUStringToOString(locationUrl, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE("DynamicLoader - locationUrl %s", tmp.getStr());
-#endif
-
- // This is the default resolver
- *resolver = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.UnoUrlResolver"));
-
- const OUString bSlash(OUString(RTL_CONSTASCII_USTRINGPARAM("\\")));
- const OUString tuedle(OUString(RTL_CONSTASCII_USTRINGPARAM("\"")));
- const OUString separator(OUString(RTL_CONSTASCII_USTRINGPARAM(",")));
- const OUString emptyString(OUString(RTL_CONSTASCII_USTRINGPARAM("")));
- const OUString equalSign(OUString(RTL_CONSTASCII_USTRINGPARAM("=")));
-
- sal_Int32 index = 0;
- sal_Bool left = sal_True;
- sal_Bool quote = sal_False;
- sal_Bool inString = sal_False;
-
- const sal_Unicode * raw_url = locationUrl.getStr();
- OUString token;
- OUString attribute;
-
- while(index <= locationUrl.getLength()) {
- if(index >= locationUrl.getLength() || (raw_url[index] == separator.getStr()[0] && !quote && !inString)) { // a separator or end?
- OUString value;
-
- if(left)
- attribute = token.trim();
-
- else
- value = token.trim();
-
-#if OSL_DEBUG_LEVEL > 1
- OString attribute_tmp = OUStringToOString(attribute, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE("DynamicLoader - attribute %s", attribute_tmp.getStr());
- OString value_tmp = OUStringToOString(value, RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE("DynamicLoader - value %s", value_tmp.getStr());
-#endif
-
- if(attribute.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("servicename"))))
- *serviceName = value;
-
- else if(attribute.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("link"))))
- *link = value;
-
- else if(attribute.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("resolver"))))
- *resolver = value;
-
- else {
- OUString message(RTL_CONSTASCII_USTRINGPARAM("help called"));
-
- if(!attribute.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("help")))) {
- message = OUString(RTL_CONSTASCII_USTRINGPARAM("DynamicLoader - unknown attribute: "));
- message += attribute;
- }
-
- fprintf(stdout, "DynamicLoader - help\n");
- fprintf(stdout, "attributes:\n");
- fprintf(stdout, "\tservicename: service name of dynamic component\n");
- fprintf(stdout, "\tlink: link to a single service factory for dynamic component\n");
- fprintf(stdout, "\tresolver: the service which resolves the link\n");
- fprintf(stdout, "\thelp: this help\n");
-
- throw RuntimeException(message, Reference<XInterface>());
- }
-
- left = sal_True; // reset state to be left
- token = emptyString;
- }
- else if(raw_url[index] == bSlash.getStr()[0] && !quote) // a back slash?
- quote = sal_True;
-
- else if(raw_url[index] == equalSign.getStr()[0] && !quote && !inString) { // equalSign (switch from left to right)?
- left = sal_False;
-
- attribute = token.trim();
- token = emptyString;
- }
- else if(raw_url[index] == tuedle.getStr()[0] && !quote) // begin or end of string?
- inString = !inString;
-
- else { // no special handling
- token += OUString(raw_url + index, 1);
- quote = sal_False;
- }
-
- ++ index;
- }
-
- // enshure, that attributes are set properly
- if(!(*serviceName).getLength())
- throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("dynamic_loader::DynamicLoader.parseUrl - missing or empty attribute: servicename")),
- Reference<XInterface>());
-
- if(!(*link).getLength())
- throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("dynamic_loader::DynamicLoader.parseUrl - missing or empty attribute: link")),
- Reference<XInterface>());
-
- if(!(*resolver).getLength())
- throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("dynamic_loader::DynamicLoader.parseUrl - missing or empty attribute: resolver")),
- Reference<XInterface>());
- }
-
-
- // XImplementationLoader
- sal_Bool SAL_CALL DynamicLoader::writeRegistryInfo(const Reference<XRegistryKey> & xKey,
- const OUString & implementationLoaderUrl,
- const OUString & locationUrl)
- throw(CannotRegisterImplementationException, RuntimeException)
- {
- OSL_TRACE("DynamicLoader::writeRegistryInfo");
-
- OUString serviceName;
- OUString link;
- OUString resolver;
-
- try {
- parseUrl(locationUrl, &serviceName, &link, &resolver);
- }
- catch(RuntimeException & runtimeException) {
- throw CannotRegisterImplementationException(runtimeException.Message, Reference<XInterface>());
- }
-
- // create the keys
- OUString keyName = OUString::createFromAscii("/");
- keyName += implementationLoaderUrl;
- keyName += OUString(RTL_CONSTASCII_USTRINGPARAM("_"));
- keyName += serviceName;
- keyName += OUString::createFromAscii("/UNO/SERVICES");
-
- Reference<XRegistryKey> xNewKey(xKey->createKey(keyName));
- xNewKey->createKey(serviceName);
-
- sal_Bool bSuccess = sal_True;
-
- return bSuccess;
- }
-
- Reference<XInterface> SAL_CALL DynamicLoader::activate(const OUString &,
- const OUString &,
- const OUString & locationUrl,
- const Reference<XRegistryKey> &)
- throw(CannotActivateFactoryException, RuntimeException)
- {
- OSL_TRACE("DynamicLoader::activate");
-
- OUString serviceName;
- OUString link;
- OUString resolver;
-
- parseUrl(locationUrl, &serviceName, &link, &resolver);
-
- XSingleServiceFactory * xFactory = (XSingleServiceFactory *)new SingleServiceFactory(_xSMgr,
- serviceName,
- link,
- resolver);
-
- Reference<XInterface> xReturn;
-
- if(xFactory)
- xReturn = Reference<XInterface>::query(xFactory);
-
- return xReturn;
- }
-}
-
-
-
-
-extern "C" {
- void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment **) {
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
- }
-
- void * SAL_CALL component_getFactory(const sal_Char * pImplName, XMultiServiceFactory * pServiceManager, XRegistryKey *) {
- void * pRet = 0;
-
- if (pServiceManager && OUString::createFromAscii(pImplName).equals(::dynamic_loader::DynamicLoader::implname)) {
- Reference<XSingleServiceFactory> xFactory(createOneInstanceFactory(pServiceManager,
- ::dynamic_loader::DynamicLoader::implname,
- ::dynamic_loader::DynamicLoader::createInstance,
- ::dynamic_loader::DynamicLoader::getSupportedServiceNames_Static()));
-
- if (xFactory.is()) {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
- else
- OSL_TRACE("DynamicLoader - warning - given wrong implName: %s", pImplName);
-
- return pRet;
- }
-}
diff --git a/remotebridges/source/dynamicloader/dynamicloader.xml b/remotebridges/source/dynamicloader/dynamicloader.xml
deleted file mode 100644
index 9735629b8a09..000000000000
--- a/remotebridges/source/dynamicloader/dynamicloader.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> dynamicloader.uno </module-name>
- <component-description>
- <author> Kay Ramme </author>
- <name> com.sun.star.loader.Dynamic </name>
- <description>
- This service allows the delegation of the resolution
- of a SingleServiceFactory for a service to be
- delegated to a resolver (e.g. UnoUrlResolver).
- </description>
- <loader-name> com.sun.star.loader.SharedLibrary </loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.loader.Dynamic </supported-service>
- <service-dependency> com.sun.star.bridge.UnoUrlResolver </service-dependency>
- <type> com.sun.star.bridge.XUnoUrlResolver </type>
- <type> com.sun.star.lang.XMultiServiceFactory </type>
- <type> com.sun.star.lang.XServiceInfo </type>
- <type> com.sun.star.lang.XSingleServiceFactory </type>
- <type> com.sun.star.lang.XTypeProvider </type>
- <type> com.sun.star.lang.XSingleComponentFactory </type>
- <type> com.sun.star.uno.XComponentContext </type>
- <type> com.sun.star.loader.XImplementationLoader </type>
- <type> com.sun.star.registry.XRegistryKey </type>
- <type> com.sun.star.uno.XWeak </type>
- <type> com.sun.star.uno.XAggregation </type>
- </component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> cppuhelper3 </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/remotebridges/source/factory/brdgfctr.xml b/remotebridges/source/factory/brdgfctr.xml
deleted file mode 100644
index 9e2abf8eef1e..000000000000
--- a/remotebridges/source/factory/brdgfctr.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name> bridgefac.uno </module-name>
- <component-description>
- <author> Joerg Budischewski </author>
- <name> com.sun.star.comp.remotebridges.BridgeFactory </name>
- <description>
- This component allows
- to establish a connection to another process.
- </description>
- <loader-name> com.sun.star.loader.SharedLibrary </loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.bridge.BridgeFactory </supported-service>
- <service-dependency> ... </service-dependency>
- <type> com.sun.star.bridge.XBridgeFactory </type>
- <type> com.sun.star.bridge.XInstanceProvider </type>
- <type> com.sun.star.bridge.XBridge </type>
- <type> com.sun.star.bridge.BridgeExistsException </type>
- <type> com.sun.star.container.XContentEnumerationAccess </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.lang.XMultiServiceFactory </type>
- <type> com.sun.star.lang.XSingleServiceFactory </type>
- <type> com.sun.star.lang.XInitialization </type>
- <type> com.sun.star.lang.XComponent </type>
- <type> com.sun.star.lang.XServiceInfo </type>
- <type> com.sun.star.lang.XTypeProvider </type>
- <type> com.sun.star.lang.IllegalArgumentException </type>
- <type> com.sun.star.lang.XInitialization </type>
- <type> com.sun.star.registry.XRegistryKey </type>
- <type> com.sun.star.lang.XSingleComponentFactory </type>
- <type> com.sun.star.uno.XComponentContext </type>
- <type> com.sun.star.uno.XWeak </type>
- <type> com.sun.star.uno.TypeClass </type>
- <type> com.sun.star.uno.XAggregation </type>
- </component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> cppuhelper3 </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/remotebridges/source/factory/bridgefactory.cxx b/remotebridges/source/factory/bridgefactory.cxx
deleted file mode 100644
index c5bfd9a46d79..000000000000
--- a/remotebridges/source/factory/bridgefactory.cxx
+++ /dev/null
@@ -1,493 +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 <hash_map>
-
-#include <rtl/alloc.h>
-
-#include <uno/mapping.hxx>
-#include <osl/mutex.hxx>
-
-#include <bridges/remote/context.h>
-
-#include <cppuhelper/implementationentry.hxx>
-#include <cppuhelper/component.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include "cppuhelper/unourl.hxx"
-#include "rtl/malformeduriexception.hxx"
-
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-#include <com/sun/star/bridge/XBridgeFactory.hpp>
-
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-
-
-#include "bridgeimpl.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::cppu;
-using namespace ::std;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::bridge;
-using namespace ::com::sun::star::connection;
-using namespace ::com::sun::star::registry;
-using namespace ::com::sun::star::container;
-
-#define SERVICE_NAME "com.sun.star.bridge.BridgeFactory"
-#define IMPLEMENTATION_NAME "com.sun.star.comp.remotebridges.BridgeFactory"
-
-namespace remotebridges_factory
-{
- rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
-
- struct hashOUString
- {
- size_t operator()(const OUString & s) const
- { return s.hashCode(); }
- };
-
- struct equalOUString
- {
- sal_Bool operator()(const OUString & s1 , const OUString &s2 ) const
- {
- return s1 == s2;
- }
- };
-
- typedef ::std::hash_map
- <
- OUString,
- WeakReference< XBridge >,
- hashOUString,
- equalOUString
- > BridgeHashMap;
-
-
- typedef ::std::hash_map
- <
- OUString,
- OUString,
- hashOUString,
- equalOUString
- > ServiceHashMap;
-
- class OBridgeFactory :
- public MyMutex,
- public OComponentHelper,
- public XBridgeFactory,
- public XServiceInfo
- {
- public:
- OBridgeFactory( const Reference < XComponentContext > &rCtx );
- ~OBridgeFactory();
-
- public: // XInterface
- ::com::sun::star::uno::Any SAL_CALL
- queryInterface( const ::com::sun::star::uno::Type & aType ) throw(RuntimeException);
-
- void SAL_CALL acquire() throw()
- { OComponentHelper::acquire(); }
- void SAL_CALL release() throw()
- { OComponentHelper::release(); }
-
- public:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::bridge::XBridge > SAL_CALL
- createBridge(
- const ::rtl::OUString& sName,
- const ::rtl::OUString& sProtocol,
- const ::com::sun::star::uno::Reference< ::com::sun::star::connection::XConnection >& aConnection,
- const ::com::sun::star::uno::Reference< ::com::sun::star::bridge::XInstanceProvider >& anInstanceProvider )
- throw(::com::sun::star::bridge::BridgeExistsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::bridge::XBridge > SAL_CALL
- getBridge( const ::rtl::OUString& sName )
- throw(::com::sun::star::uno::RuntimeException );
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::bridge::XBridge > > SAL_CALL
- getExistingBridges( ) throw(::com::sun::star::uno::RuntimeException);
-
- public: //XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
- getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
- getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
-
- public: //XServiceInfo
- virtual OUString SAL_CALL getImplementationName( ) throw(RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException);
- virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(RuntimeException);
-
- public:
- static OUString getImplementationNameStatic( ) SAL_THROW( () );
- static Sequence< OUString > getSupportedServiceNamesStatic() SAL_THROW( () );
-
- private:
- void init();
- OUString getServiceNameForProtocol( const OUString &sProtocol );
-
- private:
- Reference < XMultiComponentFactory > m_rSMgr;
- Reference < XComponentContext > m_rCtx;
- BridgeHashMap m_mapBridge;
- ServiceHashMap m_mapProtocolToService;
- sal_Bool m_bInitialized;
- ::osl::Mutex m_mutexInit;
- };
-
- OBridgeFactory::OBridgeFactory( const Reference < XComponentContext > &rCtx )
- : OComponentHelper( m_mutex )
- , m_rSMgr( rCtx->getServiceManager() )
- , m_rCtx( rCtx )
- , m_bInitialized( sal_False )
- {
- g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
- }
-
- OBridgeFactory::~OBridgeFactory()
- {
- g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
- }
-
- void OBridgeFactory::init()
- {
- MutexGuard guard( m_mutexInit );
- if( ! m_bInitialized )
- {
- Reference< XContentEnumerationAccess > rContent( m_rSMgr , UNO_QUERY );
- if( rContent.is() )
- {
- OUString sMetaService = OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.bridge.Bridge" ) );
- Reference < XEnumeration > rEnum =
- rContent->createContentEnumeration( sMetaService );
- if ( rEnum.is() )
- while( rEnum->hasMoreElements() )
- {
- Any a = rEnum->nextElement();
- Reference <XServiceInfo> rInfo;
- if( a >>= rInfo )
- {
- Sequence< OUString > seq = rInfo->getSupportedServiceNames();
- sal_Int32 i;
- for( i = 0 ; i < seq.getLength() ; i ++ )
- {
- if( seq.getConstArray()[i] != sMetaService )
- {
- sal_Int32 nIndex = seq.getConstArray()[i].lastIndexOf( '.' );
- OUString sSuffix = seq.getConstArray()[i].copy(nIndex+1);
- if( sSuffix.getLength() > 6 &&
- 0 == sSuffix.copy( sSuffix.getLength() - 6 ).compareToAscii( "Bridge" ) )
- {
- OUString sProtocol = sSuffix.copy(0 , sSuffix.getLength()-6 ).toAsciiLowerCase();
- m_mapProtocolToService[ sProtocol ] = seq.getConstArray()[i];
- }
- }
- }
- }
- }
- }
- m_bInitialized = sal_True;
- }
- }
-
- OUString OBridgeFactory::getServiceNameForProtocol( const OUString & sProtocol )
- {
- init();
- OUString sService;
- OUString sProtocolName;
- try
- {
- sProtocolName = cppu::UnoUrlDescriptor(sProtocol).getName();
- }
- catch (rtl::MalformedUriException &)
- {
- OSL_ENSURE(false, "MalformedUriException");
- }
- ServiceHashMap::iterator ii = m_mapProtocolToService.find( sProtocolName );
- if( ii != m_mapProtocolToService.end() )
- {
- sService = (*ii).second;
- }
- else
- {
- // fallback to the old solution, deprecated, should be removed !
- sService = OUString::createFromAscii( "com.sun.star.bridge.Bridge." );
- sService += sProtocolName;
- }
- return sService;
- }
-
- Any OBridgeFactory::queryInterface( const Type &aType ) throw(RuntimeException)
- {
- Any a = ::cppu::queryInterface(
- aType ,
- ( XBridgeFactory * ) this );
- if( a.hasValue() )
- {
- return a;
- }
-
- return OComponentHelper::queryInterface( aType );
-
- }
-
- Reference< XBridge > OBridgeFactory::createBridge(
- const OUString& sName,
- const OUString& sProtocol,
- const Reference< XConnection >& aConnection,
- const Reference< XInstanceProvider >& anInstanceProvider )
- throw(::com::sun::star::bridge::BridgeExistsException,
- ::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::uno::RuntimeException)
- {
- OUString sService = getServiceNameForProtocol( sProtocol );
-
- Reference < XInterface > rXInterface =
- m_rSMgr->createInstanceWithContext(sService, m_rCtx );
- Reference < XInitialization > rInit(rXInterface, UNO_QUERY );
- Reference < XBridge > rBridge( rInit , UNO_QUERY );
-
- if( rInit.is() && rBridge.is() )
- {
- Sequence < Any > seqAny( 4 );
- seqAny.getArray()[0] <<= sName;
- seqAny.getArray()[1] <<= sProtocol;
- seqAny.getArray()[2] <<= aConnection;
- seqAny.getArray()[3] <<= anInstanceProvider;
-
- // let the Exceptions fly ....
- rInit->initialize( seqAny );
- }
- else
- {
- throw IllegalArgumentException();
- }
-
- if( sName.getLength() )
- {
- MutexGuard guard( m_mutex );
- // put the bridge into the hashmap
- m_mapBridge[ sName ] = rBridge;
- }
- return rBridge;
- }
-
- Reference< XBridge > OBridgeFactory::getBridge( const ::rtl::OUString& sName )
- throw(::com::sun::star::uno::RuntimeException )
-
- {
- MutexGuard guard( m_mutex );
- BridgeHashMap::iterator ii = m_mapBridge.find( sName );
-
- Reference < XBridge > rBridge;
-
- if( ii != m_mapBridge.end() )
- {
- rBridge = (*ii).second;
- if( ! rBridge.is() )
- {
- m_mapBridge.erase( ii );
- }
- }
-
- if( ! rBridge.is() )
- {
- // try to get it via the C-Context
- remote_Context * pRemoteC = remote_getContext( sName.pData );
-
- if( pRemoteC )
- {
- rBridge = Reference < XBridge > ((XBridge *) new OBridge( pRemoteC ) );
- pRemoteC->aBase.release( (uno_Context * )pRemoteC );
- m_mapBridge[ sName ] = rBridge;
- }
- }
- return rBridge;
- }
-
- Sequence< Reference< XBridge > > OBridgeFactory::getExistingBridges( )
- throw(::com::sun::star::uno::RuntimeException)
- {
- MutexGuard guard( m_mutex );
-
- sal_Int32 nCount;
-
- rtl_uString **ppName = remote_getContextList(
- &nCount,
- rtl_allocateMemory );
-
- Sequence < Reference < XBridge > > seq( nCount );
- if( nCount )
- {
-
- for( sal_Int32 i = 0;
- i < nCount ;
- i ++ )
- {
- seq.getArray()[i] = getBridge( OUString( ppName[i]) );
- rtl_uString_release( ppName[i] );
- }
- rtl_freeMemory( ppName );
- }
-
- return seq;
- }
-
- // XTypeProvider
- Sequence< Type > SAL_CALL OBridgeFactory::getTypes(void) throw( RuntimeException )
- {
- static OTypeCollection *pCollection = 0;
- if( ! pCollection )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pCollection )
- {
- static OTypeCollection collection(
- getCppuType( (Reference< XBridgeFactory > * ) 0 ),
- OComponentHelper::getTypes() );
- pCollection = &collection;
- }
- }
- return (*pCollection).getTypes();
- }
-
- Sequence< sal_Int8 > SAL_CALL OBridgeFactory::getImplementationId( ) throw( RuntimeException)
- {
- static OImplementationId *pId = 0;
- if( ! pId )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pId )
- {
- static OImplementationId id( sal_False );
- pId = &id;
- }
- }
- return (*pId).getImplementationId();
- }
-
- OUString OBridgeFactory::getImplementationNameStatic()
- {
- static OUString *pName = 0;
- if( ! pName )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pName )
- {
- static OUString name( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
- pName = &name;
- }
- }
- return *pName;
- }
-
- Sequence< OUString > OBridgeFactory::getSupportedServiceNamesStatic()
- {
- static Sequence < OUString > *pNames = 0;
- if( ! pNames )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( !pNames )
- {
- static Sequence< OUString > seqNames(1);
- seqNames.getArray()[0] = OUString::createFromAscii( SERVICE_NAME );
- pNames = &seqNames;
- }
- }
- return *pNames;
- }
-
- OUString OBridgeFactory::getImplementationName( ) throw(RuntimeException)
- {
- return getImplementationNameStatic();
- }
-
- sal_Bool SAL_CALL OBridgeFactory::supportsService( const OUString& ServiceName ) throw(RuntimeException)
- {
- Sequence< OUString > seq = getSupportedServiceNamesStatic();
- sal_Bool bReturn = sal_False;
- for( sal_Int32 i = 0 ; i < seq.getLength() ; i ++ )
- {
- if( seq.getConstArray()[i] == ServiceName )
- {
- bReturn = sal_True;
- break;
- }
- }
- return bReturn;
- }
-
- Sequence< OUString > SAL_CALL OBridgeFactory::getSupportedServiceNames( ) throw(RuntimeException)
- {
- return getSupportedServiceNamesStatic();
- }
-
-
- Reference< XInterface > SAL_CALL CreateInstance(Reference< XComponentContext > const & xContext)
- {
- return Reference < XInterface > ( *new OBridgeFactory( xContext ) );
- }
-}
-
-using namespace remotebridges_factory;
-static ImplementationEntry g_entries[] =
-{
- { CreateInstance, OBridgeFactory::getImplementationNameStatic,
- OBridgeFactory::getSupportedServiceNamesStatic, createSingleComponentFactory ,
- &g_moduleCount.modCnt , 0
- },
- { 0, 0, 0, 0, 0, 0 }
-};
-
-extern "C"
-{
-sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
-{
- return g_moduleCount.canUnload( &g_moduleCount , pTime );
-}
-
-//==================================================================================================
-void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-//==================================================================================================
-void * SAL_CALL component_getFactory(
- const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
- return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
-}
-}
-
-
-
-
diff --git a/remotebridges/source/factory/bridgeimpl.cxx b/remotebridges/source/factory/bridgeimpl.cxx
deleted file mode 100644
index 403b18b3fbc0..000000000000
--- a/remotebridges/source/factory/bridgeimpl.cxx
+++ /dev/null
@@ -1,270 +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 "bridgeimpl.hxx"
-
-using namespace ::rtl;
-using namespace ::osl;
-using namespace ::cppu;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::bridge;
-
-namespace remotebridges_factory {
-
-
- OBridge::OBridge( remote_Context *pContext ) :
- OComponentHelper( m_mutex ),
- m_pContext( pContext )
- {
- g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
-
- remote_DisposingListener::acquire = thisAcquire;
- remote_DisposingListener::release = thisRelease;
- remote_DisposingListener::disposing = thisDisposing;
-
- m_pContext->aBase.acquire( (uno_Context*)m_pContext );
- m_pContext->addDisposingListener( m_pContext, ( remote_DisposingListener * ) this );
- }
-
- OBridge::~OBridge()
- {
- if( m_pContext )
- {
- m_pContext->aBase.release( (uno_Context * ) m_pContext );
- }
- g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
- }
-
- ::com::sun::star::uno::Any OBridge::queryInterface( const ::com::sun::star::uno::Type & aType ) throw(RuntimeException)
- {
- Any a = ::cppu::queryInterface(
- aType ,
- SAL_STATIC_CAST( XBridge * , this ),
- SAL_STATIC_CAST( XTypeProvider * , this ) );
- if( a.hasValue() )
- {
- return a;
- }
-
- return OComponentHelper::queryInterface( aType );
- }
-
- void OBridge::disposing()
- {
- if( m_pContext )
- {
- m_pContext->removeDisposingListener( m_pContext , ( remote_DisposingListener * )this);
-
- uno_Environment *pEnvRemote = 0;
- if( m_pContext->m_pConnection )
- {
- sal_Int32 nIndex = 0;
- OUString sProtocol = OUString( m_pContext->m_pProtocol ).getToken( 0 , ',' , nIndex );
- uno_getEnvironment( &pEnvRemote , sProtocol.pData , m_pContext );
- OSL_ASSERT( pEnvRemote );
- }
- else
- {
- // within disposing from the context, no further dispose necessary !
- }
-
- if( pEnvRemote )
- {
- pEnvRemote->dispose( pEnvRemote );
- pEnvRemote->release( pEnvRemote );
- pEnvRemote = 0;
- }
-
- m_pContext->aBase.release( (uno_Context*)m_pContext );
- m_pContext = 0;
- }
- }
-
-
- Reference< XInterface > OBridge::getInstance( const ::rtl::OUString& sInstanceName )
- throw(::com::sun::star::uno::RuntimeException)
- {
- Reference < XInterface > rReturn;
-
- remote_Context *pContext = 0;
- {
- MutexGuard guard( m_mutex );
- if( m_pContext && m_pContext->getRemoteInstance )
- {
- pContext = m_pContext;
- pContext->aBase.acquire( (uno_Context*)pContext );
- }
- }
- if( pContext )
- {
- sal_Int32 nIndex = 0;
- OUString sProtocol = OUString( m_pContext->m_pProtocol ).getToken( 0 , ',' , nIndex );
-
- // get the appropriate remote environment
- uno_Environment *pEnvRemote = 0;
- uno_getEnvironment( &pEnvRemote , sProtocol.pData , pContext );
-
- if( ! pEnvRemote )
- {
- pContext->aBase.release( (uno_Context*) pContext );
- throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "RemoteBridge: bridge already disposed" ) ),
- Reference< XInterface > () );
- }
-
- Type type = getCppuType( (Reference < XInterface > * ) 0 );
-
- remote_Interface *pRemoteI = 0;
- uno_Any exception;
- uno_Any *pException = &exception;
-
- pContext->getRemoteInstance(
- pEnvRemote,
- &pRemoteI,
- sInstanceName.pData,
- type.getTypeLibType(),
- &pException );
- pContext->aBase.release( (uno_Context*) pContext );
- pContext = 0;
-
- uno_Environment *pEnvCpp =0;
- OUString sCppuName( RTL_CONSTASCII_USTRINGPARAM( CPPU_CURRENT_LANGUAGE_BINDING_NAME ) );
- uno_getEnvironment( &pEnvCpp ,
- sCppuName.pData ,
- 0 );
- Mapping map( pEnvRemote , pEnvCpp );
-
- pEnvCpp->release( pEnvCpp );
- pEnvRemote->release( pEnvRemote );
-
- if( pException )
- {
- typelib_CompoundTypeDescription * pCompType = 0 ;
- getCppuType( (Exception*)0 ).getDescription( (typelib_TypeDescription **) &pCompType );
-
- if( ! ((typelib_TypeDescription *)pCompType)->bComplete )
- {
- typelib_typedescription_complete( (typelib_TypeDescription**) &pCompType );
- }
- XInterface *pXInterface = (XInterface *) map.mapInterface(
- *(remote_Interface**) ( ((char*)pException->pData)+pCompType->pMemberOffsets[1] ),
- getCppuType( (Reference< XInterface > *)0 ) );
- RuntimeException myException(
- *((rtl_uString **)pException->pData),
- Reference< XInterface > ( pXInterface , SAL_NO_ACQUIRE) );
- uno_any_destruct( pException , 0 );
-
- throw myException;
- }
- else if( pRemoteI )
- {
- // got an interface !
- XInterface * pCppI = ( XInterface * ) map.mapInterface( pRemoteI, type );
- rReturn = Reference<XInterface > ( pCppI, SAL_NO_ACQUIRE );
- pRemoteI->release( pRemoteI );
- }
- }
- else
- {
- throw RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "RemoteBridge: bridge already disposed." ) ),
- Reference< XInterface > () );
- }
-
- return rReturn;
- }
-
- ::rtl::OUString SAL_CALL OBridge::getName( )
- throw(::com::sun::star::uno::RuntimeException)
-
- {
- return OUString( m_pContext->m_pName );
- }
-
- ::rtl::OUString OBridge::getDescription( )
- throw(::com::sun::star::uno::RuntimeException)
- {
- return OUString( m_pContext->m_pDescription );
- }
-
- // XTypeProvider
- Sequence< Type > SAL_CALL OBridge::getTypes(void) throw( RuntimeException )
- {
- static OTypeCollection *pCollection = 0;
- if( ! pCollection )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pCollection )
- {
- static OTypeCollection collection(
- getCppuType( (Reference< XTypeProvider> * )0),
- getCppuType( (Reference< XBridge > * ) 0 ),
- OComponentHelper::getTypes() );
- pCollection = &collection;
- }
- }
-
- return (*pCollection).getTypes();
- }
-
- Sequence< sal_Int8 > SAL_CALL OBridge::getImplementationId( ) throw( RuntimeException)
- {
- static OImplementationId *pId = 0;
- if( ! pId )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pId )
- {
- static OImplementationId id( sal_False );
- pId = &id;
- }
- }
- return (*pId).getImplementationId();
- }
-
- //----------------------
- // static methods
- //----------------------
- void OBridge::thisAcquire( remote_DisposingListener *p )
- {
- OBridge *m = (OBridge * ) p;
- m->acquire();
- }
-
- void OBridge::thisRelease( remote_DisposingListener *p )
- {
- OBridge *m = (OBridge * ) p;
- m->release();
- }
-
- void OBridge::thisDisposing( remote_DisposingListener * p, rtl_uString * )
- {
- OBridge *m = (OBridge * ) p;
- m->dispose();
- }
-}
diff --git a/remotebridges/source/factory/bridgeimpl.hxx b/remotebridges/source/factory/bridgeimpl.hxx
deleted file mode 100644
index 1e483dd57180..000000000000
--- a/remotebridges/source/factory/bridgeimpl.hxx
+++ /dev/null
@@ -1,106 +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 <osl/mutex.hxx>
-#include <osl/diagnose.h>
-
-#include <uno/mapping.hxx>
-#include <uno/environment.h>
-
-#include <bridges/remote/context.h>
-#include <bridges/remote/remote.h>
-
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/component.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-
-#include <com/sun/star/bridge/XBridge.hpp>
-#include <com/sun/star/bridge/XInstanceProvider.hpp>
-
-namespace remotebridges_factory {
- extern rtl_StandardModuleCount g_moduleCount;
-
- struct MyMutex
- {
- ::osl::Mutex m_mutex;
- };
-
- class OBridge :
- public MyMutex,
- public remote_DisposingListener,
- public ::com::sun::star::bridge::XBridge,
- public ::cppu::OComponentHelper
- {
- public:
- OBridge( remote_Context *pContext );
- ~OBridge();
-
- // XInterface
- public:
- ::com::sun::star::uno::Any SAL_CALL
- queryInterface( const ::com::sun::star::uno::Type & aType ) throw(com::sun::star::uno::RuntimeException);
-
- void SAL_CALL acquire() throw()
- { OComponentHelper::acquire(); }
- void SAL_CALL release() throw()
- { OComponentHelper::release(); }
-
- public:
- virtual void SAL_CALL disposing(); // called by OComponentHelper
-
- public:
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
- getInstance( const ::rtl::OUString& sInstanceName )
- throw(::com::sun::star::uno::RuntimeException);
-
- virtual ::rtl::OUString SAL_CALL getName( )
- throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getDescription( )
- throw(::com::sun::star::uno::RuntimeException);
-
- public:
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
- getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
- getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
-
- public:
- static void SAL_CALL thisAcquire( remote_DisposingListener * );
- static void SAL_CALL thisRelease( remote_DisposingListener * );
- static void SAL_CALL thisDisposing( remote_DisposingListener * ,
- rtl_uString * pBridgeName );
-
- public:
- remote_Context *m_pContext;
- ::rtl::OString m_sName;
- ::rtl::OString m_sDescription;
- };
-}
-
diff --git a/reportdesign/prj/build.lst b/reportdesign/prj/build.lst
index d4e26e51acdc..4a5667d2090a 100644
--- a/reportdesign/prj/build.lst
+++ b/reportdesign/prj/build.lst
@@ -1,4 +1,4 @@
-rd reportdesign : l10n BOOST:boost comphelper dbaccess formula LIBXSLT:libxslt NULL
+rd reportdesign : L10N:l10n BOOST:boost comphelper dbaccess formula LIBXSLT:libxslt NULL
rd reportdesign usr1 - all rd_mkout NULL
rd reportdesign\inc nmake - all rd_inc NULL
rd reportdesign\source\core\api nmake - all rd_api rd_inc NULL
diff --git a/sal/inc/osl/thread.h b/sal/inc/osl/thread.h
index 16860644d7a0..4c53b001fcd6 100644
--- a/sal/inc/osl/thread.h
+++ b/sal/inc/osl/thread.h
@@ -159,6 +159,18 @@ sal_Bool SAL_CALL osl_scheduleThread(oslThread Thread);
*/
void SAL_CALL osl_yieldThread(void);
+/** Attempts to set the name of the current thread.
+
+ The name of a thread is usually evaluated for debugging purposes. Not all
+ platforms support this. On Linux, a set thread name can be observed with
+ "ps -L". On Windows with the Microsoft compiler, a thread name set while a
+ debugger is attached can be observed within the debugger.
+
+ @param name the name of the thread; must not be null; on Linux, only the
+ first 16 characters are used
+*/
+void SAL_CALL osl_setThreadName(char const * name);
+
/* Callback when data stored in a thread key is no longer needed */
typedef void (SAL_CALL *oslThreadKeyCallbackFunction)(void *);
diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx
index 51fe059d2210..c3ca49926456 100644
--- a/sal/inc/osl/thread.hxx
+++ b/sal/inc/osl/thread.hxx
@@ -150,6 +150,9 @@ public:
osl_yieldThread();
}
+ static inline void setName(char const * name) throw () {
+ osl_setThreadName(name);
+ }
virtual sal_Bool SAL_CALL schedule()
{
diff --git a/sal/osl/os2/thread.c b/sal/osl/os2/thread.c
index 313e67c0f925..0f0c396a407c 100644
--- a/sal/osl/os2/thread.c
+++ b/sal/osl/os2/thread.c
@@ -549,6 +549,10 @@ void SAL_CALL osl_yieldThread()
DosSleep(0);
}
+void osl_setThreadName(char const * name) {
+ (void) name;
+}
+
typedef struct _TLS
{
PULONG pulPtr;
diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c
index ede4cd7e074f..069ea9990951 100644
--- a/sal/osl/unx/pipe.c
+++ b/sal/osl/unx/pipe.c
@@ -486,7 +486,7 @@ sal_Int32 SAL_CALL osl_receivePipe(oslPipe pPipe,
(sal_Char*)pBuffer,
BytesToRead, 0);
- if ( nRet <= 0 )
+ if ( nRet < 0 )
{
OSL_TRACE("osl_receivePipe failed : %i '%s'",nRet,strerror(errno));
}
diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c
index fe53915b792f..18c4b033daf7 100644
--- a/sal/osl/unx/thread.c
+++ b/sal/osl/unx/thread.c
@@ -34,6 +34,10 @@
#include <rtl/textenc.h>
#endif
+#if defined LINUX
+#include <sys/prctl.h>
+#endif
+
/****************************************************************************
* @@@ TODO @@@
*
@@ -566,6 +570,18 @@ void SAL_CALL osl_yieldThread()
sched_yield();
}
+void SAL_CALL osl_setThreadName(char const * name) {
+#if defined LINUX
+ if (prctl(PR_SET_NAME, (unsigned long) name, 0, 0, 0) != 0) {
+ OSL_TRACE(
+ "%s prctl(PR_SET_NAME) failed with errno %d", OSL_LOG_PREFIX,
+ errno);
+ }
+#else
+ (void) name;
+#endif
+}
+
/*****************************************************************************/
/* osl_getThreadIdentifier @@@ see TODO @@@ */
/*****************************************************************************/
diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c
index 88ce87cdf175..8d85c8867b2d 100644..100755
--- a/sal/osl/w32/thread.c
+++ b/sal/osl/w32/thread.c
@@ -394,6 +394,31 @@ void SAL_CALL osl_yieldThread(void)
Sleep(0);
}
+void SAL_CALL osl_setThreadName(char const * name) {
+#ifdef _MSC_VER
+ /* See <http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx>: */
+#pragma pack(push, 8)
+ struct {
+ DWORD dwType;
+ LPCSTR szName;
+ DWORD dwThreadID;
+ DWORD dwFlags;
+ } info;
+#pragma pack(pop)
+ info.dwType = 0x1000;
+ info.szName = name;
+ info.dwThreadID = (DWORD) -1;
+ info.dwFlags = 0;
+ __try {
+ RaiseException(
+ 0x406D1388, 0, sizeof info / sizeof (ULONG_PTR),
+ (ULONG_PTR *) &info);
+ } __except (EXCEPTION_EXECUTE_HANDLER) {}
+#else
+ (void) name;
+#endif
+}
+
typedef struct _TLS
{
DWORD dwIndex;
diff --git a/sal/prj/build.lst b/sal/prj/build.lst
index 06e3958443e9..b7786f604eaf 100644
--- a/sal/prj/build.lst
+++ b/sal/prj/build.lst
@@ -20,4 +20,5 @@ sa sal\qa\OStringBuffer nmake - all sa_qa_OStringBuffer sa_cppunittester sa_util
sa sal\qa\osl\mutex nmake - all sa_qa_osl_mutex sa_cppunittester sa_util NULL
sa sal\qa\osl\pipe nmake - all sa_qa_osl_pipe sa_cppunittester sa_util NULL
sa sal\qa\osl\profile nmake - all sa_qa_osl_profile sa_cppunittester sa_util NULL
+sa sal\qa\osl\setthreadname nmake - all sa_qa_osl_setthreadname sa_cppunittester sa_util NULL
sa sal\qa\rtl\math nmake - all sa_qa_rtl_math sa_cppunittester sa_util NULL
diff --git a/sal/qa/osl/setthreadname/makefile.mk b/sal/qa/osl/setthreadname/makefile.mk
new file mode 100644
index 000000000000..f2d9da15c468
--- /dev/null
+++ b/sal/qa/osl/setthreadname/makefile.mk
@@ -0,0 +1,57 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ..$/..$/..
+PRJNAME = sal
+TARGET = qa_osl_setthreadname
+
+ENABLE_EXCEPTIONS = TRUE
+
+.INCLUDE: settings.mk
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
+DLLPRE =
+
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLO)/test-setthreadname.obj
+SHL1RPATH = NONE
+SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
+SHL1TARGET = test-setthreadname
+SHL1VERSIONMAP = version.map
+DEF1NAME = $(SHL1TARGET)
+
+SLOFILES = $(SHL1OBJS)
+
+.INCLUDE: target.mk
+.INCLUDE: _cppunit.mk
+
+.END
diff --git a/sal/qa/osl/setthreadname/test-setthreadname.cxx b/sal/qa/osl/setthreadname/test-setthreadname.cxx
new file mode 100755
index 000000000000..0f0f618395a8
--- /dev/null
+++ b/sal/qa/osl/setthreadname/test-setthreadname.cxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2011 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public 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_sal.hxx"
+#include "sal/config.h"
+
+#include <cstdlib>
+#include <iostream>
+#include <limits>
+
+#include "boost/noncopyable.hpp"
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "osl/thread.hxx"
+
+namespace {
+
+class TestThread: public osl::Thread, private boost::noncopyable {
+private:
+ virtual void SAL_CALL run();
+};
+
+void TestThread::run() {
+#if defined WNT
+ if (std::getenv("URE_TEST_SETTHREADNAME") != 0) {
+ // On Windows, setting thread names appears to only take effect when the
+ // process is being debugged, so attach a debugger now:
+ std::cout << "set: ";
+ std::cin.ignore(std::numeric_limits< int >::max(), '\n');
+ }
+#endif
+ setName("TestThread");
+ if (std::getenv("URE_TEST_SETTHREADNAME") != 0) {
+ // On Linux, the thread name can now be observed with "ps -L"; on
+ // Windows with the Microsoft compiler, the thread name can now be
+ // observed in a debugger.
+ std::cout << "stop: ";
+ std::cin.ignore(std::numeric_limits< int >::max(), '\n');
+ }
+}
+
+class Test: public CppUnit::TestFixture {
+private:
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+
+ void test();
+};
+
+void Test::test() {
+ TestThread t;
+ t.create();
+ t.join();
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sal/qa/osl/setthreadname/version.map b/sal/qa/osl/setthreadname/version.map
new file mode 100644
index 000000000000..ef2ab497cb5e
--- /dev/null
+++ b/sal/qa/osl/setthreadname/version.map
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+UDK_3_0_0 {
+ global:
+ cppunitTestPlugIn;
+
+ local:
+ *;
+};
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 8b1c079ec899..73ae4431100e 100755
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -602,6 +602,7 @@ UDK_3.11 { # OOo 3.4
global:
osl_setEnvironment;
osl_clearEnvironment;
+ osl_setThreadName;
} UDK_3.10;
PRIVATE_1.0 {
diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx
index b1c00d0636c6..ed66751364a5 100644
--- a/sc/inc/dpglobal.hxx
+++ b/sc/inc/dpglobal.hxx
@@ -62,8 +62,6 @@
// moved from fieldwnd.hxx, see also SC_DAPI_MAXFIELDS
#define MAX_LABELS 256
-#define MAX_PAGEFIELDS 10 // maximum count of fields for page area
-
#define PIVOT_MAXFUNC 11
#define PIVOT_FUNC_NONE 0x0000
#define PIVOT_FUNC_SUM 0x0001
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 8e15bd55068d..e69f8e8c3a3f 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -208,7 +208,7 @@ public:
void ToggleDetails(const ::com::sun::star::sheet::DataPilotTableHeaderData& rElemDesc, ScDPObject* pDestObj);
- sal_Bool FillOldParam(ScPivotParam& rParam, sal_Bool bForFile) const;
+ sal_Bool FillOldParam(ScPivotParam& rParam) const;
sal_Bool FillLabelData(ScPivotParam& rParam);
void InitFromOldPivot(const ScPivot& rOld, ScDocument* pDoc, sal_Bool bSetSource);
@@ -251,14 +251,14 @@ public:
CreateSource( const ScDPServiceDesc& rDesc );
static void ConvertOrientation( ScDPSaveData& rSaveData,
- PivotField* pFields, SCSIZE nCount, sal_uInt16 nOrient,
+ const ScPivotFieldVector& rFields, sal_uInt16 nOrient,
ScDocument* pDoc, SCROW nRow, SCTAB nTab,
const com::sun::star::uno::Reference<
com::sun::star::sheet::XDimensionsSupplier>& xSource,
- sal_Bool bOldDefaults,
- PivotField* pRefColFields = NULL, SCSIZE nRefColCount = 0,
- PivotField* pRefRowFields = NULL, SCSIZE nRefRowCount = 0,
- PivotField* pRefPageFields = NULL, SCSIZE nRefPageCount = 0 );
+ bool bOldDefaults,
+ const ScPivotFieldVector* pRefColFields = 0,
+ const ScPivotFieldVector* pRefRowFields = 0,
+ const ScPivotFieldVector* pRefPageFields = 0 );
static bool IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags );
};
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index d0df5e3e2426..766c8c551d5d 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -118,13 +118,9 @@ const sal_Unicode CHAR_ZWNBSP = 0x2060;
#ifdef SC_ROWLIMIT_TYPECONVERSION_NOCONVPASS
const size_t MAXSUBTOTAL = 3;
const size_t MAXQUERY = 8;
-const size_t PIVOT_MAXFIELD = 8;
-const size_t PIVOT_MAXPAGEFIELD = 10;
#else
const SCSIZE MAXSUBTOTAL = 3;
const SCSIZE MAXQUERY = 8;
-const SCSIZE PIVOT_MAXFIELD = 8;
-const SCSIZE PIVOT_MAXPAGEFIELD = 10;
#endif
#define SC_START_INDEX_DB_COLL 50000
diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx
index dbf54fb6ed82..b2fca0460b8a 100644
--- a/sc/inc/pivot.hxx
+++ b/sc/inc/pivot.hxx
@@ -68,78 +68,15 @@ class SvStream;
class ScDocument;
class ScUserListData;
class ScProgress;
-struct ScDPLabelData;
-typedef ::boost::shared_ptr<ScDPLabelData> ScDPLabelDataRef;
-
-// -----------------------------------------------------------------------
-
-struct PivotField
-{
- SCsCOL nCol;
- sal_uInt16 nFuncMask;
- sal_uInt16 nFuncCount;
- ::com::sun::star::sheet::DataPilotFieldReference maFieldRef;
-
- explicit PivotField( SCsCOL nNewCol = 0, sal_uInt16 nNewFuncMask = PIVOT_FUNC_NONE );
-
- bool operator==( const PivotField& r ) const;
-};
-
-// -----------------------------------------------------------------------
-
-// implementation still in global2.cxx
-struct ScPivotParam
-{
- SCCOL nCol; // Cursor Position /
- SCROW nRow; // bzw. Anfang des Zielbereiches
- SCTAB nTab;
- ::std::vector<ScDPLabelDataRef> maLabelArray;
- PivotField aPageArr[PIVOT_MAXPAGEFIELD];
- PivotField aColArr[PIVOT_MAXFIELD];
- PivotField aRowArr[PIVOT_MAXFIELD];
- PivotField aDataArr[PIVOT_MAXFIELD];
- SCSIZE nPageCount;
- SCSIZE nColCount;
- SCSIZE nRowCount;
- SCSIZE nDataCount;
- sal_Bool bIgnoreEmptyRows;
- sal_Bool bDetectCategories;
- sal_Bool bMakeTotalCol;
- sal_Bool bMakeTotalRow;
-
- ScPivotParam();
- ScPivotParam( const ScPivotParam& r );
- ~ScPivotParam();
-
- ScPivotParam& operator= ( const ScPivotParam& r );
- sal_Bool operator== ( const ScPivotParam& r ) const;
-//UNUSED2009-05 void Clear ();
- void ClearPivotArrays();
- void SetLabelData (const ::std::vector<ScDPLabelDataRef>& r);
- void SetPivotArrays ( const PivotField* pPageArr,
- const PivotField* pColArr,
- const PivotField* pRowArr,
- const PivotField* pDataArr,
- SCSIZE nPageCnt,
- SCSIZE nColCnt,
- SCSIZE nRowCnt,
- SCSIZE nDataCnt );
-};
-
-// -----------------------------------------------------------------------
-
-typedef PivotField PivotFieldArr[PIVOT_MAXFIELD];
-typedef PivotField PivotPageFieldArr[PIVOT_MAXPAGEFIELD];
-
-//------------------------------------------------------------------------
+// ============================================================================
struct ScDPLabelData
{
::rtl::OUString maName; /// Original name of the dimension.
::rtl::OUString maLayoutName; /// Layout name (display name)
- SCsCOL mnCol;
- sal_uInt16 mnFuncMask; /// Page/Column/Row subtotal function.
+ SCCOL mnCol;
+ sal_uInt16 mnFuncMask; /// Page/Column/Row subtotal function.
sal_Int32 mnUsedHier; /// Used hierarchy.
sal_Int32 mnFlags; /// Flags from the DataPilotSource dimension
bool mbShowAll; /// true = Show all (also empty) results.
@@ -167,7 +104,7 @@ struct ScDPLabelData
::com::sun::star::sheet::DataPilotFieldLayoutInfo maLayoutInfo; /// Layout info.
::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo; /// AutoShow info.
- explicit ScDPLabelData( const String& rName, short nCol, bool bIsValue );
+ explicit ScDPLabelData( const String& rName, SCCOL nCol, bool bIsValue );
/**
* return the name that should be displayed in the dp dialogs i.e. when
@@ -176,22 +113,63 @@ struct ScDPLabelData
::rtl::OUString SC_DLLPUBLIC getDisplayName() const;
};
+typedef std::vector< ScDPLabelData > ScDPLabelDataVector;
+
+// ============================================================================
+
+struct ScPivotField
+{
+ SCCOL nCol;
+ sal_uInt16 nFuncMask;
+ sal_uInt16 nFuncCount;
+ ::com::sun::star::sheet::DataPilotFieldReference maFieldRef;
+
+ explicit ScPivotField( SCCOL nNewCol = 0, sal_uInt16 nNewFuncMask = PIVOT_FUNC_NONE );
+
+ bool operator==( const ScPivotField& r ) const;
+};
+
+typedef ::std::vector< ScPivotField > ScPivotFieldVector;
+
+// ============================================================================
+
+struct ScPivotParam
+{
+ SCCOL nCol; // Cursor Position /
+ SCROW nRow; // bzw. Anfang des Zielbereiches
+ SCTAB nTab;
+ ScDPLabelDataVector maLabelArray;
+ ScPivotFieldVector maPageArr;
+ ScPivotFieldVector maColArr;
+ ScPivotFieldVector maRowArr;
+ ScPivotFieldVector maDataArr;
+ bool bIgnoreEmptyRows;
+ bool bDetectCategories;
+ bool bMakeTotalCol;
+ bool bMakeTotalRow;
+
+ ScPivotParam();
+
+ bool operator==( const ScPivotParam& r ) const;
+};
+
// ============================================================================
-struct ScDPFuncData
+struct ScPivotFuncData
{
- short mnCol;
- sal_uInt16 mnFuncMask;
+ SCCOL mnCol;
+ sal_uInt16 mnFuncMask;
::com::sun::star::sheet::DataPilotFieldReference maFieldRef;
- explicit ScDPFuncData( short nNewCol, sal_uInt16 nNewFuncMask );
- explicit ScDPFuncData( short nNewCol, sal_uInt16 nNewFuncMask,
+ explicit ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask );
+ explicit ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask,
const ::com::sun::star::sheet::DataPilotFieldReference& rFieldRef );
};
+typedef ::std::vector< ScPivotFuncData > ScPivotFuncDataVector;
+
// ============================================================================
-typedef std::vector< ScDPLabelData > ScDPLabelDataVec;
typedef std::vector< String > ScDPNameVec;
// ============================================================================
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index b38bec784b54..9e5d40cd7108 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -993,6 +993,14 @@
#define STR_ACC_DATAPILOT_DATA_DESCR (STR_START + 180)
#define STR_ACC_DATAPILOT_SEL_DESCR (STR_START + 181)
+//IAccessibility2 Implementation 2009-----
+#define STR_ACC_TOOLBAR_FORMULA (STR_START + 182)
+#define STR_ACC_DOC_SPREADSHEET (STR_START + 185)
+#define STR_ACC_DOC_PREVIEW_SUFFIX (STR_START + 186)
+#define STR_ACC_DOC_SPREADSHEET_READONLY (STR_START + 187)
+
+//-----IAccessibility2 Implementation 2009
+
// --------------------------------------------------
#define SCSTR_HUMAN_SCDOC_NAME (STR_START + 210)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 247ee21fe76b..36bf1ff7e76a 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -51,7 +51,7 @@ class ScQueryItem;
class ScImportOptions;
class SfxStyleSheetBase;
class ScDPObject;
-struct ScDPFuncData;
+struct ScPivotFuncData;
struct ScDPNumGroupInfo;
//<!--Added by PengYunQuan for Validity Cell Range Picker
class ScTabViewShell;
@@ -405,14 +405,14 @@ public:
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId ) = 0;
virtual AbstractScDPFunctionDlg * CreateScDPFunctionDlg( Window* pParent, int nId,
- const ScDPLabelDataVec& rLabelVec,
+ const ScDPLabelDataVector& rLabelVec,
const ScDPLabelData& rLabelData,
- const ScDPFuncData& rFuncData ) = 0;
+ const ScPivotFuncData& rFuncData ) = 0;
virtual AbstractScDPSubtotalDlg * CreateScDPSubtotalDlg( Window* pParent, int nId,
ScDPObject& rDPObj,
const ScDPLabelData& rLabelData,
- const ScDPFuncData& rFuncData,
+ const ScPivotFuncData& rFuncData,
const ScDPNameVec& rDataFields,
bool bEnableLayout ) = 0;
diff --git a/sc/prj/build.lst b/sc/prj/build.lst
index f5ab2a5f73fe..f124dafb90a2 100644
--- a/sc/prj/build.lst
+++ b/sc/prj/build.lst
@@ -1,4 +1,4 @@
-sc sc : filter l10n vbahelper oovbaapi svx uui stoc BOOST:boost formula MDDS:mdds oox LIBXSLT:libxslt NULL
+sc sc : filter L10N:l10n vbahelper oovbaapi svx uui stoc BOOST:boost formula MDDS:mdds oox LIBXSLT:libxslt NULL
sc sc usr1 - all sc_mkout NULL
sc sc\inc nmake - all sc_inc NULL
sc sc\prj get - all sc_prj NULL
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 80e9038cc539..714467d8e5eb 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1986,7 +1986,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
SetInsertingFromOtherDoc( sal_True);
UpdateReference( URM_MOVE,
nCol1, nRow1, i, nCol2, nRow2, i+nFollow,
- nDx, nDy, nDz, pCBFCP->pRefUndoDoc );
+ nDx, nDy, nDz, pCBFCP->pRefUndoDoc, sal_False );
SetInsertingFromOtherDoc( bOldInserting);
}
else
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 149c712fbdcf..ad1932303da0 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -1711,24 +1711,22 @@ sal_uInt16 lcl_CountBits( sal_uInt16 nBits )
return nCount;
}
-SCSIZE lcl_FillOldFields( PivotField* pFields,
+void lcl_FillOldFields( ScPivotFieldVector& rFields,
const uno::Reference<sheet::XDimensionsSupplier>& xSource,
- sal_uInt16 nOrient, SCCOL nColAdd, sal_Bool bAddData )
+ sal_uInt16 nOrient, SCCOL nColAdd, bool bAddData )
{
- SCSIZE nOutCount = 0;
- sal_Bool bDataFound = sal_False;
-
- SCSIZE nCount = (nOrient == sheet::DataPilotFieldOrientation_PAGE) ? PIVOT_MAXPAGEFIELD : PIVOT_MAXFIELD;
+ bool bDataFound = false;
+ rFields.clear();
//! merge multiple occurences (data field with different functions)
//! force data field in one dimension
- std::vector< long > aPos( nCount, 0 );
+ std::vector< long > aPos;
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName );
long nDimCount = xDims->getCount();
- for (long nDim=0; nDim < nDimCount && nOutCount < nCount; nDim++)
+ for (long nDim=0; nDim < nDimCount; nDim++)
{
uno::Reference<uno::XInterface> xIntDim =
ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) );
@@ -1775,7 +1773,7 @@ SCSIZE lcl_FillOldFields( PivotField* pFields,
nDupSource = lcl_FindName( xNameOrig->getName(), xDimsName );
}
- sal_Bool bDupUsed = sal_False;
+ bool bDupUsed = false;
if ( nDupSource >= 0 )
{
// add function bit to previous entry
@@ -1786,77 +1784,76 @@ SCSIZE lcl_FillOldFields( PivotField* pFields,
else
nCompCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek source column from name
- for (SCSIZE nOld=0; nOld<nOutCount && !bDupUsed; nOld++)
- if ( pFields[nOld].nCol == nCompCol )
+ for (ScPivotFieldVector::iterator aIt = rFields.begin(), aEnd = rFields.end(); (aIt != aEnd) && !bDupUsed; ++aIt)
+ if ( aIt->nCol == nCompCol )
{
// add to previous column only if new bits aren't already set there
- if ( ( pFields[nOld].nFuncMask & nMask ) == 0 )
+ if ( ( aIt->nFuncMask & nMask ) == 0 )
{
- pFields[nOld].nFuncMask |= nMask;
- pFields[nOld].nFuncCount = lcl_CountBits( pFields[nOld].nFuncMask );
- bDupUsed = sal_True;
+ aIt->nFuncMask |= nMask;
+ aIt->nFuncCount = lcl_CountBits( aIt->nFuncMask );
+ bDupUsed = true;
}
}
}
if ( !bDupUsed ) // also for duplicated dim if original has different orientation
{
+ rFields.resize( rFields.size() + 1 );
+ ScPivotField& rField = rFields.back();
+
if ( bDataLayout )
{
- pFields[nOutCount].nCol = PIVOT_DATA_FIELD;
- bDataFound = sal_True;
+ rField.nCol = PIVOT_DATA_FIELD;
+ bDataFound = true;
}
else if ( nDupSource >= 0 ) // if source was not found (different orientation)
- pFields[nOutCount].nCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek from name
+ rField.nCol = static_cast<SCsCOL>(nDupSource)+nColAdd; //! seek from name
else
- pFields[nOutCount].nCol = static_cast<SCsCOL>(nDim)+nColAdd; //! seek source column from name
+ rField.nCol = static_cast<SCsCOL>(nDim)+nColAdd; //! seek source column from name
- pFields[nOutCount].nFuncMask = nMask;
- pFields[nOutCount].nFuncCount = lcl_CountBits( nMask );
- aPos[nOutCount] = ScUnoHelpFunctions::GetLongProperty( xDimProp,
- rtl::OUString::createFromAscii(DP_PROP_POSITION) );
+ rField.nFuncMask = nMask;
+ rField.nFuncCount = lcl_CountBits( nMask );
+
+ aPos.push_back( ScUnoHelpFunctions::GetLongProperty( xDimProp,
+ rtl::OUString::createFromAscii(DP_PROP_POSITION) ) );
try
{
if( nOrient == sheet::DataPilotFieldOrientation_DATA )
xDimProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_REFVALUE ) ) )
- >>= pFields[nOutCount].maFieldRef;
+ >>= rFields.back().maFieldRef;
}
catch( uno::Exception& )
{
}
-
- ++nOutCount;
}
}
}
// sort by getPosition() value
-
- for (SCSIZE i=0; i+1<nOutCount; i++)
+ size_t nSize = aPos.size();
+ for (size_t i=0; i+1<nSize; i++)
{
- for (SCSIZE j=0; j+i+1<nOutCount; j++)
+ for (size_t j=0; j+i+1<nSize; j++)
if ( aPos[j+1] < aPos[j] )
{
std::swap( aPos[j], aPos[j+1] );
- std::swap( pFields[j], pFields[j+1] );
+ std::swap( rFields[j], rFields[j+1] );
}
}
if ( bAddData && !bDataFound )
{
- if ( nOutCount >= nCount ) // space for data field?
- --nOutCount; //! error?
- pFields[nOutCount].nCol = PIVOT_DATA_FIELD;
- pFields[nOutCount].nFuncMask = 0;
- pFields[nOutCount].nFuncCount = 0;
- ++nOutCount;
+ rFields.resize( rFields.size() + 1 );
+ ScPivotField& rField = rFields.back();
+ rField.nCol = PIVOT_DATA_FIELD;
+ rField.nFuncMask = 0;
+ rField.nFuncCount = 0;
}
-
- return nOutCount;
}
-sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam, sal_Bool bForFile) const
+sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const
{
((ScDPObject*)this)->CreateObjects(); // xSource is needed for field numbers
@@ -1866,23 +1863,11 @@ sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam, sal_Bool bForFile) const
// ppLabelArr / nLabels is not changed
SCCOL nColAdd = 0;
- if ( bForFile )
- {
- // in old file format, columns are within document, not within source range
-
- DBG_ASSERT( pSheetDesc, "FillOldParam: bForFile, !pSheetDesc" );
- nColAdd = pSheetDesc->aSourceRange.aStart.Col();
- }
-
- sal_Bool bAddData = ( lcl_GetDataGetOrientation( xSource ) == sheet::DataPilotFieldOrientation_HIDDEN );
- rParam.nPageCount = lcl_FillOldFields( rParam.aPageArr,
- xSource, sheet::DataPilotFieldOrientation_PAGE, nColAdd, sal_False );
- rParam.nColCount = lcl_FillOldFields( rParam.aColArr,
- xSource, sheet::DataPilotFieldOrientation_COLUMN, nColAdd, bAddData );
- rParam.nRowCount = lcl_FillOldFields( rParam.aRowArr,
- xSource, sheet::DataPilotFieldOrientation_ROW, nColAdd, sal_False );
- rParam.nDataCount = lcl_FillOldFields( rParam.aDataArr,
- xSource, sheet::DataPilotFieldOrientation_DATA, nColAdd, sal_False );
+ bool bAddData = ( lcl_GetDataGetOrientation( xSource ) == sheet::DataPilotFieldOrientation_HIDDEN );
+ lcl_FillOldFields( rParam.maPageArr, xSource, sheet::DataPilotFieldOrientation_PAGE, nColAdd, false );
+ lcl_FillOldFields( rParam.maColArr, xSource, sheet::DataPilotFieldOrientation_COLUMN, nColAdd, bAddData );
+ lcl_FillOldFields( rParam.maRowArr, xSource, sheet::DataPilotFieldOrientation_ROW, nColAdd, false );
+ lcl_FillOldFields( rParam.maDataArr, xSource, sheet::DataPilotFieldOrientation_DATA, nColAdd, false );
uno::Reference<beans::XPropertySet> xProp( xSource, uno::UNO_QUERY );
if (xProp.is())
@@ -2003,14 +1988,14 @@ sal_Bool ScDPObject::FillLabelData(ScPivotParam& rParam)
SCsCOL nCol = static_cast< SCsCOL >( nDim ); //! ???
bool bIsValue = true; //! check
- ScDPLabelDataRef pNewLabel(new ScDPLabelData(aFieldName, nCol, bIsValue));
- pNewLabel->maLayoutName = aLayoutName;
- GetHierarchies(nDim, pNewLabel->maHiers);
- GetMembers(nDim, GetUsedHierarchy(nDim), pNewLabel->maMembers);
- lcl_FillLabelData(*pNewLabel, xDimProp);
- pNewLabel->mnFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
+ ScDPLabelData aNewLabel(aFieldName, nCol, bIsValue);
+ aNewLabel.maLayoutName = aLayoutName;
+ GetHierarchies(nDim, aNewLabel.maHiers);
+ GetMembers(nDim, GetUsedHierarchy(nDim), aNewLabel.maMembers);
+ lcl_FillLabelData(aNewLabel, xDimProp);
+ aNewLabel.mnFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 );
- rParam.maLabelArray.push_back(pNewLabel);
+ rParam.maLabelArray.push_back(aNewLabel);
}
}
}
@@ -2131,13 +2116,13 @@ String lcl_GetDimName( const uno::Reference<sheet::XDimensionsSupplier>& xSource
// static
void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData,
- PivotField* pFields, SCSIZE nCount, sal_uInt16 nOrient,
+ const ScPivotFieldVector& rFields, sal_uInt16 nOrient,
ScDocument* pDoc, SCROW nRow, SCTAB nTab,
const uno::Reference<sheet::XDimensionsSupplier>& xSource,
- sal_Bool bOldDefaults,
- PivotField* pRefColFields, SCSIZE nRefColCount,
- PivotField* pRefRowFields, SCSIZE nRefRowCount,
- PivotField* pRefPageFields, SCSIZE nRefPageCount )
+ bool bOldDefaults,
+ const ScPivotFieldVector* pRefColFields,
+ const ScPivotFieldVector* pRefRowFields,
+ const ScPivotFieldVector* pRefPageFields )
{
// pDoc or xSource must be set
DBG_ASSERT( pDoc || xSource.is(), "missing string source" );
@@ -2145,11 +2130,11 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData,
String aDocStr;
ScDPSaveDimension* pDim;
- for (SCSIZE i=0; i<nCount; i++)
+ for (ScPivotFieldVector::const_iterator aIt = rFields.begin(), aEnd = rFields.end(); aIt != aEnd; ++aIt)
{
- SCCOL nCol = pFields[i].nCol;
- sal_uInt16 nFuncs = pFields[i].nFuncMask;
- const sheet::DataPilotFieldReference& rFieldRef = pFields[i].maFieldRef;
+ SCCOL nCol = aIt->nCol;
+ sal_uInt16 nFuncs = aIt->nFuncMask;
+ const sheet::DataPilotFieldReference& rFieldRef = aIt->maFieldRef;
if ( nCol == PIVOT_DATA_FIELD )
pDim = rSaveData.GetDataLayoutDimension();
@@ -2171,28 +2156,28 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData,
if ( nOrient == sheet::DataPilotFieldOrientation_DATA ) // set summary function
{
// generate an individual entry for each function
- sal_Bool bFirst = sal_True;
+ bool bFirst = true;
// if a dimension is used for column/row/page and data,
// use duplicated dimensions for all data occurrences
if (pRefColFields)
- for (SCSIZE nRefCol=0; nRefCol<nRefColCount; nRefCol++)
- if (pRefColFields[nRefCol].nCol == nCol)
- bFirst = sal_False;
+ for (ScPivotFieldVector::const_iterator aRefIt = pRefColFields->begin(), aRefEnd = pRefColFields->end(); bFirst && (aRefIt != aRefEnd); ++aRefIt)
+ if (aRefIt->nCol == nCol)
+ bFirst = false;
if (pRefRowFields)
- for (SCSIZE nRefRow=0; nRefRow<nRefRowCount; nRefRow++)
- if (pRefRowFields[nRefRow].nCol == nCol)
- bFirst = sal_False;
+ for (ScPivotFieldVector::const_iterator aRefIt = pRefRowFields->begin(), aRefEnd = pRefRowFields->end(); bFirst && (aRefIt != aRefEnd); ++aRefIt)
+ if (aRefIt->nCol == nCol)
+ bFirst = false;
if (pRefPageFields)
- for (sal_uInt16 nRefPage=0; nRefPage<nRefPageCount; ++nRefPage)
- if (pRefPageFields[nRefPage].nCol == nCol)
- bFirst = sal_False;
+ for (ScPivotFieldVector::const_iterator aRefIt = pRefPageFields->begin(), aRefEnd = pRefPageFields->end(); bFirst && (aRefIt != aRefEnd); ++aRefIt)
+ if (aRefIt->nCol == nCol)
+ bFirst = false;
// if set via api, a data column may occur several times
// (if the function hasn't been changed yet) -> also look for duplicate data column
- for (SCSIZE nPrevData=0; nPrevData<i; nPrevData++)
- if (pFields[nPrevData].nCol == nCol)
- bFirst = sal_False;
+ for (ScPivotFieldVector::const_iterator aRefIt = rFields.begin(); bFirst && (aRefIt != aIt); ++aRefIt)
+ if (aRefIt->nCol == nCol)
+ bFirst = false;
sal_uInt16 nMask = 1;
for (sal_uInt16 nBit=0; nBit<16; nBit++)
@@ -2209,7 +2194,7 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData,
else
pCurrDim->SetReferenceValue( &rFieldRef );
- bFirst = sal_False;
+ bFirst = false;
}
nMask *= 2;
}
@@ -2511,7 +2496,7 @@ ScDPObject* ScDPCollection::GetByName(const String& rName) const
String ScDPCollection::CreateNewName( sal_uInt16 nMin ) const
{
- String aBase = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("DataPilot"));
+ String aBase( RTL_CONSTASCII_USTRINGPARAM( "Pivot" ) );
//! from Resource?
for (sal_uInt16 nAdd=0; nAdd<=nCount; nAdd++) // nCount+1 tries
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index f79d403683f6..3b64328f8b3b 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -45,14 +45,9 @@
#include "global.hxx"
#include "rangeutl.hxx"
-#include "pivot.hxx"
#include "rechead.hxx"
#include "compiler.hxx"
#include "paramisc.hxx"
-// Wang Xu Ming -- 2009-5-18
-// DataPilot Migration
-#include "dpglobal.hxx"
-// End Comments
#include "sc.hrc"
#include "globstr.hrc"
@@ -566,179 +561,6 @@ void __EXPORT ScConsolidateParam::SetAreas( ScArea* const* ppAreas, sal_uInt16 n
}
}
-// -----------------------------------------------------------------------
-
-PivotField::PivotField( SCsCOL nNewCol, sal_uInt16 nNewFuncMask ) :
- nCol( nNewCol ),
- nFuncMask( nNewFuncMask ),
- nFuncCount( 0 )
-{
-}
-
-bool PivotField::operator==( const PivotField& r ) const
-{
- return (nCol == r.nCol)
- && (nFuncMask == r.nFuncMask)
- && (nFuncCount == r.nFuncCount)
- && (maFieldRef.ReferenceType == r.maFieldRef.ReferenceType)
- && (maFieldRef.ReferenceField == r.maFieldRef.ReferenceField)
- && (maFieldRef.ReferenceItemType == r.maFieldRef.ReferenceItemType)
- && (maFieldRef.ReferenceItemName == r.maFieldRef.ReferenceItemName);
-}
-
-//------------------------------------------------------------------------
-// struct ScPivotParam:
-
-ScPivotParam::ScPivotParam()
- : nCol(0), nRow(0), nTab(0),
- nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0),
- bIgnoreEmptyRows(sal_False), bDetectCategories(sal_False),
- bMakeTotalCol(sal_True), bMakeTotalRow(sal_True)
-{
-}
-
-//------------------------------------------------------------------------
-
-ScPivotParam::ScPivotParam( const ScPivotParam& r )
- : nCol( r.nCol ), nRow( r.nRow ), nTab( r.nTab ),
- nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0),
- bIgnoreEmptyRows(r.bIgnoreEmptyRows),
- bDetectCategories(r.bDetectCategories),
- bMakeTotalCol(r.bMakeTotalCol),
- bMakeTotalRow(r.bMakeTotalRow)
-{
- SetPivotArrays ( r.aPageArr, r.aColArr, r.aRowArr, r.aDataArr,
- r.nPageCount, r.nColCount, r.nRowCount, r.nDataCount );
-
- SetLabelData(r.maLabelArray);
-}
-
-//------------------------------------------------------------------------
-
-__EXPORT ScPivotParam::~ScPivotParam()
-{
-}
-
-//------------------------------------------------------------------------
-
-//UNUSED2009-05 void __EXPORT ScPivotParam::Clear()
-//UNUSED2009-05 {
-//UNUSED2009-05 nCol = 0;
-//UNUSED2009-05 nRow = 0;
-//UNUSED2009-05 nTab = 0;
-//UNUSED2009-05 bIgnoreEmptyRows = bDetectCategories = sal_False;
-//UNUSED2009-05 bMakeTotalCol = bMakeTotalRow = sal_True;
-//UNUSED2009-05 ClearLabelData();
-//UNUSED2009-05 ClearPivotArrays();
-//UNUSED2009-05 }
-
-void __EXPORT ScPivotParam::ClearPivotArrays()
-{
- memset( aPageArr, 0, PIVOT_MAXPAGEFIELD * sizeof(PivotField) );
- memset( aColArr, 0, PIVOT_MAXFIELD * sizeof(PivotField) );
- memset( aRowArr, 0, PIVOT_MAXFIELD * sizeof(PivotField) );
- memset( aDataArr, 0, PIVOT_MAXFIELD * sizeof(PivotField) );
- nPageCount = 0;
- nColCount = 0;
- nRowCount = 0;
- nDataCount = 0;
-}
-
-void ScPivotParam::SetLabelData(const vector<ScDPLabelDataRef>& r)
-{
- vector<ScDPLabelDataRef> aNewArray;
- aNewArray.reserve(r.size());
- for (vector<ScDPLabelDataRef>::const_iterator itr = r.begin(), itrEnd = r.end();
- itr != itrEnd; ++itr)
- {
- ScDPLabelDataRef p(new ScDPLabelData(**itr));
- aNewArray.push_back(p);
- }
- maLabelArray.swap(aNewArray);
-}
-
-//------------------------------------------------------------------------
-
-void __EXPORT ScPivotParam::SetPivotArrays ( const PivotField* pPageArr,
- const PivotField* pColArr,
- const PivotField* pRowArr,
- const PivotField* pDataArr,
- SCSIZE nPageCnt,
- SCSIZE nColCnt,
- SCSIZE nRowCnt,
- SCSIZE nDataCnt )
-{
- ClearPivotArrays();
-
- if ( pPageArr && pColArr && pRowArr && pDataArr )
- {
- nPageCount = (nPageCnt>PIVOT_MAXPAGEFIELD) ? PIVOT_MAXPAGEFIELD : nPageCnt;
- nColCount = (nColCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nColCnt;
- nRowCount = (nRowCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nRowCnt;
- nDataCount = (nDataCnt>PIVOT_MAXFIELD) ? PIVOT_MAXFIELD : nDataCnt;
-
- memcpy( aPageArr, pPageArr, nPageCount * sizeof(PivotField) );
- memcpy( aColArr, pColArr, nColCount * sizeof(PivotField) );
- memcpy( aRowArr, pRowArr, nRowCount * sizeof(PivotField) );
- memcpy( aDataArr, pDataArr, nDataCount * sizeof(PivotField) );
- }
-}
-
-//------------------------------------------------------------------------
-
-ScPivotParam& __EXPORT ScPivotParam::operator=( const ScPivotParam& r )
-{
- nCol = r.nCol;
- nRow = r.nRow;
- nTab = r.nTab;
- bIgnoreEmptyRows = r.bIgnoreEmptyRows;
- bDetectCategories = r.bDetectCategories;
- bMakeTotalCol = r.bMakeTotalCol;
- bMakeTotalRow = r.bMakeTotalRow;
-
- SetPivotArrays ( r.aPageArr, r.aColArr, r.aRowArr, r.aDataArr,
- r.nPageCount, r.nColCount, r.nRowCount, r.nDataCount );
- SetLabelData(r.maLabelArray);
- return *this;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool __EXPORT ScPivotParam::operator==( const ScPivotParam& r ) const
-{
- sal_Bool bEqual = (nCol == r.nCol)
- && (nRow == r.nRow)
- && (nTab == r.nTab)
- && (bIgnoreEmptyRows == r.bIgnoreEmptyRows)
- && (bDetectCategories == r.bDetectCategories)
- && (bMakeTotalCol == r.bMakeTotalCol)
- && (bMakeTotalRow == r.bMakeTotalRow)
- && (maLabelArray.size() == r.maLabelArray.size())
- && (nPageCount == r.nPageCount)
- && (nColCount == r.nColCount)
- && (nRowCount == r.nRowCount)
- && (nDataCount == r.nDataCount);
-
- if ( bEqual )
- {
- SCSIZE i;
-
- for ( i=0; i<nPageCount && bEqual; i++ )
- bEqual = ( aPageArr[i] == r.aPageArr[i] );
-
- for ( i=0; i<nColCount && bEqual; i++ )
- bEqual = ( aColArr[i] == r.aColArr[i] );
-
- for ( i=0; i<nRowCount && bEqual; i++ )
- bEqual = ( aRowArr[i] == r.aRowArr[i] );
-
- for ( i=0; i<nDataCount && bEqual; i++ )
- bEqual = ( aDataArr[i] == r.aDataArr[i] );
- }
-
- return bEqual;
-}
-
//------------------------------------------------------------------------
// struct ScSolveParam
diff --git a/sc/source/core/data/makefile.mk b/sc/source/core/data/makefile.mk
index 51c01febcd36..b164721744b7 100644
--- a/sc/source/core/data/makefile.mk
+++ b/sc/source/core/data/makefile.mk
@@ -131,6 +131,7 @@ EXCEPTIONSFILES= \
$(SLO)$/dptabres.obj \
$(SLO)$/dptabdat.obj \
$(SLO)$/global2.obj \
+ $(SLO)$/pivot2.obj \
$(SLO)$/tabbgcolor.obj \
$(SLO)$/table1.obj \
$(SLO)$/table2.obj \
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index dc1ac56438f7..6b540781b66d 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -28,8 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
#ifdef _MSC_VER
#pragma optimize("",off)
#endif
@@ -60,7 +58,6 @@
using ::com::sun::star::sheet::DataPilotFieldReference;
using ::rtl::OUString;
-// STATIC DATA -----------------------------------------------------------
// ============================================================================
ScDPLabelData::Member::Member() :
@@ -77,7 +74,7 @@ OUString ScDPLabelData::Member::getDisplayName() const
return maName;
}
-ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) :
+ScDPLabelData::ScDPLabelData( const String& rName, SCCOL nCol, bool bIsValue ) :
maName( rName ),
mnCol( nCol ),
mnFuncMask( PIVOT_FUNC_NONE ),
@@ -98,13 +95,59 @@ OUString ScDPLabelData::getDisplayName() const
// ============================================================================
-ScDPFuncData::ScDPFuncData( short nCol, sal_uInt16 nFuncMask ) :
+ScPivotField::ScPivotField( SCCOL nNewCol, sal_uInt16 nNewFuncMask ) :
+ nCol( nNewCol ),
+ nFuncMask( nNewFuncMask ),
+ nFuncCount( 0 )
+{
+}
+
+bool ScPivotField::operator==( const ScPivotField& r ) const
+{
+ return (nCol == r.nCol)
+ && (nFuncMask == r.nFuncMask)
+ && (nFuncCount == r.nFuncCount)
+ && (maFieldRef.ReferenceType == r.maFieldRef.ReferenceType)
+ && (maFieldRef.ReferenceField == r.maFieldRef.ReferenceField)
+ && (maFieldRef.ReferenceItemType == r.maFieldRef.ReferenceItemType)
+ && (maFieldRef.ReferenceItemName == r.maFieldRef.ReferenceItemName);
+}
+
+// ============================================================================
+
+ScPivotParam::ScPivotParam()
+ : nCol( 0 ), nRow( 0 ), nTab( 0 ),
+ bIgnoreEmptyRows( false ), bDetectCategories( false ),
+ bMakeTotalCol( true ), bMakeTotalRow( true )
+{
+}
+
+bool ScPivotParam::operator==( const ScPivotParam& r ) const
+{
+ return
+ (nCol == r.nCol)
+ && (nRow == r.nRow)
+ && (nTab == r.nTab)
+ && (bIgnoreEmptyRows == r.bIgnoreEmptyRows)
+ && (bDetectCategories == r.bDetectCategories)
+ && (bMakeTotalCol == r.bMakeTotalCol)
+ && (bMakeTotalRow == r.bMakeTotalRow)
+ && (maLabelArray.size() == r.maLabelArray.size()) // ! only size??
+ && (maPageArr == r.maPageArr)
+ && (maColArr == r.maColArr)
+ && (maRowArr == r.maRowArr)
+ && (maDataArr == r.maDataArr);
+}
+
+// ============================================================================
+
+ScPivotFuncData::ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask ) :
mnCol( nCol ),
mnFuncMask( nFuncMask )
{
}
-ScDPFuncData::ScDPFuncData( short nCol, sal_uInt16 nFuncMask, const DataPilotFieldReference& rFieldRef ) :
+ScPivotFuncData::ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask, const DataPilotFieldReference& rFieldRef ) :
mnCol( nCol ),
mnFuncMask( nFuncMask ),
maFieldRef( rFieldRef )
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 8edc85ad6f49..fc17f1b6dda5 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -263,8 +263,7 @@ DifParser::DifParser( SvStream& rNewIn, const sal_uInt32 nOption, ScDocument& rD
DBG_ERRORFILE( "CharSet passed overrides and modifies StreamCharSet" );
rIn.SetStreamCharSet( eCharSet );
}
- if ( eCharSet == RTL_TEXTENCODING_UNICODE )
- rIn.StartReadingUnicodeText();
+ rIn.StartReadingUnicodeText( eCharSet );
bPlain = ( nOption == SC_DIFOPT_PLAIN );
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 0d04255f0141..07b4a76a9c82 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
@@ -57,9 +58,9 @@
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
#include <com/sun/star/chart2/TickmarkStyle.hpp>
@@ -94,6 +95,7 @@ using ::com::sun::star::drawing::XShapes;
using ::com::sun::star::chart2::IncrementData;
using ::com::sun::star::chart2::RelativePosition;
+using ::com::sun::star::chart2::RelativeSize;
using ::com::sun::star::chart2::ScaleData;
using ::com::sun::star::chart2::SubIncrement;
using ::com::sun::star::chart2::XAxis;
@@ -820,6 +822,12 @@ void XclExpChFrame::Convert( const ScfPropertySet& rPropSet )
ConvertFrameBase( GetChRoot(), rPropSet, meObjType );
}
+void XclExpChFrame::SetAutoFlags( bool bAutoPos, bool bAutoSize )
+{
+ ::set_flag( maData.mnFlags, EXC_CHFRAME_AUTOPOS, bAutoPos );
+ ::set_flag( maData.mnFlags, EXC_CHFRAME_AUTOSIZE, bAutoSize );
+}
+
bool XclExpChFrame::IsDefault() const
{
return IsDefaultFrameBase( GetFormatInfo( meObjType ).meDefFrameType );
@@ -2287,33 +2295,52 @@ void XclExpChLegend::Convert( const ScfPropertySet& rPropSet )
mxText.reset( new XclExpChText( GetChRoot() ) );
mxText->ConvertLegend( rPropSet );
- // legend position
- Any aRelPosAny;
+ // legend position and size
+ Any aRelPosAny, aRelSizeAny;
rPropSet.GetAnyProperty( aRelPosAny, EXC_CHPROP_RELATIVEPOSITION );
- if( aRelPosAny.has< RelativePosition >() )
+ rPropSet.GetAnyProperty( aRelSizeAny, EXC_CHPROP_RELATIVESIZE );
+ cssc::ChartLegendExpansion eApiExpand = cssc::ChartLegendExpansion_CUSTOM;
+ rPropSet.GetProperty( eApiExpand, EXC_CHPROP_EXPANSION );
+ if( aRelPosAny.has< RelativePosition >() || ((eApiExpand == cssc::ChartLegendExpansion_CUSTOM) && aRelSizeAny.has< RelativeSize >()) )
{
try
{
- /* The 'RelativePosition' property is used as indicator of manually
- changed legend position, but due to the different anchor modes
- 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. */
+ /* The 'RelativePosition' or 'RelativeSize' properties are used as
+ indicator of manually changed legend position/size, but due to
+ the different anchor modes 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< 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 ) );
XclChFramePos& rFramePos = mxFramePos->GetFramePosData();
- rFramePos.maRect.mnX = maData.maRect.mnX = CalcChartXFromHmm( xChart1Legend->getPosition().X );
- rFramePos.maRect.mnY = maData.maRect.mnY = CalcChartYFromHmm( xChart1Legend->getPosition().Y );
+ rFramePos.mnTLMode = EXC_CHFRAMEPOS_CHARTSIZE;
+ ::com::sun::star::awt::Point aLegendPos = xChart1Legend->getPosition();
+ rFramePos.maRect.mnX = maData.maRect.mnX = CalcChartXFromHmm( aLegendPos.X );
+ rFramePos.maRect.mnY = maData.maRect.mnY = CalcChartYFromHmm( aLegendPos.Y );
+ // legend size, Excel expects points in CHFRAMEPOS record
+ rFramePos.mnBRMode = EXC_CHFRAMEPOS_ABSSIZE_POINTS;
+ ::com::sun::star::awt::Size aLegendSize = xChart1Legend->getSize();
+ rFramePos.maRect.mnWidth = static_cast< sal_uInt16 >( aLegendSize.Width * EXC_POINTS_PER_HMM + 0.5 );
+ rFramePos.maRect.mnHeight = static_cast< sal_uInt16 >( aLegendSize.Height * EXC_POINTS_PER_HMM + 0.5 );
+ maData.maRect.mnWidth = CalcChartXFromHmm( aLegendSize.Width );
+ maData.maRect.mnHeight = CalcChartYFromHmm( aLegendSize.Height );
+ eApiExpand = cssc::ChartLegendExpansion_CUSTOM;
// manual legend position implies manual plot area
GetChartData().SetManualPlotArea();
maData.mnDockMode = EXC_CHLEGEND_NOTDOCKED;
+ // a CHFRAME record with cleared auto flags is needed
+ if( !mxFrame )
+ mxFrame.reset( new XclExpChFrame( GetChRoot(), EXC_CHOBJTYPE_LEGEND ) );
+ mxFrame->SetAutoFlags( false, false );
}
catch( Exception& )
{
OSL_ENSURE( false, "XclExpChLegend::Convert - cannot get legend shape" );
maData.mnDockMode = EXC_CHLEGEND_RIGHT;
+ eApiExpand = cssc::ChartLegendExpansion_HIGH;
}
}
else
@@ -2329,13 +2356,10 @@ void XclExpChLegend::Convert( const ScfPropertySet& rPropSet )
default:
OSL_ENSURE( false, "XclExpChLegend::Convert - unrecognized legend position" );
maData.mnDockMode = EXC_CHLEGEND_RIGHT;
+ eApiExpand = cssc::ChartLegendExpansion_HIGH;
}
}
-
- // legend expansion
- cssc2::LegendExpansion eApiExpand = cssc2::LegendExpansion_BALANCED;
- rPropSet.GetProperty( eApiExpand, EXC_CHPROP_EXPANSION );
- ::set_flag( maData.mnFlags, EXC_CHLEGEND_STACKED, eApiExpand != cssc2::LegendExpansion_WIDE );
+ ::set_flag( maData.mnFlags, EXC_CHLEGEND_STACKED, eApiExpand == cssc::ChartLegendExpansion_HIGH );
// other flags
::set_flag( maData.mnFlags, EXC_CHLEGEND_AUTOSERIES );
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 2c8a2baca448..dcd9fc5db164 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -43,6 +43,7 @@
#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/ChartLegendExpansion.hpp>
#include <com/sun/star/chart/TimeInterval.hpp>
#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
@@ -61,11 +62,11 @@
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
#include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
@@ -109,6 +110,7 @@ using ::com::sun::star::drawing::XShape;
using ::com::sun::star::chart2::IncrementData;
using ::com::sun::star::chart2::RelativePosition;
+using ::com::sun::star::chart2::RelativeSize;
using ::com::sun::star::chart2::ScaleData;
using ::com::sun::star::chart2::SubIncrement;
using ::com::sun::star::chart2::XAxis;
@@ -337,14 +339,24 @@ sal_Int32 XclImpChRoot::CalcHmmFromChartY( sal_Int32 nPosY ) const
CalcHmmFromChartY( rRect.mnHeight ) );
}
+double XclImpChRoot::CalcRelativeFromHmmX( sal_Int32 nPosX ) const
+{
+ return static_cast< double >( nPosX ) / mxChData->maChartRect.GetWidth();
+}
+
+double XclImpChRoot::CalcRelativeFromHmmY( sal_Int32 nPosY ) const
+{
+ return static_cast< double >( nPosY ) / mxChData->maChartRect.GetHeight();
+}
+
double XclImpChRoot::CalcRelativeFromChartX( sal_Int32 nPosX ) const
{
- return static_cast< double >( CalcHmmFromChartX( nPosX ) ) / mxChData->maChartRect.GetWidth();
+ return CalcRelativeFromHmmX( CalcHmmFromChartX( nPosX ) );
}
double XclImpChRoot::CalcRelativeFromChartY( sal_Int32 nPosY ) const
{
- return static_cast< double >( CalcHmmFromChartY( nPosY ) ) / mxChData->maChartRect.GetHeight();
+ return CalcRelativeFromHmmY( CalcHmmFromChartY( nPosY ) );
}
void XclImpChRoot::ConvertLineFormat( ScfPropertySet& rPropSet,
@@ -2468,18 +2480,30 @@ Reference< XLegend > XclImpChLegend::CreateLegend() const
manual mode, if the legend is moved or resized). With manual plot
areas, Excel ignores the value in maData.mnDockMode completely. */
cssc2::LegendPosition eApiPos = cssc2::LegendPosition_CUSTOM;
- cssc2::LegendExpansion eApiExpand = cssc2::LegendExpansion_BALANCED;
+ cssc::ChartLegendExpansion eApiExpand = cssc::ChartLegendExpansion_CUSTOM;
if( !GetChartData().IsManualPlotArea() ) switch( maData.mnDockMode )
{
- case EXC_CHLEGEND_LEFT: eApiPos = cssc2::LegendPosition_LINE_START; eApiExpand = cssc2::LegendExpansion_HIGH; break;
- case EXC_CHLEGEND_RIGHT: eApiPos = cssc2::LegendPosition_LINE_END; eApiExpand = cssc2::LegendExpansion_HIGH; break;
- case EXC_CHLEGEND_TOP: eApiPos = cssc2::LegendPosition_PAGE_START; eApiExpand = cssc2::LegendExpansion_WIDE; break;
- case EXC_CHLEGEND_BOTTOM: eApiPos = cssc2::LegendPosition_PAGE_END; eApiExpand = cssc2::LegendExpansion_WIDE; break;
+ case EXC_CHLEGEND_LEFT:
+ eApiPos = cssc2::LegendPosition_LINE_START;
+ eApiExpand = cssc::ChartLegendExpansion_HIGH;
+ break;
+ case EXC_CHLEGEND_RIGHT:
// top-right not supported
- case EXC_CHLEGEND_CORNER: eApiPos = cssc2::LegendPosition_LINE_END; eApiExpand = cssc2::LegendExpansion_HIGH; break;
+ case EXC_CHLEGEND_CORNER:
+ eApiPos = cssc2::LegendPosition_LINE_END;
+ eApiExpand = cssc::ChartLegendExpansion_HIGH;
+ break;
+ case EXC_CHLEGEND_TOP:
+ eApiPos = cssc2::LegendPosition_PAGE_START;
+ eApiExpand = cssc::ChartLegendExpansion_WIDE;
+ break;
+ case EXC_CHLEGEND_BOTTOM:
+ eApiPos = cssc2::LegendPosition_PAGE_END;
+ eApiExpand = cssc::ChartLegendExpansion_WIDE;
+ break;
}
- // no automatic position: try to find the correct position and size
+ // no automatic position/size: try to find the correct position and size
if( eApiPos == cssc2::LegendPosition_CUSTOM )
{
const XclChFramePos* pFramePos = mxFramePos.is() ? &mxFramePos->GetFramePosData() : 0;
@@ -2489,38 +2513,35 @@ Reference< XLegend > XclImpChLegend::CreateLegend() const
ignored. */
if( pFramePos )
{
- RelativePosition aRelPos;
- aRelPos.Primary = CalcRelativeFromChartX( pFramePos->maRect.mnX );
- aRelPos.Secondary = CalcRelativeFromChartY( pFramePos->maRect.mnY );
- aRelPos.Anchor = ::com::sun::star::drawing::Alignment_TOP_LEFT;
+ RelativePosition aRelPos(
+ CalcRelativeFromChartX( pFramePos->maRect.mnX ),
+ CalcRelativeFromChartY( pFramePos->maRect.mnY ),
+ ::com::sun::star::drawing::Alignment_TOP_LEFT );
aLegendProp.SetProperty( EXC_CHPROP_RELATIVEPOSITION, aRelPos );
}
else
{
- // no manual position found, just go for the default
+ // no manual position/size found, just go for the default
eApiPos = cssc2::LegendPosition_LINE_END;
}
-
- /* Legend size. #i71697# It is not possible to set the legend size
- directly in the Chart, do some magic here. */
- if( !pFramePos || (pFramePos->mnBRMode != EXC_CHFRAMEPOS_ABSSIZE_POINTS) ||
- (pFramePos->maRect.mnWidth == 0) || (pFramePos->maRect.mnHeight == 0) )
+ /* Legend size. The member mnBRMode specifies whether size is
+ automatic or changes manually. Manual size is given in points,
+ not in chart units. */
+ if( pFramePos && (pFramePos->mnBRMode == EXC_CHFRAMEPOS_ABSSIZE_POINTS) &&
+ (pFramePos->maRect.mnWidth > 0) && (pFramePos->maRect.mnHeight > 0) )
{
- // automatic size: determine entry direction from flags
- eApiExpand = ::get_flagvalue( maData.mnFlags, EXC_CHLEGEND_STACKED,
- cssc2::LegendExpansion_HIGH, cssc2::LegendExpansion_WIDE );
+ eApiExpand = cssc::ChartLegendExpansion_CUSTOM;
+ sal_Int32 nWidthHmm = static_cast< sal_Int32 >( pFramePos->maRect.mnWidth / EXC_POINTS_PER_HMM );
+ sal_Int32 nHeightHmm = static_cast< sal_Int32 >( pFramePos->maRect.mnHeight / EXC_POINTS_PER_HMM );
+ RelativeSize aRelSize( CalcRelativeFromHmmX( nWidthHmm ), CalcRelativeFromHmmY( nHeightHmm ) );
+ aLegendProp.SetProperty( EXC_CHPROP_RELATIVESIZE, aRelSize );
}
else
{
- // legend size is given in points, not in chart units
- double fRatio = static_cast< double >( pFramePos->maRect.mnWidth ) / pFramePos->maRect.mnHeight;
- if( fRatio > 1.5 )
- eApiExpand = cssc2::LegendExpansion_WIDE;
- else if( fRatio < 0.75 )
- eApiExpand = cssc2::LegendExpansion_HIGH;
- else
- eApiExpand = cssc2::LegendExpansion_BALANCED;
+ // automatic size: determine entry direction from flags
+ eApiExpand = ::get_flagvalue( maData.mnFlags, EXC_CHLEGEND_STACKED,
+ cssc::ChartLegendExpansion_HIGH, cssc::ChartLegendExpansion_WIDE );
}
}
aLegendProp.SetProperty( EXC_CHPROP_ANCHORPOSITION, eApiPos );
diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx
index 5178d6d99968..206392ea6890 100644
--- a/sc/source/filter/inc/xechart.hxx
+++ b/sc/source/filter/inc/xechart.hxx
@@ -382,6 +382,8 @@ public:
/** Converts frame formatting properties from the passed property set. */
void Convert( const ScfPropertySet& rPropSet );
+ /** Sets the specified automatic flags. */
+ void SetAutoFlags( bool bAutoPos, bool bAutoSize );
/** Returns true, if the frame object contains default formats. */
bool IsDefault() const;
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 0fbde9db0905..097ce1801896 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -134,6 +134,11 @@ public:
/** Converts the passed rectangle from Excel chart units into 1/100 mm. */
::com::sun::star::awt::Rectangle CalcHmmFromChartRect( const XclChRectangle& rRect ) const;
+ /** Converts the passed horizontal coordinate from 1/100 mm into a relative position. */
+ double CalcRelativeFromHmmX( sal_Int32 nPosX ) const;
+ /** Converts the passed vertical coordinate from 1/100 mm into a relative position. */
+ double CalcRelativeFromHmmY( sal_Int32 nPosY ) const;
+
/** Converts the passed horizontal coordinate from Excel chart units into a relative position. */
double CalcRelativeFromChartX( sal_Int32 nPosX ) const;
/** Converts the passed vertical coordinate from Excel chart units into a relative position. */
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 68186a238847..925b1d14e805 100755
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -126,6 +126,7 @@ class XclRoot;
#define EXC_CHPROP_PERSPECTIVE CREATE_OUSTRING( "Perspective" )
#define EXC_CHPROP_POSITIVEERROR CREATE_OUSTRING( "PositiveError" )
#define EXC_CHPROP_RELATIVEPOSITION CREATE_OUSTRING( "RelativePosition" )
+#define EXC_CHPROP_RELATIVESIZE CREATE_OUSTRING( "RelativeSize" )
#define EXC_CHPROP_RIGHTANGLEDAXES CREATE_OUSTRING( "RightAngledAxes" )
#define EXC_CHPROP_ROLE CREATE_OUSTRING( "Role" )
#define EXC_CHPROP_ROTATIONHORIZONTAL CREATE_OUSTRING( "RotationHorizontal" )
diff --git a/sc/source/filter/inc/xlconst.hxx b/sc/source/filter/inc/xlconst.hxx
index 42160aae7529..ac0e42496b63 100644
--- a/sc/source/filter/inc/xlconst.hxx
+++ b/sc/source/filter/inc/xlconst.hxx
@@ -139,6 +139,8 @@ const sal_Int32 EXC_RK_INT100 = EXC_RK_100FLAG | EXC_RK_INTFLAG;
const sal_Int32 EXC_POINTS_PER_INCH = 72;
const sal_Int32 EXC_TWIPS_PER_INCH = EXC_POINTS_PER_INCH * 20;
+const double EXC_POINTS_PER_HMM = static_cast< double >( EXC_POINTS_PER_INCH ) / 2540.0;
+
const sal_uInt8 EXC_ORIENT_NONE = 0; /// Text orientation: not rotated.
const sal_uInt8 EXC_ORIENT_STACKED = 1; /// Text orientation: vertically stacked.
const sal_uInt8 EXC_ORIENT_90CCW = 2; /// Text orientation: 90 deg counterclockwise.
diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
index 1848c7bfefc0..6873116ee2d8 100644
--- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
@@ -31,17 +31,11 @@
#include "unoguard.hxx"
#include "fieldwnd.hxx"
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
-#endif
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX
#include <unotools/accessiblestatesethelper.hxx>
-#endif
#include <rtl/uuid.h>
#include <tools/gen.hxx>
#include <toolkit/helper/convert.hxx>
@@ -58,7 +52,7 @@ public:
ScAccessibleDataPilotButton(
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>& rxParent,
- ScDPFieldWindow* pDPFieldWindow,
+ ScPivotFieldWindow* pFieldWindow,
sal_Int32 nIndex);
virtual void Init();
@@ -151,20 +145,20 @@ protected:
throw (::com::sun::star::uno::RuntimeException);
private:
- ScDPFieldWindow* mpDPFieldWindow;
+ ScPivotFieldWindow* mpFieldWindow;
sal_Int32 mnIndex;
};
//===== internal ========================================================
ScAccessibleDataPilotControl::ScAccessibleDataPilotControl(
const uno::Reference<XAccessible>& rxParent,
- ScDPFieldWindow* pDPFieldWindow)
+ ScPivotFieldWindow* pFieldWindow)
:
ScAccessibleContextBase(rxParent, AccessibleRole::GROUP_BOX),
- mpDPFieldWindow(pDPFieldWindow)
+ mpFieldWindow(pFieldWindow)
{
- if (mpDPFieldWindow)
- maChildren.resize(mpDPFieldWindow->GetFieldCount());
+ if (mpFieldWindow)
+ maChildren.resize(mpFieldWindow->GetFieldCount());
}
ScAccessibleDataPilotControl::~ScAccessibleDataPilotControl(void)
@@ -185,7 +179,7 @@ void ScAccessibleDataPilotControl::Init()
void SAL_CALL ScAccessibleDataPilotControl::disposing()
{
ScUnoGuard aGuard;
- mpDPFieldWindow = NULL;
+ mpFieldWindow = NULL;
ScAccessibleContextBase::disposing();
}
@@ -193,12 +187,12 @@ void SAL_CALL ScAccessibleDataPilotControl::disposing()
void ScAccessibleDataPilotControl::AddField(sal_Int32 nNewIndex)
{
sal_Bool bAdded(sal_False);
- if (static_cast<sal_uInt32>(nNewIndex) == maChildren.size())
+ if (static_cast<size_t>(nNewIndex) == maChildren.size())
{
maChildren.push_back(AccessibleWeak());
bAdded = sal_True;
}
- else if (static_cast<sal_uInt32>(nNewIndex) < maChildren.size())
+ else if (static_cast<size_t>(nNewIndex) < maChildren.size())
{
::std::vector < AccessibleWeak >::iterator aItr = maChildren.begin() + nNewIndex;
maChildren.insert(aItr, AccessibleWeak());
@@ -238,7 +232,7 @@ void ScAccessibleDataPilotControl::RemoveField(sal_Int32 nOldIndex)
sal_Bool bRemoved(sal_False);
uno::Reference< XAccessible > xTempAcc;
ScAccessibleDataPilotButton* pField = NULL;
- if (static_cast<sal_uInt32>(nOldIndex) < maChildren.size())
+ if (static_cast<size_t>(nOldIndex) < maChildren.size())
{
xTempAcc = getAccessibleChild(nOldIndex);
pField = maChildren[nOldIndex].pAcc;
@@ -279,8 +273,8 @@ void ScAccessibleDataPilotControl::RemoveField(sal_Int32 nOldIndex)
void ScAccessibleDataPilotControl::FieldFocusChange(sal_Int32 nOldIndex, sal_Int32 nNewIndex)
{
- DBG_ASSERT(static_cast<sal_uInt32>(nOldIndex) < maChildren.size() &&
- static_cast<sal_uInt32>(nNewIndex) < maChildren.size(), "did not recognize a child count change");
+ DBG_ASSERT(static_cast<size_t>(nOldIndex) < maChildren.size() &&
+ static_cast<size_t>(nNewIndex) < maChildren.size(), "did not recognize a child count change");
uno::Reference < XAccessible > xTempAcc = maChildren[nOldIndex].xWeakAcc;
if (xTempAcc.is() && maChildren[nOldIndex].pAcc)
@@ -293,7 +287,7 @@ void ScAccessibleDataPilotControl::FieldFocusChange(sal_Int32 nOldIndex, sal_Int
void ScAccessibleDataPilotControl::FieldNameChange(sal_Int32 nIndex)
{
- DBG_ASSERT(static_cast<sal_uInt32>(nIndex) < maChildren.size(), "did not recognize a child count change");
+ DBG_ASSERT(static_cast<size_t>(nIndex) < maChildren.size(), "did not recognize a child count change");
uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
if (xTempAcc.is() && maChildren[nIndex].pAcc)
@@ -302,11 +296,11 @@ void ScAccessibleDataPilotControl::FieldNameChange(sal_Int32 nIndex)
void ScAccessibleDataPilotControl::GotFocus()
{
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- DBG_ASSERT(static_cast<sal_uInt32>(mpDPFieldWindow->GetFieldCount()) == maChildren.size(), "did not recognize a child count change");
+ DBG_ASSERT(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change");
- sal_Int32 nIndex(mpDPFieldWindow->GetSelectedField());
+ sal_Int32 nIndex(mpFieldWindow->GetSelectedIndex());
uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
if (xTempAcc.is() && maChildren[nIndex].pAcc)
maChildren[nIndex].pAcc->SetFocused();
@@ -315,11 +309,11 @@ void ScAccessibleDataPilotControl::GotFocus()
void ScAccessibleDataPilotControl::LostFocus()
{
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- DBG_ASSERT(static_cast<sal_uInt32>(mpDPFieldWindow->GetFieldCount()) == maChildren.size(), "did not recognize a child count change");
+ DBG_ASSERT(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change");
- sal_Int32 nIndex(mpDPFieldWindow->GetSelectedField());
+ sal_Int32 nIndex(mpFieldWindow->GetSelectedIndex());
uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
if (xTempAcc.is() && maChildren[nIndex].pAcc)
maChildren[nIndex].pAcc->ResetFocused();
@@ -337,13 +331,13 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDataPilotControl::getAccessib
{
ScUnoGuard aGuard;
IsObjectValid();
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
Point aAbsPoint(VCLPoint(rPoint));
Point aControlEdge(GetBoundingBoxOnScreen().TopLeft());
Point aRelPoint(aAbsPoint - aControlEdge);
- size_t nChildIndex(0);
- if (mpDPFieldWindow->GetFieldIndex(aRelPoint, nChildIndex))
+ size_t nChildIndex = mpFieldWindow->GetFieldIndex( aRelPoint );
+ if( nChildIndex != PIVOTFIELD_INVALID )
xAcc = getAccessibleChild(static_cast< long >( nChildIndex ));
}
}
@@ -361,8 +355,8 @@ void SAL_CALL ScAccessibleDataPilotControl::grabFocus( )
{
ScUnoGuard aGuard;
IsObjectValid();
- if (mpDPFieldWindow)
- mpDPFieldWindow->GrabFocus();
+ if (mpFieldWindow)
+ mpFieldWindow->GrabFocus();
}
sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getForeground( )
@@ -371,9 +365,9 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getForeground( )
ScUnoGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
+ nColor = mpFieldWindow->GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
}
return nColor;
}
@@ -384,16 +378,10 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getBackground( )
ScUnoGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- if (mpDPFieldWindow->GetType() == TYPE_SELECT)
- {
- nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetFaceColor().GetColor();
- }
- else
- {
- nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetWindowColor().GetColor();
- }
+ const StyleSettings& rStyleSett = mpFieldWindow->GetSettings().GetStyleSettings();
+ nColor = (mpFieldWindow->GetType() == PIVOTFIELDTYPE_SELECT) ? rStyleSett.GetFaceColor().GetColor() : rStyleSett.GetWindowColor().GetColor();
}
return nColor;
}
@@ -405,8 +393,8 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getAccessibleChildCount(void)
{
ScUnoGuard aGuard;
IsObjectValid();
- if (mpDPFieldWindow)
- return mpDPFieldWindow->GetFieldCount();
+ if (mpFieldWindow)
+ return mpFieldWindow->GetFieldCount();
else
return 0;
}
@@ -417,17 +405,17 @@ uno::Reference< XAccessible> SAL_CALL ScAccessibleDataPilotControl::getAccessibl
ScUnoGuard aGuard;
IsObjectValid();
uno::Reference<XAccessible> xAcc;
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- if (nIndex < 0 || static_cast< size_t >( nIndex ) >= mpDPFieldWindow->GetFieldCount())
+ if (nIndex < 0 || static_cast< size_t >( nIndex ) >= mpFieldWindow->GetFieldCount())
throw lang::IndexOutOfBoundsException();
- DBG_ASSERT(static_cast<sal_uInt32>(mpDPFieldWindow->GetFieldCount()) == maChildren.size(), "did not recognize a child count change");
+ DBG_ASSERT(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change");
uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
if (!xTempAcc.is())
{
- maChildren[nIndex].pAcc = new ScAccessibleDataPilotButton(this, mpDPFieldWindow, nIndex);
+ maChildren[nIndex].pAcc = new ScAccessibleDataPilotButton(this, mpFieldWindow, nIndex);
xTempAcc = maChildren[nIndex].pAcc;
maChildren[nIndex].xWeakAcc = xTempAcc;
}
@@ -491,8 +479,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
{
ScUnoGuard aGuard;
IsObjectValid();
- if (mpDPFieldWindow)
- return mpDPFieldWindow->GetDescription();
+ if (mpFieldWindow)
+ return mpFieldWindow->GetDescription();
return rtl::OUString();
}
@@ -502,8 +490,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
{
ScUnoGuard aGuard;
IsObjectValid();
- if (mpDPFieldWindow)
- return mpDPFieldWindow->GetName();
+ if (mpFieldWindow)
+ return mpFieldWindow->GetName();
return rtl::OUString();
}
@@ -511,8 +499,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
Rectangle ScAccessibleDataPilotControl::GetBoundingBoxOnScreen(void) const
throw (uno::RuntimeException)
{
- if (mpDPFieldWindow)
- return mpDPFieldWindow->GetWindowExtentsRelative(NULL);
+ if (mpFieldWindow)
+ return mpFieldWindow->GetWindowExtentsRelative(NULL);
else
return Rectangle();
}
@@ -520,8 +508,8 @@ Rectangle ScAccessibleDataPilotControl::GetBoundingBoxOnScreen(void) const
Rectangle ScAccessibleDataPilotControl::GetBoundingBox(void) const
throw (uno::RuntimeException)
{
- if (mpDPFieldWindow)
- return mpDPFieldWindow->GetWindowExtentsRelative(mpDPFieldWindow->GetAccessibleParentWindow());
+ if (mpFieldWindow)
+ return mpFieldWindow->GetWindowExtentsRelative(mpFieldWindow->GetAccessibleParentWindow());
else
return Rectangle();
}
@@ -532,10 +520,10 @@ Rectangle ScAccessibleDataPilotControl::GetBoundingBox(void) const
ScAccessibleDataPilotButton::ScAccessibleDataPilotButton(
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>& rxParent,
- ScDPFieldWindow* pDPFieldWindow,
+ ScPivotFieldWindow* pFieldWindow,
sal_Int32 nIndex)
: ScAccessibleContextBase(rxParent, AccessibleRole::PUSH_BUTTON),
- mpDPFieldWindow(pDPFieldWindow),
+ mpFieldWindow(pFieldWindow),
mnIndex(nIndex)
{
}
@@ -558,7 +546,7 @@ void ScAccessibleDataPilotButton::Init()
void SAL_CALL ScAccessibleDataPilotButton::disposing()
{
ScUnoGuard aGuard;
- mpDPFieldWindow = NULL;
+ mpFieldWindow = NULL;
ScAccessibleContextBase::disposing();
}
@@ -593,9 +581,9 @@ void SAL_CALL ScAccessibleDataPilotButton::grabFocus( )
{
ScUnoGuard aGuard;
IsObjectValid();
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- mpDPFieldWindow->GrabFocusWithSel(getAccessibleIndexInParent());
+ mpFieldWindow->GrabFocusAndSelect(getAccessibleIndexInParent());
}
}
@@ -605,9 +593,9 @@ throw (uno::RuntimeException)
ScUnoGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
+ nColor = mpFieldWindow->GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
}
return nColor;
}
@@ -618,9 +606,9 @@ throw (uno::RuntimeException)
ScUnoGuard aGuard;
IsObjectValid();
sal_Int32 nColor(0);
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetFaceColor().GetColor();
+ nColor = mpFieldWindow->GetSettings().GetStyleSettings().GetFaceColor().GetColor();
}
return nColor;
}
@@ -663,7 +651,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotButton::getAcc
pStateSet->AddState(AccessibleStateType::ENABLED);
pStateSet->AddState(AccessibleStateType::OPAQUE);
pStateSet->AddState(AccessibleStateType::FOCUSABLE);
- if (mpDPFieldWindow && (sal::static_int_cast<sal_Int32>(mpDPFieldWindow->GetSelectedField()) == mnIndex))
+ if (mpFieldWindow && (sal::static_int_cast<sal_Int32>(mpFieldWindow->GetSelectedIndex()) == mnIndex))
pStateSet->AddState(AccessibleStateType::FOCUSED);
if (isShowing())
pStateSet->AddState(AccessibleStateType::SHOWING);
@@ -709,8 +697,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotButton::getImplementationI
{
ScUnoGuard aGuard;
IsObjectValid();
- if (mpDPFieldWindow)
- return mpDPFieldWindow->GetFieldText(getAccessibleIndexInParent());
+ if (mpFieldWindow)
+ return mpFieldWindow->GetFieldText(getAccessibleIndexInParent());
return rtl::OUString();
}
@@ -720,9 +708,9 @@ Rectangle ScAccessibleDataPilotButton::GetBoundingBoxOnScreen(void) const
{
Rectangle aRect(GetBoundingBox());
- if (mpDPFieldWindow)
+ if (mpFieldWindow)
{
- Point aParentPos(mpDPFieldWindow->GetWindowExtentsRelative(NULL).TopLeft());
+ Point aParentPos(mpFieldWindow->GetWindowExtentsRelative(NULL).TopLeft());
aRect.Move(aParentPos.getX(), aParentPos.getY());
}
@@ -732,8 +720,8 @@ Rectangle ScAccessibleDataPilotButton::GetBoundingBoxOnScreen(void) const
Rectangle ScAccessibleDataPilotButton::GetBoundingBox(void) const
throw (::com::sun::star::uno::RuntimeException)
{
- if (mpDPFieldWindow)
- return Rectangle (mpDPFieldWindow->GetFieldPosition(const_cast<ScAccessibleDataPilotButton*> (this)->getAccessibleIndexInParent()), mpDPFieldWindow->GetFieldSize());
+ if (mpFieldWindow)
+ return Rectangle (mpFieldWindow->GetFieldPosition(const_cast<ScAccessibleDataPilotButton*> (this)->getAccessibleIndexInParent()), mpFieldWindow->GetFieldSize());
else
return Rectangle();
}
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index ed4971fa00ee..fac3b1bb1a0f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3443,8 +3443,13 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
else
aCursorPos.Format( aPosStr, SCA_VALID | nFlags, pDoc, aAddrDetails );
}
-
+ //IAccessibility2 Implementation 2009-----
+ // Disable the accessible VALUE_CHANGE event
+ sal_Bool bIsSuppressed = pInputWin->IsAccessibilityEventsSuppressed(sal_False);
+ pInputWin->SetAccessibilityEventsSuppressed(sal_True);
pInputWin->SetPosString(aPosStr);
+ pInputWin->SetAccessibilityEventsSuppressed(bIsSuppressed);
+ //-----IAccessibility2 Implementation 2009
pInputWin->SetSumAssignMode();
}
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index a02f6fb0f91a..2da1ed83bf08 100755
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -223,6 +223,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
pViewSh->UpdateInputHandler( sal_True ); // unbedingtes Update
pImgMgr->RegisterToolBox( this );
+ SetAccessibleName(ScResId(STR_ACC_TOOLBAR_FORMULA));
}
__EXPORT ScInputWindow::~ScInputWindow()
diff --git a/sc/source/ui/attrdlg/condfrmt.cxx b/sc/source/ui/attrdlg/condfrmt.cxx
index 8a7c4b05454d..c3bab9e32296 100644
--- a/sc/source/ui/attrdlg/condfrmt.cxx
+++ b/sc/source/ui/attrdlg/condfrmt.cxx
@@ -71,7 +71,6 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aFtCond1Template ( this, ScResId( FT_COND1_TEMPLATE ) ),
aLbCond1Template ( this, ScResId( LB_COND1_TEMPLATE ) ),
aBtnNew1 ( this, ScResId( BTN_COND1_NEW ) ),
- aFlSep1 ( this, ScResId( FL_SEP1 ) ),
aCbxCond2 ( this, ScResId( CBX_COND2 ) ),
aLbCond21 ( this, ScResId( LB_COND2_1 ) ),
@@ -84,7 +83,6 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aFtCond2Template ( this, ScResId( FT_COND2_TEMPLATE ) ),
aLbCond2Template ( this, ScResId( LB_COND2_TEMPLATE ) ),
aBtnNew2 ( this, ScResId( BTN_COND2_NEW ) ),
- aFlSep2 ( this, ScResId( FL_SEP2 ) ),
aCbxCond3 ( this, ScResId( CBX_COND3 ) ),
aLbCond31 ( this, ScResId( LB_COND3_1 ) ),
@@ -101,6 +99,8 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
+ aFlSep2 ( this, ScResId( FL_SEP2 ) ),
+ aFlSep1 ( this, ScResId( FL_SEP1 ) ),
pEdActive ( NULL ),
bDlgLostFocus ( sal_False ),
@@ -322,6 +322,32 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse
//SFX_APPWINDOW->Enable(); // Ref-Feld hat Focus
// SFX_APPWINDOW->Disable();
+
+ aLbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+ aLbCond12.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+ aEdtCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+ aRbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+
+ aLbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+ aLbCond22.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+ aEdtCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+ aRbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+
+ aLbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aLbCond32.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aEdtCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aRbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aLbCond11.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
+ aLbCond12.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
+ aEdtCond11.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
+
+ aLbCond21.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
+ aLbCond22.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
+ aEdtCond21.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
+
+ aLbCond31.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
+ aLbCond32.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
+ aEdtCond31.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
}
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 45f1ff7d549a..90e4b0f20221 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1165,9 +1165,9 @@ AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg
//add for ScDPFunctionDlg begin
AbstractScDPFunctionDlg * ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg ( Window* pParent,
int nId,
- const ScDPLabelDataVec& rLabelVec,
+ const ScDPLabelDataVector& rLabelVec,
const ScDPLabelData& rLabelData,
- const ScDPFuncData& rFuncData )
+ const ScPivotFuncData& rFuncData )
{
ScDPFunctionDlg * pDlg=NULL;
switch ( nId )
@@ -1190,7 +1190,7 @@ AbstractScDPSubtotalDlg * ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg (
int nId,
ScDPObject& rDPObj,
const ScDPLabelData& rLabelData,
- const ScDPFuncData& rFuncData,
+ const ScPivotFuncData& rFuncData,
const ScDPNameVec& rDataFields,
bool bEnableLayout )
{
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 86aebfc03287..772661a1a10b 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -490,14 +490,14 @@ public:
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId );
virtual AbstractScDPFunctionDlg * CreateScDPFunctionDlg( Window* pParent, int nId,
- const ScDPLabelDataVec& rLabelVec,
+ const ScDPLabelDataVector& rLabelVec,
const ScDPLabelData& rLabelData,
- const ScDPFuncData& rFuncData );
+ const ScPivotFuncData& rFuncData );
virtual AbstractScDPSubtotalDlg * CreateScDPSubtotalDlg( Window* pParent, int nId,
ScDPObject& rDPObj,
const ScDPLabelData& rLabelData,
- const ScDPFuncData& rFuncData,
+ const ScPivotFuncData& rFuncData,
const ScDPNameVec& rDataFields,
bool bEnableLayout );
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index 4e6c61f2e4d0..a518860b1690 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -312,6 +312,10 @@ void ScAsciiOptions::ReadFromString( const String& rString )
aToken = rString.GetToken(7, ',');
bDetectSpecialNumber = aToken.EqualsAscii("true") ? true : false;
}
+ else
+ bDetectSpecialNumber = sal_True; // default of versions that didn't add the parameter
+
+ // 9th token is used for "Save as shown" in export options
}
@@ -399,6 +403,8 @@ String ScAsciiOptions::WriteToString() const
// Detect special nubmers.
aOutStr += String::CreateFromAscii(bDetectSpecialNumber ? "true" : "false");
+ // 9th token is used for "Save as shown" in export options
+
return aOutStr;
}
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index a4a7c6826daa..03fc34eefe2c 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -185,6 +185,7 @@ ScDbNameDlg::ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
aBtnDoSize, aBtnKeepFmt, aBtnStripData, theCurArea );
Init();
FreeResource();
+ aRbAssign.SetAccessibleRelationMemberOf(&aFlAssign);
}
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 8016c20eff34..02bf712e59fb 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -28,749 +28,880 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-#include <vcl/virdev.hxx>
+#include "fieldwnd.hxx"
+
+#include <tools/debug.hxx>
#include <vcl/decoview.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/mnemonic.hxx>
#include <vcl/help.hxx>
-#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/virdev.hxx>
-#include "fieldwnd.hxx"
#include "pvlaydlg.hxx"
-#include "pvglob.hxx"
#include "AccessibleDataPilotControl.hxx"
#include "scresid.hxx"
#include "sc.hrc"
-const size_t INVALID_INDEX = static_cast< size_t >( -1 );
-
-//===================================================================
-
-ScDPFieldWindow::ScDPFieldWindow(
- ScDPLayoutDlg* pDialog,
- const ResId& rResId,
- ScDPFieldType eFieldType,
- FixedText* pFtFieldCaption ) :
- Control( pDialog, rResId ),
- pDlg( pDialog ),
- pFtCaption( pFtFieldCaption ),
- eType( eFieldType ),
- nFieldSelected( 0 ),
- pAccessible( NULL )
-{
- Init();
- if (eType != TYPE_SELECT && pFtCaption)
- aName = MnemonicGenerator::EraseAllMnemonicChars( pFtCaption->GetText() );
-}
-
-ScDPFieldWindow::ScDPFieldWindow(
- ScDPLayoutDlg* pDialog,
- const ResId& rResId,
- ScDPFieldType eFieldType,
- const String& rName ) :
- Control( pDialog, rResId ),
- aName(rName),
- pDlg( pDialog ),
- pFtCaption( NULL ),
- eType( eFieldType ),
- nFieldSelected( 0 ),
- pAccessible( NULL )
-{
- Init();
-}
+// ============================================================================
-void ScDPFieldWindow::Init()
-{
- aWndRect = Rectangle( GetPosPixel(), GetSizePixel() );
- nFieldSize = (eType == TYPE_SELECT) ? PAGE_SIZE : ((eType == TYPE_PAGE) ? MAX_PAGEFIELDS : MAX_FIELDS);
+using namespace ::com::sun::star;
+using ::rtl::OUString;
- if( pFtCaption )
- {
- Size aWinSize( aWndRect.GetSize() );
- Size aTextSize( GetTextWidth( pFtCaption->GetText() ), GetTextHeight() );
- aTextPos.X() = (aWinSize.Width() - aTextSize.Width()) / 2;
- aTextPos.Y() = (aWinSize.Height() - aTextSize.Height()) / 2;
- }
+// ============================================================================
- GetStyleSettings();
-}
+namespace {
-__EXPORT ScDPFieldWindow::~ScDPFieldWindow()
-{
- if (pAccessible)
- {
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->dispose();
- }
-}
+/** Line width for insertion cursor in pixels. */
+const long CURSOR_WIDTH = 3;
-//-------------------------------------------------------------------
+/** Number of tracking events before auto scrolling starts. */
+const size_t INITIAL_TRACKING_DELAY = 20;
-void ScDPFieldWindow::GetStyleSettings()
-{
- const StyleSettings& rStyleSet = GetSettings().GetStyleSettings();
- aFaceColor = rStyleSet.GetFaceColor();
- aWinColor = rStyleSet.GetWindowColor();
- aTextColor = rStyleSet.GetButtonTextColor();
- aWinTextColor = rStyleSet.GetWindowTextColor();
-}
+} // namespace
-//-------------------------------------------------------------------
+// ============================================================================
-Point ScDPFieldWindow::GetFieldPosition( size_t nIndex ) const
+ScPivotFieldWindow::ScPivotWindowField::ScPivotWindowField( const ScDPLabelData& rLabelData ) :
+ maFuncData( rLabelData.mnCol, rLabelData.mnFuncMask ),
+ maFieldName( rLabelData.getDisplayName() )
{
- Point aPos;
- switch( eType )
- {
- case TYPE_PAGE:
- aPos.X() = OWIDTH * (nIndex % (MAX_PAGEFIELDS / 2));
- aPos.Y() = OHEIGHT * (nIndex / (MAX_PAGEFIELDS / 2));
- break;
- case TYPE_COL:
- aPos.X() = OWIDTH * (nIndex % (MAX_FIELDS / 2));
- aPos.Y() = OHEIGHT * (nIndex / (MAX_FIELDS / 2));
- break;
- case TYPE_ROW:
- case TYPE_DATA:
- aPos.X() = 0;
- aPos.Y() = OHEIGHT * nIndex;
- break;
- case TYPE_SELECT:
- aPos.X() = (OWIDTH + SSPACE) * (nIndex / LINE_SIZE);
- aPos.Y() = (OHEIGHT + SSPACE) * (nIndex % LINE_SIZE);
- break;
- }
- return aPos;
}
-Size ScDPFieldWindow::GetFieldSize() const
+ScPivotFieldWindow::ScPivotWindowField::ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotField& rField, bool bDataWindow ) :
+ maFuncData( rField.nCol, rField.nFuncMask, rField.maFieldRef )
{
- return Size( (eType == TYPE_DATA) ? GetSizePixel().Width() : OWIDTH, OHEIGHT );
+ InitFieldName( rDialog, bDataWindow );
}
-Point ScDPFieldWindow::GetLastPosition() const
+ScPivotFieldWindow::ScPivotWindowField::ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotFuncData& rFuncData, bool bDataWindow ) :
+ maFuncData( rFuncData )
{
- return OutputToScreenPixel( GetFieldPosition( nFieldSize - 1 ) );
+ InitFieldName( rDialog, bDataWindow );
}
-bool ScDPFieldWindow::GetFieldIndex( const Point& rPos, size_t& rnIndex ) const
+void ScPivotFieldWindow::ScPivotWindowField::InitFieldName( ScPivotLayoutDlg& rDialog, bool bDataWindow )
{
- rnIndex = INVALID_INDEX;
- if( (rPos.X() >= 0) && (rPos.Y() >= 0) )
+ if( maFuncData.mnCol != PIVOT_DATA_FIELD )
{
- switch( eType )
+ ScDPLabelData* pLabelData = rDialog.GetLabelData( maFuncData.mnCol );
+ DBG_ASSERT( pLabelData, "ScPivotWindowField::InitFieldName - no label data found" );
+ if( pLabelData )
{
- case TYPE_ROW:
- case TYPE_DATA:
- rnIndex = rPos.Y() / OHEIGHT;
- break;
- case TYPE_PAGE:
- {
- size_t nRow = rPos.Y() / OHEIGHT;
- size_t nCol = rPos.X() / OWIDTH;
- rnIndex = nRow * MAX_PAGEFIELDS / 2 + nCol;
- }
- break;
- case TYPE_COL:
- {
- size_t nRow = rPos.Y() / OHEIGHT;
- size_t nCol = rPos.X() / OWIDTH;
- rnIndex = nRow * MAX_FIELDS / 2 + nCol;
- }
- break;
- case TYPE_SELECT:
+ if( bDataWindow )
{
- size_t nRow = rPos.Y() / (OHEIGHT + SSPACE);
- size_t nCol = rPos.X() / (OWIDTH + SSPACE);
- // is not between controls?
- if( (rPos.Y() % (OHEIGHT + SSPACE) < OHEIGHT) && (rPos.X() % (OWIDTH + SSPACE) < OWIDTH) )
- rnIndex = nCol * LINE_SIZE + nRow;
+ // write original nFuncMask to label data
+ pLabelData->mnFuncMask = maFuncData.mnFuncMask;
+ // GetFuncString() modifies nFuncMask (e.g. auto to sum or count)
+ maFieldName = rDialog.GetFuncString( maFuncData.mnFuncMask, pLabelData->mbIsValue );
}
- break;
+ maFieldName += pLabelData->getDisplayName();
}
}
- return IsValidIndex( rnIndex );
}
-//-------------------------------------------------------------------
-
-void ScDPFieldWindow::DrawBackground( OutputDevice& rDev )
-{
- Point aPos0;
- Size aSize( GetSizePixel() );
+// ============================================================================
- if ( eType == TYPE_SELECT )
- {
- rDev.SetLineColor();
- rDev.SetFillColor( aFaceColor );
- rDev.DrawRect( Rectangle( aPos0, aSize ) );
+ScPivotFieldWindow::ScPivotFieldWindow( ScPivotLayoutDlg* pDialog, const ResId& rResId,
+ ScrollBar& rScrollBar, FixedText* pFtCaption, const OUString& rName,
+ ScPivotFieldType eFieldType, const sal_Char* pcHelpId, PointerStyle eDropPointer,
+ size_t nColCount, size_t nRowCount, long nFieldWidthFactor, long nSpaceSize ) :
+ Control( pDialog, rResId ),
+ mpDialog( pDialog ),
+ mpAccessible( 0 ),
+ mrScrollBar( rScrollBar ),
+ mpFtCaption( pFtCaption ),
+ maName( rName ),
+ meFieldType( eFieldType ),
+ meDropPointer( eDropPointer ),
+ mnColCount( nColCount ),
+ mnRowCount( nRowCount ),
+ mnFirstVisIndex( 0 ),
+ mnSelectIndex( 0 ),
+ mnInsCursorIndex( PIVOTFIELD_INVALID ),
+ mnOldFirstVisIndex( 0 ),
+ mnAutoScrollDelay( 0 ),
+ mbVertical( eFieldType == PIVOTFIELDTYPE_SELECT ),
+ mbIsTrackingSource( false )
+{
+ SetHelpId( pcHelpId );
+
+ mnLineSize = mbVertical ? mnRowCount : mnColCount;
+ mnPageSize = mnColCount * mnRowCount;
+
+ // a single field is 36x12 appfont units
+ maFieldSize = LogicToPixel( Size( 36, 12 ), MapMode( MAP_APPFONT ) );
+ maFieldSize.Width() *= nFieldWidthFactor;
+ maSpaceSize = LogicToPixel( Size( nSpaceSize, nSpaceSize ), MapMode( MAP_APPFONT ) );
+
+ // set window size
+ long nWinWidth = static_cast< long >( mnColCount * maFieldSize.Width() + (mnColCount - 1) * maSpaceSize.Width() );
+ long nWinHeight = static_cast< long >( mnRowCount * maFieldSize.Height() + (mnRowCount - 1) * maSpaceSize.Height() );
+ SetSizePixel( Size( nWinWidth, nWinHeight ) );
+
+ // scroll bar
+ Point aScrollBarPos = GetPosPixel();
+ Size aScrollBarSize( nWinWidth, nWinHeight );
+ if( mbVertical )
+ {
+ aScrollBarPos.Y() += nWinHeight + maSpaceSize.Height();
+ aScrollBarSize.Height() = GetSettings().GetStyleSettings().GetScrollBarSize();
}
else
{
- rDev.SetLineColor( aWinTextColor );
- rDev.SetFillColor( aWinColor );
- rDev.DrawRect( Rectangle( aPos0, aSize ) );
-
- rDev.SetTextColor( aWinTextColor );
-
- /* Draw the caption text. This needs some special handling, because we
- support hard line breaks here. This part will draw each line of the
- text for itself. */
-
- xub_StrLen nTokenCnt = GetText().GetTokenCount( '\n' );
- long nY = (aSize.Height() - nTokenCnt * rDev.GetTextHeight()) / 2;
- for( xub_StrLen nToken = 0, nStringIx = 0; nToken < nTokenCnt; ++nToken )
- {
- String aLine( GetText().GetToken( 0, '\n', nStringIx ) );
- Point aLinePos( (aSize.Width() - rDev.GetCtrlTextWidth( aLine )) / 2, nY );
- rDev.DrawCtrlText( aLinePos, aLine );
- nY += rDev.GetTextHeight();
- }
+ aScrollBarPos.X() += nWinWidth + maSpaceSize.Width();
+ aScrollBarSize.Width() = GetSettings().GetStyleSettings().GetScrollBarSize();
}
+ mrScrollBar.SetPosSizePixel( aScrollBarPos, aScrollBarSize );
+ mrScrollBar.SetLineSize( 1 );
+ mrScrollBar.SetPageSize( static_cast< long >( mbVertical ? mnColCount : mnRowCount ) );
+ mrScrollBar.SetVisibleSize( static_cast< long >( mbVertical ? mnColCount : mnRowCount ) );
+ mrScrollBar.SetScrollHdl( LINK( this, ScPivotFieldWindow, ScrollHdl ) );
+ mrScrollBar.SetEndScrollHdl( LINK( this, ScPivotFieldWindow, ScrollHdl ) );
}
-void ScDPFieldWindow::DrawField(
- OutputDevice& rDev, const Rectangle& rRect, FieldString& rText, bool bFocus )
+ScPivotFieldWindow::~ScPivotFieldWindow()
{
- VirtualDevice aVirDev( rDev );
- // #i97623# VirtualDevice is always LTR while other windows derive direction from parent
- aVirDev.EnableRTL( IsRTLEnabled() );
+ ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
+ if( xAcc.is() )
+ xAcc->dispose();
+}
- String aText = rText.first;
- Size aDevSize( rRect.GetSize() );
- long nWidth = aDevSize.Width();
- long nHeight = aDevSize.Height();
- long nLabelWidth = rDev.GetTextWidth( aText );
- long nLabelHeight = rDev.GetTextHeight();
-
- // #i31600# if text is too long, cut and add ellipsis
- rText.second = nLabelWidth + 6 <= nWidth;
- if( !rText.second )
- {
- xub_StrLen nMinLen = 0;
- xub_StrLen nMaxLen = aText.Len();
- bool bFits = false;
- do
- {
- xub_StrLen nCurrLen = (nMinLen + nMaxLen) / 2;
- aText = String( rText.first, 0, nCurrLen ).AppendAscii( "..." );
- nLabelWidth = rDev.GetTextWidth( aText );
- bFits = nLabelWidth + 6 <= nWidth;
- (bFits ? nMinLen : nMaxLen) = nCurrLen;
- }
- while( !bFits || (nMinLen + 1 < nMaxLen) );
+void ScPivotFieldWindow::ReadDataLabels( const ScDPLabelDataVector& rLabels )
+{
+ maFields.clear();
+ maFields.reserve( rLabels.size() );
+ for( ScDPLabelDataVector::const_iterator aIt = rLabels.begin(), aEnd = rLabels.end(); aIt != aEnd; ++aIt )
+ {
+ ScPivotWindowField aField( *aIt );
+ if( aField.maFieldName.getLength() > 0 )
+ maFields.push_back( aField );
}
- Point aLabelPos( (nWidth - nLabelWidth) / 2, ::std::max< long >( (nHeight - nLabelHeight) / 2, 3 ) );
-
- aVirDev.SetOutputSizePixel( aDevSize );
- aVirDev.SetFont( rDev.GetFont() );
- DecorationView aDecoView( &aVirDev );
- aDecoView.DrawButton( Rectangle( Point( 0, 0 ), aDevSize ), bFocus ? BUTTON_DRAW_DEFAULT : 0 );
- aVirDev.SetTextColor( aTextColor );
- aVirDev.DrawText( aLabelPos, aText );
- rDev.DrawBitmap( rRect.TopLeft(), aVirDev.GetBitmap( Point( 0, 0 ), aDevSize ) );
+ Invalidate();
}
-void ScDPFieldWindow::Redraw()
+void ScPivotFieldWindow::ReadPivotFields( const ScPivotFieldVector& rPivotFields )
{
- VirtualDevice aVirDev;
- // #i97623# VirtualDevice is always LTR while other windows derive direction from parent
- aVirDev.EnableRTL( IsRTLEnabled() );
- aVirDev.SetMapMode( MAP_PIXEL );
-
- Point aPos0;
- Size aSize( GetSizePixel() );
- Font aFont( GetFont() ); // Font vom Window
- aFont.SetTransparent( sal_True );
- aVirDev.SetFont( aFont );
- aVirDev.SetOutputSizePixel( aSize );
-
- DrawBackground( aVirDev );
-
- if( !aFieldArr.empty() && (nFieldSelected >= aFieldArr.size()) )
- nFieldSelected = aFieldArr.size() - 1;
- Rectangle aFieldRect( aPos0, GetFieldSize() );
- for( size_t nIx = 0; nIx < aFieldArr.size(); ++nIx )
+ maFields.clear();
+ maFields.reserve( rPivotFields.size() );
+ for( ScPivotFieldVector::const_iterator aIt = rPivotFields.begin(), aEnd = rPivotFields.end(); aIt != aEnd; ++aIt )
{
- aFieldRect.SetPos( GetFieldPosition( nIx ) );
- bool bFocus = HasFocus() && (nIx == nFieldSelected);
- DrawField( aVirDev, aFieldRect, aFieldArr[ nIx ], bFocus );
+ ScPivotWindowField aField( *mpDialog, *aIt, meFieldType == PIVOTFIELDTYPE_DATA );
+ if( aField.maFieldName.getLength() > 0 )
+ maFields.push_back( aField );
}
- DrawBitmap( aPos0, aVirDev.GetBitmap( aPos0, aSize ) );
+ Invalidate();
+}
- if( HasFocus() && (nFieldSelected < aFieldArr.size()) )
+void ScPivotFieldWindow::WriteFieldNames( ScDPNameVec& rFieldNames ) const
+{
+ rFieldNames.clear();
+ rFieldNames.reserve( maFields.size() );
+ // do not use the names stored in maFields, but generate plain display names from label data
+ for( ScPivotWindowFieldVector::const_iterator aIt = maFields.begin(), aEnd = maFields.end(); aIt != aEnd; ++aIt )
{
- long nFieldWidth = aFieldRect.GetWidth();
- long nSelectionWidth = Min( GetTextWidth( aFieldArr[ nFieldSelected ].first ) + 4, nFieldWidth - 6 );
- Rectangle aSelection(
- GetFieldPosition( nFieldSelected ) + Point( (nFieldWidth - nSelectionWidth) / 2, 3 ),
- Size( nSelectionWidth, aFieldRect.GetHeight() - 6 ) );
- InvertTracking( aSelection, SHOWTRACK_SMALL | SHOWTRACK_WINDOW );
+ if( ScDPLabelData* pLabelData = mpDialog->GetLabelData( aIt->maFuncData.mnCol ) )
+ {
+ OUString aDisplayName = pLabelData->getDisplayName();
+ if( aDisplayName.getLength() > 0 )
+ rFieldNames.push_back( aDisplayName );
+ }
}
-
- UpdateStyle();
}
-void ScDPFieldWindow::UpdateStyle()
+void ScPivotFieldWindow::WritePivotFields( ScPivotFieldVector& rPivotFields ) const
{
- WinBits nMask = ~(WB_TABSTOP | WB_NOTABSTOP);
- SetStyle( (GetStyle() & nMask) | (IsEmpty() ? WB_NOTABSTOP : WB_TABSTOP) );
+ rPivotFields.resize( maFields.size() );
+ ScPivotFieldVector::iterator aOutIt = rPivotFields.begin();
+ for( ScPivotWindowFieldVector::const_iterator aIt = maFields.begin(), aEnd = maFields.end(); aIt != aEnd; ++aIt, ++aOutIt )
+ {
+ aOutIt->nCol = aIt->maFuncData.mnCol;
+ aOutIt->nFuncMask = aIt->maFuncData.mnFuncMask;
+ aOutIt->maFieldRef = aIt->maFuncData.maFieldRef;
+ }
}
-//-------------------------------------------------------------------
-
-bool ScDPFieldWindow::IsValidIndex( size_t nIndex ) const
+OUString ScPivotFieldWindow::GetDescription() const
{
- return nIndex < nFieldSize;
+ switch( meFieldType )
+ {
+ case PIVOTFIELDTYPE_COL: return String( ScResId( STR_ACC_DATAPILOT_COL_DESCR ) );
+ case PIVOTFIELDTYPE_ROW: return String( ScResId( STR_ACC_DATAPILOT_ROW_DESCR ) );
+ case PIVOTFIELDTYPE_DATA: return String( ScResId( STR_ACC_DATAPILOT_DATA_DESCR ) );
+ case PIVOTFIELDTYPE_SELECT: return String( ScResId( STR_ACC_DATAPILOT_SEL_DESCR ) );
+ default:;
+ }
+ return OUString();
}
-bool ScDPFieldWindow::IsExistingIndex( size_t nIndex ) const
+OUString ScPivotFieldWindow::GetFieldText( size_t nFieldIndex ) const
{
- return nIndex < aFieldArr.size();
+ return (nFieldIndex < maFields.size()) ? maFields[ nFieldIndex ].maFieldName : OUString();
}
-bool ScDPFieldWindow::IsShortenedText( size_t nIndex ) const
+ScPivotFuncDataEntry ScPivotFieldWindow::FindFuncDataByCol( SCCOL nCol ) const
{
- return (nIndex < aFieldArr.size()) && !aFieldArr[ nIndex ].second;
+ for( ScPivotWindowFieldVector::const_iterator aIt = maFields.begin(), aEnd = maFields.end(); aIt != aEnd; ++aIt )
+ if( aIt->maFuncData.mnCol == nCol )
+ return ScPivotFuncDataEntry( &aIt->maFuncData, aIt - maFields.begin() );
+ return ScPivotFuncDataEntry( 0, PIVOTFIELD_INVALID );
}
-size_t ScDPFieldWindow::CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const
+Point ScPivotFieldWindow::GetFieldPosition( size_t nFieldIndex ) const
{
- size_t nNewField = nFieldSelected;
- switch( eType )
- {
- case TYPE_PAGE:
- nNewField += static_cast<SCsCOLROW>(nDX) + nDY * MAX_PAGEFIELDS / 2;
- break;
- case TYPE_COL:
- nNewField += static_cast<SCsCOLROW>(nDX) + nDY * MAX_FIELDS / 2;
- break;
- case TYPE_ROW:
- case TYPE_DATA:
- nNewField += nDY;
- break;
- case TYPE_SELECT:
- nNewField += static_cast<SCsCOLROW>(nDX) * LINE_SIZE + nDY;
- break;
- }
-
- return IsExistingIndex( nNewField ) ? nNewField : nFieldSelected;
+ long nRelIndex = static_cast< long >( nFieldIndex ) - mnFirstVisIndex;
+ long nCol = static_cast< long >( mbVertical ? (nRelIndex / mnRowCount) : (nRelIndex % mnColCount) );
+ long nRow = static_cast< long >( mbVertical ? (nRelIndex % mnRowCount) : (nRelIndex / mnColCount) );
+ return Point( nCol * (maFieldSize.Width() + maSpaceSize.Width()), nRow * (maFieldSize.Height() + maSpaceSize.Height()) );
}
-void ScDPFieldWindow::SetSelection( size_t nIndex )
+size_t ScPivotFieldWindow::GetFieldIndex( const Point& rWindowPos ) const
{
- if( !aFieldArr.empty() )
+ if( (rWindowPos.X() >= 0) && (rWindowPos.Y() >= 0) )
{
- if( nFieldSelected >= aFieldArr.size() )
- nFieldSelected = aFieldArr.size() - 1;
- if( nFieldSelected != nIndex )
+ long nGridWidth = maFieldSize.Width() + maSpaceSize.Width();
+ long nGridHeight = maFieldSize.Height() + maSpaceSize.Height();
+ size_t nCol = static_cast< size_t >( rWindowPos.X() / nGridWidth );
+ size_t nRow = static_cast< size_t >( rWindowPos.Y() / nGridHeight );
+ if( (nCol < mnColCount) && (nRow < mnRowCount) )
{
- sal_Int32 nOldSelected(nFieldSelected);
- nFieldSelected = nIndex;
- Redraw();
-
- if (pAccessible && HasFocus())
+ long nColOffset = rWindowPos.X() % nGridWidth;
+ long nRowOffset = rWindowPos.Y() % nGridHeight;
+ // check that passed position is not in the space between the fields
+ if( (nColOffset < maFieldSize.Width()) && (nRowOffset < maFieldSize.Height()) )
{
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->FieldFocusChange(nOldSelected, nFieldSelected);
- else
- pAccessible = NULL;
+ size_t nFieldIndex = mnFirstVisIndex + (mbVertical ? (nCol * mnRowCount + nRow) : (nRow * mnColCount + nCol));
+ return (nFieldIndex < maFields.size()) ? nFieldIndex : PIVOTFIELD_INVALID;
}
}
}
+ return PIVOTFIELD_INVALID;
}
-void ScDPFieldWindow::SetSelectionHome()
+size_t ScPivotFieldWindow::GetDropIndex( const Point& rWindowPos ) const
{
- if( !aFieldArr.empty() )
+ if( (rWindowPos.X() >= 0) && (rWindowPos.Y() >= 0) )
{
- if( eType == TYPE_SELECT )
- pDlg->NotifyMoveSlider( KEY_HOME );
- SetSelection( 0 );
+ long nGridWidth = maFieldSize.Width() + maSpaceSize.Width();
+ long nGridHeight = maFieldSize.Height() + maSpaceSize.Height();
+ size_t nCol = static_cast< size_t >( rWindowPos.X() / nGridWidth );
+ size_t nRow = static_cast< size_t >( rWindowPos.Y() / nGridHeight );
+ if( (nCol < mnColCount) && (nRow < mnRowCount) )
+ {
+ size_t nFieldIndex = mnFirstVisIndex + (mbVertical ? (nCol * mnRowCount + nRow) : (nRow * mnColCount + nCol));
+ long nColOffset = rWindowPos.X() % nGridWidth;
+ long nRowOffset = rWindowPos.Y() % nGridHeight;
+ // take next field, if position is in right/lower third
+ if( (mnColCount == 1) ? (nRowOffset * 3 > nGridHeight * 2) : (nColOffset * 3 > nGridWidth * 2) )
+ ++nFieldIndex;
+ return ::std::min( nFieldIndex, maFields.size() );
+ }
}
+ return maFields.size();
}
-void ScDPFieldWindow::SetSelectionEnd()
+void ScPivotFieldWindow::GrabFocusAndSelect( size_t nSelectIndex )
{
- if( !aFieldArr.empty() )
- {
- if( eType == TYPE_SELECT )
- pDlg->NotifyMoveSlider( KEY_END );
- SetSelection( aFieldArr.size() - 1 );
- }
+ if( !HasFocus() ) GrabFocus();
+ MoveSelection( nSelectIndex );
}
-void ScDPFieldWindow::MoveSelection( sal_uInt16 nKeyCode, SCsCOL nDX, SCsROW nDY )
+void ScPivotFieldWindow::SelectNextField()
{
- size_t nNewIndex = CalcNewFieldIndex( nDX, nDY );
- if( (eType == TYPE_SELECT) && (nNewIndex == nFieldSelected) )
+ MoveSelection( NEXT_FIELD );
+}
+
+void ScPivotFieldWindow::InsertField( size_t nInsertIndex, const ScPivotFuncData& rFuncData )
+{
+ if( (meFieldType != PIVOTFIELDTYPE_SELECT) && (nInsertIndex <= maFields.size()) )
{
- if( pDlg->NotifyMoveSlider( nKeyCode ) )
+ size_t nFieldIndex = FindFuncDataByCol( rFuncData.mnCol ).second;
+ if( nFieldIndex < maFields.size() )
+ {
+ // field exists already in this window, move it to the specified position
+ MoveField( nFieldIndex, nInsertIndex );
+ }
+ else
{
- switch( nKeyCode )
+ // insert the field into the vector and notify accessibility object
+ ScPivotWindowField aField( *mpDialog, rFuncData, meFieldType == PIVOTFIELDTYPE_DATA );
+ if( aField.maFieldName.getLength() > 0 )
{
- case KEY_UP: nNewIndex += (LINE_SIZE - 1); break;
- case KEY_DOWN: nNewIndex -= (LINE_SIZE - 1); break;
+ InsertFieldUnchecked( nInsertIndex, aField );
+ // adjust selection and scroll position
+ MoveSelection( nInsertIndex );
+ Invalidate();
}
}
}
- SetSelection( nNewIndex );
}
-void ScDPFieldWindow::ModifySelectionOffset( long nOffsetDiff )
+bool ScPivotFieldWindow::RemoveField( size_t nRemoveIndex )
{
- nFieldSelected -= nOffsetDiff;
- Redraw();
+ if( (meFieldType != PIVOTFIELDTYPE_SELECT) && (nRemoveIndex < maFields.size()) )
+ {
+ // remove the field from the vector and notify accessibility object
+ RemoveFieldUnchecked( nRemoveIndex );
+ // adjust selection and scroll position, if last field is removed
+ if( !maFields.empty() )
+ MoveSelection( (mnSelectIndex < maFields.size()) ? mnSelectIndex : (maFields.size() - 1) );
+ Invalidate();
+ return true;
+ }
+ return false;
}
-void ScDPFieldWindow::SelectNext()
+bool ScPivotFieldWindow::MoveField( size_t nFieldIndex, size_t nInsertIndex )
{
- if( eType == TYPE_SELECT )
- MoveSelection( KEY_DOWN, 0, 1 );
+ /* If field is moved behind current position, insertion index needs to be
+ adjusted, because the field is first removed from the vector. This is
+ done before nFieldIndex and nInsertIndex are checked for equality, to
+ catch the cases "move before ourselves" and "move bedind ourselves"
+ which are both no-ops. */
+ if( nFieldIndex < nInsertIndex )
+ --nInsertIndex;
+
+ if( (meFieldType != PIVOTFIELDTYPE_SELECT) && (nFieldIndex != nInsertIndex) && (nFieldIndex < maFields.size()) && (nInsertIndex < maFields.size()) )
+ {
+ // move the field in the vector and notify accessibility object
+ ScPivotWindowField aField = maFields[ nFieldIndex ];
+ RemoveFieldUnchecked( nFieldIndex );
+ InsertFieldUnchecked( nInsertIndex, aField );
+ // adjust selection and scroll position
+ MoveSelection( nInsertIndex );
+ Invalidate();
+ return true;
+ }
+ return false;
}
-void ScDPFieldWindow::GrabFocusWithSel( size_t nIndex )
+const ScPivotFuncData* ScPivotFieldWindow::GetSelectedFuncData() const
{
- SetSelection( nIndex );
- if( !HasFocus() )
- GrabFocus();
+ return (mnSelectIndex < maFields.size()) ? &maFields[ mnSelectIndex ].maFuncData : 0;
}
-void ScDPFieldWindow::MoveField( size_t nDestIndex )
+void ScPivotFieldWindow::ModifySelectedField( const ScPivotFuncData& rFuncData )
{
- if( nDestIndex != nFieldSelected )
+ if( mnSelectIndex < maFields.size() )
{
- // "recycle" existing functionality
- pDlg->NotifyMouseButtonDown( eType, nFieldSelected );
- pDlg->NotifyMouseButtonUp( OutputToScreenPixel( GetFieldPosition( nDestIndex ) ) );
+ maFields[ mnSelectIndex ].maFuncData = rFuncData;
+ maFields[ mnSelectIndex ].InitFieldName( *mpDialog, meFieldType == PIVOTFIELDTYPE_DATA );
+ Invalidate();
}
}
-void ScDPFieldWindow::MoveFieldRel( SCsCOL nDX, SCsROW nDY )
+bool ScPivotFieldWindow::RemoveSelectedField()
{
- MoveField( CalcNewFieldIndex( nDX, nDY ) );
+ return RemoveField( mnSelectIndex );
}
-//-------------------------------------------------------------------
-
-void __EXPORT ScDPFieldWindow::Paint( const Rectangle& /* rRect */ )
+bool ScPivotFieldWindow::MoveSelectedField( size_t nInsertIndex )
{
- // #124828# hiding the caption is now done from StateChanged
- Redraw();
+ return MoveField( mnSelectIndex, nInsertIndex );
}
-void ScDPFieldWindow::UseMnemonic()
+void ScPivotFieldWindow::NotifyStartTracking()
{
- // Now the FixedText has its mnemonic char. Grab the text and hide the
- // FixedText to be able to handle tabstop and mnemonics separately.
- if( pFtCaption )
- {
- SetText( pFtCaption->GetText() );
- pFtCaption->Hide();
- }
-
- // after reading the mnemonics, tab stop style bits can be updated
- UpdateStyle();
+ // rescue old scrolling index, to be able to restore it when tracking is cancelled
+ mnOldFirstVisIndex = mnFirstVisIndex;
}
-void __EXPORT ScDPFieldWindow::DataChanged( const DataChangedEvent& rDCEvt )
+void ScPivotFieldWindow::NotifyTracking( const Point& rWindowPos )
{
- if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ size_t nFieldIndex = GetDropIndex( rWindowPos );
+
+ // insertion index changed: draw new cursor and exit
+ if( nFieldIndex != mnInsCursorIndex )
{
- GetStyleSettings();
- Redraw();
+ mnInsCursorIndex = nFieldIndex;
+ mnAutoScrollDelay = INITIAL_TRACKING_DELAY;
+ Invalidate();
+ return;
}
- Control::DataChanged( rDCEvt );
-}
-void __EXPORT ScDPFieldWindow::MouseButtonDown( const MouseEvent& rMEvt )
-{
- if( rMEvt.IsLeft() )
+ // insertion index unchanged: countdown for auto scrolling
+ if( mnAutoScrollDelay > 0 )
{
- size_t nIndex = 0;
- if( GetFieldIndex( rMEvt.GetPosPixel(), nIndex ) && IsExistingIndex( nIndex ) )
- {
- GrabFocusWithSel( nIndex );
+ --mnAutoScrollDelay;
+ return;
+ }
- if( rMEvt.GetClicks() == 1 )
- {
- PointerStyle ePtr = pDlg->NotifyMouseButtonDown( eType, nIndex );
- CaptureMouse();
- SetPointer( Pointer( ePtr ) );
- }
- else
- pDlg->NotifyDoubleClick( eType, nIndex );
- }
+ // check if tracking happens on first or last field
+ long nScrollDelta = 0;
+ if( (mnInsCursorIndex > 0) && (mnInsCursorIndex == mnFirstVisIndex) )
+ nScrollDelta = -static_cast< long >( mnLineSize );
+ else if( (mnInsCursorIndex < maFields.size()) && (mnInsCursorIndex == mnFirstVisIndex + mnPageSize) )
+ nScrollDelta = static_cast< long >( mnLineSize );
+ if( nScrollDelta != 0 )
+ {
+ // update mnInsCursorIndex, so it will be drawn at the same position after scrolling
+ mnInsCursorIndex += nScrollDelta;
+ mnFirstVisIndex += nScrollDelta;
+ // delay auto scroll by line size, to slow down scrolling in column/page windows
+ mnAutoScrollDelay = mnLineSize - 1;
+ Invalidate();
}
}
-void __EXPORT ScDPFieldWindow::MouseButtonUp( const MouseEvent& rMEvt )
+void ScPivotFieldWindow::NotifyEndTracking( ScPivotFieldEndTracking eEndType )
{
- if( rMEvt.IsLeft() )
+ if( eEndType != ENDTRACKING_DROP )
+ mnFirstVisIndex = mnOldFirstVisIndex;
+ if( eEndType != ENDTRACKING_SUSPEND )
{
- if( rMEvt.GetClicks() == 1 )
- {
- pDlg->NotifyMouseButtonUp( OutputToScreenPixel( rMEvt.GetPosPixel() ) );
- SetPointer( Pointer( POINTER_ARROW ) );
- }
-
- if( IsMouseCaptured() )
- ReleaseMouse();
+ mnOldFirstVisIndex = PIVOTFIELD_INVALID;
+ mbIsTrackingSource = false;
}
+ mnInsCursorIndex = PIVOTFIELD_INVALID;
+ Invalidate();
}
-void __EXPORT ScDPFieldWindow::MouseMove( const MouseEvent& rMEvt )
+// protected ------------------------------------------------------------------
+
+void ScPivotFieldWindow::Paint( const Rectangle& /*rRect*/ )
{
- if( IsMouseCaptured() )
+ // prepare a virtual device for buffered painting
+ VirtualDevice aVirDev;
+ // #i97623# VirtualDevice is always LTR on construction while other windows derive direction from parent
+ aVirDev.EnableRTL( IsRTLEnabled() );
+ aVirDev.SetMapMode( MAP_PIXEL );
+ aVirDev.SetOutputSizePixel( GetSizePixel() );
+ Font aFont = GetFont();
+ aFont.SetTransparent( true );
+ aVirDev.SetFont( aFont );
+
+ // draw the background and all fields
+ DrawBackground( aVirDev );
+ for( size_t nFieldIndex = mnFirstVisIndex, nEndIndex = mnFirstVisIndex + mnPageSize; nFieldIndex < nEndIndex; ++nFieldIndex )
+ DrawField( aVirDev, nFieldIndex );
+ DrawInsertionCursor( aVirDev );
+ DrawBitmap( Point( 0, 0 ), aVirDev.GetBitmap( Point( 0, 0 ), GetSizePixel() ) );
+
+ // draw field text focus
+ if( HasFocus() && (mnSelectIndex < maFields.size()) && (mnFirstVisIndex <= mnSelectIndex) && (mnSelectIndex < mnFirstVisIndex + mnPageSize) )
{
- PointerStyle ePtr = pDlg->NotifyMouseMove( OutputToScreenPixel( rMEvt.GetPosPixel() ) );
- SetPointer( Pointer( ePtr ) );
+ long nFieldWidth = maFieldSize.Width();
+ long nSelectionWidth = Min( GetTextWidth( maFields[ mnSelectIndex ].maFieldName ) + 4, nFieldWidth - 6 );
+ Rectangle aSelection(
+ GetFieldPosition( mnSelectIndex ) + Point( (nFieldWidth - nSelectionWidth) / 2, 3 ),
+ Size( nSelectionWidth, maFieldSize.Height() - 6 ) );
+ InvertTracking( aSelection, SHOWTRACK_SMALL | SHOWTRACK_WINDOW );
}
- size_t nIndex = 0;
- if( GetFieldIndex( rMEvt.GetPosPixel(), nIndex ) && IsShortenedText( nIndex ) )
+
+ // update scrollbar
+ size_t nFieldCount = maFields.size();
+ /* Already show the scrollbar if window is full but no fields are hidden
+ (yet). This gives the user the hint that it is now possible to add more
+ fields to the window. */
+ mrScrollBar.Show( nFieldCount >= mnPageSize );
+ mrScrollBar.Enable( nFieldCount > mnPageSize );
+ if( mrScrollBar.IsVisible() )
{
- Point aPos = OutputToScreenPixel( rMEvt.GetPosPixel() );
- Rectangle aRect( aPos, GetSizePixel() );
- String aHelpText = GetFieldText(nIndex);
- Help::ShowQuickHelp( this, aRect, aHelpText );
+ mrScrollBar.SetRange( Range( 0, static_cast< long >( (nFieldCount - 1) / mnLineSize + 1 ) ) );
+ mrScrollBar.SetThumbPos( static_cast< long >( mnFirstVisIndex / mnLineSize ) );
}
+
+ /* Exclude empty fields from tab chain, but do not disable them. They need
+ to be enabled because they still act as target for field movement via
+ keyboard shortcuts. */
+ WinBits nMask = ~(WB_TABSTOP | WB_NOTABSTOP);
+ SetStyle( (GetStyle() & nMask) | (IsEmpty() ? WB_NOTABSTOP : WB_TABSTOP) );
}
-void __EXPORT ScDPFieldWindow::KeyInput( const KeyEvent& rKEvt )
+void ScPivotFieldWindow::StateChanged( StateChangedType nStateChange )
{
- const KeyCode& rKeyCode = rKEvt.GetKeyCode();
- sal_uInt16 nCode = rKeyCode.GetCode();
- sal_Bool bKeyEvaluated = sal_False;
+ Control::StateChanged( nStateChange );
- if( rKeyCode.IsMod1() && (eType != TYPE_SELECT) )
- {
- bKeyEvaluated = sal_True;
- switch( nCode )
- {
- case KEY_UP: MoveFieldRel( 0, -1 ); break;
- case KEY_DOWN: MoveFieldRel( 0, 1 ); break;
- case KEY_LEFT: MoveFieldRel( -1, 0 ); break;
- case KEY_RIGHT: MoveFieldRel( 1, 0 ); break;
- case KEY_HOME: MoveField( 0 ); break;
- case KEY_END: MoveField( aFieldArr.size() - 1 ); break;
- default: bKeyEvaluated = sal_False;
- }
- }
- else
+ if( nStateChange == STATE_CHANGE_INITSHOW )
{
- bKeyEvaluated = sal_True;
- switch( nCode )
+ /* After the fixed text associated to this control has received its
+ unique mnemonic from VCL dialog initialization code, put this text
+ into the field windows.
+ #124828# Hiding the FixedTexts and clearing the tab stop style bits
+ has to be done after assigning the mnemonics, but Paint() is too
+ late, because the test tool may send key events to the dialog when
+ it isn't visible. Mnemonics are assigned in Dialog::StateChanged()
+ for STATE_CHANGE_INITSHOW, so this can be done immediately
+ afterwards. */
+ if( mpFtCaption )
{
- case KEY_UP: MoveSelection( nCode, 0, -1 ); break;
- case KEY_DOWN: MoveSelection( nCode, 0, 1 ); break;
- case KEY_LEFT: MoveSelection( nCode, -1, 0 ); break;
- case KEY_RIGHT: MoveSelection( nCode, 1, 0 ); break;
- case KEY_HOME: SetSelectionHome(); break;
- case KEY_END: SetSelectionEnd(); break;
- case KEY_DELETE:
- pDlg->NotifyRemoveField( eType, nFieldSelected ); break;
- default: bKeyEvaluated = sal_False;
+ SetText( mpFtCaption->GetText() );
+ mpFtCaption->Hide();
}
}
-
- if( !bKeyEvaluated )
- Control::KeyInput( rKEvt );
}
-void __EXPORT ScDPFieldWindow::GetFocus()
+void ScPivotFieldWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
- Control::GetFocus();
- Redraw();
- if( GetGetFocusFlags() & GETFOCUS_MNEMONIC ) // move field on shortcut
- pDlg->NotifyMoveField( eType );
- else // else change focus
- pDlg->NotifyFieldFocus( eType, sal_True );
-
- if (pAccessible)
- {
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->GotFocus();
- else
- pAccessible = NULL;
- }
+ Control::DataChanged( rDCEvt );
+ if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ Invalidate();
}
-void __EXPORT ScDPFieldWindow::LoseFocus()
+void ScPivotFieldWindow::KeyInput( const KeyEvent& rKEvt )
{
- Control::LoseFocus();
- Redraw();
- pDlg->NotifyFieldFocus( eType, sal_False );
+ bool bKeyEvaluated = false;
- if (pAccessible)
+ if( !maFields.empty() )
{
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->LostFocus();
+ const KeyCode& rKeyCode = rKEvt.GetKeyCode();
+ sal_uInt16 nCode = rKeyCode.GetCode();
+
+ // do not move fields in selection window
+ if( rKeyCode.IsMod1() && (meFieldType != PIVOTFIELDTYPE_SELECT) )
+ {
+ bKeyEvaluated = true;
+ switch( nCode )
+ {
+ case KEY_UP: MoveSelectedField( mbVertical ? PREV_FIELD : PREV_LINE ); break;
+ case KEY_DOWN: MoveSelectedField( mbVertical ? NEXT_FIELD : NEXT_LINE ); break;
+ case KEY_LEFT: MoveSelectedField( mbVertical ? PREV_LINE : PREV_FIELD ); break;
+ case KEY_RIGHT: MoveSelectedField( mbVertical ? NEXT_LINE : NEXT_FIELD ); break;
+ case KEY_HOME: MoveSelectedField( FIRST_FIELD ); break;
+ case KEY_END: MoveSelectedField( LAST_FIELD ); break;
+ default: bKeyEvaluated = false;
+ }
+ }
else
- pAccessible = NULL;
+ {
+ bKeyEvaluated = true;
+ switch( nCode )
+ {
+ case KEY_UP: MoveSelection( mbVertical ? PREV_FIELD : PREV_LINE ); break;
+ case KEY_DOWN: MoveSelection( mbVertical ? NEXT_FIELD : NEXT_LINE ); break;
+ case KEY_LEFT: MoveSelection( mbVertical ? PREV_LINE : PREV_FIELD ); break;
+ case KEY_RIGHT: MoveSelection( mbVertical ? NEXT_LINE : NEXT_FIELD ); break;
+ case KEY_PAGEUP: MoveSelection( PREV_PAGE ); break;
+ case KEY_PAGEDOWN: MoveSelection( NEXT_PAGE ); break;
+ case KEY_HOME: MoveSelection( FIRST_FIELD ); break;
+ case KEY_END: MoveSelection( LAST_FIELD ); break;
+ // delete field per DEL key - dialog needs to change focus if window becomes empty
+ case KEY_DELETE: RemoveSelectedField(); mpDialog->NotifyFieldRemoved( *this ); break;
+ default: bKeyEvaluated = false;
+ }
+ }
}
-}
-//-------------------------------------------------------------------
+ if( !bKeyEvaluated )
+ Control::KeyInput( rKEvt );
+}
-void ScDPFieldWindow::AddField( const String& rText, size_t nNewIndex )
+void ScPivotFieldWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- DBG_ASSERT( nNewIndex == aFieldArr.size(), "ScDPFieldWindow::AddField - invalid index" );
- if( IsValidIndex( nNewIndex ) )
+ if( rMEvt.IsLeft() )
{
- aFieldArr.push_back( FieldString( rText, true ) );
- if (pAccessible)
+ size_t nNewSelectIndex = GetFieldIndex( rMEvt.GetPosPixel() );
+ if( nNewSelectIndex < maFields.size() )
{
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->AddField(nNewIndex);
+ // grabbing after GetFieldIndex() will prevent to focus empty window
+ GrabFocusAndSelect( nNewSelectIndex );
+ if( rMEvt.GetClicks() == 1 )
+ {
+ // one click: start tracking
+ mbIsTrackingSource = true;
+ mnOldFirstVisIndex = mnFirstVisIndex;
+ mpDialog->NotifyStartTracking( *this );
+ }
else
- pAccessible = NULL;
+ {
+ // two clicks: open field options dialog
+ mpDialog->NotifyDoubleClick( *this );
+ }
}
}
}
-void ScDPFieldWindow::DelField( size_t nDelIndex )
+void ScPivotFieldWindow::RequestHelp( const HelpEvent& rHEvt )
{
- if( IsExistingIndex( nDelIndex ) )
+ if( (rHEvt.GetMode() & HELPMODE_QUICK) != 0 )
{
- if (pAccessible) // before decrement fieldcount
+ // show a tooltip with full field name, if field text is clipped
+ size_t nFieldIndex = GetFieldIndex( rHEvt.GetMousePosPixel() - GetPosPixel() );
+ if( (nFieldIndex < maFields.size()) && maFields[ nFieldIndex ].mbClipped )
{
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->RemoveField(nDelIndex);
- else
- pAccessible = NULL;
+ Rectangle aRect( rHEvt.GetMousePosPixel(), GetSizePixel() );
+ Help::ShowQuickHelp( this, aRect, maFields[ nFieldIndex ].maFieldName );
+ return;
}
- aFieldArr.erase( aFieldArr.begin() + nDelIndex );
- Redraw();
}
+ Control::RequestHelp( rHEvt );
}
-void ScDPFieldWindow::ClearFields()
+void ScPivotFieldWindow::GetFocus()
{
- if( eType == TYPE_SELECT || eType == TYPE_PAGE || eType == TYPE_COL || eType == TYPE_ROW || eType == TYPE_DATA)
- {
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (!xTempAcc.is() && pAccessible)
- pAccessible = NULL;
- if (pAccessible)
- for( size_t nIdx = aFieldArr.size(); nIdx > 0; --nIdx )
- pAccessible->RemoveField( nIdx - 1 );
+ Control::GetFocus();
+ Invalidate();
+ ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
+ if( xAcc.is() )
+ xAcc->GotFocus();
+}
- aFieldArr.clear();
- }
+void ScPivotFieldWindow::LoseFocus()
+{
+ Control::LoseFocus();
+ Invalidate();
+ ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
+ if( xAcc.is() )
+ xAcc->LostFocus();
+}
+
+uno::Reference< accessibility::XAccessible > ScPivotFieldWindow::CreateAccessible()
+{
+ mpAccessible = new ScAccessibleDataPilotControl( GetAccessibleParentWindow()->GetAccessible(), this );
+ uno::Reference< accessibility::XAccessible > xReturn( mpAccessible );
+ mpAccessible->Init();
+ mxAccessible = xReturn;
+ return xReturn;
+}
+
+// private --------------------------------------------------------------------
+
+size_t ScPivotFieldWindow::RecalcVisibleIndex( size_t nSelectIndex ) const
+{
+ // calculate a scrolling offset that shows the selected field
+ size_t nNewFirstVisIndex = mnFirstVisIndex;
+ if( nSelectIndex < nNewFirstVisIndex )
+ nNewFirstVisIndex = static_cast< size_t >( (nSelectIndex / mnLineSize) * mnLineSize );
+ else if( nSelectIndex >= nNewFirstVisIndex + mnPageSize )
+ nNewFirstVisIndex = static_cast< size_t >( (nSelectIndex / mnLineSize + 1) * mnLineSize ) - mnPageSize;
+ // check if there are complete empty lines in the bottom/right
+ size_t nMaxFirstVisIndex = (maFields.size() <= mnPageSize) ? 0 : (((maFields.size() - 1) / mnLineSize + 1) * mnLineSize - mnPageSize);
+ return ::std::min( nNewFirstVisIndex, nMaxFirstVisIndex );
}
-void ScDPFieldWindow::SetFieldText( const String& rText, size_t nIndex )
+void ScPivotFieldWindow::SetSelectionUnchecked( size_t nSelectIndex, size_t nFirstVisIndex )
{
- if( IsExistingIndex( nIndex ) )
+ if( !maFields.empty() && (nSelectIndex < maFields.size()) )
{
- aFieldArr[ nIndex ] = FieldString( rText, true );
- Redraw();
+ bool bScrollPosChanged = mnFirstVisIndex != nFirstVisIndex;
+ bool bSelectionChanged = mnSelectIndex != nSelectIndex;
- if (pAccessible)
+ sal_Int32 nOldSelected = static_cast< sal_Int32 >( mnSelectIndex );
+ mnFirstVisIndex = nFirstVisIndex;
+ mnSelectIndex = nSelectIndex;
+
+ if( bScrollPosChanged || bSelectionChanged )
+ Invalidate();
+
+ // TODO: accessibility action for changed scrolling position?
+
+ // notify accessibility object about changed selection
+ if( bSelectionChanged && HasFocus() )
{
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->FieldNameChange(nIndex);
- else
- pAccessible = NULL;
+ ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
+ if( xAcc.is() )
+ xAcc->FieldFocusChange( nOldSelected, static_cast< sal_Int32 >( mnSelectIndex ) );
}
}
}
-const String& ScDPFieldWindow::GetFieldText( size_t nIndex ) const
+void ScPivotFieldWindow::MoveSelection( size_t nSelectIndex )
{
- if( IsExistingIndex( nIndex ) )
- return aFieldArr[ nIndex ].first;
- return EMPTY_STRING;
+ if( nSelectIndex < maFields.size() )
+ SetSelectionUnchecked( nSelectIndex, RecalcVisibleIndex( nSelectIndex ) );
}
-//-------------------------------------------------------------------
-
-bool ScDPFieldWindow::AddField( const String& rText, const Point& rPos, size_t& rnIndex )
+void ScPivotFieldWindow::MoveSelection( MoveType eMoveType )
{
- if ( aFieldArr.size() == nFieldSize )
- return sal_False;
+ if( maFields.empty() )
+ return;
- size_t nNewIndex = 0;
- if( GetFieldIndex( rPos, nNewIndex ) )
+ size_t nLastIndex = maFields.size() - 1;
+ size_t nNewSelectIndex = mnSelectIndex;
+ switch( eMoveType )
{
- if( nNewIndex > aFieldArr.size() )
- nNewIndex = aFieldArr.size();
-
- aFieldArr.insert( aFieldArr.begin() + nNewIndex, FieldString( rText, true ) );
- nFieldSelected = nNewIndex;
- Redraw();
- rnIndex = nNewIndex;
+ case PREV_FIELD:
+ nNewSelectIndex = (nNewSelectIndex > 0) ? (nNewSelectIndex - 1) : 0;
+ break;
+ case NEXT_FIELD:
+ nNewSelectIndex = (nNewSelectIndex < nLastIndex) ? (nNewSelectIndex + 1) : nLastIndex;
+ break;
+ case PREV_LINE:
+ nNewSelectIndex = (nNewSelectIndex > mnLineSize) ? (nNewSelectIndex - mnLineSize) : 0;
+ break;
+ case NEXT_LINE:
+ nNewSelectIndex = (nNewSelectIndex + mnLineSize < nLastIndex) ? (nNewSelectIndex + mnLineSize) : nLastIndex;
+ break;
+ case PREV_PAGE:
+ nNewSelectIndex = (nNewSelectIndex > mnPageSize) ? (nNewSelectIndex - mnPageSize) : 0;
+ break;
+ case NEXT_PAGE:
+ nNewSelectIndex = (nNewSelectIndex + mnPageSize < nLastIndex) ? (nNewSelectIndex + mnPageSize) : nLastIndex;
+ break;
+ case FIRST_FIELD:
+ nNewSelectIndex = 0;
+ break;
+ case LAST_FIELD:
+ nNewSelectIndex = nLastIndex;
+ break;
+ }
- if (pAccessible)
- {
- com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible;
- if (xTempAcc.is())
- pAccessible->AddField(nNewIndex);
- else
- pAccessible = NULL;
- }
+ // SetSelectionUnchecked() redraws the control and updates the scrollbar
+ SetSelectionUnchecked( nNewSelectIndex, RecalcVisibleIndex( nNewSelectIndex ) );
+}
- return true;
+void ScPivotFieldWindow::MoveSelectedField( MoveType eMoveType )
+{
+ if( mnSelectIndex < maFields.size() )
+ {
+ // find position to insert the field by changing the selection first
+ size_t nOldSelectIndex = mnSelectIndex;
+ MoveSelection( eMoveType );
+ MoveField( nOldSelectIndex, (nOldSelectIndex < mnSelectIndex) ? (mnSelectIndex + 1) : mnSelectIndex );
}
+}
- return false;
+void ScPivotFieldWindow::InsertFieldUnchecked( size_t nInsertIndex, const ScPivotWindowField& rField )
+{
+ maFields.insert( maFields.begin() + nInsertIndex, rField );
+ ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
+ if( xAcc.is() )
+ xAcc->AddField( static_cast< sal_Int32 >( nInsertIndex ) );
+}
+
+void ScPivotFieldWindow::RemoveFieldUnchecked( size_t nRemoveIndex )
+{
+ ::rtl::Reference< ScAccessibleDataPilotControl > xAcc = GetAccessibleControl();
+ if( xAcc.is() )
+ xAcc->RemoveField( static_cast< sal_Int32 >( nRemoveIndex ) );
+ maFields.erase( maFields.begin() + nRemoveIndex );
}
-void ScDPFieldWindow::GetExistingIndex( const Point& rPos, size_t& rnIndex )
+void ScPivotFieldWindow::DrawBackground( OutputDevice& rDev )
{
- if( !aFieldArr.empty() && (eType != TYPE_SELECT) && GetFieldIndex( rPos, rnIndex ) )
+ Size aDevSize = rDev.GetOutputSizePixel();
+ const StyleSettings& rStyleSett = GetSettings().GetStyleSettings();
+
+ if( meFieldType == PIVOTFIELDTYPE_SELECT )
{
- if( rnIndex >= aFieldArr.size() )
- rnIndex = aFieldArr.size() - 1;
+ rDev.SetLineColor();
+ rDev.SetFillColor( rStyleSett.GetFaceColor() );
+ rDev.DrawRect( Rectangle( Point( 0, 0 ), aDevSize ) );
}
else
- rnIndex = 0;
+ {
+ rDev.SetLineColor( rStyleSett.GetWindowTextColor() );
+ rDev.SetFillColor( rStyleSett.GetWindowColor() );
+ rDev.DrawRect( Rectangle( Point( 0, 0 ), aDevSize ) );
+
+ /* Draw the caption text. This needs some special handling, because we
+ support hard line breaks here. This part will draw each line of the
+ text for itself. */
+ rDev.SetTextColor( rStyleSett.GetWindowTextColor() );
+ xub_StrLen nTokenCnt = GetText().GetTokenCount( '\n' );
+ long nY = (aDevSize.Height() - nTokenCnt * rDev.GetTextHeight()) / 2;
+ for( xub_StrLen nToken = 0, nStringIx = 0; nToken < nTokenCnt; ++nToken )
+ {
+ String aLine = GetText().GetToken( 0, '\n', nStringIx );
+ Point aLinePos( (aDevSize.Width() - rDev.GetCtrlTextWidth( aLine )) / 2, nY );
+ rDev.DrawCtrlText( aLinePos, aLine );
+ nY += rDev.GetTextHeight();
+ }
+ }
}
-String ScDPFieldWindow::GetDescription() const
+void ScPivotFieldWindow::DrawField( OutputDevice& rDev, size_t nFieldIndex )
{
- String sDescription;
- switch( eType )
+ if( (nFieldIndex < maFields.size()) && (mnFirstVisIndex <= nFieldIndex) && (nFieldIndex < mnFirstVisIndex + mnPageSize) )
{
- case TYPE_COL:
- sDescription = ScResId(STR_ACC_DATAPILOT_COL_DESCR);
- break;
- case TYPE_ROW:
- sDescription = ScResId(STR_ACC_DATAPILOT_ROW_DESCR);
- break;
- case TYPE_DATA:
- sDescription = ScResId(STR_ACC_DATAPILOT_DATA_DESCR);
- break;
- case TYPE_SELECT:
- sDescription = ScResId(STR_ACC_DATAPILOT_SEL_DESCR);
- break;
- default:
+ // draw the button
+ Point aFieldPos = GetFieldPosition( nFieldIndex );
+ bool bFocus = HasFocus() && (nFieldIndex == mnSelectIndex);
+ DecorationView aDecoView( &rDev );
+ aDecoView.DrawButton( Rectangle( aFieldPos, maFieldSize ), bFocus ? BUTTON_DRAW_DEFAULT : 0 );
+
+ // #i31600# if text is too long, cut and add ellipsis
+ const OUString& rFullText = maFields[ nFieldIndex ].maFieldName;
+ OUString aClippedText = rFullText;
+ long nLabelWidth = rDev.GetTextWidth( rFullText );
+ if( (maFields[ nFieldIndex ].mbClipped = nLabelWidth + 6 > maFieldSize.Width()) == true )
{
- // added to avoid warnings
+ sal_Int32 nMinLen = 0;
+ sal_Int32 nMaxLen = rFullText.getLength();
+ bool bFits = false;
+ do
+ {
+ sal_Int32 nCurrLen = (nMinLen + nMaxLen) / 2;
+ aClippedText = rFullText.copy( 0, nCurrLen ) + OUString( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
+ nLabelWidth = rDev.GetTextWidth( aClippedText );
+ bFits = nLabelWidth + 6 <= maFieldSize.Width();
+ (bFits ? nMinLen : nMaxLen) = nCurrLen;
+ }
+ while( !bFits || (nMinLen + 1 < nMaxLen) );
}
+
+ // draw the button text
+ Point aLabelOffset( (maFieldSize.Width() - nLabelWidth) / 2, ::std::max< long >( (maFieldSize.Height() - rDev.GetTextHeight()) / 2, 3 ) );
+ rDev.SetTextColor( GetSettings().GetStyleSettings().GetButtonTextColor() );
+ rDev.DrawText( aFieldPos + aLabelOffset, aClippedText );
}
- return sDescription;
}
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ScDPFieldWindow::CreateAccessible()
+void ScPivotFieldWindow::DrawInsertionCursor( OutputDevice& rDev )
{
- pAccessible =
- new ScAccessibleDataPilotControl(GetAccessibleParentWindow()->GetAccessible(), this);
+ if( (mnInsCursorIndex <= maFields.size()) && (mnFirstVisIndex <= mnInsCursorIndex) && (mnInsCursorIndex <= mnFirstVisIndex + mnPageSize) &&
+ (!mbIsTrackingSource || (mnInsCursorIndex < mnSelectIndex) || (mnInsCursorIndex > mnSelectIndex + 1)) )
+ {
+ Color aTextColor = GetSettings().GetStyleSettings().GetButtonTextColor();
+ rDev.SetLineColor( aTextColor );
+ rDev.SetFillColor( aTextColor );
- com::sun::star::uno::Reference < ::com::sun::star::accessibility::XAccessible > xReturn = pAccessible;
+ bool bVerticalCursor = mnColCount > 1;
+ long nCursorLength = bVerticalCursor ? maFieldSize.Height() : maFieldSize.Width();
- pAccessible->Init();
- xAccessible = xReturn;
+ bool bEndOfLastField = mnInsCursorIndex == mnFirstVisIndex + mnPageSize;
+ Point aMainLinePos = GetFieldPosition( bEndOfLastField ? (mnInsCursorIndex - 1) : mnInsCursorIndex );
+ if( bEndOfLastField )
+ (bVerticalCursor ? aMainLinePos.X() : aMainLinePos.Y()) += ((bVerticalCursor ? maFieldSize.Width() : maFieldSize.Height()) - CURSOR_WIDTH);
+ else if( (bVerticalCursor ? aMainLinePos.X() : aMainLinePos.Y()) > 0 )
+ (bVerticalCursor ? aMainLinePos.X() : aMainLinePos.Y()) -= ((CURSOR_WIDTH + 1) / 2);
+ Size aMainLineSize( bVerticalCursor ? CURSOR_WIDTH : nCursorLength, bVerticalCursor ? nCursorLength : CURSOR_WIDTH );
+ rDev.DrawRect( Rectangle( aMainLinePos, aMainLineSize ) );
- return xReturn;
+ Point aSubLinePos = aMainLinePos;
+ (bVerticalCursor ? aSubLinePos.X() : aSubLinePos.Y()) -= CURSOR_WIDTH;
+ Size aSubLineSize( bVerticalCursor ? (3 * CURSOR_WIDTH) : CURSOR_WIDTH, bVerticalCursor ? CURSOR_WIDTH : (3 * CURSOR_WIDTH) );
+ rDev.DrawRect( Rectangle( aSubLinePos, aSubLineSize ) );
+
+ (bVerticalCursor ? aSubLinePos.Y() : aSubLinePos.X()) += (nCursorLength - CURSOR_WIDTH);
+ rDev.DrawRect( Rectangle( aSubLinePos, aSubLineSize ) );
+ }
}
-//===================================================================
+::rtl::Reference< ScAccessibleDataPilotControl > ScPivotFieldWindow::GetAccessibleControl()
+{
+ ::rtl::Reference< ScAccessibleDataPilotControl > xAccImpl;
+ if( mpAccessible )
+ {
+ // try to resolve the weak reference mxAccessible
+ uno::Reference< accessibility::XAccessible > xAcc = mxAccessible;
+ if( xAcc.is() )
+ xAccImpl.set( mpAccessible ); // the rtl reference keeps the object alive
+ else
+ mpAccessible = 0; // object is dead, forget the pointer
+ }
+ return xAccImpl;
+ }
+
+// handlers -------------------------------------------------------------------
+
+IMPL_LINK( ScPivotFieldWindow, ScrollHdl, ScrollBar*, pScrollBar )
+{
+ // scrollbar may return negative values, if it is too small
+ long nThumbPos = pScrollBar->GetThumbPos();
+ if( nThumbPos >= 0 )
+ {
+ size_t nNewFirstVisIndex = static_cast< size_t >( nThumbPos * mnLineSize );
+ // keep the selection index on same relative position inside row/column
+ size_t nSelectLineOffset = mnSelectIndex % mnLineSize;
+ size_t nNewSelectIndex = mnSelectIndex;
+ if( nNewSelectIndex < nNewFirstVisIndex )
+ nNewSelectIndex = nNewFirstVisIndex + nSelectLineOffset;
+ else if( nNewSelectIndex >= nNewFirstVisIndex + mnPageSize )
+ nNewSelectIndex = nNewFirstVisIndex + mnPageSize - mnLineSize + nSelectLineOffset;
+ nNewSelectIndex = ::std::min( nNewSelectIndex, maFields.size() - 1 );
+ SetSelectionUnchecked( nNewSelectIndex, nNewFirstVisIndex );
+ }
+ GrabFocus();
+ return 0;
+}
+// ============================================================================
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 5b2b7b47fdd2..8e2bbc7458c3 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -132,6 +132,65 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
pTimer = new Timer;
pTimer->SetTimeout( 50 ); // 50ms warten
pTimer->SetTimeoutHdl( LINK( this, ScFilterDlg, TimeOutHdl ) );
+
+ String sAccName (ScResId(RID_FILTER_OPERATOR));
+ String sIndexName(sAccName);
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1"));
+ aLbConnect1.SetAccessibleName(sIndexName);
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2"));
+ aLbConnect2.SetAccessibleName(sIndexName);
+
+ sAccName = String(ScResId(RID_FILTER_FIELDNAME));
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1"));
+ aLbField1.SetAccessibleName(sIndexName);
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2"));
+ aLbField2.SetAccessibleName(sIndexName);
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 3"));
+ aLbField3.SetAccessibleName(sIndexName);
+
+
+ sAccName = String(ScResId(RID_FILTER_CONDITION));
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1"));
+ aLbCond1.SetAccessibleName(sIndexName);
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2"));
+ aLbCond2.SetAccessibleName(sIndexName);
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 3"));
+ aLbCond3.SetAccessibleName(sIndexName);
+
+ sAccName = String(ScResId(RID_FILTER_VALUE));
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 1"));
+ aEdVal1.SetAccessibleName(sIndexName);
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 2"));
+ aEdVal2.SetAccessibleName(sIndexName);
+ sIndexName = sAccName;
+ sIndexName.AppendAscii (RTL_CONSTASCII_STRINGPARAM (" 3"));
+ aEdVal3.SetAccessibleName(sIndexName);
+
+ aLbCopyArea.SetAccessibleName(ScResId(STR_COPY_AREA_TO));
+ aEdCopyArea.SetAccessibleName(ScResId(STR_COPY_AREA_TO));
+ aLbCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult);
+ aEdCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult);
+
+ aLbConnect1.SetAccessibleRelationLabeledBy(&aFtConnect);
+ aLbConnect2.SetAccessibleRelationLabeledBy(&aFtConnect);
+ aLbField1.SetAccessibleRelationLabeledBy(&aFtField);
+ aLbField2.SetAccessibleRelationLabeledBy(&aFtField);
+ aLbField3.SetAccessibleRelationLabeledBy(&aFtField);
+ aLbCond1.SetAccessibleRelationLabeledBy(&aFtCond);
+ aLbCond2.SetAccessibleRelationLabeledBy(&aFtCond);
+ aLbCond3.SetAccessibleRelationLabeledBy(&aFtCond);
+ aEdVal1.SetAccessibleRelationLabeledBy(&aFtVal);
+ aEdVal2.SetAccessibleRelationLabeledBy(&aFtVal);
+ aEdVal3.SetAccessibleRelationLabeledBy(&aFtVal);
}
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index 64456ef2cf2d..b21afc999b28 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -44,10 +44,20 @@ static const sal_Char pStrFix[] = "FIX";
ScImportOptions::ScImportOptions( const String& rStr )
{
+ // Use the same string format as ScAsciiOptions,
+ // because the import options string is passed here when a CSV file is loaded and saved again.
+ // The old format is still supported because it might be used in macros.
+
bFixedWidth = sal_False;
nFieldSepCode = 0;
- if ( rStr.GetTokenCount(',') >= 3 )
+ nTextSepCode = 0;
+ eCharSet = RTL_TEXTENCODING_DONTKNOW;
+ bSaveAsShown = sal_True; // "true" if not in string (after CSV import)
+ bQuoteAllText = sal_False;
+ xub_StrLen nTokenCount = rStr.GetTokenCount(',');
+ if ( nTokenCount >= 3 )
{
+ // first 3 tokens: common
String aToken( rStr.GetToken( 0, ',' ) );
if( aToken.EqualsIgnoreCaseAscii( pStrFix ) )
bFixedWidth = sal_True;
@@ -56,7 +66,21 @@ ScImportOptions::ScImportOptions( const String& rStr )
nTextSepCode = (sal_Unicode) rStr.GetToken(1,',').ToInt32();
aStrFont = rStr.GetToken(2,',');
eCharSet = ScGlobal::GetCharsetValue(aStrFont);
- bSaveAsShown = (rStr.GetToken( 3, ',' ).ToInt32() ? sal_True : sal_False);
+
+ if ( nTokenCount == 4 )
+ {
+ // compatibility with old options string: "Save as shown" as 4th token, numeric
+ bSaveAsShown = (rStr.GetToken( 3, ',' ).ToInt32() ? sal_True : sal_False);
+ bQuoteAllText = sal_True; // use old default then
+ }
+ else
+ {
+ // look at the same positions as in ScAsciiOptions
+ if ( nTokenCount >= 7 )
+ bQuoteAllText = rStr.GetToken(6, ',').EqualsAscii("true");
+ if ( nTokenCount >= 9 )
+ bSaveAsShown = rStr.GetToken(8, ',').EqualsAscii("true");
+ }
}
}
@@ -74,8 +98,11 @@ String ScImportOptions::BuildString() const
aResult += String::CreateFromInt32(nTextSepCode);
aResult += ',';
aResult += aStrFont;
- aResult += ',';
- aResult += String::CreateFromInt32( bSaveAsShown ? 1 : 0 );
+ // use the same string format as ScAsciiOptions:
+ aResult.AppendAscii( ",1,,0," ); // first row, no column info, default language
+ aResult.AppendAscii(bQuoteAllText ? "true" : "false"); // same as "quoted field as text" in ScAsciiOptions
+ aResult.AppendAscii( ",true," ); // "detect special numbers"
+ aResult.AppendAscii(bSaveAsShown ? "true" : "false"); // "save as shown": not in ScAsciiOptions
return aResult;
}
diff --git a/sc/source/ui/dbgui/imoptdlg.hrc b/sc/source/ui/dbgui/imoptdlg.hrc
index 5fd9256e8009..22136706de9d 100644
--- a/sc/source/ui/dbgui/imoptdlg.hrc
+++ b/sc/source/ui/dbgui/imoptdlg.hrc
@@ -41,4 +41,5 @@
#define FL_FIELDOPT 11
#define CB_FIXEDWIDTH 12
#define CB_SAVESHOWN 13
+#define CB_QUOTEALL 14
diff --git a/sc/source/ui/dbgui/imoptdlg.src b/sc/source/ui/dbgui/imoptdlg.src
index e83f3a9c9dac..905308e9fecb 100644
--- a/sc/source/ui/dbgui/imoptdlg.src
+++ b/sc/source/ui/dbgui/imoptdlg.src
@@ -96,7 +96,7 @@ ModalDialog RID_SCDLG_IMPORTOPT
CheckBox CB_FIXEDWIDTH
{
HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FIXEDWIDTH";
- Pos = MAP_APPFONT( 12, 80 );
+ Pos = MAP_APPFONT( 12, 92 );
Size = MAP_APPFONT( 172, 10 );
Hide = TRUE;
Text [ en-US ] = "Fixed column ~width";
@@ -104,12 +104,20 @@ ModalDialog RID_SCDLG_IMPORTOPT
CheckBox CB_SAVESHOWN
{
HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_SAVESHOWN";
- Pos = MAP_APPFONT( 12, 66 );
+ Pos = MAP_APPFONT( 12, 78 );
Size = MAP_APPFONT( 172, 10 );
TabStop = TRUE;
Hide = TRUE;
Text [ en-US ] = "Save cell content as ~shown";
};
+ CheckBox CB_QUOTEALL
+ {
+ HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_QUOTEALL";
+ Pos = MAP_APPFONT( 20, 64 );
+ Size = MAP_APPFONT( 164, 10 );
+ Hide = TRUE;
+ Text [ en-US ] = "~Quote all text cells";
+ };
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 202 , 6 ) ;
diff --git a/sc/source/ui/dbgui/pivot.hrc b/sc/source/ui/dbgui/pivot.hrc
index 1a97d4c75b52..fd14c0f98a6b 100644
--- a/sc/source/ui/dbgui/pivot.hrc
+++ b/sc/source/ui/dbgui/pivot.hrc
@@ -34,13 +34,16 @@
#define BTN_OPTIONS 6
#define FL_LAYOUT 10
+#define FL_SELECT 90
+#define SCROLL_COL 91
#define WND_COL 11
+#define SCROLL_ROW 92
#define WND_ROW 12
+#define SCROLL_DATA 93
#define WND_DATA 13
#define WND_SELECT 14
-#define WND_FIELD 15
-#define WND_FIELD_SPACE 16
#define WND_HSCROLL 17
+#define SCROLL_PAGE 98
#define WND_PAGE 18
#define FT_COL 31
#define FT_ROW 32
diff --git a/sc/source/ui/dbgui/pivot.src b/sc/source/ui/dbgui/pivot.src
index 763f03fe82bf..52b1a9d584cd 100644
--- a/sc/source/ui/dbgui/pivot.src
+++ b/sc/source/ui/dbgui/pivot.src
@@ -31,12 +31,12 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
OutputSize = TRUE ;
HelpId = CMD_SID_OPENDLG_PIVOTTABLE ;
- Size = MAP_APPFONT ( 336 , 190 ) ;
+ Size = MAP_APPFONT ( 348 , 186 ) ;
Hide = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
Closeable = FALSE ;
- Text [ en-US ] = "DataPilot" ;
+ Text [ en-US ] = "Pivot Table" ;
FixedText FT_PAGE
{
@@ -44,10 +44,17 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
Size = MAP_APPFONT ( 37 , 8 ) ;
Text[ en-US ] = "Page Fields" ;
};
+ ScrollBar SCROLL_PAGE
+ {
+ Pos = MAP_APPFONT ( 198 , 14 ) ;
+ Size = MAP_APPFONT ( 8 , 24 ) ;
+ HScroll = FALSE ;
+ TabStop = FALSE ;
+ };
Control WND_PAGE
{
- Pos = MAP_APPFONT ( 6 , 14 ) ;
- Size = MAP_APPFONT ( 182 , 24 ) ;
+ Pos = MAP_APPFONT ( 18 , 14 ) ;
+ Size = MAP_APPFONT ( 180 , 24 ) ;
TabStop = TRUE ;
};
FixedText FT_COL
@@ -56,9 +63,16 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
Size = MAP_APPFONT ( 37 , 8 ) ;
Text [ en-US ] = "Column Fields" ;
};
+ ScrollBar SCROLL_COL
+ {
+ Pos = MAP_APPFONT ( 198 , 42 ) ;
+ Size = MAP_APPFONT ( 8 , 24 ) ;
+ HScroll = FALSE ;
+ TabStop = FALSE ;
+ };
Control WND_COL
{
- Pos = MAP_APPFONT ( 44 , 40 ) ;
+ Pos = MAP_APPFONT ( 54 , 42 ) ;
Size = MAP_APPFONT ( 144 , 24 ) ;
TabStop = TRUE ;
};
@@ -68,9 +82,16 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
Size = MAP_APPFONT ( 37 , 8 ) ;
Text [ en-US ] = "Row\nFields" ;
};
+ ScrollBar SCROLL_ROW
+ {
+ Pos = MAP_APPFONT ( 42 , 70 ) ;
+ Size = MAP_APPFONT ( 8 , 96 ) ;
+ HScroll = FALSE ;
+ TabStop = FALSE ;
+ };
Control WND_ROW
{
- Pos = MAP_APPFONT ( 6 , 66 ) ;
+ Pos = MAP_APPFONT ( 6 , 70 ) ;
Size = MAP_APPFONT ( 36 , 96 ) ;
TabStop = TRUE ;
};
@@ -80,16 +101,23 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
Size = MAP_APPFONT ( 37 , 8 ) ;
Text [ en-US ] = "Data Fields" ;
};
+ ScrollBar SCROLL_DATA
+ {
+ Pos = MAP_APPFONT ( 198 , 70 ) ;
+ Size = MAP_APPFONT ( 8 , 96 ) ;
+ HScroll = FALSE ;
+ TabStop = FALSE ;
+ };
Control WND_DATA
{
- Pos = MAP_APPFONT ( 44 , 66 ) ;
+ Pos = MAP_APPFONT ( 54 , 70 ) ;
Size = MAP_APPFONT ( 144 , 96 ) ;
TabStop = TRUE ;
};
Control WND_SELECT
{
- Pos = MAP_APPFONT ( 194 , 14 ) ;
- Size = MAP_APPFONT ( 70 , 126 ) ;
+ Pos = MAP_APPFONT ( 212 , 14 ) ;
+ Size = MAP_APPFONT ( 74 , 138 ) ;
TabStop = TRUE ;
};
String STR_SELECT
@@ -98,47 +126,53 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
};
ScrollBar WND_HSCROLL
{
- Pos = MAP_APPFONT ( 194 , 144 ) ;
- Size = MAP_APPFONT ( 70 , 8 ) ;
+ Pos = MAP_APPFONT ( 212 , 154 ) ;
+ Size = MAP_APPFONT ( 74 , 8 ) ;
HScroll = TRUE ;
TabStop = FALSE ;
};
FixedText FT_INFO
{
- Pos = MAP_APPFONT ( 6 , 168 ) ;
- Size = MAP_APPFONT ( 182 , 16 ) ;
+ Pos = MAP_APPFONT ( 6 , 172 ) ;
+ Size = MAP_APPFONT ( 280 , 8 ) ;
WordBreak = TRUE ;
Text [ en-US ] = "Drag the fields from the right into the desired position." ;
};
FixedLine FL_LAYOUT
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 268 , 8 ) ;
+ Size = MAP_APPFONT ( 200 , 8 ) ;
Text [ en-US ] = "Layout";
};
+ FixedLine FL_SELECT
+ {
+ Pos = MAP_APPFONT ( 212 , 3 ) ;
+ Size = MAP_APPFONT ( 74 , 8 ) ;
+ Text [ en-US ] = "Fields";
+ };
OKButton BTN_OK
{
- Pos = MAP_APPFONT ( 280 , 6 ) ;
+ Pos = MAP_APPFONT ( 292 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
- Pos = MAP_APPFONT ( 280 , 23 ) ;
+ Pos = MAP_APPFONT ( 292 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton BTN_HELP
{
- Pos = MAP_APPFONT ( 280 , 43 ) ;
+ Pos = MAP_APPFONT ( 292 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
PushButton BTN_REMOVE
{
HelpID = "sc:PushButton:RID_SCDLG_PIVOT_LAYOUT:BTN_REMOVE";
- Pos = MAP_APPFONT ( 280 , 63 ) ;
+ Pos = MAP_APPFONT ( 292 , 63 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Remove";
@@ -146,7 +180,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
PushButton BTN_OPTIONS
{
HelpID = "sc:PushButton:RID_SCDLG_PIVOT_LAYOUT:BTN_OPTIONS";
- Pos = MAP_APPFONT ( 280 , 80 ) ;
+ Pos = MAP_APPFONT ( 292 , 80 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Options...";
@@ -154,34 +188,23 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
MoreButton BTN_MORE
{
HelpID = "sc:MoreButton:RID_SCDLG_PIVOT_LAYOUT:BTN_MORE";
- Pos = MAP_APPFONT ( 280 , 170 ) ;
+ Pos = MAP_APPFONT ( 292 , 166 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
MapUnit = MAP_APPFONT ;
Delta = 90 ;
};
- Window WND_FIELD
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 36 , 12 ) ;
- };
- Window WND_FIELD_SPACE
- {
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 2 , 2 ) ;
- };
FixedLine FL_OUTPUT
{
- Pos = MAP_APPFONT ( 6 , 190 ) ;
- Size = MAP_APPFONT ( 268 , 8 ) ;
+ Pos = MAP_APPFONT ( 6 , 186 ) ;
+ Size = MAP_APPFONT ( 280 , 8 ) ;
Text [ en-US ] = "Result" ;
Hide = TRUE ;
};
FixedText FT_INAREA
{
- Pos = MAP_APPFONT ( 12 , 203 ) ;
+ Pos = MAP_APPFONT ( 12 , 199 ) ;
Size = MAP_APPFONT ( 59 , 8 ) ;
Hide = TRUE ;
Text [ en-US ] = "Selection from" ;
@@ -190,15 +213,15 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_INAREA";
Border = TRUE ;
- Pos = MAP_APPFONT ( 73 , 201 ) ;
- Size = MAP_APPFONT ( 100 , 12 ) ;
+ Pos = MAP_APPFONT ( 73 , 197 ) ;
+ Size = MAP_APPFONT ( 109 , 12 ) ;
TabStop = TRUE ;
Hide = TRUE ;
};
ImageButton RB_INAREA
{
HelpID = "sc:ImageButton:RID_SCDLG_PIVOT_LAYOUT:RB_INAREA";
- Pos = MAP_APPFONT ( 177 , 200 ) ;
+ Pos = MAP_APPFONT ( 186 , 196 ) ;
Size = MAP_APPFONT ( 13 , 15 ) ;
TabStop = TRUE ;
Hide = TRUE ;
@@ -207,7 +230,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
FixedText FT_OUTAREA
{
- Pos = MAP_APPFONT ( 12 , 221 ) ;
+ Pos = MAP_APPFONT ( 12 , 217 ) ;
Size = MAP_APPFONT ( 59 , 8 ) ;
Hide = TRUE ;
Text [ en-US ] = "Results to" ;
@@ -216,7 +239,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
HelpID = "sc:ListBox:RID_SCDLG_PIVOT_LAYOUT:LB_OUTAREA";
Border = TRUE ;
- Pos = MAP_APPFONT ( 73 , 219 ) ;
+ Pos = MAP_APPFONT ( 73 , 215 ) ;
Size = MAP_APPFONT ( 75 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
@@ -226,15 +249,15 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
{
HelpID = "sc:Edit:RID_SCDLG_PIVOT_LAYOUT:ED_OUTAREA";
Border = TRUE ;
- Pos = MAP_APPFONT ( 152 , 219 ) ;
- Size = MAP_APPFONT ( 100 , 12 ) ;
+ Pos = MAP_APPFONT ( 152 , 215 ) ;
+ Size = MAP_APPFONT ( 109 , 12 ) ;
TabStop = TRUE ;
Hide = TRUE ;
};
ImageButton RB_OUTAREA
{
HelpID = "sc:ImageButton:RID_SCDLG_PIVOT_LAYOUT:RB_OUTAREA";
- Pos = MAP_APPFONT ( 256 , 218 ) ;
+ Pos = MAP_APPFONT ( 265 , 214 ) ;
Size = MAP_APPFONT ( 13 , 15 ) ;
TabStop = TRUE ;
Hide = TRUE ;
@@ -243,8 +266,8 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
CheckBox BTN_IGNEMPTYROWS
{
HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_IGNEMPTYROWS";
- Pos = MAP_APPFONT ( 12 , 237 ) ;
- Size = MAP_APPFONT ( 124 , 10 ) ;
+ Pos = MAP_APPFONT ( 12 , 233 ) ;
+ Size = MAP_APPFONT ( 136 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Ignore ~empty rows" ;
@@ -252,8 +275,8 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
CheckBox BTN_DETECTCAT
{
HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_DETECTCAT";
- Pos = MAP_APPFONT ( 142 , 237 ) ;
- Size = MAP_APPFONT ( 124 , 10 ) ;
+ Pos = MAP_APPFONT ( 152 , 233 ) ;
+ Size = MAP_APPFONT ( 128 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "~Identify categories" ;
@@ -261,8 +284,8 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
CheckBox BTN_TOTALCOL
{
HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_TOTALCOL";
- Pos = MAP_APPFONT ( 12 , 251 ) ;
- Size = MAP_APPFONT ( 124 , 10 ) ;
+ Pos = MAP_APPFONT ( 12 , 247 ) ;
+ Size = MAP_APPFONT ( 136 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Total columns" ;
@@ -270,8 +293,8 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
CheckBox BTN_TOTALROW
{
HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_TOTALROW";
- Pos = MAP_APPFONT ( 142 , 251 ) ;
- Size = MAP_APPFONT ( 124 , 10 ) ;
+ Pos = MAP_APPFONT ( 152 , 247 ) ;
+ Size = MAP_APPFONT ( 128 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "~Total rows" ;
@@ -279,8 +302,8 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
CheckBox BTN_FILTER
{
HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_FILTER";
- Pos = MAP_APPFONT ( 12 , 265 ) ;
- Size = MAP_APPFONT ( 124 , 10 ) ;
+ Pos = MAP_APPFONT ( 12 , 261 ) ;
+ Size = MAP_APPFONT ( 136 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "~Add filter" ;
@@ -288,8 +311,8 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
CheckBox BTN_DRILLDOWN
{
HelpID = "sc:CheckBox:RID_SCDLG_PIVOT_LAYOUT:BTN_DRILLDOWN";
- Pos = MAP_APPFONT ( 142 , 265 ) ;
- Size = MAP_APPFONT ( 124 , 10 ) ;
+ Pos = MAP_APPFONT ( 152 , 261 ) ;
+ Size = MAP_APPFONT ( 128 , 10 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Ena~ble drill to details" ;
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 794e7361338e..5ee9b320a04e 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -209,8 +209,8 @@ void ScDPFunctionListBox::FillFunctionNames()
// ============================================================================
ScDPFunctionDlg::ScDPFunctionDlg(
- Window* pParent, const ScDPLabelDataVec& rLabelVec,
- const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ) :
+ Window* pParent, const ScDPLabelDataVector& rLabelVec,
+ const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) :
ModalDialog ( pParent, ScResId( RID_SCDLG_DPDATAFIELD ) ),
maFlFunc ( this, ScResId( FL_FUNC ) ),
maLbFunc ( this, ScResId( LB_FUNC ) ),
@@ -267,7 +267,7 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const
return aRef;
}
-void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData )
+void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
{
// list box
sal_uInt16 nFuncMask = (rFuncData.mnFuncMask == PIVOT_FUNC_NONE) ? PIVOT_FUNC_SUM : rFuncData.mnFuncMask;
@@ -291,7 +291,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData&
maLbBaseField.SetSelectHdl( LINK( this, ScDPFunctionDlg, SelectHdl ) );
// base field list box
- for( ScDPLabelDataVec::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt )
+ for( ScDPLabelDataVector::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt )
maLbBaseField.InsertEntry(aIt->getDisplayName());
// base item list box
@@ -393,7 +393,7 @@ IMPL_LINK( ScDPFunctionDlg, DblClickHdl, MultiListBox*, EMPTYARG )
// ============================================================================
ScDPSubtotalDlg::ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj,
- const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData,
+ const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData,
const ScDPNameVec& rDataFields, bool bEnableLayout ) :
ModalDialog ( pParent, ScResId( RID_SCDLG_PIVOTSUBT ) ),
maFlSubt ( this, ScResId( FL_FUNC ) ),
@@ -440,7 +440,7 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const
rLabelData.maShowInfo = maLabelData.maShowInfo;
}
-void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData )
+void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
{
// field name
maFtName.SetText(rLabelData.getDisplayName());
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 10134e696571..b43779ffa62b 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -28,19 +28,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
-//----------------------------------------------------------------------------
-
#include "pvlaydlg.hxx"
-#include "dbdocfun.hxx"
-
-#include <sfx2/dispatch.hxx>
-#include <vcl/msgbox.hxx>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
#include <com/sun/star/sheet/DataPilotFieldSortMode.hpp>
+#include <sfx2/dispatch.hxx>
+#include <vcl/mnemonic.hxx>
+#include <vcl/msgbox.hxx>
+
+#include "dbdocfun.hxx"
#include "uiitems.hxx"
#include "rangeutl.hxx"
#include "document.hxx"
@@ -48,8 +45,6 @@
#include "tabvwsh.hxx"
#include "reffact.hxx"
#include "scresid.hxx"
-#include "pvglob.hxx"
-//CHINA001 #include "pvfundlg.hxx"
#include "globstr.hrc"
#include "pivot.hrc"
#include "dpobject.hxx"
@@ -59,221 +54,140 @@
#include "sc.hrc" //CHINA001
#include "scabstdlg.hxx" //CHINA001
-using namespace com::sun::star;
-using ::rtl::OUString;
-using ::std::vector;
-
-//----------------------------------------------------------------------------
-
-#define FSTR(index) aFuncNameArr[index-1]
-#define STD_FORMAT SCA_VALID | SCA_TAB_3D \
- | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE
-long PivotGlobal::nObjHeight = 0; // initialized with resource data
-long PivotGlobal::nObjWidth = 0;
-long PivotGlobal::nSelSpace = 0;
+// ============================================================================
+using namespace ::com::sun::star;
+using ::rtl::OUString;
-//============================================================================
+// ============================================================================
namespace {
-void lcl_FillToPivotField( PivotField& rPivotField, const ScDPFuncData& rFuncData )
-{
- rPivotField.nCol = rFuncData.mnCol;
- rPivotField.nFuncMask = rFuncData.mnFuncMask;
- rPivotField.maFieldRef = rFuncData.maFieldRef;
-}
+const sal_uInt16 STD_FORMAT = sal_uInt16( SCA_VALID | SCA_TAB_3D | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE );
-PointerStyle lclGetPointerForField( ScDPFieldType eType )
+OUString lclGetNameWithoutMnemonic( const FixedText& rFixedText )
{
- switch( eType )
- {
- case TYPE_PAGE: return POINTER_PIVOT_FIELD;
- case TYPE_COL: return POINTER_PIVOT_COL;
- case TYPE_ROW: return POINTER_PIVOT_ROW;
- case TYPE_DATA: return POINTER_PIVOT_FIELD;
- case TYPE_SELECT: return POINTER_PIVOT_FIELD;
- }
- return POINTER_ARROW;
+ return MnemonicGenerator::EraseAllMnemonicChars( rFixedText.GetText() );
}
} // namespace
-//============================================================================
-
-//----------------------------------------------------------------------------
-
-ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
- const ScDPObject& rDPObject )
- : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
- aFlLayout ( this, ScResId( FL_LAYOUT ) ),
- aFtPage ( this, ScResId( FT_PAGE ) ),
- aWndPage ( this, ScResId( WND_PAGE ), TYPE_PAGE, &aFtPage ),
- aFtCol ( this, ScResId( FT_COL ) ),
- aWndCol ( this, ScResId( WND_COL ), TYPE_COL, &aFtCol ),
- aFtRow ( this, ScResId( FT_ROW ) ),
- aWndRow ( this, ScResId( WND_ROW ), TYPE_ROW, &aFtRow ),
- aFtData ( this, ScResId( FT_DATA ) ),
- aWndData ( this, ScResId( WND_DATA ), TYPE_DATA, &aFtData ),
- aWndSelect ( this, ScResId( WND_SELECT ), TYPE_SELECT, String(ScResId(STR_SELECT)) ),
- aSlider ( this, ScResId( WND_HSCROLL ) ),
- aFtInfo ( this, ScResId( FT_INFO ) ),
-
- aFlAreas ( this, ScResId( FL_OUTPUT ) ),
-
- aFtInArea ( this, ScResId( FT_INAREA) ),
- aEdInPos ( this, ScResId( ED_INAREA) ),
- aRbInPos ( this, ScResId( RB_INAREA ), &aEdInPos, this ),
-
- aLbOutPos ( this, ScResId( LB_OUTAREA ) ),
- aFtOutArea ( this, ScResId( FT_OUTAREA ) ),
- aEdOutPos ( this, this, ScResId( ED_OUTAREA ) ),
- aRbOutPos ( this, ScResId( RB_OUTAREA ), &aEdOutPos, this ),
- aBtnIgnEmptyRows( this, ScResId( BTN_IGNEMPTYROWS ) ),
- aBtnDetectCat ( this, ScResId( BTN_DETECTCAT ) ),
- aBtnTotalCol ( this, ScResId( BTN_TOTALCOL ) ),
- aBtnTotalRow ( this, ScResId( BTN_TOTALROW ) ),
- aBtnFilter ( this, ScResId( BTN_FILTER ) ),
- aBtnDrillDown ( this, ScResId( BTN_DRILLDOWN ) ),
-
- aBtnOk ( this, ScResId( BTN_OK ) ),
- aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- aBtnHelp ( this, ScResId( BTN_HELP ) ),
- aBtnRemove ( this, ScResId( BTN_REMOVE ) ),
- aBtnOptions ( this, ScResId( BTN_OPTIONS ) ),
- aBtnMore ( this, ScResId( BTN_MORE ) ),
-
- aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
- aStrNewTable ( ScResId( SCSTR_NEWTABLE ) ),
-
- bIsDrag ( sal_False ),
-
- pEditActive ( NULL ),
-
- eLastActiveType ( TYPE_SELECT ),
- nOffset ( 0 ),
- //
- xDlgDPObject ( new ScDPObject( rDPObject ) ),
- pViewData ( ((ScTabViewShell*)SfxViewShell::Current())->
- GetViewData() ),
- pDoc ( ((ScTabViewShell*)SfxViewShell::Current())->
- GetViewData()->GetDocument() ),
- bRefInputMode ( sal_False )
-{
- xDlgDPObject->SetAlive( sal_True ); // needed to get structure information
- xDlgDPObject->FillOldParam( thePivotData, sal_False );
- xDlgDPObject->FillLabelData( thePivotData );
-
- Init();
- FreeResource();
-}
-
-
-//----------------------------------------------------------------------------
-
-ScDPLayoutDlg::~ScDPLayoutDlg()
-{
- sal_uInt16 nEntries = aLbOutPos.GetEntryCount();
- sal_uInt16 i;
-
- for ( i=2; i<nEntries; i++ )
- delete (String*)aLbOutPos.GetEntryData( i );
-}
-
-
-//----------------------------------------------------------------------------
-
-ScDPFieldWindow& ScDPLayoutDlg::GetFieldWindow( ScDPFieldType eType )
-{
- switch( eType )
- {
- case TYPE_PAGE: return aWndPage;
- case TYPE_ROW: return aWndRow;
- case TYPE_COL: return aWndCol;
- case TYPE_DATA: return aWndData;
- default:
- {
- // added to avoid warnings
- }
- }
- return aWndSelect;
-}
-
-void __EXPORT ScDPLayoutDlg::Init()
-{
- DBG_ASSERT( pViewData && pDoc,
- "Ctor-Initialisierung fehlgeschlagen!" );
-
- aBtnRemove.SetClickHdl( LINK( this, ScDPLayoutDlg, ClickHdl ) );
- aBtnOptions.SetClickHdl( LINK( this, ScDPLayoutDlg, ClickHdl ) );
-
- aFuncNameArr.reserve( FUNC_COUNT );
- for ( sal_uInt16 i = 0; i < FUNC_COUNT; ++i )
- aFuncNameArr.push_back( String( ScResId( i + 1 ) ) );
-
- aBtnMore.AddWindow( &aFlAreas );
- aBtnMore.AddWindow( &aFtInArea );
- aBtnMore.AddWindow( &aEdInPos );
- aBtnMore.AddWindow( &aRbInPos );
- aBtnMore.AddWindow( &aFtOutArea );
- aBtnMore.AddWindow( &aLbOutPos );
- aBtnMore.AddWindow( &aEdOutPos );
- aBtnMore.AddWindow( &aRbOutPos );
- aBtnMore.AddWindow( &aBtnIgnEmptyRows );
- aBtnMore.AddWindow( &aBtnDetectCat );
- aBtnMore.AddWindow( &aBtnTotalCol );
- aBtnMore.AddWindow( &aBtnTotalRow );
- aBtnMore.AddWindow( &aBtnFilter );
- aBtnMore.AddWindow( &aBtnDrillDown );
- aBtnMore.SetClickHdl( LINK( this, ScDPLayoutDlg, MoreClickHdl ) );
-
- {
- Size aFieldSize( Window( this, ScResId( WND_FIELD ) ).GetSizePixel() );
- OHEIGHT = aFieldSize.Height();
- OWIDTH = aFieldSize.Width();
- }
- SSPACE = Window( this, ScResId( WND_FIELD_SPACE ) ).GetSizePixel().Width();
-
- CalcWndSizes();
-
- aSelectArr.resize( MAX_LABELS );
- aPageArr.resize( MAX_PAGEFIELDS );
- aColArr.resize( MAX_FIELDS );
- aRowArr.resize( MAX_FIELDS );
- aDataArr.resize( MAX_FIELDS );
-
- ScRange inRange;
- String inString;
- if (xDlgDPObject->GetSheetDesc())
- {
- aEdInPos.Enable();
- aRbInPos.Enable();
- aOldRange = xDlgDPObject->GetSheetDesc()->aSourceRange;
- aOldRange.Format( inString, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
- aEdInPos.SetText(inString);
+// ============================================================================
+
+ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, const ScDPObject& rDPObject ) :
+
+ ScAnyRefDlg( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
+
+ maFlLayout( this, ScResId( FL_LAYOUT ) ),
+ maScrPage( this, ScResId( SCROLL_PAGE ) ),
+ maFtPage( this, ScResId( FT_PAGE ) ),
+ maWndPage( this, ScResId( WND_PAGE ), maScrPage, &maFtPage, lclGetNameWithoutMnemonic( maFtPage ), PIVOTFIELDTYPE_PAGE, HID_SC_DPLAY_PAGE, POINTER_PIVOT_FIELD, 5, 2, 1, 0 ),
+ maScrCol( this, ScResId( SCROLL_COL ) ),
+ maFtCol( this, ScResId( FT_COL ) ),
+ maWndCol( this, ScResId( WND_COL ), maScrCol, &maFtCol, lclGetNameWithoutMnemonic( maFtCol ), PIVOTFIELDTYPE_COL, HID_SC_DPLAY_COLUMN, POINTER_PIVOT_COL, 4, 2, 1, 0 ),
+ maScrRow( this, ScResId( SCROLL_ROW ) ),
+ maFtRow( this, ScResId( FT_ROW ) ),
+ maWndRow( this, ScResId( WND_ROW ), maScrRow, &maFtRow, lclGetNameWithoutMnemonic( maFtRow ), PIVOTFIELDTYPE_ROW, HID_SC_DPLAY_ROW, POINTER_PIVOT_ROW, 1, 8, 1, 0 ),
+ maScrData( this, ScResId( SCROLL_DATA ) ),
+ maFtData( this, ScResId( FT_DATA ) ),
+ maWndData( this, ScResId( WND_DATA ), maScrData, &maFtData, lclGetNameWithoutMnemonic( maFtData ), PIVOTFIELDTYPE_DATA, HID_SC_DPLAY_DATA, POINTER_PIVOT_FIELD, 1, 8, 4, 0 ),
+ maFlSelect( this, ScResId( FL_SELECT ) ),
+ maScrSelect( this, ScResId( WND_HSCROLL ) ),
+ maWndSelect( this, ScResId( WND_SELECT ), maScrSelect, 0, String( ScResId( STR_SELECT ) ), PIVOTFIELDTYPE_SELECT, HID_SC_DPLAY_SELECT, POINTER_PIVOT_FIELD, 2, 10, 1, 2 ),
+ maFtInfo( this, ScResId( FT_INFO ) ),
+
+ maFlAreas( this, ScResId( FL_OUTPUT ) ),
+ maFtInArea( this, ScResId( FT_INAREA) ),
+ maEdInPos( this, ScResId( ED_INAREA) ),
+ maRbInPos( this, ScResId( RB_INAREA ), &maEdInPos, this ),
+ maLbOutPos( this, ScResId( LB_OUTAREA ) ),
+ maFtOutArea( this, ScResId( FT_OUTAREA ) ),
+ maEdOutPos( this, this, ScResId( ED_OUTAREA ) ),
+ maRbOutPos( this, ScResId( RB_OUTAREA ), &maEdOutPos, this ),
+ maBtnIgnEmptyRows( this, ScResId( BTN_IGNEMPTYROWS ) ),
+ maBtnDetectCat( this, ScResId( BTN_DETECTCAT ) ),
+ maBtnTotalCol( this, ScResId( BTN_TOTALCOL ) ),
+ maBtnTotalRow( this, ScResId( BTN_TOTALROW ) ),
+ maBtnFilter( this, ScResId( BTN_FILTER ) ),
+ maBtnDrillDown( this, ScResId( BTN_DRILLDOWN ) ),
+
+ maBtnOk( this, ScResId( BTN_OK ) ),
+ maBtnCancel( this, ScResId( BTN_CANCEL ) ),
+ maBtnHelp( this, ScResId( BTN_HELP ) ),
+ maBtnRemove( this, ScResId( BTN_REMOVE ) ),
+ maBtnOptions( this, ScResId( BTN_OPTIONS ) ),
+ maBtnMore( this, ScResId( BTN_MORE ) ),
+
+ mxDlgDPObject( new ScDPObject( rDPObject ) ),
+ mpViewData( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData() ),
+ mpDoc( ((ScTabViewShell*)SfxViewShell::Current())->GetViewData()->GetDocument() ),
+ mpFocusWindow( 0 ),
+ mpTrackingWindow( 0 ),
+ mpDropWindow( 0 ),
+ mpActiveEdit( 0 ),
+ mbRefInputMode( false )
+{
+ DBG_ASSERT( mpViewData && mpDoc, "ScPivotLayoutDlg::ScPivotLayoutDlg - missing document or view data" );
+
+ mxDlgDPObject->SetAlive( true ); // needed to get structure information
+ mxDlgDPObject->FillOldParam( maPivotData );
+ mxDlgDPObject->FillLabelData( maPivotData );
+
+ maBtnRemove.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
+ maBtnOptions.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
+
+ // PIVOT_MAXFUNC defined in sc/inc/dpglobal.hxx
+ maFuncNames.reserve( PIVOT_MAXFUNC );
+ for( sal_uInt16 i = 1; i <= PIVOT_MAXFUNC; ++i )
+ maFuncNames.push_back( String( ScResId( i ) ) );
+
+ maBtnMore.AddWindow( &maFlAreas );
+ maBtnMore.AddWindow( &maFtInArea );
+ maBtnMore.AddWindow( &maEdInPos );
+ maBtnMore.AddWindow( &maRbInPos );
+ maBtnMore.AddWindow( &maFtOutArea );
+ maBtnMore.AddWindow( &maLbOutPos );
+ maBtnMore.AddWindow( &maEdOutPos );
+ maBtnMore.AddWindow( &maRbOutPos );
+ maBtnMore.AddWindow( &maBtnIgnEmptyRows );
+ maBtnMore.AddWindow( &maBtnDetectCat );
+ maBtnMore.AddWindow( &maBtnTotalCol );
+ maBtnMore.AddWindow( &maBtnTotalRow );
+ maBtnMore.AddWindow( &maBtnFilter );
+ maBtnMore.AddWindow( &maBtnDrillDown );
+ maBtnMore.SetClickHdl( LINK( this, ScPivotLayoutDlg, MoreClickHdl ) );
+
+ if( mxDlgDPObject->GetSheetDesc() )
+ {
+ maEdInPos.Enable();
+ maRbInPos.Enable();
+ ScRange aRange = mxDlgDPObject->GetSheetDesc()->aSourceRange;
+ String aString;
+ aRange.Format( aString, SCR_ABS_3D, mpDoc, mpDoc->GetAddressConvention() );
+ maEdInPos.SetText( aString );
}
else
{
- /* Data is not reachable, so could be a remote database */
- aEdInPos.Disable();
- aRbInPos.Disable();
+ // data is not reachable, so could be a remote database
+ maEdInPos.Disable();
+ maRbInPos.Disable();
}
- InitFields();
+ // #i29203# align right border of page window with data window
+ long nPagePosX = maWndData.GetPosPixel().X() + maWndData.GetSizePixel().Width() - maWndPage.GetSizePixel().Width();
+ maWndPage.SetPosPixel( Point( nPagePosX, maWndPage.GetPosPixel().Y() ) );
+ maScrPage.SetPosPixel( Point( maScrData.GetPosPixel().X(), maScrPage.GetPosPixel().Y() ) );
+
+ InitFieldWindows();
- aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) );
- aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) );
- aEdInPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdInModifyHdl ) );
- aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) );
- aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) );
- Link aLink = LINK( this, ScDPLayoutDlg, GetFocusHdl );
- if ( aEdInPos.IsEnabled() )
- // Once disabled it will never get enabled, so no need to handle focus.
- aEdInPos.SetGetFocusHdl( aLink );
- aEdOutPos.SetGetFocusHdl( aLink );
+ maLbOutPos.SetSelectHdl( LINK( this, ScPivotLayoutDlg, SelAreaHdl ) );
+ maEdOutPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdOutModifyHdl ) );
+ maEdInPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdInModifyHdl ) );
+ maBtnOk.SetClickHdl( LINK( this, ScPivotLayoutDlg, OkHdl ) );
+ maBtnCancel.SetClickHdl( LINK( this, ScPivotLayoutDlg, CancelHdl ) );
- if ( pViewData && pDoc )
+ if( mpViewData && mpDoc )
{
/*
* Aus den RangeNames des Dokumentes werden nun die
@@ -281,11 +195,11 @@ void __EXPORT ScDPLayoutDlg::Init()
* um sinnvolle Bereiche handelt
*/
- aLbOutPos.Clear();
- aLbOutPos.InsertEntry( aStrUndefined, 0 );
- aLbOutPos.InsertEntry( aStrNewTable, 1 );
+ maLbOutPos.Clear();
+ maLbOutPos.InsertEntry( String( ScResId( SCSTR_UNDEFINED ) ), 0 );
+ maLbOutPos.InsertEntry( String( ScResId( SCSTR_NEWTABLE ) ), 1 );
- ScAreaNameIterator aIter( pDoc );
+ ScAreaNameIterator aIter( mpDoc );
String aName;
ScRange aRange;
String aRefStr;
@@ -293,1531 +207,742 @@ void __EXPORT ScDPLayoutDlg::Init()
{
if ( !aIter.WasDBName() ) // hier keine DB-Bereiche !
{
- sal_uInt16 nInsert = aLbOutPos.InsertEntry( aName );
+ sal_uInt16 nInsert = maLbOutPos.InsertEntry( aName );
- aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, pDoc->GetAddressConvention() );
- aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) );
+ aRange.aStart.Format( aRefStr, SCA_ABS_3D, mpDoc, mpDoc->GetAddressConvention() );
+ maLbOutPos.SetEntryData( nInsert, new String( aRefStr ) );
}
}
}
- if ( thePivotData.nTab != MAXTAB+1 )
+ if ( maPivotData.nTab != MAXTAB+1 )
{
String aStr;
- ScAddress( thePivotData.nCol,
- thePivotData.nRow,
- thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() );
- aEdOutPos.SetText( aStr );
- EdModifyHdl(0);
+ ScAddress( maPivotData.nCol,
+ maPivotData.nRow,
+ maPivotData.nTab ).Format( aStr, STD_FORMAT, mpDoc, mpDoc->GetAddressConvention() );
+ maEdOutPos.SetText( aStr );
+ EdOutModifyHdl( 0 );
}
else
{
- aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 );
+ maLbOutPos.SelectEntryPos( maLbOutPos.GetEntryCount()-1 );
SelAreaHdl(NULL);
}
- aBtnIgnEmptyRows.Check( thePivotData.bIgnoreEmptyRows );
- aBtnDetectCat .Check( thePivotData.bDetectCategories );
- aBtnTotalCol .Check( thePivotData.bMakeTotalCol );
- aBtnTotalRow .Check( thePivotData.bMakeTotalRow );
-
- if( const ScDPSaveData* pSaveData = xDlgDPObject->GetSaveData() )
- {
- aBtnFilter.Check( pSaveData->GetFilterButton() );
- aBtnDrillDown.Check( pSaveData->GetDrillDown() );
- }
- else
- {
- aBtnFilter.Check();
- aBtnDrillDown.Check();
- }
-
- aWndPage.SetHelpId( HID_SC_DPLAY_PAGE );
- aWndCol.SetHelpId( HID_SC_DPLAY_COLUMN );
- aWndRow.SetHelpId( HID_SC_DPLAY_ROW );
- aWndData.SetHelpId( HID_SC_DPLAY_DATA );
- aWndSelect.SetHelpId( HID_SC_DPLAY_SELECT );
-
- InitFocus();
+ maBtnIgnEmptyRows.Check( maPivotData.bIgnoreEmptyRows );
+ maBtnDetectCat.Check( maPivotData.bDetectCategories );
+ maBtnTotalCol.Check( maPivotData.bMakeTotalCol );
+ maBtnTotalRow.Check( maPivotData.bMakeTotalRow );
-// SetDispatcherLock( sal_True ); // Modal-Modus einschalten
-
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg
-}
+ const ScDPSaveData* pSaveData = mxDlgDPObject->GetSaveData();
+ maBtnFilter.Check( !pSaveData || pSaveData->GetFilterButton() );
+ maBtnDrillDown.Check( !pSaveData || pSaveData->GetDrillDown() );
+ // child event listener handles field movement when keyboard shortcut is pressed
+ AddChildEventListener( LINK( this, ScPivotLayoutDlg, ChildEventListener ) );
+ GrabFieldFocus( maWndSelect );
-//----------------------------------------------------------------------------
-
-sal_Bool __EXPORT ScDPLayoutDlg::Close()
-{
- return DoClose( ScPivotLayoutWrapper::GetChildWindowId() );
+ FreeResource();
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::StateChanged( StateChangedType nStateChange )
+ScPivotLayoutDlg::~ScPivotLayoutDlg()
{
- ScAnyRefDlg::StateChanged( nStateChange );
+ RemoveChildEventListener( LINK( this, ScPivotLayoutDlg, ChildEventListener ) );
- if ( nStateChange == STATE_CHANGE_INITSHOW )
- {
- // #124828# Hiding the FixedTexts and clearing the tab stop style bits
- // has to be done after assigning the mnemonics, but Paint is too late,
- // because the test tool may send key events to the dialog when it isn't visible.
- // Mnemonics are assigned in the Dialog::StateChanged for STATE_CHANGE_INITSHOW,
- // so this can be done immediately afterwards.
-
- aWndPage.UseMnemonic();
- aWndCol.UseMnemonic();
- aWndRow.UseMnemonic();
- aWndData.UseMnemonic();
- }
+ for( sal_uInt16 i = 2, nEntries = maLbOutPos.GetEntryCount(); i < nEntries; ++i )
+ delete (String*)maLbOutPos.GetEntryData( i );
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::InitWndSelect( const vector<ScDPLabelDataRef>& rLabels )
+ScDPLabelData* ScPivotLayoutDlg::GetLabelData( SCCOL nCol, size_t* pnIndex )
{
- size_t nLabelCount = rLabels.size();
- if (nLabelCount > MAX_LABELS)
- nLabelCount = MAX_LABELS;
- size_t nLast = (nLabelCount > PAGE_SIZE) ? (PAGE_SIZE - 1) : (nLabelCount - 1);
-
- aLabelDataArr.clear();
- aLabelDataArr.reserve( nLabelCount );
- for ( size_t i=0; i < nLabelCount; i++ )
+ ScDPLabelData* pLabelData = 0;
+ for( ScDPLabelDataVector::iterator aIt = maLabelData.begin(), aEnd = maLabelData.end(); !pLabelData && (aIt != aEnd); ++aIt )
{
- aLabelDataArr.push_back(*rLabels[i]);
-
- if ( i <= nLast )
+ if( aIt->mnCol == nCol )
{
- aWndSelect.AddField(aLabelDataArr[i].getDisplayName(), i);
- aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) );
+ pLabelData = &*aIt;
+ if( pnIndex )
+ *pnIndex = aIt - maLabelData.begin();
}
}
+ return pLabelData;
}
-
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::InitWnd( PivotField* pArr, long nCount, ScDPFieldType eType )
+String ScPivotLayoutDlg::GetFuncString( sal_uInt16& rnFuncMask, bool bIsValue )
{
- if ( pArr && (eType != TYPE_SELECT) )
- {
- ScDPFuncDataVec* pInitArr = NULL;
- ScDPFieldWindow* pInitWnd = NULL;
- sal_Bool bDataArr = sal_False;
+ String aStr;
- switch ( eType )
+ if( (rnFuncMask == PIVOT_FUNC_NONE) || (rnFuncMask == PIVOT_FUNC_AUTO) )
+ {
+ if( bIsValue )
{
- case TYPE_PAGE:
- pInitArr = &aPageArr;
- pInitWnd = &aWndPage;
- break;
-
- case TYPE_COL:
- pInitArr = &aColArr;
- pInitWnd = &aWndCol;
- break;
-
- case TYPE_ROW:
- pInitArr = &aRowArr;
- pInitWnd = &aWndRow;
- break;
-
- case TYPE_DATA:
- pInitArr = &aDataArr;
- pInitWnd = &aWndData;
- bDataArr = sal_True;
- break;
- default:
- break;
+ aStr = GetFuncName( PIVOTSTR_SUM );
+ rnFuncMask = PIVOT_FUNC_SUM;
}
-
- if ( pInitArr && pInitWnd )
+ else
{
- long j=0;
- for ( long i=0; (i<nCount); i++ )
- {
- SCCOL nCol = pArr[i].nCol;
- sal_uInt16 nMask = pArr[i].nFuncMask;
-
- if ( nCol != PIVOT_DATA_FIELD )
- {
- (*pInitArr)[j].reset( new ScDPFuncData( nCol, nMask, pArr[i].maFieldRef ) );
-
- if ( !bDataArr )
- {
- pInitWnd->AddField( GetLabelString( nCol ), j );
- }
- else
- {
- ScDPLabelData* pData = GetLabelData( nCol );
- DBG_ASSERT( pData, "ScDPLabelData not found" );
- if (pData)
- {
- String aStr( GetFuncString( (*pInitArr)[j]->mnFuncMask,
- pData->mbIsValue ) );
-
- aStr += GetLabelString( nCol );
- pInitWnd->AddField( aStr, j );
-
- pData->mnFuncMask = nMask;
- }
- }
- ++j;
- }
- }
-// Do not redraw here -> first the FixedText has to get its mnemonic char
-// pInitWnd->Redraw();
- }
+ aStr = GetFuncName( PIVOTSTR_COUNT );
+ rnFuncMask = PIVOT_FUNC_COUNT;
+ }
+ }
+ else if( rnFuncMask == PIVOT_FUNC_SUM ) aStr = GetFuncName( PIVOTSTR_SUM );
+ else if( rnFuncMask == PIVOT_FUNC_COUNT ) aStr = GetFuncName( PIVOTSTR_COUNT );
+ else if( rnFuncMask == PIVOT_FUNC_AVERAGE ) aStr = GetFuncName( PIVOTSTR_AVG );
+ else if( rnFuncMask == PIVOT_FUNC_MAX ) aStr = GetFuncName( PIVOTSTR_MAX );
+ else if( rnFuncMask == PIVOT_FUNC_MIN ) aStr = GetFuncName( PIVOTSTR_MIN );
+ else if( rnFuncMask == PIVOT_FUNC_PRODUCT ) aStr = GetFuncName( PIVOTSTR_PROD );
+ else if( rnFuncMask == PIVOT_FUNC_COUNT_NUM ) aStr = GetFuncName( PIVOTSTR_COUNT2 );
+ else if( rnFuncMask == PIVOT_FUNC_STD_DEV ) aStr = GetFuncName( PIVOTSTR_DEV );
+ else if( rnFuncMask == PIVOT_FUNC_STD_DEVP ) aStr = GetFuncName( PIVOTSTR_DEV2 );
+ else if( rnFuncMask == PIVOT_FUNC_STD_VAR ) aStr = GetFuncName( PIVOTSTR_VAR );
+ else if( rnFuncMask == PIVOT_FUNC_STD_VARP ) aStr = GetFuncName( PIVOTSTR_VAR2 );
+ else
+ {
+ aStr = ScGlobal::GetRscString( STR_TABLE_ERGEBNIS );
+ aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ) );
}
-}
+ return aStr;
+}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::InitFocus()
+void ScPivotLayoutDlg::NotifyStartTracking( ScPivotFieldWindow& rSourceWindow )
{
- if( aWndSelect.IsEmpty() )
- {
- aBtnOk.GrabFocus();
- NotifyFieldFocus( TYPE_SELECT, sal_False );
- }
- else
- aWndSelect.GrabFocus();
+ mpTrackingWindow = &rSourceWindow;
+ mpDropWindow = 0;
+ rSourceWindow.NotifyStartTracking();
+ StartTracking( STARTTRACK_BUTTONREPEAT );
+ SetPointer( Pointer( rSourceWindow.GetDropPointerStyle() ) );
}
-void ScDPLayoutDlg::InitFields()
+void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldWindow& rSourceWindow )
{
- InitWndSelect(thePivotData.maLabelArray);
- InitWnd( thePivotData.aPageArr, static_cast<long>(thePivotData.nPageCount), TYPE_PAGE );
- InitWnd( thePivotData.aColArr, static_cast<long>(thePivotData.nColCount), TYPE_COL );
- InitWnd( thePivotData.aRowArr, static_cast<long>(thePivotData.nRowCount), TYPE_ROW );
- InitWnd( thePivotData.aDataArr, static_cast<long>(thePivotData.nDataCount), TYPE_DATA );
-
- size_t nLabels = thePivotData.maLabelArray.size();
- aSlider.SetPageSize( PAGE_SIZE );
- aSlider.SetVisibleSize( PAGE_SIZE );
- aSlider.SetLineSize( LINE_SIZE );
- aSlider.SetRange( Range( 0, static_cast<long>(((nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) );
-
- if ( nLabels > PAGE_SIZE )
- {
- aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) );
- aSlider.Show();
- }
- else
- aSlider.Hide();
-}
+ // nothing to do on double-click in selection window
+ if( rSourceWindow.GetType() == PIVOTFIELDTYPE_SELECT )
+ return;
-//----------------------------------------------------------------------------
+ const ScPivotFuncData* pFuncData = rSourceWindow.GetSelectedFuncData();
+ DBG_ASSERT( pFuncData, "ScPivotLayoutDlg::NotifyDoubleClick - invalid selection" );
+ if( !pFuncData )
+ return;
-void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos )
-{
- ScDPFuncData fData( *(aSelectArr[nFromIndex]) );
- size_t nAt = 0;
- ScDPFieldWindow* toWnd = NULL;
- ScDPFieldWindow* rmWnd1 = NULL;
- ScDPFieldWindow* rmWnd2 = NULL;
- ScDPFuncDataVec* toArr = NULL;
- ScDPFuncDataVec* rmArr1 = NULL;
- ScDPFuncDataVec* rmArr2 = NULL;
- sal_Bool bDataArr = sal_False;
-
- switch ( eToType )
+ ScDPLabelData* pLabelData = GetLabelData( pFuncData->mnCol );
+ DBG_ASSERT( pLabelData, "ScPivotLayoutDlg::NotifyDoubleClick - missing label data" );
+ if( !pLabelData )
+ return;
+
+ ScAbstractDialogFactory* pFactory = ScAbstractDialogFactory::Create();
+ DBG_ASSERT( pFactory, "ScPivotLayoutDlg::NotifyDoubleClick - ScAbstractDialogFactory creation failed" );
+ if( !pFactory )
+ return;
+
+ if( rSourceWindow.GetType() == PIVOTFIELDTYPE_DATA )
{
- case TYPE_PAGE:
- toWnd = &aWndPage;
- rmWnd1 = &aWndRow;
- rmWnd2 = &aWndCol;
- toArr = &aPageArr;
- rmArr1 = &aRowArr;
- rmArr2 = &aColArr;
- break;
-
- case TYPE_COL:
- toWnd = &aWndCol;
- rmWnd1 = &aWndPage;
- rmWnd2 = &aWndRow;
- toArr = &aColArr;
- rmArr1 = &aPageArr;
- rmArr2 = &aRowArr;
- break;
-
- case TYPE_ROW:
- toWnd = &aWndRow;
- rmWnd1 = &aWndPage;
- rmWnd2 = &aWndCol;
- toArr = &aRowArr;
- rmArr1 = &aPageArr;
- rmArr2 = &aColArr;
- break;
-
- case TYPE_DATA:
- toWnd = &aWndData;
- toArr = &aDataArr;
- bDataArr = sal_True;
- break;
-
- default:
+ ::std::auto_ptr< AbstractScDPFunctionDlg > xDlg( pFactory->CreateScDPFunctionDlg(
+ this, RID_SCDLG_DPDATAFIELD, maLabelData, *pLabelData, *pFuncData ) );
+ if( xDlg->Execute() == RET_OK )
{
- // added to avoid warnings
+ ScPivotFuncData aFuncData( *pFuncData );
+ aFuncData.mnFuncMask = pLabelData->mnFuncMask = xDlg->GetFuncMask();
+ aFuncData.maFieldRef = xDlg->GetFieldRef();
+ rSourceWindow.ModifySelectedField( aFuncData );
}
}
-
- bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType );
- if ( bAllowed
- && (toArr->back().get() == NULL)
- && (!Contains( toArr, fData.mnCol, nAt )) )
+ else
{
- // ggF. in anderem Fenster entfernen
- if ( rmArr1 )
- {
- if ( Contains( rmArr1, fData.mnCol, nAt ) )
- {
- rmWnd1->DelField( nAt );
- Remove( rmArr1, nAt );
- }
- }
- if ( rmArr2 )
- {
- if ( Contains( rmArr2, fData.mnCol, nAt ) )
- {
- rmWnd2->DelField( nAt );
- Remove( rmArr2, nAt );
- }
- }
+ // list of plain names of all data fields
+ ScDPNameVec aDataFieldNames;
+ maWndData.WriteFieldNames( aDataFieldNames );
+ // allow to modify layout options for row fields, if multiple data fields exist, or if it is not the last row field
+ bool bLayout = (rSourceWindow.GetType() == PIVOTFIELDTYPE_ROW) && ((aDataFieldNames.size() > 1) || (rSourceWindow.GetSelectedIndex() + 1 < rSourceWindow.GetFieldCount()));
- ScDPLabelData& rData = aLabelDataArr[nFromIndex+nOffset];
- size_t nAddedAt = 0;
-
- if ( !bDataArr )
- {
- if ( toWnd->AddField( rData.getDisplayName(),
- DlgPos2WndPos( rAtPos, *toWnd ),
- nAddedAt ) )
- {
- Insert( toArr, fData, nAddedAt );
- toWnd->GrabFocus();
- }
- }
- else
+ ::std::auto_ptr< AbstractScDPSubtotalDlg > xDlg( pFactory->CreateScDPSubtotalDlg(
+ this, RID_SCDLG_PIVOTSUBT, *mxDlgDPObject, *pLabelData, *pFuncData, aDataFieldNames, bLayout ) );
+ if( xDlg->Execute() == RET_OK )
{
- sal_uInt16 nMask = fData.mnFuncMask;
- OUString aStr = GetFuncString( nMask, rData.mbIsValue );
-
- aStr += rData.getDisplayName();
-
- if ( toWnd->AddField( aStr,
- DlgPos2WndPos( rAtPos, *toWnd ),
- nAddedAt ) )
- {
- fData.mnFuncMask = nMask;
- Insert( toArr, fData, nAddedAt );
- toWnd->GrabFocus();
- }
+ xDlg->FillLabelData( *pLabelData );
+ ScPivotFuncData aFuncData( *pFuncData );
+ aFuncData.mnFuncMask = pLabelData->mnFuncMask;
+ rSourceWindow.ModifySelectedField( aFuncData );
}
-
}
}
+void ScPivotLayoutDlg::NotifyFieldRemoved( ScPivotFieldWindow& rSourceWindow )
+{
+ // update focus: move to selection window, if source window is empty now
+ GrabFieldFocus( rSourceWindow );
+}
-//----------------------------------------------------------------------------
+// protected ------------------------------------------------------------------
-void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos )
+void ScPivotLayoutDlg::Tracking( const TrackingEvent& rTEvt )
{
- if ( eFromType == TYPE_SELECT )
- AddField( nFromIndex, eToType, rAtPos );
- else if ( eFromType != eToType )
- {
- ScDPFieldWindow* fromWnd = NULL;
- ScDPFieldWindow* toWnd = NULL;
- ScDPFieldWindow* rmWnd1 = NULL;
- ScDPFieldWindow* rmWnd2 = NULL;
- ScDPFuncDataVec* fromArr = NULL;
- ScDPFuncDataVec* toArr = NULL;
- ScDPFuncDataVec* rmArr1 = NULL;
- ScDPFuncDataVec* rmArr2 = NULL;
- size_t nAt = 0;
- sal_Bool bDataArr = sal_False;
-
- switch ( eFromType )
- {
- case TYPE_PAGE:
- fromWnd = &aWndPage;
- fromArr = &aPageArr;
- break;
-
- case TYPE_COL:
- fromWnd = &aWndCol;
- fromArr = &aColArr;
- break;
-
- case TYPE_ROW:
- fromWnd = &aWndRow;
- fromArr = &aRowArr;
- break;
-
- case TYPE_DATA:
- fromWnd = &aWndData;
- fromArr = &aDataArr;
- break;
-
- default:
- {
- // added to avoid warnings
- }
- }
+ DBG_ASSERT( mpTrackingWindow, "ScPivotLayoutDlg::Tracking - missing tracking source window" );
+ if( !mpTrackingWindow )
+ return;
- switch ( eToType )
- {
- case TYPE_PAGE:
- toWnd = &aWndPage;
- toArr = &aPageArr;
- rmWnd1 = &aWndCol;
- rmWnd2 = &aWndRow;
- rmArr1 = &aColArr;
- rmArr2 = &aRowArr;
- break;
-
- case TYPE_COL:
- toWnd = &aWndCol;
- toArr = &aColArr;
- rmWnd1 = &aWndPage;
- rmWnd2 = &aWndRow;
- rmArr1 = &aPageArr;
- rmArr2 = &aRowArr;
- break;
-
- case TYPE_ROW:
- toWnd = &aWndRow;
- toArr = &aRowArr;
- rmWnd1 = &aWndPage;
- rmWnd2 = &aWndCol;
- rmArr1 = &aPageArr;
- rmArr2 = &aColArr;
- break;
-
- case TYPE_DATA:
- toWnd = &aWndData;
- toArr = &aDataArr;
- bDataArr = sal_True;
- break;
-
- default:
- {
- // added to avoid warnings
- }
- }
+ // find target window
+ const Point& rDialogPos = rTEvt.GetMouseEvent().GetPosPixel();
+ ScPivotFieldWindow* pTargetWindow = dynamic_cast< ScPivotFieldWindow* >( FindWindow( rDialogPos ) );
- if ( fromArr && toArr && fromWnd && toWnd )
- {
- ScDPFuncData fData( *((*fromArr)[nFromIndex]) );
+ // check if the target orientation is allowed for this field
+ if( pTargetWindow && (mpTrackingWindow != pTargetWindow) && !IsInsertAllowed( *mpTrackingWindow, *pTargetWindow ) )
+ pTargetWindow = 0;
- bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType );
- if ( bAllowed && Contains( fromArr, fData.mnCol, nAt ) )
- {
- fromWnd->DelField( nAt );
- Remove( fromArr, nAt );
+ // tracking from selection window: do not show "delete" mouse pointer
+ PointerStyle eTargetPointer = pTargetWindow ? pTargetWindow->GetDropPointerStyle() :
+ ((mpTrackingWindow->GetType() == PIVOTFIELDTYPE_SELECT) ? POINTER_NOTALLOWED : POINTER_PIVOT_DELETE);
- if ( (toArr->back().get() == NULL)
- && (!Contains( toArr, fData.mnCol, nAt )) )
- {
- size_t nAddedAt = 0;
- if ( !bDataArr )
- {
- // ggF. in anderem Fenster entfernen
- if ( rmArr1 )
- {
- if ( Contains( rmArr1, fData.mnCol, nAt ) )
- {
- rmWnd1->DelField( nAt );
- Remove( rmArr1, nAt );
- }
- }
- if ( rmArr2 )
- {
- if ( Contains( rmArr2, fData.mnCol, nAt ) )
- {
- rmWnd2->DelField( nAt );
- Remove( rmArr2, nAt );
- }
- }
+ // after calculating pointer style, check if target is selection window
+ if( pTargetWindow && (pTargetWindow->GetType() == PIVOTFIELDTYPE_SELECT) )
+ pTargetWindow = 0;
- if ( toWnd->AddField( GetLabelString( fData.mnCol ),
- DlgPos2WndPos( rAtPos, *toWnd ),
- nAddedAt ) )
- {
- Insert( toArr, fData, nAddedAt );
- toWnd->GrabFocus();
- }
- }
- else
- {
- String aStr;
- sal_uInt16 nMask = fData.mnFuncMask;
- aStr = GetFuncString( nMask );
- aStr += GetLabelString( fData.mnCol );
-
- if ( toWnd->AddField( aStr,
- DlgPos2WndPos( rAtPos, *toWnd ),
- nAddedAt ) )
- {
- fData.mnFuncMask = nMask;
- Insert( toArr, fData, nAddedAt );
- toWnd->GrabFocus();
- }
- }
- }
- }
- }
+ // notify windows about tracking
+ if( mpDropWindow != pTargetWindow )
+ {
+ // tracking window changed
+ if( mpDropWindow )
+ mpDropWindow->NotifyEndTracking( ENDTRACKING_SUSPEND );
+ if( pTargetWindow )
+ pTargetWindow->NotifyStartTracking();
+ mpDropWindow = pTargetWindow;
}
- else // -> eFromType == eToType
+ if( mpDropWindow )
+ mpDropWindow->NotifyTracking( rDialogPos - pTargetWindow->GetPosPixel() );
+
+ // end tracking: move or remove field
+ if( rTEvt.IsTrackingEnded() )
{
- ScDPFieldWindow* theWnd = NULL;
- ScDPFuncDataVec* theArr = NULL;
- size_t nAt = 0;
- size_t nToIndex = 0;
- Point aToPos;
- sal_Bool bDataArr = sal_False;
-
- switch ( eFromType )
+ bool bCancelled = rTEvt.IsTrackingCanceled();
+ if( mpDropWindow )
{
- case TYPE_PAGE:
- theWnd = &aWndPage;
- theArr = &aPageArr;
- break;
-
- case TYPE_COL:
- theWnd = &aWndCol;
- theArr = &aColArr;
- break;
-
- case TYPE_ROW:
- theWnd = &aWndRow;
- theArr = &aRowArr;
- break;
-
- case TYPE_DATA:
- theWnd = &aWndData;
- theArr = &aDataArr;
- bDataArr = sal_True;
- break;
-
- default:
+ mpDropWindow->NotifyEndTracking( bCancelled ? ENDTRACKING_CANCEL : ENDTRACKING_DROP );
+ if( !bCancelled )
{
- // added to avoid warnings
+ size_t nInsertIndex = mpDropWindow->GetDropIndex( rDialogPos - mpDropWindow->GetPosPixel() );
+ bool bMoved = MoveField( *mpTrackingWindow, *mpDropWindow, nInsertIndex, true );
+ // focus drop window, if move was successful, otherwise back to source window
+ GrabFieldFocus( bMoved ? *mpDropWindow : *mpTrackingWindow );
}
}
-
- ScDPFuncData fData( *((*theArr)[nFromIndex]) );
-
- if ( Contains( theArr, fData.mnCol, nAt ) )
+ else
{
- aToPos = DlgPos2WndPos( rAtPos, *theWnd );
- theWnd->GetExistingIndex( aToPos, nToIndex );
-
- if ( nToIndex != nAt )
- {
- size_t nAddedAt = 0;
-
- theWnd->DelField( nAt );
- Remove( theArr, nAt );
-
- if ( !bDataArr )
- {
- if ( theWnd->AddField( GetLabelString( fData.mnCol ),
- aToPos,
- nAddedAt ) )
- {
- Insert( theArr, fData, nAddedAt );
- }
- }
- else
- {
- String aStr;
- sal_uInt16 nMask = fData.mnFuncMask;
- aStr = GetFuncString( nMask );
- aStr += GetLabelString( fData.mnCol );
-
- if ( theWnd->AddField( aStr,
- DlgPos2WndPos( rAtPos, *theWnd ),
- nAddedAt ) )
- {
- fData.mnFuncMask = nMask;
- Insert( theArr, fData, nAddedAt );
- }
- }
- }
+ // drop target invalid (outside field windows): remove tracked field
+ if( !bCancelled )
+ mpTrackingWindow->RemoveSelectedField();
+ // focus source window (or another window, if it is empty now)
+ GrabFieldFocus( *mpTrackingWindow );
}
+ eTargetPointer = POINTER_ARROW;
+ if( mpTrackingWindow != mpDropWindow )
+ mpTrackingWindow->NotifyEndTracking( ENDTRACKING_CANCEL );
+ mpTrackingWindow = mpDropWindow = 0;
}
+ SetPointer( eTargetPointer );
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::RemoveField( ScDPFieldType eFromType, size_t nIndex )
+void ScPivotLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
- ScDPFuncDataVec* pArr = NULL;
- switch( eFromType )
+ if( !mbRefInputMode || !mpActiveEdit )
+ return;
+
+ if( rRef.aStart != rRef.aEnd )
+ RefInputStart( mpActiveEdit );
+
+ if( mpActiveEdit == &maEdInPos )
{
- case TYPE_PAGE: pArr = &aPageArr; break;
- case TYPE_COL: pArr = &aColArr; break;
- case TYPE_ROW: pArr = &aRowArr; break;
- case TYPE_DATA: pArr = &aDataArr; break;
- default:
- {
- // added to avoid warnings
- }
+ String aRefStr;
+ rRef.Format( aRefStr, SCR_ABS_3D, pDocP, pDocP->GetAddressConvention() );
+ mpActiveEdit->SetRefString( aRefStr );
}
-
- if( pArr )
+ else if( mpActiveEdit == &maEdOutPos )
{
- ScDPFieldWindow& rWnd = GetFieldWindow( eFromType );
- rWnd.DelField( nIndex );
- Remove( pArr, nIndex );
- if( rWnd.IsEmpty() ) InitFocus();
+ String aRefStr;
+ rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() );
+ mpActiveEdit->SetRefString( aRefStr );
}
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::NotifyMouseButtonUp( const Point& rAt )
+sal_Bool ScPivotLayoutDlg::IsRefInputMode() const
{
- if ( bIsDrag )
- {
- bIsDrag = sal_False;
-
- ScDPFieldType eDnDToType = TYPE_SELECT;
- Point aPos = ScreenToOutputPixel( rAt );
- sal_Bool bDel = sal_False;
-
- if ( aRectPage.IsInside( aPos ) )
- {
- eDnDToType = TYPE_PAGE;
- bDel = sal_False;
- }
- else if ( aRectCol.IsInside( aPos ) )
- {
- eDnDToType = TYPE_COL;
- bDel = sal_False;
- }
- else if ( aRectRow.IsInside( aPos ) )
- {
- eDnDToType = TYPE_ROW;
- bDel = sal_False;
- }
- else if ( aRectData.IsInside( aPos ) )
- {
- eDnDToType = TYPE_DATA;
- bDel = sal_False;
- }
- else if ( aRectSelect.IsInside( aPos ) )
- {
- eDnDToType = TYPE_SELECT;
- bDel = sal_True;
- }
- else
- bDel = sal_True;
-
- if ( bDel )
- RemoveField( eDnDFromType, nDnDFromIndex );
- else
- MoveField( eDnDFromType, nDnDFromIndex, eDnDToType, aPos );
- }
+ return mbRefInputMode;
}
-
-//----------------------------------------------------------------------------
-
-PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt )
+void ScPivotLayoutDlg::SetActive()
{
- PointerStyle ePtr = POINTER_ARROW;
-
- if ( bIsDrag )
+ if( mbRefInputMode )
{
- Point aPos = ScreenToOutputPixel( rAt );
- ScDPFieldType eCheckTarget = TYPE_SELECT;
-
- if ( aRectPage.IsInside( aPos ) )
- eCheckTarget = TYPE_PAGE;
- else if ( aRectCol.IsInside( aPos ) )
- eCheckTarget = TYPE_COL;
- else if ( aRectRow.IsInside( aPos ) )
- eCheckTarget = TYPE_ROW;
- else if ( aRectData.IsInside( aPos ) )
- eCheckTarget = TYPE_DATA;
- else if ( eDnDFromType != TYPE_SELECT )
- ePtr = POINTER_PIVOT_DELETE;
- else if ( aRectSelect.IsInside( aPos ) )
- ePtr = lclGetPointerForField( TYPE_SELECT );
- else
- ePtr = POINTER_NOTALLOWED;
+ if( mpActiveEdit )
+ mpActiveEdit->GrabFocus();
- if ( eCheckTarget != TYPE_SELECT )
- {
- // check if the target orientation is allowed for this field
- ScDPFuncDataVec* fromArr = NULL;
- switch ( eDnDFromType )
- {
- case TYPE_PAGE: fromArr = &aPageArr; break;
- case TYPE_COL: fromArr = &aColArr; break;
- case TYPE_ROW: fromArr = &aRowArr; break;
- case TYPE_DATA: fromArr = &aDataArr; break;
- case TYPE_SELECT: fromArr = &aSelectArr; break;
- }
- ScDPFuncData fData( *((*fromArr)[nDnDFromIndex]) );
- if (IsOrientationAllowed( fData.mnCol, eCheckTarget ))
- ePtr = lclGetPointerForField( eCheckTarget );
- else
- ePtr = POINTER_NOTALLOWED;
- }
+ if( mpActiveEdit == &maEdInPos )
+ EdInModifyHdl( 0 );
+ else if( mpActiveEdit == &maEdOutPos )
+ EdOutModifyHdl( 0 );
+ }
+ else
+ {
+ GrabFocus();
}
- return ePtr;
+ RefInputDone();
}
-
-//----------------------------------------------------------------------------
-
-PointerStyle ScDPLayoutDlg::NotifyMouseButtonDown( ScDPFieldType eType, size_t nFieldIndex )
+sal_Bool ScPivotLayoutDlg::Close()
{
- bIsDrag = sal_True;
- eDnDFromType = eType;
- nDnDFromIndex = nFieldIndex;
- return lclGetPointerForField( eType );
+ return DoClose( ScPivotLayoutWrapper::GetChildWindowId() );
}
+// private --------------------------------------------------------------------
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::NotifyDoubleClick( ScDPFieldType eType, size_t nFieldIndex )
+ScPivotFieldWindow& ScPivotLayoutDlg::GetFieldWindow( ScPivotFieldType eFieldType )
{
- ScDPFuncDataVec* pArr = NULL;
- switch ( eType )
+ switch( eFieldType )
{
- case TYPE_PAGE: pArr = &aPageArr; break;
- case TYPE_COL: pArr = &aColArr; break;
- case TYPE_ROW: pArr = &aRowArr; break;
- case TYPE_DATA: pArr = &aDataArr; break;
- default:
- {
- // added to avoid warnings
- }
+ case PIVOTFIELDTYPE_PAGE: return maWndPage;
+ case PIVOTFIELDTYPE_ROW: return maWndRow;
+ case PIVOTFIELDTYPE_COL: return maWndCol;
+ case PIVOTFIELDTYPE_DATA: return maWndData;
+ default:;
}
+ return maWndSelect;
+}
- if ( pArr )
+bool ScPivotLayoutDlg::IsInsertAllowed( const ScPivotFieldWindow& rSourceWindow, const ScPivotFieldWindow& rTargetWindow )
+{
+ if( rTargetWindow.GetType() != PIVOTFIELDTYPE_SELECT )
{
- if ( nFieldIndex >= pArr->size() )
+ const ScPivotFuncData* pSourceData = rSourceWindow.GetSelectedFuncData();
+ ScDPLabelData* pLabelData = pSourceData ? GetLabelData( pSourceData->mnCol ) : 0;
+ DBG_ASSERT( pLabelData, "ScPivotLayoutDlg::IsInsertAllowed - label data not found" );
+ if( pLabelData )
{
- DBG_ERROR("invalid selection");
- return;
- }
-
- size_t nArrPos = 0;
- if( ScDPLabelData* pData = GetLabelData( (*pArr)[nFieldIndex]->mnCol, &nArrPos ) )
- {
- ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
-
- switch ( eType )
+ sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN;
+ switch( rTargetWindow.GetType() )
{
- case TYPE_PAGE:
- case TYPE_COL:
- case TYPE_ROW:
- {
- // list of names of all data fields
- std::vector< String > aDataFieldNames;
- for( ScDPFuncDataVec::const_iterator aIt = aDataArr.begin(), aEnd = aDataArr.end();
- (aIt != aEnd) && aIt->get(); ++aIt )
- {
- String aName( GetLabelString( (*aIt)->mnCol ) );
- if( aName.Len() )
- aDataFieldNames.push_back( aName );
- }
-
- bool bLayout = (eType == TYPE_ROW) &&
- ((aDataFieldNames.size() > 1) || ((nFieldIndex + 1 < pArr->size()) && (*pArr)[nFieldIndex+1].get()));
-
- AbstractScDPSubtotalDlg* pDlg = pFact->CreateScDPSubtotalDlg(
- this, RID_SCDLG_PIVOTSUBT,
- *xDlgDPObject, *pData, *(*pArr)[nFieldIndex], aDataFieldNames, bLayout );
-
- if ( pDlg->Execute() == RET_OK )
- {
- pDlg->FillLabelData( *pData );
- (*pArr)[nFieldIndex]->mnFuncMask = pData->mnFuncMask;
- }
- delete pDlg;
- }
- break;
-
- case TYPE_DATA:
- {
- AbstractScDPFunctionDlg* pDlg = pFact->CreateScDPFunctionDlg(
- this, RID_SCDLG_DPDATAFIELD,
- aLabelDataArr, *pData, *(*pArr)[nFieldIndex] );
-
- if ( pDlg->Execute() == RET_OK )
- {
- (*pArr)[nFieldIndex]->mnFuncMask = pData->mnFuncMask = pDlg->GetFuncMask();
- (*pArr)[nFieldIndex]->maFieldRef = pDlg->GetFieldRef();
-
- String aStr( GetFuncString ( aDataArr[nFieldIndex]->mnFuncMask ) );
- aStr += GetLabelString( aDataArr[nFieldIndex]->mnCol );
- aWndData.SetFieldText( aStr, nFieldIndex );
- }
- delete pDlg;
- }
- break;
-
- default:
- {
- // added to avoid warnings
- }
+ case PIVOTFIELDTYPE_PAGE: eOrient = sheet::DataPilotFieldOrientation_PAGE; break;
+ case PIVOTFIELDTYPE_COL: eOrient = sheet::DataPilotFieldOrientation_COLUMN; break;
+ case PIVOTFIELDTYPE_ROW: eOrient = sheet::DataPilotFieldOrientation_ROW; break;
+ case PIVOTFIELDTYPE_DATA: eOrient = sheet::DataPilotFieldOrientation_DATA; break;
+ default: return false;
}
+ return ScDPObject::IsOrientationAllowed( static_cast< sal_uInt16 >( eOrient ), pLabelData->mnFlags );
}
}
+ return false;
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::NotifyFieldFocus( ScDPFieldType eType, sal_Bool bGotFocus )
+void ScPivotLayoutDlg::InitFieldWindows()
{
- /* Enable Remove/Options buttons on GetFocus in field window.
- #107616# Enable them also, if dialog is deactivated (click into document).
- The !IsActive() condition handles the case that a LoseFocus event of a
- field window would follow the Deactivate event of this dialog. */
- sal_Bool bEnable = (bGotFocus || !IsActive()) && (eType != TYPE_SELECT);
-
- // #128113# The TestTool may set the focus into an empty field.
- // Then the Remove/Options buttons must be disabled.
- if ( bEnable && bGotFocus && GetFieldWindow( eType ).IsEmpty() )
- bEnable = sal_False;
-
- aBtnRemove.Enable( bEnable );
- aBtnOptions.Enable( bEnable );
- if( bGotFocus )
- eLastActiveType = eType;
+ maLabelData = maPivotData.maLabelArray;
+ maWndSelect.ReadDataLabels( maLabelData );
+ maWndPage.ReadPivotFields( maPivotData.maPageArr );
+ maWndCol.ReadPivotFields( maPivotData.maColArr );
+ maWndRow.ReadPivotFields( maPivotData.maRowArr );
+ maWndData.ReadPivotFields( maPivotData.maDataArr );
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::NotifyMoveField( ScDPFieldType eToType )
+void ScPivotLayoutDlg::GrabFieldFocus( ScPivotFieldWindow& rFieldWindow )
{
- ScDPFieldWindow& rWnd = GetFieldWindow( eLastActiveType );
- if( (eToType != TYPE_SELECT) && !rWnd.IsEmpty() )
+ if( rFieldWindow.IsEmpty() )
{
- MoveField( eLastActiveType, rWnd.GetSelectedField(), eToType, GetFieldWindow( eToType ).GetLastPosition() );
- if( rWnd.IsEmpty() )
- NotifyFieldFocus( eToType, sal_True );
+ if( maWndSelect.IsEmpty() )
+ maBtnOk.GrabFocus();
else
- rWnd.GrabFocus();
- if( eLastActiveType == TYPE_SELECT )
- aWndSelect.SelectNext();
+ maWndSelect.GrabFocus();
}
else
- InitFocus();
+ rFieldWindow.GrabFocus();
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::NotifyRemoveField( ScDPFieldType eType, size_t nFieldIndex )
-{
- if( eType != TYPE_SELECT )
- RemoveField( eType, nFieldIndex );
-}
-
-//----------------------------------------------------------------------------
+namespace {
-sal_Bool ScDPLayoutDlg::NotifyMoveSlider( sal_uInt16 nKeyCode )
+void lclFindFieldWindow( ScPivotFieldWindow*& rpFieldWindow, const ScPivotFuncData*& rpFuncData, size_t& rnFieldIndex, ScPivotFieldWindow& rFieldWindow )
{
- long nOldPos = aSlider.GetThumbPos();
- switch( nKeyCode )
+ ScPivotFuncDataEntry aEntry = rFieldWindow.FindFuncDataByCol( rpFuncData->mnCol );
+ if( aEntry.first )
{
- case KEY_HOME: aSlider.DoScroll( 0 ); break;
- case KEY_END: aSlider.DoScroll( aSlider.GetRangeMax() ); break;
- case KEY_UP:
- case KEY_LEFT: aSlider.DoScrollAction( SCROLL_LINEUP ); break;
- case KEY_DOWN:
- case KEY_RIGHT: aSlider.DoScrollAction( SCROLL_LINEDOWN ); break;
+ rpFieldWindow = &rFieldWindow;
+ rpFuncData = aEntry.first;
+ rnFieldIndex = aEntry.second;
}
- return nOldPos != aSlider.GetThumbPos();
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::Deactivate()
-{
- /* #107616# If the dialog has been deactivated (click into document), the LoseFocus
- event from field window disables Remove/Options buttons. Re-enable them here by
- simulating a GetFocus event. Event order of LoseFocus and Deactivate is not important.
- The last event will enable the buttons in both cases (see NotifyFieldFocus). */
- NotifyFieldFocus( eLastActiveType, sal_True );
-}
-
-//----------------------------------------------------------------------------
+} // namespace
-sal_Bool ScDPLayoutDlg::Contains( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt )
+bool ScPivotLayoutDlg::MoveField( ScPivotFieldWindow& rSourceWindow, ScPivotFieldWindow& rTargetWindow, size_t nInsertIndex, bool bMoveExisting )
{
- if ( !pArr )
- return sal_False;
-
- sal_Bool bFound = sal_False;
- size_t i = 0;
+ // move inside the same window
+ if( &rSourceWindow == &rTargetWindow )
+ return bMoveExisting && rTargetWindow.MoveSelectedField( nInsertIndex );
- while ( (i<pArr->size()) && ((*pArr)[i].get() != NULL) && !bFound )
+ // do not insert if not supported by target window
+ if( !IsInsertAllowed( rSourceWindow, rTargetWindow ) )
{
- bFound = ((*pArr)[i]->mnCol == nCol);
- if ( bFound )
- nAt = i;
- i++;
+ rSourceWindow.RemoveSelectedField();
+ return false;
}
- return bFound;
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::Remove( ScDPFuncDataVec* pArr, size_t nAt )
-{
- if ( !pArr || (nAt>=pArr->size()) )
- return;
-
- pArr->erase( pArr->begin() + nAt );
- pArr->push_back( ScDPFuncDataRef() );
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::Insert( ScDPFuncDataVec* pArr, const ScDPFuncData& rFData, size_t nAt )
-{
- if ( !pArr || (nAt>=pArr->size()) )
- return;
-
- if ( (*pArr)[nAt].get() == NULL )
- {
- (*pArr)[nAt].reset( new ScDPFuncData( rFData ) );
- }
- else
+ // move from one window to another window
+ if( const ScPivotFuncData* pSourceData = rSourceWindow.GetSelectedFuncData() )
{
- if ( pArr->back().get() == NULL ) // mind. ein Slot frei?
+ // move to page/col/row window: try to find existing field in another window
+ ScPivotFieldWindow* pSourceWindow = &rSourceWindow;
+ size_t nSourceIndex = rSourceWindow.GetSelectedIndex();
+ if( rTargetWindow.GetType() != PIVOTFIELDTYPE_DATA )
{
- pArr->insert( pArr->begin() + nAt, ScDPFuncDataRef( new ScDPFuncData( rFData ) ) );
- pArr->erase( pArr->end() - 1 );
+ lclFindFieldWindow( pSourceWindow, pSourceData, nSourceIndex, maWndPage );
+ lclFindFieldWindow( pSourceWindow, pSourceData, nSourceIndex, maWndCol );
+ lclFindFieldWindow( pSourceWindow, pSourceData, nSourceIndex, maWndRow );
}
- }
-}
+ // found in target window: move to new position
+ if( pSourceWindow == &rTargetWindow )
+ return bMoveExisting && pSourceWindow->MoveField( nSourceIndex, nInsertIndex );
-//----------------------------------------------------------------------------
+ // insert field into target window
+ rTargetWindow.InsertField( nInsertIndex, *pSourceData );
+ // remove field from source window
+ pSourceWindow->RemoveField( nSourceIndex );
+ // remove field from data window, if it is the original source
+ if( (rSourceWindow.GetType() == PIVOTFIELDTYPE_DATA) && (pSourceWindow->GetType() != PIVOTFIELDTYPE_DATA) )
+ rSourceWindow.RemoveSelectedField();
-ScDPLabelData* ScDPLayoutDlg::GetLabelData( SCsCOL nCol, size_t* pnPos )
-{
- ScDPLabelData* pData = 0;
- for( ScDPLabelDataVec::iterator aIt = aLabelDataArr.begin(), aEnd = aLabelDataArr.end(); !pData && (aIt != aEnd); ++aIt )
- {
- if( aIt->mnCol == nCol )
- {
- pData = &*aIt;
- if( pnPos ) *pnPos = aIt - aLabelDataArr.begin();
- }
+ return true;
}
- return pData;
-}
-
-//----------------------------------------------------------------------------
-
-String ScDPLayoutDlg::GetLabelString( SCsCOL nCol )
-{
- ScDPLabelData* pData = GetLabelData( nCol );
- DBG_ASSERT( pData, "LabelData not found" );
- if (pData)
- return pData->getDisplayName();
- return String();
+ return false;
}
-//----------------------------------------------------------------------------
+// handlers -------------------------------------------------------------------
-bool ScDPLayoutDlg::IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType )
+IMPL_LINK( ScPivotLayoutDlg, ClickHdl, PushButton *, pBtn )
{
- bool bAllowed = true;
- ScDPLabelData* pData = GetLabelData( nCol );
- DBG_ASSERT( pData, "LabelData not found" );
- if (pData)
+ if( mpFocusWindow )
{
- sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN;
- switch (eType)
- {
- case TYPE_PAGE: eOrient = sheet::DataPilotFieldOrientation_PAGE; break;
- case TYPE_COL: eOrient = sheet::DataPilotFieldOrientation_COLUMN; break;
- case TYPE_ROW: eOrient = sheet::DataPilotFieldOrientation_ROW; break;
- case TYPE_DATA: eOrient = sheet::DataPilotFieldOrientation_DATA; break;
- case TYPE_SELECT: eOrient = sheet::DataPilotFieldOrientation_HIDDEN; break;
- }
- bAllowed = ScDPObject::IsOrientationAllowed( (sal_uInt16)eOrient, pData->mnFlags );
- }
- return bAllowed;
-}
-
-//----------------------------------------------------------------------------
-
-String ScDPLayoutDlg::GetFuncString( sal_uInt16& rFuncMask, sal_Bool bIsValue )
-{
- String aStr;
+ /* Raising sub dialogs (from the NotifyDoubleClick function) triggers
+ VCL child window focus events from this sub dialog which may
+ invalidate the member mpFocusWindow pointing to the target field
+ window. This would cause a crash with the following call to the
+ GrabFieldFocus function, if mpFocusWindow is used directly. */
+ ScPivotFieldWindow& rTargetWindow = *mpFocusWindow;
- if ( rFuncMask == PIVOT_FUNC_NONE
- || rFuncMask == PIVOT_FUNC_AUTO )
- {
- if ( bIsValue )
+ if( pBtn == &maBtnRemove )
{
- aStr = FSTR(PIVOTSTR_SUM);
- rFuncMask = PIVOT_FUNC_SUM;
+ rTargetWindow.RemoveSelectedField();
+ // focus back to field window
+ GrabFieldFocus( rTargetWindow );
}
- else
+ else if( pBtn == &maBtnOptions )
{
- aStr = FSTR(PIVOTSTR_COUNT);
- rFuncMask = PIVOT_FUNC_COUNT;
+ NotifyDoubleClick( rTargetWindow );
+ // focus back to field window
+ GrabFieldFocus( rTargetWindow );
}
}
- else if ( rFuncMask == PIVOT_FUNC_SUM ) aStr = FSTR(PIVOTSTR_SUM);
- else if ( rFuncMask == PIVOT_FUNC_COUNT ) aStr = FSTR(PIVOTSTR_COUNT);
- else if ( rFuncMask == PIVOT_FUNC_AVERAGE ) aStr = FSTR(PIVOTSTR_AVG);
- else if ( rFuncMask == PIVOT_FUNC_MAX ) aStr = FSTR(PIVOTSTR_MAX);
- else if ( rFuncMask == PIVOT_FUNC_MIN ) aStr = FSTR(PIVOTSTR_MIN);
- else if ( rFuncMask == PIVOT_FUNC_PRODUCT ) aStr = FSTR(PIVOTSTR_PROD);
- else if ( rFuncMask == PIVOT_FUNC_COUNT_NUM ) aStr = FSTR(PIVOTSTR_COUNT2);
- else if ( rFuncMask == PIVOT_FUNC_STD_DEV ) aStr = FSTR(PIVOTSTR_DEV);
- else if ( rFuncMask == PIVOT_FUNC_STD_DEVP ) aStr = FSTR(PIVOTSTR_DEV2);
- else if ( rFuncMask == PIVOT_FUNC_STD_VAR ) aStr = FSTR(PIVOTSTR_VAR);
- else if ( rFuncMask == PIVOT_FUNC_STD_VARP ) aStr = FSTR(PIVOTSTR_VAR2);
- else
- {
- aStr = ScGlobal::GetRscString( STR_TABLE_ERGEBNIS );
- aStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " - " ));
- }
-
- return aStr;
-}
-
-
-//----------------------------------------------------------------------------
-
-Point ScDPLayoutDlg::DlgPos2WndPos( const Point& rPt, Window& rWnd )
-{
- Point aWndPt( rPt );
- aWndPt.X() = rPt.X()-rWnd.GetPosPixel().X();
- aWndPt.Y() = rPt.Y()-rWnd.GetPosPixel().Y();
-
- return aWndPt;
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::CalcWndSizes()
-{
- // row/column/data area sizes
- aWndPage.SetSizePixel( Size( MAX_PAGEFIELDS * OWIDTH / 2, 2 * OHEIGHT ) );
- aWndRow.SetSizePixel( Size( OWIDTH, MAX_FIELDS * OHEIGHT ) );
- aWndCol.SetSizePixel( Size( MAX_FIELDS * OWIDTH / 2, 2 * OHEIGHT ) );
- aWndData.SetSizePixel( Size( MAX_FIELDS * OWIDTH / 2, MAX_FIELDS * OHEIGHT ) );
-
- // #i29203# align right border of page window with data window
- long nDataPosX = aWndData.GetPosPixel().X() + aWndData.GetSizePixel().Width();
- aWndPage.SetPosPixel( Point( nDataPosX - aWndPage.GetSizePixel().Width(), aWndPage.GetPosPixel().Y() ) );
-
- // selection area
- aWndSelect.SetSizePixel( Size(
- 2 * OWIDTH + SSPACE, LINE_SIZE * OHEIGHT + (LINE_SIZE - 1) * SSPACE ) );
-
- // scroll bar
- Point aSliderPos( aWndSelect.GetPosPixel() );
- Size aSliderSize( aWndSelect.GetSizePixel() );
- aSliderPos.Y() += aSliderSize.Height() + SSPACE;
- aSliderSize.Height() = GetSettings().GetStyleSettings().GetScrollBarSize();
- aSlider.SetPosSizePixel( aSliderPos, aSliderSize );
-
- aRectPage = Rectangle( aWndPage.GetPosPixel(), aWndPage.GetSizePixel() );
- aRectRow = Rectangle( aWndRow.GetPosPixel(), aWndRow.GetSizePixel() );
- aRectCol = Rectangle( aWndCol.GetPosPixel(), aWndCol.GetSizePixel() );
- aRectData = Rectangle( aWndData.GetPosPixel(), aWndData.GetSizePixel() );
- aRectSelect = Rectangle( aWndSelect.GetPosPixel(), aWndSelect.GetSizePixel() );
-}
-
-
-//----------------------------------------------------------------------------
-
-sal_Bool ScDPLayoutDlg::GetPivotArrays( PivotField* pPageArr,
- PivotField* pColArr,
- PivotField* pRowArr,
- PivotField* pDataArr,
- sal_uInt16& rPageCount,
- sal_uInt16& rColCount,
- sal_uInt16& rRowCount,
- sal_uInt16& rDataCount )
-{
- sal_Bool bFit = sal_True;
- sal_uInt16 i=0;
-
- for ( i=0; (i<aDataArr.size()) && (aDataArr[i].get() != NULL ); i++ )
- lcl_FillToPivotField( pDataArr[i], *aDataArr[i] );
- rDataCount = i;
-
- for ( i=0; (i<aPageArr.size()) && (aPageArr[i].get() != NULL ); i++ )
- lcl_FillToPivotField( pPageArr[i], *aPageArr[i] );
- rPageCount = i;
-
- for ( i=0; (i<aColArr.size()) && (aColArr[i].get() != NULL ); i++ )
- lcl_FillToPivotField( pColArr[i], *aColArr[i] );
- rColCount = i;
-
- for ( i=0; (i<aRowArr.size()) && (aRowArr[i].get() != NULL ); i++ )
- lcl_FillToPivotField( pRowArr[i], *aRowArr[i] );
- rRowCount = i;
-
- if ( rRowCount < aRowArr.size() )
- pRowArr[rRowCount++].nCol = PIVOT_DATA_FIELD;
- else if ( rColCount < aColArr.size() )
- pColArr[rColCount++].nCol = PIVOT_DATA_FIELD;
- else
- bFit = sal_False; // kein Platz fuer Datenfeld
-
- return bFit;
-}
-
-void ScDPLayoutDlg::UpdateSrcRange()
-{
- String theCurPosStr = aEdInPos.GetText();
- sal_uInt16 nResult = ScRange().Parse(theCurPosStr, pDoc, pDoc->GetAddressConvention());
-
- if ( SCA_VALID != (nResult & SCA_VALID) )
- // invalid source range.
- return;
-
- ScRefAddress start, end;
- ConvertDoubleRef(pDoc, theCurPosStr, 1, start, end, pDoc->GetAddressConvention());
- ScRange aNewRange(start.GetAddress(), end.GetAddress());
- ScSheetSourceDesc inSheet = *xDlgDPObject->GetSheetDesc();
-
- if (inSheet.aSourceRange == aNewRange)
- // new range is identical to the current range. Nothing to do.
- return;
-
- ScTabViewShell * pTabViewShell = pViewData->GetViewShell();
- inSheet.aSourceRange = aNewRange;
- xDlgDPObject->SetSheetDesc(inSheet);
- xDlgDPObject->FillOldParam( thePivotData, sal_False );
- xDlgDPObject->FillLabelData(thePivotData);
-
- pTabViewShell->SetDialogDPObject(xDlgDPObject.get());
- aLabelDataArr.clear();
- aWndSelect.ClearFields();
- aWndData.ClearFields();
- aWndRow.ClearFields();
- aWndCol.ClearFields();
- aWndPage.ClearFields();
-
- for (size_t i = 0; i < MAX_LABELS; ++i)
- aSelectArr[i].reset();
-
- for (size_t i = 0; i < MAX_FIELDS; ++i)
- {
- aRowArr[i].reset();
- aColArr[i].reset();
- aDataArr[i].reset();
- }
-
- for (size_t i = 0; i < MAX_PAGEFIELDS; ++i)
- aPageArr[i].reset();
-
- InitFields();
+ return 0;
}
-//----------------------------------------------------------------------------
-
-void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
+IMPL_LINK( ScPivotLayoutDlg, OkHdl, OKButton *, EMPTYARG )
{
- if ( !bRefInputMode || !pEditActive )
- return;
+ String aOutPosStr = maEdOutPos.GetText();
+ ScAddress aAdrDest;
+ bool bToNewTable = maLbOutPos.GetSelectEntryPos() == 1;
+ sal_uInt16 nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, mpDoc, mpDoc->GetAddressConvention() ) : 0;
- if ( rRef.aStart != rRef.aEnd )
- RefInputStart( pEditActive );
-
- if ( pEditActive == &aEdInPos )
- {
- String aRefStr;
- rRef.Format( aRefStr, SCR_ABS_3D, pDocP, pDocP->GetAddressConvention() );
- pEditActive->SetRefString( aRefStr );
- }
- else if ( pEditActive == &aEdOutPos )
+ if( bToNewTable || ((aOutPosStr.Len() > 0) && ((nResult & SCA_VALID) == SCA_VALID)) )
{
- String aRefStr;
- rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() );
- pEditActive->SetRefString( aRefStr );
- }
-}
+ ScPivotFieldVector aPageFields, aColFields, aRowFields, aDataFields;
+ maWndPage.WritePivotFields( aPageFields );
+ maWndCol.WritePivotFields( aColFields );
+ maWndRow.WritePivotFields( aRowFields );
+ maWndData.WritePivotFields( aDataFields );
+ // TODO: handle data field in dialog field windows?
+ aRowFields.resize( aRowFields.size() + 1 );
+ aRowFields.back().nCol = PIVOT_DATA_FIELD;
-//----------------------------------------------------------------------------
+ ScDPSaveData* pOldSaveData = mxDlgDPObject->GetSaveData();
-void ScDPLayoutDlg::SetActive()
-{
- if ( bRefInputMode )
- {
- if ( pEditActive )
- pEditActive->GrabFocus();
+ ScRange aOutRange( aAdrDest ); // bToNewTable is passed separately
- if ( pEditActive == &aEdInPos )
- EdInModifyHdl( NULL );
- else if ( pEditActive == &aEdOutPos )
- EdModifyHdl( NULL );
- }
- else
- {
- GrabFocus();
- }
+ ScDPSaveData aSaveData;
+ aSaveData.SetIgnoreEmptyRows( maBtnIgnEmptyRows.IsChecked() );
+ aSaveData.SetRepeatIfEmpty( maBtnDetectCat.IsChecked() );
+ aSaveData.SetColumnGrand( maBtnTotalCol.IsChecked() );
+ aSaveData.SetRowGrand( maBtnTotalRow.IsChecked() );
+ aSaveData.SetFilterButton( maBtnFilter.IsChecked() );
+ aSaveData.SetDrillDown( maBtnDrillDown.IsChecked() );
- RefInputDone();
-}
+ uno::Reference< sheet::XDimensionsSupplier > xSource = mxDlgDPObject->GetSource();
-//----------------------------------------------------------------------------
-// Handler:
-//----------------------------------------------------------------------------
+ ScDPObject::ConvertOrientation( aSaveData, aPageFields, sheet::DataPilotFieldOrientation_PAGE, 0, 0, 0, xSource, false );
+ ScDPObject::ConvertOrientation( aSaveData, aColFields, sheet::DataPilotFieldOrientation_COLUMN, 0, 0, 0, xSource, false );
+ ScDPObject::ConvertOrientation( aSaveData, aRowFields, sheet::DataPilotFieldOrientation_ROW, 0, 0, 0, xSource, false );
+ ScDPObject::ConvertOrientation( aSaveData, aDataFields, sheet::DataPilotFieldOrientation_DATA, 0, 0, 0, xSource, false, &aColFields, &aRowFields, &aPageFields );
-IMPL_LINK( ScDPLayoutDlg, ClickHdl, PushButton *, pBtn )
-{
- if( pBtn == &aBtnRemove )
- {
- ScDPFieldWindow& rWnd = GetFieldWindow( eLastActiveType );
- RemoveField( eLastActiveType, rWnd.GetSelectedField() );
- if( !rWnd.IsEmpty() ) rWnd.GrabFocus();
- }
- else if( pBtn == &aBtnOptions )
- {
- ScDPFieldWindow& rWnd = GetFieldWindow( eLastActiveType );
- NotifyDoubleClick( eLastActiveType, rWnd.GetSelectedField() );
- rWnd.GrabFocus();
- }
- return 0;
-}
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
-{
- String aOutPosStr( aEdOutPos.GetText() );
- ScAddress aAdrDest;
- sal_Bool bToNewTable = (aLbOutPos.GetSelectEntryPos() == 1);
- sal_uInt16 nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, pDoc, pDoc->GetAddressConvention() ) : 0;
-
- if ( bToNewTable
- || ( (aOutPosStr.Len() > 0) && (SCA_VALID == (nResult & SCA_VALID)) ) )
- {
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Enable();
-
- ScPivotParam theOutParam;
- PivotPageFieldArr aPageFieldArr;
- PivotFieldArr aColFieldArr;
- PivotFieldArr aRowFieldArr;
- PivotFieldArr aDataFieldArr;
- sal_uInt16 nPageCount;
- sal_uInt16 nColCount;
- sal_uInt16 nRowCount;
- sal_uInt16 nDataCount;
-
- sal_Bool bFit = GetPivotArrays( aPageFieldArr, aColFieldArr, aRowFieldArr, aDataFieldArr,
- nPageCount, nColCount, nRowCount, nDataCount );
- if ( bFit )
+ for( ScDPLabelDataVector::const_iterator aIt = maLabelData.begin(), aEnd = maLabelData.end(); aIt != aEnd; ++aIt )
{
- ScDPSaveData* pOldSaveData = xDlgDPObject->GetSaveData();
-
- ScRange aOutRange( aAdrDest ); // bToNewTable is passed separately
-
- ScDPSaveData aSaveData;
- aSaveData.SetIgnoreEmptyRows( aBtnIgnEmptyRows.IsChecked() );
- aSaveData.SetRepeatIfEmpty( aBtnDetectCat.IsChecked() );
- aSaveData.SetColumnGrand( aBtnTotalCol.IsChecked() );
- aSaveData.SetRowGrand( aBtnTotalRow.IsChecked() );
- aSaveData.SetFilterButton( aBtnFilter.IsChecked() );
- aSaveData.SetDrillDown( aBtnDrillDown.IsChecked() );
-
- uno::Reference<sheet::XDimensionsSupplier> xSource = xDlgDPObject->GetSource();
-
- ScDPObject::ConvertOrientation( aSaveData, aPageFieldArr, nPageCount,
- sheet::DataPilotFieldOrientation_PAGE, NULL, 0, 0, xSource, sal_False );
- ScDPObject::ConvertOrientation( aSaveData, aColFieldArr, nColCount,
- sheet::DataPilotFieldOrientation_COLUMN, NULL, 0, 0, xSource, sal_False );
- ScDPObject::ConvertOrientation( aSaveData, aRowFieldArr, nRowCount,
- sheet::DataPilotFieldOrientation_ROW, NULL, 0, 0, xSource, sal_False );
- ScDPObject::ConvertOrientation( aSaveData, aDataFieldArr, nDataCount,
- sheet::DataPilotFieldOrientation_DATA, NULL, 0, 0, xSource, sal_False,
- aColFieldArr, nColCount, aRowFieldArr, nRowCount, aPageFieldArr, nPageCount );
-
- for( ScDPLabelDataVec::const_iterator aIt = aLabelDataArr.begin(), aEnd = aLabelDataArr.end(); aIt != aEnd; ++aIt )
+ if( ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName( aIt->maName ) )
{
- if( ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName( aIt->maName ) )
+ pDim->SetUsedHierarchy( aIt->mnUsedHier );
+ pDim->SetShowEmpty( aIt->mbShowAll );
+ pDim->SetSortInfo( &aIt->maSortInfo );
+ pDim->SetLayoutInfo( &aIt->maLayoutInfo );
+ pDim->SetAutoShowInfo( &aIt->maShowInfo );
+ ScDPSaveDimension* pOldDim = NULL;
+ if (pOldSaveData)
{
- pDim->SetUsedHierarchy( aIt->mnUsedHier );
- pDim->SetShowEmpty( aIt->mbShowAll );
- pDim->SetSortInfo( &aIt->maSortInfo );
- pDim->SetLayoutInfo( &aIt->maLayoutInfo );
- pDim->SetAutoShowInfo( &aIt->maShowInfo );
- ScDPSaveDimension* pOldDim = NULL;
- if (pOldSaveData)
+ // Transfer the existing layout names to new dimension instance.
+ pOldDim = pOldSaveData->GetExistingDimensionByName(aIt->maName);
+ if (pOldDim)
{
- // Transfer the existing layout names to new dimension instance.
- pOldDim = pOldSaveData->GetExistingDimensionByName(aIt->maName);
- if (pOldDim)
- {
- const OUString* pLayoutName = pOldDim->GetLayoutName();
- if (pLayoutName)
- pDim->SetLayoutName(*pLayoutName);
+ const OUString* pLayoutName = pOldDim->GetLayoutName();
+ if (pLayoutName)
+ pDim->SetLayoutName(*pLayoutName);
- const OUString* pSubtotalName = pOldDim->GetSubtotalName();
- if (pSubtotalName)
- pDim->SetSubtotalName(*pSubtotalName);
- }
+ const OUString* pSubtotalName = pOldDim->GetSubtotalName();
+ if (pSubtotalName)
+ pDim->SetSubtotalName(*pSubtotalName);
}
+ }
- bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL );
+ bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL );
- // visibility of members
- for (vector<ScDPLabelData::Member>::const_iterator itr = aIt->maMembers.begin(), itrEnd = aIt->maMembers.end();
- itr != itrEnd; ++itr)
- {
- ScDPSaveMember* pMember = pDim->GetMemberByName(itr->maName);
+ // visibility of members
+ for (::std::vector<ScDPLabelData::Member>::const_iterator itr = aIt->maMembers.begin(), itrEnd = aIt->maMembers.end();
+ itr != itrEnd; ++itr)
+ {
+ ScDPSaveMember* pMember = pDim->GetMemberByName(itr->maName);
- // #i40054# create/access members only if flags are not default
- // (or in manual sorting mode - to keep the order)
- if (bManualSort || !itr->mbVisible || !itr->mbShowDetails)
- {
- pMember->SetIsVisible(itr->mbVisible);
- pMember->SetShowDetails(itr->mbShowDetails);
- }
- if (pOldDim)
+ // #i40054# create/access members only if flags are not default
+ // (or in manual sorting mode - to keep the order)
+ if (bManualSort || !itr->mbVisible || !itr->mbShowDetails)
+ {
+ pMember->SetIsVisible(itr->mbVisible);
+ pMember->SetShowDetails(itr->mbShowDetails);
+ }
+ if (pOldDim)
+ {
+ // Transfer the existing layout name.
+ ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(itr->maName);
+ if (pOldMember)
{
- // Transfer the existing layout name.
- ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(itr->maName);
- if (pOldMember)
- {
- const OUString* pLayoutName = pOldMember->GetLayoutName();
- if (pLayoutName)
- pMember->SetLayoutName(*pLayoutName);
- }
+ const OUString* pLayoutName = pOldMember->GetLayoutName();
+ if (pLayoutName)
+ pMember->SetLayoutName(*pLayoutName);
}
}
}
}
- ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension();
- if (pDim && pOldSaveData)
+ }
+ ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension();
+ if (pDim && pOldSaveData)
+ {
+ ScDPSaveDimension* pOldDim = pOldSaveData->GetDataLayoutDimension();
+ if (pOldDim)
{
- ScDPSaveDimension* pOldDim = pOldSaveData->GetDataLayoutDimension();
- if (pOldDim)
- {
- const OUString* pLayoutName = pOldDim->GetLayoutName();
- if (pLayoutName)
- pDim->SetLayoutName(*pLayoutName);
- }
+ const OUString* pLayoutName = pOldDim->GetLayoutName();
+ if (pLayoutName)
+ pDim->SetLayoutName(*pLayoutName);
}
+ }
- sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE );
- ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable );
+ sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE );
+ ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable );
- bRefInputMode = sal_False; // to allow deselecting when switching sheets
+ mbRefInputMode = false; // to allow deselecting when switching sheets
- SetDispatcherLock( sal_False );
- SwitchToDocument();
+ SetDispatcherLock( false );
+ SwitchToDocument();
- // #95513# don't hide the dialog before executing the slot, instead it is used as
- // parent for message boxes in ScTabViewShell::GetDialogParent
+ // #95513# don't hide the dialog before executing the slot, instead it is used as
+ // parent for message boxes in ScTabViewShell::GetDialogParent
- const SfxPoolItem* pRet = GetBindings().GetDispatcher()->Execute(
- SID_PIVOT_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aOutItem, 0L, 0L );
+ const SfxPoolItem* pRet = GetBindings().GetDispatcher()->Execute(
+ SID_PIVOT_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aOutItem, 0L, 0L );
- bool bSuccess = true;
- if (pRet)
- {
- const SfxBoolItem* pItem = dynamic_cast<const SfxBoolItem*>(pRet);
- if (pItem)
- bSuccess = pItem->GetValue();
- }
- if (bSuccess)
- // Table successfully inserted.
- Close();
- else
- {
- // Table insertion failed. Keep the dialog open.
- bRefInputMode = true;
- SetDispatcherLock(true);
- }
+ bool bSuccess = true;
+ if (pRet)
+ {
+ const SfxBoolItem* pItem = dynamic_cast<const SfxBoolItem*>(pRet);
+ if (pItem)
+ bSuccess = pItem->GetValue();
}
+ if (bSuccess)
+ // Table successfully inserted.
+ Close();
else
{
- ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ),
- ScGlobal::GetRscString( STR_PIVOT_ERROR )
- ).Execute();
+ // Table insertion failed. Keep the dialog open.
+ mbRefInputMode = true;
+ SetDispatcherLock(true);
}
}
else
{
- if ( !aBtnMore.GetState() )
- aBtnMore.SetState( sal_True );
+ if( !maBtnMore.GetState() )
+ maBtnMore.SetState( true );
- ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ),
- ScGlobal::GetRscString( STR_INVALID_TABREF )
- ).Execute();
- aEdOutPos.GrabFocus();
+ ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ), ScGlobal::GetRscString( STR_INVALID_TABREF ) ).Execute();
+ maEdOutPos.GrabFocus();
}
return 0;
}
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG )
+IMPL_LINK( ScPivotLayoutDlg, CancelHdl, CancelButton *, EMPTYARG )
{
Close();
return 0;
}
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScDPLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG )
+IMPL_LINK( ScPivotLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG )
{
- if ( aBtnMore.GetState() )
+ if ( maBtnMore.GetState() )
{
- bRefInputMode = sal_True;
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Enable();
- if ( aEdInPos.IsEnabled() )
+ mbRefInputMode = true;
+ if ( maEdInPos.IsEnabled() )
{
- aEdInPos.Enable();
- aEdInPos.GrabFocus();
- aEdInPos.Enable();
+ maEdInPos.Enable();
+ maEdInPos.GrabFocus();
+ maEdInPos.Enable();
}
else
{
- aEdOutPos.Enable();
- aEdOutPos.GrabFocus();
- aEdOutPos.Enable();
+ maEdOutPos.Enable();
+ maEdOutPos.GrabFocus();
+ maEdOutPos.Enable();
}
}
else
{
- bRefInputMode = sal_False;
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg
+ mbRefInputMode = false;
}
return 0;
}
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, Edit *, EMPTYARG )
+IMPL_LINK( ScPivotLayoutDlg, EdOutModifyHdl, Edit *, EMPTYARG )
{
- String theCurPosStr = aEdOutPos.GetText();
- sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() );
+ String theCurPosStr = maEdOutPos.GetText();
+ sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, mpDoc, mpDoc->GetAddressConvention() );
if ( SCA_VALID == (nResult & SCA_VALID) )
{
- String* pStr = NULL;
- sal_Bool bFound = sal_False;
- sal_uInt16 i = 0;
- sal_uInt16 nCount = aLbOutPos.GetEntryCount();
+ String* pStr = 0;
+ bool bFound = false;
+ sal_uInt16 i = 0;
+ sal_uInt16 nCount = maLbOutPos.GetEntryCount();
for ( i=2; i<nCount && !bFound; i++ )
{
- pStr = (String*)aLbOutPos.GetEntryData( i );
+ pStr = (String*)maLbOutPos.GetEntryData( i );
bFound = (theCurPosStr == *pStr);
}
if ( bFound )
- aLbOutPos.SelectEntryPos( --i );
+ maLbOutPos.SelectEntryPos( --i );
else
- aLbOutPos.SelectEntryPos( 0 );
+ maLbOutPos.SelectEntryPos( 0 );
}
return 0;
}
-IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG )
+IMPL_LINK( ScPivotLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG )
{
- UpdateSrcRange();
- return 0;
-}
+ String theCurPosStr = maEdInPos.GetText();
+ sal_uInt16 nResult = ScRange().Parse( theCurPosStr, mpDoc, mpDoc->GetAddressConvention() );
+ // invalid source range
+ if( SCA_VALID != (nResult & SCA_VALID) )
+ return 0;
-//----------------------------------------------------------------------------
+ ScRefAddress start, end;
+ ConvertDoubleRef( mpDoc, theCurPosStr, 1, start, end, mpDoc->GetAddressConvention() );
+ ScRange aNewRange( start.GetAddress(), end.GetAddress() );
+ ScSheetSourceDesc inSheet = *mxDlgDPObject->GetSheetDesc();
-IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG )
-{
- String aString;
- sal_uInt16 nSelPos = aLbOutPos.GetSelectEntryPos();
+ // new range is identical to the current range
+ if( inSheet.aSourceRange == aNewRange )
+ return 0;
- if ( nSelPos > 1 )
- {
- aString = *(String*)aLbOutPos.GetEntryData( nSelPos );
- }
- else if ( nSelPos == aLbOutPos.GetEntryCount()-1 ) // auf neue Tabelle?
+ ScTabViewShell* pTabViewShell = mpViewData->GetViewShell();
+ inSheet.aSourceRange = aNewRange;
+ mxDlgDPObject->SetSheetDesc( inSheet );
+ mxDlgDPObject->FillOldParam( maPivotData );
+ mxDlgDPObject->FillLabelData( maPivotData );
+
+ // SetDialogDPObject does not take ownership but makes a copy internally
+ pTabViewShell->SetDialogDPObject( mxDlgDPObject.get() );
+
+ // re-initialize the field windows from the new data
+ InitFieldWindows();
+
+ return 0;
+}
+
+IMPL_LINK( ScPivotLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG )
+{
+ String aString;
+ sal_uInt16 nSelPos = maLbOutPos.GetSelectEntryPos();
+ if( nSelPos > 1 )
{
- aEdOutPos.Disable();
- aRbOutPos.Disable();
+ aString = *(String*)maLbOutPos.GetEntryData( nSelPos );
}
else
{
- aEdOutPos.Enable();
- aRbOutPos.Enable();
+ // do not allow to specify output position, if target is "new sheet"
+ bool bNewSheet = nSelPos == 1;
+ maEdOutPos.Enable( !bNewSheet );
+ maRbOutPos.Enable( !bNewSheet );
}
- aEdOutPos.SetText( aString );
+ maEdOutPos.SetText( aString );
return 0;
}
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScDPLayoutDlg, ScrollHdl, ScrollBar *, EMPTYARG )
+IMPL_LINK( ScPivotLayoutDlg, ChildEventListener, VclWindowEvent*, pEvent )
{
- long nNewOffset = aSlider.GetThumbPos();
- long nOffsetDiff = nNewOffset - nOffset;
- nOffset = nNewOffset;
-
- size_t nFields = std::min< size_t >( aLabelDataArr.size() - nOffset, PAGE_SIZE );
-
- aWndSelect.ClearFields();
-
- size_t i=0;
- for ( i=0; i<nFields; i++ )
+ Window* pWindow = pEvent->GetWindow();
+ // check that this dialog is the parent of the window, to ignore focus events from sub dialogs
+ if( (pEvent->GetId() == VCLEVENT_WINDOW_GETFOCUS) && pWindow && (pWindow->GetParent() == this) )
{
- const ScDPLabelData& rData = aLabelDataArr[nOffset+i];
- aWndSelect.AddField(rData.getDisplayName(), i);
- aSelectArr[i].reset( new ScDPFuncData( rData.mnCol, rData.mnFuncMask ) );
- }
- for ( ; i<aSelectArr.size(); i++ )
- aSelectArr[i].reset();
-
- aWndSelect.ModifySelectionOffset( nOffsetDiff ); // adjusts selection & redraws
- return 0;
-}
+ // check if old window and/or new window are field windows
+ ScPivotFieldWindow* pSourceWindow = mpFocusWindow;
+ ScPivotFieldWindow* pTargetWindow = dynamic_cast< ScPivotFieldWindow* >( pWindow );
-//----------------------------------------------------------------------------
+ /* Enable or disable the Remove/Options buttons. Do nothing if the
+ buttons themselves get the focus.
+ #128113# The TestTool may set the focus into an empty window. Then
+ the Remove/Options buttons must be disabled. */
+ if( (pWindow != &maBtnRemove) && (pWindow != &maBtnOptions) )
+ {
+ bool bEnableButtons = pTargetWindow && (pTargetWindow->GetType() != PIVOTFIELDTYPE_SELECT) && !pTargetWindow->IsEmpty();
+ maBtnRemove.Enable( bEnableButtons );
+ maBtnOptions.Enable( bEnableButtons );
+ /* Remember the new focus window (will not be changed, if
+ Remove/Option buttons are getting focus, because they need to
+ know the field window they are working on). */
+ mpFocusWindow = pTargetWindow;
+ }
-IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl )
-{
- pEditActive = NULL;
- if ( pCtrl == &aEdInPos )
- pEditActive = &aEdInPos;
- else if ( pCtrl == &aEdOutPos )
- pEditActive = &aEdOutPos;
+ /* Move the last selected field to target window, if focus changes via
+ keyboard shortcut. */
+ if( pSourceWindow && pTargetWindow && (pSourceWindow != pTargetWindow) && ((pTargetWindow->GetGetFocusFlags() & GETFOCUS_MNEMONIC) != 0) )
+ {
+ // append field in target window
+ MoveField( *pSourceWindow, *pTargetWindow, pTargetWindow->GetFieldCount(), false );
+ // move cursor in selection window to next field
+ if( pSourceWindow->GetType() == PIVOTFIELDTYPE_SELECT )
+ pSourceWindow->SelectNextField();
+ // return focus to source window (if it is not empty)
+ GrabFieldFocus( pSourceWindow->IsEmpty() ? *pTargetWindow : *pSourceWindow );
+ }
+ mpActiveEdit = dynamic_cast< ::formula::RefEdit* >( pEvent->GetWindow() );
+ }
return 0;
}
+// ============================================================================
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index f1f35a4fbf48..080c80e509ea 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -117,6 +117,8 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo
aBtnOk .SetClickHdl( LINK( this, ScNewScenarioDlg, OkHdl ) );
aCbShowFrame.SetClickHdl( LINK( this, ScNewScenarioDlg, EnableHdl ) );
+ aLbColor.SetAccessibleName(String(ScResId( STR_COLOR ) ));
+
FreeResource();
aLbColor.SelectEntry( Color( COL_LIGHTGRAY ) );
@@ -142,6 +144,9 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo
aCbAttrib.Enable(sal_False);
aCbValue.Enable(sal_False);
*/
+
+ aEdComment.SetAccessibleRelationMemberOf(&aFlComment);
+ aLbColor.SetAccessibleRelationLabeledBy(&aCbShowFrame);
}
//------------------------------------------------------------------------
diff --git a/sc/source/ui/dbgui/scendlg.hrc b/sc/source/ui/dbgui/scendlg.hrc
index 83818773bf5a..f7fa562a5b17 100644
--- a/sc/source/ui/dbgui/scendlg.hrc
+++ b/sc/source/ui/dbgui/scendlg.hrc
@@ -55,3 +55,6 @@
#define STR_CREATEDBY 31
#define STR_ON 32
#define STR_EDIT 33
+//IAccessibility2 Implementation 2009-----
+#define STR_COLOR 34
+//-----IAccessibility2 Implementation 2009
diff --git a/sc/source/ui/dbgui/scendlg.src b/sc/source/ui/dbgui/scendlg.src
index f7c3d29b8365..640fdda8bc30 100644
--- a/sc/source/ui/dbgui/scendlg.src
+++ b/sc/source/ui/dbgui/scendlg.src
@@ -147,6 +147,10 @@ ModalDialog RID_SCDLG_NEWSCENARIO
{
Text [ en-US ] = "on" ;
};
+ String STR_COLOR
+ {
+ Text [ en-US ] = "Display border in" ;
+ };
FixedLine FL_NAME
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index abbda7b995e7..2cf981a15ff3 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -273,7 +273,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
OUString sTextSeparators;
bool bMergeDelimiters = false;
bool bFixedWidth = false;
- bool bQuotedFieldAsText = true;
+ bool bQuotedFieldAsText = false;
bool bDetectSpecialNum = false;
sal_Int32 nFromRow = 1;
sal_Int32 nCharSet = -1;
@@ -316,34 +316,45 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
maFieldSeparators = GetSeparators();
// Clipboard is always Unicode, else detect.
- bool bPreselectUnicode = !mbFileImport;
+ rtl_TextEncoding ePreselectUnicode = (mbFileImport ?
+ RTL_TEXTENCODING_DONTKNOW : RTL_TEXTENCODING_UNICODE);
// Sniff for Unicode / not
- if( !bPreselectUnicode && mpDatStream )
+ if( ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW && mpDatStream )
{
Seek( 0 );
- mpDatStream->StartReadingUnicodeText();
+ mpDatStream->StartReadingUnicodeText( RTL_TEXTENCODING_DONTKNOW );
sal_uLong nUniPos = mpDatStream->Tell();
- if ( nUniPos > 0 )
- bPreselectUnicode = sal_True; // read 0xfeff/0xfffe
- else
+ switch (nUniPos)
{
- sal_uInt16 n;
- *mpDatStream >> n;
- // Assume that normal ASCII/ANSI/ISO/etc. text doesn't start with
- // control characters except CR,LF,TAB
- if ( (n & 0xff00) < 0x2000 )
- {
- switch ( n & 0xff00 )
+ case 2:
+ ePreselectUnicode = RTL_TEXTENCODING_UNICODE; // UTF-16
+ break;
+ case 3:
+ ePreselectUnicode = RTL_TEXTENCODING_UTF8; // UTF-8
+ break;
+ case 0:
{
- case 0x0900 :
- case 0x0a00 :
- case 0x0d00 :
- break;
- default:
- bPreselectUnicode = sal_True;
+ sal_uInt16 n;
+ *mpDatStream >> n;
+ // Assume that normal ASCII/ANSI/ISO/etc. text doesn't start with
+ // control characters except CR,LF,TAB
+ if ( (n & 0xff00) < 0x2000 )
+ {
+ switch ( n & 0xff00 )
+ {
+ case 0x0900 :
+ case 0x0a00 :
+ case 0x0d00 :
+ break;
+ default:
+ ePreselectUnicode = RTL_TEXTENCODING_UNICODE; // UTF-16
+ }
+ }
+ mpDatStream->Seek(0);
}
- }
- mpDatStream->Seek(0);
+ break;
+ default:
+ ; // nothing
}
mnStreamPos = mpDatStream->Tell();
}
@@ -373,10 +384,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
// Insert one "SYSTEM" entry for compatibility in AsciiOptions and system
// independent document linkage.
aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser );
- aLbCharSet.SelectTextEncoding( bPreselectUnicode ?
- RTL_TEXTENCODING_UNICODE : gsl_getSystemTextEncoding() );
+ aLbCharSet.SelectTextEncoding( ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW ?
+ gsl_getSystemTextEncoding() : ePreselectUnicode );
- if( nCharSet >= 0 )
+ if( nCharSet >= 0 && ePreselectUnicode == RTL_TEXTENCODING_DONTKNOW )
aLbCharSet.SelectEntryPos( static_cast<sal_uInt16>(nCharSet) );
SetSelectedCharSet();
@@ -410,6 +421,9 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName,
UpdateVertical();
maTableBox.Execute( CSVCMD_NEWCELLTEXTS );
+
+ aEdOther.SetAccessibleName(aCkbOther.GetText());
+ aEdOther.SetAccessibleRelationLabeledBy(&aCkbOther);
}
@@ -437,8 +451,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, String &rText )
memset( mpRowPosArray, 0, sizeof(mpRowPosArray[0]) * (ASCIIDLG_MAXROWS+2));
Seek(0);
- if ( mpDatStream->GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
- mpDatStream->StartReadingUnicodeText();
+ mpDatStream->StartReadingUnicodeText( mpDatStream->GetStreamCharSet() );
mnStreamPos = mpDatStream->Tell();
mpRowPosArray[mnRowPosCount] = mnStreamPos;
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 3bca3a8ade22..486704ca4d12 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -132,11 +132,12 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aEdFieldSep ( this, ScResId( ED_FIELDSEP ) ),
aFtTextSep ( this, ScResId( FT_TEXTSEP ) ),
aEdTextSep ( this, ScResId( ED_TEXTSEP ) ),
+ aCbQuoteAll ( this, ScResId( CB_QUOTEALL ) ),
+ aCbShown ( this, ScResId( CB_SAVESHOWN ) ),
aCbFixed ( this, ScResId( CB_FIXEDWIDTH ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- aBtnHelp ( this, ScResId( BTN_HELP ) ),
- aCbShown ( this, ScResId( CB_SAVESHOWN ) )
+ aBtnHelp ( this, ScResId( BTN_HELP ) )
{
// im Ctor-Initializer nicht moeglich (MSC kann das nicht):
pFieldSepTab = new ScDelimiterTable( String(ScResId(SCSTR_FIELDSEP)) );
@@ -214,6 +215,8 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aCbFixed.Check( sal_False );
aCbShown.Show();
aCbShown.Check( sal_True );
+ aCbQuoteAll.Show();
+ aCbQuoteAll.Check( sal_False );
}
else
{
@@ -225,6 +228,7 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aEdTextSep.Hide();
aCbFixed.Hide();
aCbShown.Hide();
+ aCbQuoteAll.Hide();
aLbFont.GrabFocus();
aLbFont.SetDoubleClickHdl( LINK( this, ScImportOptionsDlg, DoubleClickHdl ) );
}
@@ -259,6 +263,7 @@ void ScImportOptionsDlg::GetImportOptions( ScImportOptions& rOptions ) const
rOptions.nTextSepCode = GetCodeFromCombo( aEdTextSep );
rOptions.bFixedWidth = aCbFixed.IsChecked();
rOptions.bSaveAsShown = aCbShown.IsChecked();
+ rOptions.bQuoteAllText = aCbQuoteAll.IsChecked();
}
}
@@ -302,6 +307,7 @@ IMPL_LINK( ScImportOptionsDlg, FixedWidthHdl, CheckBox*, pCheckBox )
aFtTextSep.Enable( bEnable );
aEdTextSep.Enable( bEnable );
aCbShown.Enable( bEnable );
+ aCbQuoteAll.Enable( bEnable );
}
return 0;
}
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 24751946253f..7e0b53d863cc 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -70,8 +70,8 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi
: ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_SPEC_FILTER ),
//
- aLbFilterArea ( this, ScResId( LB_CRITERIA_AREA ) ),
aFtFilterArea ( this, ScResId( FT_CRITERIA_AREA ) ),
+ aLbFilterArea ( this, ScResId( LB_CRITERIA_AREA ) ),
aEdFilterArea ( this, this, ScResId( ED_CRITERIA_AREA ) ),
aRbFilterArea ( this, ScResId( RB_CRITERIA_AREA ), &aEdFilterArea, this ),
//
@@ -103,6 +103,11 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi
pTimer->SetTimeout( 50 ); // 50ms warten
pTimer->SetTimeoutHdl( LINK( this, ScSpecialFilterDlg, TimeOutHdl ) );
pTimer->Start();
+
+ aLbCopyArea.SetAccessibleName(aBtnCopyResult.GetText());
+ aEdCopyArea.SetAccessibleName(aBtnCopyResult.GetText());
+ aLbCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult);
+ aEdCopyArea.SetAccessibleRelationLabeledBy(&aBtnCopyResult);
}
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 65411f7f82d2..2bf85de61a0b 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -600,6 +600,13 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent,
Init();
FreeResource();
SetExchangeSupport();
+
+ aLbOutPos.SetAccessibleRelationLabeledBy(&aBtnCopyResult);
+ aLbOutPos.SetAccessibleName(aBtnCopyResult.GetText());
+ aEdOutPos.SetAccessibleRelationLabeledBy(&aBtnCopyResult);
+ aEdOutPos.SetAccessibleName(aBtnCopyResult.GetText());
+ aLbSortUser.SetAccessibleRelationLabeledBy(&aBtnSortUser);
+ aLbSortUser.SetAccessibleName(aBtnSortUser.GetText());
}
// -----------------------------------------------------------------------
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 070167f8ff95..d2f4db3cde07 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -523,6 +523,9 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( Window* pParent,
{
Init();
FreeResource();
+
+ aLbUserDef.SetAccessibleRelationLabeledBy(&aBtnUserDef);
+ aLbUserDef.SetAccessibleName(aBtnUserDef.GetText());
}
// -----------------------------------------------------------------------
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 7e274a86f0f7..734fd20a71d7 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1650,6 +1650,8 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
sal_uInt16 nOldNumberFormatInt = rStream.GetNumberFormatInt();
ByteString aStrDelimEncoded; // only used if not Unicode
UniString aStrDelimDecoded; // only used if context encoding
+ ByteString aDelimEncoded;
+ UniString aDelimDecoded;
sal_Bool bContextOrNotAsciiEncoding;
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
@@ -1659,6 +1661,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
else
{
aStrDelimEncoded = ByteString( cStrDelim, eCharSet );
+ aDelimEncoded = ByteString( cDelim, eCharSet );
rtl_TextEncodingInfo aInfo;
aInfo.StructSize = sizeof(aInfo);
if ( rtl_getTextEncodingInfo( eCharSet, &aInfo ) )
@@ -1667,7 +1670,10 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
(((aInfo.Flags & RTL_TEXTENCODING_INFO_CONTEXT) != 0) ||
((aInfo.Flags & RTL_TEXTENCODING_INFO_ASCII) == 0));
if ( bContextOrNotAsciiEncoding )
+ {
aStrDelimDecoded = String( aStrDelimEncoded, eCharSet );
+ aDelimDecoded = String( aDelimEncoded, eCharSet );
+ }
}
else
bContextOrNotAsciiEncoding = sal_False;
@@ -1895,14 +1901,21 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
if ( eCharSet == RTL_TEXTENCODING_UNICODE )
{
xub_StrLen nPos = aString.Search( cStrDelim );
+ // #i116636# quotes are needed if text delimiter (quote), field delimiter, or LF is in the cell text
+ bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
+ ( nPos != STRING_NOTFOUND ) ||
+ ( aString.Search( cDelim ) != STRING_NOTFOUND ) ||
+ ( aString.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND );
while ( nPos != STRING_NOTFOUND )
{
aString.Insert( cStrDelim, nPos );
nPos = aString.Search( cStrDelim, nPos+2 );
}
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
rStream.WriteUnicodeText( aString );
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
}
else
{
@@ -1928,6 +1941,10 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
UniString aStrDec( aStrEnc, eCharSet );
// search on re-decoded string
xub_StrLen nPos = aStrDec.Search( aStrDelimDecoded );
+ bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
+ ( nPos != STRING_NOTFOUND ) ||
+ ( aStrDec.Search( aDelimDecoded ) != STRING_NOTFOUND ) ||
+ ( aStrDec.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND );
while ( nPos != STRING_NOTFOUND )
{
aStrDec.Insert( aStrDelimDecoded, nPos );
@@ -1935,15 +1952,21 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
nPos+1+aStrDelimDecoded.Len() );
}
// write byte re-encoded
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
rStream.WriteUnicodeOrByteText( aStrDec, eCharSet );
- rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
+ if ( bNeedQuotes )
+ rStream.WriteUniOrByteChar( cStrDelim, eCharSet );
}
else
{
ByteString aStrEnc( aString, eCharSet );
// search on encoded string
xub_StrLen nPos = aStrEnc.Search( aStrDelimEncoded );
+ bool bNeedQuotes = rAsciiOpt.bQuoteAllText ||
+ ( nPos != STRING_NOTFOUND ) ||
+ ( aStrEnc.Search( aDelimEncoded ) != STRING_NOTFOUND ) ||
+ ( aStrEnc.Search( sal_Char(_LF) ) != STRING_NOTFOUND );
while ( nPos != STRING_NOTFOUND )
{
aStrEnc.Insert( aStrDelimEncoded, nPos );
@@ -1951,11 +1974,13 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
nPos+1+aStrDelimEncoded.Len() );
}
// write byte encoded
- rStream.Write( aStrDelimEncoded.GetBuffer(),
- aStrDelimEncoded.Len() );
+ if ( bNeedQuotes )
+ rStream.Write( aStrDelimEncoded.GetBuffer(),
+ aStrDelimEncoded.Len() );
rStream.Write( aStrEnc.GetBuffer(), aStrEnc.Len() );
- rStream.Write( aStrDelimEncoded.GetBuffer(),
- aStrDelimEncoded.Len() );
+ if ( bNeedQuotes )
+ rStream.Write( aStrDelimEncoded.GetBuffer(),
+ aStrDelimEncoded.Len() );
}
}
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 244f80dd0d5a..7f11f15f5db4 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -826,8 +826,7 @@ sal_Bool ScImportExport::Text2Doc( SvStream& rStrm )
SCCOL nEndCol = aRange.aEnd.Col();
SCROW nEndRow = aRange.aEnd.Row();
sal_uLong nOldPos = rStrm.Tell();
- if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
- rStrm.StartReadingUnicodeText();
+ rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() );
sal_Bool bData = sal_Bool( !bSingle );
if( !bSingle)
bOk = StartPaste();
@@ -1167,8 +1166,7 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
::std::auto_ptr<ScProgress> xProgress( new ScProgress( pDocSh,
ScGlobal::GetRscString( STR_LOAD_DOC ), rStrm.Tell() - nOldPos ));
rStrm.Seek( nOldPos );
- if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
- rStrm.StartReadingUnicodeText();
+ rStrm.StartReadingUnicodeText( rStrm.GetStreamCharSet() );
sal_Bool bOld = ScColumn::bDoubleAlloc;
ScColumn::bDoubleAlloc = sal_True;
diff --git a/sc/source/ui/inc/AccessibleDataPilotControl.hxx b/sc/source/ui/inc/AccessibleDataPilotControl.hxx
index c86d598b6e9c..f92fb79987a7 100644
--- a/sc/source/ui/inc/AccessibleDataPilotControl.hxx
+++ b/sc/source/ui/inc/AccessibleDataPilotControl.hxx
@@ -31,7 +31,7 @@
#include "AccessibleContextBase.hxx"
-class ScDPFieldWindow;
+class ScPivotFieldWindow;
class ScAccessibleDataPilotButton;
class ScAccessibleDataPilotControl
@@ -42,7 +42,7 @@ public:
ScAccessibleDataPilotControl(
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>& rxParent,
- ScDPFieldWindow* pDPFieldWindow);
+ ScPivotFieldWindow* pFieldWindow);
virtual void Init();
@@ -131,7 +131,7 @@ protected:
throw (::com::sun::star::uno::RuntimeException);
private:
- ScDPFieldWindow* mpDPFieldWindow;
+ ScPivotFieldWindow* mpFieldWindow;
struct AccessibleWeak
{
::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xWeakAcc;
diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx
index c5e0e4cde789..914e2917d2e0 100644
--- a/sc/source/ui/inc/areasdlg.hxx
+++ b/sc/source/ui/inc/areasdlg.hxx
@@ -62,18 +62,18 @@ public:
virtual sal_Bool Close();
private:
- ListBox aLbPrintArea;
FixedLine aFlPrintArea;
+ ListBox aLbPrintArea;
formula::RefEdit aEdPrintArea;
formula::RefButton aRbPrintArea;
- ListBox aLbRepeatRow;
FixedLine aFlRepeatRow;
+ ListBox aLbRepeatRow;
formula::RefEdit aEdRepeatRow;
formula::RefButton aRbRepeatRow;
- ListBox aLbRepeatCol;
FixedLine aFlRepeatCol;
+ ListBox aLbRepeatCol;
formula::RefEdit aEdRepeatCol;
formula::RefButton aRbRepeatCol;
diff --git a/sc/source/ui/inc/condfrmt.hrc b/sc/source/ui/inc/condfrmt.hrc
index 099d82b2fa85..06af0cd485ce 100644
--- a/sc/source/ui/inc/condfrmt.hrc
+++ b/sc/source/ui/inc/condfrmt.hrc
@@ -63,6 +63,12 @@
#define FL_SEP1 41
#define FL_SEP2 42
+//IAccessibility2 Implementation 2009-----
+#define LABEL_FORMARTTING_CONDITIONS 5043
+#define LABEL_CONDITIONS 5044
+#define LABEL_CONDITION_VALUE 5045
+//-----IAccessibility2 Implementation 2009
+
#define BTN_OK 31
#define BTN_CANCEL 32
#define BTN_HELP 33
diff --git a/sc/source/ui/inc/condfrmt.hxx b/sc/source/ui/inc/condfrmt.hxx
index 3909792d753d..c8963ef689ee 100644
--- a/sc/source/ui/inc/condfrmt.hxx
+++ b/sc/source/ui/inc/condfrmt.hxx
@@ -69,8 +69,6 @@ private:
FixedText aFtCond1Template;
ListBox aLbCond1Template;
PushButton aBtnNew1;
- FixedLine aFlSep1;
-
CheckBox aCbxCond2;
ListBox aLbCond21;
ListBox aLbCond22;
@@ -82,8 +80,6 @@ private:
FixedText aFtCond2Template;
ListBox aLbCond2Template;
PushButton aBtnNew2;
- FixedLine aFlSep2;
-
CheckBox aCbxCond3;
ListBox aLbCond31;
ListBox aLbCond32;
@@ -123,7 +119,8 @@ private:
Size aCond3Size1;
Size aCond3Size2;
Size aCond3Size3;
-
+ FixedLine aFlSep2;
+ FixedLine aFlSep1;
formula::RefEdit* pEdActive;
sal_Bool bDlgLostFocus;
ScDocument* pDoc;
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 5c74777edf47..65dd07d19e8a 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -28,193 +28,225 @@
#ifndef SC_FIELDWND_HXX
#define SC_FIELDWND_HXX
+#include <utility>
#include <vector>
-#include "address.hxx"
+#include <boost/shared_ptr.hpp>
+#include <cppuhelper/weakref.hxx>
+#include <rtl/ref.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/fixed.hxx>
-#include <cppuhelper/weakref.hxx>
-#define PAGE_SIZE 16 // count of visible fields for scrollbar
-#define LINE_SIZE 8 // count of fields per column for scrollbar
-#define MAX_FIELDS 8 // maximum count of fields for row/col/data area
-#define MAX_PAGEFIELDS 10 // maximum count of fields for page area
+#include "address.hxx"
+#include "pivot.hxx"
-#define OWIDTH PivotGlobal::nObjWidth
-#define OHEIGHT PivotGlobal::nObjHeight
-#define SSPACE PivotGlobal::nSelSpace
+// ============================================================================
-class ScDPLayoutDlg;
+class ScPivotLayoutDlg;
class ScAccessibleDataPilotControl;
-//===================================================================
+const size_t PIVOTFIELD_INVALID = static_cast< size_t >( -1 );
+
+// ============================================================================
-/** Type of content area. */
-enum ScDPFieldType
+/** Type of the pivot table field window. */
+enum ScPivotFieldType
{
- TYPE_PAGE, /// Area for all page fields.
- TYPE_ROW, /// Area for all row fields.
- TYPE_COL, /// Area for all column fields.
- TYPE_DATA, /// Area for all data fields.
- TYPE_SELECT /// Selection area with all fields.
+ PIVOTFIELDTYPE_PAGE, /// Window for all page fields.
+ PIVOTFIELDTYPE_COL, /// Window for all column fields.
+ PIVOTFIELDTYPE_ROW, /// Window for all row fields.
+ PIVOTFIELDTYPE_DATA, /// Window for all data fields.
+ PIVOTFIELDTYPE_SELECT /// Selection window with all fields.
};
-//-------------------------------------------------------------------
+/** Type of an end tracking event. */
+enum ScPivotFieldEndTracking
+{
+ ENDTRACKING_SUSPEND, /// Stop tracking in this window, but tracking still active (in another window).
+ ENDTRACKING_CANCEL, /// Tracking has been cancelled.
+ ENDTRACKING_DROP /// Tracking has ended, a field has been dropped.
+};
+
+// ============================================================================
+
+typedef ::std::pair< const ScPivotFuncData*, size_t > ScPivotFuncDataEntry;
+
+// ============================================================================
-/** Represents a field area in the DataPilot layout dialog. */
-class ScDPFieldWindow : public Control
+/** Represents a field area in the pivot table layout dialog. */
+class ScPivotFieldWindow : public Control
{
+public:
+ ScPivotFieldWindow(
+ ScPivotLayoutDlg* pDialog,
+ const ResId& rResId,
+ ScrollBar& rScrollBar,
+ FixedText* pFtCaption,
+ const ::rtl::OUString& rName,
+ ScPivotFieldType eFieldType,
+ const sal_Char* pcHelpId,
+ PointerStyle eDropPointer,
+ size_t nColCount,
+ size_t nRowCount,
+ long nFieldWidthFactor,
+ long nSpaceSize );
+
+ virtual ~ScPivotFieldWindow();
+
+ /** Initializes this field window from the passed label data (used for selection window). */
+ void ReadDataLabels( const ScDPLabelDataVector& rLabels );
+ /** Initializes this field window from the passed field data (used for row/col/page/data window). */
+ void ReadPivotFields( const ScPivotFieldVector& rPivotFields );
+
+ /** Fills the passed vector with the plain names of all fields from this field window. */
+ void WriteFieldNames( ScDPNameVec& rFieldNames ) const;
+ /** Fills the passed pivot field vector with the fields of this field window. */
+ void WritePivotFields( ScPivotFieldVector& rPivotFields ) const;
+
+ /** Returns the type of this field window. */
+ inline ScPivotFieldType GetType() const { return meFieldType; }
+ /** Returns the mouse pointer style for tracking over this window. */
+ inline PointerStyle GetDropPointerStyle() const { return meDropPointer; }
+ /** Returns the name of the control without shortcut. */
+ inline ::rtl::OUString GetName() const { return maName; }
+ /** Returns the description of the control which is used for the accessibility objects. */
+ ::rtl::OUString GetDescription() const;
+
+ /** Returns true, if the window is empty. */
+ inline bool IsEmpty() const { return maFields.empty(); }
+ /** Returns the number of existing fields. */
+ inline size_t GetFieldCount() const { return maFields.size(); }
+ /** Returns the text of an existing field. */
+ ::rtl::OUString GetFieldText( size_t nFieldIndex ) const;
+
+ /** Returns the index of a field with the specified column identifier. */
+ ScPivotFuncDataEntry FindFuncDataByCol( SCCOL nCol ) const;
+
+ /** Returns the pixel size of a field. */
+ inline const Size& GetFieldSize() const { return maFieldSize; }
+ /** Returns the pixel position of a field (without bound check). */
+ Point GetFieldPosition( size_t nFieldIndex ) const;
+ /** Calculates the field index at a specific pixel position. */
+ size_t GetFieldIndex( const Point& rWindowPos ) const;
+ /** Calculates the field insertion index for mouse drop at a specific pixel position. */
+ size_t GetDropIndex( const Point& rWindowPos ) const;
+
+ /** Returns the index of the selected field. */
+ inline size_t GetSelectedIndex() const { return mnSelectIndex; }
+ /** Grabs focus and sets the passed selection. */
+ void GrabFocusAndSelect( size_t nIndex );
+ /** Selects the next field. */
+ void SelectNextField();
+
+ /** Inserts a new field in front of the specified field. */
+ void InsertField( size_t nInsertIndex, const ScPivotFuncData& rFuncData );
+ /** Removes the specified field. */
+ bool RemoveField( size_t nRemoveIndex );
+ /** Moves the specified field to a new position. */
+ bool MoveField( size_t nFieldIndex, size_t nInsertIndex );
+
+ /** Returns the selected field (pointer is valid as long as field vector is not changed). */
+ const ScPivotFuncData* GetSelectedFuncData() const;
+ /** Removes the selected field. */
+ void ModifySelectedField( const ScPivotFuncData& rFuncData );
+ /** Removes the selected field. */
+ bool RemoveSelectedField();
+ /** Moves the selected field in front of the specified field. */
+ bool MoveSelectedField( size_t nInsertIndex );
+
+ /** Called from dialog when tracking starts in this field window. */
+ void NotifyStartTracking();
+ /** Called from dialog while tracking in this field window. */
+ void NotifyTracking( const Point& rWindowPos );
+ /** Called from dialog when tracking ends in this field window. */
+ void NotifyEndTracking( ScPivotFieldEndTracking eEndType );
+
+protected:
+ virtual void Paint( const Rectangle& rRect );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreateAccessible();
+
private:
- typedef ::std::pair< String, bool > FieldString; // true = text fits into button
-
- String aName; /// name of the control, used in Accessibility
- ScDPLayoutDlg* pDlg; /// Parent dialog.
- Rectangle aWndRect; /// Area rectangle in pixels.
- FixedText* pFtCaption; /// FixedText containing the name of the control.
- Point aTextPos; /// Position of the caption text.
- std::vector< FieldString > aFieldArr; /// String array of the field names and flags, if text fits into button.
- ScDPFieldType eType; /// Type of this area.
- Color aFaceColor; /// Color for dialog background.
- Color aWinColor; /// Color for window background.
- Color aTextColor; /// Color for text in buttons.
- Color aWinTextColor; /// Color for text in field windows.
- size_t nFieldSize; /// Maximum count of fields.
- size_t nFieldSelected; /// Currently selected field.
-
- com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAccessible;
- ScAccessibleDataPilotControl* pAccessible;
-
- /** Initilize the object. */
- void Init();
-
- /** Reads all needed style settings. */
- void GetStyleSettings();
+ /** A structure containing all data needed for a field in this window. */
+ struct ScPivotWindowField
+ {
+ ScPivotFuncData maFuncData; /// Field data from source pivot table.
+ ::rtl::OUString maFieldName; /// Name displayed on the field button.
+ bool mbClipped; /// True = field text does not fit into button.
+ explicit ScPivotWindowField( const ScDPLabelData& rLabelData );
+ explicit ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotField& rField, bool bDataWindow );
+ explicit ScPivotWindowField( ScPivotLayoutDlg& rDialog, const ScPivotFuncData& rFuncData, bool bDataWindow );
+ void InitFieldName( ScPivotLayoutDlg& rDialog, bool bDataWindow );
+ };
+
+ /** Specifies how the selection cursor can move in the window. */
+ enum MoveType { PREV_FIELD, NEXT_FIELD, PREV_LINE, NEXT_LINE, PREV_PAGE, NEXT_PAGE, FIRST_FIELD, LAST_FIELD };
+
+ /** Calculates a scroll position to make the passed field visible. Tries to
+ stick to current scroll position if possible. */
+ size_t RecalcVisibleIndex( size_t nSelectIndex ) const;
+
+ /** Sets selection to the specified field and changes scrolling position. */
+ void SetSelectionUnchecked( size_t nSelectIndex, size_t nFirstVisIndex );
+ /** Selects a field and adjusts scrolling position to make the field visible. */
+ void MoveSelection( size_t nSelectIndex );
+ /** Sets selection to a new position relative to current. */
+ void MoveSelection( MoveType eMoveType );
+ /** Moves the selected field to a new position relative to current. */
+ void MoveSelectedField( MoveType eMoveType );
+
+ /** Inserts the passed field into the vector and notifies accessibility object. */
+ void InsertFieldUnchecked( size_t nInsertIndex, const ScPivotWindowField& rField );
+ /** Removes the specified field from the vector and notifies accessibility object. */
+ void RemoveFieldUnchecked( size_t nRemoveIndex );
/** Draws the background. */
- void DrawBackground( OutputDevice& rDev );
- /** Draws a field into the specified rectangle. */
- void DrawField(
- OutputDevice& rDev,
- const Rectangle& rRect,
- FieldString& rText,
- bool bFocus );
-
- /** @return sal_True, if the field index is inside of the control area. */
- bool IsValidIndex( size_t nIndex ) const;
- /** @return sal_True, if the field with the given index exists. */
- bool IsExistingIndex( size_t nIndex ) const;
- /** @return sal_True, if the field with the given index exists and the text is
- too long for the button control. */
- bool IsShortenedText( size_t nIndex ) const;
- /** @return The new selection index after moving to the given direction. */
- size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const;
-
- /** Sets selection to the field with index nIndex. */
- void SetSelection( size_t nIndex );
- /** Sets selection to first field. */
- void SetSelectionHome();
- /** Sets selection to last field. */
- void SetSelectionEnd();
- /** Sets selection to new position relative to current. */
- void MoveSelection( sal_uInt16 nKeyCode, SCsCOL nDX, SCsROW nDY );
-
- /** Moves the selected field to nDestIndex. */
- void MoveField( size_t nDestIndex );
- /** Moves the selected field to the given direction. */
- void MoveFieldRel( SCsCOL nDX, SCsROW nDY );
-
- /** Updates the tab stop style bits. */
- void UpdateStyle();
+ void DrawBackground( OutputDevice& rDev );
+ /** Draws the specified field. */
+ void DrawField( OutputDevice& rDev, size_t nFieldIndex );
+ /** Draws the insertion cursor. */
+ void DrawInsertionCursor( OutputDevice& rDev );
-protected:
- virtual void Paint( const Rectangle& rRect );
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void MouseButtonDown( const MouseEvent& rMEvt );
- virtual void MouseButtonUp( const MouseEvent& rMEvt );
- virtual void MouseMove( const MouseEvent& rMEvt );
- virtual void KeyInput( const KeyEvent& rKEvt );
- virtual void GetFocus();
- virtual void LoseFocus();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+ /** Returns a reference to the accessiblity object, if still alive. */
+ ::rtl::Reference< ScAccessibleDataPilotControl > GetAccessibleControl();
-public:
- ScDPFieldWindow(
- ScDPLayoutDlg* pDialog,
- const ResId& rResId,
- ScDPFieldType eFieldType,
- FixedText* pFtFieldCaption );
- ScDPFieldWindow(
- ScDPLayoutDlg* pDialog,
- const ResId& rResId,
- ScDPFieldType eFieldType,
- const String& aName );
- virtual ~ScDPFieldWindow();
-
- /** Reads the FixedText's text with mnemonic and hides the FixedText. */
- void UseMnemonic();
-
- /** Draws the complete control. */
- void Redraw();
-
- /** @return The pixel position of a field (without bound check). */
- Point GetFieldPosition( size_t nIndex ) const;
- /** @return The pixel size of a field. */
- Size GetFieldSize() const;
-
- /** @return The index of the selected field. */
- inline bool IsEmpty() const { return aFieldArr.empty(); }
- /** @return The index of the selected field. */
- inline size_t GetSelectedField() const { return nFieldSelected; }
- /** @return The pixel position of the last possible field. */
- Point GetLastPosition() const;
-
- /** @return The count of existing fields. */
- inline size_t GetFieldCount() const { return aFieldArr.size(); }
- /** Inserts a field to the specified index. */
- void AddField( const String& rText, size_t nNewIndex );
- /** Removes a field from the specified index. */
- void DelField( size_t nDelIndex );
- /** Removes all fields. */
- void ClearFields();
- /** Changes the text on an existing field. */
- void SetFieldText( const String& rText, size_t nIndex );
- /** Returns the text of an existing field. */
- const String& GetFieldText( size_t nIndex ) const;
-
- /** Inserts a field using the specified pixel position.
- @param rPos The coordinates to insert the field.
- @param rnIndex The new index of the field is returned here.
- @return sal_True, if the field has been created. */
- bool AddField( const String& rText, const Point& rPos, size_t& rnIndex );
- /** Calculates the field index at a specific pixel position.
- @param rnIndex The index of the field is returned here.
- @return sal_True, if the index value is valid. */
- bool GetFieldIndex( const Point& rPos, size_t& rnIndex ) const;
- /** Calculates a field index at a specific pixel position. Returns in every
- case the index of an existing field.
- @param rnIndex The index of the field is returned here.
- @return sal_True, if the index value is valid. */
- void GetExistingIndex( const Point& rPos, size_t& rnIndex );
-
- /** Notifies this control that the offset of the first field has been changed.
- The control has to adjust the selection to keep the same field selected
- on scrolling with scrollbar. */
- void ModifySelectionOffset( long nOffsetDiff );
- /** Selects the next field. Called i.e. after moving a field from SELECT area. */
- void SelectNext();
-
- /** @return The name of the control without shortcut. */
- inline String GetName() const { return aName; }
-
- /** @return The description of the control which is used for the accessibility objects. */
- String GetDescription() const;
-
- /** Grabs focus and sets new selection. */
- void GrabFocusWithSel( size_t nIndex );
-
- /** @return The type of the FieldWindow. */
- inline ScDPFieldType GetType() const { return eType; }
+ DECL_LINK( ScrollHdl, ScrollBar* );
+
+private:
+ typedef ::std::vector< ScPivotWindowField > ScPivotWindowFieldVector;
+
+ ScPivotLayoutDlg* mpDialog; /// Parent pivot table dialog.
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible >
+ mxAccessible; /// Weak reference to the accessible object.
+ ScAccessibleDataPilotControl*
+ mpAccessible; /// Pointer to the accessible implementation.
+ ScrollBar& mrScrollBar; /// Scrollbar of the select window.
+ FixedText* mpFtCaption; /// Associated fixedtext control with caption text and mnemonic.
+ ::rtl::OUString maName; /// Name of the control, used for accessibility.
+ ScPivotWindowFieldVector maFields; /// Vector with all fields contained in this window.
+ Size maFieldSize; /// Size of a single field in pixels.
+ Size maSpaceSize; /// Size between fields in pixels.
+ ScPivotFieldType meFieldType; /// Type of this field window.
+ PointerStyle meDropPointer; /// Mouse pointer style for tracking over this window.
+ size_t mnColCount; /// Number of field columns.
+ size_t mnRowCount; /// Number of field rows.
+ size_t mnLineSize; /// Number of fields per line (depending on scrolling orientation).
+ size_t mnPageSize; /// Number of visible fields.
+ size_t mnFirstVisIndex; /// Index of first visible field (scrolling offset).
+ size_t mnSelectIndex; /// Currently selected field.
+ size_t mnInsCursorIndex; /// Position of the insertion cursor.
+ size_t mnOldFirstVisIndex; /// Stores original scroll position during auto scrolling.
+ size_t mnAutoScrollDelay; /// Initial counter before auto scrolling starts on tracking.
+ bool mbVertical; /// True = sort fields vertically.
+ bool mbIsTrackingSource; /// True = this field window is the source while tracking.
};
-//===================================================================
+// ============================================================================
-#endif // SC_FIELDWND_HXX
+#endif
diff --git a/sc/source/ui/inc/filldlg.hxx b/sc/source/ui/inc/filldlg.hxx
index 2bdc42b90881..49173487ef56 100644
--- a/sc/source/ui/inc/filldlg.hxx
+++ b/sc/source/ui/inc/filldlg.hxx
@@ -79,6 +79,15 @@ public:
void SetEdStartValEnabled(sal_Bool bFlag=sal_False);
private:
+ FixedText aFtStartVal;
+ Edit aEdStartVal;
+ String aStartStrVal;
+
+ FixedText aFtEndVal;
+ Edit aEdEndVal;
+
+ FixedText aFtIncrement;
+ Edit aEdIncrement;
FixedLine aFlDirection;
RadioButton aBtnDown;
RadioButton aBtnRight;
@@ -98,17 +107,7 @@ private:
RadioButton aBtnDayOfWeek;
RadioButton aBtnMonth;
RadioButton aBtnYear;
-
- sal_Bool bStartValFlag;
- FixedText aFtStartVal;
- Edit aEdStartVal;
- String aStartStrVal;
-
- FixedText aFtEndVal;
- Edit aEdEndVal;
-
- FixedText aFtIncrement;
- Edit aEdIncrement;
+ sal_Bool bStartValFlag;
OKButton aBtnOk;
CancelButton aBtnCancel;
diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx
index 885a5b68e7e2..16cad04b60b8 100644
--- a/sc/source/ui/inc/filtdlg.hxx
+++ b/sc/source/ui/inc/filtdlg.hxx
@@ -216,8 +216,8 @@ public:
virtual sal_Bool Close();
private:
- ListBox aLbFilterArea;
FixedText aFtFilterArea;
+ ListBox aLbFilterArea;
formula::RefEdit aEdFilterArea;
formula::RefButton aRbFilterArea;
diff --git a/sc/source/ui/inc/filter.hrc b/sc/source/ui/inc/filter.hrc
index 508c5af9aab5..f62c4d5e015e 100644
--- a/sc/source/ui/inc/filter.hrc
+++ b/sc/source/ui/inc/filter.hrc
@@ -80,3 +80,10 @@
#define ED_CRITERIA_AREA 52
#define RB_CRITERIA_AREA 53
+//IAccessibility2 Implementation 2009-----
+#define STR_COPY_AREA_TO 5054
+#define RID_FILTER_OPERATOR 5055
+#define RID_FILTER_FIELDNAME 5056
+#define RID_FILTER_CONDITION 5057
+#define RID_FILTER_VALUE 5058
+//-----IAccessibility2 Implementation 2009
diff --git a/sc/source/ui/inc/imoptdlg.hxx b/sc/source/ui/inc/imoptdlg.hxx
index eba954ee76ea..31a6569b9dd1 100644
--- a/sc/source/ui/inc/imoptdlg.hxx
+++ b/sc/source/ui/inc/imoptdlg.hxx
@@ -45,18 +45,18 @@ public:
ScImportOptions()
: nFieldSepCode(0), nTextSepCode(0),
eCharSet(RTL_TEXTENCODING_DONTKNOW), bFixedWidth(sal_False),
- bSaveAsShown(sal_False)
+ bSaveAsShown(sal_False), bQuoteAllText(sal_False)
{}
ScImportOptions( const String& rStr );
ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, const String& rStr )
: nFieldSepCode(nFieldSep), nTextSepCode(nTextSep), aStrFont(rStr),
- bFixedWidth(sal_False), bSaveAsShown(sal_False)
+ bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
{ eCharSet = ScGlobal::GetCharsetValue(aStrFont); }
ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, rtl_TextEncoding nEnc )
: nFieldSepCode(nFieldSep), nTextSepCode(nTextSep),
- bFixedWidth(sal_False), bSaveAsShown(sal_False)
+ bFixedWidth(sal_False), bSaveAsShown(sal_False), bQuoteAllText(sal_False)
{ SetTextEncoding( nEnc ); }
ScImportOptions( const ScImportOptions& rCpy )
@@ -65,7 +65,8 @@ public:
aStrFont (rCpy.aStrFont),
eCharSet (rCpy.eCharSet),
bFixedWidth (rCpy.bFixedWidth),
- bSaveAsShown (rCpy.bSaveAsShown)
+ bSaveAsShown (rCpy.bSaveAsShown),
+ bQuoteAllText (rCpy.bQuoteAllText)
{}
ScImportOptions& operator=( const ScImportOptions& rCpy )
@@ -76,6 +77,7 @@ public:
eCharSet = rCpy.eCharSet;
bFixedWidth = rCpy.bFixedWidth;
bSaveAsShown = rCpy.bSaveAsShown;
+ bQuoteAllText = rCpy.bQuoteAllText;
return *this;
}
@@ -87,7 +89,8 @@ public:
&& eCharSet == rCmp.eCharSet
&& aStrFont == rCmp.aStrFont
&& bFixedWidth == rCmp.bFixedWidth
- && bSaveAsShown == rCmp.bSaveAsShown;
+ && bSaveAsShown == rCmp.bSaveAsShown
+ && bQuoteAllText == rCmp.bQuoteAllText;
}
String BuildString() const;
@@ -97,8 +100,9 @@ public:
sal_Unicode nTextSepCode;
String aStrFont;
CharSet eCharSet;
- sal_Bool bFixedWidth;
- sal_Bool bSaveAsShown;
+ sal_Bool bFixedWidth;
+ sal_Bool bSaveAsShown;
+ sal_Bool bQuoteAllText;
};
diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index 73e07f0d79fc..ba738b3eea86 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -83,9 +83,10 @@ public:
SCTAB GetTableCount() { return nTableCount;}
private:
+ FixedLine aFlPos;
RadioButton aBtnBefore;
RadioButton aBtnBehind;
- FixedLine aFlPos;
+ FixedLine aFlTable;
RadioButton aBtnNew;
RadioButton aBtnFromFile;
FixedText aFtCount;
@@ -96,7 +97,6 @@ private:
ScExpandedFixedText aFtPath;
PushButton aBtnBrowse;
CheckBox aBtnLink;
- FixedLine aFlTable;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index cd691211dbfb..4e2b64f33f42 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -31,21 +31,11 @@
#include <com/sun/star/sheet/DataPilotFieldReference.hpp>
#include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
-#ifndef _FIXED_HXX
#include <vcl/fixed.hxx>
-#endif
-#ifndef _LSTBOX_HXX
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _DIALOG_HXX
#include <vcl/dialog.hxx>
-#endif
-#ifndef _BUTTON_HXX
#include <vcl/button.hxx>
-#endif
-#ifndef _MOREBTN_HXX
#include <vcl/morebtn.hxx>
-#endif
#include <vcl/field.hxx>
#include <svtools/stdctrl.hxx>
#include <svx/checklbx.hxx>
@@ -79,14 +69,14 @@ private:
class ScDPFunctionDlg : public ModalDialog
{
public:
- explicit ScDPFunctionDlg( Window* pParent, const ScDPLabelDataVec& rLabelVec,
- const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData );
+ explicit ScDPFunctionDlg( Window* pParent, const ScDPLabelDataVector& rLabelVec,
+ const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
sal_uInt16 GetFuncMask() const;
::com::sun::star::sheet::DataPilotFieldReference GetFieldRef() const;
private:
- void Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData );
+ void Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
DECL_LINK( SelectHdl, ListBox* );
DECL_LINK( DblClickHdl, MultiListBox* );
@@ -110,7 +100,7 @@ private:
ScDPListBoxWrapper maLbTypeWrp; /// Wrapper for direct usage of API constants.
- const ScDPLabelDataVec& mrLabelVec; /// Data of all labels.
+ const ScDPLabelDataVector& mrLabelVec; /// Data of all labels.
bool mbEmptyItem; /// true = Empty base item in listbox.
};
@@ -120,7 +110,7 @@ class ScDPSubtotalDlg : public ModalDialog
{
public:
explicit ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj,
- const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData,
+ const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData,
const ScDPNameVec& rDataFields, bool bEnableLayout );
sal_uInt16 GetFuncMask() const;
@@ -128,7 +118,7 @@ public:
void FillLabelData( ScDPLabelData& rLabelData ) const;
private:
- void Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData );
+ void Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
DECL_LINK( DblClickHdl, MultiListBox* );
DECL_LINK( RadioClickHdl, RadioButton* );
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index 45eef2f364fb..d6f12e8c5d49 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -28,212 +28,135 @@
#ifndef SC_PVLAYDLG_HXX
#define SC_PVLAYDLG_HXX
-#include <vector>
#include <memory>
-#include <boost/shared_ptr.hpp>
+#include <vector>
-#ifndef _LSTBOX_HXX //autogen
-#include <vcl/lstbox.hxx>
-#endif
-#ifndef _SCRBAR_HXX //autogen
-#include <vcl/scrbar.hxx>
-#endif
+#include <formula/funcutl.hxx>
#include <svtools/stdctrl.hxx>
-#ifndef _MOREBTN_HXX //autogen
+#include <vcl/lstbox.hxx>
#include <vcl/morebtn.hxx>
-#endif
-#include "pivot.hxx"
+#include <vcl/scrbar.hxx>
+
#include "anyrefdg.hxx"
#include "fieldwnd.hxx"
-#include "formula/funcutl.hxx"
-
-/*==========================================================================*\
-
- Eine Instanz der Klasse ScPivotLayoutDlg ist ein (semi-)modaler
- Dialog, in dem mit der Maus Felder mit Spaltenueberschriften den
- drei Pivot-Kategorien "Spalte", "Zeile" und "Daten" zugeordnet
- werden koennen.
- Der Dialog erhaelt in der Struktur LabelData Informationen ueber
- diese Ueberschriften (Name, Art (Zahl/String) und Funktionsmaske).
- Weiterhin werden drei PivotFeld-Arrays uebergeben, mit denen die
- drei Kategorie-Fenster initialisiert werden. Ein Kategorie-Fenster
- wird durch eine Instanz der Klasse FieldWindow dargestellt. Ein
- solches Fenster ist fuer die Darstellung der Datenstrukturen am
- Schirm zustaendig. Es meldet Mausaktionen an den Dialog weiter und
- bietet entsprechende Methoden zur Veraenderung der Darstellung.
- Der Dialog sorgt fuer den Abgleich der interenen Datenstrukturen mit
- der Bildschirmdarstellung. Ein weiteres FieldWindow (Select) bietet
- alle Tabellenueberschriften zur Auswahl an, ist also "read-only".
-
-\*==========================================================================*/
-
-//============================================================================
+// ============================================================================
class ScViewData;
class ScDocument;
class ScRangeData;
-struct ScDPFuncData;
class ScDPObject;
-//============================================================================
-
-#define FUNC_COUNT 11
+// ============================================================================
-class ScDPLayoutDlg : public ScAnyRefDlg
+class ScPivotLayoutDlg : public ScAnyRefDlg
{
public:
- ScDPLayoutDlg(
- SfxBindings* pB,
- SfxChildWindow* pCW,
- Window* pParent,
- const ScDPObject& rDPObject );
- virtual ~ScDPLayoutDlg();
-
- virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
- virtual sal_Bool IsRefInputMode() const { return bRefInputMode; }
- virtual void SetActive();
- virtual sal_Bool Close();
- virtual void StateChanged( StateChangedType nStateChange );
-
- void NotifyDoubleClick ( ScDPFieldType eType, size_t nFieldIndex );
- PointerStyle NotifyMouseButtonDown( ScDPFieldType eType, size_t nFieldIndex );
- void NotifyMouseButtonUp ( const Point& rAt );
- PointerStyle NotifyMouseMove ( const Point& rAt );
- void NotifyFieldFocus ( ScDPFieldType eType, sal_Bool bGotFocus );
- void NotifyMoveField ( ScDPFieldType eToType );
- void NotifyRemoveField ( ScDPFieldType eType, size_t nFieldIndex );
- sal_Bool NotifyMoveSlider ( sal_uInt16 nKeyCode ); // return sal_True, if position changed
+ ScPivotLayoutDlg(
+ SfxBindings* pB,
+ SfxChildWindow* pCW,
+ Window* pParent,
+ const ScDPObject& rDPObject );
+ virtual ~ScPivotLayoutDlg();
+
+ ScDPLabelData* GetLabelData( SCCOL nCol, size_t* pnIndex = 0 );
+ String GetFuncString( sal_uInt16& rnFuncMask, bool bIsValue = true );
+
+ void NotifyStartTracking( ScPivotFieldWindow& rSourceWindow );
+ void NotifyDoubleClick( ScPivotFieldWindow& rSourceWindow );
+ void NotifyFieldRemoved( ScPivotFieldWindow& rSourceWindow );
protected:
- virtual void Deactivate();
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
+ virtual sal_Bool IsRefInputMode() const;
+ virtual void SetActive();
+ virtual sal_Bool Close();
private:
- typedef boost::shared_ptr< ScDPFuncData > ScDPFuncDataRef;
- typedef std::vector< ScDPFuncDataRef > ScDPFuncDataVec;
- typedef std::auto_ptr< ScDPObject > ScDPObjectPtr;
-
- FixedLine aFlLayout;
- FixedText aFtPage;
- ScDPFieldWindow aWndPage;
- FixedText aFtCol;
- ScDPFieldWindow aWndCol;
- FixedText aFtRow;
- ScDPFieldWindow aWndRow;
- FixedText aFtData;
- ScDPFieldWindow aWndData;
- ScDPFieldWindow aWndSelect;
- ScrollBar aSlider;
- FixedInfo aFtInfo;
-
- FixedLine aFlAreas;
-
- // DP source selection
- FixedText aFtInArea;
- ::formula::RefEdit aEdInPos;
- ::formula::RefButton aRbInPos;
-
- // DP output location
- ListBox aLbOutPos;
- FixedText aFtOutArea;
- formula::RefEdit aEdOutPos;
- formula::RefButton aRbOutPos;
-
- CheckBox aBtnIgnEmptyRows;
- CheckBox aBtnDetectCat;
- CheckBox aBtnTotalCol;
- CheckBox aBtnTotalRow;
- CheckBox aBtnFilter;
- CheckBox aBtnDrillDown;
-
- OKButton aBtnOk;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
- PushButton aBtnRemove;
- PushButton aBtnOptions;
- MoreButton aBtnMore;
-
- const String aStrUndefined;
- const String aStrNewTable;
- std::vector< String > aFuncNameArr;
-
- ScDPFieldType eDnDFromType;
- size_t nDnDFromIndex;
- sal_Bool bIsDrag;
-
- ::formula::RefEdit* pEditActive;
-
- Rectangle aRectPage;
- Rectangle aRectRow;
- Rectangle aRectCol;
- Rectangle aRectData;
- Rectangle aRectSelect;
-
- ScDPLabelDataVec aLabelDataArr; // (nCol, Feldname, Zahl/Text)
-
- ScDPFieldType eLastActiveType; /// Type of last active area.
- size_t nOffset; /// Offset of first field in TYPE_SELECT area.
-
- ScDPFuncDataVec aSelectArr;
- ScDPFuncDataVec aPageArr;
- ScDPFuncDataVec aColArr;
- ScDPFuncDataVec aRowArr;
- ScDPFuncDataVec aDataArr;
-
- ScDPObjectPtr xDlgDPObject;
- ScRange aOldRange;
- ScPivotParam thePivotData;
- ScViewData* pViewData;
- ScDocument* pDoc;
- sal_Bool bRefInputMode;
+ /** Returns the localized function name for the specified (1-based) resource index. */
+ inline const String& GetFuncName( sal_uInt16 nFuncIdx ) const { return maFuncNames[ nFuncIdx - 1 ]; }
+ /** Returns the specified field window. */
+ ScPivotFieldWindow& GetFieldWindow( ScPivotFieldType eFieldType );
-private:
- ScDPFieldWindow& GetFieldWindow ( ScDPFieldType eType );
- void Init ();
- void InitWndSelect ( const ::std::vector<ScDPLabelDataRef>& rLabels );
- void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType );
- void InitFocus ();
- void InitFields ();
- void CalcWndSizes ();
- Point DlgPos2WndPos ( const Point& rPt, Window& rWnd );
- ScDPLabelData* GetLabelData ( SCsCOL nCol, size_t* pPos = NULL );
- String GetLabelString ( SCsCOL nCol );
- bool IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType );
- String GetFuncString ( sal_uInt16& rFuncMask, sal_Bool bIsValue = sal_True );
- sal_Bool Contains ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt );
- void Remove ( ScDPFuncDataVec* pArr, size_t nAt );
- void Insert ( ScDPFuncDataVec* pArr, const ScDPFuncData& rFData, size_t nAt );
-
- void AddField ( size_t nFromIndex,
- ScDPFieldType eToType, const Point& rAtPos );
- void MoveField ( ScDPFieldType eFromType, size_t nFromIndex,
- ScDPFieldType eToType, const Point& rAtPos );
- void RemoveField ( ScDPFieldType eRemType, size_t nRemIndex );
-
- sal_Bool GetPivotArrays ( PivotField* pPageArr,
- PivotField* pColArr,
- PivotField* pRowArr,
- PivotField* pDataArr,
- sal_uInt16& rPageCount,
- sal_uInt16& rColCount,
- sal_uInt16& rRowCount,
- sal_uInt16& rDataCount );
-
- void UpdateSrcRange();
+ /** Fills the field windows from the current pivot table settings. */
+ void InitFieldWindows();
+ /** Sets focus to the specified field window, if it is not empty. */
+ void GrabFieldFocus( ScPivotFieldWindow& rFieldWindow );
+
+ /** Returns true, if the specified field can be inserted into the specified field window. */
+ bool IsInsertAllowed( const ScPivotFieldWindow& rSourceWindow, const ScPivotFieldWindow& rTargetWindow );
+ /** Moves the selected field in the source window to the specified window. */
+ bool MoveField( ScPivotFieldWindow& rSourceWindow, ScPivotFieldWindow& rTargetWindow, size_t nInsertIndex, bool bMoveExisting );
// Handler
DECL_LINK( ClickHdl, PushButton * );
- DECL_LINK( ScrollHdl, ScrollBar * );
- DECL_LINK( SelAreaHdl, ListBox * );
- DECL_LINK( MoreClickHdl, MoreButton * );
- DECL_LINK( EdModifyHdl, Edit * );
- DECL_LINK( EdInModifyHdl, Edit * );
DECL_LINK( OkHdl, OKButton * );
DECL_LINK( CancelHdl, CancelButton * );
- DECL_LINK( GetFocusHdl, Control* );
-};
-
+ DECL_LINK( MoreClickHdl, MoreButton * );
+ DECL_LINK( EdOutModifyHdl, Edit * );
+ DECL_LINK( EdInModifyHdl, Edit * );
+ DECL_LINK( SelAreaHdl, ListBox * );
+ DECL_LINK( ChildEventListener, VclWindowEvent* );
+private:
+ typedef ::std::auto_ptr< ScDPObject > ScDPObjectPtr;
+
+ FixedLine maFlLayout;
+ ScrollBar maScrPage;
+ FixedText maFtPage;
+ ScPivotFieldWindow maWndPage;
+ ScrollBar maScrCol;
+ FixedText maFtCol;
+ ScPivotFieldWindow maWndCol;
+ ScrollBar maScrRow;
+ FixedText maFtRow;
+ ScPivotFieldWindow maWndRow;
+ ScrollBar maScrData;
+ FixedText maFtData;
+ ScPivotFieldWindow maWndData;
+ FixedLine maFlSelect;
+ ScrollBar maScrSelect;
+ ScPivotFieldWindow maWndSelect;
+ FixedInfo maFtInfo;
+
+ FixedLine maFlAreas;
+ FixedText maFtInArea;
+ ::formula::RefEdit maEdInPos;
+ ::formula::RefButton maRbInPos;
+ ListBox maLbOutPos;
+ FixedText maFtOutArea;
+ formula::RefEdit maEdOutPos;
+ formula::RefButton maRbOutPos;
+ CheckBox maBtnIgnEmptyRows;
+ CheckBox maBtnDetectCat;
+ CheckBox maBtnTotalCol;
+ CheckBox maBtnTotalRow;
+ CheckBox maBtnFilter;
+ CheckBox maBtnDrillDown;
+
+ OKButton maBtnOk;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+ PushButton maBtnRemove;
+ PushButton maBtnOptions;
+ MoreButton maBtnMore;
+
+ ::std::vector< String > maFuncNames; /// Localized function names from resource.
+
+ ScDPObjectPtr mxDlgDPObject; /// Clone of the pivot table object this dialog is based on.
+ ScPivotParam maPivotData; /// The pivot table field configuration.
+ ScDPLabelDataVector maLabelData; /// Information about all dimensions.
+
+ ScViewData* mpViewData;
+ ScDocument* mpDoc;
+ ScPivotFieldWindow* mpFocusWindow; /// Pointer to the field window that currently has the focus.
+ ScPivotFieldWindow* mpTrackingWindow; /// Pointer to the field window that has started mouse tracking.
+ ScPivotFieldWindow* mpDropWindow; /// Pointer to the field window that shows an insertion cursor.
+ ::formula::RefEdit* mpActiveEdit;
+ bool mbRefInputMode;
+};
-#endif // SC_PVLAYDLG_HXX
+// ============================================================================
+#endif
diff --git a/sc/source/ui/inc/scuiimoptdlg.hxx b/sc/source/ui/inc/scuiimoptdlg.hxx
index 5b92f31baa51..08215d99e98d 100644
--- a/sc/source/ui/inc/scuiimoptdlg.hxx
+++ b/sc/source/ui/inc/scuiimoptdlg.hxx
@@ -58,11 +58,12 @@ private:
ComboBox aEdFieldSep;
FixedText aFtTextSep;
ComboBox aEdTextSep;
+ CheckBox aCbQuoteAll;
+ CheckBox aCbShown;
CheckBox aCbFixed;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
- CheckBox aCbShown;
ScDelimiterTable* pFieldSepTab;
ScDelimiterTable* pTextSepTab;
diff --git a/sc/source/ui/inc/shtabdlg.hxx b/sc/source/ui/inc/shtabdlg.hxx
index 6da486588cee..07801cb9bba6 100644
--- a/sc/source/ui/inc/shtabdlg.hxx
+++ b/sc/source/ui/inc/shtabdlg.hxx
@@ -44,11 +44,11 @@
class ScShowTabDlg : public ModalDialog
{
private:
+ FixedText aFtLbTitle;
::svtools::ToolTipMultiListBox aLb;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
- FixedText aFtLbTitle;
DECL_LINK( DblClkHdl, void * );
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 1f8dab142c8f..2acd7003556a 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -114,6 +114,9 @@ ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB,
xRowNameRanges = pDoc->GetRowNameRanges()->Clone();
Init();
FreeResource();
+
+ aRbAssign.SetAccessibleRelationMemberOf(&aEdAssign);
+ aRbAssign2.SetAccessibleRelationMemberOf(&aEdAssign);
}
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 67584198bce8..042dbc175f07 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -65,6 +65,16 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent,
: ModalDialog ( pParent, ScResId( RID_SCDLG_FILLSERIES ) ),
+ aFtStartVal ( this, ScResId( FT_START_VALUE ) ),
+ aEdStartVal ( this, ScResId( ED_START_VALUES ) ),
+ aStartStrVal ( aStartStr),
+
+ aFtEndVal ( this, ScResId( FT_END_VALUE ) ),
+ aEdEndVal ( this, ScResId( ED_END_VALUES ) ),
+
+ aFtIncrement ( this, ScResId( FT_INCREMENT ) ),
+ aEdIncrement ( this, ScResId( ED_INCREMENT ) ),
+
aFlDirection ( this, ScResId( FL_DIRECTION ) ),
aBtnDown ( this, ScResId( BTN_BOTTOM ) ),
aBtnRight ( this, ScResId( BTN_RIGHT ) ),
@@ -83,14 +93,6 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent,
aBtnMonth ( this, ScResId( BTN_MONTH ) ),
aBtnYear ( this, ScResId( BTN_YEAR ) ),
- aFtStartVal ( this, ScResId( FT_START_VALUE ) ),
- aEdStartVal ( this, ScResId( ED_START_VALUES ) ),
- aStartStrVal ( aStartStr),
- aFtEndVal ( this, ScResId( FT_END_VALUE ) ),
- aEdEndVal ( this, ScResId( ED_END_VALUES ) ),
- aFtIncrement ( this, ScResId( FT_INCREMENT ) ),
- aEdIncrement ( this, ScResId( ED_INCREMENT ) ),
-
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx
index 05c807b8e1f4..0b0a4de9f985 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -110,6 +110,7 @@ ScHighlightChgDlg::ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Wind
Init();
}
+
ScHighlightChgDlg::~ScHighlightChgDlg()
{
SetDispatcherLock( sal_False );
diff --git a/sc/source/ui/miscdlgs/highred.src b/sc/source/ui/miscdlgs/highred.src
index dd32eb9b4012..3fa4a62fcd17 100644
--- a/sc/source/ui/miscdlgs/highred.src
+++ b/sc/source/ui/miscdlgs/highred.src
@@ -100,7 +100,7 @@ ModelessDialog RID_SCDLG_HIGHLIGHT_CHANGES
Hide = TRUE ;
Pos = MAP_APPFONT ( 142 , 118 ) ;
Size = MAP_APPFONT ( 13 , 15 ) ;
- TabStop = FALSE ;
+ TabStop = TRUE;
QuickHelpText [ en-US ] = "Minimize/Maximize" ;
};
Text [ en-US ] = "Show Changes" ;
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index a4dd2dea32bd..be425ee51bec 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -69,9 +69,10 @@ ScInsertTableDlg::ScInsertTableDlg( Window* pParent, ScViewData& rData, SCTAB nT
: ModalDialog ( pParent, ScResId( RID_SCDLG_INSERT_TABLE ) ),
//
+ aFlPos ( this, ScResId( FL_POSITION ) ),
aBtnBefore ( this, ScResId( RB_BEFORE ) ),
aBtnBehind ( this, ScResId( RB_BEHIND ) ),
- aFlPos ( this, ScResId( FL_POSITION ) ),
+ aFlTable ( this, ScResId( FL_TABLE ) ),
aBtnNew ( this, ScResId( RB_NEW ) ),
aBtnFromFile ( this, ScResId( RB_FROMFILE ) ),
aFtCount ( this, ScResId( FT_COUNT ) ),
@@ -82,7 +83,6 @@ ScInsertTableDlg::ScInsertTableDlg( Window* pParent, ScViewData& rData, SCTAB nT
aFtPath ( this, ScResId( FT_PATH ) ),
aBtnBrowse ( this, ScResId( BTN_BROWSE ) ),
aBtnLink ( this, ScResId( CB_LINK ) ),
- aFlTable ( this, ScResId( FL_TABLE ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
@@ -100,6 +100,7 @@ ScInsertTableDlg::ScInsertTableDlg( Window* pParent, ScViewData& rData, SCTAB nT
#endif /* ENABLE_LAYOUT */
Init_Impl( bFromFile );
FreeResource();
+ aLbTables.SetAccessibleName(aBtnFromFile.GetText());
}
//------------------------------------------------------------------------
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 9d629bec38e3..3ba5b2952cf1 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -82,6 +82,9 @@ ScLinkedAreaDlg::ScLinkedAreaDlg( Window* pParent ) :
aLbRanges.SetSelectHdl( LINK( this, ScLinkedAreaDlg, RangeHdl ) );
aBtnReload.SetClickHdl( LINK( this, ScLinkedAreaDlg, ReloadHdl ) );
UpdateEnable();
+
+ aNfDelay.SetAccessibleName(aBtnReload.GetText());
+ aNfDelay.SetAccessibleRelationLabeledBy(&aBtnReload);
}
ScLinkedAreaDlg::~ScLinkedAreaDlg()
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 2972395d1916..c158a7035691 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -269,6 +269,19 @@ ScOptSolverDlg::ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
mpOperator[3] = &maLbOp4;
mpDelButton[3] = &maBtnDel4;
+ maRbMax.SetAccessibleRelationMemberOf(&maFtDirection);
+ maRbMin.SetAccessibleRelationMemberOf(&maFtDirection);
+ maRbValue.SetAccessibleRelationMemberOf(&maFtDirection);
+ maEdLeft2.SetAccessibleName(maFtCellRef.GetText());
+ maLbOp2.SetAccessibleName(maFtOperator.GetText());
+ maEdRight2.SetAccessibleName(maFtConstraint.GetText());
+ maEdLeft3.SetAccessibleName(maFtCellRef.GetText());
+ maLbOp3.SetAccessibleName(maFtOperator.GetText());
+ maEdRight3.SetAccessibleName(maFtConstraint.GetText());
+ maEdLeft4.SetAccessibleName(maFtCellRef.GetText());
+ maLbOp4.SetAccessibleName(maFtOperator.GetText());
+ maEdRight4.SetAccessibleName(maFtConstraint.GetText());
+
Init( aCursorPos );
FreeResource();
}
diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx
index 62cdaad524f9..cf0059a12ceb 100644
--- a/sc/source/ui/miscdlgs/shtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/shtabdlg.cxx
@@ -45,11 +45,11 @@
ScShowTabDlg::ScShowTabDlg( Window* pParent ) :
ModalDialog ( pParent, ScResId( RID_SCDLG_SHOW_TAB ) ),
+ aFtLbTitle ( this, ScResId( FT_LABEL ) ),
aLb ( this, ScResId( LB_ENTRYLIST ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- aBtnHelp ( this, ScResId( BTN_HELP ) ),
- aFtLbTitle ( this, ScResId( FT_LABEL ) )
+ aBtnHelp ( this, ScResId( BTN_HELP ) )
{
aLb.Clear();
aLb.SetDoubleClickHdl( LINK( this, ScShowTabDlg, DblClkHdl ) );
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index 2e9751a8e4d6..e3e58b8f75ad 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -88,6 +88,9 @@ ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
{
Init();
FreeResource();
+
+ aRBFormulaCell.SetAccessibleRelationMemberOf(&aFlVariables);
+ aRBVariableCell.SetAccessibleRelationMemberOf(&aFlVariables);
}
//----------------------------------------------------------------------------
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 1b1494269c06..0a3b0c4603a4 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -154,6 +154,8 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
pSaveObj = new SaveData;
Init();
FreeResource();
+
+ aRbAssign.SetAccessibleRelationMemberOf(&aFlAssign);
}
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 3576e5f3c877..a4dcaa801624 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -767,6 +767,10 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win
aContentTimer.SetTimeout( SC_CONTENT_TIMEOUT );
FreeResource();
+
+ aLbEntries.SetAccessibleRelationLabeledBy(&aLbEntries);
+ aTbxCmd.SetAccessibleRelationLabeledBy(&aTbxCmd);
+ aLbDocuments.SetAccessibleName(aStrActiveWin);
}
//------------------------------------------------------------------------
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index fc9933b49035..719f954ed594 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -112,18 +112,18 @@ static void printAddressFlags(sal_uInt16 nFlag)
ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent )
: ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_AREAS),
//
- aLbPrintArea ( this, ScResId( LB_PRINTAREA ) ),
aFlPrintArea ( this, ScResId( FL_PRINTAREA ) ),
+ aLbPrintArea ( this, ScResId( LB_PRINTAREA ) ),
aEdPrintArea ( this, this, ScResId( ED_PRINTAREA ) ),
aRbPrintArea ( this, ScResId( RB_PRINTAREA ), &aEdPrintArea, this ),
//
- aLbRepeatRow ( this, ScResId( LB_REPEATROW ) ),
aFlRepeatRow ( this, ScResId( FL_REPEATROW ) ),
+ aLbRepeatRow ( this, ScResId( LB_REPEATROW ) ),
aEdRepeatRow ( this, this, ScResId( ED_REPEATROW ) ),
aRbRepeatRow ( this, ScResId( RB_REPEATROW ), &aEdRepeatRow, this ),
//
- aLbRepeatCol ( this, ScResId( LB_REPEATCOL ) ),
aFlRepeatCol ( this, ScResId( FL_REPEATCOL ) ),
+ aLbRepeatCol ( this, ScResId( LB_REPEATCOL ) ),
aEdRepeatCol ( this, this, ScResId( ED_REPEATCOL ) ),
aRbRepeatCol ( this, ScResId( RB_REPEATCOL ), &aEdRepeatCol, this ),
//
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index c614c22651ec..e4a73d24aa01 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -101,6 +101,8 @@ ScHFPage::ScHFPage( Window* pParent, sal_uInt16 nResId,
aBtnEdit.SetHelpId( HID_SC_HEADER_EDIT );
else
aBtnEdit.SetHelpId( HID_SC_FOOTER_EDIT );
+
+ aBtnEdit.SetAccessibleRelationMemberOf(&aFrm);
}
//------------------------------------------------------------------
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index f1b20238d240..56f8dbaf4689 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -162,6 +162,9 @@ ScTablePage::ScTablePage( Window* pParent, const SfxItemSet& rCoreAttrs ) :
aBmpPageDir.SetOutputSizePixel( aBmpSize );
FreeResource();
+
+ aEdPageNo.SetAccessibleName(aBtnPageNo.GetText());
+ aEdPageNo.SetAccessibleRelationLabeledBy(&aBtnPageNo);
}
// -----------------------------------------------------------------------
diff --git a/sc/source/ui/src/condfrmt.src b/sc/source/ui/src/condfrmt.src
index 4cd79a2ffc3d..4adc735a7f2d 100644
--- a/sc/source/ui/src/condfrmt.src
+++ b/sc/source/ui/src/condfrmt.src
@@ -385,41 +385,16 @@ ModelessDialog RID_SCDLG_CONDFORMAT
Text [ en-US ] = "Conditional Formatting" ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String LABEL_FORMARTTING_CONDITIONS
+{
+ Text [ en-US ] = "Formatting Conditions" ;
+};
+String LABEL_CONDITIONS
+{
+ Text [ en-US ] = "Conditions" ;
+};
+String LABEL_CONDITION_VALUE
+{
+ Text [ en-US ] = "Condition Value" ;
+};
diff --git a/sc/source/ui/src/filter.src b/sc/source/ui/src/filter.src
index eed896330b0e..ed501b782a8d 100644
--- a/sc/source/ui/src/filter.src
+++ b/sc/source/ui/src/filter.src
@@ -872,3 +872,23 @@ ModalDialog RID_SCDLG_PIVOTFILTER
};
};
+String STR_COPY_AREA_TO
+{
+ Text [ en-US ] = "Copy results to" ;
+};
+String RID_FILTER_OPERATOR
+{
+ Text [ en-US ] = "Operator" ;
+};
+String RID_FILTER_FIELDNAME
+{
+ Text [ en-US ] = "Field Name" ;
+};
+String RID_FILTER_CONDITION
+{
+ Text [ en-US ] = "Condition" ;
+};
+String RID_FILTER_VALUE
+{
+ Text [ en-US ] = "Value" ;
+};
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 6c15762bda6a..30787b6e3b84 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -201,15 +201,15 @@ Resource RID_GLOBSTR
};
String STR_UNDO_PIVOT_NEW
{
- Text [ en-US ] = "Create DataPilot Table" ;
+ Text [ en-US ] = "Create pivot table" ;
};
String STR_UNDO_PIVOT_MODIFY
{
- Text [ en-US ] = "Edit DataPilot Table" ;
+ Text [ en-US ] = "Edit pivot table" ;
};
String STR_UNDO_PIVOT_DELETE
{
- Text [ en-US ] = "Delete DataPilot Table" ;
+ Text [ en-US ] = "Delete pivot table" ;
};
String STR_UNDO_CONSOLIDATE
{
@@ -525,7 +525,7 @@ Resource RID_GLOBSTR
};
String STR_PIVOT_NODATA
{
- Text [ en-US ] = "The DataPilot table must contain at least one entry." ;
+ Text [ en-US ] = "The pivot table must contain at least one entry." ;
};
String STR_PIVOT_MOVENOTALLOWED
{
@@ -533,11 +533,11 @@ Resource RID_GLOBSTR
};
String STR_PIVOT_ERROR
{
- Text [ en-US ] = "Error creating the Data Pilot Table." ;
+ Text [ en-US ] = "Error creating the pivot table." ;
};
String STR_PIVOT_OVERLAP
{
- Text [ en-US ] = "DataPilot tables can not overlap." ;
+ Text [ en-US ] = "Pivot tables can not overlap." ;
};
String STR_PIVOT_NOTEMPTY
{
@@ -549,7 +549,7 @@ Resource RID_GLOBSTR
};
String STR_PIVOT_PROGRESS
{
- Text [ en-US ] = "Create DataPilot Table" ;
+ Text [ en-US ] = "Create Pivot Table" ;
};
String STR_PIVOT_TOTAL
{
@@ -693,7 +693,7 @@ Resource RID_GLOBSTR
};
String STR_PIVOT_TABLE
{
- Text [ en-US ] = "DataPilot" ;
+ Text [ en-US ] = "Pivot Table" ;
};
// Text strings for captions of subtotal functions.
String STR_FUN_TEXT_SUM
@@ -738,7 +738,7 @@ Resource RID_GLOBSTR
};
String STR_PIVOT_NOTFOUND
{
- Text [ en-US ] = "No DataPilot table found at this position." ;
+ Text [ en-US ] = "No pivot table found at this position." ;
};
String STR_EMPTYDATA
{
@@ -1037,7 +1037,7 @@ Resource RID_GLOBSTR
};
String STR_EXPORT_ASCII
{
- Text [ en-US ] = "Export of text files" ;
+ Text [ en-US ] = "Export Text File" ;
};
String STR_IMPORT_LOTUS
{
@@ -1470,27 +1470,27 @@ Resource RID_GLOBSTR
// Templates for data pilot tables.
String STR_PIVOT_STYLE_INNER
{
- Text [ en-US ] = "DataPilot Value" ;
+ Text [ en-US ] = "Pivot Table Value" ;
};
String STR_PIVOT_STYLE_RESULT
{
- Text [ en-US ] = "DataPilot Result" ;
+ Text [ en-US ] = "Pivot Table Result" ;
};
String STR_PIVOT_STYLE_CATEGORY
{
- Text [ en-US ] = "DataPilot Category" ;
+ Text [ en-US ] = "Pivot Table Category" ;
};
String STR_PIVOT_STYLE_TITLE
{
- Text [ en-US ] = "DataPilot Title" ;
+ Text [ en-US ] = "Pivot Table Title" ;
};
String STR_PIVOT_STYLE_FIELDNAME
{
- Text [ en-US ] = "DataPilot Field" ;
+ Text [ en-US ] = "Pivot Table Field" ;
};
String STR_PIVOT_STYLE_TOP
{
- Text [ en-US ] = "DataPilot Corner" ;
+ Text [ en-US ] = "Pivot Table Corner" ;
};
String STR_OPERATION_FILTER
{
@@ -1663,7 +1663,7 @@ Resource RID_GLOBSTR
String STR_ERR_DATAPILOT_INPUT
{
- Text[ en-US ] = "You cannot change this part of the DataPilot table.";
+ Text[ en-US ] = "You cannot change this part of the pivot table.";
};
String STR_RECALC_MANUAL
@@ -1728,7 +1728,7 @@ Resource RID_GLOBSTR
};
String STR_ERR_DATAPILOTSOURCE
{
- Text [ en-US ] = "DataPilot source data is invalid.";
+ Text [ en-US ] = "Pivot table source data is invalid.";
};
String STR_PIVOT_FIRSTROWEMPTYERR
{
@@ -1736,7 +1736,7 @@ Resource RID_GLOBSTR
};
String STR_PIVOT_ONLYONEROWERR
{
- Text [ en-US ] = "DataPilot table needs at least two rows of data to create or refresh." ;
+ Text [ en-US ] = "Pivot table needs at least two rows of data to create or refresh." ;
};
};
diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src
index a466823581bf..e16f60acd7fc 100644
--- a/sc/source/ui/src/popup.src
+++ b/sc/source/ui/src/popup.src
@@ -210,7 +210,7 @@ Menu RID_POPUP_TAB
String RID_POPUP_PIVOT
{
- Text [ en-US ] = "DataPilot pop-up menu" ;
+ Text [ en-US ] = "Pivot table pop-up menu" ;
};
Menu RID_POPUP_PIVOT
@@ -221,7 +221,7 @@ Menu RID_POPUP_PIVOT
{
Identifier = SID_OPENDLG_PIVOTTABLE ;
HelpId = CMD_SID_OPENDLG_PIVOTTABLE ;
- Text [ en-US ] = "~Start..." ;
+ Text [ en-US ] = "~Edit Layout..." ;
};
MenuItem
{
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 129ed62a6c15..4f99f90b8437 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -7894,7 +7894,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
{
String 1 // Description
{
- Text [ en-US ] = "Extracts value(s) from a DataPilot table.";
+ Text [ en-US ] = "Extracts value(s) from a pivot table.";
};
ExtraData =
{
@@ -7910,15 +7910,15 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
};
String 3 // Description of Parameter 1
{
- Text [ en-US ] = "The name of the data pilot field to extract.";
+ Text [ en-US ] = "The name of the pivot table field to extract.";
};
String 4 // Name of Parameter 2
{
- Text [ en-US ] = "DataPilot";
+ Text [ en-US ] = "Pivot Table";
};
String 5 // Description of Parameter 2
{
- Text [ en-US ] = "A reference to a cell or range in the DataPilot table.";
+ Text [ en-US ] = "A reference to a cell or range in the pivot table.";
};
String 6 // Name of Parameter 3
{
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 17b7b99b2e04..071eedf4a4a0 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -136,7 +136,7 @@ String SCSTR_PREVIEWSHELL
String SCSTR_PIVOTSHELL
{
- Text [ en-US ] = "Data Pilot Tables" ;
+ Text [ en-US ] = "Pivot Tables" ;
};
String SCSTR_AUDITSHELL
@@ -700,17 +700,17 @@ String STR_ACC_EDITCELL_DESCR
String STR_ACC_DATAPILOT_ROW_DESCR
{
- Text [ en-US ] = "Fields that you drop here will be displayed as rows in the final DataPilot table.";
+ Text [ en-US ] = "Fields that you drop here will be displayed as rows in the final pivot table.";
};
String STR_ACC_DATAPILOT_COL_DESCR
{
- Text [ en-US ] = "Fields that you drop here will be displayed as columns in the final DataPilot table.";
+ Text [ en-US ] = "Fields that you drop here will be displayed as columns in the final pivot table.";
};
String STR_ACC_DATAPILOT_DATA_DESCR
{
- Text [ en-US ] = "Fields that you drop here will be used for calculations in the final DataPilot table.";
+ Text [ en-US ] = "Fields that you drop here will be used for calculations in the final pivot table.";
};
String STR_ACC_DATAPILOT_SEL_DESCR
@@ -728,6 +728,23 @@ String RID_SCSTR_ONCLICK
Text [ en-US ] = "Mouse button pressed";
};
+String STR_ACC_TOOLBAR_FORMULA
+{
+ Text [ en-US ] = "Formula Tool Bar";
+};
+String STR_ACC_DOC_SPREADSHEET
+{
+ Text [ en-US ] = "%PRODUCTNAME Spreadsheets";
+};
+String STR_ACC_DOC_SPREADSHEET_READONLY
+{
+ Text [ en-US ] = "(read-only)";
+};
+String STR_ACC_DOC_PREVIEW_SUFFIX
+{
+ Text [ en-US ] = "(Preview mode)";
+};
+
String SCSTR_MOREBTN_MOREOPTIONS
{
Text [ en-US ] = "More ~Options";
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 4a3689653ab6..67cc1d318fdb 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -471,10 +471,10 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
// out-of-bound dimension ID. This should never happen!
return;
- const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim];
+ const ScDPLabelData& rLabelData = pDPData->maDPParam.maLabelArray[pDPData->mnDim];
mpDPFieldPopup.reset(new ScDPFieldPopupWindow(this, pViewData->GetDocument()));
- mpDPFieldPopup->setName(OUString::createFromAscii("DataPilot field member popup"));
+ mpDPFieldPopup->setName(OUString::createFromAscii("Pivot table field member popup"));
mpDPFieldPopup->setExtendedData(pDPData.release());
mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this));
{
@@ -568,7 +568,7 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
return;
// Build a map of layout names to original names.
- const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim];
+ const ScDPLabelData& rLabelData = pDPData->maDPParam.maLabelArray[pDPData->mnDim];
MemNameMapType aMemNameMap;
for (vector<ScDPLabelData::Member>::const_iterator itr = rLabelData.maMembers.begin(), itrEnd = rLabelData.maMembers.end();
itr != itrEnd; ++itr)
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 2e829d83e07d..972503656132 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -251,7 +251,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
if( pDialogDPObject )
{
GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() );
- pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject );
+ pResult = new ScPivotLayoutDlg( pB, pCW, pParent, *pDialogDPObject );
}
}
break;
diff --git a/scaddins/prj/build.lst b/scaddins/prj/build.lst
index 6f51161232d3..c3b483cf462c 100644
--- a/scaddins/prj/build.lst
+++ b/scaddins/prj/build.lst
@@ -1,4 +1,4 @@
-ca scaddins : LIBXSLT:libxslt l10n vcl NULL
+ca scaddins : LIBXSLT:libxslt L10N:l10n vcl NULL
ca scaddins usr1 - all sc_mkout NULL
ca scaddins\source\datefunc nmake - all sc_dfunc NULL
ca scaddins\source\analysis nmake - all sc_analysis NULL
diff --git a/sccomp/prj/build.lst b/sccomp/prj/build.lst
index 6884378f77a0..a16408723fa8 100644
--- a/sccomp/prj/build.lst
+++ b/sccomp/prj/build.lst
@@ -1,4 +1,4 @@
-scc sccomp : l10n offuh comphelper LPSOLVE:lpsolve tools rsc LIBXSLT:libxslt NULL
+scc sccomp : L10N:l10n offuh comphelper LPSOLVE:lpsolve tools rsc LIBXSLT:libxslt NULL
scc sccomp usr1 - all scc_mkout NULL
scc sccomp\prj get - all scc_prj NULL
scc sccomp\source\solver nmake - all scc_solver NULL
diff --git a/scp2/prj/build.lst b/scp2/prj/build.lst
index f3fbbec38273..10632bfc4d45 100644
--- a/scp2/prj/build.lst
+++ b/scp2/prj/build.lst
@@ -1,4 +1,4 @@
-cp scp2 : l10n i18npool setup_native l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt NULL
+cp scp2 : L10N:l10n i18npool setup_native l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt NULL
cp scp2 usr1 - all cp_mkout NULL
cp scp2\macros nmake - all cp_langmacros NULL
cp scp2\source\templates nmake - all cp_langtemplates NULL
diff --git a/scp2/source/ooo/ure.scp b/scp2/source/ooo/ure.scp
index 804f0edad0b2..2d6b8858eca1 100755
--- a/scp2/source/ooo/ure.scp
+++ b/scp2/source/ooo/ure.scp
@@ -296,14 +296,6 @@ File gid_File_Dl_Reg
// CompID = "D5313B1F-D09F-401F-B180-891F70D489ED";
End
-File gid_File_Dl_Rmcxt
- TXT_FILE_BODY;
- Dir = SCP2_URE_DL_DIR;
- Name = SCP2_URE_DL_VER("rmcxt", "3");
- Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
- // CompID = "E0C091E3-7C18-4C32-B9CF-4D95AC243801";
-End
-
File gid_File_Dl_Store
TXT_FILE_BODY;
Dir = SCP2_URE_DL_DIR;
@@ -390,14 +382,6 @@ Shortcut gid_Shortcut_Dl_JavaUno
End
#endif
-File gid_File_Dl_UrpUno
- TXT_FILE_BODY;
- Dir = SCP2_URE_DL_DIR;
- Name = SCP2_URE_DL_NORMAL("urp_uno");
- Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
- // CompID = "D9F647ED-8E6F-4F80-8D2B-A45372B6AB60";
-End
-
File gid_File_Dl_UnsafeUnoUno
TXT_FILE_BODY;
Dir = SCP2_URE_DL_DIR;
@@ -678,20 +662,19 @@ File gid_File_Dl_Acceptor
// CompID = "31183C51-C9A4-4D7A-A2F4-103252E1FEB0";
End
-File gid_File_Dl_Bootstrap
+File gid_File_Dl_Binaryurp
TXT_FILE_BODY;
Dir = SCP2_URE_DL_DIR;
- Name = SCP2_URE_DL_BARE("bootstrap.uno");
- Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
- // CompID = "2620B307-25DB-498F-B2B8-46D928165331";
+ Name = SCP2_URE_DL_BARE("binaryurp.uno");
+ Styles = (PACKED);
End
-File gid_File_Dl_Bridgefac
+File gid_File_Dl_Bootstrap
TXT_FILE_BODY;
Dir = SCP2_URE_DL_DIR;
- Name = SCP2_URE_DL_BARE("bridgefac.uno");
+ Name = SCP2_URE_DL_BARE("bootstrap.uno");
Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
- // CompID = "E025163F-FE1E-4E8C-B0E5-49C08924A646";
+ // CompID = "2620B307-25DB-498F-B2B8-46D928165331";
End
File gid_File_Dl_Connector
@@ -779,14 +762,6 @@ File gid_File_Dl_Reflection
// CompID = "601C7946-CFEB-4F56-9429-6D5963188DF3";
End
-File gid_File_Dl_Remotebridge
- TXT_FILE_BODY;
- Dir = SCP2_URE_DL_DIR;
- Name = SCP2_URE_DL_BARE("remotebridge.uno");
- Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
- // CompID = "B440B28E-B7AD-40C7-89E1-1508CA798347";
-End
-
File gid_File_Dl_Streams
TXT_FILE_BODY;
Dir = SCP2_URE_DL_DIR;
@@ -1131,7 +1106,6 @@ Module gid_Module_Root_Ure_Hidden
gid_File_Dl_Salhelper,
gid_File_Dl_Profile_Uno,
gid_File_Dl_Reg,
- gid_File_Dl_Rmcxt,
gid_File_Dl_Store,
gid_File_Dl_Xmlreader,
gid_File_Dl_Jvmaccess,
@@ -1141,7 +1115,6 @@ Module gid_Module_Root_Ure_Hidden
gid_File_Dl_Profile_Jvmfwk3rc,
gid_File_Dl_ComnameUno,
gid_File_Dl_JavaUno,
- gid_File_Dl_UrpUno,
gid_File_Dl_UnsafeUnoUno,
gid_File_Dl_AffineUnoUno,
gid_File_Dl_LogUnoUno,
@@ -1150,8 +1123,8 @@ Module gid_Module_Root_Ure_Hidden
gid_File_Dl_Juh,
gid_File_Dl_Juhx,
gid_File_Dl_Acceptor,
+ gid_File_Dl_Binaryurp,
gid_File_Dl_Bootstrap,
- gid_File_Dl_Bridgefac,
gid_File_Dl_Connector,
gid_File_Dl_Introspection,
gid_File_Dl_Invocadapt,
@@ -1161,7 +1134,6 @@ Module gid_Module_Root_Ure_Hidden
gid_File_Dl_Namingservice,
gid_File_Dl_Proxyfac,
gid_File_Dl_Reflection,
- gid_File_Dl_Remotebridge,
gid_File_Dl_Stocservices,
gid_File_Dl_Streams,
gid_File_Dl_Textinstream,
diff --git a/sd/prj/build.lst b/sd/prj/build.lst
index 0816f2de7255..72ee2777a8f8 100644
--- a/sd/prj/build.lst
+++ b/sd/prj/build.lst
@@ -1,4 +1,4 @@
-sd sd : filter l10n animations svx sfx2 stoc canvas LIBXSLT:libxslt NULL
+sd sd : filter L10N:l10n animations svx sfx2 stoc canvas LIBXSLT:libxslt NULL
sd sd usr1 - all sd_mkout NULL
sd sd\inc nmake - all sd_inc NULL
sd sd\prj get - all sd_prj NULL
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 4fc88c3a6049..3b6b2e4d5670 100755
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -1234,10 +1234,17 @@ String STR_SET_BACKGROUND_PICTURE
{
Text [ en-US ] = "Set Background Picture for Slide ..." ;
};
+
+String STR_ACC_DIALOG_DESC
+{
+ Text [ en-US ] = "Select a template from which to import page designs." ;
+};
+
String RID_ANNOTATIONS_START
{
Text [ en-US ] = "Comments";
};
+
String STR_RESET_LAYOUT
{
Text[ en-US ] = "Reset Slide Layout";
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index e5e27928f520..bd3bdb2243c0 100755
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -157,21 +157,19 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings,
aNumFldBitmap ( this, SdResId( NUM_FLD_BITMAP ) ),
aTimeField ( this, SdResId( TIME_FIELD ) ),
aLbLoopCount ( this, SdResId( LB_LOOP_COUNT ) ),
-
+ aGrpBitmap ( this, SdResId( GRP_BITMAP ) ),
aBtnGetOneObject ( this, SdResId( BTN_GET_ONE_OBJECT ) ),
aBtnGetAllObjects ( this, SdResId( BTN_GET_ALL_OBJECTS ) ),
aBtnRemoveBitmap ( this, SdResId( BTN_REMOVE_BITMAP ) ),
aBtnRemoveAll ( this, SdResId( BTN_REMOVE_ALL ) ),
aFtCount ( this, SdResId( FT_COUNT ) ),
aFiCount ( this, SdResId( FI_COUNT ) ),
- aGrpBitmap ( this, SdResId( GRP_BITMAP ) ),
-
+ aGrpAnimation ( this, SdResId( GRP_ANIMATION_GROUP ) ),
aRbtGroup ( this, SdResId( RBT_GROUP ) ),
aRbtBitmap ( this, SdResId( RBT_BITMAP ) ),
aFtAdjustment ( this, SdResId( FT_ADJUSTMENT ) ),
aLbAdjustment ( this, SdResId( LB_ADJUSTMENT ) ),
aBtnCreateGroup ( this, SdResId( BTN_CREATE_GROUP ) ),
- aGrpAnimation ( this, SdResId( GRP_ANIMATION_GROUP ) ),
pWin ( pParent ),
pBitmapEx ( NULL ),
@@ -181,6 +179,7 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings,
pBindings ( pInBindings )
{
+ aCtlDisplay.SetAccessibleName(String (SdResId(STR_DISPLAY)));
FreeResource();
aBtnGetOneObject.SetModeImage( Image( SdResId( IMG_GET1OBJECT_H ) ), BMP_COLOR_HIGHCONTRAST );
@@ -226,6 +225,11 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings,
// der Animator ist leer; es kann keine Animationsgruppe erstellt werden
aBtnCreateGroup.Disable();
+
+ aBtnGetOneObject.SetAccessibleRelationMemberOf( &aGrpBitmap );
+ aBtnGetAllObjects.SetAccessibleRelationMemberOf( &aGrpBitmap );
+ aBtnRemoveBitmap.SetAccessibleRelationMemberOf( &aGrpBitmap );
+ aBtnRemoveAll.SetAccessibleRelationMemberOf( &aGrpBitmap );
}
// -----------------------------------------------------------------------
diff --git a/sd/source/ui/dlg/animobjs.src b/sd/source/ui/dlg/animobjs.src
index efbd75ac9003..66bb46a22ed0 100644..100755
--- a/sd/source/ui/dlg/animobjs.src
+++ b/sd/source/ui/dlg/animobjs.src
@@ -319,6 +319,10 @@ DockingWindow FLT_WIN_ANIMATION
Size = MAP_APPFONT ( 147 , 8 ) ;
Text [ en-US ] = "Animation group" ;
};
+ String STR_DISPLAY
+ {
+ Text [ en-US ] = "Preview";
+ };
};
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index c32083d71dfe..2152572470dc 100755
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -72,23 +72,23 @@ CopyDlg::CopyDlg(
maFtCopies ( this, SdResId( FT_COPIES ) ),
maNumFldCopies ( this, SdResId( NUM_FLD_COPIES ) ),
maBtnSetViewData ( this, SdResId( BTN_SET_VIEWDATA ) ),
+ maGrpMovement ( this, SdResId( GRP_MOVEMENT ) ),
maFtMoveX ( this, SdResId( FT_MOVE_X ) ),
maMtrFldMoveX ( this, SdResId( MTR_FLD_MOVE_X ) ),
maFtMoveY ( this, SdResId( FT_MOVE_Y ) ),
maMtrFldMoveY ( this, SdResId( MTR_FLD_MOVE_Y ) ),
maFtAngle ( this, SdResId( FT_ANGLE ) ),
maMtrFldAngle ( this, SdResId( MTR_FLD_ANGLE ) ),
- maGrpMovement ( this, SdResId( GRP_MOVEMENT ) ),
+ maGrpEnlargement ( this, SdResId( GRP_ENLARGEMENT ) ),
maFtWidth ( this, SdResId( FT_WIDTH ) ),
maMtrFldWidth ( this, SdResId( MTR_FLD_WIDTH ) ),
maFtHeight ( this, SdResId( FT_HEIGHT ) ),
maMtrFldHeight ( this, SdResId( MTR_FLD_HEIGHT ) ),
- maGrpEnlargement ( this, SdResId( GRP_ENLARGEMENT ) ),
+ maGrpColor ( this, SdResId( GRP_COLOR ) ),
maFtStartColor ( this, SdResId( FT_START_COLOR ) ),
maLbStartColor ( this, SdResId( LB_START_COLOR ) ),
maFtEndColor ( this, SdResId( FT_END_COLOR ) ),
maLbEndColor ( this, SdResId( LB_END_COLOR ) ),
- maGrpColor ( this, SdResId( GRP_COLOR ) ),
maBtnOK ( this, SdResId( BTN_OK ) ),
maBtnCancel ( this, SdResId( BTN_CANCEL ) ),
maBtnHelp ( this, SdResId( BTN_HELP ) ),
diff --git a/sd/source/ui/dlg/custsdlg.src b/sd/source/ui/dlg/custsdlg.src
index 5d05b63f6287..275a47b38397 100644..100755
--- a/sd/source/ui/dlg/custsdlg.src
+++ b/sd/source/ui/dlg/custsdlg.src
@@ -99,6 +99,9 @@ ModalDialog DLG_CUSTOMSHOW
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 102 + DIFF , 86 + DIFF_Y ) ;
TabStop = TRUE ;
+ //IAccessibility2 Implementation 2009-----
+ QuickHelpText [ en-US ] = "Custom Screen Show" ;
+ //-----IAccessibility2 Implementation 2009
};
CheckBox CBX_USE_CUSTOMSHOW
{
diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx
index 5316d5a87ede..5fd5fd45628d 100755
--- a/sd/source/ui/dlg/dlgfield.cxx
+++ b/sd/source/ui/dlg/dlgfield.cxx
@@ -61,9 +61,9 @@
SdModifyFieldDlg::SdModifyFieldDlg( Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet ) :
ModalDialog ( pWindow, SdResId( DLG_FIELD_MODIFY ) ),
+ aGrpType ( this, SdResId( GRP_TYPE ) ),
aRbtFix ( this, SdResId( RBT_FIX ) ),
aRbtVar ( this, SdResId( RBT_VAR ) ),
- aGrpType ( this, SdResId( GRP_TYPE ) ),
maFtLanguage( this, SdResId( FT_LANGUAGE ) ),
maLbLanguage( this, SdResId( LB_LANGUAGE ) ),
aFtFormat ( this, SdResId( FT_FORMAT ) ),
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index 9707ecb2c300..d5c2fa4c8890 100755
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -544,6 +544,19 @@ HeaderFooterTabPage::HeaderFooterTabPage( HeaderFooterDialog* pDialog, ::Window*
FillFormatList(SVXDATEFORMAT_A);
+ maTBHeader.SetAccessibleRelationMemberOf(&maCBHeader);
+ maRBDateTimeFixed.SetAccessibleRelationMemberOf(&maCBDateTime);
+ maRBDateTimeAutomatic.SetAccessibleRelationMemberOf(&maCBDateTime);
+ maTBDateTimeFixed.SetAccessibleName(maRBDateTimeFixed.GetText());
+ maTBDateTimeFixed.SetAccessibleRelationMemberOf(&maCBDateTime);
+ maTBDateTimeFixed.SetAccessibleRelationLabeledBy(&maRBDateTimeFixed);
+ maCBDateTimeFormat.SetAccessibleRelationMemberOf(&maCBDateTime);
+ maCBDateTimeFormat.SetAccessibleName(maRBDateTimeAutomatic.GetText());
+ maCBDateTimeFormat.SetAccessibleRelationLabeledBy(&maRBDateTimeAutomatic);
+ maCBDateTimeLanguage.SetAccessibleRelationMemberOf(&maCBDateTime);
+ maTBFooter.SetAccessibleRelationMemberOf(&maCBFooter);
+ maCBSlideNumber.SetAccessibleRelationMemberOf(&maFLIncludeOnPage);
+ maCBFooter.SetAccessibleRelationMemberOf(&maFLIncludeOnPage);
}
// -----------------------------------------------------------------------
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 3248504a61ab..6240bb734e92 100755
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -93,6 +93,8 @@ SdNavigatorWin::SdNavigatorWin(
FreeResource();
+ maTlbObjects.SetAccessibleName(String(SdResId(STR_OBJECTS_TREE)));
+
mpNavigatorCtrlItem = new SdNavigatorControllerItem( SID_NAVIGATOR_STATE, this, mpBindings );
mpPageNameCtrlItem = new SdPageNameControllerItem( SID_NAVIGATOR_PAGENAME, this, mpBindings );
mpDocList = new List();
diff --git a/sd/source/ui/dlg/navigatr.src b/sd/source/ui/dlg/navigatr.src
index 4d4499d3226d..2ae1550ef1df 100644..100755
--- a/sd/source/ui/dlg/navigatr.src
+++ b/sd/source/ui/dlg/navigatr.src
@@ -159,3 +159,8 @@ Window FLT_NAVIGATOR
NAVIGATR_IDLIST
};
};
+
+String STR_OBJECTS_TREE
+{
+ Text [ en-US ] = "Page Tree";
+};
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index 1ad9e29d4662..aa44dd340a00 100755
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -111,6 +111,12 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow,
aTmfPause.SetModifyHdl( LINK( this, SdStartPresentationDlg, ChangePauseHdl ) );
aTmfPause.SetFormat( TIMEF_SEC );
+ aLbDias.SetAccessibleRelationLabeledBy( &aRbtAtDia );
+ aLbDias.SetAccessibleName(aRbtAtDia.GetText());
+ aLbCustomshow.SetAccessibleRelationLabeledBy( &aRbtCustomshow );
+ aTmfPause.SetAccessibleRelationLabeledBy( &aRbtAuto );
+ aTmfPause.SetAccessibleName(aRbtAuto.GetText());
+
// Listbox mit Seitennamen fuellen
rPageNames.First();
for( sal_uInt16 i = 0;
diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index c792b1554e5b..a1417180b654 100755
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -99,6 +99,9 @@ SdPrintOptions::SdPrintOptions( Window* pParent, const SfxItemSet& rInAttrs ) :
#ifndef QUARTZ
SetDrawMode();
#endif
+
+ aCbxFront.SetAccessibleRelationLabeledBy( &aRbtBooklet );
+ aCbxBack.SetAccessibleRelationLabeledBy( &aRbtBooklet );
}
// -----------------------------------------------------------------------
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 6ed87ba105ea..c36ab0687d7f 100755
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -144,6 +144,9 @@ SdTPAction::SdTPAction( Window* pWindow, const SfxItemSet& rInAttrs ) :
mpDoc ( NULL ),
bTreeUpdated ( sal_False )
{
+ aEdtSound.SetAccessibleName(String(SdResId(STR_PATHNAME)));
+ aBtnSeek.SetAccessibleRelationMemberOf( &aFlSeparator );
+
FreeResource();
aBtnSearch.SetClickHdl( LINK( this, SdTPAction, ClickSearchHdl ) );
diff --git a/sd/source/ui/dlg/tpaction.src b/sd/source/ui/dlg/tpaction.src
index a567afebdf5c..79cd333c9300 100644..100755
--- a/sd/source/ui/dlg/tpaction.src
+++ b/sd/source/ui/dlg/tpaction.src
@@ -173,7 +173,10 @@ TabPage TP_ANIMATION
Hide = TRUE ;
Text [ en-US ] = "~Find" ;
};
-
+ String STR_PATHNAME
+ {
+ Text [ en-US ] = "Path Name";
+ };
Text [ en-US ] = "Interaction";
};
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 0eb30d78e45f..f1e5b446f796 100755
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -43,9 +43,6 @@
#include "vectdlg.hxx"
#include "vectdlg.hrc"
#include <tools/config.hxx>
-#ifndef _SV_OCTREE_HXX //autogen
- #include <vcl/octree.hxx>
-#endif
#include <vcl/bmpacc.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/metaact.hxx>
diff --git a/sd/source/ui/dlg/vectdlg.src b/sd/source/ui/dlg/vectdlg.src
index f66ba0a9454c..17c648bbcad3 100644..100755
--- a/sd/source/ui/dlg/vectdlg.src
+++ b/sd/source/ui/dlg/vectdlg.src
@@ -182,6 +182,7 @@ ModalDialog DLG_VECTORIZE
Border = TRUE ;
Pos = MAP_APPFONT ( 6, 98 ) ;
Size = MAP_APPFONT ( 92, 100 ) ;
+ Text [ en-US ] = "Source picture" ;
};
FixedText FT_VECTORIZED
@@ -196,6 +197,7 @@ ModalDialog DLG_VECTORIZE
Border = TRUE ;
Pos = MAP_APPFONT ( 101, 98 ) ;
Size = MAP_APPFONT ( 93, 100 ) ;
+ Text [ en-US ] = "Vectorized image" ;
};
FixedText GRP_PRGS
@@ -211,6 +213,7 @@ ModalDialog DLG_VECTORIZE
SVLook = TRUE ;
Pos = MAP_APPFONT ( 6, 215 ) ;
Size = MAP_APPFONT ( 188, 10 ) ;
+ Text [ en-US ] = "Progress" ;
};
};
diff --git a/sd/source/ui/inc/animobjs.hrc b/sd/source/ui/inc/animobjs.hrc
index 5c5c8e7852cc..1a6d8291ee59 100644..100755
--- a/sd/source/ui/inc/animobjs.hrc
+++ b/sd/source/ui/inc/animobjs.hrc
@@ -47,3 +47,6 @@
#define LB_ADJUSTMENT 2
#define LB_LOOP_COUNT 3
#define GRP_ANIMATION_GROUP 2
+//IAccessibility2 Implementation 2009-----
+#define STR_DISPLAY 1
+//-----IAccessibility2 Implementation 2009
diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx
index 030f0a3eb845..c03a785775e6 100755
--- a/sd/source/ui/inc/animobjs.hxx
+++ b/sd/source/ui/inc/animobjs.hxx
@@ -124,21 +124,20 @@ private:
NumericField aNumFldBitmap;
TimeField aTimeField;
ListBox aLbLoopCount;
-
+ FixedLine aGrpBitmap;
ImageButton aBtnGetOneObject;
ImageButton aBtnGetAllObjects;
ImageButton aBtnRemoveBitmap;
ImageButton aBtnRemoveAll;
FixedText aFtCount;
FixedInfo aFiCount;
- FixedLine aGrpBitmap;
+ FixedLine aGrpAnimation;
RadioButton aRbtGroup;
RadioButton aRbtBitmap;
FixedText aFtAdjustment;
ListBox aLbAdjustment;
PushButton aBtnCreateGroup;
- FixedLine aGrpAnimation;
::Window* pWin;
List aBmpExList;
diff --git a/sd/source/ui/inc/copydlg.hxx b/sd/source/ui/inc/copydlg.hxx
index 2732f4f76c38..b726a473b3c5 100644..100755
--- a/sd/source/ui/inc/copydlg.hxx
+++ b/sd/source/ui/inc/copydlg.hxx
@@ -64,25 +64,25 @@ private:
NumericField maNumFldCopies;
ImageButton maBtnSetViewData;
+ FixedLine maGrpMovement;
FixedText maFtMoveX;
MetricField maMtrFldMoveX;
FixedText maFtMoveY;
MetricField maMtrFldMoveY;
FixedText maFtAngle;
MetricField maMtrFldAngle;
- FixedLine maGrpMovement;
+ FixedLine maGrpEnlargement;
FixedText maFtWidth;
MetricField maMtrFldWidth;
FixedText maFtHeight;
MetricField maMtrFldHeight;
- FixedLine maGrpEnlargement;
+ FixedLine maGrpColor;
FixedText maFtStartColor;
ColorLB maLbStartColor;
FixedText maFtEndColor;
ColorLB maLbEndColor;
- FixedLine maGrpColor;
OKButton maBtnOK;
CancelButton maBtnCancel;
diff --git a/sd/source/ui/inc/dlgfield.hxx b/sd/source/ui/inc/dlgfield.hxx
index b7f87348ad76..dd08fa5c2d56 100644..100755
--- a/sd/source/ui/inc/dlgfield.hxx
+++ b/sd/source/ui/inc/dlgfield.hxx
@@ -57,9 +57,9 @@ class SvxFieldData;
class SdModifyFieldDlg : public ModalDialog
{
private:
+ FixedLine aGrpType;
RadioButton aRbtFix;
RadioButton aRbtVar;
- FixedLine aGrpType;
FixedText maFtLanguage;
SvxLanguageBox maLbLanguage;
FixedText aFtFormat;
diff --git a/sd/source/ui/inc/navigatr.hrc b/sd/source/ui/inc/navigatr.hrc
index 47812c304890..f12932255fe5 100644..100755
--- a/sd/source/ui/inc/navigatr.hrc
+++ b/sd/source/ui/inc/navigatr.hrc
@@ -25,6 +25,9 @@
*
************************************************************************/
#define FLT_NAVIGATOR 575
+//IAccessibility2 Implementation 2009-----
+#define STR_OBJECTS_TREE (FLT_NAVIGATOR+1)
+//-----IAccessibility2 Implementation 2009
#define TLB_OBJECTS 1
#define TBI_PEN 2
#define TBI_FIRST 3
@@ -41,3 +44,7 @@
#define IL_NAVIGATR 333
#define ILH_NAVIGATR 444
+//IAccessibility2 Implementation 2009-----
+#define STR_DRAGMODE 1
+//-----IAccessibility2 Implementation 2009
+
diff --git a/sd/source/ui/inc/strings.hrc b/sd/source/ui/inc/strings.hrc
index 7f5086057e5c..97693308ee07 100755
--- a/sd/source/ui/inc/strings.hrc
+++ b/sd/source/ui/inc/strings.hrc
@@ -500,6 +500,9 @@
#define STR_NAVIGATOR_SHOW_NAMED_SHAPES (RID_APP_START+718)
#define STR_NAVIGATOR_SHOW_ALL_SHAPES (RID_APP_START+719)
#define STR_NAVIGATOR_SHAPE_BASE_NAME (RID_APP_START+720)
+//IAccessibility2 Implementation 2009-----
+#define STR_ACC_DIALOG_DESC (RID_APP_START + 730)
+//-----IAccessibility2 Implementation 2009
#define STR_RESET_LAYOUT (RID_APP_START+721)
#define STR_INSERT_TABLE (RID_APP_START+722)
diff --git a/sd/source/ui/inc/tpaction.hrc b/sd/source/ui/inc/tpaction.hrc
index e273b9cb573c..0c4fe8a265d9 100644..100755
--- a/sd/source/ui/inc/tpaction.hrc
+++ b/sd/source/ui/inc/tpaction.hrc
@@ -49,3 +49,6 @@
#define FT_TREE 5
#define TP_ANIMATION 787
#define TP_ANIMATION_ACTION 789
+//IAccessibility2 Implementation 2009-----
+#define STR_PATHNAME 1
+ //-----IAccessibility2 Implementation 2009
diff --git a/sdext/prj/build.lst b/sdext/prj/build.lst
index 3603afbae866..2604633810a3 100644
--- a/sdext/prj/build.lst
+++ b/sdext/prj/build.lst
@@ -1,4 +1,4 @@
-dx sdext : l10n offuh comphelper unotools readlicense_oo cppu tools cppuhelper sal javaunohelper officecfg XPDF:xpdf LIBXSLT:libxslt xmlhelp NULL
+dx sdext : L10N:l10n offuh comphelper unotools readlicense_oo cppu tools cppuhelper sal javaunohelper officecfg XPDF:xpdf LIBXSLT:libxslt xmlhelp NULL
dx sdext usr1 - all sdext_mkout NULL
dx sdext\prj get - all sdext_prj NULL
dx sdext\source\minimizer nmake - all sdext_minimizer sdext_minimizer_rdoooe sdext_minimizer_rdooo sdext_inc NULL
diff --git a/set_soenv.in b/set_soenv.in
index d10cdfab8da3..d23b62eb5288 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -78,7 +78,7 @@ my ( $USR, $ETC, $BIN, $LIB, $LIB64, $INC, $INCLUDE, $DEV, $OPT, $LOCAL, $SOLENV
# Environment variables.
my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAVA_HOME, $JDK, $JAVAFLAGS, $OOO_SHELL,
- $UPD, $WORK_STAMP, $SOURCE_ROOT_DIR ,
+ $UPD, $WORK_STAMP, $SOURCE_ROOT_DIR , $gb_REPOS,
$SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $WORKDIR, $OUTDIR, $SOLARENV,
$STAR_INIROOT, $STAR_INIROOTOLD, $STAR_STANDLST, $STAR_SSCOMMON, $STAR_SSOLARINI,
$DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH,
@@ -1496,6 +1496,13 @@ else
#
print "done\n";
+$gb_REPOS = $SRC_ROOT;
+
+if ('@WITH_LANG@' ne "")
+{
+ $gb_REPOS .= " ".$SOURCE_ROOT_DIR."/l10n";
+ $BUILD_TYPE = "@BUILD_TYPE@ L10N";
+}
#
# F. Setting the different aliases.
@@ -1831,7 +1838,7 @@ ToFile( "WITH_FONTS", "@WITH_FONTS@", "e" );
ToFile( "WITHOUT_AFMS", "@WITHOUT_AFMS@", "e" );
ToFile( "WITHOUT_PPDS", "@WITHOUT_PPDS@", "e" );
ToFile( "WITH_BINFILTER", "@WITH_BINFILTER@", "e" );
-ToFile( "BUILD_TYPE", "@BUILD_TYPE@", "e" );
+ToFile( "BUILD_TYPE", "$BUILD_TYPE", "e" );
ToFile( "VERBOSE", "@VERBOSE@", "e" );
ToFile( "ENABLE_EVOAB2", "@ENABLE_EVOAB2@", "e" );
ToFile( "GOBJECT_CFLAGS", "@GOBJECT_CFLAGS@", "e" );
@@ -1855,6 +1862,9 @@ if ($SYSTEM_PYTHON eq "NO") {
ToFile( "HOME", "@HOME@", "e" );
}
ToFile( "SYSTEM_ICU", "@SYSTEM_ICU@", "e" );
+ToFile( "ICU_MAJOR", "@ICU_MAJOR@", "e" );
+ToFile( "ICU_MINOR", "@ICU_MINOR@", "e" );
+ToFile( "ICU_MICRO", "@ICU_MICRO@", "e" );
ToFile( "SYSTEM_GENBRK", "@SYSTEM_GENBRK@", "e" );
ToFile( "SYSTEM_GENCCODE", "@SYSTEM_GENCCODE@", "e" );
ToFile( "SYSTEM_GENCMN", "@SYSTEM_GENCMN@", "e" );
@@ -1962,6 +1972,8 @@ if ($platform !~ m/cygwin|os2/) {
}
ToFile( "SOLARSRC", $SOLARSRC, "e" );
ToFile( "SOURCE_ROOT_DIR", $SOURCE_ROOT_DIR, "e" );
+ToFile( "gb_REPOS", $gb_REPOS, "e" );
+
if ( $platform =~ m/cygwin/ )
{
ToFile( "ILIB", $ILIB, "e" );
diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst
index df7b02484039..00d7a0c92045 100644
--- a/setup_native/prj/build.lst
+++ b/setup_native/prj/build.lst
@@ -1,4 +1,4 @@
-pk setup_native : l10n l10ntools soltools sal xml2cmp NULL
+pk setup_native : L10N:l10n l10ntools soltools sal xml2cmp NULL
pk setup_native usr1 - all sn_mkout NULL
pk setup_native\scripts\source nmake - u sn_source NULL
pk setup_native\scripts nmake - u sn_scripts sn_source.u NULL
diff --git a/setup_native/source/mac/ooo3_installer.icns b/setup_native/source/mac/ooo3_installer.icns
index e064ad70479d..bacdd17d8470 100644
--- a/setup_native/source/mac/ooo3_installer.icns
+++ b/setup_native/source/mac/ooo3_installer.icns
Binary files differ
diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt
index fb04b347fcdf..242507c59db9 100755
--- a/setup_native/source/packinfo/packinfo_office.txt
+++ b/setup_native/source/packinfo/packinfo_office.txt
@@ -566,7 +566,7 @@ linuxpatchrequires = ""
copyright = "1999-2010 by Oracle"
solariscopyright = "solariscopyrightfile"
vendor = "Oracle"
-description = "De-AT dictionary for %PACKAGENAME %PRODUCTVERSION"
+description = "De-AT dictionary for %PRODUCTNAME %PRODUCTVERSION"
destpath = "/opt"
packageversion = "%PACKAGEVERSION"
End
@@ -582,7 +582,7 @@ linuxpatchrequires = ""
copyright = "1999-2010 by Oracle"
solariscopyright = "solariscopyrightfile"
vendor = "Oracle"
-description = "De-CH dictionary for %PACKAGENAME %PRODUCTVERSION"
+description = "De-CH dictionary for %PRODUCTNAME %PRODUCTVERSION"
destpath = "/opt"
packageversion = "%PACKAGEVERSION"
End
@@ -598,7 +598,7 @@ linuxpatchrequires = ""
copyright = "1999-2010 by Oracle"
solariscopyright = "solariscopyrightfile"
vendor = "Oracle"
-description = "De-DE dictionary for %PACKAGENAME %PRODUCTVERSION"
+description = "De-DE dictionary for %PRODUCTNAME %PRODUCTVERSION"
destpath = "/opt"
packageversion = "%PACKAGEVERSION"
End
diff --git a/setup_native/source/win32/msi-encodinglist.txt b/setup_native/source/win32/msi-encodinglist.txt
index 5185a9ea642e..ebfe9371f59f 100644
--- a/setup_native/source/win32/msi-encodinglist.txt
+++ b/setup_native/source/win32/msi-encodinglist.txt
@@ -3,19 +3,20 @@
af 1252 1078 # Afrikaans
ar 1256 1025
ar-SA 1256 1025
-as-IN 0 1101 # Assamese
as 0 1101 # Assamese
+as-IN 0 1101 # Assamese
ast 1252 1610
be-BY 1251 1059 # Belarusian
bg 1251 1026 # Bulgarian
bn 0 2117 # Bengali
bn-BD 0 2117 # Bengali Bangladesh
bn-IN 0 1093 # Bengali India
+bo 0 2121
br 1252 1150 # Breton
brx 0 1603 # Bodo (India)
bs 0 5146 # bosnian
-bo 0 2121
ca 1252 1027 # Catalan
+ca-XV 1252 32771 # Catalan Valencian
cs 1250 1029 # Czech
cy 1252 1106 # Welsh
da 1252 1030
@@ -38,11 +39,12 @@ fr-CA 1252 3084
ga 0 2108 # Irish
gd 0 1084 # Gaelic (Scotland)
gl 1252 1110 # Galician
-gu 0 1095 # Gujarati
+gu 0 1095 # Gujarati
gu-IN 0 1095 # Gujarati
he 1255 1037
hi 0 1081
hr 1250 1050 # Croatian
+ht 1252 1626 # Haitian
hu 1250 1038
hy 0 1067 # Armenian
id 1252 1057 # Indonesian
@@ -50,6 +52,8 @@ is 1252 1039 # Icelandic
it 1252 1040
ja 932 1041
ka 0 1079 # Georgian
+kid 1252 1033 # key id pseudo language
+kk 0 1087
km 0 1107 # Khmer
kn 0 1099 # Kannada
kn-IN 0 1099 # Kannada
@@ -57,15 +61,14 @@ ko 949 1042
kok 0 1111 # Konkani
ks 0 1120 # Kashmiri
ku 0 1574
-kid 1252 1033 # key id pseudo language
ky 0 2100
lo 0 1108 # Lao
lt 1257 1063 # Lithuanian
lv 1257 1062 # Latvian
mai 0 1605 # Maithili (India)
mk 1251 1071 # Macedonian
-ml-IN 0 1100
ml 0 1100
+ml-IN 0 1100
mn 0 1104 # Mongolian
mni 0 1112 # Manipuri
mn-TR 0 2128 # Mongolian Classical/traditional
@@ -81,18 +84,17 @@ nn 1252 2068
no 1252 1044
nr 0 1580 # Ndebele South
ns 0 1132 # Northern Sotho (Sepedi)
-or 0 1096 # Oriya
oc 1252 1154 # Occitan-lengadocian
+om 0 2162
+or 0 1096 # Oriya
or-IN 0 1096
pa-IN 0 1094 # Punjabi
pap 0 2171
-om 0 2162
pl 1250 1045
+ps 0 2171
pt 1252 2070
pt-BR 1252 1046
pt-PT 1252 2070
-ps 0 2171
-ca-XV 1252 32771 # Catalan Valencian
rm 0 1047 # Raeto-Romance
ro 1250 1048 # Romanian
ru 1251 1049
@@ -103,6 +105,7 @@ sb 0 1070 # Sorbian
sc 0 3047
sd 0 1113 # Sindhi
sh 1250 2074 # Serbian Latin
+si 0 2133
sk 1250 1051 # Slovak
sl 1250 1060 # Slovenian
sq 1250 1052 # Albanian
@@ -113,11 +116,10 @@ st 0 1072 # Southern Sotho, Sutu
sv 1252 1053
sw 1252 1089 # Swahili
sw-TZ 1252 1089 # Swahili
-si 0 2133
ta 0 1097 # Tamil
ta-IN 0 1097 # Tamil
-te-IN 0 1098
te 0 1098
+te-IN 0 1098
tg 0 1064 # Tajik
th 874 1054
ti-ER 0 1139
@@ -125,11 +127,11 @@ tn 0 1074 # Setsuana
tr 1254 1055 # Turkish
ts 0 1073 # Tsonga
tt 1251 1092 # Tatar
+ug 0 2200
uk 1251 1058 # Ukrainian
ur 1256 1056 # Urdu
ur-IN 0 2080
uz 0 1091 # Uzbek (Latin)
-ug 0 2200
ve 0 1075 # Venda
vi 1258 1066 # Vietnamese
xh 0 1076 # Xhosa
@@ -137,4 +139,3 @@ yi 0 1085 # Yiddish
zh-CN 936 2052
zh-TW 950 1028
zu 0 1077 # Zulu
-kk 0 1087
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index 8cf17e3f6e4f..61e972c99278 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -552,9 +552,9 @@ public:
class SfxCustomPropertiesPage : public SfxTabPage
{
private:
- FixedText m_aPropertiesFT;
CustomPropertiesControl m_aPropertiesCtrl;
PushButton m_aAddBtn;
+ FixedText m_aPropertiesFT; // Sym2_5121----, Moved by Steve Yin
DECL_LINK( AddHdl, PushButton* );
diff --git a/sfx2/inc/sfx2/mgetempl.hxx b/sfx2/inc/sfx2/mgetempl.hxx
index 60375f5272c0..a599163116e5 100644
--- a/sfx2/inc/sfx2/mgetempl.hxx
+++ b/sfx2/inc/sfx2/mgetempl.hxx
@@ -70,9 +70,9 @@ class SfxManageStyleSheetPage : public SfxTabPage
FixedText aFilterFt;
ListBox aFilterLb;
+ FixedLine aDescGb;
FixedInfo aDescFt;
MultiLineEdit aDescED;
- FixedLine aDescGb;
SfxStyleSheetBase *pStyle;
SfxStyleFamilies *pFamilies;
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index ca1d3eb6b8a4..dfa3cc8593ec 100755
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -253,6 +253,9 @@
#define STR_ERRUNOEVENTBINDUNG (RID_SFX_START+119)
#define STR_SHARED (RID_SFX_START+120)
#define RID_XMLSEC_DOCUMENTSIGNED (RID_SFX_START+121)
+// IAccessibility2 implementation 2009. ------
+#define STR_ACCTITLE_PRODUCTIVITYTOOLS (RID_SFX_START+157)
+// ------ IAccessibility2 implementation 2009.
//=========================================================================
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index ca582c0aaf12..f25e991f84f4 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -1,3 +1,3 @@
-sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL
+sf sfx2 : L10N:l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL
sf sfx2\prj nmake - all sf_prj NULL
diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src
index c3b734e327de..3bca517c5fd5 100644
--- a/sfx2/source/appl/sfx.src
+++ b/sfx2/source/appl/sfx.src
@@ -40,3 +40,8 @@ String STR_STYLE_FILTER_ALL
Text [ en-US ] = "All Styles" ;
};
+String STR_ACCTITLE_PRODUCTIVITYTOOLS
+{
+ Text [ en-US ] = "%PRODUCTNAME";
+};
+
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index b8c2bec4ba5a..2d5c383f8b89 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -828,6 +828,7 @@ SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet )
bHandleDelete ( sal_False )
{
+ aNameED.SetAccessibleName(String(SfxResId(EDIT_FILE_NAME)));
FreeResource();
ImplUpdateSignatures();
@@ -1818,6 +1819,11 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR
m_aEditLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, EditTimeoutHdl ) );
m_aBoxLoseFocusTimer.SetTimeout( 300 );
m_aBoxLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, BoxTimeoutHdl ) );
+
+ ResMgr* pResMgr = rResId.GetResMgr();
+ m_aNameBox.SetAccessibleName( String( ResId( STR_HEADER_NAME, *pResMgr ) ) );
+ m_aTypeBox.SetAccessibleName( String( ResId( STR_HEADER_TYPE, *pResMgr ) ) );
+ m_aValueEdit.SetAccessibleName( String( ResId( STR_HEADER_VALUE, *pResMgr ) ) );
}
CustomPropertiesWindow::~CustomPropertiesWindow()
@@ -2064,6 +2070,11 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
//add lose focus handlers of date/time fields
pNewLine->m_aTypeBox.SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, BoxLoseFocusHdl ) );
+
+ pNewLine->m_aNameBox.SetAccessibleName(m_aNameBox.GetAccessibleName());
+ pNewLine->m_aTypeBox.SetAccessibleName(m_aTypeBox.GetAccessibleName());
+ pNewLine->m_aValueEdit.SetAccessibleName(m_aValueEdit.GetAccessibleName());
+
long nPos = GetVisibleLineCount() * GetLineHeight();
m_aCustomPropertiesLines.push_back( pNewLine );
Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit,
@@ -2384,9 +2395,9 @@ void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny,
SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet ) :
SfxTabPage( pParent, SfxResId( TP_CUSTOMPROPERTIES ), rItemSet ),
- m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) ),
m_aPropertiesCtrl ( this, SfxResId( CTRL_PROPERTIES ) ),
- m_aAddBtn ( this, SfxResId( BTN_ADD ) )
+ m_aAddBtn ( this, SfxResId( BTN_ADD ) ),
+ m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) )
{
FreeResource();
diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc
index 5453e3606026..43bd848844a0 100644
--- a/sfx2/source/dialog/dinfdlg.hrc
+++ b/sfx2/source/dialog/dinfdlg.hrc
@@ -153,6 +153,10 @@
#define STR_HEADER_VALUE 92
#define STR_HEADER_ACTION 93
+//IAccessibility2 Implementation 2009-----
+#define EDIT_FILE_NAME 94
+//-----IAccessibility2 Implementation 2009
+
#define PB_OK 100
#define PB_CANCEL 101
#define PB_HELP 102
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index c78347e3dba3..eaa24105bb17 100644
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -303,6 +303,10 @@ TabPage TP_DOCINFODOC
{
Text [ en-US ] = "unknown" ;
};
+ String EDIT_FILE_NAME
+ {
+ Text [ en-US ] = "File Name" ;
+ };
};
// TP_DOCINFOUSER --------------------------------------------------------
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 454c42896cfe..5cac88236f4a 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -77,9 +77,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem
aFilterFt ( this, SfxResId( FT_REGION ) ),
aFilterLb ( this, SfxResId( LB_REGION ) ),
+ aDescGb ( this, SfxResId( GB_DESC ) ),
aDescFt ( this, SfxResId( FT_DESC ) ),
aDescED ( this, SfxResId( ED_DESC ) ),
- aDescGb ( this, SfxResId( GB_DESC ) ),
pStyle( &( (SfxStyleDialog*)pParent->GetParent() )->GetStyleSheet() ),
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
index 8235333857d5..17bbee8c126f 100644
--- a/sfx2/source/dialog/newstyle.cxx
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -91,6 +91,7 @@ SfxNewStyleDlg::SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& rInPool
aOKBtn.SetClickHdl(LINK(this, SfxNewStyleDlg, OKHdl));
aColBox.SetModifyHdl(LINK(this, SfxNewStyleDlg, ModifyHdl));
aColBox.SetDoubleClickHdl(LINK(this, SfxNewStyleDlg, OKHdl));
+ aColBox.SetAccessibleName(SfxResId(FL_COL));
SfxStyleSheetBase *pStyle = rPool.First();
while ( pStyle )
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index d9c1ea80636d..47af8e61d81b 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -125,6 +125,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
mbAsciiOnly ( false )
{
+ maPasswordED.SetAccessibleName(String(SfxResId(TEXT_PASSWD)));
FreeResource();
// setup layout
diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc
index 5c9b07c7a130..dd35a6449dd8 100644
--- a/sfx2/source/dialog/passwd.hrc
+++ b/sfx2/source/dialog/passwd.hrc
@@ -46,6 +46,9 @@
#define FT_PASSWD_CONFIRM2 27
#define ED_PASSWD_CONFIRM2 28
+//IAccessibility2 Implementation 2009-----
+#define TEXT_PASSWD 31
+//-----IAccessibility2 Implementation 2009
#endif
// ******************************************************************* EOF
diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src
index 426fb9986d5a..beb2f96a5e21 100644
--- a/sfx2/source/dialog/passwd.src
+++ b/sfx2/source/dialog/passwd.src
@@ -129,37 +129,10 @@ ModalDialog DLG_PASSWD
Pos = MAP_APPFONT( 144, 43 );
Size = MAP_APPFONT( 50, 14 );
};
-};
-
-// ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ String TEXT_PASSWD
+ {
+ Text [ en-US ] = "Password" ;
+ };
+};
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index e9c66e2a5f13..35a5fb766b97 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -697,6 +697,11 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText )
pExampleSet = new SfxItemSet( *pSet );
pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
}
+
+ aOKBtn.SetAccessibleRelationMemberOf( &aOKBtn );
+ aCancelBtn.SetAccessibleRelationMemberOf( &aCancelBtn );
+ aHelpBtn.SetAccessibleRelationMemberOf( &aHelpBtn );
+ aResetBtn.SetAccessibleRelationMemberOf( &aResetBtn );
}
// -----------------------------------------------------------------------
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 54df29e63e4a..d8ea47baf32d 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -778,6 +778,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx
bHierarchical ( sal_False ),
bBindingUpdate ( sal_True )
{
+ aFmtLb.SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST));
aFmtLb.SetHelpId( HID_TEMPLATE_FMT );
aFilterLb.SetHelpId( HID_TEMPLATE_FILTER );
aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT | WB_HIDESELECTION );
@@ -1792,6 +1793,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox )
FillTreeBox();
SelectStyle(aSelectEntry);
+ pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST));
pTreeBox->Show();
}
}
diff --git a/sfx2/source/dialog/templdlg.hrc b/sfx2/source/dialog/templdlg.hrc
index 58563fb9c160..e39108ce57a9 100644
--- a/sfx2/source/dialog/templdlg.hrc
+++ b/sfx2/source/dialog/templdlg.hrc
@@ -49,4 +49,7 @@
#define BT_VLIST 9
#define BT_TOOL 10
+//IAccessibility2 Implementation 2009-----
+#define STR_STYLE_ELEMTLIST 18
+//-----IAccessibility2 Implementation 2009
diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src
index 60979450d9f6..ff2661181434 100644
--- a/sfx2/source/dialog/templdlg.src
+++ b/sfx2/source/dialog/templdlg.src
@@ -143,6 +143,10 @@ ModalDialog RID_STYLECATALOG
};
};
// Strings ---------------------------------------------------------------
+String STR_STYLE_ELEMTLIST
+{
+ Text [ en-US ] = "Style List" ;
+};
String STR_STYLE_FILTER_HIERARCHICAL
{
Text [ en-US ] = "Hierarchical" ;
diff --git a/shell/prj/build.lst b/shell/prj/build.lst
index ad157a677bff..abf9af0c0c8e 100755
--- a/shell/prj/build.lst
+++ b/shell/prj/build.lst
@@ -1,4 +1,4 @@
-sl shell : l10n offuh rdbmaker tools sal EXPAT:expat LIBXSLT:libxslt NULL
+sl shell : L10N:l10n offuh rdbmaker tools sal EXPAT:expat LIBXSLT:libxslt NULL
sl shell\inc nmake - all sl_inc NULL
sl shell\source\win32 nmake - w sl_win32 sl_inc NULL
sl shell\source\win32\simplemail nmake - w sl_win32_simplemail sl_inc NULL
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
index ed9dcc3721e6..ad4df2173516 100755
--- a/solenv/bin/build.pl
+++ b/solenv/bin/build.pl
@@ -2237,7 +2237,7 @@ sub retrieve_build_list {
my $old_fh = select(STDOUT);
# Try to get global depencies from solver's build.lst if such exists
- my $solver_inc_dir = "$ENV{SOLARVER}/common";
+ my $solver_inc_dir = "$ENV{SOLARVER}/$ENV{INPATH}";
$solver_inc_dir .= $ENV{PROEXT} if (defined $ENV{PROEXT});
$solver_inc_dir .= '/inc';
$solver_inc_dir .= $ENV{UPDMINOREXT} if (defined $ENV{UPDMINOREXT});
@@ -2245,20 +2245,16 @@ sub retrieve_build_list {
$solver_inc_dir = correct_path($solver_inc_dir);
$dead_parents{$module}++;
print "Fetching dependencies for module $module from solver...";
- foreach (@possible_build_lists) {
- my $possible_build_lst = "$solver_inc_dir/$_";
- if (-e $possible_build_lst) {
+ foreach my $onelist (@possible_build_lists) {
+ my $build_list_candidate = "$solver_inc_dir/$onelist";
+ if (-e $build_list_candidate) {
print " ok\n";
select($old_fh);
- return $possible_build_lst;
+ return $build_list_candidate;
};
}
- print " failed\n";
-
- if (!defined $dead_parents{$module}) {
- print "WARNING: Cannot figure out CWS for $module. Forgot to set CWS?\n";
- }
- select($old_fh);
+ print(" failed\n");
+ print_error("incomplete dependencies!\n");
return undef;
};
diff --git a/solenv/bin/cws.pl b/solenv/bin/cws.pl
index bf9ce9508d38..c613d13bcbb1 100644
--- a/solenv/bin/cws.pl
+++ b/solenv/bin/cws.pl
@@ -75,7 +75,7 @@ my %valid_options_hash = (
'help' => ['help'],
'create' => ['help', 'milestone', 'migration', 'hg'],
'fetch' => ['help', 'milestone', 'childworkspace','platforms','noautocommon',
- 'quiet', 'onlysolver'],
+ 'quiet', 'onlysolver', 'additionalrepositories'],
'query' => ['help', 'milestone','masterworkspace','childworkspace'],
'task' => ['help'],
'setcurrent' => ['help', 'milestone'],
@@ -120,6 +120,7 @@ sub parse_command_line
'profile',
'commit|C',
'platforms|p=s',
+ 'additionalrepositories|r=s',
'noautocommon|x=s',
'onlysolver|o',
'quiet|q',
@@ -399,20 +400,23 @@ sub hg_clone_cws_or_milestone
my ($hg_local_source, $hg_lan_source, $hg_remote_source);
my $config = CwsConfig->new();
- if ( $rep_type eq 'ooo') {
- $hg_local_source = $config->get_ooo_hg_local_source();
- $hg_lan_source = $config->get_ooo_hg_lan_source();
- $hg_remote_source = $config->get_ooo_hg_remote_source();
- }
- else {
- $hg_local_source = $config->get_so_hg_local_source();
- $hg_lan_source = $config->get_so_hg_lan_source();
- $hg_remote_source = $config->get_so_hg_remote_source();
- }
+
+ $hg_local_source = $config->get_hg_source(uc $rep_type, 'LOCAL');
+ $hg_lan_source = $config->get_hg_source(uc $rep_type, 'LAN');
+ $hg_remote_source = $config->get_hg_source(uc $rep_type, 'REMOTE');
my $masterws = $cws->master();
- my $master_local_source = "$hg_local_source/" . $masterws;
- my $master_lan_source = "$hg_lan_source/" . $masterws;
+ my ($master_local_source, $master_lan_source);
+ if ($rep_type eq "ooo" || $rep_type eq "so")
+ {
+ $master_local_source = "$hg_local_source/" . $masterws;
+ $master_lan_source = "$hg_lan_source/" . $masterws;
+ }
+ else
+ {
+ $master_local_source = "$hg_local_source/master_".$rep_type."/".$masterws;
+ $master_lan_source = "$hg_lan_source/master_".$rep_type."/".$masterws;
+ }
my $milestone_tag;
if ( $clone_milestone_only ) {
@@ -434,7 +438,15 @@ sub hg_clone_cws_or_milestone
my $pull_from_remote = 0;
my $cws_remote_source;
if ( !$clone_milestone_only ) {
- $cws_remote_source = "$hg_remote_source/cws/" . $cws->child();
+ if ($rep_type eq "ooo" || $rep_type eq "so")
+ {
+ $cws_remote_source = "$hg_remote_source/cws/" . $cws->child();
+ }
+ # e.g. cws_l10n
+ else
+ {
+ $cws_remote_source = "$hg_remote_source/cws_".$rep_type."/" . $cws->child();
+ }
# The outgoing repository might not yet be available. Which is not
# an error. Since pulling from the cws outgoing URL results in an ugly
@@ -446,7 +458,8 @@ sub hg_clone_cws_or_milestone
require LWP::Simple;
my $content = LWP::Simple::get($cws_remote_source);
my $pattern = "<title>cws/". $cws->child();
- if ( $content && $content =~ /$pattern/ ) {
+ my $pattern2 = "<title>cws_".$rep_type."/". $cws->child();
+ if ( $content && ($content =~ /$pattern/ || $content =~ /$pattern2/) ) {
$pull_from_remote = 1;
}
else {
@@ -1456,10 +1469,10 @@ sub do_help
}
elsif ($arg eq 'fetch') {
print STDERR "fetch: fetch a milestone or CWS\n";
- print STDERR "usage: fetch [-q] [-p platforms] [-o] <-m milestone> <workspace>\n";
- print STDERR "usage: fetch [-q] [-p platforms] [-o] <-c cws> <workspace>\n";
- print STDERR "usage: fetch [-q] [-x platforms] [-o] <-m milestone> <workspace>\n";
- print STDERR "usage: fetch [-q] [-x platforms] [-o] <-c cws> <workspace>\n";
+ print STDERR "usage: fetch [-q] [-p platforms] [-r additionalrepositories] [-o] <-m milestone> <workspace>\n";
+ print STDERR "usage: fetch [-q] [-p platforms] [-r additionalrepositories] [-o] <-c cws> <workspace>\n";
+ print STDERR "usage: fetch [-q] [-x platforms] [-r additionalrepositories] [-o] <-m milestone> <workspace>\n";
+ print STDERR "usage: fetch [-q] [-x platforms] [-r additionalrepositories] [-o] <-c cws> <workspace>\n";
print STDERR "usage: fetch [-q] <-m milestone> <workspace>\n";
print STDERR "usage: fetch [-q] <-c cws> <workspace>\n";
print STDERR "\t-m milestone: Checkout milestone <milestone> to workspace <workspace>\n";
@@ -1475,6 +1488,8 @@ sub do_help
print STDERR "\t-x platform: Copy one or more prebuilt platforms 'platform'. \n";
print STDERR "\t Separate multiple platforms with commas.\n";
print STDERR "\t Does not automatically adds 'common[.pro]'.\n";
+ print STDERR "\t-r additionalrepositories Checkout additional repositories. \n";
+ print STDERR "\t Separate multiple repositories with commas.\n";
print STDERR "\t--noautocommon platform: Same as -x\n";
print STDERR "\t-o: Omit checkout of sources, copy only solver. \n";
print STDERR "\t--onlysolver: Same as -o\n";
@@ -1582,6 +1597,8 @@ sub do_fetch
}
my $milestone_opt = $options_ref->{'milestone'};
+ my $additional_repositories_opt = $options_ref->{'additionalrepositories'};
+ $additional_repositories_opt = "", if ( !defined $additional_repositories_opt );
my $child = $options_ref->{'childworkspace'};
my $platforms = $options_ref->{'platforms'};
my $noautocommon = $options_ref->{'noautocommon'};
@@ -1718,8 +1735,23 @@ sub do_fetch
if ( !mkdir($work_master) ) {
print_error("Can't create directory '$work_master': $!.", 8);
}
+
+ my %unique = map { $_ => 1 } split( /,/ , $additional_repositories_opt);
+ my @unique_repo_list = keys %unique;
+
+ if (defined($additional_repositories_opt))
+ {
+ foreach my $repo(@unique_repo_list)
+ {
+ # do not double clone ooo and sun
+ hg_clone_cws_or_milestone($repo, $cws, "$work_master/".$repo, $clone_milestone_only), if $repo ne "ooo" && $repo ne "sun";
+ }
+
+ }
+
hg_clone_cws_or_milestone('ooo', $cws, "$work_master/ooo", $clone_milestone_only);
hg_clone_cws_or_milestone('so', $cws, "$work_master/sun", $clone_milestone_only);
+
if ( get_source_config_for_milestone($masterws, $milestone) ) {
# write source_config file
my $source_config_file = "$work_master/source_config";
@@ -1729,6 +1761,10 @@ sub do_fetch
print SOURCE_CONFIG "[repositories]\n";
print SOURCE_CONFIG "ooo=active\n";
print SOURCE_CONFIG "sun=active\n";
+ foreach my $repo(@unique_repo_list)
+ {
+ print SOURCE_CONFIG $repo."=active\n", if $repo ne "ooo" || $repo ne "sun";
+ }
close(SOURCE_CONFIG);
}
else {
diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index d28a2e7e3fa0..c85aaffcde07 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -1955,7 +1955,7 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
installer::windows::registry::create_registry_table($registryitemsinproductlanguageresolvedarrayref, \@allregistrycomponents, $newidtdir, $languagesarrayref, $allvariableshashref);
if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems4.log", $registryitemsinproductlanguageresolvedarrayref); }
- installer::windows::component::create_component_table($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, \@allfilecomponents, \@allregistrycomponents, $newidtdir, $componentid, $componentidkeypath);
+ installer::windows::component::create_component_table($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, \@allfilecomponents, \@allregistrycomponents, $newidtdir, $componentid, $componentidkeypath, $allvariableshashref);
if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles19.log", $filesinproductlanguageresolvedarrayref); }
if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems5.log", $registryitemsinproductlanguageresolvedarrayref); }
@@ -2166,6 +2166,7 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
installer::logger::print_message( "... creating msi database (language $onelanguage) ... \n" );
installer::windows::msiglobal::set_uuid_into_component_table($languageidtdir, $allvariableshashref); # setting new GUID for the components using the tool uuidgen.exe
+ installer::windows::msiglobal::prepare_64bit_database($languageidtdir, $allvariableshashref); # making last 64 bit changes
installer::windows::msiglobal::create_msi_database($languageidtdir ,$msifilename);
# validating the database # ToDo
diff --git a/solenv/bin/modules/CwsConfig.pm b/solenv/bin/modules/CwsConfig.pm
index 6121691e1e7f..1ba12fecac1d 100644
--- a/solenv/bin/modules/CwsConfig.pm
+++ b/solenv/bin/modules/CwsConfig.pm
@@ -343,94 +343,59 @@ sub get_so_svn_server
#### HG methods ####
-sub get_ooo_hg_local_source
+sub _get_hg_source
{
- my $self = shift;
-
- if ( !defined($self->{HG_LOCAL_SOURCE}) ) {
+ my $self = shift;
+ my $repository_source = shift;
+ if ( !defined($self->{$repository_source}) ) {
my $config_file = $self->get_config_file();
- my $source = $config_file->{CWS_CONFIG}->{'HG_LOCAL_SOURCE'};
+ my $source = $config_file->{CWS_CONFIG}->{$repository_source};
if ( !defined($source) ) {
$source = "";
}
- $self->{HG_LOCAL_SOURCE} = $source;
+ $self->{$repository_source} = $source;
}
- return $self->{HG_LOCAL_SOURCE} ? $self->{HG_LOCAL_SOURCE} : undef;
-}
-
-sub get_ooo_hg_lan_source
-{
- my $self = shift;
+ return $self->{$repository_source} ? $self->{$repository_source} : undef;
- if ( !defined($self->{HG_LAN_SOURCE}) ) {
- my $config_file = $self->get_config_file();
- my $source = $config_file->{CWS_CONFIG}->{'HG_LAN_SOURCE'};
- if ( !defined($source) ) {
- $source = "";
- }
- $self->{HG_LAN_SOURCE} = $source;
- }
- return $self->{HG_LAN_SOURCE} ? $self->{HG_LAN_SOURCE} : undef;
}
-sub get_ooo_hg_remote_source
+sub get_hg_source
{
- my $self = shift;
+ my $self = shift;
+ my $repository = shift;
+ my $location = shift;
- if ( !defined($self->{HG_REMOTE_SOURCE}) ) {
- my $config_file = $self->get_config_file();
- my $source = $config_file->{CWS_CONFIG}->{'HG_REMOTE_SOURCE'};
- if ( !defined($source) ) {
- $source = "";
+ #Special prefix handling, see cwsrc
+ if ($repository eq "OOO")
+ {
+ if ($location eq "LOCAL")
+ {
+ return $self->_get_hg_source('HG_LOCAL_SOURCE');
}
- $self->{HG_REMOTE_SOURCE} = $source;
- }
- return $self->{HG_REMOTE_SOURCE} ? $self->{HG_REMOTE_SOURCE} : undef;
-}
-
-sub get_so_hg_local_source
-{
- my $self = shift;
-
- if ( !defined($self->{SO_HG_LOCAL_SOURCE}) ) {
- my $config_file = $self->get_config_file();
- my $source = $config_file->{CWS_CONFIG}->{'SO_HG_LOCAL_SOURCE'};
- if ( !defined($source) ) {
- $source = "";
+ elsif ($location eq "LAN")
+ {
+ return $self->_get_hg_source('HG_LAN_SOURCE');
}
- $self->{SO_HG_LOCAL_SOURCE} = $source;
- }
- return $self->{SO_HG_LOCAL_SOURCE} ? $self->{SO_HG_LOCAL_SOURCE} : undef;
-}
-
-sub get_so_hg_lan_source
-{
- my $self = shift;
-
- if ( !defined($self->{SO_HG_LAN_SOURCE}) ) {
- my $config_file = $self->get_config_file();
- my $source = $config_file->{CWS_CONFIG}->{'SO_HG_LAN_SOURCE'};
- if ( !defined($source) ) {
- $source = "";
+ elsif ($location eq "REMOTE")
+ {
+ return $self->_get_hg_source('HG_REMOTE_SOURCE');
}
- $self->{SO_HG_LAN_SOURCE} = $source;
}
- return $self->{SO_HG_LAN_SOURCE} ? $self->{SO_HG_LAN_SOURCE} : undef;
-}
-
-sub get_so_hg_remote_source
-{
- my $self = shift;
-
- if ( !defined($self->{SO_HG_REMOTE_SOURCE}) ) {
- my $config_file = $self->get_config_file();
- my $source = $config_file->{CWS_CONFIG}->{'SO_HG_REMOTE_SOURCE'};
- if ( !defined($source) ) {
- $source = "";
+ else
+ {
+ if ($location eq "LOCAL")
+ {
+ return $self->_get_hg_source($repository.'_HG_LOCAL_SOURCE');
+ }
+ elsif ($location eq "LAN")
+ {
+ return $self->_get_hg_source($repository.'_HG_LAN_SOURCE');
+ }
+ elsif ($location eq "REMOTE")
+ {
+ return $self->_get_hg_source($repository.'_HG_REMOTE_SOURCE');
}
- $self->{SO_HG_REMOTE_SOURCE} = $source;
}
- return $self->{SO_HG_REMOTE_SOURCE} ? $self->{SO_HG_REMOTE_SOURCE} : undef;
}
#### Prebuild binaries configuration ####
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
index 144cf4c88a4b..1536cb993db0 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -87,7 +87,8 @@ BEGIN
"oc",
"ml",
"as",
- "ast"
+ "ast",
+ "ht"
);
@items_at_modules = ("Files", "Dirs", "Unixlinks");
@asianlanguages = ("ja", "ko", "zh-CN", "zh-TW");
@@ -374,6 +375,10 @@ BEGIN
%spellcheckerlanguagehash = ();
%spellcheckerfilehash = ();
$registryrootcomponent = "";
+ %allcomponents = ();
+ %allcomponents_in_this_database = ();
+ %allshortcomponents = ();
+ %alluniquedirectorynames = ();
$installlocationdirectory = "";
$installlocationdirectoryset = 0;
diff --git a/solenv/bin/modules/installer/windows/component.pm b/solenv/bin/modules/installer/windows/component.pm
index 38989858a4b6..4ab5aac68954 100644
--- a/solenv/bin/modules/installer/windows/component.pm
+++ b/solenv/bin/modules/installer/windows/component.pm
@@ -193,7 +193,7 @@ sub get_registry_component_directory
sub get_file_component_attributes
{
- my ($componentname, $filesref) = @_;
+ my ($componentname, $filesref, $allvariables) = @_;
my $attributes;
@@ -240,6 +240,9 @@ sub get_file_component_attributes
$attributes = 4; # Files in shellnew dir and in non advertised startmenu entries must have user registry key as KeyPath
}
+ # Adding 256, if this is a 64 bit installation set.
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes = $attributes + 256; }
+
return $attributes
}
@@ -251,12 +254,15 @@ sub get_file_component_attributes
sub get_registry_component_attributes
{
- my ($componentname) = @_;
+ my ($componentname, $allvariables) = @_;
my $attributes;
$attributes = 4;
+ # Adding 256, if this is a 64 bit installation set.
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes = $attributes + 256; }
+
if ( exists($installer::globals::dontdeletecomponents{$componentname}) ) { $attributes = $attributes + 16; }
return $attributes
@@ -381,7 +387,7 @@ sub get_component_keypath
sub create_component_table
{
- my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref) = @_;
+ my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref, $allvariables) = @_;
my @componenttable = ();
@@ -402,7 +408,7 @@ sub create_component_table
$onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref);
$onecomponent{'directory'} = get_file_component_directory($onecomponent{'name'}, $filesref, $dirref);
if ( $onecomponent{'directory'} eq "IGNORE_COMP" ) { next; }
- $onecomponent{'attributes'} = get_file_component_attributes($onecomponent{'name'}, $filesref);
+ $onecomponent{'attributes'} = get_file_component_attributes($onecomponent{'name'}, $filesref, $allvariables);
$onecomponent{'condition'} = get_file_component_condition($onecomponent{'name'}, $filesref);
$onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $filesref, $componentidkeypathhashref);
@@ -421,7 +427,7 @@ sub create_component_table
$onecomponent{'name'} = ${$allregistrycomponents}[$i];
$onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref);
$onecomponent{'directory'} = get_registry_component_directory();
- $onecomponent{'attributes'} = get_registry_component_attributes($onecomponent{'name'});
+ $onecomponent{'attributes'} = get_registry_component_attributes($onecomponent{'name'}, $allvariables);
$onecomponent{'condition'} = get_component_condition($onecomponent{'name'});
$onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $registryref, $componentidkeypathhashref);
diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm
index ba6f9a3b75bd..f7b13747e3bf 100644
--- a/solenv/bin/modules/installer/windows/directory.pm
+++ b/solenv/bin/modules/installer/windows/directory.pm
@@ -77,19 +77,78 @@ sub overwrite_programfilesfolder
}
##############################################################
+# Maximum length of directory name is 72.
+# Taking care of underlines, which are the separator.
+##############################################################
+
+sub make_short_dir_version
+{
+ my ($longstring, $length, $displayname) = @_;
+
+ my $shortstring = "";
+ my $infoline = "";
+ my $savestring = $longstring;
+
+ # Splitting the string at each "underline" and allowing only $length characters per directory name.
+ # Checking also uniqueness and length.
+
+ my $stringarray = installer::converter::convert_stringlist_into_array_without_newline(\$longstring, "_");
+
+ foreach my $onestring ( @{$stringarray} )
+ {
+ my $partstring = "";
+
+ if ( $onestring =~ /\-/ )
+ {
+ my $localstringarray = installer::converter::convert_stringlist_into_array_without_newline(\$onestring, "-");
+ foreach my $onelocalstring ( @{$localstringarray} )
+ {
+ if ( length($onelocalstring) > $length ) { $onelocalstring = substr($onelocalstring, 0, $length); }
+ $partstring = $partstring . "-" . $onelocalstring;
+ }
+ $partstring =~ s/^\s*\-//;
+ }
+ else
+ {
+ if ( length($onestring) > $length ) { $partstring = substr($onestring, 0, $length); }
+ else { $partstring = $onestring; }
+ }
+
+ $shortstring = $shortstring . "_" . $partstring;
+ }
+
+ $shortstring =~ s/^\s*\_//;
+
+ if ( length($shortstring) > 72 )
+ {
+ my $shortlength = length($shortstring);
+ $infoline = "WARNING: Failed to create unique directory name with less than 72 characters: \"$displayname\" ($shortstring ($shortlength)).\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ return $shortstring;
+}
+
+##############################################################
# Adding unique directory names to the directory collection
##############################################################
sub create_unique_directorynames
{
- my ($directoryref) = @_;
+ my ($directoryref, $allvariables) = @_;
$installer::globals::officeinstalldirectoryset = 0;
+ my %conversionhash = ();
+ my $infoline = "";
+ my $errorcount = 0;
+
for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
{
my $onedir = ${$directoryref}[$i];
- my $uniquename = $onedir->{'HostName'};
+ my $hostname = $onedir->{'HostName'};
+
+ my $uniquename = $hostname;
my $styles = "";
if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
# get_path_from_fullqualifiedname(\$uniqueparentname);
@@ -101,6 +160,42 @@ sub create_unique_directorynames
$uniquename =~ s/\_//g; # removing existing underlines
$uniquename =~ s/\.//g; # removing dots in directoryname
$uniquename =~ s/\Q$installer::globals::separator\E/\_/g; # replacing slash and backslash with underline
+ $uniquename =~ s/OpenOffice/OO/g;
+ $uniquename =~ s/_registry/_rgy/g;
+ $uniquename =~ s/_registration/_rgn/g;
+ $uniquename =~ s/_extension/_ext/g;
+ $uniquename =~ s/_frame/_frm/g;
+ $uniquename =~ s/_table/_tbl/g;
+ $uniquename =~ s/_chart/_crt/g;
+
+ my $startlength = 5;
+
+ if ( ! $allvariables->{'NOSHORTDIRECTORYNAMES'} )
+ {
+ # This process does not work for SDK, because of its long and similar pathes
+ $uniquename = make_short_dir_version($uniquename, $startlength, $hostname); # taking care of underlines!
+ }
+
+ if ( exists($installer::globals::alluniquedirectorynames{$uniquename}) )
+ {
+ # This is an error, that must stop the packaging process
+ $errorcount++;
+
+ $infoline = "$errorcount: Already existing unique directory: $uniquename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "$errorcount: First full directory: $conversionhash{$uniquename}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "$errorcount: Current full directory: $hostname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $conversionhash{$uniquename} = $hostname;
+
+ $installer::globals::alluniquedirectorynames{$uniquename} = 1;
+
+ # Important: The unique parent is generated from the string $uniquename. Therefore counters
+ # like adding "_1" is not allowed to achive uniqueness, because this depends from other directories
+ # and does not deliver always the same result.
my $uniqueparentname = $uniquename;
@@ -147,6 +242,11 @@ sub create_unique_directorynames
$installer::globals::vendordirectoryset = 1;
}
}
+
+ if ( $errorcount > 0 )
+ {
+ installer::exiter::exit_program("ERROR: Failed to create unique directory names.", "create_unique_directorynames");
+ }
}
#####################################################
@@ -434,8 +534,9 @@ sub create_directory_table
my $infoline;
overwrite_programfilesfolder($allvariableshashref);
- create_unique_directorynames($directoryref);
if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1.log", $directoryref); }
+ create_unique_directorynames($directoryref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1a.log", $directoryref); }
create_defaultdir_directorynames($directoryref, $shortdirnamehashref); # only destdir!
if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_2.log", $directoryref); }
set_installlocation_directory($directoryref, $allvariableshashref);
diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm
index 10666be7460c..b679d8b46e2b 100644
--- a/solenv/bin/modules/installer/windows/file.pm
+++ b/solenv/bin/modules/installer/windows/file.pm
@@ -170,6 +170,40 @@ sub assign_sequencenumbers_to_files
}
}
+#########################################################
+# Create a shorter version of a long component name,
+# because maximum length in msi database is 72.
+# Attention: In multi msi installation sets, the short
+# names have to be unique over all packages, because
+# this string is used to create the globally unique id
+# -> no resetting of
+# %installer::globals::allshortcomponents
+# after a package was created.
+#########################################################
+
+sub generate_new_short_componentname
+{
+ my ($componentname) = @_;
+
+ my $shortcomponentname = "";
+ my $counter = 1;
+
+ my $startversion = substr($componentname, 0, 60); # taking only the first 60 characters
+ $startversion = $startversion . "_";
+
+ $shortcomponentname = $startversion . $counter;
+
+ while ( exists($installer::globals::allshortcomponents{$shortcomponentname}) )
+ {
+ $counter++;
+ $shortcomponentname = $startversion . $counter;
+ }
+
+ $installer::globals::allshortcomponents{$shortcomponentname} = 1;
+
+ return $shortcomponentname;
+}
+
###############################################
# Generating the component name from a file
###############################################
@@ -178,77 +212,139 @@ sub get_file_component_name
{
my ($fileref, $filesref) = @_;
- # In this function exists the rule to create components from files
- # Rule:
- # Two files get the same componentid, if:
- # both have the same destination directory.
- # both have the same "gid" -> both were packed in the same zip file
- # All other files are included into different components!
-
- # my $componentname = $fileref->{'gid'} . "_" . $fileref->{'Dir'};
-
- # $fileref->{'Dir'} is not sufficient! All files in a zip file have the same $fileref->{'Dir'},
- # but can be in different subdirectories.
- # Solution: destination=share\Scripts\beanshell\Capitalise\capitalise.bsh
- # in which the filename (capitalise.bsh) has to be removed and all backslashes (slashes) are
- # converted into underline.
-
- my $destination = $fileref->{'destination'};
- installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
- $destination =~ s/\s//g;
- $destination =~ s/\\/\_/g;
- $destination =~ s/\//\_/g;
- $destination =~ s/\_\s*$//g; # removing ending underline
-
- my $componentname = $fileref->{'gid'} . "__" . $destination;
-
- # Files with different languages, need to be packed into different components.
- # Then the installation of the language specific component is determined by a language condition.
-
- if ( $fileref->{'ismultilingual'} )
- {
- my $officelanguage = $fileref->{'specificlanguage'};
- $componentname = $componentname . "_" . $officelanguage;
- }
-
- $componentname = lc($componentname); # componentnames always lowercase
-
- $componentname =~ s/\-/\_/g; # converting "-" to "_"
- $componentname =~ s/\./\_/g; # converting "-" to "_"
-
- # Attention: Maximum length for the componentname is 72
-
- $componentname =~ s/gid_file_/g_f_/g;
- $componentname =~ s/_extra_/_e_/g;
- $componentname =~ s/_config_/_c_/g;
- $componentname =~ s/_org_openoffice_/_o_o_/g;
- $componentname =~ s/_program_/_p_/g;
- $componentname =~ s/_typedetection_/_td_/g;
- $componentname =~ s/_linguistic_/_l_/g;
- $componentname =~ s/_module_/_m_/g;
- $componentname =~ s/_optional_/_opt_/g;
- $componentname =~ s/_packages/_pack/g;
- $componentname =~ s/_menubar/_mb/g;
- $componentname =~ s/_common_/_cm_/g;
- $componentname =~ s/_export_/_exp_/g;
- $componentname =~ s/_table_/_tb_/g;
- $componentname =~ s/_sofficecfg_/_sc_/g;
- $componentname =~ s/_startmodulecommands_/_smc_/g;
- $componentname =~ s/_drawimpresscommands_/_dic_/g;
- $componentname =~ s/_basiccommands_/_bac_/g;
- $componentname =~ s/_basicidecommands_/_baic_/g;
- $componentname =~ s/_genericcommands_/_genc_/g;
- $componentname =~ s/_bibliographycommands_/_bibc_/g;
- $componentname =~ s/_share_/_s_/g;
- $componentname =~ s/_modules_/_ms_/g;
- $componentname =~ s/_uiconfig_zip_/_ucz_/g;
- $componentname =~ s/_soffice_cfg_/_sc_/g;
-
- # All this is not necessary for files, which have the flag ASSIGNCOMPOMENT
+ my $componentname = "";
+
+ # Special handling for files with ASSIGNCOMPOMENT
my $styles = "";
if ( $fileref->{'Styles'} ) { $styles = $fileref->{'Styles'}; }
- if ( $styles =~ /\bASSIGNCOMPOMENT\b/ ) { $componentname = get_component_from_assigned_file($fileref->{'AssignComponent'}, $filesref); }
+ if ( $styles =~ /\bASSIGNCOMPOMENT\b/ )
+ {
+ $componentname = get_component_from_assigned_file($fileref->{'AssignComponent'}, $filesref);
+ }
+ else
+ {
+ # In this function exists the rule to create components from files
+ # Rule:
+ # Two files get the same componentid, if:
+ # both have the same destination directory.
+ # both have the same "gid" -> both were packed in the same zip file
+ # All other files are included into different components!
+
+ # my $componentname = $fileref->{'gid'} . "_" . $fileref->{'Dir'};
+
+ # $fileref->{'Dir'} is not sufficient! All files in a zip file have the same $fileref->{'Dir'},
+ # but can be in different subdirectories.
+ # Solution: destination=share\Scripts\beanshell\Capitalise\capitalise.bsh
+ # in which the filename (capitalise.bsh) has to be removed and all backslashes (slashes) are
+ # converted into underline.
+
+ my $destination = $fileref->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+ $destination =~ s/\s//g;
+ $destination =~ s/\\/\_/g;
+ $destination =~ s/\//\_/g;
+ $destination =~ s/\_\s*$//g; # removing ending underline
+
+ $componentname = $fileref->{'gid'} . "__" . $destination;
+
+ # Files with different languages, need to be packed into different components.
+ # Then the installation of the language specific component is determined by a language condition.
+
+ if ( $fileref->{'ismultilingual'} )
+ {
+ my $officelanguage = $fileref->{'specificlanguage'};
+ $componentname = $componentname . "_" . $officelanguage;
+ }
+
+ $componentname = lc($componentname); # componentnames always lowercase
+
+ $componentname =~ s/\-/\_/g; # converting "-" to "_"
+ $componentname =~ s/\./\_/g; # converting "-" to "_"
+
+ # Attention: Maximum length for the componentname is 72
+ # %installer::globals::allcomponents_in_this_database : resetted for each database
+ # %installer::globals::allcomponents : not resetted for each database
+ # Component strings must be unique for the complete product, because they are used for
+ # the creation of the globally unique identifier.
+
+ my $fullname = $componentname; # This can be longer than 72
+
+ if (( exists($installer::globals::allcomponents{$fullname}) ) && ( ! exists($installer::globals::allcomponents_in_this_database{$fullname}) ))
+ {
+ # This is not allowed: One component cannot be installed with different packages.
+ installer::exiter::exit_program("ERROR: Component \"$fullname\" is already included into another package. This is not allowed.", "get_file_component_name");
+ }
+
+ if ( exists($installer::globals::allcomponents{$fullname}) )
+ {
+ $componentname = $installer::globals::allcomponents{$fullname};
+ }
+ else
+ {
+ if ( length($componentname) > 72 )
+ {
+ # Using md5sum needs much time
+ # chomp(my $shorter = `echo $componentname | md5sum | sed -e "s/ .*//g"`);
+ # $componentname = "comp_$shorter";
+ $componentname = generate_new_short_componentname($componentname); # This has to be unique for the complete product, not only one package
+ }
+
+ $installer::globals::allcomponents{$fullname} = $componentname;
+ $installer::globals::allcomponents_in_this_database{$fullname} = 1;
+ }
+
+ # $componentname =~ s/gid_file_/g_f_/g;
+ # $componentname =~ s/_extra_/_e_/g;
+ # $componentname =~ s/_config_/_c_/g;
+ # $componentname =~ s/_org_openoffice_/_o_o_/g;
+ # $componentname =~ s/_program_/_p_/g;
+ # $componentname =~ s/_typedetection_/_td_/g;
+ # $componentname =~ s/_linguistic_/_l_/g;
+ # $componentname =~ s/_module_/_m_/g;
+ # $componentname =~ s/_optional_/_opt_/g;
+ # $componentname =~ s/_packages/_pack/g;
+ # $componentname =~ s/_menubar/_mb/g;
+ # $componentname =~ s/_common_/_cm_/g;
+ # $componentname =~ s/_export_/_exp_/g;
+ # $componentname =~ s/_table_/_tb_/g;
+ # $componentname =~ s/_sofficecfg_/_sc_/g;
+ # $componentname =~ s/_soffice_cfg_/_sc_/g;
+ # $componentname =~ s/_startmodulecommands_/_smc_/g;
+ # $componentname =~ s/_drawimpresscommands_/_dic_/g;
+ # $componentname =~ s/_basiccommands_/_bac_/g;
+ # $componentname =~ s/_basicidecommands_/_baic_/g;
+ # $componentname =~ s/_genericcommands_/_genc_/g;
+ # $componentname =~ s/_bibliographycommands_/_bibc_/g;
+ # $componentname =~ s/_gentiumbookbasicbolditalic_/_gbbbi_/g;
+ # $componentname =~ s/_share_/_s_/g;
+ # $componentname =~ s/_extension_/_ext_/g;
+ # $componentname =~ s/_extensions_/_exs_/g;
+ # $componentname =~ s/_modules_/_ms_/g;
+ # $componentname =~ s/_uiconfig_zip_/_ucz_/g;
+ # $componentname =~ s/_productivity_/_pr_/g;
+ # $componentname =~ s/_wizard_/_wz_/g;
+ # $componentname =~ s/_import_/_im_/g;
+ # $componentname =~ s/_javascript_/_js_/g;
+ # $componentname =~ s/_template_/_tpl_/g;
+ # $componentname =~ s/_tplwizletter_/_twl_/g;
+ # $componentname =~ s/_beanshell_/_bs_/g;
+ # $componentname =~ s/_presentation_/_bs_/g;
+ # $componentname =~ s/_columns_/_cls_/g;
+ # $componentname =~ s/_python_/_py_/g;
+
+ # $componentname =~ s/_tools/_ts/g;
+ # $componentname =~ s/_transitions/_trs/g;
+ # $componentname =~ s/_scriptbinding/_scrb/g;
+ # $componentname =~ s/_spreadsheet/_ssh/g;
+ # $componentname =~ s/_publisher/_pub/g;
+ # $componentname =~ s/_presenter/_pre/g;
+ # $componentname =~ s/_registry/_reg/g;
+
+ # $componentname =~ s/screen/sc/g;
+ # $componentname =~ s/wordml/wm/g;
+ # $componentname =~ s/openoffice/oo/g;
+ }
return $componentname;
}
diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm
index 64dc2f34a12a..453464a3ae36 100644
--- a/solenv/bin/modules/installer/windows/idtglobal.pm
+++ b/solenv/bin/modules/installer/windows/idtglobal.pm
@@ -90,10 +90,8 @@ sub get_next_free_number
}
until (!($alreadyexists));
- if (( $counter > 9 ) && ( length($name) > 6 ))
- {
- $dontsave = 1;
- }
+ if (( $counter > 9 ) && ( length($name) > 6 )) { $dontsave = 1; }
+ if (( $counter > 99 ) && ( length($name) > 5 )) { $dontsave = 1; }
if (!($dontsave))
{
@@ -192,6 +190,14 @@ sub make_eight_three_conform
$name =~ s/\s*$//; # removing ending whitespaces
$name = $name . "\~";
$number = get_next_free_number($name, $shortnamesref);
+
+ if ( $number > 99 )
+ {
+ $name = substr($name, 0, 4); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+ }
}
$name = $name . "$number";
@@ -224,6 +230,14 @@ sub make_eight_three_conform
$name =~ s/\s*$//; # removing ending whitespaces
$name = $name . "\~";
$number = get_next_free_number($name, $shortnamesref);
+
+ if ( $number > 99 )
+ {
+ $name = substr($name, 0, 4); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+ }
}
$name = $name . "$number";
diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm
index 716f63499a02..dbb6e051aa29 100644
--- a/solenv/bin/modules/installer/windows/msiglobal.pm
+++ b/solenv/bin/modules/installer/windows/msiglobal.pm
@@ -785,11 +785,16 @@ sub get_codepage_for_sis
sub get_template_for_sis
{
- my ( $language ) = @_;
+ my ( $language, $allvariables ) = @_;
my $windowslanguage = installer::windows::language::get_windows_language($language);
- my $value = "\"Intel;" . $windowslanguage; # adding the Windows language
+ my $architecture = "Intel";
+
+ # Adding 256, if this is a 64 bit installation set.
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $architecture = "x64"; }
+
+ my $value = "\"" . $architecture . ";" . $windowslanguage; # adding the Windows language
$value = $value . "\""; # adding ending '"'
@@ -927,7 +932,7 @@ sub write_summary_into_msi_database
my $msiversion = get_msiversion_for_sis();
my $codepage = get_codepage_for_sis($language);
- my $template = get_template_for_sis($language);
+ my $template = get_template_for_sis($language, $allvariableshashref);
my $guid = get_packagecode_for_sis();
my $title = get_title_for_sis($sislanguage,$languagefile, "OOO_SIS_TITLE");
my $author = get_author_for_sis();
@@ -1669,6 +1674,104 @@ sub set_uuid_into_component_table
}
+#########################################################################
+# Adding final 64 properties into msi database, if required.
+# RegLocator : +16 in type column to search in 64 bit registry.
+# All conditions: "VersionNT" -> "VersionNT64" (several tables).
+# Already done: "+256" in Attributes column of table "Component".
+# Still following: Setting "x64" instead of "Intel" in Summary
+# Information Stream of msi database in "get_template_for_sis".
+#########################################################################
+
+sub prepare_64bit_database
+{
+ my ($basedir, $allvariables) = @_;
+
+ my $infoline = "";
+
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 ))
+ {
+ # 1. Beginning with table "RegLocat.idt". Adding "16" to the type.
+
+ my $reglocatfile = "";
+ my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt";
+
+ if ( -f $reglocatfilename )
+ {
+ my $saving_required = 0;
+ $reglocatfile = installer::files::read_file($reglocatfilename);
+
+ for ( my $i = 3; $i <= $#{$reglocatfile}; $i++ ) # ignoring the first three lines
+ {
+ my $oneline = ${$reglocatfile}[$i];
+
+ if ( $oneline =~ /^\s*\#/ ) { next; } # this is a comment line
+ if ( $oneline =~ /^\s*$/ ) { next; }
+
+ if ( $oneline =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(\d+)\s*$/ )
+ {
+ # Syntax: Signature_ Root Key Name Type
+ my $sig = $1;
+ my $root = $2;
+ my $key = $3;
+ my $name = $4;
+ my $type = $5;
+
+ $type = $type + 16;
+
+ my $newline = $sig . "\t" . $root . "\t" . $key . "\t" . $name . "\t" . $type . "\n";
+ ${$reglocatfile}[$i] = $newline;
+
+ $saving_required = 1;
+ }
+ }
+
+ if ( $saving_required )
+ {
+ # Saving the files
+ installer::files::save_file($reglocatfilename ,$reglocatfile);
+ $infoline = "Making idt file 64 bit conform: $reglocatfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # 2. Replacing all occurences of "VersionNT" by "VersionNT64"
+
+ my @versionnt_files = ("Componen.idt", "InstallE.idt", "InstallU.idt", "LaunchCo.idt");
+
+ foreach my $onefile ( @versionnt_files )
+ {
+ my $fullfilename = $basedir . $installer::globals::separator . $onefile;
+
+ if ( -f $fullfilename )
+ {
+ my $saving_required = 0;
+ $filecontent = installer::files::read_file($fullfilename);
+
+ for ( my $i = 3; $i <= $#{$filecontent}; $i++ ) # ignoring the first three lines
+ {
+ my $oneline = ${$filecontent}[$i];
+
+ if ( $oneline =~ /\bVersionNT\b/ )
+ {
+ ${$filecontent}[$i] =~ s/\bVersionNT\b/VersionNT64/g;
+ $saving_required = 1;
+ }
+ }
+
+ if ( $saving_required )
+ {
+ # Saving the files
+ installer::files::save_file($fullfilename ,$filecontent);
+ $infoline = "Making idt file 64 bit conform: $fullfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ }
+
+}
+
#################################################################
# Include all cab files into the msi database.
# This works only on Windows
diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini
index 3b096337d5d7..c2579cd5b952 100644
--- a/solenv/config/sdev300.ini
+++ b/solenv/config/sdev300.ini
@@ -9,7 +9,7 @@ common
BMP_WRITES_FLAG TRUE
BUILD_SPECIAL TRUE
BUILD_STAX YES
- BUILD_TYPE SO OOo EXT BINFILTER MORE_FONTS BSH CURL DICTIONARIES HSQLDB HUNSPELL HYPHEN MYTHES JPEG LIBXML2 LIBXMLSEC LPSOLVE MOZ NEON TWAIN PYTHON ZLIB SANE UNIXODBC X11_EXTENSIONS LIBWPD EPM ODK MSFONTEXTRACT MATHMLDTD BOOST MDDS EXPAT CRASHREP BERKELEYDB LIBXSLT SUN AGG GTK ICU SYSTRAY_GTK JAVAINSTALLER2 VIGRA OPENSSL JFREEREPORT APACHE_COMMONS TOMCAT REPORTBUILDER SDEXT SWEXT XPDF LUCENE REDLAND SAXON WRITER2LATEX NSS L10N GRAPHITE MYSQLCPPCONN MYSQLC CPPUNIT LIBTEXTCAT LIBTEXTCATDATA AFMS
+ BUILD_TYPE SO OOo EXT BINFILTER MORE_FONTS BSH CURL DICTIONARIES HSQLDB HUNSPELL HYPHEN MYTHES JPEG LIBXML2 LIBXMLSEC LPSOLVE MOZ NEON TWAIN PYTHON ZLIB SANE UNIXODBC X11_EXTENSIONS LIBWPD EPM ODK MSFONTEXTRACT MATHMLDTD BOOST MDDS EXPAT CRASHREP BERKELEYDB LIBXSLT SUN AGG GTK ICU SYSTRAY_GTK JAVAINSTALLER2 VIGRA OPENSSL JFREEREPORT APACHE_COMMONS TOMCAT REPORTBUILDER SDEXT SWEXT XPDF LUCENE REDLAND SAXON WRITER2LATEX NSS GRAPHITE MYSQLCPPCONN MYSQLC CPPUNIT LIBTEXTCAT LIBTEXTCATDATA AFMS
CONFIG_PROJECT config_office
DIC_ALL TRUE
ENABLEUNICODE TRUE
@@ -58,7 +58,6 @@ common
common:2 IF %UPDATER% == YES
{
WITH_LANG en-US de
- BUILD_TYPE l10n
}
common:3 IF %UPDATER% != YES
{
@@ -96,6 +95,7 @@ common
PROEXT .pro
PROFULLSWITCH product=full
}
+
r_only
{
LU_RFLAG r_only
@@ -116,7 +116,7 @@ common
SRC_ROOT
UPDATER
}
- order minorext common:2 common:3 pro:0 pro:1 common common:0 cwsname common:1 tmp crashdump maxproc hg r_only nosource
+ order minorext common:2 common:3 pro:0 pro:1 common common:0 cwsname common:1 tmp crashdump maxproc hg r_only nosource
reset
{
ALT_L10N_MODULE
@@ -219,6 +219,11 @@ finish
gb_REPOS %SOURCE_ROOT_DIR%/ooo %SOURCE_ROOT_DIR%/sun
gb_LOCALBUILDDIR %SOL_TMP%/gb_%CWS_WORK_STAMP%/%WORK_STAMP%
}
+ common_setrepo:0 IF X%WITH_LANG%X != XX
+ {
+ gb_REPOS %gb_REPOS% %SOURCE_ROOT_DIR%/l10n
+ BUILD_TYPE %BUILD_TYPE% L10N
+ }
common_jre:0 IF %JREPATH% ==
{
HIER set
@@ -299,7 +304,7 @@ finish
JAVA_TARGET_FLAG -target 1.6
}
}
- order cwsname:0 cwsname:1 cwsname:2 common_0:0 common_0:1 common_0:2 common_0:3 jdk14 jdk15 ojdk16 common_1 common_2:0 l10n common_jre:0 common_jre:1 cax cap common_a
+ order cwsname:0 cwsname:1 cwsname:2 common_0:0 common_0:1 common_0:2 common_0:3 jdk14 jdk15 ojdk16 common_1 common_2:0 l10n common_jre:0 common_jre:1 cax cap common_a common_setrepo:0
switches
{
cwsname CWS_WORK_STAMP
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index 3bf50bd4e988..1b7acc947bfc 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -28,11 +28,10 @@
# SrsPartMergeTarget class
gb_SrsPartMergeTarget_TRANSEXTARGET := $(call gb_Executable_get_target,transex3)
-gb_SrsPartMergeTarget_TRANSEXAUXDEPS := $(call gb_Library_get_target,tl) $(call gb_Library_get_target,sal)
# gb_SrsPartMergeTarget_TRANSEXPRECOMMAND is set by the platforms
gb_SrsPartMergeTarget_TRANSEXCOMMAND := $(gb_SrsPartMergeTarget_TRANSEXPRECOMMAND) $(gb_SrsPartMergeTarget_TRANSEXTARGET)
-gb_SrsPartMergeTarget_SDFLOCATION := $(SRCDIR)/l10n/$(INPATH)/misc/sdf/
+gb_SrsPartMergeTarget_SDFLOCATION := $(LOCDIR)/l10n/$(INPATH)/misc/sdf/
gb_SrsPartMergeTarget_REPOS := $(gb_REPOS)
define gb_SrsPartMergeTarget__command
@@ -49,7 +48,7 @@ $(call gb_Helper_abbreviate_dirs_native,\
endef
define gb_SrsPartMergeTarget__rules
-$$(call gb_SrsPartMergeTarget_get_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY) | $$(gb_SrsPartMergeTarget_TRANSEXTARGET) $$(gb_SrsPartMergeTarget_TRANSEXAUXDEPS)
+$$(call gb_SrsPartMergeTarget_get_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY) | $$(gb_SrsPartMergeTarget_TRANSEXTARGET)
$$(if $$(SDF),$$(call gb_SrsPartMergeTarget__command,$$@,$$*,$$<),mkdir -p $$(dir $$@) && cp $$< $$@)
endef
diff --git a/solenv/gbuild/SdiTarget.mk b/solenv/gbuild/SdiTarget.mk
index 49bf290e096c..8f8670c6950d 100644
--- a/solenv/gbuild/SdiTarget.mk
+++ b/solenv/gbuild/SdiTarget.mk
@@ -32,10 +32,9 @@
# SdiTarget class
gb_SdiTarget_SVIDLTARGET := $(call gb_Executable_get_target,svidl)
-gb_SdiTarget_SVIDLAUXDEPS := $(call gb_Library_get_target,tl) $(call gb_Library_get_target,sal)
gb_SdiTarget_SVIDLCOMMAND := $(gb_SdiTarget_SVIDLPRECOMMAND) $(gb_SdiTarget_SVIDLTARGET)
-$(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET) $(gb_SdiTarget_SVIDLAUXDEPS)
+$(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET)
$(call gb_Output_announce,$*,$(true),SDI,1)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $@))
diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index a000f8bfad1f..2cbeca889001 100755
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -122,7 +122,7 @@ gb_LinkTarget_NOEXCEPTIONFLAGS := \
gb_LinkTarget_LDFLAGS := \
-Wl,--sysroot=$(SYSBASE) \
- -Wl,-rpath-link=$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
+ -Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
-Wl,-z,combreloc \
-Wl,-z,defs \
$(subst -L../lib , ,$(SOLARLIB)) \
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 22c264dbe4e7..f953dfbee599 100755
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -34,7 +34,7 @@ gb_CC := cc
gb_CXX := CC
gb_GCCP := cc
gb_AR := ar
-gb_AWK := nawk
+gb_AWK := /usr/xpg4/bin/awk
gb_CLASSPATHSEP := :
# use CC/CXX if they are nondefaults
diff --git a/solenv/inc/_cppunit.mk b/solenv/inc/_cppunit.mk
index 8d9e45d33331..85804dd41ac6 100644
--- a/solenv/inc/_cppunit.mk
+++ b/solenv/inc/_cppunit.mk
@@ -1,7 +1,7 @@
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL1TARGET)"!=""
+.IF "$(SHL1TARGETN)"!=""
ALLTAR : test1
test1 .PHONY : $(SHL1TARGETN)
@echo ----------------------------------------------------------
@@ -13,7 +13,7 @@ test1 .PHONY : $(SHL1TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL2TARGET)"!=""
+.IF "$(SHL2TARGETN)"!=""
ALLTAR : test2
test2 .PHONY : $(SHL2TARGETN)
@echo ----------------------------------------------------------
@@ -25,7 +25,7 @@ test2 .PHONY : $(SHL2TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL3TARGET)"!=""
+.IF "$(SHL3TARGETN)"!=""
ALLTAR : test3
test3 .PHONY : $(SHL3TARGETN)
@echo ----------------------------------------------------------
@@ -37,7 +37,7 @@ test3 .PHONY : $(SHL3TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL4TARGET)"!=""
+.IF "$(SHL4TARGETN)"!=""
ALLTAR : test4
test4 .PHONY : $(SHL4TARGETN)
@echo ----------------------------------------------------------
@@ -49,7 +49,7 @@ test4 .PHONY : $(SHL4TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL5TARGET)"!=""
+.IF "$(SHL5TARGETN)"!=""
ALLTAR : test5
test5 .PHONY : $(SHL5TARGETN)
@echo ----------------------------------------------------------
@@ -61,7 +61,7 @@ test5 .PHONY : $(SHL5TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL6TARGET)"!=""
+.IF "$(SHL6TARGETN)"!=""
ALLTAR : test6
test6 .PHONY : $(SHL6TARGETN)
@echo ----------------------------------------------------------
@@ -73,7 +73,7 @@ test6 .PHONY : $(SHL6TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL7TARGET)"!=""
+.IF "$(SHL7TARGETN)"!=""
ALLTAR : test7
test7 .PHONY : $(SHL7TARGETN)
@echo ----------------------------------------------------------
@@ -85,7 +85,7 @@ test7 .PHONY : $(SHL7TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL8TARGET)"!=""
+.IF "$(SHL8TARGETN)"!=""
ALLTAR : test8
test8 .PHONY : $(SHL8TARGETN)
@echo ----------------------------------------------------------
@@ -97,7 +97,7 @@ test8 .PHONY : $(SHL8TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL9TARGET)"!=""
+.IF "$(SHL9TARGETN)"!=""
ALLTAR : test9
test9 .PHONY : $(SHL9TARGETN)
@echo ----------------------------------------------------------
@@ -109,7 +109,7 @@ test9 .PHONY : $(SHL9TARGETN)
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL10TARGET)"!=""
+.IF "$(SHL10TARGETN)"!=""
ALLTAR : test10
test10 .PHONY : $(SHL10TARGETN)
@echo ----------------------------------------------------------
diff --git a/solenv/inc/cppunit.mk b/solenv/inc/cppunit.mk
index 2173f1a9ff9a..b30ca7152700 100644
--- a/solenv/inc/cppunit.mk
+++ b/solenv/inc/cppunit.mk
@@ -44,7 +44,7 @@
# unroll begin
# ---- create the test libraries ------------------------------------
-.IF "$(SHL$(TNR)TARGET)"!=""
+.IF "$(SHL$(TNR)TARGETN)"!=""
ALLTAR : test$(TNR)
test$(TNR) .PHONY : $(SHL$(TNR)TARGETN)
@echo ----------------------------------------------------------
diff --git a/solenv/inc/extension_post.mk b/solenv/inc/extension_post.mk
index f221ff7ebe4a..7b8c99b37fe8 100644
--- a/solenv/inc/extension_post.mk
+++ b/solenv/inc/extension_post.mk
@@ -69,10 +69,22 @@ $(COMPONENT_JARFILES) : $(CLASSDIR)/$$(@:f)
.ENDIF # "$(COMPONENT_JARFILES)"!=""
.IF "$(COMPONENT_LIBRARIES)"!=""
+PACK_RUNTIME!:=TRUE
# TODO(Q3): strip the binary?
$(COMPONENT_LIBRARIES) : $(DLLDEST)/$$(@:f)
@@-$(MKDIRHIER) $(@:d)
$(COMMAND_ECHO)$(COPY) $< $@
+.ENDIF # "$(COMPONENT_LIBRARIES)"!=""
+
+.IF "$(PACK_RUNTIME)"!=""
+PACK_RUNTIME_FLAG:=$(MISC)/$(TARGET)_pack_runtime.flag
+$(EXTENSION_TARGET) : $(PACK_RUNTIME_FLAG)
+
+$(EXTENSIONDIR) :
+ @@-$(MKDIRHIER) $(@:d)
+
+$(PACK_RUNTIME_FLAG) : $(EXTENSIONDIR)
+ @@-$(MKDIRHIER) $(@:d)
.IF "$(OS)$(CPU)"=="WNTI"
.IF "$(COM)"=="GCC"
$(GNUCOPY) $(SOLARBINDIR)/mingwm10.dll $(EXTENSIONDIR)
@@ -120,7 +132,8 @@ $(COMPONENT_LIBRARIES) : $(DLLDEST)/$$(@:f)
.ENDIF # "$(PACKMS)"!=""
.ENDIF #"$(COM)"=="GCC"
.ENDIF # "$(OS)$(CPU)"=="WNTI"
-.ENDIF # "$(COMPONENT_LIBRARIES)"!=""
+ @$(TOUCH) $@
+.ENDIF # "$(PACK_RUNTIME)"!=""
IMPLEMENTATION_IDENTIFIER*="com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID)"
diff --git a/solenv/inc/langlist.mk b/solenv/inc/langlist.mk
index 32045cbf6262..e3ac2e5065ff 100644
--- a/solenv/inc/langlist.mk
+++ b/solenv/inc/langlist.mk
@@ -25,7 +25,6 @@
#
#*************************************************************************
-
completelangiso=af \
ar \
as \
@@ -69,6 +68,7 @@ he \
hi \
hi-IN \
hr \
+ht \
hu \
is \
it \
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 240547d98fa7..0a163f9e0128 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m100(Build:9571)
-BUILD=9571
-LAST_MINOR=m100
+RSCREVISION=300m101(Build:9573)
+BUILD=9573
+LAST_MINOR=m101
SOURCEVERSION=DEV300
diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk
index a095b7762fbe..b0872169bfc6 100644
--- a/solenv/inc/settings.mk
+++ b/solenv/inc/settings.mk
@@ -810,7 +810,7 @@ SOLARCOMMONSDFDIR=$(SOLARSDFDIR)
.EXPORT : SOLARBINDIR
-L10N_MODULE*=$(SOLARSRC)$/l10n
+L10N_MODULE*=$(SOURCE_ROOT_DIR)/l10n/l10n
ALT_L10N_MODULE*=$(SOLARSRC)$/l10n_so
.IF "$(WITH_LANG)"!=""
diff --git a/solenv/inc/tg_ext.mk b/solenv/inc/tg_ext.mk
index e19c7124d4a7..63c0c995f42a 100644
--- a/solenv/inc/tg_ext.mk
+++ b/solenv/inc/tg_ext.mk
@@ -312,11 +312,11 @@ $(MISC)/$(TARFILE_ROOTDIR).done : $(MISC)/$(TARFILE_MD5)-$(TARFILE_NAME).unpack
#.IF "$(my4ver:s/.//:s/,//)" >= "300"
# $(COMMAND_ECHO)cd $(MISC) && ( $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2 )
#.ELSE # "$(my4ver:s/.//:s/,//)" >= "300"
- $(COMMAND_ECHO)cd $(MISC) && $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2
+ $(COMMAND_ECHO)cd $(MISC) && $(TYPE:s/+//) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2
#.ENDIF # "$(my4ver:s/.//:s/,//)" >= "300"
.ELSE # "$(GUI)"=="WNT"
.IF "$(BSCLIENT)"=="TRUE"
- $(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2
+ $(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2
.ELSE # "$(BSCLIENT)"!=""
$(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) $(PATCHFLAGS) -p2
.ENDIF # "$(BSCLIENT)"!=""
diff --git a/starmath/prj/build.lst b/starmath/prj/build.lst
index a849b8142dee..bfecbc4a7f6d 100644
--- a/starmath/prj/build.lst
+++ b/starmath/prj/build.lst
@@ -1,4 +1,4 @@
-sm starmath : LIBXSLT:libxslt l10n svx NULL
+sm starmath : LIBXSLT:libxslt L10N:l10n svx NULL
sm starmath usr1 - all sm_mkout NULL
sm starmath\inc nmake - all sm_inc NULL
sm starmath\prj get - all sm_prj NULL
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index 99019e959dfa..d3ebed762bac 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -179,8 +179,6 @@ void IdlReflectionServiceImpl::dispose()
MutexGuard aGuard( _aComponentMutex );
_aElements.clear();
- _xTDMgr.clear();
- _xMgr.clear();
#ifdef TEST_LIST_CLASSES
OSL_ENSURE( g_aClassNames.size() == 0, "### idl classes still alive!" );
ClassNameList::const_iterator iPos( g_aClassNames.begin() );
diff --git a/stoc/source/corereflection/lrucache.hxx b/stoc/source/corereflection/lrucache.hxx
index 062c13d981e5..98c5faf4586d 100644
--- a/stoc/source/corereflection/lrucache.hxx
+++ b/stoc/source/corereflection/lrucache.hxx
@@ -177,9 +177,9 @@ template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual >
inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::setValue(
const t_Key & rKey, const t_Val & rValue )
{
+ ::osl::MutexGuard aGuard( _aCacheMutex );
if (_nCachedElements > 0)
{
- ::osl::MutexGuard aGuard( _aCacheMutex );
const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( rKey ) );
CacheEntry * pEntry;
@@ -221,6 +221,7 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::clear()
_pBlock[nPos].aKey = t_Key();
_pBlock[nPos].aVal = t_Val();
}
+ _nCachedElements = 0;
#ifdef __CACHE_DIAGNOSE
OSL_TRACE( "> cleared cache <\n" );
#endif
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index e9eb46ac6344..b59502852d1d 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -444,7 +444,6 @@ static OUString s_user = OUSTR("user");
static OUString s_permission = OUSTR("permission");
static OUString s_openBrace = OUSTR("{");
static OUString s_closingBrace = OUSTR("}");
-static OUString s_semi = OUSTR(";");
static OUString s_filePermission = OUSTR("com.sun.star.io.FilePermission");
static OUString s_socketPermission = OUSTR("com.sun.star.connection.SocketPermission");
diff --git a/svl/prj/build.lst b/svl/prj/build.lst
index f41b1142ae3f..999cdf8947de 100644
--- a/svl/prj/build.lst
+++ b/svl/prj/build.lst
@@ -1,2 +1,2 @@
-sl svl : l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL
+sl svl : L10N:l10n rsc offuh ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL
sl svl\prj nmake - all svl_prj NULL
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 8828a91c6b14..01bc05ebaeca 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -250,6 +250,8 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/table/tablecontrol \
svtools/source/table/tablecontrol_impl \
svtools/source/table/tabledatawindow \
+ svtools/source/table/mousefunction \
+ svtools/source/table/cellvalueconversion \
svtools/source/table/tablegeometry \
svtools/source/toolpanel/drawerlayouter \
svtools/source/toolpanel/dummypanel \
@@ -278,6 +280,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/uno/toolboxcontroller \
svtools/source/uno/treecontrolpeer \
svtools/source/uno/unocontroltablemodel \
+ svtools/source/uno/unogridcolumnfacade \
svtools/source/uno/unoevent \
svtools/source/uno/unoiface \
svtools/source/uno/unoimap \
diff --git a/svtools/Package_inc.mk b/svtools/Package_inc.mk
index 6cc92a14c823..4162e8f53fea 100644
--- a/svtools/Package_inc.mk
+++ b/svtools/Package_inc.mk
@@ -145,15 +145,15 @@ $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svxbox.hxx,svtools/svx
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/sychconv.hxx,svtools/sychconv.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/syntaxhighlight.hxx,svtools/syntaxhighlight.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/tabbar.hxx,svtools/tabbar.hxx))
-$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/abstracttablecontrol.hxx,svtools/table/abstracttablecontrol.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablecontrolinterface.hxx,svtools/table/tablecontrolinterface.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/defaultinputhandler.hxx,svtools/table/defaultinputhandler.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/gridtablerenderer.hxx,svtools/table/gridtablerenderer.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablecontrol.hxx,svtools/table/tablecontrol.hxx))
-$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tabledatawindow.hxx,svtools/table/tabledatawindow.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tableinputhandler.hxx,svtools/table/tableinputhandler.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablemodel.hxx,svtools/table/tablemodel.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablerenderer.hxx,svtools/table/tablerenderer.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tabletypes.hxx,svtools/table/tabletypes.hxx))
+$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/table/tablesort.hxx,svtools/table/tablesort.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/taskbar.hxx,svtools/taskbar.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/templatefoldercache.hxx,svtools/templatefoldercache.hxx))
$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/templdlg.hxx,svtools/templdlg.hxx))
diff --git a/svtools/inc/svtools/accessiblefactory.hxx b/svtools/inc/svtools/accessiblefactory.hxx
index 9606e93a2fa0..372af4fdca25 100755
--- a/svtools/inc/svtools/accessiblefactory.hxx
+++ b/svtools/inc/svtools/accessiblefactory.hxx
@@ -28,16 +28,12 @@
#ifndef SVTOOLS_ACCESSIBLE_FACTORY_HXX
#define SVTOOLS_ACCESSIBLE_FACTORY_HXX
-#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX
+#include "AccessibleBrowseBoxObjType.hxx"
+#include "accessibletableprovider.hxx"
+
#include <com/sun/star/uno/Reference.hxx>
-#endif
-#ifndef _RTL_REF_HXX
#include <rtl/ref.hxx>
-#endif
-#include "AccessibleBrowseBoxObjType.hxx"
-#include "accessibletableprovider.hxx"
-#include "accessibletable.hxx"
namespace com { namespace sun { namespace star {
namespace accessibility {
@@ -64,6 +60,11 @@ namespace svt
class ToolPanelDeck;
class IToolPanelDeck;
class PanelTabBar;
+ namespace table
+ {
+ class IAccessibleTable;
+ class IAccessibleTableControl;
+ }
/** a function which is able to create a factory for the standard Accessible/Context
components needed for standard toolkit controls
diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx
index 807760ef9b97..d7bd98481404 100644
--- a/svtools/inc/svtools/accessibletable.hxx
+++ b/svtools/inc/svtools/accessibletable.hxx
@@ -109,8 +109,6 @@ public:
virtual long GetRowCount() const= 0;
virtual long GetColumnCount() const= 0;
virtual sal_Bool HasRowHeader() const= 0;
- virtual sal_Int32 GetSelectedRowCount() const= 0;
- virtual bool IsRowSelected( long _nRow ) const= 0;
virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0;
virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0;
virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0;
@@ -122,9 +120,13 @@ public:
virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const = 0;
virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const = 0;
virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
- virtual std::vector<sal_Int32>& GetSelectedRows() = 0;
- virtual void RemoveSelectedRow(sal_Int32 _nRowPos) = 0;
virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0;
+
+ virtual sal_Int32 GetSelectedRowCount() const = 0;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const = 0;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const = 0;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) = 0;
+ virtual void SelectAllRows( bool const i_select ) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc
index b4bf84532b26..554fc63f5c7c 100644
--- a/svtools/inc/svtools/svtools.hrc
+++ b/svtools/inc/svtools/svtools.hrc
@@ -252,6 +252,10 @@
#define STR_SVT_ACC_DESC_FOLDER (STR_SVT_ACC_BEGIN+4)
#define STR_SVT_ACC_DESC_FILE (STR_SVT_ACC_BEGIN+5)
#define STR_SVT_ACC_EMPTY_FIELD (STR_SVT_ACC_BEGIN+6)
+//IAccessible2 implementation
+#define STR_SVT_ACC_LISTENTRY_SELCTED_STATE (STR_SVT_ACC_BEGIN+7)
+#define STR_SVT_ACC_RULER_VERT_NAME (STR_SVT_ACC_BEGIN+8)
+#define STR_SVT_ACC_RULER_HORZ_NAME (STR_SVT_ACC_BEGIN+9)
#define STR_SVT_ACC_END (STR_SVT_ACC_EMPTY_FIELD)
#define STR_SVT_INDEXENTRY_START (STR_SVT_ACC_END + 1)
@@ -390,6 +394,11 @@
#define RID_IMG_PRNDLG_COLLATE_HC (STR_SVT_PRNDLG_START + 31)
#define RID_IMG_PRNDLG_NOCOLLATE_HC (STR_SVT_PRNDLG_START + 32)
+// IAccessible2 implementation in 2009
+#define STR_PARAGRAPH_START (STR_SVT_PRNDLG_START + 50)
+#define STR_PARAGRAPH (STR_PARAGRAPH_START + 0)
+#define STR_PARAGRAPH_END (STR_PARAGRAPH)
+
#endif // #ifndef _SVTOOLS_HRC
// ******************************************************************* EOF
diff --git a/svtools/inc/svtools/table/abstracttablecontrol.hxx b/svtools/inc/svtools/table/abstracttablecontrol.hxx
deleted file mode 100644
index 9206f20ecbcb..000000000000
--- a/svtools/inc/svtools/table/abstracttablecontrol.hxx
+++ /dev/null
@@ -1,134 +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 SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
-#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
-
-#include <sal/types.h>
-#include <vcl/event.hxx>
-#include <vcl/seleng.hxx>
-#include "tabletypes.hxx"
-//........................................................................
-namespace svt { namespace table
-{
-//........................................................................
-
- enum TableControlAction
- {
- /// moves the cursor in the table control one row up, if possible, by keeping the current column
- cursorUp,
- /// moves the cursor in the table control one row down, if possible, by keeping the current column
- cursorDown,
- /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
- cursorLeft,
- /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
- cursorRight,
- /// moves the cursor to the beginning of the current line
- cursorToLineStart,
- /// moves the cursor to the end of the current line
- cursorToLineEnd,
- /// moves the cursor to the first row, keeping the current column
- cursorToFirstLine,
- /// moves the cursor to the last row, keeping the current column
- cursorToLastLine,
- /// moves the cursor one page up, keeping the current column
- cursorPageUp,
- /// moves the cursor one page down, keeping the current column
- cursorPageDown,
- /// moves the cursor to the top-most, left-most cell
- cursorTopLeft,
- /// moves the cursor to the bottom-most, right-most cell
- cursorBottomRight,
- /// selects the row, where the actual cursor is
- cursorSelectRow,
- /// selects the rows, above the actual cursor is
- cursorSelectRowUp,
- /// selects the row, beneath the actual cursor is
- cursorSelectRowDown,
- /// selects the row, from the actual cursor till top
- cursorSelectRowAreaTop,
- /// selects the row, from the actual cursor till bottom
- cursorSelectRowAreaBottom,
-
-
- /// invalid and final enumeration value, not to be actually used
- invalidTableControlAction
- };
-
- //====================================================================
- //= IAbstractTableControl
- //====================================================================
- /** defines a callback interface to be implemented by a concrete table control
- */
- class SAL_NO_VTABLE IAbstractTableControl
- {
- public:
- /** hides the cell cursor
-
- The method cares for successive calls, that is, for every call to
- ->hideCursor(), you need one call to ->showCursor. Only if the number
- of both calls matches, the cursor is really shown.
-
- @see showCursor
- */
- virtual void hideCursor() = 0;
-
- /** shows the cell cursor
-
- @see hideCursor
- */
- virtual void showCursor() = 0;
-
- /** dispatches an action to the table control
-
- @return
- <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
- failure conditions include some other instance vetoing the action, or impossibility
- to execute the action at all (for instance moving up one row when already positioned
- on the very first row).
-
- @see TableControlAction
- */
- virtual bool dispatchAction( TableControlAction _eAction ) = 0;
- /** returns selection engine*/
- virtual SelectionEngine* getSelEngine() = 0;
- virtual void setCursorAtCurrentCell(const Point& rPoint) = 0;
- virtual bool isTooltipActive() = 0;
- virtual rtl::OUString& setTooltip(const Point& rPoint ) = 0;
- virtual RowPos getCurrentRow(const Point& rPoint ) = 0;
- virtual void resizeColumn(const Point& rPoint ) = 0;
- virtual bool startResizeColumn(const Point& rPoint) = 0;
- virtual bool endResizeColumn(const Point& rPoint) = 0;
- virtual bool isRowSelected(RowPos _nRow) = 0;
-
- virtual ~IAbstractTableControl() {};
- };
-
-//........................................................................
-} } // namespace svt::table
-//........................................................................
-
-#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
diff --git a/svtools/inc/svtools/table/defaultinputhandler.hxx b/svtools/inc/svtools/table/defaultinputhandler.hxx
index ca760896d539..6990f903cdb2 100644
--- a/svtools/inc/svtools/table/defaultinputhandler.hxx
+++ b/svtools/inc/svtools/table/defaultinputhandler.hxx
@@ -27,43 +27,44 @@
#ifndef SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
#define SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
-#include <svtools/table/tableinputhandler.hxx>
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tabletypes.hxx"
-//........................................................................
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
struct DefaultInputHandler_Impl;
- //====================================================================
+ //==================================================================================================================
//= DefaultInputHandler
- //====================================================================
+ //==================================================================================================================
class DefaultInputHandler : public ITableInputHandler
{
- friend class TableDataWindow;
private:
- DefaultInputHandler_Impl* m_pImpl;
- bool m_bResize;
+ ::boost::scoped_ptr< DefaultInputHandler_Impl > m_pImpl;
public:
DefaultInputHandler();
~DefaultInputHandler();
- virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
- virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
- virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt );
- virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt );
- virtual bool GetFocus ( IAbstractTableControl& _rControl );
- virtual bool LoseFocus ( IAbstractTableControl& _rControl );
- virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt );
- virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt );
- virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
- virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt );
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt );
+ virtual bool GetFocus ( ITableControl& _rControl );
+ virtual bool LoseFocus ( ITableControl& _rControl );
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt );
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt );
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt );
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt );
};
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
#endif // SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
diff --git a/svtools/inc/svtools/table/gridtablerenderer.hxx b/svtools/inc/svtools/table/gridtablerenderer.hxx
index e474306c0423..c472fa408574 100644
--- a/svtools/inc/svtools/table/gridtablerenderer.hxx
+++ b/svtools/inc/svtools/table/gridtablerenderer.hxx
@@ -29,6 +29,8 @@
#include <svtools/table/tablemodel.hxx>
+#include <boost/scoped_ptr.hpp>
+
//........................................................................
namespace svt { namespace table
{
@@ -43,14 +45,11 @@ namespace svt { namespace table
This class is able to paint a table grid, table headers, and cell
backgrounds according to the selected/active state of cells.
-
- TODO update the documentation when it's decided whether this renderer
- also does value handling
*/
class GridTableRenderer : public ITableRenderer
{
private:
- GridTableRenderer_Impl* m_pImpl;
+ ::boost::scoped_ptr< GridTableRenderer_Impl > m_pImpl;
public:
/** creates a table renderer associated with the given model
@@ -72,9 +71,17 @@ namespace svt { namespace table
This method returns the index of the last row which has been prepared
*/
- RowPos getCurrentRow();
+ RowPos getCurrentRow() const;
+
+ /** determines whether or not to paint grid lines
+ */
+ bool useGridLines() const;
- protected:
+ /** controls whether or not to paint grid lines
+ */
+ void useGridLines( bool const i_use );
+
+ public:
// ITableRenderer overridables
virtual void PaintHeaderArea(
OutputDevice& _rDevice, const Rectangle& _rArea,
@@ -89,17 +96,34 @@ namespace svt { namespace table
virtual void PaintRowHeader(
bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText );
- virtual void PaintCellImage( ColPos _nColumn,
- bool _bActive, bool _bSelected,
- OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, Image* _pCellData );
- virtual void PaintCellString( ColPos _nColumn,
+ const StyleSettings& _rStyle );
+ virtual void PaintCell( ColPos const i_col,
bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText );
+ const StyleSettings& _rStyle );
virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect);
virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect);
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ );
+
+ private:
+ struct CellRenderContext;
+
+ void impl_paintCellContent(
+ CellRenderContext const & i_context
+ );
+ void impl_paintCellImage(
+ CellRenderContext const & i_context,
+ Image const & i_image
+ );
+ void impl_paintCellText(
+ CellRenderContext const & i_context,
+ ::rtl::OUString const & i_text
+ );
};
//........................................................................
} } // namespace svt::table
diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx
index 28ac3583bd5a..8afc2209227c 100644
--- a/svtools/inc/svtools/table/tablecontrol.hxx
+++ b/svtools/inc/svtools/table/tablecontrol.hxx
@@ -28,13 +28,16 @@
#define SVTOOLS_INC_TABLE_TABLECONTROL_HXX
#include "svtools/svtdllapi.h"
-#include <svtools/table/tablemodel.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/accessibletable.hxx"
+#include "svtools/accessiblefactory.hxx"
+
#include <vcl/ctrl.hxx>
#include <vcl/seleng.hxx>
-#include <svtools/table/tabledatawindow.hxx>
-#include <svtools/accessibletable.hxx>
-#include <com/sun/star/util/Color.hpp>
-#include <svtools/accessiblefactory.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+
//........................................................................
namespace svt { namespace table
@@ -42,8 +45,6 @@ namespace svt { namespace table
//........................................................................
class TableControl_Impl;
- class TableDataWindow;
- class AccessibleTableControl_Impl;
//====================================================================
//= TableControl
@@ -63,31 +64,19 @@ namespace svt { namespace table
The control supports the concept of a <em>current</em> (or <em>active</em>
cell).
The control supports accessibility, this is encapsulated in IAccessibleTable
-
- // TODO: scrolling?
*/
class SVT_DLLPUBLIC TableControl : public Control, public IAccessibleTable
{
private:
- DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* );
- DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+ ::boost::shared_ptr< TableControl_Impl > m_pImpl;
- DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
- TableControl_Impl* m_pImpl;
- ::com::sun::star::uno::Sequence< sal_Int32 > m_nCols;
- ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aText;
- Link m_aSelectHdl;
- bool m_bSelectionChanged;
- bool m_bTooltip;
public:
- ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable;
-
TableControl( Window* _pParent, WinBits _nStyle );
~TableControl();
/// sets a new table model
- SVT_DLLPRIVATE void SetModel( PTableModel _pModel );
+ void SetModel( PTableModel _pModel );
/// retrieves the current table model
PTableModel GetModel() const;
@@ -107,9 +96,8 @@ namespace svt { namespace table
*/
sal_Int32 GetCurrentRow() const;
- /** returns the row, which contains the input point*/
-
- ColPos GetCurrentRow (const Point& rPoint);
+ ITableControl&
+ getTableControlInterface();
/** retrieves the current column
@@ -125,7 +113,7 @@ namespace svt { namespace table
/** activates the cell at the given position
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -135,7 +123,7 @@ namespace svt { namespace table
/** moves the active cell to the given column, by keeping the active row
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -148,7 +136,7 @@ namespace svt { namespace table
/** moves the active cell to the given row, by keeping the active column
@return
- <TRUE/> if the move was successful, <FALSE/> otherwise. Usual
+ <sal_True/> if the move was successful, <FALSE/> otherwise. Usual
failure conditions include some other instance vetoing the move,
or impossibility to execute the move at all (for instance because
of invalid coordinates).
@@ -157,22 +145,17 @@ namespace svt { namespace table
{
return GoTo( GetCurrentColumn(), _nRow );
}
- SVT_DLLPRIVATE virtual void Resize();
- virtual void Select();
- SVT_DLLPRIVATE void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; }
- const Link& GetSelectHdl() const { return m_aSelectHdl; }
- /**invalidates the table if table has been changed e.g. new row added
- */
- void InvalidateDataWindow(RowPos _nRowStart, RowPos _nRowEnd, bool _bRemoved);
- /**gets the vector, which contains the selected rows
- */
- std::vector<sal_Int32>& GetSelectedRows();
- /**after removing a row, updates the vector which contains the selected rows
- if the row, which should be removed, is selected, it will be erased from the vector
- */
- SelectionEngine* getSelEngine();
- TableDataWindow* getDataWindow();
+ SVT_DLLPRIVATE virtual void Resize();
+ virtual void Select();
+ void SetSelectHdl( const Link& rLink );
+ const Link& GetSelectHdl() const;
+
+ /**after removing a row, updates the vector which contains the selected rows
+ if the row, which should be removed, is selected, it will be erased from the vector
+ */
+ SelectionEngine* getSelEngine();
+ Window& getDataWindow();
// Window overridables
virtual void GetFocus();
@@ -180,55 +163,55 @@ namespace svt { namespace table
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void StateChanged( StateChangedType i_nStateChange );
- /** Creates and returns the accessible object of the whole GridControl. */
- SVT_DLLPRIVATE virtual XACC CreateAccessible();
- SVT_DLLPRIVATE virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
- SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
- SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
- SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
- virtual void FillAccessibleStateSet(
- ::utl::AccessibleStateSetHelper& rStateSet,
- AccessibleTableControlObjType eObjType ) const;
- //// Window
- virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
- virtual void GrabFocus();
- virtual XACC GetAccessible( sal_Bool bCreate = sal_True );
- virtual Window* GetAccessibleParentWindow() const;
- virtual Window* GetWindowInstance();
- virtual sal_Int32 GetAccessibleControlCount() const;
- virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
- virtual long GetRowCount() const;
- virtual long GetColumnCount() const;
- virtual sal_Bool HasRowHeader() const;
- virtual sal_Int32 GetSelectedRowCount() const;
- virtual bool IsRowSelected( long _nRow ) const;
- virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
- virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
- virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
- virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
- virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
- virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
- virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const;
- virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const;
- virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
- virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const;
- virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
- virtual sal_Bool HasRowHeader();
- virtual sal_Bool HasColHeader();
- virtual sal_Bool isAccessibleAlive( ) const;
- virtual void commitGridControlEvent( sal_Int16 _nEventId, const com::sun::star::uno::Any& _rNewValue, const com::sun::star::uno::Any& _rOldValue );
- virtual void RemoveSelectedRow(RowPos _nRowPos);
- virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
- ::com::sun::star::uno::Sequence< sal_Int32 >& getColumnsForTooltip();
- ::com::sun::star::uno::Sequence< ::rtl::OUString >& getTextForTooltip();
- void setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols);
- void clearSelection();
- void selectionChanged(bool _bChanged);
- bool isTooltip();
-
- protected:
- /// retrieves the XAccessible implementation associated with the GridControl instance
- ::svt::IAccessibleFactory& getAccessibleFactory();
+ /** Creates and returns the accessible object of the whole GridControl. */
+ SVT_DLLPRIVATE virtual XACC CreateAccessible();
+ SVT_DLLPRIVATE virtual XACC CreateAccessibleControl( sal_Int32 _nIndex );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const;
+ SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow );
+ SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const;
+ virtual void FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const;
+
+ // .............................................................................................................
+ // IAccessibleTable
+ virtual Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const;
+ virtual void GrabFocus();
+ virtual XACC GetAccessible( sal_Bool bCreate = sal_True );
+ virtual Window* GetAccessibleParentWindow() const;
+ virtual Window* GetWindowInstance();
+ virtual sal_Int32 GetAccessibleControlCount() const;
+ virtual sal_Bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint );
+ virtual long GetRowCount() const;
+ virtual long GetColumnCount() const;
+ virtual sal_Bool HasRowHeader() const;
+ virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint );
+ virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True );
+ virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
+ virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetRowDescription( sal_Int32 _nRow ) const;
+ virtual ::rtl::OUString GetRowName(sal_Int32 _nIndex) const;
+ virtual ::rtl::OUString GetColumnDescription( sal_uInt16 _nColumnPos ) const;
+ virtual ::rtl::OUString GetColumnName( sal_Int32 _nIndex ) const;
+ virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+ virtual sal_Bool HasRowHeader();
+ virtual sal_Bool HasColHeader();
+ virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const;
+
+ virtual sal_Int32 GetSelectedRowCount() const;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select );
+ virtual void SelectAllRows( bool const i_select );
+ // .............................................................................................................
+
+ private:
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* );
+ DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* );
+
+ DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
private:
TableControl(); // never implemented
diff --git a/svtools/inc/svtools/table/tablecontrolinterface.hxx b/svtools/inc/svtools/table/tablecontrolinterface.hxx
new file mode 100644
index 000000000000..74e9688d01db
--- /dev/null
+++ b/svtools/inc/svtools/table/tablecontrolinterface.hxx
@@ -0,0 +1,254 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+************************************************************************/
+
+#ifndef SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+#define SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
+
+#include <sal/types.h>
+#include <vcl/event.hxx>
+#include <vcl/seleng.hxx>
+
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablemodel.hxx"
+
+class Pointer;
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= TableControlAction
+ //==================================================================================================================
+ enum TableControlAction
+ {
+ /// moves the cursor in the table control one row up, if possible, by keeping the current column
+ cursorUp,
+ /// moves the cursor in the table control one row down, if possible, by keeping the current column
+ cursorDown,
+ /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
+ cursorLeft,
+ /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
+ cursorRight,
+ /// moves the cursor to the beginning of the current line
+ cursorToLineStart,
+ /// moves the cursor to the end of the current line
+ cursorToLineEnd,
+ /// moves the cursor to the first row, keeping the current column
+ cursorToFirstLine,
+ /// moves the cursor to the last row, keeping the current column
+ cursorToLastLine,
+ /// moves the cursor one page up, keeping the current column
+ cursorPageUp,
+ /// moves the cursor one page down, keeping the current column
+ cursorPageDown,
+ /// moves the cursor to the top-most, left-most cell
+ cursorTopLeft,
+ /// moves the cursor to the bottom-most, right-most cell
+ cursorBottomRight,
+ /// selects the row, where the actual cursor is
+ cursorSelectRow,
+ /// selects the rows, above the actual cursor is
+ cursorSelectRowUp,
+ /// selects the row, beneath the actual cursor is
+ cursorSelectRowDown,
+ /// selects the row, from the actual cursor till top
+ cursorSelectRowAreaTop,
+ /// selects the row, from the actual cursor till bottom
+ cursorSelectRowAreaBottom,
+
+ /// invalid and final enumeration value, not to be actually used
+ invalidTableControlAction
+ };
+
+ //==================================================================================================================
+ //= TableCellArea
+ //==================================================================================================================
+ enum TableCellArea
+ {
+ CellContent,
+ ColumnDivider
+ };
+
+ //==================================================================================================================
+ //= TableCell
+ //==================================================================================================================
+ struct TableCell
+ {
+ ColPos nColumn;
+ RowPos nRow;
+ TableCellArea eArea;
+
+ TableCell()
+ :nColumn( COL_INVALID )
+ ,nRow( ROW_INVALID )
+ ,eArea( CellContent )
+ {
+ }
+
+ TableCell( ColPos const i_column, RowPos const i_row )
+ :nColumn( i_column )
+ ,nRow( i_row )
+ ,eArea( CellContent )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ColumnMetrics
+ //==================================================================================================================
+ struct ColumnMetrics
+ {
+ /** the start of the column, in pixels. Might be negative, in case the column is scrolled out of the visible
+ area.
+ */
+ long nStartPixel;
+
+ /** the end of the column, in pixels, plus 1. Effectively, this is the accumulated width of a all columns
+ up to the current one.
+ */
+ long nEndPixel;
+
+ ColumnMetrics()
+ :nStartPixel(0)
+ ,nEndPixel(0)
+ {
+ }
+
+ ColumnMetrics( long const i_start, long const i_end )
+ :nStartPixel( i_start )
+ ,nEndPixel( i_end )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= TableArea
+ //==================================================================================================================
+ enum TableArea
+ {
+ TableAreaColumnHeaders,
+ TableAreaRowHeaders,
+ TableAreaDataArea,
+ TableAreaAll
+ };
+
+ //==================================================================================================================
+ //= ITableControl
+ //==================================================================================================================
+ /** defines a callback interface to be implemented by a concrete table control
+ */
+ class SAL_NO_VTABLE ITableControl
+ {
+ public:
+ /** hides the cell cursor
+
+ The method cares for successive calls, that is, for every call to
+ ->hideCursor(), you need one call to ->showCursor. Only if the number
+ of both calls matches, the cursor is really shown.
+
+ @see showCursor
+ */
+ virtual void hideCursor() = 0;
+
+ /** shows the cell cursor
+
+ @see hideCursor
+ */
+ virtual void showCursor() = 0;
+
+ /** dispatches an action to the table control
+
+ @return
+ <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the action, or impossibility
+ to execute the action at all (for instance moving up one row when already positioned
+ on the very first row).
+
+ @see TableControlAction
+ */
+ virtual bool dispatchAction( TableControlAction _eAction ) = 0;
+
+ /** returns selection engine*/
+ virtual SelectionEngine* getSelEngine() = 0;
+
+ /** returns the table model
+
+ The returned model is guaranteed to not be <NULL/>.
+ */
+ virtual PTableModel getModel() const = 0;
+
+ /// returns the index of the currently active column
+ virtual ColPos getCurrentColumn() const = 0;
+
+ /// returns the index of the currently active row
+ virtual RowPos getCurrentRow() const = 0;
+
+ /// activates the given cell
+ virtual bool activateCell( ColPos const i_col, RowPos const i_row ) = 0;
+
+ /// retrieves the size of the table window, in pixels
+ virtual ::Size getTableSizePixel() const = 0;
+
+ /// sets a new mouse pointer for the table window
+ virtual void setPointer( Pointer const & i_pointer ) = 0;
+
+ /// captures the mouse to the table window
+ virtual void captureMouse() = 0;
+
+ /// releases the mouse, after it had previously been captured
+ virtual void releaseMouse() = 0;
+
+ /// invalidates the table window
+ virtual void invalidate( TableArea const i_what ) = 0;
+
+ /// calculates a width, given in pixels, into a AppFont-based width
+ virtual long pixelWidthToAppFont( long const i_pixels ) const = 0;
+
+ /// shows a trackign rectangle
+ virtual void showTracking( Rectangle const & i_location, sal_uInt16 const i_flags ) = 0;
+
+ /// hides a prviously shown tracking rectangle
+ virtual void hideTracking() = 0;
+
+ /// does a hit test for the given pixel coordinates
+ virtual TableCell hitTest( const Point& rPoint ) const = 0;
+
+ /// retrieves the metrics for a given column
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const = 0;
+
+ /// determines whether a given row is selected
+ virtual bool isRowSelected( RowPos _nRow ) const = 0;
+
+ virtual ~ITableControl() {};
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
diff --git a/svtools/inc/svtools/table/tableinputhandler.hxx b/svtools/inc/svtools/table/tableinputhandler.hxx
index 6d6af9f641bb..87803f03e240 100644
--- a/svtools/inc/svtools/table/tableinputhandler.hxx
+++ b/svtools/inc/svtools/table/tableinputhandler.hxx
@@ -40,7 +40,7 @@ namespace svt { namespace table
{
//........................................................................
- class IAbstractTableControl;
+ class ITableControl;
//====================================================================
//= ITableInputHandler
@@ -56,16 +56,16 @@ namespace svt { namespace table
// or whether it has been sufficiently handled by the ->ITableInputHandler instance
// (<FALSE/>).
- virtual bool MouseMove ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool MouseButtonDown ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool MouseButtonUp ( IAbstractTableControl& _rControl, const MouseEvent& rMEvt ) = 0;
- virtual bool KeyInput ( IAbstractTableControl& _rControl, const KeyEvent& rKEvt ) = 0;
- virtual bool GetFocus ( IAbstractTableControl& _rControl ) = 0;
- virtual bool LoseFocus ( IAbstractTableControl& _rControl ) = 0;
- virtual bool RequestHelp ( IAbstractTableControl& _rControl, const HelpEvent& rHEvt ) = 0;
- virtual bool Command ( IAbstractTableControl& _rControl, const CommandEvent& rCEvt ) = 0;
- virtual bool PreNotify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
- virtual bool Notify ( IAbstractTableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) = 0;
+ virtual bool GetFocus ( ITableControl& _rControl ) = 0;
+ virtual bool LoseFocus ( ITableControl& _rControl ) = 0;
+ virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt ) = 0;
+ virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt ) = 0;
+ virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
+ virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
virtual ~ITableInputHandler() { }
};
diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx
index 3da396d9d86c..94f03b684e64 100644..100755
--- a/svtools/inc/svtools/table/tablemodel.hxx
+++ b/svtools/inc/svtools/table/tablemodel.hxx
@@ -28,16 +28,22 @@
#define SVTOOLS_INC_TABLE_TABLEMODEL_HXX
#include "svtools/svtdllapi.h"
-#include <svtools/table/tabletypes.hxx>
-#include <svtools/table/tablerenderer.hxx>
-#include <svtools/table/tableinputhandler.hxx>
-#include <rtl/ref.hxx>
-#include <sal/types.h>
+#include "svtools/table/tabletypes.hxx"
+#include "svtools/table/tablerenderer.hxx"
+#include "svtools/table/tableinputhandler.hxx"
+#include "svtools/table/tablesort.hxx"
+
#include <com/sun/star/util/Color.hpp>
-#include <boost/shared_ptr.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/style/HorizontalAlignment.hpp>
+#include <rtl/ref.hxx>
+#include <sal/types.h>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <boost/enable_shared_from_this.hpp>
+
//........................................................................
namespace svt { namespace table
{
@@ -45,19 +51,6 @@ namespace svt { namespace table
//====================================================================
- //= cell data
- //====================================================================
- struct TableContentType
- {
- ::rtl::OUString sContent;
- Image* pImage;
- TableContentType() :
- sContent(),
- pImage( )
- {
- }
- };
- //====================================================================
//= ScrollbarVisibility
//====================================================================
enum ScrollbarVisibility
@@ -78,13 +71,24 @@ namespace svt { namespace table
//====================================================================
//= ITableModelListener
//====================================================================
+ typedef sal_Int32 ColumnAttributeGroup;
+ #define COL_ATTRS_NONE (0x00000000)
+ /// denotes column attributes related to the width of the column
+ #define COL_ATTRS_WIDTH (0x00000001)
+ /// denotes column attributes related to the appearance of the column, i.e. those relevant for rendering
+ #define COL_ATTRS_APPEARANCE (0x00000002)
+ /// denotes the entirety of column attributes
+ #define COL_ATTRS_ALL (0x7FFFFFFF)
+
+ //====================================================================
+ //= ITableModelListener
+ //====================================================================
/** declares an interface to be implemented by components interested in
changes in an ->ITableModel
*/
- class SAL_NO_VTABLE ITableModelListener
+ class SAL_NO_VTABLE ITableModelListener : public ::boost::enable_shared_from_this< ITableModelListener >
{
public:
- //virtual void onTableModelChanged(PTableModel pTableModel) = 0;
/** notifies the listener that one or more rows have been inserted into
the table
@@ -100,7 +104,8 @@ namespace svt { namespace table
the table
@param first
- the old index of the first removed row
+ the old index of the first removed row. If this is <code>-1</code>, then all
+ rows have been removed from the model.
@param last
the old index of the last removed row. Must not be smaller
than ->first
@@ -116,27 +121,19 @@ namespace svt { namespace table
the index of the last newly inserted row. Must not be smaller
than ->first
*/
- virtual void columnsInserted( ColPos first, ColPos last ) = 0;
+ virtual void columnInserted( ColPos const i_colIndex ) = 0;
/** notifies the listener that one or more columns have been removed from
the table
- @param first
- the old index of the first removed row
- @param last
- the old index of the last removed row. Must not be smaller
- than ->first
+ @param i_colIndex
+ the old index of the removed column
*/
- virtual void columnsRemoved( ColPos first, ColPos last ) = 0;
-
- /** notifies the listener that a column in the table has moved
+ virtual void columnRemoved( ColPos const i_colIndex ) = 0;
- @param oldIndex
- the old index of the column within the model
- @param newIndex
- the new index of the column within the model
+ /** notifies the listener that all columns have been removed form the model
*/
- virtual void columnMoved( ColPos oldIndex, ColPos newIndex ) = 0;
+ virtual void allColumnsRemoved() = 0;
/** notifies the listener that a rectangular cell range in the table
has been updated
@@ -145,7 +142,24 @@ namespace svt { namespace table
they have about the cells in question, in particular any possibly
cached cell values.
*/
- virtual void cellsUpdated( ColPos firstCol, ColPos lastCol, RowPos firstRow, RowPos lastRow ) = 0;
+ virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) = 0;
+
+ /** notifies the listener that attributes of a given column changed
+
+ @param i_column
+ the position of the column whose attributes changed
+ @param i_attributeGroup
+ a combination of one or more <code>COL_ATTRS_*</code> flags, denoting the attribute group(s)
+ in which changes occurred.
+ */
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup ) = 0;
+
+ /** notifies the listener that the metrics of the table changed.
+
+ Metrics here include the column header height, the row header width, the row height, and the presence
+ of both the row and column header.
+ */
+ virtual void tableMetricsChanged() = 0;
/// deletes the listener instance
virtual ~ITableModelListener(){};
@@ -172,7 +186,8 @@ namespace svt { namespace table
@see setID
*/
- virtual ColumnID getID() const = 0;
+ virtual ::com::sun::star::uno::Any
+ getID() const = 0;
/** sets a new column ID
@@ -183,7 +198,7 @@ namespace svt { namespace table
@see getID
*/
- virtual bool setID( const ColumnID _nID ) = 0;
+ virtual void setID( const ::com::sun::star::uno::Any& _nID ) = 0;
/** returns the name of the column
@@ -200,7 +215,15 @@ namespace svt { namespace table
*/
virtual void setName( const String& _rName ) = 0;
- /** determines whether the column can be resized
+ /** retrieves the help text to be displayed for the column.
+ */
+ virtual String getHelpText() const = 0;
+
+ /** sets a new the help text to be displayed for the column.
+ */
+ virtual void setHelpText( const String& i_helpText ) = 0;
+
+ /** determines whether the column can be interactively resized
@see getMinWidth
@see getMaxWidth
@@ -216,40 +239,41 @@ namespace svt { namespace table
*/
virtual void setResizable( bool _bResizable ) = 0;
- /** returns the width of the column, in 1/100 millimeters
+ /** denotes the relative flexibility of the column
- The returned value must be a positive ->TableMetrics value.
+ This flexibility is taken into account when a table control auto-resizes its columns, because the available
+ space changed. In this case, the columns grow or shrink according to their flexibility.
- It can also be COLWIDTH_FIT_TO_VIEW, to indicate that the width of the column
- should automatically be adjusted to completely fit the view. For instance, a
- model's last column could return this value, to indicate that it is to occupy
- all horizontal space remaining in the view, after all other columns have been
- layouted.
+ A value of 0 means the column is not auto-resized at all.
+ */
+ virtual sal_Int32 getFlexibility() const = 0;
- If there is more than one column with width COLWIDTH_FIT_TO_VIEW in a model,
- they're all layouted equal-width.
+ /** sets a new flexibility value for the column
- If the columns with a read width (i.e. other than COLWIDTH_FIT_TO_VIEW) are,
- in sum, wider than the view, then the view is free to choose a real width for any
- columns which return COLWIDTH_FIT_TO_VIEW here.
+ @see getFlexibility
+ */
+ virtual void setFlexibility( sal_Int32 const i_flexibility ) = 0;
+
+ /** returns the width of the column, in app-font unitss
+
+ The returned value must be a positive ->TableMetrics value.
@see setWidth
@see getMinWidth
@see getMaxWidth
- @see COLWIDTH_FIT_TO_VIEW
*/
virtual TableMetrics getWidth() const = 0;
/** sets a new width for the column
@param _nWidth
- the new width, in 1/100 millimeters
+ the new width, app-font units
@see getWidth
*/
virtual void setWidth( TableMetrics _nWidth ) = 0;
- /** returns the minimum width of the column, in 1/100 millimeters, or 0 if the column
+ /** returns the minimum width of the column, in app-font units, or 0 if the column
does not have a minimal width
@see setMinWidth
@@ -258,7 +282,7 @@ namespace svt { namespace table
*/
virtual TableMetrics getMinWidth() const = 0;
- /** sets the minimum width of the column, in 1/100 millimeters
+ /** sets the minimum width of the column, in app-font units
@see getMinWidth
@see setMaxWidth
@@ -266,7 +290,7 @@ namespace svt { namespace table
*/
virtual void setMinWidth( TableMetrics _nMinWidth ) = 0;
- /** returns the maximum width of the column, in 1/100 millimeters, or 0 if the column
+ /** returns the maximum width of the column, in app-font units, or 0 if the column
does not have a minimal width
@see setMaxWidth
@@ -275,7 +299,7 @@ namespace svt { namespace table
*/
virtual TableMetrics getMaxWidth() const = 0;
- /** sets the maximum width of the column, in 1/100 millimeters
+ /** sets the maximum width of the column, in app-font units
@see getMaxWidth
@see setMinWidth
@@ -283,24 +307,14 @@ namespace svt { namespace table
*/
virtual void setMaxWidth( TableMetrics _nMaxWidth ) = 0;
- /** returns the preferred width of the column, or 0 if the column
- does not have a preferred width.
-
- @see setMaxWidth
- @see getMinWidth
- @see getWidth
+ /** retrieves the horizontal alignment to be used for content in this cell
*/
- virtual TableMetrics getPreferredWidth() const = 0;
- /** sets the preferred width of the column, to be used when user resizes column
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0;
- @see getMaxWidth
- @see setMinWidth
- @see setWidth
+ /** sets a new the horizontal alignment to be used for content in this cell
*/
- virtual void setPreferredWidth( TableMetrics _nPrefWidth ) = 0;
-
- virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign() = 0;
virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign) = 0;
+
/// deletes the column model instance
virtual ~IColumnModel() { }
};
@@ -322,9 +336,6 @@ namespace svt { namespace table
*/
virtual TableSize getRowCount() const = 0;
- SVT_DLLPRIVATE virtual void setColumnCount(TableSize _nColCount) = 0;
- SVT_DLLPRIVATE virtual void setRowCount(TableSize _nRowCount) = 0;
-
/** determines whether the table has column headers
If this method returns <TRUE/>, the renderer returned by
@@ -333,15 +344,6 @@ namespace svt { namespace table
@see IColumnRenderer
*/
virtual bool hasColumnHeaders() const = 0;
- /** sets whether the table should have row headers
- @see IColumnRenderer
- */
- SVT_DLLPRIVATE virtual void setRowHeaders( bool rowHeaders) = 0;
-
- /** sets whether the table should have column headers
- @see IColumnRenderer
- */
- SVT_DLLPRIVATE virtual void setColumnHeaders( bool columnHeaders) = 0;
/** determines whether the table has row headers
@@ -359,14 +361,6 @@ namespace svt { namespace table
*/
virtual bool isCellEditable( ColPos col, RowPos row ) const = 0;
- /** adds the given listener to the list of ->ITableModelListener's
- */
- SVT_DLLPRIVATE virtual void addTableModelListener( const PTableModelListener& listener ) = 0;
-
- /** revokes the given listener from the list of ->ITableModelListener's
- */
- SVT_DLLPRIVATE virtual void removeTableModelListener( const PTableModelListener& listener ) = 0;
-
/** returns a model for a certain column
@param column
@@ -375,27 +369,15 @@ namespace svt { namespace table
@return
the model of the column in question. Must not be <NULL/>
-
- @see getColumnModelByID
*/
virtual PColumnModel getColumnModel( ColPos column ) = 0;
- /** finds a column model by ID
-
- @param id
- the id of the column which is to be looked up
- @return
- the column model with the given ID, or <NULL/> if there is
- no such column
- */
- virtual PColumnModel getColumnModelByID( ColumnID id ) = 0;
-
/** returns a renderer which is able to paint the table represented
by this table model
@return the renderer to use. Must not be <NULL/>
*/
- SVT_DLLPRIVATE virtual PTableRenderer getRenderer() const = 0;
+ virtual PTableRenderer getRenderer() const = 0;
/** returns the component handling input in a view associated with the model
*/
@@ -404,12 +386,10 @@ namespace svt { namespace table
/** determines the height of rows in the table.
@return
- the logical height of rows in the table, in 1/100 millimeters. The height must be
+ the logical height of rows in the table, in app-font units. The height must be
greater 0.
*/
- SVT_DLLPRIVATE virtual TableMetrics getRowHeight() const = 0;
-
- SVT_DLLPRIVATE virtual void setRowHeight(TableMetrics _nRowHeight) = 0;
+ virtual TableMetrics getRowHeight() const = 0;
/** determines the height of the column header row
@@ -417,10 +397,10 @@ namespace svt { namespace table
returned <FALSE/>.
@return
- the logical height of the column header row, in 1/100 millimeters.
+ the logical height of the column header row, in app-font units.
Must be greater than 0.
*/
- SVT_DLLPRIVATE virtual TableMetrics getColumnHeaderHeight() const = 0;
+ virtual TableMetrics getColumnHeaderHeight() const = 0;
/** determines the width of the row header column
@@ -428,48 +408,105 @@ namespace svt { namespace table
returned <FALSE/>.
@return
- the logical width of the row header column, in 1/100 millimeters.
+ the logical width of the row header column, in app-font units.
Must be greater than 0.
*/
- SVT_DLLPRIVATE virtual TableMetrics getRowHeaderWidth() const = 0;
+ virtual TableMetrics getRowHeaderWidth() const = 0;
- /** determines the visibility of the vertical scrollbar of the table control
- @param overAllHeight the height of the table with all rows
- @param actHeight the given height of the table
+ /** returns the visibilit mode of the vertical scrollbar
*/
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int overAllHeight,int actHeight) const = 0;
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const = 0;
- /** determines the visibility of the horizontal scrollbar of the table control
- @param overAllWidth the width of the table with all columns
- @param actWidth the given width of the table
+ /** returns the visibilit mode of the horizontal scrollbar
*/
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const = 0;
- virtual bool hasVerticalScrollbar() =0;
- virtual bool hasHorizontalScrollbar() = 0;
- /** fills cells with content
- */
- virtual void setCellContent(const std::vector< std::vector< ::com::sun::star::uno::Any > >& cellContent)=0;
- /** gets the content of the cells
- */
- virtual std::vector< std::vector< ::com::sun::star::uno::Any > >& getCellContent() = 0;
- /**sets title of header rows
- */
- SVT_DLLPRIVATE virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)=0;
- /** gets title of header rows
- */
- virtual std::vector<rtl::OUString>& getRowHeaderName() = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getLineColor() = 0;
- SVT_DLLPRIVATE virtual void setLineColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getHeaderBackgroundColor() = 0;
- SVT_DLLPRIVATE virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getTextColor() = 0;
- SVT_DLLPRIVATE virtual void setTextColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getOddRowBackgroundColor() = 0;
- SVT_DLLPRIVATE virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::util::Color getEvenRowBackgroundColor() = 0;
- SVT_DLLPRIVATE virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor) = 0;
- SVT_DLLPRIVATE virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() = 0;
- SVT_DLLPRIVATE virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _xAlign) = 0;
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const = 0;
+
+ /** adds a listener to be notified of changes in the table model
+ */
+ virtual void addTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** remove a listener to be notified of changes in the table model
+ */
+ virtual void removeTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** retrieves the content of the given cell
+ */
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent ) = 0;
+
+ /** returns an object which should be displayed as tooltip for the given cell
+
+ At the moment, only string-convertible values are supported here. In the future, one might imagine displaying
+ scaled-down versions of a graphic in a cell, and a larger version of that very graphic as tooltip.
+
+ If no tooltip object is provided, then the cell content is used, and displayed as tooltip for the cell
+ if and only if it doesn't fit into the cell's space itself.
+
+ @param i_col
+ The column index of the cell in question. COL_ROW_HEADERS is a valid argument here.
+ @param i_row
+ The row index of the cell in question.
+ @param o_cellToolTip
+ takes the tooltip object upon return.
+ */
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any & o_cellToolTip ) = 0;
+
+ /** retrieves title of a given row
+ */
+ virtual ::com::sun::star::uno::Any getRowHeading( RowPos const i_rowPos ) const = 0;
+
+ /** returns the color to be used for rendering the grid lines.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getLineColor() const = 0;
+
+ /** returns the color to be used for rendering the header background.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const = 0;
+
+ /** returns the color to be used for rendering the header text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const = 0;
+
+ /** returns the color to be used for rendering cell texts.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextColor() const = 0;
+
+ /** returns the color to be used for text lines (underline, strikethrough) when rendering cell text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::boost::optional< ::Color > getTextLineColor() const = 0;
+
+ /** returns the colors to be used for the row backgrounds.
+
+ If this value is not set, every second row will have a background color derived from the style settings's
+ selection color, the other rows will not have a special background at all.
+
+ If this value is an empty sequence, the rows will not have a special background at all, instead the
+ normal background of the complete control will be used.
+
+ If value is a non-empty sequence, then rows will have the background colors as specified in the sequence,
+ in alternating order.
+ */
+ virtual ::boost::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const = 0;
+
+ /** determines the vertical alignment of content within a cell
+ */
+ virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() const = 0;
+
+ /** returns an adapter to the sorting functionality of the model
+
+ It is legitimate to return <NULL/> here, in this case, the table model does not support sorting.
+ */
+ virtual ITableDataSort* getSortAdapter() = 0;
/// destroys the table model instance
virtual ~ITableModel() { }
diff --git a/svtools/inc/svtools/table/tablerenderer.hxx b/svtools/inc/svtools/table/tablerenderer.hxx
index f81771dd22e6..3d50c9d70ee7 100644
--- a/svtools/inc/svtools/table/tablerenderer.hxx
+++ b/svtools/inc/svtools/table/tablerenderer.hxx
@@ -46,6 +46,7 @@ namespace svt { namespace table
class SAL_NO_VTABLE ITableRenderer
{
public:
+
/** paints a (part of) header area
There are two header areas in a table control:
@@ -175,12 +176,10 @@ namespace svt { namespace table
the are into which the row header should be painted
@param _rStyle
the style to be used for drawing
- @param _rText
- the title of the header row
*/
virtual void PaintRowHeader( bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0;
+ const StyleSettings& _rStyle ) = 0;
/** paints a certain cell
@@ -207,46 +206,11 @@ namespace svt { namespace table
the are into which the cell should be painted
@param _rStyle
the style to be used for drawing
- @param _pCellData
- the content of the cell
*/
- virtual void PaintCellImage( ColPos _nColumn,
+ virtual void PaintCell( ColPos const i_col,
bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, Image* _pCellData ) = 0;
-
- /** paints a certain cell
-
- The row to be painted is denoted by the most recent call to
- ->PrepareRow.
-
- @param _bSelected
- <TRUE/> if and only if the cell to be painted is
- selected currently. This is the case if either
- the row or the column of the cell is currently selected.
- <br/>
- Note that this flag is equal to the respective flag in the
- previous ->PrepareRow call, it's passed here for convinience
- only.
- @param _bActive
- <TRUE/> if the cell is currently active.
- <br/>
- Note that this flag is equal to the respective flag in the
- previous ->PrepareRow call, it's passed here for convinience
- only.
- @param _rDevice
- denotes the device to paint onto
- @param _rArea
- the are into which the cell should be painted
- @param _rStyle
- the style to be used for drawing
- @param _rText
- the content of the cell
- */
- virtual void PaintCellString( ColPos _nColumn,
- bool _bActive, bool _bSelected,
- OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText ) = 0;
+ const StyleSettings& _rStyle ) = 0;
/** draws a cell cursor in the given rectangle
@@ -262,6 +226,41 @@ namespace svt { namespace table
*/
virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect) = 0;
+ /** checks whether a given cell content fits into a given target area on a given device.
+
+ @param i_colPos
+ denotes the column which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different columns.
+
+ @param i_rowPos
+ denotes the row which the cell content would be painted into. Your renderer implementation
+ would only need this parameter if rendering is done differently for different rows.
+
+ @param i_active
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for the active
+ cell.
+
+ @param i_selected
+ is <TRUE/> if and only if the renderer should assume the cell content would be painted for a selected
+ cell.
+
+ @param i_targetDevice
+ denotes the target device for the assumed rendering operation
+
+ @param i_targetArea
+ denotes the area within the target device for the assumed rendering operation.
+
+ @return
+ <TRUE/> if and only if the given cell content could be rendered into the given device and the
+ given area.
+ */
+ virtual bool FitsIntoCell(
+ ::com::sun::star::uno::Any const & i_cellContent,
+ ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected,
+ OutputDevice& i_targetDevice, Rectangle const & i_targetArea
+ ) = 0;
+
/// deletes the renderer instance
virtual ~ITableRenderer() { }
};
diff --git a/svtools/inc/svtools/table/tablesort.hxx b/svtools/inc/svtools/table/tablesort.hxx
new file mode 100755
index 000000000000..1690b4d51344
--- /dev/null
+++ b/svtools/inc/svtools/table/tablesort.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 SVTOOLS_TABLESORT_HXX
+#define SVTOOLS_TABLESORT_HXX
+
+#include "svtools/table/tabletypes.hxx"
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ColumnSortDirection
+ //==================================================================================================================
+ enum ColumnSortDirection
+ {
+ ColumnSortAscending,
+ ColumnSortDescending
+ };
+
+ //==================================================================================================================
+ //= ColumnSort
+ //==================================================================================================================
+ struct ColumnSort
+ {
+ ColPos nColumnPos;
+ ColumnSortDirection eSortDirection;
+
+ ColumnSort()
+ :nColumnPos( COL_INVALID )
+ ,eSortDirection( ColumnSortAscending )
+ {
+ }
+
+ ColumnSort( ColPos const i_columnPos, ColumnSortDirection const i_sortDirection )
+ :nColumnPos( i_columnPos )
+ ,eSortDirection( i_sortDirection )
+ {
+ }
+ };
+
+ //==================================================================================================================
+ //= ITableDataSort
+ //==================================================================================================================
+ /** provides sorting functionality for the datta underlying an ITableModel
+ */
+ class SAL_NO_VTABLE ITableDataSort
+ {
+ public:
+ /** sorts the rows in the model by the given column's data, in the given direction.
+ */
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection ) = 0;
+
+ /** retrieves the current sort order of the data
+
+ If the <code>nColumnIndex</code> member of the returned srtructure is <code>COL_INVALID</code>, then
+ the data is currently not sorted.
+ */
+ virtual ColumnSort getCurrentSortOrder() const = 0;
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_TABLESORT_HXX
diff --git a/svtools/inc/svtools/table/tabletypes.hxx b/svtools/inc/svtools/table/tabletypes.hxx
index 645120e30d4b..ae20851992e3 100644
--- a/svtools/inc/svtools/table/tabletypes.hxx
+++ b/svtools/inc/svtools/table/tabletypes.hxx
@@ -49,14 +49,7 @@ namespace svt { namespace table
*/
typedef sal_Int32 AnyPos;
- /// the ID of a column in a table
- typedef sal_Int32 ColumnID;
-
typedef sal_Int32 TableMetrics;
-/** special column width value which indicates that the column should be
- automatically resized to fit the view
-*/
-#define COLWIDTH_FIT_TO_VIEW ((::svt::table::TableMetrics)-1)
/// denotes the column containing the row headers
#define COL_ROW_HEADERS ((::svt::table::ColPos)-1)
diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst
index fd0f1a560c18..ff9aa6a9875c 100644
--- a/svtools/prj/build.lst
+++ b/svtools/prj/build.lst
@@ -1,2 +1,2 @@
-st svtools : l10n svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal sot jvmfwk LIBXSLT:libxslt NULL
+st svtools : L10N:l10n svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal sot jvmfwk LIBXSLT:libxslt NULL
st svtools\prj nmake - all st_prj NULL
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index c13eabd2314e..377180653780 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -752,17 +752,18 @@ void BrowserScrollBar::Tracking( const TrackingEvent& rTEvt )
sal_uLong nPos = GetThumbPos();
if ( nPos != _nLastPos )
{
- if ( _nTip )
- Help::HideTip( _nTip );
-
String aTip( String::CreateFromInt32(nPos) );
aTip += '/';
if ( _pDataWin->GetRealRowCount().Len() )
aTip += _pDataWin->GetRealRowCount();
else
aTip += String::CreateFromInt32(GetRangeMax());
+
Rectangle aRect( GetPointerPosPixel(), Size( GetTextHeight(), GetTextWidth( aTip ) ) );
- _nTip = Help::ShowTip( this, aRect, aTip );
+ if ( _nTip )
+ Help::UpdateTip( _nTip, this, aRect, aTip );
+ else
+ _nTip = Help::ShowTip( this, aRect, aTip );
_nLastPos = nPos;
}
diff --git a/svtools/source/contnr/svcontnr.src b/svtools/source/contnr/svcontnr.src
index bcd1e060664f..e0449fc3f644 100644
--- a/svtools/source/contnr/svcontnr.src
+++ b/svtools/source/contnr/svcontnr.src
@@ -74,30 +74,3 @@ String STR_SVT_ACC_EMPTY_FIELD
Text [ en-US ] = "Empty Field";
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svtools/source/control/filectrl.src b/svtools/source/control/filectrl.src
index dc8bbb5905d6..f9d63b65b838 100644..100755
--- a/svtools/source/control/filectrl.src
+++ b/svtools/source/control/filectrl.src
@@ -31,28 +31,20 @@ String STR_FILECTRL_BUTTONTEXT
Text [ en-US ] = "Browse..." ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String STR_TABBAR_PUSHBUTTON_MOVET0HOME
+{
+ Text [ en-US ] = "Move To Home" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVELEFT
+{
+ Text [ en-US ] = "Move Left" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVERIGHT
+{
+ Text [ en-US ] = "Move Right" ;
+};
+String STR_TABBAR_PUSHBUTTON_MOVETOEND
+{
+ Text [ en-US ] = "Move To End" ;
+};
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 164118d12ef9..1c5b95460232 100755
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -303,6 +303,7 @@ void Ruler::ImplInit( WinBits nWinBits )
else
aDefSize.Width() = nDefHeight;
SetOutputSizePixel( aDefSize );
+ SetType(WINDOW_RULER);
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 033ae63e8a0a..b7511d24b5c8 100755
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -38,7 +38,8 @@
#include <vcl/button.hxx>
#include <vcl/edit.hxx>
#include "svtaccessiblefactory.hxx"
-
+#include <filectrl.hrc>
+#include <svtools/svtdata.hxx>
#include <limits>
// =======================================================================
@@ -397,6 +398,16 @@ void TabBar::ImplInit( WinBits nWinStyle )
mnOffY++;
ImplInitControls();
+
+ if(mpFirstBtn)
+ mpFirstBtn->SetAccessibleName(String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVET0HOME)));
+ if(mpPrevBtn)
+ mpPrevBtn->SetAccessibleName( String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVELEFT)));
+ if(mpNextBtn)
+ mpNextBtn->SetAccessibleName(String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVERIGHT)));
+ if(mpLastBtn)
+ mpLastBtn->SetAccessibleName( String(SvtResId(STR_TABBAR_PUSHBUTTON_MOVETOEND)));
+
SetSizePixel( Size( 100, CalcWindowSizePixel().Height() ) );
ImplInitSettings( sal_True, sal_True );
}
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index 9ffc4fc55f04..620002017e6c 100644
--- a/svtools/source/control/toolbarmenuacc.cxx
+++ b/svtools/source/control/toolbarmenuacc.cxx
@@ -252,7 +252,7 @@ OUString SAL_CALL ToolbarMenuAcc::getAccessibleName() throw (RuntimeException)
if( !aRet.getLength() )
{
- Window* pLabel = mpParent->mrMenu.GetLabeledBy();
+ Window* pLabel = mpParent->mrMenu.GetAccessibleRelationLabeledBy();
if( pLabel && pLabel != &mpParent->mrMenu )
aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
}
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 848ef4c3e10e..1b98e3197bd3 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -317,7 +317,7 @@ sal_Int16 SAL_CALL ValueSetAcc::getAccessibleRole()
if ( !aRet.Len() )
{
- Window* pLabel = mpParent->GetLabeledBy();
+ Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != mpParent )
aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
}
diff --git a/svtools/source/dialogs/colrdlg.hrc b/svtools/source/dialogs/colrdlg.hrc
index 41329df6e366..b1e785bd2f17 100644
--- a/svtools/source/dialogs/colrdlg.hrc
+++ b/svtools/source/dialogs/colrdlg.hrc
@@ -65,3 +65,5 @@
#define BTN_CANCEL 1
#define BTN_HELP 1
+//IAccessibility2 Implementation 2009-----
+#define STR_COLORDES 3001
diff --git a/svtools/source/dialogs/colrdlg.src b/svtools/source/dialogs/colrdlg.src
index a93642b0bd05..fee6314b28cc 100644
--- a/svtools/source/dialogs/colrdlg.src
+++ b/svtools/source/dialogs/colrdlg.src
@@ -277,45 +277,19 @@ ModalDialog DLG_COLOR
Border = TRUE ;
Pos = MAP_APPFONT ( 200 , 109 ) ;
Size = MAP_APPFONT ( 26 , 51 + DIFF ) ;
- TabStop = TRUE ;
+ TabStop = FALSE ;
};
Control CTL_PREVIEW
{
Border = TRUE ;
Pos = MAP_APPFONT ( 229 , 109 ) ;
Size = MAP_APPFONT ( 26 , 51 + DIFF ) ;
- TabStop = TRUE ;
+ TabStop = FALSE ;
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String STR_COLORDES
+{
+ Text [ en-US ] = "RGB(%1, %2, %3) Hue:%4 Saturation:%5 Brightness:%6";
+};
diff --git a/svtools/source/inc/filectrl.hrc b/svtools/source/inc/filectrl.hrc
index 1707e306e1b0..150bbba4ac68 100644
--- a/svtools/source/inc/filectrl.hrc
+++ b/svtools/source/inc/filectrl.hrc
@@ -30,5 +30,12 @@
#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
+//IAccessibility2 Implementation 2009-----
+#define STR_TABBAR_PUSHBUTTON_MOVET0HOME ( STR_FILECTRL_BUTTONTEXT+ 1)
+#define STR_TABBAR_PUSHBUTTON_MOVELEFT ( STR_FILECTRL_BUTTONTEXT+ 2)
+#define STR_TABBAR_PUSHBUTTON_MOVERIGHT ( STR_FILECTRL_BUTTONTEXT+ 3)
+#define STR_TABBAR_PUSHBUTTON_MOVETOEND ( STR_FILECTRL_BUTTONTEXT+ 4)
+//-----IAccessibility2 Implementation 2009
+
#endif
diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src
index 067eb601a5af..bb5fa2dfd363 100644
--- a/svtools/source/misc/langtab.src
+++ b/svtools/source/misc/langtab.src
@@ -301,7 +301,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Shuswap" ; LANGUAGE_USER_SHUSWAP ; > ;
< "Oromo" ; LANGUAGE_OROMO ; > ;
< "Greek, Ancient" ; LANGUAGE_USER_ANCIENT_GREEK ; > ;
- < "Yiddish" ; LANGUAGE_YIDDISH ; > ;
+ < "Yiddish (Israel)" ; LANGUAGE_YIDDISH ; > ;
< "Quechua (Ecuador)" ; LANGUAGE_QUECHUA_ECUADOR ; > ;
< "Uyghur" ; LANGUAGE_UIGHUR_CHINA ; > ;
< "Asturian" ; LANGUAGE_USER_ASTURIAN ; > ;
@@ -323,6 +323,12 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Yoruba" ; LANGUAGE_YORUBA ; > ;
< "Rusyn (Ukraine)" ; LANGUAGE_USER_RUSYN_UKRAINE ; > ;
< "Rusyn (Slovakia)" ; LANGUAGE_USER_RUSYN_SLOVAKIA ; > ;
+ < "Yiddish (USA)" ; LANGUAGE_USER_YIDDISH_US ; > ;
+ < "Hawaiian" ; LANGUAGE_HAWAIIAN_UNITED_STATES ; > ;
+ < "Limbu" ; LANGUAGE_USER_LIMBU ; > ;
+ < "Lojban" ; LANGUAGE_USER_LOJBAN ; > ;
+ < "Kabyle" ; LANGUAGE_USER_KABYLE ; > ;
+ < "Haitian" ; LANGUAGE_USER_HAITIAN ; > ;
};
};
diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx
new file mode 100755
index 000000000000..286ca505bb30
--- /dev/null
+++ b/svtools/source/table/cellvalueconversion.cxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svtools.hxx"
+
+#include "cellvalueconversion.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace svt
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= CellValueConversion
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString CellValueConversion::convertToString( const Any& i_value )
+ {
+ ::rtl::OUString sConvertString;
+ if ( !i_value.hasValue() )
+ return sConvertString;
+
+
+ // TODO: use css.script.XTypeConverter?
+
+ sal_Int32 nInt = 0;
+ sal_Bool bBool = false;
+ double fDouble = 0;
+
+ ::rtl::OUString sStringValue;
+ if ( i_value >>= sConvertString )
+ sStringValue = sConvertString;
+ else if ( i_value >>= nInt )
+ sStringValue = sConvertString.valueOf( nInt );
+ else if ( i_value >>= bBool )
+ sStringValue = sConvertString.valueOf( bBool );
+ else if ( i_value >>= fDouble )
+ sStringValue = sConvertString.valueOf( fDouble );
+ else
+ OSL_ENSURE( !i_value.hasValue(), "CellValueConversion::convertToString: cannot handle the given cell content type!" );
+
+ return sStringValue;
+ }
+
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
diff --git a/svtools/source/inc/accessibletableimp.hxx b/svtools/source/table/cellvalueconversion.hxx
index 3a01c01567d3..4d6b8c8d6aac 100644..100755
--- a/svtools/source/inc/accessibletableimp.hxx
+++ b/svtools/source/table/cellvalueconversion.hxx
@@ -22,41 +22,31 @@
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
-************************************************************************/
+ ************************************************************************/
-#ifndef SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
-#define SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
+#ifndef SVTOOLS_CELLVALUECONVERSION_HXX
+#define SVTOOLS_CELLVALUECONVERSION_HXX
-#include "svtaccessiblefactory.hxx"
+/** === begin UNO includes === **/
+#include <com/sun/star/uno/Any.hxx>
+/** === end UNO includes === **/
-namespace svt { namespace table
+//......................................................................................................................
+namespace svt
{
-//........................................................................
+//......................................................................................................................
-
- class AccessibleTableControl_Impl
+ //==================================================================================================================
+ //= CellValueConversion
+ //==================================================================================================================
+ class CellValueConversion
{
- public:
- AccessibleFactoryAccess m_aFactoryAccess;
- IAccessibleTableControl* m_pAccessible;
-
- public:
- AccessibleTableControl_Impl() : m_pAccessible(NULL)
- {
- }
-
-
- /// @see AccessibleTableControl::getTableRowHeader
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- getAccessibleTableHeader( AccessibleTableControlObjType _eObjType );
- /// @see AccessibleTableControl::getTable
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- getAccessibleTable( );
-
+ public:
+ static ::rtl::OUString convertToString( const ::com::sun::star::uno::Any& i_cellValue );
};
-//........................................................................
-} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
+} // namespace svt
+//......................................................................................................................
-#endif // SVTOOLS_SOURCE_INC_ACCESSIBLETABLEIMP_HXX
+#endif // SVTOOLS_CELLVALUECONVERSION_HXX
diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx
index 133575fdf8cf..733366d16904 100644
--- a/svtools/source/table/defaultinputhandler.cxx
+++ b/svtools/source/table/defaultinputhandler.cxx
@@ -28,111 +28,123 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/defaultinputhandler.hxx"
-#include "svtools/table/abstracttablecontrol.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
+
+#include "tabledatawindow.hxx"
+#include "mousefunction.hxx"
#include <tools/debug.hxx>
#include <vcl/event.hxx>
#include <vcl/cursor.hxx>
-#include "svtools/table/tabledatawindow.hxx"
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//.......................................................................
+//......................................................................................................................
+ typedef ::rtl::Reference< IMouseFunction > PMouseFunction;
+ typedef ::std::vector< PMouseFunction > MouseFunctions;
struct DefaultInputHandler_Impl
{
+ PMouseFunction pActiveFunction;
+ MouseFunctions aMouseFunctions;
};
- //====================================================================
+ //==================================================================================================================
//= DefaultInputHandler
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
DefaultInputHandler::DefaultInputHandler()
:m_pImpl( new DefaultInputHandler_Impl )
- ,m_bResize(false)
{
+ m_pImpl->aMouseFunctions.push_back( new ColumnResize );
+ m_pImpl->aMouseFunctions.push_back( new RowSelection );
+ m_pImpl->aMouseFunctions.push_back( new ColumnSortHandler );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
DefaultInputHandler::~DefaultInputHandler()
{
- DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseMove( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
{
- Point aPoint = _rMEvt.GetPosPixel();
- if(m_bResize)
+ bool lcl_delegateMouseEvent( DefaultInputHandler_Impl& i_impl, ITableControl& i_control, const MouseEvent& i_event,
+ FunctionResult ( IMouseFunction::*i_handlerMethod )( ITableControl&, const MouseEvent& ) )
{
- _rControl.resizeColumn(aPoint);
- return true;
- }
- return false;
- }
-
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseButtonDown( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
- {
- bool bHandled = false;
- Point aPoint = _rMEvt.GetPosPixel();
- RowPos nRow = _rControl.getCurrentRow(aPoint);
- if(nRow == -1)
- {
- m_bResize = _rControl.startResizeColumn(aPoint);
- bHandled = true;
- }
- else if(nRow >= 0)
- {
- if(_rControl.getSelEngine()->GetSelectionMode() == NO_SELECTION)
+ if ( i_impl.pActiveFunction.is() )
{
- _rControl.setCursorAtCurrentCell(aPoint);
- bHandled = true;
+ bool furtherHandler = false;
+ switch ( (i_impl.pActiveFunction.get()->*i_handlerMethod)( i_control, i_event ) )
+ {
+ case ActivateFunction:
+ OSL_ENSURE( false, "lcl_delegateMouseEvent: unexpected - function already *is* active!" );
+ break;
+ case ContinueFunction:
+ break;
+ case DeactivateFunction:
+ i_impl.pActiveFunction.clear();
+ break;
+ case SkipFunction:
+ furtherHandler = true;
+ break;
+ }
+ if ( !furtherHandler )
+ // handled the event
+ return true;
}
- else
+
+ // ask all other handlers
+ bool handled = false;
+ for ( MouseFunctions::iterator handler = i_impl.aMouseFunctions.begin();
+ ( handler != i_impl.aMouseFunctions.end() ) && !handled;
+ ++handler
+ )
{
- if(!_rControl.isRowSelected(nRow))
- bHandled = _rControl.getSelEngine()->SelMouseButtonDown(_rMEvt);
- else
- bHandled = true;
+ if ( *handler == i_impl.pActiveFunction )
+ // we already invoked this function
+ continue;
+
+ switch ( (handler->get()->*i_handlerMethod)( i_control, i_event ) )
+ {
+ case ActivateFunction:
+ i_impl.pActiveFunction = *handler;
+ handled = true;
+ break;
+ case ContinueFunction:
+ case DeactivateFunction:
+ OSL_ENSURE( false, "lcl_delegateMouseEvent: unexpected: inactivate handler cannot be continued or deactivated!" );
+ break;
+ case SkipFunction:
+ handled = false;
+ break;
+ }
}
+ return handled;
}
- return bHandled;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::MouseButtonUp( IAbstractTableControl& _rControl, const MouseEvent& _rMEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseMove( ITableControl& i_tableControl, const MouseEvent& i_event )
{
- bool bHandled = false;
- Point aPoint = _rMEvt.GetPosPixel();
- if(_rControl.getCurrentRow(aPoint) >= 0)
- {
- if(m_bResize)
- {
- m_bResize = _rControl.endResizeColumn(aPoint);
- bHandled = true;
- }
- else if(_rControl.getSelEngine()->GetSelectionMode() == NO_SELECTION)
- {
- bHandled = true;
- }
- else
- {
- bHandled = _rControl.getSelEngine()->SelMouseButtonUp(_rMEvt);
- }
- }
- else
- {
- if(m_bResize)
- {
- m_bResize = _rControl.endResizeColumn(aPoint);
- bHandled = true;
- }
- }
- return bHandled;
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseMove );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseButtonDown( ITableControl& i_tableControl, const MouseEvent& i_event )
+ {
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseDown );
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::KeyInput( IAbstractTableControl& _rControl, const KeyEvent& rKEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::MouseButtonUp( ITableControl& i_tableControl, const MouseEvent& i_event )
+ {
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseUp );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::KeyInput( ITableControl& _rControl, const KeyEvent& rKEvt )
{
bool bHandled = false;
@@ -158,11 +170,11 @@ namespace svt { namespace table
{ KEY_PAGEDOWN, KEY_MOD1, cursorToLastLine },
{ KEY_HOME, KEY_MOD1, cursorTopLeft },
{ KEY_END, KEY_MOD1, cursorBottomRight },
- { KEY_SPACE, KEY_MOD1, cursorSelectRow },
- { KEY_UP, KEY_SHIFT, cursorSelectRowUp },
- { KEY_DOWN, KEY_SHIFT, cursorSelectRowDown },
- { KEY_END, KEY_SHIFT, cursorSelectRowAreaBottom },
- { KEY_HOME, KEY_SHIFT, cursorSelectRowAreaTop },
+ { KEY_SPACE, KEY_MOD1, cursorSelectRow },
+ { KEY_UP, KEY_SHIFT, cursorSelectRowUp },
+ { KEY_DOWN, KEY_SHIFT, cursorSelectRowDown },
+ { KEY_END, KEY_SHIFT, cursorSelectRowAreaBottom },
+ { KEY_HOME, KEY_SHIFT, cursorSelectRowAreaTop },
{ 0, 0, invalidTableControlAction }
};
@@ -173,7 +185,6 @@ namespace svt { namespace table
if ( ( pActions->nKeyCode == nKeyCode ) && ( pActions->nKeyModifier == rKeyCode.GetAllModifier() ) )
{
bHandled = _rControl.dispatchAction( pActions->eAction );
- bHandled = true; // always handled issue #i114340
break;
}
}
@@ -181,22 +192,22 @@ namespace svt { namespace table
return bHandled;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::GetFocus( IAbstractTableControl& _rControl )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::GetFocus( ITableControl& _rControl )
{
_rControl.showCursor();
return false; // continue processing
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::LoseFocus( IAbstractTableControl& _rControl )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::LoseFocus( ITableControl& _rControl )
{
_rControl.hideCursor();
return false; // continue processing
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::RequestHelp( IAbstractTableControl& _rControl, const HelpEvent& _rHEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::RequestHelp( ITableControl& _rControl, const HelpEvent& _rHEvt )
{
(void)_rControl;
(void)_rHEvt;
@@ -204,8 +215,8 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::Command( IAbstractTableControl& _rControl, const CommandEvent& _rCEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::Command( ITableControl& _rControl, const CommandEvent& _rCEvt )
{
(void)_rControl;
(void)_rCEvt;
@@ -213,8 +224,8 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::PreNotify( IAbstractTableControl& _rControl, NotifyEvent& _rNEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::PreNotify( ITableControl& _rControl, NotifyEvent& _rNEvt )
{
(void)_rControl;
(void)_rNEvt;
@@ -222,14 +233,14 @@ namespace svt { namespace table
return false;
}
- //--------------------------------------------------------------------
- bool DefaultInputHandler::Notify( IAbstractTableControl& _rControl, NotifyEvent& _rNEvt )
+ //------------------------------------------------------------------------------------------------------------------
+ bool DefaultInputHandler::Notify( ITableControl& _rControl, NotifyEvent& _rNEvt )
{
(void)_rControl;
(void)_rNEvt;
// TODO
return false;
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index 5fb61a9f385e..1e230d372c24 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -27,51 +27,209 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
+#include "cellvalueconversion.hxx"
#include "svtools/table/gridtablerenderer.hxx"
+#include "svtools/colorcfg.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/graphic/XGraphic.hpp>
+/** === end UNO includes === **/
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
#include <vcl/image.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/decoview.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::TypeClass_INTERFACE;
+ using ::com::sun::star::graphic::XGraphic;
+ using ::com::sun::star::style::HorizontalAlignment;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment_CENTER;
+ using ::com::sun::star::style::HorizontalAlignment_RIGHT;
+ using ::com::sun::star::style::VerticalAlignment;
+ using ::com::sun::star::style::VerticalAlignment_TOP;
+ using ::com::sun::star::style::VerticalAlignment_MIDDLE;
+ using ::com::sun::star::style::VerticalAlignment_BOTTOM;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= CachedSortIndicator
+ //==================================================================================================================
+ class CachedSortIndicator
+ {
+ public:
+ CachedSortIndicator()
+ :m_lastHeaderHeight( 0 )
+ ,m_lastArrowColor( COL_TRANSPARENT )
+ {
+ }
+
+ BitmapEx const & getBitmapFor( OutputDevice const & i_device, long const i_headerHeight, StyleSettings const & i_style, bool const i_sortAscending );
+
+ private:
+ long m_lastHeaderHeight;
+ Color m_lastArrowColor;
+ BitmapEx m_sortAscending;
+ BitmapEx m_sortDescending;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ BitmapEx const & CachedSortIndicator::getBitmapFor( OutputDevice const & i_device, long const i_headerHeight,
+ StyleSettings const & i_style, bool const i_sortAscending )
+ {
+ BitmapEx & rBitmap( i_sortAscending ? m_sortAscending : m_sortDescending );
+ if ( !rBitmap || ( i_headerHeight != m_lastHeaderHeight ) || ( i_style.GetActiveColor() != m_lastArrowColor ) )
+ {
+ long const nSortIndicatorWidth = 2 * i_headerHeight / 3;
+ long const nSortIndicatorHeight = 2 * nSortIndicatorWidth / 3;
+
+ Point const aBitmapPos( 0, 0 );
+ Size const aBitmapSize( nSortIndicatorWidth, nSortIndicatorHeight );
+ VirtualDevice aDevice( i_device, 0, 0 );
+ aDevice.SetOutputSizePixel( aBitmapSize );
+
+ DecorationView aDecoView( &aDevice );
+ aDecoView.DrawSymbol(
+ Rectangle( aBitmapPos, aBitmapSize ),
+ i_sortAscending ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN,
+ i_style.GetActiveColor()
+ );
+
+ rBitmap = aDevice.GetBitmapEx( aBitmapPos, aBitmapSize );
+ m_lastHeaderHeight = i_headerHeight;
+ m_lastArrowColor = i_style.GetActiveColor();
+ }
+ return rBitmap;
+ }
+ //==================================================================================================================
+ //= GridTableRenderer_Impl
+ //==================================================================================================================
struct GridTableRenderer_Impl
{
- ITableModel& rModel;
- RowPos nCurrentRow;
+ ITableModel& rModel;
+ RowPos nCurrentRow;
+ bool bUseGridLines;
+ CachedSortIndicator aSortIndicator;
GridTableRenderer_Impl( ITableModel& _rModel )
:rModel( _rModel )
,nCurrentRow( ROW_INVALID )
+ ,bUseGridLines( true )
{
}
};
- //====================================================================
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ static Rectangle lcl_getContentArea( GridTableRenderer_Impl const & i_impl, Rectangle const & i_cellArea )
+ {
+ Rectangle aContentArea( i_cellArea );
+ if ( i_impl.bUseGridLines )
+ {
+ --aContentArea.Right();
+ --aContentArea.Bottom();
+ }
+ return aContentArea;
+ }
+ static Rectangle lcl_getTextRenderingArea( Rectangle const & i_contentArea )
+ {
+ Rectangle aTextArea( i_contentArea );
+ aTextArea.Left() += 2; aTextArea.Right() -= 2;
+ ++aTextArea.Top(); --aTextArea.Bottom();
+ return aTextArea;
+ }
+
+ static sal_uLong lcl_getAlignmentTextDrawFlags( GridTableRenderer_Impl const & i_impl, ColPos const i_columnPos )
+ {
+ sal_uLong nVertFlag = TEXT_DRAW_TOP;
+ VerticalAlignment const eVertAlign = i_impl.rModel.getVerticalAlign();
+ switch ( eVertAlign )
+ {
+ case VerticalAlignment_MIDDLE: nVertFlag = TEXT_DRAW_VCENTER; break;
+ case VerticalAlignment_BOTTOM: nVertFlag = TEXT_DRAW_BOTTOM; break;
+ default:
+ break;
+ }
+
+ sal_uLong nHorzFlag = TEXT_DRAW_LEFT;
+ HorizontalAlignment const eHorzAlign = i_impl.rModel.getColumnModel( i_columnPos )->getHorizontalAlign();
+ switch ( eHorzAlign )
+ {
+ case HorizontalAlignment_CENTER: nHorzFlag = TEXT_DRAW_CENTER; break;
+ case HorizontalAlignment_RIGHT: nHorzFlag = TEXT_DRAW_RIGHT; break;
+ default:
+ break;
+ }
+
+ return nVertFlag | nHorzFlag;
+ }
+
+ }
+
+ //==================================================================================================================
//= GridTableRenderer
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
GridTableRenderer::GridTableRenderer( ITableModel& _rModel )
:m_pImpl( new GridTableRenderer_Impl( _rModel ) )
{
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
GridTableRenderer::~GridTableRenderer()
{
- DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- RowPos GridTableRenderer::getCurrentRow()
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos GridTableRenderer::getCurrentRow() const
{
return m_pImpl->nCurrentRow;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ bool GridTableRenderer::useGridLines() const
+ {
+ return m_pImpl->bUseGridLines;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::useGridLines( bool const i_use )
+ {
+ m_pImpl->bUseGridLines = i_use;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ Color lcl_getEffectiveColor(
+ ::boost::optional< ::Color > const & i_modelColor,
+ StyleSettings const & i_styleSettings,
+ ::Color const & ( StyleSettings::*i_getDefaultColor ) () const
+ )
+ {
+ if ( !!i_modelColor )
+ return *i_modelColor;
+ return ( i_styleSettings.*i_getDefaultColor )();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintHeaderArea(
OutputDevice& _rDevice, const Rectangle& _rArea, bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
const StyleSettings& _rStyle )
@@ -79,15 +237,18 @@ namespace svt { namespace table
OSL_PRECOND( _bIsColHeaderArea || _bIsRowHeaderArea,
"GridTableRenderer::PaintHeaderArea: invalid area flags!" );
- _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR);
- Color background = m_pImpl->rModel.getHeaderBackgroundColor();
- if( background != 0xFFFFFF)
- _rDevice.SetFillColor(background);
- else
- _rDevice.SetFillColor(_rStyle.GetDialogColor());
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
+ _rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR );
+
+ Color const background = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderBackgroundColor(), _rStyle, &StyleSettings::GetDialogColor );
+ _rDevice.SetFillColor( background );
+
+ _rDevice.SetLineColor();
_rDevice.DrawRect( _rArea );
+
// delimiter lines at bottom/right
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
_rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
@@ -96,48 +257,73 @@ namespace svt { namespace table
(void)_bIsRowHeaderArea;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle )
{
_rDevice.Push( PUSH_LINECOLOR);
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight());
String sHeaderText;
- PColumnModel pColumn = m_pImpl->rModel.getColumnModel( _nCol );
+ PColumnModel const pColumn = m_pImpl->rModel.getColumnModel( _nCol );
DBG_ASSERT( !!pColumn, "GridTableRenderer::PaintColumnHeader: invalid column model object!" );
if ( !!pColumn )
sHeaderText = pColumn->getName();
- if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
- else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- sal_uLong nHorFlag = TEXT_DRAW_LEFT;
- sal_uLong nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(_nCol)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(_nCol)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle aRect(_rArea);
- aRect.Left()+=4; aRect.Right()-=4;
- aRect.Bottom()-=2;
- _rDevice.DrawText( aRect, sHeaderText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getTextColor(), _rStyle, &StyleSettings::GetFieldTextColor );
+ _rDevice.SetTextColor( textColor );
+
+ Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, _nCol ) | TEXT_DRAW_CLIP;
+ _rDevice.DrawText( aTextRect, sHeaderText, nDrawTextFlags );
+
+ ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
+ _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight());
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
+
+ // draw sort indicator if the model data is sorted by the given column
+ ITableDataSort const * pSortAdapter = m_pImpl->rModel.getSortAdapter();
+ ColumnSort aCurrentSortOrder;
+ if ( pSortAdapter != NULL )
+ aCurrentSortOrder = pSortAdapter->getCurrentSortOrder();
+ if ( aCurrentSortOrder.nColumnPos == _nCol )
+ {
+ long const nHeaderHeight( _rArea.GetHeight() );
+ BitmapEx const aIndicatorBitmap = m_pImpl->aSortIndicator.getBitmapFor( _rDevice, nHeaderHeight, _rStyle,
+ aCurrentSortOrder.eSortDirection == ColumnSortAscending );
+ Size const aBitmapSize( aIndicatorBitmap.GetSizePixel() );
+ long const nSortIndicatorPaddingX = 2;
+ long const nSortIndicatorPaddingY = ( nHeaderHeight - aBitmapSize.Height() ) / 2;
+
+ if ( ( nDrawTextFlags & TEXT_DRAW_RIGHT ) != 0 )
+ {
+ // text is right aligned => draw the sort indicator at the left hand side
+ _rDevice.DrawBitmapEx(
+ Point( _rArea.Left() + nSortIndicatorPaddingX, _rArea.Top() + nSortIndicatorPaddingY ),
+ aIndicatorBitmap
+ );
+ }
+ else
+ {
+ // text is left-aligned or centered => draw the sort indicator at the right hand side
+ _rDevice.DrawBitmapEx(
+ Point( _rArea.Right() - nSortIndicatorPaddingX - aBitmapSize.Width(), nSortIndicatorPaddingY ),
+ aIndicatorBitmap
+ );
+ }
+ }
+
_rDevice.Pop();
(void)_bActive;
// no special painting for the active column at the moment
(void)_bSelected;
- //selection for column header not yet implemented
+ // selection for column header not yet implemented
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rRowArea, const StyleSettings& _rStyle )
{
@@ -146,237 +332,288 @@ namespace svt { namespace table
_rDevice.Push( PUSH_FILLCOLOR | PUSH_LINECOLOR);
- Color aRowBackground = m_pImpl->rModel.getOddRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- Color aRowBackground2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color fieldColor = _rStyle.GetFieldColor();
- if(aRowBackground == 0xFFFFFF)
- aRowBackground = fieldColor;
- if(aRowBackground2 == 0xFFFFFF)
- aRowBackground2 = fieldColor;
- //if row is selected background color becomes blue, and lines should be also blue
- //if they aren't user defined
- if(_bSelected)
+ ::Color backgroundColor = _rStyle.GetFieldColor();
+
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+
+ if ( _bSelected )
{
- Color aSelected(_rStyle.GetHighlightColor());
- aRowBackground = aSelected;
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
- else
- _rDevice.SetLineColor(line);
+ // selected rows use the background color from the style
+ backgroundColor = _rStyle.GetHighlightColor();
+ if ( !aLineColor )
+ lineColor = backgroundColor;
}
- //if row not selected, check the cases whether user defined backgrounds are set
- //and set line color to be the same
else
{
- if(aRowBackground2 != fieldColor && _nRow%2)
+ ::boost::optional< ::std::vector< ::Color > > aRowColors = m_pImpl->rModel.getRowBackgroundColors();
+ if ( !aRowColors )
{
- aRowBackground = aRowBackground2;
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
+ // use alternating default colors
+ Color const fieldColor = _rStyle.GetFieldColor();
+ if ( _rStyle.GetHighContrastMode() || ( ( m_pImpl->nCurrentRow % 2 ) == 0 ) )
+ {
+ backgroundColor = fieldColor;
+ }
else
- _rDevice.SetLineColor(line);
+ {
+ Color hilightColor = _rStyle.GetHighlightColor();
+ hilightColor.SetRed( 9 * ( fieldColor.GetRed() - hilightColor.GetRed() ) / 10 + hilightColor.GetRed() );
+ hilightColor.SetGreen( 9 * ( fieldColor.GetGreen() - hilightColor.GetGreen() ) / 10 + hilightColor.GetGreen() );
+ hilightColor.SetBlue( 9 * ( fieldColor.GetBlue() - hilightColor.GetBlue() ) / 10 + hilightColor.GetBlue() );
+ backgroundColor = hilightColor;
+ }
}
- //fill the rows with alternating background colors if second background color is specified
- else if(aRowBackground != fieldColor && line == 0xFFFFFF)
- _rDevice.SetLineColor(aRowBackground);
else
{
- //if Line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ if ( aRowColors->empty() )
+ {
+ // all colors have the same background color
+ backgroundColor = _rStyle.GetFieldColor();
+ }
+ else
+ {
+ backgroundColor = aRowColors->at( m_pImpl->nCurrentRow % aRowColors->size() );
+ }
}
}
- _rDevice.SetFillColor( aRowBackground );
- _rDevice.DrawRect( _rRowArea );
- // TODO: active?
+ //m_pImpl->bUseGridLines ? _rDevice.SetLineColor( lineColor ) : _rDevice.SetLineColor();
+ _rDevice.SetLineColor();
+ _rDevice.SetFillColor( backgroundColor );
+ _rDevice.DrawRect( _rRowArea );
_rDevice.Pop();
+
(void)_bActive;
+ // row containing the active cell not rendered any special at the moment
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::PaintRowHeader( bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea,
- const StyleSettings& _rStyle, rtl::OUString& _rText )
+ const StyleSettings& _rStyle )
{
- _rDevice.Push( PUSH_LINECOLOR);
- _rDevice.SetLineColor(_rStyle.GetSeparatorColor());
+ _rDevice.Push( PUSH_LINECOLOR | PUSH_TEXTCOLOR );
+
+ ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color const lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+ _rDevice.SetLineColor( lineColor );
_rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
- if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
- else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- sal_uLong nHorFlag = TEXT_DRAW_LEFT;
- sal_uLong nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(0)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(0)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle aRect(_rArea);
- aRect.Left()+=4; aRect.Right()-=4;
- aRect.Bottom()-=2;
- _rDevice.DrawText( aRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+
+ Any const rowHeading( m_pImpl->rModel.getRowHeading( m_pImpl->nCurrentRow ) );
+ ::rtl::OUString const rowTitle( CellValueConversion::convertToString( rowHeading ) );
+ if ( rowTitle.getLength() )
+ {
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderTextColor(), _rStyle, &StyleSettings::GetFieldTextColor );
+ _rDevice.SetTextColor( textColor );
+
+ Rectangle const aTextRect( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, _rArea ) ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, 0 ) | TEXT_DRAW_CLIP;
+ // TODO: is using the horizontal alignment of the 0'th column a good idea here? This is pretty ... arbitray ..
+ _rDevice.DrawText( aTextRect, rowTitle, nDrawTextFlags );
+ }
+
// TODO: active? selected?
(void)_bActive;
(void)_bSelected;
- //at the moment no special paint for selected row header
_rDevice.Pop();
}
- //--------------------------------------------------------------------
- void GridTableRenderer::PaintCellImage( ColPos _nColumn, bool _bSelected, bool _bActive,
- OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, Image* _pCellData )
- {
- _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR);
- Color background1 = m_pImpl->rModel.getOddRowBackgroundColor();
- Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- //if row is selected and line color isn't user specified, set it blue
- if(_bSelected)
+ //------------------------------------------------------------------------------------------------------------------
+ struct GridTableRenderer::CellRenderContext
+ {
+ OutputDevice& rDevice;
+ Rectangle const aContentArea;
+ StyleSettings const & rStyle;
+ ColPos const nColumn;
+ bool const bSelected;
+
+ CellRenderContext( OutputDevice& i_device, Rectangle const & i_contentArea,
+ StyleSettings const & i_style, ColPos const i_column, bool const i_selected )
+ :rDevice( i_device )
+ ,aContentArea( i_contentArea )
+ ,rStyle( i_style )
+ ,nColumn( i_column )
+ ,bSelected( i_selected )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(_rStyle.GetHighlightColor());
- else
- _rDevice.SetLineColor(line);
}
- //else set line color to the color of row background
- else
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::PaintCell( ColPos const i_column, bool _bSelected, bool _bActive,
+ OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle )
+ {
+ _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+
+ Rectangle const aContentArea( lcl_getContentArea( *m_pImpl, _rArea ) );
+ CellRenderContext const aRenderContext( _rDevice, aContentArea, _rStyle, i_column, _bSelected );
+ impl_paintCellContent( aRenderContext );
+
+ if ( m_pImpl->bUseGridLines )
{
- if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2)
- {
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(background2);
- else
- _rDevice.SetLineColor(line);
- }
- else if(background1 != 0xFFFFFF && line == 0xFFFFFF)
- _rDevice.SetLineColor(background1);
- else
+ ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() );
+ ::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor;
+
+ if ( _bSelected && !aLineColor )
{
- //if line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ // if no line color is specified by the model, use the usual selection color for lines in selected cells
+ lineColor = _rStyle.GetHighlightColor();
}
- }
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
- Rectangle aRect( _rArea );
- ++aRect.Left(); --aRect.Right();
- aRect.Top(); aRect.Bottom();
- Point imagePos(Point(aRect.Left(), aRect.Top()));
- Size imageSize = _pCellData->GetSizePixel();
- if(aRect.GetWidth() > imageSize.Width())
- {
- if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 1)
- imagePos.X() = aRect.Left()+((double)(aRect.GetWidth() - imageSize.Width()))/2;
- else if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 2)
- imagePos.X() = aRect.Right() - imageSize.Width();
- }
- else
- imageSize.Width() = aRect.GetWidth();
- if(aRect.GetHeight() > imageSize.Height())
- {
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- imagePos.Y() = aRect.Top()+((double)(aRect.GetHeight() - imageSize.Height()))/2;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- imagePos.Y() = aRect.Bottom() - imageSize.Height();
+ _rDevice.SetLineColor( lineColor );
+ _rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() );
+ _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
}
- else
- imageSize.Height() = aRect.GetHeight()-1;
- Image& image (*_pCellData);
- _rDevice.DrawImage(imagePos, imageSize, image, 0);
+
_rDevice.Pop();
(void)_bActive;
// no special painting for the active cell at the moment
}
- //--------------------------------------------------------------------
- void GridTableRenderer::PaintCellString( ColPos _nColumn, bool _bSelected, bool _bActive,
- OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, rtl::OUString& _rText )
- {
- _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
- Color background1 = m_pImpl->rModel.getOddRowBackgroundColor();
- Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor();
- Color line = m_pImpl->rModel.getLineColor();
- //if row is selected and line color isn't user specified, set it blue
- if(_bSelected)
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellImage( CellRenderContext const & i_context, Image const & i_image )
+ {
+ Point imagePos( Point( i_context.aContentArea.Left(), i_context.aContentArea.Top() ) );
+ Size imageSize = i_image.GetSizePixel();
+ if ( i_context.aContentArea.GetWidth() > imageSize.Width() )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(_rStyle.GetHighlightColor());
- else
- _rDevice.SetLineColor(line);
+ const HorizontalAlignment eHorzAlign = m_pImpl->rModel.getColumnModel( i_context.nColumn )->getHorizontalAlign();
+ switch ( eHorzAlign )
+ {
+ case HorizontalAlignment_CENTER:
+ imagePos.X() += ( i_context.aContentArea.GetWidth() - imageSize.Width() ) / 2;
+ break;
+ case HorizontalAlignment_RIGHT:
+ imagePos.X() = i_context.aContentArea.Right() - imageSize.Width();
+ break;
+ default:
+ break;
+ }
+
}
- //else set line color to the color of row background
else
+ imageSize.Width() = i_context.aContentArea.GetWidth();
+
+ if ( i_context.aContentArea.GetHeight() > imageSize.Height() )
{
- if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2)
+ const VerticalAlignment eVertAlign = m_pImpl->rModel.getVerticalAlign();
+ switch ( eVertAlign )
{
- if(line == 0xFFFFFF)
- _rDevice.SetLineColor(background2);
- else
- _rDevice.SetLineColor(line);
- }
- else if(background1 != 0xFFFFFF && line == 0xFFFFFF)
- _rDevice.SetLineColor(background1);
- else
- {
- //if Line color is set, then it was user defined and should be visible
- //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible
- _rDevice.SetLineColor(line);
+ case VerticalAlignment_MIDDLE:
+ imagePos.Y() += ( i_context.aContentArea.GetHeight() - imageSize.Height() ) / 2;
+ break;
+ case VerticalAlignment_BOTTOM:
+ imagePos.Y() = i_context.aContentArea.Bottom() - imageSize.Height();
+ break;
+ default:
+ break;
}
}
- _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() );
+ else
+ imageSize.Height() = i_context.aContentArea.GetHeight() - 1;
+
+ i_context.rDevice.DrawImage( imagePos, imageSize, i_image, 0 );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellContent( CellRenderContext const & i_context )
+ {
+ Any aCellContent;
+ m_pImpl->rModel.getCellContent( i_context.nColumn, m_pImpl->nCurrentRow, aCellContent );
+
+ if ( aCellContent.getValueTypeClass() == TypeClass_INTERFACE )
+ {
+ Reference< XInterface > const xContentInterface( aCellContent, UNO_QUERY );
+ if ( !xContentInterface.is() )
+ // allowed. kind of.
+ return;
- Rectangle aRect( _rArea );
- ++aRect.Left(); --aRect.Right();
- aRect.Top(); aRect.Bottom();
- if(_bSelected)
- _rDevice.SetTextColor(_rStyle.GetHighlightTextColor());
- else if(m_pImpl->rModel.getTextColor() != 0x000000)
- _rDevice.SetTextColor(m_pImpl->rModel.getTextColor());
+ Reference< XGraphic > const xGraphic( aCellContent, UNO_QUERY );
+ ENSURE_OR_RETURN_VOID( xGraphic.is(), "GridTableRenderer::impl_paintCellContent: only XGraphic interfaces (or NULL) are supported for painting." );
+
+ const Image aImage( xGraphic );
+ impl_paintCellImage( i_context, aImage );
+ return;
+ }
+
+ const ::rtl::OUString sText( CellValueConversion::convertToString( aCellContent ) );
+ impl_paintCellText( i_context, sText );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void GridTableRenderer::impl_paintCellText( CellRenderContext const & i_context, ::rtl::OUString const & i_text )
+ {
+ if ( i_context.bSelected )
+ i_context.rDevice.SetTextColor( i_context.rStyle.GetHighlightTextColor() );
else
- _rDevice.SetTextColor(_rStyle.GetFieldTextColor());
- sal_uLong nHorFlag = TEXT_DRAW_LEFT;
- sal_uLong nVerFlag = TEXT_DRAW_TOP;
- if(m_pImpl->rModel.getVerticalAlign() == 1)
- nVerFlag = TEXT_DRAW_VCENTER;
- else if(m_pImpl->rModel.getVerticalAlign() == 2)
- nVerFlag = TEXT_DRAW_BOTTOM;
- if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 1)
- nHorFlag = TEXT_DRAW_CENTER;
- else if(m_pImpl->rModel.getColumnModel(_nColumn)->getHorizontalAlign() == 2)
- nHorFlag = TEXT_DRAW_RIGHT;
- Rectangle textRect(_rArea);
- textRect.Left()+=4; textRect.Right()-=4;
- textRect.Bottom()-=2;
- _rDevice.DrawText( textRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP);
+ {
+ ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getTextColor(), i_context.rStyle, &StyleSettings::GetFieldTextColor );
+ i_context.rDevice.SetTextColor( textColor );
+ }
- _rDevice.Pop();
- (void)_bActive;
- // no special painting for the active cell at the moment
+ Rectangle const textRect( lcl_getTextRenderingArea( i_context.aContentArea ) );
+ sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, i_context.nColumn ) | TEXT_DRAW_CLIP;
+ i_context.rDevice.DrawText( textRect, i_text, nDrawTextFlags );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect)
{
_rView.ShowFocus( _rCursorRect );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void GridTableRenderer::HideCellCursor( Window& _rView, const Rectangle& _rCursorRect)
{
- (void)_rCursorRect;
+ (void)_rCursorRect;
_rView.HideFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool GridTableRenderer::FitsIntoCell( Any const & i_cellContent, ColPos const i_colPos, RowPos const i_rowPos,
+ bool const i_active, bool const i_selected, OutputDevice& i_targetDevice, Rectangle const & i_targetArea )
+ {
+ if ( !i_cellContent.hasValue() )
+ return true;
+
+ if ( i_cellContent.getValueTypeClass() == TypeClass_INTERFACE )
+ {
+ Reference< XInterface > const xContentInterface( i_cellContent, UNO_QUERY );
+ if ( !xContentInterface.is() )
+ return true;
+
+ Reference< XGraphic > const xGraphic( i_cellContent, UNO_QUERY );
+ if ( xGraphic.is() )
+ // for the moment, assume it fits. We can always scale it down during painting ...
+ return true;
+
+ OSL_ENSURE( false, "GridTableRenderer::FitsIntoCell: only XGraphic interfaces (or NULL) are supported for painting." );
+ return true;
+ }
+
+ ::rtl::OUString const sText( CellValueConversion::convertToString( i_cellContent ) );
+ if ( sText.getLength() == 0 )
+ return true;
+
+ Rectangle const aTargetArea( lcl_getTextRenderingArea( lcl_getContentArea( *m_pImpl, i_targetArea ) ) );
+
+ long const nTextHeight = i_targetDevice.GetTextHeight();
+ if ( nTextHeight > aTargetArea.GetHeight() )
+ return false;
+
+ long const nTextWidth = i_targetDevice.GetTextWidth( sText );
+ if ( nTextWidth > aTargetArea.GetWidth() )
+ return false;
+ OSL_UNUSED( i_active );
+ OSL_UNUSED( i_selected );
+ OSL_UNUSED( i_rowPos );
+ OSL_UNUSED( i_colPos );
+ return true;
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx
new file mode 100755
index 000000000000..20d505e911e9
--- /dev/null
+++ b/svtools/source/table/mousefunction.cxx
@@ -0,0 +1,320 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_svtools.hxx"
+
+#include "mousefunction.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
+
+#include <tools/diagnose_ex.h>
+#include <vcl/window.hxx>
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= MouseFunction
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount MouseFunction::acquire()
+ {
+ return osl_incrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ oslInterlockedCount MouseFunction::release()
+ {
+ oslInterlockedCount newCount = osl_decrementInterlockedCount( &m_refCount );
+ if ( newCount == 0 )
+ {
+ delete this;
+ return 0;
+ }
+ return newCount;
+ }
+
+ //==================================================================================================================
+ //= ColumnResize
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ Point const aPoint = i_event.GetPosPixel();
+
+ if ( m_nResizingColumn == COL_INVALID )
+ {
+ // if we hit a column divider, change the mosue pointer accordingly
+ Pointer aNewPointer( POINTER_ARROW );
+ TableCell const tableCell = i_tableControl.hitTest( aPoint );
+ if ( ( tableCell.nRow == ROW_COL_HEADERS ) && ( tableCell.eArea == ColumnDivider ) )
+ {
+ aNewPointer = Pointer( POINTER_HSPLIT );
+ }
+ i_tableControl.setPointer( aNewPointer );
+
+ return SkipFunction; // TODO: is this correct?
+ }
+
+ ::Size const tableSize = i_tableControl.getTableSizePixel();
+
+ // set proper pointer
+ Pointer aNewPointer( POINTER_ARROW );
+ ColumnMetrics const & columnMetrics( i_tableControl.getColumnMetrics( m_nResizingColumn ) );
+ if ( ( aPoint.X() > tableSize.Width() )
+ || ( aPoint.X() < columnMetrics.nStartPixel )
+ )
+ {
+ aNewPointer = Pointer( POINTER_NOTALLOWED );
+ }
+ else
+ {
+ aNewPointer = Pointer( POINTER_HSPLIT );
+ }
+ i_tableControl.setPointer( aNewPointer );
+
+ // show tracking line
+ i_tableControl.hideTracking();
+ i_tableControl.showTracking(
+ Rectangle(
+ Point( aPoint.X(), 0 ),
+ Size( 1, tableSize.Height() )
+ ),
+ SHOWTRACK_SPLIT | SHOWTRACK_WINDOW
+ );
+
+ (void)i_event;
+ return ContinueFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nResizingColumn != COL_INVALID )
+ {
+ OSL_ENSURE( false, "ColumnResize::handleMouseDown: suspicious: MouseButtonDown while still tracking?" );
+ return ContinueFunction;
+ }
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( tableCell.nRow == ROW_COL_HEADERS )
+ {
+ if ( ( tableCell.nColumn != COL_INVALID )
+ && ( tableCell.eArea == ColumnDivider )
+ )
+ {
+ m_nResizingColumn = tableCell.nColumn;
+ i_tableControl.captureMouse();
+ return ActivateFunction;
+ }
+ }
+
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnResize::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nResizingColumn == COL_INVALID )
+ return SkipFunction;
+
+ Point const aPoint = i_event.GetPosPixel();
+
+ i_tableControl.hideTracking();
+ PColumnModel const pColumn = i_tableControl.getModel()->getColumnModel( m_nResizingColumn );
+ long const maxWidthLogical = pColumn->getMaxWidth();
+ long const minWidthLogical = pColumn->getMinWidth();
+
+ // new position of mouse
+ long const requestedEnd = aPoint.X();
+
+ // old position of right border
+ long const oldEnd = i_tableControl.getColumnMetrics( m_nResizingColumn ).nEndPixel;
+
+ // position of left border if cursor in the to-be-resized column
+ long const columnStart = i_tableControl.getColumnMetrics( m_nResizingColumn ).nStartPixel;
+ long const requestedWidth = requestedEnd - columnStart;
+ // TODO: this is not correct, strictly: It assumes that the mouse was pressed exactly on the "end" pos,
+ // but for a while now, we have relaxed this, and allow clicking a few pixels aside, too
+
+ if ( requestedEnd >= columnStart )
+ {
+ long requestedWidthLogical = i_tableControl.pixelWidthToAppFont( requestedWidth );
+ // respect column width limits
+ if ( oldEnd > requestedEnd )
+ {
+ // column has become smaller, check against minimum width
+ if ( ( minWidthLogical != 0 ) && ( requestedWidthLogical < minWidthLogical ) )
+ requestedWidthLogical = minWidthLogical;
+ }
+ else if ( oldEnd < requestedEnd )
+ {
+ // column has become larger, check against max width
+ if ( ( maxWidthLogical != 0 ) && ( requestedWidthLogical >= maxWidthLogical ) )
+ requestedWidthLogical = maxWidthLogical;
+ }
+ pColumn->setWidth( requestedWidthLogical );
+ i_tableControl.invalidate( TableAreaAll );
+ }
+
+ i_tableControl.setPointer( Pointer() );
+ i_tableControl.releaseMouse();
+
+ m_nResizingColumn = COL_INVALID;
+ return DeactivateFunction;
+ }
+
+ //==================================================================================================================
+ //= RowSelection
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ OSL_UNUSED( i_tableControl );
+ OSL_UNUSED( i_event );
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ bool handled = false;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( tableCell.nRow >= 0 )
+ {
+ bool bSetCursor = false;
+ if ( i_tableControl.getSelEngine()->GetSelectionMode() == NO_SELECTION )
+ {
+ bSetCursor = true;
+ }
+ else
+ {
+ if ( !i_tableControl.isRowSelected( tableCell.nRow ) )
+ {
+ handled = i_tableControl.getSelEngine()->SelMouseButtonDown( i_event );
+ }
+ else
+ {
+ bSetCursor = true;
+ }
+ }
+
+ if ( bSetCursor )
+ {
+ i_tableControl.activateCell( tableCell.nColumn, tableCell.nRow );
+ handled = true;
+ }
+ }
+
+ if ( handled )
+ m_bActive = true;
+ return handled ? ActivateFunction : SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult RowSelection::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ TableCell const tableCell = i_tableControl.hitTest( i_event.GetPosPixel() );
+ if ( tableCell.nRow >= 0 )
+ {
+ if ( i_tableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION )
+ {
+ i_tableControl.getSelEngine()->SelMouseButtonUp( i_event );
+ }
+ }
+ if ( m_bActive )
+ {
+ m_bActive = false;
+ return DeactivateFunction;
+ }
+ return SkipFunction;
+ }
+
+ //==================================================================================================================
+ //= ColumnSortHandler
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ OSL_UNUSED( i_tableControl );
+ OSL_UNUSED( i_event );
+ return SkipFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nActiveColumn != COL_INVALID )
+ {
+ OSL_ENSURE( false, "ColumnSortHandler::handleMouseDown: called while already active - suspicious!" );
+ return ContinueFunction;
+ }
+
+ if ( i_tableControl.getModel()->getSortAdapter() == NULL )
+ // no sorting support at the model
+ return SkipFunction;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( ( tableCell.nRow != ROW_COL_HEADERS ) || ( tableCell.nColumn < 0 ) )
+ return SkipFunction;
+
+ // TODO: ensure the column header is rendered in some special way, indicating its current state
+
+ m_nActiveColumn = tableCell.nColumn;
+ return ActivateFunction;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FunctionResult ColumnSortHandler::handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event )
+ {
+ if ( m_nActiveColumn == COL_INVALID )
+ return SkipFunction;
+
+ TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) );
+ if ( ( tableCell.nRow == ROW_COL_HEADERS ) && ( tableCell.nColumn == m_nActiveColumn ) )
+ {
+ ITableDataSort* pSort = i_tableControl.getModel()->getSortAdapter();
+ ENSURE_OR_RETURN( pSort != NULL, "ColumnSortHandler::handleMouseUp: somebody is mocking with us!", DeactivateFunction );
+ // in handleMousButtonDown, the model claimed to have sort support ...
+
+ ColumnSortDirection eSortDirection = ColumnSortAscending;
+ ColumnSort const aCurrentSort = pSort->getCurrentSortOrder();
+ if ( aCurrentSort.nColumnPos == m_nActiveColumn )
+ // invert existing sort order
+ eSortDirection = ( aCurrentSort.eSortDirection == ColumnSortAscending ) ? ColumnSortDescending : ColumnSortAscending;
+
+ pSort->sortByColumn( m_nActiveColumn, eSortDirection );
+ }
+
+ m_nActiveColumn = COL_INVALID;
+ return DeactivateFunction;
+ }
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
diff --git a/svtools/source/table/mousefunction.hxx b/svtools/source/table/mousefunction.hxx
new file mode 100755
index 000000000000..2149026a0923
--- /dev/null
+++ b/svtools/source/table/mousefunction.hxx
@@ -0,0 +1,161 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_MOUSEFUNCTION_HXX
+#define SVTOOLS_MOUSEFUNCTION_HXX
+
+#include "svtools/table/tabletypes.hxx"
+
+#include <rtl/ref.hxx>
+
+#include <boost/noncopyable.hpp>
+
+class MouseEvent;
+
+//......................................................................................................................
+namespace svt { namespace table
+{
+//......................................................................................................................
+
+ class ITableControl;
+
+ //==================================================================================================================
+ //= FunctionResult
+ //==================================================================================================================
+ enum FunctionResult
+ {
+ ActivateFunction,
+ ContinueFunction,
+ DeactivateFunction,
+
+ SkipFunction
+ };
+
+ //==================================================================================================================
+ //= IMouseFunction
+ //==================================================================================================================
+ class IMouseFunction : public ::rtl::IReference, public ::boost::noncopyable
+ {
+ public:
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
+
+ protected:
+ virtual ~IMouseFunction() { }
+ };
+
+ //==================================================================================================================
+ //= MouseFunction
+ //==================================================================================================================
+ class MouseFunction : public IMouseFunction
+ {
+ public:
+ MouseFunction()
+ :m_refCount( 0 )
+ {
+ }
+ protected:
+ ~MouseFunction()
+ {
+ }
+
+ public:
+ virtual oslInterlockedCount SAL_CALL acquire();
+ virtual oslInterlockedCount SAL_CALL release();
+
+ private:
+ oslInterlockedCount m_refCount;
+ };
+
+ //==================================================================================================================
+ //= ColumnResize
+ //==================================================================================================================
+ class ColumnResize : public MouseFunction
+ {
+ public:
+ ColumnResize()
+ :m_nResizingColumn( COL_INVALID )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ ColPos m_nResizingColumn;
+ };
+
+ //==================================================================================================================
+ //= RowSelection
+ //==================================================================================================================
+ class RowSelection : public MouseFunction
+ {
+ public:
+ RowSelection()
+ :m_bActive( false )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ bool m_bActive;
+ };
+
+ //==================================================================================================================
+ //= ColumnSortHandler
+ //==================================================================================================================
+ class ColumnSortHandler : public MouseFunction
+ {
+ public:
+ ColumnSortHandler()
+ :m_nActiveColumn( COL_INVALID )
+ {
+ }
+
+ public:
+ // IMouseFunction
+ virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event );
+ virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event );
+
+ private:
+ ColPos m_nActiveColumn;
+ };
+
+//......................................................................................................................
+} } // namespace svt::table
+//......................................................................................................................
+
+#endif // SVTOOLS_MOUSEFUNCTION_HXX
diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx
index d6122e7917a0..01a9b667a8f7 100644
--- a/svtools/source/table/tablecontrol.cxx
+++ b/svtools/source/table/tablecontrol.cxx
@@ -28,55 +28,39 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/tablecontrol.hxx"
+
#include "tablegeometry.hxx"
#include "tablecontrol_impl.hxx"
-#include "accessibletableimp.hxx"
-#include "svtools/table/tabledatawindow.hxx"
+#include "tabledatawindow.hxx"
+
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <tools/diagnose_ex.h>
+
using namespace ::com::sun::star::uno;
using ::com::sun::star::accessibility::XAccessible;
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::lang;
using namespace utl;
-//using namespace rtl;
-//........................................................................
+
+//......................................................................................................................
namespace svt { namespace table
{
- //====================================================================
- //= AccessibleTableControl_Impl
- //====================================================================
- // ----------------------------------------------------------------------------
- Reference< XAccessible > AccessibleTableControl_Impl::getAccessibleTableHeader( AccessibleTableControlObjType _eObjType )
- {
- if ( m_pAccessible && m_pAccessible->isAlive() )
- return m_pAccessible->getTableHeader( _eObjType );
- return NULL;
- }
- // ----------------------------------------------------------------------------
- Reference< XAccessible > AccessibleTableControl_Impl::getAccessibleTable( )
- {
- if ( m_pAccessible && m_pAccessible->isAlive() )
- return m_pAccessible->getTable( );
- return NULL;
- }
+//......................................................................................................................
- //====================================================================
+ //==================================================================================================================
//= TableControl
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ // -----------------------------------------------------------------------------------------------------------------
TableControl::TableControl( Window* _pParent, WinBits _nStyle )
:Control( _pParent, _nStyle )
,m_pImpl( new TableControl_Impl( *this ) )
- ,m_bSelectionChanged(false)
- ,m_bTooltip(false)
{
- TableDataWindow* aTableData = m_pImpl->getDataWindow();
- aTableData->SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) );
- aTableData->SetMouseButtonUpHdl( LINK( this, TableControl, ImplMouseButtonUpHdl ) );
- aTableData->SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) );
- m_pAccessTable.reset(new ::svt::table::AccessibleTableControl_Impl());
+ TableDataWindow& rDataWindow = m_pImpl->getDataWindow();
+ rDataWindow.SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) );
+ rDataWindow.SetMouseButtonUpHdl( LINK( this, TableControl, ImplMouseButtonUpHdl ) );
+ rDataWindow.SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) );
// by default, use the background as determined by the style settings
const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() );
@@ -84,51 +68,39 @@ namespace svt { namespace table
SetFillColor( aWindowColor );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
TableControl::~TableControl()
{
ImplCallEventListeners( VCLEVENT_OBJECT_DYING );
- DELETEZ( m_pImpl );
- if ( m_pAccessTable->m_pAccessible )
- {
- m_pAccessTable->m_pAccessible->dispose();
- }
+
+ m_pImpl->setModel( PTableModel() );
+ m_pImpl->disposeAccessible();
+ m_pImpl.reset();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::GetFocus()
{
if ( !m_pImpl->getInputHandler()->GetFocus( *m_pImpl ) )
- {
Control::GetFocus();
- Control::GrabFocus();
- }
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::LoseFocus()
{
if ( !m_pImpl->getInputHandler()->LoseFocus( *m_pImpl ) )
Control::LoseFocus();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::KeyInput( const KeyEvent& rKEvt )
{
if ( !m_pImpl->getInputHandler()->KeyInput( *m_pImpl, rKEvt ) )
Control::KeyInput( rKEvt );
- else
- {
- if(m_bSelectionChanged)
- {
- Select();
- m_bSelectionChanged = false;
- }
- }
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::StateChanged( StateChangedType i_nStateChange )
{
Control::StateChanged( i_nStateChange );
@@ -138,156 +110,180 @@ namespace svt { namespace table
{
case STATE_CHANGE_CONTROLBACKGROUND:
if ( IsControlBackground() )
- getDataWindow()->SetControlBackground( GetControlBackground() );
+ getDataWindow().SetControlBackground( GetControlBackground() );
else
- getDataWindow()->SetControlBackground();
+ getDataWindow().SetControlBackground();
break;
case STATE_CHANGE_CONTROLFOREGROUND:
if ( IsControlForeground() )
- getDataWindow()->SetControlForeground( GetControlForeground() );
+ getDataWindow().SetControlForeground( GetControlForeground() );
else
- getDataWindow()->SetControlForeground();
+ getDataWindow().SetControlForeground();
break;
case STATE_CHANGE_CONTROLFONT:
if ( IsControlFont() )
- getDataWindow()->SetControlFont( GetControlFont() );
+ getDataWindow().SetControlFont( GetControlFont() );
else
- getDataWindow()->SetControlFont();
+ getDataWindow().SetControlFont();
break;
}
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::Resize()
{
Control::Resize();
m_pImpl->onResize();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::SetModel( PTableModel _pModel )
{
m_pImpl->setModel( _pModel );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
PTableModel TableControl::GetModel() const
{
return m_pImpl->getModel();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
RowPos TableControl::GetTopRow() const
{
return m_pImpl->getTopRow();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
void TableControl::SetTopRow( RowPos _nRow )
{
- // TODO
- (void)_nRow;
+ OSL_ENSURE( false, "TableControl::SetTopRow: not implemented!" );
+ OSL_UNUSED( _nRow );
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
sal_Int32 TableControl::GetCurrentRow() const
{
- return m_pImpl->getCurRow();
+ return m_pImpl->getCurrentRow();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
sal_Int32 TableControl::GetCurrentColumn() const
{
- return m_pImpl->getCurColumn();
+ return m_pImpl->getCurrentColumn();
}
- //--------------------------------------------------------------------
+ // -----------------------------------------------------------------------------------------------------------------
bool TableControl::GoTo( ColPos _nColumn, RowPos _nRow )
{
return m_pImpl->goTo( _nColumn, _nRow );
}
- //--------------------------------------------------------------------
+
+ // -----------------------------------------------------------------------------------------------------------------
sal_Bool TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos)
{
return m_pImpl->goTo( _nColPos, _nRowPos );
}
- //--------------------------------------------------------------------
- void TableControl::clearSelection()
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetSelectedRowCount() const
+ {
+ return sal_Int32( m_pImpl->getSelectedRowCount() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const
{
- m_pImpl->clearSelection();
+ return sal_Int32( m_pImpl->getSelectedRowIndex( i_selectionIndex ) );
}
- //--------------------------------------------------------------------
- void TableControl::InvalidateDataWindow(RowPos _nRowStart, RowPos _nRowEnd, bool _bRemoved)
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl::IsRowSelected( sal_Int32 const i_rowIndex ) const
{
- Rectangle _rRect;
- if(_bRemoved)
- m_pImpl->invalidateRows();
+ return m_pImpl->isRowSelected( i_rowIndex );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void TableControl::SelectRow( RowPos const i_rowIndex, bool const i_select )
+ {
+ ENSURE_OR_RETURN_VOID( ( i_rowIndex >= 0 ) && ( i_rowIndex < m_pImpl->getModel()->getRowCount() ),
+ "TableControl::SelectRow: no control (anymore)!" );
+
+ if ( i_select )
+ {
+ if ( !m_pImpl->markRowAsSelected( i_rowIndex ) )
+ // nothing to do
+ return;
+ }
else
{
- if(m_bSelectionChanged)
- {
- m_pImpl->invalidateSelectedRegion(_nRowStart, _nRowEnd, _rRect);
- m_bSelectionChanged = false;
- }
- else
- m_pImpl->invalidateRow(_nRowStart, _rRect);
+ m_pImpl->markRowAsDeselected( i_rowIndex );
}
+
+ m_pImpl->invalidateRowRange( i_rowIndex, i_rowIndex );
+ Select();
}
- //--------------------------------------------------------------------
- std::vector<sal_Int32>& TableControl::GetSelectedRows()
- {
- return m_pImpl->getSelectedRows();
- }
- //--------------------------------------------------------------------
- void TableControl::RemoveSelectedRow(RowPos _nRowPos)
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void TableControl::SelectAllRows( bool const i_select )
{
- m_pImpl->removeSelectedRow(_nRowPos);
+ if ( i_select )
+ {
+ if ( !m_pImpl->markAllRowsAsSelected() )
+ // nothing to do
+ return;
+ }
+ else
+ {
+ if ( !m_pImpl->markAllRowsAsDeselected() )
+ // nothing to do
+ return;
+ }
+
+
+ Invalidate();
+ // TODO: can't we do better than this, and invalidate only the rows which changed?
+ Select();
}
- //--------------------------------------------------------------------
- RowPos TableControl::GetCurrentRow(const Point& rPoint)
+ // -----------------------------------------------------------------------------------------------------------------
+ ITableControl& TableControl::getTableControlInterface()
{
- return m_pImpl->getCurrentRow( rPoint );
+ return *m_pImpl;
}
+ // -----------------------------------------------------------------------------------------------------------------
SelectionEngine* TableControl::getSelEngine()
{
return m_pImpl->getSelEngine();
}
- TableDataWindow* TableControl::getDataWindow()
+ // -----------------------------------------------------------------------------------------------------------------
+ Window& TableControl::getDataWindow()
{
return m_pImpl->getDataWindow();
}
+ // -----------------------------------------------------------------------------------------------------------------
Reference< XAccessible > TableControl::CreateAccessible()
{
Window* pParent = GetAccessibleParentWindow();
- DBG_ASSERT( pParent, "TableControl::CreateAccessible - parent not found" );
+ ENSURE_OR_RETURN( pParent, "TableControl::CreateAccessible - parent not found", NULL );
- if( pParent && !m_pAccessTable->m_pAccessible)
- {
- Reference< XAccessible > xAccParent = pParent->GetAccessible();
- if( xAccParent.is() )
- {
- m_pAccessTable->m_pAccessible = getAccessibleFactory().createAccessibleTableControl(
- xAccParent, *this
- );
- }
- }
- Reference< XAccessible > xAccessible;
- if ( m_pAccessTable->m_pAccessible )
- xAccessible = m_pAccessTable->m_pAccessible->getMyself();
- return xAccessible;
+ return m_pImpl->getAccessible( *pParent );
}
+
+ // -----------------------------------------------------------------------------------------------------------------
Reference<XAccessible> TableControl::CreateAccessibleControl( sal_Int32 _nIndex )
{
(void)_nIndex;
DBG_ASSERT( sal_False, "TableControl::CreateAccessibleControl: to be overwritten!" );
return NULL;
}
+
+ // -----------------------------------------------------------------------------------------------------------------
::rtl::OUString TableControl::GetAccessibleObjectName( AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const
{
::rtl::OUString aRetText;
@@ -320,309 +316,297 @@ namespace svt { namespace table
}
return aRetText;
}
-// -----------------------------------------------------------------------------
-::rtl::OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType, sal_Int32 ) const
-{
- ::rtl::OUString aRetText;
- switch( eObjType )
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetAccessibleObjectDescription( AccessibleTableControlObjType eObjType, sal_Int32 ) const
{
- case TCTYPE_GRIDCONTROL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl description" ) );
- break;
- case TCTYPE_TABLE:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
- break;
- case TCTYPE_ROWHEADERBAR:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
- break;
- case TCTYPE_COLUMNHEADERBAR:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
- break;
- case TCTYPE_TABLECELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
- break;
- case TCTYPE_ROWHEADERCELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
- break;
- case TCTYPE_COLUMNHEADERCELL:
- aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
- break;
+ ::rtl::OUString aRetText;
+ switch( eObjType )
+ {
+ case TCTYPE_GRIDCONTROL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl description" ) );
+ break;
+ case TCTYPE_TABLE:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
+ break;
+ case TCTYPE_ROWHEADERBAR:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
+ break;
+ case TCTYPE_COLUMNHEADERBAR:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
+ break;
+ case TCTYPE_TABLECELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
+ break;
+ case TCTYPE_ROWHEADERCELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
+ break;
+ case TCTYPE_COLUMNHEADERCELL:
+ aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
+ break;
+ }
+ return aRetText;
}
- return aRetText;
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString TableControl::GetRowDescription( sal_Int32 _nRow) const
-{
- (void)_nRow;
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "row description" ) );
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetRowDescription( sal_Int32 _nRow) const
+ {
+ (void)_nRow;
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "row description" ) );
+ }
-::rtl::OUString TableControl::GetRowName( sal_Int32 _nIndex) const
-{
- return GetModel()->getRowHeaderName()[_nIndex];
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetRowName( sal_Int32 _nIndex) const
+ {
+ ::rtl::OUString sRowName;
+ GetModel()->getRowHeading( _nIndex ) >>= sRowName;
+ return sRowName;
+ }
-::rtl::OUString TableControl::GetColumnDescription( sal_uInt16 _nColumn) const
-{
- (void)_nColumn;
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "col description" ) );
-}
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetColumnDescription( sal_uInt16 _nColumn) const
+ {
+ (void)_nColumn;
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "col description" ) );
+ }
-::rtl::OUString TableControl::GetColumnName( sal_Int32 _nIndex) const
-{
- return GetModel()->getColumnModel(_nIndex)->getName();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetColumnName( sal_Int32 _nIndex) const
+ {
+ return GetModel()->getColumnModel(_nIndex)->getName();
+ }
-// -----------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Any TableControl::GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos ) const
+ {
+ Any aCellContent;
+ GetModel()->getCellContent( _nColPos, _nRowPos, aCellContent );
+ return aCellContent;
+ }
-::com::sun::star::uno::Any TableControl::GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
-{
- ::com::sun::star::uno::Any cellContent(::com::sun::star::uno::Any(::rtl::OUString::createFromAscii("")));
- std::vector<std::vector< ::com::sun::star::uno::Any > >& aTableContent = GetModel()->getCellContent();
- if(&aTableContent)
- cellContent = aTableContent[_nRowPos][_nColPos];
- return cellContent;
-}
-// -----------------------------------------------------------------------------
-
-::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
-{
- const ::com::sun::star::uno::Any cellContent = GetCellContent(_nRowPos, _nColPos);
- return m_pImpl->convertToString(cellContent);
-}
-// -----------------------------------------------------------------------------
-
-void TableControl::FillAccessibleStateSet(
- ::utl::AccessibleStateSetHelper& rStateSet,
- AccessibleTableControlObjType eObjType ) const
-{
- switch( eObjType )
- {
- case TCTYPE_GRIDCONTROL:
- case TCTYPE_TABLE:
-
- rStateSet.AddState( AccessibleStateType::FOCUSABLE );
- rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE);
- if ( HasFocus() )
- rStateSet.AddState( AccessibleStateType::FOCUSED );
- if ( IsActive() )
- rStateSet.AddState( AccessibleStateType::ACTIVE );
- if ( IsEnabled() )
- rStateSet.AddState( AccessibleStateType::ENABLED );
- if ( IsReallyVisible() )
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const
+ {
+ return m_pImpl->getCellContentAsString( _nRowPos, _nColPos );
+ }
- break;
- case TCTYPE_ROWHEADERBAR:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
- break;
- case TCTYPE_COLUMNHEADERBAR:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
- break;
- case TCTYPE_TABLECELL:
- {
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::FillAccessibleStateSet(
+ ::utl::AccessibleStateSetHelper& rStateSet,
+ AccessibleTableControlObjType eObjType ) const
+ {
+ switch( eObjType )
+ {
+ case TCTYPE_GRIDCONTROL:
+ case TCTYPE_TABLE:
+
+ rStateSet.AddState( AccessibleStateType::FOCUSABLE );
+ rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE);
+ if ( HasFocus() )
+ rStateSet.AddState( AccessibleStateType::FOCUSED );
+ if ( IsActive() )
+ rStateSet.AddState( AccessibleStateType::ACTIVE );
+ if ( IsEnabled() )
+ rStateSet.AddState( AccessibleStateType::ENABLED );
+ if ( IsReallyVisible() )
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+
+ break;
+ case TCTYPE_ROWHEADERBAR:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ break;
+ case TCTYPE_COLUMNHEADERBAR:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS );
+ break;
+ case TCTYPE_TABLECELL:
+ {
+ rStateSet.AddState( AccessibleStateType::TRANSIENT );
+ rStateSet.AddState( AccessibleStateType::SELECTABLE);
+ if( GetSelectedRowCount()>0)
+ rStateSet.AddState( AccessibleStateType::SELECTED);
+ }
+ break;
+ case TCTYPE_ROWHEADERCELL:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
rStateSet.AddState( AccessibleStateType::TRANSIENT );
- rStateSet.AddState( AccessibleStateType::SELECTABLE);
- if( GetSelectedRowCount()>0)
- rStateSet.AddState( AccessibleStateType::SELECTED);
- }
- break;
- case TCTYPE_ROWHEADERCELL:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::TRANSIENT );
- break;
- case TCTYPE_COLUMNHEADERCELL:
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- break;
+ break;
+ case TCTYPE_COLUMNHEADERCELL:
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ break;
+ }
}
-}
-Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const
-{
- return Control::GetWindowExtentsRelative( pRelativeWindow );
-}
-//-----------------------------------------------------------------------------
-void TableControl::GrabFocus()
-{
- Control::GrabFocus();
-}
-// -----------------------------------------------------------------------------
-Reference< XAccessible > TableControl::GetAccessible( sal_Bool bCreate )
-{
- return Control::GetAccessible( bCreate );
-}
-// -----------------------------------------------------------------------------
-Window* TableControl::GetAccessibleParentWindow() const
-{
- return Control::GetAccessibleParentWindow();
-}
-// -----------------------------------------------------------------------------
-Window* TableControl::GetWindowInstance()
-{
- return this;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const
+ {
+ return Control::GetWindowExtentsRelative( pRelativeWindow );
+ }
-sal_Bool TableControl::HasRowHeader()
-{
- return GetModel()->hasRowHeaders();
-}
-//--------------------------------------------------------------------------------
-sal_Bool TableControl::HasColHeader()
-{
- return GetModel()->hasColumnHeaders();
-}
-//--------------------------------------------------------------------------------
-sal_Int32 TableControl::GetAccessibleControlCount() const
-{
- sal_Int32 count = 0;
- if(GetRowCount()>0)
- count+=1;
- if(GetModel()->hasRowHeaders())
- count+=1;
- if(GetModel()->hasColumnHeaders())
- count+=1;
- return count;
-}
-sal_Bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
-{
- sal_Int32 nRow = m_pImpl->getCurrentRow(_rPoint);
- sal_Int32 nCol = GetCurrentColumn();
- _rnIndex = nRow * GetColumnCount() + nCol;
- return nRow>=0 ? sal_True : sal_False;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::GrabFocus()
+ {
+ Control::GrabFocus();
+ }
-long TableControl::GetRowCount() const
-{
- return m_pImpl->getRowCount();
-}
-long TableControl::GetColumnCount() const
-{
- return m_pImpl->getColumnCount();
-}
-sal_Bool TableControl::HasRowHeader() const
-{
- PTableModel pModel = GetModel();
- return pModel->hasRowHeaders();
-}
-sal_Int32 TableControl::GetSelectedRowCount() const
-{
- return m_pImpl->getSelectedRows().size();
-}
-bool TableControl::IsRowSelected( long _nRow ) const
-{
- return m_pImpl->isRowSelected(m_pImpl->getSelectedRows(), _nRow);
-}
-sal_Bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
-{
- _rnRow = m_pImpl->getCurrentRow(_rPoint);
- _rnColPos = GetCurrentColumn();
- return _rnRow>=0 ? sal_True : sal_False;
-}
-void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
-{
- if ( GetCurrentRow() == _nRow && GetCurrentColumn() == _nColumnPos )
- _rStateSet.AddState( AccessibleStateType::FOCUSED );
- else // only transient when column is not focused
- _rStateSet.AddState( AccessibleStateType::TRANSIENT );
-}
-Rectangle TableControl::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)
-{
- (void)_nRow;
- (void)_nColumnPos;
- return GetCharacterBounds(nIndex);
-}
-sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
-{
- (void)_nRow;
- (void)_nColumnPos;
- return GetIndexForPoint(_rPoint);
-;
-}
- // -----------------------------------------------------------------------------
-sal_Bool TableControl::isAccessibleAlive( ) const
-{
- return ( NULL != m_pAccessTable->m_pAccessible ) && m_pAccessTable->m_pAccessible->isAlive();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > TableControl::GetAccessible( sal_Bool bCreate )
+ {
+ return Control::GetAccessible( bCreate );
+ }
-// -----------------------------------------------------------------------------
-::svt::IAccessibleFactory& TableControl::getAccessibleFactory()
-{
- return m_pAccessTable->m_aFactoryAccess.getFactory();
-}
-// -----------------------------------------------------------------------------
-void TableControl::commitGridControlEvent( sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue )
-{
- if ( isAccessibleAlive() )
- m_pAccessTable->m_pAccessible->commitEvent( _nEventId, _rNewValue, _rOldValue);
-}
-// -----------------------------------------------------------------------------
-Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen)
-{
- (void)_bOnScreen;
- return m_pImpl->calcHeaderRect(_bIsColumnBar);
-}
-// -----------------------------------------------------------------------------
-Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen)
-{
- (void)_bOnScreen;
- return m_pImpl->calcTableRect();
-}
-//--------------------------------------------------------------------
-::com::sun::star::uno::Sequence< sal_Int32 >& TableControl::getColumnsForTooltip()
-{
- return m_nCols;
-}
-//--------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::rtl::OUString >& TableControl::getTextForTooltip()
-{
- return m_aText;
-}
-//--------------------------------------------------------------------
-void TableControl::setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols )
-{
- m_aText = aText;
- m_nCols = nCols;
- m_bTooltip = true;
-}
-// -----------------------------------------------------------------------
-void TableControl::selectionChanged(bool _bChanged)
-{
- m_bSelectionChanged = _bChanged;
-}
-// -----------------------------------------------------------------------
-bool TableControl::isTooltip()
-{
- return m_bTooltip;
-}
-// -----------------------------------------------------------------------
-IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG )
-{
- Select();
- return 1;
-}
-IMPL_LINK( TableControl, ImplMouseButtonDownHdl, MouseEvent*, pData )
-{
- CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pData );
- return 1;
-}
-IMPL_LINK( TableControl, ImplMouseButtonUpHdl, MouseEvent*, pData )
-{
- CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, pData );
- return 1;
-}
-// -----------------------------------------------------------------------
-void TableControl::Select()
-{
- ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_aSelectHdl, this );
-}
-//........................................................................
+ //------------------------------------------------------------------------------------------------------------------
+ Window* TableControl::GetAccessibleParentWindow() const
+ {
+ return Control::GetAccessibleParentWindow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Window* TableControl::GetWindowInstance()
+ {
+ return this;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasRowHeader()
+ {
+ return GetModel()->hasRowHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasColHeader()
+ {
+ return GetModel()->hasColumnHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetAccessibleControlCount() const
+ {
+ sal_Int32 count = 0;
+ if(GetRowCount()>0)
+ count+=1;
+ if(GetModel()->hasRowHeaders())
+ count+=1;
+ if(GetModel()->hasColumnHeaders())
+ count+=1;
+ return count;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
+ {
+ sal_Int32 nRow = m_pImpl->getRowAtPoint( _rPoint );
+ sal_Int32 nCol = m_pImpl->getColAtPoint( _rPoint );
+ _rnIndex = nRow * GetColumnCount() + nCol;
+ return nRow >= 0 ? sal_True : sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl::GetRowCount() const
+ {
+ return GetModel()->getRowCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl::GetColumnCount() const
+ {
+ return GetModel()->getColumnCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::HasRowHeader() const
+ {
+ return GetModel()->hasRowHeaders();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool TableControl::ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )
+ {
+ _rnRow = m_pImpl->getRowAtPoint( _rPoint );
+ _rnColPos = m_pImpl->getColAtPoint( _rPoint );
+ return _rnRow >= 0 ? sal_True : sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
+ {
+ if ( GetCurrentRow() == _nRow && GetCurrentColumn() == _nColumnPos )
+ _rStateSet.AddState( AccessibleStateType::FOCUSED );
+ else // only transient when column is not focused
+ _rStateSet.AddState( AccessibleStateType::TRANSIENT );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)
+ {
+ (void)_nRow;
+ (void)_nColumnPos;
+ return GetCharacterBounds(nIndex);
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)
+ {
+ (void)_nRow;
+ (void)_nColumnPos;
+ return GetIndexForPoint(_rPoint);
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::calcHeaderRect(sal_Bool _bIsColumnBar,sal_Bool _bOnScreen)
+ {
+ (void)_bOnScreen;
+ return m_pImpl->calcHeaderRect( _bIsColumnBar ? false : true );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen)
+ {
+ (void)_bOnScreen;
+ return m_pImpl->calcTableRect();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG )
+ {
+ Select();
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplMouseButtonDownHdl, MouseEvent*, pData )
+ {
+ CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pData );
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( TableControl, ImplMouseButtonUpHdl, MouseEvent*, pData )
+ {
+ CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, pData );
+ return 1;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::Select()
+ {
+ ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_pImpl->getSelectHandler(), this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl::SetSelectHdl( const Link& i_selectHandler )
+ {
+ m_pImpl->setSelectHandler( i_selectHandler );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const Link& TableControl::GetSelectHdl() const
+ {
+ return m_pImpl->getSelectHandler();
+ }
+
+//......................................................................................................................
}} // namespace svt::table
-//........................................................................
+//......................................................................................................................
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index 4c109529244d..8e481d27d993 100644..100755
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -30,40 +30,60 @@
#include "svtools/table/tablecontrol.hxx"
#include "svtools/table/defaultinputhandler.hxx"
#include "svtools/table/tablemodel.hxx"
+
+#include "tabledatawindow.hxx"
#include "tablecontrol_impl.hxx"
#include "tablegeometry.hxx"
-#include "svtools/table/tabledatawindow.hxx"
-#include <com/sun/star/awt/XControl.hpp>
+#include "cellvalueconversion.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/flagguard.hxx>
#include <vcl/scrbar.hxx>
#include <vcl/seleng.hxx>
#include <rtl/ref.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
#include <vcl/image.hxx>
-#include <com/sun/star/graphic/XGraphic.hpp>
+#include <tools/diagnose_ex.h>
#include <functional>
-#include <stdlib.h>
-//........................................................................
+#define MIN_COLUMN_WIDTH_PIXEL 4
+
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
-
- //====================================================================
- //= TempHideCursor
- //====================================================================
- class TempHideCursor
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::accessibility::AccessibleTableModelChange;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::accessibility::XAccessible;
+ using ::com::sun::star::uno::Reference;
+ /** === end UNO using === **/
+ namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId;
+ namespace AccessibleTableModelChangeType = ::com::sun::star::accessibility::AccessibleTableModelChangeType;
+
+ //==================================================================================================================
+ //= SuppressCursor
+ //==================================================================================================================
+ class SuppressCursor
{
private:
- IAbstractTableControl& m_rTable;
+ ITableControl& m_rTable;
public:
- TempHideCursor( IAbstractTableControl& _rTable )
+ SuppressCursor( ITableControl& _rTable )
:m_rTable( _rTable )
{
m_rTable.hideCursor();
}
- ~TempHideCursor()
+ ~SuppressCursor()
{
m_rTable.showCursor();
}
@@ -102,50 +122,18 @@ namespace svt { namespace table
{
return false;
}
- virtual void setRowHeaders(bool _bRowHeaders)
- {
- (void)_bRowHeaders;
- }
- virtual void setColumnHeaders(bool _bColumnHeaders)
- {
- (void)_bColumnHeaders;
- }
- void setColumnCount(TableSize _nColCount)
- {
- (void) _nColCount;
- }
- void setRowCount(TableSize _nRowCount)
- {
- (void)_nRowCount;
- }
virtual bool isCellEditable( ColPos col, RowPos row ) const
{
(void)col;
(void)row;
return false;
}
- virtual void addTableModelListener( const PTableModelListener& listener )
- {
- (void)listener;
- // ignore
- }
- virtual void removeTableModelListener( const PTableModelListener& listener )
- {
- (void)listener;
- // ignore
- }
virtual PColumnModel getColumnModel( ColPos column )
{
DBG_ERROR( "EmptyTableModel::getColumnModel: invalid call!" );
(void)column;
return PColumnModel();
}
- virtual PColumnModel getColumnModelByID( ColumnID id )
- {
- DBG_ERROR( "EmptyTableModel::getColumnModel: invalid call!" );
- (void)id;
- return PColumnModel();
- }
virtual PTableRenderer getRenderer() const
{
return PTableRenderer();
@@ -170,83 +158,68 @@ namespace svt { namespace table
{
return 0;
}
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int , int ) const
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const
{
- return ScrollbarShowNever;
+ return ScrollbarShowNever;
}
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int , int ) const
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const
{
- return ScrollbarShowNever;
+ return ScrollbarShowNever;
+ }
+ virtual void addTableModelListener( const PTableModelListener& i_listener )
+ {
+ (void)i_listener;
+ }
+ virtual void removeTableModelListener( const PTableModelListener& i_listener )
+ {
+ (void)i_listener;
+ }
+ virtual ::boost::optional< ::Color > getLineColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getTextColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::Color > getTextLineColor() const
+ {
+ return ::boost::optional< ::Color >();
+ }
+ virtual ::boost::optional< ::std::vector< ::Color > > getRowBackgroundColors() const
+ {
+ return ::boost::optional< ::std::vector< ::Color > >();
+ }
+ virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign() const
+ {
+ return com::sun::star::style::VerticalAlignment(0);
+ }
+ virtual ITableDataSort* getSortAdapter()
+ {
+ return NULL;
+ }
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent )
+ {
+ (void)i_row;
+ (void)i_col;
+ o_cellContent.clear();
+ }
+ virtual void getCellToolTip( ColPos const, RowPos const, ::com::sun::star::uno::Any& )
+ {
+ }
+ virtual Any getRowHeading( RowPos const i_rowPos ) const
+ {
+ (void)i_rowPos;
+ return Any();
}
- virtual bool hasVerticalScrollbar()
- {
- return false;
- }
- virtual bool hasHorizontalScrollbar()
- {
- return false;
- }
- virtual void setCellContent(const std::vector<std::vector< ::com::sun::star::uno::Any > >& )
- {
- }
- virtual ::com::sun::star::util::Color getLineColor()
- {
- return 0;
- }
- virtual void setLineColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getHeaderBackgroundColor()
- {
- return -1;
- }
- virtual void setHeaderBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getTextColor()
- {
- return 0;
- }
- virtual void setTextColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::util::Color getOddRowBackgroundColor()
- {
- return -1;
- }
- virtual void setOddRowBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign()
- {
- return com::sun::star::style::VerticalAlignment(0);
- }
- virtual void setVerticalAlign(com::sun::star::style::VerticalAlignment )
- {
- }
- virtual ::com::sun::star::util::Color getEvenRowBackgroundColor()
- {
- return -1;
- }
- virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color )
- {
- }
- virtual std::vector<std::vector< ::com::sun::star::uno::Any > >& getCellContent()
- {
- return m_aCellContent;
- }
- virtual void setRowHeaderName(const std::vector<rtl::OUString>& )
- {
- }
- virtual std::vector<rtl::OUString>& getRowHeaderName()
- {
- aRowHeaderNames.clear();
- aRowHeaderNames.push_back(rtl::OUString::createFromAscii(""));
- return aRowHeaderNames;
- }
- private:
- std::vector<rtl::OUString> aRowHeaderNames;
- std::vector<std::vector< ::com::sun::star::uno::Any > > m_aCellContent;
};
@@ -312,7 +285,7 @@ namespace svt { namespace table
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
const sal_Char* TableControl_Impl::impl_checkInvariants() const
{
if ( !m_pModel )
@@ -327,12 +300,9 @@ namespace svt { namespace table
if ( m_pModel->getRowCount() != m_nRowCount )
return "row counts are inconsistent!";
- if ( ( m_nCurColumn != COL_INVALID ) && !m_aColumnWidthsPixel.empty() && ( m_nCurColumn < 0 ) || ( m_nCurColumn >= (ColPos)m_aColumnWidthsPixel.size() ) )
+ if ( ( m_nCurColumn != COL_INVALID ) && !m_aColumnWidths.empty() && ( m_nCurColumn < 0 ) || ( m_nCurColumn >= (ColPos)m_aColumnWidths.size() ) )
return "current column is invalid!";
- if ( m_aColumnWidthsPixel.size() != m_aAccColumnWidthsPixel.size() )
- return "columnd width caches are inconsistent!";
-
if ( !lcl_checkLimitsExclusive_OrDefault_OrFallback( m_nTopRow, (RowPos)-1, m_nRowCount, getModel(), (RowPos)0 ) )
return "invalid top row value!";
@@ -348,6 +318,20 @@ namespace svt { namespace table
if ( m_pInputHandler != m_pModel->getInputHandler() )
return "input handler is not the model-provided one!";
+ // m_aSelectedRows should have reasonable content
+ {
+ if ( m_aSelectedRows.size() > size_t( m_pModel->getRowCount() ) )
+ return "there are more rows selected than actually exist";
+ for ( ::std::vector< RowPos >::const_iterator selRow = m_aSelectedRows.begin();
+ selRow != m_aSelectedRows.end();
+ ++selRow
+ )
+ {
+ if ( ( *selRow < 0 ) || ( *selRow >= m_pModel->getRowCount() ) )
+ return "a non-existent row is selected";
+ }
+ }
+
// m_nColHeaderHeightPixel consistent with the model's value?
{
TableMetrics nHeaderHeight = m_pModel->hasColumnHeaders() ? m_pModel->getColumnHeaderHeight() : 0;
@@ -373,7 +357,28 @@ namespace svt { namespace table
return "row header widths are inconsistent!";
}
- // TODO: check m_aColumnWidthsPixel and m_aAccColumnWidthsPixel
+ // m_aColumnWidths consistency
+ if ( size_t( m_nColumnCount ) != m_aColumnWidths.size() )
+ return "wrong number of cached column widths";
+
+ for ( ColumnPositions::const_iterator col = m_aColumnWidths.begin();
+ col != m_aColumnWidths.end();
+ )
+ {
+ if ( col->getEnd() < col->getStart() )
+ return "column widths: 'end' is expected to not be smaller than start";
+
+ ColumnPositions::const_iterator nextCol = col + 1;
+ if ( nextCol != m_aColumnWidths.end() )
+ if ( col->getEnd() != nextCol->getStart() )
+ return "column widths: one column's end should be the next column's start";
+ col = nextCol;
+ }
+
+ if ( m_nLeftColumn < m_nColumnCount )
+ if ( m_aColumnWidths[ m_nLeftColumn ].getStart() != m_nRowHeaderWidthPixel )
+ return "the left-most column should start immediately after the row header";
+
if ( m_nCursorHidden < 0 )
return "invalid hidden count for the cursor!";
@@ -382,6 +387,8 @@ namespace svt { namespace table
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
// prevent infinite recursion
+ if ( m_nLeftColumn < 0 )
+ return "invalid left-most column index";
if ( m_pVScroll->GetThumbPos() != m_nTopRow )
return "vertical scroll bar |position| is incorrect!";
if ( m_pVScroll->GetRange().Max() != m_nRowCount )
@@ -410,44 +417,44 @@ namespace svt { namespace table
#define DBG_CHECK_ME() \
DBG_CHKTHIS( TableControl_Impl, TableControl_Impl_checkInvariants )
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableControl_Impl::TableControl_Impl( TableControl& _rAntiImpl )
:m_rAntiImpl ( _rAntiImpl )
,m_pModel ( new EmptyTableModel )
,m_pInputHandler ( )
,m_nRowHeightPixel ( 15 )
- ,m_nColHeaderHeightPixel( 0 )
+ ,m_nColHeaderHeightPixel( 0 )
,m_nRowHeaderWidthPixel ( 0 )
,m_nColumnCount ( 0 )
,m_nRowCount ( 0 )
+ ,m_bColumnsFit ( true )
,m_nCurColumn ( COL_INVALID )
,m_nCurRow ( ROW_INVALID )
,m_nLeftColumn ( 0 )
- ,m_nTopRow ( 0 )
+ ,m_nTopRow ( 0 )
,m_nCursorHidden ( 1 )
,m_pDataWindow ( new TableDataWindow( *this ) )
- ,m_pVScroll ( NULL )
+ ,m_pVScroll ( NULL )
,m_pHScroll ( NULL )
,m_pScrollCorner ( NULL )
- ,m_pSelEngine ( )
- ,m_nRowSelected ( )
- ,m_pTableFunctionSet ( new TableFunctionSet(this ) )
- ,m_nAnchor (-1 )
- ,m_bResizing ( false )
- ,m_nResizingColumn ( 0 )
- ,m_bResizingGrid ( false )
+ ,m_pSelEngine ( )
+ ,m_aSelectedRows ( )
+ ,m_pTableFunctionSet ( new TableFunctionSet( this ) )
+ ,m_nAnchor ( -1 )
+ ,m_bUpdatingColWidths ( false )
+ ,m_pAccessibleTable ( NULL )
#if DBG_UTIL
,m_nRequiredInvariants ( INV_SCROLL_POSITION )
#endif
{
DBG_CTOR( TableControl_Impl, TableControl_Impl_checkInvariants );
- m_pSelEngine = new SelectionEngine(m_pDataWindow, m_pTableFunctionSet);
- m_pSelEngine->SetSelectionMode(SINGLE_SELECTION);
+ m_pSelEngine = new SelectionEngine( m_pDataWindow.get(), m_pTableFunctionSet );
+ m_pSelEngine->SetSelectionMode(SINGLE_SELECTION);
m_pDataWindow->SetPosPixel( Point( 0, 0 ) );
m_pDataWindow->Show();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableControl_Impl::~TableControl_Impl()
{
DBG_DTOR( TableControl_Impl, TableControl_Impl_checkInvariants );
@@ -457,35 +464,30 @@ namespace svt { namespace table
DELETEZ( m_pScrollCorner );
DELETEZ( m_pTableFunctionSet );
DELETEZ( m_pSelEngine );
- DELETEZ( m_pDataWindow );
}
- //--------------------------------------------------------------------
- PTableModel TableControl_Impl::getModel() const
- {
- if ( dynamic_cast< const EmptyTableModel* >( m_pModel.get() ) != NULL )
- // if it's an EmptyTableModel, pretend that there is no model
- return PTableModel();
-
- return m_pModel;
- }
-
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::setModel( PTableModel _pModel )
{
DBG_CHECK_ME();
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
+
+ if ( !!m_pModel )
+ m_pModel->removeTableModelListener( shared_from_this() );
m_pModel = _pModel;
if ( !m_pModel)
m_pModel.reset( new EmptyTableModel );
+ m_pModel->addTableModelListener( shared_from_this() );
+
m_nCurRow = ROW_INVALID;
m_nCurColumn = COL_INVALID;
// recalc some model-dependent cached info
impl_ni_updateCachedModelValues();
+ impl_ni_updateScrollbars();
// completely invalidate
m_rAntiImpl.Invalidate();
@@ -495,67 +497,308 @@ namespace svt { namespace table
if ( m_nColumnCount ) m_nCurColumn = 0;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_getAllVisibleCellsArea( Rectangle& _rCellArea ) const
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ bool lcl_adjustSelectedRows( ::std::vector< RowPos >& io_selectionIndexes, RowPos const i_firstAffectedRowIndex, TableSize const i_offset )
+ {
+ bool didChanges = false;
+ for ( ::std::vector< RowPos >::iterator selPos = io_selectionIndexes.begin();
+ selPos != io_selectionIndexes.end();
+ ++selPos
+ )
+ {
+ if ( *selPos < i_firstAffectedRowIndex )
+ continue;
+ *selPos += i_offset;
+ didChanges = true;
+ }
+ return didChanges;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::rowsInserted( RowPos i_first, RowPos i_last )
+ {
+ DBG_CHECK_ME();
+ OSL_PRECOND( i_last >= i_first, "TableControl_Impl::rowsInserted: invalid row indexes!" );
+
+ TableSize const insertedRows = i_last - i_first + 1;
+
+ // adjust selection, if necessary
+ bool const selectionChanged = lcl_adjustSelectedRows( m_aSelectedRows, i_first, insertedRows );
+
+ // adjust our cached row count
+ m_nRowCount = m_pModel->getRowCount();
+
+ // if the rows have been inserted before the current row, adjust this
+ if ( i_first <= m_nCurRow )
+ goTo( m_nCurColumn, m_nCurRow + insertedRows );
+
+ // adjust scrollbars
+ impl_ni_updateScrollbars();
+
+ // notify A1YY events
+ if ( impl_isAccessibleAlive() )
+ {
+ impl_commitAccessibleEvent( AccessibleEventId::TABLE_MODEL_CHANGED,
+ makeAny( AccessibleTableModelChange( AccessibleTableModelChangeType::INSERT, i_first, i_last, 0, m_pModel->getColumnCount() ) ),
+ Any()
+ );
+ impl_commitAccessibleEvent( AccessibleEventId::CHILD,
+ makeAny( m_pAccessibleTable->getTableHeader( TCTYPE_ROWHEADERBAR ) ),
+ Any()
+ );
+
+// for ( sal_Int32 i = 0 ; i <= m_pModel->getColumnCount(); ++i )
+// {
+// impl_commitAccessibleEvent(
+// CHILD,
+// makeAny( m_pAccessibleTable->getTable() ),
+// Any());
+// }
+ // Huh? What's that? We're notifying |columnCount| CHILD events here, claiming the *table* itself
+ // has been inserted. Doesn't make much sense, does it?
+ }
+
+ // schedule repaint
+ invalidateRowRange( i_first, ROW_INVALID );
+
+ // call selection handlers, if necessary
+ if ( selectionChanged )
+ m_rAntiImpl.Select();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::rowsRemoved( RowPos i_first, RowPos i_last )
+ {
+ sal_Int32 firstRemovedRow = i_first;
+ sal_Int32 lastRemovedRow = i_last;
+
+ // adjust selection, if necessary
+ bool selectionChanged = false;
+ if ( i_first == -1 )
+ {
+ selectionChanged = markAllRowsAsDeselected();
+
+ firstRemovedRow = 0;
+ lastRemovedRow = m_nRowCount - 1;
+ }
+ else
+ {
+ ENSURE_OR_RETURN_VOID( i_last >= i_first, "TableControl_Impl::rowsRemoved: illegal indexes!" );
+
+ for ( sal_Int32 row = i_first; row <= i_last; ++row )
+ {
+ if ( markRowAsDeselected( row ) )
+ selectionChanged = true;
+ }
+
+ if ( lcl_adjustSelectedRows( m_aSelectedRows, i_last + 1, i_first - i_last - 1 ) )
+ selectionChanged = true;
+ }
+
+ // adjust cached row count
+ m_nRowCount = m_pModel->getRowCount();
+
+ // adjust the current row, if it is larger than the row count now
+ if ( m_nCurRow >= m_nRowCount )
+ {
+ if ( m_nRowCount > 0 )
+ goTo( m_nCurColumn, m_nRowCount - 1 );
+ else
+ m_nCurRow = ROW_INVALID;
+ }
+
+ // adjust scrollbars
+ impl_ni_updateScrollbars();
+
+ // notify A11Y events
+ if ( impl_isAccessibleAlive() )
+ {
+ impl_commitAccessibleEvent(
+ AccessibleEventId::TABLE_MODEL_CHANGED,
+ makeAny( AccessibleTableModelChange(
+ AccessibleTableModelChangeType::DELETE,
+ firstRemovedRow,
+ lastRemovedRow,
+ 0,
+ m_pModel->getColumnCount()
+ ) ),
+ Any()
+ );
+ }
+
+ // schedule a repaint
+ invalidateRowRange( firstRemovedRow, ROW_INVALID );
+
+ // call selection handlers, if necessary
+ if ( selectionChanged )
+ m_rAntiImpl.Select();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnInserted( ColPos const i_colIndex )
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+
+ OSL_UNUSED( i_colIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnRemoved( ColPos const i_colIndex )
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+
+ OSL_UNUSED( i_colIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::allColumnsRemoved()
+ {
+ m_nColumnCount = m_pModel->getColumnCount();
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+
+ m_rAntiImpl.Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow )
+ {
+ invalidateRowRange( i_firstRow, i_lastRow );
+
+ OSL_UNUSED( i_firstCol );
+ OSL_UNUSED( i_lastCol );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::tableMetricsChanged()
+ {
+ long const oldRowHeaderWidthPixel = m_nRowHeaderWidthPixel;
+ impl_ni_updateCachedTableMetrics();
+ if ( oldRowHeaderWidthPixel != m_nRowHeaderWidthPixel )
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+ m_rAntiImpl.Invalidate();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_invalidateColumn( ColPos const i_column )
{
DBG_CHECK_ME();
- _rCellArea.Left() = 0;
- _rCellArea.Top() = 0;
+ Rectangle const aAllCellsArea( impl_getAllVisibleCellsArea() );
+
+ const TableColumnGeometry aColumn( *this, aAllCellsArea, i_column );
+ if ( aColumn.isValid() )
+ m_rAntiImpl.Invalidate( aColumn.getRect() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup )
+ {
+ ColumnAttributeGroup nGroup( i_attributeGroup );
+ if ( nGroup & COL_ATTRS_APPEARANCE )
+ {
+ impl_invalidateColumn( i_column );
+ nGroup &= ~COL_ATTRS_APPEARANCE;
+ }
+
+ if ( nGroup & COL_ATTRS_WIDTH )
+ {
+ if ( !m_bUpdatingColWidths )
+ {
+ impl_ni_updateColumnWidths( i_column );
+ invalidate( TableAreaAll );
+ impl_ni_updateScrollbars();
+ }
+
+ nGroup &= ~COL_ATTRS_WIDTH;
+ }
+
+ OSL_ENSURE( ( nGroup == COL_ATTRS_NONE ) || ( i_attributeGroup == COL_ATTRS_ALL ),
+ "TableControl_Impl::columnChanged: don't know how to handle this change!" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl_Impl::impl_getAllVisibleCellsArea() const
+ {
+ DBG_CHECK_ME();
+
+ Rectangle aArea( Point( 0, 0 ), Size( 0, 0 ) );
// determine the right-most border of the last column which is
// at least partially visible
- _rCellArea.Right() = m_nRowHeaderWidthPixel;
- if ( !m_aAccColumnWidthsPixel.empty() )
+ aArea.Right() = m_nRowHeaderWidthPixel;
+ if ( !m_aColumnWidths.empty() )
{
- // the number of pixels which are scroll out of the left hand
+ // the number of pixels which are scrolled out of the left hand
// side of the window
- long nScrolledOutLeft = m_nLeftColumn == 0 ? 0 : m_aAccColumnWidthsPixel[ m_nLeftColumn - 1 ];
+ const long nScrolledOutLeft = m_nLeftColumn == 0 ? 0 : m_aColumnWidths[ m_nLeftColumn - 1 ].getEnd();
- ArrayOfLong::const_reverse_iterator loop = m_aAccColumnWidthsPixel.rbegin();
+ ColumnPositions::const_reverse_iterator loop = m_aColumnWidths.rbegin();
do
{
- _rCellArea.Right() = *loop++ - nScrolledOutLeft + m_nRowHeaderWidthPixel;
+ aArea.Right() = loop->getEnd() - nScrolledOutLeft + m_nRowHeaderWidthPixel;
+ ++loop;
}
- while ( ( loop != m_aAccColumnWidthsPixel.rend() )
- && ( *loop - nScrolledOutLeft >= _rCellArea.Right() )
+ while ( ( loop != m_aColumnWidths.rend() )
+ && ( loop->getEnd() - nScrolledOutLeft >= aArea.Right() )
);
}
- // so far, _rCellArea.Right() denotes the first pixel *after* the cell area
- --_rCellArea.Right();
+ // so far, aArea.Right() denotes the first pixel *after* the cell area
+ --aArea.Right();
// determine the last row which is at least partially visible
- _rCellArea.Bottom() =
+ aArea.Bottom() =
m_nColHeaderHeightPixel
+ impl_getVisibleRows( true ) * m_nRowHeightPixel
- 1;
+
+ return aArea;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_getAllVisibleDataCellArea( Rectangle& _rCellArea ) const
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle TableControl_Impl::impl_getAllVisibleDataCellArea() const
{
DBG_CHECK_ME();
- impl_getAllVisibleCellsArea( _rCellArea );
- _rCellArea.Left() = m_nRowHeaderWidthPixel;
- _rCellArea.Top() = m_nColHeaderHeightPixel;
+ Rectangle aArea( impl_getAllVisibleCellsArea() );
+ aArea.Left() = m_nRowHeaderWidthPixel;
+ aArea.Top() = m_nColHeaderHeightPixel;
+ return aArea;
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_ni_updateCachedModelValues()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateCachedTableMetrics()
{
- m_nRowHeightPixel = 15;
- m_nColHeaderHeightPixel = 0;
- m_nRowHeaderWidthPixel = 0;
- m_pInputHandler.reset();
- m_nColumnCount = m_nRowCount = 0;
+ m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MAP_APPFONT ).Height();
- m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MAP_APPFONT ).Height();
- if ( m_pModel->hasColumnHeaders() )
+ m_nColHeaderHeightPixel = 0;
+ if ( m_pModel->hasColumnHeaders() )
m_nColHeaderHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getColumnHeaderHeight() ), MAP_APPFONT ).Height();
+
+ m_nRowHeaderWidthPixel = 0;
if ( m_pModel->hasRowHeaders() )
m_nRowHeaderWidthPixel = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT).Width();
+ }
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateCachedModelValues()
+ {
+ m_pInputHandler.reset();
+ m_nColumnCount = m_nRowCount = 0;
+
+ impl_ni_updateCachedTableMetrics();
impl_ni_updateColumnWidths();
m_pInputHandler = m_pModel->getInputHandler();
@@ -566,144 +809,279 @@ namespace svt { namespace table
m_nRowCount = m_pModel->getRowCount();
}
- //--------------------------------------------------------------------
- void TableControl_Impl::impl_ni_updateColumnWidths()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding )
{
- m_aColumnWidthsPixel.resize( 0 );
- m_aAccColumnWidthsPixel.resize( 0 );
+ ENSURE_OR_RETURN_VOID( !m_bUpdatingColWidths, "TableControl_Impl::impl_ni_updateColumnWidths: recursive call detected!" );
+
+ m_aColumnWidths.resize( 0 );
if ( !m_pModel )
return;
- TableSize colCount = m_pModel->getColumnCount();
+ const TableSize colCount = m_pModel->getColumnCount();
+ if ( colCount == 0 )
+ return;
+
+ m_bUpdatingColWidths = true;
+ const ::comphelper::FlagGuard aWidthUpdateFlag( m_bUpdatingColWidths );
- m_aColumnWidthsPixel.reserve( colCount );
- m_aAccColumnWidthsPixel.reserve( colCount );
- if(colCount>0)
+ m_aColumnWidths.reserve( colCount );
+
+ // the available horizontal space
+ long gridWidthPixel = m_rAntiImpl.GetOutputSizePixel().Width();
+ if ( m_pModel->hasRowHeaders() && ( gridWidthPixel != 0 ) )
{
- std::vector<sal_Int32> aPrePixelWidths(0);
- long accumulatedPixelWidth = 0;
- int lastResizableCol = -1;
- double gridWidth = m_rAntiImpl.GetOutputSizePixel().Width();
- if(m_pModel->hasRowHeaders())
- {
- TableMetrics rowHeaderWidth = m_pModel->getRowHeaderWidth();
- gridWidth-= m_rAntiImpl.LogicToPixel( Size( rowHeaderWidth, 0 ), MAP_APPFONT ).Width();
- }
- if(m_pModel->hasVerticalScrollbar())
+ gridWidthPixel -= m_nRowHeaderWidthPixel;
+ }
+ if ( m_pModel->getVerticalScrollbarVisibility() != ScrollbarShowNever )
+ {
+ long nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
+ gridWidthPixel -= nScrollbarMetrics;
+ }
+
+ // TODO: shouldn't we take the visibility of the vertical scroll bar into account here, too?
+ long const gridWidthAppFont = m_rAntiImpl.PixelToLogic( Size( gridWidthPixel, 0 ), MAP_APPFONT ).Width();
+
+ // determine the accumulated current width of all columns
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ const PColumnModel pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+
+ }
+
+ // collect some meta data for our columns:
+ // - their current (appt-font) metrics
+ long accumulatedCurrentWidth = 0;
+ ::std::vector< long > currentColWidths;
+ currentColWidths.reserve( colCount );
+ // - their effective minimal and maximal width (app-font!)
+ typedef ::std::vector< ::std::pair< long, long > > ColumnLimits;
+ ColumnLimits effectiveColumnLimits;
+ effectiveColumnLimits.reserve( colCount );
+ long accumulatedMinWidth = 0;
+ long accumulatedMaxWidth = 0;
+ // - their relative flexibility
+ ::std::vector< ::sal_Int32 > columnFlexibilities;
+ columnFlexibilities.reserve( colCount );
+ long flexibilityDenominator = 0;
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ PColumnModel const pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+
+ // current width
+ TableMetrics const currentWidth = pColumn->getWidth();
+ currentColWidths.push_back( currentWidth );
+
+ // accumulated width
+ accumulatedCurrentWidth += currentWidth;
+
+ // flexibility
+ ::sal_Int32 flexibility = pColumn->getFlexibility();
+ OSL_ENSURE( flexibility >= 0, "TableControl_Impl::impl_ni_updateColumnWidths: a column's flexibility should be non-negative." );
+ if ( ( flexibility < 0 ) // normalization
+ || ( !pColumn->isResizable() ) // column not resizeable => no auto-resize
+ || ( col <= i_assumeInflexibleColumnsUpToIncluding ) // column shall be treated as inflexible => respec this
+ )
+ flexibility = 0;
+
+ // min/max width
+ long effectiveMin = currentWidth, effectiveMax = currentWidth;
+ // if the column is not flexible, it will not be asked for min/max, but we assume the current width as limit then
+ if ( flexibility > 0 )
{
- sal_Int32 scrollbarWidth = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
- gridWidth-=scrollbarWidth;
+ long const minWidth = pColumn->getMinWidth();
+ if ( minWidth > 0 )
+ effectiveMin = minWidth;
+ else
+ effectiveMin = MIN_COLUMN_WIDTH_PIXEL;
+
+ long const maxWidth = pColumn->getMaxWidth();
+ OSL_ENSURE( minWidth <= maxWidth, "TableControl_Impl::impl_ni_updateColumnWidths: pretty undecided 'bout its width limits, this column!" );
+ if ( ( maxWidth > 0 ) && ( maxWidth >= minWidth ) )
+ effectiveMax = maxWidth;
+ else
+ effectiveMax = gridWidthAppFont; // TODO: any better guess here?
+
+ if ( effectiveMin == effectiveMax )
+ // if the min and the max are identical, this implies no flexibility at all
+ flexibility = 0;
}
- double colWidthsSum = 0.0;
- double colWithoutFixedWidthsSum = 0.0;
- double minColWithoutFixedSum = 0.0;
- for ( ColPos col = 0; col < colCount; ++col )
+
+ columnFlexibilities.push_back( flexibility );
+ flexibilityDenominator += flexibility;
+
+ effectiveColumnLimits.push_back( ::std::pair< long, long >( effectiveMin, effectiveMax ) );
+ accumulatedMinWidth += effectiveMin;
+ accumulatedMaxWidth += effectiveMax;
+ }
+
+ ::std::vector< long > newWidths( currentColWidths );
+ if ( flexibilityDenominator == 0 )
+ {
+ // no column is flexible => don't adjust anything
+ }
+ else if ( gridWidthAppFont > accumulatedCurrentWidth )
+ { // we have space to give away ...
+ long distributeAppFontUnits = gridWidthAppFont - accumulatedCurrentWidth;
+ if ( gridWidthAppFont > accumulatedMaxWidth )
{
- PColumnModel pColumn = m_pModel->getColumnModel( col );
- DBG_ASSERT( !!pColumn, "TableControl_Impl::impl_ni_updateColumnWidths: invalid column returned by the model!" );
- if ( !pColumn )
- continue;
- TableMetrics colWidth = 0;
- TableMetrics colPrefWidth = pColumn->getPreferredWidth();
- bool bResizable = pColumn->isResizable();
- if(pColumn->getMinWidth() == 0 && bResizable)
- {
- pColumn->setMinWidth(1);
- minColWithoutFixedSum+=m_rAntiImpl.PixelToLogic( Size( 1, 0 ), MAP_APPFONT ).Width();
- }
- if(pColumn->getMaxWidth() == 0 && bResizable)
- pColumn->setMaxWidth(m_rAntiImpl.PixelToLogic( Size( (int)gridWidth, 0 ), MAP_APPFONT ).Width());
- if( colPrefWidth != 0)
- {
- if(m_bResizingGrid)
- {
- colWidth = pColumn->getWidth();
- pColumn->setPreferredWidth(0);
- }
- else
- {
- colWidth = colPrefWidth;
- pColumn->setWidth(colPrefWidth);
- }
- }
- else
- colWidth = pColumn->getWidth();
- long pixelWidth = m_rAntiImpl.LogicToPixel( Size( colWidth, 0 ), MAP_APPFONT ).Width();
- if(bResizable && colPrefWidth == 0)
+ // ... but the column's maximal widths are still less than we have
+ // => set them all to max
+ for ( size_t i = 0; i < size_t( colCount ); ++i )
{
- colWithoutFixedWidthsSum+=pixelWidth;
- lastResizableCol = col;
+ newWidths[i] = effectiveColumnLimits[i].second;
}
- colWidthsSum+=pixelWidth;
- aPrePixelWidths.push_back(pixelWidth);
- }
- double gridWidthWithoutFixed = gridWidth - colWidthsSum + colWithoutFixedWidthsSum;
- double scalingFactor = 1.0;
- if(m_bResizingGrid)
- {
- if(gridWidthWithoutFixed > (minColWithoutFixedSum+colWidthsSum - colWithoutFixedWidthsSum))
- scalingFactor = gridWidthWithoutFixed/colWithoutFixedWidthsSum;
}
else
{
- if(colWidthsSum < gridWidthWithoutFixed)
+ bool startOver = false;
+ do
{
- if(colWithoutFixedWidthsSum>0)
- scalingFactor = gridWidthWithoutFixed/colWithoutFixedWidthsSum;
+ startOver = false;
+ // distribute the remaining space amongst all columns with a positive flexibility
+ for ( size_t i=0; i<newWidths.size() && !startOver; ++i )
+ {
+ long const columnFlexibility = columnFlexibilities[i];
+ if ( columnFlexibility == 0 )
+ continue;
+
+ long newColWidth = currentColWidths[i] + columnFlexibility * distributeAppFontUnits / flexibilityDenominator;
+
+ if ( newColWidth > effectiveColumnLimits[i].second )
+ { // that was too much, we hit the col's maximum
+ // set the new width to exactly this maximum
+ newColWidth = effectiveColumnLimits[i].second;
+ // adjust the flexibility denominator ...
+ flexibilityDenominator -= columnFlexibility;
+ columnFlexibilities[i] = 0;
+ // ... and the remaining width ...
+ long const difference = newColWidth - currentColWidths[i];
+ distributeAppFontUnits -= difference;
+ // ... this way, we ensure that the width not taken up by this column is consumed by the other
+ // flexible ones (if there are some)
+
+ // and start over with the first column, since there might be earlier columns which need
+ // to be recalculated now
+ startOver = true;
+ }
+
+ newWidths[i] = newColWidth;
+ }
}
+ while ( startOver );
}
- for ( ColPos i = 0; i < colCount; ++i )
+ }
+ else if ( gridWidthAppFont < accumulatedCurrentWidth )
+ { // we need to take away some space from the columns which allow it ...
+ long takeAwayAppFontUnits = accumulatedCurrentWidth - gridWidthAppFont;
+ if ( gridWidthAppFont < accumulatedMinWidth )
{
- PColumnModel pColumn = m_pModel->getColumnModel( i );
- DBG_ASSERT( !!pColumn, "TableControl_Impl::impl_ni_updateColumnWidths: invalid column returned by the model!" );
- if ( !pColumn )
- continue;
- if(pColumn->isResizable() && pColumn->getPreferredWidth() == 0)
+ // ... but the column's minimal widths are still more than we have
+ // => set them all to min
+ for ( size_t i = 0; i < size_t( colCount ); ++i )
{
- aPrePixelWidths[i]*=scalingFactor;
- TableMetrics logicColWidth = m_rAntiImpl.PixelToLogic( Size( aPrePixelWidths[i], 0 ), MAP_APPFONT ).Width();
- pColumn->setWidth(logicColWidth);
+ newWidths[i] = effectiveColumnLimits[i].first;
}
- m_aColumnWidthsPixel.push_back( aPrePixelWidths[i] );
- m_aAccColumnWidthsPixel.push_back( accumulatedPixelWidth += aPrePixelWidths[i] );
}
- if(gridWidth > m_aAccColumnWidthsPixel[colCount-1])
+ else
{
- if(lastResizableCol >= 0)
+ bool startOver = false;
+ do
{
- PColumnModel pColumn = m_pModel->getColumnModel(lastResizableCol);
- m_aColumnWidthsPixel[lastResizableCol]+=gridWidth-m_aAccColumnWidthsPixel[colCount-1];
- TableMetrics logicColWidth1 = m_rAntiImpl.PixelToLogic( Size( m_aColumnWidthsPixel[lastResizableCol], 0 ), MAP_APPFONT ).Width();
- pColumn->setWidth(logicColWidth1);
- while(lastResizableCol < colCount)
+ startOver = false;
+ // take away the space we need from the columns with a positive flexibility
+ for ( size_t i=0; i<newWidths.size() && !startOver; ++i )
{
- if(lastResizableCol == 0)
- m_aAccColumnWidthsPixel[0] = m_aColumnWidthsPixel[lastResizableCol];
- else
- m_aAccColumnWidthsPixel[lastResizableCol]=m_aAccColumnWidthsPixel[lastResizableCol-1]+m_aColumnWidthsPixel[lastResizableCol];
- ++lastResizableCol;
+ long const columnFlexibility = columnFlexibilities[i];
+ if ( columnFlexibility == 0 )
+ continue;
+
+ long newColWidth = currentColWidths[i] - columnFlexibility * takeAwayAppFontUnits / flexibilityDenominator;
+
+ if ( newColWidth < effectiveColumnLimits[i].first )
+ { // that was too much, we hit the col's minimum
+ // set the new width to exactly this minimum
+ newColWidth = effectiveColumnLimits[i].first;
+ // adjust the flexibility denominator ...
+ flexibilityDenominator -= columnFlexibility;
+ columnFlexibilities[i] = 0;
+ // ... and the remaining width ...
+ long const difference = currentColWidths[i] - newColWidth;
+ takeAwayAppFontUnits -= difference;
+
+ // and start over with the first column, since there might be earlier columns which need
+ // to be recalculated now
+ startOver = true;
+ }
+
+ newWidths[i] = newColWidth;
}
}
+ while ( startOver );
+ }
+ }
+
+ // now that we have calculated the app-font widths, get the actual pixels
+ long accumulatedWidthPixel = m_nRowHeaderWidthPixel;
+ for ( ColPos col = 0; col < colCount; ++col )
+ {
+ long const colWidth = m_rAntiImpl.LogicToPixel( Size( newWidths[col], 0 ), MAP_APPFONT ).Width();
+ const long columnStart = accumulatedWidthPixel;
+ const long columnEnd = columnStart + colWidth;
+ m_aColumnWidths.push_back( MutableColumnMetrics( columnStart, columnEnd ) );
+ accumulatedWidthPixel = columnEnd;
+
+ // and don't forget to forward this to the column models
+ PColumnModel const pColumn = m_pModel->getColumnModel( col );
+ ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" );
+ pColumn->setWidth( newWidths[col] );
+ }
+
+ // if the column resizing happened to leave some space at the right, but there are columns
+ // scrolled out to the left, scroll them in
+ while ( ( m_nLeftColumn > 0 )
+ && ( accumulatedWidthPixel - m_aColumnWidths[ m_nLeftColumn - 1 ].getStart() <= gridWidthPixel )
+ )
+ {
+ --m_nLeftColumn;
+ }
+
+ // now adjust the column metrics, since they currently ignore the horizontal scroll position
+ if ( m_nLeftColumn > 0 )
+ {
+ const long offsetPixel = m_aColumnWidths[ 0 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getStart();
+ for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin();
+ colPos != m_aColumnWidths.end();
+ ++colPos
+ )
+ {
+ colPos->move( offsetPixel );
}
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
namespace
{
- //................................................................
+ //..............................................................................................................
/// determines whether a scrollbar is needed for the given values
- bool lcl_determineScrollbarNeed( ScrollbarVisibility _eVisibility,
- long _nVisibleUnits, long _nRange )
+ bool lcl_determineScrollbarNeed( long const i_position, ScrollbarVisibility const i_visibility,
+ long const i_availableSpace, long const i_neededSpace )
{
- if ( _eVisibility == ScrollbarShowNever )
+ if ( i_visibility == ScrollbarShowNever )
return false;
- if ( _eVisibility == ScrollbarShowAlways )
+ if ( i_visibility == ScrollbarShowAlways )
+ return true;
+ if ( i_position > 0 )
return true;
- return _nVisibleUnits > _nRange;
+ if ( i_availableSpace >= i_neededSpace )
+ return false;
+ return true;
}
- //................................................................
+ //..............................................................................................................
void lcl_setButtonRepeat( Window& _rWindow, sal_uLong _nDelay )
{
AllSettings aSettings = _rWindow.GetSettings();
@@ -715,24 +1093,23 @@ namespace svt { namespace table
_rWindow.SetSettings( aSettings, sal_True );
}
- //................................................................
+ //..............................................................................................................
void lcl_updateScrollbar( Window& _rParent, ScrollBar*& _rpBar,
- ScrollbarVisibility _eVisibility, long _nVisibleUnits,
+ bool const i_needBar, long _nVisibleUnits,
long _nPosition, long _nLineSize, long _nRange,
bool _bHorizontal, const Link& _rScrollHandler )
{
- // do we need the scrollbar?
- bool bNeedBar = lcl_determineScrollbarNeed( _eVisibility, _nVisibleUnits, _nRange );
-
// do we currently have the scrollbar?
bool bHaveBar = _rpBar != NULL;
// do we need to correct the scrollbar visibility?
- if ( bHaveBar && !bNeedBar )
+ if ( bHaveBar && !i_needBar )
{
+ if ( _rpBar->IsTracking() )
+ _rpBar->EndTracking();
DELETEZ( _rpBar );
}
- else if ( !bHaveBar && bNeedBar )
+ else if ( !bHaveBar && i_needBar )
{
_rpBar = new ScrollBar(
&_rParent,
@@ -754,7 +1131,7 @@ namespace svt { namespace table
}
}
- //................................................................
+ //..............................................................................................................
/** returns the number of rows fitting into the given range,
for the given row height. Partially fitting rows are counted, too, if the
respective parameter says so.
@@ -766,7 +1143,7 @@ namespace svt { namespace table
: _nOverallHeight / _nRowHeightPixel;
}
- //................................................................
+ //..............................................................................................................
/** returns the number of columns fitting into the given area,
with the first visible column as given. Partially fitting columns are counted, too,
if the respective parameter says so.
@@ -791,15 +1168,13 @@ namespace svt { namespace table
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_ni_updateScrollbars()
{
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// the width/height of a scrollbar, needed several times below
- long nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
- if ( m_rAntiImpl.IsZoom() )
- nScrollbarMetrics = (long)( nScrollbarMetrics * (double)m_rAntiImpl.GetZoom() );
+ long const nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize();
// determine the playground for the data cells (excluding headers)
// TODO: what if the control is smaller than needed for the headers/scrollbars?
@@ -809,26 +1184,28 @@ namespace svt { namespace table
m_nRowCount = m_pModel->getRowCount();
m_nColumnCount = m_pModel->getColumnCount();
- if(m_aAccColumnWidthsPixel.empty())
- {
+ if ( m_aColumnWidths.empty() )
impl_ni_updateColumnWidths();
- }
+ OSL_ENSURE( m_aColumnWidths.size() == size_t( m_nColumnCount ), "TableControl_Impl::impl_ni_updateScrollbars: inconsistency!" );
+ const long nAllColumnsWidth = m_aColumnWidths.empty()
+ ? 0
+ : m_aColumnWidths[ m_nColumnCount - 1 ].getEnd() - m_aColumnWidths[ 0 ].getStart();
+
+ const ScrollbarVisibility eVertScrollbar = m_pModel->getVerticalScrollbarVisibility();
+ const ScrollbarVisibility eHorzScrollbar = m_pModel->getHorizontalScrollbarVisibility();
// do we need a vertical scrollbar?
+ bool bNeedVerticalScrollbar = lcl_determineScrollbarNeed(
+ m_nTopRow, eVertScrollbar, aDataCellPlayground.GetHeight(), m_nRowHeightPixel * m_nRowCount );
bool bFirstRoundVScrollNeed = false;
- if ( lcl_determineScrollbarNeed(
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(), m_nRowHeightPixel*m_nRowCount),
- lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
- m_nRowCount ) )
+ if ( bNeedVerticalScrollbar )
{
aDataCellPlayground.Right() -= nScrollbarMetrics;
bFirstRoundVScrollNeed = true;
}
// do we need a horizontal scrollbar?
- if ( lcl_determineScrollbarNeed(
- m_pModel->getHorizontalScrollbarVisibility(aDataCellPlayground.GetWidth(), m_aAccColumnWidthsPixel[m_nColumnCount-1]),
- lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ),
- m_nColumnCount ) )
+ const bool bNeedHorizontalScrollbar = lcl_determineScrollbarNeed( m_nLeftColumn, eHorzScrollbar, aDataCellPlayground.GetWidth(), nAllColumnsWidth );
+ if ( bNeedHorizontalScrollbar )
{
aDataCellPlayground.Bottom() -= nScrollbarMetrics;
@@ -836,19 +1213,21 @@ namespace svt { namespace table
// the need for a vertical one may have changed, since the horizontal
// SB might just occupy enough space so that not all rows do fit
// anymore
- if ( !bFirstRoundVScrollNeed && lcl_determineScrollbarNeed(
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(),m_nRowHeightPixel*m_nRowCount),
- lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
- m_nRowCount ) )
+ if ( !bFirstRoundVScrollNeed )
{
- aDataCellPlayground.Right() -= nScrollbarMetrics;
+ bNeedVerticalScrollbar = lcl_determineScrollbarNeed(
+ m_nTopRow, eVertScrollbar, aDataCellPlayground.GetHeight(), m_nRowHeightPixel * m_nRowCount );
+ if ( bNeedVerticalScrollbar )
+ {
+ aDataCellPlayground.Right() -= nScrollbarMetrics;
+ }
}
}
// create or destroy the vertical scrollbar, as needed
lcl_updateScrollbar(
m_rAntiImpl,
m_pVScroll,
- m_pModel->getVerticalScrollbarVisibility(aDataCellPlayground.GetHeight(),m_nRowHeightPixel*m_nRowCount),
+ bNeedVerticalScrollbar,
lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ),
// visible units
m_nTopRow, // current position
@@ -872,7 +1251,7 @@ namespace svt { namespace table
lcl_updateScrollbar(
m_rAntiImpl,
m_pHScroll,
- m_pModel->getHorizontalScrollbarVisibility(aDataCellPlayground.GetWidth(), m_aAccColumnWidthsPixel[m_nColumnCount-1]),
+ bNeedHorizontalScrollbar,
lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ),
// visible units
m_nLeftColumn, // current position
@@ -884,14 +1263,14 @@ namespace svt { namespace table
// position it
if ( m_pHScroll )
{
- TableSize nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false );
- int nRange = m_nColumnCount;
- if( m_nLeftColumn + nVisibleUnits == nRange-1)
+ TableSize const nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false );
+ TableMetrics const nRange = m_nColumnCount;
+ if( m_nLeftColumn + nVisibleUnits == nRange - 1 )
{
- if(m_aAccColumnWidthsPixel[nRange-2] - m_aAccColumnWidthsPixel[m_nLeftColumn] + m_aColumnWidthsPixel[nRange-1]>aDataCellPlayground.GetWidth())
+ if ( m_aColumnWidths[ nRange - 1 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getEnd() + m_aColumnWidths[ nRange-1 ].getWidth() > aDataCellPlayground.GetWidth() )
{
m_pHScroll->SetVisibleSize( nVisibleUnits -1 );
- m_pHScroll->SetPageSize(nVisibleUnits -1);
+ m_pHScroll->SetPageSize( nVisibleUnits - 1 );
}
}
Rectangle aScrollbarArea(
@@ -929,41 +1308,17 @@ namespace svt { namespace table
) );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::onResize()
{
DBG_CHECK_ME();
- if(m_nRowCount != 0)
- {
- if(m_nColumnCount != 0)
- {
- if(m_bResizingGrid)
- impl_ni_updateColumnWidths();
- invalidateRows();
- m_bResizingGrid = true;
- }
- }
- else
- {
- //In the case that column headers are defined but data hasn't yet been set,
- //only column headers will be shown
- if(m_pModel->hasColumnHeaders())
- {
- if(m_nColHeaderHeightPixel>1)
- {
- m_pDataWindow->SetSizePixel( m_rAntiImpl.GetOutputSizePixel());
- if(m_bResizingGrid)
- //update column widths to fit in grid
- impl_ni_updateColumnWidths();
- m_bResizingGrid = true;
- }
- }
- if(m_nColumnCount != 0)
- impl_ni_updateScrollbars();
- }
+
+ impl_ni_updateColumnWidths();
+ impl_ni_updateScrollbars();
+ checkCursorPosition();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::doPaintContent( const Rectangle& _rUpdateRect )
{
DBG_CHECK_ME();
@@ -971,32 +1326,24 @@ namespace svt { namespace table
if ( !getModel() )
return;
PTableRenderer pRenderer = getModel()->getRenderer();
- DBG_ASSERT( !!pRenderer, "TableDataWindow::Paint: invalid renderer!" );
+ DBG_ASSERT( !!pRenderer, "TableDataWindow::doPaintContent: invalid renderer!" );
if ( !pRenderer )
return;
// our current style settings, to be passed to the renderer
const StyleSettings& rStyle = m_rAntiImpl.GetSettings().GetStyleSettings();
m_nRowCount = m_pModel->getRowCount();
- TableSize nVisibleRows = impl_getVisibleRows(true);
- TableSize nActualRows = m_nRowCount;
- if(m_nRowCount>nVisibleRows)
- nActualRows = nVisibleRows;
// the area occupied by all (at least partially) visible cells, including
// headers
- Rectangle aAllCellsWithHeaders;
- impl_getAllVisibleCellsArea( aAllCellsWithHeaders );
+ Rectangle const aAllCellsWithHeaders( impl_getAllVisibleCellsArea() );
// ............................
// draw the header column area
if ( m_pModel->hasColumnHeaders() )
{
- TableRowGeometry aHeaderRow( *this, Rectangle( Point( 0, 0 ),
+ TableRowGeometry const aHeaderRow( *this, Rectangle( Point( 0, 0 ),
aAllCellsWithHeaders.BottomRight() ), ROW_COL_HEADERS );
- Rectangle aColRect(aHeaderRow.getRect());
- //to avoid double lines when scrolling horizontally
- if(m_nLeftColumn != 0)
- --aColRect.Left();
+ Rectangle const aColRect(aHeaderRow.getRect());
pRenderer->PaintHeaderArea(
*m_pDataWindow, aColRect, true, false, rStyle
);
@@ -1012,7 +1359,7 @@ namespace svt { namespace table
if ( _rUpdateRect.GetIntersection( aCell.getRect() ).IsEmpty() )
continue;
- bool isActiveColumn = ( aCell.getColumn() == getCurColumn() );
+ bool isActiveColumn = ( aCell.getColumn() == getCurrentColumn() );
bool isSelectedColumn = false;
pRenderer->PaintColumnHeader( aCell.getColumn(), isActiveColumn, isSelectedColumn,
*m_pDataWindow, aCell.getRect(), rStyle );
@@ -1024,31 +1371,23 @@ namespace svt { namespace table
{
aRowHeaderArea = aAllCellsWithHeaders;
aRowHeaderArea.Right() = m_nRowHeaderWidthPixel - 1;
- if(m_nTopRow+nActualRows>m_nRowCount)
- aRowHeaderArea.Bottom() = m_nRowHeightPixel * (nActualRows -1)+ m_nColHeaderHeightPixel - 1;
- else
- aRowHeaderArea.Bottom() = m_nRowHeightPixel * nActualRows + m_nColHeaderHeightPixel - 1;
- //to avoid double lines when scrolling vertically
- if(m_nTopRow != 0)
- --aRowHeaderArea.Top();
- --aRowHeaderArea.Right();
- pRenderer->PaintHeaderArea(*m_pDataWindow, aRowHeaderArea, false, true, rStyle);
+
+ TableSize const nVisibleRows = impl_getVisibleRows( true );
+ TableSize nActualRows = nVisibleRows;
+ if ( m_nTopRow + nActualRows > m_nRowCount )
+ nActualRows = m_nRowCount - m_nTopRow;
+ aRowHeaderArea.Bottom() = m_nColHeaderHeightPixel + m_nRowHeightPixel * nActualRows - 1;
+
+ pRenderer->PaintHeaderArea( *m_pDataWindow, aRowHeaderArea, false, true, rStyle );
// Note that strictly, aRowHeaderArea also contains the intersection between column
// and row header area. However, below we go to paint this intersection, again,
// so this hopefully doesn't hurt if we already paint it here.
if ( m_pModel->hasColumnHeaders() )
{
- TableCellGeometry aIntersection( *this, Rectangle( Point( 0, 0 ),
+ TableCellGeometry const aIntersection( *this, Rectangle( Point( 0, 0 ),
aAllCellsWithHeaders.BottomRight() ), COL_ROW_HEADERS, ROW_COL_HEADERS );
- Rectangle aInters(aIntersection.getRect());
- //to avoid double line when scrolling vertically
- if( m_nTopRow != 0 )
- {
- --aInters.Top();
- --aInters.Bottom();
- }
- --aInters.Right();
+ Rectangle const aInters( aIntersection.getRect() );
pRenderer->PaintHeaderArea(
*m_pDataWindow, aInters, true, true, rStyle
);
@@ -1061,51 +1400,36 @@ namespace svt { namespace table
TableSize colCount = getModel()->getColumnCount();
// paint all rows
- Rectangle aAllDataCellsArea;
- impl_getAllVisibleDataCellArea( aAllDataCellsArea );
- ::std::vector< std::vector< ::com::sun::star::uno::Any > >& aCellContent = m_pModel->getCellContent();
+ Rectangle const aAllDataCellsArea( impl_getAllVisibleDataCellArea() );
for ( TableRowGeometry aRowIterator( *this, aAllCellsWithHeaders, getTopRow() );
aRowIterator.isValid();
aRowIterator.moveDown() )
{
if ( _rUpdateRect.GetIntersection( aRowIterator.getRect() ).IsEmpty() )
continue;
- bool isActiveRow = ( aRowIterator.getRow() == getCurRow() );
- bool isSelectedRow = false;
- if(!m_nRowSelected.empty())
- {
- for(std::vector<RowPos>::iterator itSel=m_nRowSelected.begin();
- itSel!=m_nRowSelected.end();++itSel)
- {
- if(*itSel == aRowIterator.getRow())
- isSelectedRow = true;
- }
- }
- Rectangle aRect = aRowIterator.getRect().GetIntersection( aAllDataCellsArea );
- //to avoid double lines
- if( aRowIterator.getRow() != 0 )
- --aRect.Top();
- if(m_nLeftColumn != 0)
- --aRect.Left();
- else
- {
- if(m_pModel->hasRowHeaders())
- --aRect.Left();
- }
+
+ bool const isActiveRow = ( aRowIterator.getRow() == getCurrentRow() );
+ bool const isSelectedRow = isRowSelected( aRowIterator.getRow() );
+
+ Rectangle const aRect = aRowIterator.getRect().GetIntersection( aAllDataCellsArea );
+
// give the redenderer a chance to prepare the row
- pRenderer->PrepareRow( aRowIterator.getRow(), isActiveRow, isSelectedRow,
- *m_pDataWindow, aRect, rStyle );
+ pRenderer->PrepareRow(
+ aRowIterator.getRow(), isActiveRow, isSelectedRow,
+ *m_pDataWindow, aRect, rStyle
+ );
// paint the row header
if ( m_pModel->hasRowHeaders() )
{
- Rectangle aCurrentRowHeader( aRowHeaderArea.GetIntersection( aRowIterator.getRect() ) );
- rtl::OUString rowHeaderName = m_pModel->getRowHeaderName()[aRowIterator.getRow()];
+ const Rectangle aCurrentRowHeader( aRowHeaderArea.GetIntersection( aRowIterator.getRect() ) );
pRenderer->PaintRowHeader( isActiveRow, isSelectedRow, *m_pDataWindow, aCurrentRowHeader,
- rStyle, rowHeaderName );
+ rStyle );
}
+
if ( !colCount )
continue;
+
// paint all cells in this row
for ( TableCellGeometry aCell( aRowIterator, m_nLeftColumn );
aCell.isValid();
@@ -1113,25 +1437,12 @@ namespace svt { namespace table
)
{
bool isSelectedColumn = false;
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >xGraphic;
- ::com::sun::star::uno::Any rCellData = aCellContent[aRowIterator.getRow()][aCell.getColumn()];
- if(rCellData>>=xGraphic)
- {
- Image* pImage = new Image(xGraphic);
- if(pImage!=NULL)
- pRenderer->PaintCellImage( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
- *m_pDataWindow, aCell.getRect(), rStyle, pImage );
- }
- else
- {
- ::rtl::OUString sContent = convertToString(rCellData);
- pRenderer->PaintCellString( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
- *m_pDataWindow, aCell.getRect(), rStyle, sContent );
- }
+ pRenderer->PaintCell( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow,
+ *m_pDataWindow, aCell.getRect(), rStyle );
}
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::hideCursor()
{
DBG_CHECK_ME();
@@ -1140,7 +1451,7 @@ namespace svt { namespace table
impl_ni_doSwitchCursor( false );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::showCursor()
{
DBG_CHECK_ME();
@@ -1150,12 +1461,14 @@ namespace svt { namespace table
impl_ni_doSwitchCursor( true );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
bool TableControl_Impl::dispatchAction( TableControlAction _eAction )
{
DBG_CHECK_ME();
bool bSuccess = false;
+ bool selectionChanged = false;
+
Rectangle rCells;
switch ( _eAction )
{
@@ -1163,25 +1476,25 @@ namespace svt { namespace table
if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
{
//if other rows already selected, deselect them
- if(m_nRowSelected.size()>0)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
invalidateSelectedRegion(*it, *it, rCells);
}
- m_nRowSelected.clear();
+ m_aSelectedRows.clear();
}
if(m_nCurRow < m_nRowCount-1)
{
++m_nCurRow;
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
}
else
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
ensureVisible(m_nCurColumn,m_nCurRow,false);
- m_rAntiImpl.selectionChanged(true);
+ selectionChanged = true;
bSuccess = true;
}
else
@@ -1194,28 +1507,28 @@ namespace svt { namespace table
case cursorUp:
if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
{
- if(m_nRowSelected.size()>0)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
invalidateSelectedRegion(*it, *it, rCells);
}
- m_nRowSelected.clear();
+ m_aSelectedRows.clear();
}
if(m_nCurRow>0)
{
--m_nCurRow;
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
else
{
- m_nRowSelected.push_back(m_nCurRow);
+ m_aSelectedRows.push_back(m_nCurRow);
invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
ensureVisible(m_nCurColumn,m_nCurRow,false);
- m_rAntiImpl.selectionChanged(true);
+ selectionChanged = true;
bSuccess = true;
}
else
@@ -1277,259 +1590,269 @@ namespace svt { namespace table
case cursorBottomRight:
bSuccess = goTo( m_nColumnCount - 1, m_nRowCount - 1 );
break;
- case cursorSelectRow:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- //pos is the position of the current row in the vector of selected rows, if current row is selected
- int pos = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- //if current row is selected, it should be deselected, when ALT+SPACE are pressed
- if(pos>-1)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+pos);
- if(m_nRowSelected.empty() && m_nAnchor != -1)
- m_nAnchor = -1;
- }
- //else select the row->put it in the vector
- else
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
- break;
- case cursorSelectRowUp:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+
+ case cursorSelectRow:
{
- //if there are other selected rows, deselect them
- return false;
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ //pos is the position of the current row in the vector of selected rows, if current row is selected
+ int pos = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ //if current row is selected, it should be deselected, when ALT+SPACE are pressed
+ if(pos>-1)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+pos);
+ if(m_aSelectedRows.empty() && m_nAnchor != -1)
+ m_nAnchor = -1;
+ }
+ //else select the row->put it in the vector
+ else
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ selectionChanged = true;
+ bSuccess = true;
}
- else
+ break;
+ case cursorSelectRowUp:
{
- //there are other selected rows
- if(m_nRowSelected.size()>0)
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ {
+ //if there are other selected rows, deselect them
+ return false;
+ }
+ else
{
- //the anchor wasn't set -> a region is not selected, that's why clear all selection
- //and select the current row
- if(m_nAnchor==-1)
+ //there are other selected rows
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ //the anchor wasn't set -> a region is not selected, that's why clear all selection
+ //and select the current row
+ if(m_nAnchor==-1)
{
- invalidateSelectedRegion(*it, *it, rCells);
- }
- m_nRowSelected.clear();
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
- else
- {
- //a region is already selected, prevRow is last selected row and the row above - nextRow - should be selected
- int prevRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- int nextRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow-1);
- if(prevRow>-1)
- {
- //if m_nCurRow isn't the upper one, can move up, otherwise not
- if(m_nCurRow>0)
- m_nCurRow--;
- else
- return bSuccess = true;
- //if nextRow already selected, deselect it, otherwise select it
- if(nextRow>-1 && m_nRowSelected[nextRow] == m_nCurRow)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+prevRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow+1, rCells);
- }
- else
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
- }
+ invalidateSelectedRegion(*it, *it, rCells);
+ }
+ m_aSelectedRows.clear();
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
else
{
- if(m_nCurRow>0)
+ //a region is already selected, prevRow is last selected row and the row above - nextRow - should be selected
+ int prevRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ int nextRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow-1);
+ if(prevRow>-1)
+ {
+ //if m_nCurRow isn't the upper one, can move up, otherwise not
+ if(m_nCurRow>0)
+ m_nCurRow--;
+ else
+ return bSuccess = true;
+ //if nextRow already selected, deselect it, otherwise select it
+ if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow+1, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ }
+ else
{
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow--;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ if(m_nCurRow>0)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow--;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ }
}
}
}
- }
- else
- {
- //if nothing is selected and the current row isn't the upper one
- //select the current and one row above
- //otherwise select only the upper row
- if(m_nCurRow>0)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow--;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
- }
else
{
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ //if nothing is selected and the current row isn't the upper one
+ //select the current and one row above
+ //otherwise select only the upper row
+ if(m_nCurRow>0)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow--;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
}
+ m_pSelEngine->SetAnchor(sal_True);
+ m_nAnchor = m_nCurRow;
+ ensureVisible(m_nCurColumn, m_nCurRow, false);
+ selectionChanged = true;
+ bSuccess = true;
}
- m_pSelEngine->SetAnchor(sal_True);
- m_nAnchor = m_nCurRow;
- ensureVisible(m_nCurColumn, m_nCurRow, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
}
- }
- break;
- case cursorSelectRowDown:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- {
- bSuccess = false;
- }
- else
+ break;
+ case cursorSelectRowDown:
{
- if(m_nRowSelected.size()>0)
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ {
+ bSuccess = false;
+ }
+ else
{
- //the anchor wasn't set -> a region is not selected, that's why clear all selection
- //and select the current row
- if(m_nAnchor==-1)
+ if(m_aSelectedRows.size()>0)
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();
- it!=m_nRowSelected.end();++it)
+ //the anchor wasn't set -> a region is not selected, that's why clear all selection
+ //and select the current row
+ if(m_nAnchor==-1)
{
- invalidateSelectedRegion(*it, *it, rCells);
- }
- m_nRowSelected.clear();
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ for(std::vector<RowPos>::iterator it=m_aSelectedRows.begin();
+ it!=m_aSelectedRows.end();++it)
+ {
+ invalidateSelectedRegion(*it, *it, rCells);
+ }
+ m_aSelectedRows.clear();
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ else
+ {
+ //a region is already selected, prevRow is last selected row and the row beneath - nextRow - should be selected
+ int prevRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
+ int nextRow = getRowSelectedNumber(m_aSelectedRows, m_nCurRow+1);
+ if(prevRow>-1)
+ {
+ //if m_nCurRow isn't the last one, can move down, otherwise not
+ if(m_nCurRow<m_nRowCount-1)
+ m_nCurRow++;
+ else
+ return bSuccess = true;
+ //if next row already selected, deselect it, otherwise select it
+ if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow)
+ {
+ m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow-1, rCells);
+ }
+ else
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ }
+ }
+ else
+ {
+ if(m_nCurRow<m_nRowCount-1)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow++;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
+ }
+ }
}
+ }
else
{
- //a region is already selected, prevRow is last selected row and the row beneath - nextRow - should be selected
- int prevRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow);
- int nextRow = getRowSelectedNumber(m_nRowSelected, m_nCurRow+1);
- if(prevRow>-1)
- {
- //if m_nCurRow isn't the last one, can move down, otherwise not
- if(m_nCurRow<m_nRowCount-1)
- m_nCurRow++;
- else
- return bSuccess = true;
- //if next row already selected, deselect it, otherwise select it
- if(nextRow>-1 && m_nRowSelected[nextRow] == m_nCurRow)
- {
- m_nRowSelected.erase(m_nRowSelected.begin()+prevRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow-1, rCells);
- }
- else
- {
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
- }
+ //there wasn't any selection, select current and row beneath, otherwise only row beneath
+ if(m_nCurRow<m_nRowCount-1)
+ {
+ m_aSelectedRows.push_back(m_nCurRow);
+ m_nCurRow++;
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
}
else
{
- if(m_nCurRow<m_nRowCount-1)
- {
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow++;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
- }
+ m_aSelectedRows.push_back(m_nCurRow);
+ invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
}
}
+ m_pSelEngine->SetAnchor(sal_True);
+ m_nAnchor = m_nCurRow;
+ ensureVisible(m_nCurColumn, m_nCurRow, false);
+ selectionChanged = true;
+ bSuccess = true;
}
+ }
+ break;
+
+ case cursorSelectRowAreaTop:
+ {
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ bSuccess = false;
else
{
- //there wasn't any selection, select current and row beneath, otherwise only row beneath
- if(m_nCurRow<m_nRowCount-1)
+ //select the region between the current and the upper row
+ RowPos iter = m_nCurRow;
+ invalidateSelectedRegion(m_nCurRow, 0, rCells);
+ //put the rows in vector
+ while(iter>=0)
{
- m_nRowSelected.push_back(m_nCurRow);
- m_nCurRow++;
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells);
- }
- else
- {
- m_nRowSelected.push_back(m_nCurRow);
- invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells);
+ if ( !isRowSelected( iter ) )
+ m_aSelectedRows.push_back(iter);
+ --iter;
}
+ m_nCurRow = 0;
+ m_nAnchor = m_nCurRow;
+ m_pSelEngine->SetAnchor(sal_True);
+ ensureVisible(m_nCurColumn, 0, false);
+ selectionChanged = true;
+ bSuccess = true;
}
- m_pSelEngine->SetAnchor(sal_True);
- m_nAnchor = m_nCurRow;
- ensureVisible(m_nCurColumn, m_nCurRow, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
}
- }
break;
- case cursorSelectRowAreaTop:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- bSuccess = false;
- else
+
+ case cursorSelectRowAreaBottom:
{
- //select the region between the current and the upper row
+ if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ return bSuccess = false;
+ else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ return bSuccess = false;
+ //select the region between the current and the last row
RowPos iter = m_nCurRow;
- invalidateSelectedRegion(m_nCurRow, 0, rCells);
- //put the rows in vector
- while(iter>=0)
+ invalidateSelectedRegion(m_nCurRow, m_nRowCount-1, rCells);
+ //put the rows in the vector
+ while(iter<=m_nRowCount)
{
- if(!isRowSelected(m_nRowSelected, iter))
- m_nRowSelected.push_back(iter);
- --iter;
+ if ( !isRowSelected( iter ) )
+ m_aSelectedRows.push_back(iter);
+ ++iter;
}
- m_nCurRow = 0;
+ m_nCurRow = m_nRowCount-1;
m_nAnchor = m_nCurRow;
m_pSelEngine->SetAnchor(sal_True);
- ensureVisible(m_nCurColumn, 0, false);
- m_rAntiImpl.selectionChanged(true);
+ ensureVisible(m_nCurColumn, m_nRowCount-1, false);
+ selectionChanged = true;
bSuccess = true;
}
- }
- break;
- case cursorSelectRowAreaBottom:
- {
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
- return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
- return bSuccess = false;
- //select the region between the current and the last row
- RowPos iter = m_nCurRow;
- invalidateSelectedRegion(m_nCurRow, m_nRowCount-1, rCells);
- //put the rows in the vector
- while(iter<=m_nRowCount)
- {
- if(!isRowSelected(m_nRowSelected, iter))
- m_nRowSelected.push_back(iter);
- ++iter;
- }
- m_nCurRow = m_nRowCount-1;
- m_nAnchor = m_nCurRow;
- m_pSelEngine->SetAnchor(sal_True);
- ensureVisible(m_nCurColumn, m_nRowCount-1, false);
- m_rAntiImpl.selectionChanged(true);
- bSuccess = true;
- }
break;
default:
DBG_ERROR( "TableControl_Impl::dispatchAction: unsupported action!" );
+ break;
+ }
+
+ if ( bSuccess && selectionChanged )
+ {
+ m_rAntiImpl.Select();
}
+
return bSuccess;
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_ni_doSwitchCursor( bool _bShow )
{
PTableRenderer pRenderer = !!m_pModel ? m_pModel->getRenderer() : PTableRenderer();
@@ -1537,16 +1860,14 @@ namespace svt { namespace table
{
Rectangle aCellRect;
impl_getCellRect( m_nCurColumn, m_nCurRow, aCellRect );
- if(!m_pModel->hasRowHeaders() && m_nCurColumn == 0)
- aCellRect.Left()++;
if ( _bShow )
- pRenderer->ShowCellCursor( *m_pDataWindow, aCellRect);
+ pRenderer->ShowCellCursor( *m_pDataWindow, aCellRect );
else
- pRenderer->HideCellCursor( *m_pDataWindow, aCellRect);
+ pRenderer->HideCellCursor( *m_pDataWindow, aCellRect );
}
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::impl_getCellRect( ColPos _nColumn, RowPos _nRow, Rectangle& _rCellRect ) const
{
DBG_CHECK_ME();
@@ -1560,164 +1881,236 @@ namespace svt { namespace table
return;
}
- Rectangle aAllCells;
- impl_getAllVisibleCellsArea( aAllCells );
-
- TableCellGeometry aCell( *this, aAllCells, _nColumn, _nRow );
+ TableCellGeometry aCell( *this, impl_getAllVisibleCellsArea(), _nColumn, _nRow );
_rCellRect = aCell.getRect();
- _rCellRect.Top()--;_rCellRect.Left()--;
}
- //-------------------------------------------------------------------------------
- RowPos TableControl_Impl::getCurrentRow(const Point& rPoint)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getRowAtPoint( const Point& rPoint ) const
+ {
+ DBG_CHECK_ME();
+ return impl_getRowForAbscissa( rPoint.Y() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColPos TableControl_Impl::getColAtPoint( const Point& rPoint ) const
{
DBG_CHECK_ME();
- Rectangle rCellRect;
- RowPos newRowPos = -2;//-1 is HeaderRow
- ColPos newColPos = 0;
- for(int i=-1;i<m_nRowCount;i++)
+ return impl_getColumnForOrdinate( rPoint.X() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableCell TableControl_Impl::hitTest( Point const & i_point ) const
+ {
+ TableCell aCell( getColAtPoint( i_point ), getRowAtPoint( i_point ) );
+ if ( aCell.nColumn > COL_ROW_HEADERS )
{
- for(int j=-1;j<m_nColumnCount;j++)
+ PColumnModel const pColumn = m_pModel->getColumnModel( aCell.nColumn );
+ MutableColumnMetrics const & rColInfo( m_aColumnWidths[ aCell.nColumn ] );
+ if ( ( rColInfo.getEnd() - 3 <= i_point.X() )
+ && ( rColInfo.getEnd() >= i_point.X() )
+ && pColumn->isResizable()
+ )
{
- impl_getCellRect(j,i,rCellRect);
- if((rPoint.X() >= rCellRect.Left() && rPoint.X() <= rCellRect.Right()) && rPoint.Y() >= rCellRect.Top() && rPoint.Y() <= rCellRect.Bottom())
- {
- newRowPos = i;
- newColPos = j;
- if(newColPos != -1)
- m_nCurColumn = newColPos;
- return newRowPos;
- }
+ aCell.eArea = ColumnDivider;
}
}
- return newRowPos;
+ return aCell;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnMetrics TableControl_Impl::getColumnMetrics( ColPos const i_column ) const
+ {
+ DBG_CHECK_ME();
+
+ ENSURE_OR_RETURN( ( i_column >= 0 ) && ( i_column < m_pModel->getColumnCount() ),
+ "TableControl_Impl::getColumnMetrics: illegal column index!", ColumnMetrics() );
+ return (ColumnMetrics const &)m_aColumnWidths[ i_column ];
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ PTableModel TableControl_Impl::getModel() const
+ {
+ return m_pModel;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getCurrentColumn() const
+ {
+ return m_nCurColumn;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getCurrentRow() const
+ {
+ return m_nCurRow;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::Size TableControl_Impl::getTableSizePixel() const
+ {
+ return m_pDataWindow->GetOutputSizePixel();
}
- //-------------------------------------------------------------------------------
- void TableControl_Impl::setCursorAtCurrentCell(const Point& rPoint)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::setPointer( Pointer const & i_pointer )
{
DBG_CHECK_ME();
- hideCursor();
- Rectangle rCellRect;
- RowPos newRowPos = -2;//-1 is HeaderRow
- ColPos newColPos = 0;
- for(int i=0;i<m_nRowCount;i++)
+ m_pDataWindow->SetPointer( i_pointer );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::captureMouse()
+ {
+ m_pDataWindow->CaptureMouse();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::releaseMouse()
+ {
+ m_pDataWindow->ReleaseMouse();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::invalidate( TableArea const i_what )
+ {
+ switch ( i_what )
{
- for(int j=-1;j<m_nColumnCount;j++)
- {
- impl_getCellRect(j,i,rCellRect);
- if((rPoint.X() >= rCellRect.Left() && rPoint.X() <= rCellRect.Right()) && rPoint.Y() >= rCellRect.Top() && rPoint.Y() <= rCellRect.Bottom())
- {
- newRowPos = i;
- m_nCurRow = newRowPos;
- newColPos = j;
- if(newColPos == -1)
- m_nCurColumn = 0;
- else
- m_nCurColumn = newColPos;
- }
- }
+ case TableAreaColumnHeaders:
+ m_pDataWindow->Invalidate( calcHeaderRect( true ) );
+ break;
+
+ case TableAreaRowHeaders:
+ m_pDataWindow->Invalidate( calcHeaderRect( false ) );
+ break;
+
+ case TableAreaDataArea:
+ m_pDataWindow->Invalidate( impl_getAllVisibleDataCellArea() );
+ break;
+
+ case TableAreaAll:
+ m_pDataWindow->Invalidate();
+ break;
}
- showCursor();
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ long TableControl_Impl::pixelWidthToAppFont( long const i_pixels ) const
+ {
+ return m_pDataWindow->PixelToLogic( Size( i_pixels, 0 ), MAP_APPFONT ).Width();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::hideTracking()
+ {
+ m_pDataWindow->HideTracking();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::showTracking( Rectangle const & i_location, sal_uInt16 const i_flags )
+ {
+ m_pDataWindow->ShowTracking( i_location, i_flags );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::activateCell( ColPos const i_col, RowPos const i_row )
+ {
+ DBG_CHECK_ME();
+ return goTo( i_col, i_row );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void TableControl_Impl::invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect)
{
DBG_CHECK_ME();
- Rectangle aAllCells;
//get the visible area of the table control and set the Left and right border of the region to be repainted
- impl_getAllVisibleCellsArea( aAllCells );
+ Rectangle const aAllCells( impl_getAllVisibleCellsArea() );
_rCellRect.Left() = aAllCells.Left();
_rCellRect.Right() = aAllCells.Right();
- Rectangle rCells;
//if only one row is selected
if(_nPrevRow == _nCurRow)
{
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Top()=--rCells.Top();
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
//if the region is above the current row
else if(_nPrevRow < _nCurRow )
{
- impl_getCellRect(m_nCurColumn,_nPrevRow,rCells);
- _rCellRect.Top()= --rCells.Top();
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
//if the region is beneath the current row
else
{
- impl_getCellRect(m_nCurColumn,_nCurRow,rCells);
- _rCellRect.Top()= --rCells.Top();
- impl_getCellRect(m_nCurColumn,_nPrevRow,rCells);
- _rCellRect.Bottom()=rCells.Bottom();
+ Rectangle aCellRect;
+ impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect );
+ _rCellRect.Top() = aCellRect.Top();
+ impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect );
+ _rCellRect.Bottom() = aCellRect.Bottom();
}
m_pDataWindow->Invalidate(_rCellRect);
}
- //-------------------------------------------------------------------------------
- //this method is to be called, when a new row is added
- void TableControl_Impl::invalidateRow(RowPos _nRowPos, Rectangle& _rCellRect)
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow )
{
- if(m_nCurRow < 0)
- m_nCurRow = 0;
- if(m_nCursorHidden == 2)
+ if ( m_nCursorHidden == 2 )
+ // WTF? what kind of hack is this?
--m_nCursorHidden;
- impl_getAllVisibleCellsArea( _rCellRect );
- TableRowGeometry _rRow( *this, _rCellRect, _nRowPos);
- impl_ni_updateScrollbars();
- m_pDataWindow->Invalidate(_rRow.getRect());
- }
- //-------------------------------------------------------------------------------
- std::vector<RowPos>& TableControl_Impl::getSelectedRows()
- {
- return m_nRowSelected;
- }
- //--------------------------------------------------------------------
- void TableControl_Impl::clearSelection()
- {
- m_nRowSelected.clear();
- }
- //--------------------------------------------------------------------
- //-------------------------------------------------------------------------------
- void TableControl_Impl::removeSelectedRow(RowPos _nRowPos)
- {
- int i =0;
- //if the row is selected, remove it from the selection vector
- if(isRowSelected(m_nRowSelected, _nRowPos))
- {
- if(m_nRowSelected.size()>1)
- m_nRowSelected.erase(m_nRowSelected.begin()+_nRowPos);
- else
- m_nRowSelected.clear();
- }
- //after removing a row, row positions must be updated, so selected rows could stay selected
- if(m_nRowSelected.size()>1)
+
+ RowPos const firstRow = i_firstRow < m_nTopRow ? m_nTopRow : i_firstRow;
+ RowPos const lastVisibleRow = m_nTopRow + impl_getVisibleRows( true ) - 1;
+ RowPos const lastRow = ( ( i_lastRow == ROW_INVALID ) || ( i_lastRow > lastVisibleRow ) ) ? lastVisibleRow : i_lastRow;
+
+ Rectangle aInvalidateRect;
+
+ Rectangle const aVisibleCellsArea( impl_getAllVisibleCellsArea() );
+ TableRowGeometry aRow( *this, aVisibleCellsArea, firstRow, true );
+ while ( aRow.isValid() && ( aRow.getRow() <= lastRow ) )
{
- for(std::vector<RowPos>::iterator it=m_nRowSelected.begin();it!=m_nRowSelected.end();++it)
- {
- if(*it > _nRowPos)
- m_nRowSelected[i]=*it-1;
- ++i;
- }
+ aInvalidateRect.Union( aRow.getRect() );
+ aRow.moveDown();
}
- if(_nRowPos == 0)
- m_nCurRow = 0;
- else
- m_nCurRow = _nRowPos-1;
+
+ if ( i_lastRow == ROW_INVALID )
+ aInvalidateRect.Bottom() = m_pDataWindow->GetOutputSizePixel().Height();
+
+ m_pDataWindow->Invalidate( aInvalidateRect );
}
+
//------------------------------------------------------------------------------
- void TableControl_Impl::invalidateRows()
+ void TableControl_Impl::checkCursorPosition()
{
- impl_ni_updateScrollbars();
+ DBG_CHECK_ME();
+
TableSize nVisibleRows = impl_getVisibleRows(true);
TableSize nVisibleCols = impl_getVisibleColumns(true);
- if(m_nTopRow+nVisibleRows>m_nRowCount && m_nRowCount>=nVisibleRows)
- m_nTopRow--;
+ if ( ( m_nTopRow + nVisibleRows > m_nRowCount )
+ && ( m_nRowCount >= nVisibleRows )
+ )
+ {
+ --m_nTopRow;
+ }
else
+ {
m_nTopRow = 0;
- if(m_nLeftColumn+nVisibleCols>m_nColumnCount && m_nColumnCount>=nVisibleCols)
- m_nLeftColumn--;
+ }
+
+ if ( ( m_nLeftColumn + nVisibleCols > m_nColumnCount )
+ && ( m_nColumnCount >= nVisibleCols )
+ )
+ {
+ --m_nLeftColumn;
+ }
else
+ {
m_nLeftColumn = 0;
+ }
+
m_pDataWindow->Invalidate();
}
@@ -1736,7 +2129,7 @@ namespace svt { namespace table
}
//--------------------------------------------------------------------
- TableSize TableControl_Impl::impl_getVisibleColumns( bool _bAcceptPartialRow ) const
+ TableSize TableControl_Impl::impl_getVisibleColumns( bool _bAcceptPartialCol ) const
{
DBG_CHECK_ME();
@@ -1746,7 +2139,7 @@ namespace svt { namespace table
Rectangle( Point( 0, 0 ), m_pDataWindow->GetOutputSizePixel() ),
m_nLeftColumn,
*this,
- _bAcceptPartialRow
+ _bAcceptPartialCol
);
}
@@ -1757,12 +2150,15 @@ namespace svt { namespace table
// TODO: give veto listeners a chance
- if ( ( _nColumn < -1 ) || ( _nColumn >= m_nColumnCount )
- || ( _nRow < -1 ) || ( _nRow >= m_nRowCount )
+ if ( ( _nColumn < 0 ) || ( _nColumn >= m_nColumnCount )
+ || ( _nRow < 0 ) || ( _nRow >= m_nRowCount )
)
+ {
+ OSL_ENSURE( false, "TableControl_Impl::goTo: invalid row or column index!" );
return false;
+ }
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
m_nCurColumn = _nColumn;
m_nCurRow = _nRow;
@@ -1779,32 +2175,40 @@ namespace svt { namespace table
&& ( _nRow >= 0 ) && ( _nRow < m_nRowCount ),
"TableControl_Impl::ensureVisible: invalid coordinates!" );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
if ( _nColumn < m_nLeftColumn )
- impl_ni_ScrollColumns( _nColumn - m_nLeftColumn );
+ impl_scrollColumns( _nColumn - m_nLeftColumn );
else
{
TableSize nVisibleColumns = impl_getVisibleColumns( _bAcceptPartialVisibility );
if ( _nColumn > m_nLeftColumn + nVisibleColumns - 1 )
{
- impl_ni_ScrollColumns( _nColumn - ( m_nLeftColumn + nVisibleColumns - 1 ) );
+ impl_scrollColumns( _nColumn - ( m_nLeftColumn + nVisibleColumns - 1 ) );
// TODO: since not all columns have the same width, this might in theory result
// in the column still not being visible.
}
}
if ( _nRow < m_nTopRow )
- impl_ni_ScrollRows( _nRow - m_nTopRow );
+ impl_scrollRows( _nRow - m_nTopRow );
else
{
TableSize nVisibleRows = impl_getVisibleRows( _bAcceptPartialVisibility );
if ( _nRow > m_nTopRow + nVisibleRows - 1 )
- impl_ni_ScrollRows( _nRow - ( m_nTopRow + nVisibleRows - 1 ) );
+ impl_scrollRows( _nRow - ( m_nTopRow + nVisibleRows - 1 ) );
}
}
//--------------------------------------------------------------------
+ ::rtl::OUString TableControl_Impl::getCellContentAsString( RowPos const i_row, ColPos const i_col )
+ {
+ ::com::sun::star::uno::Any content;
+ m_pModel->getCellContent( i_col, i_row, content );
+ return CellValueConversion::convertToString( content );
+ }
+
+ //--------------------------------------------------------------------
TableSize TableControl_Impl::impl_ni_ScrollRows( TableSize _nRowDelta )
{
// compute new top row
@@ -1818,10 +2222,10 @@ namespace svt { namespace table
m_nTopRow = nNewTopRow;
// if updates are enabled currently, scroll the viewport
- if ( m_rAntiImpl.IsUpdateMode() && ( m_nTopRow != nOldTopRow ) )
+ if ( m_nTopRow != nOldTopRow )
{
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// TODO: call a onStartScroll at our listener (or better an own onStartScroll,
// which hides the cursor and then calls the listener)
// Same for onEndScroll
@@ -1844,43 +2248,68 @@ namespace svt { namespace table
m_pVScroll->SetThumbPos( m_nTopRow );
}
+ // The scroll bar availaility might change when we scrolled. This is because we do not hide
+ // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will
+ // be auto-hidden when it's scrolled back to pos 0.
+ if ( m_nTopRow == 0 )
+ m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) );
+
return (TableSize)( m_nTopRow - nOldTopRow );
}
//--------------------------------------------------------------------
+ TableSize TableControl_Impl::impl_scrollRows( TableSize const i_rowDelta )
+ {
+ DBG_CHECK_ME();
+ return impl_ni_ScrollRows( i_rowDelta );
+ }
+
+ //--------------------------------------------------------------------
TableSize TableControl_Impl::impl_ni_ScrollColumns( TableSize _nColumnDelta )
{
// compute new left column
- ColPos nNewLeftColumn =
+ const ColPos nNewLeftColumn =
::std::max(
::std::min( (ColPos)( m_nLeftColumn + _nColumnDelta ), (ColPos)( m_nColumnCount - 1 ) ),
(ColPos)0
);
- ColPos nOldLeftColumn = m_nLeftColumn;
+ const ColPos nOldLeftColumn = m_nLeftColumn;
m_nLeftColumn = nNewLeftColumn;
// if updates are enabled currently, scroll the viewport
- if ( m_rAntiImpl.IsUpdateMode() && ( m_nLeftColumn != nOldLeftColumn ) )
+ if ( m_nLeftColumn != nOldLeftColumn )
{
DBG_SUSPEND_INV( INV_SCROLL_POSITION );
- TempHideCursor aHideCursor( *this );
+ SuppressCursor aHideCursor( *this );
// TODO: call a onStartScroll at our listener (or better an own onStartScroll,
// which hides the cursor and then calls the listener)
// Same for onEndScroll
// scroll the view port, if possible
- Rectangle aDataArea( Point( m_nRowHeaderWidthPixel, 0 ), m_pDataWindow->GetOutputSizePixel() );
+ const Rectangle aDataArea( Point( m_nRowHeaderWidthPixel, 0 ), m_pDataWindow->GetOutputSizePixel() );
long nPixelDelta =
- ( m_nLeftColumn > 0 ? m_aAccColumnWidthsPixel[ m_nLeftColumn - 1 ] : 0 )
- - ( nOldLeftColumn > 0 ? m_aAccColumnWidthsPixel[ nOldLeftColumn - 1 ] : 0 );
+ m_aColumnWidths[ nOldLeftColumn ].getStart()
+ - m_aColumnWidths[ m_nLeftColumn ].getStart();
+
+ // update our column positions
+ // Do this *before* scrolling, as SCROLL_UPDATE will trigger a paint, which already needs the correct
+ // information in m_aColumnWidths
+ for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin();
+ colPos != m_aColumnWidths.end();
+ ++colPos
+ )
+ {
+ colPos->move( nPixelDelta );
+ }
+ // scroll the window content (if supported and possible), or invalidate the complete window
if ( m_pDataWindow->GetBackground().IsScrollable()
&& abs( nPixelDelta ) < aDataArea.GetWidth()
)
{
- m_pDataWindow->Scroll( (long)-nPixelDelta, 0, aDataArea, SCROLL_CLIP | SCROLL_UPDATE );
+ m_pDataWindow->Scroll( nPixelDelta, 0, aDataArea, SCROLL_CLIP | SCROLL_UPDATE );
}
else
m_pDataWindow->Invalidate( INVALIDATE_UPDATE );
@@ -1889,39 +2318,55 @@ namespace svt { namespace table
m_pHScroll->SetThumbPos( m_nLeftColumn );
}
+ // The scroll bar availaility might change when we scrolled. This is because we do not hide
+ // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will
+ // be auto-hidden when it's scrolled back to pos 0.
+ if ( m_nLeftColumn == 0 )
+ m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) );
+
return (TableSize)( m_nLeftColumn - nOldLeftColumn );
}
- //-------------------------------------------------------------------------------
- SelectionEngine* TableControl_Impl::getSelEngine()
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize TableControl_Impl::impl_scrollColumns( TableSize const i_columnDelta )
{
- return m_pSelEngine;
+ DBG_CHECK_ME();
+ return impl_ni_ScrollColumns( i_columnDelta );
}
- //-------------------------------------------------------------------------------
- TableDataWindow* TableControl_Impl::getDataWindow()
+
+ //------------------------------------------------------------------------------------------------------------------
+ SelectionEngine* TableControl_Impl::getSelEngine()
{
- return m_pDataWindow;
+ return m_pSelEngine;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
ScrollBar* TableControl_Impl::getHorzScrollbar()
{
return m_pHScroll;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
ScrollBar* TableControl_Impl::getVertScrollbar()
{
return m_pVScroll;
}
- //-------------------------------------------------------------------------------
- sal_Bool TableControl_Impl::isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current)
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::isRowSelected( RowPos i_row ) const
{
- return ::std::find(selectedRows.begin(),selectedRows.end(),current) != selectedRows.end();
+ return ::std::find( m_aSelectedRows.begin(), m_aSelectedRows.end(), i_row ) != m_aSelectedRows.end();
}
- //-------------------------------------------------------------------------------
- bool TableControl_Impl::isRowSelected(RowPos current)
+
+ //------------------------------------------------------------------------------------------------------------------
+ RowPos TableControl_Impl::getSelectedRowIndex( size_t const i_selectionIndex ) const
{
- return ::std::find(m_nRowSelected.begin(),m_nRowSelected.end(),current) != m_nRowSelected.end();
+ if ( i_selectionIndex < m_aSelectedRows.size() )
+ return m_aSelectedRows[ i_selectionIndex ];
+ return ROW_INVALID;
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
int TableControl_Impl::getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current)
{
std::vector<RowPos>::const_iterator it = ::std::find(selectedRows.begin(),selectedRows.end(),current);
@@ -1931,281 +2376,158 @@ namespace svt { namespace table
}
return -1;
}
- //-------------------------------------------------------------------------------
- bool TableControl_Impl::isTooltipActive()
- {
- return m_rAntiImpl.isTooltip();
- }
- //-------------------------------------------------------------------------------
- ::rtl::OUString& TableControl_Impl::setTooltip(const Point& rPoint )
+
+ //--------------------------------------------------------------------
+ ColPos TableControl_Impl::impl_getColumnForOrdinate( long const i_ordinate ) const
{
- ::rtl::OUString aTooltipText;
- RowPos current = getCurrentRow(rPoint);
- com::sun::star::uno::Sequence< sal_Int32 > cols = m_rAntiImpl.getColumnsForTooltip();
- com::sun::star::uno::Sequence< ::rtl::OUString > text = m_rAntiImpl.getTextForTooltip();
- if(text.getLength()==0 && cols.getLength()==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][m_nCurColumn];
- aTooltipText = convertToString(content);
- }
- else if(text.getLength() == 0)
- {
- for(int i=0; i<cols.getLength(); i++)
- {
- if(i==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText = convertToString(content);
- }
- else
- {
- aTooltipText+= ::rtl::OUString::createFromAscii("\n");
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText += convertToString(content);
- }
- }
- }
- else if(cols.getLength() == 0)
- {
- for(int i=0; i<text.getLength(); i++)
- {
- if(i==0)
- aTooltipText = text[i];
- else
- {
- aTooltipText+= ::rtl::OUString::createFromAscii("\n");
- aTooltipText+= text[i];
- }
- }
- }
- else
+ DBG_CHECK_ME();
+
+ if ( ( m_aColumnWidths.empty() ) || ( i_ordinate < 0 ) )
+ return COL_INVALID;
+
+ if ( i_ordinate < m_nRowHeaderWidthPixel )
+ return COL_ROW_HEADERS;
+
+ long const ordinate = i_ordinate - m_nRowHeaderWidthPixel;
+
+ ColumnPositions::const_iterator lowerBound = ::std::lower_bound(
+ m_aColumnWidths.begin(),
+ m_aColumnWidths.end(),
+ ordinate + 1,
+ ColumnInfoPositionLess()
+ );
+ if ( lowerBound == m_aColumnWidths.end() )
{
- int nCols = cols.getLength();
- int mText = text.getLength();
- if(nCols < mText )
- cols.realloc(mText);
- else if(mText < nCols)
- text.realloc(nCols);
- for(int i=0; i<cols.getLength(); i++)
- {
- if(i==0)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- aTooltipText = text[i] + convertToString(content);
- }
- else
- {
- aTooltipText+= ::rtl::OUString::createFromAscii("\n");
- aTooltipText+= text[i];
- if(nCols > i)
- {
- ::com::sun::star::uno::Any content = m_pModel->getCellContent()[current][cols[i]];
- ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >xGraphic;
- aTooltipText += convertToString(content);
- }
- }
- }
+ // point is *behind* the start of the last column ...
+ if ( ordinate < m_aColumnWidths.rbegin()->getEnd() )
+ // ... but still before its end
+ return m_nColumnCount - 1;
+ return COL_INVALID;
}
- return m_aTooltipText = aTooltipText;
+ return lowerBound - m_aColumnWidths.begin();
}
+
//--------------------------------------------------------------------
- void TableControl_Impl::resizeColumn(const Point& rPoint)
- {
- Pointer aNewPointer(POINTER_ARROW);
- int headerRowWidth = 0;
- if(m_pModel->hasRowHeaders())
- headerRowWidth = m_rAntiImpl.LogicToPixel( Size(m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- int resizingColumn=m_nCurColumn-m_nLeftColumn;
- PColumnModel pColumn = m_pModel->getColumnModel(m_nCurColumn);
- impl_ni_getAccVisibleColWidths();
- int newColWidth = m_aColumnWidthsPixel[m_nCurColumn];
- //make resize area for the separator wider
- int nLeft = m_aVisibleColumnWidthsPixel[resizingColumn]-4;
- //subtract 1 from m_aAccColumnWidthPixel because right border should be part of the current cell
- int nRight = m_aVisibleColumnWidthsPixel[resizingColumn]-1;
- if( rPoint.X()> nLeft && rPoint.X()<nRight && pColumn->isResizable())
- aNewPointer = Pointer( POINTER_HSPLIT );
- //MouseButton was pressed but not yet released, mouse is moving
- if(m_bResizing)
- {
- if(rPoint.X() > m_pDataWindow->GetOutputSizePixel().Width() || rPoint.X() < m_aVisibleColumnWidthsPixel[resizingColumn]-newColWidth)
- aNewPointer = Pointer( POINTER_NOTALLOWED);
- else
- aNewPointer = Pointer( POINTER_HSPLIT );
- m_pDataWindow->HideTracking();
- int lineHeight = 0;
- if(m_pModel->hasColumnHeaders())
- lineHeight+= m_nColHeaderHeightPixel;
- lineHeight+=m_nRowHeightPixel*m_nRowCount;
- int gridHeight = m_pDataWindow->GetOutputSizePixel().Height();
- if(lineHeight >= gridHeight)
- lineHeight = gridHeight;
- m_pDataWindow->ShowTracking(Rectangle(Point(rPoint.X(),0), Size(1, lineHeight )),
- SHOWTRACK_SPLIT | SHOWTRACK_WINDOW);
- }
- m_pDataWindow->SetPointer(aNewPointer);
+ RowPos TableControl_Impl::impl_getRowForAbscissa( long const i_abscissa ) const
+ {
+ DBG_CHECK_ME();
+
+ if ( i_abscissa < 0 )
+ return ROW_INVALID;
+
+ if ( i_abscissa < m_nColHeaderHeightPixel )
+ return ROW_COL_HEADERS;
+
+ long const abscissa = i_abscissa - m_nColHeaderHeightPixel;
+ long const row = m_nTopRow + abscissa / m_nRowHeightPixel;
+ return row < m_pModel->getRowCount() ? row : ROW_INVALID;
}
+
//--------------------------------------------------------------------
- bool TableControl_Impl::startResizeColumn(const Point& rPoint)
+ bool TableControl_Impl::markRowAsDeselected( RowPos const i_rowIndex )
{
- m_bResizingGrid = false;
- m_nResizingColumn = m_nCurColumn;
- PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn);
- //make resize area for the separator wider
- int nLeft = m_aVisibleColumnWidthsPixel[m_nResizingColumn-m_nLeftColumn]-4;
- int nRight = m_aVisibleColumnWidthsPixel[m_nResizingColumn-m_nLeftColumn]-1;
- if(rPoint.X()> nLeft && rPoint.X()<nRight && pColumn->isResizable())
- {
- m_pDataWindow->CaptureMouse();
- m_bResizing = true;
- }
- return m_bResizing;
+ DBG_CHECK_ME();
+
+ ::std::vector< RowPos >::iterator selPos = ::std::find( m_aSelectedRows.begin(), m_aSelectedRows.end(), i_rowIndex );
+ if ( selPos == m_aSelectedRows.end() )
+ return false;
+
+ m_aSelectedRows.erase( selPos );
+ return true;
}
+
//--------------------------------------------------------------------
- bool TableControl_Impl::endResizeColumn(const Point& rPoint)
- {
- if(m_bResizing)
- {
- m_pDataWindow->HideTracking();
- PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn);
- int maxWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMaxWidth(), 0 ), MAP_APPFONT ).Width();
- int minWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMinWidth(), 0 ), MAP_APPFONT ).Width();
- int resizeCol = m_nResizingColumn-m_nLeftColumn;
- //new position of mouse
- int actX = rPoint.X();
- //old position of right border
- int oldX = m_aVisibleColumnWidthsPixel[resizeCol];
- //position of left border if cursor in the first cell
- int leftX = 0;
- if(m_nResizingColumn > m_nLeftColumn)
- leftX = m_aVisibleColumnWidthsPixel[resizeCol-1];
- else if(m_nResizingColumn == m_nLeftColumn && m_pModel->hasRowHeaders())
- leftX = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- int actWidth = actX - leftX;
- int newActWidth = 0;
- //minimize the column width
- if(oldX > actX && actX >= leftX)
+ bool TableControl_Impl::markRowAsSelected( RowPos const i_rowIndex )
+ {
+ DBG_CHECK_ME();
+
+ if ( isRowSelected( i_rowIndex ) )
+ return false;
+
+ SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
+ switch ( eSelMode )
+ {
+ case SINGLE_SELECTION:
+ if ( !m_aSelectedRows.empty() )
{
- if(minWidth < actWidth)
- {
- newActWidth = m_rAntiImpl.PixelToLogic( Size( actWidth, 0 ), MAP_APPFONT ).Width();
- pColumn->setPreferredWidth(newActWidth);
- }
- else
- pColumn->setPreferredWidth(pColumn->getMinWidth());
- if(m_nLeftColumn != 0)
- impl_updateLeftColumn();
+ OSL_ENSURE( m_aSelectedRows.size() == 1, "TableControl::markRowAsSelected: SingleSelection with more than one selected element?" );
+ m_aSelectedRows[0] = i_rowIndex;
+ break;
+ }
+ // fall through
+
+ case MULTIPLE_SELECTION:
+ m_aSelectedRows.push_back( i_rowIndex );
+ break;
+
+ default:
+ OSL_ENSURE( false, "TableControl_Impl::markRowAsSelected: unsupported selection mode!" );
+ return false;
}
- else if(oldX < actX)
+
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ bool TableControl_Impl::markAllRowsAsDeselected()
+ {
+ if ( m_aSelectedRows.empty() )
+ return false;
+
+ m_aSelectedRows.clear();
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ bool TableControl_Impl::markAllRowsAsSelected()
+ {
+ DBG_CHECK_ME();
+
+ SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
+ ENSURE_OR_RETURN_FALSE( eSelMode == MULTIPLE_SELECTION, "TableControl_Impl::markAllRowsAsSelected: unsupported selection mode!" );
+
+ if ( m_aSelectedRows.size() == size_t( m_pModel->getRowCount() ) )
{
- if(actWidth < maxWidth)
+ #if OSL_DEBUG_LEVEL > 0
+ for ( TableSize row = 0; row < m_pModel->getRowCount(); ++row )
{
- newActWidth = m_rAntiImpl.PixelToLogic( Size( actWidth, 0 ), MAP_APPFONT ).Width();
- pColumn->setPreferredWidth(newActWidth);
+ OSL_ENSURE( isRowSelected( row ), "TableControl_Impl::markAllRowsAsSelected: inconsistency in the selected rows!" );
}
- else
- pColumn->setPreferredWidth(pColumn->getMaxWidth());
+ #endif
+ // already all rows marked as selected
+ return false;
}
- m_nCurColumn = m_nResizingColumn;
- impl_ni_updateColumnWidths();
- impl_ni_updateScrollbars();
- m_pDataWindow->Invalidate(INVALIDATE_UPDATE);
- m_pDataWindow->SetPointer(Pointer());
- m_bResizing = false;
- m_bResizingGrid = true;
- }
- m_pDataWindow->ReleaseMouse();
- return m_bResizing;
- }
- //-------------------------------------------------------------------------------
- void TableControl_Impl::impl_ni_getAccVisibleColWidths()
- {
- TableSize nVisCols = impl_getVisibleColumns(true);
- int widthsPixel = 0;
- m_aVisibleColumnWidthsPixel.resize(0);
- m_aVisibleColumnWidthsPixel.reserve(nVisCols);
- int headerRowWidth = 0;
- if(m_pModel->hasRowHeaders())
- {
- headerRowWidth = m_rAntiImpl.LogicToPixel( Size(m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- widthsPixel+=headerRowWidth;
- }
- int col = m_nLeftColumn;
- while(nVisCols)
- {
- m_aVisibleColumnWidthsPixel.push_back(widthsPixel+=m_aColumnWidthsPixel[col]);
- col++;
- nVisCols--;
- }
- }
- //-------------------------------------------------------------------------------
- void TableControl_Impl::impl_updateLeftColumn()
- {
- int nVisCols = m_aVisibleColumnWidthsPixel.size();
- int headerRowWidth = 0;
- //sum of currently visible columns
- int widthsPixel = 0;
- //header pixel should be added, because header doesn't vanish when scrolling
- if(m_pModel->hasRowHeaders())
- {
- headerRowWidth = m_rAntiImpl.LogicToPixel( Size(m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width();
- widthsPixel+=headerRowWidth;
- }
- int col = m_nLeftColumn;
- //add column width of the neighbour of the left column
- widthsPixel+=m_aColumnWidthsPixel[col-1];
- //compute the sum of the new column widths
- while(nVisCols)
- {
- PColumnModel pColumn = m_pModel->getColumnModel(col);
- int colWidth = pColumn->getWidth();
- int colPrefWidth = pColumn->getPreferredWidth();
- if(colPrefWidth!=0)
- colWidth = colPrefWidth;
- widthsPixel += m_rAntiImpl.LogicToPixel( Size( colWidth, 0 ), MAP_APPFONT ).Width();
- col++;
- nVisCols--;
- }
- //when the sum of all visible columns and the next to the left column is smaller than
- //window width, then update m_nLeftColumn
- if(widthsPixel<m_pDataWindow->GetOutputSizePixel().Width())
- m_nLeftColumn--;
+
+ m_aSelectedRows.clear();
+ for ( RowPos i=0; i < m_pModel->getRowCount(); ++i )
+ m_aSelectedRows.push_back(i);
+
+ return true;
}
+
//--------------------------------------------------------------------
- rtl::OUString TableControl_Impl::convertToString(const ::com::sun::star::uno::Any& value)
- {
- sal_Int32 nInt = 0;
- sal_Bool bBool = false;
- double fDouble = 0;
- ::rtl::OUString sNewString;
- ::rtl::OUString sConvertString;
- if(value >>= sConvertString)
- sNewString = sConvertString;
- else if(value >>= nInt)
- sNewString = sConvertString.valueOf(nInt);
- else if(value >>= bBool)
- sNewString = sConvertString.valueOf(bBool);
- else if(value >>= fDouble)
- sNewString = sConvertString.valueOf(fDouble);
- return sNewString;
- }
Rectangle TableControl_Impl::calcHeaderRect(bool bColHeader)
{
- Rectangle aRectTable, aRectTableWithHeaders;
- impl_getAllVisibleDataCellArea(aRectTable);
- impl_getAllVisibleCellsArea(aRectTableWithHeaders);
- Size aSizeTable(aRectTable.GetSize());
- Size aSizeTableWithHeaders(aRectTableWithHeaders.GetSize());
- if(bColHeader)
- return Rectangle(aRectTableWithHeaders.TopLeft(),Size(aSizeTableWithHeaders.Width()-aSizeTable.Width(), aSizeTableWithHeaders.Height()));
+ Rectangle const aRectTableWithHeaders( impl_getAllVisibleCellsArea() );
+ Size const aSizeTableWithHeaders( aRectTableWithHeaders.GetSize() );
+ if ( bColHeader )
+ return Rectangle( aRectTableWithHeaders.TopLeft(), Size( aSizeTableWithHeaders.Width(), m_nColHeaderHeightPixel ) );
else
- return Rectangle(aRectTableWithHeaders.TopLeft(),Size(aSizeTableWithHeaders.Width(), aSizeTableWithHeaders.Height()-aSizeTable.Height()));
+ return Rectangle( aRectTableWithHeaders.TopLeft(), Size( m_nRowHeaderWidthPixel, aSizeTableWithHeaders.Height() ) );
}
+
+ //--------------------------------------------------------------------
Rectangle TableControl_Impl::calcTableRect()
{
- Rectangle aRect;
- impl_getAllVisibleDataCellArea(aRect);
- return aRect;
+ return impl_getAllVisibleDataCellArea();
+ }
+
+ //--------------------------------------------------------------------
+ IMPL_LINK( TableControl_Impl, OnUpdateScrollbars, void*, /**/ )
+ {
+ DBG_CHECK_ME();
+ impl_ni_updateScrollbars();
+ return 1L;
}
//--------------------------------------------------------------------
@@ -2221,157 +2543,200 @@ namespace svt { namespace table
return 0L;
}
- //---------------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > TableControl_Impl::getAccessible( Window& i_parentWindow )
+ {
+ DBG_TESTSOLARMUTEX();
+ if ( m_pAccessibleTable == NULL )
+ {
+ Reference< XAccessible > const xAccParent = i_parentWindow.GetAccessible();
+ if ( xAccParent.is() )
+ {
+ m_pAccessibleTable = m_aFactoryAccess.getFactory().createAccessibleTableControl(
+ xAccParent, m_rAntiImpl
+ );
+ }
+ }
+
+ Reference< XAccessible > xAccessible;
+ if ( m_pAccessibleTable )
+ xAccessible = m_pAccessibleTable->getMyself();
+ return xAccessible;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::disposeAccessible()
+ {
+ if ( m_pAccessibleTable )
+ m_pAccessibleTable->dispose();
+ m_pAccessibleTable = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableControl_Impl::impl_isAccessibleAlive() const
+ {
+ DBG_CHECK_ME();
+ return ( NULL != m_pAccessibleTable ) && m_pAccessibleTable->isAlive();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableControl_Impl::impl_commitAccessibleEvent( sal_Int16 const i_eventID, Any const & i_newValue, Any const & i_oldValue )
+ {
+ DBG_CHECK_ME();
+ if ( impl_isAccessibleAlive() )
+ m_pAccessibleTable->commitEvent( i_eventID, i_newValue, i_oldValue );
+ }
+
+ //==================================================================================================================
+ //= TableFunctionSet
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
TableFunctionSet::TableFunctionSet(TableControl_Impl* _pTableControl)
:m_pTableControl( _pTableControl)
- ,m_nCurrentRow (-2)
+ ,m_nCurrentRow( ROW_INVALID )
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
TableFunctionSet::~TableFunctionSet()
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::BeginDrag()
{
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::CreateAnchor()
{
- m_pTableControl->m_nAnchor = m_pTableControl->m_nCurRow;
+ m_pTableControl->setAnchor( m_pTableControl->getCurRow() );
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DestroyAnchor()
{
- m_pTableControl->m_nAnchor = -1;
+ m_pTableControl->setAnchor( ROW_INVALID );
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
sal_Bool TableFunctionSet::SetCursorAtPoint(const Point& rPoint, sal_Bool bDontSelectAtCursor)
{
sal_Bool bHandled = sal_False;
- Rectangle rCells;
- //curRow is the row where the mouse click happened, m_nCurRow is the last selected row, before the mouse click
- RowPos curRow = m_pTableControl->getCurrentRow(rPoint);
- if(curRow == -2)
+ // newRow is the row which includes the point, getCurRow() is the last selected row, before the mouse click
+ RowPos newRow = m_pTableControl->getRowAtPoint( rPoint );
+ if ( newRow == ROW_COL_HEADERS )
+ newRow = m_pTableControl->getTopRow();
+
+ ColPos newCol = m_pTableControl->getColAtPoint( rPoint );
+ if ( newCol == COL_ROW_HEADERS )
+ newCol = m_pTableControl->getLeftColumn();
+
+ if ( ( newRow == ROW_INVALID ) || ( newCol == COL_INVALID ) )
return sal_False;
- if( bDontSelectAtCursor )
+
+ if ( bDontSelectAtCursor )
{
- if(m_pTableControl->m_nRowSelected.size()>1)
- m_pTableControl->m_pSelEngine->AddAlways(sal_True);
+ if ( m_pTableControl->getSelectedRowCount() > 1 )
+ m_pTableControl->getSelEngine()->AddAlways(sal_True);
bHandled = sal_True;
}
- else if(m_pTableControl->m_nAnchor == m_pTableControl->m_nCurRow)
+ else if ( m_pTableControl->getAnchor() == m_pTableControl->getCurRow() )
{
//selecting region,
- int diff = m_pTableControl->m_nCurRow - curRow;
+ int diff = m_pTableControl->getCurRow() - newRow;
//selected region lies above the last selection
if( diff >= 0)
{
//put selected rows in vector
- while(m_pTableControl->m_nAnchor>=curRow)
+ while ( m_pTableControl->getAnchor() >= newRow )
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, m_pTableControl->m_nAnchor);
- //if row isn't selected, put it in vector, otherwise don't put it there, because it will be twice there
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(m_pTableControl->m_nAnchor);
- m_pTableControl->m_nAnchor--;
+ m_pTableControl->markRowAsSelected( m_pTableControl->getAnchor() );
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() - 1 );
diff--;
}
- m_pTableControl->m_nAnchor++;
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() + 1 );
}
//selected region lies beneath the last selected row
else
{
- while(m_pTableControl->m_nAnchor<=curRow)
+ while ( m_pTableControl->getAnchor() <= newRow )
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, m_pTableControl->m_nAnchor);
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(m_pTableControl->m_nAnchor);
- m_pTableControl->m_nAnchor++;
+ m_pTableControl->markRowAsSelected( m_pTableControl->getAnchor() );
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() + 1 );
diff++;
}
- m_pTableControl->m_nAnchor--;
+ m_pTableControl->setAnchor( m_pTableControl->getAnchor() - 1 );
}
- m_pTableControl->invalidateSelectedRegion(m_pTableControl->m_nCurRow, curRow, rCells);
+ Rectangle aCellRect;
+ m_pTableControl->invalidateSelectedRegion( m_pTableControl->getCurRow(), newRow, aCellRect );
bHandled = sal_True;
}
//no region selected
else
{
- if(m_pTableControl->m_nRowSelected.empty())
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ if ( !m_pTableControl->hasRowSelection() )
+ m_pTableControl->markRowAsSelected( newRow );
else
{
- if(m_pTableControl->m_pSelEngine->GetSelectionMode()==SINGLE_SELECTION)
+ if ( m_pTableControl->getSelEngine()->GetSelectionMode() == SINGLE_SELECTION )
{
DeselectAll();
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ m_pTableControl->markRowAsSelected( newRow );
}
else
{
- bool isAlreadySelected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, curRow);
- if(!isAlreadySelected)
- m_pTableControl->m_nRowSelected.push_back(curRow);
+ m_pTableControl->markRowAsSelected( newRow );
}
}
- if(m_pTableControl->m_nRowSelected.size()>1 && m_pTableControl->m_pSelEngine->GetSelectionMode()!=SINGLE_SELECTION)
- m_pTableControl->m_pSelEngine->AddAlways(sal_True);
- m_pTableControl->invalidateSelectedRegion(curRow, curRow, rCells);
+ if ( m_pTableControl->getSelectedRowCount() > 1 && m_pTableControl->getSelEngine()->GetSelectionMode() != SINGLE_SELECTION )
+ m_pTableControl->getSelEngine()->AddAlways(sal_True);
+
+ Rectangle aCellRect;
+ m_pTableControl->invalidateSelectedRegion( newRow, newRow, aCellRect );
bHandled = sal_True;
}
- m_pTableControl->m_nCurRow = curRow;
- m_pTableControl->ensureVisible(m_pTableControl->m_nCurColumn,m_pTableControl->m_nCurRow,false);
+ m_pTableControl->goTo( newCol, newRow );
return bHandled;
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
sal_Bool TableFunctionSet::IsSelectionAtPoint( const Point& rPoint )
{
- m_pTableControl->m_pSelEngine->AddAlways(sal_False);
- if(m_pTableControl->m_nRowSelected.empty())
+ m_pTableControl->getSelEngine()->AddAlways(sal_False);
+ if ( !m_pTableControl->hasRowSelection() )
return sal_False;
else
{
- RowPos curRow = m_pTableControl->getCurrentRow(rPoint);
- m_pTableControl->m_nAnchor = -1;
- bool selected = m_pTableControl->isRowSelected(m_pTableControl->m_nRowSelected, curRow);
+ RowPos curRow = m_pTableControl->getRowAtPoint( rPoint );
+ m_pTableControl->setAnchor( ROW_INVALID );
+ bool selected = m_pTableControl->isRowSelected( curRow );
m_nCurrentRow = curRow;
return selected;
}
}
- //-------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DeselectAtPoint( const Point& rPoint )
{
(void)rPoint;
- long pos = 0;
- long i = 0;
- Rectangle rCells;
- for(std::vector<RowPos>::iterator it=m_pTableControl->m_nRowSelected.begin();
- it!=m_pTableControl->m_nRowSelected.end();++it)
- {
- if(*it == m_nCurrentRow)
- {
- pos = i;
- m_pTableControl->invalidateSelectedRegion(*it, *it, rCells);
- }
- ++i;
- }
- m_pTableControl->m_nRowSelected.erase(m_pTableControl->m_nRowSelected.begin()+pos);
+ Rectangle aCellRange;
+ m_pTableControl->invalidateSelectedRegion( m_nCurrentRow, m_nCurrentRow, aCellRange );
+ m_pTableControl->markRowAsDeselected( m_nCurrentRow );
}
- //-------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableFunctionSet::DeselectAll()
{
- if(!m_pTableControl->m_nRowSelected.empty())
+ if ( m_pTableControl->hasRowSelection() )
{
- Rectangle rCells;
- for(std::vector<RowPos>::iterator it=m_pTableControl->m_nRowSelected.begin();
- it!=m_pTableControl->m_nRowSelected.end();++it)
+ Rectangle aCellRange;
+ for ( size_t i=0; i<m_pTableControl->getSelectedRowCount(); ++i )
{
- m_pTableControl->invalidateSelectedRegion(*it, *it, rCells);
+ RowPos const rowIndex = m_pTableControl->getSelectedRowIndex(i);
+ m_pTableControl->invalidateSelectedRegion( rowIndex, rowIndex, aCellRange );
}
- m_pTableControl->m_nRowSelected.clear();
+
+ m_pTableControl->markAllRowsAsDeselected();
}
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx
index c0604be15cdb..bc1ac55fbe51 100644..100755
--- a/svtools/source/table/tablecontrol_impl.hxx
+++ b/svtools/source/table/tablecontrol_impl.hxx
@@ -27,18 +27,16 @@
#ifndef SVTOOLS_TABLECONTROL_IMPL_HXX
#define SVTOOLS_TABLECONTROL_IMPL_HXX
-#ifndef SVTOOLS_INC_TABLE_TABLEMODEL_HXX
-#include <svtools/table/tablemodel.hxx>
-#endif
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrolinterface.hxx"
-#ifndef SVTOOLS_INC_TABLE_ABSTRACTTABLECONTROL_HXX
-#include <svtools/table/abstracttablecontrol.hxx>
-#endif
+#include "svtaccessiblefactory.hxx"
-#include <svtools/table/tablemodel.hxx>
-#include <vector>
#include <vcl/seleng.hxx>
+#include <vector>
+
+#include <boost/scoped_ptr.hpp>
class ScrollBar;
class ScrollBarBox;
@@ -48,7 +46,42 @@ namespace svt { namespace table
{
//........................................................................
- typedef ::std::vector< long > ArrayOfLong;
+ struct MutableColumnMetrics : protected ColumnMetrics
+ {
+ MutableColumnMetrics()
+ :ColumnMetrics()
+ {
+ }
+
+ MutableColumnMetrics( long const i_startPixel, long const i_endPixel )
+ :ColumnMetrics( i_startPixel, i_endPixel )
+ {
+ }
+
+ long getStart() const { return nStartPixel; }
+ long getEnd() const { return nEndPixel; }
+
+ void setEnd( long const i_end ) { nEndPixel = i_end; }
+ void move( long const i_offset ) { nStartPixel += i_offset; nEndPixel += i_offset; }
+
+ long getWidth() const { return nEndPixel - nStartPixel; }
+
+ ColumnMetrics const & operator()() { return *this; }
+ };
+
+ struct ColumnInfoPositionLess
+ {
+ bool operator()( MutableColumnMetrics const& i_colInfo, long const i_position )
+ {
+ return i_colInfo.getEnd() < i_position;
+ }
+ bool operator()( long const i_position, MutableColumnMetrics const& i_colInfo )
+ {
+ return i_position < i_colInfo.getStart();
+ }
+ };
+
+ typedef ::std::vector< MutableColumnMetrics > ColumnPositions;
class TableControl;
class TableDataWindow;
@@ -57,13 +90,14 @@ namespace svt { namespace table
//====================================================================
//= TableControl_Impl
//====================================================================
- class TableControl_Impl : public IAbstractTableControl
+ class TableControl_Impl :public ITableControl
+ ,public ITableModelListener
{
friend class TableGeometry;
friend class TableRowGeometry;
friend class TableColumnGeometry;
friend class SuspendInvariants;
- friend class TableFunctionSet;
+
private:
/// the control whose impl-instance we implemnt
TableControl& m_rAntiImpl;
@@ -71,14 +105,9 @@ namespace svt { namespace table
PTableModel m_pModel;
/// the input handler to use, usually the input handler as provided by ->m_pModel
PTableInputHandler m_pInputHandler;
- /// the widths of the single columns, measured in pixel
- ArrayOfLong m_aColumnWidthsPixel;
- /** the accumulated widths of the single columns, i.e. their exclusive right borders,
- <strong<not</strong> counting the space for a possible row header column
- */
- ArrayOfLong m_aAccColumnWidthsPixel;
+ /// info about the widths of our columns
+ ColumnPositions m_aColumnWidths;
- ArrayOfLong m_aVisibleColumnWidthsPixel;
/// the height of a single row in the table, measured in pixels
long m_nRowHeightPixel;
/// the height of the column header row in the table, measured in pixels
@@ -88,9 +117,13 @@ namespace svt { namespace table
/// the number of columns in the table control. Cached model value.
TableSize m_nColumnCount;
+
/// the number of rows in the table control. Cached model value.
TableSize m_nRowCount;
+ /// denotes whether or not the columns fitted into the available width, last time we checked
+ long m_bColumnsFit;
+
ColPos m_nCurColumn;
RowPos m_nCurRow;
ColPos m_nLeftColumn;
@@ -103,24 +136,27 @@ namespace svt { namespace table
The window's upper left corner is at position (0,0), relative to the
table control, which is the direct parent of the data window.
*/
- TableDataWindow* m_pDataWindow;
+ ::boost::scoped_ptr< TableDataWindow >
+ m_pDataWindow;
/// the vertical scrollbar, if any
ScrollBar* m_pVScroll;
/// the horizontal scrollbar, if any
- ScrollBar* m_pHScroll;
+ ScrollBar* m_pHScroll;
ScrollBarBox* m_pScrollCorner;
- //selection engine - for determining selection range, e.g. single, multiple
- SelectionEngine* m_pSelEngine;
- //vector which contains the selected rows
- std::vector<RowPos> m_nRowSelected;
- //part of selection engine
- TableFunctionSet* m_pTableFunctionSet;
- //part of selection engine
- RowPos m_nAnchor;
- bool m_bResizing;
- ColPos m_nResizingColumn;
- bool m_bResizingGrid;
- rtl::OUString m_aTooltipText;
+ //selection engine - for determining selection range, e.g. single, multiple
+ SelectionEngine* m_pSelEngine;
+ //vector which contains the selected rows
+ std::vector<RowPos> m_aSelectedRows;
+ //part of selection engine
+ TableFunctionSet* m_pTableFunctionSet;
+ //part of selection engine
+ RowPos m_nAnchor;
+ bool m_bUpdatingColWidths;
+
+ Link m_aSelectHdl;
+
+ AccessibleFactoryAccess m_aFactoryAccess;
+ IAccessibleTableControl* m_pAccessibleTable;
#if DBG_UTIL
#define INV_SCROLL_POSITION 1
@@ -133,21 +169,18 @@ namespace svt { namespace table
#endif
public:
-
-
- PTableModel getModel() const;
void setModel( PTableModel _pModel );
inline const PTableInputHandler& getInputHandler() const { return m_pInputHandler; }
- inline ColPos getCurColumn() const { return m_nCurColumn; }
- inline RowPos getCurRow() const { return m_nCurRow; }
- inline void setCurRow(RowPos curRow){ m_nCurRow = curRow; }
- inline RowPos getTopRow() const { return m_nTopRow; }
- inline long getRowCount() const { return m_nRowCount; }
- inline long getColumnCount() const { return m_nColumnCount; }
+ inline RowPos getCurRow() const { return m_nCurRow; }
+ inline void setCurRow( RowPos i_curRow ){ m_nCurRow = i_curRow; }
- inline long getColHeaderHightPixel() const { return m_nColHeaderHeightPixel; }
+ RowPos getAnchor() const { return m_nAnchor; }
+ void setAnchor( RowPos const i_anchor ) { m_nAnchor = i_anchor; }
+
+ inline RowPos getTopRow() const { return m_nTopRow; }
+ inline ColPos getLeftColumn() const { return m_nLeftColumn; }
inline const TableControl& getAntiImpl() const { return m_rAntiImpl; }
inline TableControl& getAntiImpl() { return m_rAntiImpl; }
@@ -185,45 +218,115 @@ namespace svt { namespace table
<TRUE/> if it's okay that the given cooordinate is only partially visible
*/
void ensureVisible( ColPos _nColumn, RowPos _nRow, bool _bAcceptPartialVisibility );
- /** returns the row, which contains the input point*/
- virtual RowPos getCurrentRow (const Point& rPoint);
-
- void setCursorAtCurrentCell(const Point& rPoint);
- /** checks whether the vector with the selected rows contains the current row*/
- sal_Bool isRowSelected(const ::std::vector<RowPos>& selectedRows, RowPos current);
-
- bool isRowSelected(RowPos current);
- /** returns the position of the current row in the selection vector */
- int getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current);
- /** _rCellRect contains the region, which should be invalidate after some action e.g. selecting row*/
- void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect );
- /** to be called when a new row is added to the control*/
- void invalidateRow(RowPos _nRowPos, Rectangle& _rCellRect );
- /** returns the vector, which contains the selected rows*/
- std::vector<RowPos>& getSelectedRows();
- /** updates the vector, which contains the selected rows after removing the row nRowPos*/
- void removeSelectedRow(RowPos _nRowPos);
- void invalidateRows();
- void clearSelection();
- // IAbstractTableControl
- virtual void hideCursor();
- virtual void showCursor();
- virtual bool dispatchAction( TableControlAction _eAction );
- virtual SelectionEngine* getSelEngine();
- virtual bool isTooltipActive();
- virtual rtl::OUString& setTooltip(const Point& rPoint );
- virtual void resizeColumn(const Point& rPoint);
- virtual bool startResizeColumn(const Point& rPoint);
- virtual bool endResizeColumn(const Point& rPoint);
-
- TableDataWindow* getDataWindow();
- ScrollBar* getHorzScrollbar();
- ScrollBar* getVertScrollbar();
-
- ::rtl::OUString convertToString(const ::com::sun::star::uno::Any& _value);
- Rectangle calcHeaderRect(bool bColHeader);
- Rectangle calcTableRect();
+
+ /** retrieves the content of the given cell, converted to a string
+ */
+ ::rtl::OUString getCellContentAsString( RowPos const i_row, ColPos const i_col );
+
+ /** returns the position of the current row in the selection vector */
+ int getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current);
+
+ /** _rCellRect contains the region, which should be invalidate after some action e.g. selecting row*/
+ void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect );
+
+ /** invalidates the part of the data window which is covered by the given row
+ @param i_firstRow
+ the index of the first row to include in the invalidation
+ @param i_lastRow
+ the index of the last row to include in the invalidation, or ROW_INVALID if the invalidation
+ should happen down to the bottom of the data window.
+ */
+ void invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow );
+
+ void checkCursorPosition();
+
+ bool hasRowSelection() const { return !m_aSelectedRows.empty(); }
+ size_t getSelectedRowCount() const { return m_aSelectedRows.size(); }
+ RowPos getSelectedRowIndex( size_t const i_selectionIndex ) const;
+
+ /** removes the given row index from m_aSelectedRows
+
+ @return
+ <TRUE/> if and only if the row was previously marked as selected
+ */
+ bool markRowAsDeselected( RowPos const i_rowIndex );
+
+ /** marks the given row as selectged, by putting it into m_aSelectedRows
+ @return
+ <TRUE/> if and only if the row was previously <em>not</em> marked as selected
+ */
+ bool markRowAsSelected( RowPos const i_rowIndex );
+
+ /** marks all rows as deselected
+ @return
+ <TRUE/> if and only if the selection actually changed by this operation
+ */
+ bool markAllRowsAsDeselected();
+
+ /** marks all rows as selected
+ @return
+ <FALSE/> if and only if all rows were selected already.
+ */
+ bool markAllRowsAsSelected();
+
+ void setSelectHandler( Link const & i_selectHandler ) { m_aSelectHdl = i_selectHandler; }
+ Link const& getSelectHandler() const { return m_aSelectHdl; }
+
+ // ITableControl
+ virtual void hideCursor();
+ virtual void showCursor();
+ virtual bool dispatchAction( TableControlAction _eAction );
+ virtual SelectionEngine* getSelEngine();
+ virtual PTableModel getModel() const;
+ virtual ColPos getCurrentColumn() const;
+ virtual RowPos getCurrentRow() const;
+ virtual bool activateCell( ColPos const i_col, RowPos const i_row );
+ virtual ::Size getTableSizePixel() const;
+ virtual void setPointer( Pointer const & i_pointer );
+ virtual void captureMouse();
+ virtual void releaseMouse();
+ virtual void invalidate( TableArea const i_what );
+ virtual long pixelWidthToAppFont( long const i_pixels ) const;
+ virtual void hideTracking();
+ virtual void showTracking( Rectangle const & i_location, sal_uInt16 const i_flags );
+ virtual RowPos getRowAtPoint( const Point& rPoint ) const;
+ virtual ColPos getColAtPoint( const Point& rPoint ) const;
+ virtual TableCell hitTest( const Point& rPoint ) const;
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const;
+ virtual bool isRowSelected( RowPos i_row ) const;
+
+
+ TableDataWindow& getDataWindow() { return *m_pDataWindow; }
+ const TableDataWindow& getDataWindow() const { return *m_pDataWindow; }
+ ScrollBar* getHorzScrollbar();
+ ScrollBar* getVertScrollbar();
+
+ Rectangle calcHeaderRect(bool bColHeader);
+ Rectangle calcTableRect();
+
+ // A11Y
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ getAccessible( Window& i_parentWindow );
+ void disposeAccessible();
+
+ // ITableModelListener
+ virtual void rowsInserted( RowPos first, RowPos last );
+ virtual void rowsRemoved( RowPos first, RowPos last );
+ virtual void columnInserted( ColPos const i_colIndex );
+ virtual void columnRemoved( ColPos const i_colIndex );
+ virtual void allColumnsRemoved();
+ virtual void cellsUpdated( ColPos const i_firstCol, ColPos i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow );
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup );
+ virtual void tableMetricsChanged();
+
private:
+ bool impl_isAccessibleAlive() const;
+ void impl_commitAccessibleEvent(
+ sal_Int16 const i_eventID,
+ ::com::sun::star::uno::Any const & i_newValue,
+ ::com::sun::star::uno::Any const & i_oldValue
+ );
+
/** toggles the cursor visibility
The method is not bound to the classes public invariants, as it's used in
@@ -251,7 +354,7 @@ namespace svt { namespace table
specifies whether a possible only partially visible last row is
counted, too.
*/
- TableSize impl_getVisibleColumns( bool _bAcceptPartialRow ) const;
+ TableSize impl_getVisibleColumns( bool _bAcceptPartialCol ) const;
/** determines the rectangle occupied by the given cell
*/
@@ -264,15 +367,20 @@ namespace svt { namespace table
*/
void impl_ni_updateCachedModelValues();
- /** updates ->m_aColumnWidthsPixel with the current pixel widths of all model columns
+ /** updates the cached table metrics (row height etc.)
+ */
+ void impl_ni_updateCachedTableMetrics();
- The method takes into account the current zoom factor and map mode of the table
- control, plus any possible COLWIDTH_FIT_TO_VIEW widths in the model columns.
+ /** updates ->m_aColumnWidthsPixel with the current pixel widths of all model columns
The method is not bound to the classes public invariants, as it's used in
situations where the they must not necessarily be fullfilled.
+
+ @param i_assumeInflexibleColumnsUpToIncluding
+ the index of a column up to which all columns should be considered as inflexible, or
+ <code>COL_INVALID</code>.
*/
- void impl_ni_updateColumnWidths();
+ void impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding = COL_INVALID );
/** updates the scrollbars of the control
@@ -296,6 +404,10 @@ namespace svt { namespace table
*/
TableSize impl_ni_ScrollRows( TableSize _nRowDelta );
+ /** equivalent to impl_ni_ScrollRows, but checks the instances invariants beforehand (in a non-product build only)
+ */
+ TableSize impl_scrollRows( TableSize const i_rowDelta );
+
/** scrolls the view by the given number of columns
The method is not bound to the classes public invariants, as it's used in
@@ -306,8 +418,13 @@ namespace svt { namespace table
from the given numbers to scroll in case the begin or the end of the
column range were reached.
*/
- TableSize impl_ni_ScrollColumns( TableSize _nRowDelta );
- /** retrieves the area occupied by the totality of (at least partially) visible cells
+ TableSize impl_ni_ScrollColumns( TableSize _nColumnDelta );
+
+ /** equivalent to impl_ni_ScrollColumns, but checks the instances invariants beforehand (in a non-product build only)
+ */
+ TableSize impl_scrollColumns( TableSize const i_columnDelta );
+
+ /** retrieves the area occupied by the totality of (at least partially) visible cells
The returned area includes row and column headers. Also, it takes into
account the the fact that there might be less columns than would normally
@@ -316,27 +433,37 @@ namespace svt { namespace table
As a result of respecting the partial visibility of rows and columns,
the returned area might be larger than the data window's output size.
*/
- void impl_getAllVisibleCellsArea( Rectangle& _rCellArea ) const;
+ Rectangle impl_getAllVisibleCellsArea() const;
/** retrieves the area occupied by all (at least partially) visible data cells.
Effectively, the returned area is the same as returned by ->impl_getAllVisibleCellsArea,
minus the row and column header areas.
*/
- void impl_getAllVisibleDataCellArea( Rectangle& _rCellArea ) const;
+ Rectangle impl_getAllVisibleDataCellArea() const;
+
+ /** retrieves the column which covers the given ordinate
+ */
+ ColPos impl_getColumnForOrdinate( long const i_ordinate ) const;
- void impl_ni_getAccVisibleColWidths();
- void impl_updateLeftColumn();
+ /** retrieves the row which covers the given abscissa
+ */
+ RowPos impl_getRowForAbscissa( long const i_abscissa ) const;
+
+ /// invalidates the window area occupied by the given column
+ void impl_invalidateColumn( ColPos const i_column );
DECL_LINK( OnScroll, ScrollBar* );
+ DECL_LINK( OnUpdateScrollbars, void* );
};
+
//see seleng.hxx, seleng.cxx, FunctionSet overridables, part of selection engine
class TableFunctionSet : public FunctionSet
{
- friend class TableDataWindow;
private:
- TableControl_Impl* m_pTableControl;
- RowPos m_nCurrentRow;
+ TableControl_Impl* m_pTableControl;
+ RowPos m_nCurrentRow;
+
public:
TableFunctionSet(TableControl_Impl* _pTableControl);
virtual ~TableFunctionSet();
diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx
index bbd7f6829369..11605e36c8b2 100644
--- a/svtools/source/table/tabledatawindow.cxx
+++ b/svtools/source/table/tabledatawindow.cxx
@@ -28,23 +28,31 @@
#include "precompiled_svtools.hxx"
#include "svtools/table/tablecontrol.hxx"
-#include "svtools/table/tabledatawindow.hxx"
+
+#include "tabledatawindow.hxx"
#include "tablecontrol_impl.hxx"
+#include "tablegeometry.hxx"
+#include "cellvalueconversion.hxx"
+
#include <vcl/help.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
- class TableControl_Impl;
-//........................................................................
+//......................................................................................................................
- //====================================================================
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
//= TableDataWindow
- //====================================================================
- //--------------------------------------------------------------------
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
TableDataWindow::TableDataWindow( TableControl_Impl& _rTableControl )
:Window( &_rTableControl.getAntiImpl() )
- ,m_rTableControl ( _rTableControl )
+ ,m_rTableControl( _rTableControl )
+ ,m_nTipWindowHandle( 0 )
{
// by default, use the background as determined by the style settings
const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() );
@@ -52,105 +60,164 @@ namespace svt { namespace table
SetFillColor( aWindowColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ TableDataWindow::~TableDataWindow()
+ {
+ impl_hideTipWindow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::Paint( const Rectangle& rUpdateRect )
{
m_rTableControl.doPaintContent( rUpdateRect );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetBackground( const Wallpaper& rColor )
{
Window::SetBackground( rColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetControlBackground( const Color& rColor )
{
Window::SetControlBackground( rColor );
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetBackground()
{
Window::SetBackground();
}
- //--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::SetControlBackground()
{
Window::SetControlBackground();
}
- //--------------------------------------------------------------------
- void TableDataWindow::MouseMove( const MouseEvent& rMEvt )
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::RequestHelp( const HelpEvent& rHEvt )
{
- Point aPoint = rMEvt.GetPosPixel();
- if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) )
+ sal_uInt16 const nHelpMode = rHEvt.GetMode();
+ if ( ( IsMouseCaptured() )
+ || ( ( nHelpMode & HELPMODE_QUICK ) == 0 )
+ )
+ {
+ Window::RequestHelp( rHEvt );
+ return;
+ }
+
+ ::rtl::OUString sHelpText;
+ sal_uInt16 nHelpStyle = 0;
+
+ Point const aMousePos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ RowPos const hitRow = m_rTableControl.getRowAtPoint( aMousePos );
+ ColPos const hitCol = m_rTableControl.getColAtPoint( aMousePos );
+
+ PTableModel const pTableModel( m_rTableControl.getModel() );
+ if ( ( hitCol >= 0 ) && ( hitCol < pTableModel->getColumnCount() ) )
{
- if(m_rTableControl.getCurrentRow(aPoint)>=0 && m_rTableControl.isTooltipActive() )
+ if ( hitRow == ROW_COL_HEADERS )
{
- SetPointer(POINTER_ARROW);
- rtl::OUString& rHelpText = m_rTableControl.setTooltip(aPoint);
- Help::EnableBalloonHelp();
- Window::SetHelpText( rHelpText.getStr());
+ sHelpText = pTableModel->getColumnModel( hitCol )->getHelpText();
}
- else if(m_rTableControl.getCurrentRow(aPoint) == -1)
+ else if ( ( hitRow >= 0 ) && ( hitRow < pTableModel->getRowCount() ) )
{
- if(Help::IsBalloonHelpEnabled())
- Help::DisableBalloonHelp();
- m_rTableControl.resizeColumn(aPoint);
+ Any aCellToolTip;
+ pTableModel->getCellToolTip( hitCol, hitRow, aCellToolTip );
+ if ( !aCellToolTip.hasValue() )
+ {
+ // use the cell content
+ pTableModel->getCellContent( hitCol, hitRow, aCellToolTip );
+
+ // use the cell content as tool tip only if it doesn't fit into the cell.
+ bool const activeCell = ( hitRow == m_rTableControl.getCurrentRow() ) && ( hitCol == m_rTableControl.getCurrentColumn() );
+ bool const selectedCell = m_rTableControl.isRowSelected( hitRow );
+
+ Rectangle const aWindowRect( Point( 0, 0 ), GetOutputSizePixel() );
+ TableCellGeometry const aCell( m_rTableControl, aWindowRect, hitCol, hitRow );
+ Rectangle const aCellRect( aCell.getRect() );
+
+ PTableRenderer const pRenderer = pTableModel->getRenderer();
+ if ( pRenderer->FitsIntoCell( aCellToolTip, hitCol, hitRow, activeCell, selectedCell, *this, aCellRect ) )
+ aCellToolTip.clear();
+ }
+
+ sHelpText = CellValueConversion::convertToString( aCellToolTip );
+
+ if ( sHelpText.indexOf( '\n' ) >= 0 )
+ nHelpStyle = QUICKHELP_TIP_STYLE_BALLOON;
}
+ }
+
+ if ( sHelpText.getLength() )
+ {
+ Rectangle const aControlScreenRect(
+ OutputToScreenPixel( Point( 0, 0 ) ),
+ GetOutputSizePixel()
+ );
+
+ if ( m_nTipWindowHandle )
+ Help::UpdateTip( m_nTipWindowHandle, this, aControlScreenRect, sHelpText );
else
- {
- if(Help::IsBalloonHelpEnabled())
- Help::DisableBalloonHelp();
- Window::MouseMove( rMEvt );
- }
+ m_nTipWindowHandle = Help::ShowTip( this, aControlScreenRect, sHelpText, nHelpStyle );
}
+ else
+ impl_hideTipWindow();
}
- //--------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::impl_hideTipWindow()
+ {
+ if ( m_nTipWindowHandle != 0 )
+ {
+ Help::HideTip( m_nTipWindowHandle );
+ m_nTipWindowHandle = 0;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TableDataWindow::MouseMove( const MouseEvent& rMEvt )
+ {
+ if ( rMEvt.IsLeaveWindow() )
+ impl_hideTipWindow();
+
+ if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) )
+ {
+ Window::MouseMove( rMEvt );
+ }
+ }
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- Point aPoint = rMEvt.GetPosPixel();
- RowPos nCurRow = m_rTableControl.getCurrentRow(aPoint);
- std::vector<RowPos> selectedRows(m_rTableControl.getSelectedRows());
+ impl_hideTipWindow();
+
+ Point const aPoint = rMEvt.GetPosPixel();
+ RowPos const hitRow = m_rTableControl.getRowAtPoint( aPoint );
+ bool const wasRowSelected = m_rTableControl.isRowSelected( hitRow );
+
if ( !m_rTableControl.getInputHandler()->MouseButtonDown( m_rTableControl, rMEvt ) )
- Window::MouseButtonDown( rMEvt );
- else
{
- if(nCurRow >= 0 && m_rTableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION)
- {
- bool found = std::find(selectedRows.begin(),selectedRows.end(), nCurRow) != selectedRows.end();
+ Window::MouseButtonDown( rMEvt );
+ return;
+ }
- if( !found )
- {
- m_aSelectHdl.Call( NULL );
- }
- }
+ bool const isRowSelected = m_rTableControl.isRowSelected( hitRow );
+ if ( isRowSelected != wasRowSelected )
+ {
+ m_aSelectHdl.Call( NULL );
}
m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt);
- m_rTableControl.getAntiImpl().LoseFocus();
}
- //--------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
void TableDataWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
if ( !m_rTableControl.getInputHandler()->MouseButtonUp( m_rTableControl, rMEvt ) )
Window::MouseButtonUp( rMEvt );
+
m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt);
- m_rTableControl.getAntiImpl().GetFocus();
+ m_rTableControl.getAntiImpl().GrabFocus();
}
- //--------------------------------------------------------------------
- void TableDataWindow::SetPointer( const Pointer& rPointer )
- {
- Window::SetPointer(rPointer);
- }
- //--------------------------------------------------------------------
- void TableDataWindow::CaptureMouse()
- {
- Window::CaptureMouse();
- }
- //--------------------------------------------------------------------
- void TableDataWindow::ReleaseMouse( )
- {
- Window::ReleaseMouse();
- }
- // -----------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------------
long TableDataWindow::Notify(NotifyEvent& rNEvt )
{
long nDone = 0;
@@ -168,6 +235,6 @@ namespace svt { namespace table
}
return nDone ? nDone : Window::Notify( rNEvt );
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/source/table/tabledatawindow.hxx
index 829feecd5836..6f78ac49c44d 100644
--- a/svtools/inc/svtools/table/tabledatawindow.hxx
+++ b/svtools/source/table/tabledatawindow.hxx
@@ -55,8 +55,12 @@ namespace svt { namespace table
Link m_aMouseButtonDownHdl;
Link m_aMouseButtonUpHdl;
Link m_aSelectHdl;
+ sal_uLong m_nTipWindowHandle;
+
public:
TableDataWindow( TableControl_Impl& _rTableControl );
+ ~TableDataWindow();
+
inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; }
inline const Link& GetMouseButtonDownHdl() const { return m_aMouseButtonDownHdl; }
inline void SetMouseButtonUpHdl( const Link& rLink ) { m_aMouseButtonUpHdl = rLink; }
@@ -69,15 +73,16 @@ namespace svt { namespace table
virtual void MouseMove( const MouseEvent& rMEvt);
virtual void MouseButtonDown( const MouseEvent& rMEvt);
virtual void MouseButtonUp( const MouseEvent& rMEvt);
- virtual void SetPointer( const Pointer& rPointer );
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
virtual long Notify(NotifyEvent& rNEvt);
virtual void SetControlBackground(const Color& rColor);
virtual void SetControlBackground();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
void SetBackground(const Wallpaper& rColor);
void SetBackground();
+
+ private:
+ void impl_hideTipWindow();
};
//........................................................................
} } // namespace svt::table
diff --git a/svtools/source/table/tablegeometry.cxx b/svtools/source/table/tablegeometry.cxx
index d60de9e6438f..661079775daa 100644
--- a/svtools/source/table/tablegeometry.cxx
+++ b/svtools/source/table/tablegeometry.cxx
@@ -27,105 +27,139 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-
#include "tablegeometry.hxx"
#include "tablecontrol_impl.hxx"
#include <tools/debug.hxx>
-//........................................................................
+//......................................................................................................................
namespace svt { namespace table
{
-//........................................................................
+//......................................................................................................................
- //====================================================================
+ //==================================================================================================================
//= TableRowGeometry
- //====================================================================
- //--------------------------------------------------------------------
- TableRowGeometry::TableRowGeometry( const TableControl_Impl& _rControl, const Rectangle& _rBoundaries,
- RowPos _nRow )
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TableRowGeometry::TableRowGeometry( TableControl_Impl const & _rControl, Rectangle const & _rBoundaries,
+ RowPos const _nRow, bool const i_allowVirtualRows )
:TableGeometry( _rControl, _rBoundaries )
,m_nRowPos( _nRow )
+ ,m_bAllowVirtualRows( i_allowVirtualRows )
{
if ( m_nRowPos == ROW_COL_HEADERS )
{
- //DBG_ASSERT( m_rControl.m_pModel->hasColumnHeaders(),
- // "TableRowGeometry::TableRowGeometry: why asking for the geoemtry of the non-existent column header row?" );
m_aRect.Top() = 0;
m_aRect.Bottom() = m_rControl.m_nColHeaderHeightPixel - 1;
}
else
{
- if ( ( m_nRowPos >= m_rControl.m_nTopRow ) && ( m_nRowPos < m_rControl.m_pModel->getRowCount() ) )
- {
- m_aRect.Top() = m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel;
- m_aRect.Bottom() = m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1;
- }
- else
- m_aRect.SetEmpty();
+ impl_initRect();
}
}
- //--------------------------------------------------------------------
- bool TableRowGeometry::moveDown()
+ //------------------------------------------------------------------------------------------------------------------
+ void TableRowGeometry::impl_initRect()
{
- if ( ++m_nRowPos < m_rControl.m_pModel->getRowCount() )
- m_aRect.Move( 0, m_rControl.m_nRowHeightPixel );
+ if ( ( m_nRowPos >= m_rControl.m_nTopRow ) && impl_isValidRow( m_nRowPos ) )
+ {
+ m_aRect.Top() = m_rControl.m_nColHeaderHeightPixel + ( m_nRowPos - m_rControl.m_nTopRow ) * m_rControl.m_nRowHeightPixel;
+ m_aRect.Bottom() = m_aRect.Top() + m_rControl.m_nRowHeightPixel - 1;
+ }
else
m_aRect.SetEmpty();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableRowGeometry::impl_isValidRow( RowPos const i_row ) const
+ {
+ return m_bAllowVirtualRows || ( i_row < m_rControl.m_pModel->getRowCount() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableRowGeometry::moveDown()
+ {
+ if ( m_nRowPos == ROW_COL_HEADERS )
+ {
+ m_nRowPos = m_rControl.m_nTopRow;
+ impl_initRect();
+ }
+ else
+ {
+ if ( impl_isValidRow( ++m_nRowPos ) )
+ m_aRect.Move( 0, m_rControl.m_nRowHeightPixel );
+ else
+ m_aRect.SetEmpty();
+ }
return isValid();
}
- //====================================================================
+ //==================================================================================================================
//= TableColumnGeometry
- //====================================================================
- //--------------------------------------------------------------------
- TableColumnGeometry::TableColumnGeometry( const TableControl_Impl& _rControl, const Rectangle& _rBoundaries,
- ColPos _nCol )
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TableColumnGeometry::TableColumnGeometry( TableControl_Impl const & _rControl, Rectangle const & _rBoundaries,
+ ColPos const _nCol, bool const i_allowVirtualColumns )
:TableGeometry( _rControl, _rBoundaries )
,m_nColPos( _nCol )
+ ,m_bAllowVirtualColumns( i_allowVirtualColumns )
{
if ( m_nColPos == COL_ROW_HEADERS )
{
-/* DBG_ASSERT( m_rControl.m_pModel->hasRowHeaders(),
- "TableColumnGeometry::TableColumnGeometry: why asking for the geoemtry of the non-existent row header column?" )*/;
m_aRect.Left() = 0;
m_aRect.Right() = m_rControl.m_nRowHeaderWidthPixel - 1;
}
else
{
- ColPos nLeftColumn = m_rControl.m_nLeftColumn;
- if ( ( m_nColPos >= nLeftColumn ) && ( m_nColPos < (ColPos)m_rControl.m_aColumnWidthsPixel.size() ) )
- {
- m_aRect.Left() = m_rControl.m_nRowHeaderWidthPixel;
- // TODO: take into account any possibly frozen columns
+ impl_initRect();
+ }
+ }
- for ( ColPos col = nLeftColumn; col < m_nColPos; ++col )
- m_aRect.Left() += m_rControl.m_aColumnWidthsPixel[ col ];
- m_aRect.Right() = m_aRect.Left() + m_rControl.m_aColumnWidthsPixel[ m_nColPos ] - 1;
- }
- else
- m_aRect.SetEmpty();
+ //------------------------------------------------------------------------------------------------------------------
+ void TableColumnGeometry::impl_initRect()
+ {
+ ColPos nLeftColumn = m_rControl.m_nLeftColumn;
+ if ( ( m_nColPos >= nLeftColumn ) && impl_isValidColumn( m_nColPos ) )
+ {
+ m_aRect.Left() = m_rControl.m_nRowHeaderWidthPixel;
+ // TODO: take into account any possibly frozen columns
+
+ for ( ColPos col = nLeftColumn; col < m_nColPos; ++col )
+ m_aRect.Left() += m_rControl.m_aColumnWidths[ col ].getWidth();
+ m_aRect.Right() = m_aRect.Left() + m_rControl.m_aColumnWidths[ m_nColPos ].getWidth() - 1;
}
+ else
+ m_aRect.SetEmpty();
}
- //--------------------------------------------------------------------
- bool TableColumnGeometry::moveRight()
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableColumnGeometry::impl_isValidColumn( ColPos const i_column ) const
{
- DBG_ASSERT( m_nColPos != COL_ROW_HEADERS, "TableColumnGeometry::moveRight: cannot move the row header column!" );
- // what would be COL_ROW_HEADERS + 1?
+ return m_bAllowVirtualColumns || ( i_column < ColPos( m_rControl.m_aColumnWidths.size() ) );
+ }
- if ( ++m_nColPos < (ColPos)m_rControl.m_aColumnWidthsPixel.size() )
+ //------------------------------------------------------------------------------------------------------------------
+ bool TableColumnGeometry::moveRight()
+ {
+ if ( m_nColPos == COL_ROW_HEADERS )
{
- m_aRect.Left() = m_aRect.Right() + 1;
- m_aRect.Right() += m_rControl.m_aColumnWidthsPixel[ m_nColPos ];
+ m_nColPos = m_rControl.m_nLeftColumn;
+ impl_initRect();
}
else
- m_aRect.SetEmpty();
+ {
+ if ( impl_isValidColumn( ++m_nColPos ) )
+ {
+ m_aRect.Left() = m_aRect.Right() + 1;
+ m_aRect.Right() += m_rControl.m_aColumnWidths[ m_nColPos ].getWidth();
+ }
+ else
+ m_aRect.SetEmpty();
+ }
return isValid();
}
-//........................................................................
+//......................................................................................................................
} } // namespace svt::table
-//........................................................................
+//......................................................................................................................
diff --git a/svtools/source/table/tablegeometry.hxx b/svtools/source/table/tablegeometry.hxx
index 3ddde0c98c64..fedc7cb2f24f 100644
--- a/svtools/source/table/tablegeometry.hxx
+++ b/svtools/source/table/tablegeometry.hxx
@@ -27,13 +27,9 @@
#ifndef SVTOOLS_TABLEGEOMETRY_HXX
#define SVTOOLS_TABLEGEOMETRY_HXX
-#ifndef SVTOOLS_INC_TABLE_TABLETYPES_HXX
-#include <svtools/table/tabletypes.hxx>
-#endif
+#include "svtools/table/tabletypes.hxx"
-#ifndef _SV_GEN_HXX
#include <tools/gen.hxx>
-#endif
//........................................................................
namespace svt { namespace table
@@ -79,18 +75,25 @@ namespace svt { namespace table
{
protected:
RowPos m_nRowPos;
+ bool m_bAllowVirtualRows;
public:
TableRowGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- RowPos _nRow
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ RowPos const _nRow,
+ bool const i_allowVirtualRows = false
+ // allow rows >= getRowCount()?
);
// status
RowPos getRow() const { return m_nRowPos; }
// operations
bool moveDown();
+
+ private:
+ void impl_initRect();
+ bool impl_isValidRow( RowPos const i_row ) const;
};
//====================================================================
@@ -100,18 +103,24 @@ namespace svt { namespace table
{
protected:
ColPos m_nColPos;
+ bool m_bAllowVirtualColumns;
public:
TableColumnGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- ColPos _nCol
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ ColPos const _nCol,
+ bool const i_allowVirtualColumns = false
);
// status
ColPos getCol() const { return m_nColPos; }
// operations
bool moveRight();
+
+ private:
+ void impl_initRect();
+ bool impl_isValidColumn( ColPos const i_column ) const;
};
//====================================================================
@@ -127,13 +136,14 @@ namespace svt { namespace table
public:
TableCellGeometry(
- const TableControl_Impl& _rControl,
- const Rectangle& _rBoundaries,
- ColPos _nCol,
- RowPos _nRow
+ TableControl_Impl const & _rControl,
+ Rectangle const & _rBoundaries,
+ ColPos const _nCol,
+ RowPos const _nRow,
+ bool const i_alllowVirtualCells = false
)
- :m_aRow( _rControl, _rBoundaries, _nRow )
- ,m_aCol( _rControl, _rBoundaries, _nCol )
+ :m_aRow( _rControl, _rBoundaries, _nRow, i_alllowVirtualCells )
+ ,m_aCol( _rControl, _rBoundaries, _nCol, i_alllowVirtualCells )
{
}
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index f5bc837f60b0..0e826ef6bff3 100755..100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -28,115 +28,193 @@
#include "precompiled_svtools.hxx"
#include "svtxgridcontrol.hxx"
-#include "accessibletableimp.hxx"
#include <com/sun/star/view/SelectionType.hpp>
+#include "svtools/table/tablecontrolinterface.hxx"
#include "svtools/table/gridtablerenderer.hxx"
-#include "svtools/table/defaultinputhandler.hxx"
#include "svtools/table/tablecontrol.hxx"
#include "unocontroltablemodel.hxx"
#include <comphelper/sequence.hxx>
#include <rtl/ref.hxx>
-#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
-#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
-#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/grid/GridInvalidDataException.hpp>
#include <com/sun/star/awt/grid/GridInvalidModelException.hpp>
#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
-using ::rtl::OUString;
using namespace ::svt::table;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt::grid;
using namespace ::com::sun::star::view;
-using namespace ::toolkit;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::container;
using namespace ::com::sun::star::accessibility;
-using namespace ::com::sun::star::accessibility::AccessibleEventId;
-using namespace ::com::sun::star::accessibility::AccessibleTableModelChangeType;
-using ::com::sun::star::accessibility::AccessibleTableModelChange;
SVTXGridControl::SVTXGridControl()
- :m_pTableModel (new UnoControlTableModel()),
- m_xDataModel(0),
- m_xColumnModel(0),
- m_bHasColumnHeaders(false),
- m_bHasRowHeaders(false),
- m_bVScroll(false),
- m_bHScroll(false),
- m_bUpdate(false),
- m_nSelectedRowCount(0),
- m_aSelectionListeners( *this )
+ :m_pTableModel( new UnoControlTableModel() )
+ ,m_bHasColumnHeaders( false )
+ ,m_bHasRowHeaders( false )
+ ,m_bTableModelInitCompleted( false )
+ ,m_nSelectedRowCount( 0 )
+ ,m_aSelectionListeners( *this )
{
}
-//--------------------------------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------------
SVTXGridControl::~SVTXGridControl()
{
}
-::com::sun::star::uno::Any SVTXGridControl::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+void SVTXGridControl::SetWindow( Window* pWindow )
{
- ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridControl*, this ),
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridDataListener*, this ),
- SAL_STATIC_CAST( ::com::sun::star::awt::grid::XGridColumnListener*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
- return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
+ SVTXGridControl_Base::SetWindow( pWindow );
+ impl_checkTableModelInit();
}
-// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( SVTXGridControl )
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridControl>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener>* ) NULL ),
- VCLXWindow::getTypes()
-IMPL_XTYPEPROVIDER_END
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getRowAtPoint: no control (anymore)!", -1 );
+
+ TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) );
+ return ( tableCell.nRow >= 0 ) ? tableCell.nRow : -1;
+}
-sal_Int32 SAL_CALL SVTXGridControl::getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- return pTable->GetCurrentRow( Point(x,y) );
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getColumnAtPoint: no control (anymore)!", -1 );
+
+ TableCell const tableCell = pTable->getTableControlInterface().hitTest( Point( x, y ) );
+ return ( tableCell.nColumn >= 0 ) ? tableCell.nColumn : -1;
}
-void SAL_CALL SVTXGridControl::setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const com::sun::star::uno::Sequence< sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException)
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getCurrentColumn( ) throw (RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- pTable->setTooltip(text, columns);
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentColumn: no control (anymore)!", -1 );
+
+ sal_Int32 const nColumn = pTable->GetCurrentColumn();
+ return ( nColumn >= 0 ) ? nColumn : -1;
}
+// ---------------------------------------------------------------------------------------------------------------------
+sal_Int32 SAL_CALL SVTXGridControl::getCurrentRow( ) throw (RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getCurrentRow: no control (anymore)!", -1 );
+
+ sal_Int32 const nRow = pTable->GetCurrentRow();
+ return ( nRow >= 0 ) ? nRow : -1;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.addInterface(listener);
}
+// ---------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.removeInterface(listener);
}
+// ---------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const Any& aValue) throw(RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- TableControl* pTable = (TableControl*)GetWindow();
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable != NULL, "SVTXGridControl::setProperty: no control (anymore)!" );
+
switch( GetPropertyId( PropertyName ) )
{
+ case BASEPROPERTY_ROW_HEADER_WIDTH:
+ {
+ sal_Int32 rowHeaderWidth( -1 );
+ aValue >>= rowHeaderWidth;
+ ENSURE_OR_BREAK( rowHeaderWidth > 0, "SVTXGridControl::setProperty: illegal row header width!" );
+ m_pTableModel->setRowHeaderWidth( rowHeaderWidth );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_COLUMN_HEADER_HEIGHT:
+ {
+ sal_Int32 columnHeaderHeight = 0;
+ if ( !aValue.hasValue() )
+ {
+ columnHeaderHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ }
+ else
+ {
+ aValue >>= columnHeaderHeight;
+ }
+ ENSURE_OR_BREAK( columnHeaderHeight > 0, "SVTXGridControl::setProperty: illegal column header height!" );
+ m_pTableModel->setColumnHeaderHeight( columnHeaderHeight );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_USE_GRID_LINES:
+ {
+ GridTableRenderer* pGridRenderer = dynamic_cast< GridTableRenderer* >(
+ m_pTableModel->getRenderer().get() );
+ ENSURE_OR_BREAK( pGridRenderer != NULL, "SVTXGridControl::setProperty(UseGridLines): invalid renderer!" );
+ sal_Bool bUseGridLines = sal_False;
+ OSL_VERIFY( aValue >>= bUseGridLines );
+ pGridRenderer->useGridLines( bUseGridLines );
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_ROW_HEIGHT:
+ {
+ sal_Int32 rowHeight = 0;
+ if ( !aValue.hasValue() )
+ {
+ rowHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ }
+ else
+ {
+ aValue >>= rowHeight;
+ }
+ m_pTableModel->setRowHeight( rowHeight );
+ ENSURE_OR_BREAK( rowHeight > 0, "SVTXGridControl::setProperty: illegal row height!" );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
case BASEPROPERTY_BACKGROUNDCOLOR:
{
// let the base class handle this for the TableControl
VCLXWindow::setProperty( PropertyName, aValue );
// and forward to the grid control's data window
if ( pTable->IsBackground() )
- pTable->getDataWindow()->SetBackground( pTable->GetBackground() );
+ pTable->getDataWindow().SetBackground( pTable->GetBackground() );
else
- pTable->getDataWindow()->SetBackground();
+ pTable->getDataWindow().SetBackground();
}
break;
@@ -151,7 +229,6 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
case SelectionType_SINGLE: eSelMode = SINGLE_SELECTION; break;
case SelectionType_RANGE: eSelMode = RANGE_SELECTION; break;
case SelectionType_MULTI: eSelMode = MULTIPLE_SELECTION; break;
- // case SelectionType_NONE:
default: eSelMode = NO_SELECTION; break;
}
if( pTable->getSelEngine()->GetSelectionMode() != eSelMode )
@@ -163,19 +240,16 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
{
sal_Bool bHScroll = true;
if( aValue >>= bHScroll )
- {
- m_bHScroll = bHScroll;
- m_pTableModel->setHorizontalScrollbarVisibility(bHScroll);
- }
+ m_pTableModel->setHorizontalScrollbarVisibility( bHScroll ? ScrollbarShowAlways : ScrollbarShowSmart );
break;
}
+
case BASEPROPERTY_VSCROLL:
{
sal_Bool bVScroll = true;
if( aValue >>= bVScroll )
{
- m_bVScroll = bVScroll;
- m_pTableModel->setVerticalScrollbarVisibility(bVScroll);
+ m_pTableModel->setVerticalScrollbarVisibility( bVScroll ? ScrollbarShowAlways : ScrollbarShowSmart );
}
break;
}
@@ -189,64 +263,42 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
break;
}
- case BASEPROPERTY_GRID_HEADER_BACKGROUND:
- {
- sal_Int32 colorHeader = 0xFFFFFF;
- if( aValue >>= colorHeader )
- {
- m_pTableModel->setHeaderBackgroundColor(colorHeader);
- }
+
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ m_pTableModel->setRowBackgroundColors( aValue );
+ pTable->Invalidate();
break;
- }
+
case BASEPROPERTY_GRID_LINE_COLOR:
- {
- sal_Int32 colorLine = 0xFFFFFF;
- if( aValue >>= colorLine )
- {
- m_pTableModel->setLineColor(colorLine);
- }
+ m_pTableModel->setLineColor( aValue );
+ pTable->Invalidate();
break;
- }
- case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND:
- {
- sal_Int32 colorEvenRow = 0xFFFFFF;
- if( aValue >>= colorEvenRow )
- {
- m_pTableModel->setEvenRowBackgroundColor(colorEvenRow);
- }
+
+ case BASEPROPERTY_GRID_HEADER_BACKGROUND:
+ m_pTableModel->setHeaderBackgroundColor( aValue );
+ pTable->Invalidate();
break;
- }
- case BASEPROPERTY_GRID_ROW_BACKGROUND:
- {
- sal_Int32 colorBackground = 0xFFFFFF;
- if( aValue >>= colorBackground )
- {
- m_pTableModel->setOddRowBackgroundColor(colorBackground);
- }
+
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
+ m_pTableModel->setHeaderTextColor( aValue );
+ pTable->Invalidate();
break;
- }
+
case BASEPROPERTY_TEXTCOLOR:
- {
- sal_Int32 colorText = 0x000000;
- if( aValue >>= colorText )
- {
- m_pTableModel->setTextColor(colorText);
- }
+ m_pTableModel->setTextColor( aValue );
+ pTable->Invalidate();
break;
- }
+
+ case BASEPROPERTY_TEXTLINECOLOR:
+ m_pTableModel->setTextLineColor( aValue );
+ pTable->Invalidate();
+ break;
+
case BASEPROPERTY_VERTICALALIGN:
{
- com::sun::star::style::VerticalAlignment vAlign(com::sun::star::style::VerticalAlignment(0));
- if( aValue >>= vAlign )
- {
- switch( vAlign )
- {
- case com::sun::star::style::VerticalAlignment_TOP: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(0)); break;
- case com::sun::star::style::VerticalAlignment_MIDDLE: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(1)); break;
- case com::sun::star::style::VerticalAlignment_BOTTOM: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(2)); break;
- default: m_pTableModel->setVerticalAlign(com::sun::star::style::VerticalAlignment(0)); break;
- }
- }
+ VerticalAlignment eAlign( VerticalAlignment_TOP );
+ if ( aValue >>= eAlign )
+ m_pTableModel->setVerticalAlign( eAlign );
break;
}
@@ -261,97 +313,31 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
case BASEPROPERTY_GRID_DATAMODEL:
{
- {
- m_xDataModel = Reference< XGridDataModel >( aValue, UNO_QUERY );
- if(m_xDataModel != NULL)
- {
- Sequence<Sequence< Any > > cellData = m_xDataModel->getData();
- if(cellData.getLength()!= 0)
- {
- for (int i = 0; i < cellData.getLength(); i++)
- {
- std::vector< Any > newRow;
- Sequence< Any > rawRowData = cellData[i];
- //check whether the data row vector length matches with the column count
- if(m_xColumnModel->getColumnCount() == 0)
- {
- for ( ::svt::table::ColPos col = 0; col < rawRowData.getLength(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn();
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- }
- m_xColumnModel->setDefaultColumns(rawRowData.getLength());
- }
- else
- if((unsigned int)rawRowData.getLength()!=(unsigned)m_pTableModel->getColumnCount())
- throw GridInvalidDataException(rtl::OUString::createFromAscii("The column count doesn't match with the length of row data"), m_xDataModel);
-
- for ( int k = 0; k < rawRowData.getLength(); k++)
- {
- newRow.push_back(rawRowData[k]);
- }
- m_pTableModel->getCellContent().push_back(newRow);
- }
-
- Sequence< ::rtl::OUString > rowHeaders = m_xDataModel->getRowHeaders();
- std::vector< rtl::OUString > newRow(
- comphelper::sequenceToContainer< std::vector<rtl::OUString > >(rowHeaders));
- m_pTableModel->setRowCount(m_xDataModel->getRowCount());
- m_pTableModel->setRowHeaderName(newRow);
- }
- }
- else
- throw GridInvalidDataException(rtl::OUString::createFromAscii("The data model isn't set!"), m_xDataModel);
- sal_Int32 fontHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight()+3 ), MAP_APPFONT ).Height();
- if(m_xDataModel->getRowHeight() == 0)
- {
- m_pTableModel->setRowHeight(fontHeight);
- m_xDataModel->setRowHeight(fontHeight);
- }
- else
- m_pTableModel->setRowHeight(m_xDataModel->getRowHeight());
- m_pTableModel->setRowHeaderWidth(m_xDataModel->getRowHeaderWidth());
- }
- break;
+ Reference< XGridDataModel > const xDataModel( aValue, UNO_QUERY );
+ if ( !xDataModel.is() )
+ throw GridInvalidDataException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid data model." ) ), *this );
+
+ m_pTableModel->setDataModel( xDataModel );
+ impl_checkTableModelInit();
}
+ break;
+
case BASEPROPERTY_GRID_COLUMNMODEL:
{
- m_xColumnModel = Reference< XGridColumnModel >( aValue, UNO_QUERY );
- if(m_xColumnModel != NULL)
- {
- if(m_xColumnModel->getColumnCount() != 0)
- {
- Sequence<Reference< XGridColumn > > columns = m_xColumnModel->getColumns();
- std::vector<Reference< XGridColumn > > aNewColumns(
- comphelper::sequenceToContainer<std::vector<Reference< XGridColumn > > >(columns));
- sal_Int32 fontHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight()+3 ), MAP_APPFONT ).Height();
- if(m_xColumnModel->getColumnHeaderHeight() == 0)
- {
- m_pTableModel->setColumnHeaderHeight(fontHeight);
- m_xColumnModel->setColumnHeaderHeight(fontHeight);
- }
- else
- m_pTableModel->setColumnHeaderHeight(m_xColumnModel->getColumnHeaderHeight());
- for ( ::svt::table::ColPos col = 0; col < m_xColumnModel->getColumnCount(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn(aNewColumns[col]);
- Reference< XGridColumn > xGridColumn = m_xColumnModel->getColumn(col);
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- tableColumn->setHorizontalAlign(xGridColumn->getHorizontalAlign());
- tableColumn->setWidth(xGridColumn->getColumnWidth());
- if(xGridColumn->getPreferredWidth() != 0)
- tableColumn->setPreferredWidth(xGridColumn->getPreferredWidth());
- if(xGridColumn->getMaxWidth() != 0)
- tableColumn->setMaxWidth(xGridColumn->getMaxWidth());
- if(xGridColumn->getMinWidth() != 0)
- tableColumn->setMinWidth(xGridColumn->getMinWidth());
- tableColumn->setResizable(xGridColumn->getResizeable());
- }
- }
- }
- else
- throw GridInvalidModelException(rtl::OUString::createFromAscii("The column model isn't set!"), m_xColumnModel);
+ // obtain new col model
+ Reference< XGridColumnModel > const xColumnModel( aValue, UNO_QUERY );
+ if ( !xColumnModel.is() )
+ throw GridInvalidModelException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid column model." ) ), *this );
+
+ // remove all old columns
+ m_pTableModel->removeAllColumns();
+
+ // announce to the TableModel
+ m_pTableModel->setColumnModel( xColumnModel );
+ impl_checkTableModelInit();
+ // add new columns
+ impl_updateColumnsFromModel_nothrow();
break;
}
default:
@@ -360,489 +346,354 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
}
}
+
+void SVTXGridControl::impl_checkTableModelInit()
+{
+ if ( !m_bTableModelInitCompleted && m_pTableModel->hasColumnModel() && m_pTableModel->hasDataModel() )
+ {
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ if ( pTable )
+ {
+ pTable->SetModel( PTableModel( m_pTableModel ) );
+
+ m_bTableModelInitCompleted = true;
+
+ // ensure default columns exist, if they have not previously been added
+ Reference< XGridDataModel > const xDataModel( m_pTableModel->getDataModel(), UNO_QUERY_THROW );
+ Reference< XGridColumnModel > const xColumnModel( m_pTableModel->getColumnModel(), UNO_QUERY_THROW );
+
+ sal_Int32 const nDataColumnCount = xDataModel->getColumnCount();
+ if ( ( nDataColumnCount > 0 ) && ( xColumnModel->getColumnCount() == 0 ) )
+ xColumnModel->setDefaultColumns( nDataColumnCount );
+ // this will trigger notifications, which in turn will let us update our m_pTableModel
+ }
+ }
+}
+
+namespace
+{
+ void lcl_convertColor( ::boost::optional< ::Color > const & i_color, Any & o_colorValue )
+ {
+ if ( !i_color )
+ o_colorValue.clear();
+ else
+ o_colorValue <<= i_color->GetColor();
+ }
+}
+
Any SVTXGridControl::getProperty( const ::rtl::OUString& PropertyName ) throw(RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable != NULL, "SVTXGridControl::getProperty: no control (anymore)!", Any() );
+
+ Any aPropertyValue;
+
const sal_uInt16 nPropId = GetPropertyId( PropertyName );
- TableControl* pTable = (TableControl*)GetWindow();
- if(pTable)
+ switch(nPropId)
+ {
+ case BASEPROPERTY_GRID_SELECTIONMODE:
{
- switch(nPropId)
+ SelectionType eSelectionType;
+
+ SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
+ switch( eSelMode )
{
- case BASEPROPERTY_GRID_SELECTIONMODE:
+ case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break;
+ case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break;
+ case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break;
+ default: eSelectionType = SelectionType_NONE; break;
+ }
+ aPropertyValue <<= eSelectionType;
+ break;
+ }
+
+ case BASEPROPERTY_GRID_SHOWROWHEADER:
+ aPropertyValue <<= sal_Bool( m_pTableModel->hasRowHeaders() );
+ break;
+
+ case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
+ aPropertyValue <<= sal_Bool( m_pTableModel->hasColumnHeaders() );
+ break;
+
+ case BASEPROPERTY_GRID_DATAMODEL:
+ aPropertyValue <<= m_pTableModel->getDataModel();
+ break;
+
+ case BASEPROPERTY_GRID_COLUMNMODEL:
+ aPropertyValue <<= m_pTableModel->getColumnModel();
+ break;
+
+ case BASEPROPERTY_HSCROLL:
{
- SelectionType eSelectionType;
+ sal_Bool const bHasScrollbar = ( m_pTableModel->getHorizontalScrollbarVisibility() != ScrollbarShowNever );
+ aPropertyValue <<= bHasScrollbar;
+ break;
+ }
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- switch( eSelMode )
- {
- case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break;
- case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break;
- case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break;
-// case NO_SELECTION:
- default: eSelectionType = SelectionType_NONE; break;
- }
- return Any( eSelectionType );
+ case BASEPROPERTY_VSCROLL:
+ {
+ sal_Bool const bHasScrollbar = ( m_pTableModel->getVerticalScrollbarVisibility() != ScrollbarShowNever );
+ aPropertyValue <<= bHasScrollbar;
+ break;
}
- case BASEPROPERTY_GRID_SHOWROWHEADER:
+
+ case BASEPROPERTY_USE_GRID_LINES:
+ {
+ GridTableRenderer* pGridRenderer = dynamic_cast< GridTableRenderer* >(
+ m_pTableModel->getRenderer().get() );
+ ENSURE_OR_BREAK( pGridRenderer != NULL, "SVTXGridControl::getProperty(UseGridLines): invalid renderer!" );
+ aPropertyValue <<= pGridRenderer->useGridLines();
+ }
+ break;
+
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ {
+ ::boost::optional< ::std::vector< ::Color > > aColors( m_pTableModel->getRowBackgroundColors() );
+ if ( !aColors )
+ aPropertyValue.clear();
+ else
+ {
+ Sequence< ::com::sun::star::util::Color > aAPIColors( aColors->size() );
+ for ( size_t i=0; i<aColors->size(); ++i )
{
- return Any ((sal_Bool) m_pTableModel->hasRowHeaders());
+ aAPIColors[i] = aColors->at(i).GetColor();
}
- case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
- return Any ((sal_Bool) m_pTableModel->hasColumnHeaders());
- case BASEPROPERTY_GRID_DATAMODEL:
- return Any ( m_xDataModel );
- case BASEPROPERTY_GRID_COLUMNMODEL:
- return Any ( m_xColumnModel);
- case BASEPROPERTY_HSCROLL:
- return Any ( m_bHScroll);
- case BASEPROPERTY_VSCROLL:
- return Any ( m_bVScroll);
+ aPropertyValue <<= aAPIColors;
}
}
- return VCLXWindow::getProperty( PropertyName );
+ break;
+
+ case BASEPROPERTY_GRID_LINE_COLOR:
+ lcl_convertColor( m_pTableModel->getLineColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_GRID_HEADER_BACKGROUND:
+ lcl_convertColor( m_pTableModel->getHeaderBackgroundColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
+ lcl_convertColor( m_pTableModel->getHeaderTextColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_TEXTCOLOR:
+ lcl_convertColor( m_pTableModel->getTextColor(), aPropertyValue );
+ break;
+
+ case BASEPROPERTY_TEXTLINECOLOR:
+ lcl_convertColor( m_pTableModel->getTextLineColor(), aPropertyValue );
+ break;
+
+ default:
+ aPropertyValue = VCLXWindow::getProperty( PropertyName );
+ break;
+ }
+
+ return aPropertyValue;
}
void SVTXGridControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
{
PushPropertyIds( rIds,
- BASEPROPERTY_GRID_SHOWROWHEADER,
- BASEPROPERTY_GRID_SHOWCOLUMNHEADER,
- BASEPROPERTY_GRID_DATAMODEL,
- BASEPROPERTY_GRID_COLUMNMODEL,
- BASEPROPERTY_GRID_SELECTIONMODE,
- BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND,
- BASEPROPERTY_GRID_HEADER_BACKGROUND,
- BASEPROPERTY_GRID_LINE_COLOR,
- BASEPROPERTY_GRID_ROW_BACKGROUND,
- 0);
+ BASEPROPERTY_GRID_SHOWROWHEADER,
+ BASEPROPERTY_GRID_SHOWCOLUMNHEADER,
+ BASEPROPERTY_GRID_DATAMODEL,
+ BASEPROPERTY_GRID_COLUMNMODEL,
+ BASEPROPERTY_GRID_SELECTIONMODE,
+ BASEPROPERTY_GRID_HEADER_BACKGROUND,
+ BASEPROPERTY_GRID_HEADER_TEXT_COLOR,
+ BASEPROPERTY_GRID_LINE_COLOR,
+ BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS,
+ 0
+ );
VCLXWindow::ImplGetPropertyIds( rIds, true );
}
-void SAL_CALL SVTXGridControl::setVisible( sal_Bool bVisible ) throw(::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- TableControl* pTable = (TableControl*)GetWindow();
- if ( pTable )
- {
- pTable->SetModel(PTableModel(m_pTableModel));
- pTable->Show( bVisible );
- }
+ m_pTableModel->notifyRowsInserted( i_event );
}
-void SAL_CALL SVTXGridControl::setFocus() throw(::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL//----------------------------------------------------------------------------------------------------------------------
+ SVTXGridControl::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- if ( GetWindow())
- GetWindow()->GrabFocus();
+ m_pTableModel->notifyRowsRemoved( i_event );
}
-void SAL_CALL SVTXGridControl::rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- std::vector< Any > newRow;
- Sequence< Any > rawRowData = Event.rowData;
- int colCount = m_xColumnModel->getColumnCount();
- if(colCount == 0)
- {
- Reference<XGridColumnListener> listener(*this,UNO_QUERY_THROW);
- m_xColumnModel->setDefaultColumns(rawRowData.getLength());
- for ( ::svt::table::ColPos col = 0; col < rawRowData.getLength(); ++col )
- {
- UnoControlTableColumn* tableColumn = new UnoControlTableColumn();
- m_pTableModel->getColumnModel().push_back((PColumnModel)tableColumn);
- m_xColumnModel->getColumn(col)->addColumnListener(listener);
- }
+ m_pTableModel->notifyDataChanged( i_event );
- }
- else if((unsigned int)rawRowData.getLength()!=(unsigned)colCount)
- throw GridInvalidDataException(rtl::OUString::createFromAscii("The column count doesn't match with the length of row data"), m_xDataModel);
-
- for ( int k = 0; k < rawRowData.getLength(); k++)
- newRow.push_back(rawRowData[k]);
- m_pTableModel->getCellContent().push_back(newRow);
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().push_back(Event.headerName);
- m_pTableModel->setRowCount(m_pTableModel->getCellContent().size());
- TableControl* pTable = (TableControl*)GetWindow();
- pTable->InvalidateDataWindow(m_pTableModel->getCellContent().size()-1, 0, false);
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(INSERT, m_pTableModel->getRowCount()-1, m_pTableModel->getRowCount(), 0, m_pTableModel->getColumnCount())),
- Any());
- pTable->commitGridControlEvent(CHILD,
- makeAny( pTable->m_pAccessTable->m_pAccessible->getTableHeader(TCTYPE_ROWHEADERBAR)),
- Any());
- for (sal_Int32 i = 0 ; i <= m_pTableModel->getColumnCount() ; ++i)
- {
- pTable->commitGridControlEvent(
- CHILD,
- makeAny( pTable->m_pAccessTable->m_pAccessible->getTable() ),
- Any());
- }
- }
+ // if the data model is sortable, a dataChanged event is also fired in case the sort order changed.
+ // So, just in case, invalidate the column header area, too.
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::dataChanged: no control (anymore)!" );
+ pTable->getTableControlInterface().invalidate( TableAreaColumnHeaders );
}
-void SAL_CALL SVTXGridControl::rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
+ OSL_UNUSED( i_event );
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.index == -1)
- {
- if(!isSelectionEmpty())
- deselectAllRows();
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().clear();
- pTable->clearSelection();
- m_pTableModel->getCellContent().clear();
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(DELETE, 0, m_pTableModel->getColumnCount(), 0, m_pTableModel->getColumnCount())),
- Any());
- }
- }
- else if(Event.index >= 0 && Event.index < m_pTableModel->getRowCount())
- {
- if(isSelectedIndex(Event.index))
- {
- Sequence<sal_Int32> selected(1);
- selected[0]=Event.index;
- deselectRows(selected);
- }
- if(m_pTableModel->hasRowHeaders())
- m_pTableModel->getRowHeaderName().erase(m_pTableModel->getRowHeaderName().begin()+Event.index);
- std::vector<std::vector<Any> >::iterator rowPos =m_pTableModel->getCellContent().begin() + Event.index;
- m_pTableModel->getCellContent().erase( rowPos );
- }
- m_pTableModel->setRowCount(m_pTableModel->getCellContent().size());
- pTable->InvalidateDataWindow(Event.index, Event.index, true);
- if(pTable->isAccessibleAlive())
- {
- pTable->commitGridControlEvent(TABLE_MODEL_CHANGED,
- makeAny( AccessibleTableModelChange(DELETE, Event.index, Event.index+1, 0, m_pTableModel->getColumnCount())),
- Any());
- }
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" );
+
+ // TODO: we could do better than this - invalidate the header area only
+ pTable->getTableControlInterface().invalidate( TableAreaRowHeaders );
}
-void SAL_CALL SVTXGridControl::columnChanged(const ::com::sun::star::awt::grid::GridColumnEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.valueName == rtl::OUString::createFromAscii("ColumnResize"))
- {
- bool resizable = m_pTableModel->getColumnModel()[Event.index]->isResizable();
- Event.newValue>>=resizable;
- m_pTableModel->getColumnModel()[Event.index]->setResizable(resizable);
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("ColWidth"))
- {
- sal_Int32 colWidth = m_pTableModel->getColumnModel()[Event.index]->getWidth();
- Event.newValue>>=colWidth;
- m_pTableModel->getColumnModel()[Event.index]->setWidth(colWidth);
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("MaxWidth"))
- {
- sal_Int32 maxWidth = m_pTableModel->getColumnModel()[Event.index]->getMaxWidth();
- Event.newValue>>=maxWidth;
- m_pTableModel->getColumnModel()[Event.index]->setMaxWidth(maxWidth);
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("MinWidth"))
- {
- sal_Int32 minWidth = m_pTableModel->getColumnModel()[Event.index]->getMinWidth();
- Event.newValue>>=minWidth;
- m_pTableModel->getColumnModel()[Event.index]->setMinWidth(minWidth);
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("PrefWidth"))
- {
- sal_Int32 prefWidth = m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth();
- Event.newValue>>=prefWidth;
- m_pTableModel->getColumnModel()[Event.index]->setPreferredWidth(prefWidth);
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("HAlign"))
- {
- ::com::sun::star::style::HorizontalAlignment hAlign = m_pTableModel->getColumnModel()[Event.index]->getHorizontalAlign();
- Event.newValue>>=hAlign;
- m_pTableModel->getColumnModel()[Event.index]->setHorizontalAlign(hAlign);
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("UpdateWidth"))
- {
- if(m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth() != 0)
- m_xColumnModel->getColumn(Event.index)->updateColumn(rtl::OUString::createFromAscii("PrefWidth"), m_pTableModel->getColumnModel()[Event.index]->getPreferredWidth());
- m_xColumnModel->getColumn(Event.index)->updateColumn(rtl::OUString::createFromAscii("ColWidth"), m_pTableModel->getColumnModel()[Event.index]->getWidth());
- }
- pTable->Invalidate();
+ Reference< XGridColumn > const xGridColumn( i_event.Element, UNO_QUERY_THROW );
+
+ sal_Int32 nIndex( m_pTableModel->getColumnCount() );
+ OSL_VERIFY( i_event.Accessor >>= nIndex );
+ m_pTableModel->insertColumn( nIndex, xGridColumn );
}
-void SAL_CALL SVTXGridControl::dataChanged(const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- TableControl* pTable = (TableControl*)GetWindow();
- if(Event.valueName == rtl::OUString::createFromAscii("RowHeight"))
- {
- sal_Int32 rowHeight = m_pTableModel->getRowHeight();
- Event.newValue>>=rowHeight;
- m_pTableModel->setRowHeight(rowHeight);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("RowHeaderWidth"))
- {
- sal_Int32 rowHeaderWidth = m_pTableModel->getRowHeaderWidth();
- Event.newValue>>=rowHeaderWidth;
- m_pTableModel->setRowHeaderWidth(rowHeaderWidth);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("RowHeaders"))
- {
- Sequence< rtl::OUString > headers(0);
- Event.newValue>>=headers;
- std::vector< rtl::OUString > headerNames( comphelper::sequenceToContainer <std::vector< rtl::OUString > >(headers) );
- m_pTableModel->setRowHeaderName(headerNames);
- pTable->Invalidate();
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("CellUpdated"))
- {
- std::vector< std::vector< Any > >& rowContent = m_pTableModel->getCellContent();
- sal_Int32 col = -1;
- Event.oldValue>>=col;
- rowContent[Event.index][col] = Event.newValue;
- pTable->InvalidateDataWindow(Event.index, Event.index, false);
- }
- else if(Event.valueName == rtl::OUString::createFromAscii("RowUpdated"))
- {
- std::vector<std::vector< Any > >& rowContent = m_pTableModel->getCellContent();
- Sequence< sal_Int32 > cols(0);
- Sequence< Any > values(0);
- Event.oldValue>>=cols;
- Event.newValue>>=values;
- for(int i = 0; i< cols.getLength(); i++)
- {
- if(cols[i]>=0 && cols[i]<m_pTableModel->getColumnCount())
- rowContent[Event.index][cols[i]]=values[i];
- else
- break;
- }
- pTable->InvalidateDataWindow(Event.index, Event.index, false);
- }
+ sal_Int32 nIndex( -1 );
+ OSL_VERIFY( i_event.Accessor >>= nIndex );
+ m_pTableModel->removeColumn( nIndex );
}
-void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
{
- VCLXWindow::disposing( Source );
+ OSL_ENSURE( false, "SVTXGridControl::elementReplaced: not implemented!" );
+ // at the moment, the XGridColumnModel API does not allow replacing columns
+ OSL_UNUSED( i_event );
+ // TODO: replace the respective column in our table model
}
-::sal_Int32 SAL_CALL SVTXGridControl::getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
-{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return -1;
- else
- {
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- return *(std::min_element(itStart, itEnd));
- }
-}
-::sal_Int32 SAL_CALL SVTXGridControl::getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return -1;
- else
- {
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- return *(std::max_element(itStart, itEnd));
- }
+ VCLXWindow::disposing( Source );
}
-void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- sal_Int32 start = rangeOfRows[0];
- int seqSize = rangeOfRows.getLength();
- sal_Int32 end = rangeOfRows[seqSize-1];
- if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount()))
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(eSelMode == SINGLE_SELECTION)
- {
- if(!selectedRows.empty())
- selectedRows.clear();
- if(rangeOfRows.getLength() == 1)
- selectedRows.push_back(start);
- else
- return;
- }
- else
- {
- for(int i=0;i<seqSize;i++)
- {
- if(!isSelectedIndex(rangeOfRows[i]))
- selectedRows.push_back(rangeOfRows[i]);
- }
- }
- pTable->selectionChanged(true);
- pTable->InvalidateDataWindow(start, end, false);
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
- }
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectRow: no control (anymore)!" );
+
+ pTable->SelectRow( i_rowIndex, true );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(!selectedRows.empty())
- selectedRows.clear();
- for(int i=0;i<m_pTableModel->getRowCount();i++)
- selectedRows.push_back(i);
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectAllRows: no control (anymore)!" );
+
+ pTable->SelectAllRows( true );
}
-void SAL_CALL SVTXGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- std::vector<RowPos>::iterator itStart = selectedRows.begin();
- std::vector<RowPos>::iterator itEnd = selectedRows.end();
- for(int i = 0; i < rangeOfRows.getLength(); i++ )
- {
- std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, rangeOfRows[i]);
- selectedRows.erase(iter);
- }
- pTable->selectionChanged(true);
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectRow: no control (anymore)!" );
+
+ pTable->SelectRow( i_rowIndex, false );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(!selectedRows.empty())
- selectedRows.clear();
- pTable->Invalidate();
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectAllRows: no control (anymore)!" );
+
+ pTable->SelectAllRows( false );
}
+//----------------------------------------------------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL SVTXGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- Sequence<sal_Int32> selectedRowsToSequence(comphelper::containerToSequence(selectedRows));
- return selectedRowsToSequence;
-}
+ ::vos::OGuard aGuard( GetMutex() );
-::sal_Bool SAL_CALL SVTXGridControl::isCellEditable() throw (::com::sun::star::uno::RuntimeException)
-{
- return sal_False;
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", Sequence< sal_Int32 >() );
+
+ sal_Int32 selectionCount = pTable->GetSelectedRowCount();
+ Sequence< sal_Int32 > selectedRows( selectionCount );
+ for ( sal_Int32 i=0; i<selectionCount; ++i )
+ selectedRows[i] = pTable->GetSelectedRowIndex(i);
+ return selectedRows;
}
+//----------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL SVTXGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException)
{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(selectedRows.empty())
- return sal_True;
- else
- return sal_False;
-}
+ ::vos::OGuard aGuard( GetMutex() );
-::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- TableControl* pTable = (TableControl*)GetWindow();
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- return std::find(selectedRows.begin(),selectedRows.end(), index) != selectedRows.end();
-}
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", sal_True );
-void SAL_CALL SVTXGridControl::selectRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if(index<0 || index>=m_pTableModel->getRowCount())
- return;
- TableControl* pTable = (TableControl*)GetWindow();
- SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode();
- if(eSelMode != NO_SELECTION)
- {
- std::vector<RowPos>& selectedRows = pTable->GetSelectedRows();
- if(eSelMode == MULTIPLE_SELECTION)
- {
- if(!isSelectedIndex(index))
- selectedRows.push_back(index);
- else
- return;
- }
- else if(eSelMode == SINGLE_SELECTION)
- {
- if(!selectedRows.empty())
- {
- if(!isSelectedIndex(index))
- deselectRows(getSelection());
- else
- return;
- }
- selectedRows.push_back(index);
- }
- pTable->selectionChanged(true);
- pTable->InvalidateDataWindow(index, index, false);
- SetSynthesizingVCLEvent( sal_True );
- pTable->Select();
- SetSynthesizingVCLEvent( sal_False );
- }
+ return pTable->GetSelectedRowCount() > 0;
}
-void SAL_CALL SVTXGridControl::selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex( ::sal_Int32 index ) throw (::com::sun::star::uno::RuntimeException)
{
- (void)x;
+ ::vos::OGuard aGuard( GetMutex() );
+
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN( pTable, "SVTXGridControl::isSelectedIndex: no control (anymore)!", sal_False );
+
+ return pTable->IsRowSelected( index );
}
+
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::dispose() throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( GetMutex() );
-
::com::sun::star::lang::EventObject aObj;
aObj.Source = (::cppu::OWeakObject*)this;
m_aSelectionListeners.disposeAndClear( aObj );
VCLXWindow::dispose();
}
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this );
+ ::vos::OGuard aGuard( GetMutex() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this );
switch ( rVclWindowEvent.GetId() )
{
case VCLEVENT_TABLEROW_SELECT:
{
- TableControl* pTable = (TableControl*)GetWindow();
-
- if( pTable )
- {
- if ( m_aSelectionListeners.getLength() )
- {
- ImplCallItemListeners();
- }
- }
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_BREAK( pTable, "SVTXGridControl::ProcessWindowEvent: no control (anymore)!" );
+ if ( m_aSelectionListeners.getLength() )
+ ImplCallItemListeners();
}
break;
@@ -852,28 +703,30 @@ void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent
}
}
+//----------------------------------------------------------------------------------------------------------------------
void SVTXGridControl::ImplCallItemListeners()
{
- TableControl* pTable = (TableControl*) GetWindow();
- if ( pTable && m_aSelectionListeners.getLength() )
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::ImplCallItemListeners: no control (anymore)!" );
+
+ if ( m_aSelectionListeners.getLength() )
{
- ::std::vector<sal_Int32> selRows = pTable->GetSelectedRows();
+ sal_Int32 const actSelRowCount = pTable->GetSelectedRowCount();
::com::sun::star::awt::grid::GridSelectionEvent aEvent;
aEvent.Source = (::cppu::OWeakObject*)this;
aEvent.Column = 0;
- sal_Int32 actSelRowCount = selRows.size();
sal_Int32 diff = actSelRowCount - m_nSelectedRowCount;
//row added to selection
if(diff >= 1)
{
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(0);
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Range = diff;
}
//selected row changed
else if(diff == 0 && actSelRowCount != 0)
{
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2);
aEvent.Range = 0;
}
@@ -882,7 +735,7 @@ void SVTXGridControl::ImplCallItemListeners()
//selection changed: multiple row deselected, only 1 row is selected
if(actSelRowCount == 1)
{
- aEvent.Row = selRows[actSelRowCount-1];
+ aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 );
aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2);
}
//row is deselected
@@ -897,3 +750,31 @@ void SVTXGridControl::ImplCallItemListeners()
m_aSelectionListeners.selectionChanged( aEvent );
}
}
+
+//----------------------------------------------------------------------------------------------------------------------
+void SVTXGridControl::impl_updateColumnsFromModel_nothrow()
+{
+ Reference< XGridColumnModel > const xColumnModel( m_pTableModel->getColumnModel() );
+ ENSURE_OR_RETURN_VOID( xColumnModel.is(), "no model!" );
+ TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
+ ENSURE_OR_RETURN_VOID( pTable != NULL, "no table!" );
+
+ try
+ {
+ const Sequence< Reference< XGridColumn > > columns = xColumnModel->getColumns();
+ for ( const Reference< XGridColumn >* colRef = columns.getConstArray();
+ colRef != columns.getConstArray() + columns.getLength();
+ ++colRef
+ )
+ {
+ ENSURE_OR_CONTINUE( colRef->is(), "illegal column!" );
+
+ m_pTableModel->appendColumn( *colRef );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
diff --git a/svtools/source/uno/svtxgridcontrol.hxx b/svtools/source/uno/svtxgridcontrol.hxx
index b15507e4614f..525327b3c760 100755
--- a/svtools/source/uno/svtxgridcontrol.hxx
+++ b/svtools/source/uno/svtxgridcontrol.hxx
@@ -32,86 +32,88 @@
#include <svtools/table/tablecontrol.hxx>
#include <com/sun/star/awt/grid/XGridControl.hpp>
#include <com/sun/star/awt/grid/XGridDataListener.hpp>
-#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
#include <com/sun/star/awt/grid/GridDataEvent.hpp>
#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxwindows.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase4.hxx>
#include <toolkit/helper/listenermultiplexer.hxx>
using namespace ::svt::table;
-class SVTXGridControl : public ::cppu::ImplInheritanceHelper3< VCLXWindow, ::com::sun::star::awt::grid::XGridControl,
- ::com::sun::star::awt::grid::XGridDataListener, ::com::sun::star::awt::grid::XGridColumnListener>
+typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow
+ , ::com::sun::star::awt::grid::XGridControl
+ , ::com::sun::star::awt::grid::XGridDataListener
+ , ::com::sun::star::container::XContainerListener
+ > SVTXGridControl_Base;
+class SVTXGridControl : public SVTXGridControl_Base
{
private:
- ::boost::shared_ptr< UnoControlTableModel > m_pTableModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >m_xDataModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >m_xColumnModel;
- bool m_bHasColumnHeaders;
- bool m_bHasRowHeaders;
- bool m_bVScroll;
- bool m_bHScroll;
- bool m_bUpdate;
- sal_Int32 m_nSelectedRowCount;
- SelectionListenerMultiplexer m_aSelectionListeners;
+ ::boost::shared_ptr< UnoControlTableModel > m_pTableModel;
+ bool m_bHasColumnHeaders;
+ bool m_bHasRowHeaders;
+ bool m_bTableModelInitCompleted;
+ sal_Int32 m_nSelectedRowCount;
+ SelectionListenerMultiplexer m_aSelectionListeners;
protected:
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
void ImplCallItemListeners();
public:
- SVTXGridControl();
+ SVTXGridControl();
~SVTXGridControl();
- //XGridDataListener overridables
- virtual void SAL_CALL rowAdded(const ::com::sun::star::awt::grid::GridDataEvent& Event) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL rowRemoved(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL dataChanged(const ::com::sun::star::awt::grid::GridDataEvent & Event) throw (::com::sun::star::uno::RuntimeException);
- //XGridColumnListener overridables
- virtual void SAL_CALL columnChanged(const ::com::sun::star::awt::grid::GridColumnEvent & Event) throw (::com::sun::star::uno::RuntimeException);
+ // XGridDataListener
+ virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::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() { VCLXWindow::acquire(); }
- void SAL_CALL release() throw() { VCLXWindow::release(); }
+ // 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);
- // ::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);
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
- //::com::sun::star::awt::grid::XGridControl
- virtual ::sal_Int32 SAL_CALL getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ // XGridSelection
+ virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL isCellEditable() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectColumn(::sal_Int32 x) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const ::com::sun::star::uno::Sequence< sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException);
+
+ // XGridControl
+ virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
- void SAL_CALL setVisible(sal_Bool bVisible) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setFocus() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XComponent
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
- };
- #endif // _SVT_GRIDCONTROL_HXX_
+
+protected:
+ // VCLXWindow
+ virtual void SetWindow( Window* pWindow );
+
+private:
+ void impl_updateColumnsFromModel_nothrow();
+ void impl_checkTableModelInit();
+};
+#endif // _SVT_GRIDCONTROL_HXX_
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index d6809635e5e5..c36368023a22 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -1360,7 +1360,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
case BASEPROPERTY_TREE_DATAMODEL:
onChangeDataModel( rTree, Reference< XTreeDataModel >( aValue, UNO_QUERY ) );
break;
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
{
sal_Int32 nHeight = 0;
if( aValue >>= nHeight )
@@ -1445,7 +1445,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
}
return Any( eSelectionType );
}
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
return Any( (sal_Int32)rTree.GetEntryHeight() );
case BASEPROPERTY_TREE_DATAMODEL:
return Any( mxDataModel );
diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx
index d239ee3c740d..933363115810 100644
--- a/svtools/source/uno/unocontroltablemodel.cxx
+++ b/svtools/source/uno/unocontroltablemodel.cxx
@@ -28,486 +28,866 @@
#include "precompiled_svtools.hxx"
#include "unocontroltablemodel.hxx"
-#include <com/sun/star/view/SelectionType.hpp>
-#include "svtools/table/gridtablerenderer.hxx"
+#include "unogridcolumnfacade.hxx"
+
#include "svtools/table/defaultinputhandler.hxx"
+#include "svtools/table/gridtablerenderer.hxx"
#include "svtools/table/tablecontrol.hxx"
-#include <comphelper/sequence.hxx>
-#include <rtl/ref.hxx>
-#include <tools/debug.hxx>
-#include <toolkit/helper/property.hxx>
-#include <comphelper/processfactory.hxx>
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+#include <com/sun/star/awt/grid/XSortableGridData.hpp>
+/** === end UNO includes === **/
-using ::rtl::OUString;
-using namespace ::svt::table;
-using namespace ::com::sun::star::uno;
+#include <comphelper/stlunosequence.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::awt::grid::XGridColumnListener;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::grid::GridColumnEvent;
+ using ::com::sun::star::awt::grid::XGridDataModel;
+ using ::com::sun::star::awt::grid::XGridColumnModel;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment;
+ using ::com::sun::star::style::VerticalAlignment_TOP;
+ using ::com::sun::star::style::VerticalAlignment;
+ using ::com::sun::star::uno::WeakReference;
+ using ::com::sun::star::awt::grid::GridDataEvent;
+ using ::com::sun::star::awt::grid::XSortableGridData;
+ using ::com::sun::star::beans::Pair;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= UnoControlTableModel_Impl
+ //==================================================================================================================
+ typedef ::std::vector< PTableModelListener > ModellListeners;
+ typedef ::std::vector< PColumnModel > ColumnModels;
+ struct UnoControlTableModel_Impl
+ {
+ ColumnModels aColumns;
+ bool bHasColumnHeaders;
+ bool bHasRowHeaders;
+ ScrollbarVisibility eVScrollMode;
+ ScrollbarVisibility eHScrollMode;
+ PTableRenderer pRenderer;
+ PTableInputHandler pInputHandler;
+ TableMetrics nRowHeight;
+ TableMetrics nColumnHeaderHeight;
+ TableMetrics nRowHeaderWidth;
+ ::boost::optional< ::Color > m_aGridLineColor;
+ ::boost::optional< ::Color > m_aHeaderBackgroundColor;
+ ::boost::optional< ::Color > m_aHeaderTextColor;
+ ::boost::optional< ::Color > m_aTextColor;
+ ::boost::optional< ::Color > m_aTextLineColor;
+ ::boost::optional< ::std::vector< ::Color > > m_aRowColors;
+ VerticalAlignment m_eVerticalAlign;
+ ModellListeners m_aListeners;
+ WeakReference< XGridDataModel > m_aDataModel;
+ WeakReference< XGridColumnModel > m_aColumnModel;
+ UnoControlTableModel_Impl()
+ :aColumns ( )
+ ,bHasColumnHeaders ( true )
+ ,bHasRowHeaders ( false )
+ ,eVScrollMode ( ScrollbarShowNever )
+ ,eHScrollMode ( ScrollbarShowNever )
+ ,pRenderer ( )
+ ,pInputHandler ( )
+ ,nRowHeight ( 10 )
+ ,nColumnHeaderHeight ( 10 )
+ ,nRowHeaderWidth ( 10 )
+ ,m_aGridLineColor ( )
+ ,m_aHeaderBackgroundColor ( )
+ ,m_aHeaderTextColor ( )
+ ,m_aTextColor ( )
+ ,m_aTextLineColor ( )
+ ,m_aRowColors ( )
+ ,m_eVerticalAlign ( VerticalAlignment_TOP )
+ {
+ }
+ };
- //--------------------------------------------------------------------
- UnoControlTableColumn::UnoControlTableColumn(Reference<XGridColumn> m_xGridColumn)
- :m_nID( 0 )
- ,m_sName()
- ,m_bIsResizable( true )
- ,m_nWidth( 4 )
- ,m_nMinWidth( 0 )
- ,m_nMaxWidth( 0 )
- ,m_nPrefWidth ( 0 )
- ,m_xHorizontalAlign(com::sun::star::style::HorizontalAlignment(0))
- {
- m_sName = m_xGridColumn->getTitle();
- }
- //--------------------------------------------------------------------
- UnoControlTableColumn::UnoControlTableColumn()
- :m_nID( 0 )
- ,m_sName()
- ,m_bIsResizable( true )
- ,m_nWidth( 4 )
- ,m_nMinWidth( 0 )
- ,m_nMaxWidth( 0 )
- ,m_nPrefWidth ( 0 )
- ,m_xHorizontalAlign(com::sun::star::style::HorizontalAlignment(0))
+ //==================================================================================================================
+ //= UnoControlTableModel
+ //==================================================================================================================
+#ifdef DBG_UTIL
+ const char* UnoControlTableModel_checkInvariants( const void* _pInstance )
{
+ return static_cast< const UnoControlTableModel* >( _pInstance )->checkInvariants();
}
- //--------------------------------------------------------------------
- ColumnID UnoControlTableColumn::getID() const
+ //------------------------------------------------------------------------------------------------------------------
+ const char* UnoControlTableModel::checkInvariants() const
{
- return m_nID;
- }
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ if ( !xDataModel.is() )
+ return "data model anymore";
- //--------------------------------------------------------------------
- bool UnoControlTableColumn::setID( const ColumnID _nID )
- {
- m_nID = _nID;
- return true;
- }
+ // TODO: more?
- //--------------------------------------------------------------------
- String UnoControlTableColumn::getName() const
- {
- return m_sName;
+ return NULL;
}
+#endif
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setName( const String& _rName )
+#define DBG_CHECK_ME() \
+ DBG_TESTSOLARMUTEX(); \
+ DBG_CHKTHIS( UnoControlTableModel, UnoControlTableModel_checkInvariants )
+
+ //------------------------------------------------------------------------------------------------------------------
+ DBG_NAME( UnoControlTableModel )
+ UnoControlTableModel::UnoControlTableModel()
+ :m_pImpl( new UnoControlTableModel_Impl )
{
- m_sName = _rName;
+ DBG_CTOR( UnoControlTableModel, UnoControlTableModel_checkInvariants );
+ m_pImpl->bHasColumnHeaders = true;
+ m_pImpl->bHasRowHeaders = false;
+ m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) );
+ m_pImpl->pInputHandler.reset( new DefaultInputHandler );
}
- //--------------------------------------------------------------------
- bool UnoControlTableColumn::isResizable() const
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoControlTableModel::~UnoControlTableModel()
{
- return m_bIsResizable;
+ DBG_DTOR( UnoControlTableModel, UnoControlTableModel_checkInvariants );
+ DELETEZ( m_pImpl );
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setResizable( bool _bResizable )
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize UnoControlTableModel::getColumnCount() const
{
- m_bIsResizable = _bResizable;
+ DBG_CHECK_ME();
+ return (TableSize)m_pImpl->aColumns.size();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableSize UnoControlTableModel::getRowCount() const
{
- return m_nWidth;
+ DBG_CHECK_ME();
+
+ TableSize nRowCount = 0;
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_THROW( xDataModel.is(), "no data model anymore!" );
+ nRowCount = xDataModel->getRowCount();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return nRowCount;
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setWidth( TableMetrics _nWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasColumnHeaders() const
{
- m_nWidth = _nWidth;
+ DBG_CHECK_ME();
+ return m_pImpl->bHasColumnHeaders;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getMinWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasRowHeaders() const
{
- return m_nMinWidth;
+ DBG_CHECK_ME();
+ return m_pImpl->bHasRowHeaders;
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setMinWidth( TableMetrics _nMinWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeaders(bool _bRowHeaders)
{
- m_nMinWidth = _nMinWidth;
+ DBG_CHECK_ME();
+ if ( m_pImpl->bHasRowHeaders == _bRowHeaders )
+ return;
+
+ m_pImpl->bHasRowHeaders = _bRowHeaders;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getMaxWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnHeaders(bool _bColumnHeaders)
{
- return m_nMaxWidth;
+ DBG_CHECK_ME();
+ if ( m_pImpl->bHasColumnHeaders == _bColumnHeaders )
+ return;
+
+ m_pImpl->bHasColumnHeaders = _bColumnHeaders;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setMaxWidth( TableMetrics _nMaxWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::isCellEditable( ColPos col, RowPos row ) const
{
- m_nMaxWidth = _nMaxWidth;
+ DBG_CHECK_ME();
+ (void)col;
+ (void)row;
+ return false;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableColumn::getPreferredWidth() const
+
+ //------------------------------------------------------------------------------------------------------------------
+ PColumnModel UnoControlTableModel::getColumnModel( ColPos column )
{
- return m_nPrefWidth;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN( ( column >= 0 ) && ( column < getColumnCount() ),
+ "DefaultTableModel::getColumnModel: invalid index!", PColumnModel() );
+ return m_pImpl->aColumns[ column ];
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setPreferredWidth( TableMetrics _nPrefWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::appendColumn( Reference< XGridColumn > const & i_column )
{
- m_nPrefWidth = _nPrefWidth;
+ DBG_CHECK_ME();
+ insertColumn( m_pImpl->aColumns.size(), i_column );
}
- //--------------------------------------------------------------------
- ::com::sun::star::style::HorizontalAlignment UnoControlTableColumn::getHorizontalAlign()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::insertColumn( ColPos const i_position, Reference< XGridColumn > const & i_column )
{
- return m_xHorizontalAlign;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_position >= 0 ) && ( size_t( i_position ) <= m_pImpl->aColumns.size() ),
+ "UnoControlTableModel::insertColumn: illegal position!" );
+
+ const PColumnModel pColumn( new UnoGridColumnFacade( *this, i_column ) );
+ m_pImpl->aColumns.insert( m_pImpl->aColumns.begin() + i_position, pColumn );
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnInserted( i_position );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableColumn::setHorizontalAlign( com::sun::star::style::HorizontalAlignment _align )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeColumn( ColPos const i_position )
{
- m_xHorizontalAlign = _align;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_position >= 0 ) && ( size_t( i_position ) <= m_pImpl->aColumns.size() ),
+ "UnoControlTableModel::removeColumn: illegal position!" );
+
+ // remove the column
+ ColumnModels::iterator pos = m_pImpl->aColumns.begin() + i_position;
+ const PColumnModel pColumn = *pos;
+ m_pImpl->aColumns.erase( pos );
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnRemoved( i_position );
+ }
+
+ // dispose the column
+ UnoGridColumnFacade* pColumnImpl = dynamic_cast< UnoGridColumnFacade* >( pColumn.get() );
+ OSL_ENSURE( pColumnImpl != NULL, "UnoControlTableModel::removeColumn: illegal column implementation!" );
+ if ( pColumnImpl )
+ pColumnImpl->dispose();
}
- //====================================================================
- //= DefaultTableModel_Impl
- //====================================================================
- struct UnoControlTableModel_Impl
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeAllColumns()
{
- ::std::vector< PColumnModel > aColumns;
- TableSize nRowCount;
- bool bHasColumnHeaders;
- bool bHasRowHeaders;
- bool bVScroll;
- bool bHScroll;
- PTableRenderer pRenderer;
- PTableInputHandler pInputHandler;
- TableMetrics nRowHeight;
- TableMetrics nColumnHeaderHeight;
- TableMetrics nRowHeaderWidth;
- std::vector<rtl::OUString> aRowHeadersTitle;
- std::vector<std::vector< Any > > aCellContent;
- ::com::sun::star::util::Color m_xLineColor;
- ::com::sun::star::util::Color m_xHeaderColor;
- ::com::sun::star::util::Color m_xTextColor;
- ::com::sun::star::util::Color m_xRowColor1;
- ::com::sun::star::util::Color m_xRowColor2;
- ::com::sun::star::style::VerticalAlignment m_xVerticalAlign;
+ DBG_CHECK_ME();
+ if ( m_pImpl->aColumns.empty() )
+ return;
- UnoControlTableModel_Impl()
- :aColumns ( )
- ,nRowCount ( 0 )
- ,bHasColumnHeaders ( false )
- ,bHasRowHeaders ( false )
- ,bVScroll ( false )
- ,bHScroll ( false )
- ,pRenderer ( )
- ,pInputHandler ( )
- ,nRowHeight ( 0 )
- ,nColumnHeaderHeight( 0 )
- ,nRowHeaderWidth ( 10 )
- ,aRowHeadersTitle ( )
- ,aCellContent ( )
- ,m_xLineColor ( 0xFFFFFF )
- ,m_xHeaderColor ( 0xFFFFFF )
- ,m_xTextColor ( 0 )//black as default
- ,m_xRowColor1 ( 0xFFFFFF )
- ,m_xRowColor2 ( 0xFFFFFF )
- ,m_xVerticalAlign (com::sun::star::style::VerticalAlignment(0))
+ // dispose the column instances
+ for ( ColumnModels::const_iterator col = m_pImpl->aColumns.begin();
+ col != m_pImpl->aColumns.end();
+ ++col
+ )
{
+ UnoGridColumnFacade* pColumn = dynamic_cast< UnoGridColumnFacade* >( col->get() );
+ ENSURE_OR_CONTINUE( pColumn != NULL, "UnoControlTableModel::removeAllColumns: illegal column implementation!" );
+ pColumn->dispose();
}
- };
+ m_pImpl->aColumns.clear();
+
+ // notify listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->allColumnsRemoved();
+ }
+ }
- //====================================================================
- //= UnoControlTableModel
- //====================================================================
- //--------------------------------------------------------------------
- UnoControlTableModel::UnoControlTableModel()
- :m_pImpl( new UnoControlTableModel_Impl )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::impl_notifyTableMetricsChanged() const
{
- m_pImpl->bHasColumnHeaders = false;
- m_pImpl->bHasRowHeaders = false;
- m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) );
- m_pImpl->pInputHandler.reset( new DefaultInputHandler );
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->tableMetricsChanged();
+ }
}
- //--------------------------------------------------------------------
- UnoControlTableModel::~UnoControlTableModel()
+ //------------------------------------------------------------------------------------------------------------------
+ PTableRenderer UnoControlTableModel::getRenderer() const
{
- DELETEZ( m_pImpl );
+ DBG_CHECK_ME();
+ return m_pImpl->pRenderer;
}
- //--------------------------------------------------------------------
- TableSize UnoControlTableModel::getColumnCount() const
+ //------------------------------------------------------------------------------------------------------------------
+ PTableInputHandler UnoControlTableModel::getInputHandler() const
{
- return (TableSize)m_pImpl->aColumns.size();
+ DBG_CHECK_ME();
+ return m_pImpl->pInputHandler;
}
- //--------------------------------------------------------------------
- TableSize UnoControlTableModel::getRowCount() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getRowHeight() const
{
- return m_pImpl->nRowCount;
+ DBG_CHECK_ME();
+ return m_pImpl->nRowHeight;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasColumnHeaders() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeight(TableMetrics _nRowHeight)
{
- return m_pImpl->bHasColumnHeaders;
+ DBG_CHECK_ME();
+ if ( m_pImpl->nRowHeight == _nRowHeight )
+ return;
+
+ m_pImpl->nRowHeight = _nRowHeight;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasRowHeaders() const
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getColumnHeaderHeight() const
{
- return m_pImpl->bHasRowHeaders;
+ DBG_CHECK_ME();
+ DBG_ASSERT( hasColumnHeaders(), "DefaultTableModel::getColumnHeaderHeight: invalid call!" );
+ return m_pImpl->nColumnHeaderHeight;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaders(bool _bRowHeaders)
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoControlTableModel::getRowHeaderWidth() const
{
- m_pImpl->bHasRowHeaders = _bRowHeaders;
+ DBG_CHECK_ME();
+ DBG_ASSERT( hasRowHeaders(), "DefaultTableModel::getRowHeaderWidth: invalid call!" );
+ return m_pImpl->nRowHeaderWidth;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setColumnHeaders(bool _bColumnHeaders)
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnHeaderHeight(TableMetrics _nHeight)
{
- m_pImpl->bHasColumnHeaders = _bColumnHeaders;
+ DBG_CHECK_ME();
+ if ( m_pImpl->nColumnHeaderHeight == _nHeight )
+ return;
+
+ m_pImpl->nColumnHeaderHeight = _nHeight;
+ impl_notifyTableMetricsChanged();
}
- void UnoControlTableModel::setColumnCount(TableSize _nColCount)
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowHeaderWidth(TableMetrics _nWidth)
{
- m_pImpl->aColumns.resize( _nColCount);
+ DBG_CHECK_ME();
+ if ( m_pImpl->nRowHeaderWidth == _nWidth )
+ return;
+
+ m_pImpl->nRowHeaderWidth = _nWidth;
+ impl_notifyTableMetricsChanged();
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowCount(TableSize _nRowCount)
+
+ //------------------------------------------------------------------------------------------------------------------
+ ScrollbarVisibility UnoControlTableModel::getVerticalScrollbarVisibility() const
{
- m_pImpl->nRowCount = _nRowCount;
+ DBG_CHECK_ME();
+ return m_pImpl->eVScrollMode;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::isCellEditable( ColPos col, RowPos row ) const
+
+ //------------------------------------------------------------------------------------------------------------------
+ ScrollbarVisibility UnoControlTableModel::getHorizontalScrollbarVisibility() const
{
- (void)col;
- (void)row;
- return false;
+ DBG_CHECK_ME();
+ return m_pImpl->eHScrollMode;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::addTableModelListener( const PTableModelListener& listener )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::addTableModelListener( const PTableModelListener& i_listener )
{
- (void) listener;
- // TODO
- DBG_ERROR( "DefaultTableModel::addTableModelListener: not yet implemented!" );
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( !!i_listener, "illegal NULL listener" );
+ m_pImpl->m_aListeners.push_back( i_listener );
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::removeTableModelListener( const PTableModelListener& listener )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::removeTableModelListener( const PTableModelListener& i_listener )
{
- (void)listener;
- // TODO
- DBG_ERROR( "DefaultTableModel::removeTableModelListener: not yet implemented!" );
+ DBG_CHECK_ME();
+ for ( ModellListeners::iterator lookup = m_pImpl->m_aListeners.begin();
+ lookup != m_pImpl->m_aListeners.end();
+ ++lookup
+ )
+ {
+ if ( *lookup == i_listener )
+ {
+ m_pImpl->m_aListeners.erase( lookup );
+ return;
+ }
+ }
+ OSL_ENSURE( false, "UnoControlTableModel::removeTableModelListener: listener is not registered - sure you're doing the right thing here?" );
}
- //--------------------------------------------------------------------
- PColumnModel UnoControlTableModel::getColumnModel( ColPos column )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setVerticalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const
{
- DBG_ASSERT( ( column >= 0 ) && ( column < getColumnCount() ),
- "DefaultTableModel::getColumnModel: invalid index!" );
- return m_pImpl->aColumns[ column ];
+ DBG_CHECK_ME();
+ m_pImpl->eVScrollMode = i_visibility;
}
- //--------------------------------------------------------------------
- std::vector<PColumnModel>& UnoControlTableModel::getColumnModel()
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHorizontalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const
{
- return m_pImpl->aColumns;
+ DBG_CHECK_ME();
+ m_pImpl->eHScrollMode = i_visibility;
}
- //--------------------------------------------------------------------
- PColumnModel UnoControlTableModel::getColumnModelByID( ColumnID id )
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setDataModel( Reference< XGridDataModel > const & i_gridDataModel )
{
- (void)id;
- // TODO
- DBG_ERROR( "DefaultTableModel::getColumnModelByID: not yet implemented!" );
- return PColumnModel();
+ DBG_CHECK_ME();
+ m_pImpl->m_aDataModel = i_gridDataModel;
+ // TODO: register as listener, so we're notified of row/data changes, and can multiplex them to our
+ // own listeners
}
- //--------------------------------------------------------------------
- PTableRenderer UnoControlTableModel::getRenderer() const
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridDataModel > UnoControlTableModel::getDataModel() const
{
- return m_pImpl->pRenderer;
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ return xDataModel;
}
- //--------------------------------------------------------------------
- PTableInputHandler UnoControlTableModel::getInputHandler() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasDataModel() const
{
- return m_pImpl->pInputHandler;
+ return getDataModel().is();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getRowHeight() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setColumnModel( Reference< XGridColumnModel > const & i_gridColumnModel )
{
- return m_pImpl->nRowHeight;
+ DBG_CHECK_ME();
+ m_pImpl->m_aColumnModel = i_gridColumnModel;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeight(TableMetrics _nRowHeight)
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridColumnModel > UnoControlTableModel::getColumnModel() const
{
- m_pImpl->nRowHeight = _nRowHeight;
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ return xColumnModel;
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getColumnHeaderHeight() const
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoControlTableModel::hasColumnModel() const
{
- DBG_ASSERT( hasColumnHeaders(), "DefaultTableModel::getColumnHeaderHeight: invalid call!" );
- return m_pImpl->nColumnHeaderHeight;
+ return getColumnModel().is();
}
- //--------------------------------------------------------------------
- TableMetrics UnoControlTableModel::getRowHeaderWidth() const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::getCellContent( ColPos const i_col, RowPos const i_row, Any& o_cellContent )
{
- DBG_ASSERT( hasRowHeaders(), "DefaultTableModel::getRowHeaderWidth: invalid call!" );
- return m_pImpl->nRowHeaderWidth;
+ DBG_CHECK_ME();
+
+ o_cellContent.clear();
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN_VOID( xDataModel.is(), "UnoControlTableModel::getCellContent: no data model anymore!" );
+
+ PColumnModel const pColumn = getColumnModel( i_col );
+ UnoGridColumnFacade* pColumnImpl = dynamic_cast< UnoGridColumnFacade* >( pColumn.get() );
+ ENSURE_OR_RETURN_VOID( pColumnImpl != NULL, "UnoControlTableModel::getCellContent: no (valid) column at this position!" );
+ sal_Int32 const nDataColumnIndex = pColumnImpl->getDataColumnIndex() >= 0 ? pColumnImpl->getDataColumnIndex() : i_col;
+
+ if ( nDataColumnIndex >= xDataModel->getColumnCount() )
+ {
+ // this is allowed, in case the column model has been dynamically extended, but the data model does
+ // not (yet?) know about it.
+ // So, handle it gracefully.
+ #if OSL_DEBUG_LEVEL > 0
+ {
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ OSL_ENSURE( xColumnModel.is() && i_col < xColumnModel->getColumnCount(),
+ "UnoControlTableModel::getCellContent: request a column's value which the ColumnModel doesn't know about!" );
+ }
+ #endif
+ }
+ else
+ {
+ o_cellContent = xDataModel->getCellData( nDataColumnIndex, i_row );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setColumnHeaderHeight(TableMetrics _nHeight)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::getCellToolTip( ColPos const i_col, RowPos const i_row, Any& o_cellToolTip )
{
- m_pImpl->nColumnHeaderHeight = _nHeight;
+ DBG_CHECK_ME();
+ try
+ {
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_THROW( xDataModel.is(), "no data model anymore!" );
+
+ o_cellToolTip = xDataModel->getCellToolTip( i_col, i_row );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaderWidth(TableMetrics _nWidth)
+ //------------------------------------------------------------------------------------------------------------------
+ Any UnoControlTableModel::getRowHeading( RowPos const i_rowPos ) const
{
- m_pImpl->nRowHeaderWidth = _nWidth;
+ DBG_CHECK_ME();
+
+ Any aRowHeading;
+
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN( xDataModel.is(), "UnoControlTableModel::getRowHeading: no data model anymore!", aRowHeading );
+
+ try
+ {
+ aRowHeading = xDataModel->getRowHeading( i_rowPos );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aRowHeading;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::SetTitleHeight( TableMetrics _nHeight )
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
{
- DBG_ASSERT( _nHeight > 0, "DefaultTableModel::SetTitleHeight: invalid height value!" );
- m_pImpl->nColumnHeaderHeight = _nHeight;
- // TODO: notification
+ void lcl_setColor( Any const & i_color, ::boost::optional< ::Color > & o_convertedColor )
+ {
+ if ( !i_color.hasValue() )
+ o_convertedColor.reset();
+ else
+ {
+ sal_Int32 nColor = COL_TRANSPARENT;
+ if ( i_color >>= nColor )
+ {
+ o_convertedColor.reset( ::Color( nColor ) );
+ }
+ else
+ {
+ OSL_ENSURE( false, "lcl_setColor: could not extract color value!" );
+ }
+ }
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::SetHandleWidth( TableMetrics _nWidth )
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getLineColor() const
{
- DBG_ASSERT( _nWidth > 0, "DefaultTableModel::SetHandleWidth: invalid width value!" );
- m_pImpl->nRowHeaderWidth = _nWidth;
- // TODO: notification
+ DBG_CHECK_ME();
+ return m_pImpl->m_aGridLineColor;
}
- //--------------------------------------------------------------------
- ScrollbarVisibility UnoControlTableModel::getVerticalScrollbarVisibility(int overAllHeight, int actHeight) const
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setLineColor( Any const & i_color )
{
- if(overAllHeight>=actHeight && !m_pImpl->bVScroll)
- return ScrollbarShowNever;
- else
- return ScrollbarShowAlways;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aGridLineColor );
}
- //--------------------------------------------------------------------
- ScrollbarVisibility UnoControlTableModel::getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getHeaderBackgroundColor() const
{
- if(overAllWidth>=actWidth && !m_pImpl->bHScroll)
- return ScrollbarShowNever;
- else
- return ScrollbarShowAlways;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aHeaderBackgroundColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setVerticalScrollbarVisibility(bool _bVScroll) const
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHeaderBackgroundColor( Any const & i_color )
{
- m_pImpl->bVScroll = _bVScroll;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aHeaderBackgroundColor );
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setHorizontalScrollbarVisibility(bool _bHScroll) const
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getHeaderTextColor() const
{
- m_pImpl->bHScroll = _bHScroll;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aHeaderTextColor;
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasVerticalScrollbar()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setHeaderTextColor( Any const & i_color )
{
- return m_pImpl->bVScroll;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aHeaderTextColor );
}
- //--------------------------------------------------------------------
- bool UnoControlTableModel::hasHorizontalScrollbar()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getTextColor() const
{
- return m_pImpl->bHScroll;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aTextColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setCellContent(const std::vector<std::vector< Any > >& cellContent)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setTextColor( Any const & i_color )
{
- m_pImpl->aCellContent = cellContent;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aTextColor );
}
- std::vector<std::vector< Any > >& UnoControlTableModel::getCellContent()
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::Color > UnoControlTableModel::getTextLineColor() const
{
- return m_pImpl->aCellContent;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aTextColor;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent)
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setTextLineColor( Any const & i_color )
{
- m_pImpl->aRowHeadersTitle = cellColumnContent;
+ DBG_CHECK_ME();
+ lcl_setColor( i_color, m_pImpl->m_aTextLineColor );
}
- std::vector<rtl::OUString>& UnoControlTableModel::getRowHeaderName()
+ //------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< ::std::vector< ::Color > > UnoControlTableModel::getRowBackgroundColors() const
{
- return m_pImpl->aRowHeadersTitle;
+ DBG_CHECK_ME();
+ return m_pImpl->m_aRowColors;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getLineColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue )
{
- return m_pImpl->m_xLineColor;
+ DBG_CHECK_ME();
+ Sequence< ::com::sun::star::util::Color > aAPIColors;
+ if ( !( i_APIValue >>= aAPIColors ) )
+ m_pImpl->m_aRowColors.reset();
+ else
+ {
+ ::std::vector< ::Color > aColors( aAPIColors.getLength() );
+ for ( sal_Int32 i=0; i<aAPIColors.getLength(); ++i )
+ {
+ aColors[i] = ::Color( aAPIColors[i] );
+ }
+ m_pImpl->m_aRowColors.reset( aColors );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setLineColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ VerticalAlignment UnoControlTableModel::getVerticalAlign() const
{
- m_pImpl->m_xLineColor = _rColor;
+ DBG_CHECK_ME();
+ return m_pImpl->m_eVerticalAlign;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getHeaderBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::setVerticalAlign( VerticalAlignment _xAlign )
{
- return m_pImpl->m_xHeaderColor;
+ DBG_CHECK_ME();
+ m_pImpl->m_eVerticalAlign = _xAlign;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setHeaderBackgroundColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ ColPos UnoControlTableModel::getColumnPos( UnoGridColumnFacade const & i_column ) const
{
- m_pImpl->m_xHeaderColor = _rColor;
+ DBG_CHECK_ME();
+ for ( ColumnModels::const_iterator col = m_pImpl->aColumns.begin();
+ col != m_pImpl->aColumns.end();
+ ++col
+ )
+ {
+ if ( &i_column == col->get() )
+ return col - m_pImpl->aColumns.begin();
+ }
+ OSL_ENSURE( false, "UnoControlTableModel::getColumnPos: column not found!" );
+ return COL_INVALID;
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getTextColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ITableDataSort* UnoControlTableModel::getSortAdapter()
{
- return m_pImpl->m_xTextColor;
+ DBG_CHECK_ME();
+
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY );
+ if ( xSortAccess.is() )
+ return this;
+ return NULL;
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setTextColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection )
{
- m_pImpl->m_xTextColor = _rColor;
+ DBG_CHECK_ME();
+
+ try
+ {
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY_THROW );
+ xSortAccess->sortByColumn( i_column, i_sortDirection == ColumnSortAscending );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getOddRowBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnSort UnoControlTableModel::getCurrentSortOrder() const
{
- return m_pImpl->m_xRowColor1;
+ DBG_CHECK_ME();
+
+ ColumnSort currentSort;
+ try
+ {
+ Reference< XSortableGridData > const xSortAccess( getDataModel(), UNO_QUERY_THROW );
+ Pair< ::sal_Int32, ::sal_Bool > const aCurrentSortOrder( xSortAccess->getCurrentSortOrder() );
+ currentSort.nColumnPos = aCurrentSortOrder.First;
+ currentSort.eSortDirection = aCurrentSortOrder.Second ? ColumnSortAscending : ColumnSortDescending;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return currentSort;
}
//--------------------------------------------------------------------
- void UnoControlTableModel::setOddRowBackgroundColor( ::com::sun::star::util::Color _rColor )
+ void UnoControlTableModel::notifyColumnChange( ColPos const i_columnPos, ColumnAttributeGroup const i_attributeGroup ) const
{
- m_pImpl->m_xRowColor1 = _rColor;
+ DBG_CHECK_ME();
+ ENSURE_OR_RETURN_VOID( ( i_columnPos >= 0 ) && ( i_columnPos < getColumnCount() ),
+ "UnoControlTableModel::notifyColumnChange: invalid column index!" );
+
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->columnChanged( i_columnPos, i_attributeGroup );
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::util::Color UnoControlTableModel::getEvenRowBackgroundColor()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyRowsInserted( GridDataEvent const & i_event ) const
{
- return m_pImpl->m_xRowColor2;
+ // check sanity of the event
+ ENSURE_OR_RETURN_VOID( i_event.FirstRow >= 0, "UnoControlTableModel::notifyRowsInserted: invalid first row!" );
+ ENSURE_OR_RETURN_VOID( i_event.LastRow >= i_event.FirstRow, "UnoControlTableModel::notifyRowsInserted: invalid row indexes!" );
+
+ // check own sanity
+ Reference< XGridColumnModel > const xColumnModel( m_pImpl->m_aColumnModel );
+ ENSURE_OR_RETURN_VOID( xColumnModel.is(), "UnoControlTableModel::notifyRowsInserted: no column model anymore!" );
+
+ Reference< XGridDataModel > const xDataModel( m_pImpl->m_aDataModel );
+ ENSURE_OR_RETURN_VOID( xDataModel.is(), "UnoControlTableModel::notifyRowsInserted: no data model anymore!" );
+
+ // implicitly add columns to the column model
+ // TODO: is this really a good idea?
+ sal_Int32 const dataColumnCount = xDataModel->getColumnCount();
+ OSL_ENSURE( dataColumnCount > 0, "UnoControlTableModel::notifyRowsInserted: no columns at all?" );
+
+ sal_Int32 const modelColumnCount = xColumnModel->getColumnCount();
+ if ( ( modelColumnCount == 0 ) && ( dataColumnCount > 0 ) )
+ {
+ // TODO: shouldn't we clear the mutexes guard for this call?
+ xColumnModel->setDefaultColumns( dataColumnCount );
+ }
+
+ // multiplex the event to our own listeners
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->rowsInserted( i_event.FirstRow, i_event.LastRow );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setEvenRowBackgroundColor( ::com::sun::star::util::Color _rColor )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyRowsRemoved( GridDataEvent const & i_event ) const
{
- m_pImpl->m_xRowColor2 = _rColor;
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->rowsRemoved( i_event.FirstRow, i_event.LastRow );
+ }
}
- //--------------------------------------------------------------------
- ::com::sun::star::style::VerticalAlignment UnoControlTableModel::getVerticalAlign()
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyDataChanged( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const
{
- return m_pImpl->m_xVerticalAlign;
+ ColPos const firstCol = i_event.FirstColumn == -1 ? 0 : i_event.FirstColumn;
+ ColPos const lastCol = i_event.FirstColumn == -1 ? getColumnCount() - 1 : i_event.LastColumn;
+ RowPos const firstRow = i_event.FirstRow == -1 ? 0 : i_event.FirstRow;
+ RowPos const lastRow = i_event.FirstRow == -1 ? getRowCount() - 1 : i_event.LastRow;
+
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->cellsUpdated( firstCol, lastCol, firstRow, lastRow );
+ }
}
- //--------------------------------------------------------------------
- void UnoControlTableModel::setVerticalAlign( com::sun::star::style::VerticalAlignment _xAlign )
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoControlTableModel::notifyAllDataChanged() const
{
- m_pImpl->m_xVerticalAlign = _xAlign;
+ ModellListeners aListeners( m_pImpl->m_aListeners );
+ for ( ModellListeners::const_iterator loop = aListeners.begin();
+ loop != aListeners.end();
+ ++loop
+ )
+ {
+ (*loop)->cellsUpdated( 0, getColumnCount() - 1, 0, getRowCount() - 1 );
+ }
}
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
diff --git a/svtools/source/uno/unocontroltablemodel.hxx b/svtools/source/uno/unocontroltablemodel.hxx
index c00642448f79..537c3d9a5249 100644
--- a/svtools/source/uno/unocontroltablemodel.hxx
+++ b/svtools/source/uno/unocontroltablemodel.hxx
@@ -28,67 +28,37 @@
#ifndef _UNOCONTROL_TABLEMODEL_HXX_
#define _UNOCONTROL_TABLEMODEL_HXX_
-#include <svtools/table/tablemodel.hxx>
-#include <svtools/table/tablecontrol.hxx>
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridControl.hpp>
-#include <com/sun/star/awt/grid/XGridDataListener.hpp>
#include <com/sun/star/awt/grid/GridDataEvent.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
-#include <toolkit/awt/vclxwindow.hxx>
-#include <toolkit/awt/vclxwindows.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <com/sun/star/style/HorizontalAlignment.hpp>
+/** === end UNO includes === **/
+#include <cppuhelper/implbase2.hxx>
+#include <rtl/ref.hxx>
-using namespace ::svt::table;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt::grid;
+#include <boost/noncopyable.hpp>
-class UnoControlTableColumn : public IColumnModel
-{
- private:
- ColumnID m_nID;
- String m_sName;
- bool m_bIsResizable;
- TableMetrics m_nWidth;
- TableMetrics m_nMinWidth;
- TableMetrics m_nMaxWidth;
- TableMetrics m_nPrefWidth;
- ::com::sun::star::style::HorizontalAlignment m_xHorizontalAlign;
-
- public:
- UnoControlTableColumn(Reference<XGridColumn>);
- UnoControlTableColumn();
-
- // IColumnModel overridables
- virtual ColumnID getID() const;
- virtual bool setID( const ColumnID _nID );
- virtual String getName() const;
- virtual void setName( const String& _rName );
- virtual bool isResizable() const;
- virtual void setResizable( bool _bResizable );
- virtual TableMetrics getWidth() const;
- virtual void setWidth( TableMetrics _nWidth );
- virtual TableMetrics getMinWidth() const;
- virtual void setMinWidth( TableMetrics _nMinWidth );
- virtual TableMetrics getMaxWidth() const;
- virtual void setMaxWidth( TableMetrics _nMaxWidth );
- virtual TableMetrics getPreferredWidth() const;
- virtual void setPreferredWidth( TableMetrics _nPrefWidth );
- virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign();
- virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign);
-};
-
-struct UnoControlTableModel_Impl;
-
-class UnoControlTableModel : public ITableModel
+// .....................................................................................................................
+namespace svt { namespace table
{
+// .....................................................................................................................
+
+ //==================================================================================================================
+ //= UnoControlTableModel
+ //==================================================================================================================
+ class UnoGridColumnFacade;
+ struct UnoControlTableModel_Impl;
+ class UnoControlTableModel : public ITableModel, public ITableDataSort
+ {
private:
UnoControlTableModel_Impl* m_pImpl;
@@ -96,82 +66,102 @@ class UnoControlTableModel : public ITableModel
UnoControlTableModel();
~UnoControlTableModel();
- /// returns the current row height, in 1/100 millimeters
- inline TableMetrics GetRowHeight() const { return getRowHeight(); }
- /// sets a new row height.
- void setRowHeight( TableMetrics _nHeight );
- /// sets a new row header width.
- void setRowHeaderWidth( TableMetrics _nWidth );
- /// sets a new column header height.
- void setColumnHeaderHeight( TableMetrics _nHeight );
-
- /// returns the height of the title row (containing the column headers)
- inline TableMetrics GetTitleHeight() const { return getColumnHeaderHeight(); }
- /// sets a new height for the title row (containing the column headers)
- void SetTitleHeight( TableMetrics _nHeight );
-
- /// returns the width of the handle column (containing the row headers)
- inline TableMetrics GetHandleWidth() const { return getRowHeaderWidth(); }
- /// sets a new width for the handle column (containing the row headers)
- void SetHandleWidth( TableMetrics _nWidth );
-
- /// sets the width of a column
- inline void SetColumnWidth( ColPos _nColumn, TableMetrics _nWidth100thMM );
- /// retrieves the width of a column, in 1/100th millimeters
- inline TableMetrics GetColumnWidth( ColPos _nColumn );
-
public:
// ITableModel overridables
- virtual TableSize getColumnCount() const;
- virtual TableSize getRowCount() const;
- virtual void setColumnCount(TableSize _nColCount);
- virtual void setRowCount(TableSize _nRowCount);
- virtual bool hasColumnHeaders() const;
- virtual bool hasRowHeaders() const;
- virtual void setRowHeaders(bool _bRowHeaders);
- virtual void setColumnHeaders(bool _bColumnHeaders);
- virtual bool isCellEditable( ColPos col, RowPos row ) const;
- virtual void addTableModelListener( const PTableModelListener& listener );
- virtual void removeTableModelListener( const PTableModelListener& listener );
- virtual PColumnModel getColumnModel( ColPos column );
- virtual std::vector<PColumnModel>& getColumnModel();
- virtual PColumnModel getColumnModelByID( ColumnID id );
- virtual PTableRenderer getRenderer() const;
- virtual PTableInputHandler getInputHandler() const;
- virtual TableMetrics getRowHeight() const;
- virtual TableMetrics getColumnHeaderHeight() const;
- virtual TableMetrics getRowHeaderWidth() const;
- virtual ScrollbarVisibility getVerticalScrollbarVisibility(int overAllHeight, int actHeight) const;
- virtual ScrollbarVisibility getHorizontalScrollbarVisibility(int overAllWidth, int actWidth) const;
- virtual void setVerticalScrollbarVisibility(bool _bVScroll) const;
- virtual void setHorizontalScrollbarVisibility(bool _bHScroll) const;
- virtual void setCellContent(const std::vector<std::vector< Any > >& cellContent);
- virtual std::vector<std::vector< Any > >& getCellContent();
- virtual void setRowHeaderName(const std::vector<rtl::OUString>& cellColumnContent);
- virtual std::vector<rtl::OUString>& getRowHeaderName();
- virtual ::com::sun::star::util::Color getLineColor();
- virtual void setLineColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getHeaderBackgroundColor();
- virtual void setHeaderBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getTextColor();
- virtual void setTextColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getOddRowBackgroundColor();
- virtual void setOddRowBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::util::Color getEvenRowBackgroundColor();
- virtual void setEvenRowBackgroundColor(::com::sun::star::util::Color _rColor);
- virtual ::com::sun::star::style::VerticalAlignment getVerticalAlign();
- virtual void setVerticalAlign(::com::sun::star::style::VerticalAlignment _rAlign);
- virtual bool hasVerticalScrollbar();
- virtual bool hasHorizontalScrollbar();
-};
-
-inline void UnoControlTableModel::SetColumnWidth( ColPos _nColumn, TableMetrics _nWidth100thMM )
-{
- getColumnModel( _nColumn )->setWidth( _nWidth100thMM );
-}
+ virtual TableSize getColumnCount() const;
+ virtual TableSize getRowCount() const;
+ virtual bool hasColumnHeaders() const;
+ virtual bool hasRowHeaders() const;
+ virtual bool isCellEditable( ColPos col, RowPos row ) const;
+ virtual PColumnModel getColumnModel( ColPos column );
+ virtual PTableRenderer getRenderer() const;
+ virtual PTableInputHandler getInputHandler() const;
+ virtual TableMetrics getRowHeight() const;
+ virtual TableMetrics getColumnHeaderHeight() const;
+ virtual TableMetrics getRowHeaderWidth() const;
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const;
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const;
+ virtual void addTableModelListener( const PTableModelListener& i_listener );
+ virtual void removeTableModelListener( const PTableModelListener& i_listener );
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any& o_cellContent );
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, ::com::sun::star::uno::Any & o_cellToolTip );
+ virtual ::com::sun::star::uno::Any getRowHeading( RowPos const i_rowPos ) const;
+ virtual ::boost::optional< ::Color > getLineColor() const;
+ virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const;
+ virtual ::boost::optional< ::Color > getHeaderTextColor() const;
+ virtual ::boost::optional< ::Color > getTextColor() const;
+ virtual ::boost::optional< ::Color > getTextLineColor() const;
+ virtual ::boost::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const;
+ virtual ::com::sun::star::style::VerticalAlignment
+ getVerticalAlign() const;
+ virtual ITableDataSort* getSortAdapter();
+
+ // ITableDataSort overridables
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection );
+ virtual ColumnSort getCurrentSortOrder() const;
+
+ // column write access
+ void appendColumn( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_column );
+ void insertColumn( ColPos const i_position, ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_column );
+ void removeColumn( ColPos const i_position );
+ void removeAllColumns();
+
+ // other operations
+ void setVerticalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const;
+ void setHorizontalScrollbarVisibility( ScrollbarVisibility const i_visibility ) const;
+
+ void setDataModel( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel > const & i_gridDataModel );
+ bool hasDataModel() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataModel >
+ getDataModel() const;
+ void setColumnModel( ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel > const & i_gridColumnModel );
+ bool hasColumnModel() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnModel >
+ getColumnModel() const;
+
+ void setRowHeaders(bool _bRowHeaders);
+ void setColumnHeaders(bool _bColumnHeaders);
+
+ void setRowHeight( TableMetrics _nHeight );
+ void setRowHeaderWidth( TableMetrics _nWidth );
+ void setColumnHeaderHeight( TableMetrics _nHeight );
+
+ void setLineColor( ::com::sun::star::uno::Any const & i_color );
+ void setHeaderBackgroundColor( ::com::sun::star::uno::Any const & i_color );
+ void setHeaderTextColor( ::com::sun::star::uno::Any const & i_color );
+ void setTextColor( ::com::sun::star::uno::Any const & i_color );
+ void setTextLineColor( ::com::sun::star::uno::Any const & i_color );
+ void setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue );
+
+ void setVerticalAlign(::com::sun::star::style::VerticalAlignment _rAlign);
+
+ // multiplexing of XGridDataListener events
+ void notifyRowsInserted( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+ void notifyRowsRemoved( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+ void notifyDataChanged( ::com::sun::star::awt::grid::GridDataEvent const & i_event ) const;
+
+ /// retrieves the index of a column within the model
+ ColPos getColumnPos( UnoGridColumnFacade const & i_column ) const;
+
+ /// notifies a change in a column belonging to the model
+ void notifyColumnChange( ColPos const i_columnPos, ColumnAttributeGroup const i_attributeGroup ) const;
+
+ /** notifies a change in all data represented by the model. To be used if you cannot specified the changed data
+ in more detail.
+ */
+ void notifyAllDataChanged() const;
+
+#ifdef DBG_UTIL
+ const char* checkInvariants() const;
+#endif
-inline TableMetrics UnoControlTableModel::GetColumnWidth( ColPos _nColumn )
-{
- return getColumnModel( _nColumn )->getWidth();
-}
- #endif // _UNOCONTROL_TABLEMODEL_HXX_
+ private:
+ void impl_notifyTableMetricsChanged() const;
+ };
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
+
+#endif // _UNOCONTROL_TABLEMODEL_HXX_
diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx
new file mode 100755
index 000000000000..d2f5e7b565fd
--- /dev/null
+++ b/svtools/source/uno/unogridcolumnfacade.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.
+ *
+ ************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#include "unogridcolumnfacade.hxx"
+#include "unocontroltablemodel.hxx"
+
+#include "svtools/table/defaultinputhandler.hxx"
+#include "svtools/table/gridtablerenderer.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/view/SelectionType.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/stlunosequence.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::awt::grid::XGridColumnListener;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::grid::GridColumnEvent;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::style::HorizontalAlignment_LEFT;
+ using ::com::sun::star::style::HorizontalAlignment;
+ /** === end UNO using === **/
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ template< class ATTRIBUTE_TYPE >
+ void lcl_set( Reference< XGridColumn > const & i_column, void ( SAL_CALL XGridColumn::*i_setter )( ATTRIBUTE_TYPE ),
+ ATTRIBUTE_TYPE i_value )
+ {
+ try
+ {
+ (i_column.get()->*i_setter) ( i_value );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ template< class ATTRIBUTE_TYPE >
+ ATTRIBUTE_TYPE lcl_get( Reference< XGridColumn > const & i_column, ATTRIBUTE_TYPE ( SAL_CALL XGridColumn::*i_getter )() )
+ {
+ ATTRIBUTE_TYPE value = ATTRIBUTE_TYPE();
+ try
+ {
+ value = (i_column.get()->*i_getter)();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return value;
+ }
+ }
+
+ //==================================================================================================================
+ //= ColumnChangeMultiplexer
+ //==================================================================================================================
+ typedef ::cppu::WeakImplHelper1 < XGridColumnListener
+ > ColumnChangeMultiplexer_Base;
+ class ColumnChangeMultiplexer :public ColumnChangeMultiplexer_Base
+ ,public ::boost::noncopyable
+ {
+ public:
+ ColumnChangeMultiplexer( UnoGridColumnFacade& i_colImpl );
+
+ void dispose();
+
+ protected:
+ ~ColumnChangeMultiplexer();
+
+ // XGridColumnListener
+ virtual void SAL_CALL columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const EventObject& i_event ) throw (RuntimeException);
+
+ private:
+ UnoGridColumnFacade* m_pColumnImplementation;
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnChangeMultiplexer::ColumnChangeMultiplexer( UnoGridColumnFacade& i_colImpl )
+ :m_pColumnImplementation( &i_colImpl )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ColumnChangeMultiplexer::~ColumnChangeMultiplexer()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ColumnChangeMultiplexer::dispose()
+ {
+ DBG_TESTSOLARMUTEX();
+ m_pColumnImplementation = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ColumnChangeMultiplexer::columnChanged( const GridColumnEvent& i_event ) throw (RuntimeException)
+ {
+ if ( i_event.AttributeName.equalsAscii( "DataColumnIndex" ) )
+ {
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ if ( m_pColumnImplementation != NULL )
+ m_pColumnImplementation->dataColumnIndexChanged();
+ return;
+ }
+
+ ColumnAttributeGroup nChangedAttributes( COL_ATTRS_NONE );
+
+ if ( i_event.AttributeName.equalsAscii( "HorizontalAlign" ) )
+ nChangedAttributes |= COL_ATTRS_APPEARANCE;
+
+ if ( i_event.AttributeName.equalsAscii( "ColumnWidth" )
+ || i_event.AttributeName.equalsAscii( "MaxWidth" )
+ || i_event.AttributeName.equalsAscii( "MinWidth" )
+ || i_event.AttributeName.equalsAscii( "PreferredWidth" )
+ || i_event.AttributeName.equalsAscii( "Resizeable" )
+ || i_event.AttributeName.equalsAscii( "Flexibility" )
+ )
+ nChangedAttributes |= COL_ATTRS_WIDTH;
+
+ OSL_ENSURE( nChangedAttributes != COL_ATTRS_NONE,
+ "ColumnChangeMultiplexer::columnChanged: unknown column attributed changed!" );
+
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ if ( m_pColumnImplementation != NULL )
+ m_pColumnImplementation->columnChanged( nChangedAttributes );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ColumnChangeMultiplexer::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ OSL_UNUSED( i_event );
+ }
+
+ //==================================================================================================================
+ //= UnoGridColumnFacade
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ UnoGridColumnFacade::UnoGridColumnFacade( UnoControlTableModel const & i_owner, Reference< XGridColumn > const & i_gridColumn )
+ :m_pOwner( &i_owner )
+ ,m_nDataColumnIndex( -1 )
+ ,m_xGridColumn( i_gridColumn, UNO_QUERY_THROW )
+ ,m_pChangeMultiplexer( new ColumnChangeMultiplexer( *this ) )
+ {
+ m_xGridColumn->addGridColumnListener( m_pChangeMultiplexer.get() );
+ impl_updateDataColumnIndex_nothrow();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UnoGridColumnFacade::~UnoGridColumnFacade()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::dispose()
+ {
+ DBG_TESTSOLARMUTEX();
+ ENSURE_OR_RETURN_VOID( m_pOwner != NULL, "UnoGridColumnFacade::dispose: already disposed!" );
+
+ m_xGridColumn->removeGridColumnListener( m_pChangeMultiplexer.get() );
+ m_pChangeMultiplexer->dispose();
+ m_pChangeMultiplexer.clear();
+ m_xGridColumn.clear();
+ m_pOwner = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::impl_updateDataColumnIndex_nothrow()
+ {
+ m_nDataColumnIndex = -1;
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_nDataColumnIndex = m_xGridColumn->getDataColumnIndex();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::dataColumnIndexChanged()
+ {
+ DBG_TESTSOLARMUTEX();
+ impl_updateDataColumnIndex_nothrow();
+ if ( m_pOwner != NULL )
+ m_pOwner->notifyAllDataChanged();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::columnChanged( ColumnAttributeGroup const i_attributeGroup )
+ {
+ DBG_TESTSOLARMUTEX();
+ if ( m_pOwner != NULL )
+ m_pOwner->notifyColumnChange( m_pOwner->getColumnPos( *this ), i_attributeGroup );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any UnoGridColumnFacade::getID() const
+ {
+ Any aID;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", aID );
+ try
+ {
+ aID = m_xGridColumn->getIdentifier();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return aID;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setID( const Any& i_ID )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setIdentifier( i_ID );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String UnoGridColumnFacade::getName() const
+ {
+ ::rtl::OUString sName;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", sName );
+ try
+ {
+ sName = m_xGridColumn->getTitle();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sName;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setName( const String& _rName )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setTitle( _rName );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ String UnoGridColumnFacade::getHelpText() const
+ {
+ ::rtl::OUString sHelpText;
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", sHelpText );
+ try
+ {
+ sHelpText = m_xGridColumn->getHelpText();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sHelpText;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setHelpText( const String& i_helpText )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ try
+ {
+ m_xGridColumn->setHelpText( i_helpText );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool UnoGridColumnFacade::isResizable() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", false );
+ return lcl_get( m_xGridColumn, &XGridColumn::getResizeable );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setResizable( bool i_resizable )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setResizeable, sal_Bool( i_resizable ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int32 UnoGridColumnFacade::getFlexibility() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 1 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getFlexibility );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setFlexibility( sal_Int32 const i_flexibility )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setFlexibility, i_flexibility );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getColumnWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setWidth( TableMetrics _nWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setColumnWidth, _nWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getMinWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getMinWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setMinWidth( TableMetrics _nMinWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setMinWidth, _nMinWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TableMetrics UnoGridColumnFacade::getMaxWidth() const
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", 0 );
+ return lcl_get( m_xGridColumn, &XGridColumn::getMaxWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setMaxWidth( TableMetrics _nMaxWidth )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setMinWidth, _nMaxWidth );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::style::HorizontalAlignment UnoGridColumnFacade::getHorizontalAlign()
+ {
+ ENSURE_OR_RETURN( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!", HorizontalAlignment_LEFT );
+ return lcl_get( m_xGridColumn, &XGridColumn::getHorizontalAlign );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UnoGridColumnFacade::setHorizontalAlign( com::sun::star::style::HorizontalAlignment _align )
+ {
+ ENSURE_OR_RETURN_VOID( m_xGridColumn.is(), "UnoGridColumnFacade: already disposed!" );
+ lcl_set( m_xGridColumn, &XGridColumn::setHorizontalAlign, _align );
+ }
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
diff --git a/svtools/source/uno/unogridcolumnfacade.hxx b/svtools/source/uno/unogridcolumnfacade.hxx
new file mode 100755
index 000000000000..7499621ba8af
--- /dev/null
+++ b/svtools/source/uno/unogridcolumnfacade.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 SVTOOLS_GRIDCOLUMNFACADE_HXX
+#define SVTOOLS_GRIDCOLUMNFACADE_HXX
+
+#include "svtools/table/tablemodel.hxx"
+#include "svtools/table/tablecontrol.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridColumn.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+#include <rtl/ref.hxx>
+
+#include <boost/noncopyable.hpp>
+
+// .....................................................................................................................
+namespace svt { namespace table
+{
+// .....................................................................................................................
+
+ //==================================================================================================================
+ //= UnoGridColumnFacade
+ //==================================================================================================================
+ class ColumnChangeMultiplexer;
+ class UnoControlTableModel;
+ class UnoGridColumnFacade :public IColumnModel
+ ,public ::boost::noncopyable
+ {
+ public:
+ UnoGridColumnFacade(
+ UnoControlTableModel const & i_owner,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > const & i_gridColumn
+ );
+ ~UnoGridColumnFacade();
+
+ // IColumnModel overridables
+ virtual ::com::sun::star::uno::Any
+ getID() const;
+ virtual void setID( const ::com::sun::star::uno::Any& i_ID );
+ virtual String getName() const;
+ virtual void setName( const String& _rName );
+ virtual String getHelpText() const;
+ virtual void setHelpText( const String& i_helpText );
+ virtual bool isResizable() const;
+ virtual void setResizable( bool _bResizable );
+ virtual sal_Int32 getFlexibility() const;
+ virtual void setFlexibility( sal_Int32 const i_flexibility );
+ virtual TableMetrics getWidth() const;
+ virtual void setWidth( TableMetrics _nWidth );
+ virtual TableMetrics getMinWidth() const;
+ virtual void setMinWidth( TableMetrics _nMinWidth );
+ virtual TableMetrics getMaxWidth() const;
+ virtual void setMaxWidth( TableMetrics _nMaxWidth );
+ virtual ::com::sun::star::style::HorizontalAlignment getHorizontalAlign();
+ virtual void setHorizontalAlign(::com::sun::star::style::HorizontalAlignment _xAlign);
+
+ /** disposes the column wrapper
+
+ Note that the XGridColumn which is wrapped by the instance is <strong>not</strong> disposed, as we
+ do not own it.
+ */
+ void dispose();
+
+ sal_Int32
+ getDataColumnIndex() const { return m_nDataColumnIndex; }
+
+ // callbacks for the XGridColumnListener
+ void columnChanged( ColumnAttributeGroup const i_attributeGroup );
+ void dataColumnIndexChanged();
+
+ private:
+ void impl_updateDataColumnIndex_nothrow();
+
+ private:
+ UnoControlTableModel const * m_pOwner;
+ sal_Int32 m_nDataColumnIndex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > m_xGridColumn;
+ ::rtl::Reference< ColumnChangeMultiplexer > m_pChangeMultiplexer;
+ };
+
+// .....................................................................................................................
+} } // svt::table
+// .....................................................................................................................
+
+#endif // SVTOOLS_GRIDCOLUMNFACADE_HXX
diff --git a/svx/inc/float3d.hrc b/svx/inc/float3d.hrc
index 259317275e8b..06b640ebff0e 100644
--- a/svx/inc/float3d.hrc
+++ b/svx/inc/float3d.hrc
@@ -181,4 +181,6 @@
#define BMP_TEX_CIRCLE_H 159
#define BMP_TEX_FILTER_H 160
#define BMP_COLORDLG_H 161
-
+// IAccessibility2 implementation 2009. ------
+#define STR_COLOR_LIGHT_PRE 162
+// ------ IAccessibility2 implementation 2009.
diff --git a/svx/inc/svx/bmpmask.hxx b/svx/inc/svx/bmpmask.hxx
index 39ae551db3dd..ae0ac7b9d630 100644
--- a/svx/inc/svx/bmpmask.hxx
+++ b/svx/inc/svx/bmpmask.hxx
@@ -96,6 +96,9 @@ class SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow
PushButton aBtnExec;
FixedLine aGrpQ;
+ FixedText aFt1;
+ FixedText aFt2;
+ FixedText aFt3;
CheckBox aCbx1;
MaskSet* pQSet1;
MetricField aSp1;
@@ -119,9 +122,7 @@ class SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow
MaskData* pData;
CheckBox aCbxTrans;
ColorLB aLbColorTrans;
- FixedText aFt1;
- FixedText aFt2;
- FixedText aFt3;
+
const XColorTable* pColTab;
Color aPipetteColor;
SvxBmpMaskSelectItem aSelItem;
diff --git a/svx/inc/svx/chrtitem.hxx b/svx/inc/svx/chrtitem.hxx
index bc68bf1df705..ce1f5ea0753f 100644
--- a/svx/inc/svx/chrtitem.hxx
+++ b/svx/inc/svx/chrtitem.hxx
@@ -114,21 +114,6 @@ enum SvxChartDataDescr
#define CHDESCR_COUNT (CHDESCR_TEXTANDVALUE + 1)
-enum SvxChartLegendPos
-{
- CHLEGEND_NONE,
- CHLEGEND_LEFT,
- CHLEGEND_TOP,
- CHLEGEND_RIGHT,
- CHLEGEND_BOTTOM,
- CHLEGEND_NONE_TOP,
- CHLEGEND_NONE_LEFT,
- CHLEGEND_NONE_RIGHT,
- CHLEGEND_NONE_BOTTOM
-};
-
-#define CHLEGEND_COUNT (CHLEGEND_BOTTOM + 1)
-
enum SvxChartTextOrder
{
CHTXTORDER_SIDEBYSIDE,
@@ -243,25 +228,6 @@ public:
//------------------------------------------------------------------
-class SVX_DLLPUBLIC SvxChartLegendPosItem : public SfxEnumItem
-{
-public:
- TYPEINFO();
- SvxChartLegendPosItem(SvxChartLegendPos eLegendPos /*= CHLEGEND_NONE*/,
- sal_uInt16 nId );
- SvxChartLegendPosItem(SvStream& rIn,
- sal_uInt16 nId );
-
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
- virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
-
- sal_uInt16 GetValueCount() const { return CHLEGEND_COUNT; }
- SvxChartLegendPos GetValue() const
- { return (SvxChartLegendPos)SfxEnumItem::GetValue(); }
-};
-
-//------------------------------------------------------------------
-
class SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem
{
public:
diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index b28b150bd487..3bca44105edd 100755
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -52,6 +52,14 @@
#define RID_SVXSTR_LINESTYLE (RID_SVX_START + 173)
#define RID_SVXSTR_FIELDUNIT_TABLE (RID_SVX_START + 311)
#define RID_SVXSTR_COLOR_USER (RID_SVX_START + 250)
+//IAccessibility2 Implementation 2009-----
+#define RID_SVXSTR_GALLERYPROPS_GALTHEME (RID_SVX_START + 251)
+#define RID_SVXSTR_GALLERY_THEMEITEMS (RID_SVX_START + 252)
+#define RID_SVXSTR_GALLERY_THEMENAME (RID_SVX_START + 253)
+#define RID_SVXSTR_GALLERY_FILESFOUND (RID_SVX_START + 254)
+#define RID_SVXSTR_GALLERY_PREVIEW (RID_SVX_START + 255)
+//-----IAccessibility2 Implementation 2009
+
// factory IDs of tabpages implemented in CUI
#define RID_SVXPAGE_CHAR_TWOLINES (RID_SVX_START + 242)
@@ -956,6 +964,9 @@
#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1191)
+//IAccessibility2 Implementation 2009-----
+#define RID_SVXSTR_TEXTCOLOR (RID_SVX_START + 1178)
+//-----IAccessibility2 Implementation 2009
// ----------------------------------------------------------------------------
// if we have _a_lot_ time, we should group the resource ids by type, instead
// of grouping them by semantics. The reason is that resource ids have to be
@@ -1049,5 +1060,10 @@
#define OFA_TP_TABPROPERTIES_TEXT (RID_OFA_START + 245)
#define OFA_TP_HELPERPROG (RID_OFA_START + 249)
+// IAccessibility2 implementation 2009. ------
+#define STR_COLORTABLE (RID_OFA_START + 257)
+#define STR_SWITCH (RID_OFA_START + 258)
+// ------ IAccessibility2 implementation 2009.
+
#endif
diff --git a/svx/inc/svx/float3d.hxx b/svx/inc/svx/float3d.hxx
index 13eb8a697de0..8ad3d618d271 100644
--- a/svx/inc/svx/float3d.hxx
+++ b/svx/inc/svx/float3d.hxx
@@ -84,6 +84,7 @@ private:
ImageButton aBtnUpdate;
ImageButton aBtnAssign;
+ FixedLine aFLGeometrie;
// Geometrie
FixedText aFtPercentDiagonal;
MetricField aMtrPercentDiagonal;
@@ -93,36 +94,35 @@ private:
MetricField aMtrEndAngle;
FixedText aFtDepth;
MetricField aMtrDepth;
- FixedLine aFLGeometrie;
+ FixedLine aFLSegments;
FixedText aFtHorizontal;
NumericField aNumHorizontal;
FixedText aFtVertical;
NumericField aNumVertical;
- FixedLine aFLSegments;
+ FixedLine aFLNormals;
ImageButton aBtnNormalsObj;
ImageButton aBtnNormalsFlat;
ImageButton aBtnNormalsSphere;
ImageButton aBtnNormalsInvert;
ImageButton aBtnTwoSidedLighting;
- FixedLine aFLNormals;
ImageButton aBtnDoubleSided;
-
+ FixedLine aFLRepresentation;
// Darstellung
FixedText aFtShademode;
ListBox aLbShademode;
+ FixedLine aFLShadow;
ImageButton aBtnShadow3d;
FixedText aFtSlant;
MetricField aMtrSlant;
- FixedLine aFLShadow;
FixedText aFtDistance;
MetricField aMtrDistance;
FixedText aFtFocalLeng;
MetricField aMtrFocalLength;
FixedLine aFLCamera;
- FixedLine aFLRepresentation;
+ FixedLine aFLLight;
// Beleuchtung
ImageButton aBtnLight1;
@@ -133,6 +133,7 @@ private:
ImageButton aBtnLight6;
ImageButton aBtnLight7;
ImageButton aBtnLight8;
+ FixedText aFTLightsource;
ColorLB aLbLight1;
ColorLB aLbLight2;
ColorLB aLbLight3;
@@ -143,7 +144,6 @@ private:
ColorLB aLbLight8;
ImageButton aBtnLightColor;
- FixedText aFTLightsource;
// #99694# Keyboard shortcuts activate the next control, so the
// order needed to be changed here
@@ -151,7 +151,7 @@ private:
ColorLB aLbAmbientlight; // ListBox
ImageButton aBtnAmbientColor; // color button
- FixedLine aFLLight;
+ FixedLine aFLTexture;
// Texturen
FixedText aFtTexKind;
@@ -171,9 +171,9 @@ private:
ImageButton aBtnTexCircleY;
FixedText aFtTexFilter;
ImageButton aBtnTexFilter;
- FixedLine aFLTexture;
// Material
+ FixedLine aFLMaterial;
// Materialeditor
FixedText aFtMatFavorites;
ListBox aLbMatFavorites;
@@ -183,20 +183,20 @@ private:
FixedText aFtMatEmission;
ColorLB aLbMatEmission;
ImageButton aBtnEmissionColor;
+ FixedLine aFLMatSpecular;
FixedText aFtMatSpecular;
ColorLB aLbMatSpecular;
ImageButton aBtnSpecularColor;
FixedText aFtMatSpecularIntensity;
MetricField aMtrMatSpecularIntensity;
- FixedLine aFLMatSpecular;
- FixedLine aFLMaterial;
+
+ Svx3DPreviewControl aCtlPreview;
+ SvxLightCtl3D aCtlLightPreview;
// Unterer Teil
ImageButton aBtnConvertTo3D;
ImageButton aBtnLatheObject;
ImageButton aBtnPerspective;
- Svx3DPreviewControl aCtlPreview;
- SvxLightCtl3D aCtlLightPreview;
// der Rest ...
Image aImgLightOn;
diff --git a/svx/inc/svx/fontworkgallery.hxx b/svx/inc/svx/fontworkgallery.hxx
index 36502ccecca5..53c5b9b7bf38 100644
--- a/svx/inc/svx/fontworkgallery.hxx
+++ b/svx/inc/svx/fontworkgallery.hxx
@@ -91,8 +91,8 @@ public:
class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog
{
- ValueSet maCtlFavorites;
FixedLine maFLFavorites;
+ ValueSet maCtlFavorites;
OKButton maOKButton;
CancelButton maCancelButton;
HelpButton maHelpButton;
diff --git a/svx/inc/svx/hdft.hxx b/svx/inc/svx/hdft.hxx
index adc4745ace83..d30189ce81a0 100644
--- a/svx/inc/svx/hdft.hxx
+++ b/svx/inc/svx/hdft.hxx
@@ -70,6 +70,7 @@ protected:
SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rSet,
sal_uInt16 nSetId );
+ FixedLine aFrm;
CheckBox aTurnOnBox;
CheckBox aCntSharedBox;
FixedText aLMLbl;
@@ -82,7 +83,6 @@ protected:
FixedText aHeightFT;
MetricField aHeightEdit;
CheckBox aHeightDynBtn;
- FixedLine aFrm;
SvxPageWindow aBspWin;
PushButton aBackgroundBtn;
diff --git a/svx/inc/svx/svdstr.hrc b/svx/inc/svx/svdstr.hrc
index d778bf40326b..2049bc4c3fdc 100644
--- a/svx/inc/svx/svdstr.hrc
+++ b/svx/inc/svx/svdstr.hrc
@@ -185,8 +185,12 @@
#define STR_ObjNameSingulMEDIA (STR_ObjNameBegin + 143)
#define STR_ObjNamePluralMEDIA (STR_ObjNameBegin + 144)
-#define STR_ObjNameEnd (STR_ObjNamePluralMEDIA)
-
+//#define STR_ObjNameEnd (STR_ObjNamePluralMEDIA)
+//IAccessibility2 Implementation 2009-----
+#define STR_ObjNameSingulFONTWORK (STR_ObjNameBegin+145)
+#define STR_ObjNamePluralFONTWORK (STR_ObjNameBegin+146)
+#define STR_ObjNameEnd (STR_ObjNamePluralFONTWORK)
+//-----IAccessibility2 Implementation 2009
#define STR_EditBegin (STR_ObjNameEnd+1)
#define STR_EditWithCopy (STR_EditBegin + 0)
#define STR_EditPosSize (STR_EditBegin + 1)
diff --git a/svx/prj/build.lst b/svx/prj/build.lst
index 7b541b2d77c4..641f4e528793 100644
--- a/svx/prj/build.lst
+++ b/svx/prj/build.lst
@@ -1,2 +1,2 @@
-sx svx : sfx2 l10n oovbaapi connectivity xmloff linguistic jvmfwk avmedia drawinglayer editeng LIBXSLT:libxslt NULL
+sx svx : sfx2 L10N:l10n oovbaapi connectivity xmloff linguistic jvmfwk avmedia drawinglayer editeng LIBXSLT:libxslt NULL
sx svx\prj nmake - all sx_prj NULL
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 9c2a5fc9a3bb..b6b8ca387969 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -417,6 +417,10 @@ SvxBmpMask::SvxBmpMask( SfxBindings *pBindinx,
aBtnExec ( this, BMP_RESID( BTN_EXEC ) ),
aGrpQ ( this, BMP_RESID( GRP_Q ) ),
+ aFt1 ( this, BMP_RESID ( FT_1 ) ),
+ aFt2 ( this, BMP_RESID ( FT_2 ) ),
+ aFt3 ( this, BMP_RESID ( FT_3 ) ),
+
aCbx1 ( this, BMP_RESID( CBX_1 ) ),
pQSet1 ( new MaskSet( this, BMP_RESID( QCOL_1 ) ) ),
aSp1 ( this, BMP_RESID( SP_1 ) ),
@@ -440,9 +444,6 @@ SvxBmpMask::SvxBmpMask( SfxBindings *pBindinx,
pData ( new MaskData( this, *pBindinx ) ),
aCbxTrans ( this, BMP_RESID( CBX_TRANS ) ),
aLbColorTrans ( this, BMP_RESID ( LB_TRANS ) ),
- aFt1 ( this, BMP_RESID ( FT_1 ) ),
- aFt2 ( this, BMP_RESID ( FT_2 ) ),
- aFt3 ( this, BMP_RESID ( FT_3 ) ),
pColTab ( NULL ),
aPipetteColor ( COL_WHITE ),
aSelItem ( SID_BMPMASK_EXEC, *this, *pBindinx ),
@@ -508,6 +509,42 @@ SvxBmpMask::SvxBmpMask( SfxBindings *pBindinx,
pQSet2->Show();
pQSet3->Show();
pQSet4->Show();
+
+ aCbx1.SetAccessibleRelationMemberOf( &aGrpQ );
+ pQSet1->SetAccessibleRelationMemberOf( &aGrpQ );
+ aSp1.SetAccessibleRelationMemberOf( &aGrpQ );
+ aLbColor1.SetAccessibleRelationMemberOf( &aGrpQ );
+ aCbx1.SetAccessibleRelationLabeledBy( &aFt1 );
+ pQSet1->SetAccessibleRelationLabeledBy( &aFt1 );
+ aSp1.SetAccessibleRelationLabeledBy( &aFt2 );
+ aLbColor1.SetAccessibleRelationLabeledBy( &aFt3 );
+ aCbx2.SetAccessibleRelationMemberOf( &aGrpQ );
+ pQSet2->SetAccessibleRelationMemberOf( &aGrpQ );
+ aSp2.SetAccessibleRelationMemberOf( &aGrpQ );
+ aLbColor2.SetAccessibleRelationMemberOf( &aGrpQ );
+ aCbx2.SetAccessibleRelationLabeledBy( &aFt1 );
+ pQSet2->SetAccessibleRelationLabeledBy( &aFt1 );
+ aSp2.SetAccessibleRelationLabeledBy( &aFt2 );
+ aLbColor2.SetAccessibleRelationLabeledBy( &aFt3 );
+ aCbx3.SetAccessibleRelationMemberOf( &aGrpQ );
+ pQSet3->SetAccessibleRelationMemberOf( &aGrpQ );
+ aSp3.SetAccessibleRelationMemberOf( &aGrpQ );
+ aLbColor3.SetAccessibleRelationMemberOf( &aGrpQ );
+ aCbx3.SetAccessibleRelationLabeledBy( &aFt1 );
+ pQSet3->SetAccessibleRelationLabeledBy( &aFt1 );
+ aSp3.SetAccessibleRelationLabeledBy( &aFt2 );
+ aLbColor3.SetAccessibleRelationLabeledBy( &aFt3 );
+ aCbx4.SetAccessibleRelationMemberOf( &aGrpQ );
+ pQSet4->SetAccessibleRelationMemberOf( &aGrpQ );
+ aSp4.SetAccessibleRelationMemberOf( &aGrpQ );
+ aLbColor4.SetAccessibleRelationMemberOf( &aGrpQ );
+ aCbx4.SetAccessibleRelationLabeledBy( &aFt1 );
+ pQSet4->SetAccessibleRelationLabeledBy( &aFt1 );
+ aSp4.SetAccessibleRelationLabeledBy( &aFt2 );
+ aLbColor4.SetAccessibleRelationLabeledBy( &aFt3 );
+ aLbColorTrans.SetAccessibleRelationLabeledBy( &aCbxTrans );
+ aLbColorTrans.SetAccessibleRelationMemberOf( &aGrpQ );
+ aCbxTrans.SetAccessibleRelationMemberOf( &aGrpQ );
}
//-------------------------------------------------------------------------
diff --git a/svx/source/dialog/bmpmask.hrc b/svx/source/dialog/bmpmask.hrc
index 99c9eab04b7b..42fcc244c3f7 100644
--- a/svx/source/dialog/bmpmask.hrc
+++ b/svx/source/dialog/bmpmask.hrc
@@ -27,7 +27,11 @@
#define RID_SVXDLG_BMPMASK (RID_SVX_BMPMASK_START)
#define RID_SVXDLG_BMPMASK_STR_TRANSP (RID_SVX_BMPMASK_START + 1)
#define RID_SVXDLG_BMPMASK_STR_SOURCECOLOR (RID_SVX_BMPMASK_START + 2)
-
+/*IAccessibility2 Implementation 2009-----*/
+#define RID_SVXDLG_BMPMASK_STR_PALETTE (RID_SVX_BMPMASK_START + 3)
+#define RID_SVXDLG_BMPMASK_STR_TOLERANCE (RID_SVX_BMPMASK_START + 4)
+#define RID_SVXDLG_BMPMASK_STR_REPLACEWITH (RID_SVX_BMPMASK_START + 5)
+/*-----IAccessibility2 Implementation 2009*/
#define GRP_Q 1
#define CTR_PIPETTE 1
#define CBX_1 1
diff --git a/svx/source/dialog/bmpmask.src b/svx/source/dialog/bmpmask.src
index 7823007dbe7c..b221f633283a 100644
--- a/svx/source/dialog/bmpmask.src
+++ b/svx/source/dialog/bmpmask.src
@@ -327,47 +327,16 @@ String RID_SVXDLG_BMPMASK_STR_SOURCECOLOR
Text [ en-US ] = "Source Color";
};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+String RID_SVXDLG_BMPMASK_STR_PALETTE
+{
+ Text [ en-US ] = "Color Palette";
+};
+String RID_SVXDLG_BMPMASK_STR_TOLERANCE
+{
+ Text [ en-US ] = "Tolerance";
+};
+String RID_SVXDLG_BMPMASK_STR_REPLACEWITH
+{
+ Text [ en-US ] = "Replace with";
+};
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index c3f1f0b17a52..d8adc0560625 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -634,6 +634,7 @@ SvxTPView::SvxTPView( Window * pParent)
aTitle5 ( SVX_RES( STR_TITLE5 ) ),
aStrMyName ( SVX_RES( STR_VIEW) )
{
+ aViewData.SetAccessibleName(String(SVX_RES(STR_TREE)));
FreeResource();
aViewData.SetHelpId(HID_REDLINING_VIEW_DG_VIEW_TABLE);
@@ -826,6 +827,14 @@ SvxTPFilter::SvxTPFilter( Window * pParent)
aStrMyName ( SVX_RES( STR_FILTER) ),
bModified (sal_False)
{
+ aLbDate.SetAccessibleName( String( SVX_RES( STR_DATE_COMBOX) ) );
+ aDfDate.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN) ) );
+ aTfDate.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN) ) );
+ aDfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN1) ) );
+ aTfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN1) ) );
+ aLbAuthor.SetAccessibleName(aCbAuthor.GetText());
+ aLbAction.SetAccessibleName( String( SVX_RES( STR_ACTION) ) );
+ aEdComment.SetAccessibleName(aCbComment.GetText());
Image aImgTimeHC( SVX_RES( IMG_TIME_H ) );
FreeResource();
@@ -874,6 +883,15 @@ SvxTPFilter::SvxTPFilter( Window * pParent)
HideRange();
ShowAction();
bModified=sal_False;
+
+ aLbDate.SetAccessibleRelationLabeledBy(&aCbDate);
+ aLbAuthor.SetAccessibleRelationLabeledBy(&aCbAuthor);
+ aLbAction.SetAccessibleRelationLabeledBy(&aCbRange);
+ aEdRange.SetAccessibleRelationLabeledBy(&aCbRange);
+ aBtnRange.SetAccessibleRelationLabeledBy(&aCbRange);
+ aEdComment.SetAccessibleRelationLabeledBy(&aCbComment);
+ aDfDate2.SetAccessibleRelationLabeledBy(&aDfDate2);
+ aTfDate2.SetAccessibleRelationLabeledBy(&aTfDate2);
}
void SvxTPFilter::SetRedlinTable(SvxRedlinTable* pTable)
diff --git a/svx/source/dialog/ctredlin.hrc b/svx/source/dialog/ctredlin.hrc
index 23cc504c0573..772d985ae8c0 100644
--- a/svx/source/dialog/ctredlin.hrc
+++ b/svx/source/dialog/ctredlin.hrc
@@ -66,5 +66,12 @@
#define STR_TITLE3 3
#define STR_TITLE4 4
#define STR_TITLE5 5
-//
+//IAccessibility2 Implementation 2009-----
+#define STR_DATE_COMBOX 6
+#define STR_DATE_SPIN 7
+#define STR_DATE_SPIN1 8
+#define STR_DATE_TIME_SPIN 9
+#define STR_DATE_TIME_SPIN1 10
+#define STR_TREE 11
+//-----IAccessibility2 Implementation 2009
diff --git a/svx/source/dialog/ctredlin.src b/svx/source/dialog/ctredlin.src
index e617607ebfad..284ed97ed54e 100644
--- a/svx/source/dialog/ctredlin.src
+++ b/svx/source/dialog/ctredlin.src
@@ -114,7 +114,10 @@ TabPage SID_REDLIN_FILTER_PAGE
ImageBitmap = Bitmap { File = "time.bmp" ; };
MASKCOLOR
};
- QuickHelpText [ en-US ] = "Set Date/Time" ;
+ // IAccessibility2 implementation 2009. ------
+ //QuickHelpText [ en-US ] = "Set Date/Time" ;
+ QuickHelpText [ en-US ] = "Set Start Date/Time" ;
+ // ------ IAccessibility2 implementation 2009.
};
FixedText FT_DATE2
{
@@ -170,7 +173,10 @@ TabPage SID_REDLIN_FILTER_PAGE
ImageBitmap = Bitmap { File = "time.bmp" ; };
MASKCOLOR
};
- QuickHelpText [ en-US ] = "Set Date/Time" ;
+ // IAccessibility2 implementation 2009. ------
+ //QuickHelpText [ en-US ] = "Set Date/Time" ;
+ QuickHelpText [ en-US ] = "Set End Date/Time" ;
+ // ------ IAccessibility2 implementation 2009.
};
CheckBox CB_AUTOR
{
@@ -254,6 +260,32 @@ TabPage SID_REDLIN_FILTER_PAGE
ImageBitmap = Bitmap { File = "time_h.bmp" ; };
MASKCOLOR
};
+ /*IAccessibility2 Implementation 2009-----*/
+ String STR_DATE_COMBOX
+ {
+ Text [ en-US ] = "Date Condition" ;
+ };
+ String STR_DATE_SPIN
+ {
+ Text [ en-US ] = "Start Date" ;
+ };
+ String STR_DATE_SPIN1
+ {
+ Text [ en-US ] = "End Date" ;
+ };
+ String STR_DATE_TIME_SPIN
+ {
+ Text [ en-US ] = "Start Time" ;
+ };
+ String STR_DATE_TIME_SPIN1
+ {
+ Text [ en-US ] = "End Time" ;
+ };
+ String STR_TREE
+ {
+ Text [ en-US ] = "Changes" ;
+ };
+ /*-----IAccessibility2 Implementation 2009*/
};
TabPage SID_REDLIN_VIEW_PAGE
{
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 5f05d360007c..ee59f6ce924d 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -45,6 +45,7 @@
#include <svx/xlnwtit.hxx>
#include "helpid.hrc"
#include <algorithm>
+#include <svx/dialmgr.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -1012,6 +1013,7 @@ void SvxLightCtl3D::Init()
maHorScroller.SetHelpId(HID_CTRL3D_HSCROLL);
maVerScroller.SetHelpId(HID_CTRL3D_VSCROLL);
maSwitcher.SetHelpId(HID_CTRL3D_SWITCHER);
+ maSwitcher.SetAccessibleName(String(SVX_RES(STR_SWITCH)));
// Light preview
maLightControl.Show();
diff --git a/svx/source/dialog/dlgctrl.src b/svx/source/dialog/dlgctrl.src
index 2da544673c65..e5962dcef059 100644
--- a/svx/source/dialog/dlgctrl.src
+++ b/svx/source/dialog/dlgctrl.src
@@ -31,4 +31,9 @@ Bitmap RID_SVXCTRL_RECTBTNS
{
File = "rectbtns.bmp" ;
};
-
+/*IAccessibility2 Implementation 2009-----*/
+String STR_SWITCH
+{
+ Text [ en-US ] = "Switch" ;
+};
+/*-----IAccessibility2 Implementation 2009*/
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 67e34801ca34..b4debaa4eaa4 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -146,6 +146,7 @@ SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAtt
SfxTabPage( pParent, SVX_RES( nResId ), rAttr ),
+ aFrm ( this, SVX_RES( FL_FRAME ) ),
aTurnOnBox ( this, SVX_RES( CB_TURNON ) ),
aCntSharedBox ( this, SVX_RES( CB_SHARED ) ),
aLMLbl ( this, SVX_RES( FT_LMARGIN ) ),
@@ -158,7 +159,6 @@ SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAtt
aHeightFT ( this, SVX_RES( FT_HEIGHT ) ),
aHeightEdit ( this, SVX_RES( ED_HEIGHT ) ),
aHeightDynBtn ( this, SVX_RES( CB_HEIGHT_DYN ) ),
- aFrm ( this, SVX_RES( FL_FRAME ) ),
aBspWin ( this, SVX_RES( WN_BSP ) ),
aBackgroundBtn ( this, SVX_RES( BTN_EXTRAS ) ),
@@ -182,6 +182,20 @@ SvxHFPage::SvxHFPage( Window* pParent, sal_uInt16 nResId, const SfxItemSet& rAtt
SetFieldUnit( aHeightEdit, eFUnit );
SetFieldUnit( aLMEdit, eFUnit );
SetFieldUnit( aRMEdit, eFUnit );
+
+ aTurnOnBox.SetAccessibleRelationMemberOf( &aFrm );
+ aCntSharedBox.SetAccessibleRelationMemberOf( &aFrm );
+ aLMLbl.SetAccessibleRelationMemberOf( &aFrm );
+ aLMEdit.SetAccessibleRelationMemberOf( &aFrm );
+ aRMLbl.SetAccessibleRelationMemberOf( &aFrm );
+ aRMEdit.SetAccessibleRelationMemberOf( &aFrm );
+ aDistFT.SetAccessibleRelationMemberOf( &aFrm );
+ aDistEdit.SetAccessibleRelationMemberOf( &aFrm );
+ aDynSpacingCB.SetAccessibleRelationMemberOf( &aFrm );
+ aHeightFT.SetAccessibleRelationMemberOf( &aFrm );
+ aHeightEdit.SetAccessibleRelationMemberOf( &aFrm );
+ aHeightDynBtn.SetAccessibleRelationMemberOf( &aFrm );
+ aBackgroundBtn.SetAccessibleRelationMemberOf(&aFrm);
}
// -----------------------------------------------------------------------
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 83d8206111f8..a3b367ad878c 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -248,6 +248,17 @@ SvxGridTabPage::SvxGridTabPage( Window* pParent, const SfxItemSet& rCoreSet) :
LINK( this, SvxGridTabPage, ChangeDivisionHdl_Impl ) );
aNumFldDivisionY.SetModifyHdl(
LINK( this, SvxGridTabPage, ChangeDivisionHdl_Impl ) );
+
+ ::rtl::OUString sFlResolution( aFlResolution.GetDisplayText() );
+ ::rtl::OUString sFtDrawX(aFtDrawX.GetDisplayText());
+ ::rtl::OUString sFtDrawY(aFtDrawY.GetDisplayText());
+ aMtrFldDrawX.SetAccessibleName( sFtDrawX + sFlResolution );
+ aMtrFldDrawY.SetAccessibleName( sFtDrawY + sFlResolution );
+ ::rtl::OUString sFlDivision( aFlDivision.GetDisplayText() );
+ ::rtl::OUString sFtDivisionX(aFtDivisionX.GetDisplayText());
+ ::rtl::OUString sFtDivisionY(aFtDivisionY.GetDisplayText());
+ aNumFldDivisionX.SetAccessibleName( sFtDivisionX + sFlDivision );
+ aNumFldDivisionY.SetAccessibleName( sFtDivisionY + sFlDivision );
}
//------------------------------------------------------------------------
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index a85fc023eca5..3185263b4fe4 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -277,6 +277,14 @@ SvxRubyDialog::SvxRubyDialog( SfxBindings *pBind, SfxChildWindow *pCW,
}
UpdateColors();
+
+ String leftLabelName = aLeftFT.GetText(), rightLabelName = aRightFT.GetText();
+ aLeft2ED.SetAccessibleName(leftLabelName);
+ aLeft3ED.SetAccessibleName(leftLabelName);
+ aLeft4ED.SetAccessibleName(leftLabelName);
+ aRight2ED.SetAccessibleName(rightLabelName);
+ aRight3ED.SetAccessibleName(rightLabelName);
+ aRight4ED.SetAccessibleName(rightLabelName);
}
/* -----------------------------09.01.01 17:17--------------------------------
diff --git a/svx/source/dialog/sdstring.src b/svx/source/dialog/sdstring.src
index 4b70dda6a151..44982cee0751 100644
--- a/svx/source/dialog/sdstring.src
+++ b/svx/source/dialog/sdstring.src
@@ -1187,103 +1187,26 @@ String RID_SVXSTR_COLOR_USER
Text [ en-US ] = "User" ;
};
+String RID_SVXSTR_GALLERYPROPS_GALTHEME
+{
+ Text [ en-US ] = "Gallery Theme" ;
+};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+//IAccessibility2 Implementation 2009-----
+String RID_SVXSTR_GALLERY_THEMEITEMS
+{
+ Text [ en-US ] = "Theme Items";
+};
+String RID_SVXSTR_GALLERY_THEMENAME
+{
+ Text [ en-US ] = "Theme Name";
+};
+String RID_SVXSTR_GALLERY_FILESFOUND
+{
+ Text [ en-US ] = "Files Found";
+};
+String RID_SVXSTR_GALLERY_PREVIEW
+{
+ Text [ en-US ] = "Preview";
+};
+//-----IAccessibility2 Implementation 2009
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 5f91c6dabacb..97dc2cfaf76d 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -494,6 +494,14 @@ void SvxSearchDialog::Construct_Impl()
{
aJapMatchFullHalfWidthCB.Hide();
}
+
+ aSimilarityBtn.SetAccessibleRelationLabeledBy(&aSimilarityBox);
+ aSimilarityBtn.SetAccessibleRelationMemberOf(&aOptionsFL);
+ aJapOptionsBtn.SetAccessibleRelationLabeledBy(&aJapOptionsCB);
+ aJapOptionsBtn.SetAccessibleRelationMemberOf(&aOptionsFL);
+ aRowsBtn.SetAccessibleRelationMemberOf(&aCalcSearchDirFT);
+ aColumnsBtn.SetAccessibleRelationMemberOf(&aCalcSearchDirFT);
+
//component extension - show component search buttons if the commands
// vnd.sun.star::SearchViaComponent1 and 2 are supported
const uno::Reference< frame::XFrame >xFrame = rBindings.GetActiveFrame();
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index ea33f2089ed0..f1766f01c3ea 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -119,6 +119,7 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
aBtnMaterial ( this, SVX_RES( BTN_MATERIAL ) ),
aBtnUpdate ( this, SVX_RES( BTN_UPDATE ) ),
aBtnAssign ( this, SVX_RES( BTN_ASSIGN ) ),
+ aFLGeometrie ( this, SVX_RES( FL_GEOMETRIE ) ),
// Geometrie
aFtPercentDiagonal ( this, SVX_RES( FT_PERCENT_DIAGONAL ) ),
@@ -129,36 +130,36 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
aMtrEndAngle ( this, SVX_RES( MTR_END_ANGLE ) ),
aFtDepth ( this, SVX_RES( FT_DEPTH ) ),
aMtrDepth ( this, SVX_RES( MTR_DEPTH ) ),
- aFLGeometrie ( this, SVX_RES( FL_GEOMETRIE ) ),
+ aFLSegments ( this, SVX_RES( FL_SEGMENTS ) ),
aFtHorizontal ( this, SVX_RES( FT_HORIZONTAL ) ),
aNumHorizontal ( this, SVX_RES( NUM_HORIZONTAL ) ),
aFtVertical ( this, SVX_RES( FT_VERTICAL ) ),
aNumVertical ( this, SVX_RES( NUM_VERTICAL ) ),
- aFLSegments ( this, SVX_RES( FL_SEGMENTS ) ),
+ aFLNormals ( this, SVX_RES( FL_NORMALS ) ),
aBtnNormalsObj ( this, SVX_RES( BTN_NORMALS_OBJ ) ),
aBtnNormalsFlat ( this, SVX_RES( BTN_NORMALS_FLAT ) ),
aBtnNormalsSphere ( this, SVX_RES( BTN_NORMALS_SPHERE ) ),
aBtnNormalsInvert ( this, SVX_RES( BTN_NORMALS_INVERT ) ),
aBtnTwoSidedLighting( this, SVX_RES( BTN_TWO_SIDED_LIGHTING ) ),
- aFLNormals ( this, SVX_RES( FL_NORMALS ) ),
aBtnDoubleSided ( this, SVX_RES( BTN_DOUBLE_SIDED ) ),
// Darstellung
+ aFLRepresentation ( this, SVX_RES( FL_REPRESENTATION ) ),
aFtShademode ( this, SVX_RES( FT_SHADEMODE ) ),
aLbShademode ( this, SVX_RES( LB_SHADEMODE ) ),
+ aFLShadow ( this, SVX_RES( FL_SHADOW ) ),
aBtnShadow3d ( this, SVX_RES( BTN_SHADOW_3D ) ),
aFtSlant ( this, SVX_RES( FT_SLANT ) ),
aMtrSlant ( this, SVX_RES( MTR_SLANT ) ),
- aFLShadow ( this, SVX_RES( FL_SHADOW ) ),
aFtDistance ( this, SVX_RES( FT_DISTANCE ) ),
aMtrDistance ( this, SVX_RES( MTR_DISTANCE ) ),
aFtFocalLeng ( this, SVX_RES( FT_FOCAL_LENGTH ) ),
aMtrFocalLength ( this, SVX_RES( MTR_FOCAL_LENGTH ) ),
aFLCamera ( this, SVX_RES( FL_CAMERA ) ),
- aFLRepresentation ( this, SVX_RES( FL_REPRESENTATION ) ),
+ aFLLight ( this, SVX_RES( FL_LIGHT ) ),
// Beleuchtung
aBtnLight1 ( this, SVX_RES( BTN_LIGHT_1 ) ),
@@ -169,6 +170,7 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
aBtnLight6 ( this, SVX_RES( BTN_LIGHT_6 ) ),
aBtnLight7 ( this, SVX_RES( BTN_LIGHT_7 ) ),
aBtnLight8 ( this, SVX_RES( BTN_LIGHT_8 ) ),
+ aFTLightsource ( this, SVX_RES( FT_LIGHTSOURCE ) ),
aLbLight1 ( this, SVX_RES( LB_LIGHT_1 ) ),
aLbLight2 ( this, SVX_RES( LB_LIGHT_2 ) ),
aLbLight3 ( this, SVX_RES( LB_LIGHT_3 ) ),
@@ -179,15 +181,13 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
aLbLight8 ( this, SVX_RES( LB_LIGHT_8 ) ),
aBtnLightColor ( this, SVX_RES( BTN_LIGHT_COLOR ) ),
- aFTLightsource ( this, SVX_RES( FT_LIGHTSOURCE ) ),
// #99694# Keyboard shortcuts activate the next control, so the
// order needed to be changed here
aFTAmbientlight ( this, SVX_RES( FT_AMBIENTLIGHT ) ), // Text label
aLbAmbientlight ( this, SVX_RES( LB_AMBIENTLIGHT ) ), // ListBox
aBtnAmbientColor ( this, SVX_RES( BTN_AMBIENT_COLOR ) ), // color button
-
- aFLLight ( this, SVX_RES( FL_LIGHT ) ),
+ aFLTexture ( this, SVX_RES( FL_TEXTURE ) ),
// Texturen
aFtTexKind ( this, SVX_RES( FT_TEX_KIND ) ),
@@ -207,7 +207,7 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
aBtnTexCircleY ( this, SVX_RES( BTN_TEX_CIRCLE_Y ) ),
aFtTexFilter ( this, SVX_RES( FT_TEX_FILTER ) ),
aBtnTexFilter ( this, SVX_RES( BTN_TEX_FILTER ) ),
- aFLTexture ( this, SVX_RES( FL_TEXTURE ) ),
+ aFLMaterial ( this, SVX_RES( FL_MATERIAL ) ),
// Material
aFtMatFavorites ( this, SVX_RES( FT_MAT_FAVORITES ) ),
@@ -218,20 +218,19 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
aFtMatEmission ( this, SVX_RES( FT_MAT_EMISSION ) ),
aLbMatEmission ( this, SVX_RES( LB_MAT_EMISSION ) ),
aBtnEmissionColor ( this, SVX_RES( BTN_EMISSION_COLOR ) ),
+ aFLMatSpecular ( this, SVX_RES( FL_MAT_SPECULAR ) ),
aFtMatSpecular ( this, SVX_RES( FT_MAT_SPECULAR ) ),
aLbMatSpecular ( this, SVX_RES( LB_MAT_SPECULAR ) ),
aBtnSpecularColor ( this, SVX_RES( BTN_SPECULAR_COLOR ) ),
aFtMatSpecularIntensity( this, SVX_RES( FT_MAT_SPECULAR_INTENSITY ) ),
aMtrMatSpecularIntensity( this, SVX_RES( MTR_MAT_SPECULAR_INTENSITY ) ),
- aFLMatSpecular ( this, SVX_RES( FL_MAT_SPECULAR ) ),
- aFLMaterial ( this, SVX_RES( FL_MATERIAL ) ),
+ aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
+ aCtlLightPreview ( this, SVX_RES( CTL_LIGHT_PREVIEW ) ),
// Unterer Bereich
aBtnConvertTo3D ( this, SVX_RES( BTN_CHANGE_TO_3D ) ),
aBtnLatheObject ( this, SVX_RES( BTN_LATHE_OBJ ) ),
aBtnPerspective ( this, SVX_RES( BTN_PERSPECTIVE ) ),
- aCtlPreview ( this, SVX_RES( CTL_PREVIEW ) ),
- aCtlLightPreview ( this, SVX_RES( CTL_LIGHT_PREVIEW ) ),
aImgLightOn ( SVX_RES( RID_SVXIMAGE_LIGHT_ON ) ),
aImgLightOff ( SVX_RES( RID_SVXIMAGE_LIGHT_OFF ) ),
@@ -255,6 +254,11 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
mpRemember2DAttributes(NULL),
bOnly3DChanged ( sal_False )
{
+ String accname(SVX_RES(STR_COLOR_LIGHT_PRE));
+ aCtlLightPreview.SetAccessibleName(accname);
+ aCtlPreview.SetAccessibleName(accname);
+ aLbAmbientlight.SetAccessibleName(aFTAmbientlight.GetDisplayText());
+
SETHCIMAGE( aBtnGeo, BMP_GEO_H );
SETHCIMAGE( aBtnRepresentation, BMP_REPRESENTATION_H );
SETHCIMAGE( aBtnLight, BMP_3DLIGHT_H );
@@ -416,6 +420,86 @@ __EXPORT Svx3DWin::Svx3DWin( SfxBindings* pInBindings,
}
Reset();
+
+ aBtnNormalsObj.SetAccessibleRelationMemberOf( &aFLNormals );
+ aBtnNormalsFlat.SetAccessibleRelationMemberOf( &aFLNormals );
+ aBtnNormalsSphere.SetAccessibleRelationMemberOf( &aFLNormals );
+ aBtnNormalsInvert.SetAccessibleRelationMemberOf( &aFLNormals );
+ aBtnTwoSidedLighting.SetAccessibleRelationMemberOf( &aFLNormals );
+ aBtnDoubleSided.SetAccessibleRelationMemberOf( &aFLNormals );
+
+ aBtnLight1.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLight2.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLight3.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLight4.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLight5.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLight6.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLight7.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLight8.SetAccessibleRelationMemberOf( &aFLLight );
+
+ aBtnLight1.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLight2.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLight3.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLight4.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLight5.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLight6.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLight7.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLight8.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnLightColor.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnLightColor.SetAccessibleRelationLabeledBy( &aFTLightsource );
+ aBtnAmbientColor.SetAccessibleRelationMemberOf( &aFLLight );
+ aBtnAmbientColor.SetAccessibleRelationLabeledBy( &aFTAmbientlight );
+
+ aBtnSpecularColor.SetAccessibleRelationLabeledBy( &aFtMatSpecular );
+ aBtnMatColor.SetAccessibleRelationLabeledBy( &aFtMatColor );
+ aBtnEmissionColor.SetAccessibleRelationLabeledBy( &aFtMatEmission );
+ aBtnTexLuminance.SetAccessibleRelationLabeledBy( &aFtTexKind );
+ aBtnTexColor.SetAccessibleRelationLabeledBy( &aFtTexKind );
+ aBtnTexReplace.SetAccessibleRelationLabeledBy( &aFtTexMode );
+ aBtnTexModulate.SetAccessibleRelationLabeledBy( &aFtTexMode );
+ aBtnTexBlend.SetAccessibleRelationLabeledBy( &aFtTexMode );
+ aBtnTexObjectX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
+ aBtnTexParallelX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
+ aBtnTexCircleX.SetAccessibleRelationLabeledBy( &aFtTexProjectionX );
+ aBtnTexObjectY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
+ aBtnTexParallelY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
+ aBtnTexCircleY.SetAccessibleRelationLabeledBy( &aFtTexProjectionY );
+ aBtnTexFilter.SetAccessibleRelationLabeledBy( &aFtTexFilter );
+ aCtlLightPreview.SetAccessibleRelationLabeledBy( &aCtlLightPreview );
+ aBtnNormalsObj.SetAccessibleRelationMemberOf(&aFLNormals);
+ aBtnNormalsFlat.SetAccessibleRelationMemberOf(&aFLNormals);
+ aBtnNormalsSphere.SetAccessibleRelationMemberOf(&aFLNormals);
+ aBtnNormalsInvert.SetAccessibleRelationMemberOf(&aFLNormals);
+ aBtnTwoSidedLighting.SetAccessibleRelationMemberOf(&aFLNormals);
+
+ aBtnShadow3d.SetAccessibleRelationMemberOf(&aFLShadow);
+
+ aBtnLight1.SetAccessibleRelationMemberOf(&aFLLight);
+ aBtnLight2.SetAccessibleRelationMemberOf(&aFLLight);
+ aBtnLight3.SetAccessibleRelationMemberOf(&aFLLight);
+ aBtnLight4.SetAccessibleRelationMemberOf(&aFLLight);
+ aBtnLight5.SetAccessibleRelationMemberOf(&aFLLight);
+ aBtnLight6.SetAccessibleRelationMemberOf(&aFLLight);
+ aBtnLight7.SetAccessibleRelationMemberOf(&aFLLight);
+ aBtnLight8.SetAccessibleRelationMemberOf(&aFLLight);
+
+ aBtnTexLuminance.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexColor.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexReplace.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexModulate.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexBlend.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexObjectX.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexParallelX.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexCircleX.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexObjectY.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexParallelY.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexCircleY.SetAccessibleRelationMemberOf(&aFLTexture);
+ aBtnTexFilter.SetAccessibleRelationMemberOf(&aFLTexture);
+
+ aBtnMatColor.SetAccessibleRelationMemberOf(&aFLMaterial);
+ aBtnEmissionColor.SetAccessibleRelationMemberOf(&aFLMaterial);
+
+ aBtnSpecularColor.SetAccessibleRelationMemberOf(&aFLMatSpecular);
}
// -----------------------------------------------------------------------
diff --git a/svx/source/engine3d/float3d.src b/svx/source/engine3d/float3d.src
index 1947fead5556..c75ab16e19c2 100644
--- a/svx/source/engine3d/float3d.src
+++ b/svx/source/engine3d/float3d.src
@@ -1438,53 +1438,10 @@ String RID_SVXFLOAT3D_FIX_B
Text [ en-US ] = "B:";
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+// IAccessibility2 implementation 2009. ------
+String STR_COLOR_LIGHT_PRE
+{
+ Text [ en-US ] = "Color Light Preview";
+};
+// ------ IAccessibility2 implementation 2009.
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 47aeceda995b..0dce12e13cfb 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -365,7 +365,8 @@ Reference< XInterface > SAL_CALL FmXGridControl_NewInstance_Impl(const Reference
DBG_NAME(FmXGridControl )
//------------------------------------------------------------------------------
FmXGridControl::FmXGridControl(const Reference< XMultiServiceFactory >& _rxFactory)
- :m_aModifyListeners(*this, GetMutex())
+ :UnoControl( _rxFactory)
+ ,m_aModifyListeners(*this, GetMutex())
,m_aUpdateListeners(*this, GetMutex())
,m_aContainerListeners(*this, GetMutex())
,m_aSelectionListeners(*this, GetMutex())
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 528661d2abe4..6f6cdbf9c2a6 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -479,7 +479,10 @@ class FmXAutoControl: public UnoControl
friend Reference< XInterface > SAL_CALL FmXAutoControl_NewInstance_Impl();
public:
- FmXAutoControl(){}
+ FmXAutoControl( const ::comphelper::ComponentContext& i_context )
+ :UnoControl( i_context.getLegacyServiceFactory() )
+ {
+ }
virtual ::rtl::OUString GetComponentServiceName() {return ::rtl::OUString::createFromAscii("Edit");}
virtual void SAL_CALL createPeer( const Reference< XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw( RuntimeException );
@@ -1451,7 +1454,7 @@ void FormController::toggleAutoFields(sal_Bool bAutoFields)
&& ::comphelper::getBOOL( xField->getPropertyValue( FM_PROP_AUTOINCREMENT ) )
)
{
- replaceControl( xControl, new FmXAutoControl );
+ replaceControl( xControl, new FmXAutoControl( m_aContext ) );
}
}
}
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index dfa4eaad4a9d..3704262833ed 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -41,6 +41,8 @@
#include <com/sun/star/util/DateTime.hpp>
#include "gallery.hrc"
#include <algorithm>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
#include <svx/svxdlg.hxx> //CHINA001
//CHINA001 #include <svx/dialogs.hrc> //CHINA001
@@ -162,6 +164,7 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId,
mpThemes->SetHelpId( HID_GALLERY_THEMELIST );
mpThemes->SetSelectHdl( LINK( this, GalleryBrowser1, SelectThemeHdl ) );
+ mpThemes->SetAccessibleName(String(SVX_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) ) );
for( sal_uIntPtr i = 0, nCount = mpGallery->GetThemeCount(); i < nCount; i++ )
ImplInsertThemeEntry( mpGallery->GetThemeInfo( i ) );
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 98e4d69ee84e..2fff76ba0c76 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -54,8 +54,9 @@
#include "gallery.hrc"
#include <vcl/svapp.hxx>
#include <svx/fmmodel.hxx>
-#include <svx/svxdlg.hxx> //CHINA001
-//CHINA001 #include <svx/dialogs.hrc> //CHINA001
+#include <svx/dialmgr.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/dialogs.hrc>
// -----------
// - Defines -
@@ -338,6 +339,9 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId,
maViewBox.SetSelectHdl( LINK( this, GalleryBrowser2, SelectTbxHdl ) );
maViewBox.Show();
+ mpIconView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) ));
+ mpListView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) ));
+
maInfoBar.Show();
maSeparator.Show();
@@ -347,6 +351,12 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId,
InitSettings();
SetMode( ( GALLERYBROWSERMODE_PREVIEW != GalleryBrowser2::meInitMode ) ? GalleryBrowser2::meInitMode : GALLERYBROWSERMODE_ICON );
+
+ if(maInfoBar.GetText().Len() == 0)
+ mpIconView->SetAccessibleRelationLabeledBy(mpIconView);
+ else
+ mpIconView->SetAccessibleRelationLabeledBy(&maInfoBar);
+ mpIconView->SetAccessibleRelationMemberOf(mpIconView);
}
// -----------------------------------------------------------------------------
@@ -641,6 +651,10 @@ void GalleryBrowser2::SelectTheme( const String& rThemeName )
mpListView = new GalleryListView( this, mpCurTheme );
mpPreview = new GalleryPreview( this, mpCurTheme );
+ mpIconView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) ));
+ mpListView->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_THEMEITEMS ) ));
+ mpPreview->SetAccessibleName(String( SVX_RES( RID_SVXSTR_GALLERY_PREVIEW ) ));
+
const Link aSelectHdl( LINK( this, GalleryBrowser2, SelectObjectHdl ) );
mpIconView->SetSelectHdl( aSelectHdl );
@@ -655,6 +669,12 @@ void GalleryBrowser2::SelectTheme( const String& rThemeName )
maViewBox.EnableItem( TBX_ID_ICON, sal_True );
maViewBox.EnableItem( TBX_ID_LIST, sal_True );
maViewBox.CheckItem( ( GALLERYBROWSERMODE_ICON == GetMode() ) ? TBX_ID_ICON : TBX_ID_LIST, sal_True );
+
+ if(maInfoBar.GetText().Len() == 0)
+ mpIconView->SetAccessibleRelationLabeledBy(mpIconView);
+ else
+ mpIconView->SetAccessibleRelationLabeledBy(&maInfoBar);
+ mpIconView->SetAccessibleRelationMemberOf(mpIconView);
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src
index 39ee6e0e6b1b..8179367cd53d 100644
--- a/svx/source/gallery2/gallery.src
+++ b/svx/source/gallery2/gallery.src
@@ -409,85 +409,3 @@ Menu RID_SVXMN_GALLERY2
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx
index 114ce405bb69..944a520eb648 100644
--- a/svx/source/items/chrtitem.cxx
+++ b/svx/source/items/chrtitem.cxx
@@ -52,7 +52,6 @@ using namespace ::com::sun::star;
TYPEINIT1_FACTORY(SvxChartStyleItem, SfxEnumItem, new SvxChartStyleItem(CHSTYLE_2D_LINE, 0));
TYPEINIT1(SvxChartDataDescrItem, SfxEnumItem);
-TYPEINIT1(SvxChartLegendPosItem, SfxEnumItem);
TYPEINIT1(SvxChartTextOrderItem, SfxEnumItem);
TYPEINIT1(SvxChartTextOrientItem, SfxEnumItem);
TYPEINIT1(SvxChartIndicateItem, SfxEnumItem);
@@ -127,39 +126,6 @@ SfxPoolItem* SvxChartDataDescrItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) c
/*************************************************************************
|*
-|* SvxChartLegendPosItem
-|*
-*************************************************************************/
-
-SvxChartLegendPosItem::SvxChartLegendPosItem(SvxChartLegendPos eLegendPos,
- sal_uInt16 nId) :
- SfxEnumItem(nId, (sal_uInt16)eLegendPos)
-{
-}
-
-// -----------------------------------------------------------------------
-
-SvxChartLegendPosItem::SvxChartLegendPosItem(SvStream& rIn, sal_uInt16 nId) :
- SfxEnumItem(nId, rIn)
-{
-}
-
-// -----------------------------------------------------------------------
-
-SfxPoolItem* SvxChartLegendPosItem::Clone(SfxItemPool* /*pPool*/) const
-{
- return new SvxChartLegendPosItem(*this);
-}
-
-// -----------------------------------------------------------------------
-
-SfxPoolItem* SvxChartLegendPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
-{
- return new SvxChartLegendPosItem(rIn, Which());
-}
-
-/*************************************************************************
-|*
|* SvxChartTextOrderItem
|*
*************************************************************************/
diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src
index 6690d4a7618b..6c80ba2c383a 100644
--- a/svx/source/svdraw/svdstr.src
+++ b/svx/source/svdraw/svdstr.src
@@ -2865,76 +2865,14 @@ Bitmap SIP_SA_ACCESSIBILITY_CROP_MARKERS
File = "cropmarkersACC.bmp";
};
-// ******************************************************************* EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+//IAccessibility2 Implementation 2009-----
+String STR_ObjNameSingulFONTWORK
+{
+ Text [ en-US ] = "font work" ;
+};
+String STR_ObjNamePluralFONTWORK
+{
+ Text [ en-US ] = "font works" ;
+};
+//-----IAccessibility2 Implementation 2009
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index b712bcfe04d2..884a1ac14d3c 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -113,6 +113,7 @@ SvxColorValueSet::SvxColorValueSet( Window* _pParent, WinBits nWinStyle ) :
DragSourceHelper( this ),
bLeft (sal_True)
{
+ SetAccessibleName(String( SVX_RES( STR_COLORTABLE ) ) );
}
/*************************************************************************
@@ -126,6 +127,7 @@ SvxColorValueSet::SvxColorValueSet( Window* _pParent, const ResId& rResId ) :
DragSourceHelper( this ),
bLeft (sal_True)
{
+ SetAccessibleName(String( SVX_RES( STR_COLORTABLE ) ));
}
/*************************************************************************
diff --git a/svx/source/tbxctrls/colrctrl.src b/svx/source/tbxctrls/colrctrl.src
index 023c271c5455..1fdd6df6a39b 100644
--- a/svx/source/tbxctrls/colrctrl.src
+++ b/svx/source/tbxctrls/colrctrl.src
@@ -53,32 +53,11 @@ DockingWindow RID_SVXCTRL_COLOR
Border = FALSE ;
};
};
- // ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+// IAccessibility2 implementation 2009. ------
+String STR_COLORTABLE
+{
+ Text [ en-US ] = "Color Palette" ;
+};
+// ------ IAccessibility2 implementation 2009.
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 416dc09ca157..403ef97f6319 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -83,8 +83,8 @@ const int nLineCount = 4;
\************************************************************************/
FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, Window* pParent, sal_uInt16 /*nSID*/ ) :
ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_GALLERY ) ),
- maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ),
maFLFavorites ( this, SVX_RES( FL_FAVORITES ) ),
+ maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ),
maOKButton ( this, SVX_RES( BTN_OK ) ),
maCancelButton ( this, SVX_RES( BTN_CANCEL ) ),
maHelpButton ( this, SVX_RES( BTN_HELP ) ),
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 5a4362592738..ad97a61900fa 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -856,6 +856,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
{
aColorSet.SetStyle( aColorSet.GetStyle() | WB_NONEFIELD );
aColorSet.SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) );
+ aColorSet.SetAccessibleName( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) );
}
else if ( SID_ATTR_CHAR_COLOR == theSlotId || SID_ATTR_CHAR_COLOR2 == theSlotId || SID_EXTRUSION_3D_COLOR == theSlotId )
{
@@ -870,8 +871,13 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
{
aColorSet.SetStyle( aColorSet.GetStyle() | WB_NONEFIELD );
aColorSet.SetText( SVX_RESSTR( RID_SVXSTR_AUTOMATIC ) );
+ aColorSet.SetAccessibleName( SVX_RESSTR( RID_SVXSTR_TEXTCOLOR ) );
}
}
+ else
+ {
+ aColorSet.SetAccessibleName( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) );
+ }
if ( pColorTable )
{
@@ -1092,6 +1098,7 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFram
SetHelpId( HID_POPUP_FRAME );
SetText( SVX_RESSTR(RID_SVXSTR_FRAME) );
+ aFrameSet.SetAccessibleName( SVX_RESSTR(RID_SVXSTR_FRAME) );
aFrameSet.Show();
}
/*-- 22.09.2004 12:27:50---------------------------------------------------
@@ -1348,6 +1355,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame
aLineSet.SetSelectHdl( LINK( this, SvxLineWindow_Impl, SelectHdl ) );
aLineSet.SetText( SVX_RESSTR(STR_NONE) );
+ aLineSet.SetAccessibleName( SVX_RESSTR(RID_SVXSTR_FRAME_STYLE) );
lcl_CalcSizeValueSet( *this, aLineSet, aBmpSize );
SetHelpId( HID_POPUP_LINE );
diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src
index f3e068f56226..f49966e9ae17 100644
--- a/svx/source/tbxctrls/tbcontrl.src
+++ b/svx/source/tbxctrls/tbcontrl.src
@@ -185,5 +185,11 @@ String RID_SVXSTR_MORE
Text [ en-US ] = "More...";
};
+//IAccessibility2 Implementation 2009-----
+String RID_SVXSTR_TEXTCOLOR
+{
+ Text [ en-US ] = "Font color";
+};
+//-----IAccessibility2 Implementation 2009
// ********************************************************************** EOF
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 138fe30b964f..c6257e22fc93 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -39,12 +39,6 @@ $(eval $(call gb_Module_add_targets,sw,\
Package_xml \
))
-ifeq ($(strip $(ENABLE_VBA)),YES)
-$(eval $(call gb_Module_add_targets,sw,\
- Library_vbaswobj \
-))
-endif
-
$(eval $(call gb_Module_add_subsequentcheck_targets,sw,\
JunitTest_sw_complex \
JunitTest_sw_unoapi \
diff --git a/sw/inc/access.hrc b/sw/inc/access.hrc
index b6c6bb30086e..b33b19b814c7 100644
--- a/sw/inc/access.hrc
+++ b/sw/inc/access.hrc
@@ -52,7 +52,20 @@
#define STR_ACCESS_ANNOTATION_BUTTON_NAME (RC_ACCESS_BEGIN + 20)
#define STR_ACCESS_ANNOTATION_BUTTON_DESC (RC_ACCESS_BEGIN + 21)
-#define ACCESS_ACT_END STR_ACCESS_ANNOTATION_BUTTON_DESC
+//IAccessibility2 Implementation 2009-----
+#define STR_ACCESS_PREVIEW_DOC_NAME (RC_ACCESS_BEGIN + 22)
+//#define STR_ACCESS_PREVIEW_DOC_DESC (RC_ACCESS_BEGIN + 23)
+#define STR_ACCESS_PREVIEW_DOC_SUFFIX (RC_ACCESS_BEGIN + 24)
+#define STR_ACCESS_DOC_WORDPROCESSING (RC_ACCESS_BEGIN + 25)
+#define STR_ACCESS_DOC_WORDPROCESSING_READONLY (RC_ACCESS_BEGIN + 26)
+#define STR_ACCESS_COLUMN_WIDTH (RC_ACCESS_BEGIN + 27)
+#define STR_ACCESS_PAGESETUP_SPACING (RC_ACCESS_BEGIN + 28)
+#define STR_ACCESS_SW_CATEGORY (RC_ACCESS_BEGIN + 29)
+#define STR_ACCESS_TL_GLOBAL (RC_ACCESS_BEGIN + 30)
+#define STR_ACCESS_TL_CONTENT (RC_ACCESS_BEGIN + 31)
+//-----IAccessibility2 Implementation 2009
+
+#define ACCESS_ACT_END STR_ACCESS_TL_CONTENT
#if ACCESS_ACT_END > RC_ACCESS_END
#error Resource-Id Ueberlauf in #file, #line
diff --git a/sw/inc/colwd.hxx b/sw/inc/colwd.hxx
index 3afb1647f4ad..54df3b1b9f24 100644
--- a/sw/inc/colwd.hxx
+++ b/sw/inc/colwd.hxx
@@ -41,11 +41,11 @@ class SwTableFUNC;
class SwTableWidthDlg : public SvxStandardDialog
{
+ FixedLine aWidthFL;
FixedText aColFT;
NumericField aColEdit;
FixedText aWidthFT;
MetricField aWidthEdit;
- FixedLine aWidthFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 3beaff17ade8..0d659aee244d 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -374,7 +374,10 @@ public:
void SetFlyPos( const Point &rAbsPos);
Point FindAnchorPos( const Point &rAbsPos, sal_Bool bMoveIt = sal_False );
// determines whether a frame or its environment is vertically formatted and right-to-left
- sal_Bool IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRightToLeft) const;
+ // --> OD 2009-08-31 #mongolianlayout#
+ // also determines, if frame or its environmane is in mongolianlayout (vertical left-to-right)
+ // - add output parameter <bVertL2R>
+ sal_Bool IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRightToLeft, sal_Bool& bVertL2R) const;
SwFrmFmt* GetCurFrmFmt() const; //Wenn Rahmen, dann Rahmenvorlage, sonst 0
void SetFrmFmt( SwFrmFmt *pFmt, sal_Bool bKeepOrient = sal_False, Point* pDocPos = 0 ); //Wenn Rahmen, dann Rahmenvorlage setzen
diff --git a/sw/inc/poolfmt.hrc b/sw/inc/poolfmt.hrc
index f191f0fac78c..e68de680c243 100644
--- a/sw/inc/poolfmt.hrc
+++ b/sw/inc/poolfmt.hrc
@@ -268,7 +268,14 @@
#define STR_POOLNUMRULE_BUL3 (RC_POOLNUMRULE_BEGIN+ 7)
#define STR_POOLNUMRULE_BUL4 (RC_POOLNUMRULE_BEGIN+ 8)
#define STR_POOLNUMRULE_BUL5 (RC_POOLNUMRULE_BEGIN+ 9)
-
+//IAccessibility2 Impplementaton 2009-----
+//Solution:Define column item's accessible name ID.
+#define STR_COLUMN_VALUESET_ITEM0 (RC_POOLNUMRULE_BEGIN + 10 )
+#define STR_COLUMN_VALUESET_ITEM1 (RC_POOLNUMRULE_BEGIN + 11 )
+#define STR_COLUMN_VALUESET_ITEM2 (RC_POOLNUMRULE_BEGIN + 12 )
+#define STR_COLUMN_VALUESET_ITEM3 (RC_POOLNUMRULE_BEGIN + 13 )
+#define STR_COLUMN_VALUESET_ITEM4 (RC_POOLNUMRULE_BEGIN + 14 )
+//-----IAccessibility2 Impplementaton 2009
//-----------------
// Paragraph styles
//-----------------
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index abeedbd8a0de..6f085bf0d26a 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -129,8 +129,10 @@
#define PROPERTY_MAP_PARA_AUTO_STYLE 96
#define PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM 97
#define PROPERTY_MAP_METAFIELD 98
-
-#define PROPERTY_MAP_END 99
+//IAccessibility2 Implementation 2009-----
+#define PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE 99
+//-----IAccessibility2 Implementation 2009
+#define PROPERTY_MAP_END 100
//S&E
#define WID_WORDS 0
diff --git a/sw/prj/build.lst b/sw/prj/build.lst
index 71a6b39a261d..c491c7f4e726 100644
--- a/sw/prj/build.lst
+++ b/sw/prj/build.lst
@@ -1,2 +1,2 @@
-sw sw : filter l10n connectivity OOo:writerperfect vbahelper svx stoc writerfilter LIBXSLT:libxslt NULL
+sw sw : filter L10N:l10n connectivity OOo:writerperfect vbahelper svx stoc writerfilter LIBXSLT:libxslt NULL
sw sw\prj nmake - all sw_prj NULL
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 051efd2b0948..91d99221e1fd 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -140,11 +140,12 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
{
case FRMDIR_VERT_TOP_LEFT:
{
- // vertical from left-to-right - not supported yet
+ // vertical from left-to-right - Badaa: supported now!
bVert = true;
bR2L = true;
- ASSERT( false,
- "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ //ASSERT( false, "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
+ //End
}
break;
case FRMDIR_VERT_TOP_RIGHT:
@@ -173,10 +174,18 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
}
// use geometry of drawing object
const SwRect aObjRect = _rSdrObj.GetSnapRect();
+
if ( bVert )
{
- nHoriRelPos = aObjRect.Top() - aAnchorPos.Y();
- nVertRelPos = aAnchorPos.X() - aObjRect.Right();
+ if ( bR2L ) {
+ //FRMDIR_VERT_TOP_LEFT
+ nHoriRelPos = aObjRect.Left() - aAnchorPos.X();
+ nVertRelPos = aObjRect.Top() - aAnchorPos.Y();
+ } else {
+ //FRMDIR_VERT_TOP_RIGHT
+ nHoriRelPos = aObjRect.Top() - aAnchorPos.Y();
+ nVertRelPos = aAnchorPos.X() - aObjRect.Right();
+ }
}
else if ( bR2L )
{
@@ -188,6 +197,7 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
nHoriRelPos = aObjRect.Left() - aAnchorPos.X();
nVertRelPos = aObjRect.Top() - aAnchorPos.Y();
}
+ //End of SCMS
}
_pFrmFmt->SetFmtAttr( SwFmtHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME ) );
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index e8b5c378a2ec..492b44e5c89f 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -679,8 +679,19 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
long lYDiff = aNewPos.Y() - aOldPos.Y();
if( GetFlyFrm()->GetAnchorFrm()->IsVertical() )
{
- lXDiff -= rVert.GetPos();
- lYDiff += rHori.GetPos();
+ //lXDiff -= rVert.GetPos();
+ //lYDiff += rHori.GetPos();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( GetFlyFrm()->GetAnchorFrm()->IsVertLR() )
+ {
+ lXDiff += rVert.GetPos();
+ lXDiff = -lXDiff;
+ }
+ else
+ {
+ lXDiff -= rVert.GetPos();
+ lYDiff += rHori.GetPos();
+ }
}
else
{
@@ -791,7 +802,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
const sal_Bool bRTL = pTmpFrm->IsRightToLeft();
- const Point aNewPos( bVertX || bRTL ?
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const bool bVertL2RX = pTmpFrm->IsVertLR();
+ const Point aNewPos( ( bVertX && !bVertL2RX ) || bRTL ?
aOutRect.Right() + 1 :
aOutRect.Left(),
aOutRect.Top() );
@@ -856,10 +869,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
}
//Position kann auch veraendert sein!
- const Point aOldPos( bVertX || bRTL ?
+ const Point aOldPos( ( bVertX && !bVertL2RX ) || bRTL ?
GetFlyFrm()->Frm().TopRight() :
GetFlyFrm()->Frm().Pos() );
-
if ( aNewPos != aOldPos )
{
//Kann sich durch das ChgSize veraendert haben!
@@ -867,7 +879,12 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
{
if( aOutRect.TopRight() != aNewPos )
{
- SwTwips nDeltaX = aNewPos.X() - aOutRect.Right();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwTwips nDeltaX;
+ if ( bVertL2RX )
+ nDeltaX = aNewPos.X() - aOutRect.Left();
+ else
+ nDeltaX = aNewPos.X() - aOutRect.Right();
SwTwips nDeltaY = aNewPos.Y() - aOutRect.Top();
MoveRect( aOutRect, Size( nDeltaX, nDeltaY ) );
}
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index e7e1ae88f266..f449dac13bc3 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -279,7 +279,8 @@ void SwDrawView::AddCustomHdl()
}
// add anchor handle:
- aHdl.AddHdl( new SwSdrHdl( aPos, pAnch->IsVertical() ||
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ aHdl.AddHdl( new SwSdrHdl( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
pAnch->IsRightToLeft() ) );
}
@@ -829,9 +830,10 @@ const SwFrm* SwDrawView::CalcAnchor()
aMyRect = pObj->GetSnapRect();
}
- const sal_Bool bTopRight = pAnch && ( pAnch->IsVertical() ||
- pAnch->IsRightToLeft() );
-
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const sal_Bool bTopRight = pAnch && ( ( pAnch->IsVertical() &&
+ !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() );
const Point aMyPt = bTopRight ? aMyRect.TopRight() : aMyRect.TopLeft();
Point aPt;
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 965d7c4ffe87..7ea3d079cc4b 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -772,8 +772,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
_bMirror = _bMirror && !pPage->OnRightPage();
Point aPos;
- sal_Bool bVertic = sal_False;
+ bool bVertic = false;
sal_Bool bRTL = sal_False;
+ // --> OD 2009-09-01 #mongolianlayout#
+ bool bVerticalL2R = false;
+ // <--
if ((FLY_AT_PAGE == _nAnchorId) || (FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL
{
@@ -798,9 +801,14 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
else
aPos = (pFrm->Frm().*fnRect->fnGetPos)();
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
{
- bVertic = sal_True;
+ // --> OD 2009-09-01 #mongolianlayout#
+ bVertic = bVert ? true : false;
+ bVerticalL2R = bVertL2R ? true : false;
+ // <--
_bMirror = false; // no mirroring in vertical environment
switch ( _eHoriRelOrient )
{
@@ -849,8 +857,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
default:break;
}
}
- // --> OD 2006-12-12 #i67221# - proposed patch
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert && !bVertL2R )
+ // <--
{
switch ( _eVertRelOrient )
{
@@ -862,6 +871,20 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
break;
}
}
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if ( bVertL2R )
+ {
+ switch ( _eVertRelOrient )
+ {
+ case text::RelOrientation::PRINT_AREA:
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ {
+ aPos.X() += pFrm->GetLeftMargin();
+ }
+ break;
+ }
+ }
+ // <--
else
{
switch ( _eVertRelOrient )
@@ -926,10 +949,17 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
// to page areas.
if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
{
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert && !bVertL2R )
+ // <--
{
aPos.X() = aVertEnvironRect.Right();
}
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if ( bVertL2R )
+ {
+ aPos.X() = aVertEnvironRect.Left();
+ }
else
{
aPos.Y() = aVertEnvironRect.Top();
@@ -946,7 +976,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
// to page areas.
if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
{
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert && !bVertL2R )
+ // <--
{
aPos.X() = aVertEnvironRect.Right();
if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
@@ -954,6 +986,16 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
aPos.X() -= rVertEnvironLayFrm.GetRightMargin();
}
}
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if ( bVertL2R )
+ {
+ aPos.X() = aVertEnvironRect.Left();
+ if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
+ {
+ aPos.X() += rVertEnvironLayFrm.GetLeftMargin();
+ }
+ }
+ // <--
else
{
aPos.Y() = aVertEnvironRect.Top();
@@ -1013,10 +1055,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
pTxtFrm->GetTopOfLine( nTop, aDefaultCntntPos );
}
}
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert || bVertL2R )
{
aPos.X() = nTop;
}
+ // <--
else
{
aPos.Y() = nTop;
@@ -1043,10 +1087,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
pTxtFrm->GetAutoPos( aChRect, aDefaultCntntPos );
}
nLeft = (aChRect.*fnRect->fnGetLeft)();
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert || bVertL2R )
{
aPos.Y() = nLeft;
}
+ // <--
else
{
aPos.X() = nLeft;
@@ -1054,7 +1100,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
// <--
- if ( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bVert || bVertL2R )
+ // <--
{
_orRect = SwRect( aVertEnvironRect.Left(),
aHoriEnvironRect.Top(),
@@ -1088,7 +1136,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
// bei zeichengebundenen lieber nur 90% der Hoehe ausnutzen
{
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
_orRect.Width( (_orRect.Width()*9)/10 );
else
_orRect.Height( (_orRect.Height()*9)/10 );
@@ -1098,26 +1148,51 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
const SwTwips nBaseOfstForFly = ( pFrm->IsTxtFrm() && pFly ) ?
((SwTxtFrm*)pFrm)->GetBaseOfstForFly( !bWrapThrough ) :
0;
- if( bVert )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
{
- bVertic = sal_True;
+ // --> OD 2009-09-01 #mongolianlayout#
+ bVertic = bVert ? true : false;
+ bVerticalL2R = bVertL2R ? true : false;
+ // <--
_bMirror = false;
switch ( _eHoriRelOrient )
{
- case text::RelOrientation::FRAME_RIGHT: aPos.Y() += pFrm->Prt().Height();
- aPos += (pFrm->Prt().*fnRect->fnGetPos)();
- break;
- case text::RelOrientation::PRINT_AREA: aPos += (pFrm->Prt().*fnRect->fnGetPos)();
- aPos.Y() += nBaseOfstForFly;
- break;
- case text::RelOrientation::PAGE_RIGHT: aPos.Y() = pPage->Frm().Top()
- + pPage->Prt().Bottom(); break;
- case text::RelOrientation::PAGE_PRINT_AREA: aPos.Y() = pPage->Frm().Top()
- + pPage->Prt().Top(); break;
+ case text::RelOrientation::FRAME_RIGHT:
+ {
+ aPos.Y() += pFrm->Prt().Height();
+ aPos += (pFrm->Prt().*fnRect->fnGetPos)();
+ break;
+ }
+ case text::RelOrientation::PRINT_AREA:
+ {
+ aPos += (pFrm->Prt().*fnRect->fnGetPos)();
+ aPos.Y() += nBaseOfstForFly;
+ break;
+ }
+ case text::RelOrientation::PAGE_RIGHT:
+ {
+ aPos.Y() = pPage->Frm().Top() + pPage->Prt().Bottom();
+ break;
+ }
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ {
+ aPos.Y() = pPage->Frm().Top() + pPage->Prt().Top();
+ break;
+ }
case text::RelOrientation::PAGE_LEFT:
- case text::RelOrientation::PAGE_FRAME: aPos.Y() = pPage->Frm().Top(); break;
- case text::RelOrientation::FRAME: aPos.Y() += nBaseOfstForFly; break;
+ case text::RelOrientation::PAGE_FRAME:
+ {
+ aPos.Y() = pPage->Frm().Top();
+ break;
+ }
+ case text::RelOrientation::FRAME:
+ {
+ aPos.Y() += nBaseOfstForFly;
+ break;
+ }
default: break;
}
}
@@ -1175,19 +1250,27 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
{
switch ( _eHoriRelOrient )
{
- case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrm->Prt().Width();
- aPos += pFrm->Prt().Pos();
- break;
- case text::RelOrientation::PRINT_AREA: aPos += pFrm->Prt().Pos();
- aPos.X() += nBaseOfstForFly;
- break;
- case text::RelOrientation::PAGE_RIGHT: aPos.X() = pPage->Frm().Left()
- + pPage->Prt().Right(); break;
- case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() = pPage->Frm().Left()
- + pPage->Prt().Left(); break;
+ case text::RelOrientation::FRAME_RIGHT:
+ aPos.X() += pFrm->Prt().Width();
+ aPos += pFrm->Prt().Pos();
+ break;
+ case text::RelOrientation::PRINT_AREA:
+ aPos += pFrm->Prt().Pos();
+ aPos.X() += nBaseOfstForFly;
+ break;
+ case text::RelOrientation::PAGE_RIGHT:
+ aPos.X() = pPage->Frm().Left() + pPage->Prt().Right();
+ break;
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ aPos.X() = pPage->Frm().Left() + pPage->Prt().Left();
+ break;
case text::RelOrientation::PAGE_LEFT:
- case text::RelOrientation::PAGE_FRAME: aPos.X() = pPage->Frm().Left(); break;
- case text::RelOrientation::FRAME: aPos.X() += nBaseOfstForFly; break;
+ case text::RelOrientation::PAGE_FRAME:
+ aPos.X() = pPage->Frm().Left();
+ break;
+ case text::RelOrientation::FRAME:
+ aPos.X() += nBaseOfstForFly;
+ break;
default: break;
}
}
@@ -1195,8 +1278,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
if( !_opRef )
{
- if( bVertic )
+ if( bVertic && !bVerticalL2R )
_orRect.Pos( aPos.X() - _orRect.Width() - _orRect.Left(), _orRect.Top() - aPos.Y() );
+ // --> OD 2009-09-01 #mongolianlayout#
+ else if( bVerticalL2R )
+ _orRect.Pos( _orRect.Left() - aPos.X(), _orRect.Top() - aPos.Y() );
+ // <--
else if ( bRTL )
_orRect.Pos( - ( _orRect.Right() - aPos.X() ), _orRect.Top() - aPos.Y() );
else
@@ -1239,10 +1326,13 @@ Size SwFEShell::GetGraphicDefaultSize() const
/* -----------------------------12.08.2002 12:51------------------------------
---------------------------------------------------------------------------*/
-sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL) const
+// --> OD 2009-08-31 #mongolianlayou#
+// add output parameter <bVertL2R>
+sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, sal_Bool& bVertL2R) const
{
sal_Bool bVert = sal_False;
bRTL = sal_False;
+ bVertL2R = sal_False;
if ( Imp()->HasDrawView() )
{
@@ -1284,10 +1374,12 @@ sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL) const
bVert = pRef->IsVertical();
bRTL = pRef->IsRightToLeft();
+ bVertL2R = pRef->IsVertLR();
}
return bVert;
}
+// <--
void SwFEShell::MoveObjectIfActive( svt::EmbeddedObjectRef&, const Point& )
{
diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx
index 966b1a43f428..178a07c7bec7 100644
--- a/sw/source/core/inc/anchoredobjectposition.hxx
+++ b/sw/source/core/inc/anchoredobjectposition.hxx
@@ -83,12 +83,14 @@ namespace objectpositioning
void _GetInfoAboutObj();
// --> OD 2006-03-15 #i62875#
- SwTwips _ImplAdjustVertRelPos( const SwTwips _nTopOfAnch,
- const bool _bVert,
- const SwFrm& _rPageAlignLayFrm,
- const SwTwips _nProposedRelPosY,
- const bool _bFollowTextFlow,
- const bool _bCheckBottom = true ) const;
+ // --> OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
+ SwTwips _ImplAdjustVertRelPos( const SwTwips nTopOfAnch,
+ const bool bVert,
+ const bool bVertL2R,
+ const SwFrm& rPageAlignLayFrm,
+ const SwTwips nProposedRelPosY,
+ const bool bFollowTextFlow,
+ const bool bCheckBottom = true ) const;
SwTwips _ImplAdjustHoriRelPos( const SwFrm& _rPageAlignLayFrm,
const SwTwips _nProposedRelPosX ) const;
// <--
@@ -170,53 +172,59 @@ namespace objectpositioning
/** adjust calculated vertical in order to keep object inside
'page' alignment layout frame.
- OD 2004-07-22 #i31805# - add parameter <_bCheckBottom>
- OD 2004-10-08 #i26945# - add parameter <_bFollowTextFlow>
+ OD 2004-07-22 #i31805# - add parameter <bCheckBottom>
+ OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow>
OD 2006-03-15 #i62875# - made inline, intrinsic actions moved
to private method <_ImplAdjustVertRelPos>, which is only
called, if <mbDoNotCaptureAnchoredObj> not set.
+ OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
- @param _nTopOfAnch
+ @param nTopOfAnch
input parameter - 'vertical' position, at which the relative
position of the object is calculated from.
- @param _bVert
+ @param bVert
input parameter - boolean, indicating, if object is in vertical
layout.
- @param _rPageAlignLayFrm
+ @param bVertL2R
+ input parameter - boolean, indicating, if object is in mongolian
+ layout (vertical left-to-right layout).
+
+ @param rPageAlignLayFrm
input parameter - layout frame, which determines the 'page area'
the object has to be vertical positioned in.
- @param _nProposedRelPosY
+ @param nProposedRelPosY
input parameter - proposed relative vertical position, which
will be adjusted.
- @param _bFollowTextFlow
+ @param bFollowTextFlow
input parameter - value of attribute 'Follow text flow' of the
anchored object.
- @param _bCheckBottom
+ @param bCheckBottom
input parameter - boolean indicating, if bottom of anchored
object has to be checked and thus, (if needed) the proposed
relative position has to be adjusted. default value <true>
@author OD
*/
- inline SwTwips _AdjustVertRelPos( const SwTwips _nTopOfAnch,
- const bool _bVert,
- const SwFrm& _rPageAlignLayFrm,
- const SwTwips _nProposedRelPosY,
- const bool _bFollowTextFlow,
- const bool _bCheckBottom = true ) const
+ inline SwTwips _AdjustVertRelPos( const SwTwips nTopOfAnch,
+ const bool bVert,
+ const bool bVertL2R,
+ const SwFrm& rPageAlignLayFrm,
+ const SwTwips nProposedRelPosY,
+ const bool bFollowTextFlow,
+ const bool bCheckBottom = true ) const
{
return !mbDoNotCaptureAnchoredObj
- ? _ImplAdjustVertRelPos( _nTopOfAnch, _bVert,
- _rPageAlignLayFrm,
- _nProposedRelPosY,
- _bFollowTextFlow,
- _bCheckBottom )
- : _nProposedRelPosY;
+ ? _ImplAdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
+ rPageAlignLayFrm,
+ nProposedRelPosY,
+ bFollowTextFlow,
+ bCheckBottom )
+ : nProposedRelPosY;
}
// *********************************************************************
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 9b3599ac977f..1b8762f71edd 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -198,8 +198,8 @@ struct SwRectFnCollection
};
typedef SwRectFnCollection* SwRectFn;
+/*
extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
-
#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
sal_Bool bRev = pFrm->IsReverse(); \
SwRectFn fnRect = bVert ? \
@@ -221,6 +221,36 @@ extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
SwRectFn fnRect = bVert == bNeighb ? \
fnRectHori : fnRectVert;
+*/
+
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R;
+#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
+ sal_Bool bRev = pFrm->IsReverse(); \
+ sal_Bool bVertL2R = pFrm->IsVertLR(); \
+ SwRectFn fnRect = bVert ? \
+ ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
+ ( bRev ? fnRectB2T : fnRectHori );
+#define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \
+ sal_Bool bRevX = pFrm->IsReverse(); \
+ sal_Bool bVertL2RX = pFrm->IsVertLR(); \
+ SwRectFn fnRectX = bVertX ? \
+ ( bRevX ? fnRectVL2R : ( bVertL2RX ? fnRectVertL2R : fnRectVert ) ): \
+ ( bRevX ? fnRectB2T : fnRectHori );
+#define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
+ bRev != pFrm->IsReverse() ) \
+ bVert = pFrm->IsVertical(); \
+ bRev = pFrm->IsReverse(); \
+ bVertL2R = pFrm->IsVertLR(); \
+ fnRect = bVert ? \
+ ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
+ ( bRev ? fnRectB2T : fnRectHori ); }
+#define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
+ sal_Bool bVertL2R = pFrm->IsVertLR(); \
+ sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
+ SwRectFn fnRect = bVert == bNeighb ? \
+ fnRectHori : ( bVertL2R ? fnRectVertL2R : fnRectVert );
+//End of SCMS
#define POS_DIFF( aFrm1, aFrm2 ) \
( (aFrm1.*fnRect->fnGetTop)() != (aFrm2.*fnRect->fnGetTop)() || \
(aFrm1.*fnRect->fnGetLeft)() != (aFrm2.*fnRect->fnGetLeft)() )
@@ -371,6 +401,9 @@ protected:
sal_uInt16 bInvalidVert: 1;
sal_uInt16 bDerivedVert: 1;
sal_uInt16 bVertical: 1;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ sal_uInt16 bVertLR: 1;
+ //End of SCMS
sal_uInt16 nType: 4; //Who am I?
sal_Bool bValidPos: 1;
@@ -562,8 +595,14 @@ public:
inline sal_Bool IsReverse() const { return bReverse; }
inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; }
inline sal_Bool IsVertical() const;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ inline sal_Bool IsVertLR() const;
+ //End of SCMS
inline sal_Bool GetVerticalFlag() const;
inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; }
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ inline void SetbVertLR( sal_Bool bNew ) { bVertLR = bNew ? 1 : 0; }
+ //End of SCMS
inline void SetDerivedVert( sal_Bool bNew ){ bDerivedVert = bNew ? 1 : 0; }
inline void SetInvalidVert( sal_Bool bNew) { bInvalidVert = bNew ? 1 : 0; }
inline sal_Bool IsRightToLeft() const;
@@ -571,6 +610,7 @@ public:
inline void SetRightToLeft( sal_Bool bNew ){ bRightToLeft = bNew ? 1 : 0; }
inline void SetDerivedR2L( sal_Bool bNew ) { bDerivedR2L = bNew ? 1 : 0; }
inline void SetInvalidR2L( sal_Bool bNew ) { bInvalidR2L = bNew ? 1 : 0; }
+
void CheckDirChange();
// returns upper left frame position for LTR and
// upper right frame position for Asian / RTL frames
@@ -950,6 +990,12 @@ sal_Bool SwFrm::IsVertical() const
((SwFrm*)this)->SetDirFlags( sal_True );
return bVertical != 0;
}
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+inline sal_Bool SwFrm::IsVertLR() const
+{
+ return bVertLR != 0;
+}
+//End of SCMS
sal_Bool SwFrm::GetVerticalFlag() const
{
return bVertical != 0;
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 0f4a60c3fa5b..08c9f9d11e36 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -577,7 +577,13 @@ void SwFrm::MakePos()
if( bReverse )
aFrm.Pos().X() += pPrv->Frm().Width();
else
- aFrm.Pos().X() -= aFrm.Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( bVertL2R )
+ aFrm.Pos().X() += pPrv->Frm().Width();
+ else
+ aFrm.Pos().X() -= aFrm.Width();
+ }
}
else
aFrm.Pos().Y() += pPrv->Frm().Height();
@@ -645,13 +651,15 @@ void SwFrm::MakePos()
aFrm.Pos().X() += GetUpper()->Prt().Width()
- aFrm.Width();
}
- else if( bVert && FRM_NOTE_VERT & nMyType && !bReverse )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ else if( bVert && !bVertL2R && FRM_NOTE_VERT & nMyType && !bReverse )
aFrm.Pos().X() -= aFrm.Width() - GetUpper()->Prt().Width();
}
}
else
aFrm.Pos().X() = aFrm.Pos().Y() = 0;
- if( IsBodyFrm() && bVert && !bReverse && GetUpper() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsBodyFrm() && bVert && !bVertL2R && !bReverse && GetUpper() )
aFrm.Pos().X() += GetUpper()->Prt().Width() - aFrm.Width();
bValidPos = sal_True;
}
@@ -873,7 +881,8 @@ void SwLayoutFrm::MakeAll()
//uebernimmt im DTor die Benachrichtigung
const SwLayNotify aNotify( this );
sal_Bool bVert = IsVertical();
- SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : fnRectVert;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : ( IsVertLR() ? fnRectVertL2R : fnRectVert );
SwBorderAttrAccess *pAccess = 0;
const SwBorderAttrs*pAttrs = 0;
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 854012ca9e57..df076ca751de 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -336,7 +336,8 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut
}
const sal_Bool bVert = IsVertical();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
//Ist ein Pointer da, oder sollen wir die Attribute einstellen,
//so stellen wir auf jeden Fall die Spaltenbreiten ein. Andernfalls
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index dfdc9dc04c53..c6e8f4d823d8 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1460,6 +1460,9 @@ void SwFrm::SetDirFlags( sal_Bool bVert )
{
bVertical = pAsk->IsVertical() ? 1 : 0;
bReverse = pAsk->IsReverse() ? 1 : 0;
+
+ bVertLR = pAsk->IsVertLR() ? 1 : 0;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if ( !pAsk->bInvalidVert )
bInvalidVert = sal_False;
}
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 38ce56f902d4..8cd4253f6ddc 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -154,9 +154,21 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
bDerivedR2L = 0;
if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir
|| pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
bVertical = 0;
+ bVertLR = 0;
+ }
else
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
bVertical = 1;
+ if ( FRMDIR_VERT_TOP_LEFT == nDir )
+ bVertLR = 1;
+ else
+ bVertLR = 0;
+ }
+
bVert = bVertical;
bInvalidR2L = 0;
if( FRMDIR_HORI_RIGHT_TOP == nDir )
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index aa0661f126b3..2a5b688e7110 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -661,13 +661,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
while( pUp->IsSctFrm() )
pUp = pUp->GetUpper();
const bool bVert = pUp->IsVertical();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const bool bVertL2R = pUp->IsVertLR();
+
//Dem Textflus folgen.
// --> OD 2009-01-12 #i70582#
+ // --> OD 2009-03-05 - adopted for Support for Classical Mongolian Script
const SwTwips nTopForObjPos =
bVert
- ? ( pCnt->Frm().Left() +
- pCnt->Frm().Width() -
- pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ ? ( bVertL2R
+ ? ( pCnt->Frm().Left() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) )
: ( pCnt->Frm().Top() +
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
// <--
@@ -676,7 +683,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
// OD 26.09.2003 - <rPt> point is inside environment of given content frame
// --> OD 2009-01-12 #i70582#
if( bVert )
- rRet.nMain = nTopForObjPos - rPt.X();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( bVertL2R )
+ rRet.nMain = rPt.X() - nTopForObjPos;
+ else
+ rRet.nMain = nTopForObjPos - rPt.X();
+ }
else
rRet.nMain = rPt.Y() - nTopForObjPos;
// <--
@@ -701,7 +714,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
// OD 26.09.2003 - <rPt> point is in left border of environment
// --> OD 2009-01-12 #i70582#
if( bVert )
- rRet.nMain = nTopForObjPos - rPt.X();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( bVertL2R )
+ rRet.nMain = rPt.X() - nTopForObjPos;
+ else
+ rRet.nMain = nTopForObjPos - rPt.X();
+ }
else
rRet.nMain = rPt.Y() - nTopForObjPos;
// <--
@@ -712,11 +731,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
}
else
{
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
// --> OD 2009-01-12 #i70582#
rRet.nMain = bVert
- ? nTopForObjPos - (pUp->Frm().Left() + pUp->Prt().Left())
- : (pUp->Frm().Top() + pUp->Prt().Bottom()) - nTopForObjPos;
- // <--
+ ? ( bVertL2R
+ ? ( (pUp->Frm().Left() + pUp->Prt().Right()) - nTopForObjPos )
+ : ( nTopForObjPos - (pUp->Frm().Left() + pUp->Prt().Left() ) ) )
+ : ( (pUp->Frm().Top() + pUp->Prt().Bottom()) - nTopForObjPos );
const SwFrm *pPre = pCnt;
const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, sal_True, pCnt );
@@ -737,7 +758,11 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ nFrmTop = pLay->Frm().Left();
+ else
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
nPrtHeight = pLay->Prt().Width();
}
else
@@ -752,9 +777,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pLay = pSect->GetUpper();
if( pLay->IsVertical() )
{
- nFrmTop = pSect->Frm().Left();
- nPrtHeight = pSect->Frm().Left() - pLay->Frm().Left()
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pSect->Frm().Right();
+ nPrtHeight = pLay->Frm().Left() + pLay->Prt().Left()
+ + pLay->Prt().Width() - pSect->Frm().Left()
+ - pSect->Frm().Width();
+ }
+ else
+ {
+ nFrmTop = pSect->Frm().Left();
+ nPrtHeight = pSect->Frm().Left() - pLay->Frm().Left()
- pLay->Prt().Left();
+ }
}
else
{
@@ -770,8 +806,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
- nPrtHeight = pLay->Prt().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pLay->Frm().Left();
+ nPrtHeight = pLay->Prt().Width();
+ }
+ else
+ {
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ nPrtHeight = pLay->Prt().Width();
+ }
}
else
{
@@ -815,8 +860,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pSect = pNxtSect;
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
- nPrtHeight = pLay->Prt().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pLay->Frm().Left();
+ nPrtHeight = pLay->Prt().Width();
+ }
+ else
+ {
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ nPrtHeight = pLay->Prt().Width();
+ }
}
else
{
@@ -829,9 +883,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pLay = pSect->GetUpper();
if( pLay->IsVertical() )
{
- nFrmTop = pSect->Frm().Left();
- nPrtHeight = pSect->Frm().Left() -
- pLay->Frm().Left() - pLay->Prt().Left();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pSect->Frm().Right();
+ nPrtHeight = pLay->Frm().Left()+pLay->Prt().Left()
+ + pLay->Prt().Width() - pSect->Frm().Left()
+ - pSect->Frm().Width();
+ }
+ else
+ {
+ nFrmTop = pSect->Frm().Left();
+ nPrtHeight = pSect->Frm().Left() -
+ pLay->Frm().Left() - pLay->Prt().Left();
+ }
}
else
{
@@ -847,8 +912,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if( pLay->IsVertical() )
{
- nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
- nPrtHeight = pLay->Prt().Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( pLay->IsVertLR() )
+ {
+ nFrmTop = pLay->Frm().Left();
+ nPrtHeight = pLay->Prt().Width();
+ }
+ else
+ {
+ nFrmTop = pLay->Frm().Left() + pLay->Frm().Width();
+ nPrtHeight = pLay->Prt().Width();
+ }
}
else
{
@@ -863,7 +937,8 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
{
if ( pLay->Frm().IsInside( rPt ) )
{
- SwTwips nDiff = pLay->IsVertical() ? ( nFrmTop - rPt.X() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwTwips nDiff = pLay->IsVertical() ? ( pLay->IsVertLR() ? ( rPt.X() - nFrmTop ) : ( nFrmTop - rPt.X() ) )
: ( rPt.Y() - nFrmTop );
if( bSct || pSect )
rRet.nSub += nDiff;
@@ -1219,9 +1294,8 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwPageFrm *pOldPage = FindPageFrm();
const SwRect aOld( GetObjRectWithSpaces() );
Point aNew( rNew );
-
- if( GetAnchorFrm()->IsVertical() || GetAnchorFrm()->IsRightToLeft() )
-
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( ( GetAnchorFrm()->IsVertical() && !GetAnchorFrm()->IsVertLR() ) || GetAnchorFrm()->IsRightToLeft() )
aNew.X() += Frm().Width();
SwCntntFrm *pCnt = (SwCntntFrm*)::FindAnchor( GetAnchorFrm(), aNew );
if( pCnt->IsProtected() )
@@ -1229,6 +1303,8 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwPageFrm *pTmpPage = 0;
const bool bVert = pCnt->IsVertical();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const bool bVertL2R = pCnt->IsVertLR();
const sal_Bool bRTL = pCnt->IsRightToLeft();
if( ( !bVert != !GetAnchorFrm()->IsVertical() ) ||
@@ -1261,14 +1337,21 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
// --> OD 2009-01-12 #i70582#
const SwTwips nTopForObjPos =
bVert
- ? ( pCnt->Frm().Left() +
- pCnt->Frm().Width() -
- pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ ? ( bVertL2R
+ ? ( pCnt->Frm().Left() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) )
: ( pCnt->Frm().Top() +
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
- if ( bVert )
+ if( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
{
- nY = nTopForObjPos - rNew.X() - Frm().Width();
+ if ( bVertL2R )
+ nY = rNew.X() - nTopForObjPos;
+ else
+ nY = nTopForObjPos - rNew.X() - Frm().Width();
}
else
{
@@ -1302,8 +1385,14 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
do
{ const SwFrm *pUp = pFollow->GetUpper();
if( pUp->IsVertical() )
- nDiff += pFollow->Frm().Left() + pFollow->Frm().Width()
- - pUp->Frm().Left() - pUp->Prt().Left();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( pUp->IsVertLR() )
+ nDiff += pUp->Prt().Width() - pFollow->GetRelPos().X();
+ else
+ nDiff += pFollow->Frm().Left() + pFollow->Frm().Width()
+ - pUp->Frm().Left() - pUp->Prt().Left();
+ }
else
nDiff += pUp->Prt().Height() - pFollow->GetRelPos().Y();
pFollow = pFollow->GetFollow();
@@ -1320,14 +1409,21 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
// --> OD 2009-01-12 #i70582#
const SwTwips nTopForObjPos =
bVert
- ? ( pCnt->Frm().Left() +
- pCnt->Frm().Width() -
- pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ ? ( bVertL2R
+ ? ( pCnt->Frm().Left() +
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() )
+ : ( pCnt->Frm().Left() +
+ pCnt->Frm().Width() -
+ pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) )
: ( pCnt->Frm().Top() +
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
- if ( bVert )
+ if( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
{
- nY = nTopForObjPos - rNew.X();
+ if ( bVertL2R )
+ nY = rNew.X() - nTopForObjPos;
+ else
+ nY = nTopForObjPos - rNew.X();
}
else
{
@@ -1421,6 +1517,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
GetPageFrm()->MoveFly( this, pTmpPage );
const Point aRelPos = bVert ? Point( -nY, nX ) : Point( nX, nY );
+
ChgRelPos( aRelPos );
GetFmt()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index aacb9dcadd66..08dee8d2e40e 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -421,7 +421,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() + nDist );
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() )
Frm().Pos().X() -= nDist;
}
long nGrow = nDist - nAvail,
@@ -463,7 +464,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
nDist -= nReal;
//Den masslosen Wunsch koennen wir leider nur in Grenzen erfuellen.
Frm().SSize().Height() -= nDist;
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() )
Frm().Pos().X() += nDist;
}
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 762c1caa3d84..1608425d94ab 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1648,13 +1648,21 @@ sal_Bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
bChanged = aOldRect != pFly->Frm();
if ( IsPaint() && (pFly->IsCompletePaint() || bChanged) &&
- pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 )
+ pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 )
pImp->GetShell()->AddPaintRect( pFly->Frm() );
if ( bChanged )
pFly->Invalidate();
else
pFly->Validate();
+/*
+ //mba: it's unclear why we should invalidate always, so I remove it
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsPaint() && bAddRect && pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 )
+ pImp->GetShell()->AddPaintRect( pFly->Frm() );
+
+ pFly->Invalidate();
+*/
bAddRect = false;
pFly->ResetCompletePaint();
}
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 512998248fe1..9da088849559 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -290,9 +290,67 @@ static SwRectFnCollection aVerticalRightToLeft = {
&SwRect::SetBottomAndHeight,
&SwRect::SetLeftAndWidth
};
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+static SwRectFnCollection aVerticalLeftToRight = {
+ /* fnRectGet */
+ &SwRect::_Left,
+ &SwRect::_Right,
+ &SwRect::_Top,
+ &SwRect::_Bottom,
+ &SwRect::_Height,
+ &SwRect::_Width,
+ &SwRect::TopLeft,
+ &SwRect::SwappedSize,
+ /* fnRectSet */
+ &SwRect::_Left,
+ &SwRect::_Right,
+ &SwRect::_Top,
+ &SwRect::_Bottom,
+ &SwRect::_Height,
+ &SwRect::_Width,
+
+ &SwRect::SubLeft,
+ &SwRect::AddRight,
+ &SwRect::SubTop,
+ &SwRect::AddBottom,
+ &SwRect::AddHeight,
+ &SwRect::AddWidth,
+
+ &SwRect::SetPosY,
+ &SwRect::SetPosX,
+ &SwFrm::GetLeftMargin,
+ &SwFrm::GetRightMargin,
+ &SwFrm::GetTopMargin,
+ &SwFrm::GetBottomMargin,
+ &SwFrm::SetTopBottomMargins,
+ &SwFrm::SetLeftRightMargins,
+ &SwFrm::GetPrtLeft,
+ &SwFrm::GetPrtRight,
+ &SwFrm::GetPrtTop,
+ &SwFrm::GetPrtBottom,
+ &SwRect::GetLeftDistance,
+ &SwRect::GetRightDistance,
+ &SwRect::GetTopDistance,
+ &SwRect::GetBottomDistance,
+ &SwFrm::SetMaxRight,
+ &SwRect::OverStepRight,
+
+ &SwRect::SetUpperLeftCorner,
+ &SwFrm::MakeRightPos,
+ &FirstMinusSecond,
+ &FirstMinusSecond,
+ &SwIncrement,
+ &SwIncrement,
+ &SwRect::SetTopAndHeight,
+ &SwRect::SetLeftAndWidth
+};
+//End of SCMS
SwRectFn fnRectHori = &aHorizontal;
SwRectFn fnRectVert = &aVertical;
+//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+SwRectFn fnRectVertL2R = &aVerticalLeftToRight;
+//End of SCMS
SwRectFn fnRectB2T = &aBottomToTop;
SwRectFn fnRectVL2R = &aVerticalRightToLeft;
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index d17940a1fec3..9792fc09ed42 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -131,7 +131,8 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
if ( nHeight < 0 )
nHeight = 0;
Frm().Height( nHeight );
- if( IsVertical() && !IsReverse() && nWidth != Frm().Width() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() && nWidth != Frm().Width() )
Frm().Pos().X() += Frm().Width() - nWidth;
Frm().Width( nWidth );
}
@@ -342,9 +343,19 @@ void SwPageFrm::CheckDirection( sal_Bool bVert )
{
if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir ||
GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
bVertical = 0;
+ bVertLR = 0;
+ }
else
+ {
bVertical = 1;
+ if(FRMDIR_VERT_TOP_RIGHT == nDir)
+ bVertLR = 0;
+ else if(FRMDIR_VERT_TOP_LEFT==nDir)
+ bVertLR = 1;
+ }
/*
if( pDesc && pDesc->GetName().GetChar(0)=='x')
bReverse = 1;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index fa767ec36958..e0f4914da529 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1214,7 +1214,9 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
if ( rAttrs.IsLine() || rAttrs.IsBorderDist() ||
(bShadow && rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE) )
{
- SwRectFn fnRect = pFrm->IsVertical() ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = pFrm->IsVertical() ? ( pFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
+
const SvxBoxItem &rBox = rAttrs.GetBox();
const sal_Bool bTop = 0 != (pFrm->*fnRect->fnGetTopMargin)();
if ( bTop )
@@ -3168,8 +3170,17 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect )
}
else
{
- fnCheck = &SwRect::GetRightDistance;
- nLimit = rRect.Left();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( rFrm.IsVertLR() )
+ {
+ fnCheck = &SwRect::GetLeftDistance;
+ nLimit = rRect.Right();
+ }
+ else
+ {
+ fnCheck = &SwRect::GetRightDistance;
+ nLimit = rRect.Left();
+ }
}
}
@@ -4880,8 +4891,9 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol,
const SwFrm *pCol = Lower();
if ( !pCol || !pCol->IsColumnFrm() )
return;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = pCol->IsVertical() ? ( pCol->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
- SwRectFn fnRect = pCol->IsVertical() ? fnRectVert : fnRectHori;
SwRect aLineRect = Prt();
aLineRect += Frm().Pos();
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index fd0a0ce1f838..512c45a67b41 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -230,7 +230,9 @@ void SwFrm::CheckDirChange()
SetInvalidVert( sal_True );
SetInvalidR2L( sal_True );
sal_Bool bChg = bOldR2L != IsRightToLeft();
- if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ sal_Bool bOldVertL2R = IsVertLR();
+ if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev || bOldVertL2R != IsVertLR() )
{
InvalidateAll();
if( IsLayoutFrm() )
@@ -324,7 +326,8 @@ void SwFrm::CheckDirChange()
Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const
{
Point aAnchor = Frm().Pos();
- if ( IsVertical() || IsRightToLeft() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( ( IsVertical() && !IsVertLR() ) || IsRightToLeft() )
aAnchor.X() += Frm().Width();
if ( IsTxtFrm() )
@@ -612,7 +615,8 @@ const SwRect SwFrm::PaintArea() const
// Cell frames may not leave their upper:
SwRect aRect = IsRowFrm() ? GetUpper()->Frm() : Frm();
const sal_Bool bVert = IsVertical();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
long nRight = (aRect.*fnRect->fnGetRight)();
long nLeft = (aRect.*fnRect->fnGetLeft)();
const SwFrm* pTmp = this;
@@ -711,7 +715,8 @@ const SwRect SwFrm::PaintArea() const
const SwRect SwFrm::UnionFrm( sal_Bool bBorder ) const
{
sal_Bool bVert = IsVertical();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
long nLeft = (Frm().*fnRect->fnGetLeft)();
long nWidth = (Frm().*fnRect->fnGetWidth)();
long nPrtLeft = (Prt().*fnRect->fnGetLeft)();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index f0d67a191ded..90a3656d1ab7 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4778,7 +4778,8 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SwTwips nHeight = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nHeight - nReal );
- if( IsVertical() && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !bRev )
Frm().Pos().X() += nReal;
}
@@ -4792,7 +4793,8 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
nReal -= nTmp;
SwTwips nHeight = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nHeight + nReal );
- if( IsVertical() && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !bRev )
Frm().Pos().X() -= nReal;
}
nReal = nTmp;
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index c295e6d4542c..c04b13e3c3e5 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2564,7 +2564,8 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
//At least the endframe...
bVert = pEndFrm->IsVertical();
bRev = pEndFrm->IsReverse();
- fnRect = bVert ? ( bRev ? fnRectVL2R : fnRectVert ) :
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ fnRect = bVert ? ( bRev ? fnRectVL2R : ( pEndFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) ) :
( bRev ? fnRectB2T : fnRectHori );
nTmpTwips = (aEndRect.*fnRect->fnGetTop)();
if( (aEndFrm.*fnRect->fnGetTop)() != nTmpTwips )
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 9909b6147d83..4ebca620e4e2 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -108,7 +108,9 @@ SwFrm::SwFrm( SwModify *pMod ) :
ASSERT( pMod, "Kein Frameformat uebergeben." );
bInvalidR2L = bInvalidVert = 1;
- bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = 0;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = bVertLR = 0;
+
bValidPos = bValidPrtArea = bValidSize = bValidLineNum = bRetouche =
bFixSize = bColLocked = sal_False;
bCompletePaint = bInfInvalid = sal_True;
@@ -138,9 +140,19 @@ void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_B
bInvalidVert = 0;
if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir
|| bBrowse )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
bVertical = 0;
+ bVertLR = 0;
+ }
else
+ {
bVertical = 1;
+ if(FRMDIR_VERT_TOP_RIGHT == nDir)
+ bVertLR = 0;
+ else if(FRMDIR_VERT_TOP_LEFT==nDir)
+ bVertLR = 1;
+ }
}
else
{
@@ -1134,9 +1146,12 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
if ( IsHeaderFrm() || IsFooterFrm() )
fnRect = fnRectHori;
else if ( IsCellFrm() || IsColumnFrm() )
- fnRect = GetUpper()->IsVertical() ? fnRectHori : fnRectVert;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ fnRect = GetUpper()->IsVertical() ? fnRectHori : ( GetUpper()->IsVertLR() ? fnRectVertL2R : fnRectVert );
else
- fnRect = GetUpper()->IsVertical() ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ fnRect = GetUpper()->IsVertical() ? ( GetUpper()->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
+
if( (Frm().*fnRect->fnGetWidth)() != (pParent->Prt().*fnRect->fnGetWidth)())
_InvalidateSize();
@@ -1621,7 +1636,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
if ( !bTst )
{
(pFrm->GetNext()->Frm().*fnRect->fnSetHeight)(nAddMax-nAdd);
- if( bVert && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bVert && !bVertL2R && !bRev )
pFrm->GetNext()->Frm().Pos().X() += nAdd;
pFrm->GetNext()->InvalidatePrt();
if ( pFrm->GetNext()->GetNext() )
@@ -1635,7 +1651,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
{
SwTwips nTmp = (pFrm->Frm().*fnRect->fnGetHeight)();
(pFrm->Frm().*fnRect->fnSetHeight)( nTmp - nReal );
- if( bVert && !bRev )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bVert && !bVertL2R && !bRev )
pFrm->Frm().Pos().X() += nReal;
pFrm->InvalidatePrt();
if ( pFrm->GetNext() )
@@ -1896,7 +1913,8 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight + nDist );
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() && !IsReverse() )
Frm().Pos().X() -= nDist;
if ( GetNext() )
{
@@ -1928,7 +1946,8 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
//Cntnts werden immer auf den gewuenschten Wert gebracht.
long nOld = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nOld + nDist );
- if( IsVertical() && !IsReverse() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical()&& !IsVertLR() && !IsReverse() )
Frm().Pos().X() -= nDist;
if ( nOld && IsInTab() )
{
@@ -2024,7 +2043,8 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
else
nRstHeight = nDist;
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() - nDist );
- if( IsVertical() )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertical() && !IsVertLR() )
Frm().Pos().X() += nDist;
nDist = nRstHeight;
if ( IsInTab() )
@@ -2443,7 +2463,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight + nDist );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() -= nDist;
bMoveAccFrm = sal_True;
}
@@ -2524,7 +2545,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
( !IsCellFrm() || static_cast<SwCellFrm*>(this)->GetLayoutRowSpan() > 1 ) )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight + nReal );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() = nFrmPos - nReal;
bMoveAccFrm = sal_True;
}
@@ -2615,7 +2637,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if ( !bTst )
{
(Frm().*fnRect->fnSetHeight)( nFrmHeight - nReal );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nReal;
bMoveAccFrm = sal_True;
}
@@ -2636,7 +2659,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)()
+ nRealDist - nReal );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nRealDist - nReal;
ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
}
@@ -2649,7 +2673,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)()
+ nReal - nTmp );
- if( bChgPos )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nTmp - nReal;
ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
nReal = nTmp;
@@ -3169,7 +3194,8 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
const sal_uInt16 nRight = (sal_uInt16)((SwBorderAttrs*)pAttrs)->CalcRight( this );
const sal_uInt16 nLower = pAttrs->CalcBottom();
sal_Bool bVert = IsVertical() && !IsPageFrm();
- SwRectFn fnRect = bVert ? fnRectVert : fnRectHori;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
if ( !bValidPrtArea )
{
bValidPrtArea = sal_True;
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index cf3017426f31..dc8fe3ad9fdd 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -375,7 +375,12 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
break;
case text::VertOrientation::TOP:
{
- nRelPosY += bVert ? _rLRSpacing.GetRight() : _rULSpacing.GetUpper();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ nRelPosY += bVert
+ ? ( bVertL2R
+ ? _rLRSpacing.GetLeft()
+ : _rLRSpacing.GetRight() )
+ : _rULSpacing.GetUpper();
}
break;
case text::VertOrientation::CENTER:
@@ -385,8 +390,13 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
break;
case text::VertOrientation::BOTTOM:
{
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
nRelPosY += nAlignAreaHeight -
- ( nObjHeight + ( bVert ? _rLRSpacing.GetLeft() : _rULSpacing.GetLower() ) );
+ ( nObjHeight + ( bVert
+ ? ( bVertL2R
+ ? _rLRSpacing.GetRight()
+ : _rLRSpacing.GetLeft() )
+ : _rULSpacing.GetLower() ) );
}
break;
default:
@@ -405,21 +415,23 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
/** adjust calculated vertical in order to keep object inside
'page' alignment layout frame.
- OD 2004-07-01 #i28701# - parameter <_nTopOfAnch> and <_bVert> added
- OD 2004-07-22 #i31805# - add parameter <_bCheckBottom>
- OD 2004-10-08 #i26945# - add parameter <_bFollowTextFlow>
+ OD 2004-07-01 #i28701# - parameter <nTopOfAnch> and <bVert> added
+ OD 2004-07-22 #i31805# - add parameter <bCheckBottom>
+ OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow>
OD 2006-03-15 #i62875# - method now private and renamed.
+ OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
@author OD
*/
-SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips _nTopOfAnch,
- const bool _bVert,
- const SwFrm& _rPageAlignLayFrm,
- const SwTwips _nProposedRelPosY,
- const bool _bFollowTextFlow,
- const bool _bCheckBottom ) const
+SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnch,
+ const bool bVert,
+ const bool bVertL2R,
+ const SwFrm& rPageAlignLayFrm,
+ const SwTwips nProposedRelPosY,
+ const bool bFollowTextFlow,
+ const bool bCheckBottom ) const
{
- SwTwips nAdjustedRelPosY = _nProposedRelPosY;
+ SwTwips nAdjustedRelPosY = nProposedRelPosY;
const Size aObjSize( GetAnchoredObj().GetObjRect().SSize() );
@@ -436,57 +448,67 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips _nTopOfAn
// --> OD 2004-10-08 #i26945# - no extension of restricted area, if
// object's attribute follow text flow is set and its inside a table
if ( GetFrmFmt().getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) &&
- ( !_bFollowTextFlow ||
+ ( !bFollowTextFlow ||
!GetAnchoredObj().GetAnchorFrm()->IsInTab() ) )
{
- aPgAlignArea = _rPageAlignLayFrm.FindPageFrm()->Frm();
+ aPgAlignArea = rPageAlignLayFrm.FindPageFrm()->Frm();
}
else
{
- aPgAlignArea = _rPageAlignLayFrm.Frm();
+ aPgAlignArea = rPageAlignLayFrm.Frm();
}
}
- if ( _bVert )
+ if ( bVert )
{
- // OD 2004-07-22 #i31805# - consider value of <_bCheckBottom>
- if ( _bCheckBottom &&
- _nTopOfAnch - nAdjustedRelPosY - aObjSize.Width() <
- aPgAlignArea.Left() )
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( !bVertL2R )
+ // <--
{
- nAdjustedRelPosY = aPgAlignArea.Left() +
- _nTopOfAnch -
- aObjSize.Width();
+ if ( bCheckBottom &&
+ nTopOfAnch - nAdjustedRelPosY - aObjSize.Width() <
+ aPgAlignArea.Left() )
+ {
+ nAdjustedRelPosY = aPgAlignArea.Left() +
+ nTopOfAnch -
+ aObjSize.Width();
+ }
+ if ( nTopOfAnch - nAdjustedRelPosY > aPgAlignArea.Right() )
+ {
+ nAdjustedRelPosY = nTopOfAnch - aPgAlignArea.Right();
+ }
}
- // --> OD 2004-08-13 #i32964# - correction
- if ( _nTopOfAnch - nAdjustedRelPosY > aPgAlignArea.Right() )
+ // --> OD 2009-09-01 #mongolianlayout#
+ else
{
- nAdjustedRelPosY = _nTopOfAnch - aPgAlignArea.Right();
+ if ( bCheckBottom &&
+ nTopOfAnch + nAdjustedRelPosY + aObjSize.Width() >
+ aPgAlignArea.Right() )
+ {
+ nAdjustedRelPosY = aPgAlignArea.Right() -
+ nTopOfAnch -
+ aObjSize.Width();
+ }
+ if ( nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Left() )
+ {
+ nAdjustedRelPosY = aPgAlignArea.Left() - nTopOfAnch;
+ }
}
// <--
}
else
{
- // OD 2004-07-22 #i31805# - consider value of <_bCheckBottom>
- if ( _bCheckBottom &&
- _nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() >
- // --> OD 2006-01-13 #129959#
- // Do not mix usage of <top + height> and <bottom>
-// aPgAlignArea.Bottom() )
+ if ( bCheckBottom &&
+ nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() >
aPgAlignArea.Top() + aPgAlignArea.Height() )
- // <--
{
- // --> OD 2006-01-13 #129959#
- // Do not mix usage of <top + height> and <bottom>
-// nAdjustedRelPosY = aPgAlignArea.Bottom() -
nAdjustedRelPosY = aPgAlignArea.Top() + aPgAlignArea.Height() -
- // <--
- _nTopOfAnch -
+ nTopOfAnch -
aObjSize.Height();
}
- if ( _nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Top() )
+ if ( nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Top() )
{
- nAdjustedRelPosY = aPgAlignArea.Top() - _nTopOfAnch;
+ nAdjustedRelPosY = aPgAlignArea.Top() - nTopOfAnch;
}
}
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index aa8fdfe888b8..71e85c9d94fa 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -268,9 +268,20 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// determine relative vertical position
SwTwips nRelPosY = nAlignAreaOffset;
- SwTwips nObjHeight = (aObjBoundRect.*fnRect->fnGetHeight)();
- SwTwips nUpperSpace = bVert ? rLR.GetRight() : rUL.GetUpper();
- SwTwips nLowerSpace = bVert ? rLR.GetLeft() : rUL.GetLower();
+ const SwTwips nObjHeight = (aObjBoundRect.*fnRect->fnGetHeight)();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const SwTwips nUpperSpace = bVert
+ ? ( bVertL2R
+ ? rLR.GetLeft()
+ : rLR.GetRight() )
+ : rUL.GetUpper();
+ // --> OD 2009-08-31 #monglianlayout#
+ const SwTwips nLowerSpace = bVert
+ ? ( bVertL2R
+ ? rLR.GetLeft()
+ : rLR.GetRight() )
+ : rUL.GetLower();
+ // <--
switch ( aVert.GetVertOrient() )
{
case text::VertOrientation::CHAR_BOTTOM:
@@ -279,8 +290,11 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
// bottom (to character anchored)
nRelPosY += nAlignAreaHeight + nUpperSpace;
- if ( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( bVert && !bVertL2R )
+ {
nRelPosY += nObjHeight;
+ }
break;
}
}
@@ -402,7 +416,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
aEnvOfObj.GetVertEnvironmentLayoutFrm(
*(pOrientFrm->GetUpper()) );
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm, nRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
@@ -584,7 +598,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// anchored object would fit into environment layout frame, if
// anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm, nRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
@@ -625,7 +639,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// anchored object would fit into environment layout
// frame, if anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nTmpRelPosY,
DoesObjFollowsTextFlow(),
@@ -714,7 +728,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// align at 'page areas', but stay inside given environment
const SwFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nRelPosY,
DoesObjFollowsTextFlow() );
@@ -735,9 +749,19 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
{
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- ( aRelPos.X() - nRelDiff ) -
- aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #monglianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ ( aRelPos.X() - nRelDiff ) -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch +
+ ( aRelPos.X() - nRelDiff ) );
+ }
+ // <--
}
else
{
@@ -828,7 +852,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
nTmpRelPosY = aRelPos.Y() + nDist;
const SwLayoutFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nTmpRelPosY,
DoesObjFollowsTextFlow(),
@@ -836,9 +860,18 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
if ( bVert )
{
aRelPos.X() = nTmpRelPosY;
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() -
- aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
}
else
{
@@ -918,9 +951,21 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
SWREFRESHFN( pUpperOfOrientFrm )
bMoveable = rAnchorTxtFrm.IsMoveable( (SwLayoutFrm*)pUpperOfOrientFrm );
if( bVertX )
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() -
- aObjBoundRect.Width() );
+ {
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch +
+ aRelPos.X() );
+ }
+ // <--
+ }
else
GetAnchoredObj().SetObjTop( nTopOfAnch +
aRelPos.Y() );
@@ -972,8 +1017,19 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// frame, the horizontal position is oriented at.
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() - aObjBoundRect.Width() );
+ {
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() - aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
+ }
else
GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() );
@@ -1023,8 +1079,17 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
{
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() - aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() - aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
GetAnchoredObj().SetObjTop( rAnchorTxtFrm.Frm().Top() +
aRelPos.Y() );
}
diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
index 729a1eabaded..cf02ed8e45cd 100644
--- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
@@ -120,7 +120,11 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
if( bVert )
{
ASSERT( !bRev, "<SwToLayoutAnchoredObjectPosition::CalcPosition()> - reverse layout set." );
- aRelPos.X() = -nRelPosY - aObjBoundRect.Width();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( bVertL2R )
+ aRelPos.X() = nRelPosY;
+ else
+ aRelPos.X() = -nRelPosY - aObjBoundRect.Width();
maOffsetToFrmAnchorPos.X() = nVertOffsetToFrmAnchorPos;
}
else
@@ -204,8 +208,12 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
// determine absolute 'horizontal' position, depending on layout-direction
// --> OD 2004-06-17 #i26791# - determine offset to 'horizontal' frame
// anchor position, depending on layout-direction
- if ( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ // --> OD 2009-09-04 #mongolianlayout#
+ if( bVert || bVertL2R )
+ // <--
{
+
aRelPos.Y() = nRelPosX;
maOffsetToFrmAnchorPos.Y() = nOffset;
}
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 37fb9fbc5747..810efc66f1da 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -224,8 +224,9 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
const SwTwips nFrmMaxY = (pFrm->*fnRect->fnGetPrtBottom)();
// nMaxY is an absolute value
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
SwTwips nMaxY = bVert ?
- Max( nFrmMaxY, nUpperMaxY ) :
+ ( bVertL2R ? Min( nFrmMaxY, nUpperMaxY ) : Max( nFrmMaxY, nUpperMaxY ) ) :
Min( nFrmMaxY, nUpperMaxY );
sal_Bool bRet = sal_False;
@@ -242,8 +243,8 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
{
if( nFirstOffset > 0 )
aPnt1.Y() += nFirstOffset;
-
- if ( aPnt1.X() < nMaxY )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( aPnt1.X() < nMaxY && !bVertL2R )
aPnt1.X() = nMaxY;
aPnt2.X() = aPnt1.X() + pFrm->Prt().Width();
aPnt2.Y() = aPnt1.Y();
@@ -396,8 +397,9 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)();
// nMaxY is in absolute value
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
SwTwips nMaxY = bVert ?
- Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) :
+ ( bVertL2R ? Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) :
Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY );
if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() )
@@ -406,8 +408,9 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const
Point aPnt2;
if ( bVert )
{
- if ( aPnt1.X() < nMaxY )
+ if ( aPnt1.X() < nMaxY && !bVertL2R )
aPnt1.X() = nMaxY;
+
aPnt2.X() = aPnt1.X() + pFrm->Prt().Width();
aPnt2.Y() = aPnt1.Y();
if( aPnt2.X() < nMaxY )
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 27473ccac4fc..4fac26a7a08d 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -482,9 +482,17 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit )
if ( IsVertical() )
{
ASSERT( ! IsSwapped(),"Swapped frame while calculating nRstHeight" );
- nRstHeight = Frm().Left() + Frm().Width() -
- ( GetUpper()->Frm().Left() + GetUpper()->Prt().Left() );
- }
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ nRstHeight = GetUpper()->Frm().Left()
+ + GetUpper()->Prt().Left()
+ + GetUpper()->Prt().Width()
+ - Frm().Left();
+ else
+ nRstHeight = Frm().Left() + Frm().Width() -
+ ( GetUpper()->Frm().Left() + GetUpper()->Prt().Left() );
+ }
else
nRstHeight = GetUpper()->Frm().Top()
+ GetUpper()->Prt().Top()
@@ -1137,7 +1145,9 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
// If the frame grows (or shirks) the repaint rectangle cannot simply
// be rotated back after formatting, because we use the upper left point
// of the frame for rotation. This point changes when growing/shrinking.
- if ( IsVertical() && nChg )
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertical() && !IsVertLR() && nChg )
{
SwRect &rRepaint = *(pPara->GetRepaint());
rRepaint.Left( rRepaint.Left() - nChg );
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 369109efb918..d9f9597d472c 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -448,6 +448,10 @@ SwRect SwTxtFrm::Paint()
// d.h. als linken Rand den berechneten PaintOfst!
SwRepaint *pRepaint = GetPara()->GetRepaint();
long l;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() ) // mba: the following line was added, but we don't need it for the existing directions; kept for IsVertLR(), but should be checked
+ pRepaint->Chg( ( GetUpper()->Frm() ).Pos() + ( GetUpper()->Prt() ).Pos(), ( GetUpper()->Prt() ).SSize() );
+
if( pRepaint->GetOfst() )
pRepaint->Left( pRepaint->GetOfst() );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index c8300820a8f2..557d44045d95 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -814,7 +814,11 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor,
else
{
aPoint.A() = X();
- aPoint.B() = Y() - rPor.GetAscent();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( GetTxtFrm()->IsVertLR() )
+ aPoint.B() = Y() - rPor.Height() + rPor.GetAscent();
+ else
+ aPoint.B() = Y() - rPor.GetAscent();
}
// Adjust x coordinate if we are inside a bidi portion
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index 798faee0d58d..c042634eaf60 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -367,7 +367,11 @@ sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
case SvxParaVertAlignItem::AUTOMATIC :
if ( bAutoToCentered || GetInfo().GetTxtFrm()->IsVertical() )
{
- nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( GetInfo().GetTxtFrm()->IsVertLR() )
+ nOfst += rLine.Height() - ( rLine.Height() - nPorHeight ) / 2 - nPorAscent;
+ else
+ nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent;
break;
}
case SvxParaVertAlignItem::BASELINE :
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 125f3f52908f..25b425df729c 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -104,13 +104,22 @@ void SwTxtFrm::SwapWidthAndHeight()
{
const long nPrtOfstX = Prt().Pos().X();
Prt().Pos().X() = Prt().Pos().Y();
- Prt().Pos().Y() = Frm().Width() - ( nPrtOfstX + Prt().Width() );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertLR() )
+ Prt().Pos().Y() = nPrtOfstX;
+ else
+ Prt().Pos().Y() = Frm().Width() - ( nPrtOfstX + Prt().Width() );
+
}
else
{
const long nPrtOfstY = Prt().Pos().Y();
Prt().Pos().Y() = Prt().Pos().X();
- Prt().Pos().X() = Frm().Height() - ( nPrtOfstY + Prt().Height() );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if( IsVertLR() )
+ Prt().Pos().X() = nPrtOfstY;
+ else
+ Prt().Pos().X() = Frm().Height() - ( nPrtOfstY + Prt().Height() );
}
const long nFrmWidth = Frm().Width();
@@ -128,16 +137,33 @@ void SwTxtFrm::SwapWidthAndHeight()
void SwTxtFrm::SwitchHorizontalToVertical( SwRect& rRect ) const
{
// calc offset inside frame
- const long nOfstX = rRect.Left() - Frm().Left();
- const long nOfstY = rRect.Top() + rRect.Height() - Frm().Top();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ long nOfstX, nOfstY;
+ if ( IsVertLR() )
+ {
+ nOfstX = rRect.Left() - Frm().Left();
+ nOfstY = rRect.Top() - Frm().Top();
+ }
+ else
+ {
+ nOfstX = rRect.Left() - Frm().Left();
+ nOfstY = rRect.Top() + rRect.Height() - Frm().Top();
+ }
+
const long nWidth = rRect.Width();
const long nHeight = rRect.Height();
- if ( bIsSwapped )
- rRect.Left( Frm().Left() + Frm().Height() - nOfstY );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ rRect.Left(Frm().Left() + nOfstY);
else
- // frame is rotated
- rRect.Left( Frm().Left() + Frm().Width() - nOfstY );
+ {
+ if ( bIsSwapped )
+ rRect.Left( Frm().Left() + Frm().Height() - nOfstY );
+ else
+ // frame is rotated
+ rRect.Left( Frm().Left() + Frm().Width() - nOfstY );
+ }
rRect.Top( Frm().Top() + nOfstX );
rRect.Width( nHeight );
@@ -151,12 +177,17 @@ void SwTxtFrm::SwitchHorizontalToVertical( Point& rPoint ) const
// calc offset inside frame
const long nOfstX = rPoint.X() - Frm().Left();
const long nOfstY = rPoint.Y() - Frm().Top();
-
- if ( bIsSwapped )
- rPoint.X() = Frm().Left() + Frm().Height() - nOfstY;
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ rPoint.X() = Frm().Left() + nOfstY;
else
- // calc rotated coords
- rPoint.X() = Frm().Left() + Frm().Width() - nOfstY;
+ {
+ if ( bIsSwapped )
+ rPoint.X() = Frm().Left() + Frm().Height() - nOfstY;
+ else
+ // calc rotated coords
+ rPoint.X() = Frm().Left() + Frm().Width() - nOfstY;
+ }
rPoint.Y() = Frm().Top() + nOfstX;
}
@@ -177,10 +208,17 @@ void SwTxtFrm::SwitchVerticalToHorizontal( SwRect& rRect ) const
long nOfstX;
// calc offset inside frame
- if ( bIsSwapped )
- nOfstX = Frm().Left() + Frm().Height() - ( rRect.Left() + rRect.Width() );
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ nOfstX = rRect.Left() - Frm().Left();
else
- nOfstX = Frm().Left() + Frm().Width() - ( rRect.Left() + rRect.Width() );
+ {
+ if ( bIsSwapped )
+ nOfstX = Frm().Left() + Frm().Height() - ( rRect.Left() + rRect.Width() );
+ else
+ nOfstX = Frm().Left() + Frm().Width() - ( rRect.Left() + rRect.Width() );
+ }
const long nOfstY = rRect.Top() - Frm().Top();
const long nWidth = rRect.Height();
@@ -200,10 +238,17 @@ void SwTxtFrm::SwitchVerticalToHorizontal( Point& rPoint ) const
long nOfstX;
// calc offset inside frame
- if ( bIsSwapped )
- nOfstX = Frm().Left() + Frm().Height() - rPoint.X();
+
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( IsVertLR() )
+ nOfstX = rPoint.X() - Frm().Left();
else
- nOfstX = Frm().Left() + Frm().Width() - rPoint.X();
+ {
+ if ( bIsSwapped )
+ nOfstX = Frm().Left() + Frm().Height() - rPoint.X();
+ else
+ nOfstX = Frm().Left() + Frm().Width() - rPoint.X();
+ }
const long nOfstY = rPoint.Y() - Frm().Top();
@@ -2547,6 +2592,12 @@ void SwTxtFrm::ChgThisLines()
else //Paragraphs which are not counted should not manipulate the AllLines.
nThisLines = nNew;
}
+
+ //mba: invalidating is not necessary; if mongolian script has a problem, it should be fixed at the ritgh place
+ //with invalidating we probably get too much flickering
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ //Ugly. How can we hack if better?
+ //InvalidatePage();
}
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 4a715ba3b27b..a83fe42c265d 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -140,7 +140,12 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nLinePos - nTabPos :
nLinePos + nTabPos;
- SwTwips nMyRight = Right();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ SwTwips nMyRight;
+ if ( pFrm->IsVertLR() )
+ nMyRight = Left();
+ else
+ nMyRight = Right();
if ( pFrm->IsVertical() )
{
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index d5a45beb41d1..f0fe98e44987 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -222,9 +222,17 @@ void SwTxtFrmBreak::SetRstHeight( const SwTxtMargin &rLine )
{
// OD, FME 2004-02-27 #106629# - consider bottom margin
SWRECTFN( pFrm )
+
nRstHeight = (pFrm->*fnRect->fnGetBottomMargin)();
+
if ( bVert )
- nRstHeight += nOrigin - pFrm->SwitchHorizontalToVertical( rLine.Y() );
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ {
+ if ( pFrm->IsVertLR() )
+ nRstHeight = (*fnRect->fnYDiff)( pFrm->SwitchHorizontalToVertical( rLine.Y() ) , nOrigin );
+ else
+ nRstHeight += nOrigin - pFrm->SwitchHorizontalToVertical( rLine.Y() );
+ }
else
nRstHeight += rLine.Y() - nOrigin;
}
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index 2b81f26ab8f5..b2e46cef10f9 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -310,7 +310,7 @@ sal_uLong SwASCIIParser::ReadChars()
}
else if (pUseMe != &aEmpty) //Already successfully figured out type
{
- rInput.StartReadingUnicodeText();
+ rInput.StartReadingUnicodeText( currentCharSet );
bSwapUnicode = rInput.IsEndianSwap();
}
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx
index 244af428abe0..ff4ec261b209 100644
--- a/sw/source/ui/chrdlg/break.cxx
+++ b/sw/source/ui/chrdlg/break.cxx
@@ -160,6 +160,7 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
SvxStandardDialog( pParent,SW_RES(DLG_BREAK) ),
rSh(rS),
+ aBreakFL(this,SW_RES(FL_BREAK)),
aLineBtn(this,SW_RES(RB_LINE)),
aColumnBtn(this,SW_RES(RB_COL)),
aPageBtn(this,SW_RES(RB_PAGE)),
@@ -167,7 +168,6 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
aPageCollBox(this, SW_RES(LB_COLL)),
aPageNumBox(this, SW_RES(CB_PAGENUM)),
aPageNumEdit(this, SW_RES(ED_PAGENUM)),
- aBreakFL(this,SW_RES(FL_BREAK)),
aOkBtn(this,SW_RES(BT_OK)),
aCancelBtn(this,SW_RES(BT_CANCEL)),
@@ -178,6 +178,9 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) :
bHtmlMode(0 != ::GetHtmlMode(rS.GetView().GetDocShell()))
{
+ aPageNumEdit.SetAccessibleRelationLabeledBy(&aPageNumBox);
+ aPageNumEdit.SetAccessibleName(aPageNumBox.GetText());
+
Link aLk = LINK(this,SwBreakDlg,ClickHdl);
aPageBtn.SetClickHdl( aLk );
aLineBtn.SetClickHdl( aLk );
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 61ca1e90a750..15f6737b537c 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -216,6 +216,8 @@ SwCharURLPage::SwCharURLPage( Window* pParent,
{
FreeResource();
+ aEventPB.SetAccessibleRelationMemberOf(&aURLFL);
+
const SfxPoolItem* pItem;
SfxObjectShell* pShell;
if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem) ||
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index e4b95c599071..8f02d0cc8796 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -569,6 +569,7 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage(pParent, SW_RES(TP_DROPCAPS), rSet),
+ aSettingsFL (this, SW_RES(FL_SETTINGS)),
aDropCapsBox (this, SW_RES(CB_SWITCH )),
aWholeWordCB (this, SW_RES(CB_WORD )),
aSwitchText (this, SW_RES(FT_DROPCAPS )),
@@ -577,13 +578,12 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
aLinesField (this, SW_RES(FLD_LINES )),
aDistanceText (this, SW_RES(TXT_DISTANCE)),
aDistanceField(this, SW_RES(FLD_DISTANCE)),
- aSettingsFL (this, SW_RES(FL_SETTINGS)),
+ aContentFL (this, SW_RES(FL_CONTENT )),
aTextText (this, SW_RES(TXT_TEXT )),
aTextEdit (this, SW_RES(EDT_TEXT )),
aTemplateText (this, SW_RES(TXT_TEMPLATE)),
aTemplateBox (this, SW_RES(BOX_TEMPLATE)),
- aContentFL (this, SW_RES(FL_CONTENT )),
pPict (new SwDropCapsPict(this, SW_RES(CNT_PICT))),
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 00d691edd9c3..20b99cc492fb 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -69,10 +69,10 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
aOutlineStartFL ( this, SW_RES( FL_OUTLINE_START )),
aOutlineLvFT ( this, SW_RES( FT_OUTLINE_LEVEL )),
aOutlineLvLB ( this, SW_RES( LB_OUTLINE_LEVEL )),
+ aNewStartFL ( this, SW_RES( FL_NEW_START ) ),
aNumberStyleFT ( this, SW_RES( FT_NUMBER_STYLE ) ),
aNumberStyleLB ( this, SW_RES( LB_NUMBER_STYLE ) ),
- aNewStartFL ( this, SW_RES( FL_NEW_START ) ),
- aNewStartCB ( this, SW_RES( CB_NEW_START ) ),
+ aNewStartCB ( this, SW_RES( CB_NEW_START ) ),
aNewStartNumberCB ( this, SW_RES( CB_NUMBER_NEW_START ) ),
aNewStartNF ( this, SW_RES( NF_NEW_START ) ),
aCountParaFL ( this, SW_RES( FL_COUNT_PARA ) ),
@@ -111,6 +111,8 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
SwParagraphNumTabPage, LineCountHdl_Impl));
aRestartParaCountCB.SetClickHdl(
LINK(this, SwParagraphNumTabPage, LineCountHdl_Impl));
+ aNewStartNF.SetAccessibleName(aNewStartNumberCB.GetText());
+ aNewStartNF.SetAccessibleRelationLabeledBy(&aNewStartNumberCB);
}
/*-----------------31.01.98 08:34-------------------
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index 94a0e7845930..01aa945712cd 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -99,6 +99,10 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet)
FreeResource();
SetExchangeSupport();
+ aRemovePB.SetAccessibleRelationMemberOf(&aConditionFL);
+ aAssignPB.SetAccessibleRelationMemberOf(&aConditionFL);
+ aTbLinks.SetAccessibleRelationLabeledBy(&aConditionCB);
+
// Handler installieren
aConditionCB.SetClickHdl( LINK(this, SwCondCollPage, OnOffHdl));
aTbLinks.SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveHdl ));
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 56a2ced0eabd..84ab51621609 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -345,11 +345,11 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
aProspectCB (this, SW_RES(CB_PROSPECT)),
aProspectCB_RTL (this, SW_RES(CB_PROSPECT_RTL)),
aSeparatorRFL (this, SW_RES(FL_SEP_PRT_RIGHT)),
+ aFL3 (this, SW_RES(FL_3)),
aNoRB (this, SW_RES(RB_NO)),
aOnlyRB (this, SW_RES(RB_ONLY)),
aEndRB (this, SW_RES(RB_END)),
aEndPageRB (this, SW_RES(RB_PAGEEND)),
- aFL3 (this, SW_RES(FL_3)),
aFL4 (this, SW_RES(FL_4)),
aPrintEmptyPagesCB(this, SW_RES(CB_PRINTEMPTYPAGES)),
// aSingleJobsCB (this, SW_RES(CB_SINGLEJOBS)),
@@ -1964,6 +1964,13 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( Window* pParent,
aLk = LINK(this, SwRedlineOptionsTabPage, ChangedMaskPrevHdl);
aMarkPosLB.SetSelectHdl( aLk );
aMarkColorLB.SetSelectHdl( aLk );
+//IAccessibility2 Impplementaton 2009-----
+ //solution: set different accessible name of four color box
+ aInsertColorLB.SetAccessibleName(::rtl::OUString( aInsertFT.GetDisplayText()) + ::rtl::OUString(aInsertColorFT.GetDisplayText()));
+ aDeletedColorLB.SetAccessibleName(::rtl::OUString( aDeletedFT.GetDisplayText()) + ::rtl::OUString( aDeletedColorFT.GetDisplayText()));
+ aChangedColorLB.SetAccessibleName(::rtl::OUString( aChangedFT.GetDisplayText()) + ::rtl::OUString( aChangedColorFT.GetDisplayText()));
+ aMarkColorLB.SetAccessibleName(::rtl::OUString( aMarkPosFT.GetDisplayText()) + ::rtl::OUString( aMarkColorFT.GetDisplayText()));
+//-----IAccessibility2 Impplementaton 2009
}
SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage()
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index cb6a9882fac3..08bb7b96e45b 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -82,23 +82,21 @@ SfxTabPage * SwDocStatPage::Create(Window *pParent, const SfxItemSet &rSet)
SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage (pParent, SW_RES(TP_DOC_STAT), rSet),
-
+ aPageLbl (this, SW_RES( FT_PAGE )),
+ aPageNo (this, SW_RES( FT_PAGE_COUNT )),
aTableLbl (this, SW_RES( FT_TABLE )),
+ aTableNo (this, SW_RES( FT_TABLE_COUNT)),
aGrfLbl (this, SW_RES( FT_GRF )),
+ aGrfNo (this, SW_RES( FT_GRF_COUNT )),
aOLELbl (this, SW_RES( FT_OLE )),
- aPageLbl (this, SW_RES( FT_PAGE )),
+ aOLENo (this, SW_RES( FT_OLE_COUNT )),
aParaLbl (this, SW_RES( FT_PARA )),
+ aParaNo (this, SW_RES( FT_PARA_COUNT )),
aWordLbl (this, SW_RES( FT_WORD )),
+ aWordNo (this, SW_RES( FT_WORD_COUNT )),
aCharLbl (this, SW_RES( FT_CHAR )),
+ aCharNo (this, SW_RES( FT_CHAR_COUNT )),
aLineLbl (this, SW_RES( FT_LINE )),
-
- aTableNo (this, SW_RES( FT_TABLE_COUNT)),
- aGrfNo (this, SW_RES( FT_GRF_COUNT )),
- aOLENo (this, SW_RES( FT_OLE_COUNT )),
- aPageNo (this, SW_RES( FT_PAGE_COUNT )),
- aParaNo (this, SW_RES( FT_PARA_COUNT )),
- aWordNo (this, SW_RES( FT_WORD_COUNT )),
- aCharNo (this, SW_RES( FT_CHAR_COUNT )),
aLineNo (this, SW_RES( FT_LINE_COUNT )),
aUpdatePB (this, SW_RES( PB_PDATE ))
{
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 312224b8dad0..e0ec8cdf2a0b 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -457,6 +457,10 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
aTree.Select( aTree.First() );
aTree.Show();
bDontCheckPasswd = sal_False;
+
+ aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL);
+ aPasswdPB.SetAccessibleRelationLabeledBy(&aPasswdCB);
+ aSubRegionED.SetAccessibleName(aSubRegionFT.GetText());
}
/* -----------------------------26.04.01 14:56--------------------------------
@@ -1353,6 +1357,7 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
rData.SetLinkFilePassword( aEmptyStr );
}
rData.SetType(DDE_LINK_SECTION);
+ aFileNameED.SetAccessibleName(aDDECommandFT.GetText());
}
else
{
@@ -1371,6 +1376,7 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
rData.SetLinkFilePassword( aEmptyStr );
aFileNameED.SetText(aEmptyStr);
}
+ aFileNameED.SetAccessibleName(aFileNameFT.GetText());
}
aFilePB.Enable(bFile && !bDDE);
}
@@ -1734,6 +1740,7 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(
aCurName.SetModifyHdl ( LINK( this, SwInsertSectionTabPage, NameEditHdl));
aDDECB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, DDEHdl ));
ChangeProtectHdl(&aProtectCB);
+ aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL);
aSubRegionED.EnableAutocomplete( sal_True, sal_True );
}
/* -----------------21.05.99 10:31-------------------
@@ -1999,6 +2006,7 @@ IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox )
aDDECommandFT.Show();
aSubRegionFT.Hide();
aSubRegionED.Hide();
+ aFileNameED.SetAccessibleName(aDDECommandFT.GetText());
}
else
{
@@ -2008,6 +2016,7 @@ IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox )
aSubRegionFT.Show();
aSubRegionED.Show();
aSubRegionED.Enable(bFile);
+ aFileNameED.SetAccessibleName(aFileNameFT.GetText());
}
return 0;
}
@@ -2375,6 +2384,7 @@ SwSectionIndentTabPage::SwSectionIndentTabPage( Window *pParent, const SfxItemSe
Link aLk = LINK(this, SwSectionIndentTabPage, IndentModifyHdl);
aBeforeMF.SetModifyHdl(aLk);
aAfterMF.SetModifyHdl(aLk);
+ aPreviewWin.SetAccessibleName(aIndentFL.GetText());
}
/*-- 13.06.2003 09:59:23---------------------------------------------------
diff --git a/sw/source/ui/docvw/access.src b/sw/source/ui/docvw/access.src
index 42081d3ab7e7..d455c01d0cf3 100644
--- a/sw/source/ui/docvw/access.src
+++ b/sw/source/ui/docvw/access.src
@@ -100,3 +100,22 @@ String STR_ACCESS_ANNOTATION_BUTTON_DESC
Text [ en-US ] = "Activate this button to open a list of actions which can be performed on this comment and other comments";
};
+//IAccessibility2 Implementation 2009-----
+String STR_ACCESS_PREVIEW_DOC_NAME
+{
+ Text [ en-US ] = "Document preview";
+};
+String STR_ACCESS_PREVIEW_DOC_SUFFIX
+{
+ Text [ en-US ] = "(Preview mode)";
+};
+String STR_ACCESS_DOC_WORDPROCESSING
+{
+ Text [ en-US ] = "%PRODUCTNAME Document";
+};
+String STR_ACCESS_DOC_WORDPROCESSING_READONLY
+{
+ Text [ en-US ] = "(read-only)";
+};
+//-----IAccessibility2 Implementation 2009
+
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 396c71f9f4a9..07f76bc30b56 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1208,8 +1208,8 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
{
// --> FME 2005-04-26 #i47138#
// Check if object is anchored as character and move direction
- sal_Bool bDummy;
- const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy );
+ sal_Bool bDummy1, bDummy2;
+ const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy1, bDummy2 );
const bool bHoriMove = !bVertAnchor == !( nDir % 2 );
const bool bMoveAllowed =
!bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR);
@@ -1365,11 +1365,14 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
if( ( bVertText && ( !bTblCrsr || bVertTable ) ) ||
( bTblCrsr && bVertTable ) )
{
+ // Attempt to integrate cursor travelling for mongolian layout does not work.
+ // Thus, back to previous mapping of cursor keys to direction keys.
if( KEY_UP == nKey ) nKey = KEY_LEFT;
else if( KEY_DOWN == nKey ) nKey = KEY_RIGHT;
else if( KEY_LEFT == nKey ) nKey = KEY_DOWN;
else if( KEY_RIGHT == nKey ) nKey = KEY_UP;
}
+
if ( rSh.IsInRightToLeftText() )
{
if( KEY_LEFT == nKey ) nKey = KEY_RIGHT;
@@ -1979,6 +1982,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
#ifdef SW_CRSR_TIMER
sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
+ sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False );
#endif
if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) {
eKeyState=KS_GotoPrevFieldMark;
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index cacd61a83434..4ee1d3295ddc 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -272,6 +272,7 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
pNewDBMgr(NULL),
aItem ((const SwLabItem&) rSet.Get(FN_LABEL)),
+ aWritingFL (this, SW_RES(FL_WRITING)),
aWritingText (this, SW_RES(TXT_WRITING)),
aAddrBox (this, SW_RES(BOX_ADDR )),
aWritingEdit (this, SW_RES(EDT_WRITING)),
@@ -282,7 +283,7 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
aInsertBT (this, SW_RES(BTN_INSERT )),
aDBFieldFT (this, SW_RES(FT_DBFIELD )),
aDBFieldLB (this, SW_RES(LB_DBFIELD )),
- aWritingFL (this, SW_RES(FL_WRITING)),
+ aFormatFL (this, SW_RES(FL_FORMAT )),
aContButton (this, SW_RES(BTN_CONT )),
aSheetButton (this, SW_RES(BTN_SHEET )),
aMakeText (this, SW_RES(TXT_MAKE )),
@@ -290,9 +291,8 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) :
aTypeText (this, SW_RES(TXT_TYPE )),
aTypeBox (this, SW_RES(BOX_TYPE )),
aHiddenSortTypeBox(this, WB_SORT|WB_HIDE),
- aFormatInfo (this, SW_RES(INF_FORMAT )),
- aFormatFL (this, SW_RES(FL_FORMAT ))
-{
+ aFormatInfo (this, SW_RES(INF_FORMAT ))
+ {
WaitObject aWait( pParent );
FreeResource();
@@ -715,10 +715,10 @@ void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt,
SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_VISITING_CARDS), rSet),
+ aContentFL(this, SW_RES( FL_CONTENT )),
aAutoTextLB(this, SW_RES( LB_AUTO_TEXT )),
aAutoTextGroupFT(this, SW_RES( FT_AUTO_TEXT_GROUP )),
aAutoTextGroupLB(this, SW_RES( LB_AUTO_TEXT_GROUP )),
- aContentFL(this, SW_RES( FL_CONTENT )),
aExampleWIN(this, SW_RES( WIN_EXAMPLE )),
sVisCardGroup(SW_RES(ST_VISCARD_GROUP)),
pExampleFrame(0)
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 2639109b8079..4341bc9c5b75 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -61,6 +61,7 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_LAB_PRT), rSet),
pPrinter( 0 ),
+ aFLDontKnow (this, SW_RES(FL_DONTKNOW)),
aPageButton (this, SW_RES(BTN_PAGE )),
aSingleButton (this, SW_RES(BTN_SINGLE )),
aColText (this, SW_RES(TXT_COL )),
@@ -68,10 +69,9 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) :
aRowText (this, SW_RES(TXT_ROW )),
aRowField (this, SW_RES(FLD_ROW )),
aSynchronCB (this, SW_RES(CB_SYNCHRON)),
- aFLDontKnow (this, SW_RES(FL_DONTKNOW)),
+ aFLPrinter (this, SW_RES(FL_PRINTER )),
aPrinterInfo (this, SW_RES(INF_PRINTER)),
- aPrtSetup (this, SW_RES(BTN_PRTSETUP)),
- aFLPrinter (this, SW_RES(FL_PRINTER ))
+ aPrtSetup (this, SW_RES(BTN_PRTSETUP))
{
FreeResource();
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index 4fd8d163ac36..44fa4f4e9f3e 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -45,6 +45,7 @@ class SwLabPrtPage : public SfxTabPage
{
Printer* pPrinter; //Fuer die Schachteinstellug - leider.
+ FixedLine aFLDontKnow;
RadioButton aPageButton;
RadioButton aSingleButton;
FixedText aColText;
@@ -52,11 +53,10 @@ class SwLabPrtPage : public SfxTabPage
FixedText aRowText;
NumericField aRowField;
CheckBox aSynchronCB;
- FixedLine aFLDontKnow;
+ FixedLine aFLPrinter;
FixedInfo aPrinterInfo;
PushButton aPrtSetup;
- FixedLine aFLPrinter;
SwLabPrtPage(Window* pParent, const SfxItemSet& rSet);
~SwLabPrtPage();
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index 2bfcc7e27cae..2bbbc8526f10 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -34,6 +34,7 @@ class SwLabPage : public SfxTabPage
String sActDBName;
SwLabItem aItem;
+ FixedLine aWritingFL;
FixedText aWritingText;
CheckBox aAddrBox;
MultiLineEdit aWritingEdit;
@@ -45,8 +46,8 @@ class SwLabPage : public SfxTabPage
FixedText aDBFieldFT;
ListBox aDBFieldLB;
// PushButton aDatabaseButton;
- FixedLine aWritingFL;
+ FixedLine aFormatFL;
RadioButton aContButton;
RadioButton aSheetButton;
FixedText aMakeText;
@@ -55,7 +56,6 @@ class SwLabPage : public SfxTabPage
ListBox aTypeBox;
ListBox aHiddenSortTypeBox;
FixedInfo aFormatInfo;
- FixedLine aFormatFL;
sal_Bool m_bLabel;
@@ -102,12 +102,11 @@ public:
class SwOneExampleFrame;
class SwVisitingCardPage : public SfxTabPage
{
+ FixedLine aContentFL;
SvTreeListBox aAutoTextLB;
FixedText aAutoTextGroupFT;
ListBox aAutoTextGroupLB;
- FixedLine aContentFL;
-
Window aExampleWIN;
String sVisCardGroup;
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index bd528f39709a..1f3030686a1a 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -335,12 +335,16 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
aNameFT.SetText(SW_RESSTR(STR_MACNAME));
aValueFT.SetText(SW_RESSTR(STR_PROMPT));
aNameED.SetText(GetFldMgr().GetMacroName());
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_HIDDENPARAFLD:
aNameFT.SetText(SW_RESSTR(STR_COND));
aNameED.SetDropEnable(sal_True);
bName = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_HIDDENTXTFLD:
@@ -352,6 +356,8 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
if (!IsFldEdit() && pSh )
aValueED.SetText(pSh->GetSelTxt());
bName = bValue = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
}
break;
@@ -365,18 +371,24 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
}
bName = bValue = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_JUMPEDITFLD:
aNameFT.SetText(SW_RESSTR(STR_JUMPEDITFLD));
aValueFT.SetText(SW_RESSTR(STR_PROMPT));
bName = bValue = sal_True;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_INPUTFLD:
aValueFT.SetText(SW_RESSTR(STR_PROMPT));
bValue = sal_True;
- // bShowSelection = sal_True;
+ // bShowSelection = TRUE;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
break;
case TYP_COMBINED_CHARS:
@@ -388,6 +400,8 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
const sal_uInt16 nLen = aNameED.GetText().Len();
if( !nLen || nLen > MAX_COMBINED_CHARACTERS )
bInsert = sal_False;
+ aNameED.SetAccessibleName(aNameFT.GetText());
+ aValueED.SetAccessibleName(aValueFT.GetText());
}
break;
case TYP_DROPDOWN :
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 62b95165bd6b..9859f4875b46 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -68,6 +68,8 @@
#include <docary.hxx>
#include <pagedesc.hxx>
+#include "access.hrc"
+
#define FRAME_FORMAT_WIDTH 1000
// sw/inc/fmtclds.hxx
@@ -451,12 +453,13 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
: SfxTabPage(pParent, SW_RES(TP_COLUMN), rSet),
+ aFLGroup(this, SW_RES(FL_COLUMNS )),
aClNrLbl(this, SW_RES(FT_NUMBER )),
aCLNrEdt(this, SW_RES(ED_NUMBER )),
aDefaultVS(this, SW_RES(VS_DEFAULTS)),
aBalanceColsCB(this, SW_RES(CB_BALANCECOLS)),
- aFLGroup(this, SW_RES(FL_COLUMNS )),
+ aFLLayout(this, SW_RES(FL_LAYOUT)),
aBtnUp(this, SW_RES(BTN_DOWN)),
aColumnFT(this, SW_RES(FT_COLUMN)),
aWidthFT(this, SW_RES(FT_WIDTH)),
@@ -472,15 +475,13 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
aBtnDown(this, SW_RES(BTN_UP)),
aAutoWidthBox(this, SW_RES(CB_AUTO_WIDTH)),
- aFLLayout(this, SW_RES(FL_LAYOUT)),
-
+ aFLLineType(this, SW_RES(FL_LINETYPE)),
aLineTypeLbl(this, SW_RES(FT_STYLE)),
aLineTypeDLB(this, SW_RES(LB_STYLE)),
aLineHeightLbl(this, SW_RES(FT_HEIGHT)),
aLineHeightEdit(this, SW_RES(ED_HEIGHT)),
aLinePosLbl(this, SW_RES(FT_POSITION)),
aLinePosDLB(this, SW_RES(LB_POSITION)),
- aFLLineType(this, SW_RES(FL_LINETYPE)),
aVertFL(this, SW_RES(FL_VERT)),
aPropertiesFL( this, SW_RES( FL_PROPERTIES )),
@@ -505,6 +506,15 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
FreeResource();
SetExchangeSupport();
+ aBtnDown.SetAccessibleRelationMemberOf(&aFLLayout);
+ aEd1.SetAccessibleRelationLabeledBy(&aWidthFT);
+ aEd2.SetAccessibleRelationLabeledBy(&aWidthFT);
+ aEd3.SetAccessibleRelationLabeledBy(&aWidthFT);
+ aDistEd1.SetAccessibleRelationLabeledBy(&aDistFT);
+ aDistEd2.SetAccessibleRelationLabeledBy(&aDistFT);
+ aBtnUp.SetAccessibleRelationLabeledBy(&aColumnFT);
+ aBtnDown.SetAccessibleRelationLabeledBy(&aColumnFT);
+
aDefaultVS.SetHelpId(HID_COLUMN_VALUESET);
aDefaultVS.SetColCount( 5 );
aDefaultVS.SetStyle( aDefaultVS.GetStyle()
@@ -909,16 +919,41 @@ void SwColumnPage::SetLabels( sal_uInt16 nVis )
String sLbl( '~' );
String sLbl2( String::CreateFromInt32( nVis + 1 ));
+ String tmp1(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1);
aLbl1.SetText(sLbl2);
sLbl2 = String::CreateFromInt32( nVis + 2 );
+ String tmp2(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1);
aLbl2.SetText(sLbl2);
sLbl2 = String::CreateFromInt32( nVis + 3 );
+ String tmp3(sLbl2);
sLbl2.Insert(sLbl, sLbl2.Len() - 1);
aLbl3.SetText(sLbl2);
+ String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
+ sColumnWidth.SearchAndReplaceAscii("%1", tmp1);
+ aEd1.SetAccessibleName(sColumnWidth);
+
+ sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
+ sColumnWidth.SearchAndReplaceAscii("%1", tmp2);
+ aEd2.SetAccessibleName(sColumnWidth);
+
+ sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
+ sColumnWidth.SearchAndReplaceAscii("%1", tmp3);
+ aEd3.SetAccessibleName(sColumnWidth);
+
+ String sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ;
+ String sDist1 = sDist;
+ sDist1.SearchAndReplaceAscii("%1", tmp1);
+ sDist1.SearchAndReplaceAscii("%2", tmp2);
+ aDistEd1.SetAccessibleName(sDist1);
+
+ String sDist2 = sDist;
+ sDist2.SearchAndReplaceAscii("%1", tmp2);
+ sDist2.SearchAndReplaceAscii("%2", tmp3);
+ aDistEd2.SetAccessibleName(sDist2);
}
/*------------------------------------------------------------------------
diff --git a/sw/source/ui/frmdlg/column.hrc b/sw/source/ui/frmdlg/column.hrc
index dd8b81e0c91a..e46697a8c618 100644
--- a/sw/source/ui/frmdlg/column.hrc
+++ b/sw/source/ui/frmdlg/column.hrc
@@ -79,7 +79,6 @@
#define FT_TEXTDIRECTION 60
#define LB_TEXTDIRECTION 61
#define FL_VERT 62
-
#define LISTBOX_SELECTION 0
#define LISTBOX_SECTION 1
#define LISTBOX_SECTIONS 2
diff --git a/sw/source/ui/frmdlg/column.src b/sw/source/ui/frmdlg/column.src
index 04e91ce3560a..c5ba19c9a958 100644
--- a/sw/source/ui/frmdlg/column.src
+++ b/sw/source/ui/frmdlg/column.src
@@ -30,6 +30,8 @@
#include "frmui.hrc"
#include "cmdid.h"
#include "helpid.h"
+#include "access.hrc"
+
// #define TP_COLUMN 256
TabPage TP_COLUMN
{
@@ -416,4 +418,14 @@ ModalDialog DLG_COLUMN
Text [ en-US ] = "Columns";
};
+//IAccessibility2 Impplementaton 2009-----
+String STR_ACCESS_PAGESETUP_SPACING
+{
+ Text [ en-US ] = "Spacing between %1 and %2";
+};
+String STR_ACCESS_COLUMN_WIDTH
+{
+ Text [ en-US ] = "Column %1 Width";
+};
+//-----IAccessibility2 Impplementaton 2009
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index 09c9764c460e..dd709b8243d4 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -71,7 +71,8 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nTyp
pOwnSh( pSh ),
bAbsPos( sal_False ),
bNewFrm( bNew ),
- bIsInVertical( sal_False )
+ bIsInVertical( sal_False ),
+ bIsInVerticalL2R( sal_False )
{
if ( bNewFrm )
{
@@ -92,7 +93,7 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nTyp
{
pOwnSh->GetFlyFrmAttr( aSet );
sal_Bool bRightToLeft;
- bIsInVertical = pOwnSh->IsFrmVertical(sal_True, bRightToLeft);
+ bIsInVertical = pOwnSh->IsFrmVertical(sal_True, bRightToLeft, bIsInVerticalL2R);
}
::PrepareBoxInfo( aSet, *pOwnSh );
}
@@ -102,12 +103,13 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, const SfxItemS
pOwnSh( pSh ),
bAbsPos( sal_False ),
bNewFrm( bNew ),
- bIsInVertical(sal_False)
+ bIsInVertical(sal_False),
+ bIsInVerticalL2R(sal_False)
{
if(!bNew)
{
sal_Bool bRightToLeft;
- bIsInVertical = pSh->IsFrmVertical(sal_True, bRightToLeft);
+ bIsInVertical = pSh->IsFrmVertical(sal_True, bRightToLeft, bIsInVerticalL2R);
}
}
@@ -297,7 +299,9 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
if (bOnlyPercentRefValue)
return;
- if(bIsInVertical)
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bIsInVertical || bIsInVerticalL2R )
+ // <--
{
Point aPos(aBoundRect.Pos());
long nTmp = aPos.X();
@@ -494,7 +498,9 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
rVal.nMaxVPos = -aBoundRect.Height();
}
}
- if(bIsInVertical)
+ // --> OD 2009-09-01 #mongolianlayout#
+ if ( bIsInVertical || bIsInVerticalL2R )
+ // <--
{
//restore width/height exchange
long nTmp = rVal.nWidth;
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 9c107582aed9..e64ec62f6c3a 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -500,17 +500,32 @@ void lcl_InsertVectors(ListBox& rBox,
/* -----------------------------20.08.2002 16:12------------------------------
---------------------------------------------------------------------------*/
-SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bRTL)
+// --> OD 2009-08-31 #mongolianlayout#
+// add input parameter
+SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bVerticalL2R, sal_Bool bRTL)
{
//special handling of STR_FROMLEFT
- if(SwFPos::FROMLEFT == eStringId)
+ if ( SwFPos::FROMLEFT == eStringId )
+ {
+ eStringId = bVertical
+ ? ( bRTL
+ ? SwFPos::FROMBOTTOM
+ : SwFPos::FROMTOP )
+ : ( bRTL
+ ? SwFPos::FROMRIGHT
+ : SwFPos::FROMLEFT );
+ return eStringId;
+ }
+ // --> OD 2009-08-31 #mongolianlayout#
+ // special handling of STR_FROMTOP in case of mongolianlayout (vertical left-to-right)
+ if ( SwFPos::FROMTOP == eStringId &&
+ bVertical && bVerticalL2R )
{
- eStringId = bVertical ?
- bRTL ? SwFPos::FROMBOTTOM : SwFPos::FROMTOP :
- bRTL ? SwFPos::FROMRIGHT : SwFPos::FROMLEFT;
+ eStringId = SwFPos::FROMLEFT;
return eStringId;
}
- if(bVertical)
+ // <--
+ if ( bVertical )
{
//exchange horizontal strings with vertical strings and vice versa
static const StringIdPair_Impl aHoriIds[] =
@@ -535,6 +550,19 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
{SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
{SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
};
+ // --> OD 2009-08-31 #monglianlayout#
+ static const StringIdPair_Impl aVertL2RIds[] =
+ {
+ {SwFPos::TOP, SwFPos::LEFT },
+ {SwFPos::BOTTOM, SwFPos::RIGHT },
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI },
+ {SwFPos::FROMTOP, SwFPos::FROMLEFT },
+ {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT },
+ {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } ,
+ {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
+ {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
+ };
+ // <--
sal_uInt16 nIndex;
for(nIndex = 0; nIndex < sizeof(aHoriIds) / sizeof(StringIdPair_Impl); ++nIndex)
{
@@ -547,11 +575,24 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
nIndex = 0;
for(nIndex = 0; nIndex < sizeof(aVertIds) / sizeof(StringIdPair_Impl); ++nIndex)
{
- if(aVertIds[nIndex].eHori == eStringId)
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVerticalL2R )
{
- eStringId = aVertIds[nIndex].eVert;
- break;
+ if(aVertIds[nIndex].eHori == eStringId)
+ {
+ eStringId = aVertIds[nIndex].eVert;
+ break;
+ }
+ }
+ else
+ {
+ if(aVertL2RIds[nIndex].eHori == eStringId)
+ {
+ eStringId = aVertL2RIds[nIndex].eVert;
+ break;
+ }
}
+ // <--
}
}
return eStringId;
@@ -613,6 +654,7 @@ namespace
SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
SfxTabPage (pParent, SW_RES(TP_FRM_STD), rSet),
+ aSizeFL (this, SW_RES(FL_SIZE)),
aWidthFT (this, SW_RES(FT_WIDTH)),
aWidthAutoFT (this, SW_RES(FT_WIDTH_AUTO)),
aWidthED (this, SW_RES(ED_WIDTH)),
@@ -625,16 +667,16 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
aAutoHeightCB (this, SW_RES(CB_AUTOHEIGHT)),
aFixedRatioCB (this, SW_RES(CB_FIXEDRATIO)),
aRealSizeBT (this, SW_RES(BT_REALSIZE)),
- aSizeFL (this, SW_RES(FL_SIZE)),
- aTypeFL (this, SW_RES(FL_TYPE)),
aTypeSepFL (this, SW_RES(FL_TYPE_SEP)),
+ aTypeFL (this, SW_RES(FL_TYPE)),
aAnchorAtPageRB (this, SW_RES(RB_ANCHOR_PAGE)),
aAnchorAtParaRB (this, SW_RES(RB_ANCHOR_PARA)),
aAnchorAtCharRB (this, SW_RES(RB_ANCHOR_AT_CHAR)),
aAnchorAsCharRB (this, SW_RES(RB_ANCHOR_AS_CHAR)),
aAnchorAtFrameRB(this, SW_RES(RB_ANCHOR_FRAME)),
+ aPositionFL (this, SW_RES(FL_POSITION)),
aHorizontalFT (this, SW_RES(FT_HORIZONTAL)),
aHorizontalDLB (this, SW_RES(DLB_HORIZONTAL)),
aAtHorzPosFT (this, SW_RES(FT_AT_HORZ_POS)),
@@ -650,18 +692,21 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
aVertRelationLB (this, SW_RES(LB_VERT_RELATION)),
// OD 19.09.2003 #i18732# - new checkbox
aFollowTextFlowCB(this, SW_RES(CB_FOLLOWTEXTFLOW)),
- aPositionFL (this, SW_RES(FL_POSITION)),
aExampleWN (this, SW_RES(WN_BSP)),
bAtHorzPosModified( sal_False ),
bAtVertPosModified( sal_False ),
-
bFormat(sal_False),
bNew(sal_True),
bNoModifyHdl(sal_True),
- bVerticalChanged(sal_False),
+ // --> OD 2009-08-31 #mongolianlayout# - no used
+// bVerticalChanged(FALSE),
+ // <--
bIsVerticalFrame(sal_False),
+ // --> OD 2009-08-31 #mongolianlayou#
+ bIsVerticalL2R(sal_False),
+ // <--
bIsInRightToLeft(sal_False),
bHtmlMode(sal_False),
nHtmlMode(0),
@@ -685,6 +730,8 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
FreeResource();
SetExchangeSupport();
+ aRealSizeBT.SetAccessibleRelationMemberOf(&aSizeFL);
+
Link aLk = LINK(this, SwFrmPage, RangeModifyHdl);
aWidthED. SetLoseFocusHdl( aLk );
aHeightED. SetLoseFocusHdl( aLk );
@@ -811,7 +858,10 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
{
if (rAnchor.GetAnchorId() != FLY_AT_FLY && !pSh->IsFlyInFly())
aAnchorAtFrameRB.Hide();
- if(!bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft))
+ // --> OD 2009-08-31 #mongolianlayout#
+// if ( !bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft) )
+ if ( pSh->IsFrmVertical( sal_True, bIsInRightToLeft, bIsVerticalL2R ) )
+ // <--
{
String sHLabel = aHorizontalFT.GetText();
aHorizontalFT.SetText(aVerticalFT.GetText());
@@ -1323,7 +1373,12 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP))
{
SvxSwFramePosString::StringId eStrId = aMirrorPagesCB.IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
- eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, bIsVerticalFrame, bIsInRightToLeft);
+ // --> OD 2009-08-31 #mongolianlayout#
+ eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId,
+ bIsVerticalFrame,
+ bIsVerticalL2R,
+ bIsInRightToLeft);
+ // <--
String sEntry(aFramePosString.GetString(eStrId));
if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
@@ -1387,7 +1442,13 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
{
SvxSwFramePosString::StringId sStrId1 = aAsCharRelationMap[nRelPos].eStrId;
- sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, bIsVerticalFrame, bIsInRightToLeft);
+ // --> OD 2009-08-31 #mongolianlayout#
+ sStrId1 =
+ lcl_ChangeResIdToVerticalOrRTL( sStrId1,
+ bIsVerticalFrame,
+ bIsVerticalL2R,
+ bIsInRightToLeft);
+ // <--
String sEntry = aFramePosString.GetString(sStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]);
@@ -1447,7 +1508,13 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
{
SvxSwFramePosString::StringId eStrId1 = aMirrorPagesCB.IsChecked() ?
aRelationMap[nRelPos].eMirrorStrId : aRelationMap[nRelPos].eStrId;
- eStrId1 = lcl_ChangeResIdToVerticalOrRTL(eStrId1, bIsVerticalFrame, bIsInRightToLeft);
+ // --> OD 2009-08-31 #mongolianlayout#
+ eStrId1 =
+ lcl_ChangeResIdToVerticalOrRTL( eStrId1,
+ bIsVerticalFrame,
+ bIsVerticalL2R,
+ bIsInRightToLeft);
+ // <--
String sEntry = aFramePosString.GetString(eStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aRelationMap[nRelPos]);
@@ -2354,6 +2421,8 @@ SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) :
{
FreeResource();
+ aBrowseBT.SetAccessibleRelationMemberOf(&aConnectFL);
+
SetExchangeSupport();
aMirrorHorzBox.SetClickHdl( LINK(this, SwGrfExtPage, MirrorHdl));
aMirrorVertBox.SetClickHdl( LINK(this, SwGrfExtPage, MirrorHdl));
@@ -2866,6 +2935,7 @@ void lcl_Move(Window& rWin, sal_Int32 nDiff)
SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) :
SfxTabPage(pParent, SW_RES(TP_FRM_ADD), rSet),
+ aNamesFL (this, SW_RES(FL_NAME)),
aNameFT (this, SW_RES(FT_NAME)),
aNameED (this, SW_RES(ED_NAME)),
aAltNameFT (this, SW_RES(FT_ALT_NAME)),
@@ -2874,20 +2944,18 @@ SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) :
aPrevLB (this, SW_RES(LB_PREV)),
aNextFT (this, SW_RES(FT_NEXT)),
aNextLB (this, SW_RES(LB_NEXT)),
- aNamesFL (this, SW_RES(FL_NAME)),
+ aProtectFL (this, SW_RES(FL_PROTECT)),
aProtectContentCB (this, SW_RES(CB_PROTECT_CONTENT)),
aProtectFrameCB (this, SW_RES(CB_PROTECT_FRAME)),
aProtectSizeCB (this, SW_RES(CB_PROTECT_SIZE)),
- aProtectFL (this, SW_RES(FL_PROTECT)),
+ aExtFL (this, SW_RES(FL_EXT)),
aEditInReadonlyCB (this, SW_RES(CB_EDIT_IN_READONLY)),
aPrintFrameCB (this, SW_RES(CB_PRINT_FRAME)),
aTextFlowFT (this, SW_RES(FT_TEXTFLOW)),
aTextFlowLB (this, SW_RES(LB_TEXTFLOW)),
- aExtFL (this, SW_RES(FL_EXT)),
-
pWrtSh(0),
nDlgType(0),
diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx
index 5034c410725a..3b53b3f1bd77 100644
--- a/sw/source/ui/inc/bookmark.hxx
+++ b/sw/source/ui/inc/bookmark.hxx
@@ -65,8 +65,8 @@ public:
class SwInsertBookmarkDlg: public SvxStandardDialog
{
- BookmarkCombo aBookmarkBox;
FixedLine aBookmarkFl;
+ BookmarkCombo aBookmarkBox;
OKButton aOkBtn;
CancelButton aCancelBtn;
PushButton aDeleteBtn;
diff --git a/sw/source/ui/inc/break.hxx b/sw/source/ui/inc/break.hxx
index 6e90131912df..8c6c53744ad4 100644
--- a/sw/source/ui/inc/break.hxx
+++ b/sw/source/ui/inc/break.hxx
@@ -50,6 +50,7 @@ class SwWrtShell;
class SwBreakDlg: public SvxStandardDialog
{
SwWrtShell &rSh;
+ FixedLine aBreakFL;
RadioButton aLineBtn;
RadioButton aColumnBtn;
RadioButton aPageBtn;
@@ -57,7 +58,6 @@ class SwBreakDlg: public SvxStandardDialog
ListBox aPageCollBox;
CheckBox aPageNumBox;
NumericField aPageNumEdit;
- FixedLine aBreakFL;
OKButton aOkBtn;
CancelButton aCancelBtn;
diff --git a/sw/source/ui/inc/column.hxx b/sw/source/ui/inc/column.hxx
index 948f68c9d319..86c10c647836 100644
--- a/sw/source/ui/inc/column.hxx
+++ b/sw/source/ui/inc/column.hxx
@@ -122,13 +122,14 @@ class ColumnValueSet : public ValueSet
--------------------------------------------------------------------*/
class SwColumnPage : public SfxTabPage
{
+ FixedLine aFLGroup;
FixedText aClNrLbl;
NumericField aCLNrEdt;
ColumnValueSet aDefaultVS;
ImageList aPreColsIL;
CheckBox aBalanceColsCB;
- FixedLine aFLGroup;
+ FixedLine aFLLayout;
ImageButton aBtnUp;
FixedText aColumnFT;
FixedText aWidthFT;
@@ -144,15 +145,14 @@ class SwColumnPage : public SfxTabPage
ImageButton aBtnDown;
CheckBox aAutoWidthBox;
- FixedLine aFLLayout;
+ FixedLine aFLLineType;
FixedText aLineTypeLbl;
LineListBox aLineTypeDLB;
FixedText aLineHeightLbl;
MetricField aLineHeightEdit;
FixedText aLinePosLbl;
ListBox aLinePosDLB;
- FixedLine aFLLineType;
FixedLine aVertFL;
FixedLine aPropertiesFL;
diff --git a/sw/source/ui/inc/docstdlg.hxx b/sw/source/ui/inc/docstdlg.hxx
index 7880413f6089..b45700534d48 100644
--- a/sw/source/ui/inc/docstdlg.hxx
+++ b/sw/source/ui/inc/docstdlg.hxx
@@ -55,22 +55,21 @@ protected:
DECL_LINK( UpdateHdl, PushButton*);
private:
- FixedText aTableLbl;
- FixedText aGrfLbl;
- FixedText aOLELbl;
FixedText aPageLbl;
- FixedText aParaLbl;
- FixedText aWordLbl;
- FixedText aCharLbl;
- FixedText aLineLbl;
-
+ FixedInfo aPageNo;
+ FixedText aTableLbl;
FixedInfo aTableNo;
+ FixedText aGrfLbl;
FixedInfo aGrfNo;
+ FixedText aOLELbl;
FixedInfo aOLENo;
- FixedInfo aPageNo;
+ FixedText aParaLbl;
FixedInfo aParaNo;
+ FixedText aWordLbl;
FixedInfo aWordNo;
+ FixedText aCharLbl;
FixedInfo aCharNo;
+ FixedText aLineLbl;
FixedInfo aLineNo;
PushButton aUpdatePB;
diff --git a/sw/source/ui/inc/drpcps.hxx b/sw/source/ui/inc/drpcps.hxx
index b52ef7d813d2..6e7d6547053c 100644
--- a/sw/source/ui/inc/drpcps.hxx
+++ b/sw/source/ui/inc/drpcps.hxx
@@ -72,6 +72,7 @@ class SwDropCapsPage : public SfxTabPage
{
friend class SwDropCapsPict;
+ FixedLine aSettingsFL;
CheckBox aDropCapsBox;
CheckBox aWholeWordCB;
FixedText aSwitchText;
@@ -80,13 +81,12 @@ friend class SwDropCapsPict;
NumericField aLinesField;
FixedText aDistanceText;
MetricField aDistanceField;
- FixedLine aSettingsFL;
+ FixedLine aContentFL;
FixedText aTextText;
Edit aTextEdit;
FixedText aTemplateText;
ListBox aTemplateBox;
- FixedLine aContentFL;
SwDropCapsPict *pPict;
diff --git a/sw/source/ui/inc/frmmgr.hxx b/sw/source/ui/inc/frmmgr.hxx
index 8a38df73a1bd..0d4d0131de43 100644
--- a/sw/source/ui/inc/frmmgr.hxx
+++ b/sw/source/ui/inc/frmmgr.hxx
@@ -65,6 +65,9 @@ class SW_DLLPUBLIC SwFlyFrmAttrMgr
sal_Bool bAbsPos,
bNewFrm;
sal_Bool bIsInVertical;
+ // --> OD 2009-09-01 #mongolianlayout#
+ sal_Bool bIsInVerticalL2R;
+ // <--
// interne Verrechnung fuer Umrandung
SW_DLLPRIVATE SwTwips CalcTopSpace();
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index 0af7ae0b1602..29983a275e59 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -54,6 +54,7 @@ struct SwPosition;
class SwFrmPage: public SfxTabPage
{
// Size
+ FixedLine aSizeFL;
FixedText aWidthFT;
FixedText aWidthAutoFT;
PercentField aWidthED;
@@ -66,11 +67,10 @@ class SwFrmPage: public SfxTabPage
CheckBox aAutoHeightCB;
CheckBox aFixedRatioCB;
PushButton aRealSizeBT;
- FixedLine aSizeFL;
// Anker
- FixedLine aTypeFL;
FixedLine aTypeSepFL;
+ FixedLine aTypeFL;
RadioButton aAnchorAtPageRB;
RadioButton aAnchorAtParaRB;
RadioButton aAnchorAtCharRB;
@@ -78,6 +78,7 @@ class SwFrmPage: public SfxTabPage
RadioButton aAnchorAtFrameRB;
// Position
+ FixedLine aPositionFL;
FixedText aHorizontalFT;
ListBox aHorizontalDLB;
FixedText aAtHorzPosFT;
@@ -93,7 +94,6 @@ class SwFrmPage: public SfxTabPage
ListBox aVertRelationLB;
// OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
CheckBox aFollowTextFlowCB;
- FixedLine aPositionFL;
// Example
SvxSwFrameExample aExampleWN;
@@ -109,6 +109,9 @@ class SwFrmPage: public SfxTabPage
sal_Bool bNoModifyHdl;
sal_Bool bVerticalChanged; //check done whether frame is in vertical environment
sal_Bool bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged
+ // --> OD 2009-08-31 #mongolianlayou#
+ sal_Bool bIsVerticalL2R;
+ // <--
sal_Bool bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
sal_Bool bHtmlMode;
sal_uInt16 nHtmlMode;
@@ -286,6 +289,7 @@ public:
class SwFrmAddPage : public SfxTabPage
{
+ FixedLine aNamesFL;
FixedText aNameFT;
Edit aNameED;
FixedText aAltNameFT;
@@ -294,19 +298,18 @@ class SwFrmAddPage : public SfxTabPage
ListBox aPrevLB;
FixedText aNextFT;
ListBox aNextLB;
- FixedLine aNamesFL;
+ FixedLine aProtectFL;
CheckBox aProtectContentCB;
CheckBox aProtectFrameCB;
CheckBox aProtectSizeCB;
- FixedLine aProtectFL;
+ FixedLine aExtFL;
CheckBox aEditInReadonlyCB;
CheckBox aPrintFrameCB;
FixedText aTextFlowFT;
ListBox aTextFlowLB;
- FixedLine aExtFL;
SwWrtShell* pWrtSh;
diff --git a/sw/source/ui/inc/glosbib.hxx b/sw/source/ui/inc/glosbib.hxx
index e547ad831889..0046e4f46e87 100644
--- a/sw/source/ui/inc/glosbib.hxx
+++ b/sw/source/ui/inc/glosbib.hxx
@@ -74,9 +74,11 @@ public:
class SwGlossaryGroupDlg : public SvxStandardDialog
{
-
+ FixedText aBibFT;
FEdit aNameED;
+ FixedText aPathFT;
ListBox aPathLB;
+ FixedText aSelectFT;
SwGlossaryGroupTLB aGroupTLB;
OKButton aOkPB;
@@ -85,9 +87,6 @@ class SwGlossaryGroupDlg : public SvxStandardDialog
PushButton aNewPB;
PushButton aDelPB;
PushButton aRenamePB;
- FixedText aBibFT;
- FixedText aPathFT;
- FixedText aSelectFT;
SvStrings* pRemovedArr;
SvStrings* pInsertedArr;
diff --git a/sw/source/ui/inc/insfnote.hxx b/sw/source/ui/inc/insfnote.hxx
index f1984a5c4f3d..e9483eea02c3 100644
--- a/sw/source/ui/inc/insfnote.hxx
+++ b/sw/source/ui/inc/insfnote.hxx
@@ -48,18 +48,18 @@ class SwInsFootNoteDlg: public SvxStandardDialog
String aFontName;
CharSet eCharSet;
char cExtChar;
- sal_Bool bExtCharAvailable;
- sal_Bool bEdit;
+ sal_Bool bExtCharAvailable;
+ sal_Bool bEdit;
+ FixedLine aNumberFL;
RadioButton aNumberAutoBtn;
RadioButton aNumberCharBtn;
Edit aNumberCharEdit;
PushButton aNumberExtChar;
- FixedLine aNumberFL;
//Alles fuer die Auswahl Fussnote/Endnote
+ FixedLine aTypeFL;
RadioButton aFtnBtn;
RadioButton aEndNoteBtn;
- FixedLine aTypeFL;
OKButton aOkBtn;
CancelButton aCancelBtn;
diff --git a/sw/source/ui/inc/linenum.hxx b/sw/source/ui/inc/linenum.hxx
index 468b5ba44743..8d727b771750 100644
--- a/sw/source/ui/inc/linenum.hxx
+++ b/sw/source/ui/inc/linenum.hxx
@@ -66,6 +66,7 @@ public:
class SwLineNumberingPage : public SfxTabPage
{
CheckBox aNumberingOnCB;
+ FixedLine aDisplayFL;
FixedText aCharStyleFT;
ListBox aCharStyleLB;
FixedText aFormatFT;
@@ -77,17 +78,16 @@ class SwLineNumberingPage : public SfxTabPage
FixedText aNumIntervalFT;
NumericField aNumIntervalNF;
FixedText aNumRowsFT;
- FixedLine aDisplayFL;
+ FixedLine aDivisorFL;
FixedText aDivisorFT;
Edit aDivisorED;
FixedText aDivIntervalFT;
NumericField aDivIntervalNF;
FixedText aDivRowsFT;
- FixedLine aDivisorFL;
+ FixedLine aCountFL;
CheckBox aCountEmptyLinesCB;
CheckBox aCountFrameLinesCB;
CheckBox aRestartEachPageCB;
- FixedLine aCountFL;
SwWrtShell* pSh;
diff --git a/sw/source/ui/inc/num.hxx b/sw/source/ui/inc/num.hxx
index 0c80939b6258..c999bf25eb93 100644
--- a/sw/source/ui/inc/num.hxx
+++ b/sw/source/ui/inc/num.hxx
@@ -82,13 +82,13 @@ struct SwBmpItemInfo
--------------------------------------------------*/
class SwNumPositionTabPage : public SfxTabPage
{
- FixedLine aPositionFL;
- FixedLine aLevelFL;
+ FixedLine aLevelFL;
MultiListBox aLevelLB;
// --> OD 2008-02-01 #newlistlevelattrs#
// former set of controls shown for numbering rules containing list level
// attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
+ FixedLine aPositionFL;
FixedText aDistBorderFT;
MetricField aDistBorderMF;
CheckBox aRelativeCB;
diff --git a/sw/source/ui/inc/numpara.hxx b/sw/source/ui/inc/numpara.hxx
index 520eabffd506..6fb8fe446154 100644
--- a/sw/source/ui/inc/numpara.hxx
+++ b/sw/source/ui/inc/numpara.hxx
@@ -48,10 +48,10 @@ class SwParagraphNumTabPage : public SfxTabPage
FixedText aOutlineLvFT;
ListBox aOutlineLvLB;
+ FixedLine aNewStartFL;
FixedText aNumberStyleFT;
ListBox aNumberStyleLB;
- FixedLine aNewStartFL;
TriStateBox aNewStartCB;
TriStateBox aNewStartNumberCB;
NumericField aNewStartNF;
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index db631fc55757..4ee11b8757c6 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -135,11 +135,11 @@ class SwAddPrinterTabPage : public SfxTabPage
FixedLine aSeparatorRFL;
+ FixedLine aFL3;
RadioButton aNoRB;
RadioButton aOnlyRB;
RadioButton aEndRB;
RadioButton aEndPageRB;
- FixedLine aFL3;
FixedLine aFL4;
CheckBox aPrintEmptyPagesCB;
// CheckBox aSingleJobsCB;
diff --git a/sw/source/ui/inc/outline.hxx b/sw/source/ui/inc/outline.hxx
index 73e3a9919206..f626de0c0fa3 100644
--- a/sw/source/ui/inc/outline.hxx
+++ b/sw/source/ui/inc/outline.hxx
@@ -104,9 +104,10 @@ class SwOutlineTabDialog : public SfxTabDialog
* --------------------------------------------------*/
class SwOutlineSettingsTabPage : public SfxTabPage
{
- ListBox aLevelLB;
FixedLine aLevelFL;
+ ListBox aLevelLB;
+ FixedLine aNumberFL;
FixedText aCollLbl;
ListBox aCollBox;
FixedText aNumberLbl;
@@ -122,7 +123,6 @@ class SwOutlineSettingsTabPage : public SfxTabPage
Edit aSuffixED;
FixedText aStartLbl;
NumericField aStartEdit;
- FixedLine aNumberFL;
NumberingPreview aPreviewWIN;
String aNoFmtName;
diff --git a/sw/source/ui/inc/pgfnote.hxx b/sw/source/ui/inc/pgfnote.hxx
index 0bc2399a9eb1..5f8c147bf374 100644
--- a/sw/source/ui/inc/pgfnote.hxx
+++ b/sw/source/ui/inc/pgfnote.hxx
@@ -59,13 +59,14 @@ private:
SwFootNotePage(Window *pParent, const SfxItemSet &rSet);
~SwFootNotePage();
+ FixedLine aPosHeader;
RadioButton aMaxHeightPageBtn;
RadioButton aMaxHeightBtn;
MetricField aMaxHeightEdit;
FixedText aDistLbl;
MetricField aDistEdit;
- FixedLine aPosHeader;
+ FixedLine aLineHeader;
FixedText aLinePosLbl;
ListBox aLinePosBox;
FixedText aLineTypeLbl;
@@ -74,7 +75,6 @@ private:
MetricField aLineWidthEdit;
FixedText aLineDistLbl;
MetricField aLineDistEdit;
- FixedLine aLineHeader;
DECL_LINK( HeightPage, Button * );
DECL_LINK( HeightMetric, Button * );
diff --git a/sw/source/ui/inc/rowht.hxx b/sw/source/ui/inc/rowht.hxx
index e4b497246cd7..6ad4e5f7ab19 100644
--- a/sw/source/ui/inc/rowht.hxx
+++ b/sw/source/ui/inc/rowht.hxx
@@ -49,9 +49,9 @@ class SwWrtShell;
class SwTableHeightDlg : public SvxStandardDialog
{
+ FixedLine aHeightFL;
MetricField aHeightEdit;
CheckBox aAutoHeightCB;
- FixedLine aHeightFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
diff --git a/sw/source/ui/inc/split.hxx b/sw/source/ui/inc/split.hxx
index 4929c7318891..6d515acf22b5 100644
--- a/sw/source/ui/inc/split.hxx
+++ b/sw/source/ui/inc/split.hxx
@@ -49,13 +49,13 @@ class SwWrtShell;
class SwSplitTableDlg : public SvxStandardDialog
{
+ FixedLine aCountFL;
FixedText aCountLbl;
NumericField aCountEdit;
- FixedLine aCountFL;
+ FixedLine aDirFL;
ImageRadioButton aHorzBox;
ImageRadioButton aVertBox;
CheckBox aPropCB;
- FixedLine aDirFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
diff --git a/sw/source/ui/inc/srtdlg.hxx b/sw/source/ui/inc/srtdlg.hxx
index 5c813b796051..25840e7ae2c0 100644
--- a/sw/source/ui/inc/srtdlg.hxx
+++ b/sw/source/ui/inc/srtdlg.hxx
@@ -51,7 +51,7 @@ class SwSortDlg : public SvxStandardDialog
FixedText aTypLbl;
FixedText aDirLbl;
- FixedLine aDirFL;
+ FixedLine aSortFL;
CheckBox aKeyCB1;
NumericField aColEdt1;
@@ -71,7 +71,7 @@ class SwSortDlg : public SvxStandardDialog
RadioButton aSortUp3RB;
RadioButton aSortDn3RB;
- FixedLine aSortFL;
+ FixedLine aDirFL;
RadioButton aColumnRB;
RadioButton aRowRB;
diff --git a/sw/source/ui/inc/swrenamexnameddlg.hxx b/sw/source/ui/inc/swrenamexnameddlg.hxx
index 16f3d56852e6..d15c90935c85 100644
--- a/sw/source/ui/inc/swrenamexnameddlg.hxx
+++ b/sw/source/ui/inc/swrenamexnameddlg.hxx
@@ -50,9 +50,9 @@
* --------------------------------------------------*/
class SwRenameXNamedDlg : public ModalDialog
{
+ FixedLine aNameFL;
FixedText aNewNameFT;
NoSpaceEdit aNewNameED;
- FixedLine aNameFL;
OKButton aOk;
CancelButton aCancel;
HelpButton aHelp;
diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index 7a02000f7151..a47bcb5a5e3a 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -188,6 +188,7 @@ class SwTOXSelectTabPage : public SfxTabPage
//
//index only
+ FixedLine aIdxOptionsFL;
CheckBox aCollectSameCB;
CheckBox aUseFFCB;
CheckBox aUseDashCB;
@@ -196,7 +197,6 @@ class SwTOXSelectTabPage : public SfxTabPage
CheckBox aKeyAsEntryCB;
CheckBox aFromFileCB;
MenuButton aAutoMarkPB;
- FixedLine aIdxOptionsFL; // index only
// object only
SwOLENames aFromNames;
@@ -363,6 +363,7 @@ class SwTOXEntryTabPage : public SfxTabPage
FixedText aLevelFT;
SwIdxTreeListBox aLevelLB;
+ FixedLine aEntryFL;
FixedText aTokenFT;
SwTokenWindow aTokenWIN;
PushButton aAllLevelsPB;
@@ -395,14 +396,13 @@ class SwTOXEntryTabPage : public SfxTabPage
FixedText aTabPosFT;
MetricField aTabPosMF; // tab stop position
CheckBox aAutoRightCB;
- FixedLine aEntryFL;
+ FixedLine aFormatFL;
CheckBox aRelToStyleCB; // position relative to the right margin of the para style
FixedText aMainEntryStyleFT;
ListBox aMainEntryStyleLB; // character style of main entries in indexes
CheckBox aAlphaDelimCB;
CheckBox aCommaSeparatedCB;
- FixedLine aFormatFL;
RadioButton aSortDocPosRB;
RadioButton aSortContentRB;
@@ -492,14 +492,14 @@ public:
--------------------------------------------------*/
class SwTOXStylesTabPage : public SfxTabPage
{
+ FixedLine aFormatFL;
FixedText aLevelFT2;
ListBox aLevelLB;
+ ImageButton aAssignBT;
FixedText aTemplateFT;
ListBox aParaLayLB;
PushButton aStdBT;
- ImageButton aAssignBT;
PushButton aEditStyleBT;
- FixedLine aFormatFL;
SwForm* m_pCurrentForm;
// void UpdatePattern();
diff --git a/sw/source/ui/inc/swuiidxmrk.hxx b/sw/source/ui/inc/swuiidxmrk.hxx
index 28f1d0d53e74..ad3adcce78ca 100644
--- a/sw/source/ui/inc/swuiidxmrk.hxx
+++ b/sw/source/ui/inc/swuiidxmrk.hxx
@@ -71,6 +71,7 @@ class SwIndexMarkDlg : public Window
{
friend class SwIndexMarkFloatDlg;
friend class SwIndexMarkModalDlg;
+ FixedLine aIndexFL;
FixedText aTypeFT;
ListBox aTypeDCB;
ImageButton aNewBT;
@@ -97,7 +98,6 @@ class SwIndexMarkDlg : public Window
CheckBox aSearchCaseSensitiveCB;
CheckBox aSearchCaseWordOnlyCB;
- FixedLine aIndexFL;
OKButton aOKBT;
CancelButton aCancelBT;
diff --git a/sw/source/ui/inc/tautofmt.hxx b/sw/source/ui/inc/tautofmt.hxx
index 9a9ad24947d6..bf581291c12e 100644
--- a/sw/source/ui/inc/tautofmt.hxx
+++ b/sw/source/ui/inc/tautofmt.hxx
@@ -63,12 +63,12 @@ class SwAutoFormatDlg : public SfxModalDialog
{
FixedLine aFlFormat;
ListBox aLbFormat;
+ FixedLine aFlFormats;
CheckBox aBtnNumFormat;
CheckBox aBtnBorder;
CheckBox aBtnFont;
CheckBox aBtnPattern;
CheckBox aBtnAlignment;
- FixedLine aFlFormats;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 4d7763143725..905caaf6f0ef 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -374,6 +374,8 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet
aShowExampleCB.SetClickHdl(LINK(this, SwMultiTOXTabDialog, ShowPreviewHdl));
aShowExampleCB.Check( SW_MOD()->GetModuleConfig()->IsShowIndexPreview());
+
+ aExampleContainerWIN.SetAccessibleName(aShowExampleCB.GetText());
SetViewAlign( WINDOWALIGN_LEFT );
// SetViewWindow does not work if the dialog is visible!
@@ -807,6 +809,10 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent,
{
FreeResource();
+ aHeaderTree.SetAccessibleRelationMemberOf(&aStylesFL);
+ aLeftPB.SetAccessibleRelationMemberOf(&aStylesFL);
+ aRightPB.SetAccessibleRelationMemberOf(&aStylesFL);
+
aLeftPB.SetModeImage( Image( SW_RES( IMG_ALL_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST );
aRightPB.SetModeImage( Image( SW_RES( IMG_ALL_RIGHT_HC ) ), BMP_COLOR_HIGHCONTRAST );
@@ -985,6 +991,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aTOXMarksCB( this, SW_RES(CB_TOXMARKS )),
+ aIdxOptionsFL( this, SW_RES(FL_IDXOPTIONS )),
aCollectSameCB( this, SW_RES(CB_COLLECTSAME )),
aUseFFCB( this, SW_RES(CB_USEFF )),
aUseDashCB( this, SW_RES(CB_USE_DASH )),
@@ -993,7 +1000,6 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aKeyAsEntryCB( this, SW_RES(CB_KEYASENTRY )),
aFromFileCB( this, SW_RES(CB_FROMFILE )),
aAutoMarkPB( this, SW_RES(MB_AUTOMARK )),
- aIdxOptionsFL( this, SW_RES(FL_IDXOPTIONS )),
aFromNames( SW_RES(RES_SRCTYPES )),
aFromObjCLB( this, SW_RES(CLB_FROMOBJ )),
@@ -1017,6 +1023,11 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
bFirstCall(sal_True)
{
aBracketLB.InsertEntry(String(SW_RES(ST_NO_BRACKET)), 0);
+
+ aAddStylesPB.SetAccessibleRelationMemberOf(&aCreateFromFL);
+ aAddStylesPB.SetAccessibleRelationLabeledBy(&aAddStylesCB);
+ aAddStylesPB.SetAccessibleName(aAddStylesCB.GetText());
+
FreeResource();
pIndexEntryWrapper = new IndexEntrySupplierWrapper();
@@ -2053,6 +2064,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
SfxTabPage(pParent, SW_RES(TP_TOX_ENTRY), rAttrSet),
aLevelFT(this, SW_RES(FT_LEVEL )),
aLevelLB(this, SW_RES(LB_LEVEL )),
+ aEntryFL(this, SW_RES(FL_ENTRY )),
aTokenFT(this, SW_RES(FT_TOKEN )),
aTokenWIN(this, SW_RES(WIN_TOKEN )),
@@ -2086,14 +2098,14 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
aTabPosFT(this, SW_RES(FT_TABPOS )),
aTabPosMF(this, SW_RES(MF_TABPOS )),
aAutoRightCB(this, SW_RES(CB_AUTORIGHT )),
- aEntryFL(this, SW_RES(FL_ENTRY )),
+ aFormatFL(this, SW_RES(FL_FORMAT )),
+
aRelToStyleCB(this, SW_RES(CB_RELTOSTYLE )),
aMainEntryStyleFT(this, SW_RES(FT_MAIN_ENTRY_STYLE)),
aMainEntryStyleLB(this, SW_RES(LB_MAIN_ENTRY_STYLE)),
aAlphaDelimCB(this, SW_RES(CB_ALPHADELIM )),
aCommaSeparatedCB(this, SW_RES(CB_COMMASEPARATED )),
- aFormatFL(this, SW_RES(FL_FORMAT )),
aSortDocPosRB(this, SW_RES(RB_DOCPOS )),
aSortContentRB(this, SW_RES(RB_SORTCONTENT )),
@@ -2124,6 +2136,16 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet
m_pCurrentForm(0),
bInLevelHdl(sal_False)
{
+ aEditStylePB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aHyperLinkPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aPageNoPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aTabPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aEntryPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aEntryNoPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aAllLevelsPB.SetAccessibleRelationMemberOf(&aEntryFL);
+ aTokenWIN.SetAccessibleRelationMemberOf(&aEntryFL);
+ aTokenWIN.SetAccessibleRelationLabeledBy(&aTokenFT);
+
Image aSortUpHC(SW_RES(IMG_SORTUP_HC ));
aFirstSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST);
aSecondSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST);
@@ -3912,17 +3934,18 @@ void SwTokenWindow::GetFocus()
* --------------------------------------------------*/
SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrSet ) :
SfxTabPage(pParent, SW_RES(TP_TOX_STYLES), rAttrSet),
+ aFormatFL(this, SW_RES(FL_FORMAT )),
aLevelFT2(this, SW_RES(FT_LEVEL )),
aLevelLB(this, SW_RES(LB_LEVEL )),
+ aAssignBT(this, SW_RES(BT_ASSIGN )),
aTemplateFT(this, SW_RES(FT_TEMPLATE)),
aParaLayLB(this, SW_RES(LB_PARALAY )),
aStdBT(this, SW_RES(BT_STD )),
- aAssignBT(this, SW_RES(BT_ASSIGN )),
aEditStyleBT(this, SW_RES(BT_EDIT_STYLE )),
- aFormatFL(this, SW_RES(FL_FORMAT )),
m_pCurrentForm(0)
{
FreeResource();
+
SetExchangeSupport( sal_True );
aAssignBT.SetModeImage( Image( SW_RES( IMG_ONE_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST );
@@ -3933,6 +3956,11 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrS
aParaLayLB.SetSelectHdl (LINK( this, SwTOXStylesTabPage, EnableSelectHdl));
aLevelLB.SetSelectHdl (LINK( this, SwTOXStylesTabPage, EnableSelectHdl));
aParaLayLB.SetDoubleClickHdl(LINK( this, SwTOXStylesTabPage, DoubleClickHdl));
+
+ aStdBT.SetAccessibleRelationMemberOf(&aFormatFL);
+ aAssignBT.SetAccessibleRelationMemberOf(&aFormatFL);
+ aEditStyleBT.SetAccessibleRelationMemberOf(&aFormatFL);
+
}
/* -----------------25.03.99 15:17-------------------
*
diff --git a/sw/source/ui/index/cnttab.hrc b/sw/source/ui/index/cnttab.hrc
index c544be2c7a2e..4a3457b3ce81 100644
--- a/sw/source/ui/index/cnttab.hrc
+++ b/sw/source/ui/index/cnttab.hrc
@@ -173,6 +173,7 @@
#define STR_TOKEN_HELP_AUTHORITY (STR_BUTTON_HELP_TEXT_START + 9)
#define STR_CHARSTYLE (STR_TOKEN_HELP_AUTHORITY + 1)
+
#define TLB_STYLES 100
#define FL_STYLES 101
#define PB_OK 102
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index 9b97b8931b7f..a21d8920c78d 100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -1218,6 +1218,9 @@ ModalDialog DLG_ADD_IDX_STYLES
};
MaskColor = IMAGE_MASK_COLOR ;
};
+ //IAccessibility2 Implementation 2009-----
+ QuickHelpText [ en-US ] = "Left" ;
+ //-----IAccessibility2 Implementation 2009
};
ImageButton PB_RIGHT
{
@@ -1233,6 +1236,9 @@ ModalDialog DLG_ADD_IDX_STYLES
};
MaskColor = IMAGE_MASK_COLOR ;
};
+ //IAccessibility2 Implementation 2009-----
+ QuickHelpText [ en-US ] = "Right" ;
+ //-----IAccessibility2 Implementation 2009
};
FixedLine FL_STYLES
{
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 5a3359ad9571..74fbc4383f96 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -102,6 +102,7 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
const ResId& rResId,
sal_Int32 _nOptionsId, SwWrtShell& rWrtShell ) :
Window(pParent, rResId),
+ aIndexFL(this, SW_RES(FL_INDEX )),
aTypeFT (this, SW_RES(LBL_INDEX )),
aTypeDCB(this, SW_RES(DCB_INDEX )),
aNewBT(this, SW_RES(BT_NEW )),
@@ -128,7 +129,6 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
aSearchCaseSensitiveCB(this, SW_RES(CB_CASESENSITIVE )),
aSearchCaseWordOnlyCB(this, SW_RES(CB_WORDONLY )),
- aIndexFL(this, SW_RES(FL_INDEX )),
aOKBT(this, SW_RES(BT_OK )),
aCancelBT(this, SW_RES(BT_CANCEL )),
@@ -154,6 +154,8 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
pTOXMgr(0),
pSh(&rWrtShell)
{
+ aNewBT.SetAccessibleRelationMemberOf(&aIndexFL);
+
if( SvtCJKOptions().IsCJKFontEnabled() )
{
uno::Reference< lang::XMultiServiceFactory > xMSF = getProcessServiceFactory();
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 77ce091d454b..5df6fc1fca5d 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -152,9 +152,8 @@ void SwInsertBookmarkDlg::Apply()
SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRequest& rRequest ) :
SvxStandardDialog(pParent,SW_RES(DLG_INSERT_BOOKMARK)),
-
- aBookmarkBox(this,SW_RES(CB_BOOKMARK)),
aBookmarkFl(this,SW_RES(FL_BOOKMARK)),
+ aBookmarkBox(this,SW_RES(CB_BOOKMARK)),
aOkBtn(this,SW_RES(BT_OK)),
aCancelBtn(this,SW_RES(BT_CANCEL)),
aDeleteBtn(this,SW_RES(BT_DELETE)),
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 9e2b1caa3894..731e1451bd32 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -110,6 +110,8 @@ IMPL_LINK( SwFootNoteOptionDlg, OkHdl, Button *, pBtn )
SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN,
const SfxItemSet &rSet ) :
SfxTabPage( pParent, SW_RES(bEN ? TP_ENDNOTEOPTION : TP_FOOTNOTEOPTION), rSet ),
+ aNumFL (this, SW_RES( FL_NUM )),
+
aNumTypeFT (this, SW_RES( FT_NUMTYPE )),
aNumViewBox (this, SW_RES( LB_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES),
aOffsetLbl (this, SW_RES( FT_OFFSET )),
@@ -123,25 +125,24 @@ SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN,
aPosFT (this, SW_RES( FT_POS )),
aPosPageBox (this, SW_RES( RB_POS_PAGE )),
aPosChapterBox (this, SW_RES( RB_POS_CHAPTER)),
- aNumFL (this, SW_RES( FL_NUM )),
+ aTemplFL (this, SW_RES( FL_TEMPL )),
aParaTemplLbl (this, SW_RES( FT_PARA_TEMPL)),
aParaTemplBox (this, SW_RES( LB_PARA_TEMPL)),
aPageTemplLbl (this, SW_RES( FT_PAGE_TEMPL)),
aPageTemplBox (this, SW_RES( LB_PAGE_TEMPL)),
- aTemplFL (this, SW_RES( FL_TEMPL )),
+ aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)),
aFtnCharAnchorTemplLbl( this, SW_RES( FT_ANCHR_CHARFMT)),
aFtnCharAnchorTemplBox( this, SW_RES( LB_ANCHR_CHARFMT)),
aFtnCharTextTemplLbl( this, SW_RES( FT_TEXT_CHARFMT)),
aFtnCharTextTemplBox( this, SW_RES( LB_TEXT_CHARFMT)),
- aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)),
+ aContFL (this, SW_RES( FL_CONT )),
aContLbl (this, SW_RES( FT_CONT )),
aContEdit (this, SW_RES( ED_CONT )),
aContFromLbl (this, SW_RES( FT_CONT_FROM )),
aContFromEdit (this, SW_RES( ED_CONT_FROM )),
- aContFL (this, SW_RES( FL_CONT )),
aNumDoc(aNumCountBox.GetEntry(FTNNUM_DOC)),
aNumPage(aNumCountBox.GetEntry(FTNNUM_PAGE)),
@@ -156,6 +157,8 @@ SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN,
aPosChapterBox.SetClickHdl(LINK(this, SwEndNoteOptionPage, PosChapterHdl));
aNumCountBox.SetSelectHdl(LINK(this, SwEndNoteOptionPage, NumCountHdl));
+ aPosPageBox.SetAccessibleRelationMemberOf(&aPosFT);
+ aPosChapterBox.SetAccessibleRelationMemberOf(&aPosFT);
}
void SwEndNoteOptionPage::Reset( const SfxItemSet& )
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 64392b6a6d6f..de1342c91ae9 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -76,9 +76,11 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
const SvStrings* pPathArr,
SwGlossaryHdl *pHdl) :
SvxStandardDialog(pParent, SW_RES(DLG_BIB_BASE)),
-
+ aBibFT( this, SW_RES(FT_BIB)),
aNameED( this, SW_RES(ED_NAME)),
+ aPathFT( this, SW_RES(FT_PATH)),
aPathLB( this, SW_RES(LB_PATH)),
+ aSelectFT( this, SW_RES(FT_SELECT)),
aGroupTLB( this, SW_RES(TLB_GROUPS)),
aOkPB( this, SW_RES(BT_OK)),
@@ -87,9 +89,6 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent,
aNewPB( this, SW_RES(PB_NEW)),
aDelPB( this, SW_RES(PB_DELETE)),
aRenamePB( this, SW_RES(PB_RENAME)),
- aBibFT( this, SW_RES(FT_BIB)),
- aPathFT( this, SW_RES(FT_PATH)),
- aSelectFT( this, SW_RES(FT_SELECT)),
pRemovedArr(0),
pInsertedArr(0),
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index eba08da76c56..9835b2f4d681 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -91,6 +91,8 @@
#include <swmodule.hxx>
#include <sfx2/filedlghelper.hxx>
+#include "access.hrc"
+
#define LONG_LENGTH 60
#define SHORT_LENGTH 30
@@ -152,11 +154,11 @@ class SwNewGlosNameDlg : public ModalDialog
NoSpaceEdit aNewShort;
OKButton aOk;
CancelButton aCancel;
- FixedLine aFL;
FixedText aONFT;
Edit aOldName;
FixedText aOSFT;
Edit aOldShort;
+ FixedLine aFL;
protected:
DECL_LINK( Modify, Edit * );
@@ -181,11 +183,12 @@ SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent,
aNewShort(this,SW_RES( ED_NS )),
aOk (this, SW_RES( BT_OKNEW)),
aCancel (this, SW_RES( BT_CANCEL)),
- aFL (this, SW_RES( FL_NN )),
aONFT (this, SW_RES( FT_ON )),
aOldName(this, SW_RES( ED_ON )),
aOSFT (this, SW_RES( FT_OS )),
- aOldShort(this,SW_RES( ED_OS ))
+ aOldShort(this,SW_RES( ED_OS )),
+ aFL (this, SW_RES( FL_NN ))
+
{
FreeResource();
aOldName.SetText( rOldName );
@@ -298,6 +301,8 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aCategoryBox.GetModel()->SetSortMode(SortAscending);
aCategoryBox.SetHighlightRange(); // ueber volle Breite selektieren
aCategoryBox.SetNodeDefaultImages( );
+ aCategoryBox.SetAccessibleName(SW_RES(STR_ACCESS_SW_CATEGORY));
+ aCategoryBox.SetAccessibleRelationLabeledBy(&aInsertTipCB);
Init();
}
diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src
index 3dddc5218398..1302f02fbf9a 100644
--- a/sw/source/ui/misc/glossary.src
+++ b/sw/source/ui/misc/glossary.src
@@ -29,6 +29,8 @@
#include "glossary.hrc"
#include "cmdid.h"
#include "helpid.h"
+#include "access.hrc"
+
// #define DLG_GLOSSARY 256
ModalDialog DLG_GLOSSARY
{
@@ -288,6 +290,12 @@ String STR_GLOSSARY
{
Text [ en-US ] = "AutoText :" ;
};
+/*IAccessibility2 Implementation 2009-----*/
+String STR_ACCESS_SW_CATEGORY
+{
+ Text [ en-US ] = "Category" ;
+};
+/*-----IAccessibility2 Implementation 2009*/
ModalDialog DLG_RENAME_GLOS
{
OutputSize = TRUE ;
diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx
index 26255d0e3d48..9dc2b28e721c 100644
--- a/sw/source/ui/misc/impfnote.hxx
+++ b/sw/source/ui/misc/impfnote.hxx
@@ -46,6 +46,7 @@ class SwWrtShell;
class SwEndNoteOptionPage : public SfxTabPage
{
+ FixedLine aNumFL;
FixedText aNumTypeFT;
SwNumberingTypeListBox aNumViewBox;
FixedText aOffsetLbl;
@@ -59,25 +60,24 @@ class SwEndNoteOptionPage : public SfxTabPage
FixedText aPosFT;
RadioButton aPosPageBox;
RadioButton aPosChapterBox;
- FixedLine aNumFL;
+ FixedLine aTemplFL;
FixedText aParaTemplLbl;
ListBox aParaTemplBox;
FixedText aPageTemplLbl;
ListBox aPageTemplBox;
- FixedLine aTemplFL;
+ FixedLine aCharTemplFL;
FixedText aFtnCharAnchorTemplLbl;
ListBox aFtnCharAnchorTemplBox;
FixedText aFtnCharTextTemplLbl;
ListBox aFtnCharTextTemplBox;
- FixedLine aCharTemplFL;
+ FixedLine aContFL;
FixedText aContLbl;
Edit aContEdit;
FixedText aContFromLbl;
Edit aContFromEdit;
- FixedLine aContFL;
String aNumDoc;
String aNumPage;
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index adc18f0daa6b..7e9d4894faaa 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -233,15 +233,15 @@ SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool
rSh(rShell),
bExtCharAvailable(sal_False),
bEdit(bEd),
+ aNumberFL (this,SW_RES(FL_NUMBER)),
aNumberAutoBtn (this,SW_RES(RB_NUMBER_AUTO)),
aNumberCharBtn (this,SW_RES(RB_NUMBER_CHAR)),
aNumberCharEdit (this,SW_RES(ED_NUMBER_CHAR)),
aNumberExtChar (this,SW_RES(BT_NUMBER_CHAR)),
- aNumberFL (this,SW_RES(FL_NUMBER)),
+ aTypeFL (this,SW_RES(FL_TYPE)),
aFtnBtn (this,SW_RES(RB_TYPE_FTN)),
aEndNoteBtn (this,SW_RES(RB_TYPE_ENDNOTE)),
- aTypeFL (this,SW_RES(FL_TYPE)),
aOkBtn (this,SW_RES(BT_OK)),
aCancelBtn (this,SW_RES(BT_CANCEL)),
@@ -249,6 +249,10 @@ SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool
aPrevBT (this,SW_RES(BT_PREV)),
aNextBT (this,SW_RES(BT_NEXT))
{
+ aNumberCharEdit.SetAccessibleName(String(SW_RES(STR_CHAR)));
+ aNumberExtChar.SetAccessibleRelationMemberOf(&aNumberFL);
+ aNumberCharEdit.SetAccessibleRelationLabeledBy(&aNumberCharBtn);
+
aNumberAutoBtn.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberAutoBtnHdl));
aNumberExtChar.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberExtCharHdl));
aNumberCharBtn.SetClickHdl(LINK(this,SwInsFootNoteDlg,NumberCharHdl));
diff --git a/sw/source/ui/misc/insfnote.hrc b/sw/source/ui/misc/insfnote.hrc
index 8ac15b4f9fc3..d8e534f9255a 100644
--- a/sw/source/ui/misc/insfnote.hrc
+++ b/sw/source/ui/misc/insfnote.hrc
@@ -39,3 +39,7 @@
#define BT_HELP 102
#define BT_PREV 103
#define BT_NEXT 104
+
+//IAccessibility2 Implementation 2009-----
+#define STR_CHAR 105
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/misc/insfnote.src b/sw/source/ui/misc/insfnote.src
index 265ee1e095f6..964f174f189b 100644
--- a/sw/source/ui/misc/insfnote.src
+++ b/sw/source/ui/misc/insfnote.src
@@ -49,6 +49,12 @@ ModalDialog DLG_INS_FOOTNOTE
Group = TRUE ;
Left = TRUE ;
};
+ //IAccessibility2 Implementation 2009-----
+ String STR_CHAR
+ {
+ Text [ en-US ] = "Character" ;
+ };
+ //-----IAccessibility2 Implementation 2009
OKButton BT_OK
{
Pos = MAP_APPFONT ( 104 , 6 ) ;
diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx
index 60c6662511c0..4b03871e9f7d 100644
--- a/sw/source/ui/misc/linenum.cxx
+++ b/sw/source/ui/misc/linenum.cxx
@@ -105,6 +105,7 @@ SwLineNumberingPage::SwLineNumberingPage( Window* pParent,
const SfxItemSet& rSet )
: SfxTabPage(pParent, SW_RES(TP_LINENUMBERING), rSet),
aNumberingOnCB ( this, SW_RES( CB_NUMBERING_ON )),
+ aDisplayFL ( this, SW_RES( FL_DISPLAY )),
aCharStyleFT ( this, SW_RES( FT_CHAR_STYLE )),
aCharStyleLB ( this, SW_RES( LB_CHAR_STYLE )),
aFormatFT ( this, SW_RES( FT_FORMAT )),
@@ -116,19 +117,29 @@ SwLineNumberingPage::SwLineNumberingPage( Window* pParent,
aNumIntervalFT ( this, SW_RES( FT_NUM_INVERVAL )),
aNumIntervalNF ( this, SW_RES( NF_NUM_INVERVAL )),
aNumRowsFT ( this, SW_RES( FT_NUM_ROWS )),
- aDisplayFL ( this, SW_RES( FL_DISPLAY )),
+ aDivisorFL ( this, SW_RES( FL_DIVISOR )),
aDivisorFT ( this, SW_RES( FT_DIVISOR )),
aDivisorED ( this, SW_RES( ED_DIVISOR )),
aDivIntervalFT ( this, SW_RES( FT_DIV_INTERVAL )),
aDivIntervalNF ( this, SW_RES( NF_DIV_INTERVAL )),
aDivRowsFT ( this, SW_RES( FT_DIV_ROWS )),
- aDivisorFL ( this, SW_RES( FL_DIVISOR )),
+ aCountFL ( this, SW_RES( FL_COUNT )),
aCountEmptyLinesCB ( this, SW_RES( CB_COUNT_EMPTYLINES )),
aCountFrameLinesCB ( this, SW_RES( CB_COUNT_FRAMELINES )),
- aRestartEachPageCB ( this, SW_RES( CB_RESTART_PAGE )),
- aCountFL ( this, SW_RES( FL_COUNT ))
+ aRestartEachPageCB ( this, SW_RES( CB_RESTART_PAGE ))
{
+ String sIntervalName = aDivIntervalFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii("(");
+ sIntervalName += aDivRowsFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii(")");
+ aDivIntervalNF.SetAccessibleName(sIntervalName);
+ sIntervalName = aNumIntervalFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii("(");
+ sIntervalName += aNumRowsFT.GetAccessibleName();
+ sIntervalName += String::CreateFromAscii(")");
+ aNumIntervalNF.SetAccessibleName(sIntervalName);
+
FreeResource();
SwLineNumberingDlg *pDlg = (SwLineNumberingDlg *)GetParent();
pSh = pDlg->GetWrtShell();
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 62f9b19380d0..4b6b48e5ccea 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -101,9 +101,9 @@ static sal_Bool bLastRelative = sal_False;
SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
const SfxItemSet& rSet) :
SfxTabPage( pParent, SW_RES( TP_NUM_POSITION ), rSet ),
- aPositionFL( this, SW_RES(FL_POSITION )),
aLevelFL( this, SW_RES(FL_LEVEL )),
aLevelLB( this, SW_RES(LB_LEVEL )),
+ aPositionFL( this, SW_RES(FL_POSITION )),
aDistBorderFT( this, SW_RES(FT_BORDERDIST )),
aDistBorderMF( this, SW_RES(MF_BORDERDIST )),
@@ -144,6 +144,9 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
SetExchangeSupport();
aPreviewWIN.SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
+ aStandardPB.SetAccessibleRelationMemberOf(&aPositionFL);
+
+
aRelativeCB.Check();
aAlignLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl));
// --> OD 2008-02-01 #newlistlevelattrs#
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 8658c0024b18..3f67fb5cdb1a 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -88,6 +88,10 @@
#include <app.hrc>
// <--
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#endif
+
using namespace ::com::sun::star;
/* -----------------------------31.01.01 10:23--------------------------------
@@ -102,9 +106,9 @@ DBG_NAME(outlinehdl)
class SwNumNamesDlg: public ModalDialog
{
+ FixedLine aFormFL;
Edit aFormEdit;
ListBox aFormBox;
- FixedLine aFormFL;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
@@ -186,9 +190,9 @@ IMPL_LINK_INLINE_END( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
: ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)),
+ aFormFL(this, SW_RES(FL_FORM)),
aFormEdit(this, SW_RES(ED_FORM)),
aFormBox(this, SW_RES(LB_FORM)),
- aFormFL(this, SW_RES(FL_FORM)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn(this, SW_RES(BT_HELP))
@@ -241,6 +245,7 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
pUserButton->SetText(SW_RES(ST_FORM));
pUserButton->SetHelpId(HID_OUTLINE_FORM);
pUserButton->SetClickHdl(LINK(this, SwOutlineTabDialog, FormHdl));
+ pUserButton->SetAccessibleRole( com::sun::star::accessibility::AccessibleRole::BUTTON_MENU );
FreeResource();
pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() );
@@ -543,8 +548,9 @@ short SwOutlineTabDialog::Ok()
* --------------------------------------------------*/
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_OUTLINE_NUM), rSet),
- aLevelLB( this, SW_RES(LB_LEVEL )),
aLevelFL( this, SW_RES(FL_LEVEL )),
+ aLevelLB( this, SW_RES(LB_LEVEL )),
+ aNumberFL(this, SW_RES(FL_NUMBER)),
aCollLbl(this, SW_RES(FT_COLL)),
aCollBox(this, SW_RES(LB_COLL)),
aNumberLbl(this, SW_RES(FT_NUMBER)),
@@ -560,7 +566,6 @@ SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxIte
aSuffixED(this, SW_RES(ED_SUFFIX)),
aStartLbl(this, SW_RES(FT_START)),
aStartEdit(this, SW_RES(ED_START)),
- aNumberFL(this, SW_RES(FL_NUMBER)),
aPreviewWIN( this, SW_RES(WIN_PREVIEW )),
aNoFmtName(SW_RES(ST_NO_COLL)),
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index facd2cb583ef..593dbebae5ef 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -156,14 +156,14 @@ IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG )
SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
SfxTabPage(pParent, SW_RES(TP_FOOTNOTE_PAGE), rSet),
-
+ aPosHeader(this, SW_RES(FL_FOOTNOTE_SIZE)),
aMaxHeightPageBtn(this, SW_RES(RB_MAXHEIGHT_PAGE)),
aMaxHeightBtn(this, SW_RES(RB_MAXHEIGHT)),
aMaxHeightEdit(this, SW_RES(ED_MAXHEIGHT)),
aDistLbl(this, SW_RES(FT_DIST)),
aDistEdit(this, SW_RES(ED_DIST)),
- aPosHeader(this, SW_RES(FL_FOOTNOTE_SIZE)),
+ aLineHeader(this, SW_RES(FL_LINE)),
aLinePosLbl(this, SW_RES(FT_LINEPOS)),
aLinePosBox(this, SW_RES(DLB_LINEPOS)),
aLineTypeLbl(this, SW_RES(FT_LINETYPE)),
@@ -171,9 +171,8 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
aLineWidthLbl(this, SW_RES(FT_LINEWIDTH)),
aLineWidthEdit(this, SW_RES(ED_LINEWIDTH)),
aLineDistLbl(this, SW_RES(FT_LINEDIST)),
- aLineDistEdit(this, SW_RES(ED_LINEDIST)),
- aLineHeader(this, SW_RES(FL_LINE))
-{
+ aLineDistEdit(this, SW_RES(ED_LINEDIST))
+ {
FreeResource();
SetExchangeSupport();
@@ -184,6 +183,7 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) :
MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
long nHeightValue = MEASURE_METRIC != eSys ? 1440 : 1134;
aMaxHeightEdit.SetValue(aMaxHeightEdit.Normalize(nHeightValue),FUNIT_TWIP);;
+ aMaxHeightEdit.SetAccessibleRelationLabeledBy(&aMaxHeightBtn);
}
SwFootNotePage::~SwFootNotePage()
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index ee879ea8e645..678b0c917e3c 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -133,11 +133,12 @@ sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
SvxStandardDialog(pParent, SW_RES(DLG_SORTING)),
+
aColLbl(this, SW_RES(FT_COL )),
aTypLbl(this, SW_RES(FT_KEYTYP)),
aDirLbl(this, SW_RES(FT_DIR )),
+ aSortFL(this, SW_RES(FL_SORT_2 )),
- aDirFL(this, SW_RES(FL_DIR )),
aKeyCB1(this, SW_RES(CB_KEY1 )),
aColEdt1(this, SW_RES(ED_KEY1 )),
@@ -156,8 +157,8 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
aTypDLB3(this, SW_RES(DLB_KEY3 )),
aSortUp3RB(this, SW_RES(RB_UP3 )),
aSortDn3RB(this, SW_RES(RB_DN3 )),
+ aDirFL(this, SW_RES(FL_DIR )),
- aSortFL(this, SW_RES(FL_SORT_2 )),
aColumnRB(this, SW_RES(RB_COL )),
aRowRB(this, SW_RES(RB_ROW )),
@@ -185,6 +186,19 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
nX( 99 ),
nY( 99 )
{
+ aColEdt1.SetAccessibleName(aColLbl.GetText());
+ aColEdt2.SetAccessibleName(aColLbl.GetText());
+ aColEdt3.SetAccessibleName(aColLbl.GetText());
+ aTypDLB1.SetAccessibleName(aTypLbl.GetText());
+ aTypDLB2.SetAccessibleName(aTypLbl.GetText());
+ aTypDLB3.SetAccessibleName(aTypLbl.GetText());
+ aSortUpRB.SetAccessibleRelationMemberOf( &aKeyCB1 );
+ aSortDnRB.SetAccessibleRelationMemberOf( &aKeyCB1 );
+ aSortUp2RB.SetAccessibleRelationMemberOf( &aKeyCB2 );
+ aSortDn2RB.SetAccessibleRelationMemberOf( &aKeyCB2 );
+ aSortUp3RB.SetAccessibleRelationMemberOf( &aKeyCB3 );
+ aSortDn3RB.SetAccessibleRelationMemberOf( &aKeyCB3 );
+
aDelimEdt.SetMaxTextLen( 1 );
if(rSh.GetSelectionType() &
(nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) )
@@ -262,6 +276,25 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
aColEdt2.SetMax(nMax);
aColEdt3.SetMax(nMax);
}
+
+ aDelimEdt.SetAccessibleRelationLabeledBy(&aDelimFreeRB);
+ aDelimPB.SetAccessibleRelationLabeledBy(&aDelimFreeRB);
+ aDelimPB.SetAccessibleRelationMemberOf(&aDelimFL);
+
+ aColEdt1.SetAccessibleRelationMemberOf(&aKeyCB1);
+ aColEdt1.SetAccessibleRelationLabeledBy(&aColLbl);
+ aTypDLB1.SetAccessibleRelationMemberOf(&aKeyCB1);
+ aTypDLB1.SetAccessibleRelationLabeledBy(&aTypLbl);
+
+ aColEdt2.SetAccessibleRelationMemberOf(&aKeyCB2);
+ aColEdt2.SetAccessibleRelationLabeledBy(&aColLbl);
+ aTypDLB2.SetAccessibleRelationMemberOf(&aKeyCB2);
+ aTypDLB2.SetAccessibleRelationLabeledBy(&aTypLbl);
+
+ aColEdt3.SetAccessibleRelationMemberOf(&aKeyCB3);
+ aColEdt3.SetAccessibleRelationLabeledBy(&aColLbl);
+ aTypDLB3.SetAccessibleRelationMemberOf(&aKeyCB3);
+ aTypDLB3.SetAccessibleRelationLabeledBy(&aTypLbl);
}
SwSortDlg::~SwSortDlg()
@@ -416,6 +449,9 @@ IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck )
aColEdt2.SetMax(nY);
aColEdt3.SetMax(nY);
+ aColEdt1.SetAccessibleName(aColTxt);
+ aColEdt2.SetAccessibleName(aColTxt);
+ aColEdt3.SetAccessibleName(aColTxt);
}
else if( pCheck == ( CheckBox* ) &aColumnRB)
{
@@ -423,6 +459,10 @@ IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck )
aColEdt1.SetMax(nX);
aColEdt2.SetMax(nX);
aColEdt3.SetMax(nX);
+
+ aColEdt1.SetAccessibleName(aRowTxt);
+ aColEdt2.SetAccessibleName(aRowTxt);
+ aColEdt3.SetAccessibleName(aRowTxt);
}
else if(!aKeyCB1.IsChecked() &&
!aKeyCB2.IsChecked() &&
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 3d5023c311eb..70aba0ae2a8f 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -266,7 +266,8 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, nAnchor));
sal_Bool bRTL;
- aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrmVertical(sal_True, bRTL)));
+ sal_Bool bVertL2R;
+ aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrmVertical(sal_True, bRTL, bVertL2R)));
aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_RTL_TEXT, bRTL));
SwFrmFmt* pFrmFmt = FindFrmFmt( pObj );
@@ -832,8 +833,12 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation
pValidation->bFollowTextFlow,
pValidation->bMirror, NULL, &pValidation->aPercentSize);
- sal_Bool bRTL;
- sal_Bool bIsInVertical = pSh->IsFrmVertical(sal_True, bRTL);
+ sal_Bool bIsInVertical( sal_False );
+ {
+ sal_Bool bRTL;
+ sal_Bool bVertL2R;
+ bIsInVertical = pSh->IsFrmVertical(sal_True, bRTL, bVertL2R);
+ }
if(bIsInVertical)
{
Point aPos(aBoundRect.Pos());
diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx
index 70811c670496..d9e3d64b22e2 100644
--- a/sw/source/ui/table/colwd.cxx
+++ b/sw/source/ui/table/colwd.cxx
@@ -76,12 +76,12 @@ IMPL_LINK_INLINE_END( SwTableWidthDlg, LoseFocusHdl, Edit *, EMPTYARG )
SwTableWidthDlg::SwTableWidthDlg(Window *pParent, SwTableFUNC &rTableFnc ) :
SvxStandardDialog( pParent, SW_RES(DLG_COL_WIDTH) ),
+ aWidthFL(this, SW_RES(FL_WIDTH)),
aColFT(this, SW_RES(FT_COL)),
aColEdit(this, SW_RES(ED_COL)),
aWidthFT(this, SW_RES(FT_WIDTH)),
aWidthEdit(this, SW_RES(ED_WIDTH)),
- aWidthFL(this, SW_RES(FL_WIDTH)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn(this, SW_RES(BT_HELP)),
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index da3ad666fd64..411868ac6b3d 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -153,6 +153,8 @@ SwConvertTableDlg::SwConvertTableDlg( SwView& rView, bool bToTable )
pTAutoFmt( 0 ),
pShell( &rView.GetWrtShell() )
{
+ aOtherEd.SetAccessibleName(String(SW_RES(STR_SYMBOL)));
+ aOtherEd.SetAccessibleRelationLabeledBy(&aOtherBtn);
FreeResource();
if(nSaveButtonState > -1)
{
diff --git a/sw/source/ui/table/convert.hrc b/sw/source/ui/table/convert.hrc
index 7f7cbbec768f..b8a29a17c380 100644
--- a/sw/source/ui/table/convert.hrc
+++ b/sw/source/ui/table/convert.hrc
@@ -45,3 +45,6 @@
#define BT_AUTOFORMAT 102
#define BT_HELP 103
#define WIN_REPEAT_HEADER 104
+//IAccessibility2 Implementation 2009-----
+#define STR_SYMBOL 105
+//-----IAccessibility2 Implementation 2009
diff --git a/sw/source/ui/table/convert.src b/sw/source/ui/table/convert.src
index c15b4ad4456c..911672509611 100644
--- a/sw/source/ui/table/convert.src
+++ b/sw/source/ui/table/convert.src
@@ -191,6 +191,12 @@ ModalDialog DLG_CONV_TEXT_TABLE
Hide = TRUE ;
Text [ en-US ] = "Auto~Format..." ;
};
+ /*IAccessibility2 Implementation 2009-----*/
+ String STR_SYMBOL
+ {
+ Text [ en-US ] = "Symbol" ;
+ };
+ /*-----IAccessibility2 Implementation 2009*/
};
diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx
index 1fb108276bc1..a1d1770136d7 100644
--- a/sw/source/ui/table/rowht.cxx
+++ b/sw/source/ui/table/rowht.cxx
@@ -86,10 +86,10 @@ void SwTableHeightDlg::Apply()
SwTableHeightDlg::SwTableHeightDlg( Window *pParent, SwWrtShell &rS ) :
SvxStandardDialog(pParent, SW_RES(DLG_ROW_HEIGHT)),
+ aHeightFL(this, SW_RES(FL_HEIGHT)),
aHeightEdit(this, SW_RES(ED_HEIGHT)),
aAutoHeightCB(this, SW_RES(CB_AUTOHEIGHT)),
- aHeightFL(this, SW_RES(FL_HEIGHT)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn( this, SW_RES( BT_HELP ) ),
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 38b0e6e54799..45eab49d553d 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -53,6 +53,8 @@
#include <fmtrowsplt.hxx>
#include <svx/htmlmode.hxx>
+#include "access.hrc"
+
#ifndef _DOCSH_HXX
#include <docsh.hxx>
#endif
@@ -825,6 +827,7 @@ SwTableColumnPage::SwTableColumnPage( Window* pParent,
aSpaceFT(this, SW_RES(FT_SPACE)),
aSpaceED(this, SW_RES(ED_SPACE)),
+ aColFL(this, SW_RES(COL_FL_LAYOUT)),
aUpBtn(this, SW_RES(COL_BTN_UP)),
aFT1(this, SW_RES(COL_FT_1)),
aMF1(this, SW_RES(COL_MF_1)),
@@ -839,7 +842,6 @@ SwTableColumnPage::SwTableColumnPage( Window* pParent,
aFT6(this, SW_RES(COL_FT_6)),
aMF6(this, SW_RES(COL_MF_6)),
aDownBtn(this, SW_RES(COL_BTN_DOWN)),
- aColFL(this, SW_RES(COL_FL_LAYOUT)),
nTableWidth(0),
nMinWidth( MINLAY ),
@@ -852,6 +854,9 @@ SwTableColumnPage::SwTableColumnPage( Window* pParent,
FreeResource();
SetExchangeSupport();
+ aDownBtn.SetAccessibleRelationMemberOf(&aColFL);
+ aUpBtn.SetAccessibleRelationMemberOf(&aColFL);
+
pFieldArr[0] = &aMF1;
pFieldArr[1] = &aMF2;
pFieldArr[2] = &aMF3;
@@ -986,8 +991,16 @@ IMPL_LINK( SwTableColumnPage, AutoClickHdl, CheckBox *, pBox )
for( sal_uInt16 i = 0; (i < nNoOfVisibleCols ) && ( i < MET_FIELDS); i++ )
{
String sEntry('~');
- sEntry += String::CreateFromInt32( aValueTbl[i] + 1 );
+ String sIndex = String::CreateFromInt32( aValueTbl[i] + 1 );
+ sEntry += sIndex;
pTextArr[i]->SetText( sEntry );
+//IAccessibility2 Impplementaton 2009-----
+ //added by menghu for SODC_5143,12/12/2006
+ String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH);
+ sColumnWidth.SearchAndReplace( DEFINE_CONST_UNICODE("%1"), sIndex );
+ pFieldArr[i]->SetAccessibleName( sColumnWidth );
+ //end of SODC_5143
+//-----IAccessibility2 Impplementaton 2009
}
aDownBtn.Enable(aValueTbl[0] > 0);
@@ -1458,6 +1471,13 @@ SwTextFlowPage::SwTextFlowPage( Window* pParent,
{
FreeResource();
+ aPgBrkRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aColBrkRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aPgBrkBeforeRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aPgBrkAfterRB.SetAccessibleRelationMemberOf(&aPgBrkCB);
+ aPageCollLB.SetAccessibleRelationLabeledBy(&aPageCollCB);
+ aPageCollLB.SetAccessibleName(aPageCollCB.GetText());
+
aPgBrkCB.SetClickHdl(LINK(this, SwTextFlowPage, PageBreakHdl_Impl));
aPgBrkBeforeRB.SetClickHdl(
LINK( this, SwTextFlowPage, PageBreakPosHdl_Impl ) );
diff --git a/sw/source/ui/table/tabledlg.hrc b/sw/source/ui/table/tabledlg.hrc
index 843bec591d9e..f03aed6afffc 100644
--- a/sw/source/ui/table/tabledlg.hrc
+++ b/sw/source/ui/table/tabledlg.hrc
@@ -108,3 +108,4 @@
#define FT_VERTORIENT 150
#define LB_VERTORIENT 151
+
diff --git a/sw/source/ui/table/tabledlg.src b/sw/source/ui/table/tabledlg.src
index 79300699bd33..51248119c5f1 100644
--- a/sw/source/ui/table/tabledlg.src
+++ b/sw/source/ui/table/tabledlg.src
@@ -786,4 +786,3 @@ InfoBox MSG_WRONG_TABLENAME
{
Message [ en-US ] = "The name of the table must not contain spaces." ;
};
-
diff --git a/sw/source/ui/table/tablepg.hxx b/sw/source/ui/table/tablepg.hxx
index aa9dd2490ec1..07f408ec8556 100644
--- a/sw/source/ui/table/tablepg.hxx
+++ b/sw/source/ui/table/tablepg.hxx
@@ -121,7 +121,7 @@ class SwTableColumnPage : public SfxTabPage
CheckBox aProportionalCB;
FixedText aSpaceFT;
MetricField aSpaceED;
-
+ FixedLine aColFL;
ImageButton aUpBtn;
FixedText aFT1;
PercentField aMF1;
@@ -136,7 +136,6 @@ class SwTableColumnPage : public SfxTabPage
FixedText aFT6;
PercentField aMF6;
ImageButton aDownBtn;
- FixedLine aColFL;
SwTableRep* pTblData;
PercentField* pFieldArr[MET_FIELDS];
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 41aaca4a4f65..e64c5110a942 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -184,13 +184,13 @@ SwAutoFormatDlg::SwAutoFormatDlg( Window* pParent, SwWrtShell* pWrtShell,
//
aFlFormat ( this, SW_RES( FL_FORMAT ) ),
aLbFormat ( this, SW_RES( LB_FORMAT ) ),
+ aFlFormats ( this, SW_RES( FL_FORMATS ) ),
aBtnNumFormat ( this, SW_RES( BTN_NUMFORMAT ) ),
aBtnBorder ( this, SW_RES( BTN_BORDER ) ),
aBtnFont ( this, SW_RES( BTN_FONT ) ),
aBtnPattern ( this, SW_RES( BTN_PATTERN ) ),
aBtnAlignment ( this, SW_RES( BTN_ALIGNMENT ) ),
- aFlFormats ( this, SW_RES( FL_FORMATS ) ),
aBtnOk ( this, SW_RES( BTN_OK ) ),
aBtnCancel ( this, SW_RES( BTN_CANCEL ) ),
aBtnHelp ( this, SW_RES( BTN_HELP ) ),
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index ee5522595f96..1e96297a3464 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -313,8 +313,14 @@ void SwView::ExecTabWin( SfxRequest& rReq )
SwFrmFmt* pFmt = ((SwFrmFmt*)rSh.GetFlyFrmFmt());
const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED);
- sal_Bool bRTL;
- sal_Bool bVerticalFrame = (bFrmSelection && rSh.IsFrmVertical(sal_True, bRTL))|| (!bFrmSelection && bVerticalWriting);
+ sal_Bool bVerticalFrame(sal_False);
+ {
+ sal_Bool bRTL;
+ sal_Bool bVertL2R;
+ bVerticalFrame = ( bFrmSelection &&
+ rSh.IsFrmVertical(sal_True, bRTL, bVertL2R) ) ||
+ ( !bFrmSelection && bVerticalWriting);
+ }
long nDeltaX = bVerticalFrame ?
rRect.Right() - rPageRect.Right() + aLongLR.GetRight() :
rPageRect.Left() + aLongLR.GetLeft() - rRect.Left();
@@ -452,7 +458,10 @@ void SwView::ExecTabWin( SfxRequest& rReq )
RES_VERT_ORIENT, RES_HORI_ORIENT, 0 );
//which of the orientation attributes is to be put depends on the frame's environment
sal_Bool bRTL;
- if((bFrmSelection && rSh.IsFrmVertical(sal_True, bRTL))|| (!bFrmSelection && bVerticalWriting))
+ sal_Bool bVertL2R;
+ if ( ( bFrmSelection &&
+ rSh.IsFrmVertical(sal_True, bRTL, bVertL2R ) ) ||
+ ( !bFrmSelection && bVerticalWriting ) )
{
SwFmtHoriOrient aHoriOrient(pFmt->GetHoriOrient());
aHoriOrient.SetHoriOrient(text::HoriOrientation::NONE);
@@ -1274,8 +1283,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_RULER_BORDERS_VERTICAL:
case SID_RULER_BORDERS:
{
- sal_Bool bFrameRTL;
- sal_Bool bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL) && bFrmSelection;
+ sal_Bool bFrameHasVerticalColumns(sal_False);
+ {
+ sal_Bool bFrameRTL;
+ sal_Bool bFrameVertL2R;
+ bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL, bFrameVertL2R) &&
+ bFrmSelection;
+ }
sal_Bool bHasTable = ( IsTabColFromDoc() ||
( rSh.GetTableFmt() && !bFrmSelection &&
!(nFrmType & FRMTYPE_COLSECT ) ) );
@@ -1498,8 +1512,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_RULER_ROWS :
case SID_RULER_ROWS_VERTICAL:
{
- sal_Bool bFrameRTL;
- sal_Bool bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL) && bFrmSelection;
+ sal_Bool bFrameHasVerticalColumns(sal_False);
+ {
+ sal_Bool bFrameRTL;
+ sal_Bool bFrameVertL2R;
+ bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL, bFrameVertL2R) &&
+ bFrmSelection;
+ }
if( ( (SID_RULER_ROWS == nWhich) &&
((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ) ||
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 023dabf27043..35f3c0e8e172 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -2891,6 +2891,9 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
aTmpSize = pPrinter->LogicToLogic( aTmpSize,
pPrinter->GetMapMode(), MapMode( MAP_100TH_MM ));
aPageSize = awt::Size( aTmpSize.Width(), aTmpSize.Height() );
+ #if 0
+ // #i115048# it seems users didn't like getting double the formatted page size
+ // revert to "old" behavior scaling to the current paper size of the printer
if (bPrintProspect)
{
// we just state what output size we would need
@@ -2900,6 +2903,20 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
aPreferredPageSize = awt::Size ( TWIP_TO_MM100( 2 * aTmpSize.Width() ),
TWIP_TO_MM100( aTmpSize.Height() ));
}
+ #else
+ if( bPrintProspect )
+ {
+ // just switch to an appropriate portrait/landscape format
+ // FIXME: brochure printing with landscape pages puts the
+ // pages next to each other, so landscape is currently always
+ // the better choice
+ if( aPageSize.Width < aPageSize.Height )
+ {
+ aPreferredPageSize.Width = aPageSize.Height;
+ aPreferredPageSize.Height = aPageSize.Width;
+ }
+ }
+ #endif
}
}
else
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index 3fc2f9c047c7..d88ecdf6be73 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -80,6 +80,8 @@
#include <utlui.hrc>
#endif
+#include "access.hrc"
+
#include <unomid.h>
@@ -808,7 +810,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
pEdit->SetModifyHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
-
+ pEdit->SetAccessibleName(pEdit->GetQuickHelpText());
bPageCtrlsVisible = sal_True;
// Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SHOW_ROOT);
@@ -933,6 +935,10 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
UsePage(0);
aPageChgTimer.SetTimeoutHdl(LINK(this, SwNavigationPI, ChangePageHdl));
aPageChgTimer.SetTimeout(PAGE_CHANGE_TIMEOUT);
+
+ aContentTree.SetAccessibleName(SW_RESSTR(STR_ACCESS_TL_CONTENT));
+ aGlobalTree.SetAccessibleName(SW_RESSTR(STR_ACCESS_TL_GLOBAL));
+ aDocListBox.SetAccessibleName(aStatusArr[3]);
}
/*------------------------------------------------------------------------
diff --git a/sw/source/ui/utlui/navipi.hrc b/sw/source/ui/utlui/navipi.hrc
index 8254e2dc92a9..70fd1dc6e14a 100644
--- a/sw/source/ui/utlui/navipi.hrc
+++ b/sw/source/ui/utlui/navipi.hrc
@@ -88,4 +88,3 @@
#define ST_POSTIT_SHOW (ST_GLOBAL_CONTEXT_FIRST +35)
#define ST_POSTIT_HIDE (ST_GLOBAL_CONTEXT_FIRST +36)
#define ST_POSTIT_DELETE (ST_GLOBAL_CONTEXT_FIRST +37)
-
diff --git a/sw/source/ui/utlui/navipi.src b/sw/source/ui/utlui/navipi.src
index 0c45e3203df0..fde6b82f139b 100644
--- a/sw/source/ui/utlui/navipi.src
+++ b/sw/source/ui/utlui/navipi.src
@@ -29,6 +29,7 @@
#include "utlui.hrc"
#include "navipi.hrc"
#include "helpid.h"
+#include "access.hrc"
Window DLG_NAVIGATION_PI
{
@@ -534,3 +535,15 @@ ImageList IMG_NAVI_ENTRYBMPH
MaskColor = IMAGE_MASK_COLOR ;
NAVI_ENTRY_IDS
};
+
+//IAccessibility2 Implementation 2009-----
+String STR_ACCESS_TL_GLOBAL
+{
+ Text [ en-US ] = "Global View";
+};
+String STR_ACCESS_TL_CONTENT
+{
+ Text [ en-US ] = "Content View";
+};
+//-----IAccessibility2 Implementation 2009
+
diff --git a/sw/source/ui/utlui/poolfmt.src b/sw/source/ui/utlui/poolfmt.src
index de3f74fb857d..a1d0fcbcfe76 100644
--- a/sw/source/ui/utlui/poolfmt.src
+++ b/sw/source/ui/utlui/poolfmt.src
@@ -738,7 +738,28 @@ String STR_POOLCHR_RUBYTEXT
{
Text [ en-US ] = "Rubies";
};
-
+//IAccessibility2 Implementation 2009-----
+String STR_COLUMN_VALUESET_ITEM0
+{
+ Text [ en-US ] = "1 column";
+};
+String STR_COLUMN_VALUESET_ITEM1
+{
+ Text [ en-US ] = "2 columns with equal size";
+};
+String STR_COLUMN_VALUESET_ITEM2
+{
+ Text [ en-US ] = "3 columns with equal size";
+};
+String STR_COLUMN_VALUESET_ITEM3
+{
+ Text [ en-US ] = "2 columns with different size (left > right)";
+};
+String STR_COLUMN_VALUESET_ITEM4
+{
+ Text [ en-US ] = "2 columns with different size (left < right)";
+};
+//-----IAccessibility2 Implementation 2009
String STR_POOLCHR_VERT_NUM
{
Text [ en-US ] = "Vertical Numbering Symbols";
diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx
index 27b861991e0f..94363dfbbbcf 100644
--- a/sw/source/ui/utlui/swrenamexnameddlg.cxx
+++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx
@@ -72,9 +72,9 @@ SwRenameXNamedDlg::SwRenameXNamedDlg( Window* pWin,
uno::Reference< container::XNamed > & xN,
uno::Reference< container::XNameAccess > & xNA ) :
ModalDialog(pWin, SW_RES(DLG_RENAME_XNAMED)),
- aNewNameFT(this, SW_RES(FT_NEW_NAME)),
- aNewNameED(this, SW_RES(ED_NEW_NAME)),
aNameFL(this, SW_RES(FL_NAME)),
+ aNewNameFT(this, SW_RES(FT_NEW_NAME)),
+ aNewNameED(this, SW_RES(ED_NEW_NAME)),
aOk(this, SW_RES(PB_OK)),
aCancel(this, SW_RES(PB_CANCEL)),
aHelp(this, SW_RES(PB_HELP)),
diff --git a/swext/prj/build.lst b/swext/prj/build.lst
index aa07df358770..143351e5abfa 100644
--- a/swext/prj/build.lst
+++ b/swext/prj/build.lst
@@ -1,4 +1,4 @@
-swext swext : officecfg l10n javaunohelper ridljar unoil jurt APACHE_COMMONS:apache-commons readlicense_oo xsltml xmlhelp NULL
+swext swext : officecfg L10N:l10n javaunohelper ridljar unoil jurt APACHE_COMMONS:apache-commons readlicense_oo xsltml xmlhelp NULL
swext swext usr1 - all swext_mkout NULL
swext swext\mediawiki\help nmake - all swext_mwhelp NULL
swext swext\mediawiki\src\registry\schema\org\openoffice\Office\Custom nmake - all swext_mwschema NULL
diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst
index 1530997a3ec3..b5f26eb936b9 100644
--- a/sysui/prj/build.lst
+++ b/sysui/prj/build.lst
@@ -1,4 +1,4 @@
-su sysui : l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL
+su sysui : L10N:l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL
su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL
su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL
su sysui\desktop\icons nmake - w su_iconsw NULL
diff --git a/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
index 081b35f322ec..63f552df63bf 100755
--- a/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
+++ b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
@@ -346,7 +346,8 @@ testcase tWriterUIChangesTest7
Kontext "RubyDialog"
DialogClose.Click
Sleep 2
- QAErrorlog "#i40913# Something wrong in menu format/Ruby when Asian Language support is off"
+ '#i40913#
+ warnlog "Something wrong in menu format/Ruby when Asian Language support is off"
catch
endcatch
end if
@@ -398,25 +399,29 @@ testcase tWriterUIChangesTest8
try
FormatChangeCaseHalfWidth
- QAErrorlog "#i43434# Something wrong in submenu format/change case -> Half width when Asian Language support is off"
+ '#i43434#
+ warnlog "Something wrong in submenu format/change case -> Half width when Asian Language support is off"
catch
endcatch
try
FormatChangeCaseFullWidth
- QAErrorlog "#i43434# Something wrong in submenu format/change case -> Full width when Asian Language support is off"
+ '#i43434#
+ warnlog "Something wrong in submenu format/change case -> Full width when Asian Language support is off"
catch
endcatch
try
FormatChangeCaseHiragana
- QAErrorlog "#i43434# Something wrong in submenu format/change case -> Hiragana when Asian Language support is off"
+ '#i43434#
+ warnlog "Something wrong in submenu format/change case -> Hiragana when Asian Language support is off"
catch
endcatch
try
FormatChangeCaseKatagana
- QAErrorlog "#i43434# Something wrong in submenu format/change case -> Katagana when Asian Language support is off"
+ '#i43434#
+ warnlog "Something wrong in submenu format/change case -> Katagana when Asian Language support is off"
catch
endcatch
end if
@@ -740,4 +745,4 @@ function hSystemHasAsianLocale() as boolean
case else : hSystemHasAsianLocale() = false
end select
-end function \ No newline at end of file
+end function
diff --git a/testautomation/framework/optional/includes/configuration.inc b/testautomation/framework/optional/includes/configuration.inc
index 0fce11bddd1b..9e63a4a9ad7e 100644
--- a/testautomation/framework/optional/includes/configuration.inc
+++ b/testautomation/framework/optional/includes/configuration.inc
@@ -44,7 +44,8 @@ sub sToolsCustomizeKeyboardFunction
for i = 0 to a
if ( i = 7 and gtSysName = "Solaris x86" ) then
- qaerrorlog( "#i62423# Solaris: Crash when opening new database" )
+ '#i62423#
+ warnlog( "Solaris: Crash when opening new database" )
else
gApplication = aApplication(i)
tToolsCustomizeKeyboardFunction(lList())
@@ -87,6 +88,7 @@ testcase tToolsCustomizeKeyboardFunction(lList())
dim i92080 as string
dim i96322 as string
dim i100037 as string
+ dim i115370 as string
i60617 = ".uno:ContinueNumbering"
i43969 = ".uno:MacroOrganizer"
@@ -94,12 +96,13 @@ testcase tToolsCustomizeKeyboardFunction(lList())
i80850 = ".uno:ToggleFormula.uno:AssignMacro"
i84982 = ".uno:FontDialogForParagraph"
i84983 = ".uno:DBNewReportWithPreSelection"
- i87950 = ".uno:DBMigrateScripts"
- i87951 = ".uno:DeleteAllNotes.uno:DeleteAuthor.uno:DeleteNote.uno:HideAllNotes.uno:HideAuthor.uno:HideNote"
- i87952 = ".uno:InsertApplet"
- i92080 = ".uno:SaveGraphic"
- i96322 = ".uno:ActivateStyleApply"
- i100037 = ".uno:AcceptTracedChange, .uno:DeleteComment, .uno:RejectTracedChange, .uno:ReplyNote, .uno:TaskPaneInsertPage, .uno:ValidityReference"
+ i87950 = ".uno:DBMigrateScripts"
+ i87951 = ".uno:DeleteAllNotes.uno:DeleteAuthor.uno:DeleteNote.uno:HideAllNotes.uno:HideAuthor.uno:HideNote"
+ i87952 = ".uno:InsertApplet"
+ i92080 = ".uno:SaveGraphic"
+ i96322 = ".uno:ActivateStyleApply"
+ i100037 = ".uno:AcceptTracedChange, .uno:DeleteComment, .uno:RejectTracedChange, .uno:ReplyNote, .uno:TaskPaneInsertPage, .uno:ValidityReference"
+ i115370 = ".uno:TaskPaneInsertPage"
Call hNewDocument
sleep 2
@@ -130,53 +133,8 @@ testcase tToolsCustomizeKeyboardFunction(lList())
if (((mid(sTemp2,d+1,1)<>" ")AND(abs(asc(mid(sTemp2,d+1,1)))<128)) AND (abs(asc(mid(sTemp2,d-1,1)))<128))then
listAppend(lList(),sTemp2)
bErrorFound = false
- if (inStr(i60617,sTemp2)>0) then
- WarnLog "#i60617# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(sTemp2,i64346)>0) then
- WarnLog "#i64346# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i43969,sTemp2)>0) then
- WarnLog "#i41265# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i80850,sTemp2)>0) then
- WarnLog "#i80850# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i84982,sTemp2)>0) then
- WarnLog "#i84982# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i84983,sTemp2)>0) then
- WarnLog "#i84983# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i87950,sTemp2)>0) then
- WarnLog "#i87950# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i87951,sTemp2)>0) then
- WarnLog "#i87951# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i87952,sTemp2)>0) then
- warnLog "#i87952# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i92080,sTemp2)>0) then
- WarnLog "#i92080# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
- if (inStr(i96322,sTemp2)>0) then
- WarnLog "#i96322# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
- bErrorFound = true
- endif
-
- if (inStr(i100037,sTemp2)>0) then
- WarnLog "#i100037# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ if (inStr(i115370,sTemp2)>0) then
+ qaerrorlog "#i115370# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
bErrorFound = true
endif
if ( not bErrorFound ) then
diff --git a/testautomation/framework/optional/includes/options_loadsave_general.inc b/testautomation/framework/optional/includes/options_loadsave_general.inc
index d320fb6a6d72..69e08f7bef20 100644
--- a/testautomation/framework/optional/includes/options_loadsave_general.inc
+++ b/testautomation/framework/optional/includes/options_loadsave_general.inc
@@ -176,7 +176,8 @@ testcase tLoadSaveGeneral
printlog( "Doctype: " & Dokumenttyp.getSelText() & " has filter: " & Filter.getSelText() )
if Filter.GetSelIndex <> 3 then
- warnlog( "#i79150# some options in Tools/Options->Load/Save->General are not saved" )
+ '#i79150#
+ warnlog( "Some options in Tools/Options->Load/Save->General are not saved" )
endif
next i
diff --git a/testautomation/framework/optional/includes/options_ooo_colors.inc b/testautomation/framework/optional/includes/options_ooo_colors.inc
index f7c68095e198..92489ecb15fc 100644
--- a/testautomation/framework/optional/includes/options_ooo_colors.inc
+++ b/testautomation/framework/optional/includes/options_ooo_colors.inc
@@ -40,8 +40,8 @@ testcase tOOoColors
dim currentColor(4) as String
dim chColor(4) as String
- const DEFAULT_COLOR_COUNT = 99
- const CHANGED_COLOR_COUNT = 100
+ const DEFAULT_COLOR_COUNT = 100
+ const CHANGED_COLOR_COUNT = DEFAULT_COLOR_COUNT +1
const USER_COLOR = "TT-Test-Color"
myColor(1) = USER_COLOR
@@ -66,10 +66,8 @@ testcase tOOoColors
printlog( "Check the number of currently registered colors - cancel test on error" )
Kontext "TabFarben"
if ( Farbe.GetItemCount() <> DEFAULT_COLOR_COUNT ) then
- warnlog( "The number of colors has changed, stopping test" )
- printlog( "Expected: " & DEFAULT_COLOR_COUNT )
- printlog( "Found...: " & Farbe.getItemCount() )
- printlog( "Close the Tools/Options dialog with OK" )
+ warnlog "The number of colors has changed, stopping test; Expected: " & DEFAULT_COLOR_COUNT & "; Found...: " & Farbe.getItemCount()
+ printlog "Close the Tools/Options dialog with OK"
Kontext "ExtrasOptionenDlg"
ExtrasOptionenDlg.OK
WaitSlot( 2000 )
diff --git a/testautomation/framework/optional/includes/options_ooo_general.inc b/testautomation/framework/optional/includes/options_ooo_general.inc
index 78a6f48a770b..2051fcefbf3d 100644
--- a/testautomation/framework/optional/includes/options_ooo_general.inc
+++ b/testautomation/framework/optional/includes/options_ooo_general.inc
@@ -85,7 +85,8 @@ testcase tOOoGeneral
hToolsOptions ( "StarOffice", "General" )
if Zweistellig.GetText <> "1950" then
- Warnlog "#i29810# - Year ( 2 digits ) => changes not saved: " + Zweistellig.GetText
+ '#i29810#
+ Warnlog "Year ( 2 digits ) => changes not saved: " + Zweistellig.GetText
endif
if not Aktivieren.IsChecked then
@@ -116,7 +117,8 @@ testcase tOOoGeneral
hToolsOptions ( "StarOffice", "General" )
if ( Zweistellig.GetText <> "1800" ) then
- Warnlog( "#i29810# - Year ( 2 digits ) => changes not saved : " & Zweistellig.GetText() )
+ '#i29810#
+ Warnlog( "Year ( 2 digits ) => changes not saved : " & Zweistellig.GetText() )
endif
If DruckenStatus.IsChecked then
diff --git a/testautomation/global/required/includes/g_printing.inc b/testautomation/global/required/includes/g_printing.inc
index 01c6321b12e9..6ee654a7dee2 100644
--- a/testautomation/global/required/includes/g_printing.inc
+++ b/testautomation/global/required/includes/g_printing.inc
@@ -172,7 +172,8 @@ testcase tPrintGeneral()
else
warnlog( "Pages setting disabled" )
endif
-
+
+ cb_test( PrintReverse, false, "" )
'Selection.check()
'AllPages.check()
@@ -485,7 +486,6 @@ testcase tPrintOptions()
printlog( "Controls common for all applications" )
cb_test( PrintToFile, false, "" )
cb_test( PrintAsSingleJobs, false, "" )
- cb_test( PrintReverse, false, "" )
printlog( "Application specific controls" )
select case( gApplication )
diff --git a/testautomation/global/system/includes/iniinfo.inc b/testautomation/global/system/includes/iniinfo.inc
index 0b83af421eeb..3423584253fd 100644
--- a/testautomation/global/system/includes/iniinfo.inc
+++ b/testautomation/global/system/includes/iniinfo.inc
@@ -115,17 +115,33 @@ sub GetIniInformation
end if
'--------
- call GetTheInstallationType ' gNetzInst and gNetzOfficePath will be set if StarOffice is a Network-Installation
- gOfficeBasisPath = getOfficeBasisPath()
- gOOoStartupTimeOut = fgetOOoStartupTimeOut()
- gOOoShutdownTimeOut = fgetOOoShutdownTimeOut()
- call sCheckValgrindStatus()
- ' set a global path for custom scripts, like basepath, but outside of current environment
- gPrivateEnvironmentLocation = getIniValue(gTesttoolIni, "PrivateEnvironment", "Current")
+ call GetTheInstallationType ' gNetzInst and gNetzOfficePath will be set if StarOffice is a Network-Installation
+ gOfficeBasisPath = getOfficeBasisPath()
+ gOOoStartupTimeOut = fgetOOoStartupTimeOut()
+ gOOoShutdownTimeOut = fgetOOoShutdownTimeOut()
+ call sCheckValgrindStatus()
+ ' set a global path for custom scripts outside of current environment
+ gPrivateEnvironmentLocation = getIniValue(gTesttoolIni, "PrivateEnvironment", "Current")
if (gPrivateEnvironmentLocation <> "" AND gPrivateEnvironmentLocation <> ".") then
- if NOT fileExists(gPrivateEnvironmentLocation) then
- qaErrorLog "[PrivateEnvironment] defined in: '"+gTesttoolIni+"', but the path '"+gPrivateEnvironmentLocation+"'does not exist!"
- gPrivateEnvironmentLocation = ""
+ ' check if the gPrivateEnvironmentLocation path exists
+ if fileExists(gPrivateEnvironmentLocation) then
+ ' check if the path ends with a path sign and add the path sign if not
+ if (Right(gPrivateEnvironmentLocation,1) <> gPathSigne) then
+ gPrivateEnvironmentLocation = gPrivateEnvironmentLocation & gPathSigne
+ endif
+ else
+ ' check if the gTesttoolPath plus the gPrivateEnvironmentLocation path exists
+ ' f.e. this is for a relative path
+ if fileExists(gTesttoolPath & gPrivateEnvironmentLocation) then
+ gPrivateEnvironmentLocation = gTesttoolPath & gPrivateEnvironmentLocation
+ ' check if the path ends with a path sign and add the path sign if not
+ if (Right(gPrivateEnvironmentLocation,1) <> gPathSigne) then
+ gPrivateEnvironmentLocation = gPrivateEnvironmentLocation & gPathSigne
+ endif
+ else
+ qaErrorLog "[PrivateEnvironment] defined in: '" & gTesttoolIni & "', but the path '" & gPrivateEnvironmentLocation & "'does not exist!"
+ gPrivateEnvironmentLocation = ""
+ endif
end if
else
gPrivateEnvironmentLocation = ""
diff --git a/testautomation/global/win/dial_d_h.win b/testautomation/global/win/dial_d_h.win
index 926c153ae43b..6af13cd00f6c 100755
--- a/testautomation/global/win/dial_d_h.win
+++ b/testautomation/global/win/dial_d_h.win
@@ -264,6 +264,7 @@ Synchronisieren sym:sw:PushButton:DLG_SYNC_BTN:BTN_SYNC
Zeichensatzliste sym:sc:ListBox:RID_SCDLG_IMPORTOPT:LB_FONT
Feldtrenner sym:sc:ComboBox:RID_SCDLG_IMPORTOPT:ED_FIELDSEP
Texttrenner sym:sc:ComboBox:RID_SCDLG_IMPORTOPT:ED_TEXTSEP
+QuoteAll sym:sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_QUOTEALL
Zeichensatz sym:sc:ListBox:RID_SCDLG_IMPORTOPT:DDLB_FONT
FixedWidth sym:sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FIXEDWIDTH
SaveAsShown sym:sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_SAVESHOWN
diff --git a/testautomation/global/win/edia_p_s.win b/testautomation/global/win/edia_p_s.win
index 7cd8e58ed94e..c985d6512cc2 100755
--- a/testautomation/global/win/edia_p_s.win
+++ b/testautomation/global/win/edia_p_s.win
@@ -150,6 +150,7 @@ PageCount .HelpID:vcl:PrintDialog:NumPagesText
PartsToPrint .HelpID:vcl:PrintDialog:PageContentType:ListBox
SlidesPerPage .HelpID:vcl:PrintDialog:SlidesPerPage:ListBox
ArrangeSlides .HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox
+PrintReverse .HelpID:vcl:PrintDialog:OptPage:ToReverse
*TabApplication .HelpID:vcl:PrintDialog:TabPage:AppPage
PrintPageBackground .HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox
@@ -197,7 +198,6 @@ BrochurePageSides .HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox
*TabOptions .HelpID:vcl:PrintDialog:OptPage
PrintToFile .HelpID:vcl:PrintDialog:OptPage:ToFile
PrintAsSingleJobs .HelpID:vcl:PrintDialog:OptPage:SingleJobs
-PrintReverse .HelpID:vcl:PrintDialog:OptPage:ToReverse
PaperTrayFromPrefs .HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox
*PurchaseStarOffice sym:TAB_HID_LICENSING_DIALOG
diff --git a/testautomation/math/optional/includes/m_101_.inc b/testautomation/math/optional/includes/m_101_.inc
index c36bb8822808..6c24b196ac2b 100644
--- a/testautomation/math/optional/includes/m_101_.inc
+++ b/testautomation/math/optional/includes/m_101_.inc
@@ -280,7 +280,8 @@ testcase tFilePassword
if Passwort.isEnabled then
if NOT((instr(sTemp,gMathFilter) = 1)OR(instr(sTemp," (.sxm)") > 1)) then
if (4=i) then
- warnlog "#i112895# (" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Enabled"
+ '#i112895#
+ warnlog "(" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Enabled"
else
warnlog "(" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Enabled"
endif
diff --git a/testautomation/math/optional/includes/m_105.inc b/testautomation/math/optional/includes/m_105.inc
index 0caad76e7ec5..48e45c41e1cb 100644
--- a/testautomation/math/optional/includes/m_105.inc
+++ b/testautomation/math/optional/includes/m_105.inc
@@ -408,7 +408,8 @@ testcase tToolsCatalog
SymboleMath.close
catch
if ((2=i)AND(11=j))then
- warnlog "#i42011# Expected: Timeout on closing Tools->Catalog with this character. (" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")"
+ '#i42011#
+ warnlog "Expected: Timeout on closing Tools->Catalog with this character. (" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")"
else
warnlog "Not Expected! Timeout on closing Tools->Catalog with this character. (" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")"
endif
@@ -452,8 +453,8 @@ testcase tToolsCatalog
next j
next i
- if (listCount(lAllSymbols()) <> 106) then
- warnlog "There have to be 106 Symbols, but there are: " + listCount(lAllSymbols())
+ if (listCount(lAllSymbols()) <> 108) then
+ warnlog "There have to be 108 Symbols, but there are: " + listCount(lAllSymbols())
endif
' TODO: check sAllSymbols for not allowed characters!
listCopy(lAllSymbols(),lAllSymbolsSort())
@@ -570,7 +571,8 @@ testcase tToolsCatalogNew
try
SymbolSet.select "TBOnewSymbolSet"
catch
- qaerrorlog "#i64504# Symbol set name is not saved on exiting OOo"
+ 'i64504
+ qaerrorlog "Symbol set name is not saved on exiting OOo"
SymbolSet.select ""
endcatch
SymbolSet.setText "TBOnewSymbolSet"
diff --git a/testautomation/math/required/includes/m_001_.inc b/testautomation/math/required/includes/m_001_.inc
index 7ddffee84d29..85546a0e222a 100755
--- a/testautomation/math/required/includes/m_001_.inc
+++ b/testautomation/math/required/includes/m_001_.inc
@@ -205,7 +205,8 @@ testcase tmFilePassword
if ( SpeichernDlg.exists( 2 ) ) then
Dateiname.SetText Datei$
if (Passwort.IsChecked <> TRUE) then
- Warnlog "#i36015# Password has to be checked! :-("
+ '#i36015#
+ Warnlog "Password has to be checked! :-("
Passwort.Check
printlog "will be forced checked no!"
endif
@@ -255,7 +256,8 @@ testcase tmFilePassword
Kontext "SpeichernDlg"
Dateiname.SetText Datei$
if (Passwort.IsChecked <> TRUE) then
- Warnlog "#i36015# Password has to be checked! :-("
+ '#i36015#
+ Warnlog "Password has to be checked! :-("
Passwort.Check
printlog "will be forced checked no!"
endif
diff --git a/testautomation/math/required/includes/m_005_.inc b/testautomation/math/required/includes/m_005_.inc
index f2c2a5d0ca60..a7884f29f8a2 100644
--- a/testautomation/math/required/includes/m_005_.inc
+++ b/testautomation/math/required/includes/m_005_.inc
@@ -298,7 +298,8 @@ testcase tToolsExtensionManager
ExtensionSoftwareLicenseAgreement.CANCEL
kontext
if active.exists(5) then
- qaerrorlog "#i73307# Alzheimer feature extension licensing '" + active.getText + "'"
+ '#i73307#
+ warnlog "Alzheimer feature extension licensing '" + active.getText + "'"
active.ok
endif
endif
diff --git a/testautomation/math/required/includes/m_007_.inc b/testautomation/math/required/includes/m_007_.inc
index fc8269c05c21..0b4c7c759ed3 100644
--- a/testautomation/math/required/includes/m_007_.inc
+++ b/testautomation/math/required/includes/m_007_.inc
@@ -121,7 +121,8 @@ testcase tmHelpContents
Printlog "HelpAbout: '" + HelpAbout.GetItemCount +"'"
catch
Index.Click
- qaErrorLog "#i55563# Used Index Button"
+ '#i55563#
+ warnlog "Used Index Button"
Printlog "HelpAbout: '" + HelpAbout.GetItemCount +"'"
endcatch
try
diff --git a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
index 38c25d41bde5..33c52111c384 100644
--- a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
@@ -40,6 +40,7 @@
' #1 tFileRecentDocuments
' #1 tFileClose
' #1 tFileSave
+' #1 tFileSaveAsCSV
' #1 tFileSaveAsDBF
' #1 tFileVersions
' #1 tFilePagePreview
@@ -59,6 +60,7 @@ sub c_upd_filemenu
Call tFileRecentDocuments
Call tFileClose
Call tFileSave
+ Call tFileSaveAsCSV
Call tFileSaveAsDBF
Call tFileVersions
Call tFilePagePreview
@@ -547,6 +549,68 @@ endcase
'-----------------------------------------------------------
+testcase tFileSaveAsCSV
+
+ Dim UIFilter as string
+ Dim bStatus as boolean
+
+ Printlog " Open new Spreadsheet document"
+ Call hNewDocument
+ Printlog " Fill two cells (10, Test)"
+ Kontext "DocumentCalc"
+ DocumentCalc.Typekeys "10 <TAB> Test <RETURN>"
+ Printlog " Open 'SaveAs' dialog"
+ FileSaveAs
+ Kontext "SpeichernDlg"
+ Printlog " Enter filename 'csv-Test_update'"
+ DateiName.SetText "csv-Test_update"
+ Printlog " Choose file typ CSV"
+ UIFilter = hGetUIFiltername ( "Text - txt - csv (StarCalc)" )
+ bStatus = hSelectUIFilter ( UIFilter )
+ if ( not bStatus ) then
+ warnlog "Filter not found"
+ SpeichernDlg.Cancel
+ Call hCloseDocument
+ goto endsub
+ end if
+ Printlog " Click on Save button"
+ Speichern.click
+ Printlog " Commit overwrite warning if file already exists"
+ Kontext
+ if Active.exists(2) then
+ Active.Yes
+ end if
+ Printlog " Check alien file format warning"
+ Kontext "AlienWarning"
+ if AlienWarning.exists(2) then
+ Printlog " Commit if exists"
+ AlienWarning.OK
+ else
+ warnlog "Alien file format warning is missing -> Check this out!"
+ end if
+ Printlog " Check existence of export encoding dialog"
+ Kontext "ExportCalc"
+ Call DialogTest (ExportCalc)
+ printlog " Verify that Quote All is disabled by default"
+ if QuoteAll.IsChecked then
+ warnlog " Option Quote All is checked but shouldn't"
+ end if
+ Printlog " Accept dialog by OK"
+ ExportCalc.OK
+ Kontext
+ if Active.exists(2) then
+ Printlog Active.GetText
+ Active.OK
+ else
+ warnlog " Messagebox that only the current sheet is saved is missing"
+ end if
+ Printlog " Close document"
+ Call hCloseDocument
+
+endcase
+
+'-----------------------------------------------------------
+
testcase tFileSaveAsDBF
Dim UIFilter as string
diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk
index fa6d3f4d591f..caf1c045be03 100644
--- a/toolkit/Library_tk.mk
+++ b/toolkit/Library_tk.mk
@@ -99,6 +99,8 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
toolkit/source/controls/grid/defaultgridcolumnmodel \
toolkit/source/controls/grid/defaultgriddatamodel \
toolkit/source/controls/grid/gridcolumn \
+ toolkit/source/controls/grid/grideventforwarder \
+ toolkit/source/controls/grid/sortablegriddatamodel \
toolkit/source/controls/grid/gridcontrol \
toolkit/source/controls/roadmapcontrol \
toolkit/source/controls/roadmapentry \
diff --git a/toolkit/inc/toolkit/awt/vclxcontainer.hxx b/toolkit/inc/toolkit/awt/vclxcontainer.hxx
index b854844ae7f1..dbf8c62f4580 100644
--- a/toolkit/inc/toolkit/awt/vclxcontainer.hxx
+++ b/toolkit/inc/toolkit/awt/vclxcontainer.hxx
@@ -42,7 +42,7 @@
// class VCLXContainer
// ----------------------------------------------------
-class VCLXContainer : public ::com::sun::star::awt::XVclContainer,
+class TOOLKIT_DLLPUBLIC VCLXContainer : public ::com::sun::star::awt::XVclContainer,
public ::com::sun::star::awt::XVclContainerPeer,
public VCLXWindow
{
diff --git a/toolkit/inc/toolkit/awt/vclxtopwindow.hxx b/toolkit/inc/toolkit/awt/vclxtopwindow.hxx
index d8e467b01499..d3b130cc8202 100644
--- a/toolkit/inc/toolkit/awt/vclxtopwindow.hxx
+++ b/toolkit/inc/toolkit/awt/vclxtopwindow.hxx
@@ -91,7 +91,7 @@ public:
// class VCLXTopWindow
// ----------------------------------------------------
-class VCLXTopWindow: public VCLXTopWindow_Base,
+class TOOLKIT_DLLPUBLIC VCLXTopWindow: public VCLXTopWindow_Base,
public VCLXContainer
{
protected:
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx
index 547ee86c66e4..8dcf05c9f8db 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -377,7 +377,7 @@ public:
// ----------------------------------------------------
// class VCLXDialog
// ----------------------------------------------------
-class VCLXDialog : public ::com::sun::star::awt::XDialog2,
+class TOOLKIT_DLLPUBLIC VCLXDialog : public ::com::sun::star::awt::XDialog2,
public VCLXTopWindow
{
public:
diff --git a/toolkit/inc/toolkit/controls/animatedimages.hxx b/toolkit/inc/toolkit/controls/animatedimages.hxx
index 96791c252b0b..c19ed5e5451c 100755
--- a/toolkit/inc/toolkit/controls/animatedimages.hxx
+++ b/toolkit/inc/toolkit/controls/animatedimages.hxx
@@ -57,7 +57,7 @@ namespace toolkit
class AnimatedImagesControl : public AnimatedImagesControl_Base
{
public:
- AnimatedImagesControl();
+ AnimatedImagesControl( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
::rtl::OUString GetComponentServiceName();
// XAnimation
@@ -93,7 +93,7 @@ namespace toolkit
class AnimatedImagesControlModel : public AnimatedImagesControlModel_Base
{
public:
- AnimatedImagesControlModel();
+ AnimatedImagesControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource );
virtual UnoControlModel* Clone() const;
diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
index 2246ec0204b4..3090eba68749 100644
--- a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
+++ b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
@@ -104,7 +104,7 @@ protected:
UnoControlModelHolderList::iterator ImplFindElement( const ::rtl::OUString& rName );
public:
- ControlModelContainerBase();
+ ControlModelContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
ControlModelContainerBase( const ControlModelContainerBase& rModel );
~ControlModelContainerBase();
@@ -232,8 +232,11 @@ protected:
void ImplUpdateResourceResolver();
void ImplStartListingForResourceEvents();
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > Impl_getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL );
-public:
+
ControlContainerBase();
+
+public:
+ ControlContainerBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
~ControlContainerBase();
DECLIMPL_SERVICEINFO_DERIVED( ControlContainerBase, UnoControlBase, "toolkit.ControlContainerBase" )
diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
index 1ab0120ec470..17b958aeace9 100644
--- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@ -48,7 +48,7 @@ protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlDialogModel();
+ UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlDialogModel( const UnoControlDialogModel& rModel );
~UnoControlDialogModel();
@@ -76,8 +76,8 @@ private:
public:
- UnoDialogControl();
- ~UnoDialogControl();
+ UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ ~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); }
diff --git a/toolkit/inc/toolkit/controls/formattedcontrol.hxx b/toolkit/inc/toolkit/controls/formattedcontrol.hxx
index f589dabd47aa..93f675dae03f 100644
--- a/toolkit/inc/toolkit/controls/formattedcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/formattedcontrol.hxx
@@ -67,8 +67,11 @@ namespace toolkit
) throw (::com::sun::star::uno::Exception);
public:
- UnoControlFormattedFieldModel();
- UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel ) : UnoControlModel( rModel ) {;}
+ UnoControlFormattedFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
+ :UnoControlModel( rModel )
+ {
+ }
UnoControlModel* Clone() const { return new UnoControlFormattedFieldModel( *this ); }
@@ -110,7 +113,7 @@ namespace toolkit
class UnoFormattedFieldControl : public UnoSpinFieldControl
{
public:
- UnoFormattedFieldControl();
+ UnoFormattedFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::awt::XTextListener
diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
index 558d145f3d14..ef86ec8eb5b8 100644
--- a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
+++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx
@@ -185,8 +185,7 @@ FORWARD_DECLARE_INTERFACE( script, XNameContainer )
,public ::comphelper::OAggregationArrayUsageHelper< OTemplateInstanceDisambiguation< CONTROLMODEL > >
{
public:
- OGeometryControlModel();
- OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & i_xCompContext);
+ OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
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 3b784251b65e..0b2362656433 100644
--- a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
+++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx
@@ -32,17 +32,17 @@
//====================================================================
//--------------------------------------------------------------------
template <class CONTROLMODEL>
-OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel()
- :OGeometryControlModel_Base(new CONTROLMODEL)
-{
-}
-
-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))
+OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :OGeometryControlModel_Base(new CONTROLMODEL( i_factory ) )
{
}
+//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/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
index 1b86d277fde2..0848fb21b8b5 100644
--- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
@@ -45,37 +45,37 @@
#include <cppuhelper/implbase4.hxx>
-
#include <comphelper/uno3.hxx>
-typedef GraphicControlModel UnoControlRoadmapModel_Base;
+//........................................................................
+namespace toolkit
+{
+//........................................................................
+ typedef GraphicControlModel UnoControlRoadmapModel_Base;
-typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory
- , ::com::sun::star::container::XContainer
- , ::com::sun::star::container::XIndexContainer
- > UnoControlRoadmapModel_IBase;
+ typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory
+ , ::com::sun::star::container::XContainer
+ , ::com::sun::star::container::XIndexContainer
+ > UnoControlRoadmapModel_IBase;
-typedef UnoControlBase UnoControlRoadmap_Base;
-typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XItemEventBroadcaster
- , ::com::sun::star::container::XContainerListener
- , ::com::sun::star::awt::XItemListener
- , ::com::sun::star::beans::XPropertyChangeListener
- > UnoControlRoadmap_IBase;
+ typedef UnoControlBase UnoControlRoadmap_Base;
+ typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XItemEventBroadcaster
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::awt::XItemListener
+ , ::com::sun::star::beans::XPropertyChangeListener
+ > UnoControlRoadmap_IBase;
-typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener,
- ::com::sun::star::awt::XItemEventBroadcaster> SVTXRoadmap_Base;
+ typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener,
+ ::com::sun::star::awt::XItemEventBroadcaster> SVTXRoadmap_Base;
-//........................................................................
-namespace toolkit{
-//........................................................................
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::lang;
@@ -110,7 +110,7 @@ namespace toolkit{
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlRoadmapModel();
+ UnoControlRoadmapModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlRoadmapModel( const UnoControlRoadmapModel& rModel ) :
UnoControlRoadmapModel_Base( rModel ),
UnoControlRoadmapModel_IBase( rModel ),
@@ -167,7 +167,7 @@ namespace toolkit{
private:
ItemListenerMultiplexer maItemListeners;
public:
- UnoRoadmapControl();
+ UnoRoadmapControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
diff --git a/toolkit/inc/toolkit/controls/spinningprogress.hxx b/toolkit/inc/toolkit/controls/spinningprogress.hxx
index b2e8204ca999..e0a676b2aa86 100755
--- a/toolkit/inc/toolkit/controls/spinningprogress.hxx
+++ b/toolkit/inc/toolkit/controls/spinningprogress.hxx
@@ -44,7 +44,7 @@ namespace toolkit
class SpinningProgressControlModel : public SpinningProgressControlModel_Base
{
public:
- SpinningProgressControlModel();
+ SpinningProgressControlModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource );
virtual UnoControlModel* Clone() const;
diff --git a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx
index 6861f4bc01bb..c7a2e3b8ef90 100644
--- a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx
+++ b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx
@@ -66,7 +66,7 @@ protected:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
public:
- UnoControlTabPageContainerModel();
+ UnoControlTabPageContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlTabPageContainerModel( const UnoControlTabPageContainerModel& rModel ) : UnoControlTabPageContainerModel_Base( rModel ),maContainerListeners( *this ) {;}
UnoControlModel* Clone() const { return new UnoControlTabPageContainerModel( *this ); }
@@ -113,7 +113,7 @@ typedef ::cppu::AggImplInheritanceHelper1 < ControlContainerBase
class UnoControlTabPageContainer : public UnoControlTabPageContainer_Base
{
public:
- UnoControlTabPageContainer();
+ UnoControlTabPageContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::lang::XComponent
diff --git a/toolkit/inc/toolkit/controls/tabpagemodel.hxx b/toolkit/inc/toolkit/controls/tabpagemodel.hxx
index 76edc2e68026..08938669fa58 100644
--- a/toolkit/inc/toolkit/controls/tabpagemodel.hxx
+++ b/toolkit/inc/toolkit/controls/tabpagemodel.hxx
@@ -93,12 +93,11 @@
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);
+ UnoControlTabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory);
// ::com::sun::star::io::XPersistObject
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
@@ -127,7 +126,7 @@ private:
bool m_bWindowListener;
public:
- UnoControlTabPage();
+ UnoControlTabPage( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
~UnoControlTabPage();
::rtl::OUString GetComponentServiceName();
diff --git a/toolkit/inc/toolkit/controls/tkscrollbar.hxx b/toolkit/inc/toolkit/controls/tkscrollbar.hxx
index 78795aa240c2..da3d97ab1bc2 100644
--- a/toolkit/inc/toolkit/controls/tkscrollbar.hxx
+++ b/toolkit/inc/toolkit/controls/tkscrollbar.hxx
@@ -50,7 +50,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlScrollBarModel();
+ UnoControlScrollBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlScrollBarModel( *this ); }
@@ -76,7 +76,7 @@ namespace toolkit
AdjustmentListenerMultiplexer maAdjustmentListeners;
public:
- UnoScrollBarControl();
+ UnoScrollBarControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoControlBase::queryInterface(rType); }
diff --git a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
index 1d059c749902..a0ddfc0dbf8d 100644
--- a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
+++ b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx
@@ -51,7 +51,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoSimpleAnimationControlModel();
+ UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoSimpleAnimationControlModel( const UnoSimpleAnimationControlModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoSimpleAnimationControlModel( *this ); }
@@ -80,7 +80,7 @@ namespace toolkit
private:
public:
- UnoSimpleAnimationControl();
+ UnoSimpleAnimationControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// XSimpleAnimation
diff --git a/toolkit/inc/toolkit/controls/tkspinbutton.hxx b/toolkit/inc/toolkit/controls/tkspinbutton.hxx
index 48c602f76cfc..7600c3e6f9e7 100644
--- a/toolkit/inc/toolkit/controls/tkspinbutton.hxx
+++ b/toolkit/inc/toolkit/controls/tkspinbutton.hxx
@@ -51,7 +51,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoSpinButtonModel();
+ UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoSpinButtonModel( const UnoSpinButtonModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoSpinButtonModel( *this ); }
@@ -82,7 +82,7 @@ namespace toolkit
AdjustmentListenerMultiplexer maAdjustmentListeners;
public:
- UnoSpinButtonControl();
+ UnoSpinButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
DECLARE_UNO3_AGG_DEFAULTS( UnoSpinButtonControl, UnoControlBase );
diff --git a/toolkit/inc/toolkit/controls/tkthrobber.hxx b/toolkit/inc/toolkit/controls/tkthrobber.hxx
index d6c3a3d8a511..1c149639fc47 100644
--- a/toolkit/inc/toolkit/controls/tkthrobber.hxx
+++ b/toolkit/inc/toolkit/controls/tkthrobber.hxx
@@ -51,7 +51,7 @@ namespace toolkit
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoThrobberControlModel();
+ UnoThrobberControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoThrobberControlModel( const UnoThrobberControlModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoThrobberControlModel( *this ); }
@@ -80,7 +80,7 @@ namespace toolkit
private:
public:
- UnoThrobberControl();
+ UnoThrobberControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
DECLARE_UNO3_AGG_DEFAULTS( UnoThrobberControl, UnoControlBase );
diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx
index 6bcfa519ed3d..44836ec28dd6 100644
--- a/toolkit/inc/toolkit/controls/unocontrol.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrol.hxx
@@ -49,6 +49,7 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/implbase9.hxx>
+#include <comphelper/componentcontext.hxx>
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
@@ -95,6 +96,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > mxVclWindowPeer; // just to avoid the query_interface thing
protected:
+ const ::comphelper::ComponentContext maContext;
EventListenerMultiplexer maDisposeListeners;
WindowListenerMultiplexer maWindowListeners;
FocusListenerMultiplexer maFocusListeners;
@@ -144,8 +146,11 @@ protected:
virtual sal_Bool requiresNewPeer( const ::rtl::OUString& _rPropertyName ) const;
-public:
+protected:
UnoControl();
+
+public:
+ UnoControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
~UnoControl();
UnoControlComponentInfos& GetComponentInfos() { return maComponentInfos; }
diff --git a/toolkit/inc/toolkit/controls/unocontrolbase.hxx b/toolkit/inc/toolkit/controls/unocontrolbase.hxx
index f12dd23a5c67..1ce56c11cec1 100644
--- a/toolkit/inc/toolkit/controls/unocontrolbase.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolbase.hxx
@@ -39,6 +39,14 @@
class TOOLKIT_DLLPUBLIC UnoControlBase : public UnoControl
{
protected:
+ UnoControlBase();
+
+protected:
+ UnoControlBase( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControl( i_factory )
+ {
+ }
+
sal_Bool ImplHasProperty( sal_uInt16 nProp );
sal_Bool ImplHasProperty( const ::rtl::OUString& aPropertyName );
void ImplSetPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue, sal_Bool bUpdateThis );
diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx
index 1175d0e85abb..dcba4fdcbf9a 100644
--- a/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx
@@ -64,8 +64,9 @@ protected:
void ImplActivateTabControllers();
public:
- UnoControlContainer();
- UnoControlContainer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer );
+ UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
+ UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xPeer );
~UnoControlContainer();
diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx
index ef0d9a4068ee..cdc908718988 100644
--- a/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx
@@ -45,7 +45,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlContainerModel();
+ UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlContainerModel( const UnoControlContainerModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlContainerModel( *this ); }
diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
index 5ac3c33aa1c9..bdb6e5d4bc68 100644
--- a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
@@ -44,6 +44,9 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/implbase7.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/uno3.hxx>
#include <list>
@@ -53,21 +56,25 @@ class ImplPropertyTable;
// class UnoControlModel
// ----------------------------------------------------
-class TOOLKIT_DLLPUBLIC UnoControlModel : public ::com::sun::star::awt::XControlModel,
- public ::com::sun::star::beans::XPropertyState,
- public ::com::sun::star::io::XPersistObject,
- public ::com::sun::star::lang::XComponent,
- public ::com::sun::star::lang::XServiceInfo,
- public ::com::sun::star::lang::XTypeProvider,
- public ::com::sun::star::lang::XUnoTunnel,
- public ::com::sun::star::util::XCloneable,
- public MutexAndBroadcastHelper,
- public ::cppu::OPropertySetHelper,
- public ::cppu::OWeakAggObject
+typedef ::cppu::WeakAggImplHelper7 < ::com::sun::star::awt::XControlModel
+ , ::com::sun::star::beans::XPropertyState
+ , ::com::sun::star::io::XPersistObject
+ , ::com::sun::star::lang::XComponent
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XUnoTunnel
+ , ::com::sun::star::util::XCloneable
+ > UnoControlModel_Base;
+
+class TOOLKIT_DLLPUBLIC UnoControlModel :public UnoControlModel_Base
+ ,public MutexAndBroadcastHelper
+ ,public ::cppu::OPropertySetHelper
{
private:
- ImplPropertyTable* mpData;
- EventListenerMultiplexer maDisposeListeners;
+ ImplPropertyTable* mpData;
+ EventListenerMultiplexer maDisposeListeners;
+
+protected:
+ const ::comphelper::ComponentContext maContext;
protected:
void ImplRegisterProperty( sal_uInt16 nPropType );
@@ -99,18 +106,21 @@ protected:
sal_Int32 _nSecondHandle /// second handle, which should supersede _nFirstHandle in the sequence
) const;
-public:
+protected:
UnoControlModel();
+public:
+ UnoControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlModel( const UnoControlModel& rModel );
~UnoControlModel();
virtual UnoControlModel* Clone() const = 0;
- // ::com::sun::star::uno::XAggregation
+ // ::com::sun::star::uno::XInterface
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); }
- void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
- void SAL_CALL release() throw() { OWeakAggObject::release(); }
+ void SAL_CALL acquire() throw();
+ void SAL_CALL release() throw();
+ // ::com::sun::star::uno::XAggregation
::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XUnoTunnel
@@ -122,10 +132,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw(::com::sun::star::uno::RuntimeException);
// ::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::XControlModel
+ DECLARE_XTYPEPROVIDER()
// ::com::sun::star::lang::XComponent
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx
index 21af6d2b45e6..09622d2c8ef8 100644
--- a/toolkit/inc/toolkit/controls/unocontrols.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrols.hxx
@@ -82,7 +82,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlEditModel();
+ UnoControlEditModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlEditModel( *this ); }
@@ -124,7 +124,7 @@ private:
public:
- UnoEditControl();
+ UnoEditControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
TextListenerMultiplexer& GetTextListeners() { return maTextListeners; }
@@ -185,7 +185,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFileControlModel();
+ UnoControlFileControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFileControlModel( *this ); }
@@ -206,7 +206,7 @@ public:
class UnoFileControl : public UnoEditControl
{
public:
- UnoFileControl();
+ UnoFileControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::lang::XServiceInfo
@@ -226,7 +226,12 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL );
protected:
- GraphicControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
+ GraphicControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
+ ,mbAdjustingImagePosition( false )
+ ,mbAdjustingGraphic( false )
+ {
+ }
GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
// ::cppu::OPropertySetHelper
@@ -242,14 +247,14 @@ private:
// ----------------------------------------------------
// class UnoControlButtonModel
// ----------------------------------------------------
-class UnoControlButtonModel : public GraphicControlModel
+class UnoControlButtonModel : public GraphicControlModel
{
protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlButtonModel();
+ UnoControlButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); }
@@ -282,7 +287,7 @@ private:
public:
- UnoButtonControl();
+ UnoButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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);
@@ -327,7 +332,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlImageControlModel();
+ UnoControlImageControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { }
UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); }
@@ -359,7 +364,7 @@ private:
public:
- UnoImageControlControl();
+ UnoImageControlControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
@@ -387,7 +392,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlRadioButtonModel();
+ UnoControlRadioButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); }
@@ -421,7 +426,7 @@ private:
public:
- UnoRadioButtonControl();
+ UnoRadioButtonControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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);
@@ -466,7 +471,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlCheckBoxModel();
+ UnoControlCheckBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); }
@@ -499,7 +504,7 @@ private:
public:
- UnoCheckBoxControl();
+ UnoCheckBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
~UnoCheckBoxControl(){;}
::rtl::OUString GetComponentServiceName();
@@ -547,7 +552,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFixedHyperlinkModel();
+ UnoControlFixedHyperlinkModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFixedHyperlinkModel( *this ); }
@@ -573,7 +578,7 @@ private:
ActionListenerMultiplexer maActionListeners;
public:
- UnoFixedHyperlinkControl();
+ UnoFixedHyperlinkControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
@@ -621,7 +626,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFixedTextModel();
+ UnoControlFixedTextModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFixedTextModel( *this ); }
@@ -645,7 +650,7 @@ class UnoFixedTextControl : public UnoControlBase,
public ::com::sun::star::awt::XLayoutConstrains
{
public:
- UnoFixedTextControl();
+ UnoFixedTextControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoControlBase::queryInterface(rType); }
@@ -686,7 +691,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlGroupBoxModel();
+ UnoControlGroupBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlGroupBoxModel( *this ); }
@@ -708,7 +713,7 @@ public:
class UnoGroupBoxControl : public UnoControlBase
{
public:
- UnoGroupBoxControl();
+ UnoGroupBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
@@ -725,12 +730,20 @@ struct UnoControlListBoxModel_Data;
typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
, ::com::sun::star::awt::XItemList
> UnoControlListBoxModel_Base;
-class TOOLKIT_DLLPUBLIC UnoControlListBoxModel :public UnoControlListBoxModel_Base
+class TOOLKIT_DLLPUBLIC UnoControlListBoxModel : public UnoControlListBoxModel_Base
{
protected:
- UnoControlListBoxModel(bool asComboBox);
+ enum ConstructorMode
+ {
+ ConstructDefault,
+ ConstructWithoutProperties
+ };
+
public:
- UnoControlListBoxModel();
+ UnoControlListBoxModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory,
+ ConstructorMode const i_mode = ConstructDefault
+ );
UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource );
~UnoControlListBoxModel();
@@ -828,7 +841,7 @@ typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase
class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base
{
public:
- UnoListBoxControl();
+ UnoListBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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);
@@ -908,7 +921,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlComboBoxModel();
+ UnoControlComboBoxModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); }
@@ -942,7 +955,7 @@ private:
public:
- UnoComboBoxControl();
+ UnoComboBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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);
@@ -1009,7 +1022,7 @@ private:
sal_Bool mbRepeat;
public:
- UnoSpinFieldControl();
+ UnoSpinFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); }
::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
@@ -1047,7 +1060,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlDateFieldModel();
+ UnoControlDateFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlDateFieldModel( *this ); }
@@ -1074,7 +1087,7 @@ private:
sal_Int32 mnLast;
sal_Bool mbLongFormat;
public:
- UnoDateFieldControl();
+ UnoDateFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoSpinFieldControl::queryInterface(rType); }
@@ -1123,7 +1136,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlTimeFieldModel();
+ UnoControlTimeFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlTimeFieldModel( *this ); }
@@ -1150,7 +1163,7 @@ private:
sal_Int32 mnLast;
public:
- UnoTimeFieldControl();
+ UnoTimeFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoSpinFieldControl::queryInterface(rType); }
@@ -1198,7 +1211,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlNumericFieldModel();
+ UnoControlNumericFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlNumericFieldModel( *this ); }
@@ -1225,7 +1238,7 @@ private:
double mnLast;
public:
- UnoNumericFieldControl();
+ UnoNumericFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoSpinFieldControl::queryInterface(rType); }
@@ -1275,7 +1288,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlCurrencyFieldModel();
+ UnoControlCurrencyFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlCurrencyFieldModel( *this ); }
@@ -1302,7 +1315,7 @@ private:
double mnLast;
public:
- UnoCurrencyFieldControl();
+ UnoCurrencyFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoSpinFieldControl::queryInterface(rType); }
@@ -1351,7 +1364,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlPatternFieldModel();
+ UnoControlPatternFieldModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlPatternFieldModel( *this ); }
@@ -1377,7 +1390,7 @@ protected:
void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
public:
- UnoPatternFieldControl();
+ UnoPatternFieldControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoSpinFieldControl::queryInterface(rType); }
@@ -1412,7 +1425,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlProgressBarModel();
+ UnoControlProgressBarModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlProgressBarModel( *this ); }
@@ -1434,7 +1447,7 @@ class UnoProgressBarControl : public UnoControlBase,
public ::com::sun::star::awt::XProgressBar
{
public:
- UnoProgressBarControl();
+ UnoProgressBarControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::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 UnoControlBase::queryInterface(rType); }
@@ -1468,7 +1481,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoControlFixedLineModel();
+ UnoControlFixedLineModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlFixedLineModel( *this ); }
@@ -1490,7 +1503,7 @@ public:
class UnoFixedLineControl : public UnoControlBase
{
public:
- UnoFixedLineControl();
+ UnoFixedLineControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx b/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
index 45e0bdf93dc4..4ae1dd17c62f 100644
--- a/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
+++ b/toolkit/inc/toolkit/helper/mutexandbroadcasthelper.hxx
@@ -39,7 +39,6 @@ class MutexAndBroadcastHelper
public:
MutexAndBroadcastHelper() : BrdcstHelper( Mutex ) {}
-
::osl::Mutex Mutex;
::cppu::OBroadcastHelper BrdcstHelper;
@@ -47,11 +46,6 @@ public:
::cppu::OBroadcastHelper& GetBroadcastHelper() { return BrdcstHelper; }
};
-
-
-
-
-
#endif // _TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx
index 082ac75bafae..c2d6380dcb65 100644
--- a/toolkit/inc/toolkit/helper/property.hxx
+++ b/toolkit/inc/toolkit/helper/property.hxx
@@ -177,7 +177,7 @@ namespace rtl {
#define BASEPROPERTY_TREE_ROOTDISPLAYED 127
#define BASEPROPERTY_TREE_SHOWSHANDLES 128
#define BASEPROPERTY_TREE_SHOWSROOTHANDLES 129
-#define BASEPROPERTY_TREE_ROWHEIGHT 130
+#define BASEPROPERTY_ROW_HEIGHT 130
#define BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING 131
#define BASEPROPERTY_TREE_END 131
#define BASEPROPERTY_DIALOGSOURCEURL 132
@@ -196,13 +196,16 @@ namespace rtl {
#define BASEPROPERTY_ENABLEVISIBLE 145 // sal_Bool
#define BASEPROPERTY_REFERENCE_DEVICE 146
#define BASEPROPERTY_HIGHCONTRASTMODE 147
-#define BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND 148
-#define BASEPROPERTY_GRID_HEADER_BACKGROUND 149
-#define BASEPROPERTY_GRID_LINE_COLOR 150
-#define BASEPROPERTY_GRID_ROW_BACKGROUND 151
+#define BASEPROPERTY_GRID_HEADER_BACKGROUND 148
+#define BASEPROPERTY_GRID_HEADER_TEXT_COLOR 149
+#define BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS 150
+#define BASEPROPERTY_GRID_LINE_COLOR 151
#define BASEPROPERTY_MULTISELECTION_SIMPLEMODE 152
#define BASEPROPERTY_ITEM_SEPARATOR_POS 153
#define BASEPROPERTY_AUTO_REPEAT 154
+#define BASEPROPERTY_ROW_HEADER_WIDTH 155
+#define BASEPROPERTY_COLUMN_HEADER_HEIGHT 156
+#define BASEPROPERTY_USE_GRID_LINES 157
// 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 1e5d394fb660..27949e9de791 100644
--- a/toolkit/inc/toolkit/helper/servicenames.hxx
+++ b/toolkit/inc/toolkit/helper/servicenames.hxx
@@ -97,6 +97,7 @@ extern const sal_Char __FAR_DATA szServiceName_GridControlModel[];
extern const sal_Char __FAR_DATA szServiceName_DefaultGridDataModel[];
extern const sal_Char __FAR_DATA szServiceName_DefaultGridColumnModel[];
extern const sal_Char __FAR_DATA szServiceName_GridColumn[];
+extern const sal_Char __FAR_DATA szServiceName_SortableGridDataModel[];
extern const sal_Char __FAR_DATA szServiceName_UnoSimpleAnimationControl[], szServiceName2_UnoSimpleAnimationControl[];
extern const sal_Char __FAR_DATA szServiceName_UnoSimpleAnimationControlModel[], szServiceName2_UnoSimpleAnimationControlModel[];
diff --git a/toolkit/prj/build.lst b/toolkit/prj/build.lst
index 7b6fd72c3ab0..e11d32c435bf 100644
--- a/toolkit/prj/build.lst
+++ b/toolkit/prj/build.lst
@@ -1,2 +1,3 @@
-ti toolkit : LIBXSLT:libxslt vcl NULL
-ti toolkit\prj nmake - all ti_prj NULL
+ti toolkit : LIBXSLT:libxslt vcl qadevOOo test NULL
+ti toolkit\prj nmake - all ti_prj NULL
+ti toolkit\qa\complex\toolkit nmake - all ti_complex_toolkit NULL
diff --git a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java
index cfb40614beab..d4f2329d8f31 100755
--- a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBar.java
+++ b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java
@@ -27,12 +27,15 @@
package complex.toolkit;
-// import complexlib.ComplexTestCase;
-import lib.TestParameters;
+import complex.toolkit.accessibility._XAccessibleEventBroadcaster;
+import complex.toolkit.accessibility._XAccessibleExtendedComponent;
+import complex.toolkit.accessibility._XAccessibleComponent;
+import complex.toolkit.accessibility._XAccessibleContext;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import util.SOfficeFactory;
import util.AccessibilityTools;
import com.sun.star.awt.XWindow;
-// import com.sun.star.chart.XChartDocument;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XServiceInfo;
@@ -45,11 +48,8 @@ import com.sun.star.accessibility.AccessibleRole;
import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.XExtendedToolkit;
-// import java.io.PrintWriter;
-// 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;
@@ -58,26 +58,12 @@ import static org.junit.Assert.*;
/**
*
*/
-public class CheckAccessibleStatusBar {
+public class AccessibleStatusBar {
XInterface testObject = null;
XMultiServiceFactory xMSF = null;
XWindow xWindow = null;
- /**
- * The test parameters
- */
- private static TestParameters param = null;
-
-// public String[] getTestMethodNames() {
-// return new String[]{"checkDocs"};//WriterDoc", "checkDrawDoc",
-//// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
-// }
-
-/* public String getTestObjectName() {
- return "com.sun.star.awt.AccessibleStatusBar";
- }
-*/
private XMultiServiceFactory getMSF()
{
final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
@@ -100,41 +86,13 @@ public class CheckAccessibleStatusBar {
/**
* Check document types
*/
- @Test public void checkDocs() {
- Object doc = param.get("DocType");
- String testDocType;
- if (doc == null)
- {
- testDocType = "all";
- }
- else
- {
- testDocType = (String)doc;
- }
-
- System.out.println("Param was " + doc);
- System.out.println("DocType " + testDocType);
- if (testDocType.equalsIgnoreCase("writer") || testDocType.equalsIgnoreCase("all"))
- {
- checkWriterDoc();
- }
- if (testDocType.equalsIgnoreCase("math") || testDocType.equalsIgnoreCase("all"))
- {
- checkMathDoc();
- }
- if (testDocType.equalsIgnoreCase("draw") || testDocType.equalsIgnoreCase("all"))
- {
- checkDrawDoc();
- }
- if (testDocType.equalsIgnoreCase("impress") || testDocType.equalsIgnoreCase("all"))
- {
- checkImpressDoc();
- }
- if (testDocType.equalsIgnoreCase("calc") || testDocType.equalsIgnoreCase("all"))
- {
- checkCalcDoc();
- }
-
+ @Test
+ public void checkDocs() {
+ checkWriterDoc();
+ checkMathDoc();
+ checkDrawDoc();
+ checkImpressDoc();
+ checkCalcDoc();
}
/**
@@ -150,7 +108,7 @@ public class CheckAccessibleStatusBar {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -160,7 +118,7 @@ public class CheckAccessibleStatusBar {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -178,7 +136,7 @@ public class CheckAccessibleStatusBar {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -188,7 +146,7 @@ public class CheckAccessibleStatusBar {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -206,7 +164,7 @@ public class CheckAccessibleStatusBar {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -216,7 +174,7 @@ public class CheckAccessibleStatusBar {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -234,7 +192,7 @@ public class CheckAccessibleStatusBar {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -244,7 +202,7 @@ public class CheckAccessibleStatusBar {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -262,7 +220,7 @@ public class CheckAccessibleStatusBar {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -272,7 +230,7 @@ public class CheckAccessibleStatusBar {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -287,12 +245,11 @@ public class CheckAccessibleStatusBar {
xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow());
shortWait();
- AccessibilityTools at = new AccessibilityTools();
- XAccessible xRoot = at.getAccessibleObject(xWindow);
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
XAccessibleContext parentContext = null;
System.out.println("Get the accessible status bar.");
- parentContext = at.getAccessibleObjectForRole(
+ parentContext = AccessibilityTools.getAccessibleObjectForRole(
xRoot, AccessibleRole.STATUS_BAR, "");
shortWait();
System.out.println("...OK.");
@@ -309,11 +266,11 @@ public class CheckAccessibleStatusBar {
testObject=parentContext;
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
catch(Throwable t) {
System.out.println("Got throwable:");
- t.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", t );
}
}
@@ -354,7 +311,7 @@ public class CheckAccessibleStatusBar {
System.out.println("*** Now testing XAccessibleEventBroadcaster ***");
_XAccessibleEventBroadcaster _xAccEvBcast =
- new _XAccessibleEventBroadcaster(testObject, "Pfff", xWindow);
+ new _XAccessibleEventBroadcaster(testObject, xWindow);
assertTrue("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
assertTrue("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
}
@@ -362,12 +319,14 @@ public class CheckAccessibleStatusBar {
- @BeforeClass public static void setUpConnection() throws Exception {
+ @BeforeClass
+ public static void setUpConnection() throws Exception {
System.out.println("setUpConnection()");
connection.setUp();
}
- @AfterClass public static void tearDownConnection()
+ @AfterClass
+ public static void tearDownConnection()
throws InterruptedException, com.sun.star.uno.Exception
{
System.out.println("tearDownConnection()");
diff --git a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java
index 537654c6aacc..edd84651d45e 100755
--- a/toolkit/qa/complex/toolkit/CheckAccessibleStatusBarItem.java
+++ b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java
@@ -27,14 +27,16 @@
package complex.toolkit;
-// import complexlib.ComplexTestCase;
-import lib.TestParameters;
-// import util.SOfficeFactory;
-// import complexlib.ComplexTestCase;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+import complex.toolkit.accessibility._XAccessibleEventBroadcaster;
+import complex.toolkit.accessibility._XAccessibleExtendedComponent;
+import complex.toolkit.accessibility._XAccessibleText;
+import complex.toolkit.accessibility._XAccessibleComponent;
+import complex.toolkit.accessibility._XAccessibleContext;
import util.SOfficeFactory;
import util.AccessibilityTools;
import com.sun.star.awt.XWindow;
-// import com.sun.star.chart.XChartDocument;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XServiceInfo;
@@ -47,12 +49,9 @@ import com.sun.star.accessibility.AccessibleRole;
import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.XExtendedToolkit;
-// import java.io.PrintWriter;
-// 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;
@@ -61,35 +60,17 @@ import static org.junit.Assert.*;
/**
*
*/
-public class CheckAccessibleStatusBarItem {
+public class AccessibleStatusBarItem {
XMultiServiceFactory xMSF = null;
XAccessibleContext testObject = null;
XWindow xWindow = null;
- /**
- * The test parameters
- */
- private static TestParameters param = null;
-
-// public String[] getTestMethodNames() {
-// return new String[]{"checkDocs"};//{"checkWriterDoc", "checkDrawDoc",
-//// "checkMathDoc", "checkImpressDoc", "checkCalcDoc"};
-// }
-
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- shortWait(500) ;
- }
-
/**
* Sleeps for a certain time.
* @param Thread is sleeping for this time in milliseconds.
*/
- private void shortWait(int time) {
+ private void shortWait() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
@@ -100,43 +81,14 @@ public class CheckAccessibleStatusBarItem {
/**
* Check document types
*/
- @Test public void checkDocs()
+ @Test
+ public void checkDocs()
{
- param = new TestParameters();
- Object doc = param.get("DocType");
- String testDocType;
- if (doc == null)
- {
- testDocType = "all";
- }
- else
- {
- testDocType = (String)doc;
- }
-
- System.out.println("Param was " + doc);
- System.out.println("DocType " + testDocType);
- if (testDocType.equalsIgnoreCase("writer") || testDocType.equalsIgnoreCase("all"))
- {
- checkWriterDoc();
- }
- if (testDocType.equalsIgnoreCase("math") || testDocType.equalsIgnoreCase("all"))
- {
- checkMathDoc();
- }
- if (testDocType.equalsIgnoreCase("draw") || testDocType.equalsIgnoreCase("all"))
- {
- checkDrawDoc();
- }
- if (testDocType.equalsIgnoreCase("impress") || testDocType.equalsIgnoreCase("all"))
- {
- checkImpressDoc();
- }
- if (testDocType.equalsIgnoreCase("calc") || testDocType.equalsIgnoreCase("all"))
- {
- checkCalcDoc();
- }
-
+ checkWriterDoc();
+ checkMathDoc();
+ checkDrawDoc();
+ checkImpressDoc();
+ checkCalcDoc();
}
private XMultiServiceFactory getMSF()
@@ -158,7 +110,7 @@ public class CheckAccessibleStatusBarItem {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -168,7 +120,7 @@ public class CheckAccessibleStatusBarItem {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -186,7 +138,7 @@ public class CheckAccessibleStatusBarItem {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -196,7 +148,7 @@ public class CheckAccessibleStatusBarItem {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -214,7 +166,7 @@ public class CheckAccessibleStatusBarItem {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -224,7 +176,7 @@ public class CheckAccessibleStatusBarItem {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -242,7 +194,7 @@ public class CheckAccessibleStatusBarItem {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -252,7 +204,7 @@ public class CheckAccessibleStatusBarItem {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -270,7 +222,7 @@ public class CheckAccessibleStatusBarItem {
getTestObject();
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
runAllInterfaceTests();
@@ -280,7 +232,7 @@ public class CheckAccessibleStatusBarItem {
xClose.close(false);
}
catch(com.sun.star.util.CloseVetoException e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
}
}
@@ -297,35 +249,25 @@ public class CheckAccessibleStatusBarItem {
XWindow.class,tk.getActiveTopWindow());
shortWait();
- AccessibilityTools at = new AccessibilityTools();
- XAccessible xRoot = at.getAccessibleObject(xWindow);
+ XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
XAccessibleContext parentContext = null;
System.out.println("Get the accessible status bar.");
- parentContext = at.getAccessibleObjectForRole(
+ parentContext = AccessibilityTools.getAccessibleObjectForRole(
xRoot, AccessibleRole.STATUS_BAR, "");
shortWait();
if ( parentContext == null ) {
- System.out.println("Could not get the test object: set the correct focus in the next 30 seconds.");
- shortWait(30000);
- parentContext = at.getAccessibleObjectForRole(
- xRoot, AccessibleRole.STATUS_BAR, "");
-
- if ( parentContext == null )
- {
- fail("Could not create a test object.");
- }
+ fail("Could not create a test object.");
}
System.out.println("...OK.");
testObject=parentContext;
}
catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", e );
}
catch(Throwable t) {
- System.out.println("Got throwable:");
- t.printStackTrace();
+ Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, "caught an exception", t );
}
}
@@ -391,7 +333,7 @@ public class CheckAccessibleStatusBarItem {
System.out.println("*** Now testing XAccessibleEventBroadcaster ***");
_XAccessibleEventBroadcaster _xAccEvBcast =
- new _XAccessibleEventBroadcaster(object, "Pfff", xWindow);
+ new _XAccessibleEventBroadcaster(object, xWindow);
assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener());
assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener());
diff --git a/toolkit/qa/complex/toolkit/Assert.java b/toolkit/qa/complex/toolkit/Assert.java
new file mode 100755
index 000000000000..93b1a2c490e1
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/Assert.java
@@ -0,0 +1,234 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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.toolkit;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import com.sun.star.uno.UnoRuntime;
+import static org.junit.Assert.*;
+
+/**
+ * provides assertion capabilities not found in {@link org.junit.Assert}
+ * @author frank.schoenheit@oracle.com
+ */
+public class Assert
+{
+ // --------------------------------------------------------------------------------------------------------
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_message
+ * is the message to print when the check fails
+ * @param i_object
+ * is the object to invoke the method on
+ * @param i_methodName
+ * is the name of the method to invoke
+ * @param i_methodArgs
+ * are the arguments to pass to the method.
+ * @param i_argClasses
+ * are the classes to assume for the arguments of the methods
+ * @param i_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.
+ */
+ public static void assertException( final String i_message, final Object i_object, final String i_methodName,
+ final Class[] i_argClasses, final Object[] i_methodArgs, final Class i_expectedExceptionClass )
+ {
+ Class objectClass = i_object.getClass();
+
+ boolean noExceptionAllowed = ( i_expectedExceptionClass == null );
+
+ boolean caughtExpected = noExceptionAllowed ? true : false;
+ try
+ {
+ Method method = impl_getMethod( objectClass, i_methodName, i_argClasses );
+ method.invoke(i_object, i_methodArgs );
+ }
+ catch ( NoSuchMethodException e )
+ {
+ StringBuilder message = new StringBuilder();
+ message.append( "no such method: " ).append( objectClass.getName() ).append( "." ).append( i_methodName ).append( "( " );
+ for ( int i=0; i<i_argClasses.length; ++i )
+ {
+ message.append( i_argClasses[i].getName() );
+ if ( i<i_argClasses.length - 1 )
+ message.append( ", " );
+ }
+ message.append( " )" );
+ fail( message.toString() );
+ }
+ catch ( InvocationTargetException e )
+ {
+ caughtExpected = noExceptionAllowed
+ ? false
+ : ( e.getTargetException().getClass().equals( i_expectedExceptionClass ) );
+ }
+ catch( Exception e )
+ {
+ caughtExpected = false;
+ }
+
+ assertTrue( i_message, caughtExpected );
+ }
+
+ /**
+ * retrieves a method, given by name and parameter signature, from the given class
+ *
+ * The method does somewhat more than simply calling {@link Class.getMethod}. In particular, it recognizes
+ * primitiive parameter types, and attempts to find a method taking the given primitive type, instead of the
+ * type represented by the parameter class.
+ *
+ * For instance, if you have a method <code>foo( int )</code>, {@link Class.getMethod} would not return this
+ * method when you pass <code>Integer.class</code>. <code>impl_getMethod</code> will recognize this, and
+ * properly retrieve the method.
+ *
+ * Note: <code>impl_getMethod</code> is limited in that it will not try all possible combinations of primitive
+ * and non-primitive types. That is, a method like <code>foo( int, Integer, int )</code> is likely to not be
+ * found.
+ *
+ * @param i_obbjectClass
+ * @param i_methodName
+ * @param i_argClasses
+ * @return
+ */
+ private static Method impl_getMethod( final Class i_objectClass, final String i_methodName, final Class[] i_argClasses ) throws NoSuchMethodException
+ {
+ try
+ {
+ return i_objectClass.getMethod( i_methodName, i_argClasses );
+ }
+ catch ( NoSuchMethodException ex )
+ {
+ }
+
+ int substitutedTypes = 0;
+ int substitutedTypesLastRound = 0;
+ final Class[][] substitutionTable = new Class[][] {
+ new Class[] { Long.class, long.class },
+ new Class[] { Integer.class, int.class },
+ new Class[] { Short.class, short.class },
+ new Class[] { Byte.class, byte.class },
+ new Class[] { Double.class, double.class },
+ new Class[] { Float.class, float.class },
+ new Class[] { Character.class, char.class }
+ };
+ do
+ {
+ substitutedTypes = 0;
+ final Class[] argClasses = new Class[ i_argClasses.length ];
+ for ( int i=0; i < argClasses.length; ++i )
+ {
+ argClasses[i] = i_argClasses[i];
+ if ( substitutedTypes > substitutedTypesLastRound )
+ continue;
+
+ for ( int c=0; c<substitutionTable.length; ++c )
+ {
+ if ( i_argClasses[i].equals( substitutionTable[c][0] ) )
+ {
+ argClasses[i] = substitutionTable[c][1];
+ ++substitutedTypes;
+ break;
+ }
+ }
+ }
+ if ( substitutedTypes == substitutedTypesLastRound )
+ throw new NoSuchMethodException();
+ substitutedTypesLastRound = substitutedTypes;
+
+ try
+ {
+ return i_objectClass.getMethod( i_methodName, argClasses );
+ }
+ catch ( NoSuchMethodException e )
+ {
+ }
+ }
+ while ( substitutedTypes > 0 );
+ throw new NoSuchMethodException();
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_message is the message to print when the check fails
+ * @param i_object is the object to invoke the method on
+ * @param i_methodName is the name of the method to invoke
+ * @param i_methodArgs are the arguments to pass to the method. Those implicitly define
+ * the classes of the arguments of the method which is called.
+ * @param i_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.
+ */
+ public static void assertException( final String i_message, final Object i_object, final String i_methodName,
+ final Object[] i_methodArgs, final Class i_expectedExceptionClass )
+ {
+ Class[] argClasses = new Class[ i_methodArgs.length ];
+ for ( int i=0; i<i_methodArgs.length; ++i )
+ argClasses[i] = i_methodArgs[i].getClass();
+ assertException( i_message, i_object, i_methodName, argClasses, i_methodArgs, i_expectedExceptionClass );
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_object is the object to invoke the method on
+ * @param i_methodName is the name of the method to invoke
+ * @param i_methodArgs are the arguments to pass to the method. Those implicitly define
+ * the classes of the arguments of the method which is called.
+ * @param i_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.
+ */
+ public static void assertException( final Object i_object, final String i_methodName, final Object[] i_methodArgs,
+ final Class i_expectedExceptionClass )
+ {
+ assertException(
+ "did not catch the expected exception (" +
+ ( ( i_expectedExceptionClass == null ) ? "none" : i_expectedExceptionClass.getName() ) +
+ ") while calling " + i_object.getClass().getName() + "." + i_methodName,
+ i_object, i_methodName, i_methodArgs, i_expectedExceptionClass );
+ }
+
+ /** invokes a given method on a given object, and assures a certain exception is caught
+ * @param i_object is the object to invoke the method on
+ * @param i_methodName is the name of the method to invoke
+ * @param i_methodArgs are the arguments to pass to the method
+ * @param i_argClasses are the classes to assume for the arguments of the methods
+ * @param i_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.
+ */
+ public static void assertException( final Object i_object, final String i_methodName, final Class[] i_argClasses,
+ final Object[] i_methodArgs, final Class i_expectedExceptionClass )
+ {
+ assertException(
+ "did not catch the expected exception (" +
+ ( ( i_expectedExceptionClass == null ) ? "none" : i_expectedExceptionClass.getName() ) +
+ ") while calling " + i_object.getClass().getName() + "." + i_methodName,
+ i_object, i_methodName, i_argClasses, i_methodArgs, i_expectedExceptionClass );
+ }
+
+ // --------------------------------------------------------------------------------------------------------
+ public static void assertException( Object i_object, Class _unoInterfaceClass, String i_methodName, Object[] i_methodArgs,
+ Class i_expectedExceptionClass )
+ {
+ assertException( UnoRuntime.queryInterface( _unoInterfaceClass, i_object ), i_methodName,
+ i_methodArgs, i_expectedExceptionClass );
+ }
+}
diff --git a/toolkit/qa/complex/toolkit/CallbackClass.java b/toolkit/qa/complex/toolkit/CallbackClass.java
deleted file mode 100644
index 1c9eb68a6d34..000000000000
--- a/toolkit/qa/complex/toolkit/CallbackClass.java
+++ /dev/null
@@ -1,67 +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.
- *
- ************************************************************************/
-
-package complex.toolkit;
-
-import com.sun.star.awt.XCallback;
-// import lib.MultiMethodTest;
-import com.sun.star.lang.XMultiServiceFactory;
-// import com.sun.star.uno.XInterface;
-// import com.sun.star.uno.UnoRuntime;
-// import share.LogWriter;
-
-/**
- * Testing <code>com.sun.star.awt.XRequestCallback</code>
- * interface methods :
- * <ul>
- * <li><code> addCallback()</code></li>
- * </ul> <p>
- * @see com.sun.star.awt.XRequestCallback
- */
-public class CallbackClass implements XCallback{
-
- // private LogWriter log;
-
- private XMultiServiceFactory xMSF;
-
-
- public CallbackClass(XMultiServiceFactory xMSF ) {
-
- this.xMSF = xMSF;
- // this.log = log;
- }
-
-
- /**
- * Callback method which will be called by the asynchronous
- * service where we have added our request before.
- */
- public void notify( Object aData ) {
-
- System.out.println("callback called successfully" );
- }
-}
diff --git a/toolkit/qa/complex/toolkit/CheckAsyncCallback.java b/toolkit/qa/complex/toolkit/CheckAsyncCallback.java
deleted file mode 100644
index 3a1e51729f11..000000000000
--- a/toolkit/qa/complex/toolkit/CheckAsyncCallback.java
+++ /dev/null
@@ -1,156 +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.
- *
- ************************************************************************/
-
-package complex.toolkit;
-
-// import complexlib.ComplexTestCase;
-import util.SOfficeFactory;
-// import complex.toolkit.CallbackClass;
-import com.sun.star.awt.XRequestCallback;
-import com.sun.star.lang.XMultiServiceFactory;
-// import com.sun.star.lang.XComponent;
-// import com.sun.star.lang.XServiceInfo;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-// import com.sun.star.awt.XExtendedToolkit;
-// import java.io.PrintWriter;
-
-// 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 CheckAsyncCallback /* extends ComplexTestCase*/ {
-
-
- XInterface testObject = null;
- XMultiServiceFactory xMSF = null;
-
-// public String[] getTestMethodNames() {
-// return new String[]{"checkService"};
-// }
-
-/* public String getTestObjectName() {
- return "com.sun.star.awt.AccessibleStatusBar";
- }
-*/
- private XMultiServiceFactory getMSF()
- {
- final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
- return xMSF1;
- }
-
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(500) ;
- } catch (InterruptedException e) {
- System.out.println("While waiting :" + e) ;
- }
- }
-
- /**
- * Check services
- */
- @Test public void checkService() {
- checkAsyncCallbackService();
-
- }
-
- /**
- * Test the interfaces
- */
- public void checkAsyncCallbackService() {
- runAllInterfaceTests();
- }
-
- public void getTestObject() {
- try {
- xMSF = getMSF();
- SOfficeFactory xSOF = SOfficeFactory.getFactory(xMSF);
-
- XRequestCallback xAsyncCallback = null;
-
- XInterface xIfc = (XInterface)xMSF.createInstance(
- "com.sun.star.awt.AsyncCallback" );
- xAsyncCallback = UnoRuntime.queryInterface(XRequestCallback.class, xIfc);
-
- testObject=xAsyncCallback;
- }
- catch(com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- catch(Throwable t) {
- System.out.println("Got throwable:");
- t.printStackTrace();
- }
- }
-
- public void runAllInterfaceTests() {
- getTestObject();
- System.out.println("*** Now testing XRequestCallback ***");
- _XRequestCallback _xRequestCallback =
- new _XRequestCallback(testObject, xMSF );
- assertTrue("failed: XRequestCallback::addCallback", _xRequestCallback._addCallback());
- }
-
- public void checkCallback() {
- getTestObject();
- System.out.println("*** Now testing asynchronous callback service ***");
- XRequestCallback xAsyncCallback = null;
- xAsyncCallback = UnoRuntime.queryInterface(XRequestCallback.class, testObject);
- CallbackClass aCallbackClass = new CallbackClass( xMSF );
- xAsyncCallback.addCallback( aCallbackClass, null );
- }
-
-
-
- @BeforeClass public static void setUpConnection() throws Exception {
- System.out.println("setUpConnection()");
- connection.setUp();
- }
-
- @AfterClass public static void tearDownConnection()
- throws InterruptedException, com.sun.star.uno.Exception
- {
- System.out.println("tearDownConnection()");
- connection.tearDown();
- }
-
- private static final OfficeConnection connection = new OfficeConnection();
-
-
-}
diff --git a/toolkit/qa/complex/toolkit/GridControl.java b/toolkit/qa/complex/toolkit/GridControl.java
new file mode 100755
index 000000000000..a06a52342417
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/GridControl.java
@@ -0,0 +1,687 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2011 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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.toolkit;
+
+import com.sun.star.awt.XControl;
+import com.sun.star.awt.XControlContainer;
+import com.sun.star.awt.XControlModel;
+import com.sun.star.awt.XToolkit;
+import com.sun.star.awt.grid.DefaultGridDataModel;
+import com.sun.star.awt.grid.XGridColumn;
+import com.sun.star.awt.grid.XGridColumnModel;
+import com.sun.star.awt.grid.XGridDataModel;
+import com.sun.star.awt.grid.XMutableGridDataModel;
+import com.sun.star.awt.grid.XSortableMutableGridDataModel;
+import com.sun.star.beans.Pair;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.ContainerEvent;
+import com.sun.star.container.XContainerListener;
+import com.sun.star.container.XNameContainer;
+import com.sun.star.lang.EventObject;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XEventListener;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloneable;
+import complex.toolkit.awtgrid.DummyColumn;
+import complex.toolkit.awtgrid.TMutableGridDataModel;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.openoffice.test.OfficeConnection;
+
+/** is a unit test for the grid control related implementations
+ * @author frank.schoenheit@sun.com
+ */
+public class GridControl
+{
+ // -----------------------------------------------------------------------------------------------------------------
+ public GridControl()
+ {
+ m_context = m_connection.getComponentContext();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static void impl_dispose( final Object... i_components )
+ {
+ for ( int i=0; i<i_components.length; ++i )
+ {
+ if ( i_components[i] != null )
+ {
+ final XComponent component = UnoRuntime.queryInterface( XComponent.class, i_components[i] );
+ component.dispose();
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_recreateGridModel() throws Exception
+ {
+ impl_dispose( m_gridControlModel, m_columnModel, m_dataModel );
+
+ // create a grid control model, and ensure it has a proper data and column model already
+ m_gridControlModel = UnoRuntime.queryInterface( XPropertySet.class,
+ createInstance( "com.sun.star.awt.grid.UnoControlGridModel" ) );
+ assertNotNull( "grid control model does not provide XPropertySet interface", m_gridControlModel );
+
+ // ensure that the model has default column/data models
+ m_columnModel = UnoRuntime.queryInterface( XGridColumnModel.class, m_gridControlModel.getPropertyValue( "ColumnModel" ) );
+ assertNotNull( "the control model is expected to have an initial column model", m_columnModel );
+ final XGridDataModel dataModel = UnoRuntime.queryInterface( XGridDataModel.class, m_gridControlModel.getPropertyValue( "GridDataModel" ) );
+ assertNotNull( "the control model is expected to have an initial data model", dataModel );
+ m_dataModel = UnoRuntime.queryInterface( XSortableMutableGridDataModel.class,
+ dataModel );
+ assertNotNull( "the out-of-the-box data model should be mutable and sortable", m_dataModel );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testGridControlCloning() throws Exception
+ {
+ impl_recreateGridModel();
+
+ // give the test something to compare, actually
+ XGridColumnModel columnModel = UnoRuntime.queryInterface( XGridColumnModel.class,
+ m_gridControlModel.getPropertyValue( "ColumnModel" ) );
+ columnModel.setDefaultColumns( 10 );
+
+ // clone the grid model
+ final XCloneable cloneable = UnoRuntime.queryInterface( XCloneable.class, m_gridControlModel );
+ assertNotNull( "all UnoControlModel's are expected to be cloneable", cloneable );
+
+ final XInterface clone = cloneable.createClone();
+ final XPropertySet clonedProps = UnoRuntime.queryInterface( XPropertySet.class, clone );
+
+ // TODO: check all those generic properties for equality
+
+ // the data model and the column model should have been cloned, too
+ // in particular, the clone should not share the sub models with the orignal
+ final XMutableGridDataModel originalDataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class,
+ m_gridControlModel.getPropertyValue( "GridDataModel" ) );
+ final XMutableGridDataModel clonedDataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class,
+ clonedProps.getPropertyValue( "GridDataModel" ) );
+ assertFalse( "data model should not be shared after cloning", UnoRuntime.areSame( originalDataModel, clonedDataModel ) );
+ impl_assertEquality( originalDataModel, clonedDataModel );
+
+ final XGridColumnModel originalColumnModel = columnModel;
+ final XGridColumnModel clonedColumnModel = UnoRuntime.queryInterface( XGridColumnModel.class,
+ clonedProps.getPropertyValue( "ColumnModel" ) );
+ assertFalse( "column model should not be shared after cloning", UnoRuntime.areSame( originalColumnModel, clonedColumnModel ) );
+ impl_assertEquality( originalColumnModel, clonedColumnModel );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testDisposal() throws Exception
+ {
+ impl_recreateGridModel();
+
+ final int columnCount = 3;
+ m_columnModel.setDefaultColumns( columnCount );
+
+ // add disposal listeners to all columns so far
+ final XGridColumn[] columns = m_columnModel.getColumns();
+ assertEquals( "creating default columns resulted in unexpected column count", columnCount, columns.length );
+ final DisposeListener[] columnListeners = new DisposeListener[columnCount];
+ for ( int i=0; i<columnCount; ++i )
+ columnListeners[i] = new DisposeListener( columns[i] );
+
+ // add another column, and check that upon removal, it is disposed
+ final int newColumnIndex = m_columnModel.addColumn( m_columnModel.createColumn() );
+ final DisposeListener columnListener = new DisposeListener( m_columnModel.getColumn( newColumnIndex ) );
+ m_columnModel.removeColumn( newColumnIndex );
+ assertTrue( "explicit column removal is expected to dispose the column", columnListener.isDisposed() );
+
+ // by definition, the grid control model is the owner of both the column and the data model. So, setting
+ // a new column/data model should implicitly dispose the old models
+ final DisposeListener oldDataModelListener = new DisposeListener( m_dataModel );
+ final DisposeListener oldColumnModelListener = new DisposeListener( m_columnModel );
+
+ final Object newDataModel = createInstance( "com.sun.star.awt.grid.DefaultGridDataModel" );
+ final Object newColumnModel = createInstance( "com.sun.star.awt.grid.DefaultGridColumnModel" );
+ final DisposeListener newDataModelListener = new DisposeListener( newDataModel );
+ final DisposeListener newColumnModelListener = new DisposeListener( newColumnModel );
+
+ m_gridControlModel.setPropertyValue( "GridDataModel", newDataModel );
+ assertTrue( "setting a new data model failed", impl_areSameInterface( newDataModel, m_gridControlModel.getPropertyValue( "GridDataModel" ) ) );
+ m_gridControlModel.setPropertyValue( "ColumnModel", newColumnModel );
+ assertTrue( "setting a new column model failed", impl_areSameInterface( newColumnModel, m_gridControlModel.getPropertyValue( "ColumnModel" ) ) );
+
+ assertTrue( "old data model has not been disposed", oldDataModelListener.isDisposed() );
+ assertTrue( "old column model has not been disposed", oldColumnModelListener.isDisposed() );
+ for ( int i=0; i<columnCount; ++i )
+ assertTrue( "column no. " + i + " has not been disposed", columnListeners[i].isDisposed() );
+
+ // the same holds if the grid control model itself is disposed - it should dispose the depending models, too
+ assertFalse( "new data model is already disposed - this is unexpected", newDataModelListener.isDisposed() );
+ assertFalse( "new column model is already disposed - this is unexpected", newColumnModelListener.isDisposed() );
+ impl_dispose( m_gridControlModel );
+ assertTrue( "new data model is not disposed after disposing the grid column model", newDataModelListener.isDisposed() );
+ assertTrue( "new column model is not disposed after disposing the grid column model", newColumnModelListener.isDisposed() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ /**
+ * tests various aspects of the <code>XMutableGridDataModel</code> interface
+ */
+ @Test
+ public void testMutableGridDataModel() throws Exception
+ {
+ impl_recreateGridModel();
+
+ TMutableGridDataModel test = new TMutableGridDataModel( m_dataModel );
+ test.testAddRow();
+ test.testAddRows();
+ test.testRemoveRow();
+ test.testRemoveAllRows();
+ test.testUpdateCellData();
+ test.testUpdateRowData();
+ test.testUpdateRowHeading();
+ test.cleanup();
+
+ // a somehwat less straight-forward test: the data model is expected to implicitly increase its column count
+ // when you add a row which has more columns than currently known
+ final XMutableGridDataModel dataModel = DefaultGridDataModel.create( m_context );
+ dataModel.addRow( 0, new Object[] { 1 } );
+ assertEquals( "unexpected column count after adding the most simple row", 1, dataModel.getColumnCount() );
+ dataModel.addRow( 1, new Object[] { 1, 2 } );
+ assertEquals( "implicit extension of the column count doesn't work", 2, dataModel.getColumnCount() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testGridColumnModel() throws Exception
+ {
+ impl_recreateGridModel();
+
+ ColumnModelListener listener = new ColumnModelListener();
+ m_columnModel.addContainerListener( listener );
+
+ // insert default columns into the previously empty model, ensure we get the right notifications
+ final int defaultColumnsCount = 3;
+ m_columnModel.setDefaultColumns( defaultColumnsCount );
+ impl_assertColumnModelConsistency();
+ List< ContainerEvent > events = listener.assertExclusiveInsertionEvents();
+ listener.reset();
+ assertEquals( "wrong number of events fired by setDefaulColumns", defaultColumnsCount, events.size() );
+ for ( int i=0; i<defaultColumnsCount; ++i )
+ {
+ final ContainerEvent event = events.get(i);
+ final int index = impl_assertInteger( event.Accessor );
+ assertEquals( "unexpected Accessor value in insert notification", i, index );
+ assertTrue( "wrong column object notified in insert notification",
+ impl_areSameInterface( event.Element, m_columnModel.getColumn(i) ) );
+ }
+
+ // insert some more default columns, ensure that all previously existing columns are removed
+ final int moreDefaultColumnsCount = 5;
+ m_columnModel.setDefaultColumns( moreDefaultColumnsCount );
+ impl_assertColumnModelConsistency();
+ assertEquals( "setting default columns is expected to remove all previously existing columns",
+ moreDefaultColumnsCount, m_columnModel.getColumnCount() );
+
+ // in this situation, both removal and insertion events have been notified
+ final List< ContainerEvent > removalEvents = listener.getRemovalEvents();
+ final List< ContainerEvent > insertionEvents = listener.getInsertionEvents();
+ listener.reset();
+
+ // for the removal events, check the indexes
+ assertEquals( "wrong number of columns removed (or notified) upon setting default columns",
+ defaultColumnsCount, removalEvents.size() );
+ for ( int i=0; i<removalEvents.size(); ++i )
+ {
+ final ContainerEvent event = removalEvents.get(i);
+ final int removedIndex = impl_assertInteger( event.Accessor );
+
+ // The implementation is allowed to remove the columns from the beginning, in which case the
+ // index of the removed column must always be 0, since e.g. the second column has index 0
+ // after the first column (which previously had index 0) had been removed.
+ // Alternatively, the implementation is allowed to remove columns from the end, which means
+ // that the column index given in the event is steadily increasing.
+ assertTrue( "unexpected column removal event column index",
+ ( removedIndex == 0 ) || ( removedIndex == removalEvents.size() - 1 - i ) );
+ }
+
+ // for the insertion events, check the indexes as well
+ assertEquals( "wrong number of insertion events when setting default columns over existing columns",
+ moreDefaultColumnsCount, insertionEvents.size() );
+ for ( int i=0; i<insertionEvents.size(); ++i )
+ {
+ final ContainerEvent event = insertionEvents.get(i);
+ final int index = impl_assertInteger( event.Accessor );
+ assertEquals( i, index );
+ }
+
+ // okay, remove all those columns
+ while ( m_columnModel.getColumnCount() != 0 )
+ {
+ final int columnCount = m_columnModel.getColumnCount();
+ final int removeColumnIndex = m_randomGenerator.nextInt( columnCount );
+ m_columnModel.removeColumn( removeColumnIndex );
+ events = listener.assertExclusiveRemovalEvents();
+ listener.reset();
+ assertEquals( "removing a single column should notify a single event", 1, events.size() );
+ final ContainerEvent event = events.get(0);
+ final int removalIndex = impl_assertInteger( event.Accessor );
+ assertEquals( "removing an arbitrary column does not notify the proper accessor",
+ removeColumnIndex, removalIndex );
+ }
+
+ // calling addColumn with a column not created by the given model/implementatoion should not succeed
+ boolean caughtExpected = false;
+ try
+ {
+ m_columnModel.addColumn( new DummyColumn() );
+ }
+ catch( final com.sun.star.lang.IllegalArgumentException e )
+ {
+ assertTrue( impl_areSameInterface( e.Context, m_columnModel ) );
+ caughtExpected = true;
+ }
+ assertTrue( "adding a dummy (self-implemented) grid column to the model should not succeed", caughtExpected );
+
+ // adding a single column to the end should succeed, properly notify, and still be consistent
+ final XGridColumn newColumn = m_columnModel.createColumn();
+ m_columnModel.addColumn( newColumn );
+ impl_assertColumnModelConsistency();
+ events = listener.assertExclusiveInsertionEvents();
+ listener.reset();
+ assertEquals( "addColumn notifies the wrong number of insertion events", 1, events.size() );
+ final int insertionIndex = impl_assertInteger( events.get(0).Accessor );
+ assertEquals( insertionIndex, newColumn.getIndex() );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testSortableDataModel() throws Exception
+ {
+ impl_recreateGridModel();
+
+ final int colCount = 3;
+ final int rowCount = 10;
+ // initialize with some data
+ final Object[][] data = new Object[][] {
+ new Object[] { 15, 17, 0 },
+ new Object[] { 9, 8, 14 },
+ new Object[] { 17, 2, 16 },
+ new Object[] { 0, 7, 14 },
+ new Object[] { 10, 16, 16 },
+ new Object[] { 2, 8, 10 },
+ new Object[] { 4, 8, 3 },
+ new Object[] { 7, 9, 0 },
+ new Object[] { 15, 6, 19 },
+ new Object[] { 2, 14, 19 }
+ };
+ final Object[] rowHeadings = new Object[] {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
+ };
+ // ensure consistency of the test data
+ assertEquals( rowHeadings.length, rowCount );
+ assertEquals( data.length, rowCount );
+ for ( Object[] rowData : data )
+ assertEquals( rowData.length, colCount );
+
+ // add the test data
+ m_dataModel.addRows( rowHeadings, data );
+ assertEquals( rowCount, m_dataModel.getRowCount() );
+ assertEquals( colCount, m_dataModel.getColumnCount() );
+
+ // sort by each column
+ for ( int colIndex = 0; colIndex < colCount; ++colIndex )
+ {
+ for ( boolean ascending : new boolean[] { true, false } )
+ {
+ m_dataModel.sortByColumn( colIndex, ascending );
+ Pair currentSortOrder = m_dataModel.getCurrentSortOrder();
+ assertEquals( "invalid current sort column (column " + colIndex + ")", ((Integer)currentSortOrder.First).intValue(), colIndex );
+ assertEquals( "invalid current sort direction", ((Boolean)currentSortOrder.Second).booleanValue(), ascending );
+
+ /*for ( int i=0; i<rowCount; ++i )
+ {
+ for ( int j=0; j<colCount; ++j )
+ System.out.print( m_dataModel.getCellData( j, i ).toString() + ", " );
+ System.out.println();
+ }*/
+
+ // verify the data is actually sorted by this column
+ for ( int rowIndex = 0; rowIndex < rowCount - 1; ++rowIndex )
+ {
+ final Object currentValue = m_dataModel.getCellData( colIndex, rowIndex );
+ final int currentIntValue = impl_assertInteger( currentValue );
+ final Object nextValue = m_dataModel.getCellData( colIndex, rowIndex + 1 );
+ final int nextIntValue = impl_assertInteger( nextValue );
+ assertTrue( "data in row " + rowIndex + " is actually not sorted " + ( ascending ? "ascending" : "descending" ),
+ ascending ? currentIntValue <= nextIntValue
+ : currentIntValue >= nextIntValue );
+
+ // ensure the data in the other columns, and the row headings, are sorted as well
+ final Object rowHeading = m_dataModel.getRowHeading( rowIndex );
+ final int unsortedRowIndex = impl_assertInteger( rowHeading );
+ for ( int innerColIndex = 0; innerColIndex < colCount; ++innerColIndex )
+ {
+ assertEquals( "sorted row " + rowIndex + ", unsorted row " + unsortedRowIndex + ", col " + innerColIndex +
+ ": wrong data",
+ data[unsortedRowIndex][innerColIndex], m_dataModel.getCellData( innerColIndex, rowIndex ) );
+ }
+ }
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @Test
+ public void testModelViewInteraction() throws Exception
+ {
+ final List< Object > disposables = new ArrayList< Object >();
+ try
+ {
+ // create a siple dialog model/control/peer trinity
+ final XControlModel dialogModel = createInstance( XControlModel.class, "com.sun.star.awt.UnoControlDialogModel" );
+ disposables.add( dialogModel );
+ final XPropertySet dialogProps = UnoRuntime.queryInterface( XPropertySet.class, dialogModel );
+ dialogProps.setPropertyValue( "Width", 200 );
+ dialogProps.setPropertyValue( "Height", 100 );
+ dialogProps.setPropertyValue( "Title", "Grid Control Unit Test" );
+ final XControl dialogControl = createInstance( XControl.class, "com.sun.star.awt.UnoControlDialog" );
+ disposables.add( dialogControl );
+ dialogControl.setModel( dialogModel );
+ dialogControl.createPeer( createInstance( XToolkit.class, "com.sun.star.awt.Toolkit" ), null );
+
+ // insert a grid control model
+ final XMultiServiceFactory controlModelFactory = UnoRuntime.queryInterface( XMultiServiceFactory.class,
+ dialogModel );
+ XPropertySet gridModelProps = UnoRuntime.queryInterface( XPropertySet.class,
+ controlModelFactory.createInstance( "com.sun.star.awt.grid.UnoControlGridModel" ) );
+ disposables.add( gridModelProps );
+ gridModelProps.setPropertyValue( "PositionX", 6 );
+ gridModelProps.setPropertyValue( "PositionY", 6 );
+ gridModelProps.setPropertyValue( "Width", 188 );
+ gridModelProps.setPropertyValue( "Height", 88 );
+ final XNameContainer modelContainer = UnoRuntime.queryInterface( XNameContainer.class, dialogModel );
+ modelContainer.insertByName( "grid", gridModelProps );
+
+ // check the respective control has been created
+ final XControlContainer controlContainer = UnoRuntime.queryInterface( XControlContainer.class, dialogControl );
+ final XControl gridControl = controlContainer.getControl( "grid" );
+ assertNotNull( "no grid control created in the dialog", gridControl );
+
+ // in the current implementation (not sure this is a good idea at all), the control (more precise: the peer)
+ // ensures that if there are no columns in the column model, but in the data model, then the column model
+ // will implicitly have the needed columns added.
+ // To ensure that clients which rely on this do not break in the future, check this here.
+ final XMutableGridDataModel dataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class,
+ gridModelProps.getPropertyValue( "GridDataModel" ) );
+ assertNotNull( dataModel );
+ assertEquals( 0, dataModel.getColumnCount() );
+
+ final XGridColumnModel columnModel = UnoRuntime.queryInterface( XGridColumnModel.class,
+ gridModelProps.getPropertyValue( "ColumnModel" ) );
+ assertNotNull( columnModel );
+ assertEquals( 0, columnModel.getColumnCount() );
+
+ dataModel.addRow( null, new Object[] { 1, 2, 3 } );
+ assertEquals( 3, dataModel.getColumnCount() );
+ assertEquals( 3, columnModel.getColumnCount() );
+ }
+ finally
+ {
+ impl_dispose( disposables.toArray());
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private int impl_assertInteger( final Object i_object )
+ {
+ assertTrue( i_object instanceof Integer );
+ return ((Integer)i_object).intValue();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertColumnModelConsistency() throws IndexOutOfBoundsException
+ {
+ for ( int col = 0; col < m_columnModel.getColumnCount(); ++col )
+ {
+ final XGridColumn column = m_columnModel.getColumn( col );
+ assertNotNull( column );
+ assertEquals( "column/model inconsistency: column " + col + " has a wrong index!", col, column.getIndex() );
+ }
+
+ final XGridColumn[] allColumns = m_columnModel.getColumns();
+ assertEquals( "getColumns returns the wrong number of column objects",
+ m_columnModel.getColumnCount(), allColumns.length );
+ for ( int col = 0; col < m_columnModel.getColumnCount(); ++col )
+ {
+ assertTrue( "getColumns inconsistency", impl_areSameInterface( allColumns[col], m_columnModel.getColumn(col) ) );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertEquality( final XGridDataModel i_reference, final XGridDataModel i_compare ) throws IndexOutOfBoundsException
+ {
+ assertNotNull( i_reference );
+ assertNotNull( i_compare );
+
+ assertEquals( "data model comparison: wrong column counts", i_reference.getColumnCount(), i_compare.getColumnCount() );
+ assertEquals( "data model comparison: wrong row counts", i_reference.getRowCount(), i_compare.getRowCount() );
+
+ for ( int row = 0; row < i_reference.getRowCount(); ++row )
+ {
+ assertEquals( "data model comparison: wrong row heading content in row " + row,
+ i_reference.getRowHeading( row ) );
+ for ( int col = 0; col < i_reference.getRowCount(); ++col )
+ {
+ assertEquals( "data model comparison: wrong cell content in cell (" + col + ", " + row + ")",
+ i_reference.getCellData( col, row ) );
+ assertEquals( "data model comparison: wrong tooltip content in cell (" + col + ", " + row + ")",
+ i_reference.getCellToolTip( col, row ) );
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertEquality( final XGridColumnModel i_reference, final XGridColumnModel i_compare ) throws IndexOutOfBoundsException
+ {
+ assertEquals( "column model comparison: wrong column counts", i_reference.getColumnCount(), i_compare.getColumnCount() );
+ for ( int col = 0; col < i_reference.getColumnCount(); ++col )
+ {
+ final XGridColumn referenceColumn = i_reference.getColumn( col );
+ final XGridColumn compareColumn = i_compare.getColumn( col );
+ impl_assertEquality( referenceColumn, compareColumn );
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private void impl_assertEquality( final XGridColumn i_reference, final XGridColumn i_compare )
+ {
+ final Method[] methods = XGridColumn.class.getMethods();
+ for ( int m=0; m<methods.length; ++m )
+ {
+ if ( !methods[m].getName().startsWith( "get" ) )
+ continue;
+ try
+ {
+ final Object referenceValue = methods[m].invoke( i_reference );
+ final Object compareValue = methods[m].invoke( i_compare );
+ assertEquals( "grid column comparison: column attribute '" + methods[m].getName().substring(3) + "' does not match",
+ referenceValue, compareValue );
+ }
+ catch ( java.lang.Exception ex )
+ {
+ fail( " could not retrieve object attributes: " + ex.toString() );
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private boolean impl_areSameInterface( final Object i_lhs, final Object i_rhs )
+ {
+ final XInterface lhs = UnoRuntime.queryInterface( XInterface.class, i_lhs );
+ final XInterface rhs = UnoRuntime.queryInterface( XInterface.class, i_rhs );
+ return UnoRuntime.areSame( lhs, rhs );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @BeforeClass
+ public static void setUpConnection() throws java.lang.Exception
+ {
+ System.out.println( "--------------------------------------------------------------------------------" );
+ System.out.println( "starting class: " + GridControl.class.getName() );
+ System.out.print( "connecting ... " );
+ m_connection.setUp();
+ System.out.println( "done.");
+
+ final long seed = m_randomGenerator.nextLong();
+ m_randomGenerator.setSeed( seed );
+ System.out.println( "seeding random number generator with " + seed );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ @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: " + GridControl.class.getName() );
+ System.out.println( "--------------------------------------------------------------------------------" );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ public <T> T createInstance( Class<T> i_interfaceClass, final String i_serviceIndentifer ) throws Exception
+ {
+ return UnoRuntime.queryInterface( i_interfaceClass, createInstance( i_serviceIndentifer ) );
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private Object createInstance( final String i_serviceName ) throws Exception
+ {
+ Object instance = m_context.getServiceManager().createInstanceWithContext( i_serviceName, m_context );
+ assertNotNull( "could not create an instance of '" + i_serviceName + "'", instance );
+ return instance;
+ }
+ // -----------------------------------------------------------------------------------------------------------------
+ private static final class DisposeListener implements XEventListener
+ {
+ DisposeListener( final Object i_component )
+ {
+ m_component = UnoRuntime.queryInterface( XComponent.class, i_component );
+ assertNotNull( m_component );
+ m_component.addEventListener( this );
+ }
+
+ public void disposing( EventObject i_event )
+ {
+ assertTrue( UnoRuntime.areSame( i_event.Source, m_component ) );
+ m_isDisposed = true;
+ }
+
+ final boolean isDisposed() { return m_isDisposed; }
+
+ private final XComponent m_component;
+ private boolean m_isDisposed;
+ };
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static final class ColumnModelListener implements XContainerListener
+ {
+ ColumnModelListener()
+ {
+ }
+
+ public void elementInserted( ContainerEvent i_event )
+ {
+ m_insertionEvents.add( i_event );
+ }
+
+ public void elementRemoved( ContainerEvent i_event )
+ {
+ m_removalEvents.add( i_event );
+ }
+
+ public void elementReplaced( ContainerEvent i_event )
+ {
+ m_replacementEvents.add( i_event );
+ }
+
+ public void disposing( EventObject eo )
+ {
+ m_isDisposed = true;
+ }
+
+ private List< ContainerEvent > assertExclusiveInsertionEvents()
+ {
+ assertFalse( m_insertionEvents.isEmpty() );
+ assertTrue( m_removalEvents.isEmpty() );
+ assertTrue( m_replacementEvents.isEmpty() );
+ return m_insertionEvents;
+ }
+
+ private List< ContainerEvent > assertExclusiveRemovalEvents()
+ {
+ assertTrue( m_insertionEvents.isEmpty() );
+ assertFalse( m_removalEvents.isEmpty() );
+ assertTrue( m_replacementEvents.isEmpty() );
+ return m_removalEvents;
+ }
+
+ private void reset()
+ {
+ m_insertionEvents = new ArrayList< ContainerEvent >();
+ m_removalEvents = new ArrayList< ContainerEvent >();
+ m_replacementEvents = new ArrayList< ContainerEvent >();
+ }
+
+ private List< ContainerEvent > getInsertionEvents() { return m_insertionEvents; }
+ private List< ContainerEvent > getRemovalEvents() { return m_removalEvents; }
+
+ final boolean isDisposed() { return m_isDisposed; }
+
+ private List< ContainerEvent > m_insertionEvents = new ArrayList< ContainerEvent >();
+ private List< ContainerEvent > m_removalEvents = new ArrayList< ContainerEvent >();
+ private List< ContainerEvent > m_replacementEvents = new ArrayList< ContainerEvent >();
+ private boolean m_isDisposed = false;
+ };
+
+ // -----------------------------------------------------------------------------------------------------------------
+ private static final OfficeConnection m_connection = new OfficeConnection();
+ private static Random m_randomGenerator = new Random();
+ private final XComponentContext m_context;
+
+ private XPropertySet m_gridControlModel;
+ private XGridColumnModel m_columnModel;
+ private XSortableMutableGridDataModel m_dataModel;
+}
diff --git a/toolkit/qa/complex/toolkit/UnitConversion.java b/toolkit/qa/complex/toolkit/UnitConversion.java
new file mode 100644
index 000000000000..b4cf8a8e1490
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/UnitConversion.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.toolkit;
+
+import com.sun.star.awt.XUnitConversion;
+import com.sun.star.uno.UnoRuntime;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.awt.XWindowPeer;
+
+import util.DesktopTools;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+/**
+ * This complex test is only for testing the com.sun.star.awt.XUnitConversion methods
+ * These are converter methods to get the size of a well known awt component
+ * in a com.sun.star.util.MeasureUnit you want.
+ * You don't need to know the factors to calculate by hand.
+ *
+ * @author ll93751
+ */
+public class UnitConversion
+{
+ /**
+ * returns the delta value between a and b
+ * @param a
+ * @param b
+ * @return
+ */
+ private int delta(int a, int b)
+ {
+ final int n = Math.abs(a - b);
+ return n;
+ }
+
+ private XUnitConversion m_xConversion = null;
+
+ /**
+ * Not really a check,
+ * only a simple test call to convertSizeToLogic(...) with different parameters
+ * @param _aSize
+ * @param _aMeasureUnit
+ * @param _sEinheit
+ */
+ private void checkSize(com.sun.star.awt.Size _aSize, short _aMeasureUnit, String _sEinheit)
+ {
+ try
+ {
+ com.sun.star.awt.Size aSizeIn = m_xConversion.convertSizeToLogic(_aSize, _aMeasureUnit);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeIn.Width + " " + _sEinheit);
+ System.out.println("Height:" + aSizeIn.Height + " " + _sEinheit);
+ System.out.println("");
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ System.out.println("Caught IllegalArgumentException in convertSizeToLogic with '" + _sEinheit + "' " + e.getMessage());
+ }
+ }
+
+ /**
+ * The real test function
+ * 1. try to get the XMultiServiceFactory of an already running office. Therefore make sure an (open|star)office is running with
+ * parameters like -accept="socket,host=localhost,port=8100;urp;"
+ * 2. try to create an empty window
+ * 3. try to convert the WindowPeer to an XWindow
+ * 4. try to resize and move the window to an other position, so we get a well knowing position and size.
+ * 5. run some more tests
+ *
+ * If no test fails, the test is well done and returns with 'PASSED, OK'
+ *
+ */
+ @Test
+ public void testXUnitConversion()
+ {
+ final XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+
+ assertNotNull("failed: There is no office.", xMSF);
+
+ // create a window
+ XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
+ assertNotNull("failed: there is no window peer", xWindowPeer);
+
+
+ // resize and move the window to a well known position and size
+ XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
+ assertNotNull("failed: there is no window, cast wrong?", xWindow);
+
+ xWindow.setVisible(Boolean.TRUE);
+
+ int x = 100;
+ int y = 100;
+ int width = 640;
+ int height = 480;
+ xWindow.setPosSize(x, y, width, height, com.sun.star.awt.PosSize.POSSIZE);
+
+ com.sun.star.awt.Rectangle aRect = xWindow.getPosSize();
+ com.sun.star.awt.Point aPoint = new com.sun.star.awt.Point(aRect.X, aRect.Y);
+ com.sun.star.awt.Size aSize = new com.sun.star.awt.Size(aRect.Width, aRect.Height);
+
+ System.out.println("Window position and size in pixel:");
+ System.out.println("X:" + aPoint.X);
+ System.out.println("Y:" + aPoint.Y);
+ System.out.println("Width:" + aSize.Width);
+ System.out.println("Height:" + aSize.Height);
+ System.out.println("");
+
+ assertTrue("Window pos size wrong", aSize.Width == width && aSize.Height == height && aPoint.X == x && aPoint.Y == y);
+
+ m_xConversion = UnoRuntime.queryInterface(XUnitConversion.class, xWindowPeer);
+
+ // try to get the position of the window in 1/100mm with the XUnitConversion method
+ try
+ {
+ com.sun.star.awt.Point aPointInMM_100TH = m_xConversion.convertPointToLogic(aPoint, com.sun.star.util.MeasureUnit.MM_100TH);
+ System.out.println("Window position:");
+ System.out.println("X:" + aPointInMM_100TH.X + " 1/100mm");
+ System.out.println("Y:" + aPointInMM_100TH.Y + " 1/100mm");
+ System.out.println("");
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ fail("failed: IllegalArgumentException caught in convertPointToLogic " + e.getMessage());
+ }
+
+ // try to get the size of the window in 1/100mm with the XUnitConversion method
+ com.sun.star.awt.Size aSizeInMM_100TH = null;
+ com.sun.star.awt.Size aSizeInMM_10TH = null;
+ try
+ {
+ aSizeInMM_100TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_100TH);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeInMM_100TH.Width + " 1/100mm");
+ System.out.println("Height:" + aSizeInMM_100TH.Height + " 1/100mm");
+ System.out.println("");
+
+ // try to get the size of the window in 1/10mm with the XUnitConversion method
+
+ aSizeInMM_10TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_10TH);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aSizeInMM_10TH.Width + " 1/10mm");
+ System.out.println("Height:" + aSizeInMM_10TH.Height + " 1/10mm");
+ System.out.println("");
+
+ // check the size with a delta which must be smaller a given difference
+ assertTrue("Size.Width not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10);
+ assertTrue("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10);
+
+ // new
+ checkSize(aSize, com.sun.star.util.MeasureUnit.PIXEL, "pixel");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.APPFONT, "appfont");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.SYSFONT, "sysfont");
+
+ // simply check some more parameters
+ checkSize(aSize, com.sun.star.util.MeasureUnit.MM, "mm");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.CM, "cm");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_1000TH, "1/1000inch");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_100TH, "1/100inch");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_10TH, "1/10inch");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.INCH, "inch");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.M, "m");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.POINT, "point");
+ checkSize(aSize, com.sun.star.util.MeasureUnit.TWIP, "twip");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.KM, "km");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.PICA, "pica");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.FOOT, "foot");
+ // checkSize(aSize, com.sun.star.util.MeasureUnit.MILE, "mile");
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ fail("failed: IllegalArgumentException caught in convertSizeToLogic " + e.getMessage());
+ }
+
+ // convert the 1/100mm window size back to pixel
+ try
+ {
+ com.sun.star.awt.Size aNewSize = m_xConversion.convertSizeToPixel(aSizeInMM_100TH, com.sun.star.util.MeasureUnit.MM_100TH);
+ System.out.println("Window size:");
+ System.out.println("Width:" + aNewSize.Width + " pixel");
+ System.out.println("Height:" + aNewSize.Height + " pixel");
+
+ // assure the pixels are the same as we already know
+ assertTrue("failed: Size from pixel to 1/100mm to pixel", aSize.Width == aNewSize.Width && aSize.Height == aNewSize.Height);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ fail("failed: IllegalArgumentException caught in convertSizeToPixel " + e.getMessage());
+ }
+
+ // close the window.
+ // IMHO a little bit stupid, but the XWindow doesn't support a XCloseable interface
+ xWindow.dispose();
+ }
+
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println( "--------------------------------------------------------------------------------" );
+ System.out.println( "starting class: " + UnitConversion.class.getName() );
+ System.out.println( "connecting ..." );
+ connection.setUp();
+ }
+
+ @AfterClass
+ public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println();
+ System.out.println( "tearing down connection" );
+ connection.tearDown();
+ System.out.println( "finished class: " + UnitConversion.class.getName() );
+ System.out.println( "--------------------------------------------------------------------------------" );
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/toolkit/qa/complex/toolkit/_XRequestCallback.java b/toolkit/qa/complex/toolkit/_XRequestCallback.java
deleted file mode 100644
index b9486c04c80a..000000000000
--- a/toolkit/qa/complex/toolkit/_XRequestCallback.java
+++ /dev/null
@@ -1,88 +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.
- *
- ************************************************************************/
-
-package complex.toolkit;
-
-import com.sun.star.awt.XRequestCallback;
-// import lib.MultiMethodTest;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import com.sun.star.uno.UnoRuntime;
-// import share.LogWriter;
-
-/**
- * Testing <code>com.sun.star.awt.XRequestCallback</code>
- * interface methods :
- * <ul>
- * <li><code> addCallback()</code></li>
- * </ul> <p>
- * @see com.sun.star.awt.XRequestCallback
- */
-public class _XRequestCallback {
-
- // private LogWriter log;
-
- private static final String className =
- "com.sun.star.awt.XRequestCallback" ;
-
- public XRequestCallback oObj = null;
- private XMultiServiceFactory xMSF;
-
- String text = null;
-
-
- public _XRequestCallback(XInterface object, XMultiServiceFactory xMSF ) {
- oObj = UnoRuntime.queryInterface(XRequestCallback.class, object);
- this.xMSF = xMSF;
- // this.log = log;
- }
-
-
- /**
- * Calls the method and checks returned value.
- * Has OK status if returned value is equal to <code>chCount - 1</code>.
- * The following method tests are to be executed before:
- * <ul>
- * <li> <code>addCallback()</code> </li>
- * </ul>
- * @return
- */
- public boolean _addCallback() {
-
- boolean res = true;
- try {
- Object a = new Object();
- oObj.addCallback( null, a );
- } catch (com.sun.star.uno.RuntimeException ie) {
- res = false;
- }
- System.out.println("addCallback called" );
-
- return res;
- }
-
-}
diff --git a/toolkit/qa/complex/toolkit/_XAccessibleComponent.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java
index ae3e293e50fc..7dca37ce18b7 100755
--- a/toolkit/qa/complex/toolkit/_XAccessibleComponent.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java
@@ -25,9 +25,8 @@
*
************************************************************************/
-package complex.toolkit;
+package complex.toolkit.accessibility;
-// import share.LogWriter;
import com.sun.star.awt.Point;
import com.sun.star.awt.Rectangle;
import com.sun.star.awt.Size;
diff --git a/toolkit/qa/complex/toolkit/_XAccessibleContext.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java
index de2928fdabe3..14debda92cd8 100755
--- a/toolkit/qa/complex/toolkit/_XAccessibleContext.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit;
+package complex.toolkit.accessibility;
import com.sun.star.lang.Locale;
import com.sun.star.uno.XInterface;
diff --git a/toolkit/qa/complex/toolkit/_XAccessibleEventBroadcaster.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java
index 899028daec87..535c7ce36c68 100755
--- a/toolkit/qa/complex/toolkit/_XAccessibleEventBroadcaster.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit;
+package complex.toolkit.accessibility;
import com.sun.star.lang.EventObject;
import com.sun.star.awt.Rectangle;
@@ -33,13 +33,11 @@ import com.sun.star.awt.PosSize;
import com.sun.star.awt.XWindow;
import com.sun.star.accessibility.AccessibleEventObject;
import com.sun.star.accessibility.XAccessible;
-// import com.sun.star.accessibility.XAccessibleComponent;
import com.sun.star.accessibility.XAccessibleEventBroadcaster;
import com.sun.star.accessibility.XAccessibleEventListener;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
-// import share.LogWriter;
/**
* Testing <code>
@@ -62,12 +60,7 @@ import com.sun.star.uno.UnoRuntime;
*/
public class _XAccessibleEventBroadcaster {
- // private LogWriter log;
- private static final String className =
- "com.sun.star.accessibility.XAccessibleEventBroadcaster" ;
-
public XAccessibleEventBroadcaster oObj = null;
- public String EventMsg = "";
EventProducer prod = null ;
EvListener list = new EvListener();
@@ -120,11 +113,9 @@ public class _XAccessibleEventBroadcaster {
* @param eventMessage
* @param window
*/
- public _XAccessibleEventBroadcaster(XInterface object, String eventMessage, XWindow window) {
+ public _XAccessibleEventBroadcaster(XInterface object, XWindow window) {
oObj = UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class, object);
- // this.log = log;
prod = new EventProducer(window);
- EventMsg = eventMessage;
}
/**
@@ -157,7 +148,6 @@ public class _XAccessibleEventBroadcaster {
oObj.removeEventListener(list);
}
-// System.out.println(EventMsg);
return works;
}
diff --git a/toolkit/qa/complex/toolkit/_XAccessibleExtendedComponent.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java
index 2ba5c190cf31..551b00acada7 100755
--- a/toolkit/qa/complex/toolkit/_XAccessibleExtendedComponent.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit;
+package complex.toolkit.accessibility;
// import lib.MultiMethodTest;
import com.sun.star.accessibility.XAccessibleExtendedComponent;
diff --git a/toolkit/qa/complex/toolkit/_XAccessibleText.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java
index 151e6b3f7d0b..a12d93a2d9e2 100755
--- a/toolkit/qa/complex/toolkit/_XAccessibleText.java
+++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java
@@ -25,7 +25,7 @@
*
************************************************************************/
-package complex.toolkit;
+package complex.toolkit.accessibility;
import com.sun.star.accessibility.XAccessibleText;
// import lib.MultiMethodTest;
diff --git a/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java b/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java
new file mode 100755
index 000000000000..11e4a4b19f80
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java
@@ -0,0 +1,180 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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.toolkit.awtgrid;
+
+import com.sun.star.awt.grid.XGridColumn;
+import com.sun.star.awt.grid.XGridColumnListener;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.XEventListener;
+import com.sun.star.style.HorizontalAlignment;
+import com.sun.star.util.XCloneable;
+
+/**
+ * a dummy implementation of css.awt.grid.XGridColumn
+ * @author frank.schoenheit@oracle.com
+ */
+public class DummyColumn implements XGridColumn
+{
+ public DummyColumn()
+ {
+ }
+
+ public Object getIdentifier()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setIdentifier( Object o )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getColumnWidth()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setColumnWidth( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getMinWidth()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setMinWidth( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getMaxWidth()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setMaxWidth( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public boolean getResizeable()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setResizeable( boolean bln )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getFlexibility()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setFlexibility( int i ) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public HorizontalAlignment getHorizontalAlign()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setHorizontalAlign( HorizontalAlignment ha )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public String getTitle()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setTitle( String string )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public String getHelpText()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setHelpText( String string )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getIndex()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public int getDataColumnIndex()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void setDataColumnIndex( int i )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void addGridColumnListener( XGridColumnListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void removeGridColumnListener( XGridColumnListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void dispose()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void addEventListener( XEventListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public void removeEventListener( XEventListener xl )
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ public XCloneable createClone()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+}
diff --git a/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java b/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java
new file mode 100755
index 000000000000..c31f27796cf1
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java
@@ -0,0 +1,98 @@
+package complex.toolkit.awtgrid;
+
+import com.sun.star.awt.grid.GridDataEvent;
+import com.sun.star.awt.grid.XGridDataListener;
+import com.sun.star.lang.EventObject;
+import static org.junit.Assert.*;
+
+final public class GridDataListener implements XGridDataListener
+{
+ public GridDataListener()
+ {
+ }
+
+ public void rowsInserted( GridDataEvent i_event )
+ {
+ assertNull( m_rowInsertionEvent );
+ m_rowInsertionEvent = i_event;
+ }
+
+ public void rowsRemoved( GridDataEvent i_event )
+ {
+ assertNull( m_rowRemovalEvent );
+ m_rowRemovalEvent = i_event;
+ }
+
+ public void dataChanged( GridDataEvent i_event )
+ {
+ assertNull( m_dataChangeEvent );
+ m_dataChangeEvent = i_event;
+ }
+
+ public void rowHeadingChanged( GridDataEvent i_event )
+ {
+ assertNull( m_rowHeadingChangeEvent );
+ m_rowHeadingChangeEvent = i_event;
+ }
+
+ public void disposing( EventObject eo )
+ {
+ m_disposed = true;
+ }
+
+ public final GridDataEvent assertSingleRowInsertionEvent()
+ {
+ assertNotNull( m_rowInsertionEvent );
+ assertNull( m_rowRemovalEvent );
+ assertNull( m_dataChangeEvent );
+ assertNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_rowInsertionEvent;
+ }
+
+ public final GridDataEvent assertSingleRowRemovalEvent()
+ {
+ assertNull( m_rowInsertionEvent );
+ assertNotNull( m_rowRemovalEvent );
+ assertNull( m_dataChangeEvent );
+ assertNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_rowRemovalEvent;
+ }
+
+ public final GridDataEvent assertSingleDataChangeEvent()
+ {
+ assertNull( m_rowInsertionEvent );
+ assertNull( m_rowRemovalEvent );
+ assertNotNull( m_dataChangeEvent );
+ assertNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_dataChangeEvent;
+ }
+
+ public final GridDataEvent assertSingleRowHeadingChangeEvent()
+ {
+ assertNull( m_rowInsertionEvent );
+ assertNull( m_rowRemovalEvent );
+ assertNull( m_dataChangeEvent );
+ assertNotNull( m_rowHeadingChangeEvent );
+ assertFalse( m_disposed );
+ return m_rowHeadingChangeEvent;
+ }
+
+ public final boolean isDisposed()
+ {
+ return m_disposed;
+ }
+
+ public final void reset()
+ {
+ m_rowInsertionEvent = m_rowRemovalEvent = m_dataChangeEvent = m_rowHeadingChangeEvent = null;
+ // m_disposed is not reset intentionally
+ }
+ private GridDataEvent m_rowInsertionEvent = null;
+ private GridDataEvent m_rowRemovalEvent = null;
+ private GridDataEvent m_dataChangeEvent = null;
+ private GridDataEvent m_rowHeadingChangeEvent = null;
+ private boolean m_disposed = false;
+}
diff --git a/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java
new file mode 100755
index 000000000000..c550dd9a047d
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java
@@ -0,0 +1,314 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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.toolkit.awtgrid;
+
+import java.lang.reflect.Method;
+import com.sun.star.awt.grid.GridDataEvent;
+import com.sun.star.awt.grid.XMutableGridDataModel;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.IndexOutOfBoundsException;
+import static org.junit.Assert.*;
+import static complex.toolkit.Assert.*;
+
+/** test for the <code>css.awt.grid.XMutableGridData</code> interface
+ *
+ * @author frank.schoenheit@oracle.com
+ */
+public class TMutableGridDataModel
+{
+ public TMutableGridDataModel( final XMutableGridDataModel i_dataModel )
+ {
+ m_dataModel = i_dataModel;
+
+ m_listener = new GridDataListener();
+ m_dataModel.addGridDataListener( m_listener );
+ }
+
+ /*
+ * tests the XMutableGridDataModel.addRow method
+ */
+ public void testAddRow() throws IndexOutOfBoundsException
+ {
+ m_dataModel.addRow( 1, m_rowValues[0] );
+ GridDataEvent event = m_listener.assertSingleRowInsertionEvent();
+ m_listener.reset();
+ assertEquals( "row insertion: wrong FirstRow (1)", 0, event.FirstRow );
+ assertEquals( "row insertion: wrong LastRow (1)", 0, event.LastRow );
+ impl_assertRowData( 0 );
+
+ m_dataModel.addRow( 2, m_rowValues[1] );
+ event = m_listener.assertSingleRowInsertionEvent();
+ m_listener.reset();
+ assertEquals( "row insertion: wrong FirstRow (2)", 1, event.FirstRow );
+ assertEquals( "row insertion: wrong LastRow (2)", 1, event.LastRow );
+ impl_assertRowData( 1 );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.addRows method
+ */
+ public void testAddRows() throws IndexOutOfBoundsException, IllegalArgumentException
+ {
+ assertEquals( "precondition not met: call this directly after testAddRow, please!", 2, m_dataModel.getRowCount() );
+
+ m_dataModel.addRows( new Object[] { "3", 4.0, "5" }, new Object[][] { m_rowValues[2], m_rowValues[3], m_rowValues[4] } );
+ GridDataEvent event = m_listener.assertSingleRowInsertionEvent();
+ assertEquals( "row insertion: wrong FirstRow (1)", 2, event.FirstRow );
+ assertEquals( "row insertion: wrong LastRow (1)", 4, event.LastRow );
+ m_listener.reset();
+
+ assertEquals( "data model's row count is not adjusted when adding rows", m_rowValues.length, m_dataModel.getRowCount() );
+ assertEquals( "data model's column count is not adjusted when adding rows", m_rowValues[0].length, m_dataModel.getColumnCount() );
+ for ( int row=0; row<m_rowValues.length; ++row )
+ {
+ for ( int col=0; col<m_rowValues[row].length; ++col )
+ {
+ assertEquals( "added row values are not preserved",
+ m_rowValues[row][col], m_dataModel.getCellData( col, row ) );
+ }
+ }
+
+ assertException( "addRows is expected to throw when invoked with different-sized arrays",
+ m_dataModel, "addRows", new Object[] { new Object[0], new Object[1][2] }, IllegalArgumentException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.removeRow method
+ */
+ public void testRemoveRow() throws IndexOutOfBoundsException
+ {
+ assertEquals( "precondition not met: call this directly after testAddRows, please!", m_rowValues.length, m_dataModel.getRowCount() );
+
+ final int rowToRemove = 2;
+ m_dataModel.removeRow( rowToRemove );
+ GridDataEvent event = m_listener.assertSingleRowRemovalEvent();
+ assertEquals( "incorrect notification of row removal (FirstRow)", rowToRemove, event.FirstRow );
+ assertEquals( "incorrect notification of row removal (LastRow)", rowToRemove, event.LastRow );
+ m_listener.reset();
+
+ assertEquals( "data model's row count does not reflect the removed row", m_rowValues.length - 1, m_dataModel.getRowCount() );
+ for ( int row = rowToRemove; row<m_rowValues.length-1; ++row )
+ {
+ for ( int col=0; col<m_rowValues[row].length; ++col )
+ {
+ assertEquals( "unexpected row values after removing a row (col: " + col + ", row: " + row + ")",
+ m_rowValues[row+1][col], m_dataModel.getCellData( col, row ) );
+ }
+ }
+
+ assertException( "removeRow silently ignores an invalid index (1)",
+ m_dataModel, "removeRow", new Object[] { -1 }, IndexOutOfBoundsException.class );
+ assertException( "removeRow silently ignores an invalid index (2)",
+ m_dataModel, "removeRow", new Object[] { m_dataModel.getRowCount() }, IndexOutOfBoundsException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.removeAllRows method
+ */
+ public void testRemoveAllRows()
+ {
+ assertEquals( "precondition not met: call this directly after testRemoveRow, please!", m_rowValues.length - 1, m_dataModel.getRowCount() );
+
+ m_dataModel.removeAllRows();
+ final GridDataEvent event = m_listener.assertSingleRowRemovalEvent();
+ if ( event.FirstRow != -1 )
+ { // notifying "-1" is allowed, this means "all rows affected", by definition
+ assertEquals( "removeAllRows is not notifying properly (1)", 0, event.FirstRow );
+ assertEquals( "removeAllRows is not notifying properly (2)", m_rowValues.length - 1, event.LastRow );
+ }
+ m_listener.reset();
+ }
+
+ /**
+ * tests the XMutableGridDataModel.updateCellData method
+ */
+ public void testUpdateCellData() throws IndexOutOfBoundsException, IllegalArgumentException
+ {
+ assertEquals( "precondition not met: call this directly after testRemoveAllRows, please!", 0, m_dataModel.getRowCount() );
+
+ m_dataModel.addRows( new Object[] { 1, 2, 3, 4, 5 }, m_rowValues );
+ m_listener.assertSingleRowInsertionEvent();
+ m_listener.reset();
+
+ final Object[][] modifyValues = new Object[][] {
+ new Object[] { 2, 1, "text" },
+ new Object[] { 3, 0, null },
+ new Object[] { 0, 4, new Double( 33.0 ) }
+ };
+ for ( int i = 0; i < modifyValues.length; ++i )
+ {
+ final int row = ((Integer)modifyValues[i][0]).intValue();
+ final int col = ((Integer)modifyValues[i][1]).intValue();
+ final Object value = modifyValues[i][2];
+ m_dataModel.updateCellData( col, row, value );
+
+ final GridDataEvent event = m_listener.assertSingleDataChangeEvent();
+ assertEquals( "data change notification: FirstRow is invalid", row, event.FirstRow );
+ assertEquals( "data change notification: LastRow is invalid", row, event.LastRow );
+ assertEquals( "data change notification: FirstColumn is invalid", col, event.FirstColumn );
+ assertEquals( "data change notification: LastColumn is invalid", col, event.LastColumn );
+ m_listener.reset();
+
+ assertEquals( "data change at (" + col + ", " + row + ") not successful", value, m_dataModel.getCellData( col, row ) );
+ }
+
+ assertException( "updateCellData silently ignores an invalid index (1)",
+ m_dataModel, "updateCellData", new Class[] { int.class, int.class, Object.class },
+ new Object[] { -1, -1, "text" }, IndexOutOfBoundsException.class );
+ assertException( "updateCellData silently ignores an invalid index (2)",
+ m_dataModel, "updateCellData", new Class[] { int.class, int.class, Object.class },
+ new Object[] { 0, m_dataModel.getRowCount(), "text" }, IndexOutOfBoundsException.class );
+ assertException( "updateCellData silently ignores an invalid index (3)",
+ m_dataModel, "updateCellData", new Class[] { int.class, int.class, Object.class },
+ new Object[] { m_dataModel.getColumnCount(), 0, "text" }, IndexOutOfBoundsException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.updateRowData method
+ */
+ public void testUpdateRowData() throws IndexOutOfBoundsException, IllegalArgumentException
+ {
+ assertEquals( "precondition not met: call this directly after testRemoveAllRows, please!", m_rowValues.length, m_dataModel.getRowCount() );
+
+ // get data from before the update
+ final Object[][] preUpdateValues = impl_getCurrentData();
+
+ // do the update
+ final int[] colIndexes = new int[] {
+ 0, 3, 4
+ };
+ final Object[] values = new Object[] {
+ 13, null, 42.0
+ };
+ final int rowToUpdate = 2;
+ m_dataModel.updateRowData( colIndexes, rowToUpdate, values );
+ final GridDataEvent event = m_listener.assertSingleDataChangeEvent();
+ assertEquals( "row update notification: FirstRow is invalid", rowToUpdate, event.FirstRow );
+ assertEquals( "row update notification: LastRow is invalid", rowToUpdate, event.LastRow );
+ assertEquals( "row update notification: FirstColumn is invalid", 0, event.FirstColumn );
+ assertEquals( "row update notification: LastColumn is invalid", 4, event.LastColumn );
+ m_listener.reset();
+
+ // reflect the changes made in the pre-update data
+ for ( int i=0; i<colIndexes.length; ++i )
+ {
+ preUpdateValues[rowToUpdate][colIndexes[i]] = values[i];
+ }
+
+ // get data from after the update
+ final Object[][] postUpdateValues = impl_getCurrentData();
+
+ // ensure both the manually updated pre-update data and the post-update data are identical
+ assertArrayEquals( preUpdateValues, postUpdateValues );
+
+
+ assertException( "updateRowData silently ignores an invalid index (1)",
+ m_dataModel, "updateRowData", new Class[] { int[].class, int.class, Object[].class },
+ new Object[] { new int[] { -1 }, 0, new Object[] { "text" } }, IndexOutOfBoundsException.class );
+ assertException( "updateRowData silently ignores an invalid index (2)",
+ m_dataModel, "updateRowData", new Class[] { int[].class, int.class, Object[].class },
+ new Object[] { new int[] { 0 }, -1, new Object[] { "" } }, IndexOutOfBoundsException.class );
+ assertException( "updateRowData silently ignores different-sized arrays",
+ m_dataModel, "updateRowData", new Class[] { int[].class, int.class, Object[].class },
+ new Object[] { new int[] { 0, 0 }, 0, new Object[] { "" } }, IllegalArgumentException.class );
+ }
+
+ /**
+ * tests the XMutableGridDataModel.updateRowHeading method
+ */
+ public void testUpdateRowHeading() throws IndexOutOfBoundsException
+ {
+ assertEquals( "precondition not met: call this directly after testUpdateRowData, please!", m_rowValues.length, m_dataModel.getRowCount() );
+
+ final Object[] preUpdateHeadings = impl_getCurrentRowHeadings();
+
+ final int rowToUpdate = 2;
+ final String valueToUpdate = "some text";
+ m_dataModel.updateRowHeading( rowToUpdate, valueToUpdate );
+ final GridDataEvent event = m_listener.assertSingleRowHeadingChangeEvent();
+ assertEquals( "row heading update notification: FirstRow is invalid", rowToUpdate, event.FirstRow );
+ assertEquals( "row heading update notification: FirstRow is invalid", rowToUpdate, event.LastRow );
+ m_listener.reset();
+
+ preUpdateHeadings[rowToUpdate] = valueToUpdate;
+
+ final Object[] postUpdateHeadings = impl_getCurrentRowHeadings();
+ assertArrayEquals( preUpdateHeadings, postUpdateHeadings );
+
+ assertException( "updateRowHeading silently ignores an invalid index",
+ m_dataModel, "updateRowHeading", new Class[] { int.class, Object.class },
+ new Object[] { -1, "" }, IndexOutOfBoundsException.class );
+ }
+
+ public void cleanup()
+ {
+ m_dataModel.removeGridDataListener( m_listener );
+ }
+
+ private Object[][] impl_getCurrentData() throws IndexOutOfBoundsException
+ {
+ final int rowCount = m_dataModel.getRowCount();
+ final int colCount = m_dataModel.getColumnCount();
+ final Object[][] data = new Object[rowCount][colCount];
+ for ( int row=0; row<rowCount; ++row )
+ {
+ for ( int col=0; col<colCount; ++col )
+ {
+ data[row][col] = m_dataModel.getCellData( col, row );
+ }
+ }
+ return data;
+ }
+
+ private Object[] impl_getCurrentRowHeadings() throws IndexOutOfBoundsException
+ {
+ final int rowCount = m_dataModel.getRowCount();
+ final Object[] headings = new Object[rowCount];
+ for ( int row=0; row<rowCount; ++row )
+ headings[row] = m_dataModel.getRowHeading( row );
+ return headings;
+ }
+
+ private void impl_assertRowData( final int i_rowIndex ) throws IndexOutOfBoundsException
+ {
+ for ( int i=0; i<m_rowValues[i_rowIndex].length; ++i )
+ {
+ assertEquals( m_rowValues[i_rowIndex][i], m_dataModel.getCellData( i, i_rowIndex ) );
+ }
+ }
+
+ private final XMutableGridDataModel m_dataModel;
+ private final GridDataListener m_listener;
+
+ private final static Object[][] m_rowValues = new Object[][] {
+ new Object[] { 1, 2, "3", 4, 5 },
+ new Object[] { 2, 3, 4, "5", 6 },
+ new Object[] { "3", 4, 5, 6, 7 },
+ new Object[] { 4, 5, 6, 7, "8" },
+ new Object[] { 5, "6", 7, 8, 9 },
+ };
+}
diff --git a/toolkit/qa/complex/toolkit/makefile.mk b/toolkit/qa/complex/toolkit/makefile.mk
new file mode 100755
index 000000000000..ecb173f9bdac
--- /dev/null
+++ b/toolkit/qa/complex/toolkit/makefile.mk
@@ -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.
+#
+#*************************************************************************
+
+.IF "$(OOO_JUNIT_JAR)" == ""
+nothing .PHONY:
+ @echo -----------------------------------------------------
+ @echo - JUnit not available, not building anything
+ @echo -----------------------------------------------------
+.ELSE # IF "$(OOO_JUNIT_JAR)" != ""
+
+PRJ = ../../..
+PRJNAME = toolkit
+TARGET = qa_complex_toolkit
+PACKAGE = complex/toolkit
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = OOoRunnerLight.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+
+JAVAFILES = \
+ $(JAVATESTFILES) \
+ accessibility/_XAccessibleComponent.java \
+ accessibility/_XAccessibleContext.java \
+ accessibility/_XAccessibleEventBroadcaster.java \
+ accessibility/_XAccessibleExtendedComponent.java \
+ accessibility/_XAccessibleText.java \
+ Assert.java \
+ awtgrid/GridDataListener.java \
+ awtgrid/TMutableGridDataModel.java \
+ awtgrid/DummyColumn.java \
+
+#----- create a jar from compiled files ----------------------------
+
+JARTARGET = $(TARGET).jar
+
+#----- JUnit tests class -------------------------------------------
+
+JAVATESTFILES = \
+ GridControl.java \
+ UnitConversion.java \
+
+
+# disabled for now - the tests fail on at least one platform
+# no issue, yet (not sure this is worth it. Don't know who to give the issue to, and don't know whether the test really makes sense)
+DISABLED_JAVA_TEST_FILES=\
+ AccessibleStatusBar.java\
+ AccessibleStatusBarItem.java
+
+
+# --- Targets ------------------------------------------------------
+
+.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
+
+.END # "$(OOO_SUBSEQUENT_TESTS)" == ""
+
+.END # ELSE "$(OOO_JUNIT_JAR)" != ""
diff --git a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java b/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java
deleted file mode 100644
index f9840e4bde6f..000000000000
--- a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java
+++ /dev/null
@@ -1,250 +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.
- *
- ************************************************************************/
-
-package complex.xunitconversion;
-
-import com.sun.star.awt.XUnitConversion;
-import com.sun.star.uno.UnoRuntime;
-
-import com.sun.star.awt.XWindow;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.awt.XWindowPeer;
-
-import util.DesktopTools;
-
-// 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.*;
-
-/**
- * This complex test is only for testing the com.sun.star.awt.XUnitConversion methods
- * These are converter methods to get the size of a well known awt component
- * in a com.sun.star.util.MeasureUnit you want.
- * You don't need to know the factors to calculate by hand.
- *
- * @author ll93751
- */
-public class XUnitConversionTest
-{
-// public String[] getTestMethodNames()
-// {
-// return new String[]{"testXUnitConversion"}; // function name of the test method
-// }
-
- /**
- * returns the delta value between a and b
- * @param a
- * @param b
- * @return
- */
- private int delta(int a, int b)
- {
- final int n = Math.abs(a - b);
- return n;
- }
-
- private XUnitConversion m_xConversion = null;
-
- /**
- * Not really a check,
- * only a simple test call to convertSizeToLogic(...) with different parameters
- * @param _aSize
- * @param _aMeasureUnit
- * @param _sEinheit
- */
- private void checkSize(com.sun.star.awt.Size _aSize, short _aMeasureUnit, String _sEinheit)
- {
- try
- {
- com.sun.star.awt.Size aSizeIn = m_xConversion.convertSizeToLogic(_aSize, _aMeasureUnit);
- System.out.println("Window size:");
- System.out.println("Width:" + aSizeIn.Width + " " + _sEinheit);
- System.out.println("Height:" + aSizeIn.Height + " " + _sEinheit);
- System.out.println("");
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- System.out.println("Caught IllegalArgumentException in convertSizeToLogic with '" + _sEinheit + "' " + e.getMessage());
- }
- }
-
-/**
- * The real test function
- * 1. try to get the XMultiServiceFactory of an already running office. Therefore make sure an (open|star)office is running with
- * parameters like -accept="socket,host=localhost,port=8100;urp;"
- * 2. try to create an empty window
- * 3. try to convert the WindowPeer to an XWindow
- * 4. try to resize and move the window to an other position, so we get a well knowing position and size.
- * 5. run some more tests
- *
- * If no test fails, the test is well done and returns with 'PASSED, OK'
- *
- */
- @Test public void testXUnitConversion()
- {
- // XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
- final XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
-
- assertNotNull("failed: There is no office.", xMSF);
-
- // create a window
- XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
- assertNotNull("failed: there is no window peer", xWindowPeer);
-
-
- // resize and move the window to a well known position and size
- XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
- assertNotNull("failed: there is no window, cast wrong?", xWindow);
-
- xWindow.setVisible(Boolean.TRUE);
-
- int x = 100;
- int y = 100;
- int width = 640;
- int height = 480;
- xWindow.setPosSize(x, y, width, height, com.sun.star.awt.PosSize.POSSIZE);
-
- com.sun.star.awt.Rectangle aRect = xWindow.getPosSize();
- com.sun.star.awt.Point aPoint = new com.sun.star.awt.Point(aRect.X, aRect.Y);
- com.sun.star.awt.Size aSize = new com.sun.star.awt.Size(aRect.Width, aRect.Height);
-
- System.out.println("Window position and size in pixel:");
- System.out.println("X:" + aPoint.X);
- System.out.println("Y:" + aPoint.Y);
- System.out.println("Width:" + aSize.Width);
- System.out.println("Height:" + aSize.Height);
- System.out.println("");
-
- assertTrue("Window pos size wrong", aSize.Width == width && aSize.Height == height && aPoint.X == x && aPoint.Y == y);
-
- // XToolkit aToolkit = xWindowPeer.getToolkit();
- m_xConversion = UnoRuntime.queryInterface(XUnitConversion.class, xWindowPeer);
-
- // try to get the position of the window in 1/100mm with the XUnitConversion method
- try
- {
- com.sun.star.awt.Point aPointInMM_100TH = m_xConversion.convertPointToLogic(aPoint, com.sun.star.util.MeasureUnit.MM_100TH);
- System.out.println("Window position:");
- System.out.println("X:" + aPointInMM_100TH.X + " 1/100mm");
- System.out.println("Y:" + aPointInMM_100TH.Y + " 1/100mm");
- System.out.println("");
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- fail("failed: IllegalArgumentException caught in convertPointToLogic " + e.getMessage());
- }
-
- // try to get the size of the window in 1/100mm with the XUnitConversion method
- com.sun.star.awt.Size aSizeInMM_100TH = null;
- com.sun.star.awt.Size aSizeInMM_10TH = null;
- try
- {
- aSizeInMM_100TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_100TH);
- System.out.println("Window size:");
- System.out.println("Width:" + aSizeInMM_100TH.Width + " 1/100mm");
- System.out.println("Height:" + aSizeInMM_100TH.Height + " 1/100mm");
- System.out.println("");
-
- // try to get the size of the window in 1/10mm with the XUnitConversion method
-
- aSizeInMM_10TH = m_xConversion.convertSizeToLogic(aSize, com.sun.star.util.MeasureUnit.MM_10TH);
- System.out.println("Window size:");
- System.out.println("Width:" + aSizeInMM_10TH.Width + " 1/10mm");
- System.out.println("Height:" + aSizeInMM_10TH.Height + " 1/10mm");
- System.out.println("");
-
- // check the size with a delta which must be smaller a given difference
- assertTrue("Size.Width not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10);
- assertTrue("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10);
-
- // new
- checkSize(aSize, com.sun.star.util.MeasureUnit.PIXEL, "pixel");
- checkSize(aSize, com.sun.star.util.MeasureUnit.APPFONT, "appfont");
- checkSize(aSize, com.sun.star.util.MeasureUnit.SYSFONT, "sysfont");
-
- // simply check some more parameters
- checkSize(aSize, com.sun.star.util.MeasureUnit.MM, "mm");
- checkSize(aSize, com.sun.star.util.MeasureUnit.CM, "cm");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_1000TH, "1/1000inch");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_100TH, "1/100inch");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH_10TH, "1/10inch");
- checkSize(aSize, com.sun.star.util.MeasureUnit.INCH, "inch");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.M, "m");
- checkSize(aSize, com.sun.star.util.MeasureUnit.POINT, "point");
- checkSize(aSize, com.sun.star.util.MeasureUnit.TWIP, "twip");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.KM, "km");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.PICA, "pica");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.FOOT, "foot");
- // checkSize(aSize, com.sun.star.util.MeasureUnit.MILE, "mile");
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- fail("failed: IllegalArgumentException caught in convertSizeToLogic " + e.getMessage());
- }
-
- // convert the 1/100mm window size back to pixel
- try
- {
- com.sun.star.awt.Size aNewSize = m_xConversion.convertSizeToPixel(aSizeInMM_100TH, com.sun.star.util.MeasureUnit.MM_100TH);
- System.out.println("Window size:");
- System.out.println("Width:" + aNewSize.Width + " pixel");
- System.out.println("Height:" + aNewSize.Height + " pixel");
-
- // assure the pixels are the same as we already know
- assertTrue("failed: Size from pixel to 1/100mm to pixel", aSize.Width == aNewSize.Width && aSize.Height == aNewSize.Height);
- }
- catch (com.sun.star.lang.IllegalArgumentException e)
- {
- fail("failed: IllegalArgumentException caught in convertSizeToPixel " + e.getMessage());
- }
-
- // close the window.
- // IMHO a little bit stupid, but the XWindow doesn't support a XCloseable interface
- xWindow.dispose();
- }
-
-
-
- @BeforeClass public static void setUpConnection() throws Exception {
- System.out.println("setUpConnection()");
- connection.setUp();
- }
-
- @AfterClass public static void tearDownConnection()
- throws InterruptedException, com.sun.star.uno.Exception
- {
- System.out.println("tearDownConnection()");
- connection.tearDown();
- }
-
- private static final OfficeConnection connection = new OfficeConnection();
-
-}
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 80991e0a2a77..de5ebab36b2a 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -445,7 +445,7 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation
Window* pWindow = GetWindow();
if ( pWindow )
{
- Window *pLabeledBy = pWindow->GetLabeledBy();
+ Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy();
if ( pLabeledBy && pLabeledBy != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
@@ -453,7 +453,7 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation
rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABELED_BY, aSequence ) );
}
- Window* pLabelFor = pWindow->GetLabelFor();
+ Window* pLabelFor = pWindow->GetAccessibleRelationLabelFor();
if ( pLabelFor && pLabelFor != pWindow )
{
uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
diff --git a/toolkit/source/controls/animatedimages.cxx b/toolkit/source/controls/animatedimages.cxx
index 03cb2f26f324..c2fd91f1ea46 100755
--- a/toolkit/source/controls/animatedimages.cxx
+++ b/toolkit/source/controls/animatedimages.cxx
@@ -67,6 +67,7 @@ namespace toolkit
using ::com::sun::star::awt::XWindowPeer;
using ::com::sun::star::util::XModifyListener;
using ::com::sun::star::awt::XToolkit;
+ using ::com::sun::star::lang::XMultiServiceFactory;
/** === end UNO using === **/
namespace VisualEffect = ::com::sun::star::awt::VisualEffect;
namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
@@ -75,8 +76,8 @@ namespace toolkit
//= AnimatedImagesControl
//==================================================================================================================
//------------------------------------------------------------------------------------------------------------------
- AnimatedImagesControl::AnimatedImagesControl()
- :AnimatedImagesControl_Base()
+ AnimatedImagesControl::AnimatedImagesControl( Reference< XMultiServiceFactory > const & i_factory )
+ :AnimatedImagesControl_Base( i_factory )
{
}
@@ -238,8 +239,9 @@ namespace toolkit
//= AnimatedImagesControlModel
//==================================================================================================================
//------------------------------------------------------------------------------------------------------------------
- AnimatedImagesControlModel::AnimatedImagesControlModel()
- :m_pData( new AnimatedImagesControlModel_Data )
+ AnimatedImagesControlModel::AnimatedImagesControlModel( Reference< XMultiServiceFactory > const & i_factory )
+ :AnimatedImagesControlModel_Base( i_factory )
+ ,m_pData( new AnimatedImagesControlModel_Data )
{
ImplRegisterProperty( BASEPROPERTY_AUTO_REPEAT );
ImplRegisterProperty( BASEPROPERTY_BORDER );
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 940b99bd41c3..f037f10bbe31 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -220,8 +220,9 @@ static const ::rtl::OUString& getStepPropertyName( )
// ----------------------------------------------------
// class ControlModelContainerBase
// ----------------------------------------------------
-ControlModelContainerBase::ControlModelContainerBase()
- :maContainerListeners( *this )
+ControlModelContainerBase::ControlModelContainerBase( const Reference< XMultiServiceFactory >& i_factory )
+ :ControlModelContainer_IBase( i_factory )
+ ,maContainerListeners( *this )
,maChangeListeners ( GetMutex() )
,mbGroupsUpToDate( sal_False )
{
@@ -339,61 +340,61 @@ Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl::
OGeometryControlModel_Base* pNewModel = NULL;
+ const Reference< XMultiServiceFactory > xFactory( maContext.getLegacyServiceFactory() );
if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlEditModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlEditModel >;
+ pNewModel = new OGeometryControlModel< UnoControlEditModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFormattedFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >;
+ pNewModel = new OGeometryControlModel< UnoControlFormattedFieldModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFileControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFileControlModel >;
+ pNewModel = new OGeometryControlModel< UnoControlFileControlModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlButtonModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlButtonModel >;
+ pNewModel = new OGeometryControlModel< UnoControlButtonModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlImageControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlImageControlModel >;
+ pNewModel = new OGeometryControlModel< UnoControlImageControlModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRadioButtonModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >;
+ pNewModel = new OGeometryControlModel< UnoControlRadioButtonModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCheckBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >;
+ pNewModel = new OGeometryControlModel< UnoControlCheckBoxModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedHyperlinkModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >;
+ pNewModel = new OGeometryControlModel< UnoControlFixedHyperlinkModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlFixedTextModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >;
+ pNewModel = new OGeometryControlModel< UnoControlFixedTextModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlGroupBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >;
+ pNewModel = new OGeometryControlModel< UnoControlGroupBoxModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlListBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlListBoxModel >;
+ pNewModel = new OGeometryControlModel< UnoControlListBoxModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlComboBoxModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >;
+ pNewModel = new OGeometryControlModel< UnoControlComboBoxModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlDateFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >;
+ pNewModel = new OGeometryControlModel< UnoControlDateFieldModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlTimeFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >;
+ pNewModel = new OGeometryControlModel< UnoControlTimeFieldModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlNumericFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >;
+ pNewModel = new OGeometryControlModel< UnoControlNumericFieldModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlCurrencyFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >;
+ pNewModel = new OGeometryControlModel< UnoControlCurrencyFieldModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlPatternFieldModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >;
+ pNewModel = new OGeometryControlModel< UnoControlPatternFieldModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlProgressBarModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >;
+ pNewModel = new OGeometryControlModel< UnoControlProgressBarModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlScrollBarModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >;
+ pNewModel = new OGeometryControlModel< UnoControlScrollBarModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlFixedLineModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >;
+ pNewModel = new OGeometryControlModel< UnoControlFixedLineModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName2_UnoControlRoadmapModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >;
+ pNewModel = new OGeometryControlModel< UnoControlRoadmapModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName_TreeControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoTreeModel >;
+ pNewModel = new OGeometryControlModel< UnoTreeModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName_GridControlModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoGridModel >;
+ pNewModel = new OGeometryControlModel< UnoGridModel >( xFactory );
else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageContainerModel ) == 0 )
- pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >;
+ pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >( xFactory );
if ( !pNewModel )
{
- Reference< XMultiServiceFactory > xORB( ::comphelper::getProcessServiceFactory() );
- if ( xORB.is() )
+ if ( xFactory.is() )
{
- Reference< XInterface > xObject = xORB->createInstance( aServiceSpecifier );
+ Reference< XInterface > xObject = xFactory->createInstance( aServiceSpecifier );
Reference< XServiceInfo > xSI( xObject, UNO_QUERY );
Reference< XCloneable > xCloneAccess( xSI, UNO_QUERY );
Reference< XAggregation > xAgg( xCloneAccess, UNO_QUERY );
@@ -1313,9 +1314,10 @@ throw ( RuntimeException )
// ----------------------------------------------------
// class DialogContainerControl
// ----------------------------------------------------
-ControlContainerBase::ControlContainerBase() :
- mbSizeModified(false),
- mbPosModified(false)
+ControlContainerBase::ControlContainerBase( const Reference< XMultiServiceFactory >& i_factory )
+ :ContainerControl_IBase( i_factory )
+ ,mbSizeModified(false)
+ ,mbPosModified(false)
{
maComponentInfos.nWidth = 280;
maComponentInfos.nHeight = 400;
@@ -1339,8 +1341,8 @@ void ControlContainerBase::ImplInsertControl( Reference< XControlModel >& rxMode
::rtl::OUString aDefCtrl;
xP->getPropertyValue( GetPropertyName( BASEPROPERTY_DEFAULTCONTROL ) ) >>= aDefCtrl;
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XControl > xCtrl( xMSF->createInstance( aDefCtrl ), UNO_QUERY );
+ Reference < XControl > xCtrl;
+ maContext.createComponent( aDefCtrl, xCtrl );
DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" );
if ( xCtrl.is() )
@@ -1360,7 +1362,18 @@ void ControlContainerBase::ImplRemoveControl( Reference< XControlModel >& rxMode
Sequence< Reference< XControl > > aControls = getControls();
Reference< XControl > xCtrl = StdTabController::FindControl( aControls, rxModel );
if ( xCtrl.is() )
+ {
removeControl( xCtrl );
+ try
+ {
+ Reference< XComponent > const xControlComp( xCtrl, UNO_QUERY_THROW );
+ xControlComp->dispose();
+ }
+ catch( Exception const & )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
}
void ControlContainerBase::ImplSetPosSize( Reference< XControl >& rxCtrl )
@@ -1549,7 +1562,16 @@ void ControlContainerBase::elementInserted( const ContainerEvent& Event ) throw(
Event.Accessor >>= aName;
Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
+ ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementInserted: illegal element!" );
+ try
+ {
+ ImplInsertControl( xModel, aName );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException)
@@ -1558,8 +1580,16 @@ void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(R
Reference< XControlModel > xModel;
Event.Element >>= xModel;
- if ( xModel.is() )
+ ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementRemoved: illegal element!" );
+ try
+ {
ImplRemoveControl( xModel );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException)
@@ -1568,13 +1598,31 @@ void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw(
Reference< XControlModel > xModel;
Event.ReplacedElement >>= xModel;
- if ( xModel.is() )
- ImplRemoveControl( xModel );
+ try
+ {
+ OSL_ENSURE( xModel.is(), "UnoDialogControl::elementReplaced: invalid ReplacedElement!" );
+ if ( xModel.is() )
+ ImplRemoveControl( xModel );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
::rtl::OUString aName;
Event.Accessor >>= aName;
Event.Element >>= xModel;
- ImplInsertControl( xModel, aName );
+ ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementReplaced: invalid new element!" );
+ try
+ {
+ ImplInsertControl( xModel, aName );
+ }
+ catch ( const RuntimeException& e ) { throw; }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
// XPropertiesChangeListener
@@ -1761,9 +1809,8 @@ uno::Reference< graphic::XGraphic > ControlContainerBase::Impl_getGraphicFromURL
try
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
uno::Reference< graphic::XGraphicProvider > xProvider;
- if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ if ( maContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
{
uno::Sequence< beans::PropertyValue > aMediaProperties(1);
aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 15eeb2aa1939..8f400ff1945c 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -76,7 +76,8 @@ using namespace ::com::sun::star::util;
// ----------------------------------------------------
// class UnoControlDialogModel
// ----------------------------------------------------
-UnoControlDialogModel::UnoControlDialogModel()
+UnoControlDialogModel::UnoControlDialogModel( const Reference< XMultiServiceFactory >& i_factory )
+ :ControlModelContainerBase( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
// ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -163,9 +164,10 @@ Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) thro
// = class UnoDialogControl
// ============================================================================
-UnoDialogControl::UnoDialogControl() :
- maTopWindowListeners( *this ),
- mbWindowListener(false)
+UnoDialogControl::UnoDialogControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :ControlContainerBase( i_factory )
+ ,maTopWindowListeners( *this )
+ ,mbWindowListener(false)
{
maComponentInfos.nWidth = 300;
maComponentInfos.nHeight = 450;
@@ -196,7 +198,8 @@ Any UnoDialogControl::queryAggregation( const Type & rType ) throw(RuntimeExcept
aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XWindowListener*, this ) );
return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType ));
}
-//lang::XTypeProvider
+
+ //lang::XTypeProvider
IMPL_XTYPEPROVIDER_START( UnoDialogControl)
getCppuType( ( uno::Reference< awt::XTopWindow>* ) NULL ),
getCppuType( ( uno::Reference< awt::XDialog>* ) NULL ),
diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx
index e9de3c5fac77..fb2d0f720c2e 100644
--- a/toolkit/source/controls/formattedcontrol.cxx
+++ b/toolkit/source/controls/formattedcontrol.cxx
@@ -125,8 +125,9 @@ namespace toolkit
// = UnoControlFormattedFieldModel
// ===================================================================
// -------------------------------------------------------------------
- UnoControlFormattedFieldModel::UnoControlFormattedFieldModel()
- :m_bRevokedAsClient( false )
+ UnoControlFormattedFieldModel::UnoControlFormattedFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
+ ,m_bRevokedAsClient( false )
,m_bSettingValueAndText( false )
{
ImplRegisterProperty( BASEPROPERTY_ALIGN );
@@ -433,7 +434,8 @@ namespace toolkit
// = UnoFormattedFieldControl
// ===================================================================
// -------------------------------------------------------------------
- UnoFormattedFieldControl::UnoFormattedFieldControl()
+ UnoFormattedFieldControl::UnoFormattedFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
}
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
index 011f3502cdd8..0195ddff09a2 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.cxx
@@ -27,174 +27,366 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
+
#include "defaultgridcolumnmodel.hxx"
-#include <comphelper/sequence.hxx>
-#include <toolkit/helper/servicenames.hxx>
+#include "gridcolumn.hxx"
+
+/** === begin UNO includes === **/
#include <com/sun/star/awt/XVclWindowPeer.hpp>
-#include <rtl/ref.hxx>
+/** === end UNO includes === **/
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::style;
+#include <comphelper/sequence.hxx>
+#include <comphelper/componentguard.hxx>
+#include <toolkit/helper/servicenames.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/diagnose_ex.h>
+//......................................................................................................................
namespace toolkit
+//......................................................................................................................
{
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::awt::grid::XGridColumn;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::container::XContainerListener;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::lang::IndexOutOfBoundsException;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= DefaultGridColumnModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridColumnModel::DefaultGridColumnModel( const Reference< XMultiServiceFactory >& i_factory )
+ :DefaultGridColumnModel_Base( m_aMutex )
+ ,m_aContext( i_factory )
+ ,m_aContainerListeners( m_aMutex )
+ ,m_aColumns()
+ {
+ }
-///////////////////////////////////////////////////////////////////////
-// class DefaultGridColumnModel
-///////////////////////////////////////////////////////////////////////
-
-DefaultGridColumnModel::DefaultGridColumnModel(const Reference< XMultiServiceFactory >& xFactory)
-: columns(std::vector< Reference< XGridColumn > >())
- ,m_nColumnHeaderHeight(0)
- ,m_xFactory(xFactory)
-{
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridColumnModel::DefaultGridColumnModel( DefaultGridColumnModel const & i_copySource )
+ :cppu::BaseMutex()
+ ,DefaultGridColumnModel_Base( m_aMutex )
+ ,m_aContext( i_copySource.m_aContext )
+ ,m_aContainerListeners( m_aMutex )
+ ,m_aColumns()
+ {
+ Columns aColumns;
+ aColumns.reserve( i_copySource.m_aColumns.size() );
+ try
+ {
+ for ( Columns::const_iterator col = i_copySource.m_aColumns.begin();
+ col != i_copySource.m_aColumns.end();
+ ++col
+ )
+ {
+ Reference< XCloneable > const xCloneable( *col, UNO_QUERY_THROW );
+ Reference< XGridColumn > const xClone( xCloneable->createClone(), UNO_QUERY_THROW );
+
+ GridColumn* const pGridColumn = GridColumn::getImplementation( xClone );
+ if ( pGridColumn == NULL )
+ throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "invalid clone source implementation" ) ), *this );
+ // that's indeed a RuntimeException, not an IllegalArgumentException or some such:
+ // a DefaultGridColumnModel implementation whose columns are not GridColumn implementations
+ // is borked.
+ pGridColumn->setIndex( col - i_copySource.m_aColumns.begin() );
+
+ aColumns.push_back( xClone );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ if ( aColumns.size() == i_copySource.m_aColumns.size() )
+ m_aColumns.swap( aColumns );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridColumnModel::~DefaultGridColumnModel()
+ {
+ }
-DefaultGridColumnModel::~DefaultGridColumnModel()
-{
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnCount() throw (RuntimeException)
+ {
+ return m_aColumns.size();
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridColumn > SAL_CALL DefaultGridColumnModel::createColumn( ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return new GridColumn();
+ }
-::sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnCount() throw (::com::sun::star::uno::RuntimeException)
-{
- return columns.size();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridColumnModel::addColumn( const Reference< XGridColumn > & i_column ) throw (RuntimeException, IllegalArgumentException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ GridColumn* const pGridColumn = GridColumn::getImplementation( i_column );
+ if ( pGridColumn == NULL )
+ throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "invalid column implementation" ) ), *this, 1 );
-::sal_Int32 SAL_CALL DefaultGridColumnModel::addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- Reference<XGridColumn> xColumn(column);
- columns.push_back(xColumn);
- sal_Int32 index = columns.size() - 1;
- xColumn->setIndex(index);
- return index;
-}
+ m_aColumns.push_back( i_column );
+ sal_Int32 index = m_aColumns.size() - 1;
+ pGridColumn->setIndex( index );
-//---------------------------------------------------------------------
+ // fire insertion notifications
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= index;
+ aEvent.Element <<= i_column;
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL DefaultGridColumnModel::getColumns() throw (::com::sun::star::uno::RuntimeException)
-{
- return comphelper::containerToSequence(columns);
-}
+ aGuard.clear();
+ m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
-//---------------------------------------------------------------------
+ return index;
+ }
-::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL DefaultGridColumnModel::getColumn(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if ( index >=0 && index < ((sal_Int32)columns.size()))
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::removeColumn( ::sal_Int32 i_columnIndex ) throw (RuntimeException, IndexOutOfBoundsException)
{
- return columns[index];
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ if ( ( i_columnIndex < 0 ) || ( size_t( i_columnIndex ) >= m_aColumns.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ Columns::iterator const pos = m_aColumns.begin() + i_columnIndex;
+ Reference< XGridColumn > const xColumn( *pos );
+ m_aColumns.erase( pos );
+
+ // update indexes of all subsequent columns
+ sal_Int32 columnIndex( i_columnIndex );
+ for ( Columns::iterator updatePos = m_aColumns.begin() + columnIndex;
+ updatePos != m_aColumns.end();
+ ++updatePos, ++columnIndex
+ )
+ {
+ GridColumn* pColumnImpl = GridColumn::getImplementation( *updatePos );
+ ENSURE_OR_CONTINUE( pColumnImpl, "DefaultGridColumnModel::removeColumn: invalid column implementation!" );
+ pColumnImpl->setIndex( columnIndex );
+ }
+
+ // fire removal notifications
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= i_columnIndex;
+ aEvent.Element <<= xColumn;
+
+ aGuard.clear();
+ m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent );
+
+ // dispose the removed column
+ try
+ {
+ Reference< XComponent > const xColComp( xColumn, UNO_QUERY_THROW );
+ xColComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- else
- return Reference< XGridColumn >();
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridColumnModel::setColumnHeaderHeight(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException)
-{
- m_nColumnHeaderHeight = _value;
-}
-//---------------------------------------------------------------------
-sal_Int32 SAL_CALL DefaultGridColumnModel::getColumnHeaderHeight() throw (::com::sun::star::uno::RuntimeException)
-{
- return m_nColumnHeaderHeight;
-}
-
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridColumnModel::setDefaultColumns(sal_Int32 rowElements) throw (::com::sun::star::uno::RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- for(sal_Int32 i=0;i<rowElements;i++)
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< Reference< XGridColumn > > SAL_CALL DefaultGridColumnModel::getColumns() throw (RuntimeException)
{
- Reference<XGridColumn> xColumn( m_xFactory->createInstance ( OUString::createFromAscii( "com.sun.star.awt.grid.GridColumn" ) ), UNO_QUERY );
- columns.push_back(xColumn);
- xColumn->setIndex(i);
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return ::comphelper::containerToSequence( m_aColumns );
}
-}
-::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL DefaultGridColumnModel::copyColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference<XGridColumn> xColumn( m_xFactory->createInstance ( OUString::createFromAscii( "com.sun.star.awt.grid.GridColumn" ) ), UNO_QUERY );
- xColumn->setColumnWidth(column->getColumnWidth());
- xColumn->setPreferredWidth(column->getPreferredWidth());
- xColumn->setMaxWidth(column->getMaxWidth());
- xColumn->setMinWidth(column->getMinWidth());
- xColumn->setPreferredWidth(column->getPreferredWidth());
- xColumn->setResizeable(column->getResizeable());
- xColumn->setTitle(column->getTitle());
- xColumn->setHorizontalAlign(column->getHorizontalAlign());
- return xColumn;
-}
-//---------------------------------------------------------------------
-// XComponent
-//---------------------------------------------------------------------
-
-void SAL_CALL DefaultGridColumnModel::dispose() throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- ::com::sun::star::lang::EventObject aEvent;
- aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
- BrdcstHelper.aLC.disposeAndClear( aEvent );
-
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XGridColumn > SAL_CALL DefaultGridColumnModel::getColumn(::sal_Int32 index) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ if ( index >=0 && index < ((sal_Int32)m_aColumns.size()))
+ return m_aColumns[index];
-void SAL_CALL DefaultGridColumnModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XEventListener::static_type(), xListener );
-}
+ throw IndexOutOfBoundsException();
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::setDefaultColumns(sal_Int32 rowElements) throw (RuntimeException)
+ {
+ ::std::vector< ContainerEvent > aRemovedColumns;
+ ::std::vector< ContainerEvent > aInsertedColumns;
+
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ // remove existing columns
+ while ( !m_aColumns.empty() )
+ {
+ const size_t lastColIndex = m_aColumns.size() - 1;
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= sal_Int32( lastColIndex );
+ aEvent.Element <<= m_aColumns[ lastColIndex ];
+ aRemovedColumns.push_back( aEvent );
+
+ m_aColumns.erase( m_aColumns.begin() + lastColIndex );
+ }
+
+ // add new columns
+ for ( sal_Int32 i=0; i<rowElements; ++i )
+ {
+ ::rtl::Reference< GridColumn > const pGridColumn = new GridColumn();
+ Reference< XGridColumn > const xColumn( pGridColumn.get() );
+ ::rtl::OUStringBuffer colTitle;
+ colTitle.appendAscii( "Column " );
+ colTitle.append( i + 1 );
+ pGridColumn->setTitle( colTitle.makeStringAndClear() );
+ pGridColumn->setColumnWidth( 80 /* APPFONT */ );
+ pGridColumn->setFlexibility( 1 );
+ pGridColumn->setResizeable( sal_True );
+ pGridColumn->setDataColumnIndex( i );
+
+ ContainerEvent aEvent;
+ aEvent.Source = *this;
+ aEvent.Accessor <<= i;
+ aEvent.Element <<= xColumn;
+ aInsertedColumns.push_back( aEvent );
+
+ m_aColumns.push_back( xColumn );
+ pGridColumn->setIndex( i );
+ }
+ }
+
+ // fire removal notifications
+ for ( ::std::vector< ContainerEvent >::const_iterator event = aRemovedColumns.begin();
+ event != aRemovedColumns.end();
+ ++event
+ )
+ {
+ m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, *event );
+ }
+
+ // fire insertion notifications
+ for ( ::std::vector< ContainerEvent >::const_iterator event = aInsertedColumns.begin();
+ event != aInsertedColumns.end();
+ ++event
+ )
+ {
+ m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, *event );
+ }
+
+ // dispose removed columns
+ for ( ::std::vector< ContainerEvent >::const_iterator event = aRemovedColumns.begin();
+ event != aRemovedColumns.end();
+ ++event
+ )
+ {
+ try
+ {
+ const Reference< XComponent > xColComp( event->Element, UNO_QUERY_THROW );
+ xColComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
-void SAL_CALL DefaultGridColumnModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DefaultGridColumnModel::getImplementationName( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.DefaultGridColumnModel" ) );
+ }
-//---------------------------------------------------------------------
-// XServiceInfo
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL DefaultGridColumnModel::supportsService( const ::rtl::OUString& i_serviceName ) throw (RuntimeException)
+ {
+ const Sequence< ::rtl::OUString > aServiceNames( getSupportedServiceNames() );
+ for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
+ if ( aServiceNames[i] == i_serviceName )
+ return sal_True;
+ return sal_False;
+ }
-::rtl::OUString SAL_CALL DefaultGridColumnModel::getImplementationName( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridColumnModel" ) );
- return aImplName;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL DefaultGridColumnModel::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( szServiceName_DefaultGridColumnModel ) );
+ const Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::addContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ if ( i_listener.is() )
+ m_aContainerListeners.addInterface( i_listener );
+ }
-sal_Bool SAL_CALL DefaultGridColumnModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return ServiceName.equalsAscii( szServiceName_DefaultGridColumnModel );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::removeContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException)
+ {
+ if ( i_listener.is() )
+ m_aContainerListeners.removeInterface( i_listener );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridColumnModel::disposing()
+ {
+ DefaultGridColumnModel_Base::disposing();
+
+ EventObject aEvent( *this );
+ m_aContainerListeners.disposeAndClear( aEvent );
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // remove, dispose and clear columns
+ while ( !m_aColumns.empty() )
+ {
+ try
+ {
+ const Reference< XComponent > xColComponent( m_aColumns[ 0 ], UNO_QUERY_THROW );
+ xColComponent->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ m_aColumns.erase( m_aColumns.begin() );
+ }
+
+ Columns aEmpty;
+ m_aColumns.swap( aEmpty );
+ }
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridColumnModel::getSupportedServiceNames( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridColumnModel ) );
- static const Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL DefaultGridColumnModel::createClone( ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return new DefaultGridColumnModel( *this );
+ }
-}
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
-Reference< XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const Reference< XMultiServiceFactory >& _rFactory)
+//----------------------------------------------------------------------------------------------------------------------
+::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 >& _rFactory)
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::DefaultGridColumnModel( _rFactory ) );
+ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::DefaultGridColumnModel( _rFactory ) );
}
-
diff --git a/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
index 8b8c8bfc795c..da0ef20e3287 100644
--- a/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
+++ b/toolkit/source/controls/grid/defaultgridcolumnmodel.hxx
@@ -25,76 +25,73 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
+/** === begin UNO includes === **/
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
#include <com/sun/star/awt/grid/XGridColumn.hpp>
-//#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <rtl/ref.hxx>
-#include <vector>
-#include <toolkit/helper/mutexandbroadcasthelper.hxx>
-#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+#include <com/sun/star/util/Color.hpp>
+/** === end UNO includes === **/
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <vector>
+
+namespace comphelper
+{
+ class ComponentGuard;
+}
namespace toolkit
{
//enum broadcast_type { column_added, column_removed, column_changed};
-class DefaultGridColumnModel : public ::cppu::WeakImplHelper2< XGridColumnModel, XServiceInfo >,
- public MutexAndBroadcastHelper
+typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::awt::grid::XGridColumnModel
+ , ::com::sun::star::lang::XServiceInfo
+ > DefaultGridColumnModel_Base;
+
+class DefaultGridColumnModel :public ::cppu::BaseMutex
+ ,public DefaultGridColumnModel_Base
{
public:
- DefaultGridColumnModel(const Reference< XMultiServiceFactory >& xFactory);
+ DefaultGridColumnModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ DefaultGridColumnModel( DefaultGridColumnModel const & i_copySource );
virtual ~DefaultGridColumnModel();
// XGridColumnModel
-
- //virtual ::sal_Bool SAL_CALL getColumnSelectionAllowed() throw (::com::sun::star::uno::RuntimeException);
- //virtual void SAL_CALL setColumnSelectionAllowed(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL createColumn( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL addColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException);
+ virtual void SAL_CALL removeColumn( ::sal_Int32 i_columnIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > SAL_CALL getColumns() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL getColumn(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- //virtual void SAL_CALL addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException);
- //virtual void SAL_CALL removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL setColumnHeaderHeight( sal_Int32 _value) throw (com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getColumnHeaderHeight() throw (com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL getColumn(::sal_Int32 index) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setDefaultColumns(sal_Int32 rowElements) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > SAL_CALL copyColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & column) throw (::com::sun::star::uno::RuntimeException);
- // XComponent
- virtual void SAL_CALL dispose( ) throw (RuntimeException);
- virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
-private:
- /*void broadcast( broadcast_type eType, const GridColumnEvent& aEvent );
- void broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue, sal_Int32 index,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );
- void broadcast_add( sal_Int32 index,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );
- void broadcast_remove( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > & rColumn );*/
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+private:
+ typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > Columns;
- std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumn > > columns;
- sal_Bool selectionAllowed;
- sal_Int32 m_nColumnHeaderHeight;
- Reference< XMultiServiceFactory > m_xFactory;
+ ::comphelper::ComponentContext m_aContext;
+ ::cppu::OInterfaceContainerHelper m_aContainerListeners;
+ Columns m_aColumns;
};
}
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
index adc40b0426d7..4ef99d749ba1 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx
@@ -27,318 +27,411 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
+
#include "defaultgriddatamodel.hxx"
-#include <comphelper/sequence.hxx>
+
+#include <comphelper/stlunosequence.hxx>
+#include <comphelper/componentguard.hxx>
#include <toolkit/helper/servicenames.hxx>
+#include <tools/diagnose_ex.h>
#include <rtl/ref.hxx>
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
-
-#define ROWHEIGHT ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeight" ))
-#define ROWHEADERS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaders" ))
-#define CELLUPDATED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CellUpdated" ))
-#define ROWUPDATED ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowUpdated" ))
-#define ROWHEADERWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowHeaderWidth" ))
+#include <algorithm>
+//......................................................................................................................
namespace toolkit
+//......................................................................................................................
{
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::util::XCloneable;
+ /** === end UNO using === **/
+
+ using ::comphelper::stl_begin;
+ using ::comphelper::stl_end;
+
+ //==================================================================================================================
+ //= DefaultGridDataModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::DefaultGridDataModel()
+ :DefaultGridDataModel_Base( m_aMutex )
+ ,m_aRowHeaders()
+ ,m_nColumnCount(0)
+ {
+ }
-///////////////////////////////////////////////////////////////////////
-// class DefaultGridDataModel
-///////////////////////////////////////////////////////////////////////
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::DefaultGridDataModel( DefaultGridDataModel const & i_copySource )
+ :cppu::BaseMutex()
+ ,DefaultGridDataModel_Base( m_aMutex )
+ ,m_aData( i_copySource.m_aData )
+ ,m_aRowHeaders( i_copySource.m_aRowHeaders )
+ ,m_nColumnCount( i_copySource.m_nColumnCount )
+ {
+ }
-DefaultGridDataModel::DefaultGridDataModel()
-: rowHeight(0),
- rowHeaders(std::vector< ::rtl::OUString >()),
- m_nRowHeaderWidth(10)
-{
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::~DefaultGridDataModel()
+ {
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::broadcast( GridDataEvent const & i_event,
+ void ( SAL_CALL XGridDataListener::*i_listenerMethod )( GridDataEvent const & ), ::comphelper::ComponentGuard & i_instanceLock )
+ {
+ ::cppu::OInterfaceContainerHelper* pListeners = rBHelper.getContainer( XGridDataListener::static_type() );
+ if ( !pListeners )
+ return;
-DefaultGridDataModel::~DefaultGridDataModel()
-{
-}
+ i_instanceLock.clear();
+ pListeners->notifyEach( i_listenerMethod, i_event );
+ }
-void DefaultGridDataModel::broadcast( broadcast_type eType, const GridDataEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException)
-{
- ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridDataListener::static_type() );
- if( pIter )
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridDataModel::getRowCount() throw (::com::sun::star::uno::RuntimeException)
{
- ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
- while(aListIter.hasMoreElements())
- {
- XGridDataListener* pListener = static_cast<XGridDataListener*>(aListIter.next());
- switch( eType )
- {
- case row_added: pListener->rowAdded(aEvent); break;
- case row_removed: pListener->rowRemoved(aEvent); break;
- case data_changed: pListener->dataChanged(aEvent); break;
- }
- }
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_aData.size();
}
-}
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultGridDataModel::getColumnCount() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nColumnCount;
+ }
-void DefaultGridDataModel::broadcast_changed( ::rtl::OUString name, sal_Int32 index, Any oldValue, Any newValue) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, name, oldValue, newValue, index, ::rtl::OUString(), Sequence< Any >());
- broadcast( data_changed, aEvent);
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::CellData const & DefaultGridDataModel::impl_getCellData_throw( sal_Int32 const i_column, sal_Int32 const i_row ) const
+ {
+ if ( ( i_row < 0 ) || ( size_t( i_row ) > m_aData.size() )
+ || ( i_column < 0 ) || ( i_column > m_nColumnCount )
+ )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *const_cast< DefaultGridDataModel* >( this ) );
-//---------------------------------------------------------------------
+ RowData const & rRow( m_aData[ i_row ] );
+ if ( size_t( i_column ) < rRow.size() )
+ return rRow[ i_column ];
-void DefaultGridDataModel::broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName,
- ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, (const ::com::sun::star::uno::Sequence< Any >&)rowData );
- broadcast( row_added, aEvent);
-}
+ static CellData s_aEmpty;
+ return s_aEmpty;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::RowData& DefaultGridDataModel::impl_getRowDataAccess_throw( sal_Int32 const i_rowIndex, size_t const i_requiredColumnCount )
+ {
+ OSL_ENSURE( i_requiredColumnCount <= size_t( m_nColumnCount ), "DefaultGridDataModel::impl_getRowDataAccess_throw: invalid column count!" );
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aData.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ RowData& rRowData( m_aData[ i_rowIndex ] );
+ if ( rRowData.size() < i_requiredColumnCount )
+ rRowData.resize( i_requiredColumnCount );
+ return rRowData;
+ }
-void DefaultGridDataModel::broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName,
- ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridDataEvent aEvent( xSource, ::rtl::OUString(), Any(), Any(), index, headerName, rowData );
- broadcast( row_removed, aEvent);
-}
+ //------------------------------------------------------------------------------------------------------------------
+ DefaultGridDataModel::CellData& DefaultGridDataModel::impl_getCellDataAccess_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex )
+ {
+ if ( ( i_columnIndex < 0 ) || ( i_columnIndex >= m_nColumnCount ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-//---------------------------------------------------------------------
+ RowData& rRowData( impl_getRowDataAccess_throw( i_rowIndex, size_t( i_columnIndex + 1 ) ) );
+ return rRowData[ i_columnIndex ];
+ }
-//---------------------------------------------------------------------
-// XDefaultGridDataModel
-//---------------------------------------------------------------------
-::sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeight() throw (::com::sun::star::uno::RuntimeException)
-{
- return rowHeight;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL DefaultGridDataModel::getCellData( ::sal_Int32 i_column, ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return impl_getCellData_throw( i_column, i_row ).first;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL DefaultGridDataModel::getCellToolTip( ::sal_Int32 i_column, ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return impl_getCellData_throw( i_column, i_row ).second;
+ }
-void SAL_CALL DefaultGridDataModel::setRowHeight(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 oldValue = rowHeight;
- rowHeight = value;
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL DefaultGridDataModel::getRowHeading( ::sal_Int32 i_row ) throw (RuntimeException, IndexOutOfBoundsException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
- broadcast_changed( ROWHEIGHT, 0, Any(oldValue), Any(value));
-}
+ if ( ( i_row < 0 ) || ( size_t( i_row ) >= m_aRowHeaders.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-//---------------------------------------------------------------------
+ return m_aRowHeaders[ i_row ];
+ }
-::sal_Int32 SAL_CALL DefaultGridDataModel::getRowCount() throw (::com::sun::star::uno::RuntimeException)
-{
- return data.size();
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addRow( const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ sal_Int32 const columnCount = i_data.getLength();
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getRowHeaders() throw (::com::sun::star::uno::RuntimeException)
-{
- return comphelper::containerToSequence(rowHeaders);
-}
+ // store header name
+ m_aRowHeaders.push_back( i_heading );
-//---------------------------------------------------------------------
+ // store row m_aData
+ impl_addRow( i_data );
-void SAL_CALL DefaultGridDataModel::setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & value) throw (::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > oldValue( comphelper::containerToSequence(rowHeaders) );
+ // update column count
+ if ( columnCount > m_nColumnCount )
+ m_nColumnCount = columnCount;
- std::vector< rtl::OUString>::iterator iterator;
- int i = 0;
- int sequenceSize = value.getLength();
+ sal_Int32 const rowIndex = sal_Int32( m_aData.size() - 1 );
+ broadcast(
+ GridDataEvent( *this, -1, -1, rowIndex, rowIndex ),
+ &XGridDataListener::rowsInserted,
+ aGuard
+ );
+ }
- for(iterator = rowHeaders.begin(); iterator != rowHeaders.end(); iterator++)
+ //------------------------------------------------------------------------------------------------------------------
+ void DefaultGridDataModel::impl_addRow( Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount )
{
- if ( sequenceSize > i )
- *iterator = value[i];
- else
- *iterator = ::rtl::OUString();
- i++;
+ OSL_PRECOND( ( i_assumedColCount <= 0 ) || ( i_assumedColCount >= i_rowData.getLength() ),
+ "DefaultGridDataModel::impl_addRow: invalid column count!" );
+
+ RowData newRow( i_assumedColCount > 0 ? i_assumedColCount : i_rowData.getLength() );
+ RowData::iterator cellData = newRow.begin();
+ for ( const Any* pData = stl_begin( i_rowData ); pData != stl_end( i_rowData ); ++pData, ++cellData )
+ cellData->first = *pData;
+
+ m_aData.push_back( newRow );
}
- broadcast_changed( ROWHEADERS, 0, Any(oldValue), Any(comphelper::containerToSequence(rowHeaders)) );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addRows( const Sequence< Any >& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException)
+ {
+ if ( i_headings.getLength() != i_data.getLength() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, -1 );
-//---------------------------------------------------------------------
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-void SAL_CALL DefaultGridDataModel::addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< Any > & rRowdata) throw (::com::sun::star::uno::RuntimeException)
-{
- // store header name
- rowHeaders.push_back(headername);
+ sal_Int32 const rowCount = i_headings.getLength();
+ if ( rowCount == 0 )
+ return;
- // store row data
- std::vector< Any > newRow;
- for ( int i = 0; i < rRowdata.getLength();i++)
- {
- newRow.push_back(rRowdata[i]);
- }
+ // determine max col count in the new data
+ sal_Int32 maxColCount = 0;
+ for ( sal_Int32 row=0; row<rowCount; ++row )
+ if ( i_data[row].getLength() > maxColCount )
+ maxColCount = i_data[row].getLength();
- data.push_back( newRow );
+ if ( maxColCount < m_nColumnCount )
+ maxColCount = m_nColumnCount;
- broadcast_add( data.size()-1, headername, comphelper::containerToSequence(newRow));
+ for ( sal_Int32 row=0; row<rowCount; ++row )
+ {
+ m_aRowHeaders.push_back( i_headings[row] );
+ impl_addRow( i_data[row], maxColCount );
+ }
-}
+ if ( maxColCount > m_nColumnCount )
+ m_nColumnCount = maxColCount;
-//---------------------------------------------------------------------
+ sal_Int32 const firstRow = sal_Int32( m_aData.size() - rowCount );
+ sal_Int32 const lastRow = sal_Int32( m_aData.size() - 1 );
+ broadcast(
+ GridDataEvent( *this, -1, -1, firstRow, lastRow ),
+ &XGridDataListener::rowsInserted,
+ aGuard
+ );
+ }
-void SAL_CALL DefaultGridDataModel::removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
-{
- if ( index >= 0 && index <= getRowCount()-1)
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeRow( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
{
- ::rtl::OUString headerName( (::rtl::OUString) rowHeaders[index] );
- rowHeaders.erase(rowHeaders.begin() + index);
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
- Sequence< Any > rowData ( (Sequence< Any >&)data[index] );
- data.erase(data.begin() + index);
- broadcast_remove( index, headerName, rowData);
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aData.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ m_aRowHeaders.erase( m_aRowHeaders.begin() + i_rowIndex );
+ m_aData.erase( m_aData.begin() + i_rowIndex );
+
+ broadcast(
+ GridDataEvent( *this, -1, -1, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::rowsRemoved,
+ aGuard
+ );
}
- else
- return;
-}
-//---------------------------------------------------------------------
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Any > > SAL_CALL DefaultGridDataModel::getData() throw (::com::sun::star::uno::RuntimeException)
-{
- std::vector< std::vector< Any > >::iterator iterator;
- std::vector< Sequence< Any > > dummyContainer(0);
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeAllRows( ) throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ m_aRowHeaders.clear();
+ m_aData.clear();
+ broadcast(
+ GridDataEvent( *this, -1, -1, -1, -1 ),
+ &XGridDataListener::rowsRemoved,
+ aGuard
+ );
+ }
- for(iterator = data.begin(); iterator != data.end(); iterator++)
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateCellData( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
{
- Sequence< Any > cols(comphelper::containerToSequence(*iterator));
- dummyContainer.push_back( cols );
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+
+ impl_getCellDataAccess_throw( i_columnIndex, i_rowIndex ).first = i_value;
+
+ broadcast(
+ GridDataEvent( *this, i_columnIndex, i_columnIndex, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::dataChanged,
+ aGuard
+ );
}
- Sequence< Sequence< Any > > dataSequence(comphelper::containerToSequence(dummyContainer));
- return dataSequence;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateRowData( const Sequence< ::sal_Int32 >& i_columnIndexes, ::sal_Int32 i_rowIndex, const Sequence< Any >& i_values ) throw (IndexOutOfBoundsException, IllegalArgumentException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-//---------------------------------------------------------------------
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aData.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-void SAL_CALL DefaultGridDataModel::addDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XGridDataListener::static_type(), xListener );
-}
+ if ( i_columnIndexes.getLength() != i_values.getLength() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
-//---------------------------------------------------------------------
+ sal_Int32 const columnCount = i_columnIndexes.getLength();
+ if ( columnCount == 0 )
+ return;
-void SAL_CALL DefaultGridDataModel::removeDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XGridDataListener::static_type(), xListener );
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::removeAll() throw (RuntimeException)
-{
- rowHeaders.clear();
- data.clear();
- broadcast_remove( -1, ::rtl::OUString(), Sequence< Any >());
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException)
-{
- sal_Int32 oldValue = m_nRowHeaderWidth;
- m_nRowHeaderWidth = _value;
- broadcast_changed( ROWHEADERWIDTH, 0, Any(oldValue), Any(_value) );
-}
-//---------------------------------------------------------------------
-sal_Int32 SAL_CALL DefaultGridDataModel::getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- return m_nRowHeaderWidth;
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::updateCell(::sal_Int32 row, ::sal_Int32 column, const Any& value) throw (::com::sun::star::uno::RuntimeException)
-{
- if(row >= 0 && row < (signed)data.size())
- {
- if(column >= 0 && column < (signed)data[0].size())
+ for ( sal_Int32 col = 0; col < columnCount; ++col )
{
- data[row][column] = value;
- Sequence< Any >dataSeq(comphelper::containerToSequence(data[row]));
- broadcast_changed( CELLUPDATED, row, Any(column), value );
+ if ( ( i_columnIndexes[col] < 0 ) || ( i_columnIndexes[col] > m_nColumnCount ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
}
- }
-}
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::updateRow(::sal_Int32 row, const ::com::sun::star::uno::Sequence< ::sal_Int32 > & columns, const ::com::sun::star::uno::Sequence< Any > & values) throw (::com::sun::star::uno::RuntimeException)
-{
- if(row >= 0 && row < (signed)data.size())
- {
- if(columns.getLength() == values.getLength())
+
+ RowData& rDataRow = m_aData[ i_rowIndex ];
+ for ( sal_Int32 col = 0; col < columnCount; ++col )
{
- for(int i = 0; i < columns.getLength(); i++)
- data[row][i] = values[i];
- Sequence< Any >dataSeq(comphelper::containerToSequence(data[row]));
- broadcast_changed( ROWUPDATED, row, Any(columns), Any(values) );
+ sal_Int32 const columnIndex = i_columnIndexes[ col ];
+ if ( size_t( columnIndex ) >= rDataRow.size() )
+ rDataRow.resize( columnIndex + 1 );
+
+ rDataRow[ columnIndex ].first = i_values[ col ];
}
+
+ sal_Int32 const firstAffectedColumn = *::std::min_element( stl_begin( i_columnIndexes ), stl_end( i_columnIndexes ) );
+ sal_Int32 const lastAffectedColumn = *::std::max_element( stl_begin( i_columnIndexes ), stl_end( i_columnIndexes ) );
+ broadcast(
+ GridDataEvent( *this, firstAffectedColumn, lastAffectedColumn, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::dataChanged,
+ aGuard
+ );
}
-}
-//---------------------------------------------------------------------
-// XComponent
-//---------------------------------------------------------------------
-void SAL_CALL DefaultGridDataModel::dispose() throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateRowHeading( ::sal_Int32 i_rowIndex, const Any& i_heading ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
- ::com::sun::star::lang::EventObject aEvent;
- aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
- BrdcstHelper.aLC.disposeAndClear( aEvent );
+ if ( ( i_rowIndex < 0 ) || ( size_t( i_rowIndex ) >= m_aRowHeaders.size() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
-}
+ m_aRowHeaders[ i_rowIndex ] = i_heading;
-//---------------------------------------------------------------------
+ broadcast(
+ GridDataEvent( *this, -1, -1, i_rowIndex, i_rowIndex ),
+ &XGridDataListener::rowHeadingChanged,
+ aGuard
+ );
+ }
-void SAL_CALL DefaultGridDataModel::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XEventListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateCellToolTip( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ impl_getCellDataAccess_throw( i_columnIndex, i_rowIndex ).second = i_value;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::updateRowToolTip( ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
-void SAL_CALL DefaultGridDataModel::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
-}
-//---------------------------------------------------------------------
-// XServiceInfo
-//---------------------------------------------------------------------
+ RowData& rRowData = impl_getRowDataAccess_throw( i_rowIndex, m_nColumnCount );
+ for ( RowData::iterator cell = rRowData.begin(); cell != rRowData.end(); ++cell )
+ cell->second = i_value;
+ }
-::rtl::OUString SAL_CALL DefaultGridDataModel::getImplementationName( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridDataModel" ) );
- return aImplName;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::addGridDataListener( const Reference< grid::XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.addListener( XGridDataListener::static_type(), i_listener );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::removeGridDataListener( const Reference< grid::XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.removeListener( XGridDataListener::static_type(), i_listener );
+ }
-sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL DefaultGridDataModel::disposing()
+ {
+ ::com::sun::star::lang::EventObject aEvent;
+ aEvent.Source.set( *this );
+ rBHelper.aLC.disposeAndClear( aEvent );
-//---------------------------------------------------------------------
+ ::osl::MutexGuard aGuard( m_aMutex );
+ GridData aEmptyData;
+ m_aData.swap( aEmptyData );
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aServiceName( OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
- static const Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
+ ::std::vector< Any > aEmptyRowHeaders;
+ m_aRowHeaders.swap( aEmptyRowHeaders );
-}
+ m_nColumnCount = 0;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DefaultGridDataModel::getImplementationName( ) throw (RuntimeException)
+ {
+ static const ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.DefaultGridDataModel" ) );
+ return aImplName;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL DefaultGridDataModel::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
+ {
+ return ServiceName.equalsAscii( szServiceName_DefaultGridDataModel );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL DefaultGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ static const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( szServiceName_DefaultGridDataModel ) );
+ static const Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL DefaultGridDataModel::createClone( ) throw (RuntimeException)
+ {
+ return new DefaultGridDataModel( *this );
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
Reference< XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const Reference< XMultiServiceFactory >& )
{
diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.hxx b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
index ea11a8a9a00a..bf4b6cc3355e 100644
--- a/toolkit/source/controls/grid/defaultgriddatamodel.hxx
+++ b/toolkit/source/controls/grid/defaultgriddatamodel.hxx
@@ -25,60 +25,68 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
-#include <com/sun/star/awt/grid/XGridDataModel.hpp>
-#include <com/sun/star/awt/grid/GridDataEvent.hpp>
-#include <com/sun/star/awt/grid/XGridDataListener.hpp>
-#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/awt/grid/XMutableGridDataModel.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-#include <rtl/ref.hxx>
-#include <vector>
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase2.hxx>
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
-using ::rtl::OUString;
+#include <vector>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::awt::grid;
using namespace ::com::sun::star::lang;
+namespace comphelper
+{
+ class ComponentGuard;
+}
+
namespace toolkit
{
enum broadcast_type { row_added, row_removed, data_changed};
-class DefaultGridDataModel : public ::cppu::WeakImplHelper2< XGridDataModel, XServiceInfo >,
- public MutexAndBroadcastHelper
+typedef ::cppu::WeakComponentImplHelper2 < XMutableGridDataModel
+ , XServiceInfo
+ > DefaultGridDataModel_Base;
+
+class DefaultGridDataModel :public ::cppu::BaseMutex
+ ,public DefaultGridDataModel_Base
{
public:
DefaultGridDataModel();
+ DefaultGridDataModel( DefaultGridDataModel const & i_copySource );
virtual ~DefaultGridDataModel();
+ // XMutableGridDataModel
+ virtual void SAL_CALL addRow( const Any& i_heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeRow( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAllRows( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellData( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowData( const ::com::sun::star::uno::Sequence< ::sal_Int32 >& ColumnIndexes, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowHeading( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Heading ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellToolTip( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowToolTip( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
// XGridDataModel
- virtual ::sal_Int32 SAL_CALL getRowHeight() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRowHeight(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getRowCount() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowHeaders() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRowHeaders(const ::com::sun::star::uno::Sequence< ::rtl::OUString > & value) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Any > > SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addRow(const ::rtl::OUString & headername, const ::com::sun::star::uno::Sequence< Any > & data) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeRow(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeDataListener( const Reference< XGridDataListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeAll() throw (RuntimeException);
- virtual void SAL_CALL setRowHeaderWidth(sal_Int32 _value) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getRowHeaderWidth() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCell( ::sal_Int32 row, ::sal_Int32 column, const ::com::sun::star::uno::Any& value ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow( ::sal_Int32 row, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& columns, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& values ) throw (::com::sun::star::uno::RuntimeException);
- // XComponent
- virtual void SAL_CALL dispose( ) throw (RuntimeException);
- virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getRowHeading( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
@@ -86,16 +94,25 @@ public:
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
private:
+ typedef ::std::pair< Any, Any > CellData;
+ typedef ::std::vector< CellData > RowData;
+ typedef ::std::vector< RowData > GridData;
+
+ void broadcast(
+ GridDataEvent const & i_event,
+ void ( SAL_CALL ::com::sun::star::awt::grid::XGridDataListener::*i_listenerMethod )( ::com::sun::star::awt::grid::GridDataEvent const & ),
+ ::comphelper::ComponentGuard & i_instanceLock
+ );
+
+ void impl_addRow( Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount = -1 );
- void broadcast( broadcast_type eType, const GridDataEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException);
- void broadcast_changed( ::rtl::OUString name, sal_Int32 index, Any oldValue, Any newValue ) throw (::com::sun::star::uno::RuntimeException);
- void broadcast_add( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException);
- void broadcast_remove( sal_Int32 index, const ::rtl::OUString & headerName, const ::com::sun::star::uno::Sequence< Any > rowData ) throw (::com::sun::star::uno::RuntimeException);
+ CellData const & impl_getCellData_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ) const;
+ CellData& impl_getCellDataAccess_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex );
+ RowData& impl_getRowDataAccess_throw( sal_Int32 const i_rowIndex, size_t const i_requiredColumnCount );
- sal_Int32 rowHeight;
- std::vector< std::vector < Any > > data;
- std::vector< ::rtl::OUString > rowHeaders;
- sal_Int32 m_nRowHeaderWidth;
+ GridData m_aData;
+ ::std::vector< ::com::sun::star::uno::Any > m_aRowHeaders;
+ sal_Int32 m_nColumnCount;
};
}
diff --git a/toolkit/source/controls/grid/gridcolumn.cxx b/toolkit/source/controls/grid/gridcolumn.cxx
index 6720d639f5c1..c1216d53f328 100644
--- a/toolkit/source/controls/grid/gridcolumn.cxx
+++ b/toolkit/source/controls/grid/gridcolumn.cxx
@@ -25,281 +25,305 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
#include "gridcolumn.hxx"
+
#include <comphelper/sequence.hxx>
+#include <cppuhelper/typeprovider.hxx>
#include <toolkit/helper/servicenames.hxx>
-#include <rtl/ref.hxx>
-
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::style;
-
-#define COLWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ColWidth" ))
-#define MAXWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MaxWidth" ))
-#define MINWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MinWidth" ))
-#define PREFWIDTH ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PrefWidth" ))
-#define HALIGN ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "HAlign" ))
-#define TITLE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Title" ))
-#define COLRESIZE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ColumnResize" ))
-#define UPDATE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UpdateWidth" ))
namespace toolkit
{
-
-///////////////////////////////////////////////////////////////////////
-// class GridColumn
-///////////////////////////////////////////////////////////////////////
-
-GridColumn::GridColumn()
-: identifier(Any())
-,index(0)
-,columnWidth(4)
-,preferredWidth(0)
-,maxWidth(0)
-,minWidth(0)
-,bResizeable(true)
-,horizontalAlign(HorizontalAlignment(0))
-{
-}
-
-//---------------------------------------------------------------------
-
-GridColumn::~GridColumn()
-{
-}
-
-//---------------------------------------------------------------------
-
-void GridColumn::broadcast( broadcast_column_type eType, const GridColumnEvent& aEvent )
-{
- ::cppu::OInterfaceContainerHelper* pIter = BrdcstHelper.getContainer( XGridColumnListener::static_type() );
- if( pIter )
- {
- ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
- while(aListIter.hasMoreElements())
- {
- XGridColumnListener* pListener = static_cast<XGridColumnListener*>(aListIter.next());
- switch( eType )
- {
- case column_attribute_changed: pListener->columnChanged(aEvent); break;
- }
- }
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::awt;
+ using namespace ::com::sun::star::awt::grid;
+ using namespace ::com::sun::star::lang;
+ using namespace ::com::sun::star::util;
+ using namespace ::com::sun::star::style;
+
+ //==================================================================================================================
+ //= DefaultGridColumnModel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn::GridColumn()
+ :GridColumn_Base( m_aMutex )
+ ,m_aIdentifier()
+ ,m_nIndex(-1)
+ ,m_nDataColumnIndex(-1)
+ ,m_nColumnWidth(4)
+ ,m_nMaxWidth(0)
+ ,m_nMinWidth(0)
+ ,m_nFlexibility(1)
+ ,m_bResizeable(true)
+ ,m_eHorizontalAlign( HorizontalAlignment_LEFT )
+ {
}
-}
-
-//---------------------------------------------------------------------
-
-void GridColumn::broadcast_changed(::rtl::OUString name, Any oldValue, Any newValue)
-{
- Reference< XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
- GridColumnEvent aEvent( xSource, name, oldValue, newValue, index);
- broadcast( column_attribute_changed, aEvent);
-}
-
-void SAL_CALL GridColumn::updateColumn(const ::rtl::OUString& name, sal_Int32 width) throw (::com::sun::star::uno::RuntimeException)
-{
- if(PREFWIDTH == name)
- preferredWidth = width;
- else if (COLWIDTH == name)
- columnWidth = width;
-}
-//---------------------------------------------------------------------
-// XGridColumn
-//---------------------------------------------------------------------
-
-::com::sun::star::uno::Any SAL_CALL GridColumn::getIdentifier() throw (::com::sun::star::uno::RuntimeException)
-{
- return identifier;
-}
-//---------------------------------------------------------------------
-
-void SAL_CALL GridColumn::setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException)
-{
- value >>= identifier;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn::GridColumn( GridColumn const & i_copySource )
+ :cppu::BaseMutex()
+ ,GridColumn_Base( m_aMutex )
+ ,m_aIdentifier( i_copySource.m_aIdentifier )
+ ,m_nIndex( -1 )
+ ,m_nDataColumnIndex( i_copySource.m_nDataColumnIndex )
+ ,m_nColumnWidth( i_copySource.m_nColumnWidth )
+ ,m_nMaxWidth( i_copySource.m_nMaxWidth )
+ ,m_nMinWidth( i_copySource.m_nMinWidth )
+ ,m_nFlexibility( i_copySource.m_nFlexibility )
+ ,m_bResizeable( i_copySource.m_bResizeable )
+ ,m_sTitle( i_copySource.m_sTitle )
+ ,m_sHelpText( i_copySource.m_sHelpText )
+ ,m_eHorizontalAlign( i_copySource.m_eHorizontalAlign )
+ {
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn::~GridColumn()
+ {
+ }
-::sal_Int32 SAL_CALL GridColumn::getColumnWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- broadcast_changed(UPDATE, Any(columnWidth), Any());
- return columnWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void GridColumn::broadcast_changed( sal_Char const * const i_asciiAttributeName, Any i_oldValue, Any i_newValue,
+ ::comphelper::ComponentGuard& i_Guard )
+ {
+ Reference< XInterface > const xSource( static_cast< ::cppu::OWeakObject* >( this ) );
+ GridColumnEvent const aEvent(
+ xSource, ::rtl::OUString::createFromAscii( i_asciiAttributeName ),
+ i_oldValue, i_newValue, m_nIndex
+ );
-//--------------------------------------------------------------------
+ ::cppu::OInterfaceContainerHelper* pIter = rBHelper.getContainer( XGridColumnListener::static_type() );
-void SAL_CALL GridColumn::setColumnWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- columnWidth = value;
- broadcast_changed(COLWIDTH, Any(columnWidth),Any(value));
-}
-//--------------------------------------------------------------------
+ i_Guard.clear();
+ if( pIter )
+ pIter->notifyEach( &XGridColumnListener::columnChanged, aEvent );
+ }
-::sal_Int32 SAL_CALL GridColumn::getPreferredWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- broadcast_changed(UPDATE, Any(preferredWidth), Any());
- return preferredWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Any SAL_CALL GridColumn::getIdentifier() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_aIdentifier;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ m_aIdentifier = value;
+ }
-void SAL_CALL GridColumn::setPreferredWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- preferredWidth = value;
- broadcast_changed(PREFWIDTH, Any(preferredWidth),Any(value));
-}
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getColumnWidth() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nColumnWidth;
+ }
-::sal_Int32 SAL_CALL GridColumn::getMaxWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- return maxWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setColumnWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_nColumnWidth, value, "ColumnWidth" );
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getMaxWidth() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nMaxWidth;
+ }
-void SAL_CALL GridColumn::setMaxWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- maxWidth = value;
- broadcast_changed(MAXWIDTH, Any(maxWidth),Any(value));
-}
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setMaxWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_nMaxWidth, value, "MaxWidth" );
+ }
-::sal_Int32 SAL_CALL GridColumn::getMinWidth() throw (::com::sun::star::uno::RuntimeException)
-{
- return minWidth;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getMinWidth() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nMinWidth;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setMinWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_nMinWidth, value, "MinWidth" );
+ }
-void SAL_CALL GridColumn::setMinWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
-{
- minWidth = value;
- broadcast_changed(MINWIDTH, Any(minWidth),Any(value));
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL GridColumn::getTitle() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_sTitle;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_sTitle, value, "Title" );
+ }
-::rtl::OUString SAL_CALL GridColumn::getTitle() throw (::com::sun::star::uno::RuntimeException)
-{
- return title;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL GridColumn::getHelpText() throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_sHelpText;
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setHelpText( const ::rtl::OUString & value ) throw (RuntimeException)
+ {
+ impl_set( m_sHelpText, value, "HelpText" );
+ }
-void SAL_CALL GridColumn::setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException)
-{
- title = value;
- broadcast_changed(TITLE, Any(title),Any(value));
-}
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL GridColumn::getResizeable() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_bResizeable;
+ }
-sal_Bool SAL_CALL GridColumn::getResizeable() throw (::com::sun::star::uno::RuntimeException)
-{
- return bResizeable;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setResizeable(sal_Bool value) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_bResizeable, value, "Resizeable" );
+ }
-//--------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getFlexibility() throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nFlexibility;
+ }
-void SAL_CALL GridColumn::setResizeable(sal_Bool value) throw (::com::sun::star::uno::RuntimeException)
-{
- bResizeable = value;
- broadcast_changed(COLRESIZE, Any(bResizeable),Any(value));
-}
-//---------------------------------------------------------------------
-HorizontalAlignment SAL_CALL GridColumn::getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException)
-{
- return horizontalAlign;
-}
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setFlexibility( ::sal_Int32 i_value ) throw (IllegalArgumentException, RuntimeException)
+ {
+ if ( i_value < 0 )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+ impl_set( m_nFlexibility, i_value, "Flexibility" );
+ }
-void SAL_CALL GridColumn::setHorizontalAlign(HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException)
-{
- horizontalAlign = align;
- broadcast_changed(HALIGN, Any(horizontalAlign),Any(align));
-}
-//---------------------------------------------------------------------
-void SAL_CALL GridColumn::addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XGridColumnListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ HorizontalAlignment SAL_CALL GridColumn::getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_eHorizontalAlign;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setHorizontalAlign(HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException)
+ {
+ impl_set( m_eHorizontalAlign, align, "HorizontalAlign" );
+ }
-void SAL_CALL GridColumn::removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XGridColumnListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::addGridColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
+ {
+ rBHelper.addListener( XGridColumnListener::static_type(), xListener );
+ }
-//---------------------------------------------------------------------
-// XComponent
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::removeGridColumnListener( const Reference< XGridColumnListener >& xListener ) throw (RuntimeException)
+ {
+ rBHelper.removeListener( XGridColumnListener::static_type(), xListener );
+ }
-void SAL_CALL GridColumn::dispose() throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::disposing()
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_aIdentifier.clear();
+ m_sTitle = m_sHelpText = ::rtl::OUString();
+ }
- ::com::sun::star::lang::EventObject aEvent;
- aEvent.Source.set( static_cast< ::cppu::OWeakObject* >( this ) );
- BrdcstHelper.aLC.disposeAndClear( aEvent );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getIndex() throw (RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nIndex;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void GridColumn::setIndex( sal_Int32 const i_index )
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ m_nIndex = i_index;
+ }
-void SAL_CALL GridColumn::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.addListener( XEventListener::static_type(), xListener );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL GridColumn::getDataColumnIndex() throw(RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ return m_nDataColumnIndex;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridColumn::setDataColumnIndex( ::sal_Int32 i_dataColumnIndex ) throw(RuntimeException)
+ {
+ impl_set( m_nDataColumnIndex, i_dataColumnIndex, "DataColumnIndex" );
+ }
-void SAL_CALL GridColumn::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
-{
- BrdcstHelper.removeListener( XEventListener::static_type(), xListener );
-}
-void SAL_CALL GridColumn::setIndex(sal_Int32 _nIndex) throw (::com::sun::star::uno::RuntimeException)
-{
- index = _nIndex;
-}
-//---------------------------------------------------------------------
-// XServiceInfo
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL GridColumn::getImplementationName( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.GridColumn" ) );
+ }
-::rtl::OUString SAL_CALL GridColumn::getImplementationName( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.GridColumn" ) );
- return aImplName;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL GridColumn::supportsService( const ::rtl::OUString& i_serviceName ) throw (RuntimeException)
+ {
+ const Sequence< ::rtl::OUString > aServiceNames( getSupportedServiceNames() );
+ for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
+ if ( aServiceNames[i] == i_serviceName )
+ return sal_True;
+ return sal_False;
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GridColumn::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( szServiceName_GridColumn ) );
+ const Sequence< ::rtl::OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+ }
-sal_Bool SAL_CALL GridColumn::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return ServiceName.equalsAscii( szServiceName_GridColumn );
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL GridColumn::createClone( ) throw (RuntimeException)
+ {
+ return new GridColumn( *this );
+ }
-//---------------------------------------------------------------------
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Int64 SAL_CALL GridColumn::getSomething( const Sequence< sal_Int8 >& i_identifier ) throw(RuntimeException)
+ {
+ if ( ( i_identifier.getLength() == 16 ) && ( i_identifier == getUnoTunnelId() ) )
+ return ::sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
+ return 0;
+ }
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GridColumn::getSupportedServiceNames( ) throw (RuntimeException)
-{
- ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- static const OUString aServiceName( OUString::createFromAscii( szServiceName_GridColumn ) );
- static const Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< sal_Int8 > GridColumn::getUnoTunnelId() throw()
+ {
+ static ::cppu::OImplementationId const aId;
+ return aId.getImplementationId();
+ }
+ //------------------------------------------------------------------------------------------------------------------
+ GridColumn* GridColumn::getImplementation( const Reference< XInterface >& i_component )
+ {
+ Reference< XUnoTunnel > const xTunnel( i_component, UNO_QUERY );
+ if ( xTunnel.is() )
+ return reinterpret_cast< GridColumn* >( ::sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( getUnoTunnelId() ) ) );
+ return NULL;
+ }
}
-Reference< XInterface > SAL_CALL GridColumn_CreateInstance( const Reference< XMultiServiceFactory >& )
+::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 >& )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::GridColumn );
+ return *( new ::toolkit::GridColumn );
}
diff --git a/toolkit/source/controls/grid/gridcolumn.hxx b/toolkit/source/controls/grid/gridcolumn.hxx
index 38d43d55a07b..b1be836a3862 100644
--- a/toolkit/source/controls/grid/gridcolumn.hxx
+++ b/toolkit/source/controls/grid/gridcolumn.hxx
@@ -25,83 +25,111 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
+
#include <com/sun/star/awt/grid/XGridColumn.hpp>
-#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
-#include <com/sun/star/awt/grid/GridColumnEvent.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <comphelper/componentguard.hxx>
#include <rtl/ref.hxx>
-#include <vector>
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
-#include <com/sun/star/style/HorizontalAlignment.hpp>
-using ::rtl::OUString;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::awt::grid;
-using namespace ::com::sun::star::lang;
+#include <vector>
namespace toolkit
{
-enum broadcast_column_type { column_attribute_changed};
-class GridColumn : public ::cppu::WeakImplHelper2< XGridColumn, XServiceInfo >,
- public MutexAndBroadcastHelper
+typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::awt::grid::XGridColumn
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XUnoTunnel
+ > GridColumn_Base;
+class GridColumn :public ::cppu::BaseMutex
+ ,public GridColumn_Base
{
public:
GridColumn();
+ GridColumn( GridColumn const & i_copySource );
virtual ~GridColumn();
- // XGridColumn
+ // ::com::sun::star::awt::grid::XGridColumn
virtual ::com::sun::star::uno::Any SAL_CALL getIdentifier() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getColumnWidth() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setColumnWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getPreferredWidth() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setPreferredWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getMaxWidth() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setMaxWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getMinWidth() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setMinWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getResizeable() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setResizeable(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFlexibility() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFlexibility( ::sal_Int32 _flexibility ) throw (::com::sun::star::lang::IllegalArgumentException, ::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 & value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getHelpText() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpText(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDataColumnIndex() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDataColumnIndex( ::sal_Int32 i_dataColumnIndex ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::style::HorizontalAlignment SAL_CALL getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setHorizontalAlign(::com::sun::star::style::HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addColumnListener( const Reference< XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeColumnListener( const Reference< XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateColumn( const ::rtl::OUString& name, ::sal_Int32 width ) throw (::com::sun::star::uno::RuntimeException);
- // XComponent
- virtual void SAL_CALL dispose( ) throw (RuntimeException);
- virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException);
- virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
+ virtual void SAL_CALL addGridColumnListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridColumnListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XCloneable (base of XGridColumn)
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XUnoTunnel and friends
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& i_identifier ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelId() throw();
+ static GridColumn* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_component );
+
+ // attribute access
+ void setIndex( sal_Int32 const i_index );
- virtual void SAL_CALL setIndex(sal_Int32 _nIndex)throw (::com::sun::star::uno::RuntimeException);
private:
- void broadcast( broadcast_column_type eType, const GridColumnEvent& aEvent );
- void broadcast_changed( ::rtl::OUString name, Any oldValue, Any newValue);
-
- Any identifier;
- sal_Int32 index;
- sal_Int32 columnWidth;
- sal_Int32 preferredWidth;
- sal_Int32 maxWidth;
- sal_Int32 minWidth;
- sal_Bool bResizeable;
- ::rtl::OUString title;
- ::com::sun::star::style::HorizontalAlignment horizontalAlign;
+ void broadcast_changed(
+ sal_Char const * const i_asciiAttributeName,
+ ::com::sun::star::uno::Any i_oldValue,
+ ::com::sun::star::uno::Any i_newValue,
+ ::comphelper::ComponentGuard& i_Guard
+ );
+
+ template< class TYPE >
+ void impl_set( TYPE & io_attribute, TYPE const & i_newValue, sal_Char const * i_attributeName )
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ if ( io_attribute == i_newValue )
+ return;
+
+ TYPE const aOldValue( io_attribute );
+ io_attribute = i_newValue;
+ broadcast_changed( i_attributeName, ::com::sun::star::uno::makeAny( aOldValue ), ::com::sun::star::uno::makeAny( io_attribute ), aGuard );
+ }
+
+ ::com::sun::star::uno::Any m_aIdentifier;
+ sal_Int32 m_nIndex;
+ sal_Int32 m_nDataColumnIndex;
+ sal_Int32 m_nColumnWidth;
+ sal_Int32 m_nMaxWidth;
+ sal_Int32 m_nMinWidth;
+ sal_Int32 m_nFlexibility;
+ sal_Bool m_bResizeable;
+ ::rtl::OUString m_sTitle;
+ ::rtl::OUString m_sHelpText;
+ ::com::sun::star::style::HorizontalAlignment m_eHorizontalAlign;
};
}
diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx
index 5125c1349ade..acda52753a60 100644
--- a/toolkit/source/controls/grid/gridcontrol.cxx
+++ b/toolkit/source/controls/grid/gridcontrol.cxx
@@ -28,22 +28,27 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
-#include <gridcontrol.hxx>
+#include "gridcontrol.hxx"
+#include "grideventforwarder.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/view/SelectionType.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
+#include <com/sun/star/awt/grid/XMutableGridDataModel.hpp>
+#include <com/sun/star/awt/grid/DefaultGridDataModel.hpp>
+#include <com/sun/star/awt/grid/SortableGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
-#include <com/sun/star/awt/grid/ScrollBarMode.hpp>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <toolkit/helper/property.hxx>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <comphelper/processfactory.hxx>
-#include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
+#include <tools/color.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::awt::grid;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
@@ -52,10 +57,28 @@ using namespace ::com::sun::star::view;
namespace toolkit
{
-// ----------------------------------------------------
-// class UnoGridModel
-// ----------------------------------------------------
-UnoGridModel::UnoGridModel()
+//======================================================================================================================
+//= UnoGridModel
+//======================================================================================================================
+namespace
+{
+ Reference< XGridDataModel > lcl_getDefaultDataModel_throw( ::comphelper::ComponentContext const & i_context )
+ {
+ Reference< XMutableGridDataModel > const xDelegatorModel( DefaultGridDataModel::create( i_context.getUNOContext() ), UNO_QUERY_THROW );
+ Reference< XGridDataModel > const xDataModel( SortableGridDataModel::create( i_context.getUNOContext(), xDelegatorModel ), UNO_QUERY_THROW );
+ return xDataModel;
+ }
+
+ Reference< XGridColumnModel > lcl_getDefaultColumnModel_throw( ::comphelper::ComponentContext const & i_context )
+ {
+ Reference< XGridColumnModel > const xColumnModel( i_context.createComponent( "com.sun.star.awt.grid.DefaultGridColumnModel" ), UNO_QUERY_THROW );
+ return xColumnModel;
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -71,36 +94,131 @@ UnoGridModel::UnoGridModel()
ImplRegisterProperty( BASEPROPERTY_VSCROLL );
ImplRegisterProperty( BASEPROPERTY_TABSTOP );
ImplRegisterProperty( BASEPROPERTY_GRID_SHOWROWHEADER );
+ ImplRegisterProperty( BASEPROPERTY_ROW_HEADER_WIDTH );
ImplRegisterProperty( BASEPROPERTY_GRID_SHOWCOLUMNHEADER );
- ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL );
- ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL );
+ ImplRegisterProperty( BASEPROPERTY_COLUMN_HEADER_HEIGHT );
+ ImplRegisterProperty( BASEPROPERTY_ROW_HEIGHT );
+ ImplRegisterProperty( BASEPROPERTY_GRID_DATAMODEL, makeAny( lcl_getDefaultDataModel_throw( maContext ) ) );
+ ImplRegisterProperty( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( lcl_getDefaultColumnModel_throw( maContext ) ) );
ImplRegisterProperty( BASEPROPERTY_GRID_SELECTIONMODE );
ImplRegisterProperty( BASEPROPERTY_FONTRELIEF );
ImplRegisterProperty( BASEPROPERTY_FONTEMPHASISMARK );
ImplRegisterProperty( BASEPROPERTY_FONTDESCRIPTOR );
ImplRegisterProperty( BASEPROPERTY_TEXTCOLOR );
- ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
- ImplRegisterProperty( BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND );
- ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_BACKGROUND );
+ ImplRegisterProperty( BASEPROPERTY_TEXTLINECOLOR );
+ ImplRegisterProperty( BASEPROPERTY_USE_GRID_LINES );
ImplRegisterProperty( BASEPROPERTY_GRID_LINE_COLOR );
- ImplRegisterProperty( BASEPROPERTY_GRID_ROW_BACKGROUND );
+ ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_BACKGROUND );
+ ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_TEXT_COLOR );
+ ImplRegisterProperty( BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS );
+ ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
}
+//----------------------------------------------------------------------------------------------------------------------
UnoGridModel::UnoGridModel( const UnoGridModel& rModel )
-: UnoControlModel( rModel )
+ :UnoControlModel( rModel )
{
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ Reference< XGridDataModel > xDataModel;
+ // clone the data model
+ const Reference< XFastPropertySet > xCloneSource( &const_cast< UnoGridModel& >( rModel ) );
+ try
+ {
+ const Reference< XCloneable > xCloneable( xCloneSource->getFastPropertyValue( BASEPROPERTY_GRID_DATAMODEL ), UNO_QUERY_THROW );
+ xDataModel.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ if ( !xDataModel.is() )
+ xDataModel = lcl_getDefaultDataModel_throw( maContext );
+ UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_DATAMODEL, makeAny( xDataModel ) );
+ // do *not* use setFastPropertyValue here: The UnoControlModel ctor did a simple copy of all property values,
+ // so before this call here, we share our data model with the own of the clone source. setFastPropertyValue,
+ // then, disposes the old data model - which means the data model which in fact belongs to the clone source.
+ // so, call the UnoControlModel's impl-method for setting the value.
+
+ // clone the column model
+ Reference< XGridColumnModel > xColumnModel;
+ try
+ {
+ const Reference< XCloneable > xCloneable( xCloneSource->getFastPropertyValue( BASEPROPERTY_GRID_COLUMNMODEL ), UNO_QUERY_THROW );
+ xColumnModel.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ if ( !xColumnModel.is() )
+ xColumnModel = lcl_getDefaultColumnModel_throw( maContext );
+ UnoControlModel::setFastPropertyValue_NoBroadcast( BASEPROPERTY_GRID_COLUMNMODEL, makeAny( xColumnModel ) );
+ // same comment as above: do not use our own setPropertyValue here.
+ }
+ osl_decrementInterlockedCount( &m_refCount );
}
+//----------------------------------------------------------------------------------------------------------------------
UnoControlModel* UnoGridModel::Clone() const
{
return new UnoGridModel( *this );
}
+//----------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ void lcl_dispose_nothrow( const Any& i_component )
+ {
+ try
+ {
+ const Reference< XComponent > xComponent( i_component, UNO_QUERY_THROW );
+ xComponent->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridModel::dispose( ) throw(RuntimeException)
+{
+ lcl_dispose_nothrow( getFastPropertyValue( BASEPROPERTY_GRID_COLUMNMODEL ) );
+ lcl_dispose_nothrow( getFastPropertyValue( BASEPROPERTY_GRID_DATAMODEL ) );
+
+ UnoControlModel::dispose();
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception)
+{
+ Any aOldSubModel;
+ if ( ( nHandle == BASEPROPERTY_GRID_COLUMNMODEL ) || ( nHandle == BASEPROPERTY_GRID_DATAMODEL ) )
+ {
+ aOldSubModel = getFastPropertyValue( nHandle );
+ if ( aOldSubModel == rValue )
+ {
+ OSL_ENSURE( false, "UnoGridModel::setFastPropertyValue_NoBroadcast: setting the same value, again!" );
+ // shouldn't this have been caught by convertFastPropertyValue?
+ aOldSubModel.clear();
+ }
+ }
+
+ UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
+
+ if ( aOldSubModel.hasValue() )
+ lcl_dispose_nothrow( aOldSubModel );
+}
+
+//----------------------------------------------------------------------------------------------------------------------
OUString UnoGridModel::getServiceName() throw(RuntimeException)
{
return OUString::createFromAscii( szServiceName_GridControlModel );
}
+//----------------------------------------------------------------------------------------------------------------------
Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
switch( nPropId )
@@ -110,27 +228,26 @@ Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
case BASEPROPERTY_GRID_SELECTIONMODE:
return uno::makeAny( SelectionType(1) );
case BASEPROPERTY_GRID_SHOWROWHEADER:
+ case BASEPROPERTY_USE_GRID_LINES:
return uno::makeAny( (sal_Bool)sal_False );
+ case BASEPROPERTY_ROW_HEADER_WIDTH:
+ return uno::makeAny( sal_Int32( 10 ) );
case BASEPROPERTY_GRID_SHOWCOLUMNHEADER:
- return uno::makeAny( (sal_Bool)sal_False );
- case BASEPROPERTY_GRID_DATAMODEL:
- return uno::makeAny( Reference<XGridDataModel> ());
- case BASEPROPERTY_GRID_COLUMNMODEL:
- return uno::makeAny(Reference<XGridColumnModel>() );
- case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND:
- return uno::makeAny( com::sun::star::util::Color(0xFFFFFF) );
+ return uno::makeAny( (sal_Bool)sal_True );
+ case BASEPROPERTY_COLUMN_HEADER_HEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
case BASEPROPERTY_GRID_HEADER_BACKGROUND:
- return uno::makeAny( com::sun::star::util::Color(0xFFFFFF) );
+ case BASEPROPERTY_GRID_HEADER_TEXT_COLOR:
case BASEPROPERTY_GRID_LINE_COLOR:
- return uno::makeAny( com::sun::star::util::Color(0xFFFFFF) );
- case BASEPROPERTY_GRID_ROW_BACKGROUND:
- return uno::makeAny(com::sun::star::util::Color(0xFFFFFF) );
+ case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS:
+ return Any();
default:
return UnoControlModel::ImplGetDefaultValue( nPropId );
}
}
+//----------------------------------------------------------------------------------------------------------------------
::cppu::IPropertyArrayHelper& UnoGridModel::getInfoHelper()
{
static UnoPropertyArrayHelper* pHelper = NULL;
@@ -142,6 +259,7 @@ Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return *pHelper;
}
+//----------------------------------------------------------------------------------------------------------------------
// XMultiPropertySet
Reference< XPropertySetInfo > UnoGridModel::getPropertySetInfo( ) throw(RuntimeException)
{
@@ -150,20 +268,29 @@ Reference< XPropertySetInfo > UnoGridModel::getPropertySetInfo( ) throw(Runtime
}
-// ----------------------------------------------------
-// class UnoGridControl
-// ----------------------------------------------------
-UnoGridControl::UnoGridControl()
-: mSelectionMode(SelectionType(1)),
- m_aSelectionListeners( *this )
+//======================================================================================================================
+//= UnoGridControl
+//======================================================================================================================
+UnoGridControl::UnoGridControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoGridControl_Base( i_factory )
+ ,mSelectionMode(SelectionType(1))
+ ,m_aSelectionListeners( *this )
+ ,m_pEventForwarder( new GridEventForwarder( *this ) )
+{
+}
+
+//----------------------------------------------------------------------------------------------------------------------
+UnoGridControl::~UnoGridControl()
{
}
+//----------------------------------------------------------------------------------------------------------------------
OUString UnoGridControl::GetComponentServiceName()
{
return OUString::createFromAscii( "Grid" );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::dispose( ) throw(RuntimeException)
{
lang::EventObject aEvt;
@@ -172,113 +299,155 @@ void SAL_CALL UnoGridControl::dispose( ) throw(RuntimeException)
UnoControl::dispose();
}
-void UnoGridControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
{
UnoControlBase::createPeer( rxToolkit, rParentPeer );
- Reference< XGridControl > xGrid( getPeer(), UNO_QUERY_THROW );
+ const Reference< XGridControl > xGrid( getPeer(), UNO_QUERY_THROW );
xGrid->addSelectionListener(&m_aSelectionListeners);
+}
- Reference<XGridDataListener> xListener ( getPeer(), UNO_QUERY_THROW );
- Reference<XGridColumnListener> xColListener ( getPeer(), UNO_QUERY_THROW );
- Reference<XPropertySet> xPropSet ( getModel(), UNO_QUERY_THROW );
-
- Reference<XGridDataModel> xGridDataModel ( xPropSet->getPropertyValue(OUString::createFromAscii( "GridDataModel" )), UNO_QUERY_THROW );
- if(xGridDataModel != NULL)
- xGridDataModel->addDataListener(xListener);
- Reference<XGridColumnModel> xGridColumnModel ( xPropSet->getPropertyValue(OUString::createFromAscii( "ColumnModel" )), UNO_QUERY_THROW );
- if(xGridColumnModel != NULL)
+//----------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ void lcl_setEventForwarding( const Reference< XControlModel >& i_gridControlModel, const ::boost::scoped_ptr< GridEventForwarder >& i_listener,
+ bool const i_add )
{
- for(int i = 0;i<xGridColumnModel->getColumnCount();i++)
+ const Reference< XPropertySet > xModelProps( i_gridControlModel, UNO_QUERY );
+ if ( !xModelProps.is() )
+ return;
+
+ try
{
- xGridColumnModel->getColumn(i)->addColumnListener(xColListener);
+ Reference< XContainer > const xColModel(
+ xModelProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnModel" ) ) ),
+ UNO_QUERY_THROW );
+ if ( i_add )
+ xColModel->addContainerListener( i_listener.get() );
+ else
+ xColModel->removeContainerListener( i_listener.get() );
+
+ Reference< XGridDataModel > const xDataModel(
+ xModelProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridDataModel" ) ) ),
+ UNO_QUERY_THROW
+ );
+ Reference< XMutableGridDataModel > const xMutableDataModel( xDataModel, UNO_QUERY );
+ if ( xMutableDataModel.is() )
+ {
+ if ( i_add )
+ xMutableDataModel->addGridDataListener( i_listener.get() );
+ else
+ xMutableDataModel->removeGridDataListener( i_listener.get() );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
+//----------------------------------------------------------------------------------------------------------------------
+sal_Bool SAL_CALL UnoGridControl::setModel( const Reference< XControlModel >& i_model ) throw(RuntimeException)
+{
+ lcl_setEventForwarding( getModel(), m_pEventForwarder, false );
+ if ( !UnoGridControl_Base::setModel( i_model ) )
+ return sal_False;
+ lcl_setEventForwarding( getModel(), m_pEventForwarder, true );
+ return sal_True;
+}
-// -------------------------------------------------------------------
-// XGridControl
-
-::sal_Int32 UnoGridControl::getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 UnoGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl > xGrid ( getPeer(), UNO_QUERY_THROW );
- return xGrid->getItemIndexAtPoint( x, y );
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getRowAtPoint( x, y );
}
-void SAL_CALL UnoGridControl::setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 UnoGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->setToolTip( text, columns );
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getColumnAtPoint( x, y );
}
-// -------------------------------------------------------------------
-// XGridSelection
-// -------------------------------------------------------------------
-::sal_Int32 SAL_CALL UnoGridControl::getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 SAL_CALL UnoGridControl::getCurrentColumn( ) throw (RuntimeException)
{
- return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getMinSelectionIndex();
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getCurrentColumn();
}
-::sal_Int32 SAL_CALL UnoGridControl::getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+::sal_Int32 SAL_CALL UnoGridControl::getCurrentRow( ) throw (RuntimeException)
{
- return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getMaxSelectionIndex();
+ Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW );
+ return xGrid->getCurrentRow();
}
-void SAL_CALL UnoGridControl::selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRows( rangeOfRows);
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRow( i_rowIndex );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectAllRows();
}
-void SAL_CALL UnoGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException)
+
+//----------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UnoGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException)
{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectRows( rangeOfRows);
+ Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectRow( i_rowIndex );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException)
{
Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectAllRows();
}
+
+//----------------------------------------------------------------------------------------------------------------------
::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL UnoGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException)
{
return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getSelection();
}
+//----------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL UnoGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException)
{
return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectionEmpty();
}
+//----------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL UnoGridControl::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException)
{
return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectedIndex( index );
}
-void SAL_CALL UnoGridControl::selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException)
-{
- Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRow( y );
-}
-
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.addInterface( listener );
}
+//----------------------------------------------------------------------------------------------------------------------
void SAL_CALL UnoGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException)
{
m_aSelectionListeners.removeInterface( listener );
}
+
}//namespace toolkit
-Reference< XInterface > SAL_CALL GridControl_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL GridControl_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridControl );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridControl( i_factory ) );
}
-Reference< XInterface > SAL_CALL GridControlModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL GridControlModel_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridModel );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoGridModel( i_factory ) );
}
diff --git a/toolkit/source/controls/grid/gridcontrol.hxx b/toolkit/source/controls/grid/gridcontrol.hxx
index 0c8ddb1c02b6..61d9f8fc0232 100644
--- a/toolkit/source/controls/grid/gridcontrol.hxx
+++ b/toolkit/source/controls/grid/gridcontrol.hxx
@@ -30,21 +30,20 @@
#include <com/sun/star/awt/grid/XGridControl.hpp>
#include <com/sun/star/view/SelectionType.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/helper/listenermultiplexer.hxx>
-namespace toolkit {
+#include <boost/scoped_ptr.hpp>
+
+namespace toolkit
+{
-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 GridEventForwarder;
// ===================================================================
// = UnoGridModel
@@ -52,21 +51,27 @@ using namespace ::com::sun::star::container;
class UnoGridModel : public UnoControlModel
{
protected:
- Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoGridModel();
+ UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoGridModel( const UnoGridModel& rModel );
UnoControlModel* Clone() const;
+ // ::com::sun::star::lang::XComponent
+ void SAL_CALL dispose( ) 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);
// ::com::sun::star::io::XPersistObject
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
+ // OPropertySetHelper
+ void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
+
// XServiceInfo
DECLIMPL_SERVICEINFO_DERIVED( UnoGridModel, UnoControlModel, szServiceName_GridControlModel )
};
@@ -75,10 +80,13 @@ public:
// ===================================================================
// = UnoGridControl
// ===================================================================
-class UnoGridControl : public ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::grid::XGridControl >
+typedef ::cppu::ImplInheritanceHelper1 < UnoControlBase
+ , ::com::sun::star::awt::grid::XGridControl
+ > UnoGridControl_Base;
+class UnoGridControl : public UnoGridControl_Base
{
public:
- UnoGridControl();
+ UnoGridControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::lang::XComponent
@@ -86,24 +94,22 @@ public:
// ::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);
+ sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::grid::XGridControl
-
- virtual ::sal_Int32 SAL_CALL getItemIndexAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setToolTip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& text, const ::com::sun::star::uno::Sequence< ::sal_Int32 >& columns) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException);
// ::com::sun::star::awt::grid::XGridSelection
-
- virtual ::sal_Int32 SAL_CALL getMinSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getMaxSelectionIndex() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL selectRow(::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException);
@@ -111,9 +117,14 @@ public:
DECLIMPL_SERVICEINFO_DERIVED( UnoGridControl, UnoControlBase, szServiceName_GridControl )
using UnoControl::getPeer;
+
+protected:
+ ~UnoGridControl();
+
private:
- ::com::sun::star::view::SelectionType mSelectionMode;
- SelectionListenerMultiplexer m_aSelectionListeners;
+ ::com::sun::star::view::SelectionType mSelectionMode;
+ SelectionListenerMultiplexer m_aSelectionListeners;
+ ::boost::scoped_ptr< GridEventForwarder > m_pEventForwarder;
};
} // toolkit
diff --git a/toolkit/source/controls/grid/grideventforwarder.cxx b/toolkit/source/controls/grid/grideventforwarder.cxx
new file mode 100755
index 000000000000..c3760b8315a3
--- /dev/null
+++ b/toolkit/source/controls/grid/grideventforwarder.cxx
@@ -0,0 +1,149 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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 "grideventforwarder.hxx"
+#include "gridcontrol.hxx"
+
+/** === begin UNO includes === **/
+/** === 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::awt::grid::GridDataEvent;
+ using ::com::sun::star::container::ContainerEvent;
+ using ::com::sun::star::lang::EventObject;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= GridEventForwarder
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ GridEventForwarder::GridEventForwarder( UnoGridControl& i_parent )
+ :m_parent( i_parent )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ GridEventForwarder::~GridEventForwarder()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::acquire() throw()
+ {
+ m_parent.acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::release() throw()
+ {
+ m_parent.release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->rowsInserted( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->rowsRemoved( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->dataChanged( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->rowHeadingChanged( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->elementInserted( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->elementRemoved( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
+ {
+ Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->elementReplaced( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL GridEventForwarder::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ Reference< XEventListener > xPeer( m_parent.getPeer(), UNO_QUERY );
+ if ( xPeer.is() )
+ xPeer->disposing( i_event );
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/controls/grid/grideventforwarder.hxx b/toolkit/source/controls/grid/grideventforwarder.hxx
new file mode 100755
index 000000000000..5a8b03f57037
--- /dev/null
+++ b/toolkit/source/controls/grid/grideventforwarder.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_GRIDEVENTFORWARDER_HXX
+#define TOOLKIT_GRIDEVENTFORWARDER_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XGridDataListener.hpp>
+#include <com/sun/star/awt/grid/XGridColumnListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ class UnoGridControl;
+
+ //==================================================================================================================
+ //= GridEventForwarder
+ //==================================================================================================================
+ typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::grid::XGridDataListener
+ , ::com::sun::star::container::XContainerListener
+ > GridEventForwarder_Base;
+
+ class GridEventForwarder : public GridEventForwarder_Base
+ {
+ public:
+ GridEventForwarder( UnoGridControl& i_parent );
+ virtual ~GridEventForwarder();
+
+ public:
+ // XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XGridDataListener
+ virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) 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);
+
+ private:
+ UnoGridControl& m_parent;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_GRIDEVENTFORWARDER_HXX
diff --git a/toolkit/source/controls/grid/initguard.hxx b/toolkit/source/controls/grid/initguard.hxx
new file mode 100755
index 000000000000..b2dddd2e5987
--- /dev/null
+++ b/toolkit/source/controls/grid/initguard.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_INITGUARD_HXX
+#define SVTOOLS_INITGUARD_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/NotInitializedException.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/componentguard.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= InitGuard
+ //==================================================================================================================
+ template < class IMPL >
+ class InitGuard : public ::comphelper::ComponentGuard
+ {
+ public:
+ InitGuard( IMPL& i_component, ::cppu::OBroadcastHelper & i_broadcastHelper )
+ :comphelper::ComponentGuard( i_component, i_broadcastHelper )
+ {
+ if ( !i_component.isInitialized() )
+ throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *&i_component );
+ }
+
+ ~InitGuard()
+ {
+ }
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // SVTOOLS_INITGUARD_HXX
diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx
new file mode 100755
index 000000000000..77a2ffa1637b
--- /dev/null
+++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx
@@ -0,0 +1,877 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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 "sortablegriddatamodel.hxx"
+#include "toolkit/helper/servicenames.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/i18n/XCollator.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/ucb/AlreadyInitializedException.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/anycompare.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
+
+#include <set>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::TypeClass;
+ using ::com::sun::star::uno::TypeClass_VOID;
+ 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::IndexOutOfBoundsException;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::awt::grid::XGridDataListener;
+ using ::com::sun::star::beans::Pair;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::i18n::XCollator;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::awt::grid::GridDataEvent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::ucb::AlreadyInitializedException;
+ /** === end UNO using === **/
+
+#ifdef DBG_UTIL
+ const char* SortableGridDataModel_checkInvariants( const void* _pInstance )
+ {
+ return static_cast< const SortableGridDataModel* >( _pInstance )->checkInvariants();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const char* SortableGridDataModel::checkInvariants() const
+ {
+ if ( m_publicToPrivateRowIndex.size() != m_privateToPublicRowIndex.size() )
+ return "inconsistent index maps";
+
+ if ( m_delegator.is() )
+ {
+ if ( m_publicToPrivateRowIndex.size() != size_t( m_delegator->getRowCount() ) )
+ return "wrong cached row count";
+ }
+ else
+ {
+ if ( !m_publicToPrivateRowIndex.empty() )
+ return "disposed or not initialized, but having a non-empty map";
+ }
+
+ for ( size_t publicIndex=0; publicIndex<m_publicToPrivateRowIndex.size(); ++publicIndex )
+ {
+ ::sal_Int32 const privateIndex = m_publicToPrivateRowIndex[ publicIndex ];
+ if ( ( privateIndex < 0 ) || ( size_t( privateIndex ) >= m_privateToPublicRowIndex.size() ) )
+ return "invalid cached private index";
+
+ if ( m_privateToPublicRowIndex[ privateIndex ] != sal_Int32( publicIndex ) )
+ return "index map traversal not commutavive";
+ }
+
+ if ( impl_isSorted_nothrow() && m_publicToPrivateRowIndex.empty() )
+ return "sorted, but no row index translation tables";
+
+ if ( !impl_isSorted_nothrow() && !m_publicToPrivateRowIndex.empty() )
+ return "unsorted, but have index translation tables";
+
+ return NULL;
+ }
+#endif
+
+#define DBG_CHECK_ME() \
+ DBG_CHKTHIS( SortableGridDataModel, SortableGridDataModel_checkInvariants )
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ template< class STLCONTAINER >
+ static void lcl_clear( STLCONTAINER& i_container )
+ {
+ STLCONTAINER empty;
+ empty.swap( i_container );
+ }
+ }
+
+ //==================================================================================================================
+ //= SortableGridDataModel
+ //==================================================================================================================
+ DBG_NAME( SortableGridDataModel )
+ //------------------------------------------------------------------------------------------------------------------
+ SortableGridDataModel::SortableGridDataModel( Reference< XMultiServiceFactory > const & i_factory )
+ :SortableGridDataModel_Base( m_aMutex )
+ ,SortableGridDataModel_PrivateBase()
+ ,m_context( i_factory )
+ ,m_isInitialized( false )
+ ,m_delegator()
+ ,m_collator()
+ ,m_currentSortColumn( -1 )
+ ,m_sortAscending( true )
+ ,m_publicToPrivateRowIndex()
+ ,m_privateToPublicRowIndex()
+ {
+ DBG_CTOR( SortableGridDataModel, SortableGridDataModel_checkInvariants );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SortableGridDataModel::SortableGridDataModel( SortableGridDataModel const & i_copySource )
+ :cppu::BaseMutex()
+ ,SortableGridDataModel_Base( m_aMutex )
+ ,SortableGridDataModel_PrivateBase()
+ ,m_context( i_copySource.m_context )
+ ,m_isInitialized( true )
+ ,m_delegator()
+ ,m_collator( i_copySource.m_collator )
+ ,m_currentSortColumn( i_copySource.m_currentSortColumn )
+ ,m_sortAscending( i_copySource.m_sortAscending )
+ ,m_publicToPrivateRowIndex( i_copySource.m_publicToPrivateRowIndex )
+ ,m_privateToPublicRowIndex( i_copySource.m_privateToPublicRowIndex )
+ {
+ DBG_CTOR( SortableGridDataModel, SortableGridDataModel_checkInvariants );
+
+ ENSURE_OR_THROW( i_copySource.m_delegator.is(),
+ "not expected to be called for a disposed copy source!" );
+ m_delegator.set( i_copySource.m_delegator->createClone(), UNO_QUERY_THROW );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SortableGridDataModel::~SortableGridDataModel()
+ {
+ if ( !rBHelper.bDisposed )
+ {
+ acquire();
+ dispose();
+ }
+
+ DBG_DTOR( SortableGridDataModel, SortableGridDataModel_checkInvariants );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::queryInterface( const Type& aType ) throw (RuntimeException)
+ {
+ Any aReturn( SortableGridDataModel_Base::queryInterface( aType ) );
+ if ( !aReturn.hasValue() )
+ aReturn = SortableGridDataModel_PrivateBase::queryInterface( aType );
+ return aReturn;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::acquire( ) throw ()
+ {
+ SortableGridDataModel_Base::acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::release( ) throw ()
+ {
+ SortableGridDataModel_Base::release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< Type > SAL_CALL SortableGridDataModel::getTypes( ) throw (RuntimeException)
+ {
+ return SortableGridDataModel_Base::getTypes();
+ // don't expose the types got via SortableGridDataModel_PrivateBase - they're private, after all
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::sal_Int8 > SAL_CALL SortableGridDataModel::getImplementationId( ) throw (RuntimeException)
+ {
+ static ::cppu::OImplementationId aId;
+ return aId.getImplementationId();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ Reference< XCollator > lcl_loadDefaultCollator_throw( ::comphelper::ComponentContext const & i_context )
+ {
+ Reference< XCollator > const xCollator( i_context.createComponent( "com.sun.star.i18n.Collator" ), UNO_QUERY_THROW );
+ xCollator->loadDefaultCollator( Application::GetSettings().GetLocale(), 0 );
+ return xCollator;
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::initialize( const Sequence< Any >& i_arguments ) throw (Exception, RuntimeException)
+ {
+ ::comphelper::ComponentGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ if ( m_delegator.is() )
+ throw AlreadyInitializedException( ::rtl::OUString(), *this );
+
+ Reference< XMutableGridDataModel > xDelegator;
+ Reference< XCollator > xCollator;
+ switch ( i_arguments.getLength() )
+ {
+ case 1: // SortableGridDataModel.create( XMutableGridDataModel )
+ xDelegator.set( i_arguments[0], UNO_QUERY );
+ xCollator = lcl_loadDefaultCollator_throw( m_context );
+ break;
+
+ case 2: // SortableGridDataModel.createWithCollator( XMutableGridDataModel, XCollator )
+ xDelegator.set( i_arguments[0], UNO_QUERY );
+ xCollator.set( i_arguments[1], UNO_QUERY );
+ if ( !xCollator.is() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 2 );
+ break;
+ }
+ if ( !xDelegator.is() )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+
+ m_delegator = xDelegator;
+ m_collator = xCollator;
+
+ m_delegator->addGridDataListener( this );
+
+ m_isInitialized = true;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ GridDataEvent SortableGridDataModel::impl_createPublicEvent( GridDataEvent const & i_originalEvent ) const
+ {
+ GridDataEvent aEvent( i_originalEvent );
+ aEvent.Source = *const_cast< SortableGridDataModel* >( this );
+ aEvent.FirstRow = impl_getPublicRowIndex_nothrow( aEvent.FirstRow );
+ aEvent.LastRow = impl_getPublicRowIndex_nothrow( aEvent.LastRow );
+ return aEvent;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SortableGridDataModel::impl_broadcast( void ( SAL_CALL XGridDataListener::*i_listenerMethod )( const GridDataEvent & ),
+ GridDataEvent const & i_publicEvent, MethodGuard& i_instanceLock )
+ {
+ ::cppu::OInterfaceContainerHelper* pListeners = rBHelper.getContainer( XGridDataListener::static_type() );
+ if ( pListeners == NULL )
+ return;
+
+ i_instanceLock.clear();
+ pListeners->notifyEach( i_listenerMethod, i_publicEvent );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ // if the data is not sorted, broadcast the event unchanged
+ if ( !impl_isSorted_nothrow() )
+ {
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::rowsInserted, aEvent, aGuard );
+ return;
+ }
+
+ bool needReIndex = false;
+ if ( i_event.FirstRow > i_event.LastRow )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsInserted: invalid event - invalid row indexes!" );
+ needReIndex = true;
+ }
+ else if ( size_t( i_event.FirstRow ) > m_privateToPublicRowIndex.size() )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsInserted: invalid event - too large row index!" );
+ needReIndex = true;
+ }
+
+ if ( needReIndex )
+ {
+ impl_rebuildIndexesAndNotify( aGuard );
+ return;
+ }
+
+ // we do not insert the new rows into the sort order - if somebody adds rows while we're sorted, s/he has
+ // to resort. Instead, we simply append the rows, no matter where they were inserted in the delegator data
+ // model.
+ sal_Int32 const nPublicFirstRow = sal_Int32( m_privateToPublicRowIndex.size() );
+ sal_Int32 nPublicLastRow = nPublicFirstRow;
+ for ( sal_Int32 newRow = i_event.FirstRow; newRow <= i_event.LastRow; ++newRow, ++nPublicLastRow )
+ {
+ m_privateToPublicRowIndex.push_back( nPublicLastRow );
+ m_publicToPrivateRowIndex.push_back( nPublicLastRow );
+ }
+
+ // broadcast the event
+ GridDataEvent const aEvent( *this, -1, -1, nPublicFirstRow, nPublicLastRow );
+ impl_broadcast( &XGridDataListener::rowsInserted, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ void lcl_decrementValuesGreaterThan( ::std::vector< ::sal_Int32 > & io_indexMap, sal_Int32 const i_threshold )
+ {
+ for ( ::std::vector< ::sal_Int32 >::iterator loop = io_indexMap.begin();
+ loop != io_indexMap.end();
+ ++loop
+ )
+ {
+ if ( *loop >= i_threshold )
+ --*loop;
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SortableGridDataModel::impl_rebuildIndexesAndNotify( MethodGuard& i_instanceLock )
+ {
+ OSL_PRECOND( impl_isSorted_nothrow(), "SortableGridDataModel::impl_rebuildIndexesAndNotify: illegal call!" );
+
+ // clear the indexes
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+
+ // broadcast an artificial event, saying that all rows have been removed
+ GridDataEvent const aRemovalEvent( *this, -1, -1, -1, -1 );
+ impl_broadcast( &XGridDataListener::rowsRemoved, aRemovalEvent, i_instanceLock );
+ i_instanceLock.reset();
+
+ // rebuild the index
+ impl_reIndex_nothrow( m_currentSortColumn, m_sortAscending );
+
+ // broadcast an artificial event, saying that n rows have been added
+ GridDataEvent const aAdditionEvent( *this, -1, -1, 0, m_delegator->getRowCount() - 1 );
+ impl_broadcast( &XGridDataListener::rowsInserted, aAdditionEvent, i_instanceLock );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ // if the data is not sorted, broadcast the event unchanged
+ if ( !impl_isSorted_nothrow() )
+ {
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::rowsRemoved, aEvent, aGuard );
+ return;
+ }
+
+ // if all rows have been removed, also simply multiplex to own listeners
+ if ( i_event.FirstRow < 0 )
+ {
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+ GridDataEvent aEvent( i_event );
+ aEvent.Source = *this;
+ impl_broadcast( &XGridDataListener::rowsRemoved, aEvent, aGuard );
+ return;
+ }
+
+ bool needReIndex = false;
+ if ( i_event.FirstRow != i_event.LastRow )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsRemoved: missing implementation - removal of multiple rows!" );
+ needReIndex = true;
+ }
+ else if ( size_t( i_event.FirstRow ) >= m_privateToPublicRowIndex.size() )
+ {
+ OSL_ENSURE( false, "SortableGridDataModel::rowsRemoved: inconsistent/wrong data!" );
+ needReIndex = true;
+ }
+
+ if ( needReIndex )
+ {
+ impl_rebuildIndexesAndNotify( aGuard );
+ return;
+ }
+
+ // build public event version
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+
+ // remove the entries from the index maps
+ sal_Int32 const privateIndex = i_event.FirstRow;
+ sal_Int32 const publicIndex = aEvent.FirstRow;
+
+ m_publicToPrivateRowIndex.erase( m_publicToPrivateRowIndex.begin() + publicIndex );
+ m_privateToPublicRowIndex.erase( m_privateToPublicRowIndex.begin() + privateIndex );
+
+ // adjust remaining entries in the index maps
+ lcl_decrementValuesGreaterThan( m_publicToPrivateRowIndex, privateIndex );
+ lcl_decrementValuesGreaterThan( m_privateToPublicRowIndex, publicIndex );
+
+ // broadcast the event
+ impl_broadcast( &XGridDataListener::rowsRemoved, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::dataChanged, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ GridDataEvent const aEvent( impl_createPublicEvent( i_event ) );
+ impl_broadcast( &XGridDataListener::rowHeadingChanged, aEvent, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::disposing( const EventObject& i_event ) throw (RuntimeException)
+ {
+ // not interested in
+ OSL_UNUSED( i_event );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ class CellDataLessComparison : public ::std::binary_function< sal_Int32, sal_Int32, bool >
+ {
+ public:
+ CellDataLessComparison(
+ ::std::vector< Any > const & i_data,
+ ::comphelper::IKeyPredicateLess& i_predicate,
+ sal_Bool const i_sortAscending
+ )
+ :m_data( i_data )
+ ,m_predicate( i_predicate )
+ ,m_sortAscending( i_sortAscending )
+ {
+ }
+
+ bool operator()( sal_Int32 const i_lhs, sal_Int32 const i_rhs ) const
+ {
+ Any const & lhs = m_data[ i_lhs ];
+ Any const & rhs = m_data[ i_rhs ];
+ // <VOID/> is less than everything else
+ if ( !lhs.hasValue() )
+ return m_sortAscending;
+ if ( !rhs.hasValue() )
+ return !m_sortAscending;
+
+ // actually compare
+ if ( m_sortAscending )
+ return m_predicate.isLess( lhs, rhs );
+ else
+ return m_predicate.isLess( rhs, lhs );
+ }
+
+ private:
+ ::std::vector< Any > const & m_data;
+ ::comphelper::IKeyPredicateLess const & m_predicate;
+ sal_Bool const m_sortAscending;
+ };
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SortableGridDataModel::impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending )
+ {
+ ::sal_Int32 const rowCount( getRowCount() );
+ ::std::vector< ::sal_Int32 > aPublicToPrivate( rowCount );
+
+ try
+ {
+ // build an unsorted translation table, and retrieve the unsorted data
+ ::std::vector< Any > aColumnData( rowCount );
+ Type dataType;
+ for ( ::sal_Int32 rowIndex = 0; rowIndex < rowCount; ++rowIndex )
+ {
+ aColumnData[ rowIndex ] = m_delegator->getCellData( i_columnIndex, rowIndex );
+ aPublicToPrivate[ rowIndex ] = rowIndex;
+
+ // determine the data types we assume for the complete column
+ if ( ( dataType.getTypeClass() == TypeClass_VOID ) && aColumnData[ rowIndex ].hasValue() )
+ dataType = aColumnData[ rowIndex ].getValueType();
+ }
+
+ // get predicate object
+ ::std::auto_ptr< ::comphelper::IKeyPredicateLess > const pPredicate( ::comphelper::getStandardLessPredicate( dataType, m_collator ) );
+ ENSURE_OR_RETURN_VOID( pPredicate.get(), "SortableGridDataModel::impl_reIndex_nothrow: no sortable data found!" );
+
+ // then sort
+ CellDataLessComparison const aComparator( aColumnData, *pPredicate, i_sortAscending );
+ ::std::sort( aPublicToPrivate.begin(), aPublicToPrivate.end(), aComparator );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ return;
+ }
+
+ // also build the "private to public" mapping
+ ::std::vector< sal_Int32 > aPrivateToPublic( aPublicToPrivate.size() );
+ for ( size_t i=0; i<aPublicToPrivate.size(); ++i )
+ aPrivateToPublic[ aPublicToPrivate[i] ] = i;
+
+ m_publicToPrivateRowIndex.swap( aPublicToPrivate );
+ m_privateToPublicRowIndex.swap( aPrivateToPublic );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::sortByColumn( ::sal_Int32 i_columnIndex, ::sal_Bool i_sortAscending ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ if ( ( i_columnIndex < 0 ) || ( i_columnIndex >= getColumnCount() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *this );
+
+ impl_reIndex_nothrow( i_columnIndex, i_sortAscending );
+
+ m_currentSortColumn = i_columnIndex;
+ m_sortAscending = i_sortAscending;
+
+ impl_broadcast(
+ &XGridDataListener::dataChanged,
+ GridDataEvent( *this, -1, -1, -1, -1 ),
+ aGuard
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeColumnSort( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+
+ m_currentSortColumn = -1;
+ m_sortAscending = sal_True;
+
+ impl_broadcast(
+ &XGridDataListener::dataChanged,
+ GridDataEvent( *this, -1, -1, -1, -1 ),
+ aGuard
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Pair< ::sal_Int32, ::sal_Bool > SAL_CALL SortableGridDataModel::getCurrentSortOrder( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ return Pair< ::sal_Int32, ::sal_Bool >( m_currentSortColumn, m_sortAscending );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::addRow( const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->addRow( i_heading, i_data );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::addRows( const Sequence< Any >& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->addRows( i_headings, i_data );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeRow( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->removeRow( rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeAllRows( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->removeAllRows();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateCellData( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateCellData( i_columnIndex, rowIndex, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateRowData( const Sequence< ::sal_Int32 >& i_columnIndexes, ::sal_Int32 i_rowIndex, const Sequence< Any >& i_values ) throw (IndexOutOfBoundsException, IllegalArgumentException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateRowData( i_columnIndexes, rowIndex, i_values );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateRowHeading( ::sal_Int32 i_rowIndex, const Any& i_heading ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateRowHeading( rowIndex, i_heading );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateCellToolTip( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateCellToolTip( i_columnIndex, rowIndex, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::updateRowToolTip( ::sal_Int32 i_rowIndex, const Any& i_value ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ delegator->updateRowToolTip( rowIndex, i_value );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::addGridDataListener( const Reference< XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.addListener( XGridDataListener::static_type(), i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::removeGridDataListener( const Reference< XGridDataListener >& i_listener ) throw (RuntimeException)
+ {
+ rBHelper.removeListener( XGridDataListener::static_type(), i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL SortableGridDataModel::getRowCount() throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getRowCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL SortableGridDataModel::getColumnCount() throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getColumnCount();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::getCellData( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getCellData( i_columnIndex, rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::getCellToolTip( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getCellToolTip( i_columnIndex, rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Any SAL_CALL SortableGridDataModel::getRowHeading( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex );
+
+ Reference< XMutableGridDataModel > const delegator( m_delegator );
+ aGuard.clear();
+ return delegator->getRowHeading( rowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SortableGridDataModel::disposing()
+ {
+ m_currentSortColumn = -1;
+
+ Reference< XComponent > const delegatorComponent( m_delegator.get() );
+ m_delegator->removeGridDataListener( this );
+ m_delegator.clear();
+ delegatorComponent->dispose();
+
+ Reference< XComponent > const collatorComponent( m_collator, UNO_QUERY );
+ m_collator.clear();
+ if ( collatorComponent.is() )
+ collatorComponent->dispose();
+
+ lcl_clear( m_publicToPrivateRowIndex );
+ lcl_clear( m_privateToPublicRowIndex );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XCloneable > SAL_CALL SortableGridDataModel::createClone( ) throw (RuntimeException)
+ {
+ MethodGuard aGuard( *this, rBHelper );
+ DBG_CHECK_ME();
+
+ return new SortableGridDataModel( *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL SortableGridDataModel::getImplementationName( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.toolkit.SortableGridDataModel" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL SortableGridDataModel::supportsService( const ::rtl::OUString& i_serviceName ) throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > const aServiceNames( getSupportedServiceNames() );
+ for ( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
+ if ( aServiceNames[i] == i_serviceName )
+ return sal_True;
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL SortableGridDataModel::getSupportedServiceNames( ) throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(1);
+ aServiceNames[0] = ::rtl::OUString::createFromAscii( szServiceName_SortableGridDataModel );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SortableGridDataModel::impl_getPrivateRowIndex_throw( ::sal_Int32 const i_publicRowIndex ) const
+ {
+ if ( ( i_publicRowIndex < 0 ) || ( i_publicRowIndex >= m_delegator->getRowCount() ) )
+ throw IndexOutOfBoundsException( ::rtl::OUString(), *const_cast< SortableGridDataModel* >( this ) );
+
+ if ( !impl_isSorted_nothrow() )
+ // no need to translate anything
+ return i_publicRowIndex;
+
+ ENSURE_OR_RETURN( size_t( i_publicRowIndex ) < m_publicToPrivateRowIndex.size(),
+ "SortableGridDataModel::impl_getPrivateRowIndex_throw: inconsistency!", i_publicRowIndex );
+ // obviously the translation table contains too few elements - it should have exactly |getRowCount()|
+ // elements
+
+ return m_publicToPrivateRowIndex[ i_publicRowIndex ];
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SortableGridDataModel::impl_getPublicRowIndex_nothrow( ::sal_Int32 const i_privateRowIndex ) const
+ {
+ if ( !impl_isSorted_nothrow() )
+ // no need to translate anything
+ return i_privateRowIndex;
+
+ if ( i_privateRowIndex < 0 )
+ return i_privateRowIndex;
+
+ ENSURE_OR_RETURN( size_t( i_privateRowIndex ) < m_privateToPublicRowIndex.size(),
+ "SortableGridDataModel::impl_getPublicRowIndex_nothrow: invalid index!", i_privateRowIndex );
+
+ return m_privateToPublicRowIndex[ i_privateRowIndex ];
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+{
+ return *( new ::toolkit::SortableGridDataModel( i_factory ) );
+}
diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx
new file mode 100755
index 000000000000..50f08d3a7113
--- /dev/null
+++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx
@@ -0,0 +1,198 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_SORTABLEGRIDDATAMODEL_HXX
+#define TOOLKIT_SORTABLEGRIDDATAMODEL_HXX
+
+#include "initguard.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/grid/XSortableMutableGridDataModel.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
+#include <com/sun/star/awt/grid/XGridDataListener.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/componentcontext.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ class SortableGridDataModel;
+ typedef InitGuard< SortableGridDataModel > MethodGuard;
+
+ //==================================================================================================================
+ //= SortableGridDataModel
+ //==================================================================================================================
+ typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::awt::grid::XSortableMutableGridDataModel
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XInitialization
+ > SortableGridDataModel_Base;
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::grid::XGridDataListener
+ > SortableGridDataModel_PrivateBase;
+ class SortableGridDataModel :public ::cppu::BaseMutex
+ ,public SortableGridDataModel_Base
+ ,public SortableGridDataModel_PrivateBase
+ {
+ public:
+ SortableGridDataModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory );
+ SortableGridDataModel( SortableGridDataModel const & i_copySource );
+
+ bool isInitialized() const { return m_isInitialized; }
+
+#ifdef DBG_UTIL
+ const char* checkInvariants() const;
+#endif
+
+ protected:
+ ~SortableGridDataModel();
+
+ public:
+ // XSortableGridData
+ virtual void SAL_CALL sortByColumn( ::sal_Int32 ColumnIndex, ::sal_Bool SortAscending ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeColumnSort( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::beans::Pair< ::sal_Int32, ::sal_Bool > SAL_CALL getCurrentSortOrder( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XMutableGridDataModel
+ virtual void SAL_CALL addRow( const ::com::sun::star::uno::Any& Heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeRow( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAllRows( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellData( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowData( const ::com::sun::star::uno::Sequence< ::sal_Int32 >& ColumnIndexes, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowHeading( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Heading ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateCellToolTip( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateRowToolTip( ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeGridDataListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridDataListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XGridDataModel
+ virtual ::sal_Int32 SAL_CALL getRowCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getRowHeading( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XGridDataListener
+ virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& 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);
+
+ // 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 ();
+
+ // XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ /** translates the given public index into one to be passed to our delegator
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if the given index does not denote a valid row
+ */
+ ::sal_Int32 impl_getPrivateRowIndex_throw( ::sal_Int32 const i_publicRowIndex ) const;
+
+ /** translates the given private row index to a public one
+ */
+ ::sal_Int32 impl_getPublicRowIndex_nothrow( ::sal_Int32 const i_privateRowIndex ) const;
+
+ inline bool impl_isSorted_nothrow() const
+ {
+ return m_currentSortColumn >= 0;
+ }
+
+ /** rebuilds the index translation structure.
+
+ Neither <member>m_currentSortColumn</member> nor <member>m_sortAscending</member> are touched by this method.
+ Also, the given column index is not checked, this is the responsibility of the caller.
+ */
+ void impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending );
+
+ /** translates the given event, obtained from our delegator, to a version which can be broadcasted to our own
+ clients.
+ */
+ ::com::sun::star::awt::grid::GridDataEvent
+ impl_createPublicEvent( ::com::sun::star::awt::grid::GridDataEvent const & i_originalEvent ) const;
+
+ /** broadcasts the given event to our registered XGridDataListeners
+ */
+ void impl_broadcast(
+ void ( SAL_CALL ::com::sun::star::awt::grid::XGridDataListener::*i_listenerMethod )( const ::com::sun::star::awt::grid::GridDataEvent & ),
+ ::com::sun::star::awt::grid::GridDataEvent const & i_publicEvent,
+ MethodGuard& i_instanceLock
+ );
+
+ /** rebuilds our indexes, notifying row removal and row addition events
+
+ First, a rowsRemoved event is notified to our registered listeners. Then, the index translation tables are
+ rebuilt, and a rowsInserted event is notified.
+
+ Only to be called when we're sorted.
+ */
+ void impl_rebuildIndexesAndNotify( MethodGuard& i_instanceLock );
+
+ private:
+ ::comphelper::ComponentContext m_context;
+ bool m_isInitialized;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XMutableGridDataModel > m_delegator;
+ ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator > m_collator;
+ ::sal_Int32 m_currentSortColumn;
+ ::sal_Bool m_sortAscending;
+ ::std::vector< ::sal_Int32 > m_publicToPrivateRowIndex;
+ ::std::vector< ::sal_Int32 > m_privateToPublicRowIndex;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_SORTABLEGRIDDATAMODEL_HXX
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index 96f51b39dc72..875f05e2f80d 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -66,7 +66,9 @@ static void lcl_throwIndexOutOfBoundsException( )
// = UnoControlRoadmapModel
// ===================================================================
// -------------------------------------------------------------------
- UnoControlRoadmapModel::UnoControlRoadmapModel() : maContainerListeners( *this )
+ UnoControlRoadmapModel::UnoControlRoadmapModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlRoadmapModel_Base( i_factory )
+ ,maContainerListeners( *this )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -368,7 +370,9 @@ static void lcl_throwIndexOutOfBoundsException( )
// = UnoRoadmapControl
// ===================================================================
// -------------------------------------------------------------------
- UnoRoadmapControl::UnoRoadmapControl(): maItemListeners( *this )
+ UnoRoadmapControl::UnoRoadmapControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlRoadmap_Base( i_factory )
+ ,maItemListeners( *this )
{
}
diff --git a/toolkit/source/controls/spinningprogress.cxx b/toolkit/source/controls/spinningprogress.cxx
index d4b89d5123ec..cb02274e3997 100755
--- a/toolkit/source/controls/spinningprogress.cxx
+++ b/toolkit/source/controls/spinningprogress.cxx
@@ -55,13 +55,15 @@ namespace toolkit
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Type;
using ::com::sun::star::beans::XPropertySetInfo;
+ using ::com::sun::star::lang::XMultiServiceFactory;
/** === end UNO using === **/
//==================================================================================================================
//= SpinningProgressControlModel
//==================================================================================================================
//------------------------------------------------------------------------------------------------------------------
- SpinningProgressControlModel::SpinningProgressControlModel()
+ SpinningProgressControlModel::SpinningProgressControlModel( Reference< XMultiServiceFactory > const & i_factory )
+ :SpinningProgressControlModel_Base( i_factory )
{
// default image sets
osl_incrementInterlockedCount( &m_refCount );
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
index b7e381ae27c7..808feca02e8a 100644
--- a/toolkit/source/controls/tabpagecontainer.cxx
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -54,7 +54,9 @@ using namespace ::com::sun::star::view;
// ----------------------------------------------------
// class UnoControlTabPageContainerModel
// ----------------------------------------------------
-UnoControlTabPageContainerModel::UnoControlTabPageContainerModel() : maContainerListeners( *this )
+UnoControlTabPageContainerModel::UnoControlTabPageContainerModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlTabPageContainerModel_Base( i_factory )
+ ,maContainerListeners( *this )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -176,8 +178,9 @@ void UnoControlTabPageContainerModel::removeContainerListener( const Reference<
// ----------------------------------------------------
// class UnoControlTabPageContainer
// ----------------------------------------------------
-UnoControlTabPageContainer::UnoControlTabPageContainer():
- m_aTabPageListeners( *this )
+UnoControlTabPageContainer::UnoControlTabPageContainer( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlTabPageContainer_Base( i_factory )
+ ,m_aTabPageListeners( *this )
{
}
@@ -290,12 +293,3 @@ void SAL_CALL UnoControlTabPageContainer::addControl( const ::rtl::OUString& Nam
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
index 4afd46724cab..f498fefd761b 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -143,7 +143,8 @@ using namespace ::com::sun::star::util;
// ----------------------------------------------------
// class UnoControlTabPageModel
// ----------------------------------------------------
-UnoControlTabPageModel::UnoControlTabPageModel(Reference< XComponentContext >const & i_xCompContext) : m_xCompContext(i_xCompContext)
+UnoControlTabPageModel::UnoControlTabPageModel( Reference< XMultiServiceFactory > const & i_factory )
+ :ControlModelContainerBase( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
ImplRegisterProperty( BASEPROPERTY_TITLE );
@@ -209,7 +210,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument
::rtl::OUString sURL;
if ( !( rArguments[ 1 ] >>= sURL ))
throw lang::IllegalArgumentException();
- Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create(m_xCompContext,sURL);
+ Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create( maContext.getUNOContext(),sURL);
if ( xDialogModel.is() )
{
Sequence< ::rtl::OUString> aNames = xDialogModel->getElementNames();
@@ -246,16 +247,6 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument
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");
@@ -272,8 +263,9 @@ Sequence<rtl::OUString> SAL_CALL UnoControlTabPageModel_getSupportedServiceNames
// = class UnoControlTabPage
// ============================================================================
-UnoControlTabPage::UnoControlTabPage() :
- m_bWindowListener(false)
+UnoControlTabPage::UnoControlTabPage( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlTabPage_Base( i_factory )
+ ,m_bWindowListener(false)
{
maComponentInfos.nWidth = 280;
maComponentInfos.nHeight = 400;
diff --git a/toolkit/source/controls/tkscrollbar.cxx b/toolkit/source/controls/tkscrollbar.cxx
index 2de8b56131c8..f75183186610 100644
--- a/toolkit/source/controls/tkscrollbar.cxx
+++ b/toolkit/source/controls/tkscrollbar.cxx
@@ -47,7 +47,8 @@ namespace toolkit
//= UnoControlScrollBarModel
//====================================================================
//--------------------------------------------------------------------
- UnoControlScrollBarModel::UnoControlScrollBarModel()
+ UnoControlScrollBarModel::UnoControlScrollBarModel( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXScrollBar );
}
@@ -96,8 +97,9 @@ namespace toolkit
//====================================================================
//= UnoControlScrollBarModel
//====================================================================
- UnoScrollBarControl::UnoScrollBarControl()
- : maAdjustmentListeners( *this )
+ UnoScrollBarControl::UnoScrollBarControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maAdjustmentListeners( *this )
{
}
diff --git a/toolkit/source/controls/tksimpleanimation.cxx b/toolkit/source/controls/tksimpleanimation.cxx
index 6ad33608f6ee..90f56d5ad4bd 100644
--- a/toolkit/source/controls/tksimpleanimation.cxx
+++ b/toolkit/source/controls/tksimpleanimation.cxx
@@ -44,7 +44,8 @@ namespace toolkit
//= UnoSimpleAnimationControlModel
//====================================================================
//--------------------------------------------------------------------
- UnoSimpleAnimationControlModel::UnoSimpleAnimationControlModel()
+ UnoSimpleAnimationControlModel::UnoSimpleAnimationControlModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
ImplRegisterProperty( BASEPROPERTY_REPEAT );
@@ -119,7 +120,8 @@ namespace toolkit
//= UnoSimpleAnimationControl
//====================================================================
//--------------------------------------------------------------------
- UnoSimpleAnimationControl::UnoSimpleAnimationControl()
+ UnoSimpleAnimationControl::UnoSimpleAnimationControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoSimpleAnimationControl_Base( i_factory )
{
}
diff --git a/toolkit/source/controls/tkspinbutton.cxx b/toolkit/source/controls/tkspinbutton.cxx
index 5929dc7a4635..9396aea43290 100644
--- a/toolkit/source/controls/tkspinbutton.cxx
+++ b/toolkit/source/controls/tkspinbutton.cxx
@@ -50,7 +50,8 @@ namespace toolkit
//= UnoSpinButtonModel
//====================================================================
//--------------------------------------------------------------------
- UnoSpinButtonModel::UnoSpinButtonModel()
+ UnoSpinButtonModel::UnoSpinButtonModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -137,8 +138,9 @@ namespace toolkit
//= UnoSpinButtonControl
//====================================================================
//--------------------------------------------------------------------
- UnoSpinButtonControl::UnoSpinButtonControl()
- :maAdjustmentListeners( *this )
+ UnoSpinButtonControl::UnoSpinButtonControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maAdjustmentListeners( *this )
{
}
diff --git a/toolkit/source/controls/tkthrobber.cxx b/toolkit/source/controls/tkthrobber.cxx
index 1dc83f860e34..8a1927a732cb 100644
--- a/toolkit/source/controls/tkthrobber.cxx
+++ b/toolkit/source/controls/tkthrobber.cxx
@@ -44,7 +44,8 @@ namespace toolkit
//= UnoThrobberControlModel
//====================================================================
//--------------------------------------------------------------------
- UnoThrobberControlModel::UnoThrobberControlModel()
+ UnoThrobberControlModel::UnoThrobberControlModel( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BORDER );
ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
@@ -117,7 +118,8 @@ namespace toolkit
//= UnoThrobberControl
//====================================================================
//--------------------------------------------------------------------
- UnoThrobberControl::UnoThrobberControl()
+ UnoThrobberControl::UnoThrobberControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
}
diff --git a/toolkit/source/controls/tree/treecontrol.cxx b/toolkit/source/controls/tree/treecontrol.cxx
index d56ca82bb845..d2c66c64b41a 100644
--- a/toolkit/source/controls/tree/treecontrol.cxx
+++ b/toolkit/source/controls/tree/treecontrol.cxx
@@ -55,7 +55,8 @@ namespace toolkit
// ----------------------------------------------------
// class UnoTreeModel
// ----------------------------------------------------
-UnoTreeModel::UnoTreeModel()
+UnoTreeModel::UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -74,7 +75,7 @@ UnoTreeModel::UnoTreeModel()
ImplRegisterProperty( BASEPROPERTY_TREE_ROOTDISPLAYED );
ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSHANDLES );
ImplRegisterProperty( BASEPROPERTY_TREE_SHOWSROOTHANDLES );
- ImplRegisterProperty( BASEPROPERTY_TREE_ROWHEIGHT );
+ ImplRegisterProperty( BASEPROPERTY_ROW_HEIGHT );
ImplRegisterProperty( BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING );
ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
}
@@ -100,7 +101,7 @@ Any UnoTreeModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
case BASEPROPERTY_TREE_SELECTIONTYPE:
return Any( SelectionType_NONE );
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
return Any( sal_Int32( 0 ) );
case BASEPROPERTY_TREE_DATAMODEL:
return Any( Reference< XTreeDataModel >( 0 ) );
@@ -140,8 +141,9 @@ Reference< XPropertySetInfo > UnoTreeModel::getPropertySetInfo( ) throw(Runtime
// ----------------------------------------------------
// class UnoTreeControl
// ----------------------------------------------------
-UnoTreeControl::UnoTreeControl()
-: maSelectionListeners( *this )
+UnoTreeControl::UnoTreeControl( const Reference< XMultiServiceFactory >& i_factory )
+: UnoTreeControl_Base( i_factory )
+, maSelectionListeners( *this )
, maTreeExpansionListeners( *this )
, maTreeEditListeners( *this )
{
@@ -452,14 +454,14 @@ void UnoTreeControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolk
}
-Reference< XInterface > SAL_CALL TreeControl_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL TreeControl_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeControl );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeControl( i_factory ) );
}
-Reference< XInterface > SAL_CALL TreeControlModel_CreateInstance( const Reference< XMultiServiceFactory >& )
+Reference< XInterface > SAL_CALL TreeControlModel_CreateInstance( const Reference< XMultiServiceFactory >& i_factory )
{
- return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeModel );
+ return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::UnoTreeModel( i_factory ) );
}
void SAL_CALL TreeEditListenerMultiplexer::nodeEditing( const Reference< XTreeNode >& Node ) throw (RuntimeException, ::com::sun::star::util::VetoException)
diff --git a/toolkit/source/controls/tree/treecontrol.hxx b/toolkit/source/controls/tree/treecontrol.hxx
index e646664c4a64..ff5ddb4e348c 100644
--- a/toolkit/source/controls/tree/treecontrol.hxx
+++ b/toolkit/source/controls/tree/treecontrol.hxx
@@ -54,7 +54,7 @@ protected:
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
public:
- UnoTreeModel();
+ UnoTreeModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
UnoTreeModel( const UnoTreeModel& rModel );
UnoControlModel* Clone() const;
@@ -73,10 +73,11 @@ public:
// ===================================================================
// = UnoTreeControl
// ===================================================================
-class UnoTreeControl : public ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::tree::XTreeControl >
+typedef ::cppu::ImplInheritanceHelper1< UnoControlBase, ::com::sun::star::awt::tree::XTreeControl > UnoTreeControl_Base;
+class UnoTreeControl : public UnoTreeControl_Base
{
public:
- UnoTreeControl();
+ UnoTreeControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
::rtl::OUString GetComponentServiceName();
// ::com::sun::star::lang::XComponent
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 075080906900..7fbac44035c6 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -52,6 +52,7 @@
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <comphelper/stl_types.hxx>
+#include <comphelper/processfactory.hxx>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/servicenames.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -164,7 +165,26 @@ struct UnoControl_Data
// ----------------------------------------------------
DBG_NAME( UnoControl )
UnoControl::UnoControl()
- : maDisposeListeners( *this )
+ :maContext( ::comphelper::getProcessServiceFactory() )
+ ,maDisposeListeners( *this )
+ ,maWindowListeners( *this )
+ ,maFocusListeners( *this )
+ ,maKeyListeners( *this )
+ ,maMouseListeners( *this )
+ ,maMouseMotionListeners( *this )
+ ,maPaintListeners( *this )
+ ,maModeChangeListeners( GetMutex() )
+ ,mpData( new UnoControl_Data )
+{
+ DBG_CTOR( UnoControl, NULL );
+ OSL_ENSURE( false, "UnoControl::UnoControl: not implemented. Well, not really." );
+ // just implemented to let the various FooImplInheritanceHelper compile, you should use the
+ // version taking a service factory
+}
+
+UnoControl::UnoControl( const Reference< XMultiServiceFactory >& i_factory )
+ : maContext( i_factory )
+ , maDisposeListeners( *this )
, maWindowListeners( *this )
, maFocusListeners( *this )
, maKeyListeners( *this )
diff --git a/toolkit/source/controls/unocontrolbase.cxx b/toolkit/source/controls/unocontrolbase.cxx
index bbd0fc507e80..4dc1412ba661 100644
--- a/toolkit/source/controls/unocontrolbase.cxx
+++ b/toolkit/source/controls/unocontrolbase.cxx
@@ -32,6 +32,7 @@
#include <toolkit/controls/unocontrolbase.hxx>
#include <toolkit/helper/property.hxx>
+#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
@@ -39,6 +40,14 @@
// class UnoControlBase
// ----------------------------------------------------
+UnoControlBase::UnoControlBase()
+ :UnoControl( ::comphelper::getProcessServiceFactory() )
+{
+ OSL_ENSURE( false, "UnoControlBase::UnoControlBase: not implemented. Well, not really." );
+ // just implemented to let the various FooImplInheritanceHelper compile, you should use the
+ // version taking a service factory
+}
+
sal_Bool UnoControlBase::ImplHasProperty( sal_uInt16 nPropId )
{
::rtl::OUString aPropName( GetPropertyName( nPropId ) );
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index 3afe3a90f1ee..bdbdc9aae7f1 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -412,13 +412,16 @@ void SAL_CALL DialogStepChangedListener::propertyChange( const beans::PropertyC
// ----------------------------------------------------
// class UnoControlContainer
// ----------------------------------------------------
-UnoControlContainer::UnoControlContainer() : maCListeners( *this )
+UnoControlContainer::UnoControlContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlContainer_Base( i_factory )
+ ,maCListeners( *this )
{
mpControls = new UnoControlHolderList;
}
-UnoControlContainer::UnoControlContainer( uno::Reference< awt::XWindowPeer > xP )
- : maCListeners( *this )
+UnoControlContainer::UnoControlContainer( const uno::Reference< lang::XMultiServiceFactory >& i_factory, const uno::Reference< awt::XWindowPeer >& xP )
+ :UnoControlContainer_Base( i_factory )
+ ,maCListeners( *this )
{
setPeer( xP );
mbDisposePeer = sal_False;
diff --git a/toolkit/source/controls/unocontrolcontainermodel.cxx b/toolkit/source/controls/unocontrolcontainermodel.cxx
index 7630971d8a57..66948ce095d1 100644
--- a/toolkit/source/controls/unocontrolcontainermodel.cxx
+++ b/toolkit/source/controls/unocontrolcontainermodel.cxx
@@ -36,7 +36,8 @@
// ----------------------------------------------------
// class UnoControlContainerModel
// ----------------------------------------------------
-UnoControlContainerModel::UnoControlContainerModel()
+UnoControlContainerModel::UnoControlContainerModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 18bf0d9f02f7..7a2742abae57 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -154,7 +154,24 @@ static void lcl_ImplMergeFontProperty( FontDescriptor& rFD, sal_uInt16 nPropId,
// class UnoControlModel
// ----------------------------------------------------
UnoControlModel::UnoControlModel()
- : OPropertySetHelper( BrdcstHelper ), maDisposeListeners( *this )
+ :UnoControlModel_Base()
+ ,MutexAndBroadcastHelper()
+ ,OPropertySetHelper( BrdcstHelper )
+ ,maDisposeListeners( *this )
+ ,maContext( ::comphelper::getProcessServiceFactory() )
+{
+ OSL_ENSURE( false, "UnoControlModel::UnoControlModel: not implemented. Well, not really." );
+ // just implemented to let the various FooImplInheritanceHelper compile, you should use the
+ // version taking a service factory
+ mpData = new ImplPropertyTable;
+}
+
+UnoControlModel::UnoControlModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel_Base()
+ ,MutexAndBroadcastHelper()
+ ,OPropertySetHelper( BrdcstHelper )
+ ,maDisposeListeners( *this )
+ ,maContext( i_factory )
{
// Die Properties muessen vom Model in die Tabelle gestopft werden,
// nur vorhandene Properties sind gueltige Properties, auch wenn VOID.
@@ -162,18 +179,11 @@ UnoControlModel::UnoControlModel()
}
UnoControlModel::UnoControlModel( const UnoControlModel& rModel )
- : XControlModel()
- , XPropertyState()
- , XPersistObject()
- , XComponent()
- , XServiceInfo()
- , XTypeProvider()
- , XUnoTunnel()
- , XCloneable()
+ : UnoControlModel_Base()
, MutexAndBroadcastHelper()
, OPropertySetHelper( BrdcstHelper )
- , OWeakAggObject()
, maDisposeListeners( *this )
+ , maContext( rModel.maContext )
{
mpData = new ImplPropertyTable;
@@ -403,7 +413,7 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
aLocale.Country = sDefaultCurrency.copy( nSepPos + 1 );
}
- LocaleDataWrapper aLocaleInfo( ::comphelper::getProcessServiceFactory(), aLocale );
+ LocaleDataWrapper aLocaleInfo( maContext.getLegacyServiceFactory(), aLocale );
if ( !sBankSymbol.getLength() )
sBankSymbol = aLocaleInfo.getCurrBankSymbol();
@@ -484,36 +494,20 @@ void UnoControlModel::ImplRegisterProperties( const std::list< sal_uInt16 > &rId
// ::com::sun::star::uno::XInterface
::com::sun::star::uno::Any UnoControlModel::queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
{
- ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
- SAL_STATIC_CAST( ::com::sun::star::awt::XControlModel*, this ),
- SAL_STATIC_CAST( ::com::sun::star::io::XPersistObject*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XComponent*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XServiceInfo*, this ),
- SAL_STATIC_CAST( ::com::sun::star::util::XCloneable*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XPropertyState*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XMultiPropertySet*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XFastPropertySet*, this ),
- SAL_STATIC_CAST( ::com::sun::star::beans::XPropertySet*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ),
- SAL_STATIC_CAST( ::com::sun::star::lang::XUnoTunnel*, this ) );
- return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType ));
+ Any aRet = UnoControlModel_Base::queryAggregation( rType );
+ if ( !aRet.hasValue() )
+ aRet = ::cppu::OPropertySetHelper::queryInterface( rType );
+ return aRet;
}
// ::com::sun::star::lang::XUnoTunnel
IMPL_XUNOTUNNEL( UnoControlModel )
+// XInterface
+IMPLEMENT_FORWARD_REFCOUNT( UnoControlModel, UnoControlModel_Base )
+
// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( UnoControlModel )
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::io::XPersistObject>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet>* ) NULL ),
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>* ) NULL )
-IMPL_XTYPEPROVIDER_END
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( UnoControlModel, UnoControlModel_Base, ::cppu::OPropertySetHelper )
uno::Reference< util::XCloneable > UnoControlModel::createClone() throw(::com::sun::star::uno::RuntimeException)
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index 1cc305462b38..210fc08a2680 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -42,7 +42,6 @@
#include <toolkit/controls/formattedcontrol.hxx>
#include <toolkit/controls/roadmapcontrol.hxx>
#include <toolkit/controls/unocontrols.hxx>
-#include <toolkit/controls/geometrycontrolmodel.hxx>
#include <toolkit/controls/stdtabcontroller.hxx>
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
@@ -95,7 +94,8 @@ using namespace ::toolkit;
// ----------------------------------------------------
// class UnoControlEditModel
// ----------------------------------------------------
-UnoControlEditModel::UnoControlEditModel()
+UnoControlEditModel::UnoControlEditModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXEdit );
}
@@ -146,8 +146,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlEditModel::getPropertySetInf
// ----------------------------------------------------
// class UnoEditControl
// ----------------------------------------------------
-UnoEditControl::UnoEditControl()
- :maTextListeners( *this )
+UnoEditControl::UnoEditControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maTextListeners( *this )
,mnMaxTextLen( 0 )
,mbSetTextInPeer( sal_False )
,mbSetMaxTextLenInPeer( sal_False )
@@ -460,7 +461,8 @@ void UnoEditControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) t
// ----------------------------------------------------
// class UnoControlFileControlModel
// ----------------------------------------------------
-UnoControlFileControlModel::UnoControlFileControlModel()
+UnoControlFileControlModel::UnoControlFileControlModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_ALIGN );
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
@@ -519,7 +521,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFileControlModel::getPropert
// ----------------------------------------------------
// class UnoFileControl
// ----------------------------------------------------
-UnoFileControl::UnoFileControl()
+UnoFileControl::UnoFileControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoEditControl( i_factory )
{
}
@@ -547,8 +550,7 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
// graphic manager uniqueid
rtl::OUString sID = _rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
// get the DefaultContext
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- mxGrfObj = graphic::GraphicObject::createWithId( aContext.getUNOContext(), sID );
+ mxGrfObj = graphic::GraphicObject::createWithId( maContext.getUNOContext(), sID );
}
else // linked
mxGrfObj = NULL; // release the GraphicObject
@@ -558,9 +560,8 @@ uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
try
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
uno::Reference< graphic::XGraphicProvider > xProvider;
- if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
+ if ( maContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) )
{
uno::Sequence< beans::PropertyValue > aMediaProperties(1);
aMediaProperties[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
@@ -638,7 +639,8 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n
// ----------------------------------------------------
// class UnoControlButtonModel
// ----------------------------------------------------
-UnoControlButtonModel::UnoControlButtonModel()
+UnoControlButtonModel::UnoControlButtonModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXButton );
@@ -694,9 +696,10 @@ uno::Reference< beans::XPropertySetInfo > UnoControlButtonModel::getPropertySetI
// ----------------------------------------------------
// class UnoButtonControl
// ----------------------------------------------------
-UnoButtonControl::UnoButtonControl()
- : maActionListeners( *this )
- , maItemListeners( *this )
+UnoButtonControl::UnoButtonControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoButtonControl_Base( i_factory )
+ ,maActionListeners( *this )
+ ,maItemListeners( *this )
{
maComponentInfos.nWidth = 50;
maComponentInfos.nHeight = 14;
@@ -833,8 +836,9 @@ awt::Size UnoButtonControl::calcAdjustedSize( const awt::Size& rNewSize ) throw(
// ----------------------------------------------------
// class UnoControlImageControlModel
// ----------------------------------------------------
-UnoControlImageControlModel::UnoControlImageControlModel()
- :mbAdjustingImageScaleMode( false )
+UnoControlImageControlModel::UnoControlImageControlModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
+ ,mbAdjustingImageScaleMode( false )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXImageControl );
}
@@ -914,8 +918,9 @@ void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal
// ----------------------------------------------------
// class UnoImageControlControl
// ----------------------------------------------------
-UnoImageControlControl::UnoImageControlControl()
- : maActionListeners( *this )
+UnoImageControlControl::UnoImageControlControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoImageControlControl_Base( i_factory )
+ ,maActionListeners( *this )
{
// Woher die Defaults nehmen?
maComponentInfos.nWidth = 100;
@@ -958,7 +963,8 @@ awt::Size UnoImageControlControl::calcAdjustedSize( const awt::Size& rNewSize )
// ----------------------------------------------------
// class UnoControlRadioButtonModel
// ----------------------------------------------------
-UnoControlRadioButtonModel::UnoControlRadioButtonModel()
+UnoControlRadioButtonModel::UnoControlRadioButtonModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXRadioButton );
}
@@ -1005,8 +1011,10 @@ uno::Reference< beans::XPropertySetInfo > UnoControlRadioButtonModel::getPropert
// ----------------------------------------------------
// class UnoRadioButtonControl
// ----------------------------------------------------
-UnoRadioButtonControl::UnoRadioButtonControl()
- : maItemListeners( *this ), maActionListeners( *this )
+UnoRadioButtonControl::UnoRadioButtonControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoRadioButtonControl_Base( i_factory )
+ ,maItemListeners( *this )
+ ,maActionListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1165,7 +1173,8 @@ awt::Size UnoRadioButtonControl::calcAdjustedSize( const awt::Size& rNewSize ) t
// ----------------------------------------------------
// class UnoControlCheckBoxModel
// ----------------------------------------------------
-UnoControlCheckBoxModel::UnoControlCheckBoxModel()
+UnoControlCheckBoxModel::UnoControlCheckBoxModel( const Reference< XMultiServiceFactory >& i_factory )
+ :GraphicControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCheckBox );
}
@@ -1212,8 +1221,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlCheckBoxModel::getPropertySe
// ----------------------------------------------------
// class UnoCheckBoxControl
// ----------------------------------------------------
-UnoCheckBoxControl::UnoCheckBoxControl()
- : maItemListeners( *this ), maActionListeners( *this )
+UnoCheckBoxControl::UnoCheckBoxControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory )
+ :UnoCheckBoxControl_Base( i_factory )
+ ,maItemListeners( *this ), maActionListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1348,7 +1358,8 @@ awt::Size UnoCheckBoxControl::calcAdjustedSize( const awt::Size& rNewSize ) thro
// ----------------------------------------------------
// class UnoControlFixedHyperlinkModel
// ----------------------------------------------------
-UnoControlFixedHyperlinkModel::UnoControlFixedHyperlinkModel()
+UnoControlFixedHyperlinkModel::UnoControlFixedHyperlinkModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXFixedHyperlink );
}
@@ -1403,8 +1414,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedHyperlinkModel::getProp
// ----------------------------------------------------
// class UnoFixedHyperlinkControl
// ----------------------------------------------------
-UnoFixedHyperlinkControl::UnoFixedHyperlinkControl()
- : maActionListeners( *this )
+UnoFixedHyperlinkControl::UnoFixedHyperlinkControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
+ ,maActionListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1533,7 +1545,8 @@ void UnoFixedHyperlinkControl::removeActionListener(const uno::Reference< awt::X
// ----------------------------------------------------
// class UnoControlFixedTextModel
// ----------------------------------------------------
-UnoControlFixedTextModel::UnoControlFixedTextModel()
+UnoControlFixedTextModel::UnoControlFixedTextModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXFixedText );
}
@@ -1583,7 +1596,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedTextModel::getPropertyS
// ----------------------------------------------------
// class UnoFixedTextControl
// ----------------------------------------------------
-UnoFixedTextControl::UnoFixedTextControl()
+UnoFixedTextControl::UnoFixedTextControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -1663,7 +1677,8 @@ awt::Size UnoFixedTextControl::calcAdjustedSize( const awt::Size& rNewSize ) thr
// ----------------------------------------------------
// class UnoControlGroupBoxModel
// ----------------------------------------------------
-UnoControlGroupBoxModel::UnoControlGroupBoxModel()
+UnoControlGroupBoxModel::UnoControlGroupBoxModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
ImplRegisterProperty( BASEPROPERTY_ENABLED );
@@ -1714,7 +1729,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlGroupBoxModel::getPropertySe
// ----------------------------------------------------
// class UnoGroupBoxControl
// ----------------------------------------------------
-UnoGroupBoxControl::UnoGroupBoxControl()
+UnoGroupBoxControl::UnoGroupBoxControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 100;
@@ -1836,21 +1852,16 @@ private:
// = UnoControlListBoxModel
// =====================================================================================================================
// ---------------------------------------------------------------------------------------------------------------------
-UnoControlListBoxModel::UnoControlListBoxModel()
- :UnoControlListBoxModel_Base()
- ,m_pData( new UnoControlListBoxModel_Data( *this ) )
- ,m_aItemListListeners( GetMutex() )
-{
- UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox );
-}
-// ---------------------------------------------------------------------------------------------------------------------
-UnoControlListBoxModel::UnoControlListBoxModel(bool)
- :UnoControlListBoxModel_Base()
+UnoControlListBoxModel::UnoControlListBoxModel( const Reference< XMultiServiceFactory >& i_factory, ConstructorMode const i_mode )
+ :UnoControlListBoxModel_Base( i_factory )
,m_pData( new UnoControlListBoxModel_Data( *this ) )
,m_aItemListListeners( GetMutex() )
{
+ if ( i_mode == ConstructDefault )
+ {
+ UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXListBox );
+ }
}
-
// ---------------------------------------------------------------------------------------------------------------------
UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource )
:UnoControlListBoxModel_Base( i_rSource )
@@ -1868,6 +1879,7 @@ IMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName
{
return ::rtl::OUString::createFromAscii( szServiceName_UnoControlListBoxModel );
}
+
// ---------------------------------------------------------------------------------------------------------------------
uno::Any UnoControlListBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
@@ -2283,8 +2295,9 @@ void UnoControlListBoxModel::impl_notifyItemListEvent_nolck( const sal_Int32 i_n
// ----------------------------------------------------
// class UnoListBoxControl
// ----------------------------------------------------
-UnoListBoxControl::UnoListBoxControl()
- :maActionListeners( *this )
+UnoListBoxControl::UnoListBoxControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoListBoxControl_Base( i_factory )
+ ,maActionListeners( *this )
,maItemListeners( *this )
{
maComponentInfos.nWidth = 100;
@@ -2713,7 +2726,8 @@ ItemListenerMultiplexer& UnoListBoxControl::getItemListeners()
// ----------------------------------------------------
// class UnoControlComboBoxModel
// ----------------------------------------------------
-UnoControlComboBoxModel::UnoControlComboBoxModel() : UnoControlListBoxModel(true)
+UnoControlComboBoxModel::UnoControlComboBoxModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlListBoxModel( i_factory, ConstructWithoutProperties )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXComboBox );
}
@@ -2788,9 +2802,10 @@ uno::Any UnoControlComboBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) cons
// ----------------------------------------------------
// class UnoComboBoxControl
// ----------------------------------------------------
-UnoComboBoxControl::UnoComboBoxControl()
- : maActionListeners( *this ),
- maItemListeners( *this )
+UnoComboBoxControl::UnoComboBoxControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoEditControl( i_factory )
+ ,maActionListeners( *this )
+ ,maItemListeners( *this )
{
maComponentInfos.nWidth = 100;
maComponentInfos.nHeight = 12;
@@ -3108,7 +3123,9 @@ sal_Int16 UnoComboBoxControl::getDropDownLineCount() throw(uno::RuntimeException
// ----------------------------------------------------
// UnoSpinFieldControl
// ----------------------------------------------------
-UnoSpinFieldControl::UnoSpinFieldControl() : maSpinListeners( *this )
+UnoSpinFieldControl::UnoSpinFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoEditControl( i_factory )
+ ,maSpinListeners( *this )
{
mbRepeat = sal_False;
}
@@ -3198,7 +3215,8 @@ void UnoSpinFieldControl::enableRepeat( sal_Bool bRepeat ) throw(::com::sun::sta
// ----------------------------------------------------
// class UnoControlDateFieldModel
// ----------------------------------------------------
-UnoControlDateFieldModel::UnoControlDateFieldModel()
+UnoControlDateFieldModel::UnoControlDateFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXDateField );
}
@@ -3243,7 +3261,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlDateFieldModel::getPropertyS
// ----------------------------------------------------
// class UnoDateFieldControl
// ----------------------------------------------------
-UnoDateFieldControl::UnoDateFieldControl()
+UnoDateFieldControl::UnoDateFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = Date( 1, 1, 1900 ).GetDate();
mnLast = Date( 31, 12, 2200 ).GetDate();
@@ -3438,7 +3457,8 @@ sal_Bool UnoDateFieldControl::isStrictFormat() throw(uno::RuntimeException)
// ----------------------------------------------------
// class UnoControlTimeFieldModel
// ----------------------------------------------------
-UnoControlTimeFieldModel::UnoControlTimeFieldModel()
+UnoControlTimeFieldModel::UnoControlTimeFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXTimeField );
}
@@ -3483,7 +3503,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlTimeFieldModel::getPropertyS
// ----------------------------------------------------
// class UnoTimeFieldControl
// ----------------------------------------------------
-UnoTimeFieldControl::UnoTimeFieldControl()
+UnoTimeFieldControl::UnoTimeFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = Time( 0, 0 ).GetTime();
mnLast = Time( 23, 59, 59, 99 ).GetTime();
@@ -3637,7 +3658,8 @@ sal_Bool UnoTimeFieldControl::isStrictFormat() throw(uno::RuntimeException)
// ----------------------------------------------------
// class UnoControlNumericFieldModel
// ----------------------------------------------------
-UnoControlNumericFieldModel::UnoControlNumericFieldModel()
+UnoControlNumericFieldModel::UnoControlNumericFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXNumericField );
}
@@ -3682,7 +3704,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlNumericFieldModel::getProper
// ----------------------------------------------------
// class UnoNumericFieldControl
// ----------------------------------------------------
-UnoNumericFieldControl::UnoNumericFieldControl()
+UnoNumericFieldControl::UnoNumericFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = 0;
mnLast = 0x7FFFFFFF;
@@ -3833,7 +3856,8 @@ sal_Int16 UnoNumericFieldControl::getDecimalDigits() throw(uno::RuntimeException
// ----------------------------------------------------
// class UnoControlCurrencyFieldModel
// ----------------------------------------------------
-UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel()
+UnoControlCurrencyFieldModel::UnoControlCurrencyFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXCurrencyField );
}
@@ -3882,7 +3906,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlCurrencyFieldModel::getPrope
// ----------------------------------------------------
// class UnoCurrencyFieldControl
// ----------------------------------------------------
-UnoCurrencyFieldControl::UnoCurrencyFieldControl()
+UnoCurrencyFieldControl::UnoCurrencyFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
mnFirst = 0;
mnLast = 0x7FFFFFFF;
@@ -4032,7 +4057,8 @@ sal_Int16 UnoCurrencyFieldControl::getDecimalDigits() throw(uno::RuntimeExceptio
// ----------------------------------------------------
// class UnoControlPatternFieldModel
// ----------------------------------------------------
-UnoControlPatternFieldModel::UnoControlPatternFieldModel()
+UnoControlPatternFieldModel::UnoControlPatternFieldModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
UNO_CONTROL_MODEL_REGISTER_PROPERTIES( VCLXPatternField );
}
@@ -4075,7 +4101,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlPatternFieldModel::getProper
// ----------------------------------------------------
// class UnoPatternFieldControl
// ----------------------------------------------------
-UnoPatternFieldControl::UnoPatternFieldControl()
+UnoPatternFieldControl::UnoPatternFieldControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoSpinFieldControl( i_factory )
{
}
@@ -4164,7 +4191,8 @@ sal_Bool UnoPatternFieldControl::isStrictFormat() throw(uno::RuntimeException)
// ----------------------------------------------------
// class UnoControlProgressBarModel
// ----------------------------------------------------
-UnoControlProgressBarModel::UnoControlProgressBarModel()
+UnoControlProgressBarModel::UnoControlProgressBarModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -4220,7 +4248,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlProgressBarModel::getPropert
// ----------------------------------------------------
// class UnoProgressBarControl
// ----------------------------------------------------
-UnoProgressBarControl::UnoProgressBarControl()
+UnoProgressBarControl::UnoProgressBarControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
}
@@ -4296,7 +4325,8 @@ sal_Int32 UnoProgressBarControl::getValue() throw(::com::sun::star::uno::Runtime
// ----------------------------------------------------
// class UnoControlFixedLineModel
// ----------------------------------------------------
-UnoControlFixedLineModel::UnoControlFixedLineModel()
+UnoControlFixedLineModel::UnoControlFixedLineModel( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlModel( i_factory )
{
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
@@ -4347,7 +4377,8 @@ uno::Reference< beans::XPropertySetInfo > UnoControlFixedLineModel::getPropertyS
// ----------------------------------------------------
// class UnoFixedLineControl
// ----------------------------------------------------
-UnoFixedLineControl::UnoFixedLineControl()
+UnoFixedLineControl::UnoFixedLineControl( const Reference< XMultiServiceFactory >& i_factory )
+ :UnoControlBase( i_factory )
{
maComponentInfos.nWidth = 100; // ??
maComponentInfos.nHeight = 100; // ??
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index 1e90c0172e83..a418b4a00b7b 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -48,7 +48,6 @@
#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
-#include <com/sun/star/awt/grid/ScrollBarMode.hpp>
#include <com/sun/star/view/SelectionType.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
@@ -273,23 +272,26 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
DECL_PROP_2 ( "RootDisplayed", TREE_ROOTDISPLAYED, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ShowsHandles", TREE_SHOWSHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "ShowsRootHandles", TREE_SHOWSROOTHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_3 ( "RowHeight", TREE_ROWHEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "RowHeight", ROW_HEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_2 ( "InvokesStopNodeEditing", TREE_INVOKESSTOPNODEEDITING, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "DialogSourceURL", DIALOGSOURCEURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT ),
- DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
- DECL_PROP_3 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "RowHeaderWidth", ROW_HEADER_WIDTH, sal_Int32, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
+ DECL_PROP_3 ( "ColumnHeaderHeight", COLUMN_HEADER_HEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_1 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND ),
+ DECL_PROP_1 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND ),
DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ),
DECL_PROP_3 ( "ReferenceDevice", REFERENCE_DEVICE, Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT ),
- DECL_PROP_3 ( "EvenRowBackgroundColor", GRID_EVEN_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
- DECL_PROP_3 ( "RowBackgroundColor", GRID_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID )
+ DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "HeaderTextColor", GRID_HEADER_TEXT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_3 ( "RowBackgroundColors", GRID_ROW_BACKGROUND_COLORS, Sequence< sal_Int32 >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
+ DECL_PROP_2 ( "UseGridLines", USE_GRID_LINES, sal_Bool, BOUND, MAYBEDEFAULT ),
};
pPropertyInfos = aImplPropertyInfos;
nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo );
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index 37f33c4168ff..8a6b1d8de4b9 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -125,97 +125,92 @@ namespace toolkit
{ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName ); }
#define IMPL_CREATEINSTANCE2( ImplName ) \
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr) \
- { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( rSMgr ) ); }
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \
+ { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( i_factory ) ); }
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlDialogModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlDialogModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory )
{
- return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel<UnoControlDialogModel> );
+ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel<UnoControlDialogModel>( i_factory ) );
}
-#define CHECKANDCREATEFACTORY( ImplName, ServiceName1, ServiceName2 ) \
- pRet = tryCreateFactory( sImplementationName, "stardiv.Toolkit." #ImplName, \
+#define GET_FACTORY_WITH_IMPL_PREFIX( ClassName, ImplNamePrefix, ServiceName1, ServiceName2 ) \
+ pRet = tryCreateFactory( sImplementationName, ImplNamePrefix "." #ClassName, \
ServiceName1, ServiceName2, \
- ImplName##_CreateInstance, xServiceFactory \
+ ClassName##_CreateInstance, xServiceFactory \
); \
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; \
+#define GET_FACTORY( ImplName, ServiceName1, ServiceName2 ) \
+ GET_FACTORY_WITH_IMPL_PREFIX( ImplName, "stardiv.Toolkit", ServiceName1, ServiceName2 )
using namespace toolkit;
IMPL_CREATEINSTANCE2( VCLXToolkit )
IMPL_CREATEINSTANCE( StdTabController )
IMPL_CREATEINSTANCE( StdTabControllerModel )
-IMPL_CREATEINSTANCE( UnoButtonControl )
-IMPL_CREATEINSTANCE( UnoCheckBoxControl )
-IMPL_CREATEINSTANCE( UnoComboBoxControl )
-IMPL_CREATEINSTANCE( UnoControlButtonModel )
-IMPL_CREATEINSTANCE( UnoControlCheckBoxModel )
-IMPL_CREATEINSTANCE( UnoControlComboBoxModel )
-IMPL_CREATEINSTANCE( UnoControlContainer )
-IMPL_CREATEINSTANCE( UnoControlContainerModel )
-IMPL_CREATEINSTANCE( UnoControlCurrencyFieldModel )
-IMPL_CREATEINSTANCE( UnoControlDateFieldModel )
-IMPL_CREATEINSTANCE( UnoControlEditModel )
-IMPL_CREATEINSTANCE( UnoControlFileControlModel )
-IMPL_CREATEINSTANCE( UnoControlFixedHyperlinkModel )
-IMPL_CREATEINSTANCE( UnoControlFixedTextModel )
-IMPL_CREATEINSTANCE( UnoControlFormattedFieldModel )
-IMPL_CREATEINSTANCE( UnoControlGroupBoxModel )
-IMPL_CREATEINSTANCE( UnoControlImageControlModel )
-IMPL_CREATEINSTANCE( UnoControlListBoxModel )
-IMPL_CREATEINSTANCE( UnoControlNumericFieldModel )
-IMPL_CREATEINSTANCE( UnoControlPatternFieldModel )
-IMPL_CREATEINSTANCE( UnoControlRadioButtonModel )
-IMPL_CREATEINSTANCE( UnoControlTimeFieldModel )
-IMPL_CREATEINSTANCE( UnoControlProgressBarModel )
-IMPL_CREATEINSTANCE( UnoControlScrollBarModel )
-IMPL_CREATEINSTANCE( UnoSpinButtonModel )
-IMPL_CREATEINSTANCE( UnoControlFixedLineModel )
-IMPL_CREATEINSTANCE( UnoCurrencyFieldControl )
-IMPL_CREATEINSTANCE( UnoDateFieldControl )
-IMPL_CREATEINSTANCE( UnoDialogControl )
-IMPL_CREATEINSTANCE( UnoEditControl )
-IMPL_CREATEINSTANCE( UnoFileControl )
-IMPL_CREATEINSTANCE( UnoFixedHyperlinkControl )
-IMPL_CREATEINSTANCE( UnoFixedTextControl )
-IMPL_CREATEINSTANCE( UnoFormattedFieldControl )
-IMPL_CREATEINSTANCE( UnoGroupBoxControl )
-IMPL_CREATEINSTANCE( UnoImageControlControl )
-IMPL_CREATEINSTANCE( UnoListBoxControl )
-IMPL_CREATEINSTANCE( UnoNumericFieldControl )
-IMPL_CREATEINSTANCE( UnoPatternFieldControl )
-IMPL_CREATEINSTANCE( UnoRadioButtonControl )
-IMPL_CREATEINSTANCE( UnoTimeFieldControl )
-IMPL_CREATEINSTANCE( UnoProgressBarControl )
-IMPL_CREATEINSTANCE( UnoScrollBarControl )
-IMPL_CREATEINSTANCE( UnoSpinButtonControl )
-IMPL_CREATEINSTANCE( UnoFixedLineControl )
+IMPL_CREATEINSTANCE2( UnoButtonControl )
+IMPL_CREATEINSTANCE2( UnoCheckBoxControl )
+IMPL_CREATEINSTANCE2( UnoComboBoxControl )
+IMPL_CREATEINSTANCE2( UnoControlButtonModel )
+IMPL_CREATEINSTANCE2( UnoControlCheckBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlComboBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlContainer )
+IMPL_CREATEINSTANCE2( UnoControlContainerModel )
+IMPL_CREATEINSTANCE2( UnoControlCurrencyFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlDateFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlEditModel )
+IMPL_CREATEINSTANCE2( UnoControlFileControlModel )
+IMPL_CREATEINSTANCE2( UnoControlFixedHyperlinkModel )
+IMPL_CREATEINSTANCE2( UnoControlFixedTextModel )
+IMPL_CREATEINSTANCE2( UnoControlFormattedFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlGroupBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlImageControlModel )
+IMPL_CREATEINSTANCE2( UnoControlListBoxModel )
+IMPL_CREATEINSTANCE2( UnoControlNumericFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlPatternFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlRadioButtonModel )
+IMPL_CREATEINSTANCE2( UnoControlTimeFieldModel )
+IMPL_CREATEINSTANCE2( UnoControlProgressBarModel )
+IMPL_CREATEINSTANCE2( UnoControlScrollBarModel )
+IMPL_CREATEINSTANCE2( UnoSpinButtonModel )
+IMPL_CREATEINSTANCE2( UnoControlFixedLineModel )
+IMPL_CREATEINSTANCE2( UnoCurrencyFieldControl )
+IMPL_CREATEINSTANCE2( UnoDateFieldControl )
+IMPL_CREATEINSTANCE2( UnoDialogControl )
+IMPL_CREATEINSTANCE2( UnoEditControl )
+IMPL_CREATEINSTANCE2( UnoFileControl )
+IMPL_CREATEINSTANCE2( UnoFixedHyperlinkControl )
+IMPL_CREATEINSTANCE2( UnoFixedTextControl )
+IMPL_CREATEINSTANCE2( UnoFormattedFieldControl )
+IMPL_CREATEINSTANCE2( UnoGroupBoxControl )
+IMPL_CREATEINSTANCE2( UnoImageControlControl )
+IMPL_CREATEINSTANCE2( UnoListBoxControl )
+IMPL_CREATEINSTANCE2( UnoNumericFieldControl )
+IMPL_CREATEINSTANCE2( UnoPatternFieldControl )
+IMPL_CREATEINSTANCE2( UnoRadioButtonControl )
+IMPL_CREATEINSTANCE2( UnoTimeFieldControl )
+IMPL_CREATEINSTANCE2( UnoProgressBarControl )
+IMPL_CREATEINSTANCE2( UnoScrollBarControl )
+IMPL_CREATEINSTANCE2( UnoSpinButtonControl )
+IMPL_CREATEINSTANCE2( UnoFixedLineControl )
IMPL_CREATEINSTANCE( VCLXMenuBar )
IMPL_CREATEINSTANCE( VCLXPointer )
IMPL_CREATEINSTANCE( VCLXPopupMenu )
IMPL_CREATEINSTANCE( VCLXPrinterServer )
-IMPL_CREATEINSTANCE( UnoRoadmapControl )
-IMPL_CREATEINSTANCE( UnoControlRoadmapModel )
-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 )
+IMPL_CREATEINSTANCE2( UnoRoadmapControl )
+IMPL_CREATEINSTANCE2( UnoControlRoadmapModel )
+IMPL_CREATEINSTANCE2( UnoSimpleAnimationControl )
+IMPL_CREATEINSTANCE2( UnoSimpleAnimationControlModel )
+IMPL_CREATEINSTANCE2( UnoThrobberControl )
+IMPL_CREATEINSTANCE2( UnoThrobberControlModel )
+IMPL_CREATEINSTANCE2( UnoControlTabPage )
+IMPL_CREATEINSTANCE2( UnoControlTabPageModel )
+IMPL_CREATEINSTANCE2( UnoControlTabPageContainer )
+IMPL_CREATEINSTANCE2( UnoControlTabPageContainerModel )
+IMPL_CREATEINSTANCE2( AnimatedImagesControl )
+IMPL_CREATEINSTANCE2( AnimatedImagesControlModel )
+IMPL_CREATEINSTANCE2( 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 >& );
@@ -225,11 +220,7 @@ 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 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_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 );
@@ -252,83 +243,83 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplemen
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory =
static_cast< ::com::sun::star::lang::XMultiServiceFactory* >( _pServiceManager );
- CHECKANDCREATEFACTORY( VCLXToolkit, szServiceName_Toolkit, szServiceName2_Toolkit )
- CHECKANDCREATEFACTORY( VCLXPopupMenu, szServiceName_PopupMenu, szServiceName2_PopupMenu )
- CHECKANDCREATEFACTORY( VCLXMenuBar, szServiceName_MenuBar, szServiceName2_MenuBar )
- CHECKANDCREATEFACTORY( VCLXPointer, szServiceName_Pointer, szServiceName2_Pointer )
- CHECKANDCREATEFACTORY( UnoControlContainer, szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer )
- CHECKANDCREATEFACTORY( UnoControlContainerModel, szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel )
- CHECKANDCREATEFACTORY( StdTabController, szServiceName_TabController, szServiceName2_TabController )
- CHECKANDCREATEFACTORY( StdTabControllerModel, szServiceName_TabControllerModel, szServiceName2_TabControllerModel )
- CHECKANDCREATEFACTORY( UnoDialogControl, szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog )
- CHECKANDCREATEFACTORY( UnoControlDialogModel, szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel )
- CHECKANDCREATEFACTORY( UnoEditControl, szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit )
- CHECKANDCREATEFACTORY( UnoControlEditModel, szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel )
- CHECKANDCREATEFACTORY( UnoDateFieldControl, szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField )
- CHECKANDCREATEFACTORY( UnoControlDateFieldModel, szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel )
- CHECKANDCREATEFACTORY( UnoTimeFieldControl, szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField )
- CHECKANDCREATEFACTORY( UnoControlTimeFieldModel, szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel )
- CHECKANDCREATEFACTORY( UnoNumericFieldControl, szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField )
- CHECKANDCREATEFACTORY( UnoControlNumericFieldModel, szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel )
- CHECKANDCREATEFACTORY( UnoCurrencyFieldControl, szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField )
- CHECKANDCREATEFACTORY( UnoControlCurrencyFieldModel, szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel )
- CHECKANDCREATEFACTORY( UnoPatternFieldControl, szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField )
- CHECKANDCREATEFACTORY( UnoControlPatternFieldModel, szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel )
- CHECKANDCREATEFACTORY( UnoFormattedFieldControl, szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField )
- CHECKANDCREATEFACTORY( UnoControlFormattedFieldModel, szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel )
- CHECKANDCREATEFACTORY( UnoFileControl, szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl )
- CHECKANDCREATEFACTORY( UnoControlFileControlModel, szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel )
- CHECKANDCREATEFACTORY( UnoButtonControl, szServiceName_UnoControlButton, szServiceName2_UnoControlButton )
- CHECKANDCREATEFACTORY( UnoControlButtonModel, szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel )
- CHECKANDCREATEFACTORY( UnoImageControlControl, szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton )
- CHECKANDCREATEFACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel )
- CHECKANDCREATEFACTORY( UnoImageControlControl, szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl )
- CHECKANDCREATEFACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel )
- CHECKANDCREATEFACTORY( UnoRadioButtonControl, szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton )
- CHECKANDCREATEFACTORY( UnoControlRadioButtonModel, szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel )
- CHECKANDCREATEFACTORY( UnoCheckBoxControl, szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox )
- CHECKANDCREATEFACTORY( UnoControlCheckBoxModel, szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel )
- CHECKANDCREATEFACTORY( UnoListBoxControl, szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox )
- CHECKANDCREATEFACTORY( UnoControlListBoxModel, szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel )
- CHECKANDCREATEFACTORY( UnoComboBoxControl, szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox )
- CHECKANDCREATEFACTORY( UnoControlComboBoxModel, szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel )
- CHECKANDCREATEFACTORY( UnoFixedTextControl, szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText )
- CHECKANDCREATEFACTORY( UnoControlFixedTextModel, szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel )
- CHECKANDCREATEFACTORY( UnoGroupBoxControl, szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox )
- CHECKANDCREATEFACTORY( UnoControlGroupBoxModel, szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel )
- CHECKANDCREATEFACTORY( UnoProgressBarControl, szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar )
- CHECKANDCREATEFACTORY( UnoControlProgressBarModel, szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel )
- CHECKANDCREATEFACTORY( UnoScrollBarControl, szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar )
- CHECKANDCREATEFACTORY( UnoControlScrollBarModel, szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel )
- CHECKANDCREATEFACTORY( UnoFixedLineControl, szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine )
- CHECKANDCREATEFACTORY( UnoControlFixedLineModel, szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel )
- CHECKANDCREATEFACTORY( VCLXPrinterServer, szServiceName_PrinterServer, szServiceName2_PrinterServer )
- CHECKANDCREATEFACTORY( UnoRoadmapControl, szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap )
- CHECKANDCREATEFACTORY( UnoControlRoadmapModel, szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel )
- CHECKANDCREATEFACTORY( UnoSpinButtonModel, szServiceName_UnoSpinButtonModel, NULL )
- CHECKANDCREATEFACTORY( UnoSpinButtonControl, szServiceName_UnoSpinButtonControl, NULL )
- CHECKANDCREATEFACTORY( TreeControl, szServiceName_TreeControl, NULL )
- CHECKANDCREATEFACTORY( TreeControlModel, szServiceName_TreeControlModel, NULL )
- CHECKANDCREATEFACTORY( MutableTreeDataModel, szServiceName_MutableTreeDataModel, NULL )
- CHECKANDCREATEFACTORY( UnoSimpleAnimationControlModel, szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel )
- 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( UnoControlTabPageModel, szServiceName_UnoControlTabPageModel, NULL )
- CHECKANDCREATEFACTORY( UnoControlTabPage, szServiceName_UnoControlTabPage, NULL )
- CHECKANDCREATEFACTORY( UnoControlTabPageContainerModel, szServiceName_UnoControlTabPageContainerModel, NULL )
- CHECKANDCREATEFACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL )
-
+ GET_FACTORY( VCLXToolkit, szServiceName_Toolkit, szServiceName2_Toolkit )
+ GET_FACTORY( VCLXPopupMenu, szServiceName_PopupMenu, szServiceName2_PopupMenu )
+ GET_FACTORY( VCLXMenuBar, szServiceName_MenuBar, szServiceName2_MenuBar )
+ GET_FACTORY( VCLXPointer, szServiceName_Pointer, szServiceName2_Pointer )
+ GET_FACTORY( UnoControlContainer, szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer )
+ GET_FACTORY( UnoControlContainerModel, szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel )
+ GET_FACTORY( StdTabController, szServiceName_TabController, szServiceName2_TabController )
+ GET_FACTORY( StdTabControllerModel, szServiceName_TabControllerModel, szServiceName2_TabControllerModel )
+ GET_FACTORY( UnoDialogControl, szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog )
+ GET_FACTORY( UnoControlDialogModel, szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel )
+ GET_FACTORY( UnoEditControl, szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit )
+ GET_FACTORY( UnoControlEditModel, szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel )
+ GET_FACTORY( UnoDateFieldControl, szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField )
+ GET_FACTORY( UnoControlDateFieldModel, szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel )
+ GET_FACTORY( UnoTimeFieldControl, szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField )
+ GET_FACTORY( UnoControlTimeFieldModel, szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel )
+ GET_FACTORY( UnoNumericFieldControl, szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField )
+ GET_FACTORY( UnoControlNumericFieldModel, szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel )
+ GET_FACTORY( UnoCurrencyFieldControl, szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField )
+ GET_FACTORY( UnoControlCurrencyFieldModel, szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel )
+ GET_FACTORY( UnoPatternFieldControl, szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField )
+ GET_FACTORY( UnoControlPatternFieldModel, szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel )
+ GET_FACTORY( UnoFormattedFieldControl, szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField )
+ GET_FACTORY( UnoControlFormattedFieldModel, szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel )
+ GET_FACTORY( UnoFileControl, szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl )
+ GET_FACTORY( UnoControlFileControlModel, szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel )
+ GET_FACTORY( UnoButtonControl, szServiceName_UnoControlButton, szServiceName2_UnoControlButton )
+ GET_FACTORY( UnoControlButtonModel, szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel )
+ GET_FACTORY( UnoImageControlControl, szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton )
+ GET_FACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel )
+ GET_FACTORY( UnoImageControlControl, szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl )
+ GET_FACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel )
+ GET_FACTORY( UnoRadioButtonControl, szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton )
+ GET_FACTORY( UnoControlRadioButtonModel, szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel )
+ GET_FACTORY( UnoCheckBoxControl, szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox )
+ GET_FACTORY( UnoControlCheckBoxModel, szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel )
+ GET_FACTORY( UnoListBoxControl, szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox )
+ GET_FACTORY( UnoControlListBoxModel, szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel )
+ GET_FACTORY( UnoComboBoxControl, szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox )
+ GET_FACTORY( UnoControlComboBoxModel, szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel )
+ GET_FACTORY( UnoFixedTextControl, szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText )
+ GET_FACTORY( UnoControlFixedTextModel, szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel )
+ GET_FACTORY( UnoGroupBoxControl, szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox )
+ GET_FACTORY( UnoControlGroupBoxModel, szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel )
+ GET_FACTORY( UnoProgressBarControl, szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar )
+ GET_FACTORY( UnoControlProgressBarModel, szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel )
+ GET_FACTORY( UnoScrollBarControl, szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar )
+ GET_FACTORY( UnoControlScrollBarModel, szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel )
+ GET_FACTORY( UnoFixedLineControl, szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine )
+ GET_FACTORY( UnoControlFixedLineModel, szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel )
+ GET_FACTORY( VCLXPrinterServer, szServiceName_PrinterServer, szServiceName2_PrinterServer )
+ GET_FACTORY( UnoRoadmapControl, szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap )
+ GET_FACTORY( UnoControlRoadmapModel, szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel )
+ GET_FACTORY( UnoSpinButtonModel, szServiceName_UnoSpinButtonModel, NULL )
+ GET_FACTORY( UnoSpinButtonControl, szServiceName_UnoSpinButtonControl, NULL )
+ GET_FACTORY( TreeControl, szServiceName_TreeControl, NULL )
+ GET_FACTORY( TreeControlModel, szServiceName_TreeControlModel, NULL )
+ GET_FACTORY( MutableTreeDataModel, szServiceName_MutableTreeDataModel, NULL )
+ GET_FACTORY( UnoSimpleAnimationControlModel, szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel )
+ GET_FACTORY( UnoSimpleAnimationControl, szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl )
+ GET_FACTORY( UnoThrobberControlModel, szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel )
+ GET_FACTORY( UnoThrobberControl, szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl )
+ GET_FACTORY( UnoFixedHyperlinkControl, szServiceName_UnoControlFixedHyperlink, NULL )
+ GET_FACTORY( UnoControlFixedHyperlinkModel, szServiceName_UnoControlFixedHyperlinkModel, NULL )
+ GET_FACTORY( GridControl, szServiceName_GridControl, NULL );
+ GET_FACTORY( GridControlModel, szServiceName_GridControlModel, NULL );
+ GET_FACTORY( DefaultGridDataModel, szServiceName_DefaultGridDataModel, NULL );
+ GET_FACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL );
+ GET_FACTORY_WITH_IMPL_PREFIX( GridColumn, "org.openoffice.comp.toolkit", szServiceName_GridColumn, NULL );
+ GET_FACTORY_WITH_IMPL_PREFIX( SortableGridDataModel, "org.openoffice.comp.toolkit", szServiceName_SortableGridDataModel, NULL );
+ GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControl, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControl, NULL )
+ GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControlModel, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControlModel, NULL )
+ GET_FACTORY_WITH_IMPL_PREFIX( SpinningProgressControlModel, "org.openoffice.comp.toolkit", szServiceName_SpinningProgressControlModel, NULL )
+ GET_FACTORY( UnoControlTabPageModel, szServiceName_UnoControlTabPageModel, NULL )
+ GET_FACTORY( UnoControlTabPage, szServiceName_UnoControlTabPage, NULL )
+ GET_FACTORY( UnoControlTabPageContainerModel, szServiceName_UnoControlTabPageContainerModel, NULL )
+ GET_FACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL )
if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 )
return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx
index 383adb22b9de..293d257da832 100644
--- a/toolkit/source/helper/servicenames.cxx
+++ b/toolkit/source/helper/servicenames.cxx
@@ -109,4 +109,5 @@ const sal_Char __FAR_DATA szServiceName_UnoControlTabPage[] = "com.sun.star.awt.
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";
+const sal_Char __FAR_DATA szServiceName_SortableGridDataModel[] = "com.sun.star.awt.grid.SortableGridDataModel";
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index 1b676ec0edb3..943723ea5910 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -68,7 +68,6 @@ using namespace ::com::sun::star;
// instead of only a <VCLXWindow> instance, especially regarding its
// corresponding accessibility API.
case WINDOW_METRICBOX:
- // <--
case WINDOW_COMBOBOX: return new VCLXComboBox;
case WINDOW_SPINFIELD:
case WINDOW_NUMERICFIELD:
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index da91945c0b0e..600687a3633b 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -212,10 +212,11 @@ Polygon VCLUnoHelper::CreatePolygon( const ::com::sun::star::uno::Sequence< sal_
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer> VCLUnoHelper::CreateControlContainer( Window* pWindow )
{
- UnoControlContainer* pContainer = new UnoControlContainer( pWindow->GetComponentInterface( sal_True ) );
+ const uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ UnoControlContainer* pContainer = new UnoControlContainer( xFactory, pWindow->GetComponentInterface( sal_True ) );
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > x = pContainer;
- UnoControlModel* pContainerModel = new UnoControlContainerModel;
+ UnoControlModel* pContainerModel = new UnoControlContainerModel( xFactory );
pContainer->setModel( (::com::sun::star::awt::XControlModel*)pContainerModel );
return x;
diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component
index c147d2b2521d..690b3f324498 100644
--- a/toolkit/util/tk.component
+++ b/toolkit/util/tk.component
@@ -53,9 +53,12 @@
<implementation name="stardiv.Toolkit.DefaultGridDataModel">
<service name="com.sun.star.awt.grid.DefaultGridDataModel"/>
</implementation>
- <implementation name="stardiv.Toolkit.GridColumn">
+ <implementation name="org.openoffice.comp.toolkit.GridColumn">
<service name="com.sun.star.awt.grid.GridColumn"/>
</implementation>
+ <implementation name="org.openoffice.comp.toolkit.SortableGridDataModel">
+ <service name="com.sun.star.awt.grid.SortableGridDataModel"/>
+ </implementation>
<implementation name="stardiv.Toolkit.GridControl">
<service name="com.sun.star.awt.grid.UnoControlGrid"/>
</implementation>
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 66034d1dc10e..841b364fef6e 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -460,9 +460,20 @@ public:
/// Switch to no endian swapping and write 0xfeff
sal_Bool StartWritingUnicodeText();
- /// Read 16bit, if 0xfeff do nothing, if 0xfffe switch
- /// endian swapping, if none of them put back
- sal_Bool StartReadingUnicodeText();
+
+ /** If eReadBomCharSet==RTL_TEXTENCODING_DONTKNOW: read 16bit,
+ if 0xfeff do nothing (UTF-16), if 0xfffe switch endian
+ swapping (UTF-16), if 0xefbb or 0xbbef read another byte
+ and check for UTF-8. If no UTF-* BOM was detected put all
+ read bytes back. This means that if 2 bytes were read it
+ was an UTF-16 BOM, if 3 bytes were read it was an UTF-8
+ BOM. There is no UTF-7, UTF-32 or UTF-EBCDIC BOM detection!
+
+ If eReadBomCharSet!=RTL_TEXTENCODING_DONTKNOW: only read a
+ BOM of that encoding and switch endian swapping if UTF-16
+ and 0xfffe.
+ */
+ sal_Bool StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet );
/// Read a line of Unicode
sal_Bool ReadUniStringLine( String& rStr );
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index 3e6081fa2b82..18adfbab37ef 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -117,7 +117,8 @@ typedef sal_uInt16 WindowType;
#define WINDOW_INTROWINDOW (WINDOW_FIRST + 0x4f)
#define WINDOW_LISTBOXWINDOW (WINDOW_FIRST + 0x50)
#define WINDOW_DOCKINGAREA (WINDOW_FIRST + 0x51)
-#define WINDOW_LAST (WINDOW_DOCKINGAREA)
+#define WINDOW_RULER (WINDOW_FIRST + 0x52)
+#define WINDOW_LAST (WINDOW_RULER)
// ---------------
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 6e1a6401b7a0..5d0da0f3e29d 100755
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1046,21 +1046,59 @@ sal_Bool SvStream::StartWritingUnicodeText()
|*
*************************************************************************/
-sal_Bool SvStream::StartReadingUnicodeText()
+sal_Bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet )
{
+ if (!( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ return sal_True; // nothing to read
+
+ bool bTryUtf8 = false;
sal_uInt16 nFlag;
+ sal_sSize nBack = sizeof(nFlag);
*this >> nFlag;
switch ( nFlag )
{
case 0xfeff :
- // native
+ // native UTF-16
+ if ( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE)
+ nBack = 0;
break;
case 0xfffe :
- SetEndianSwap( !bSwap );
+ // swapped UTF-16
+ if ( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE)
+ {
+ SetEndianSwap( !bSwap );
+ nBack = 0;
+ }
+ break;
+ case 0xefbb :
+ if (nNumberFormatInt == NUMBERFORMAT_INT_BIGENDIAN &&
+ (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ bTryUtf8 = true;
+ break;
+ case 0xbbef :
+ if (nNumberFormatInt == NUMBERFORMAT_INT_LITTLEENDIAN &&
+ (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ bTryUtf8 = true;
break;
default:
- SeekRel( -((sal_sSize)sizeof(nFlag)) ); // no BOM, pure data
+ ; // nothing
+ }
+ if (bTryUtf8)
+ {
+ sal_uChar nChar;
+ nBack += sizeof(nChar);
+ *this >> nChar;
+ if (nChar == 0xbf)
+ nBack = 0; // it is UTF-8
}
+ if (nBack)
+ SeekRel( -nBack ); // no BOM, pure data
return nError == SVSTREAM_OK;
}
diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
index 46aa1ae69ec3..5bd774d618d5 100644
--- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
@@ -27,14 +27,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_ucb.hxx"
+
/**************************************************************************
TODO
**************************************************************************
- - filter unwanted models notified by global document event broadcaster
- - help documents
- - others, which I don't know yet
-
*************************************************************************/
#include "osl/diagnose.h"
@@ -44,12 +41,13 @@
#include "comphelper/namedvaluecollection.hxx"
#include "comphelper/documentinfo.hxx"
+#include "com/sun/star/awt/XTopWindow.hpp"
#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/container/XEnumerationAccess.hpp"
+#include "com/sun/star/document/XStorageBasedDocument.hpp"
#include "com/sun/star/frame/XStorable.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
-#include "com/sun/star/document/XStorageBasedDocument.hpp"
-#include "com/sun/star/awt/XTopWindow.hpp"
+#include "com/sun/star/util/XCloseBroadcaster.hpp"
#include "tdoc_docmgr.hxx"
@@ -60,6 +58,53 @@ using ::comphelper::DocumentInfo;
//=========================================================================
//=========================================================================
//
+// OfficeDocumentsCloseListener Implementation.
+//
+//=========================================================================
+//=========================================================================
+
+//=========================================================================
+//
+// util::XCloseListener
+//
+//=========================================================================
+
+// virtual
+void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::queryClosing(
+ const lang::EventObject& /*Source*/, sal_Bool /*GetsOwnership*/ )
+ throw ( util::CloseVetoException,
+ uno::RuntimeException )
+{
+}
+
+//=========================================================================
+void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::notifyClosing(
+ const lang::EventObject& Source )
+ throw ( uno::RuntimeException )
+{
+ document::EventObject aDocEvent;
+ aDocEvent.Source = Source.Source;
+ aDocEvent.EventName = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "OfficeDocumentsListener::notifyClosing" ) );
+ m_pManager->notifyEvent( aDocEvent );
+}
+
+//=========================================================================
+//
+// lang::XEventListener (base of util::XCloseListener)
+//
+//=========================================================================
+
+// virtual
+void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::disposing(
+ const lang::EventObject& /*Source*/ )
+ throw ( uno::RuntimeException )
+{
+}
+
+//=========================================================================
+//=========================================================================
+//
// OfficeDocumentsManager Implementation.
//
//=========================================================================
@@ -70,7 +115,8 @@ OfficeDocumentsManager::OfficeDocumentsManager(
OfficeDocumentsEventListener * pDocEventListener )
: m_xSMgr( xSMgr ),
m_xDocEvtNotifier( createDocumentEventNotifier( xSMgr ) ),
- m_pDocEventListener( pDocEventListener )
+ m_pDocEventListener( pDocEventListener ),
+ m_xDocCloseListener( new OfficeDocumentsCloseListener( this ) )
{
if ( m_xDocEvtNotifier.is() )
{
@@ -188,10 +234,19 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent(
OSL_ENSURE( xStorage.is(), "Got no document storage!" );
rtl:: OUString aDocId = getDocumentId( Event.Source );
- rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) );
+ rtl:: OUString aTitle = DocumentInfo::getDocumentTitle(
+ uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) );
m_aDocs[ aDocId ] = StorageInfo( aTitle, xStorage, xModel );
+ uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster(
+ Event.Source, uno::UNO_QUERY );
+ OSL_ENSURE( xCloseBroadcaster.is(),
+ "OnLoadFinished/OnCreate event: got no close broadcaster!" );
+
+ if ( xCloseBroadcaster.is() )
+ xCloseBroadcaster->addCloseListener( m_xDocCloseListener );
+
// Propagate document closure.
OSL_ENSURE( m_pDocEventListener,
"OnLoadFinished/OnCreate event: no owner for insert event propagation!" );
@@ -202,12 +257,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent(
}
}
else if ( Event.EventName.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( "OnUnload" ) ) )
+ RTL_CONSTASCII_STRINGPARAM( "OfficeDocumentsListener::notifyClosing" ) ) )
{
if ( isOfficeDocument( Event.Source ) )
{
// Document has been closed (unloaded)
+ // #163732# - Official event "OnUnload" does not work here. Event
+ // gets fired to early. Other OnUnload listeners called after this
+ // listener may still need TDOC access to the document. Remove the
+ // document from TDOC docs list on XCloseListener::notifyClosing.
+ // See OfficeDocumentsManager::OfficeDocumentsListener::notifyClosing.
+
osl::MutexGuard aGuard( m_aMtx );
uno::Reference< frame::XModel >
@@ -228,8 +289,6 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent(
rtl::OUString aDocId( (*it).first );
m_pDocEventListener->notifyDocumentClosed( aDocId );
}
-
-
break;
}
++it;
@@ -238,8 +297,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent(
OSL_ENSURE( it != m_aDocs.end(),
"OnUnload event notified for unknown document!" );
- if( it != m_aDocs.end() )
+ if ( it != m_aDocs.end() )
+ {
+ uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster(
+ Event.Source, uno::UNO_QUERY );
+ OSL_ENSURE( xCloseBroadcaster.is(),
+ "OnUnload event: got no XCloseBroadcaster from XModel" );
+
+ if ( xCloseBroadcaster.is() )
+ xCloseBroadcaster->removeCloseListener( m_xDocCloseListener );
+
m_aDocs.erase( it );
+ }
}
}
else if ( Event.EventName.equalsAsciiL(
@@ -307,7 +376,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent(
(*it).second.xStorage = xStorage;
// Adjust title.
- (*it).second.aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) );
+ (*it).second.aTitle = DocumentInfo::getDocumentTitle( xModel );
break;
}
++it;
@@ -334,7 +403,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent(
if ( (*it).second.xModel == xModel )
{
// Adjust title.
- rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) );
+ rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( xModel );
(*it).second.aTitle = aTitle;
// Adjust storage.
@@ -475,6 +544,14 @@ void OfficeDocumentsManager::buildDocumentsList()
m_aDocs[ aDocId ]
= StorageInfo( aTitle, xStorage, xModel );
+
+ uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster(
+ xModel, uno::UNO_QUERY );
+ OSL_ENSURE( xCloseBroadcaster.is(),
+ "buildDocumentsList: got no close broadcaster!" );
+
+ if ( xCloseBroadcaster.is() )
+ xCloseBroadcaster->addCloseListener( m_xDocCloseListener );
}
}
}
diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
index 8f8b2fc117f0..b1c0ed41d9d9 100644
--- a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
+++ b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
@@ -39,6 +39,7 @@
#include "com/sun/star/embed/XStorage.hpp"
#include "com/sun/star/frame/XModel.hpp"
#include "com/sun/star/frame/XModuleManager.hpp"
+#include "com/sun/star/util/XCloseListener.hpp"
namespace tdoc_ucp {
@@ -88,6 +89,33 @@ namespace tdoc_ucp {
class OfficeDocumentsManager :
public cppu::WeakImplHelper1< com::sun::star::document::XEventListener >
{
+ class OfficeDocumentsCloseListener :
+ public cppu::WeakImplHelper1< com::sun::star::util::XCloseListener >
+
+ {
+ public:
+ OfficeDocumentsCloseListener( OfficeDocumentsManager * pMgr )
+ : m_pManager( pMgr ) {};
+
+ // util::XCloseListener
+ virtual void SAL_CALL queryClosing(
+ const ::com::sun::star::lang::EventObject& Source,
+ ::sal_Bool GetsOwnership )
+ throw (::com::sun::star::util::CloseVetoException,
+ ::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL notifyClosing(
+ const ::com::sun::star::lang::EventObject& Source )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // lang::XEventListener (base of util::XCloseListener)
+ virtual void SAL_CALL disposing(
+ const com::sun::star::lang::EventObject & Source )
+ throw ( com::sun::star::uno::RuntimeException );
+ private:
+ OfficeDocumentsManager * m_pManager;
+ };
+
public:
OfficeDocumentsManager(
const com::sun::star::uno::Reference<
@@ -131,7 +159,9 @@ namespace tdoc_ucp {
createDocumentEventNotifier(
const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
+
void buildDocumentsList();
+
bool
isOfficeDocument(
const com::sun::star::uno::Reference<
@@ -163,9 +193,11 @@ namespace tdoc_ucp {
com::sun::star::uno::Reference<
com::sun::star::document::XEventBroadcaster > m_xDocEvtNotifier;
com::sun::star::uno::Reference<
- com::sun::star::frame::XModuleManager > m_xModuleMgr;
+ com::sun::star::frame::XModuleManager > m_xModuleMgr;
DocumentList m_aDocs;
OfficeDocumentsEventListener * m_pDocEventListener;
+ com::sun::star::uno::Reference<
+ com::sun::star::util::XCloseListener > m_xDocCloseListener;
};
} // namespace tdoc_ucp
diff --git a/unotools/inc/unotools/textsearch.hxx b/unotools/inc/unotools/textsearch.hxx
index fb89e0f15179..39b201cc672e 100644
--- a/unotools/inc/unotools/textsearch.hxx
+++ b/unotools/inc/unotools/textsearch.hxx
@@ -127,15 +127,6 @@ public:
class UNOTOOLS_DLLPUBLIC TextSearch
{
- struct CachedTextSearch
- {
- ::osl::Mutex mutex;
- ::com::sun::star::util::SearchOptions Options;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch > xTextSearch;
- };
-
- static CachedTextSearch maCache;
-
static ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch >
getXTextSearch( const ::com::sun::star::util::SearchOptions& rPara );
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 317e6f9b6e45..c40654ebef1f 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -40,6 +40,7 @@
#include <unotools/charclass.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/textsearch.hxx>
+#include <rtl/instance.hxx>
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::uno;
@@ -90,13 +91,6 @@ SearchParam::SearchParam( const SearchParam& rParam )
nTransliterationFlags = rParam.nTransliterationFlags;
}
-// Klasse zum Suchen eines Strings in einem Text. Es wird genau nach
-// dem String gesucht.
-// ( Die Unterscheidung der Gross/Klein-Schreibung kann mit einen Flag
-// unterdrueckt werden )
-
-TextSearch::CachedTextSearch TextSearch::maCache;
-
static bool lcl_Equals( const SearchOptions& rSO1, const SearchOptions& rSO2 )
{
return rSO1.algorithmType == rSO2.algorithmType &&
@@ -112,27 +106,42 @@ static bool lcl_Equals( const SearchOptions& rSO1, const SearchOptions& rSO2 )
rSO1.transliterateFlags == rSO2.transliterateFlags;
}
+namespace
+{
+ struct CachedTextSearch
+ {
+ ::osl::Mutex mutex;
+ ::com::sun::star::util::SearchOptions Options;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch > xTextSearch;
+ };
+
+ struct theCachedTextSearch
+ : public rtl::Static< CachedTextSearch, theCachedTextSearch > {};
+}
+
Reference<XTextSearch> TextSearch::getXTextSearch( const SearchOptions& rPara )
{
- osl::MutexGuard aGuard(maCache.mutex);
+ CachedTextSearch &rCache = theCachedTextSearch::get();
+
+ osl::MutexGuard aGuard(rCache.mutex);
- if ( lcl_Equals(maCache.Options, rPara) )
- return maCache.xTextSearch;
+ if ( lcl_Equals(rCache.Options, rPara) )
+ return rCache.xTextSearch;
try
{
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- maCache.xTextSearch.set( xMSF->createInstance(
+ rCache.xTextSearch.set( xMSF->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.util.TextSearch" ) ) ), UNO_QUERY_THROW );
- maCache.xTextSearch->setOptions( rPara );
- maCache.Options = rPara;
+ rCache.xTextSearch->setOptions( rPara );
+ rCache.Options = rPara;
}
catch ( Exception& )
{
DBG_ERRORFILE( "TextSearch ctor: Exception caught!" );
}
- return maCache.xTextSearch;
+ return rCache.xTextSearch;
}
TextSearch::TextSearch(const SearchParam & rParam, LanguageType eLang )
diff --git a/ure/prj/build.lst b/ure/prj/build.lst
index 1f9b694ed554..7618bf3299b7 100644
--- a/ure/prj/build.lst
+++ b/ure/prj/build.lst
@@ -1,2 +1,2 @@
-ur ure : LIBXSLT:libxslt cli_ure io javaunohelper remotebridges solenv stoc NULL
+ur ure : LIBXSLT:libxslt binaryurp cli_ure io javaunohelper remotebridges solenv stoc NULL
ur ure\source nmake - all ur_source NULL
diff --git a/ure/source/README b/ure/source/README
index 3bbdaa43d6a3..fdf1c7e85d9b 100644
--- a/ure/source/README
+++ b/ure/source/README
@@ -63,7 +63,6 @@ Linux x86, Solaris x86, and Solaris SPARC:
/opt/openoffice.org/ure/bin/regcomp.bin [private]
/opt/openoffice.org/ure/lib/unorc [private]
/opt/openoffice.org/ure/lib/libreg.so.3 [private]
-/opt/openoffice.org/ure/lib/librmcxt.so.3 [private]
/opt/openoffice.org/ure/lib/libstore.so.3 [private]
/opt/openoffice.org/ure/lib/libxmlreader.so [private]
/opt/openoffice.org/ure/lib/libjvmaccessgcc3.so.3 [private; Linux x86 only]
@@ -75,7 +74,6 @@ Linux x86, Solaris x86, and Solaris SPARC:
/opt/openoffice.org/ure/lib/libgcc3_uno.so [private; Linux x86 only]
/opt/openoffice.org/ure/lib/libsunpro5_uno.so [private; Solaris only]
/opt/openoffice.org/ure/lib/libjava_uno.so [private]
-/opt/openoffice.org/ure/lib/liburp_uno.so [private]
/opt/openoffice.org/ure/lib/libunsafe_uno_uno.so [private]
/opt/openoffice.org/ure/lib/libaffine_uno_uno.so [private]
/opt/openoffice.org/ure/lib/liblog_uno_uno.so [private]
@@ -83,8 +81,8 @@ Linux x86, Solaris x86, and Solaris SPARC:
/opt/openoffice.org/ure/lib/libjuh.so [private]
/opt/openoffice.org/ure/lib/libjuhx.so [private]
/opt/openoffice.org/ure/lib/acceptor.uno.so [private]
+/opt/openoffice.org/ure/lib/binaryurp.uno.so [private]
/opt/openoffice.org/ure/lib/bootstrap.uno.so [private]
-/opt/openoffice.org/ure/lib/bridgefac.uno.so [private]
/opt/openoffice.org/ure/lib/connector.uno.so [private]
/opt/openoffice.org/ure/lib/introspection.uno.so [private]
/opt/openoffice.org/ure/lib/invocadapt.uno.so [private]
@@ -94,7 +92,6 @@ Linux x86, Solaris x86, and Solaris SPARC:
/opt/openoffice.org/ure/lib/namingservice.uno.so [private]
/opt/openoffice.org/ure/lib/proxyfac.uno.so [private]
/opt/openoffice.org/ure/lib/reflection.uno.so [private]
-/opt/openoffice.org/ure/lib/remotebridge.uno.so [private]
/opt/openoffice.org/ure/lib/streams.uno.so [private]
/opt/openoffice.org/ure/lib/textinstream.uno.so [private]
/opt/openoffice.org/ure/lib/textoutstream.uno.so [private]
@@ -127,7 +124,6 @@ Program Files\URE\misc\services.rdb
Program Files\URE\bin\libxml2.dll [external]
Program Files\URE\bin\uno.ini [private]
Program Files\URE\bin\reg3.dll [private]
-Program Files\URE\bin\rmcxt3.dll [private]
Program Files\URE\bin\store3.dll [private]
Program Files\URE\bin\xmlreader.dll [private]
Program Files\URE\bin\jvmaccess3MSC.dll [private]
@@ -138,7 +134,6 @@ Program Files\URE\bin\jvmfwk3.ini [private]
Program Files\URE\bin\msci_uno.dll [private]
Program Files\URE\bin\java_uno.dll [private]
Program Files\URE\bin\cli_uno.dll [private]
-Program Files\URE\bin\urp_uno.dll [private]
Program Files\URE\bin\unsafe_uno_uno.dll [private]
Program Files\URE\bin\affine_uno_uno.dll [private]
Program Files\URE\bin\log_uno_uno.dll [private]
@@ -147,8 +142,8 @@ Program Files\URE\bin\jpipx.dll [private]
Program Files\URE\bin\juh.dll [private]
Program Files\URE\bin\juhx.dll [private]
Program Files\URE\bin\acceptor.uno.dll [private]
+Program Files\URE\bin\binaryurp.uno.dll [private]
Program Files\URE\bin\bootstrap.uno.dll [private]
-Program Files\URE\bin\bridgefac.uno.dll [private]
Program Files\URE\bin\connector.uno.dll [private]
Program Files\URE\bin\introspection.uno.dll [private]
Program Files\URE\bin\invocadapt.uno.dll [private]
@@ -158,7 +153,6 @@ Program Files\URE\bin\javavm.uno.dll [private]
Program Files\URE\bin\namingservice.uno.dll [private]
Program Files\URE\bin\proxyfac.uno.dll [private]
Program Files\URE\bin\reflection.uno.dll [private]
-Program Files\URE\bin\remotebridge.uno.dll [private]
Program Files\URE\bin\streams.uno.dll [private]
Program Files\URE\bin\textinstream.uno.dll [private]
Program Files\URE\bin\textoutstream.uno.dll [private]
diff --git a/ure/source/makefile.mk b/ure/source/makefile.mk
index cd6fab21049d..bdd43656b32c 100644
--- a/ure/source/makefile.mk
+++ b/ure/source/makefile.mk
@@ -35,8 +35,8 @@ ZIP1LIST = uretest
my_components = \
acceptor \
+ binaryurp \
bootstrap \
- bridgefac \
connector \
introspection \
invocadapt \
@@ -47,7 +47,6 @@ my_components = \
namingservice \
proxyfac \
reflection \
- remotebridge \
stocservices \
streams \
textinstream \
diff --git a/uui/prj/build.lst b/uui/prj/build.lst
index 6816f8416bdf..b4a009cd0b9e 100644
--- a/uui/prj/build.lst
+++ b/uui/prj/build.lst
@@ -1,4 +1,4 @@
-uu uui : l10n vcl svtools LIBXSLT:libxslt NULL
+uu uui : L10N:l10n vcl svtools LIBXSLT:libxslt NULL
uu uui usr1 - all uu_mkout NULL
uu uui\source nmake - all uu_source NULL
uu uui\util nmake - all uu_util uu_source NULL
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index bddd756f6836..54d280094f2c 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -50,6 +50,7 @@
#include <basic/sbuno.hxx>
#include <basic/sbmeth.hxx>
#include <basic/sbmod.hxx>
+#include <basic/vbahelper.hxx>
#include "vbacommandbars.hxx"
@@ -200,10 +201,8 @@ void SAL_CALL
VbaApplicationBase::setScreenUpdating(sal_Bool bUpdate) throw (uno::RuntimeException)
{
uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
- if (bUpdate)
- xModel->unlockControllers();
- else
- xModel->lockControllers();
+ // #163808# use helper from module "basic" to lock all documents of this application
+ ::basic::vba::lockControllersOfAllDocuments( xModel, !bUpdate );
}
sal_Bool SAL_CALL
@@ -262,10 +261,8 @@ void SAL_CALL VbaApplicationBase::setInteractive( ::sal_Bool bInteractive )
throw (uno::RuntimeException)
{
uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
- uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
- uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
-
- xWindow->setEnable( bInteractive );
+ // #163808# use helper from module "basic" to enable/disable all container windows of all documents of this application
+ ::basic::vba::enableContainerWindowsOfAllDocuments( xModel, bInteractive );
}
sal_Bool SAL_CALL VbaApplicationBase::getVisible() throw (uno::RuntimeException)
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index 0df38b003556..087e7188c8f6 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -86,11 +86,14 @@ VbaDocumentBase::getName() throw (uno::RuntimeException)
::rtl::OUString
VbaDocumentBase::getPath() throw (uno::RuntimeException)
{
- INetURLObject aURL( getModel()->getURL() );
- rtl::OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 );
- rtl::OUString sPath;
- ::osl::File::getSystemPathFromFileURL( sURL, sPath );
+ INetURLObject aURL( getModel()->getURL() );
+ rtl::OUString sURL = aURL.GetMainURL( INetURLObject::DECODE_TO_IURI );
+ rtl::OUString sPath;
+ if( sURL.getLength() > 0 )
+ {
+ sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 );
+ ::osl::File::getSystemPathFromFileURL( sURL, sPath );
+ }
return sPath;
}
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index f2b70ab231c7..b65a58542b92 100644
--- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -24,7 +24,9 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#include <vbahelper/vbadocumentsbase.hxx>
+
+#include "vbahelper/vbadocumentsbase.hxx"
+
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase1.hxx>
@@ -49,10 +51,12 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <sfx2/objsh.hxx>
#include <tools/urlobj.hxx>
-#include <vbahelper/vbahelper.hxx>
#include <hash_map>
#include <osl/file.hxx>
+#include "vbahelper/vbahelper.hxx"
+#include "vbahelper/vbaapplicationbase.hxx"
+
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -213,8 +217,39 @@ VbaDocumentsBase::VbaDocumentsBase( const uno::Reference< XHelperInterface >& xP
{
}
+namespace {
+
+void lclSetupComponent( const uno::Reference< lang::XComponent >& rxComponent, sal_Bool bScreenUpdating, sal_Bool bInteractive )
+{
+ if( !bScreenUpdating ) try
+ {
+ uno::Reference< frame::XModel >( rxComponent, uno::UNO_QUERY_THROW )->lockControllers();
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ if( !bInteractive ) try
+ {
+ uno::Reference< frame::XModel > xModel( rxComponent, uno::UNO_QUERY_THROW );
+ uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW );
+ uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW );
+ uno::Reference< awt::XWindow >( xFrame->getContainerWindow(), uno::UNO_SET_THROW )->setEnable( sal_False );
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+} // namespace
+
uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException)
{
+ // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened)
+ uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY );
+ sal_Bool bScreenUpdating = !xApplication.is() || xApplication->getScreenUpdating();
+ sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive();
+
uno::Reference< lang::XMultiComponentFactory > xSMgr(
mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
@@ -240,6 +275,10 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException)
sURL ,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0,
aMediaDesc.getAsConstPropertyValueList() );
+
+ // #163808# lock document controllers and container window if specified by application
+ lclSetupComponent( xComponent, bScreenUpdating, bInteractive );
+
return uno::makeAny( xComponent );
}
@@ -259,6 +298,11 @@ void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException)
// #TODO# #FIXME# can any of the unused params below be used?
uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException)
{
+ // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened)
+ uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY );
+ sal_Bool bScreenUpdating = !xApplication.is() || xApplication->getScreenUpdating();
+ sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive();
+
// we need to detect if this is a URL, if not then assume its a file path
rtl::OUString aURL;
INetURLObject aObj;
@@ -282,19 +326,16 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u
uno::Sequence< beans::PropertyValue > sProps( rProps );
sProps.realloc( sProps.getLength() + 1 );
sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode") );
- sProps[ sProps.getLength() - 1 ].Value <<= uno::makeAny( document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN );
-
- sal_Int32 nIndex = sProps.getLength() - 1;
+ sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN;
if ( ReadOnly.hasValue() )
{
sal_Bool bIsReadOnly = sal_False; ReadOnly >>= bIsReadOnly;
if ( bIsReadOnly )
{
- static const rtl::OUString sReadOnly( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") );
sProps.realloc( sProps.getLength() + 1 );
- sProps[ nIndex ].Name = sReadOnly;
- sProps[ nIndex++ ].Value = uno::makeAny( (sal_Bool)sal_True );
+ sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") );
+ sProps[ sProps.getLength() - 1 ].Value <<= true;
}
}
@@ -302,6 +343,10 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_default") ),
frame::FrameSearchFlag::CREATE,
sProps);
+
+ // #163808# lock document controllers and container window if specified by application
+ lclSetupComponent( xComponent, bScreenUpdating, bInteractive );
+
return uno::makeAny( xComponent );
}
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 8043f38defad..7c0acc7598a8 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -176,8 +176,7 @@ public:
// InvalidateContext does an UnsetState and sets mrContext to 0
void InvalidateContext();
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
+ virtual bool setClipRegion( const Region& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
@@ -250,11 +249,6 @@ public:
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( sal_uLong nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
diff --git a/vcl/aqua/source/dtrans/DragSource.cxx b/vcl/aqua/source/dtrans/DragSource.cxx
index 62b153176893..dab882e75716 100644
--- a/vcl/aqua/source/dtrans/DragSource.cxx
+++ b/vcl/aqua/source/dtrans/DragSource.cxx
@@ -47,6 +47,7 @@
using namespace rtl;
using namespace cppu;
using namespace osl;
+using namespace com::sun::star;
using namespace com::sun::star::datatransfer;
using namespace com::sun::star::datatransfer::clipboard;
using namespace com::sun::star::datatransfer::dnd;
@@ -61,7 +62,7 @@ using namespace std;
// For OOo internal D&D we provide the Transferable without NSDragPboard
// interference as a shortcut
-Reference<XTransferable> DragSource::g_XTransferable = Reference<XTransferable>();
+uno::Reference<XTransferable> DragSource::g_XTransferable;
NSView* DragSource::g_DragSourceView = nil;
bool DragSource::g_DropSuccessSet = false;
bool DragSource::g_DropSuccess = false;
@@ -138,7 +139,7 @@ Sequence<OUString> dragSource_getSupportedServiceNames()
bDropSuccess );
mDragSource->mXDragSrcListener->dragDropEnd(dsde);
- mDragSource->mXDragSrcListener = Reference<XDragSourceListener>();
+ mDragSource->mXDragSrcListener = uno::Reference<XDragSourceListener>();
}
@@ -242,8 +243,8 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
sal_Int8 sourceActions,
sal_Int32 cursor,
sal_Int32 image,
- const Reference<XTransferable >& transferable,
- const Reference<XDragSourceListener >& listener )
+ const uno::Reference<XTransferable >& transferable,
+ const uno::Reference<XDragSourceListener >& listener )
throw( RuntimeException)
{
MutexGuard guard(m_aMutex);
@@ -257,7 +258,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
mXCurrentContext = static_cast<XDragSourceContext*>(new DragSourceContext(this));
auto_ptr<AquaClipboard> clipb(new AquaClipboard(NULL, false));
g_XTransferable = transferable;
- clipb->setContents(g_XTransferable, Reference<XClipboardOwner>());
+ clipb->setContents(g_XTransferable, uno::Reference<XClipboardOwner>());
mDragSourceActions = sourceActions;
g_DragSourceView = mView;
@@ -297,7 +298,7 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
[dragImage release];
- g_XTransferable = Reference<XTransferable>();
+ g_XTransferable = uno::Reference<XTransferable>();
g_DragSourceView = nil;
// reset drop success flags
diff --git a/vcl/aqua/source/dtrans/service_entry.cxx b/vcl/aqua/source/dtrans/service_entry.cxx
index 222b5cf40e04..ca207c23bdee 100644
--- a/vcl/aqua/source/dtrans/service_entry.cxx
+++ b/vcl/aqua/source/dtrans/service_entry.cxx
@@ -38,37 +38,37 @@
using namespace ::osl;
using namespace ::rtl;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::cppu;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
-Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
+uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
{
if ( Application::IsHeadlessModeEnabled() )
return SalInstance::CreateClipboard( i_rArguments );
SalData* pSalData = GetSalData();
if( ! pSalData->mxClipboard.is() )
- pSalData->mxClipboard = Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
+ pSalData->mxClipboard = uno::Reference<XInterface>(static_cast< XClipboard* >(new AquaClipboard()), UNO_QUERY);
return pSalData->mxClipboard;
}
-
-Reference<XInterface> AquaSalInstance::CreateDragSource()
+uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
{
if ( Application::IsHeadlessModeEnabled() )
return SalInstance::CreateDragSource();
- return Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
+ return uno::Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
}
-Reference<XInterface> AquaSalInstance::CreateDropTarget()
+uno::Reference<XInterface> AquaSalInstance::CreateDropTarget()
{
if ( Application::IsHeadlessModeEnabled() )
return SalInstance::CreateDropTarget();
- return Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
+ return uno::Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);
}
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index 038f366b584c..82119fb9c50a 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -816,7 +816,6 @@ static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
[pBtn setEnabled: NO];
linebreakCell( [pBtn cell], rText );
[pBtn sizeToFit];
- [pCurParent addSubview: [pBtn autorelease]];
rRightColumn.push_back( ColumnItem( pBtn ) );
@@ -828,10 +827,17 @@ static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
[pBtn setTag: nTag];
aCheckRect = [pBtn frame];
+ // #i115837# add a murphy factor; it can apparently occasionally happen
+ // that sizeToFit does not a perfect job and that the button linebreaks again
+ // if - and only if - there is already a '\n' contained in the text and the width
+ // is minimally of
+ aCheckRect.size.width += 1;
// move to rCurY
aCheckRect.origin.y = rCurY - aCheckRect.size.height;
[pBtn setFrame: aCheckRect];
+
+ [pCurParent addSubview: [pBtn autorelease]];
// update rCurY
rCurY = aCheckRect.origin.y - 5;
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 7a3a2a76f173..62906a5df268 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -41,6 +41,7 @@
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
#include "vcl/svapp.hxx"
+#include "vcl/region.h"
#include "osl/file.hxx"
#include "osl/process.h"
@@ -562,7 +563,7 @@ void AquaSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void AquaSalGraphics::BeginSetClipRegion( sal_uLong nRectCount )
+bool AquaSalGraphics::setClipRegion( const Region& i_rClip )
{
// release old clip path
if( mxClipPath )
@@ -570,41 +571,33 @@ void AquaSalGraphics::BeginSetClipRegion( sal_uLong nRectCount )
CGPathRelease( mxClipPath );
mxClipPath = NULL;
}
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool AquaSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if( (nWidth <= 0) || (nHeight <= 0) )
- return sal_True;
-
- if( !mxClipPath )
- mxClipPath = CGPathCreateMutable();
- const CGRect aClipRect = {{nX,nY},{nWidth,nHeight}};
- CGPathAddRect( mxClipPath, NULL, aClipRect );
- return sal_True;
-}
+ mxClipPath = CGPathCreateMutable();
-// -----------------------------------------------------------------------
-
-bool AquaSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& rPolyPolygon )
-{
- if( rPolyPolygon.count() <= 0 )
- return true;
-
- if( !mxClipPath )
- mxClipPath = CGPathCreateMutable();
- AddPolyPolygonToPath( mxClipPath, rPolyPolygon, !getAntiAliasB2DDraw(), false );
- return true;
-}
-
-// -----------------------------------------------------------------------
-
-void AquaSalGraphics::EndSetClipRegion()
-{
+ // set current path, either as polypolgon or sequence of rectangles
+ if( i_rClip.HasPolyPolygon() )
+ {
+ basegfx::B2DPolyPolygon aClip( const_cast<Region&>(i_rClip).ConvertToB2DPolyPolygon() );
+ AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAliasB2DDraw(), false );
+ }
+ else
+ {
+ long nX, nY, nW, nH;
+ ImplRegionInfo aInfo;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if( nW && nH )
+ {
+ CGRect aRect = {{nX,nY}, {nW,nH}};
+ CGPathAddRect( mxClipPath, NULL, aRect );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ }
+ // set the current path as clip region
if( CheckContext() )
SetState();
+ return true;
}
// -----------------------------------------------------------------------
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index 0df146eef8fa..a1d51376aa0b 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -380,14 +380,14 @@ static bool getUseNativeDialog()
try
{
// get service provider
- Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
// create configuration hierachical access name
if( xSMgr.is() )
{
try
{
- Reference< XMultiServiceFactory > xConfigProvider(
- Reference< XMultiServiceFactory >(
+ uno::Reference< XMultiServiceFactory > xConfigProvider(
+ uno::Reference< XMultiServiceFactory >(
xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationProvider" ))),
UNO_QUERY )
@@ -399,8 +399,8 @@ static bool getUseNativeDialog()
aVal.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
aVal.Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Misc" ) );
aArgs.getArray()[0] <<= aVal;
- Reference< XNameAccess > xConfigAccess(
- Reference< XNameAccess >(
+ uno::Reference< XNameAccess > xConfigAccess(
+ uno::Reference< XNameAccess >(
xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationAccess" )),
aArgs ),
diff --git a/vcl/inc/vcl/cvtsvm.hxx b/vcl/inc/vcl/cvtsvm.hxx
index 00c7c5270a0d..ad4e38816830 100644
--- a/vcl/inc/vcl/cvtsvm.hxx
+++ b/vcl/inc/vcl/cvtsvm.hxx
@@ -92,7 +92,7 @@
class Stack;
-class VCL_DLLPUBLIC SVMConverter
+class VCL_PLUGIN_PUBLIC SVMConverter
{
private:
//#if 0 // _SOLAR__PRIVATE
diff --git a/vcl/inc/vcl/displayconnectiondispatch.hxx b/vcl/inc/vcl/displayconnectiondispatch.hxx
new file mode 100644
index 000000000000..fea1d0b7cba9
--- /dev/null
+++ b/vcl/inc/vcl/displayconnectiondispatch.hxx
@@ -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 INCLUDED_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+#define INCLUDED_VCL_DISPLAYCONNECTIONDISPATCH_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/awt/XDisplayConnection.hpp"
+#include "cppuhelper/implbase1.hxx"
+
+namespace vcl {
+
+class DisplayConnectionDispatch:
+ public cppu::WeakImplHelper1< com::sun::star::awt::XDisplayConnection >
+{
+public:
+ virtual bool dispatchEvent(void * pData, int nBytes) = 0;
+
+ virtual bool dispatchErrorEvent(void * pData, int nBytes) = 0;
+
+protected:
+ virtual ~DisplayConnectionDispatch() {}
+};
+
+}
+
+#endif
diff --git a/vcl/inc/vcl/dllapi.h b/vcl/inc/vcl/dllapi.h
index bcf4001aa671..2c5c2c6801ac 100644
--- a/vcl/inc/vcl/dllapi.h
+++ b/vcl/inc/vcl/dllapi.h
@@ -37,4 +37,10 @@
#define VCL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
+#if defined UNX && ! defined MACOS
+#define VCL_PLUGIN_PUBLIC VCL_DLLPUBLIC
+#else
+#define VCL_PLUGIN_PUBLIC SAL_DLLPRIVATE
+#endif
+
#endif
diff --git a/vcl/inc/vcl/fontcache.hxx b/vcl/inc/vcl/fontcache.hxx
index b18748ed5791..7747b99015fe 100644
--- a/vcl/inc/vcl/fontcache.hxx
+++ b/vcl/inc/vcl/fontcache.hxx
@@ -38,7 +38,7 @@
namespace psp
{
-class VCL_DLLPUBLIC FontCache
+class VCL_PLUGIN_PUBLIC FontCache
{
struct FontDir;
friend class FontDir;
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 33fece8d88e1..f97f21a8f72d 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -222,7 +222,7 @@ class FontCache;
class FontCache;
-class VCL_DLLPUBLIC PrintFontManager
+class VCL_PLUGIN_PUBLIC PrintFontManager
{
struct PrintFont;
struct TrueTypeFontFile;
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index 20c3f9aaa68e..a44935bf0e54 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -57,7 +57,7 @@ class ServerFontLayout;
// =======================================================================
-class VCL_DLLPUBLIC GlyphCache
+class VCL_PLUGIN_PUBLIC GlyphCache
{
public:
explicit GlyphCache( GlyphCachePeer& );
@@ -172,7 +172,7 @@ private:
// =======================================================================
-class VCL_DLLPUBLIC ServerFont
+class VCL_PLUGIN_PUBLIC ServerFont
{
public:
virtual const ::rtl::OString* GetFontFileName() const { return NULL; }
@@ -254,7 +254,7 @@ private:
// =======================================================================
// a class for cache entries for physical font instances that are based on serverfonts
-class VCL_DLLPUBLIC ImplServerFontEntry : public ImplFontEntry
+class VCL_PLUGIN_PUBLIC ImplServerFontEntry : public ImplFontEntry
{
private:
ServerFont* mpServerFont;
@@ -271,7 +271,7 @@ public:
// =======================================================================
-class VCL_DLLPUBLIC ServerFontLayout : public GenericSalLayout
+class VCL_PLUGIN_PUBLIC ServerFontLayout : public GenericSalLayout
{
private:
ServerFont& mrServerFont;
@@ -316,7 +316,7 @@ protected:
// =======================================================================
-class VCL_DLLPUBLIC RawBitmap
+class VCL_PLUGIN_PUBLIC RawBitmap
{
public:
RawBitmap();
@@ -349,7 +349,7 @@ inline void ServerFont::SetExtended( int nInfo, void* pVoid )
// ExtraKernInfo allows an on-demand query of extra kerning info #i29881#
// The kerning values have to be scaled to match the font size before use
-class VCL_DLLPUBLIC ExtraKernInfo
+class VCL_PLUGIN_PUBLIC ExtraKernInfo
{
public:
ExtraKernInfo( sal_IntPtr nFontId );
diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx
index ae2ff2962adb..66f264faf9ef 100644
--- a/vcl/inc/vcl/graphite_adaptors.hxx
+++ b/vcl/inc/vcl/graphite_adaptors.hxx
@@ -84,7 +84,7 @@ namespace grutils
// the Graphite engine.
// @author tse
//
-class VCL_DLLPUBLIC GraphiteFontAdaptor : public gr::Font
+class VCL_PLUGIN_PUBLIC GraphiteFontAdaptor : public gr::Font
{
typedef std::map<const gr::gid16, std::pair<gr::Rect, gr::Point> > GlyphMetricMap;
friend class GrFontHasher;
diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx
index cd22abdcdb26..ebd323bebf28 100644
--- a/vcl/inc/vcl/graphite_layout.hxx
+++ b/vcl/inc/vcl/graphite_layout.hxx
@@ -85,7 +85,7 @@ namespace grutils { class GrFeatureParser; }
// This class uses the SIL Graphite engine to provide complex text layout services to the VCL
// @author tse
//
-class VCL_DLLPUBLIC GraphiteLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC GraphiteLayout : public SalLayout
{
public:
// Mask to allow Word break status to be stored within mvChar2BaseGlyph
@@ -133,7 +133,7 @@ private:
const grutils::GrFeatureParser * mpFeatures;
public:
- GraphiteLayout(const gr::Font & font, const grutils::GrFeatureParser * features = NULL) throw();
+ explicit GraphiteLayout( const gr::Font& font, const grutils::GrFeatureParser* features = NULL ) throw();
// used by upper layers
virtual bool LayoutText( ImplLayoutArgs& ); // first step of layout
@@ -183,6 +183,4 @@ private:
void expandOrCondense(ImplLayoutArgs &rArgs);
};
-
-
#endif // _SV_GRAPHITELAYOUT_HXX
diff --git a/vcl/inc/vcl/graphite_serverfont.hxx b/vcl/inc/vcl/graphite_serverfont.hxx
index 19eb70b11908..cdaed20476e2 100644
--- a/vcl/inc/vcl/graphite_serverfont.hxx
+++ b/vcl/inc/vcl/graphite_serverfont.hxx
@@ -37,7 +37,7 @@
// Modules
-class VCL_DLLPUBLIC GraphiteLayoutImpl : public GraphiteLayout
+class VCL_PLUGIN_PUBLIC GraphiteLayoutImpl : public GraphiteLayout
{
public:
GraphiteLayoutImpl(const gr::Font & font, const grutils::GrFeatureParser * features, GraphiteFontAdaptor * pFont) throw()
@@ -51,14 +51,14 @@ private:
// This class implments the server font specific parts.
// @author tse
//
-class VCL_DLLPUBLIC GraphiteServerFontLayout : public ServerFontLayout
+class VCL_PLUGIN_PUBLIC GraphiteServerFontLayout : public ServerFontLayout
{
private:
mutable GraphiteFontAdaptor * mpFont;
// mutable so that the DrawOffset/DrawBase can be set
mutable GraphiteLayoutImpl maImpl;
public:
- GraphiteServerFontLayout(GraphiteFontAdaptor * font) throw();
+ explicit GraphiteServerFontLayout( GraphiteFontAdaptor* font ) throw();
virtual bool LayoutText( ImplLayoutArgs& rArgs) { SalLayout::AdjustLayout(rArgs); return maImpl.LayoutText(rArgs); }; // first step of layout
virtual void AdjustLayout( ImplLayoutArgs& rArgs)
@@ -94,7 +94,5 @@ public:
int getMaxCharPos() const { return mnEndCharPos; }
};
-
-
#endif
#endif //_SV_GRAPHITESERVERFONT_HXX
diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx
index 752fc6e6e4f9..b80b9a86627a 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -40,16 +40,22 @@ class Window;
// - Help-Types -
// --------------
-#define QUICKHELP_LEFT ((sal_uInt16)0x0001)
-#define QUICKHELP_CENTER ((sal_uInt16)0x0002)
-#define QUICKHELP_RIGHT ((sal_uInt16)0x0004)
-#define QUICKHELP_TOP ((sal_uInt16)0x0008)
-#define QUICKHELP_VCENTER ((sal_uInt16)0x0010)
-#define QUICKHELP_BOTTOM ((sal_uInt16)0x0020)
-#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
-#define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040)
-#define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000)
-#define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000)
+#define QUICKHELP_LEFT ((sal_uInt16)0x0001)
+#define QUICKHELP_CENTER ((sal_uInt16)0x0002)
+#define QUICKHELP_RIGHT ((sal_uInt16)0x0004)
+#define QUICKHELP_TOP ((sal_uInt16)0x0008)
+#define QUICKHELP_VCENTER ((sal_uInt16)0x0010)
+#define QUICKHELP_BOTTOM ((sal_uInt16)0x0020)
+#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM)
+#define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040)
+/// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp.
+#define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080)
+/// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp
+#define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100)
+/// force balloon-style in ShowTip
+#define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200)
+#define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000)
+#define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000)
// By changes you must also change: rsc/vclrsc.hxx
#define OOO_HELP_INDEX ".help:index"
@@ -101,21 +107,25 @@ public:
static void EnableQuickHelp();
static void DisableQuickHelp();
- static sal_Bool IsQuickHelpEnabled();
- static sal_Bool ShowQuickHelp( Window* pParent,
+ static sal_Bool IsQuickHelpEnabled();
+ static sal_Bool ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
const XubString& rLongHelpText,
sal_uInt16 nStyle = 0 );
- static sal_Bool ShowQuickHelp( Window* pParent,
+ static sal_Bool ShowQuickHelp( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rHelpText,
sal_uInt16 nStyle = 0 )
{ return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); }
- static sal_uLong ShowTip( Window* pParent,
+ static sal_uLong ShowTip( Window* pParent,
const Rectangle& rScreenRect,
const XubString& rText, sal_uInt16 nStyle = 0 );
+ static void UpdateTip( sal_uLong nId,
+ Window* pParent,
+ const Rectangle& rScreenRect,
+ const XubString& rText );
static void HideTip( sal_uLong nId );
};
diff --git a/vcl/inc/vcl/helpwin.hxx b/vcl/inc/vcl/helpwin.hxx
index a3fd0a81da36..fc3e2d5ffce8 100644
--- a/vcl/inc/vcl/helpwin.hxx
+++ b/vcl/inc/vcl/helpwin.hxx
@@ -65,7 +65,8 @@ public:
const String& GetHelpText() const { return maHelpText; }
void SetHelpText( const String& rHelpText );
- sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; }
+ sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; }
+ sal_uInt16 GetStyle() const { return mnStyle; }
// Nur merken:
void SetStatusText( const String& rStatusText ) { maStatusText = rStatusText; }
diff --git a/vcl/inc/vcl/impfont.hxx b/vcl/inc/vcl/impfont.hxx
index c0ff0a080b17..cc4271932b47 100644
--- a/vcl/inc/vcl/impfont.hxx
+++ b/vcl/inc/vcl/impfont.hxx
@@ -174,7 +174,7 @@ public:
class CmapResult;
-class VCL_DLLPUBLIC ImplFontCharMap
+class VCL_PLUGIN_PUBLIC ImplFontCharMap
{
public:
explicit ImplFontCharMap( const CmapResult& );
@@ -218,11 +218,7 @@ private:
};
// CmapResult is a normalized version of the many CMAP formats
-class
-#ifdef UNX
- VCL_DLLPUBLIC // vcl-plugins need it
-#endif // UNX
-CmapResult
+class VCL_PLUGIN_PUBLIC CmapResult
{
public:
explicit CmapResult( bool bSymbolic = false,
diff --git a/vcl/inc/vcl/lineinfo.hxx b/vcl/inc/vcl/lineinfo.hxx
index 6332acb907ee..ca498c157bd7 100644
--- a/vcl/inc/vcl/lineinfo.hxx
+++ b/vcl/inc/vcl/lineinfo.hxx
@@ -56,6 +56,8 @@ struct ImplLineInfo
ImplLineInfo();
ImplLineInfo( const ImplLineInfo& rImplLineInfo );
+ bool operator==( const ImplLineInfo& ) const;
+
friend SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo );
friend SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo );
};
diff --git a/vcl/inc/vcl/octree.hxx b/vcl/inc/vcl/octree.hxx
index 684155d075f9..88de6bcc9e68 100644
--- a/vcl/inc/vcl/octree.hxx
+++ b/vcl/inc/vcl/octree.hxx
@@ -65,7 +65,7 @@ typedef PNODE* PPNODE;
class ImpNodeCache;
class BitmapReadAccess;
-class VCL_DLLPUBLIC Octree
+class VCL_PLUGIN_PUBLIC Octree
{
private:
@@ -127,7 +127,7 @@ inline sal_uInt16 Octree::GetBestPaletteIndex( const BitmapColor& rColor )
// - InverseColorMap -
// -------------------
-class VCL_DLLPUBLIC InverseColorMap
+class VCL_PLUGIN_PUBLIC InverseColorMap
{
private:
@@ -143,7 +143,7 @@ private:
public:
- InverseColorMap( const BitmapPalette& rPal );
+ explicit InverseColorMap( const BitmapPalette& rPal );
~InverseColorMap();
inline sal_uInt16 GetBestPaletteIndex( const BitmapColor& rColor );
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 88c31bd17752..1130db5bd4a2 100644..100755
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -400,7 +400,6 @@ public:
SAL_DLLPRIVATE void ImplInitClipRegion();
SAL_DLLPRIVATE bool ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL );
SAL_DLLPRIVATE void ImplSetClipRegion( const Region* pRegion );
- SAL_DLLPRIVATE void ImplSetTriangleClipRegion( const PolyPolygon &rPolyPolygon );
SAL_DLLPRIVATE SalLayout* ImplLayout( const String&, xub_StrLen nIndex,
xub_StrLen nLen, const Point& rLogicPos = Point(0,0),
@@ -838,7 +837,6 @@ public:
void SetClipRegion();
void SetClipRegion( const Region& rRegion );
- void SetTriangleClipRegion( const PolyPolygon &rRegion );
Region GetClipRegion() const;
sal_Bool IsClipRegion() const { return mbClipRegion; }
Region GetActiveClipRegion() const;
@@ -1108,6 +1106,10 @@ public:
void Push( sal_uInt16 nFlags = PUSH_ALL );
void Pop();
+ // returns the curren stack depth; that is the number of Push() calls minus the number of Pop() calls
+ // this should not normally be used since Push and Pop must always be used symmetrically
+ // however this may be e.g. a help when debugging code in which this somehow is not the case
+ sal_uInt32 GetGCStackDepth() const;
/** Query availability of alpha channel
diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx
index f31e6590a315..aabc6bd2797f 100644
--- a/vcl/inc/vcl/outfont.hxx
+++ b/vcl/inc/vcl/outfont.hxx
@@ -116,7 +116,7 @@ public: // TODO: hide members behind accessor methods
// TODO: make cloning cheaper
// abstract base class for physical font faces
-class VCL_DLLPUBLIC ImplFontData : public ImplDevFontAttributes
+class VCL_PLUGIN_PUBLIC ImplFontData : public ImplDevFontAttributes
{
public:
// by using an ImplFontData object as a factory for its corresponding
@@ -185,7 +185,7 @@ public: // TODO: change to private
// TODO: merge with ImplFontCache
// TODO: rename to LogicalFontManager
-class VCL_DLLPUBLIC ImplDevFontList
+class VCL_PLUGIN_PUBLIC ImplDevFontList
{
private:
friend class WinGlyphFallbackSubstititution;
@@ -324,7 +324,7 @@ public: // TODO: hide members behind accessor methods
// TODO: rename ImplFontEntry to LogicalFontInstance
// TODO: allow sharing of metrics for related fonts
-class VCL_DLLPUBLIC ImplFontEntry
+class VCL_PLUGIN_PUBLIC ImplFontEntry
{
public:
explicit ImplFontEntry( const ImplFontSelectData& );
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index 0f7cb805d914..4e792ef40f57 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -537,6 +537,11 @@ The following structure describes the permissions used in PDF security
String Producer; // OpenOffice
};
+ enum ColorMode
+ {
+ DrawColor, DrawGreyscale
+ };
+
struct PDFWriterContext
{
/* must be a valid file: URL usable by osl */
@@ -599,6 +604,7 @@ The following structure describes the permissions used in PDF security
com::sun::star::lang::Locale DocumentLocale; // defines the document default language
sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
// 0 here specifies a default handling
+ PDFWriter::ColorMode ColorMode;
PDFWriterContext() :
RelFsys( false ), //i56629, i49415?, i64585?
@@ -627,7 +633,8 @@ The following structure describes the permissions used in PDF security
OpenBookmarkLevels( -1 ),
Encryption(),
DPIx( 0 ),
- DPIy( 0 )
+ DPIy( 0 ),
+ ColorMode( PDFWriter::DrawColor )
{}
};
diff --git a/vcl/inc/vcl/print.h b/vcl/inc/vcl/print.h
index 78c1bb647575..7ac0d04d6dac 100644
--- a/vcl/inc/vcl/print.h
+++ b/vcl/inc/vcl/print.h
@@ -55,7 +55,7 @@ struct ImplPrnQueueData
// - ImplPrnQueueList -
// --------------------
-class VCL_DLLPUBLIC ImplPrnQueueList
+class VCL_PLUGIN_PUBLIC ImplPrnQueueList
{
public:
std::hash_map< rtl::OUString, sal_Int32, rtl::OUStringHash >
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 3584a20a92b5..2ce69ab0b660 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -340,6 +340,9 @@ public:
sal_Bool SetPaperSizeUser( const Size& rSize );
sal_Bool SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
Paper GetPaper() const;
+ static rtl::OUString GetPaperName( Paper ePaper );
+ // return a UI string for the current paper; i_bPaperUser == false means an empty string for PAPER_USER
+ rtl::OUString GetPaperName( bool i_bPaperUser = true ) const;
// returns number of available paper formats
int GetPaperInfoCount() const;
@@ -520,24 +523,24 @@ public:
bool isDirectPrint() const;
// implementation details, not usable outside vcl
- // don't use outside vcl. Some of these ar exported for
+ // don't use outside vcl. Some of these are exported for
// the benefit of vcl's plugins.
// Still: DO NOT USE OUTSIDE VCL
- int getFilteredPageCount();
+ VCL_PLUGIN_PUBLIC int getFilteredPageCount();
SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
- PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ VCL_PLUGIN_PUBLIC PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
SAL_DLLPRIVATE void printFilteredPage( int i_nPage );
SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr<Printer>& );
SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
- void createProgressDialog();
- bool isProgressCanceled() const;
+ VCL_PLUGIN_PUBLIC void createProgressDialog();
+ VCL_PLUGIN_PUBLIC bool isProgressCanceled() const;
SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
- void setLastPage( sal_Bool i_bLastPage );
+ VCL_PLUGIN_PUBLIC void setLastPage( sal_Bool i_bLastPage );
SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
SAL_DLLPRIVATE bool getReversePrint() const;
SAL_DLLPRIVATE void pushPropertiesToPrinter();
- void setJobState( com::sun::star::view::PrintableState );
+ VCL_PLUGIN_PUBLIC void setJobState( com::sun::star::view::PrintableState );
SAL_DLLPRIVATE bool setupPrinter( Window* i_pDlgParent );
SAL_DLLPRIVATE int getPageCountProtected() const;
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index d21e517d12f7..39f326d6d089 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -73,7 +73,9 @@ namespace vcl
virtual void Resize();
virtual void DataChanged( const DataChangedEvent& );
- void setPreview( const GDIMetaFile&, const Size&, const rtl::OUString&,
+ void setPreview( const GDIMetaFile&, const Size& i_rPaperSize,
+ const rtl::OUString& i_rPaperName,
+ const rtl::OUString& i_rNoPageString,
sal_Int32 i_nDPIX, sal_Int32 i_nDPIY,
bool i_bGreyscale
);
@@ -169,6 +171,7 @@ namespace vcl
NumericField maCopyCountField;
CheckBox maCollateBox;
FixedImage maCollateImage;
+ CheckBox maReverseOrderBox;
Image maCollateImg;
Image maCollateHCImg;
@@ -197,7 +200,6 @@ namespace vcl
FixedLine maOptionsLine;
CheckBox maToFileBox;
CheckBox maCollateSingleJobsBox;
- CheckBox maReverseOrderBox;
boost::shared_ptr<vcl::RowOrColumn> mxOptGroup;
diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx
index d4a9f5f5c0ab..fce105bfa8f8 100644..100755
--- a/vcl/inc/vcl/region.hxx
+++ b/vcl/inc/vcl/region.hxx
@@ -69,14 +69,19 @@ private:
SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion();
SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; }
SAL_DLLPRIVATE ImplRegion* ImplGetImplRegion() { return mpImplRegion; }
- SAL_DLLPRIVATE sal_Bool ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
- long& nX, long& nY, long& nWidth, long& nHeight ) const;
- SAL_DLLPRIVATE sal_Bool ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
- long& nX, long& nY, long& nWidth, long& nHeight ) const;
SAL_DLLPRIVATE void ImplBeginAddRect( );
SAL_DLLPRIVATE sal_Bool ImplAddRect( const Rectangle& rRect );
SAL_DLLPRIVATE void ImplEndAddRect( );
+ SAL_DLLPRIVATE void ImplIntersectWithPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplExcludePolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplUnionPolyPolygon( const Region& );
+ SAL_DLLPRIVATE void ImplXOrPolyPolygon( const Region& );
+public: // public within vcl
+ VCL_PLUGIN_PUBLIC bool ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
+ VCL_PLUGIN_PUBLIC bool ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+ long& nX, long& nY, long& nWidth, long& nHeight ) const;
#ifdef DBG_UTIL
friend const char* ImplDbgTestRegion( const void* pObj );
#endif
diff --git a/vcl/inc/vcl/salbmp.hxx b/vcl/inc/vcl/salbmp.hxx
index e12d5a21152c..b19c2ac33aeb 100644
--- a/vcl/inc/vcl/salbmp.hxx
+++ b/vcl/inc/vcl/salbmp.hxx
@@ -38,7 +38,7 @@ class SalGraphics;
class BitmapPalette;
struct BitmapSystemData;
-class VCL_DLLPUBLIC SalBitmap
+class VCL_PLUGIN_PUBLIC SalBitmap
{
public:
SalBitmap() {}
diff --git a/vcl/inc/vcl/saldatabasic.hxx b/vcl/inc/vcl/saldatabasic.hxx
index a40cd045611c..d3c1a7254513 100644
--- a/vcl/inc/vcl/saldatabasic.hxx
+++ b/vcl/inc/vcl/saldatabasic.hxx
@@ -37,7 +37,7 @@ namespace psp
class PrinterInfoManager;
}
-class VCL_DLLPUBLIC SalData
+class VCL_PLUGIN_PUBLIC SalData
{
public:
SalInstance* m_pInstance; // pointer to instance
diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx
index c5e9aba8d272..672f290b9d45 100644
--- a/vcl/inc/vcl/salframe.hxx
+++ b/vcl/inc/vcl/salframe.hxx
@@ -143,7 +143,7 @@ using namespace rtl;
struct SystemParentData;
-class VCL_DLLPUBLIC SalFrame : public vcl::DeletionNotifier
+class VCL_PLUGIN_PUBLIC SalFrame : public vcl::DeletionNotifier
{
// the VCL window corresponding to this frame
Window* m_pWindow;
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index e6d60e2b329c..1a9b9ccaea59 100644..100755
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -96,7 +96,7 @@ typedef std::vector< sal_Int32 > Int32Vector;
// note: all positions are in pixel and relative to
// the top/left-position of the virtual output area
-class VCL_DLLPUBLIC SalGraphics
+class VCL_PLUGIN_PUBLIC SalGraphics
{
int m_nLayout; // 0: mirroring off, 1: mirror x-axis
@@ -113,8 +113,7 @@ public:
virtual ~SalGraphics();
protected:
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& ) = 0;
+ virtual bool setClipRegion( const Region& ) = 0;
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY ) = 0;
virtual void drawPixel( long nX, long nY, SalColor nSalColor ) = 0;
@@ -204,11 +203,6 @@ public:
// set the clip region to empty
virtual void ResetClipRegion() = 0;
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( sal_uLong nCount ) = 0;
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion() = 0;
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor() = 0;
@@ -355,10 +349,9 @@ public:
basegfx::B2DPolygon mirror( const basegfx::B2DPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev, bool bBack = false ) const;
- // non virtual methods; these do eventual coordinate mirroring and
+ // non virtual methods; these do possible coordinate mirroring and
// then delegate to protected virtual methods
- sal_Bool UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
- sal_Bool UnionClipRegion( const ::basegfx::B2DPolyPolygon&, const OutputDevice* );
+ bool SetClipRegion( const Region&, const OutputDevice *pOutDev );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
void DrawPixel( long nX, long nY, const OutputDevice *pOutDev );
diff --git a/vcl/inc/vcl/salimestatus.hxx b/vcl/inc/vcl/salimestatus.hxx
index 779a75c9afaa..20184a059d9a 100644
--- a/vcl/inc/vcl/salimestatus.hxx
+++ b/vcl/inc/vcl/salimestatus.hxx
@@ -30,7 +30,7 @@
#include <vcl/dllapi.h>
-class VCL_DLLPUBLIC SalI18NImeStatus
+class VCL_PLUGIN_PUBLIC SalI18NImeStatus
{
public:
SalI18NImeStatus() {}
diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx
index e1ed7288651a..51f1f5b3b4e0 100644
--- a/vcl/inc/vcl/salinst.hxx
+++ b/vcl/inc/vcl/salinst.hxx
@@ -31,10 +31,12 @@
#include "com/sun/star/uno/Reference.hxx"
#include "vcl/sv.h"
+#include "vcl/displayconnectiondispatch.hxx"
#include "vcl/dllapi.h"
#include "tools/string.hxx"
+#include "rtl/ref.hxx"
#include "rtl/string.hxx"
#include <list>
@@ -68,23 +70,13 @@ namespace vos { class IMutex; }
// - SalInstance -
// ---------------
-class VCL_DLLPUBLIC SalInstance
+class VCL_PLUGIN_PUBLIC SalInstance
{
-public:
- typedef bool(*Callback)(void*,void*,int);
private:
- void* m_pEventInst;
- void* m_pErrorInst;
- Callback m_pEventCallback;
- Callback m_pErrorCallback;
+ rtl::Reference< vcl::DisplayConnectionDispatch > m_pEventInst;
public:
- SalInstance() :
- m_pEventInst( NULL ),
- m_pErrorInst( NULL ),
- m_pEventCallback( NULL ),
- m_pErrorCallback( NULL )
- {}
+ SalInstance() {}
virtual ~SalInstance();
// Frame
@@ -154,22 +146,12 @@ public:
// methods for XDisplayConnection
- // the parameters for the callbacks are:
- // void* pInst: pInstance form the SetCallback call
- // void* pEvent: address of the system specific event structure
- // int nBytes: length of the system specific event structure
- void SetEventCallback( void* pInstance, Callback pCallback )
- { m_pEventInst = pInstance; m_pEventCallback = pCallback; }
- Callback GetEventCallback() const
- { return m_pEventCallback; }
+ void SetEventCallback( rtl::Reference< vcl::DisplayConnectionDispatch > const & pInstance )
+ { m_pEventInst = pInstance; }
bool CallEventCallback( void* pEvent, int nBytes )
- { return m_pEventCallback ? m_pEventCallback( m_pEventInst, pEvent, nBytes ) : false; }
- void SetErrorEventCallback( void* pInstance, Callback pCallback )
- { m_pErrorInst = pInstance; m_pErrorCallback = pCallback; }
- Callback GetErrorEventCallback() const
- { return m_pErrorCallback; }
+ { return m_pEventInst.is() && m_pEventInst->dispatchEvent( pEvent, nBytes ); }
bool CallErrorCallback( void* pEvent, int nBytes )
- { return m_pErrorCallback ? m_pErrorCallback( m_pErrorInst, pEvent, nBytes ) : false; }
+ { return m_pEventInst.is() && m_pEventInst->dispatchErrorEvent( pEvent, nBytes ); }
enum ConnectionIdentifierType { AsciiCString, Blob };
virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
@@ -197,7 +179,7 @@ void DestroySalInstance( SalInstance* pInst );
void SalAbort( const XubString& rErrorText );
-VCL_DLLPUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
+VCL_PLUGIN_PUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
// -----------
// - SalData -
diff --git a/vcl/inc/vcl/sallayout.hxx b/vcl/inc/vcl/sallayout.hxx
index e23090c42392..bb5c6e829a70 100755
--- a/vcl/inc/vcl/sallayout.hxx
+++ b/vcl/inc/vcl/sallayout.hxx
@@ -72,7 +72,7 @@ class ImplFontData;
// -----------------
// used for managing runs e.g. for BiDi, glyph and script fallback
-class VCL_DLLPUBLIC ImplLayoutRuns
+class VCL_PLUGIN_PUBLIC ImplLayoutRuns
{
private:
int mnRunIndex;
@@ -148,7 +148,7 @@ sal_UCS4 GetVerticalChar( sal_UCS4 );
// #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx
// VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
-VCL_DLLPUBLIC const char* GetAutofallback( sal_UCS4 ) ;
+VCL_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ;
// -------------
// - SalLayout -
@@ -179,7 +179,7 @@ typedef sal_uInt32 sal_GlyphId;
// all positions/widths are in font units
// one exception: drawposition is in pixel units
-class VCL_DLLPUBLIC SalLayout
+class VCL_PLUGIN_PUBLIC SalLayout
{
public:
// used by upper layers
@@ -258,7 +258,7 @@ protected:
// - MultiSalLayout -
// ------------------
-class VCL_DLLPUBLIC MultiSalLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC MultiSalLayout : public SalLayout
{
public:
virtual void DrawText( SalGraphics& ) const;
@@ -271,7 +271,7 @@ public:
virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const;
// used only by OutputDevice::ImplLayout, TODO: make friend
- MultiSalLayout( SalLayout& rBaseLayout,
+ explicit MultiSalLayout( SalLayout& rBaseLayout,
const ImplFontData* pBaseFont = NULL );
virtual bool AddFallback( SalLayout& rFallbackLayout,
ImplLayoutRuns&, const ImplFontData* pFallbackFont );
@@ -341,7 +341,7 @@ typedef std::vector<GlyphItem> GlyphVector;
// ---------------
-class VCL_DLLPUBLIC GenericSalLayout : public SalLayout
+class VCL_PLUGIN_PUBLIC GenericSalLayout : public SalLayout
{
public:
// used by layout engines
diff --git a/vcl/inc/vcl/salmenu.hxx b/vcl/inc/vcl/salmenu.hxx
index ab9f44922aa8..030952388dfb 100644
--- a/vcl/inc/vcl/salmenu.hxx
+++ b/vcl/inc/vcl/salmenu.hxx
@@ -60,14 +60,14 @@ struct SalMenuButtonItem
: mnId( i_nId ), maImage( rImg ), maToolTipText( i_rTTText ) {}
};
-class VCL_DLLPUBLIC SalMenuItem
+class VCL_PLUGIN_PUBLIC SalMenuItem
{
public:
SalMenuItem() {}
virtual ~SalMenuItem();
};
-class VCL_DLLPUBLIC SalMenu
+class VCL_PLUGIN_PUBLIC SalMenu
{
public:
SalMenu() {}
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index fe062429121a..f78af4321398 100755
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -307,7 +307,7 @@ class VCL_DLLPUBLIC ImplControlValue
*
* Value container for scrollbars.
*/
- class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
+class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
{
public:
long mnMin;
diff --git a/vcl/inc/vcl/salobj.hxx b/vcl/inc/vcl/salobj.hxx
index 649058289699..157d817d7d0a 100644
--- a/vcl/inc/vcl/salobj.hxx
+++ b/vcl/inc/vcl/salobj.hxx
@@ -47,7 +47,7 @@ struct SystemEnvData;
// - SalObject -
// -------------
-class VCL_DLLPUBLIC SalObject
+class VCL_PLUGIN_PUBLIC SalObject
{
void* m_pInst;
SALOBJECTPROC m_pCallback;
diff --git a/vcl/inc/vcl/salprn.hxx b/vcl/inc/vcl/salprn.hxx
index ae21a8a5b438..572b766ea909 100644
--- a/vcl/inc/vcl/salprn.hxx
+++ b/vcl/inc/vcl/salprn.hxx
@@ -44,7 +44,7 @@ namespace vcl { class PrinterController; }
// - SalPrinterQueueInfo -
// -----------------------
-struct VCL_DLLPUBLIC SalPrinterQueueInfo
+struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
{
XubString maPrinterName;
XubString maDriver;
@@ -62,7 +62,7 @@ struct VCL_DLLPUBLIC SalPrinterQueueInfo
// - SalInfoPrinter -
// ------------------
-class VCL_DLLPUBLIC SalInfoPrinter
+class VCL_PLUGIN_PUBLIC SalInfoPrinter
{
public:
std::vector< PaperInfo > m_aPaperFormats; // all printer supported formats
@@ -104,7 +104,7 @@ public:
// - SalPrinter -
// --------------
-class VCL_DLLPUBLIC SalPrinter
+class VCL_PLUGIN_PUBLIC SalPrinter
{
public: // public for Sal Implementation
SalPrinter() {}
diff --git a/vcl/inc/vcl/salsession.hxx b/vcl/inc/vcl/salsession.hxx
index 2da1ae551074..c11054a79eef 100644
--- a/vcl/inc/vcl/salsession.hxx
+++ b/vcl/inc/vcl/salsession.hxx
@@ -85,7 +85,7 @@ struct SalSessionQuitEvent : public SalSessionEvent
typedef void(*SessionProc)( SalSessionEvent *pEvent);
-class VCL_DLLPUBLIC SalSession
+class VCL_PLUGIN_PUBLIC SalSession
{
SessionProc m_aProc;
public:
diff --git a/vcl/inc/vcl/salsys.hxx b/vcl/inc/vcl/salsys.hxx
index 310b0a27e30f..da16d8d5b656 100644
--- a/vcl/inc/vcl/salsys.hxx
+++ b/vcl/inc/vcl/salsys.hxx
@@ -58,7 +58,7 @@ const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO = 7;
// - SalSystem -
// -------------
-class VCL_DLLPUBLIC SalSystem
+class VCL_PLUGIN_PUBLIC SalSystem
{
public:
SalSystem() {}
diff --git a/vcl/inc/vcl/saltimer.hxx b/vcl/inc/vcl/saltimer.hxx
index 13b85d609e9e..9e69b83e6042 100644
--- a/vcl/inc/vcl/saltimer.hxx
+++ b/vcl/inc/vcl/saltimer.hxx
@@ -42,7 +42,7 @@
* this needed to be virtualized for the sal plugin migration
*/
-class VCL_DLLPUBLIC SalTimer
+class VCL_PLUGIN_PUBLIC SalTimer
{
SALTIMERPROC m_pProc;
public:
diff --git a/vcl/inc/vcl/salvd.hxx b/vcl/inc/vcl/salvd.hxx
index 6aa3222c5d96..6bf4b820a176 100644
--- a/vcl/inc/vcl/salvd.hxx
+++ b/vcl/inc/vcl/salvd.hxx
@@ -37,7 +37,7 @@ class SalGraphics;
// - SalVirtualDevice -
// --------------------
-class VCL_DLLPUBLIC SalVirtualDevice
+class VCL_PLUGIN_PUBLIC SalVirtualDevice
{
public: // public for Sal Implementation
SalVirtualDevice() {}
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 24d85c873572..9c91915823b2 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -28,6 +28,7 @@
#ifndef _SV_SVDATA_HXX
#define _SV_SVDATA_HXX
+#include "rtl/ref.hxx"
#include "vos/thread.hxx"
#include "tools/string.hxx"
#include "tools/gen.hxx"
@@ -42,6 +43,8 @@
#include "com/sun/star/uno/Reference.hxx"
#include "unotools/options.hxx"
+#include <hash_map>
+
namespace com {
namespace sun {
namespace star {
@@ -51,9 +54,6 @@ namespace lang {
namespace frame {
class XSessionManagerClient;
}
-namespace awt {
- class XDisplayConnection;
-}
}}}
struct ImplTimerData;
@@ -361,21 +361,21 @@ struct ImplSVData
sal_Bool mbIsTestTool;
vos::OThread::TThreadIdentifier mnMainThreadId;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::awt::XDisplayConnection > mxDisplayConnection;
+ rtl::Reference< vcl::DisplayConnection > mxDisplayConnection;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge;
com::sun::star::uno::Reference< com::sun::star::frame::XSessionManagerClient > xSMClient;
::vcl::SettingsConfigItem* mpSettingsConfigItem;
std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList;
+ std::hash_map< int, rtl::OUString >* mpPaperNames;
};
void ImplInitSVData();
void ImplDeInitSVData();
void ImplDestroySVData();
Window* ImplGetDefaultWindow();
-VCL_DLLPUBLIC ResMgr* ImplGetResMgr();
-VCL_DLLPUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
+VCL_PLUGIN_PUBLIC ResMgr* ImplGetResMgr();
+VCL_PLUGIN_PUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
DockingManager* ImplGetDockingManager();
void ImplWindowAutoMnemonic( Window* pWindow );
@@ -391,8 +391,8 @@ void ImplFreeEventHookData();
long ImplCallPreNotify( NotifyEvent& rEvt );
long ImplCallEvent( NotifyEvent& rEvt );
-extern VCL_DLLPUBLIC ImplSVData* pImplSVData;
-inline VCL_DLLPUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
+extern VCL_PLUGIN_PUBLIC ImplSVData* pImplSVData;
+inline VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
inline ImplSVData* ImplGetAppSVData() { return ImplGetSVData(); }
bool ImplInitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled );
diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc
index 432a30c3a748..61622bcabade 100644
--- a/vcl/inc/vcl/svids.hrc
+++ b/vcl/inc/vcl/svids.hrc
@@ -58,6 +58,8 @@
#define SV_DISCLOSURE_PLUS_HC 1062
#define SV_DISCLOSURE_MINUS_HC 1063
+#define RID_STR_PAPERNAMES 1070
+
#define SV_RESID_MENU_EDIT 2000
#define SV_MENU_EDIT_UNDO 1
#define SV_MENU_EDIT_CUT 2
@@ -147,12 +149,12 @@
#define SV_PRINT_LOCATION_TXT 21
#define SV_PRINT_COMMENT_TXT 22
#define SV_PRINT_DETAILS_BTN 23
+#define SV_PRINT_OPT_REVERSE 24
#define SV_PRINT_TAB_OPT 3
#define SV_PRINT_OPT_PRINT_FL 1
#define SV_PRINT_OPT_TOFILE 2
#define SV_PRINT_OPT_SINGLEJOBS 3
-#define SV_PRINT_OPT_REVERSE 4
#define SV_DLG_PRINT_PROGRESS 2049
#define SV_PRINT_PROGRESS_CANCEL 1
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index 1146f1b3b842..b9feeaf3a2aa 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -150,6 +150,7 @@ struct SystemGlyphData
unsigned long index;
double x;
double y;
+ int fallbacklevel;
};
@@ -178,12 +179,14 @@ struct SystemFontData
// - SystemTextLayoutData -
// --------------------
+typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
+
struct SystemTextLayoutData
{
unsigned long nSize; // size in bytes of this structure
std::vector<SystemGlyphData> rGlyphData; // glyph data
int orientation; // Text orientation
- SystemFontData aSysFontData; // Font data for the text layout
};
#endif // _SV_SYSDATA_HXX
+
diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index 6f8273731f36..696a07ca3d42 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -85,7 +85,7 @@ class TaskPaneList;
#define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
#define WINDOWSTATE_STATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
-class VCL_DLLPUBLIC WindowStateData
+class VCL_PLUGIN_PUBLIC WindowStateData
{
private:
sal_uInt32 mnValidMask;
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index 4a9afddea8b0..4011584890cf 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -210,6 +210,24 @@ struct ImplFrameData
sal_Bool mbInternalDragGestureRecognizer;
};
+// -----------------------
+// - ImplAccessibleInfos -
+// -----------------------
+
+struct ImplAccessibleInfos
+{
+ sal_uInt16 nAccessibleRole;
+ String* pAccessibleName;
+ String* pAccessibleDescription;
+ Window* pLabeledByWindow;
+ Window* pLabelForWindow;
+ Window* pMemberOfWindow;
+
+ ImplAccessibleInfos();
+ ~ImplAccessibleInfos();
+};
+
+
// ---------------
// - WindowImpl -
// ---------------
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 364fef4ef015..f367be85051d 100755
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -1053,9 +1053,20 @@ public:
void SetAccessibleDescription( const String& rDescr );
String GetAccessibleDescription() const;
+ void SetAccessibleRelationLabeledBy( Window* pLabeledBy );
+ Window* GetAccessibleRelationLabeledBy() const;
+
+ void SetAccessibleRelationLabelFor( Window* pLabelFor );
+ Window* GetAccessibleRelationLabelFor() const;
+
+ void SetAccessibleRelationMemberOf( Window* pMemberOf );
+ Window* GetAccessibleRelationMemberOf() const;
+
+
// to avoid sending accessibility events in cases like closing dialogs
// by default checks complete parent path
sal_Bool IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True );
+ void SetAccessibilityEventsSuppressed(sal_Bool bSuppressed);
/// request XCanvas render interface for this window
::com::sun::star::uno::Reference<
@@ -1080,8 +1091,7 @@ public:
sal_Bool IsCreatedWithToolkit() const;
void SetCreatedWithToolkit( sal_Bool b );
- Window* GetLabelFor() const;
- Window* GetLabeledBy() const;
+ // Deprecated - can use SetAccessibleRelationLabelFor/By nowadys
virtual Window* GetParentLabelFor( const Window* pLabel ) const;
virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
KeyEvent GetActivationKey() const;
diff --git a/vcl/inc/vcl/xconnection.hxx b/vcl/inc/vcl/xconnection.hxx
index aa9d37430ea6..d43e02941cb3 100644
--- a/vcl/inc/vcl/xconnection.hxx
+++ b/vcl/inc/vcl/xconnection.hxx
@@ -28,11 +28,12 @@
#ifndef _VCL_XCONNECTION_HXX
#define _VCL_XCONNECTION_HXX
-#include <com/sun/star/awt/XDisplayConnection.hpp>
-#include <cppuhelper/implbase1.hxx>
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include "vcl/displayconnectiondispatch.hxx"
+
#ifndef _STLP_LIST
#include <list>
#endif
@@ -40,7 +41,7 @@
namespace vcl {
class DisplayConnection :
- public ::cppu::WeakImplHelper1< ::com::sun::star::awt::XDisplayConnection >
+ public DisplayConnectionDispatch
{
::osl::Mutex m_aMutex;
::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > >
@@ -52,9 +53,11 @@ namespace vcl {
DisplayConnection();
virtual ~DisplayConnection();
- static bool dispatchEvent( void* pThis, void* pData, int nBytes );
- static bool dispatchErrorEvent( void* pThis, void* pData, int nBytes );
- void dispatchDowningEvent();
+ void start();
+ void terminate();
+
+ virtual bool dispatchEvent( void* pData, int nBytes );
+ virtual bool dispatchErrorEvent( void* pData, int nBytes );
// XDisplayConnection
virtual void SAL_CALL addEventHandler( const ::com::sun::star::uno::Any& window, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler, sal_Int32 eventMask ) throw();
diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h
index 94b2b98b4183..1c9b66d89a0b 100644
--- a/vcl/os2/inc/salgdi.h
+++ b/vcl/os2/inc/salgdi.h
@@ -151,8 +151,6 @@ public:
virtual ~Os2SalGraphics();
protected:
- virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
@@ -226,11 +224,7 @@ public:
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( ULONG nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx
index dff1557170fb..069abb1026e3 100644
--- a/vcl/os2/source/gdi/salgdi.cxx
+++ b/vcl/os2/source/gdi/salgdi.cxx
@@ -38,6 +38,7 @@
#ifndef _RTL_STRINGBUF_HXX
#include <rtl/strbuf.hxx>
#endif
+#include "vcl/region.h"
#ifndef __H_FT2LIB
#include <wingdi.h>
@@ -217,38 +218,29 @@ void Os2SalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void Os2SalGraphics::BeginSetClipRegion( ULONG nCount )
+bool Os2SalGraphics::setClipRegion( const Region& i_rClip )
{
+ ULONG nCount = i_rClip.GetRectCount();
+
mpClipRectlAry = new RECTL[ nCount ];
mnClipElementCount = 0;
-}
-
-// -----------------------------------------------------------------------
-BOOL Os2SalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- RECTL* pClipRect = &mpClipRectlAry[ mnClipElementCount ];
- pClipRect->xLeft = nX;
- pClipRect->yTop = mnHeight - nY;
- pClipRect->xRight = nX + nWidth;
- pClipRect->yBottom = mnHeight - (nY + nHeight);
- mnClipElementCount++;
-
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-bool Os2SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-void Os2SalGraphics::EndSetClipRegion()
-{
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ RECTL* pClipRect = &mpClipRectlAry[ mnClipElementCount ];
+ pClipRect->xLeft = nX;
+ pClipRect->yTop = mnHeight - nY;
+ pClipRect->xRight = nX + nW;
+ pClipRect->yBottom = mnHeight - (nY + nH);
+ mnClipElementCount++;
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
#ifdef SAL_PRINTER_CLIPPATH
if ( mbPrinter )
{
@@ -287,6 +279,8 @@ void Os2SalGraphics::EndSetClipRegion()
}
delete [] mpClipRectlAry;
+
+ return true;
}
// -----------------------------------------------------------------------
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index af15ad73e19d..d8426a092093 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc SO:print_header cpputools shell svl LIBXSLT:libxslt NULL
+vc vcl : L10N:l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc SO:print_header cpputools shell svl LIBXSLT:libxslt NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\inc nmake - all vc_inc NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 275280eff692..13fb2d3c0893 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -36,6 +36,7 @@
#include "vcl/help.hxx"
#include "vcl/helpwin.hxx"
#include "tools/debug.hxx"
+#include "tools/diagnose_ex.h"
#include "tools/time.hxx"
// =======================================================================
@@ -274,18 +275,32 @@ sal_Bool Help::ShowQuickHelp( Window* pParent,
// -----------------------------------------------------------------------
-sal_uIntPtr Help::ShowTip( Window* pParent, const Rectangle& rRect,
+sal_uIntPtr Help::ShowTip( Window* pParent, const Rectangle& rScreenRect,
const XubString& rText, sal_uInt16 nStyle )
{
- sal_uInt16 nHelpWinStyle = HELPWINSTYLE_QUICK;
+ sal_uInt16 nHelpWinStyle = ( ( nStyle & QUICKHELP_TIP_STYLE_BALLOON ) != 0 ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
HelpTextWindow* pHelpWin = new HelpTextWindow( pParent, rText, nHelpWinStyle, nStyle );
+ sal_uIntPtr nId = reinterpret_cast< sal_uIntPtr >( pHelpWin );
+ UpdateTip( nId, pParent, rScreenRect, rText );
+
+ pHelpWin->ShowHelp( HELPDELAY_NONE );
+ return nId;
+}
+
+// -----------------------------------------------------------------------
+
+void Help::UpdateTip( sal_uIntPtr nId, Window* pParent, const Rectangle& rScreenRect, const XubString& rText )
+{
+ HelpTextWindow* pHelpWin = reinterpret_cast< HelpTextWindow* >( nId );
+ ENSURE_OR_RETURN_VOID( pHelpWin != NULL, "Help::UpdateTip: invalid ID!" );
+
Size aSz = pHelpWin->CalcOutSize();
pHelpWin->SetOutputSizePixel( aSz );
- ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle,
- pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rRect );
- pHelpWin->ShowHelp( HELPDELAY_NONE );
- return (sal_uIntPtr)pHelpWin;
+ ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(),
+ pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect );
+
+ pHelpWin->SetHelpText( rText );
}
// -----------------------------------------------------------------------
@@ -590,10 +605,14 @@ void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 n
{
DBG_ASSERT( pHelpWin != pParent, "HelpInHelp ?!" );
- if ( (( pHelpWin->GetHelpText() != rHelpText ) ||
- ( pHelpWin->GetWinStyle() != nHelpWinStyle ) ||
- ( pHelpArea && ( pHelpWin->GetHelpArea() != *pHelpArea ) ) )
- && pSVData->maHelpData.mbRequestingHelp )
+ if ( ( ( pHelpWin->GetHelpText() != rHelpText )
+ || ( pHelpWin->GetWinStyle() != nHelpWinStyle )
+ || ( pHelpArea
+ && ( pHelpWin->GetHelpArea() != *pHelpArea )
+ )
+ )
+ && pSVData->maHelpData.mbRequestingHelp
+ )
{
// remove help window if no HelpText or other HelpText or
// other help mode. but keep it if we are scrolling, ie not requesting help
@@ -605,8 +624,8 @@ void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 n
}
else
{
- bool bTextChanged = rHelpText != pHelpWin->GetHelpText();
- if( bTextChanged )
+ bool const bTextChanged = rHelpText != pHelpWin->GetHelpText();
+ if ( bTextChanged || ( ( nStyle & QUICKHELP_FORCE_REPOSITION ) != 0 ) )
{
Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
@@ -625,7 +644,9 @@ void ImplShowHelpWindow( Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 n
if ( !pHelpWin && rHelpText.Len() )
{
sal_uLong nCurTime = Time::GetSystemTicks();
- if( (nCurTime - pSVData->maHelpData.mnLastHelpHideTime) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
+ if ( ( ( nCurTime - pSVData->maHelpData.mnLastHelpHideTime ) < pParent->GetSettings().GetHelpSettings().GetTipDelay() )
+ || ( ( nStyle & QUICKHELP_NO_DELAY ) != 0 )
+ )
nDelayMode = HELPDELAY_NONE;
DBG_ASSERT( !pHelpWin, "Noch ein HelpWin ?!" );
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx
index 066d58ce4eec..c8d55d109134 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -39,6 +39,12 @@
#include <list>
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
@@ -52,12 +58,12 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient
{
struct Listener
{
- Reference< XSessionManagerListener > m_xListener;
+ css::uno::Reference< XSessionManagerListener > m_xListener;
bool m_bInteractionRequested;
bool m_bInteractionDone;
bool m_bSaveDone;
- Listener( const Reference< XSessionManagerListener >& xListener )
+ Listener( const css::uno::Reference< XSessionManagerListener >& xListener )
: m_xListener( xListener ),
m_bInteractionRequested( false ),
m_bInteractionDone( false ),
@@ -84,11 +90,11 @@ public:
VCLSession();
virtual ~VCLSession();
- virtual void SAL_CALL addSessionManagerListener( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL removeSessionManagerListener( const Reference< XSessionManagerListener>& xListener ) throw( RuntimeException );
- virtual void SAL_CALL queryInteraction( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
- virtual void SAL_CALL saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL addSessionManagerListener( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL removeSessionManagerListener( const css::uno::Reference< XSessionManagerListener>& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL queryInteraction( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+ virtual void SAL_CALL saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
virtual sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException );
};
@@ -212,7 +218,7 @@ void VCLSession::callQuit()
sal_uLong nAcquireCount = Application::ReleaseSolarMutex();
for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
{
- Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
+ css::uno::Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
if( xListener2.is() )
xListener2->doQuit();
}
@@ -244,14 +250,14 @@ void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent )
}
}
-void SAL_CALL VCLSession::addSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::addSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
m_aListeners.push_back( Listener( xListener ) );
}
-void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::removeSessionManagerListener( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -268,7 +274,7 @@ void SAL_CALL VCLSession::removeSessionManagerListener( const Reference<XSession
}
}
-void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::queryInteraction( const css::uno::Reference<XSessionManagerListener>& xListener ) throw( RuntimeException )
{
if( m_bInteractionGranted )
{
@@ -295,7 +301,7 @@ void SAL_CALL VCLSession::queryInteraction( const Reference<XSessionManagerListe
}
}
-void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::interactionDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
int nRequested = 0, nDone = 0;
@@ -318,7 +324,7 @@ void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListe
}
}
-void SAL_CALL VCLSession::saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::saveDone( const css::uno::Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
@@ -359,11 +365,11 @@ Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames()
return aRet;
}
-Reference< XInterface > SAL_CALL vcl_session_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
+css::uno::Reference< XInterface > SAL_CALL vcl_session_createInstance( const css::uno::Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/ )
{
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->xSMClient.is() )
pSVData->xSMClient = new VCLSession();
- return Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
+ return css::uno::Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
}
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 191c39ba477e..c61ddc0af6ae 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1760,9 +1760,12 @@ void Application::SetUnoWrapper( UnoWrapperBase* pWrapper )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->mxDisplayConnection.is() )
+ {
pSVData->mxDisplayConnection.set( new ::vcl::DisplayConnection );
+ pSVData->mxDisplayConnection->start();
+ }
- return pSVData->mxDisplayConnection;
+ return pSVData->mxDisplayConnection.get();
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index f5b03f2b9b91..b749fa78ea59 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -53,6 +53,7 @@
#include "vcl/salimestatus.hxx"
#include "vcl/salsys.hxx"
#include "vcl/svids.hrc"
+#include "vcl/xconnection.hxx"
#include "unotools/fontcfg.hxx"
@@ -71,6 +72,12 @@
#include <stdio.h>
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::awt;
@@ -172,6 +179,8 @@ void ImplDeInitSVData()
delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL;
if( pSVData->maCtrlData.mpCleanUnitStrings )
delete pSVData->maCtrlData.mpCleanUnitStrings, pSVData->maCtrlData.mpCleanUnitStrings = NULL;
+ if( pSVData->mpPaperNames )
+ delete pSVData->mpPaperNames, pSVData->mpPaperNames = NULL;
}
// -----------------------------------------------------------------------
@@ -362,12 +371,12 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->mxAccessBridge.is() )
{
- Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
+ css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
if( xFactory.is() )
{
- Reference< XExtendedToolkit > xToolkit =
- Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
+ css::uno::Reference< XExtendedToolkit > xToolkit =
+ css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
Sequence< Any > arguments(1);
arguments[0] = makeAny(xToolkit);
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 44990c39c05a..c075e1b108f3 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -89,6 +89,12 @@
#include "rtl/strbuf.hxx"
#endif
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace ::rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -171,7 +177,7 @@ sal_Bool ImplSVMain()
DBG_ASSERT( pSVData->mpApp, "no instance of class Application" );
- Reference<XMultiServiceFactory> xMS;
+ css::uno::Reference<XMultiServiceFactory> xMS;
sal_Bool bInit = InitVCL( xMS );
@@ -186,11 +192,7 @@ sal_Bool ImplSVMain()
if( pSVData->mxDisplayConnection.is() )
{
- vcl::DisplayConnection* pConnection =
- dynamic_cast<vcl::DisplayConnection*>(pSVData->mxDisplayConnection.get());
-
- if( pConnection )
- pConnection->dispatchDowningEvent();
+ pSVData->mxDisplayConnection->terminate();
pSVData->mxDisplayConnection.clear();
}
@@ -199,7 +201,7 @@ sal_Bool ImplSVMain()
// be some events in the AWT EventQueue, which need the SolarMutex which
// - on the other hand - is destroyed in DeInitVCL(). So empty the queue
// here ..
- Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY);
+ css::uno::Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY);
if( xComponent.is() )
{
sal_uLong nCount = Application::ReleaseSolarMutex();
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index f166a3c1f535..769614a9259b 100755
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -795,19 +795,19 @@ String Edit::ImplGetValidString( const String& rString ) const
}
// -----------------------------------------------------------------------
-Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
+uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
- Reference < i18n::XBreakIterator > xBI;
+ uno::Reference < i18n::XBreakIterator > xBI;
// if ( !xBI.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XBreakIterator >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
x >>= xBI;
}
}
@@ -815,19 +815,19 @@ Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
}
// -----------------------------------------------------------------------
-Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
+uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
{
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
- Reference < i18n::XExtendedInputSequenceChecker > xISC;
+ uno::Reference < i18n::XExtendedInputSequenceChecker > xISC;
// if ( !xISC.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.InputSequenceChecker" ) );
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.InputSequenceChecker" ) );
if ( xI.is() )
{
- Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XExtendedInputSequenceChecker >*)0) );
+ Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XExtendedInputSequenceChecker >*)0) );
x >>= xISC;
}
}
@@ -902,8 +902,8 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
// get access to the configuration of this office module
try
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
+ uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ uno::Reference< container::XNameAccess > xModuleCfg( ::comphelper::ConfigurationHelper::openConfig(
xMSF,
sModule,
::comphelper::ConfigurationHelper::E_READONLY ),
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 31de70d73616..3140d100aa86 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -355,15 +355,18 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHeight )
{
Size aWinSize = Control::GetOutputSizePixel();
- if ( nWidth == -1 )
+ if ( nWidth < 0 )
nWidth = aWinSize.Width();
- if ( nHeight == -1 )
+ if ( nHeight < 0 )
nHeight = aWinSize.Height();
if ( mpTabCtrlData->maItemList.empty() )
{
- return Rectangle( Point( TAB_OFFSET, TAB_OFFSET ),
- Size( nWidth-TAB_OFFSET*2, nHeight-TAB_OFFSET*2 ) );
+ long nW = nWidth-TAB_OFFSET*2;
+ long nH = nHeight-TAB_OFFSET*2;
+ return (nW > 0 && nH > 0)
+ ? Rectangle( Point( TAB_OFFSET, TAB_OFFSET ), Size( nW, nH ) )
+ : Rectangle();
}
if ( nItemPos == TAB_PAGERECT )
@@ -375,9 +378,11 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
nLastPos = 0;
Rectangle aRect = ImplGetTabRect( nLastPos, nWidth, nHeight );
- aRect = Rectangle( Point( TAB_OFFSET, aRect.Bottom()+TAB_OFFSET ),
- Size( nWidth-TAB_OFFSET*2,
- nHeight-aRect.Bottom()-TAB_OFFSET*2 ) );
+ long nW = nWidth-TAB_OFFSET*2;
+ long nH = nHeight-aRect.Bottom()-TAB_OFFSET*2;
+ aRect = (nW > 0 && nH > 0)
+ ? Rectangle( Point( TAB_OFFSET, aRect.Bottom()+TAB_OFFSET ), Size( nW, nH ) )
+ : Rectangle();
return aRect;
}
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 5f434f9ba48a..8d831961f8af 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -236,9 +236,13 @@ bool BitmapPalette::IsGreyPalette() const
const int nEntryCount = GetEntryCount();
if( !nEntryCount ) // NOTE: an empty palette means 1:1 mapping
return true;
- const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
- if( rGreyPalette == *this )
- return true;
+ // see above: only certain entry values will result in a valid call to GetGreyPalette
+ if( nEntryCount == 2 || nEntryCount == 4 || nEntryCount == 16 || nEntryCount == 256 )
+ {
+ const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
+ if( rGreyPalette == *this )
+ return true;
+ }
// TODO: is it worth to compare the entries?
return false;
}
diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx
index b7020874ca9c..ebd55a48f593 100644
--- a/vcl/source/gdi/lineinfo.cxx
+++ b/vcl/source/gdi/lineinfo.cxx
@@ -70,6 +70,20 @@ ImplLineInfo::ImplLineInfo( const ImplLineInfo& rImplLineInfo ) :
{
}
+// -----------------------------------------------------------------------
+
+inline bool ImplLineInfo::operator==( const ImplLineInfo& rB ) const
+{
+ return(meStyle == rB.meStyle
+ && mnWidth == rB.mnWidth
+ && mnDashCount == rB.mnDashCount
+ && mnDashLen == rB.mnDashLen
+ && mnDotCount == rB.mnDotCount
+ && mnDotLen == rB.mnDotLen
+ && mnDistance == rB.mnDistance
+ && meLineJoin == rB.meLineJoin);
+}
+
// ------------
// - LineInfo -
// ------------
@@ -125,13 +139,7 @@ sal_Bool LineInfo::operator==( const LineInfo& rLineInfo ) const
DBG_CHKOBJ( &rLineInfo, LineInfo, NULL );
return( mpImplLineInfo == rLineInfo.mpImplLineInfo ||
- ( mpImplLineInfo->meStyle == rLineInfo.mpImplLineInfo->meStyle &&
- mpImplLineInfo->mnWidth == rLineInfo.mpImplLineInfo->mnWidth &&
- mpImplLineInfo->mnDashCount == rLineInfo.mpImplLineInfo->mnDashCount &&
- mpImplLineInfo->mnDashLen == rLineInfo.mpImplLineInfo->mnDashLen &&
- mpImplLineInfo->mnDotCount == rLineInfo.mpImplLineInfo->mnDotCount &&
- mpImplLineInfo->mnDotLen == rLineInfo.mpImplLineInfo->mnDotLen &&
- mpImplLineInfo->mnDistance == rLineInfo.mpImplLineInfo->mnDistance ) );
+ *mpImplLineInfo == *rLineInfo.mpImplLineInfo );
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index ad89fda760b9..b5ecb0761949 100644..100755
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -202,10 +202,6 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
{
DBG_TESTSOLARMUTEX();
- // TODO(Q3): Change from static to plain method - everybody's
- // calling it with pOutDev=this!
- // => done, but only with minimal changes for now => TODO
- OutputDevice* const pOutDev = this;
if( !pGraphics )
{
if( !mpGraphics )
@@ -214,91 +210,8 @@ bool OutputDevice::ImplSelectClipRegion( const Region& rRegion, SalGraphics* pGr
pGraphics = mpGraphics;
}
- if( rRegion.HasPolyPolygon()
- && pGraphics->supportsOperation( OutDevSupport_B2DClip ) )
- {
- const ::basegfx::B2DPolyPolygon& rB2DPolyPolygon = rRegion.GetB2DPolyPolygon();
- pGraphics->BeginSetClipRegion( 0 );
- pGraphics->UnionClipRegion( rB2DPolyPolygon, pOutDev );
- pGraphics->EndSetClipRegion();
- return true;
- }
-
- long nX;
- long nY;
- long nWidth;
- long nHeight;
- sal_uLong nRectCount;
- ImplRegionInfo aInfo;
- sal_Bool bRegionRect;
- sal_Bool bClipRegion = sal_True;
- const sal_Bool bClipDeviceBounds( !pOutDev->GetPDFWriter()
- && pOutDev->GetOutDevType() != OUTDEV_PRINTER );
-
- nRectCount = rRegion.GetRectCount();
- pGraphics->BeginSetClipRegion( nRectCount );
- bRegionRect = rRegion.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
- if( bClipDeviceBounds )
- {
- // #b6520266# Perform actual rect clip against outdev
- // dimensions, to generate empty clips whenever one of the
- // values is completely off the device.
- const long nOffX( pOutDev->mnOutOffX );
- const long nOffY( pOutDev->mnOutOffY );
- const long nDeviceWidth( pOutDev->GetOutputWidthPixel() );
- const long nDeviceHeight( pOutDev->GetOutputHeightPixel() );
- Rectangle aDeviceBounds( nOffX, nOffY,
- nOffX+nDeviceWidth-1,
- nOffY+nDeviceHeight-1 );
- while ( bRegionRect )
- {
- // #i59315# Limit coordinates passed to sal layer to actual
- // outdev dimensions - everything else bears the risk of
- // overflowing internal coordinates (e.g. the 16 bit wire
- // format of X11).
- Rectangle aTmpRect(nX,nY,nX+nWidth-1,nY+nHeight-1);
- aTmpRect.Intersection(aDeviceBounds);
-
- if( !aTmpRect.IsEmpty() )
- {
- if ( !pGraphics->UnionClipRegion( aTmpRect.Left(),
- aTmpRect.Top(),
- aTmpRect.GetWidth(),
- aTmpRect.GetHeight(),
- pOutDev ) )
- {
- bClipRegion = sal_False;
- }
- }
- else
- {
- // #i79850# Fake off-screen clip
- if ( !pGraphics->UnionClipRegion( nDeviceWidth+1,
- nDeviceHeight+1,
- 1, 1,
- pOutDev ) )
- {
- bClipRegion = sal_False;
- }
- }
- DBG_ASSERT( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't create region" );
- bRegionRect = rRegion.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
- }
- }
- else
- {
- // #i65720# Actually, _don't_ clip anything on printer or PDF
- // export, since output might be visible outside the specified
- // device boundaries.
- while ( bRegionRect )
- {
- if ( !pGraphics->UnionClipRegion( nX, nY, nWidth, nHeight, pOutDev ) )
- bClipRegion = sal_False;
- DBG_ASSERT( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't cerate region" );
- bRegionRect = rRegion.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
- }
- }
- pGraphics->EndSetClipRegion();
+ bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
+ OSL_ENSURE( bClipRegion, "OutputDevice::ImplSelectClipRegion() - can't cerate region" );
return bClipRegion;
}
@@ -1075,9 +988,22 @@ void OutputDevice::ImplInitClipRegion()
else
{
mbOutputClipped = sal_False;
- ImplSelectClipRegion(
- // #102532# Respect output offset also for clip region
- ImplPixelToDevicePixel( maRegion ) );
+
+ // #102532# Respect output offset also for clip region
+ Region aRegion( ImplPixelToDevicePixel( maRegion ) );
+ const bool bClipDeviceBounds( ! GetPDFWriter()
+ && GetOutDevType() != OUTDEV_PRINTER );
+ if( bClipDeviceBounds )
+ {
+ // #b6520266# Perform actual rect clip against outdev
+ // dimensions, to generate empty clips whenever one of the
+ // values is completely off the device.
+ Rectangle aDeviceBounds( mnOutOffX, mnOutOffY,
+ mnOutOffX+GetOutputWidthPixel()-1,
+ mnOutOffY+GetOutputHeightPixel()-1 );
+ aRegion.Intersect( aDeviceBounds );
+ }
+ ImplSelectClipRegion( aRegion );
}
mbClipRegionSet = sal_True;
@@ -1122,693 +1048,6 @@ void OutputDevice::ImplSetClipRegion( const Region* pRegion )
// -----------------------------------------------------------------------
-namespace
-{
- inline int iround( float x )
- {
- union
- {
- float f;
- sal_Int32 i;
- };
- f = x;
- sal_Int32 exponent = (127 + 31) - ((i >> 23) & 0xFF);
- sal_Int32 r = ((sal_Int32(i) << 8) | (1U << 31)) >> exponent;
- r &= ((exponent - 32) >> 31);
- sal_Int32 sign = i >> 31;
- return r = (r ^ sign) - sign;
- }
-
- inline int floorDiv(int a, int b)
- {
- if(b == 0)
- return 0x80000000;
- if(a >= 0)
- return a / b;
- int q = -(-a / b); // quotient
- int r = -a % b; // remainder
- if(r)
- q--;
- return q;
- }
-
- inline int floorMod( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- if(a >= 0)
- return a % b;
- int r = -a % b; // remainder
- if(r)
- r = b - r;
- return r;
- }
-
- inline int ceilDiv( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- a += - 1 + b;
- if(a >= 0)
- return a / b;
- int q = -(-a / b); // quotient
- int r = -a % b; // remainder
- if(r)
- q--;
- return q;
- }
-
- inline int ceilMod( int a, int b )
- {
- if(b == 0)
- return 0x80000000;
- a += - 1 + b;
- if(a >= 0)
- return (a % b) + 1 - b;
- int r = -a % b;
- if(r)
- r = b - r;
- return r + 1 - b;
- }
-
- inline int ceilFix4(int x) { return (x + 0xF) & 0xFFFFFFF0; }
-
- struct vertex
- {
- float x,y;
- inline vertex( const Point &p )
- : x((float)p.getX()),y((float)p.getY()) {}
- };
-
- template<class T> inline void swap(T &a, T &b) { T t=a; a=b; b=t; }
-
- class SpanIterator
- {
- public:
-
- SpanIterator( sal_Int32 *pTable, size_t dwPitch, sal_Int32 dwNumScanlines );
- std::pair<sal_Int32,sal_Int32> GetNextSpan( void );
- sal_Int32 GetNumRemainingScanlines( void );
- sal_Int32 GetNumEqualScanlines( void );
- SpanIterator &operator++ ();
- SpanIterator &Skip( sal_Int32 dwNumScanlines );
- sal_Int32 GetRemainingSpans( void ) const { return maNumSpans; }
-
- private:
-
- sal_Int32 *mpTable;
- sal_Int32 *mpSpanArray;
- sal_Int32 maNumSpans;
- sal_Int32 maRemainingScanlines;
- size_t maPitch;
- };
-
- inline SpanIterator::SpanIterator( sal_Int32 *pTable, size_t dwPitch, sal_Int32 dwNumScanlines )
- : mpTable(pTable),maRemainingScanlines(dwNumScanlines),maPitch(dwPitch)
- {
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- }
-
- inline SpanIterator &SpanIterator::operator++ ()
- {
- --maRemainingScanlines;
- mpTable += maPitch;
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- return (*this);
- }
-
- inline SpanIterator &SpanIterator::Skip( sal_Int32 dwNumScanlines )
- {
- // don't skip more scanlines than there are...
- if(dwNumScanlines > maRemainingScanlines)
- dwNumScanlines = maRemainingScanlines;
-
- // skip in one fellow swoop...
- maRemainingScanlines -= dwNumScanlines;
- mpTable += maPitch * dwNumScanlines;
-
- // initialize necessary query fields...
- sal_Int32 *pNumSpans = mpTable;
- mpSpanArray = reinterpret_cast<sal_Int32 *>(pNumSpans+2);
- maNumSpans = *pNumSpans;
- return (*this);
- }
-
- inline std::pair<sal_Int32,sal_Int32> SpanIterator::GetNextSpan( void )
- {
- sal_Int32 x(0);
- sal_Int32 w(0);
- if(maNumSpans)
- {
- x = *mpSpanArray++;
- w = *mpSpanArray++;
- --maNumSpans;
- }
- return std::pair<sal_Int32,sal_Int32>(x,w);
- }
-
- inline sal_Int32 SpanIterator::GetNumEqualScanlines( void )
- {
- return mpTable[1];
- }
-
- inline sal_Int32 SpanIterator::GetNumRemainingScanlines( void )
- {
- return maRemainingScanlines;
- }
-
- class ScanlineContainer
- {
-
- public:
-
- ScanlineContainer( sal_uInt32 dwNumScanlines,
- sal_uInt32 dwNumSpansPerScanline );
-
- ~ScanlineContainer( void );
-
- void InsertSpan( sal_Int32 y, sal_Int32 lx, sal_Int32 rx );
-
- SpanIterator Iterate( void ) const { return SpanIterator(mpTable,maPitch,maNumScanlines); }
-
- inline sal_uInt32 GetNumSpans( void ) const { return maNumberOfSpans; }
-
- void Consolidate( void );
-
- private:
-
- // the span table will assist in determinate exactly how many clipping
- // regions [that is *spans*] we will end up with.
- // the counter for this purpose is right ahead.
- sal_uInt32 maNumberOfSpans;
-
- struct span
- {
- sal_Int32 x;
- sal_Int32 w;
- };
-
- sal_uInt32 maNumScanlines;
- sal_uInt32 maNumSpansPerScanline;
- sal_Int32 *mpTable;
- size_t maPitch;
- };
-
- ScanlineContainer::ScanlineContainer( sal_uInt32 dwNumScanlines,
- sal_uInt32 dwNumSpansPerScanline ) : maNumScanlines(dwNumScanlines),
- maNumSpansPerScanline(dwNumSpansPerScanline)
- {
- // #128002# add one scanline buffer at the end, as
- // SpanIterator::Skip reads two bytes past the end.
- ++dwNumScanlines;
-
- // since each triangle could possibly add another span
- // we can calculate the upper limit by [num scanlines * num triangles].
- const sal_uInt32 dwNumPossibleRegions = dwNumScanlines*dwNumSpansPerScanline;
-
- // calculate the number of bytes the span table will consume
- const size_t dwTableSize = dwNumPossibleRegions*sizeof(span)+dwNumScanlines*(sizeof(sal_Int32)<<1);
-
- // allocate the span table [on the stack]
- mpTable = static_cast<sal_Int32 *>(rtl_allocateMemory(dwTableSize));
-
- // calculate the table pitch, that is how many int's do i need to get from a scanline to the next.
- maPitch = (dwNumSpansPerScanline*sizeof(span)/sizeof(sal_Int32))+2;
-
- // we need to initialize the table here.
- // the first *int* on each scanline tells us how many spans are on it.
- sal_Int32 *pNumSpans = mpTable;
- for(unsigned int i=0; i<dwNumScanlines; ++i)
- {
- pNumSpans[0] = 0;
- pNumSpans[1] = 0;
- pNumSpans += maPitch;
- }
-
- maNumberOfSpans = 0;
- }
-
- ScanlineContainer::~ScanlineContainer( void )
- {
- rtl_freeMemory(mpTable);
- }
-
- void ScanlineContainer::InsertSpan( sal_Int32 y, sal_Int32 lx, sal_Int32 rx )
- {
- // there's new incoming span which we need to store in the table.
- // first see if its width contributes a valid span.
- if(sal_Int32 dwSpanWidth = rx-lx)
- {
- // first select the appropriate scanline the new span.
- sal_Int32 *pNumSpans = mpTable+(y*maPitch);
- span *pSpanArray = reinterpret_cast<span *>(pNumSpans+2);
-
- // retrieve the number of already contained spans.
- sal_Int32 dwNumSpan = *pNumSpans;
-
- // since we need to sort the spans from top to bottom
- // and left to right, we need to find the correct location
- // in the table.
- sal_Int32 dwIndex = 0;
- while(dwIndex<dwNumSpan)
- {
- // since we would like to avoid unnecessary spans
- // we try to consolidate them if possible.
- // consolidate with right neighbour
- if(pSpanArray[dwIndex].x == rx)
- {
- pSpanArray[dwIndex].x = lx;
- pSpanArray[dwIndex].w += dwSpanWidth;
- return;
- }
-
- // consolidate with left neighbour
- if((pSpanArray[dwIndex].x+pSpanArray[dwIndex].w) == lx)
- {
- pSpanArray[dwIndex].w += rx-lx;
- return;
- }
-
- // no consolidation possible, either this is a completely
- // seperate span or it is the first in the list.
- if(pSpanArray[dwIndex].x > lx)
- break;
-
- // forward to next element in the list.
- ++dwIndex;
- }
-
- // if we reach here, the new span needs to be stored
- // in the table, increase the number of spans in the
- // current scanline.
- *pNumSpans = dwNumSpan+1;
-
- // keep the list of spans in sorted order. 'dwIndex'
- // is where we want to store the new span. 'dwNumSpan'
- // is the number of spans already there. now we need
- // to move the offending spans out of the way.
- while(dwIndex != dwNumSpan)
- {
- pSpanArray[dwNumSpan].x = pSpanArray[dwNumSpan-1].x;
- pSpanArray[dwNumSpan].w = pSpanArray[dwNumSpan-1].w;
- --dwNumSpan;
- }
-
- // insert the new span
- pSpanArray[dwIndex].x = lx;
- pSpanArray[dwIndex].w = rx-lx;
-
- // remember the total number of spans in the table.
- ++maNumberOfSpans;
- }
- }
-
- void ScanlineContainer::Consolidate( void )
- {
- sal_Int32 *pScanline = mpTable;
-
- sal_Int32 dwRemaining = maNumScanlines;
- while(dwRemaining)
- {
- sal_Int32 dwNumSpans = pScanline[0];
- sal_Int32 *pSpanArray = pScanline+2;
-
- sal_Int32 dwRest = dwRemaining-1;
- sal_Int32 *pNext = pScanline;
- while(dwRest)
- {
- pNext += maPitch;
- sal_Int32 dwNumNextSpans = pNext[0];
- sal_Int32 *pSpanArrayNext = pNext+2;
- if(dwNumSpans != dwNumNextSpans)
- break;
-
- sal_Int32 dwCompare = dwNumSpans<<1;
- while(dwCompare)
- {
- if(pSpanArray[dwCompare-1] != pSpanArrayNext[dwCompare-1])
- break;
- --dwCompare;
- }
- if(dwCompare)
- break;
-
- --dwRest;
- }
-
- const sal_Int32 dwNumEqualScanlines(dwRemaining-dwRest);
- pScanline[1] = dwNumEqualScanlines;
- pScanline += maPitch*dwNumEqualScanlines;
- dwRemaining -= dwNumEqualScanlines;
-
- // since we track the total number of spans to generate,
- // we need to account for consolidated scanlines here.
- if(dwNumEqualScanlines > 1)
- maNumberOfSpans -= dwNumSpans * (dwNumEqualScanlines-1);
- }
- }
-}
-
-// TODO: we should consider passing a basegfx b2dpolypolygon here to
-// ensure that the signature isn't misleading.
-// if we could pass a b2dpolypolygon here, we could easily triangulate it.
-void OutputDevice::ImplSetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
-{
- DBG_TESTSOLARMUTEX();
-
- if(!(IsDeviceOutputNecessary()))
- return;
- if(!(mpGraphics))
- if(!(ImplGetGraphics()))
- return;
-
- if( mpGraphics->supportsOperation( OutDevSupport_B2DClip ) )
- {
-#if 0
- ::basegfx::B2DPolyPolygon aB2DPolyPolygon = rPolyPolygon.getB2DPolyPolygon();
-#else
- // getB2DPolyPolygon() "optimizes away" some points
- // which prevents reliable undoing of the "triangle thingy" parameter
- // so the toolspoly -> b2dpoly conversion has to be done manually
- ::basegfx::B2DPolyPolygon aB2DPolyPolygon;
- for( sal_uInt16 nPolyIdx = 0; nPolyIdx < rPolyPolygon.Count(); ++nPolyIdx )
- {
- const Polygon& rPolygon = rPolyPolygon[ nPolyIdx ];
- ::basegfx::B2DPolygon aB2DPoly;
- for( sal_uInt16 nPointIdx = 0; nPointIdx < rPolygon.GetSize(); ++nPointIdx )
- {
- const Point& rPoint = rPolygon[ nPointIdx ];
- const ::basegfx::B2DPoint aB2DPoint( rPoint.X(), rPoint.Y() );
- aB2DPoly.append( aB2DPoint );
- }
- aB2DPolyPolygon.append( aB2DPoly );
- }
-#endif
-
- const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
- aB2DPolyPolygon.transform( aTransform );
-
- // the rPolyPolygon argument is a "triangle thingy"
- // so convert it to a normal polypolyon first
- ::basegfx::B2DPolyPolygon aPolyTriangle;
- const int nPolyCount = aB2DPolyPolygon.count();
- for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx )
- {
- const ::basegfx::B2DPolygon rPolygon = aB2DPolyPolygon.getB2DPolygon( nPolyIdx );
- const int nPointCount = rPolygon.count();
- for( int nPointIdx = 0; nPointIdx+2 < nPointCount; nPointIdx +=3 )
- {
- ::basegfx::B2DPolygon aTriangle;
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+0 ) );
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+1 ) );
- aTriangle.append( rPolygon.getB2DPoint( nPointIdx+2 ) );
- aPolyTriangle.append( aTriangle );
- }
- }
-
- // now set the clip region with the real polypolygon
- mpGraphics->BeginSetClipRegion( 0 );
- mpGraphics->UnionClipRegion( aPolyTriangle, this );
- mpGraphics->EndSetClipRegion();
-
- // and mark the clip status as ready
- mbOutputClipped = sal_False;
- mbClipRegion = sal_True;
- mbClipRegionSet = sal_True;
- mbInitClipRegion = sal_False;
- return;
- }
-
- sal_Int32 offset_x = 0;
- sal_Int32 offset_y = 0;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- offset_x = mnOutOffX+mnOutOffOrigX;
- offset_y = mnOutOffY+mnOutOffOrigY;
- }
-
- // first of all we need to know the upper limit
- // of the amount of possible clipping regions.
- sal_Int32 maxy = SAL_MIN_INT32;
- sal_Int32 miny = SAL_MAX_INT32;
- sal_uInt32 dwNumTriangles = 0;
- for(sal_uInt16 i=0; i<rPolyPolygon.Count(); ++i)
- {
- const Polygon &rPoly = rPolyPolygon.GetObject(i);
- const sal_Int32 dwNumVertices = rPoly.GetSize();
- if(!(dwNumVertices % 3))
- {
- for(sal_uInt16 j=0; j<rPoly.GetSize(); ++j)
- {
- const Point &p = rPoly.GetPoint(j);
- if(p.Y() < miny)
- miny = p.Y();
- if(p.Y() > maxy)
- maxy = p.Y();
- }
- dwNumTriangles += dwNumVertices / 3;
- }
- }
-
- const sal_uInt32 dwNumScanlines = (maxy-miny);
- if(!(dwNumScanlines))
- {
- // indicates that no output needs to be produced
- // since the clipping region did not provide any
- // visible areas.
- mbOutputClipped = sal_True;
-
- // indicates that a clip region has been
- // presented to the output device.
- mbClipRegion = sal_True;
-
- // indicates that the set clipping region
- // has been processed.
- mbClipRegionSet = sal_True;
-
- // under 'normal' circumstances a new clipping region
- // needs to be processed by ImplInitClipRegion(),
- // which we need to circumvent.
- mbInitClipRegion = sal_False;
- return;
- }
-
- // this container provides all services we need to
- // efficiently store/retrieve spans from the table.
- const sal_uInt32 dwNumSpansPerScanline = dwNumTriangles;
- ScanlineContainer container(dwNumScanlines,dwNumSpansPerScanline);
-
- // convert the incoming polypolygon to spans, we assume that
- // the polypolygon has already been triangulated since we don't
- // want to use the basegfx-types here. this could be leveraged
- // after the tools-types had been removed.
- for(sal_uInt16 i=0; i<rPolyPolygon.Count(); ++i)
- {
- const Polygon &rPoly = rPolyPolygon.GetObject(i);
- const sal_uInt16 dwNumVertices = rPoly.GetSize();
- if(!(dwNumVertices % 3))
- {
- for(sal_uInt16 j=0; j<dwNumVertices; j+=3)
- {
- const Point &p0 = rPoly.GetPoint(j+0);
- const Point &p1 = rPoly.GetPoint(j+1);
- const Point &p2 = rPoly.GetPoint(j+2);
-
- // what now follows is an extremely fast triangle
- // rasterizer from which all tricky and interesting
- // parts were forcibly amputated.
- // note: top.left fill-convention
- vertex v0(p0);
- vertex v1(p1);
- vertex v2(p2);
-
- //sprintf(string,"[%f,%f] [%f,%f] [%f,%f]\n",v0.x,v0.y,v1.x,v1.y,v2.x,v2.y);
- //OSL_TRACE(string);
-
- if(v0.y > v2.y) ::swap(v0, v2);
- if(v1.y > v2.y) ::swap(v1, v2);
- if(v0.y > v1.y) ::swap(v0, v1);
-
- const float float2fixed(16.0f);
-
- // vertex coordinates of the triangle [28.4 fixed-point]
- const int i4x0 = iround(float2fixed * (v0.x - 0.5f));
- const int i4y0 = iround(float2fixed * (v0.y - 0.5f));
- const int i4x1 = iround(float2fixed * (v1.x - 0.5f));
- const int i4y1 = iround(float2fixed * (v1.y - 0.5f));
- const int i4x2 = iround(float2fixed * (v2.x - 0.5f));
- const int i4y2 = iround(float2fixed * (v2.y - 0.5f));
-
- // vertex coordinate deltas [28.4 fixed-point]
- const int i4dx12 = i4x1-i4x0;
- const int i4dy12 = i4y1-i4y0;
- const int i4dx13 = i4x2-i4x0;
- const int i4dy13 = i4y2-i4y0;
- const int i4dx23 = i4x2-i4x1;
- const int i4dy23 = i4y2-i4y1;
-
- // slope of edges [quotient,remainder]
- const int mq12 = floorDiv(i4dx12 << 4, i4dy12 << 4);
- const int mq13 = floorDiv(i4dx13 << 4, i4dy13 << 4);
- const int mq23 = floorDiv(i4dx23 << 4, i4dy23 << 4);
- const int mr12 = floorMod(i4dx12 << 4, i4dy12 << 4);
- const int mr13 = floorMod(i4dx13 << 4, i4dy13 << 4);
- const int mr23 = floorMod(i4dx23 << 4, i4dy23 << 4);
-
- // convert the vertical coordinates back to integers.
- // according to the top-left fillrule we need to step
- // the coordinates to the ceiling.
- const int y0 = (i4y0+15)>>4;
- const int y1 = (i4y1+15)>>4;
- const int y2 = (i4y2+15)>>4;
-
- // calculate the value of the horizontal coordinate
- // from the edge that 'spans' the triangle.
- const int x = ceilDiv(i4dx13*i4dy12 + i4x0*i4dy13, i4dy13);
-
- // this will hold the horizontal coordinates
- // of the seperate spans during the rasterization process.
- int lx,rx;
-
- // this pair will serve as the error accumulator while
- // we step along the edges.
- int ld,rd,lD,rD;
-
- // these are the edge and error stepping values that
- // will be used while stepping.
- int lQ,rQ,lR,rR;
-
- if(i4x1 < x)
- {
- lx = ceilDiv(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- ld = ceilMod(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- rx = ceilDiv(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rd = ceilMod(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- lQ = mq12;
- rQ = mq13;
- lR = mr12;
- rR = mr13;
- lD = i4dy12 << 4;
- rD = i4dy13 << 4;
- }
- else
- {
- lx = ceilDiv(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- ld = ceilMod(i4dx13 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rx = ceilDiv(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- rd = ceilMod(i4dx12 * (ceilFix4(i4y0) - i4y0) + i4x0 * i4dy12, i4dy12 << 4);
- lQ = mq13;
- rQ = mq12;
- lR = mr13;
- rR = mr12;
- lD = i4dy13 << 4;
- rD = i4dy12 << 4;
- }
-
- for(signed int y=y0; y<y1; y++)
- {
- container.InsertSpan(y-miny,lx,rx);
-
- lx += lQ; ld += lR;
- if(ld > 0) { ld -= lD; lx += 1; }
- rx += rQ; rd += rR;
- if(rd > 0) { rd -= rD; rx += 1; }
- }
-
- if(i4x1 < x)
- {
- lx = ceilDiv(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- ld = ceilMod(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rx = ceilDiv(i4dx13 * (ceilFix4(i4y1) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- rd = ceilMod(i4dx13 * (ceilFix4(i4y1) - i4y0) + i4x0 * i4dy13, i4dy13 << 4);
- lQ = mq23;
- lR = mr23;
- lD = i4dy23 << 4;
- }
- else
- {
- rx = ceilDiv(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rd = ceilMod(i4dx23 * (ceilFix4(i4y1) - i4y1) + i4x1 * i4dy23, i4dy23 << 4);
- rQ = mq23;
- rR = mr23;
- rD = i4dy23 << 4;
- }
-
- for(signed int y=y1; y<y2; y++)
- {
- container.InsertSpan(y-miny,lx,rx);
-
- lx += lQ; ld += lR;
- if(ld > 0) { ld -= lD; lx += 1; }
- rx += rQ; rd += rR;
- if(rd > 0) { rd -= rD; rx += 1; }
- }
- }
- }
- }
-
- // now try to consolidate as many scanlines as possible.
- // please note that this will probably change the number
- // of spans [at least this is why we do all this hassle].
- // so, if you use 'consolidate' you should *use* this
- // information during iteration, because the 'graphics'
- // object we tell all those regions about is a bit,
- // hm, how to say, *picky* if you supply not correctly
- // the amount of regions.
- container.Consolidate();
-
- // now forward the spantable to the graphics handler.
- SpanIterator it(container.Iterate());
- mpGraphics->BeginSetClipRegion( container.GetNumSpans() );
- while(miny < maxy)
- {
- const sal_Int32 dwNumEqual(it.GetNumEqualScanlines());
- while(it.GetRemainingSpans())
- {
- // retrieve the next span [x-coordinate, width] from the current scanline.
- std::pair<sal_Int32,sal_Int32> span(it.GetNextSpan());
-
- // now forward this to the graphics object.
- // the only part that is worth noting is that we use
- // the number of equal spanlines [the current is always the
- // first one of the equal bunch] as the height of the region.
- mpGraphics->UnionClipRegion( offset_x+span.first,
- offset_y+miny,
- span.second,
- dwNumEqual,
- this );
- }
- it.Skip(dwNumEqual);
- miny += dwNumEqual;
- }
- mpGraphics->EndSetClipRegion();
-
- // indicates that no output needs to be produced
- // since the clipping region did not provide any
- // visible areas. the clip covers the whole area
- // if there's not a single region.
- mbOutputClipped = (container.GetNumSpans() == 0);
-
- // indicates that a clip region has been
- // presented to the output device.
- mbClipRegion = sal_True;
-
- // indicates that the set clipping region
- // has been processed.
- mbClipRegionSet = sal_True;
-
- // under 'normal' circumstances a new clipping region
- // needs to be processed by ImplInitClipRegion(),
- // which we need to circumvent.
- mbInitClipRegion = sal_False;
-}
-
-// -----------------------------------------------------------------------
-
void OutputDevice::SetClipRegion()
{
DBG_TRACE( "OutputDevice::SetClipRegion()" );
@@ -1848,42 +1087,6 @@ void OutputDevice::SetClipRegion( const Region& rRegion )
// -----------------------------------------------------------------------
-void OutputDevice::SetTriangleClipRegion( const PolyPolygon &rPolyPolygon )
-{
- DBG_TRACE( "OutputDevice::SetTriangleClipRegion( rPolyPolygon )" );
- DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-
- // in case the passed polypolygon is empty, use the
- // existing SetClipRegion() method which gracefully
- // unsets any previously set clipping region.
- if(!(rPolyPolygon.Count()))
- SetClipRegion();
-
- sal_Int32 offset_x = 0;
- sal_Int32 offset_y = 0;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- offset_x = mnOutOffX+mnOutOffOrigX;
- offset_y = mnOutOffY+mnOutOffOrigY;
- }
-
- // play nice with the rest of the system and provide an old-style region.
- // the rest of this method does not rely on this.
- maRegion = Region::GetRegionFromPolyPolygon( LogicToPixel(rPolyPolygon) );
- maRegion.Move(offset_x,offset_x);
-
- // feed region to metafile
- if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaClipRegionAction( maRegion, sal_True ) );
-
- ImplSetTriangleClipRegion( rPolyPolygon );
-
- if( mpAlphaVDev )
- mpAlphaVDev->SetTriangleClipRegion( rPolyPolygon );
-}
-
-// -----------------------------------------------------------------------
-
Region OutputDevice::GetClipRegion() const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -3159,6 +2362,20 @@ void OutputDevice::DrawPolyLine(
// -----------------------------------------------------------------------
+sal_uInt32 OutputDevice::GetGCStackDepth() const
+{
+ const ImplObjStack* pData = mpObjStack;
+ sal_uInt32 nDepth = 0;
+ while( pData )
+ {
+ nDepth++;
+ pData = pData->mpPrev;
+ }
+ return nDepth;
+}
+
+// -----------------------------------------------------------------------
+
void OutputDevice::Push( sal_uInt16 nFlags )
{
DBG_TRACE( "OutputDevice::Push()" );
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 25e589e70c95..10f618d6e7c1 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -7414,7 +7414,6 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
// setup glyphs
Point aPos;
sal_GlyphId aGlyphId;
- int nFallbacklevel = 0;
for( int nStart = 0; rLayout->GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); )
{
// NOTE: Windows backend is producing unicode chars (ucs4), so on windows,
@@ -7424,15 +7423,12 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
aGlyph.index = static_cast<unsigned long> (aGlyphId & GF_IDXMASK);
aGlyph.x = aPos.X();
aGlyph.y = aPos.Y();
- aSysLayoutData.rGlyphData.push_back(aGlyph);
-
int nLevel = (aGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
- if (nLevel > nFallbacklevel && nLevel < MAX_FALLBACK)
- nFallbacklevel = nLevel;
+ aGlyph.fallbacklevel = nLevel < MAX_FALLBACK ? nLevel : 0;
+ aSysLayoutData.rGlyphData.push_back(aGlyph);
}
// Get font data
- aSysLayoutData.aSysFontData = GetSysFontData(nFallbacklevel);
aSysLayoutData.orientation = rLayout->GetOrientation();
rLayout->Release();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 32f534129e07..4a37d3a5d601 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -54,6 +54,7 @@
#include <vcl/metric.hxx>
#include <vcl/fontsubset.hxx>
#include <vcl/textlayout.hxx>
+#include <vcl/cvtgrf.hxx>
#include <svsys.h>
#include <vcl/salgdi.hxx>
#include <vcl/svapp.hxx>
@@ -887,34 +888,44 @@ static void appendDouble( double fValue, OStringBuffer& rBuffer, sal_Int32 nPrec
}
-static void appendColor( const Color& rColor, OStringBuffer& rBuffer )
+static void appendColor( const Color& rColor, OStringBuffer& rBuffer, bool bConvertToGrey = false )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendDouble( (double)rColor.GetRed() / 255.0, rBuffer );
- rBuffer.append( ' ' );
- appendDouble( (double)rColor.GetGreen() / 255.0, rBuffer );
- rBuffer.append( ' ' );
- appendDouble( (double)rColor.GetBlue() / 255.0, rBuffer );
+ if( bConvertToGrey )
+ {
+ sal_uInt8 cByte = rColor.GetLuminance();
+ appendDouble( (double)cByte / 255.0, rBuffer );
+ }
+ else
+ {
+ appendDouble( (double)rColor.GetRed() / 255.0, rBuffer );
+ rBuffer.append( ' ' );
+ appendDouble( (double)rColor.GetGreen() / 255.0, rBuffer );
+ rBuffer.append( ' ' );
+ appendDouble( (double)rColor.GetBlue() / 255.0, rBuffer );
+ }
}
}
-static void appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+void PDFWriterImpl::appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendColor( rColor, rBuffer );
- rBuffer.append( " RG" );
+ bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
+ appendColor( rColor, rBuffer, bGrey );
+ rBuffer.append( bGrey ? " G" : " RG" );
}
}
-static void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
+void PDFWriterImpl::appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer )
{
if( rColor != Color( COL_TRANSPARENT ) )
{
- appendColor( rColor, rBuffer );
- rBuffer.append( " rg" );
+ bool bGrey = m_aContext.ColorMode == PDFWriter::DrawGreyscale;
+ appendColor( rColor, rBuffer, bGrey );
+ rBuffer.append( bGrey ? " g" : " rg" );
}
}
@@ -2037,9 +2048,25 @@ inline void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OString& rInSt
appendLiteralStringEncrypt( aBufferString, nInObjectNumber, rOutBuffer);
}
-inline void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer )
+void PDFWriterImpl::appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc )
{
- rtl::OString aBufferString( rtl::OUStringToOString( rInString, RTL_TEXTENCODING_ASCII_US ) );
+ rtl::OString aBufferString( rtl::OUStringToOString( rInString, nEnc ) );
+ sal_Int32 nLen = aBufferString.getLength();
+ rtl::OStringBuffer aBuf( nLen );
+ const sal_Char* pT = aBufferString.getStr();
+
+ for( sal_Int32 i = 0; i < nLen; i++, pT++ )
+ {
+ if( (*pT & 0x80) == 0 )
+ aBuf.append( *pT );
+ else
+ {
+ aBuf.append( '<' );
+ appendHex( *pT, aBuf );
+ aBuf.append( '>' );
+ }
+ }
+ aBufferString = aBuf.makeStringAndClear();
appendLiteralStringEncrypt( aBufferString, nInObjectNumber, rOutBuffer);
}
@@ -2946,12 +2973,9 @@ bool PDFWriterImpl::emitTilings()
aTilingObj.setLength( 0 );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( "PDFWriterImpl::emitTilings" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::emitTilings" );
+ #endif
sal_Int32 nX = (sal_Int32)it->m_aRectangle.Left();
sal_Int32 nY = (sal_Int32)it->m_aRectangle.Top();
@@ -3439,10 +3463,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
// now we can actually write the font stream !
#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" );
- emitComment( aLine.getStr() );
- }
+ emitComment( " PDFWriterImpl::emitEmbeddedFont" );
#endif
OStringBuffer aLine( 512 );
nStreamObject = createObject();
@@ -3868,12 +3889,9 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding,
delete pCodec;
#endif
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::createToUnicodeCMap" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::createToUnicodeCMap" );
+ #endif
OStringBuffer aLine( 40 );
aLine.append( nStream );
@@ -4060,10 +4078,7 @@ bool PDFWriterImpl::emitFonts()
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) );
#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine1( " PDFWriterImpl::emitFonts" );
- emitComment( aLine1.getStr() );
- }
+ emitComment( "PDFWriterImpl::emitFonts" );
#endif
sal_Int32 nFontStream = createObject();
sal_Int32 nStreamLengthObject = createObject();
@@ -4634,18 +4649,20 @@ we check in the following sequence:
{
aLine.append( "/Launch/Win<</F" );
// INetURLObject is not good with UNC paths, use original path
- appendLiteralStringEncrypt( rLink.m_aURL, rLink.m_nObject, aLine );
+ appendLiteralStringEncrypt( rLink.m_aURL, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
aLine.append( ">>" );
}
else
{
- sal_Int32 nSetRelative = 0;
+ bool bSetRelative = false;
+ bool bFileSpec = false;
//check if relative file link is requested and if the protocol is 'file://'
if( m_aContext.RelFsys && eBaseProtocol == eTargetProtocol && eTargetProtocol == INET_PROT_FILE )
- nSetRelative++;
+ bSetRelative = true;
rtl::OUString aFragment = aTargetURL.GetMark( INetURLObject::NO_DECODE /*DECODE_WITH_CHARSET*/ ); //fragment as is,
if( nSetGoToRMode == 0 )
+ {
switch( m_aContext.DefaultLinkAction )
{
default:
@@ -4665,19 +4682,24 @@ we check in the following sequence:
eTargetProtocol != INET_PROT_FILE )
aLine.append( "/URI/URI" );
else
+ {
aLine.append( "/Launch/F" );
+ bFileSpec = true;
+ }
break;
}
+ }
//fragment are encoded in the same way as in the named destination processing
- rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
if( nSetGoToRMode )
{//add the fragment
+ rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
aLine.append("/GoToR");
aLine.append("/F");
- appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
+ bFileSpec = true;
+ appendLiteralStringEncrypt( bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_WITH_CHARSET ) :
- aURLNoMark, rLink.m_nObject, aLine );
+ aURLNoMark, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
if( aFragment.getLength() > 0 )
{
aLine.append("/D/");
@@ -4696,13 +4718,16 @@ we check in the following sequence:
//substitute the fragment
aTargetURL.SetMark( aLineLoc.getStr() );
}
- rtl::OUString aURL = aTargetURL.GetMainURL( (nSetRelative || eTargetProtocol == INET_PROT_FILE) ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE );
+ rtl::OUString aURL = aTargetURL.GetMainURL( bFileSpec ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE );
// check if we have a URL available, if the string is empty, set it as the original one
// if( aURL.getLength() == 0 )
// appendLiteralStringEncrypt( rLink.m_aURL , rLink.m_nObject, aLine );
// else
- appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL ) :
- aURL , rLink.m_nObject, aLine );
+ appendLiteralStringEncrypt( bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL,
+ INetURLObject::WAS_ENCODED,
+ bFileSpec ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE
+ ) :
+ aURL , rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
}
//<--- i56629
}
@@ -5358,12 +5383,9 @@ bool PDFWriterImpl::emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDi
pApppearanceStream->Seek( STREAM_SEEK_TO_BEGIN );
sal_Int32 nObject = createObject();
CHECK_RETURN( updateObject( nObject ) );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::emitAppearances" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::emitAppearances" );
+ #endif
OStringBuffer aLine;
aLine.append( nObject );
@@ -5606,7 +5628,7 @@ bool PDFWriterImpl::emitWidgetAnnotations()
{
// create a submit form action
aLine.append( "/AA<</D<</Type/Action/S/SubmitForm/F" );
- appendLiteralStringEncrypt( rWidget.m_aListEntries.front(), rWidget.m_nObject, aLine );
+ appendLiteralStringEncrypt( rWidget.m_aListEntries.front(), rWidget.m_nObject, aLine, osl_getThreadTextEncoding() );
aLine.append( "/Flags " );
sal_Int32 nFlags = 0;
@@ -9251,12 +9273,9 @@ bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject )
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_END );
sal_uLong nSize = rObject.m_pContentStream->Tell();
rObject.m_pContentStream->Seek( STREAM_SEEK_TO_BEGIN );
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeTransparentObject" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeTransparentObject" );
+ #endif
OStringBuffer aLine( 512 );
CHECK_RETURN( updateObject( rObject.m_nObject ) );
aLine.append( rObject.m_nObject );
@@ -9400,28 +9419,25 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
sal_Int32 nFunctionObject = createObject();
CHECK_RETURN( updateObject( nFunctionObject ) );
- OutputDevice* pRefDevice = getReferenceDevice();
- pRefDevice->Push( PUSH_ALL );
- if( rObject.m_aSize.Width() > pRefDevice->GetOutputSizePixel().Width() )
- rObject.m_aSize.Width() = pRefDevice->GetOutputSizePixel().Width();
- if( rObject.m_aSize.Height() > pRefDevice->GetOutputSizePixel().Height() )
- rObject.m_aSize.Height() = pRefDevice->GetOutputSizePixel().Height();
- pRefDevice->SetMapMode( MapMode( MAP_PIXEL ) );
- pRefDevice->DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient );
+ VirtualDevice aDev;
+ aDev.SetOutputSizePixel( rObject.m_aSize );
+ aDev.SetMapMode( MapMode( MAP_PIXEL ) );
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ aDev.SetDrawMode( aDev.GetDrawMode() |
+ ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT |
+ DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) );
+ aDev.DrawGradient( Rectangle( Point( 0, 0 ), rObject.m_aSize ), rObject.m_aGradient );
- Bitmap aSample = pRefDevice->GetBitmap( Point( 0, 0 ), rObject.m_aSize );
+ Bitmap aSample = aDev.GetBitmap( Point( 0, 0 ), rObject.m_aSize );
BitmapReadAccess* pAccess = aSample.AcquireReadAccess();
AccessReleaser aReleaser( pAccess );
Size aSize = aSample.GetSizePixel();
sal_Int32 nStreamLengthObject = createObject();
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeGradientFunction" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeGradientFunction" );
+ #endif
OStringBuffer aLine( 120 );
aLine.append( nFunctionObject );
aLine.append( " 0 obj\n"
@@ -9434,6 +9450,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
aLine.append( " ]\n"
"/BitsPerSample 8\n"
"/Range[ 0 1 0 1 0 1 ]\n"
+ "/Order 3\n"
"/Length " );
aLine.append( nStreamLengthObject );
aLine.append( " 0 R\n"
@@ -9449,7 +9466,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
checkAndEnableStreamEncryption( nFunctionObject );
beginCompression();
- for( int y = 0; y < aSize.Height(); y++ )
+ for( int y = aSize.Height()-1; y >= 0; y-- )
{
for( int x = 0; x < aSize.Width(); x++ )
{
@@ -9500,8 +9517,6 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
"endobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
- pRefDevice->Pop();
-
return true;
}
@@ -9530,12 +9545,9 @@ bool PDFWriterImpl::writeJPG( JPGEmit& rObject )
m_aErrors.insert( PDFWriter::Warning_Transparency_Omitted_PDF13 );
}
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeJPG" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeJPG" );
+ #endif
OStringBuffer aLine(200);
aLine.append( rObject.m_nObject );
@@ -9655,26 +9667,32 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
sal_Int32 nStreamLengthObject = createObject();
sal_Int32 nMaskObject = 0;
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::writeBitmapObject" );
- emitComment( aLine.getStr() );
- }
-#endif
+ #if OSL_DEBUG_LEVEL > 1
+ emitComment( "PDFWriterImpl::writeBitmapObject" );
+ #endif
OStringBuffer aLine(1024);
aLine.append( rObject.m_nObject );
aLine.append( " 0 obj\n"
"<</Type/XObject/Subtype/Image/Width " );
aLine.append( (sal_Int32)aBitmap.GetSizePixel().Width() );
- aLine.append( " /Height " );
+ aLine.append( "/Height " );
aLine.append( (sal_Int32)aBitmap.GetSizePixel().Height() );
- aLine.append( " /BitsPerComponent " );
+ aLine.append( "/BitsPerComponent " );
aLine.append( nBitsPerComponent );
- aLine.append( " /Length " );
+ aLine.append( "/Length " );
aLine.append( nStreamLengthObject );
aLine.append( " 0 R\n" );
#ifndef DEBUG_DISABLE_PDFCOMPRESSION
- aLine.append( "/Filter/FlateDecode" );
+ if( nBitsPerComponent != 1 )
+ {
+ aLine.append( "/Filter/FlateDecode" );
+ }
+ else
+ {
+ aLine.append( "/Filter/CCITTFaxDecode/DecodeParms<</K -1/BlackIs1 true/Columns " );
+ aLine.append( (sal_Int32)aBitmap.GetSizePixel().Width() );
+ aLine.append( ">>\n" );
+ }
#endif
if( ! bMask )
{
@@ -9742,7 +9760,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
{
if( aBitmap.GetBitCount() == 1 )
{
- aLine.append( " /ImageMask true\n" );
+ aLine.append( "/ImageMask true\n" );
sal_Int32 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color( COL_BLACK ) ) );
DBG_ASSERT( nBlackIndex == 0 || nBlackIndex == 1, "wrong black index" );
if( nBlackIndex )
@@ -9804,33 +9822,42 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos )) );
checkAndEnableStreamEncryption( rObject.m_nObject );
- beginCompression();
- if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
+#ifndef DEBUG_DISABLE_PDFCOMPRESSION
+ if( nBitsPerComponent == 1 )
{
- const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
-
- for( int i = 0; i < pAccess->Height(); i++ )
- {
- CHECK_RETURN( writeBuffer( pAccess->GetScanline( i ), nScanLineBytes ) );
- }
+ writeG4Stream( pAccess );
}
else
+#endif
{
- const int nScanLineBytes = pAccess->Width()*3;
- boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
- for( int y = 0; y < pAccess->Height(); y++ )
+ beginCompression();
+ if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
{
- for( int x = 0; x < pAccess->Width(); x++ )
+ const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
+
+ for( int i = 0; i < pAccess->Height(); i++ )
{
- BitmapColor aColor = pAccess->GetColor( y, x );
- pCol[3*x+0] = aColor.GetRed();
- pCol[3*x+1] = aColor.GetGreen();
- pCol[3*x+2] = aColor.GetBlue();
+ CHECK_RETURN( writeBuffer( pAccess->GetScanline( i ), nScanLineBytes ) );
}
- CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) );
}
+ else
+ {
+ const int nScanLineBytes = pAccess->Width()*3;
+ boost::shared_array<sal_uInt8> pCol( new sal_uInt8[ nScanLineBytes ] );
+ for( int y = 0; y < pAccess->Height(); y++ )
+ {
+ for( int x = 0; x < pAccess->Width(); x++ )
+ {
+ BitmapColor aColor = pAccess->GetColor( y, x );
+ pCol[3*x+0] = aColor.GetRed();
+ pCol[3*x+1] = aColor.GetGreen();
+ pCol[3*x+2] = aColor.GetBlue();
+ }
+ CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) );
+ }
+ }
+ endCompression();
}
- endCompression();
disableStreamEncryption();
sal_uInt64 nEndPos = 0;
@@ -9870,8 +9897,25 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
if( ! (rSizePixel.Width() && rSizePixel.Height()) )
return;
- SvMemoryStream* pStream = new SvMemoryStream;
rDCTData.Seek( 0 );
+ if( bIsTrueColor && m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ // need to convert to grayscale;
+ // load stream to bitmap and draw the bitmap instead
+ Graphic aGraphic;
+ GraphicConverter::Import( rDCTData, aGraphic, CVT_JPG );
+ Bitmap aBmp( aGraphic.GetBitmap() );
+ if( !!rMask && rMask.GetSizePixel() == aBmp.GetSizePixel() )
+ {
+ BitmapEx aBmpEx( aBmp, rMask );
+ drawBitmap( rTargetArea.TopLeft(), rTargetArea.GetSize(), aBmpEx );
+ }
+ else
+ drawBitmap( rTargetArea.TopLeft(), rTargetArea.GetSize(), aBmp );
+ return;
+ }
+
+ SvMemoryStream* pStream = new SvMemoryStream;
*pStream << rDCTData;
pStream->Seek( STREAM_SEEK_TO_END );
@@ -9962,18 +10006,28 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
writeBuffer( aLine.getStr(), aLine.getLength() );
}
-const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& rBitmap, bool bDrawMask )
+const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap, bool bDrawMask )
{
+ BitmapEx aBitmap( i_rBitmap );
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ int nDepth = aBitmap.GetBitmap().GetBitCount();
+ if( nDepth <= 4 )
+ eConv = BMP_CONVERSION_4BIT_GREYS;
+ if( nDepth > 1 )
+ aBitmap.Convert( eConv );
+ }
BitmapID aID;
- aID.m_aPixelSize = rBitmap.GetSizePixel();
- aID.m_nSize = rBitmap.GetBitCount();
- aID.m_nChecksum = rBitmap.GetBitmap().GetChecksum();
+ aID.m_aPixelSize = aBitmap.GetSizePixel();
+ aID.m_nSize = aBitmap.GetBitCount();
+ aID.m_nChecksum = aBitmap.GetBitmap().GetChecksum();
aID.m_nMaskChecksum = 0;
- if( rBitmap.IsAlpha() )
- aID.m_nMaskChecksum = rBitmap.GetAlpha().GetChecksum();
+ if( aBitmap.IsAlpha() )
+ aID.m_nMaskChecksum = aBitmap.GetAlpha().GetChecksum();
else
{
- Bitmap aMask = rBitmap.GetMask();
+ Bitmap aMask = aBitmap.GetMask();
if( ! aMask.IsEmpty() )
aID.m_nMaskChecksum = aMask.GetChecksum();
}
@@ -9987,7 +10041,7 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx
{
m_aBitmaps.push_front( BitmapEmit() );
m_aBitmaps.front().m_aID = aID;
- m_aBitmaps.front().m_aBitmap = rBitmap;
+ m_aBitmaps.front().m_aBitmap = aBitmap;
m_aBitmaps.front().m_nObject = createObject();
m_aBitmaps.front().m_bDrawMask = bDrawMask;
it = m_aBitmaps.begin();
@@ -10050,15 +10104,16 @@ sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size&
rSize ) );
// check if we already have this gradient
std::list<GradientEmit>::iterator it;
+ // rounding to point will generally lose some pixels
+ // round up to point boundary
+ aPtSize.Width()++;
+ aPtSize.Height()++;
for( it = m_aGradients.begin(); it != m_aGradients.end(); ++it )
{
if( it->m_aGradient == rGradient )
{
- if( it->m_aSize.Width() < aPtSize.Width() )
- it->m_aSize.Width() = aPtSize.Width();
- if( it->m_aSize.Height() <= aPtSize.Height() )
- it->m_aSize.Height() = aPtSize.Height();
- break;
+ if( it->m_aSize == aPtSize )
+ break;
}
}
if( it == m_aGradients.end() )
@@ -10133,12 +10188,12 @@ void PDFWriterImpl::drawGradient( const PolyPolygon& rPolyPoly, const Gradient&
return;
}
- sal_Int32 nGradient = createGradient( rGradient, rPolyPoly.GetBoundRect().GetSize() );
+ Rectangle aBoundRect = rPolyPoly.GetBoundRect();
+ sal_Int32 nGradient = createGradient( rGradient, aBoundRect.GetSize() );
updateGraphicsState();
- Rectangle aBoundRect = rPolyPoly.GetBoundRect();
- Point aTranslate = aBoundRect.BottomLeft() + Point( 0, 1 );
+ Point aTranslate = aBoundRect.BottomLeft();
int nPolygons = rPolyPoly.Count();
OStringBuffer aLine( 80*nPolygons );
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index b6612d835ca2..c73be7c037e5 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -59,6 +59,7 @@ class ImplFontMetricData;
class FontSubsetInfo;
class ZCodec;
class EncHashTransporter;
+struct BitStreamState;
// the maximum password length
#define ENCRYPTED_PWD_SIZE 32
@@ -831,7 +832,7 @@ i12626
// test if the encryption is active, if yes than encrypt the unicode string and add to the OStringBuffer parameter
void appendUnicodeTextStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
- void appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
+ void appendLiteralStringEncrypt( const rtl::OUString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer, rtl_TextEncoding nEnc = RTL_TEXTENCODING_ASCII_US );
void appendLiteralStringEncrypt( const rtl::OString& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
void appendLiteralStringEncrypt( rtl::OStringBuffer& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer );
@@ -1057,6 +1058,14 @@ i12626
void implWriteBitmapEx( const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx,
VirtualDevice* pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& );
+ // helpers for CCITT 1bit bitmap stream
+ void putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState );
+ void putG4Span( long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState );
+ void writeG4Stream( BitmapReadAccess* i_pBitmap );
+
+ // color helper functions
+ void appendStrokingColor( const Color& rColor, rtl::OStringBuffer& rBuffer );
+ void appendNonStrokingColor( const Color& rColor, rtl::OStringBuffer& rBuffer );
public:
PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >&, PDFWriter& );
~PDFWriterImpl();
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 8546df1be705..143c55a83ab1 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -33,6 +33,7 @@
#include "vcl/virdev.hxx"
#include "vcl/gdimtf.hxx"
#include "vcl/metaact.hxx"
+#include "vcl/bmpacc.hxx"
#include "vcl/graph.hxx"
#include "vcl/svdata.hxx"
#include "unotools/streamwrap.hxx"
@@ -47,6 +48,8 @@
#include <rtl/digest.h>
+#undef USE_PDFGRADIENTS
+
using namespace vcl;
using namespace rtl;
using namespace com::sun::star;
@@ -58,7 +61,7 @@ using namespace com::sun::star::beans;
void PDFWriterImpl::implWriteGradient( const PolyPolygon& i_rPolyPoly, const Gradient& i_rGradient,
VirtualDevice* i_pDummyVDev, const vcl::PDFWriter::PlayMetafileContext& i_rContext )
{
- GDIMetaFile aTmpMtf;
+ GDIMetaFile aTmpMtf;
i_pDummyVDev->AddGradientActions( i_rPolyPoly.GetBoundRect(), i_rGradient, aTmpMtf );
@@ -140,6 +143,15 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
const Size aSizePixel( aBitmapEx.GetSizePixel() );
if ( aSizePixel.Width() && aSizePixel.Height() )
{
+ if( m_aContext.ColorMode == PDFWriter::DrawGreyscale )
+ {
+ BmpConversion eConv = BMP_CONVERSION_8BIT_GREYS;
+ int nDepth = aBitmapEx.GetBitmap().GetBitCount();
+ if( nDepth <= 4 )
+ eConv = BMP_CONVERSION_4BIT_GREYS;
+ if( nDepth > 1 )
+ aBitmapEx.Convert( eConv );
+ }
sal_Bool bUseJPGCompression = !i_rContext.m_bOnlyLosslessCompression;
if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) )
bUseJPGCompression = sal_False;
@@ -178,13 +190,13 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
try
{
uno::Reference < io::XStream > xStream = new utl::OStreamWrapper( aStrm );
- Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW );
- Reference< graphic::XGraphicProvider > xGraphicProvider( ImplGetSVData()->maAppData.mxMSF->createInstance(
+ uno::Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW );
+ uno::Reference< graphic::XGraphicProvider > xGraphicProvider( ImplGetSVData()->maAppData.mxMSF->createInstance(
OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY );
if ( xGraphicProvider.is() )
{
- Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
- Reference < io::XOutputStream > xOut( xStream->getOutputStream() );
+ uno::Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
+ uno::Reference < io::XOutputStream > xOut( xStream->getOutputStream() );
rtl::OUString aMimeType( ::rtl::OUString::createFromAscii( "image/jpeg" ) );
uno::Sequence< beans::PropertyValue > aOutMediaProperties( 3 );
aOutMediaProperties[0].Name = ::rtl::OUString::createFromAscii( "OutputStream" );
@@ -207,7 +219,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
Sequence< PropertyValue > aArgs( 1 );
aArgs[ 0 ].Name = ::rtl::OUString::createFromAscii( "InputStream" );
aArgs[ 0 ].Value <<= xStream;
- Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
+ uno::Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
if ( xPropSet.is() )
{
sal_Int16 nBitsPerPixel = 24;
@@ -354,16 +366,23 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
case( META_GRADIENT_ACTION ):
{
const MetaGradientAction* pA = (const MetaGradientAction*) pAction;
+ #ifdef USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pA->GetRect(), pA->GetGradient() );
+ #else
const PolyPolygon aPolyPoly( pA->GetRect() );
-
implWriteGradient( aPolyPoly, pA->GetGradient(), pDummyVDev, i_rContext );
+ #endif
}
break;
case( META_GRADIENTEX_ACTION ):
{
const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction;
+ #ifdef USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pA->GetPolyPolygon(), pA->GetGradient() );
+ #else
implWriteGradient( pA->GetPolyPolygon(), pA->GetGradient(), pDummyVDev, i_rContext );
+ #endif
}
break;
@@ -518,7 +537,13 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
}
if( pGradAction )
+ {
+ #if USE_PDFGRADIENTS
+ m_rOuterFace.DrawGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient() );
+ #else
implWriteGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), pDummyVDev, i_rContext );
+ #endif
+ }
}
else
{
@@ -1538,3 +1563,475 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
/* end i12626 methods */
+static const long unsetRun[256] =
+{
+ 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0f */
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1f */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2f */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 - 0xaf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 - 0xbf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 - 0xcf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 - 0xdf */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 - 0xef */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 - 0xff */
+};
+
+static const long setRun[256] =
+{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x0f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x2f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x3f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x4f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x5f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6f */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 - 0x8f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 - 0x9f */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 - 0xaf */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 - 0xbf */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xc0 - 0xcf */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xd0 - 0xdf */
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xe0 - 0xef */
+ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */
+};
+
+inline bool isSet( const Scanline i_pLine, long i_nIndex )
+{
+ return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0;
+}
+
+long findBitRun( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet )
+{
+ if( i_nStartIndex < 0 )
+ return i_nW;
+
+ long nIndex = i_nStartIndex;
+ if( nIndex < i_nW )
+ {
+ const sal_uInt8 * pByte = static_cast<sal_uInt8*>(i_pLine) + (nIndex/8);
+ sal_uInt8 nByte = *pByte;
+
+ // run up to byte boundary
+ long nBitInByte = (nIndex & 7);
+ if( nBitInByte )
+ {
+ sal_uInt8 nMask = 0x80 >> nBitInByte;
+ while( nBitInByte != 8 )
+ {
+ if( (nByte & nMask) != (i_bSet ? nMask : 0) )
+ return nIndex < i_nW ? nIndex : i_nW;
+ nMask = nMask >> 1;
+ nBitInByte++;
+ nIndex++;
+ }
+ if( nIndex < i_nW )
+ {
+ pByte++;
+ nByte = *pByte;
+ }
+ }
+
+ sal_uInt8 nRunByte;
+ const long* pRunTable;
+ if( i_bSet )
+ {
+ nRunByte = 0xff;
+ pRunTable = setRun;
+ }
+ else
+ {
+ nRunByte = 0;
+ pRunTable = unsetRun;
+ }
+
+ while( nByte == nRunByte && nIndex < i_nW )
+ {
+ nIndex += 8;
+ pByte++;
+ nByte = *pByte;
+ }
+ if( nIndex < i_nW )
+ {
+ nIndex += pRunTable[nByte];
+ }
+ }
+ return nIndex < i_nW ? nIndex : i_nW;
+}
+
+struct BitStreamState
+{
+ sal_uInt8 mnBuffer;
+ sal_uInt32 mnNextBitPos;
+
+ BitStreamState()
+ : mnBuffer( 0 )
+ , mnNextBitPos( 8 )
+ {
+ }
+
+ const sal_uInt8* getByte() const { return &mnBuffer; }
+ void flush() { mnNextBitPos = 8; mnBuffer = 0; }
+};
+
+void PDFWriterImpl::putG4Bits( sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState& io_rState )
+{
+ while( i_nLength > io_rState.mnNextBitPos )
+ {
+ io_rState.mnBuffer |= static_cast<sal_uInt8>( i_nCode >> (i_nLength - io_rState.mnNextBitPos) );
+ i_nLength -= io_rState.mnNextBitPos;
+ writeBuffer( io_rState.getByte(), 1 );
+ io_rState.flush();
+ }
+ OSL_ASSERT( i_nLength < 9 );
+ static const unsigned int msbmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
+ io_rState.mnBuffer |= static_cast<sal_uInt8>( (i_nCode & msbmask[i_nLength]) << (io_rState.mnNextBitPos - i_nLength) );
+ io_rState.mnNextBitPos -= i_nLength;
+ if( io_rState.mnNextBitPos == 0 )
+ {
+ writeBuffer( io_rState.getByte(), 1 );
+ io_rState.flush();
+ }
+}
+
+struct PixelCode
+{
+ sal_uInt32 mnEncodedPixels;
+ sal_uInt32 mnCodeBits;
+ sal_uInt32 mnCode;
+};
+
+static const PixelCode WhitePixelCodes[] =
+{
+ { 0, 8, 0x35 }, // 0011 0101
+ { 1, 6, 0x7 }, // 0001 11
+ { 2, 4, 0x7 }, // 0111
+ { 3, 4, 0x8 }, // 1000
+ { 4, 4, 0xB }, // 1011
+ { 5, 4, 0xC }, // 1100
+ { 6, 4, 0xE }, // 1110
+ { 7, 4, 0xF }, // 1111
+ { 8, 5, 0x13 }, // 1001 1
+ { 9, 5, 0x14 }, // 1010 0
+ { 10, 5, 0x7 }, // 0011 1
+ { 11, 5, 0x8 }, // 0100 0
+ { 12, 6, 0x8 }, // 0010 00
+ { 13, 6, 0x3 }, // 0000 11
+ { 14, 6, 0x34 }, // 1101 00
+ { 15, 6, 0x35 }, // 1101 01
+ { 16, 6, 0x2A }, // 1010 10
+ { 17, 6, 0x2B }, // 1010 11
+ { 18, 7, 0x27 }, // 0100 111
+ { 19, 7, 0xC }, // 0001 100
+ { 20, 7, 0x8 }, // 0001 000
+ { 21, 7, 0x17 }, // 0010 111
+ { 22, 7, 0x3 }, // 0000 011
+ { 23, 7, 0x4 }, // 0000 100
+ { 24, 7, 0x28 }, // 0101 000
+ { 25, 7, 0x2B }, // 0101 011
+ { 26, 7, 0x13 }, // 0010 011
+ { 27, 7, 0x24 }, // 0100 100
+ { 28, 7, 0x18 }, // 0011 000
+ { 29, 8, 0x2 }, // 0000 0010
+ { 30, 8, 0x3 }, // 0000 0011
+ { 31, 8, 0x1A }, // 0001 1010
+ { 32, 8, 0x1B }, // 0001 1011
+ { 33, 8, 0x12 }, // 0001 0010
+ { 34, 8, 0x13 }, // 0001 0011
+ { 35, 8, 0x14 }, // 0001 0100
+ { 36, 8, 0x15 }, // 0001 0101
+ { 37, 8, 0x16 }, // 0001 0110
+ { 38, 8, 0x17 }, // 0001 0111
+ { 39, 8, 0x28 }, // 0010 1000
+ { 40, 8, 0x29 }, // 0010 1001
+ { 41, 8, 0x2A }, // 0010 1010
+ { 42, 8, 0x2B }, // 0010 1011
+ { 43, 8, 0x2C }, // 0010 1100
+ { 44, 8, 0x2D }, // 0010 1101
+ { 45, 8, 0x4 }, // 0000 0100
+ { 46, 8, 0x5 }, // 0000 0101
+ { 47, 8, 0xA }, // 0000 1010
+ { 48, 8, 0xB }, // 0000 1011
+ { 49, 8, 0x52 }, // 0101 0010
+ { 50, 8, 0x53 }, // 0101 0011
+ { 51, 8, 0x54 }, // 0101 0100
+ { 52, 8, 0x55 }, // 0101 0101
+ { 53, 8, 0x24 }, // 0010 0100
+ { 54, 8, 0x25 }, // 0010 0101
+ { 55, 8, 0x58 }, // 0101 1000
+ { 56, 8, 0x59 }, // 0101 1001
+ { 57, 8, 0x5A }, // 0101 1010
+ { 58, 8, 0x5B }, // 0101 1011
+ { 59, 8, 0x4A }, // 0100 1010
+ { 60, 8, 0x4B }, // 0100 1011
+ { 61, 8, 0x32 }, // 0011 0010
+ { 62, 8, 0x33 }, // 0011 0011
+ { 63, 8, 0x34 }, // 0011 0100
+ { 64, 5, 0x1B }, // 1101 1
+ { 128, 5, 0x12 }, // 1001 0
+ { 192, 6, 0x17 }, // 0101 11
+ { 256, 7, 0x37 }, // 0110 111
+ { 320, 8, 0x36 }, // 0011 0110
+ { 384, 8, 0x37 }, // 0011 0111
+ { 448, 8, 0x64 }, // 0110 0100
+ { 512, 8, 0x65 }, // 0110 0101
+ { 576, 8, 0x68 }, // 0110 1000
+ { 640, 8, 0x67 }, // 0110 0111
+ { 704, 9, 0xCC }, // 0110 0110 0
+ { 768, 9, 0xCD }, // 0110 0110 1
+ { 832, 9, 0xD2 }, // 0110 1001 0
+ { 896, 9, 0xD3 }, // 0110 1001 1
+ { 960, 9, 0xD4 }, // 0110 1010 0
+ { 1024, 9, 0xD5 }, // 0110 1010 1
+ { 1088, 9, 0xD6 }, // 0110 1011 0
+ { 1152, 9, 0xD7 }, // 0110 1011 1
+ { 1216, 9, 0xD8 }, // 0110 1100 0
+ { 1280, 9, 0xD9 }, // 0110 1100 1
+ { 1344, 9, 0xDA }, // 0110 1101 0
+ { 1408, 9, 0xDB }, // 0110 1101 1
+ { 1472, 9, 0x98 }, // 0100 1100 0
+ { 1536, 9, 0x99 }, // 0100 1100 1
+ { 1600, 9, 0x9A }, // 0100 1101 0
+ { 1664, 6, 0x18 }, // 0110 00
+ { 1728, 9, 0x9B }, // 0100 1101 1
+ { 1792, 11, 0x8 }, // 0000 0001 000
+ { 1856, 11, 0xC }, // 0000 0001 100
+ { 1920, 11, 0xD }, // 0000 0001 101
+ { 1984, 12, 0x12 }, // 0000 0001 0010
+ { 2048, 12, 0x13 }, // 0000 0001 0011
+ { 2112, 12, 0x14 }, // 0000 0001 0100
+ { 2176, 12, 0x15 }, // 0000 0001 0101
+ { 2240, 12, 0x16 }, // 0000 0001 0110
+ { 2304, 12, 0x17 }, // 0000 0001 0111
+ { 2368, 12, 0x1C }, // 0000 0001 1100
+ { 2432, 12, 0x1D }, // 0000 0001 1101
+ { 2496, 12, 0x1E }, // 0000 0001 1110
+ { 2560, 12, 0x1F } // 0000 0001 1111
+};
+
+static const PixelCode BlackPixelCodes[] =
+{
+ { 0, 10, 0x37 }, // 0000 1101 11
+ { 1, 3, 0x2 }, // 010
+ { 2, 2, 0x3 }, // 11
+ { 3, 2, 0x2 }, // 10
+ { 4, 3, 0x3 }, // 011
+ { 5, 4, 0x3 }, // 0011
+ { 6, 4, 0x2 }, // 0010
+ { 7, 5, 0x3 }, // 0001 1
+ { 8, 6, 0x5 }, // 0001 01
+ { 9, 6, 0x4 }, // 0001 00
+ { 10, 7, 0x4 }, // 0000 100
+ { 11, 7, 0x5 }, // 0000 101
+ { 12, 7, 0x7 }, // 0000 111
+ { 13, 8, 0x4 }, // 0000 0100
+ { 14, 8, 0x7 }, // 0000 0111
+ { 15, 9, 0x18 }, // 0000 1100 0
+ { 16, 10, 0x17 }, // 0000 0101 11
+ { 17, 10, 0x18 }, // 0000 0110 00
+ { 18, 10, 0x8 }, // 0000 0010 00
+ { 19, 11, 0x67 }, // 0000 1100 111
+ { 20, 11, 0x68 }, // 0000 1101 000
+ { 21, 11, 0x6C }, // 0000 1101 100
+ { 22, 11, 0x37 }, // 0000 0110 111
+ { 23, 11, 0x28 }, // 0000 0101 000
+ { 24, 11, 0x17 }, // 0000 0010 111
+ { 25, 11, 0x18 }, // 0000 0011 000
+ { 26, 12, 0xCA }, // 0000 1100 1010
+ { 27, 12, 0xCB }, // 0000 1100 1011
+ { 28, 12, 0xCC }, // 0000 1100 1100
+ { 29, 12, 0xCD }, // 0000 1100 1101
+ { 30, 12, 0x68 }, // 0000 0110 1000
+ { 31, 12, 0x69 }, // 0000 0110 1001
+ { 32, 12, 0x6A }, // 0000 0110 1010
+ { 33, 12, 0x6B }, // 0000 0110 1011
+ { 34, 12, 0xD2 }, // 0000 1101 0010
+ { 35, 12, 0xD3 }, // 0000 1101 0011
+ { 36, 12, 0xD4 }, // 0000 1101 0100
+ { 37, 12, 0xD5 }, // 0000 1101 0101
+ { 38, 12, 0xD6 }, // 0000 1101 0110
+ { 39, 12, 0xD7 }, // 0000 1101 0111
+ { 40, 12, 0x6C }, // 0000 0110 1100
+ { 41, 12, 0x6D }, // 0000 0110 1101
+ { 42, 12, 0xDA }, // 0000 1101 1010
+ { 43, 12, 0xDB }, // 0000 1101 1011
+ { 44, 12, 0x54 }, // 0000 0101 0100
+ { 45, 12, 0x55 }, // 0000 0101 0101
+ { 46, 12, 0x56 }, // 0000 0101 0110
+ { 47, 12, 0x57 }, // 0000 0101 0111
+ { 48, 12, 0x64 }, // 0000 0110 0100
+ { 49, 12, 0x65 }, // 0000 0110 0101
+ { 50, 12, 0x52 }, // 0000 0101 0010
+ { 51, 12, 0x53 }, // 0000 0101 0011
+ { 52, 12, 0x24 }, // 0000 0010 0100
+ { 53, 12, 0x37 }, // 0000 0011 0111
+ { 54, 12, 0x38 }, // 0000 0011 1000
+ { 55, 12, 0x27 }, // 0000 0010 0111
+ { 56, 12, 0x28 }, // 0000 0010 1000
+ { 57, 12, 0x58 }, // 0000 0101 1000
+ { 58, 12, 0x59 }, // 0000 0101 1001
+ { 59, 12, 0x2B }, // 0000 0010 1011
+ { 60, 12, 0x2C }, // 0000 0010 1100
+ { 61, 12, 0x5A }, // 0000 0101 1010
+ { 62, 12, 0x66 }, // 0000 0110 0110
+ { 63, 12, 0x67 }, // 0000 0110 0111
+ { 64, 10, 0xF }, // 0000 0011 11
+ { 128, 12, 0xC8 }, // 0000 1100 1000
+ { 192, 12, 0xC9 }, // 0000 1100 1001
+ { 256, 12, 0x5B }, // 0000 0101 1011
+ { 320, 12, 0x33 }, // 0000 0011 0011
+ { 384, 12, 0x34 }, // 0000 0011 0100
+ { 448, 12, 0x35 }, // 0000 0011 0101
+ { 512, 13, 0x6C }, // 0000 0011 0110 0
+ { 576, 13, 0x6D }, // 0000 0011 0110 1
+ { 640, 13, 0x4A }, // 0000 0010 0101 0
+ { 704, 13, 0x4B }, // 0000 0010 0101 1
+ { 768, 13, 0x4C }, // 0000 0010 0110 0
+ { 832, 13, 0x4D }, // 0000 0010 0110 1
+ { 896, 13, 0x72 }, // 0000 0011 1001 0
+ { 960, 13, 0x73 }, // 0000 0011 1001 1
+ { 1024, 13, 0x74 }, // 0000 0011 1010 0
+ { 1088, 13, 0x75 }, // 0000 0011 1010 1
+ { 1152, 13, 0x76 }, // 0000 0011 1011 0
+ { 1216, 13, 0x77 }, // 0000 0011 1011 1
+ { 1280, 13, 0x52 }, // 0000 0010 1001 0
+ { 1344, 13, 0x53 }, // 0000 0010 1001 1
+ { 1408, 13, 0x54 }, // 0000 0010 1010 0
+ { 1472, 13, 0x55 }, // 0000 0010 1010 1
+ { 1536, 13, 0x5A }, // 0000 0010 1101 0
+ { 1600, 13, 0x5B }, // 0000 0010 1101 1
+ { 1664, 13, 0x64 }, // 0000 0011 0010 0
+ { 1728, 13, 0x65 }, // 0000 0011 0010 1
+ { 1792, 11, 0x8 }, // 0000 0001 000
+ { 1856, 11, 0xC }, // 0000 0001 100
+ { 1920, 11, 0xD }, // 0000 0001 101
+ { 1984, 12, 0x12 }, // 0000 0001 0010
+ { 2048, 12, 0x13 }, // 0000 0001 0011
+ { 2112, 12, 0x14 }, // 0000 0001 0100
+ { 2176, 12, 0x15 }, // 0000 0001 0101
+ { 2240, 12, 0x16 }, // 0000 0001 0110
+ { 2304, 12, 0x17 }, // 0000 0001 0111
+ { 2368, 12, 0x1C }, // 0000 0001 1100
+ { 2432, 12, 0x1D }, // 0000 0001 1101
+ { 2496, 12, 0x1E }, // 0000 0001 1110
+ { 2560, 12, 0x1F } // 0000 0001 1111
+};
+
+
+void PDFWriterImpl::putG4Span( long i_nSpan, bool i_bWhitePixel, BitStreamState& io_rState )
+{
+ const PixelCode* pTable = i_bWhitePixel ? WhitePixelCodes : BlackPixelCodes;
+ // maximum encoded span is 2560 consecutive pixels
+ while( i_nSpan > 2623 )
+ {
+ // write 2560 bits, that is entry (63 + (2560 >> 6)) == 103 in the appropriate table
+ putG4Bits( pTable[103].mnCodeBits, pTable[103].mnCode, io_rState );
+ i_nSpan -= pTable[103].mnEncodedPixels;
+ }
+ // write multiples of 64 pixels up to 2560
+ if( i_nSpan > 63 )
+ {
+ sal_uInt32 nTabIndex = 63 + (i_nSpan >> 6);
+ OSL_ASSERT( pTable[nTabIndex].mnEncodedPixels == static_cast<sal_uInt32>(64*(i_nSpan >> 6)) );
+ putG4Bits( pTable[nTabIndex].mnCodeBits, pTable[nTabIndex].mnCode, io_rState );
+ i_nSpan -= pTable[nTabIndex].mnEncodedPixels;
+ }
+ putG4Bits( pTable[i_nSpan].mnCodeBits, pTable[i_nSpan].mnCode, io_rState );
+}
+
+void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap )
+{
+ long nW = i_pBitmap->Width();
+ long nH = i_pBitmap->Height();
+ if( nW <= 0 || nH <= 0 )
+ return;
+ if( i_pBitmap->GetBitCount() != 1 )
+ return;
+
+ BitStreamState aBitState;
+
+ // the first reference line is virtual and completely empty
+ const Scanline pFirstRefLine = (Scanline)rtl_allocateZeroMemory( nW/8 + 1 );
+ Scanline pRefLine = pFirstRefLine;
+ for( long nY = 0; nY < nH; nY++ )
+ {
+ const Scanline pCurLine = i_pBitmap->GetScanline( nY );
+ long nLineIndex = 0;
+ bool bRunSet = (*pCurLine & 0x80) ? true : false;
+ bool bRefSet = (*pRefLine & 0x80) ? true : false;
+ long nRunIndex1 = bRunSet ? 0 : findBitRun( pCurLine, 0, nW, bRunSet );
+ long nRefIndex1 = bRefSet ? 0 : findBitRun( pRefLine, 0, nW, bRefSet );
+ for( ; nLineIndex < nW; )
+ {
+ long nRefIndex2 = findBitRun( pRefLine, nRefIndex1, nW, isSet( pRefLine, nRefIndex1 ) );
+ if( nRefIndex2 >= nRunIndex1 )
+ {
+ long nDiff = nRefIndex1 - nRunIndex1;
+ if( -3 <= nDiff && nDiff <= 3 )
+ { // vertical coding
+ static const struct
+ {
+ sal_uInt32 mnCodeBits;
+ sal_uInt32 mnCode;
+ } VerticalCodes[7] = {
+ { 7, 0x03 }, // 0000 011
+ { 6, 0x03 }, // 0000 11
+ { 3, 0x03 }, // 011
+ { 1, 0x1 }, // 1
+ { 3, 0x2 }, // 010
+ { 6, 0x02 }, // 0000 10
+ { 7, 0x02 } // 0000 010
+ };
+ // convert to index
+ nDiff += 3;
+
+ // emit diff code
+ putG4Bits( VerticalCodes[nDiff].mnCodeBits, VerticalCodes[nDiff].mnCode, aBitState );
+ nLineIndex = nRunIndex1;
+ }
+ else
+ { // difference too large, horizontal coding
+ // emit horz code 001
+ putG4Bits( 3, 0x1, aBitState );
+ long nRunIndex2 = findBitRun( pCurLine, nRunIndex1, nW, isSet( pCurLine, nRunIndex1 ) );
+ bool bWhiteFirst = ( nLineIndex + nRunIndex1 == 0 || ! isSet( pCurLine, nLineIndex ) );
+ putG4Span( nRunIndex1 - nLineIndex, bWhiteFirst, aBitState );
+ putG4Span( nRunIndex2 - nRunIndex1, ! bWhiteFirst, aBitState );
+ nLineIndex = nRunIndex2;
+ }
+ }
+ else
+ { // emit pass code 0001
+ putG4Bits( 4, 0x1, aBitState );
+ nLineIndex = nRefIndex2;
+ }
+ if( nLineIndex < nW )
+ {
+ bool bSet = isSet( pCurLine, nLineIndex );
+ nRunIndex1 = findBitRun( pCurLine, nLineIndex, nW, bSet );
+ nRefIndex1 = findBitRun( pRefLine, nLineIndex, nW, ! bSet );
+ nRefIndex1 = findBitRun( pRefLine, nRefIndex1, nW, bSet );
+ }
+ }
+
+ // the current line is the reference for the next line
+ pRefLine = pCurLine;
+ }
+ // terminate strip with EOFB
+ putG4Bits( 12, 1, aBitState );
+ putG4Bits( 12, 1, aBitState );
+ if( aBitState.mnNextBitPos != 8 )
+ {
+ writeBuffer( aBitState.getByte(), 1 );
+ aBitState.flush();
+ }
+
+ rtl_freeMemory( pFirstRefLine );
+}
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index c00dfd7635ae..e5e19dff3771 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -41,6 +41,7 @@
#include <vcl/unohelp.hxx>
#include <tools/debug.hxx>
+#include <tools/resary.hxx>
#include <tools/stream.hxx>
#include <tools/vcompat.hxx>
#include <vcl/svdata.hxx>
@@ -54,6 +55,7 @@
#include <vcl/gdimtf.hxx>
#include <vcl/metaact.hxx>
#include <vcl/print.hxx>
+#include <vcl/svids.hrc>
#include <comphelper/processfactory.hxx>
@@ -1280,6 +1282,48 @@ int Printer::GetPaperInfoCount() const
// -----------------------------------------------------------------------
+rtl::OUString Printer::GetPaperName( Paper ePaper )
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->mpPaperNames )
+ {
+ pSVData->mpPaperNames = new std::hash_map< int, rtl::OUString >();
+ if( ImplGetResMgr() )
+ {
+ ResStringArray aPaperStrings( VclResId( RID_STR_PAPERNAMES ) );
+ static const int PaperIndex[] =
+ {
+ PAPER_A0, PAPER_A1, PAPER_A2, PAPER_A3, PAPER_A4, PAPER_A5,
+ PAPER_B4_ISO, PAPER_B5_ISO, PAPER_LETTER, PAPER_LEGAL, PAPER_TABLOID,
+ PAPER_USER, PAPER_B6_ISO, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65,
+ PAPER_ENV_DL, PAPER_SLIDE_DIA, PAPER_SCREEN, PAPER_C, PAPER_D, PAPER_E,
+ PAPER_EXECUTIVE, PAPER_FANFOLD_LEGAL_DE, PAPER_ENV_MONARCH, PAPER_ENV_PERSONAL,
+ PAPER_ENV_9, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_KAI16,
+ PAPER_KAI32, PAPER_KAI32BIG, PAPER_B4_JIS, PAPER_B5_JIS, PAPER_B6_JIS
+ };
+ OSL_ENSURE( sal_uInt32(sizeof(PaperIndex)/sizeof(PaperIndex[0])) == aPaperStrings.Count(), "localized paper name count wrong" );
+ for( int i = 0; i < int(sizeof(PaperIndex)/sizeof(PaperIndex[0])); i++ )
+ (*pSVData->mpPaperNames)[PaperIndex[i]] = aPaperStrings.GetString(i);
+ }
+ }
+
+ std::hash_map<int,rtl::OUString>::const_iterator it = pSVData->mpPaperNames->find( (int)ePaper );
+ return (it != pSVData->mpPaperNames->end()) ? it->second : rtl::OUString();
+}
+
+// -----------------------------------------------------------------------
+
+rtl::OUString Printer::GetPaperName( bool i_bPaperUser ) const
+{
+ Size aPageSize = PixelToLogic( GetPaperSizePixel(), MAP_100TH_MM );
+ Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() );
+ if( ePaper == PAPER_USER )
+ ePaper = ImplGetPaperFormat( aPageSize.Height(), aPageSize.Width() );
+ return (ePaper != PAPER_USER || i_bPaperUser ) ? GetPaperName( ePaper ) : rtl::OUString();
+}
+
+// -----------------------------------------------------------------------
+
const PaperInfo& Printer::GetPaperInfo( int nPaper ) const
{
if( ! mpInfoPrinter )
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 01bf4ca90d65..d86df6e2816b 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -855,13 +855,12 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
++nActionNum;
}
- ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
+ // clean up aMapModeVDev
+ sal_uInt32 nCount = aMapModeVDev.GetGCStackDepth();
+ while( nCount-- )
+ aMapModeVDev.Pop();
- // create an OutputDevice to record mapmode changes and the like
- VirtualDevice aMapModeVDev2;
- aMapModeVDev2.mnDPIX = mnDPIX;
- aMapModeVDev2.mnDPIY = mnDPIY;
- aMapModeVDev2.EnableOutput(sal_False);
+ ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
// fast-forward until one after the last background action
// (need to reconstruct map mode vdev state)
@@ -876,7 +875,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
pCurrAct, nActionNum) );
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev2 );
+ pCurrAct->Execute( &aMapModeVDev );
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction();
++nActionNum;
}
@@ -893,10 +892,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
{
// execute action to get correct MapModes etc.
- pCurrAct->Execute( &aMapModeVDev2 );
+ pCurrAct->Execute( &aMapModeVDev );
// cache bounds of current action
- const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev2) );
+ const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev) );
// accumulate collected bounds here, initialize with current action
Rectangle aTotalBounds( aBBCurrAct ); // thus,
@@ -925,7 +924,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// not be considered for connected components,
// too. Just put each of them into a separate
// component.
- aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev2);
+ aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev);
if( !aBBCurrAct.IsEmpty() &&
!aTotalComponents.bIsFullyTransparent )
@@ -1311,18 +1310,16 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
}
}
+ // clean up aMapModeVDev
+ nCount = aMapModeVDev.GetGCStackDepth();
+ while( nCount-- )
+ aMapModeVDev.Pop();
+
//
// STAGE 4: Copy actions to output metafile
// ========================================
//
- // create an OutputDevice to record color settings, mapmode
- // changes and the like
- VirtualDevice aMapModeVDev3;
- aMapModeVDev3.mnDPIX = mnDPIX;
- aMapModeVDev3.mnDPIY = mnDPIY;
- aMapModeVDev3.EnableOutput(sal_False);
-
// iterate over all actions and duplicate the ones not in a
// special aCCList member into rOutMtf
for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
@@ -1350,7 +1347,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// given background color
ImplConvertTransparentAction(rOutMtf,
*pCurrAct,
- aMapModeVDev3,
+ aMapModeVDev,
aBackgroundComponent.aBgColor);
}
else
@@ -1359,7 +1356,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
rOutMtf.AddAction( ( pCurrAct->Duplicate(), pCurrAct ) );
}
- pCurrAct->Execute(&aMapModeVDev3);
+ pCurrAct->Execute(&aMapModeVDev);
}
}
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index cab1b6610d26..96e67aaabffa 100644..100755
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -46,6 +46,8 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -1376,6 +1378,28 @@ sal_Bool Region::Union( const Rectangle& rRect )
if ( rRect.IsEmpty() )
return sal_True;
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = rRect;
+ return true;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
// no instance data? -> create!
@@ -1446,6 +1470,22 @@ sal_Bool Region::Intersect( const Rectangle& rRect )
return sal_True;
}
+ else if( mpImplRegion->mpB2DPolyPoly )
+ {
+ // #127431# make ImplRegion unique, if not already.
+ if( mpImplRegion->mnRefCount > 1 )
+ {
+ mpImplRegion->mnRefCount--;
+ mpImplRegion = new ImplRegion( *mpImplRegion->mpB2DPolyPoly );
+ }
+
+ *mpImplRegion->mpB2DPolyPoly =
+ basegfx::tools::clipPolyPolygonOnRange( *mpImplRegion->mpB2DPolyPoly,
+ basegfx::B2DRange( rRect.Left(), rRect.Top(),
+ rRect.Right(), rRect.Bottom() ),
+ true, false );
+ return sal_True;
+ }
else
ImplPolyPolyRegionToBandRegion();
@@ -1529,6 +1569,25 @@ sal_Bool Region::Exclude( const Rectangle& rRect )
if ( rRect.IsEmpty() )
return sal_True;
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ return sal_True;
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
// no instance data? -> create!
@@ -1571,6 +1630,28 @@ sal_Bool Region::XOr( const Rectangle& rRect )
if ( rRect.IsEmpty() )
return sal_True;
+ if( HasPolyPolygon() )
+ {
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = rRect;
+ return sal_True;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolygon aRectPoly( basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() ) ) );
+ basegfx::B2DPolyPolygon aOtherPolyPoly( aRectPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
// no instance data? -> create!
@@ -1604,11 +1685,38 @@ sal_Bool Region::XOr( const Rectangle& rRect )
}
// -----------------------------------------------------------------------
+void Region::ImplUnionPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
+
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationOr( aThisPolyPoly, aOtherPolyPoly );
+
+ *this = Region( aClip );
+}
sal_Bool Region::Union( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplUnionPolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
@@ -1654,6 +1762,22 @@ sal_Bool Region::Union( const Region& rRegion )
}
// -----------------------------------------------------------------------
+void Region::ImplIntersectWithPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::clipPolyPolygonOnPolyPolygon( aOtherPolyPoly, aThisPolyPoly, true, false );
+ *this = Region( aClip );
+}
sal_Bool Region::Intersect( const Region& rRegion )
{
@@ -1663,6 +1787,12 @@ sal_Bool Region::Intersect( const Region& rRegion )
if ( mpImplRegion == rRegion.mpImplRegion )
return sal_True;
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplIntersectWithPolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
@@ -1793,11 +1923,32 @@ sal_Bool Region::Intersect( const Region& rRegion )
}
// -----------------------------------------------------------------------
+void Region::ImplExcludePolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ return;
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+}
sal_Bool Region::Exclude( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplExcludePolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
@@ -1846,11 +1997,35 @@ sal_Bool Region::Exclude( const Region& rRegion )
}
// -----------------------------------------------------------------------
+void Region::ImplXOrPolyPolygon( const Region& i_rRegion )
+{
+ // get this B2DPolyPolygon
+ basegfx::B2DPolyPolygon aThisPolyPoly( ConvertToB2DPolyPolygon() );
+ if( aThisPolyPoly.count() == 0 )
+ {
+ *this = i_rRegion;
+ return;
+ }
+ aThisPolyPoly = basegfx::tools::prepareForPolygonOperation( aThisPolyPoly );
+
+ // get the other B2DPolyPolygon
+ basegfx::B2DPolyPolygon aOtherPolyPoly( const_cast<Region&>(i_rRegion).ConvertToB2DPolyPolygon() );
+ aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation( aOtherPolyPoly );
+
+ basegfx::B2DPolyPolygon aClip = basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
+ *this = Region( aClip );
+}
sal_Bool Region::XOr( const Region& rRegion )
{
DBG_CHKTHIS( Region, ImplDbgTestRegion );
+ if( rRegion.HasPolyPolygon() || HasPolyPolygon() )
+ {
+ ImplXOrPolyPolygon( rRegion );
+ return sal_True;
+ }
+
ImplPolyPolyRegionToBandRegion();
((Region*)&rRegion)->ImplPolyPolyRegionToBandRegion();
@@ -2031,7 +2206,7 @@ basegfx::B2DPolyPolygon Region::ConvertToB2DPolyPolygon()
// -----------------------------------------------------------------------
-sal_Bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
+bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
long& rX, long& rY,
long& rWidth, long& rHeight ) const
{
@@ -2041,11 +2216,11 @@ sal_Bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
// no internal data? -> region is empty!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_False;
+ return false;
// no band in the list? -> region is empty!
if ( mpImplRegion->mpFirstBand == NULL )
- return sal_False;
+ return false;
// initialise pointer for first access
ImplRegionBand* pCurrRectBand = mpImplRegion->mpFirstBand;
@@ -2053,7 +2228,7 @@ sal_Bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
DBG_ASSERT( pCurrRectBandSep != NULL, "Erstes Band wurde nicht optimiert." );
if ( !pCurrRectBandSep )
- return sal_False;
+ return false;
// get boundaries of current rectangle
rX = pCurrRectBandSep->mnXLeft;
@@ -2065,12 +2240,12 @@ sal_Bool Region::ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo,
rImplRegionInfo.mpVoidCurrRectBand = (void*)pCurrRectBand;
rImplRegionInfo.mpVoidCurrRectBandSep = (void*)pCurrRectBandSep;
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
-sal_Bool Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
+bool Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
long& rX, long& rY,
long& rWidth, long& rHeight ) const
{
@@ -2078,7 +2253,7 @@ sal_Bool Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
// no internal data? -> region is empty!
if ( (mpImplRegion == &aImplEmptyRegion) || (mpImplRegion == &aImplNullRegion) )
- return sal_False;
+ return false;
// get last pointers
ImplRegionBand* pCurrRectBand = (ImplRegionBand*)rImplRegionInfo.mpVoidCurrRectBand;
@@ -2095,7 +2270,7 @@ sal_Bool Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
// no band found? -> not further rectangles!
if( !pCurrRectBand )
- return sal_False;
+ return false;
// get first separation in current band
pCurrRectBandSep = pCurrRectBand->mpFirstSep;
@@ -2111,7 +2286,7 @@ sal_Bool Region::ImplGetNextRect( ImplRegionInfo& rImplRegionInfo,
rImplRegionInfo.mpVoidCurrRectBand = (void*)pCurrRectBand;
rImplRegionInfo.mpVoidCurrRectBandSep = (void*)pCurrRectBandSep;
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index f3c381147054..9f2ee0924555 100755
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -253,14 +253,29 @@ sal_Bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoi
void SalGraphics::mirror( Region& rRgn, const OutputDevice *pOutDev, bool bBack ) const
{
- // mirror the bounding rect and move Region by resulting offset
- Rectangle aRect( rRgn.GetBoundRect() );
- long nWidth = aRect.GetWidth();
- long x = aRect.Left();
- long x_org = x;
+ if( rRgn.HasPolyPolygon() )
+ {
+ basegfx::B2DPolyPolygon aPolyPoly( rRgn.ConvertToB2DPolyPolygon() );
+ aPolyPoly = mirror( aPolyPoly, pOutDev, bBack );
+ rRgn = Region( aPolyPoly );
+ }
+ else
+ {
+ ImplRegionInfo aInfo;
+ bool bRegionRect;
+ Region aMirroredRegion;
+ long nX, nY, nWidth, nHeight;
- mirror( x, nWidth, pOutDev, bBack );
- rRgn.Move( x - x_org, 0 );
+ bRegionRect = rRgn.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
+ while ( bRegionRect )
+ {
+ Rectangle aRect( Point(nX, nY), Size(nWidth, nHeight) );
+ mirror( aRect, pOutDev, bBack );
+ aMirroredRegion.Union( aRect );
+ bRegionRect = rRgn.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
+ }
+ rRgn = aMirroredRegion;
+ }
}
void SalGraphics::mirror( Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
@@ -358,22 +373,15 @@ basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rP
// ----------------------------------------------------------------------------
-sal_Bool SalGraphics::UnionClipRegion( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
+bool SalGraphics::SetClipRegion( const Region& i_rClip, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
- return unionClipRegion( nX, nY, nWidth, nHeight );
-}
-
-bool SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- return false;
-}
-
-sal_Bool SalGraphics::UnionClipRegion( const ::basegfx::B2DPolyPolygon& rPoly, const OutputDevice* pOutDev )
-{
- (void)pOutDev;// TODO: SAL_LAYOUT_BIDI_RTL
- return unionClipRegion( rPoly );
+ {
+ Region aMirror( i_rClip );
+ mirror( aMirror, pOutDev );
+ return setClipRegion( aMirror );
+ }
+ return setClipRegion( i_rClip );
}
void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
@@ -465,7 +473,7 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
bool SalGraphics::DrawPolyPolygon( const ::basegfx::B2DPolyPolygon& i_rPolyPolygon, double i_fTransparency, const OutputDevice* i_pOutDev )
{
bool bRet = false;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
basegfx::B2DPolyPolygon aMirror( mirror( i_rPolyPolygon, i_pOutDev ) );
bRet = drawPolyPolygon( aMirror, i_fTransparency );
@@ -483,7 +491,7 @@ bool SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fT
sal_Bool SalGraphics::DrawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
@@ -498,7 +506,7 @@ sal_Bool SalGraphics::DrawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPt
sal_Bool SalGraphics::DrawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry, const OutputDevice* pOutDev )
{
sal_Bool bResult = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
SalPoint* pPtAry2 = new SalPoint[nPoints];
sal_Bool bCopied = mirror( nPoints, pPtAry, pPtAry2, pOutDev );
@@ -514,7 +522,7 @@ sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt3
const SalPoint* const* i_pPtAry, const sal_uInt8* const* i_pFlgAry, const OutputDevice* i_pOutDev )
{
sal_Bool bRet = sal_False;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
// TODO: optimize, reduce new/delete calls
SalPoint **pPtAry2 = new SalPoint*[i_nPoly];
@@ -542,7 +550,7 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double
const OutputDevice* i_pOutDev )
{
bool bRet = false;
- if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) )
+ if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
{
basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) );
bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin );
diff --git a/vcl/source/helper/xconnection.cxx b/vcl/source/helper/xconnection.cxx
index d35e4b30caac..a0cc8c35e5e2 100644
--- a/vcl/source/helper/xconnection.cxx
+++ b/vcl/source/helper/xconnection.cxx
@@ -29,11 +29,18 @@
#include "precompiled_vcl.hxx"
#include "svsys.h"
+#include "rtl/ref.hxx"
#include "vcl/xconnection.hxx"
#include "vcl/svdata.hxx"
#include "vcl/salinst.hxx"
#include "vcl/svapp.hxx"
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
namespace vcl
{
class SolarMutexReleaser
@@ -62,13 +69,9 @@ using namespace com::sun::star::awt;
DisplayConnection::DisplayConnection()
{
- ImplSVData* pSVData = ImplGetSVData();
- pSVData->mpDefInst->SetEventCallback( this, dispatchEvent );
- pSVData->mpDefInst->SetErrorEventCallback( this, dispatchErrorEvent );
-
SalInstance::ConnectionIdentifierType eType;
int nBytes;
- void* pBytes = pSVData->mpDefInst->GetConnectionIdentifier( eType, nBytes );
+ void* pBytes = ImplGetSVData()->mpDefInst->GetConnectionIdentifier( eType, nBytes );
switch( eType )
{
case SalInstance::AsciiCString:
@@ -81,39 +84,54 @@ DisplayConnection::DisplayConnection()
}
DisplayConnection::~DisplayConnection()
+{}
+
+void DisplayConnection::start()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpDefInst->SetEventCallback( this );
+}
+
+void DisplayConnection::terminate()
{
ImplSVData* pSVData = ImplGetSVData();
if( pSVData )
{
- pSVData->mpDefInst->SetEventCallback( NULL, NULL );
- pSVData->mpDefInst->SetErrorEventCallback( NULL, NULL );
+ pSVData->mpDefInst->SetEventCallback( NULL );
}
-}
+ SolarMutexReleaser aRel;
+
+ MutexGuard aGuard( m_aMutex );
+ Any aEvent;
+ std::list< css::uno::Reference< XEventHandler > > aLocalList( m_aHandlers );
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = aLocalList.begin(); it != aLocalList.end(); ++it )
+ (*it)->handleEvent( aEvent );
+}
-void SAL_CALL DisplayConnection::addEventHandler( const Any& /*window*/, const Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) throw()
+void SAL_CALL DisplayConnection::addEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aHandlers.push_back( handler );
}
-void SAL_CALL DisplayConnection::removeEventHandler( const Any& /*window*/, const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aHandlers.remove( handler );
}
-void SAL_CALL DisplayConnection::addErrorHandler( const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::addErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
m_aErrorHandlers.push_back( handler );
}
-void SAL_CALL DisplayConnection::removeErrorHandler( const Reference< XEventHandler >& handler ) throw()
+void SAL_CALL DisplayConnection::removeErrorHandler( const css::uno::Reference< XEventHandler >& handler ) throw()
{
MutexGuard aGuard( m_aMutex );
@@ -125,52 +143,37 @@ Any SAL_CALL DisplayConnection::getIdentifier() throw()
return m_aAny;
}
-void DisplayConnection::dispatchDowningEvent()
-{
- SolarMutexReleaser aRel;
-
- MutexGuard aGuard( m_aMutex );
- Any aEvent;
- std::list< Reference< XEventHandler > > aLocalList( m_aHandlers );
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = aLocalList.begin(); it != aLocalList.end(); ++it )
- (*it)->handleEvent( aEvent );
-}
-
-bool DisplayConnection::dispatchEvent( void* pThis, void* pData, int nBytes )
+bool DisplayConnection::dispatchEvent( void* pData, int nBytes )
{
SolarMutexReleaser aRel;
- DisplayConnection* This = (DisplayConnection*)pThis;
-
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< Reference< XEventHandler > > handlers;
+ ::std::list< css::uno::Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( This->m_aMutex );
- handlers = This->m_aHandlers;
+ MutexGuard aGuard( m_aMutex );
+ handlers = m_aHandlers;
}
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
if( (*it)->handleEvent( aEvent ) )
return true;
return false;
}
-bool DisplayConnection::dispatchErrorEvent( void* pThis, void* pData, int nBytes )
+bool DisplayConnection::dispatchErrorEvent( void* pData, int nBytes )
{
SolarMutexReleaser aRel;
- DisplayConnection* This = (DisplayConnection*)pThis;
-
Sequence< sal_Int8 > aSeq( (sal_Int8*)pData, nBytes );
Any aEvent;
aEvent <<= aSeq;
- ::std::list< Reference< XEventHandler > > handlers;
+ ::std::list< css::uno::Reference< XEventHandler > > handlers;
{
- MutexGuard aGuard( This->m_aMutex );
- handlers = This->m_aErrorHandlers;
+ MutexGuard aGuard( m_aMutex );
+ handlers = m_aErrorHandlers;
}
- for( ::std::list< Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
+ for( ::std::list< css::uno::Reference< XEventHandler > >::const_iterator it = handlers.begin(); it != handlers.end(); ++it )
if( (*it)->handleEvent( aEvent ) )
return true;
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 04ab77f09288..f41e65f4939f 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -412,6 +412,14 @@ ModalDialog SV_DLG_PRINT
{
ImageBitmap = Bitmap { File = "ncollate_h.png" ; };
};
+
+ CheckBox SV_PRINT_OPT_REVERSE
+ {
+ HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
+ Pos = MAP_APPFONT( 10, 50 );
+ Size = MAP_APPFONT( 200, 12 );
+ Text [en-US] = "Print in ~reverse page order";
+ };
};
TabPage SV_PRINT_TAB_OPT
@@ -440,13 +448,6 @@ ModalDialog SV_DLG_PRINT
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "~Create single print jobs for collated output";
};
- CheckBox SV_PRINT_OPT_REVERSE
- {
- HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
- Pos = MAP_APPFONT( 10, 50 );
- Size = MAP_APPFONT( 200, 12 );
- Text [en-US] = "Print in ~reverse page order";
- };
};
};
@@ -498,3 +499,48 @@ StringArray SV_PRINT_NATIVE_STRINGS
< "Print selection only"; >;
};
};
+
+StringArray RID_STR_PAPERNAMES
+{
+ ItemList [en-US] =
+ {
+ < "A0"; >;
+ < "A1"; >;
+ < "A2"; >;
+ < "A3"; >;
+ < "A4"; >;
+ < "A5"; >;
+ < "B4 (ISO)"; >;
+ < "B5 (ISO)"; >;
+ < "Letter"; >;
+ < "Legal"; >;
+ < "Tabloid"; >;
+ < "User Defined"; >;
+ < "B6 (ISO)"; >;
+ < "C4 Envelope"; >;
+ < "C5 Envelope"; >;
+ < "C6 Envelope"; >;
+ < "C6/5 Envelope"; >;
+ < "DL Envelope"; >;
+ < "Dia Slide"; >;
+ < "Screen"; >;
+ < "C"; >;
+ < "D"; >;
+ < "E"; >;
+ < "Executive"; >;
+ < "Long Bond"; >;
+ < "#8 (Monarch) Envelope"; >;
+ < "#6 3/4 (Personal) Envelope"; >;
+ < "#9 Envelope"; >;
+ < "#10 Envelope"; >;
+ < "#11 Envelope"; >;
+ < "#12 Envelope"; >;
+ < "16 Kai"; >;
+ < "32 Kai"; >;
+ < "Big 32 Kai"; >;
+ < "B4 (JIS)"; >;
+ < "B5 (JIS)"; >;
+ < "B6 (JIS)"; >;
+ };
+};
+
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index bf4cc231fcc7..32fc4755a62d 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1120,11 +1120,15 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window
return pWindow;
}
-Window* Window::GetLabelFor() const
+Window* Window::GetAccessibleRelationLabelFor() const
{
if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
return NULL;
+ if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabelForWindow )
+ return mpWindowImpl->mpAccessibleInfos->pLabelForWindow;
+
+
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1205,11 +1209,14 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo
return pWindow;
}
-Window* Window::GetLabeledBy() const
+Window* Window::GetAccessibleRelationLabeledBy() const
{
if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
return NULL;
+ if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabeledByWindow )
+ return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow;
+
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
@@ -1238,6 +1245,62 @@ Window* Window::GetLabeledBy() const
return pWindow;
}
+Window* Window::GetAccessibleRelationMemberOf() const
+{
+ Window* pWindow = NULL;
+ Window* pFrameWindow = GetParent();
+ if ( !pFrameWindow )
+ {
+ pFrameWindow = ImplGetFrameWindow();
+ }
+ // if( ! ( GetType() == WINDOW_FIXEDTEXT ||
+ if( !( GetType() == WINDOW_FIXEDLINE ||
+ GetType() == WINDOW_GROUPBOX ) )
+ {
+ // search for a control that makes member of this window
+ // it is considered the last fixed line or group box
+ // that comes before this control; with the exception of push buttons
+ // which are labeled only if the fixed line or group box
+ // is directly before the control
+ // get form start and form end and index of this control
+ sal_uInt16 nIndex, nFormStart, nFormEnd;
+ Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
+ const_cast<Window*>(this),
+ nIndex,
+ nFormStart,
+ nFormEnd );
+ if( pSWindow && nIndex != nFormStart )
+ {
+ if( GetType() == WINDOW_PUSHBUTTON ||
+ GetType() == WINDOW_HELPBUTTON ||
+ GetType() == WINDOW_OKBUTTON ||
+ GetType() == WINDOW_CANCELBUTTON )
+ {
+ nFormStart = nIndex-1;
+ }
+ for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
+ {
+ sal_uInt16 nFoundIndex = 0;
+ pSWindow = ::ImplGetChildWindow( pFrameWindow,
+ nSearchIndex,
+ nFoundIndex,
+ sal_False );
+ if( pSWindow && pSWindow->IsVisible() &&
+ ( pSWindow->GetType() == WINDOW_FIXEDLINE ||
+ pSWindow->GetType() == WINDOW_GROUPBOX ) )
+ {
+ pWindow = pSWindow;
+ break;
+ }
+ if( nFoundIndex > nSearchIndex || nSearchIndex == 0 )
+ break;
+ }
+ }
+ }
+ return pWindow;
+}
+//-----IAccessibility2 Implementation 2009
+
// -----------------------------------------------------------------------
KeyEvent Window::GetActivationKey() const
@@ -1247,7 +1310,7 @@ KeyEvent Window::GetActivationKey() const
sal_Unicode nAccel = getAccel( GetText() );
if( ! nAccel )
{
- Window* pWindow = GetLabeledBy();
+ Window* pWindow = GetAccessibleRelationLabeledBy();
if( pWindow )
nAccel = getAccel( pWindow->GetText() );
}
@@ -1260,6 +1323,10 @@ KeyEvent Window::GetActivationKey() const
nCode = KEY_A + (nAccel-'A');
else if( nAccel >= '0' && nAccel <= '9' )
nCode = KEY_0 + (nAccel-'0');
+ else if( nAccel == '.' )
+ nCode = KEY_POINT;
+ else if( nAccel == '-' )
+ nCode = KEY_SUBTRACT;
KeyCode aKeyCode( nCode, sal_False, sal_False, sal_True, sal_False );
aKeyEvent = KeyEvent( nAccel, aKeyCode );
}
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 7b3dcfaa3341..6e0c109a564d 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -422,6 +422,8 @@ void MessBox::ImplPosControls()
}
mpFixedText = new FixedText( this, nWinStyle );
+ if( mpFixedText->GetStyle() & WB_EXTRAOFFSET ) // TODO: use CalcMinimumSize() instead
+ aFixedSize.Width() += 2;
mpFixedText->SetPosSizePixel( aTextPos, aFixedSize );
mpFixedText->SetText( aMessText );
mpFixedText->Show();
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 83b1c9513a8d..5569759a3fff 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -310,6 +310,7 @@ void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt )
void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPreview,
const Size& i_rOrigSize,
+ const rtl::OUString& i_rPaperName,
const rtl::OUString& i_rReplacement,
sal_Int32 i_nDPIX,
sal_Int32 i_nDPIY,
@@ -344,6 +345,12 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) );
aBuf.append( aNumText );
aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+ if( i_rPaperName.getLength() )
+ {
+ aBuf.appendAscii( " (" );
+ aBuf.append( i_rPaperName );
+ aBuf.append( sal_Unicode(')') );
+ }
maHorzDim.SetText( aBuf.makeStringAndClear() );
aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits );
@@ -613,6 +620,7 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
, maCopyCountField( this, VclResId( SV_PRINT_COPYCOUNT_FIELD ) )
, maCollateBox( this, VclResId( SV_PRINT_COLLATE ) )
, maCollateImage( this, VclResId( SV_PRINT_COLLATE_IMAGE ) )
+ , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
, maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) )
, maCollateHCImg( VclResId( SV_PRINT_COLLATE_HC_IMG ) )
, maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) )
@@ -741,7 +749,6 @@ PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rRe
, maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) )
, maToFileBox( this, VclResId( SV_PRINT_OPT_TOFILE ) )
, maCollateSingleJobsBox( this, VclResId( SV_PRINT_OPT_SINGLEJOBS ) )
- , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
{
FreeResource();
@@ -765,7 +772,6 @@ void PrintDialog::OutputOptPage::setupLayout()
mxOptGroup = xCol;
xCol->addWindow( &maToFileBox );
xCol->addWindow( &maCollateSingleJobsBox );
- xCol->addWindow( &maReverseOrderBox );
}
void PrintDialog::OutputOptPage::readFromSettings()
@@ -833,7 +839,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maPageStr = maNumPagesText.GetText();
// init reverse print
- maOptionsPage.maReverseOrderBox.Check( maPController->getReversePrint() );
+ maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() );
// fill printer listbox
const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() );
@@ -906,7 +912,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maJobPage.maDetailsBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
- maOptionsPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
+ maJobPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
@@ -1637,6 +1643,16 @@ void PrintDialog::setupOptionalUI()
{
maJobPage.mxPrintRange->show( false, false );
maJobPage.maCopySpacer.Show( sal_False );
+ maJobPage.maReverseOrderBox.Show( sal_False );
+ }
+ else
+ {
+ // add an indent to the current column
+ vcl::Indenter* pIndent = new vcl::Indenter( maJobPage.mxPrintRange.get(), -1 );
+ maJobPage.mxPrintRange->addChild( pIndent );
+ // and create a column inside the indent
+ pIndent->setWindow( &maJobPage.maReverseOrderBox );
+ maJobPage.maReverseOrderBox.Show( sal_True );
}
#ifdef WNT
@@ -1882,7 +1898,9 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache )
}
Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) );
- maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr,
+ maPreviewWindow.setPreview( aMtf, aCurPageSize,
+ aPrt->GetPaperName( false ),
+ nPages > 0 ? rtl::OUString() : maNoPageStr,
aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(),
aPrt->GetPrinterOptions().IsConvertToGreyscales()
);
@@ -2187,9 +2205,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
makeAny( sal_Bool(isCollate()) ) );
checkControlDependencies();
}
- else if( pButton == &maOptionsPage.maReverseOrderBox )
+ else if( pButton == &maJobPage.maReverseOrderBox )
{
- sal_Bool bChecked = maOptionsPage.maReverseOrderBox.IsChecked();
+ sal_Bool bChecked = maJobPage.maReverseOrderBox.IsChecked();
maPController->setReversePrint( bChecked );
maPController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverse" ) ),
makeAny( bChecked ) );
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 0a44486839f6..6ddb10c92cd7 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -134,25 +134,21 @@ struct ImplCalcToTopData
Region* mpInvalidateRegion;
};
-struct ImplAccessibleInfos
+ImplAccessibleInfos::ImplAccessibleInfos()
{
- sal_uInt16 nAccessibleRole;
- String* pAccessibleName;
- String* pAccessibleDescription;
-
- ImplAccessibleInfos()
- {
- nAccessibleRole = 0xFFFF;
- pAccessibleName = NULL;
- pAccessibleDescription = NULL;
- }
+ nAccessibleRole = 0xFFFF;
+ pAccessibleName = NULL;
+ pAccessibleDescription = NULL;
+ pLabeledByWindow = NULL;
+ pLabelForWindow = NULL;
+ pMemberOfWindow = NULL;
+}
- ~ImplAccessibleInfos()
- {
- delete pAccessibleName;
- delete pAccessibleDescription;
- }
-};
+ImplAccessibleInfos::~ImplAccessibleInfos()
+{
+ delete pAccessibleName;
+ delete pAccessibleDescription;
+}
// -----------------------------------------------------------------------
@@ -4380,7 +4376,7 @@ Window::~Window()
// Dispose of the canvas implementation (which, currently, has an
// own wrapper window as a child to this one.
- Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
if( xCanvas.is() )
{
uno::Reference < lang::XComponent > xCanvasComponent( xCanvas,
@@ -4425,12 +4421,12 @@ Window::~Window()
// deregister drop target listener
if( mpWindowImpl->mpFrameData->mxDropTargetListener.is() )
{
- Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->removeDragGestureListener(
- Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
@@ -4438,7 +4434,7 @@ Window::~Window()
}
// shutdown drag and drop for this frame window
- Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
+ uno::Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY );
// DNDEventDispatcher does not hold a reference of the DropTarget,
// so it's ok if it does not support XComponent
@@ -8086,7 +8082,7 @@ void Window::SetText( const XubString& rStr )
// name change.
if ( IsReallyVisible() )
{
- Window* pWindow = GetLabelFor();
+ Window* pWindow = GetAccessibleRelationLabelFor();
if ( pWindow && pWindow != this )
pWindow->ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
}
@@ -8482,7 +8478,7 @@ void Window::ImplStartDnd()
// -----------------------------------------------------------------------
-Reference< XDropTarget > Window::GetDropTarget()
+uno::Reference< XDropTarget > Window::GetDropTarget()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8495,7 +8491,7 @@ Reference< XDropTarget > Window::GetDropTarget()
if( ! mpWindowImpl->mpFrameData->mxDropTarget.is() )
{
// initialization is done in GetDragSource
- Reference< XDragSource > xDragSource = GetDragSource();
+ uno::Reference< XDragSource > xDragSource = GetDragSource();
}
if( mpWindowImpl->mpFrameData->mxDropTarget.is() )
@@ -8511,13 +8507,13 @@ Reference< XDropTarget > Window::GetDropTarget()
mpWindowImpl->mpFrameData->mxDropTarget->addDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener );
// register also as drag gesture listener if directly supported by drag source
- Reference< XDragGestureRecognizer > xDragGestureRecognizer =
- Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
+ uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer =
+ uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY);
if( xDragGestureRecognizer.is() )
{
xDragGestureRecognizer->addDragGestureListener(
- Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
+ uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY));
}
else
mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True;
@@ -8539,12 +8535,12 @@ Reference< XDropTarget > Window::GetDropTarget()
}
// this object is located in the same process, so there will be no runtime exception
- return Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
+ return uno::Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY );
}
// -----------------------------------------------------------------------
-Reference< XDragSource > Window::GetDragSource()
+uno::Reference< XDragSource > Window::GetDragSource()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8554,7 +8550,7 @@ Reference< XDragSource > Window::GetDragSource()
{
try
{
- Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
if ( xFactory.is() )
{
const SystemEnvData * pEnvData = GetSystemData();
@@ -8588,10 +8584,10 @@ Reference< XDragSource > Window::GetDragSource()
aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
if( aDragSourceSN.getLength() )
- mpWindowImpl->mpFrameData->mxDragSource = Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
if( aDropTargetSN.getLength() )
- mpWindowImpl->mpFrameData->mxDropTarget = Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
}
}
}
@@ -8608,12 +8604,12 @@ Reference< XDragSource > Window::GetDragSource()
return mpWindowImpl->mpFrameData->mxDragSource;
}
- return Reference< XDragSource > ();
+ return uno::Reference< XDragSource > ();
}
// -----------------------------------------------------------------------
-void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Reference< XDropTarget > &xDropTarget )
+void Window::GetDragSourceDropTarget(uno::Reference< XDragSource >& xDragSource, uno::Reference< XDropTarget > &xDropTarget )
// only for RVP transmission
{
if( mpWindowImpl->mpFrameData )
@@ -8631,14 +8627,14 @@ void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Refe
// -----------------------------------------------------------------------
-Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
+uno::Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer()
{
- return Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
+ return uno::Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY );
}
// -----------------------------------------------------------------------
-Reference< XClipboard > Window::GetClipboard()
+uno::Reference< XClipboard > Window::GetClipboard()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8648,19 +8644,19 @@ Reference< XClipboard > Window::GetClipboard()
{
try
{
- Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
- mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboardExt" ) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboardExt" ) ), UNO_QUERY );
if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
- mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY );
#if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized
if( mpWindowImpl->mpFrameData->mxClipboard.is() )
{
- Reference< XInitialization > xInit = Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
+ uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
if( xInit.is() )
{
@@ -8692,7 +8688,7 @@ Reference< XClipboard > Window::GetClipboard()
// -----------------------------------------------------------------------
-Reference< XClipboard > Window::GetPrimarySelection()
+uno::Reference< XClipboard > Window::GetPrimarySelection()
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -8702,7 +8698,7 @@ Reference< XClipboard > Window::GetPrimarySelection()
{
try
{
- Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+ uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
if( xFactory.is() )
{
@@ -8712,16 +8708,16 @@ Reference< XClipboard > Window::GetPrimarySelection()
aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "PRIMARY" ) );
aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
- mpWindowImpl->mpFrameData->mxSelection = Reference< XClipboard >( xFactory->createInstanceWithArguments(
+ mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ), aArgumentList ), UNO_QUERY );
# else
- static Reference< XClipboard > s_xSelection;
+ static uno::Reference< XClipboard > s_xSelection;
if ( !s_xSelection.is() )
- s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboardExt" ) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboardExt" ) ), UNO_QUERY );
if ( !s_xSelection.is() )
- s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboard" ) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboard" ) ), UNO_QUERY );
mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif
@@ -9134,6 +9130,7 @@ sal_uInt16 Window::GetAccessibleRole() const
case WINDOW_HELPTEXTWINDOW: nRole = accessibility::AccessibleRole::TOOL_TIP; break;
+ case WINDOW_RULER: nRole = accessibility::AccessibleRole::RULER; break;
case WINDOW_WINDOW:
case WINDOW_CONTROL:
case WINDOW_BORDERWINDOW:
@@ -9160,7 +9157,7 @@ void Window::SetAccessibleName( const String& rName )
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
- DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName, "AccessibleName already set!" );
+ DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName || !rName.Len(), "AccessibleName already set!" );
delete mpWindowImpl->mpAccessibleInfos->pAccessibleName;
mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( rName );
}
@@ -9201,9 +9198,9 @@ String Window::GetAccessibleName() const
case WINDOW_LISTBOX:
case WINDOW_MULTILISTBOX:
case WINDOW_TREELISTBOX:
-
+ case WINDOW_METRICBOX:
{
- Window *pLabel = GetLabeledBy();
+ Window *pLabel = GetAccessibleRelationLabeledBy();
if ( pLabel && pLabel != this )
aAccessibleName = pLabel->GetText();
}
@@ -9262,6 +9259,27 @@ String Window::GetAccessibleDescription() const
return aAccessibleDescription;
}
+void Window::SetAccessibleRelationLabeledBy( Window* pLabeledBy )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pLabeledByWindow = pLabeledBy;
+}
+
+void Window::SetAccessibleRelationLabelFor( Window* pLabelFor )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor;
+}
+
+void Window::SetAccessibleRelationMemberOf( Window* pMemberOfWin )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pMemberOfWindow = pMemberOfWin;
+}
+
sal_Bool Window::IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath )
{
if( !bTraverseParentPath )
@@ -9280,6 +9298,11 @@ sal_Bool Window::IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath )
}
}
+void Window::SetAccessibilityEventsSuppressed(sal_Bool bSuppressed)
+{
+ mpWindowImpl->mbSuppressAccessibilityEvents = bSuppressed;
+}
+
void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect )
{
if( ! mpOutDevData )
@@ -9546,7 +9569,7 @@ sal_Bool Window::IsTopWindow() const
{
// #113722#, cache result of expensive queryInterface call
Window *pThisWin = (Window*)this;
- Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
+ uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY );
pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0;
}
return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? sal_True : sal_False;
@@ -9682,12 +9705,12 @@ sal_Bool Window::IsNativeWidgetEnabled() const
#include <salframe.h>
#endif
-Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
+uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize,
bool bFullscreen,
bool bSpriteCanvas ) const
{
// try to retrieve hard reference from weak member
- Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
// canvas still valid? Then we're done.
if( xCanvas.is() )
@@ -9726,23 +9749,23 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi
aArg[ 2 ] = makeAny( ::com::sun::star::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) );
aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ? sal_True : sal_False );
- aArg[ 4 ] = makeAny( Reference< awt::XWindow >(
+ aArg[ 4 ] = makeAny( uno::Reference< awt::XWindow >(
const_cast<Window*>(this)->GetComponentInterface(),
uno::UNO_QUERY ));
- Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
// Create canvas instance with window handle
// =========================================
if ( xFactory.is() )
{
- static ::vcl::DeleteUnoReferenceOnDeinit<XMultiServiceFactory> xStaticCanvasFactory(
- Reference<XMultiServiceFactory>(
+ static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
+ uno::Reference<lang::XMultiServiceFactory>(
xFactory->createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.rendering.CanvasFactory") ) ),
UNO_QUERY ));
- uno::Reference<XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
+ uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get());
if(xCanvasFactory.is())
{
@@ -9789,21 +9812,21 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi
return xCanvas;
}
-Reference< rendering::XCanvas > Window::GetCanvas() const
+uno::Reference< rendering::XCanvas > Window::GetCanvas() const
{
return ImplGetCanvas( Size(), false, false );
}
-Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
+uno::Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const
{
- Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( Size(), false, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
-Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
+uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const
{
- Reference< rendering::XSpriteCanvas > xSpriteCanvas(
+ uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas(
ImplGetCanvas( rFullscreenSize, true, true ), uno::UNO_QUERY );
return xSpriteCanvas;
}
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 36d475b8795b..329e6867206b 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -246,13 +246,15 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const
int n = 0;
GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
#if GTK_CHECK_VERSION(2,20,0)
- n = m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)];
+ n = gdk_screen_get_primary_monitor(pScreen);
#else
static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
(screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
if (sym_gdk_screen_get_primary_monitor)
- n = m_aXineramaScreenIndexMap[sym_gdk_screen_get_primary_monitor( pScreen )];
+ n = sym_gdk_screen_get_primary_monitor( pScreen );
#endif
+ if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() )
+ n = m_aXineramaScreenIndexMap[n];
return n;
}
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 34a7cfcd196b..def25a0bac9d 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -479,30 +479,13 @@ void GtkSalGraphics::ResetClipRegion()
X11SalGraphics::ResetClipRegion();
}
-void GtkSalGraphics::BeginSetClipRegion( sal_uLong nCount )
-{
- m_aClipRegion.SetNull();
- X11SalGraphics::BeginSetClipRegion( nCount );
-}
-
-sal_Bool GtkSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- Rectangle aRect( Point( nX, nY ), Size( nWidth, nHeight ) );
- m_aClipRegion.Union( aRect );
- return X11SalGraphics::unionClipRegion( nX, nY, nWidth, nHeight );
-}
-
-bool GtkSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void GtkSalGraphics::EndSetClipRegion()
+bool GtkSalGraphics::setClipRegion( const Region& i_rClip )
{
+ m_aClipRegion = i_rClip;
+ bool bRet = X11SalGraphics::setClipRegion( m_aClipRegion );
if( m_aClipRegion.IsEmpty() )
m_aClipRegion.SetNull();
- X11SalGraphics::EndSetClipRegion();
+ return bRet;
}
void GtkSalGraphics::copyBits( const SalTwoRect* pPosAry,
diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx
index 95ce1bb45a1d..a460bb271198 100644
--- a/vcl/unx/headless/svpgdi.cxx
+++ b/vcl/unx/headless/svpgdi.cxx
@@ -29,6 +29,7 @@
#include "svpbmp.hxx"
#include <vcl/sysdata.hxx>
+#include <vcl/region.h>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2irange.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -152,11 +153,16 @@ void SvpSalGraphics::ResetClipRegion()
m_aClipMap.reset();
}
-void SvpSalGraphics::BeginSetClipRegion( sal_uLong n )
+bool SvpSalGraphics::setClipRegion( const Region& i_rClip )
{
- if( n <= 1 )
+ if( i_rClip.IsEmpty() )
+ m_aClipMap.reset();
+ else if( i_rClip.GetRectCount() == 1 )
{
m_aClipMap.reset();
+ Rectangle aBoundRect( i_rClip.GetBoundRect() );
+ m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
+ basegfx::B2IRange(aBoundRect.Left(),aBoundRect.Top(),aBoundRect.Right(),aBoundRect.Bottom()) );
}
else
{
@@ -164,34 +170,22 @@ void SvpSalGraphics::BeginSetClipRegion( sal_uLong n )
B2IVector aSize = m_aDevice->getSize();
m_aClipMap = createBitmapDevice( aSize, false, Format::ONE_BIT_MSB_GREY );
m_aClipMap->clear( basebmp::Color(0xFFFFFFFF) );
- }
-}
-sal_Bool SvpSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if( m_aClipMap )
- {
- B2DPolyPolygon aFull;
- aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ) );
- m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT );
- }
- else
- {
- m_aDevice = basebmp::subsetBitmapDevice( m_aOrigDevice,
- basegfx::B2IRange(nX,nY,nX+nWidth,nY+nHeight) );
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ B2DPolyPolygon aFull;
+ aFull.append( tools::createPolygonFromRect( B2DRectangle( nX, nY, nX+nW, nY+nH ) ) );
+ m_aClipMap->fillPolyPolygon( aFull, basebmp::Color(0), DrawMode_PAINT );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
}
-
- return sal_True;
-}
-
-bool SvpSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void SvpSalGraphics::EndSetClipRegion()
-{
+ return true;
}
void SvpSalGraphics::SetLineColor()
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index a7486a55198f..9e4971528033 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -68,10 +68,7 @@ public:
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( sal_uLong nCount );
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 6fdc8aac75d0..13c5469ed028 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -43,6 +43,7 @@
#include "vcl/svapp.hxx"
#include "vcl/salprn.hxx"
#include "vcl/sysdata.hxx"
+#include "vcl/region.h"
#include "basegfx/vector/b2ivector.hxx"
#include "basegfx/point/b2ipoint.hxx"
@@ -216,28 +217,27 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion ();
+ m_pPrinterGfx->ResetClipRegion();
}
-void PspGraphics::BeginSetClipRegion( sal_uLong n )
+bool PspGraphics::setClipRegion( const Region& i_rClip )
{
- m_pPrinterGfx->BeginSetClipRegion(n);
-}
-
-sal_Bool PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
-{
- return (sal_Bool)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY);
-}
+ // TODO: support polygonal clipregions here
+ m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
-bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void PspGraphics::EndSetClipRegion()
-{
- m_pPrinterGfx->EndSetClipRegion ();
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ m_pPrinterGfx->EndSetClipRegion();
+ return true;
}
void PspGraphics::SetLineColor()
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index fe9352c1fd8b..729116fcc1d2 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -90,10 +90,7 @@ public:
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( sal_uLong nCount );
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx
index ebe2cae90803..6e6cf13575ed 100644
--- a/vcl/unx/inc/dtint.hxx
+++ b/vcl/unx/inc/dtint.hxx
@@ -31,12 +31,12 @@
#include <tools/string.hxx>
#include <tools/color.hxx>
#include <vcl/font.hxx>
+#include "svunx.h"
class SalBitmap;
class SalDisplay;
class AllSettings;
-
enum DtType {
DtGeneric,
DtCDE
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 0b4439e6881f..57a639f8ad5b 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -78,11 +78,8 @@ public:
//helper methods for frame's UpdateSettings
void updateSettings( AllSettings& rSettings );
+ virtual bool setClipRegion( const Region& );
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( sal_uLong nCount );
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
// some themes set the background pixmap of our window EVERY time
// a control is painted; but presentation effects need
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 143c628eb178..7d9a2b8a3d0e 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -87,10 +87,7 @@ public:
virtual long GetGraphicsWidth() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( sal_uIntPtr nCount );
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index c40a85741c5d..2cf3190590f3 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -90,7 +90,7 @@ protected:
CairoFontsCache m_aCairoFontsCache;
XLIB_Region pPaintRegion_;
- XLIB_Region pClipRegion_;
+ XLIB_Region mpClipRegion;
GC pPenGC_; // Pen attributes
SalColor nPenColor_;
@@ -133,6 +133,7 @@ protected:
bool bXORMode_ : 1; // is ROP XOR Mode set
sal_Bool bDitherBrush_ : 1; // is solid or tile
+ using SalGraphics::SetClipRegion;
void SetClipRegion( GC pGC,
XLIB_Region pXReg = NULL ) const;
@@ -228,10 +229,7 @@ public:
virtual long GetGraphicsHeight() const;
virtual void ResetClipRegion();
- virtual void BeginSetClipRegion( sal_uIntPtr nCount );
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
- virtual void EndSetClipRegion();
+ virtual bool setClipRegion( const Region& );
virtual void SetLineColor();
virtual void SetLineColor( SalColor nSalColor );
diff --git a/vcl/unx/source/dtrans/X11_clipboard.hxx b/vcl/unx/source/dtrans/X11_clipboard.hxx
index 21bf547a9cb7..2c0ee2d95c0d 100644
--- a/vcl/unx/source/dtrans/X11_clipboard.hxx
+++ b/vcl/unx/source/dtrans/X11_clipboard.hxx
@@ -54,12 +54,12 @@ namespace x11 {
>,
public SelectionAdaptor
{
- Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
- Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
SelectionManager& m_rSelectionManager;
- Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager;
- ::std::list< Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
+ com::sun::star::uno::Reference< ::com::sun::star::lang::XInitialization > m_xSelectionManager;
+ ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
Atom m_aSelection;
protected:
@@ -100,12 +100,12 @@ namespace x11 {
* XClipboard
*/
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
throw(RuntimeException);
virtual void SAL_CALL setContents(
- const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw(RuntimeException);
virtual ::rtl::OUString SAL_CALL getName()
@@ -122,27 +122,27 @@ namespace x11 {
* XClipboardNotifier
*/
virtual void SAL_CALL addClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
virtual void SAL_CALL removeClipboardListener(
- const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw(RuntimeException);
/*
* SelectionAdaptor
*/
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable();
virtual void clearTransferable();
virtual void fireContentsChanged();
- virtual Reference< XInterface > getReference() throw();
+ virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
};
// ------------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL X11Clipboard_getSupportedServiceNames();
- Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
- const Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
+ com::sun::star::uno::Reference< XInterface > SAL_CALL X11Clipboard_createInstance(
+ const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMultiServiceFactory);
// ------------------------------------------------------------------------
diff --git a/vcl/unx/source/dtrans/X11_dndcontext.hxx b/vcl/unx/source/dtrans/X11_dndcontext.hxx
index 9b48d346f03b..d8ef87444a7a 100644
--- a/vcl/unx/source/dtrans/X11_dndcontext.hxx
+++ b/vcl/unx/source/dtrans/X11_dndcontext.hxx
@@ -51,7 +51,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DropTargetDropContext();
@@ -70,7 +70,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DropTargetDragContext();
@@ -88,7 +88,7 @@ namespace x11 {
XLIB_Window m_aDropWindow;
XLIB_Time m_nTimestamp;
SelectionManager& m_rManager;
- Reference< XInterface > m_xManagerRef;
+ com::sun::star::uno::Reference< XInterface > m_xManagerRef;
public:
DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& );
virtual ~DragSourceContext();
diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx
index 403ee9707a94..8188f2b1164a 100644
--- a/vcl/unx/source/dtrans/X11_selection.cxx
+++ b/vcl/unx/source/dtrans/X11_selection.cxx
@@ -80,6 +80,12 @@
EnterWindowMask |\
LeaveWindowMask
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace com::sun::star::datatransfer;
using namespace com::sun::star::datatransfer::dnd;
using namespace com::sun::star::lang;
@@ -279,7 +285,8 @@ SelectionManager::SelectionManager() :
m_nXdndActionMove( None ),
m_nXdndActionLink( None ),
m_nXdndActionAsk( None ),
- m_nXdndActionPrivate( None )
+ m_nXdndActionPrivate( None ),
+ m_bShutDown( false )
{
m_aDropEnterEvent.data.l[0] = None;
m_aDragRunning.reset();
@@ -632,7 +639,7 @@ OString SelectionManager::convertToCompound( const OUString& rText )
// ------------------------------------------------------------------------
bool SelectionManager::convertData(
- const Reference< XTransferable >& xTransferable,
+ const css::uno::Reference< XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int& rFormat,
@@ -1527,7 +1534,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor,
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "trying bitmap conversion\n" );
#endif
- Reference<XBitmap> xBM( new BmpTransporter( aData ) );
+ css::uno::Reference<XBitmap> xBM( new BmpTransporter( aData ) );
Sequence<Any> aArgs(2), aOutArgs;
Sequence<sal_Int16> aOutIndex;
aArgs.getArray()[0] = makeAny( xBM );
@@ -1674,7 +1681,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
if( pAdaptor &&
XGetSelectionOwner( m_pDisplay, rRequest.selection ) == m_aWindow )
{
- Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
+ css::uno::Reference< XTransferable > xTrans( pAdaptor->getTransferable() );
if( rRequest.target == m_nTARGETSAtom )
{
// someone requests our types
@@ -1843,7 +1850,7 @@ bool SelectionManager::handleSelectionRequest( XSelectionRequestEvent& rRequest
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
}
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
if( xListener.is() )
@@ -2364,7 +2371,7 @@ void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow,
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = getUserDragAction();
dsde.DropSuccess = bSuccess;
- Reference< XDragSourceListener > xListener = m_xDragSourceListener;
+ css::uno::Reference< XDragSourceListener > xListener = m_xDragSourceListener;
m_xDragSourceListener.clear();
aGuard.clear();
@@ -2448,7 +2455,7 @@ void SelectionManager::sendDragStatus( Atom nDropAction )
dsde.DropAction = m_nSourceActions;
dsde.UserAction = getUserDragAction();
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
// caution: do not change anything after this
aGuard.clear();
if( xListener.is() )
@@ -2710,7 +2717,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = m_nTargetAcceptAction;
dsde.DropSuccess = m_bDropSuccess;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2776,7 +2783,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -2902,7 +2909,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
m_nDropTimeout = time( NULL );
// HACK :-)
aGuard.clear();
- static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
+ static_cast< X11Clipboard* >( pAdaptor )->setContents( m_xDragSourceTransferable, css::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >() );
aGuard.reset();
bCancel = false;
}
@@ -2917,7 +2924,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -3071,7 +3078,7 @@ void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot )
{
ResettableMutexGuard aGuard( m_aMutex );
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_nLastDragX = nX;
m_nLastDragY = nY;
@@ -3231,8 +3238,8 @@ void SelectionManager::startDrag(
sal_Int8 sourceActions,
sal_Int32,
sal_Int32,
- const Reference< XTransferable >& transferable,
- const Reference< XDragSourceListener >& listener
+ const css::uno::Reference< XTransferable >& transferable,
+ const css::uno::Reference< XDragSourceListener >& listener
) throw()
{
#if OSL_DEBUG_LEVEL > 1
@@ -3516,8 +3523,8 @@ void SelectionManager::dragDoDispatch()
{
ClearableMutexGuard aGuard(m_aMutex);
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
- Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XTransferable > xTransferable( m_xDragSourceTransferable );
m_xDragSourceListener.clear();
m_xDragSourceTransferable.clear();
@@ -3787,10 +3794,10 @@ void SelectionManager::run( void* pThis )
timeval aLast;
gettimeofday( &aLast, 0 );
- Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
+ css::uno::Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
if( xFact.is() )
{
- Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), UNO_QUERY );
+ css::uno::Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), UNO_QUERY );
if( xDesktop.is() )
xDesktop->addTerminateListener(This);
}
@@ -3805,7 +3812,7 @@ void SelectionManager::run( void* pThis )
if( (aNow.tv_sec - aLast.tv_sec) > 0 )
{
ClearableMutexGuard aGuard(This->m_aMutex);
- std::list< std::pair< SelectionAdaptor*, Reference< XInterface > > > aChangeList;
+ std::list< std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > > > aChangeList;
for( std::hash_map< Atom, Selection* >::iterator it = This->m_aSelections.begin(); it != This->m_aSelections.end(); ++it )
{
@@ -3815,7 +3822,7 @@ void SelectionManager::run( void* pThis )
if( aOwner != it->second->m_aLastOwner )
{
it->second->m_aLastOwner = aOwner;
- std::pair< SelectionAdaptor*, Reference< XInterface > >
+ std::pair< SelectionAdaptor*, css::uno::Reference< XInterface > >
aKeep( it->second->m_pAdaptor, it->second->m_pAdaptor->getReference() );
aChangeList.push_back( aKeep );
}
@@ -3838,6 +3845,11 @@ void SelectionManager::run( void* pThis )
void SelectionManager::shutdown() throw()
{
ResettableMutexGuard aGuard(m_aMutex);
+ if( m_bShutDown )
+ {
+ return;
+ }
+ m_bShutDown = true;
// stop dispatching
if( m_aThread )
{
@@ -3927,7 +3939,7 @@ void SAL_CALL SelectionManager::queryTermination( const ::com::sun::star::lang::
void SAL_CALL SelectionManager::notifyTermination( const ::com::sun::star::lang::EventObject& rEvent )
throw( ::com::sun::star::uno::RuntimeException )
{
- Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
+ css::uno::Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY );
if( xDesktop.is() == sal_True )
xDesktop->removeTerminateListener( this );
#if OSL_DEBUG_LEVEL > 1
@@ -4060,7 +4072,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
dsde.DragSource = static_cast< XDragSource* >(this);
dsde.DropAction = DNDConstants::ACTION_NONE;
dsde.DropSuccess = sal_False;
- Reference< XDragSourceListener > xListener( m_xDragSourceListener );
+ css::uno::Reference< XDragSourceListener > xListener( m_xDragSourceListener );
m_xDragSourceListener.clear();
aGuard.clear();
xListener->dragDropEnd( dsde );
@@ -4071,7 +4083,7 @@ void SelectionManager::deregisterDropTarget( XLIB_Window aWindow )
* SelectionAdaptor
*/
-Reference< XTransferable > SelectionManager::getTransferable() throw()
+css::uno::Reference< XTransferable > SelectionManager::getTransferable() throw()
{
return m_xDragSourceTransferable;
}
@@ -4091,9 +4103,9 @@ void SelectionManager::fireContentsChanged() throw()
// ------------------------------------------------------------------------
-Reference< XInterface > SelectionManager::getReference() throw()
+css::uno::Reference< XInterface > SelectionManager::getReference() throw()
{
- return Reference< XInterface >( static_cast<OWeakObject*>(this) );
+ return css::uno::Reference< XInterface >( static_cast<OWeakObject*>(this) );
}
// ------------------------------------------------------------------------
@@ -4124,7 +4136,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) thro
if( arguments.getLength() > 0 )
{
- Reference< XDisplayConnection > xConn;
+ css::uno::Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
if( xConn.is() )
{
@@ -4159,8 +4171,8 @@ sal_Int32 SelectionManagerHolder::getDefaultCursor( sal_Int8 dragAction ) throw(
void SelectionManagerHolder::startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const css::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const css::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw()
{
if( m_xRealDragSource.is() )
diff --git a/vcl/unx/source/dtrans/X11_selection.hxx b/vcl/unx/source/dtrans/X11_selection.hxx
index 47baa1776d1a..34a50819bfed 100644
--- a/vcl/unx/source/dtrans/X11_selection.hxx
+++ b/vcl/unx/source/dtrans/X11_selection.hxx
@@ -66,10 +66,10 @@ namespace x11 {
class SelectionAdaptor
{
public:
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() = 0;
virtual void clearTransferable() = 0;
virtual void fireContentsChanged() = 0;
- virtual Reference< XInterface > getReference() = 0;
+ virtual com::sun::star::uno::Reference< XInterface > getReference() = 0;
// returns a reference that will keep the SelectionAdaptor alive until the
// refernce is released
};
@@ -87,9 +87,9 @@ namespace x11 {
sal_Int8 m_nDefaultActions;
XLIB_Window m_aTargetWindow;
class SelectionManager* m_pSelectionManager;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xSelectionManager;
- ::std::list< Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
+ ::std::list< com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener > >
m_aListeners;
DropTarget();
@@ -105,8 +105,8 @@ namespace x11 {
virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( ::com::sun::star::uno::Exception );
// XDropTarget
- virtual void SAL_CALL addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
- virtual void SAL_CALL removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual void SAL_CALL addDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual void SAL_CALL removeDropTargetListener( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
virtual sal_Bool SAL_CALL isActive() throw();
virtual void SAL_CALL setActive( sal_Bool active ) throw();
virtual sal_Int8 SAL_CALL getDefaultActions() throw();
@@ -127,7 +127,7 @@ namespace x11 {
>
{
::osl::Mutex m_aMutex;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >
m_xRealDragSource;
public:
SelectionManagerHolder();
@@ -148,8 +148,8 @@ namespace x11 {
virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
};
@@ -260,9 +260,9 @@ namespace x11 {
oslThread m_aDragExecuteThread;
::osl::Condition m_aDragRunning;
XLIB_Window m_aWindow;
- Reference< ::com::sun::star::awt::XDisplayConnection >
+ com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection >
m_xDisplayConnection;
- Reference< com::sun::star::script::XInvocation >
+ com::sun::star::uno::Reference< com::sun::star::script::XInvocation >
m_xBitmapConverter;
sal_Int32 m_nSelectionTimeout;
XLIB_Time m_nSelectionTimestamp;
@@ -285,7 +285,7 @@ namespace x11 {
XLIB_Time m_nDropTime;
sal_Int8 m_nLastDropAction;
// XTransferable for Xdnd with foreign drag source
- Reference< ::com::sun::star::datatransfer::XTransferable >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDropTransferable;
int m_nLastX, m_nLastY;
XLIB_Time m_nDropTimestamp;
@@ -303,9 +303,9 @@ namespace x11 {
XLIB_Window m_aDropProxy;
XLIB_Window m_aDragSourceWindow;
// XTransferable for Xdnd when we are drag source
- Reference< ::com::sun::star::datatransfer::XTransferable >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
m_xDragSourceTransferable;
- Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
+ com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >
m_xDragSourceListener;
// root coordinates
int m_nLastDragX, m_nLastDragY;
@@ -383,6 +383,7 @@ namespace x11 {
// since this leads to deadlocks in different Xlib implentations
// (XFree as well as Xsun) use an own mutex instead
::osl::Mutex m_aMutex;
+ bool m_bShutDown;
SelectionManager();
~SelectionManager();
@@ -409,7 +410,7 @@ namespace x11 {
bool getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData );
// returns true if conversion was successful
- bool convertData( const Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
+ bool convertData( const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable,
Atom nType,
Atom nSelection,
int & rFormat,
@@ -494,15 +495,15 @@ namespace x11 {
virtual void SAL_CALL startDrag(
const ::com::sun::star::datatransfer::dnd::DragGestureEvent& trigger,
sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
- const Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
- const Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable,
+ const com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener >& listener
) throw();
// SelectionAdaptor for XdndSelection Drag (we are drag source)
- virtual Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
+ virtual com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > getTransferable() throw();
virtual void clearTransferable() throw();
virtual void fireContentsChanged() throw();
- virtual Reference< XInterface > getReference() throw();
+ virtual com::sun::star::uno::Reference< XInterface > getReference() throw();
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/vcl/unx/source/dtrans/X11_service.cxx b/vcl/unx/source/dtrans/X11_service.cxx
index e14d81643553..d15518c0b9ab 100644
--- a/vcl/unx/source/dtrans/X11_service.cxx
+++ b/vcl/unx/source/dtrans/X11_service.cxx
@@ -39,6 +39,12 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/compbase1.hxx>
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace rtl;
using namespace cppu;
using namespace com::sun::star::lang;
@@ -69,9 +75,9 @@ Sequence< OUString > SAL_CALL x11::Xdnd_dropTarget_getSupportedServiceNames()
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
+css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >& arguments )
{
- static std::hash_map< OUString, ::std::hash_map< Atom, Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
+ static std::hash_map< OUString, ::std::hash_map< Atom, css::uno::Reference< XClipboard > >, ::rtl::OUStringHash > m_aInstances;
OUString aDisplayName;
Atom nSelection;
@@ -80,7 +86,7 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
// by SelectionManager.initialize() if no display connection is given.
if( arguments.getLength() > 0 )
{
- Reference< XDisplayConnection > xConn;
+ css::uno::Reference< XDisplayConnection > xConn;
arguments.getConstArray()[0] >>= xConn;
if( xConn.is() )
@@ -107,8 +113,8 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
nSelection = rManager.getAtom( OUString::createFromAscii( "CLIPBOARD" ) );
}
- ::std::hash_map< Atom, Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] );
- ::std::hash_map< Atom, Reference< XClipboard > >::iterator it = rMap.find( nSelection );
+ ::std::hash_map< Atom, css::uno::Reference< XClipboard > >& rMap( m_aInstances[ aDisplayName ] );
+ ::std::hash_map< Atom, css::uno::Reference< XClipboard > >::iterator it = rMap.find( nSelection );
if( it != rMap.end() )
return it->second;
@@ -120,16 +126,16 @@ Reference< XInterface > X11SalInstance::CreateClipboard( const Sequence< Any >&
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateDragSource()
+css::uno::Reference< XInterface > X11SalInstance::CreateDragSource()
{
- return Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
+ return css::uno::Reference < XInterface >( ( OWeakObject * ) new SelectionManagerHolder() );
}
// ------------------------------------------------------------------------
-Reference< XInterface > X11SalInstance::CreateDropTarget()
+css::uno::Reference< XInterface > X11SalInstance::CreateDropTarget()
{
- return Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
+ return css::uno::Reference < XInterface >( ( OWeakObject * ) new DropTarget() );
}
diff --git a/vcl/unx/source/dtrans/X11_transferable.hxx b/vcl/unx/source/dtrans/X11_transferable.hxx
index 57f0d6682cab..65f7d1fdc475 100644
--- a/vcl/unx/source/dtrans/X11_transferable.hxx
+++ b/vcl/unx/source/dtrans/X11_transferable.hxx
@@ -44,10 +44,10 @@ namespace x11 {
::osl::Mutex m_aMutex;
SelectionManager& m_rManager;
- Reference< XInterface > m_xCreator;
+ com::sun::star::uno::Reference< XInterface > m_xCreator;
Atom m_aSelection;
public:
- X11Transferable( SelectionManager& rManager, const Reference< XInterface >& xCreator, Atom selection = None );
+ X11Transferable( SelectionManager& rManager, const com::sun::star::uno::Reference< XInterface >& xCreator, Atom selection = None );
virtual ~X11Transferable();
/*
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index 21183dc567ec..d72692b86a65 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -87,6 +87,12 @@
#define PRINTER_METRICDIR "fontmetric"
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
using namespace vcl;
using namespace utl;
using namespace psp;
@@ -3942,10 +3948,10 @@ bool PrintFontManager::readOverrideMetrics()
if( ! m_aOverrideFonts.empty() )
return false;
- Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
+ css::uno::Reference< XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory() );
if( !xFact.is() )
return false;
- Reference< XMaterialHolder > xMat(
+ css::uno::Reference< XMaterialHolder > xMat(
xFact->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.psprint.CompatMetricOverride" ) ) ),
UNO_QUERY );
if( !xMat.is() )
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 0edf2326b58d..f9a156c841fc 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -41,6 +41,7 @@
#include "vcl/svapp.hxx"
#include "vcl/salprn.hxx"
#include "vcl/sysdata.hxx"
+#include "vcl/region.h"
#include <stdlib.h>
#include <unistd.h>
@@ -290,28 +291,27 @@ long PspGraphics::GetGraphicsWidth() const
void PspGraphics::ResetClipRegion()
{
- m_pPrinterGfx->ResetClipRegion ();
+ m_pPrinterGfx->ResetClipRegion();
}
-void PspGraphics::BeginSetClipRegion( sal_uLong n )
+bool PspGraphics::setClipRegion( const Region& i_rClip )
{
- m_pPrinterGfx->BeginSetClipRegion(n);
-}
-
-sal_Bool PspGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
-{
- return (sal_Bool)m_pPrinterGfx->UnionClipRegion (nX, nY, nDX, nDY);
-}
+ // TODO: support polygonal clipregions here
+ m_pPrinterGfx->BeginSetClipRegion( i_rClip.GetRectCount() );
-bool PspGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
-
-void PspGraphics::EndSetClipRegion()
-{
- m_pPrinterGfx->EndSetClipRegion ();
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ m_pPrinterGfx->UnionClipRegion( nX, nY, nW, nH );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ m_pPrinterGfx->EndSetClipRegion();
+ return true;
}
void PspGraphics::SetLineColor()
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 979e3927024a..dc1ec968d859 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -40,6 +40,7 @@
#include "vcl/printergfx.hxx"
#include "vcl/jobdata.hxx"
+#include "vcl/region.h"
#include "tools/debug.hxx"
@@ -104,7 +105,7 @@ X11SalGraphics::X11SalGraphics()
m_aRenderPicture = 0;
m_pRenderFormat = NULL;
- pClipRegion_ = NULL;
+ mpClipRegion = NULL;
pPaintRegion_ = NULL;
pPenGC_ = NULL;
@@ -167,7 +168,7 @@ void X11SalGraphics::freeResources()
Display *pDisplay = GetXDisplay();
DBG_ASSERT( !pPaintRegion_, "pPaintRegion_" );
- if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ), pClipRegion_ = None;
+ if( mpClipRegion ) XDestroyRegion( mpClipRegion ), mpClipRegion = None;
if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None;
if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None;
@@ -257,8 +258,8 @@ void X11SalGraphics::SetClipRegion( GC pGC, XLIB_Region pXReg ) const
int n = 0;
XLIB_Region Regions[3];
- if( pClipRegion_ /* && !XEmptyRegion( pClipRegion_ ) */ )
- Regions[n++] = pClipRegion_;
+ if( mpClipRegion /* && !XEmptyRegion( mpClipRegion ) */ )
+ Regions[n++] = mpClipRegion;
// if( pPaintRegion_ /* && !XEmptyRegion( pPaintRegion_ ) */ )
// Regions[n++] = pPaintRegion_;
@@ -571,7 +572,7 @@ long X11SalGraphics::GetGraphicsHeight() const
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void X11SalGraphics::ResetClipRegion()
{
- if( pClipRegion_ )
+ if( mpClipRegion )
{
bPenGC_ = sal_False;
bFontGC_ = sal_False;
@@ -583,46 +584,36 @@ void X11SalGraphics::ResetClipRegion()
bStippleGC_ = sal_False;
bTrackingGC_ = sal_False;
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = NULL;
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = NULL;
}
}
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::BeginSetClipRegion( sal_uLong )
-{
- if( pClipRegion_ )
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = XCreateRegion();
-}
-
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
+bool X11SalGraphics::setClipRegion( const Region& i_rClip )
{
- if (!nDX || !nDY)
- return sal_True;
-
- XRectangle aRect;
- aRect.x = (short)nX;
- aRect.y = (short)nY;
- aRect.width = (unsigned short)nDX;
- aRect.height = (unsigned short)nDY;
-
- XUnionRectWithRegion( &aRect, pClipRegion_, pClipRegion_ );
-
- return sal_True;
-}
+ if( mpClipRegion )
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = XCreateRegion();
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ XRectangle aRect;
+ aRect.x = (short)nX;
+ aRect.y = (short)nY;
+ aRect.width = (unsigned short)nW;
+ aRect.height = (unsigned short)nH;
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::EndSetClipRegion()
-{
+ // done, invalidate GCs
bPenGC_ = sal_False;
bFontGC_ = sal_False;
bBrushGC_ = sal_False;
@@ -633,11 +624,12 @@ void X11SalGraphics::EndSetClipRegion()
bStippleGC_ = sal_False;
bTrackingGC_ = sal_False;
- if( XEmptyRegion( pClipRegion_ ) )
+ if( XEmptyRegion( mpClipRegion ) )
{
- XDestroyRegion( pClipRegion_ );
- pClipRegion_= NULL;
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion= NULL;
}
+ return true;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -1047,8 +1039,8 @@ XID X11SalGraphics::GetXRenderPicture()
#if 0
// setup clipping so the callers don't have to do it themselves
// TODO: avoid clipping if already set correctly
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
else
#endif
{
@@ -1185,8 +1177,8 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr
// set clipping
// TODO: move into GetXRenderPicture?
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
// render the trapezoids
const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx
index 018f7514dfeb..624360b21d29 100644
--- a/vcl/unx/source/gdi/salgdi2.cxx
+++ b/vcl/unx/source/gdi/salgdi2.cxx
@@ -308,8 +308,8 @@ int X11SalGraphics::Clip( int &nX,
&& RectangleOut == Clip( pPaintRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
- if( pClipRegion_
- && RectangleOut == Clip( pClipRegion_, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
+ if( mpClipRegion
+ && RectangleOut == Clip( mpClipRegion, nX, nY, nDX, nDY, nSrcX, nSrcY ) )
return RectangleOut;
int nPaint;
@@ -323,9 +323,9 @@ int X11SalGraphics::Clip( int &nX,
nPaint = RectangleIn;
int nClip;
- if( pClipRegion_ )
+ if( mpClipRegion )
{
- nClip = XRectInRegion( pClipRegion_, nX, nY, nDX, nDY );
+ nClip = XRectInRegion( mpClipRegion, nX, nY, nDX, nDY );
if( RectangleOut == nClip )
return RectangleOut;
}
@@ -888,8 +888,8 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
return false;
// set clipping
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
// paint source * mask over destination picture
rPeer.CompositePicture( PictOpOver, aSrcPic, aAlphaPic, aDstPic,
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index c719b33a1fbf..6684b5664887 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -528,16 +528,16 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions())
rCairo.set_font_options( cr, pOptions);
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- {
- for (long i = 0; i < pClipRegion_->numRects; ++i)
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
{
+ for (long i = 0; i < mpClipRegion->numRects; ++i)
+ {
rCairo.rectangle(cr,
- pClipRegion_->rects[i].x1,
- pClipRegion_->rects[i].y1,
- pClipRegion_->rects[i].x2 - pClipRegion_->rects[i].x1,
- pClipRegion_->rects[i].y2 - pClipRegion_->rects[i].y1);
- }
+ mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y1,
+ mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1,
+ mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1);
+ }
rCairo.clip(cr);
}
@@ -621,8 +621,8 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout )
// set clipping
// TODO: move into GetXRenderPicture()?
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
ServerFont& rFont = rLayout.GetServerFont();
X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
@@ -705,10 +705,10 @@ bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )
else if( m_pVDev )
nWidth = m_pVDev->GetWidth(), nHeight = m_pVDev->GetHeight();
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
{
// get bounding box
- XClipBox( pClipRegion_, &aXRect );
+ XClipBox( mpClipRegion, &aXRect );
// clip with window
if( aXRect.x < 0 ) aXRect.x = 0;
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index f3b50db6a9d9..65a0802e9fe2 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -1188,6 +1188,8 @@ sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJo
aContext.Tagged = false;
aContext.EmbedStandardFonts = true;
aContext.DocumentLocale = Application::GetSettings().GetLocale();
+ aContext.ColorMode = i_rController.getPrinter()->GetPrinterOptions().IsConvertToGreyscales()
+ ? vcl::PDFWriter::DrawGreyscale : vcl::PDFWriter::DrawColor;
// prepare doc info
aContext.DocumentInfo.Title = i_rJobName;
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index 94c4849bb197..70734846f445 100755
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -152,8 +152,6 @@ public:
COLORREF mnTextColor; // TextColor
RGNDATA* mpClipRgnData; // ClipRegion-Data
RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
- RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
- sal_Bool mbFirstClipRect; // Flag for first cliprect to insert
LOGFONTA* mpLogFont; // LOG-Font which is currently selected (only W9x)
ImplFontAttrCache* mpFontAttrCache; // Cache font attributes from files in so/share/fonts
BYTE* mpFontCharSets; // All Charsets for the current font
@@ -183,8 +181,7 @@ public:
virtual ~WinSalGraphics();
protected:
- virtual sal_Bool unionClipRegion( long nX, long nY, long nWidth, long nHeight );
- virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
+ virtual bool setClipRegion( const Region& );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
virtual void drawPixel( long nX, long nY );
virtual void drawPixel( long nX, long nY, SalColor nSalColor );
@@ -256,11 +253,6 @@ public:
// set the clip region to empty
virtual void ResetClipRegion();
- // begin setting the clip region, add rectangles to the
- // region with the UnionClipRegion call
- virtual void BeginSetClipRegion( sal_uIntPtr nCount );
- // all rectangles were added and the clip region should be set now
- virtual void EndSetClipRegion();
// set the line color to transparent (= don't draw lines)
virtual void SetLineColor();
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 8cb52c917b38..62bdb4403c1f 100644..100755
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -37,9 +37,10 @@
#include <tools/debug.hxx>
#include <salframe.h>
#include <tools/poly.hxx>
-#ifndef _RTL_STRINGBUF_HXX
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
#include <rtl/strbuf.hxx>
-#endif
+#include <vcl/region.h>
using namespace rtl;
@@ -849,7 +850,7 @@ void WinSalGraphics::ResetClipRegion()
// -----------------------------------------------------------------------
-void WinSalGraphics::BeginSetClipRegion( sal_uLong nRectCount )
+bool WinSalGraphics::setClipRegion( const Region& i_rClip )
{
if ( mhRegion )
{
@@ -857,123 +858,143 @@ void WinSalGraphics::BeginSetClipRegion( sal_uLong nRectCount )
mhRegion = 0;
}
- sal_uLong nRectBufSize = sizeof(RECT)*nRectCount;
- if ( nRectCount < SAL_CLIPRECT_COUNT )
+ if( i_rClip.HasPolyPolygon() )
{
- if ( !mpStdClipRgnData )
- mpStdClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+(SAL_CLIPRECT_COUNT*sizeof(RECT))];
- mpClipRgnData = mpStdClipRgnData;
+ // TODO: ConvertToB2DPolyPolygon actually is kind of const, just it does not advertise it in the header
+ basegfx::B2DPolyPolygon aPolyPolygon( const_cast<Region&>(i_rClip).ConvertToB2DPolyPolygon() );
+ const sal_uInt32 nCount(aPolyPolygon.count());
+
+ if( nCount )
+ {
+ std::vector< POINT > aPolyPoints;
+ aPolyPoints.reserve( 1024 );
+ std::vector< INT > aPolyCounts( nCount, 0 );
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ basegfx::B2DPolygon aPoly( aPolyPolygon.getB2DPolygon(a) );
+ aPoly = basegfx::tools::adaptiveSubdivideByDistance( aPoly, 1 );
+ const sal_uInt32 nPoints = aPoly.count();
+ aPolyCounts[a] = nPoints;
+ for( sal_uInt32 b = 0; b < nPoints; b++ )
+ {
+ basegfx::B2DPoint aPt( aPoly.getB2DPoint( b ) );
+ POINT aPOINT;
+ aPOINT.x = (LONG)aPt.getX();
+ aPOINT.y = (LONG)aPt.getY();
+ aPolyPoints.push_back( aPOINT );
+ }
+ }
+ mhRegion = CreatePolyPolygonRgn( &aPolyPoints[0], &aPolyCounts[0], nCount, ALTERNATE );
+ }
}
else
- mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
- mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
- mpClipRgnData->rdh.iType = RDH_RECTANGLES;
- mpClipRgnData->rdh.nCount = nRectCount;
- mpClipRgnData->rdh.nRgnSize = nRectBufSize;
- SetRectEmpty( &(mpClipRgnData->rdh.rcBound) );
- mpNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
- mbFirstClipRect = TRUE;
-}
-
-
-// -----------------------------------------------------------------------
-
-sal_Bool WinSalGraphics::unionClipRegion( long nX, long nY, long nWidth, long nHeight )
-{
- if ( nWidth && nHeight )
{
- RECT* pRect = mpNextClipRect;
- RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
- long nRight = nX + nWidth;
- long nBottom = nY + nHeight;
+ ULONG nRectCount = i_rClip.GetRectCount();
- if ( mbFirstClipRect )
+ ULONG nRectBufSize = sizeof(RECT)*nRectCount;
+ if ( nRectCount < SAL_CLIPRECT_COUNT )
{
- pBoundRect->left = nX;
- pBoundRect->top = nY;
- pBoundRect->right = nRight;
- pBoundRect->bottom = nBottom;
- mbFirstClipRect = FALSE;
+ if ( !mpStdClipRgnData )
+ mpStdClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+(SAL_CLIPRECT_COUNT*sizeof(RECT))];
+ mpClipRgnData = mpStdClipRgnData;
}
else
+ mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
+ mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
+ mpClipRgnData->rdh.iType = RDH_RECTANGLES;
+ mpClipRgnData->rdh.nCount = nRectCount;
+ mpClipRgnData->rdh.nRgnSize = nRectBufSize;
+ RECT* pBoundRect = &(mpClipRgnData->rdh.rcBound);
+ SetRectEmpty( pBoundRect );
+ RECT* pNextClipRect = (RECT*)(&(mpClipRgnData->Buffer));
+ bool bFirstClipRect = true;
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
{
- if ( nX < pBoundRect->left )
- pBoundRect->left = (int)nX;
-
- if ( nY < pBoundRect->top )
- pBoundRect->top = (int)nY;
-
- if ( nRight > pBoundRect->right )
- pBoundRect->right = (int)nRight;
-
- if ( nBottom > pBoundRect->bottom )
- pBoundRect->bottom = (int)nBottom;
- }
-
- pRect->left = (int)nX;
- pRect->top = (int)nY;
- pRect->right = (int)nRight;
- pRect->bottom = (int)nBottom;
- mpNextClipRect++;
- }
- else
- {
- mpClipRgnData->rdh.nCount--;
- mpClipRgnData->rdh.nRgnSize -= sizeof( RECT );
- }
-
- return TRUE;
-}
+ if ( nW && nH )
+ {
+ long nRight = nX + nW;
+ long nBottom = nY + nH;
-// -----------------------------------------------------------------------
+ if ( bFirstClipRect )
+ {
+ pBoundRect->left = nX;
+ pBoundRect->top = nY;
+ pBoundRect->right = nRight;
+ pBoundRect->bottom = nBottom;
+ bFirstClipRect = false;
+ }
+ else
+ {
+ if ( nX < pBoundRect->left )
+ pBoundRect->left = (int)nX;
-bool WinSalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ if ( nY < pBoundRect->top )
+ pBoundRect->top = (int)nY;
-// -----------------------------------------------------------------------
+ if ( nRight > pBoundRect->right )
+ pBoundRect->right = (int)nRight;
-void WinSalGraphics::EndSetClipRegion()
-{
- // create clip region from ClipRgnData
- if ( mpClipRgnData->rdh.nCount == 1 )
- {
- RECT* pRect = &(mpClipRgnData->rdh.rcBound);
- mhRegion = CreateRectRgn( pRect->left, pRect->top,
- pRect->right, pRect->bottom );
- }
- else
- {
- sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
- mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
+ if ( nBottom > pBoundRect->bottom )
+ pBoundRect->bottom = (int)nBottom;
+ }
- // if ExtCreateRegion(...) is not supported
- if( !mhRegion )
+ pNextClipRect->left = (int)nX;
+ pNextClipRect->top = (int)nY;
+ pNextClipRect->right = (int)nRight;
+ pNextClipRect->bottom = (int)nBottom;
+ pNextClipRect++;
+ }
+ else
+ {
+ mpClipRgnData->rdh.nCount--;
+ mpClipRgnData->rdh.nRgnSize -= sizeof( RECT );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
+ // create clip region from ClipRgnData
+ if ( mpClipRgnData->rdh.nCount == 1 )
{
- RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
+ RECT* pRect = &(mpClipRgnData->rdh.rcBound);
+ mhRegion = CreateRectRgn( pRect->left, pRect->top,
+ pRect->right, pRect->bottom );
+ }
+ else if( mpClipRgnData->rdh.nCount > 1 )
+ {
+ ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ mhRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
- if( pHeader->nCount )
+ // if ExtCreateRegion(...) is not supported
+ if( !mhRegion )
{
- RECT* pRect = (RECT*) mpClipRgnData->Buffer;
- mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
- pRect++;
+ RGNDATAHEADER* pHeader = (RGNDATAHEADER*) mpClipRgnData;
- for( sal_uLong n = 1; n < pHeader->nCount; n++, pRect++ )
+ if( pHeader->nCount )
{
- HRGN hRgn = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
- CombineRgn( mhRegion, mhRegion, hRgn, RGN_OR );
- DeleteRegion( hRgn );
+ RECT* pRect = (RECT*) mpClipRgnData->Buffer;
+ mhRegion = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
+ pRect++;
+
+ for( ULONG n = 1; n < pHeader->nCount; n++, pRect++ )
+ {
+ HRGN hRgn = CreateRectRgn( pRect->left, pRect->top, pRect->right, pRect->bottom );
+ CombineRgn( mhRegion, mhRegion, hRgn, RGN_OR );
+ DeleteRegion( hRgn );
+ }
}
}
- }
- if ( mpClipRgnData != mpStdClipRgnData )
- delete [] mpClipRgnData;
+ if ( mpClipRgnData != mpStdClipRgnData )
+ delete [] mpClipRgnData;
+ }
}
- SelectClipRgn( mhDC, mhRegion );
+ if( mhRegion )
+ SelectClipRgn( mhDC, mhRegion );
+ return mhRegion != 0;
}
// -----------------------------------------------------------------------
diff --git a/vcl/win/source/gdi/salgdi2.cxx b/vcl/win/source/gdi/salgdi2.cxx
index f957c59f8a01..dc3368c26912 100644..100755
--- a/vcl/win/source/gdi/salgdi2.cxx
+++ b/vcl/win/source/gdi/salgdi2.cxx
@@ -51,6 +51,9 @@ bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const
case OutDevSupport_TransparentRect:
bRet = mbVirDev || mbWindow;
break;
+ case OutDevSupport_B2DClip:
+ bRet = true;
+ break;
case OutDevSupport_B2DDraw:
bRet = bAllowForTest;
default: break;
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 2c8f81bce364..a235d6785706 100644..100755
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -93,6 +93,7 @@
#endif
+using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::ui::dialogs;
@@ -2084,16 +2085,16 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName,
if( mpInfoPrinter->maPortName.EqualsIgnoreCaseAscii( "FILE:" ) && !(pFileName && pFileName->Len()) )
{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
if( xFactory.is() )
{
- Reference< XFilePicker > xFilePicker( xFactory->createInstance(
+ uno::Reference< XFilePicker > xFilePicker( xFactory->createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ),
UNO_QUERY );
DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
+ uno::Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
+ uno::Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
{
Sequence< Any > aServiceType( 1 );
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index d2baea1a8e90..c1b3a632556e 100755
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -104,6 +104,7 @@ using ::std::max;
#include <time.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::container;
@@ -875,11 +876,11 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
try
{
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
+ uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ uno::Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW );
if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) )
{
- Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
+ uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW );
com::sun::star::awt::Rectangle aRect;
if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect )
{
diff --git a/wizards/prj/build.lst b/wizards/prj/build.lst
index ca4e940d3527..e0d94b1c1e4d 100644
--- a/wizards/prj/build.lst
+++ b/wizards/prj/build.lst
@@ -1,4 +1,4 @@
-wz wizards : l10n rsc javaunohelper unoil LIBXSLT:libxslt NULL
+wz wizards : L10N:l10n rsc javaunohelper unoil LIBXSLT:libxslt NULL
wz wizards\util nmake - all wz_util NULL
wz wizards\source\config nmake - all wz_config NULL
wz wizards\source\configshare nmake - all wz_configshare NULL
diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk
index 9576341f0ffb..0544171dbfbd 100644
--- a/xmloff/Library_xo.mk
+++ b/xmloff/Library_xo.mk
@@ -69,8 +69,10 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
xmloff/source/chart/SchXMLAxisContext \
xmloff/source/chart/SchXMLCalculationSettingsContext \
xmloff/source/chart/SchXMLChartContext \
+ xmloff/source/chart/SchXMLEnumConverter \
xmloff/source/chart/SchXMLExport \
xmloff/source/chart/SchXMLImport \
+ xmloff/source/chart/SchXMLLegendContext \
xmloff/source/chart/SchXMLParagraphContext \
xmloff/source/chart/SchXMLPlotAreaContext \
xmloff/source/chart/SchXMLSeries2Context \
diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx
index 936217fb8dc5..6b11e885f72e 100644
--- a/xmloff/inc/SchXMLImport.hxx
+++ b/xmloff/inc/SchXMLImport.hxx
@@ -127,14 +127,6 @@ enum SchXMLPlotAreaAttrTokenMap
XML_TOK_PA_LIGHTING_MODE
};
-enum SchXMLLegendAttrMap
-{
- XML_TOK_LEGEND_POSITION,
- XML_TOK_LEGEND_X,
- XML_TOK_LEGEND_Y,
- XML_TOK_LEGEND_STYLE_NAME
-};
-
enum SchXMLAutoStyleAttrMap
{
XML_TOK_AS_FAMILY,
diff --git a/xmloff/inc/xmloff/SchXMLImportHelper.hxx b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
index a618d363137f..afc637aead74 100644
--- a/xmloff/inc/xmloff/SchXMLImportHelper.hxx
+++ b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
@@ -83,7 +83,6 @@ private:
SvXMLTokenMap* mpChartAttrTokenMap;
SvXMLTokenMap* mpPlotAreaAttrTokenMap;
- SvXMLTokenMap* mpLegendAttrTokenMap;
SvXMLTokenMap* mpAutoStyleAttrTokenMap;
SvXMLTokenMap* mpCellAttrTokenMap;
SvXMLTokenMap* mpSeriesAttrTokenMap;
@@ -124,7 +123,6 @@ public:
const SvXMLTokenMap& GetChartAttrTokenMap();
const SvXMLTokenMap& GetPlotAreaAttrTokenMap();
- const SvXMLTokenMap& GetLegendAttrTokenMap();
const SvXMLTokenMap& GetAutoStyleAttrTokenMap();
const SvXMLTokenMap& GetCellAttrTokenMap();
const SvXMLTokenMap& GetSeriesAttrTokenMap();
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index ecadbbdc196f..ca321245fdb2 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3113,6 +3113,12 @@ namespace xmloff { namespace token {
XML_OUTSIDE_MINIMUM,//#i114142#
XML_OUTSIDE_MAXIMUM,//#i114142#
+ XML_LEGEND_EXPANSION, //#i28760#
+ XML_LEGEND_EXPANSION_ASPECT_RATIO, //#i28760#
+ XML_BALANCED, //#i28760#
+ XML_HIGH, //#i28760#
+ XML_WIDE, //#i28760#
+
XML_AXIS_TYPE, //#i25706#
XML_DATE_SCALE,
XML_BASE_TIME_UNIT,
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 6b42b2e629df..9f9d1cf2bb1d 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -30,6 +30,7 @@
#include "SchXMLChartContext.hxx"
#include "SchXMLImport.hxx"
+#include "SchXMLLegendContext.hxx"
#include "SchXMLPlotAreaContext.hxx"
#include "SchXMLParagraphContext.hxx"
#include "SchXMLTableContext.hxx"
@@ -52,7 +53,6 @@
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagram.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
-#include <com/sun/star/chart/ChartLegendPosition.hpp>
#include <com/sun/star/util/XStringMapping.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -60,7 +60,6 @@
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
@@ -234,19 +233,6 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const ::rtl::OUStrin
} // anonymous namespace
-static __FAR_DATA SvXMLEnumMapEntry aXMLLegendAlignmentMap[] =
-{
-// { XML_LEFT, chart::ChartLegendPosition_LEFT },
- // #i35421#
- { XML_START, chart::ChartLegendPosition_LEFT },
- { XML_TOP, chart::ChartLegendPosition_TOP },
-// { XML_RIGHT, chart::ChartLegendPosition_RIGHT },
- // #i35421#
- { XML_END, chart::ChartLegendPosition_RIGHT },
- { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
-};
-
// ----------------------------------------
SchXMLChartContext::SchXMLChartContext( SchXMLImportHelper& rImpHelper,
@@ -1273,115 +1259,3 @@ SvXMLImportContext* SchXMLTitleContext::CreateChildContext(
}
// ----------------------------------------
-
-SchXMLLegendContext::SchXMLLegendContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const rtl::OUString& rLocalName ) :
- SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
- mrImportHelper( rImpHelper )
-{
-}
-
-void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
-{
- uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
- if( ! xDoc.is())
- return;
-
- // turn on legend
- uno::Reference< beans::XPropertySet > xDocProp( xDoc, uno::UNO_QUERY );
- if( xDocProp.is())
- {
- uno::Any aTrueBool;
- aTrueBool <<= (sal_Bool)(sal_True);
- try
- {
- xDocProp->setPropertyValue( rtl::OUString::createFromAscii( "HasLegend" ), aTrueBool );
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property HasLegend not found" );
- }
- }
-
- // parse attributes
- sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetLegendAttrTokenMap();
-
- awt::Point aLegendPos;
- bool bHasXPosition=false;
- bool bHasYPosition=false;
-
- rtl::OUString sAutoStyleName;
-
- for( sal_Int16 i = 0; i < nAttrCount; i++ )
- {
- rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
- rtl::OUString aLocalName;
- rtl::OUString aValue = xAttrList->getValueByIndex( i );
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
-
- switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
- {
- case XML_TOK_LEGEND_POSITION:
- {
- // set anchor position
- uno::Reference< beans::XPropertySet > xProp( xDoc->getLegend(), uno::UNO_QUERY );
- if( xProp.is())
- {
- try
- {
- sal_uInt16 nEnumVal;
- if( GetImport().GetMM100UnitConverter().convertEnum( nEnumVal, aValue, aXMLLegendAlignmentMap ))
- {
- uno::Any aAny;
- aAny <<= (chart::ChartLegendPosition)(nEnumVal);
- xProp->setPropertyValue( rtl::OUString::createFromAscii( "Alignment" ), aAny );
- }
- }
- catch( beans::UnknownPropertyException )
- {
- DBG_ERROR( "Property Alignment (legend) not found" );
- }
- }
- }
- break;
-
- case XML_TOK_LEGEND_X:
- GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.X, aValue );
- bHasXPosition = true;
- break;
- case XML_TOK_LEGEND_Y:
- GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.Y, aValue );
- bHasYPosition = true;
- break;
- case XML_TOK_LEGEND_STYLE_NAME:
- sAutoStyleName = aValue;
- }
- }
-
- uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
- if( xLegendShape.is() && bHasXPosition && bHasYPosition )
- xLegendShape->setPosition( aLegendPos );
-
- // set auto-styles for Legend
- uno::Reference< beans::XPropertySet > xProp( xLegendShape, uno::UNO_QUERY );
- if( xProp.is())
- {
- // the fill style has the default "none" in XML, but "solid" in the model.
- xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" )),
- uno::makeAny( drawing::FillStyle_NONE ));
- const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
- if( pStylesCtxt )
- {
- const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
- mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
- }
- }
-}
-
-SchXMLLegendContext::~SchXMLLegendContext()
-{
-}
diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx
index 41f84f783a67..e34b50c4f62d 100644
--- a/xmloff/source/chart/SchXMLChartContext.hxx
+++ b/xmloff/source/chart/SchXMLChartContext.hxx
@@ -171,19 +171,4 @@ public:
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
-// ----------------------------------------
-
-class SchXMLLegendContext : public SvXMLImportContext
-{
-private:
- SchXMLImportHelper& mrImportHelper;
-
-public:
- SchXMLLegendContext( SchXMLImportHelper& rImpHelper,
- SvXMLImport& rImport, const rtl::OUString& rLocalName );
- virtual ~SchXMLLegendContext();
-
- virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
-};
-
#endif // _SCH_XMLCHARTCONTEXT_HXX_
diff --git a/xmloff/source/chart/SchXMLEnumConverter.cxx b/xmloff/source/chart/SchXMLEnumConverter.cxx
new file mode 100755
index 000000000000..fd4d7914a2fe
--- /dev/null
+++ b/xmloff/source/chart/SchXMLEnumConverter.cxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_xmloff.hxx"
+#include "SchXMLEnumConverter.hxx"
+
+#include <com/sun/star/chart/ChartLegendPosition.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
+#include <com/sun/star/uno/Any.hxx>
+
+// header for rtl::Static
+#include <rtl/instance.hxx>
+
+using ::rtl::OUString;
+using namespace ::xmloff::token;
+using namespace ::com::sun::star;
+
+namespace
+{
+//-----------------------------------------------------------------------
+
+SvXMLEnumMapEntry aXMLLegendPositionEnumMap[] =
+{
+ { XML_START, chart::ChartLegendPosition_LEFT },
+ { XML_TOP, chart::ChartLegendPosition_TOP },
+ { XML_END, chart::ChartLegendPosition_RIGHT },
+ { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM },
+ { XML_TOKEN_INVALID, 0 }
+};
+
+class XMLLegendPositionPropertyHdl : public XMLEnumPropertyHdl
+{
+public:
+ XMLLegendPositionPropertyHdl()
+ : XMLEnumPropertyHdl( aXMLLegendPositionEnumMap, ::getCppuType((const chart::ChartLegendPosition*)0) ) {}
+ virtual ~XMLLegendPositionPropertyHdl() {};
+};
+
+struct TheLegendPositionPropertyHdl : public rtl::Static< XMLLegendPositionPropertyHdl, TheLegendPositionPropertyHdl >
+{
+};
+
+//-----------------------------------------------------------------------
+
+SvXMLEnumMapEntry aXMLLegendExpansionEnumMap[] =
+{
+ { XML_WIDE, chart::ChartLegendExpansion_WIDE },
+ { XML_HIGH, chart::ChartLegendExpansion_HIGH },
+ { XML_BALANCED, chart::ChartLegendExpansion_BALANCED },
+ { XML_CUSTOM, chart::ChartLegendExpansion_CUSTOM },
+ { XML_TOKEN_INVALID, 0 }
+};
+
+class XMLLegendExpansionPropertyHdl : public XMLEnumPropertyHdl
+{
+public:
+ XMLLegendExpansionPropertyHdl()
+ : XMLEnumPropertyHdl( aXMLLegendExpansionEnumMap, ::getCppuType((const chart::ChartLegendExpansion*)0) ) {}
+ virtual ~XMLLegendExpansionPropertyHdl() {};
+};
+
+struct TheLegendExpansionPropertyHdl : public rtl::Static< XMLLegendExpansionPropertyHdl, TheLegendExpansionPropertyHdl >
+{
+};
+
+//-----------------------------------------------------------------------
+
+}//end anonymous namespace
+
+//-----------------------------------------------------------------------
+
+XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendPositionConverter()
+{
+ return TheLegendPositionPropertyHdl::get();
+}
+XMLEnumPropertyHdl& SchXMLEnumConverter::getLegendExpansionConverter()
+{
+ return TheLegendExpansionPropertyHdl::get();
+}
diff --git a/sc/source/ui/dbgui/pvglob.hxx b/xmloff/source/chart/SchXMLEnumConverter.hxx
index 6b6526266035..63a9fb7ffb95 100644..100755
--- a/sc/source/ui/dbgui/pvglob.hxx
+++ b/xmloff/source/chart/SchXMLEnumConverter.hxx
@@ -24,19 +24,16 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef _XML_CHART_ENUM_CONVERTER_HXX_
+#define _XML_CHART_ENUM_CONVERTER_HXX_
-#ifndef SC_PVGLOB_HXX
-#define SC_PVGLOB_HXX
+#include <xmloff/EnumPropertyHdl.hxx>
-//-------------------------------------------------------------------
-
-class PivotGlobal
+class SchXMLEnumConverter
{
public:
- static long nObjHeight;
- static long nObjWidth;
- static long nSelSpace;
+ static XMLEnumPropertyHdl& getLegendPositionConverter();//returns a singleton
+ static XMLEnumPropertyHdl& getLegendExpansionConverter();//returns a singleton
};
-
-#endif // SC_PVGLOB_HXX
+#endif // _XML_CHART_ENUM_CONVERTER_HXX_
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index cc13eb2de733..c74abe953d2f 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -35,6 +35,8 @@
#include "SchXMLSeriesHelper.hxx"
#include "ColorPropertySet.hxx"
#include "SchXMLTools.hxx"
+#include "SchXMLEnumConverter.hxx"
+
#include <tools/debug.hxx>
#include <rtl/logfile.hxx>
#include <comphelper/processfactory.hxx>
@@ -68,6 +70,7 @@
#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/ChartLegendExpansion.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/ChartAxisAssign.hpp>
#include <com/sun/star/chart/ChartAxisType.hpp>
@@ -245,8 +248,8 @@ public:
void addPosition( const ::com::sun::star::awt::Point & rPosition );
void addPosition( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
/// add svg size as attribute for current element
- void addSize( const ::com::sun::star::awt::Size & rSize );
- void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
+ void addSize( const ::com::sun::star::awt::Size & rSize, bool bIsOOoNamespace = false );
+ void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape, bool bIsOOoNamespace = false );
/// fills the member msString with the appropriate String (i.e. "A3")
void getCellAddress( sal_Int32 nCol, sal_Int32 nRow );
/// exports a string as a paragraph element
@@ -1427,51 +1430,50 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >&
Reference< beans::XPropertySet > xProp( rChartDoc->getLegend(), uno::UNO_QUERY );
if( xProp.is())
{
- chart::ChartLegendPosition aLegendPos = chart::ChartLegendPosition_NONE;
+ // export legend anchor position
try
{
- Any aAny( xProp->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "Alignment" ))));
- aAny >>= aLegendPos;
+ Any aAny( xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Alignment" ))));
+ if( SchXMLEnumConverter::getLegendPositionConverter().exportXML( msString, aAny, mrExport.GetMM100UnitConverter() ) )
+ mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LEGEND_POSITION, msString );
}
catch( beans::UnknownPropertyException & )
{
DBG_WARNING( "Property Align not found in ChartLegend" );
}
- switch( aLegendPos )
+ // export absolute legend position
+ Reference< drawing::XShape > xLegendShape( xProp, uno::UNO_QUERY );
+ addPosition( xLegendShape );
+
+ // export legend size
+ const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
+ if( xLegendShape.is() && nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 && nCurrentODFVersion == SvtSaveOptions::ODFVER_LATEST )//do not export legend-expansion to ODF 1.0 and export size only if extensions are enabled //#i28670# todo: change this dependent on fileformat evolution
{
- case chart::ChartLegendPosition_LEFT:
-// msString = GetXMLToken(XML_LEFT);
- // #i35421# change left->start (not clear why this was done)
- msString = GetXMLToken(XML_START);
- break;
- case chart::ChartLegendPosition_RIGHT:
-// msString = GetXMLToken(XML_RIGHT);
- // #i35421# change right->end (not clear why this was done)
- msString = GetXMLToken(XML_END);
- break;
- case chart::ChartLegendPosition_TOP:
- msString = GetXMLToken(XML_TOP);
- break;
- case chart::ChartLegendPosition_BOTTOM:
- msString = GetXMLToken(XML_BOTTOM);
- break;
- case chart::ChartLegendPosition_NONE:
- case chart::ChartLegendPosition_MAKE_FIXED_SIZE:
- // nothing
- break;
+ try
+ {
+ chart::ChartLegendExpansion nLegendExpansion = chart::ChartLegendExpansion_HIGH;
+ OUString aExpansionString;
+ Any aAny( xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Expansion" ))));
+ bool bHasExpansion = (aAny >>= nLegendExpansion);
+ if( bHasExpansion && SchXMLEnumConverter::getLegendExpansionConverter().exportXML( aExpansionString, aAny, mrExport.GetMM100UnitConverter() ) )
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION, aExpansionString );
+ if( nLegendExpansion == chart::ChartLegendExpansion_CUSTOM)
+ {
+ awt::Size aSize( xLegendShape->getSize() );
+ addSize( aSize, true );
+ rtl::OUStringBuffer aAspectRatioString;
+ SvXMLUnitConverter::convertDouble(aAspectRatioString, double(aSize.Width)/double(aSize.Height));
+ mrExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION_ASPECT_RATIO, aAspectRatioString.makeStringAndClear() );
+ }
+ }
+ }
+ catch( beans::UnknownPropertyException & )
+ {
+ DBG_WARNING( "Property Expansion not found in ChartLegend" );
+ }
}
-
- // export anchor position
- if( msString.getLength())
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LEGEND_POSITION, msString );
-
- // export absolute position
- msString = OUString();
- Reference< drawing::XShape > xShape( xProp, uno::UNO_QUERY );
- if( xShape.is())
- addPosition( xShape );
}
// write style name
@@ -3535,21 +3537,22 @@ void SchXMLExportHelper_Impl::addPosition( Reference< drawing::XShape > xShape )
addPosition( xShape->getPosition());
}
-void SchXMLExportHelper_Impl::addSize( const awt::Size & rSize )
+void SchXMLExportHelper_Impl::addSize( const awt::Size & rSize, bool bIsOOoNamespace)
{
mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Width );
msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, msString );
+ mrExport.AddAttribute( bIsOOoNamespace ? XML_NAMESPACE_CHART_EXT : XML_NAMESPACE_SVG , XML_WIDTH, msString );
+
- mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Height );
+ mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Height);
msString = msStringBuffer.makeStringAndClear();
- mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, msString );
+ mrExport.AddAttribute( bIsOOoNamespace ? XML_NAMESPACE_CHART_EXT : XML_NAMESPACE_SVG, XML_HEIGHT, msString );
}
-void SchXMLExportHelper_Impl::addSize( Reference< drawing::XShape > xShape )
+void SchXMLExportHelper_Impl::addSize( Reference< drawing::XShape > xShape, bool bIsOOoNamespace )
{
if( xShape.is())
- addSize( xShape->getSize() );
+ addSize( xShape->getSize(), bIsOOoNamespace );
}
awt::Size SchXMLExportHelper_Impl::getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ) const
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index a033dcb60e7d..12bea7e50e1b 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -146,7 +146,6 @@ SchXMLImportHelper::SchXMLImportHelper() :
mpChartAttrTokenMap( 0 ),
mpPlotAreaAttrTokenMap( 0 ),
- mpLegendAttrTokenMap( 0 ),
mpAutoStyleAttrTokenMap( 0 ),
mpCellAttrTokenMap( 0 ),
mpSeriesAttrTokenMap( 0 ),
@@ -172,8 +171,6 @@ SchXMLImportHelper::~SchXMLImportHelper()
delete mpChartAttrTokenMap;
if( mpPlotAreaAttrTokenMap )
delete mpPlotAreaAttrTokenMap;
- if( mpLegendAttrTokenMap )
- delete mpLegendAttrTokenMap;
if( mpAutoStyleAttrTokenMap )
delete mpAutoStyleAttrTokenMap;
if( mpCellAttrTokenMap )
@@ -371,25 +368,6 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaAttrTokenMap()
return *mpPlotAreaAttrTokenMap;
}
-const SvXMLTokenMap& SchXMLImportHelper::GetLegendAttrTokenMap()
-{
- if( ! mpLegendAttrTokenMap )
- {
- static __FAR_DATA SvXMLTokenMapEntry aLegendAttrTokenMap[] =
-{
- { XML_NAMESPACE_CHART, XML_LEGEND_POSITION, XML_TOK_LEGEND_POSITION },
- { XML_NAMESPACE_SVG, XML_X, XML_TOK_LEGEND_X },
- { XML_NAMESPACE_SVG, XML_Y, XML_TOK_LEGEND_Y },
- { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_LEGEND_STYLE_NAME },
- XML_TOKEN_MAP_END
-};
-
- mpLegendAttrTokenMap = new SvXMLTokenMap( aLegendAttrTokenMap );
- } // if( ! mpLegendAttrTokenMap )
-
- return *mpLegendAttrTokenMap;
-}
-
const SvXMLTokenMap& SchXMLImportHelper::GetAutoStyleAttrTokenMap()
{
if( ! mpAutoStyleAttrTokenMap )
diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx
new file mode 100755
index 000000000000..6220fdfca46a
--- /dev/null
+++ b/xmloff/source/chart/SchXMLLegendContext.cxx
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_xmloff.hxx"
+#include "SchXMLLegendContext.hxx"
+#include "SchXMLEnumConverter.hxx"
+
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmlement.hxx>
+#include <xmloff/prstylei.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+
+#include <tools/debug.hxx>
+
+#include <com/sun/star/chart/ChartLegendPosition.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+
+using namespace ::xmloff::token;
+using namespace com::sun::star;
+
+using rtl::OUString;
+using com::sun::star::uno::Reference;
+
+//----------------------------------------
+
+namespace
+{
+
+enum LegendAttributeTokens
+{
+ XML_TOK_LEGEND_POSITION,
+ XML_TOK_LEGEND_X,
+ XML_TOK_LEGEND_Y,
+ XML_TOK_LEGEND_STYLE_NAME,
+ XML_TOK_LEGEND_EXPANSION,
+ XML_TOK_LEGEND_EXPANSION_ASPECT_RATIO,
+ XML_TOK_LEGEND_WIDTH,
+ XML_TOK_LEGEND_WIDTH_EXT,
+ XML_TOK_LEGEND_HEIGHT,
+ XML_TOK_LEGEND_HEIGHT_EXT
+};
+
+SvXMLTokenMapEntry aLegendAttributeTokenMap[] =
+{
+ { XML_NAMESPACE_CHART, XML_LEGEND_POSITION, XML_TOK_LEGEND_POSITION },
+ { XML_NAMESPACE_SVG, XML_X, XML_TOK_LEGEND_X },
+ { XML_NAMESPACE_SVG, XML_Y, XML_TOK_LEGEND_Y },
+ { XML_NAMESPACE_CHART, XML_STYLE_NAME, XML_TOK_LEGEND_STYLE_NAME },
+ { XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION, XML_TOK_LEGEND_EXPANSION },
+ { XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION_ASPECT_RATIO, XML_TOK_LEGEND_EXPANSION_ASPECT_RATIO },
+ { XML_NAMESPACE_SVG, XML_WIDTH, XML_TOK_LEGEND_WIDTH },
+ { XML_NAMESPACE_CHART_EXT, XML_WIDTH, XML_TOK_LEGEND_WIDTH_EXT },
+ { XML_NAMESPACE_SVG, XML_HEIGHT, XML_TOK_LEGEND_HEIGHT },
+ { XML_NAMESPACE_CHART_EXT, XML_HEIGHT, XML_TOK_LEGEND_HEIGHT_EXT },
+ XML_TOKEN_MAP_END
+};
+
+class LegendAttributeTokenMap : public SvXMLTokenMap
+{
+public:
+ LegendAttributeTokenMap(): SvXMLTokenMap( aLegendAttributeTokenMap ) {}
+ virtual ~LegendAttributeTokenMap() {}
+};
+
+//a LegendAttributeTokenMap Singleton
+struct theLegendAttributeTokenMap : public rtl::Static< LegendAttributeTokenMap, theLegendAttributeTokenMap > {};
+
+}//end anonymous namespace
+
+//----------------------------------------
+
+SchXMLLegendContext::SchXMLLegendContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, const rtl::OUString& rLocalName ) :
+ SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
+ mrImportHelper( rImpHelper )
+{
+}
+
+void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
+ if( !xDoc.is() )
+ return;
+
+ // turn on legend
+ uno::Reference< beans::XPropertySet > xDocProp( xDoc, uno::UNO_QUERY );
+ if( xDocProp.is() )
+ {
+ try
+ {
+ xDocProp->setPropertyValue( rtl::OUString::createFromAscii( "HasLegend" ), uno::makeAny( sal_True ) );
+ }
+ catch( beans::UnknownPropertyException )
+ {
+ DBG_ERROR( "Property HasLegend not found" );
+ }
+ }
+
+ uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > xLegendProps( xLegendShape, uno::UNO_QUERY );
+ if( !xLegendShape.is() || !xLegendProps.is() )
+ {
+ DBG_ERROR( "legend could not be created" );
+ return;
+ }
+
+ // parse attributes
+ sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+ const SvXMLTokenMap& rAttrTokenMap = theLegendAttributeTokenMap::get();
+
+ awt::Point aLegendPos;
+ bool bHasXPosition=false;
+ bool bHasYPosition=false;
+ awt::Size aLegendSize;
+ bool bHasWidth=false;
+ bool bHasHeight=false;
+ chart::ChartLegendExpansion nLegendExpansion = chart::ChartLegendExpansion_HIGH;
+ bool bHasExpansion=false;
+
+ rtl::OUString sAutoStyleName;
+ uno::Any aAny;
+
+ for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ {
+ rtl::OUString sAttrName = xAttrList->getNameByIndex( i );
+ rtl::OUString aLocalName;
+ rtl::OUString aValue = xAttrList->getValueByIndex( i );
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
+
+ switch( rAttrTokenMap.Get( nPrefix, aLocalName ))
+ {
+ case XML_TOK_LEGEND_POSITION:
+ {
+ try
+ {
+ if( SchXMLEnumConverter::getLegendPositionConverter().importXML( aValue, aAny, GetImport().GetMM100UnitConverter() ) )
+ xLegendProps->setPropertyValue( rtl::OUString::createFromAscii( "Alignment" ), aAny );
+ }
+ catch( beans::UnknownPropertyException )
+ {
+ DBG_ERROR( "Property Alignment (legend) not found" );
+ }
+ }
+ break;
+
+ case XML_TOK_LEGEND_X:
+ GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.X, aValue );
+ bHasXPosition = true;
+ break;
+ case XML_TOK_LEGEND_Y:
+ GetImport().GetMM100UnitConverter().convertMeasure( aLegendPos.Y, aValue );
+ bHasYPosition = true;
+ break;
+ case XML_TOK_LEGEND_STYLE_NAME:
+ sAutoStyleName = aValue;
+ break;
+ case XML_TOK_LEGEND_EXPANSION:
+ SchXMLEnumConverter::getLegendPositionConverter().importXML( aValue, aAny, GetImport().GetMM100UnitConverter() );
+ bHasExpansion = (aAny>>=nLegendExpansion);
+ break;
+ case XML_TOK_LEGEND_EXPANSION_ASPECT_RATIO:
+ break;
+ case XML_TOK_LEGEND_WIDTH:
+ case XML_TOK_LEGEND_WIDTH_EXT:
+ GetImport().GetMM100UnitConverter().convertMeasure( aLegendSize.Width, aValue );
+ bHasWidth = true;
+ break;
+ case XML_TOK_LEGEND_HEIGHT:
+ case XML_TOK_LEGEND_HEIGHT_EXT:
+ GetImport().GetMM100UnitConverter().convertMeasure( aLegendSize.Height, aValue );
+ bHasHeight = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if( bHasXPosition && bHasYPosition )
+ xLegendShape->setPosition( aLegendPos );
+
+ if( bHasExpansion && nLegendExpansion!= chart::ChartLegendExpansion_CUSTOM )
+ xLegendProps->setPropertyValue( rtl::OUString::createFromAscii( "Expansion" ), uno::makeAny(nLegendExpansion) );
+ else if( bHasHeight && bHasWidth )
+ xLegendShape->setSize( aLegendSize );
+
+ // the fill style has the default "none" in XML, but "solid" in the model.
+ xLegendProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" )), uno::makeAny( drawing::FillStyle_NONE ));
+
+ // set auto-styles for Legend
+ const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
+ if( pStylesCtxt )
+ {
+ const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
+ mrImportHelper.GetChartFamilyID(), sAutoStyleName );
+
+ if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ (( XMLPropStyleContext* )pStyle )->FillPropertySet( xLegendProps );
+ }
+}
+
+SchXMLLegendContext::~SchXMLLegendContext()
+{
+}
diff --git a/offapi/com/sun/star/awt/grid/XGridControlListener.idl b/xmloff/source/chart/SchXMLLegendContext.hxx
index 6f4fdf68ccd4..1841b0cef24b 100644..100755
--- a/offapi/com/sun/star/awt/grid/XGridControlListener.idl
+++ b/xmloff/source/chart/SchXMLLegendContext.hxx
@@ -24,26 +24,23 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef __com_sun_star_awt_grid_XGridControlListener_idl__
-#define __com_sun_star_awt_grid_XGridControlListener_idl__
+#ifndef _SCH_XMLLEGENDCONTEXT_HXX_
+#define _SCH_XMLLEGENDCONTEXT_HXX_
-#ifndef __com_sun_star_uno_XInterface_idl__
-#include <com/sun/star/uno/XInterface.idl>
-#endif
+#include "SchXMLImport.hxx"
-//=============================================================================
+// ----------------------------------------
-module com { module sun { module star { module awt { module grid {
-
-//=============================================================================
-
-interface XGridControlListener
+class SchXMLLegendContext : public SvXMLImportContext
{
+public:
+ SchXMLLegendContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, const rtl::OUString& rLocalName );
+ virtual ~SchXMLLegendContext();
-};
+ virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
-//=============================================================================
-
-}; }; }; }; };
+private:
+ SchXMLImportHelper& mrImportHelper;
+};
-#endif
+#endif // _SCH_XMLLEGENDCONTEXT_HXX_
diff --git a/xmloff/source/chart/makefile.mk b/xmloff/source/chart/makefile.mk
index 2f61a3d6f0e5..3151d633d13f 100644
--- a/xmloff/source/chart/makefile.mk
+++ b/xmloff/source/chart/makefile.mk
@@ -45,12 +45,14 @@ SLOFILES = $(SLO)$/ColorPropertySet.obj \
$(SLO)$/contexts.obj \
$(SLO)$/SchXMLTableContext.obj \
$(SLO)$/SchXMLChartContext.obj \
+ $(SLO)$/SchXMLLegendContext.obj \
$(SLO)$/SchXMLPlotAreaContext.obj \
$(SLO)$/SchXMLAxisContext.obj \
$(SLO)$/SchXMLParagraphContext.obj \
$(SLO)$/SchXMLTextListContext.obj \
$(SLO)$/SchXMLSeriesHelper.obj \
$(SLO)$/SchXMLSeries2Context.obj \
+ $(SLO)$/SchXMLEnumConverter.obj \
$(SLO)$/PropertyMaps.obj \
$(SLO)$/XMLChartStyleContext.obj \
$(SLO)$/XMLErrorIndicatorPropertyHdl.obj \
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 824d28a51a5c..bc1e40114c5f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3113,6 +3113,12 @@ namespace xmloff { namespace token {
TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ),
TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ),
+ TOKEN( "legend-expansion", XML_LEGEND_EXPANSION),
+ TOKEN( "legend-expansion-aspect-ratio", XML_LEGEND_EXPANSION_ASPECT_RATIO),
+ TOKEN( "balanced", XML_BALANCED),
+ TOKEN( "high", XML_HIGH),
+ TOKEN( "wide", XML_WIDE),
+
TOKEN( "axis-type", XML_AXIS_TYPE ), //#i25706#
TOKEN( "date-scale", XML_DATE_SCALE ),
TOKEN( "base-time-unit", XML_BASE_TIME_UNIT ),
diff --git a/xmlsecurity/prj/build.lst b/xmlsecurity/prj/build.lst
index 3d70b9cb1181..54326d4fe5ef 100644
--- a/xmlsecurity/prj/build.lst
+++ b/xmlsecurity/prj/build.lst
@@ -1,4 +1,4 @@
-xs xmlsecurity : l10n xmloff unotools offapi unoil svx MOZ:moz SO:moz_prebuilt LIBXMLSEC:libxmlsec NSS:nss LIBXSLT:libxslt NULL
+xs xmlsecurity : L10N:l10n xmloff unotools offapi unoil svx MOZ:moz SO:moz_prebuilt LIBXMLSEC:libxmlsec NSS:nss LIBXSLT:libxslt NULL
xs xmlsecurity usr1 - all xs_mkout NULL
xs xmlsecurity\inc nmake - all xs_inc NULL
xs xmlsecurity\source\framework nmake - all xs_fw xs_inc NULL