summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]accessibility/inc/accessibility/extended/AccessibleGridControl.hxx9
-rwxr-xr-x[-rw-r--r--]accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx12
-rwxr-xr-x[-rw-r--r--]accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx2
-rwxr-xr-x[-rw-r--r--]accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx10
-rwxr-xr-x[-rw-r--r--]accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx6
-rwxr-xr-x[-rw-r--r--]accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx0
-rwxr-xr-x[-rw-r--r--]accessibility/source/extended/AccessibleGridControl.cxx35
-rwxr-xr-x[-rw-r--r--]accessibility/source/extended/AccessibleGridControlBase.cxx113
-rwxr-xr-x[-rw-r--r--]accessibility/source/extended/AccessibleGridControlHeader.cxx67
-rwxr-xr-x[-rw-r--r--]accessibility/source/extended/AccessibleGridControlHeaderCell.cxx0
-rwxr-xr-x[-rw-r--r--]accessibility/source/extended/AccessibleGridControlTable.cxx111
-rwxr-xr-x[-rw-r--r--]accessibility/source/extended/AccessibleGridControlTableBase.cxx4
-rwxr-xr-x[-rw-r--r--]accessibility/source/extended/AccessibleGridControlTableCell.cxx10
-rw-r--r--automation/source/inc/rcontrol.hxx8
-rw-r--r--automation/source/server/sta_list.cxx3
-rw-r--r--automation/source/server/statemnt.cxx183
-rw-r--r--basctl/inc/basidesh.hrc4
-rw-r--r--basctl/source/basicide/baside2.cxx127
-rw-r--r--basctl/source/basicide/baside2.hxx4
-rw-r--r--basctl/source/basicide/baside3.cxx3
-rw-r--r--basctl/source/basicide/basides1.cxx27
-rw-r--r--basctl/source/basicide/basides2.cxx29
-rw-r--r--basctl/source/basicide/basidesh.cxx103
-rw-r--r--basctl/source/basicide/basidesh.src16
-rw-r--r--basctl/source/basicide/basobj2.cxx2
-rw-r--r--basctl/source/basicide/bastype2.cxx270
-rw-r--r--basctl/source/basicide/bastype2.hxx13
-rw-r--r--basctl/source/basicide/bastype3.cxx46
-rw-r--r--basctl/source/basicide/bastypes.cxx25
-rw-r--r--basctl/source/basicide/macrodlg.cxx14
-rw-r--r--basctl/source/basicide/moduldlg.cxx70
-rw-r--r--basctl/source/basicide/scriptdocument.cxx36
-rw-r--r--basctl/source/inc/basidesh.hxx3
-rw-r--r--basctl/source/inc/bastypes.hxx10
-rw-r--r--basctl/source/inc/scriptdocument.hxx1
-rw-r--r--basic/inc/basic/sberrors.hxx3
-rw-r--r--basic/inc/basic/sbmod.hxx13
-rw-r--r--basic/inc/basic/sbobjmod.hxx97
-rw-r--r--basic/inc/basic/sbstar.hxx5
-rw-r--r--basic/inc/basic/sbuno.hxx2
-rwxr-xr-x[-rw-r--r--]basic/prj/build.lst2
-rw-r--r--basic/source/basmgr/basmgr.cxx39
-rw-r--r--basic/source/classes/errobject.cxx225
-rw-r--r--basic/source/classes/eventatt.cxx117
-rw-r--r--basic/source/classes/makefile.mk18
-rwxr-xr-xbasic/source/classes/sb.cxx62
-rw-r--r--basic/source/classes/sb.src4
-rw-r--r--basic/source/classes/sbunoobj.cxx2
-rw-r--r--basic/source/classes/sbxmod.cxx448
-rw-r--r--basic/source/comp/codegen.cxx11
-rw-r--r--basic/source/comp/parser.cxx13
-rw-r--r--basic/source/inc/codegen.hxx1
-rw-r--r--basic/source/inc/errobject.hxx52
-rw-r--r--basic/source/inc/image.hxx1
-rw-r--r--basic/source/inc/namecont.hxx9
-rw-r--r--basic/source/inc/runtime.hxx7
-rw-r--r--basic/source/inc/scriptcont.hxx17
-rw-r--r--basic/source/runtime/methods.cxx68
-rw-r--r--basic/source/runtime/methods1.cxx11
-rw-r--r--basic/source/runtime/props.cxx18
-rwxr-xr-x[-rw-r--r--]basic/source/runtime/runtime.cxx101
-rw-r--r--basic/source/runtime/stdobj.cxx2
-rw-r--r--basic/source/runtime/step0.cxx11
-rw-r--r--basic/source/runtime/step1.cxx7
-rw-r--r--basic/source/uno/namecont.cxx24
-rw-r--r--basic/source/uno/scriptcont.cxx41
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S38
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s22
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx54
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/except.cxx6
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk2
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/share.hxx7
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx113
-rw-r--r--comphelper/inc/comphelper/mediadescriptor.hxx1
-rw-r--r--comphelper/source/misc/mediadescriptor.cxx6
-rw-r--r--dbaccess/uiconfig/dbapp/menubar/menubar.xml14
-rw-r--r--filter/inc/filter/msfilter/msvbahelper.hxx (renamed from vbahelper/inc/vbahelper/msvbahelper.hxx)10
-rw-r--r--filter/inc/filter/msfilter/svxmsbas.hxx4
-rw-r--r--filter/prj/build.lst2
-rwxr-xr-xfilter/source/config/tools/merge/pyAltFCFGMerge2
-rw-r--r--filter/source/msfilter/makefile.mk4
-rw-r--r--filter/source/msfilter/msvbahelper.cxx (renamed from vbahelper/source/vbahelper/msvbahelper.cxx)5
-rw-r--r--filter/source/msfilter/msvbasic.cxx18
-rw-r--r--filter/source/msfilter/msvbasic.hxx14
-rw-r--r--filter/source/msfilter/svxmsbas.cxx130
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx10
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx21
-rw-r--r--framework/source/uielement/menubarmanager.cxx11
-rw-r--r--framework/source/xml/menudocumenthandler.cxx14
-rw-r--r--instsetoo_native/util/openoffice.lst2
-rw-r--r--l10ntools/source/help/HelpIndexerTool.java30
-rw-r--r--moz/makefile.mk4
-rw-r--r--moz/patches/linux_libc2.5.patch11
-rw-r--r--offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl1
-rw-r--r--offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/GridColumn.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/GridColumnEvent.idl17
-rw-r--r--offapi/com/sun/star/awt/grid/GridDataEvent.idl7
-rw-r--r--offapi/com/sun/star/awt/grid/GridInvalidDataException.idl58
-rw-r--r--offapi/com/sun/star/awt/grid/GridInvalidModelException.idl57
-rw-r--r--offapi/com/sun/star/awt/grid/GridSelectionEvent.idl13
-rw-r--r--offapi/com/sun/star/awt/grid/SelectionEventType.idl8
-rw-r--r--offapi/com/sun/star/awt/grid/UnoControlGrid.idl1
-rw-r--r--offapi/com/sun/star/awt/grid/UnoControlGridModel.idl65
-rw-r--r--offapi/com/sun/star/awt/grid/XGridCell.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridCellRenderer.idl5
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumn.idl50
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumnListener.idl22
-rw-r--r--offapi/com/sun/star/awt/grid/XGridColumnModel.idl38
-rw-r--r--offapi/com/sun/star/awt/grid/XGridControl.idl27
-rw-r--r--offapi/com/sun/star/awt/grid/XGridControlListener.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridDataListener.idl2
-rw-r--r--offapi/com/sun/star/awt/grid/XGridDataModel.idl31
-rw-r--r--offapi/com/sun/star/awt/grid/XGridSelection.idl38
-rw-r--r--offapi/com/sun/star/awt/grid/makefile.mk4
-rw-r--r--offapi/com/sun/star/document/MediaDescriptor.idl9
-rw-r--r--offapi/com/sun/star/script/ModuleInfo.idl55
-rw-r--r--offapi/com/sun/star/script/ModuleType.idl72
-rw-r--r--offapi/com/sun/star/script/XVBACompat.idl49
-rw-r--r--offapi/com/sun/star/script/XVBAModuleInfo.idl73
-rw-r--r--offapi/com/sun/star/script/makefile.mk4
-rw-r--r--officecfg/registry/data/org/openoffice/Office/SFX.xcu42
-rw-r--r--oovbaapi/ooo/vba/excel/XApplication.idl4
-rw-r--r--oovbaapi/ooo/vba/excel/XWorksheet.idl5
-rw-r--r--oox/inc/oox/core/filterbase.hxx27
-rw-r--r--oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx6
-rw-r--r--oox/inc/oox/drawingml/color.hxx4
-rw-r--r--oox/inc/oox/drawingml/customshapeproperties.hxx5
-rw-r--r--oox/inc/oox/drawingml/fillproperties.hxx9
-rw-r--r--oox/inc/oox/drawingml/lineproperties.hxx4
-rw-r--r--oox/inc/oox/dump/biffdumper.hxx8
-rw-r--r--oox/inc/oox/dump/dumperbase.hxx109
-rw-r--r--oox/inc/oox/dump/oledumper.hxx418
-rw-r--r--oox/inc/oox/dump/xlsbdumper.hxx2
-rw-r--r--oox/inc/oox/helper/binaryinputstream.hxx69
-rw-r--r--oox/inc/oox/helper/binaryoutputstream.hxx5
-rw-r--r--oox/inc/oox/helper/binarystreambase.hxx15
-rw-r--r--oox/inc/oox/helper/containerhelper.hxx131
-rw-r--r--oox/inc/oox/helper/graphichelper.hxx76
-rw-r--r--oox/inc/oox/helper/helper.hxx24
-rw-r--r--oox/inc/oox/helper/modelobjecthelper.hxx2
-rw-r--r--oox/inc/oox/helper/propertyset.hxx4
-rw-r--r--oox/inc/oox/helper/storagebase.hxx65
-rwxr-xr-xoox/inc/oox/helper/textinputstream.hxx58
-rw-r--r--oox/inc/oox/helper/zipstorage.hxx6
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/ole/axbinaryreader.hxx109
-rw-r--r--oox/inc/oox/ole/axcontrol.hxx568
-rw-r--r--oox/inc/oox/ole/axcontrolfragment.hxx14
-rw-r--r--oox/inc/oox/ole/axcontrolhelper.hxx118
-rw-r--r--oox/inc/oox/ole/olehelper.hxx79
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/ole/olestorage.hxx (renamed from oox/inc/oox/helper/olestorage.hxx)37
-rwxr-xr-xoox/inc/oox/ole/vbacontrol.hxx205
-rwxr-xr-xoox/inc/oox/ole/vbahelper.hxx233
-rwxr-xr-xoox/inc/oox/ole/vbamodule.hxx96
-rwxr-xr-xoox/inc/oox/ole/vbaproject.hxx289
-rw-r--r--oox/inc/oox/ppt/pptimport.hxx5
-rw-r--r--oox/inc/oox/vml/vmldrawing.hxx14
-rw-r--r--oox/inc/oox/vml/vmlformatting.hxx21
-rw-r--r--oox/inc/oox/xls/biffhelper.hxx2
-rw-r--r--oox/inc/oox/xls/excelfilter.hxx22
-rwxr-xr-xoox/inc/oox/xls/excelvbaproject.hxx73
-rw-r--r--oox/inc/oox/xls/stylesbuffer.hxx19
-rw-r--r--oox/inc/oox/xls/workbookhelper.hxx106
-rw-r--r--oox/inc/oox/xls/worksheetsettings.hxx2
-rw-r--r--oox/prj/build.lst2
-rw-r--r--oox/prj/d.lst5
-rw-r--r--oox/source/core/binaryfilterbase.cxx6
-rwxr-xr-xoox/source/core/filterbase.cxx111
-rw-r--r--oox/source/core/filterdetect.cxx4
-rw-r--r--oox/source/core/recordparser.cxx7
-rw-r--r--oox/source/docprop/docprophandler.cxx2
-rw-r--r--oox/source/drawingml/chart/chartdrawingfragment.cxx6
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx8
-rw-r--r--oox/source/drawingml/clrschemecontext.cxx2
-rw-r--r--oox/source/drawingml/color.cxx12
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx5
-rw-r--r--oox/source/drawingml/fillproperties.cxx54
-rw-r--r--oox/source/drawingml/fillpropertiesgroupcontext.cxx12
-rw-r--r--oox/source/drawingml/lineproperties.cxx15
-rw-r--r--oox/source/drawingml/linepropertiescontext.cxx2
-rw-r--r--oox/source/drawingml/shape.cxx17
-rw-r--r--oox/source/drawingml/table/tablecell.cxx4
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx4
-rw-r--r--oox/source/drawingml/textfont.cxx4
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx2
-rw-r--r--oox/source/dump/biffdumper.cxx333
-rw-r--r--oox/source/dump/biffdumper.ini4
-rw-r--r--oox/source/dump/dffdumper.cxx32
-rw-r--r--oox/source/dump/dumperbase.cxx371
-rw-r--r--oox/source/dump/oledumper.cxx1257
-rw-r--r--oox/source/dump/oledumper.ini439
-rw-r--r--oox/source/dump/pptxdumper.cxx9
-rw-r--r--oox/source/dump/xlsbdumper.cxx241
-rw-r--r--oox/source/helper/binaryinputstream.cxx98
-rw-r--r--oox/source/helper/binaryoutputstream.cxx20
-rw-r--r--oox/source/helper/binarystreambase.cxx21
-rw-r--r--oox/source/helper/graphichelper.cxx236
-rw-r--r--oox/source/helper/makefile.mk2
-rw-r--r--oox/source/helper/modelobjecthelper.cxx10
-rw-r--r--oox/source/helper/olestorage.cxx180
-rw-r--r--oox/source/helper/propertyset.cxx44
-rw-r--r--oox/source/helper/storagebase.cxx145
-rwxr-xr-xoox/source/helper/textinputstream.cxx128
-rw-r--r--oox/source/helper/zipstorage.cxx56
-rwxr-xr-x[-rw-r--r--]oox/source/ole/axbinaryreader.cxx100
-rw-r--r--oox/source/ole/axcontrol.cxx1122
-rw-r--r--oox/source/ole/axcontrolfragment.cxx35
-rw-r--r--oox/source/ole/axcontrolhelper.cxx175
-rw-r--r--oox/source/ole/makefile.mk8
-rw-r--r--oox/source/ole/olehelper.cxx112
-rwxr-xr-xoox/source/ole/olestorage.cxx423
-rwxr-xr-xoox/source/ole/vbacontrol.cxx811
-rwxr-xr-xoox/source/ole/vbahelper.cxx248
-rwxr-xr-xoox/source/ole/vbamodule.cxx241
-rwxr-xr-xoox/source/ole/vbaproject.cxx519
-rw-r--r--oox/source/ppt/animvariantcontext.cxx2
-rw-r--r--oox/source/ppt/pptimport.cxx30
-rw-r--r--oox/source/ppt/slidepersist.cxx2
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx12
-rw-r--r--oox/source/token/properties.txt18
-rw-r--r--oox/source/vml/vmldrawing.cxx20
-rw-r--r--oox/source/vml/vmlformatting.cxx41
-rw-r--r--oox/source/vml/vmlshape.cxx22
-rw-r--r--oox/source/vml/vmlshapecontainer.cxx1
-rw-r--r--oox/source/xls/biffdetector.cxx6
-rw-r--r--oox/source/xls/biffhelper.cxx97
-rw-r--r--oox/source/xls/excelfilter.cxx56
-rwxr-xr-xoox/source/xls/excelvbaproject.cxx214
-rw-r--r--oox/source/xls/formulaparser.cxx3
-rw-r--r--oox/source/xls/makefile.mk1
-rw-r--r--oox/source/xls/sheetdatacontext.cxx4
-rw-r--r--oox/source/xls/stylesbuffer.cxx77
-rw-r--r--oox/source/xls/unitconverter.cxx2
-rw-r--r--oox/source/xls/viewsettings.cxx2
-rw-r--r--oox/source/xls/workbookfragment.cxx60
-rw-r--r--oox/source/xls/workbookhelper.cxx210
-rw-r--r--oox/source/xls/workbooksettings.cxx5
-rw-r--r--oox/source/xls/worksheetfragment.cxx3
-rw-r--r--oox/source/xls/worksheethelper.cxx63
-rw-r--r--oox/source/xls/worksheetsettings.cxx11
-rw-r--r--oox/util/makefile.mk3
-rw-r--r--postprocess/checkdeliver/checkdeliver.pl3
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/inc/servuno.hxx10
-rw-r--r--sc/inc/unonames.hxx1
-rw-r--r--sc/inc/unowids.hxx3
-rwxr-xr-x[-rw-r--r--]sc/source/core/data/documen2.cxx40
-rw-r--r--sc/source/core/data/document.cxx12
-rw-r--r--sc/source/filter/excel/excimp8.cxx15
-rw-r--r--sc/source/filter/excel/read.cxx2
-rw-r--r--sc/source/filter/excel/xiescher.cxx6
-rw-r--r--sc/source/filter/excel/xlescher.cxx15
-rw-r--r--sc/source/filter/inc/xlescher.hxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx139
-rw-r--r--sc/source/ui/docshell/docsh5.cxx39
-rw-r--r--sc/source/ui/drawfunc/drformsh.src2
-rw-r--r--sc/source/ui/drawfunc/objdraw.src2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx17
-rw-r--r--sc/source/ui/unoobj/docuno.cxx13
-rw-r--r--sc/source/ui/unoobj/servuno.cxx130
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx7
-rw-r--r--sc/source/ui/vba/excelvbahelper.hxx4
-rwxr-xr-x[-rw-r--r--]sc/source/ui/vba/testvba/runTests.pl2
-rwxr-xr-xsc/source/ui/vba/testvba/testclientbin39390 -> 50595 bytes
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx78
-rw-r--r--sc/source/ui/vba/vbaformat.cxx60
-rw-r--r--sc/source/ui/vba/vbaformat.hxx5
-rw-r--r--sc/source/ui/vba/vbarange.cxx66
-rw-r--r--sc/source/ui/vba/vbarange.hxx11
-rw-r--r--sc/source/ui/view/viewfun2.cxx17
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml24
-rw-r--r--scp2/source/ooo/file_library_ooo.scp4
-rw-r--r--sd/uiconfig/sdraw/menubar/menubar.xml10
-rw-r--r--sd/uiconfig/simpress/menubar/menubar.xml16
-rw-r--r--soldep/bootstrp/prj.cxx679
-rw-r--r--soldep/inc/soldep/prj.hxx9
-rwxr-xr-xsolenv/bin/build.pl2
-rw-r--r--solenv/bin/modules/installer/scriptitems.pm2
-rw-r--r--solenv/bin/modules/installer/simplepackage.pm7
-rw-r--r--solenv/config/sdev300.ini14
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--sot/source/unoolestorage/xolesimplestorage.cxx4
-rwxr-xr-x[-rw-r--r--]svtools/inc/svtools/accessibletable.hxx9
-rw-r--r--svtools/inc/svtools/table/abstracttablecontrol.hxx18
-rw-r--r--svtools/inc/svtools/table/defaultinputhandler.hxx1
-rw-r--r--svtools/inc/svtools/table/gridtablerenderer.hxx8
-rw-r--r--svtools/inc/svtools/table/tablecontrol.hxx152
-rw-r--r--svtools/inc/svtools/table/tabledatawindow.hxx12
-rw-r--r--svtools/inc/svtools/table/tablemodel.hxx108
-rw-r--r--svtools/inc/svtools/table/tablerenderer.hxx44
-rw-r--r--svtools/inc/svtools/table/tabletypes.hxx10
-rw-r--r--svtools/prj/d.lst2
-rw-r--r--svtools/source/inc/accessibletableimp.hxx62
-rw-r--r--svtools/source/table/defaultinputhandler.cxx57
-rw-r--r--svtools/source/table/gridtablerenderer.cxx276
-rw-r--r--svtools/source/table/tablecontrol.cxx130
-rw-r--r--svtools/source/table/tablecontrol_impl.cxx1415
-rw-r--r--svtools/source/table/tablecontrol_impl.hxx161
-rw-r--r--svtools/source/table/tabledatawindow.cxx84
-rw-r--r--svtools/source/table/tablegeometry.cxx8
-rwxr-xr-x[-rw-r--r--]svtools/source/uno/svtxgridcontrol.cxx629
-rwxr-xr-x[-rw-r--r--]svtools/source/uno/svtxgridcontrol.hxx44
-rw-r--r--svtools/source/uno/unocontroltablemodel.cxx239
-rw-r--r--svtools/source/uno/unocontroltablemodel.hxx77
-rw-r--r--svx/source/dialog/srchdlg.cxx14
-rw-r--r--svx/source/unodraw/unoshape.cxx84
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/inc/shellio.hxx21
-rw-r--r--sw/inc/unoflatpara.hxx12
-rw-r--r--sw/source/core/bastyp/swrect.cxx2
-rw-r--r--sw/source/core/doc/docredln.cxx3
-rw-r--r--sw/source/core/docnode/ndcopy.cxx6
-rw-r--r--sw/source/core/frmedt/feshview.cxx5
-rw-r--r--sw/source/core/txtnode/atrfld.cxx13
-rw-r--r--sw/source/core/txtnode/fntcache.cxx178
-rw-r--r--sw/source/core/txtnode/ndhints.cxx16
-rw-r--r--sw/source/core/txtnode/thints.cxx304
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx30
-rw-r--r--sw/source/filter/ascii/ascatr.cxx9
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx4
-rw-r--r--sw/source/filter/writer/writer.cxx77
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx3
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx8
-rw-r--r--sw/source/ui/app/mn.src7
-rw-r--r--sw/source/ui/inc/swmn_tmpl.hrc1
-rw-r--r--sw/source/ui/lingu/olmenu.cxx14
-rw-r--r--sw/source/ui/uno/unotxvw.cxx27
-rw-r--r--sw/uiconfig/sglobal/menubar/menubar.xml22
-rw-r--r--sw/uiconfig/sweb/menubar/menubar.xml22
-rw-r--r--sw/uiconfig/swform/menubar/menubar.xml22
-rw-r--r--sw/uiconfig/swreport/menubar/menubar.xml22
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml22
-rw-r--r--sw/uiconfig/swxform/menubar/menubar.xml22
-rwxr-xr-xtestautomation/framework/optional/f_basic_vba-compat.bas11
-rwxr-xr-x[-rw-r--r--]testautomation/framework/optional/includes/basic_gridcontrol.inc74
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_application-union.inc132
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc33
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc76
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc35
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_thisworkbook.inc143
-rwxr-xr-xtestautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc187
-rwxr-xr-xtestautomation/framework/optional/input/gridcontrol.odtbin11602 -> 12000 bytes
-rwxr-xr-xtestautomation/framework/optional/input/vba-compat/vba-application-union.xlsbin0 -> 31744 bytes
-rwxr-xr-xtestautomation/framework/optional/input/vba-compat/vba-project.xlsbbin0 -> 19603 bytes
-rwxr-xr-xtestautomation/framework/optional/input/vba-compat/vba-project.xlsmbin0 -> 20276 bytes
-rw-r--r--testautomation/framework/optional/input/vba-compat/vba-thisworkbook.xlsbin0 -> 39424 bytes
-rwxr-xr-x[-rw-r--r--]testautomation/global/tools/includes/optional/t_treelist_tools.inc10
-rwxr-xr-xtestautomation/global/win/dial_d_h.win6
-rw-r--r--toolkit/inc/toolkit/helper/listenermultiplexer.hxx10
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx4
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.cxx121
-rw-r--r--toolkit/source/controls/grid/defaultgridcolumnmodel.hxx37
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.cxx99
-rw-r--r--toolkit/source/controls/grid/defaultgriddatamodel.hxx23
-rw-r--r--toolkit/source/controls/grid/gridcolumn.cxx148
-rw-r--r--toolkit/source/controls/grid/gridcolumn.hxx29
-rw-r--r--toolkit/source/controls/grid/gridcontrol.cxx112
-rw-r--r--toolkit/source/controls/grid/gridcontrol.hxx18
-rw-r--r--toolkit/source/helper/listenermultiplexer.cxx5
-rw-r--r--toolkit/source/helper/property.cxx8
-rw-r--r--unoxml/source/rdf/librdf_repository.cxx21
-rw-r--r--unoxml/source/rdf/makefile.mk8
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx2
-rw-r--r--vbahelper/prj/build.lst2
-rw-r--r--vbahelper/source/vbahelper/makefile.mk1
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrol.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbaglobalbase.cxx1
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx16
-rw-r--r--vbahelper/util/makefile.mk1
-rw-r--r--vcl/inc/vcl/vclevent.hxx1
-rw-r--r--xmloff/inc/xmloff/txtimp.hxx2
-rw-r--r--xmloff/inc/xmloff/xmlexp.hxx6
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx21
-rw-r--r--xmloff/source/chart/SchXMLParagraphContext.cxx18
-rw-r--r--xmloff/source/core/xmlexp.cxx16
-rw-r--r--xmloff/source/draw/animationexport.cxx22
-rw-r--r--xmloff/source/draw/animationimport.cxx34
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx4
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx4
-rw-r--r--xmloff/source/draw/sdxmlimp_impl.hxx3
-rw-r--r--xmloff/source/draw/shapeexport.cxx6
-rw-r--r--xmloff/source/draw/ximpbody.cxx23
-rw-r--r--xmloff/source/draw/ximpshap.cxx4
-rw-r--r--xmloff/source/forms/elementexport.cxx12
-rw-r--r--xmloff/source/forms/elementimport.cxx15
-rw-r--r--xmloff/source/forms/formattributes.cxx2
-rw-r--r--xmloff/source/meta/xmlmetae.cxx4
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx5
-rw-r--r--xmloff/source/style/XMLFontStylesContext.cxx15
-rw-r--r--xmloff/source/style/fonthdl.cxx2
-rw-r--r--xmloff/source/style/fonthdl.hxx6
-rw-r--r--xmloff/source/style/prhdlfac.cxx5
-rw-r--r--xmloff/source/style/xmlnume.cxx26
-rw-r--r--xmloff/source/style/xmlnumi.cxx30
-rw-r--r--xmloff/source/text/XMLChangedRegionImportContext.cxx13
-rw-r--r--xmloff/source/text/XMLRedlineExport.cxx2
-rw-r--r--xmloff/source/text/txtimp.cxx2
-rw-r--r--xmloff/source/text/txtparae.cxx13
-rw-r--r--xmloff/source/text/txtparai.cxx15
-rw-r--r--xmloff/source/text/txtparai.hxx1
-rw-r--r--xmlscript/source/xmldlg_imexp/exp_share.hxx2
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx2
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx4
404 files changed, 17078 insertions, 6494 deletions
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx
index 957b0a508bd8..cb2c4f6628c8 100644..100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx
@@ -56,7 +56,7 @@ protected:
AccessibleGridControl(
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator,
- ::svt::table::IAccessibleTable& _rTable
+ ::svt::table::IAccessibleTable& _rTable
);
virtual ~AccessibleGridControl();
@@ -177,8 +177,7 @@ private:
<p>The instance holds it's XAccessibleContext with a hard reference, while
the contxt holds this instance weak.</p>
*/
-typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessible
- > AccessibleGridControlAccess_Base;
+typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessible > AccessibleGridControlAccess_Base;
class AccessibleGridControlAccess :public AccessibleGridControlAccess_Base
,public ::svt::table::IAccessibleTableControl
@@ -191,7 +190,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
m_xContext;
- AccessibleGridControl* m_pContext;
+ AccessibleGridControl* m_pContext;
// note that this pointer is valid as long as m_xContext is valid!
public:
@@ -253,7 +252,7 @@ protected:
private:
AccessibleGridControlAccess(); // never implemented
- AccessibleGridControlAccess( const AccessibleGridControlAccess& ); // never implemented
+ AccessibleGridControlAccess( const AccessibleGridControlAccess& ); // never implemented
AccessibleGridControlAccess& operator=( const AccessibleGridControlAccess& ); // never implemented
};
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
index 3bdd5abe8912..c6a26d8c4548 100644..100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
@@ -96,8 +96,8 @@ public:
@param eDescrText The constant for the description text. */
AccessibleGridControlBase(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible >& rxParent,
- ::svt::table::IAccessibleTable& rTable,
+ ::com::sun::star::accessibility::XAccessible >& rxParent,
+ ::svt::table::IAccessibleTable& rTable,
::svt::table::AccessibleTableControlObjType eObjType );
protected:
@@ -135,14 +135,14 @@ public:
The relation set (the GridControl does not have one).
*/
virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL
- getAccessibleRelationSet()
+ ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL
+ getAccessibleRelationSet()
throw ( ::com::sun::star::uno::RuntimeException );
/** @return The set of current states. */
virtual ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
- getAccessibleStateSet()
+ getAccessibleStateSet()
throw ( ::com::sun::star::uno::RuntimeException );
/** @return The parent's locale. */
@@ -407,7 +407,7 @@ protected:
private:
GridControlAccessibleElement(); // never implemented
- GridControlAccessibleElement( const GridControlAccessibleElement& ); // never implemented
+ GridControlAccessibleElement( const GridControlAccessibleElement& ); // never implemented
GridControlAccessibleElement& operator=( const GridControlAccessibleElement& ); // never implemented
};
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx
index b45ad5bdae5a..90306435bd4b 100644..100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx
@@ -51,7 +51,7 @@ public:
AccessibleGridControlHeader(
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible >& rxParent,
- ::svt::table::IAccessibleTable& rTable,
+ ::svt::table::IAccessibleTable& rTable,
::svt::table::AccessibleTableControlObjType eObjType );
protected:
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx
index 648614a9e214..0672ca28a151 100644..100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx
@@ -36,9 +36,9 @@ namespace accessibility
sal_Int32 m_nColumnRowId;
public:
AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
- ::svt::table::IAccessibleTable& _rTable,
- ::svt::table::AccessibleTableControlObjType _eObjType);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
+ ::svt::table::IAccessibleTable& _rTable,
+ ::svt::table::AccessibleTableControlObjType _eObjType);
/** @return The count of visible children. */
virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( ::com::sun::star::uno::RuntimeException );
@@ -56,8 +56,8 @@ namespace accessibility
/** Queries for a new interface. */
::com::sun::star::uno::Any SAL_CALL queryInterface(
- const ::com::sun::star::uno::Type& rType )
- throw ( ::com::sun::star::uno::RuntimeException );
+ const ::com::sun::star::uno::Type& rType )
+ throw ( ::com::sun::star::uno::RuntimeException );
/** Aquires the object (calls acquire() on base class). */
virtual void SAL_CALL acquire() throw ();
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx
index 35b7a69f5aa6..28d9cfb919f1 100644..100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx
@@ -57,9 +57,9 @@ public:
@param eDescrText The constant for the description text. */
AccessibleGridControlTableBase(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible >& rxParent,
- ::svt::table::IAccessibleTable& rTable,
- ::svt::table::AccessibleTableControlObjType eObjType );
+ ::com::sun::star::accessibility::XAccessible >& rxParent,
+ ::svt::table::IAccessibleTable& rTable,
+ ::svt::table::AccessibleTableControlObjType eObjType );
protected:
virtual ~AccessibleGridControlTableBase();
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx
index dd44927d7fc1..dd44927d7fc1 100644..100755
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index e8111657d7d0..f0aa406b62bf 100644..100755
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -33,7 +33,6 @@
#include <svtools/accessibletable.hxx>
#include <comphelper/types.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-//#include "svtools/table/tablecontrol.hxx"
// ============================================================================
@@ -61,21 +60,19 @@ public:
/** The data table child. */
Reference<
::com::sun::star::accessibility::XAccessible > m_xTable;
- AccessibleGridControlTable* m_pTable;
+ AccessibleGridControlTable* m_pTable;
/** The header bar for rows. */
Reference<
::com::sun::star::accessibility::XAccessible > m_xRowHeaderBar;
- AccessibleGridControlHeader* m_pRowHeaderBar;
+ AccessibleGridControlHeader* m_pRowHeaderBar;
/** The header bar for columns (first row of the table). */
Reference<
::com::sun::star::accessibility::XAccessible > m_xColumnHeaderBar;
- AccessibleGridControlHeader* m_pColumnHeaderBar;
+ AccessibleGridControlHeader* m_pColumnHeaderBar;
};
-// Ctor/Dtor/disposing --------------------------------------------------------
-
DBG_NAME( AccessibleGridControl )
AccessibleGridControl::AccessibleGridControl(
@@ -83,7 +80,6 @@ AccessibleGridControl::AccessibleGridControl(
IAccessibleTable& _rTable )
: AccessibleGridControlBase( _rxParent, _rTable, TCTYPE_GRIDCONTROL )
{
-// DBG_CTOR( AccessibleTableControl, NULL );
m_pImpl.reset( new AccessibleGridControl_Impl() );
m_pImpl->m_aCreator = _rxCreator;
}
@@ -91,7 +87,6 @@ AccessibleGridControl::AccessibleGridControl(
// -----------------------------------------------------------------------------
AccessibleGridControl::~AccessibleGridControl()
{
- DBG_DTOR( AccessibleGridControl, NULL );
}
// -----------------------------------------------------------------------------
@@ -99,7 +94,7 @@ void SAL_CALL AccessibleGridControl::disposing()
{
::osl::MutexGuard aGuard( getOslMutex() );
- m_pImpl->m_pTable = NULL;
+ m_pImpl->m_pTable = NULL;
m_pImpl->m_pColumnHeaderBar = NULL;
m_pImpl->m_pRowHeaderBar = NULL;
m_pImpl->m_aCreator = Reference< XAccessible >();
@@ -143,7 +138,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex )
{
if(nChildIndex == 0 && m_aTable.HasColHeader())
{
- if(!m_pImpl->m_xColumnHeaderBar.is()){
+ if(!m_pImpl->m_xColumnHeaderBar.is())
+ {
AccessibleGridControlHeader* pColHeaderBar = new AccessibleGridControlHeader(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_COLUMNHEADERBAR);
m_pImpl->m_xColumnHeaderBar = pColHeaderBar;
}
@@ -151,7 +147,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex )
}
else if(m_aTable.HasRowHeader() && (nChildIndex == 1 || nChildIndex == 0))
{
- if(!m_pImpl->m_xRowHeaderBar.is()){
+ if(!m_pImpl->m_xRowHeaderBar.is())
+ {
AccessibleGridControlHeader* pRowHeaderBar = new AccessibleGridControlHeader(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_ROWHEADERBAR);
m_pImpl->m_xRowHeaderBar = pRowHeaderBar;
}
@@ -164,7 +161,6 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex )
xChild = m_pImpl->m_xTable;
}
}
-
return xChild;
}
// -----------------------------------------------------------------------------
@@ -200,11 +196,11 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint )
{
Reference< XAccessible > xCurrChild( implGetFixedChild( nIndex ) );
Reference< XAccessibleComponent >
- xCurrChildComp( xCurrChild, uno::UNO_QUERY );
+ xCurrChildComp( xCurrChild, uno::UNO_QUERY );
if( xCurrChildComp.is() &&
- VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) )
- xChild = xCurrChild;
+ VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) )
+ xChild = xCurrChild;
}
}
return xChild;
@@ -217,7 +213,7 @@ void SAL_CALL AccessibleGridControl::grabFocus()
TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
- m_aTable.GrabFocus();
+ m_aTable.GrabFocus();
}
// -----------------------------------------------------------------------------
@@ -260,7 +256,6 @@ Reference< XAccessible > AccessibleGridControl::implGetTable()
{
m_pImpl->m_pTable = createAccessibleTable();
m_pImpl->m_xTable = m_pImpl->m_pTable;
-
}
return m_pImpl->m_xTable;
}
@@ -302,7 +297,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex )
Reference< XAccessible > xRet;
switch( nChildIndex )
{
- case TCINDEX_COLUMNHEADERBAR:
+ case TCINDEX_COLUMNHEADERBAR:
xRet = implGetHeaderBar( TCTYPE_COLUMNHEADERBAR );
break;
case TCINDEX_ROWHEADERBAR:
@@ -318,7 +313,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex )
AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable()
{
Reference< XAccessible > xCreator = (Reference< XAccessible >)m_pImpl->m_aCreator;
- DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" );
+ DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" );
return new AccessibleGridControlTable( xCreator, m_aTable, TCTYPE_TABLE );
}
// ============================================================================
@@ -331,13 +326,11 @@ AccessibleGridControlAccess::AccessibleGridControlAccess( const Reference< XAcce
,m_rTable( _rTable )
,m_pContext( NULL )
{
- DBG_CTOR( AccessibleGridControlAccess, NULL );
}
// -----------------------------------------------------------------------------
AccessibleGridControlAccess::~AccessibleGridControlAccess()
{
- DBG_DTOR( AccessibleGridControlAccess, NULL );
}
// -----------------------------------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx
index 12d4a7d141a4..ea81bd350426 100644..100755
--- a/accessibility/source/extended/AccessibleGridControlBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlBase.cxx
@@ -57,8 +57,6 @@ namespace accessibility {
using namespace com::sun::star::accessibility::AccessibleStateType;
// ============================================================================
-// Ctor/Dtor/disposing --------------------------------------------------------
-
DBG_NAME( AccessibleGridControlBase )
AccessibleGridControlBase::AccessibleGridControlBase(
@@ -73,13 +71,10 @@ AccessibleGridControlBase::AccessibleGridControlBase(
m_aDescription( rTable.GetAccessibleObjectDescription( eObjType ) ),
m_aClientId(0)
{
- DBG_CTOR( AccessibleGridControlBase, NULL );
}
AccessibleGridControlBase::~AccessibleGridControlBase()
{
-// DBG_DTOR( AccessibleGridControlBase, NULL );
-
if( isAlive() )
{
// increment ref count to prevent double call of Dtor
@@ -122,20 +117,19 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getAccessibleIndexInParent()
xParentContext( m_xParent->getAccessibleContext() );
if( xParentContext.is() )
{
- Reference< uno::XInterface > xChild;
+ Reference< uno::XInterface > xChild;
sal_Int32 nChildCount = xParentContext->getAccessibleChildCount();
for( sal_Int32 nChild = 0; nChild < nChildCount; ++nChild )
{
- xChild = xChild.query( xParentContext->getAccessibleChild( nChild ) );
-
- if ( xMeMyselfAndI.get() == xChild.get() )
- {
- nRet = nChild;
- break;
- }
+ xChild = xChild.query( xParentContext->getAccessibleChild( nChild ) );
+ if ( xMeMyselfAndI.get() == xChild.get() )
+ {
+ nRet = nChild;
+ break;
}
}
+ }
}
return nRet;
}
@@ -160,9 +154,9 @@ Reference< XAccessibleRelationSet > SAL_CALL
AccessibleGridControlBase::getAccessibleRelationSet()
throw ( uno::RuntimeException )
{
- ensureIsAlive();
- // GridControl does not have relations.
- return new utl::AccessibleRelationSetHelper;
+ ensureIsAlive();
+ // GridControl does not have relations.
+ return new utl::AccessibleRelationSetHelper;
}
Reference< XAccessibleStateSet > SAL_CALL
@@ -185,7 +179,7 @@ lang::Locale SAL_CALL AccessibleGridControlBase::getLocale()
Reference< XAccessibleContext >
xParentContext( m_xParent->getAccessibleContext() );
if( xParentContext.is() )
- return xParentContext->getLocale();
+ return xParentContext->getLocale();
}
throw IllegalAccessibleComponentStateException();
}
@@ -268,19 +262,18 @@ void SAL_CALL AccessibleGridControlBase::removeEventListener(
{
if( _rxListener.is() && getClientId( ) )
{
- ::osl::MutexGuard aGuard( getOslMutex() );
+ ::osl::MutexGuard aGuard( getOslMutex() );
sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( getClientId( ), _rxListener );
- if ( !nListenerCount )
- {
- // no listeners anymore
- // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
- // and at least to us not firing any events anymore, in case somebody calls
- // NotifyAccessibleEvent, again
-
- AccessibleEventNotifier::TClientId nId( getClientId( ) );
- setClientId( 0 );
- AccessibleEventNotifier::revokeClient( nId );
- }
+ if ( !nListenerCount )
+ {
+ // no listeners anymore
+ // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
+ // and at least to us not firing any events anymore, in case somebody calls
+ // NotifyAccessibleEvent, again
+ AccessibleEventNotifier::TClientId nId( getClientId( ) );
+ setClientId( 0 );
+ AccessibleEventNotifier::revokeClient( nId );
+ }
}
}
@@ -310,7 +303,6 @@ sal_Bool SAL_CALL AccessibleGridControlBase::supportsService(
for( ; ( pString != pArrEnd ) && ( rServiceName != *pString ); ++pString )
;
-
return pString != pArrEnd;
}
@@ -351,7 +343,6 @@ sal_Bool AccessibleGridControlBase::implIsShowing()
}
else
pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
-
return pStateSetHelper;
}
@@ -382,7 +373,7 @@ Rectangle AccessibleGridControlBase::getBoundingBox()
}
return aRect;
}
-//
+
Rectangle AccessibleGridControlBase::getBoundingBoxOnScreen()
throw ( lang::DisposedException )
{
@@ -436,22 +427,22 @@ sal_Int16 SAL_CALL AccessibleGridControlBase::getAccessibleRole()
switch ( m_eObjType )
{
case TCTYPE_ROWHEADERCELL:
- nRole = AccessibleRole::ROW_HEADER;
- break;
- case TCTYPE_COLUMNHEADERCELL:
- nRole = AccessibleRole::COLUMN_HEADER;
- break;
- case TCTYPE_COLUMNHEADERBAR:
- case TCTYPE_ROWHEADERBAR:
- case TCTYPE_TABLE:
- nRole = AccessibleRole::TABLE;
- break;
- case TCTYPE_TABLECELL:
- nRole = AccessibleRole::TABLE_CELL;
- break;
- case TCTYPE_GRIDCONTROL:
- nRole = AccessibleRole::PANEL;
- break;
+ nRole = AccessibleRole::ROW_HEADER;
+ break;
+ case TCTYPE_COLUMNHEADERCELL:
+ nRole = AccessibleRole::COLUMN_HEADER;
+ break;
+ case TCTYPE_COLUMNHEADERBAR:
+ case TCTYPE_ROWHEADERBAR:
+ case TCTYPE_TABLE:
+ nRole = AccessibleRole::TABLE;
+ break;
+ case TCTYPE_TABLECELL:
+ nRole = AccessibleRole::TABLE_CELL;
+ break;
+ case TCTYPE_GRIDCONTROL:
+ nRole = AccessibleRole::PANEL;
+ break;
}
return nRole;
}
@@ -480,17 +471,16 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getForeground( ) throw (::com::su
{
if ( pInst->IsControlForeground() )
nColor = pInst->GetControlForeground().GetColor();
+ else
+ {
+ Font aFont;
+ if ( pInst->IsControlFont() )
+ aFont = pInst->GetControlFont();
else
- {
- Font aFont;
- if ( pInst->IsControlFont() )
- aFont = pInst->GetControlFont();
- else
- aFont = pInst->GetFont();
- nColor = aFont.GetColor().GetColor();
- }
+ aFont = pInst->GetFont();
+ nColor = aFont.GetColor().GetColor();
+ }
}
-
return nColor;
}
// -----------------------------------------------------------------------------
@@ -505,20 +495,18 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getBackground( ) throw (::com::su
{
if ( pInst->IsControlBackground() )
nColor = pInst->GetControlBackground().GetColor();
- else
+ else
nColor = pInst->GetBackground().GetColor().GetColor();
}
-
return nColor;
}
//// ============================================================================
GridControlAccessibleElement::GridControlAccessibleElement( const Reference< XAccessible >& rxParent,
- IAccessibleTable& rTable,
- AccessibleTableControlObjType eObjType )
+ IAccessibleTable& rTable,
+ AccessibleTableControlObjType eObjType )
:AccessibleGridControlBase( rxParent, rTable, eObjType )
{
-// DBG_CTOR( GridControlAccessibleElement, NULL );
}
// XInterface -----------------------------------------------------------------
@@ -537,7 +525,6 @@ Reference< XAccessibleContext > SAL_CALL GridControlAccessibleElement::getAccess
// ----------------------------------------------------------------------------
GridControlAccessibleElement::~GridControlAccessibleElement( )
{
-// DBG_DTOR( GridControlAccessibleElement, NULL );
}
// ============================================================================
diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx
index c7622c18981e..1870eebc8e3e 100644..100755
--- a/accessibility/source/extended/AccessibleGridControlHeader.cxx
+++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx
@@ -56,8 +56,6 @@ namespace accessibility {
// ============================================================================
-// Ctor/Dtor/disposing --------------------------------------------------------
-
DBG_NAME( AccessibleGridControlHeader )
AccessibleGridControlHeader::AccessibleGridControlHeader(
@@ -66,15 +64,12 @@ AccessibleGridControlHeader::AccessibleGridControlHeader(
::svt::table::AccessibleTableControlObjType eObjType):
AccessibleGridControlTableBase( rxParent, rTable, eObjType )
{
-// DBG_CTOR( AccessibleGridControlHeaderBar, NULL );
-
DBG_ASSERT( isRowBar() || isColumnBar(),
"accessibility/extended/AccessibleGridControlHeaderBar - invalid object type" );
}
AccessibleGridControlHeader::~AccessibleGridControlHeader()
{
-// DBG_DTOR( AccessibleGridControlHeader, NULL );
}
// XAccessibleContext ---------------------------------------------------------
@@ -83,11 +78,11 @@ Reference< XAccessible > SAL_CALL
AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- TCSolarGuard aSolarGuard;
+ TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
if (nChildIndex<0 || nChildIndex>=getAccessibleChildCount())
- throw IndexOutOfBoundsException();
+ throw IndexOutOfBoundsException();
ensureIsAlive();
Reference< XAccessible > xChild;
if(m_eObjType == svt::table::TCTYPE_COLUMNHEADERBAR)
@@ -106,11 +101,11 @@ AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex )
sal_Int32 SAL_CALL AccessibleGridControlHeader::getAccessibleIndexInParent()
throw ( uno::RuntimeException )
{
- ensureIsAlive();
- if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader())
- return 1;
- else
- return 0;
+ ensureIsAlive();
+ if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader())
+ return 1;
+ else
+ return 0;
}
// XAccessibleComponent -------------------------------------------------------
@@ -126,8 +121,8 @@ AccessibleGridControlHeader::getAccessibleAtPoint( const awt::Point& rPoint )
sal_Int32 nRow = 0;
sal_Int32 nColumnPos = 0;
sal_Bool bConverted = isRowBar() ?
- m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) :
- m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) );
+ m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) :
+ m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) );
return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >();
}
@@ -181,35 +176,24 @@ Reference< XAccessibleTable > SAL_CALL AccessibleGridControlHeader::getAccessibl
ensureIsAlive();
return NULL; // no headers in headers
}
-
+//not selectable
Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleRows()
throw ( uno::RuntimeException )
{
- TCSolarGuard aSolarGuard;
- ::osl::MutexGuard aGuard( getOslMutex() );
- ensureIsAlive();
-
- Sequence< sal_Int32 > aSelSeq;
- // row of column header bar not selectable
- if( isRowBar() )
- implGetSelectedRows( aSelSeq );
+ Sequence< sal_Int32 > aSelSeq(0);
return aSelSeq;
}
//columns aren't selectable
Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleColumns()
throw ( uno::RuntimeException )
{
- return NULL;
+ Sequence< sal_Int32 > aSelSeq(0);
+ return aSelSeq;
}
-//To Do - not yet implemented
-sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 nRow )
+//row headers not selectable
+sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 /*nRow*/ )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- TCSolarGuard aSolarGuard;
- ::osl::MutexGuard aGuard( getOslMutex() );
- ensureIsAlive();
- ensureIsValidRow( nRow );
- //return isRowBar() ? implIsRowSelected( nRow ) : sal_False;
return sal_False;
}
//columns aren't selectable
@@ -219,28 +203,19 @@ sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleColumnSelected( sal_I
(void)nColumn;
return sal_False;
}
-
+//not implemented
Reference< XAccessible > SAL_CALL AccessibleGridControlHeader::getAccessibleCellAt(
- sal_Int32 nRow, sal_Int32 nColumn )
+ sal_Int32 /*nRow*/, sal_Int32 /*nColumn*/ )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- TCSolarGuard aSolarGuard;
- ::osl::MutexGuard aGuard( getOslMutex() );
- ensureIsAlive();
- ensureIsValidAddress( nRow, nColumn );
- return implGetChild( nRow, implToVCLColumnPos( nColumn ) );
+ return NULL;
}
-// TO DO - not implemented yet
+// not selectable
sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleSelected(
- sal_Int32 nRow, sal_Int32 nColumn )
+ sal_Int32 /*nRow*/, sal_Int32 /*nColumn */)
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- TCSolarGuard aSolarGuard;
- ::osl::MutexGuard aGuard( getOslMutex() );
- ensureIsAlive();
- ensureIsValidAddress( nRow, nColumn );
- return FALSE;
- // return isRowBar() ? implIsRowSelected( nRow ) : implIsColumnSelected( nColumn );
+ return sal_False;
}
// XServiceInfo ---------------------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx
index 485c57c40ae1..485c57c40ae1 100644..100755
--- a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx
+++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx
diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx
index efd78fc8634a..461e776f1392 100644..100755
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -51,8 +51,6 @@ namespace accessibility {
// ============================================================================
-// Ctor/Dtor/disposing --------------------------------------------------------
-
DBG_NAME( AccessibleGridControlTable )
AccessibleGridControlTable::AccessibleGridControlTable(
@@ -61,12 +59,10 @@ AccessibleGridControlTable::AccessibleGridControlTable(
AccessibleTableControlObjType _eType) :
AccessibleGridControlTableBase( rxParent, rTable, _eType )
{
- DBG_CTOR( AccessibleGridControlTable, NULL );
}
AccessibleGridControlTable::~AccessibleGridControlTable()
{
- DBG_DTOR( AccessibleGridControlTable, NULL );
}
// XAccessibleContext ---------------------------------------------------------
@@ -92,7 +88,6 @@ sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent()
return 1;
else
return 2;
-
}
// XAccessibleComponent -------------------------------------------------------
@@ -177,7 +172,6 @@ Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessible
TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
-
Sequence< sal_Int32 > aSelSeq;
implGetSelectedRows( aSelSeq );
return aSelSeq;
@@ -187,38 +181,34 @@ Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessible
Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleColumns()
throw ( uno::RuntimeException )
{
-// TCSolarGuard aSolarGuard;
-// ::osl::MutexGuard aGuard( getOslMutex() );
-// ensureIsAlive();
-//
-// Sequence< sal_Int32 > aSelSeq;
-// implGetSelectedColumns( aSelSeq );
-// return aSelSeq;
- return NULL;
+ Sequence< sal_Int32 > aSelSeq(0);
+ return aSelSeq;
}
-//To Do: not implemented yet
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleRowSelected( sal_Int32 nRow )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- //TCSolarGuard aSolarGuard;
- //::osl::MutexGuard aGuard( getOslMutex() );
- //ensureIsAlive();
- //ensureIsValidRow( nRow );
- //return implIsRowSelected( nRow );
- (void) nRow;
- return sal_False;
+ TCSolarGuard aSolarGuard;
+ ::osl::MutexGuard aGuard( getOslMutex() );
+ ensureIsAlive();
+ ensureIsValidRow( nRow );
+ sal_Bool bSelected = sal_False;
+ Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows();
+ for(int i=0; i<selectedRows.getLength(); i++)
+ {
+ if(nRow == selectedRows[i])
+ {
+ bSelected = sal_True;
+ continue;
+ }
+ }
+ return bSelected;
}
//columns aren't selectable
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleColumnSelected( sal_Int32 nColumn )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- /*TCSolarGuard aSolarGuard;
- ::osl::MutexGuard aGuard( getOslMutex() );
- ensureIsAlive();
- ensureIsValidColumn( nColumn );
- return implIsColumnSelected( nColumn );*/
(void) nColumn;
return sal_False;
}
@@ -238,16 +228,14 @@ sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected(
sal_Int32 nRow, sal_Int32 nColumn )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- /*TCSolarGuard aSolarGuard;
+ TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
ensureIsValidAddress( nRow, nColumn );
- return implIsRowSelected( nRow ) || implIsColumnSelected( nColumn );*/
- (void) nRow;
(void) nColumn;
- return sal_False;
+ //selection of single cells not possible, so if row is selected, the cell will be selected too
+ return isAccessibleRowSelected(nRow);
}
-//To Do: not implemented yet
void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
@@ -255,48 +243,51 @@ void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChil
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
ensureIsValidIndex( nChildIndex );
- //if( isRowBar() )
- // implSelectRow( nChildIndex, sal_True );
- //else
- // implSelectColumn( implToVCLColumnPos( nChildIndex ), sal_True );
+ sal_Int32 nColumns = m_aTable.GetColumnCount();
+ sal_Int32 nRow = (nChildIndex / nColumns);
+ std::vector< sal_Int32 > selectedRows = m_aTable.GetSelectedRows();
+ selectedRows.push_back(nRow);
}
-//To Do - not implemented yet
sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleChildSelected( sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- // using interface methods - no mutex
- /*return isRowBar() ?
- isAccessibleRowSelected( nChildIndex ) :
- isAccessibleColumnSelected( nChildIndex );*/
- (void)nChildIndex;
- return FALSE;
+ TCSolarGuard aSolarGuard;
+ ::osl::MutexGuard aGuard( getOslMutex() );
+ ensureIsAlive();
+ ensureIsValidIndex( nChildIndex );
+ sal_Int32 nColumns = m_aTable.GetColumnCount();
+ sal_Int32 nRow = (nChildIndex / nColumns);
+ return isAccessibleRowSelected(nRow);
}
-//To Do - not implemented yet
void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection()
throw ( uno::RuntimeException )
{
TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
+ for(unsigned int i=0;i<m_aTable.GetSelectedRows().size();i++)
+ m_aTable.RemoveSelectedRow((sal_Int32)i);
}
-//To Do - not implemented yet
void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren()
throw ( uno::RuntimeException )
{
TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
+ Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows();
+ for(int i=0;i<m_aTable.GetRowCount();i++)
+ selectedRows[i]=i;
}
-//To Do - not implemented yet
sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount()
throw ( uno::RuntimeException )
{
TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
- return 0;
+ Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows();
+ sal_Int32 nColumns = m_aTable.GetColumnCount();
+ return selectedRows.getLength()*nColumns;
}
-//To Do - not implemented yet
Reference< XAccessible > SAL_CALL
AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
@@ -304,10 +295,12 @@ AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChild
TCSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
- (void)nSelectedChildIndex;
- return NULL;
+ if(isAccessibleChildSelected(nSelectedChildIndex))
+ return getAccessibleChild(nSelectedChildIndex);
+ else
+ return NULL;
}
-//To Do - not implemented yet
+//not implemented yet, because only row selection possible
void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild(
sal_Int32 nSelectedChildIndex )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
@@ -316,14 +309,6 @@ void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild(
::osl::MutexGuard aGuard( getOslMutex() );
ensureIsAlive();
(void)nSelectedChildIndex;
- // method may throw lang::IndexOutOfBoundsException
- //if ( isAccessibleChildSelected(nSelectedChildIndex) )
- //{
- // if( isRowBar() )
- // implSelectRow( nSelectedChildIndex, sal_False );
- // else
- // implSelectColumn( implToVCLColumnPos( nSelectedChildIndex ), sal_False );
- //}
}
// XInterface -----------------------------------------------------------------
@@ -364,14 +349,6 @@ Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen()
return m_aTable.calcTableRect();
}
// internal helper methods ----------------------------------------------------
-//To Do - not implemented yet
-//sal_Int32 AccessibleGridControlTable::implGetChildIndexFromSelectedIndex(
-// sal_Int32 nSelectedChildIndex )
-// throw ( lang::IndexOutOfBoundsException )
-//{
-// (void)nSelectedChildIndex;
-// return 0;
-//}
Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar(
sal_Int32 nChildIndex )
throw ( uno::RuntimeException )
diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
index 8a7e3102bdf7..352e80e1a666 100644..100755
--- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
@@ -53,8 +53,6 @@ namespace accessibility {
// ============================================================================
-// Ctor/Dtor/disposing --------------------------------------------------------
-
DBG_NAME( AccessibleGridControlTableBase )
AccessibleGridControlTableBase::AccessibleGridControlTableBase(
@@ -63,12 +61,10 @@ AccessibleGridControlTableBase::AccessibleGridControlTableBase(
AccessibleTableControlObjType eObjType ) :
GridControlAccessibleElement( rxParent, rTable, eObjType )
{
- DBG_CTOR( AccessibleGridControlTableBase, NULL );
}
AccessibleGridControlTableBase::~AccessibleGridControlTableBase()
{
- DBG_DTOR( AccessibleGridControlTableBase, NULL );
}
// XAccessibleContext ---------------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
index f511eb43cbf8..43b9400e9050 100644..100755
--- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx
@@ -65,7 +65,6 @@ namespace accessibility
// =============================================================================
// = AccessibleGridControlCell
// =============================================================================
- //DBG_NAME( svt_AccessibleGridControlCell )
// -----------------------------------------------------------------------------
AccessibleGridControlCell::AccessibleGridControlCell(
const Reference< XAccessible >& _rxParent, IAccessibleTable& _rTable,
@@ -74,7 +73,6 @@ namespace accessibility
,m_nRowPos( _nRowPos )
,m_nColPos( _nColPos )
{
-// DBG_CTOR( svt_AccessibleGridControlCell, NULL );
// set accessible name here, because for that we need the position of the cell
// and so the base class isn't capable of doing this
::rtl::OUString aAccName;
@@ -104,8 +102,7 @@ namespace accessibility
::rtl::OUString AccessibleGridControlTableCell::implGetText()
{
ensureIsAlive();
- //return mpTable->GetAccessibleCellText( getRowPos(), static_cast< USHORT >( getColumnPos() ) );
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "test" ));
+ return m_aTable.GetAccessibleCellText( getRowPos(), getColumnPos() );
}
::com::sun::star::lang::Locale AccessibleGridControlTableCell::implGetLocale()
@@ -166,10 +163,7 @@ namespace accessibility
::com::sun::star::awt::Rectangle aRect;
if ( &m_aTable )
- {
aRect = AWTRectangle( m_aTable.GetFieldCharacterBounds( getRowPos(), getColumnPos(), nIndex ) );
- }
-
return aRect;
}
@@ -363,12 +357,12 @@ namespace accessibility
//!!! don't know how to put a string into the clipboard
return sal_False;
}
+
Rectangle AccessibleGridControlTableCell::implGetBoundingBox()
{
return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
}
// -----------------------------------------------------------------------------
-
Rectangle AccessibleGridControlTableCell::implGetBoundingBoxOnScreen()
{
return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle
diff --git a/automation/source/inc/rcontrol.hxx b/automation/source/inc/rcontrol.hxx
index 829dd320beb6..7313603096b4 100644
--- a/automation/source/inc/rcontrol.hxx
+++ b/automation/source/inc/rcontrol.hxx
@@ -305,7 +305,7 @@
#define RC_Profile ( M_SOFFICE | M_MOZILLA | 9 )
// (Popup)Menu
#define RC_MenuSelect ( M_SOFFICE | M_MOZILLA | 10 )
-#define RC_SetControlType ( M_SOFFICE | 11 )
+#define RC_SetControlType ( M_SOFFICE | 11 ) // deprecated since RTTI
// RemoteFileAccess
#define RC_Kill ( M_SOFFICE | 12 )
#define RC_RmDir ( M_SOFFICE | 13 )
@@ -429,14 +429,14 @@
-// Konstanten die im Basic zur Verfügung stehen sollen
+// Constants which are available in VCLTestTool scripts
-// Verschiedene Typen von Controls für den Befehl SetControlType
-// !!!!!!!!!!! Müssen alle bei SetControlType eingetragen werden !!!!!!!!!!!!
+// Different types of controls recognized via RTTI
#define CONST_CTBrowseBox 100
#define CONST_CTValueSet 103
#define CONST_CTORoadmap 104
#define CONST_CTIExtensionListBox 105
+#define CONST_CTTableControl 106
#define CONST_CTUnknown 199
// Konstanten für das ALignment des gesuchten Splitters
diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx
index 7f346c298563..c0abcb057f8b 100644
--- a/automation/source/server/sta_list.cxx
+++ b/automation/source/server/sta_list.cxx
@@ -53,6 +53,7 @@
#include <svtools/valueset.hxx>
#include <svtools/roadmap.hxx>
#include <svtools/extensionlistbox.hxx>
+#include <svtools/table/tablecontrol.hxx>
#define WINDOW_ANYTYPE WINDOW_BASE
@@ -999,6 +1000,8 @@ String StatementList::ClientTree(Window *pBase, int Indent)
WRITEc("/RoadMap")
else if ( dynamic_cast< svt::IExtensionListBox* >(pBase) )
WRITEc("/ExtensionListBox")
+ else if ( dynamic_cast< svt::table::TableControl* >(pBase) )
+ WRITEc("/TableControl")
else
WRITEc("/Unknown")
}
diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index 68ff61bbaa0d..2d1cccd9fc51 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -82,6 +82,7 @@
#include <vcl/wintypes.hxx>
#include <svtools/valueset.hxx>
#include <svtools/roadmap.hxx>
+#include <svtools/table/tablecontrol.hxx>
#include <svl/poolitem.hxx>
#include <svtools/extensionlistbox.hxx>
// Hat keinen Includeschutz
@@ -96,6 +97,7 @@
#include <basic/ttstrhlp.hxx>
#endif
#include <basic/dispdefs.hxx>
+#include <basic/sbuno.hxx>
#include <vos/socket.hxx>
#include <svl/pickerhistory.hxx>
#include <com/sun/star/util/XCancellable.hpp>
@@ -128,9 +130,10 @@
using namespace com::sun::star::frame;
using namespace com::sun::star::uno;
-using namespace com::sun::star::util;
+//using namespace com::sun::star::util; geht wegen Color nicht
using namespace com::sun::star::beans;
using namespace svt;
+//using namespace svt::table;
#ifndef SBX_VALUE_DECL_DEFINED
@@ -618,7 +621,7 @@ BOOL StatementSlot::Execute()
AddReferer();
if ( !aUnoUrl.Len() )
aUnoUrl = CUniString("slot:").Append( String::CreateFromInt32( nFunctionId ) );
- URL aTargetURL;
+ ::com::sun::star::util::URL aTargetURL;
aTargetURL.Complete = aUnoUrl;
Reference < XFramesSupplier > xDesktop = Reference < XFramesSupplier >( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.frame.Desktop") ), UNO_QUERY );
Reference < XFrame > xFrame;
@@ -664,7 +667,7 @@ BOOL StatementSlot::Execute()
ReportError( GEN_RES_STR1( S_UNO_URL_EXECUTE_FAILED_NO_FRAME, aTargetURL.Complete ) );
else
{
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY );
xTrans->parseStrict( aTargetURL );
Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY );
@@ -865,6 +868,13 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst
if ( bFirst )
pRet->GenReturn ( RET_WinInfo, SmartId(), (comm_ULONG)nConf | DH_MODE_DATA_VALID, UniString(), TRUE );
+ if ( bFirst )
+ {
+ if ( pBase->GetType() == WINDOW_WINDOW && pBase->GetParent() && pBase->GetParent()->GetType() == WINDOW_CONTROL &&
+ dynamic_cast< svt::table::TableControl* > ( pBase->GetParent() ) )
+ pBase = pBase->GetParent();
+ }
+
{ // Klammerung, so daß der String nicht während der Rekursion bestehen bleibt
String aName;
BOOL bSkip = FALSE;
@@ -958,6 +968,8 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst
aTypeSuffix.AppendAscii( "/RoadMap", 8 );
else if ( dynamic_cast< IExtensionListBox* >(pBase) )
aTypeSuffix.AppendAscii( "/ExtensionListBox" );
+ else if ( dynamic_cast< svt::table::TableControl* >(pBase) )
+ aTypeSuffix.AppendAscii( "/TableControl" );
else
aTypeSuffix.AppendAscii( "/Unknown", 8 );
}
@@ -3388,17 +3400,17 @@ BOOL StatementCommand::Execute()
{
if( (nParams & PARAM_USHORT_1) )
{
- Reference < XCancellable > xPicker;
+ Reference < ::com::sun::star::util::XCancellable > xPicker;
switch( nNr1 )
{
case CONST_FilePicker:
{
- xPicker.set( Reference < XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) );
+ xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) );
}
break;
case CONST_FolderPicker:
{
- xPicker.set( Reference < XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) );
+ xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) );
}
break;
default:
@@ -5807,6 +5819,8 @@ BOOL StatementControl::Execute()
nRealControlType = CONST_CTORoadmap;
else if ( dynamic_cast< IExtensionListBox* >(pControl) )
nRealControlType = CONST_CTIExtensionListBox;
+ else if ( dynamic_cast< ::svt::table::TableControl* >(pControl) )
+ nRealControlType = CONST_CTTableControl;
else
nRealControlType = CONST_CTUnknown;
@@ -6148,6 +6162,163 @@ protected:
}
}
break;
+
+ case CONST_CTTableControl:
+ {
+ ::svt::table::TableControl *pTC = dynamic_cast< ::svt::table::TableControl* >(pControl);
+ switch ( nMethodId )
+ {
+ case M_GetItemType :
+ {
+ if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) &&
+ ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() ))
+ {
+ ::svt::table::PTableModel pModel = pTC->GetModel();
+ Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1];
+ pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() ));
+ }
+ }
+ break;
+ case M_GetItemText :
+ {
+ if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) &&
+ ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() ))
+ {
+ ::svt::table::PTableModel pModel = pTC->GetModel();
+ Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1];
+ /* doesn't work ATM since it gets casted to SbxDATE in VCLTestTool unfortunately
+ SbxVariableRef xRes = new SbxVariable( SbxVARIANT );
+ unoToSbxValue( xRes, aCell );
+ pRet->GenReturn ( RET_Value, aUId, *xRes );*/
+
+ Type aType = aCell.getValueType();
+ TypeClass eTypeClass = aType.getTypeClass();
+ switch( eTypeClass )
+ {
+ /*case TypeClass_ENUM:
+ {
+ sal_Int32 nEnum = 0;
+ enum2int( nEnum, aValue );
+ pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)nEnum );
+ }
+ break;*/
+ case TypeClass_BOOLEAN:
+ pRet->GenReturn ( RET_Value, aUId, *(sal_Bool*)aCell.getValue() );
+ break;
+ case TypeClass_CHAR:
+ {
+ ::rtl::OUString aContent( *(sal_Unicode*)aCell.getValue() );
+ pRet->GenReturn ( RET_Value, aUId, aContent );
+ }
+ break;
+ case TypeClass_STRING:
+ {
+ ::rtl::OUString aContent;
+ aCell >>= aContent;
+ pRet->GenReturn ( RET_Value, aUId, aContent );
+ }
+ break;
+ //case TypeClass_FLOAT: break;
+ //case TypeClass_DOUBLE: break;
+ //case TypeClass_OCTET: break;
+ case TypeClass_BYTE:
+ case TypeClass_SHORT:
+ case TypeClass_LONG:
+ case TypeClass_HYPER:
+ case TypeClass_UNSIGNED_LONG:
+ case TypeClass_UNSIGNED_HYPER:
+ {
+ comm_ULONG val = 0;
+ aCell >>= val;
+ pRet->GenReturn ( RET_Value, aUId, val );
+ }
+ break;
+ //case TypeClass_UNSIGNED_OCTET:break;
+ case TypeClass_UNSIGNED_SHORT:
+ {
+ comm_USHORT val = 0;
+ aCell >>= val;
+ pRet->GenReturn ( RET_Value, aUId, val );
+ }
+ break;
+ default:
+ pRet->GenReturn ( RET_Value, aUId, comm_USHORT(0) );
+ break;
+ }
+ }
+ }
+ break;
+ case M_GetColumnCount :
+ {
+ pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetColumnCount() );
+ }
+ break;
+ case M_GetRowCount :
+ {
+ pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetRowCount() );
+ }
+ break;
+ case M_Select :
+ {
+ if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetRowCount() ))
+ {
+ if ( pTC->GoToRow( ::svt::table::RowPos( nNr1-1 ) ) )
+ {
+ Size aSize( pTC->GetSizePixel() );
+// DirectLog( S_QAError, UniString::CreateFromInt32( aSize.Width() ).Append( UniString::CreateFromInt32( aSize.Height() ) ) );
+ 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 )
+ {
+ if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID )
+ aPos.Y() -= nStep;
+ else
+ aPos.Y() += nStep;
+ nStep /= 2;
+ }
+ if ( pTC->GetCurrentRow( aPos ) == nNr1-1 )
+ {
+ MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1);
+ pTC->getSelEngine()->SelMouseButtonDown( aMEvnt );
+ pTC->getSelEngine()->SelMouseButtonUp( aMEvnt );
+ }
+ else
+ ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "find pos" ) );
+ }
+ else
+ ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "GoTo" ) );
+ }
+ }
+ break;
+ case M_GetSelCount :
+ pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows().size() ));
+ 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 ) );
+ break;
+/* case M_GetSelText :
+ if ( ! (nParams & PARAM_USHORT_1) )
+ nNr1 = 1;
+ if ( ValueOK(aUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) )
+ {
+ nNr1--;
+ COUNT_LBOX( FirstSelected, NextSelected, nNr1);
+ GetFirstValidTextItem( pThisEntry );
+ pRet->GenReturn ( RET_Value, aUId, pItem->GetText() );
+ }
+ break;
+ */
+ default:
+ ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TableControl" ) );
+ break;
+ }
+ }
+ break;
+
case CONST_CTUnknown:
ReportError( aUId, GEN_RES_STR2( S_UNKNOWN_TYPE, UniString::CreateFromInt32( nRT ), MethodString(nMethodId) ) );
break;
diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index 51d1ed2be6fc..8bf7d3316cd0 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -182,6 +182,10 @@
#define RID_STR_DLGIMP_MISMATCH_OMIT ( RID_BASICIDE_START + 115 )
#define RID_STR_DLGIMP_MISMATCH_TITLE ( RID_BASICIDE_START + 116 )
#define RID_STR_DLGIMP_MISMATCH_TEXT ( RID_BASICIDE_START + 117 )
+#define RID_STR_DOCUMENT_OBJECTS ( RID_BASICIDE_START + 118 )
+#define RID_STR_USERFORMS ( RID_BASICIDE_START + 119 )
+#define RID_STR_NORMAL_MODULES ( RID_BASICIDE_START + 120 )
+#define RID_STR_CLASS_MODULES ( RID_BASICIDE_START + 121 )
#endif // _SVX_NOIDERESIDS
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 9fc700948249..9f97e1766c3b 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -46,6 +46,7 @@
#include <com/sun/star/script/XLibraryContainer2.hpp>
#endif
#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/docfile.hxx>
#include <basic/basrdll.hxx>
@@ -202,21 +203,35 @@ ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDoc
pLayout = pParent;
aXEditorWindow.Show();
- BasicManager* pBasMgr = rDocument.getBasicManager();
- if ( pBasMgr )
+ SetBackground();
+}
+
+SbModuleRef ModulWindow::XModule()
+{
+ // ModuleWindows can now be created as a result of the
+ // modules getting created via the api. This is a result of an
+ // elementInserted event from the BasicLibrary container.
+ // However the SbModule is also created from a different listener to
+ // the same event ( in basmgr ) Therefore it is possible when we look
+ // for xModule it may not yet be available, here we keep tring to access
+ // the module until such time as it exists
+
+ if ( !xModule.Is() )
{
- StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
- if ( pBasic )
+ BasicManager* pBasMgr = GetDocument().getBasicManager();
+ if ( pBasMgr )
{
- xBasic = pBasic;
- xModule = (SbModule*)pBasic->FindModule( aName );
+ StarBASIC* pBasic = pBasMgr->GetLib( GetLibName() );
+ if ( pBasic )
+ {
+ xBasic = pBasic;
+ xModule = (SbModule*)pBasic->FindModule( GetName() );
+ }
}
}
-
- SetBackground();
+ return xModule;
}
-
__EXPORT ModulWindow::~ModulWindow()
{
DBG_DTOR( ModulWindow, 0 );
@@ -266,7 +281,7 @@ void ModulWindow::CheckCompileBasic()
{
DBG_CHKTHIS( ModulWindow, 0 );
- if ( xModule.Is() )
+ if ( XModule().Is() )
{
// Zur Laufzeit wird niemals compiliert!
BOOL bRunning = StarBASIC::IsRunning();
@@ -322,7 +337,7 @@ BOOL ModulWindow::BasicExecute()
CheckCompileBasic();
- if ( xModule.Is() && xModule->IsCompiled() && !aStatus.bError )
+ if ( XModule().Is() && xModule->IsCompiled() && !aStatus.bError )
{
if ( GetBreakPoints().Count() )
aStatus.nBasicFlags = aStatus.nBasicFlags | SbDEBUG_BREAK;
@@ -332,6 +347,9 @@ BOOL ModulWindow::BasicExecute()
DBG_ASSERT( xModule.Is(), "Kein Modul!" );
AddStatus( BASWIN_RUNNINGBASIC );
USHORT nStart, nEnd, nCurMethodStart = 0;
+ TextSelection aSel = GetEditView()->GetSelection();
+ if ( aDocument.isInVBAMode() )
+ nCurMethodStart = ( aSel.GetStart().GetPara() + 1 );
SbMethod* pMethod = 0;
// erstes Macro, sonst blind "Main" (ExtSearch?)
for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ )
@@ -339,15 +357,27 @@ BOOL ModulWindow::BasicExecute()
SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro );
DBG_ASSERT( pM, "Method?" );
pM->GetLineRange( nStart, nEnd );
- if ( !pMethod || ( nStart < nCurMethodStart ) )
+ if ( aDocument.isInVBAMode() )
+ {
+ if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd )
+ {
+ pMethod = pM;
+ break;
+ }
+ }
+ else if ( !pMethod || ( nStart < nCurMethodStart ) )
{
pMethod = pM;
nCurMethodStart = nStart;
}
}
if ( !pMethod )
- pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD );
-
+ {
+ if ( aDocument.isInVBAMode() )
+ return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE;
+ else
+ pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD );
+ }
if ( pMethod )
{
pMethod->SetDebugFlags( aStatus.nBasicFlags );
@@ -374,7 +404,7 @@ BOOL ModulWindow::CompileBasic()
CheckCompileBasic();
BOOL bIsCompiled = FALSE;
- if ( xModule.Is() )
+ if ( XModule().Is() )
bIsCompiled = xModule->IsCompiled();
return bIsCompiled;
@@ -551,11 +581,11 @@ BOOL ModulWindow::ImportDialog()
BOOL ModulWindow::ToggleBreakPoint( ULONG nLine )
{
- DBG_ASSERT( xModule.Is(), "Kein Modul!" );
+ DBG_ASSERT( XModule().Is(), "Kein Modul!" );
BOOL bNewBreakPoint = FALSE;
- if ( xModule.Is() )
+ if ( XModule().Is() )
{
CheckCompileBasic();
if ( aStatus.bError )
@@ -597,9 +627,9 @@ BOOL ModulWindow::ToggleBreakPoint( ULONG nLine )
void ModulWindow::UpdateBreakPoint( const BreakPoint& rBrk )
{
- DBG_ASSERT( xModule.Is(), "Kein Modul!" );
+ DBG_ASSERT( XModule().Is(), "Kein Modul!" );
- if ( xModule.Is() )
+ if ( XModule().Is() )
{
CheckCompileBasic();
@@ -823,9 +853,9 @@ void ModulWindow::BasicRemoveWatch()
void ModulWindow::EditMacro( const String& rMacroName )
{
DBG_CHKTHIS( ModulWindow, 0 );
- DBG_ASSERT( xModule.Is(), "Kein Modul!" );
+ DBG_ASSERT( XModule().Is(), "Kein Modul!" );
- if ( xModule.Is() )
+ if ( XModule().Is() )
{
CheckCompileBasic();
@@ -895,12 +925,12 @@ BOOL __EXPORT ModulWindow::AllowUndo()
void __EXPORT ModulWindow::UpdateData()
{
DBG_CHKTHIS( ModulWindow, 0 );
- DBG_ASSERT( xModule.Is(), "Kein Modul!" );
+ DBG_ASSERT( XModule().Is(), "Kein Modul!" );
// UpdateData wird gerufen, wenn sich der Source von aussen
// geaendert hat.
// => Keine Unterbrechungen erwuenscht!
- if ( xModule.Is() )
+ if ( XModule().Is() )
{
SetModule( xModule->GetSource32() );
@@ -1193,19 +1223,6 @@ void __EXPORT ModulWindow::DoScroll( ScrollBar* pCurScrollBar )
}
-BOOL ModulWindow::RenameModule( const String& rNewName )
-{
- if ( !BasicIDE::RenameModule( this, GetDocument(), GetLibName(), GetName(), rNewName ) )
- return FALSE;
-
- SfxBindings* pBindings = BasicIDE::GetBindingsPtr();
- if ( pBindings )
- pBindings->Invalidate( SID_DOC_MODIFIED );
-
- return TRUE;
-}
-
-
BOOL __EXPORT ModulWindow::IsModified()
{
return GetEditEngine() ? GetEditEngine()->IsModified() : FALSE;
@@ -1221,7 +1238,7 @@ void __EXPORT ModulWindow::GoOnTop()
String ModulWindow::GetSbModuleName()
{
String aModuleName;
- if ( xModule.Is() )
+ if ( XModule().Is() )
aModuleName = xModule->GetName();
return aModuleName;
}
@@ -1343,7 +1360,7 @@ USHORT __EXPORT ModulWindow::GetSearchOptions()
void __EXPORT ModulWindow::BasicStarted()
{
- if ( xModule.Is() )
+ if ( XModule().Is() )
{
aStatus.bIsRunning = TRUE;
BreakPointList& rList = GetBreakPoints();
@@ -1372,7 +1389,39 @@ BasicEntryDescriptor ModulWindow::CreateEntryDescriptor()
ScriptDocument aDocument( GetDocument() );
String aLibName( GetLibName() );
LibraryLocation eLocation = aDocument.getLibraryLocation( aLibName );
- return BasicEntryDescriptor( aDocument, eLocation, aLibName, GetName(), OBJ_TYPE_MODULE );
+ String aModName( GetName() );
+ String aLibSubName;
+ if( xBasic.Is() && aDocument.isInVBAMode() && XModule().Is() )
+ {
+ switch( xModule->GetModuleType() )
+ {
+ case script::ModuleType::DOCUMENT:
+ {
+ aLibSubName = String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) );
+ uno::Reference< container::XNameContainer > xLib = aDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
+ if( xLib.is() )
+ {
+ String sObjName;
+ ModuleInfoHelper::getObjectName( xLib, aModName, sObjName );
+ if( sObjName.Len() )
+ {
+ aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")");
+ }
+ }
+ break;
+ }
+ case script::ModuleType::FORM:
+ aLibSubName = String( IDEResId( RID_STR_USERFORMS ) );
+ break;
+ case script::ModuleType::NORMAL:
+ aLibSubName = String( IDEResId( RID_STR_NORMAL_MODULES ) );
+ break;
+ case script::ModuleType::CLASS:
+ aLibSubName = String( IDEResId( RID_STR_CLASS_MODULES ) );
+ break;
+ }
+ }
+ return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aModName, OBJ_TYPE_MODULE );
}
void ModulWindow::SetReadOnly( BOOL b )
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 6d35f0a027a8..280bb6ee3ab6 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -357,6 +357,7 @@ private:
void AssertValidEditEngine();
sal_Int32 FormatAndPrint( Printer* pPrinter, sal_Int32 nPage = -1 );
+ SbModuleRef XModule();
protected:
virtual void Resize();
virtual void GetFocus();
@@ -389,7 +390,7 @@ public:
virtual void SetReadOnly( BOOL bReadOnly );
virtual BOOL IsReadOnly();
- StarBASIC* GetBasic() { return xBasic; }
+ StarBASIC* GetBasic() { XModule(); return xBasic; }
SbModule* GetSbModule() { return xModule; }
void SetSbModule( SbModule* pModule ) { xModule = pModule; }
@@ -417,7 +418,6 @@ public:
// void InsertFromObjectCatalog( ObjectCatalog* pObjDlg );
BOOL ToggleBreakPoint( ULONG nLine );
- BOOL RenameModule( const String& rNewName );
BasicStatus& GetBasicStatus() { return aStatus; }
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index afbe3daf5be1..f4a3c1d48fc7 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -1297,8 +1297,9 @@ BasicEntryDescriptor DialogWindow::CreateEntryDescriptor()
{
ScriptDocument aDocument( GetDocument() );
String aLibName( GetLibName() );
+ String aLibSubName;
LibraryLocation eLocation = aDocument.getLibraryLocation( aLibName );
- return BasicEntryDescriptor( aDocument, eLocation, aLibName, GetName(), OBJ_TYPE_DIALOG );
+ return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, GetName(), OBJ_TYPE_DIALOG );
}
void DialogWindow::SetReadOnly( BOOL b )
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 4432de9aa282..351186325b09 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -109,7 +109,6 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
{
if ( aDocument.removeModule( aLibName, aName ) )
{
- RemoveWindow( pCurWin, TRUE );
BasicIDE::MarkDocumentModified( aDocument );
}
}
@@ -430,11 +429,31 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
{
String aNewName( rModName.GetValue() );
String aOldName( pWin->GetName() );
-
if ( aNewName != aOldName )
{
- if ( ( pWin->IsA( TYPE( ModulWindow ) ) && ((ModulWindow*)pWin)->RenameModule( aNewName ) )
- || ( pWin->IsA( TYPE( DialogWindow ) ) && ((DialogWindow*)pWin)->RenameDialog( aNewName ) ) )
+ bool bRenameOk = false;
+ if ( pWin->IsA( TYPE( ModulWindow ) ) )
+ {
+ ModulWindow* pModWin = (ModulWindow*)pWin;
+ String aLibName = ( pModWin->GetLibName() );
+ ScriptDocument aDocument( pWin->GetDocument() );
+
+ if ( BasicIDE::RenameModule( pModWin, aDocument, aLibName, aOldName, aNewName ) )
+ {
+ bRenameOk = true;
+ // Because we listen for container events for script
+ // modules, rename will delete the 'old' window
+ // pWin has been invalidated, restore now
+ pWin = FindBasWin( aDocument, aLibName, aNewName, TRUE );
+ }
+
+ }
+ else if ( pWin->IsA( TYPE( DialogWindow ) ) )
+ {
+ DialogWindow* pDlgWin = (DialogWindow*)pWin;
+ bRenameOk = pDlgWin->RenameDialog( aNewName );
+ }
+ if ( bRenameOk )
{
BasicIDE::MarkDocumentModified( pWin->GetDocument() );
}
diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx
index 20de8e9aafba..bef969db9266 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -51,6 +51,10 @@
#include <tools/diagnose_ex.h>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/signaturestate.hxx>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -235,7 +239,7 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const
if ( !aLibName.Len() )
aLibName = String::CreateFromAscii( "Standard" );
- rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
+ uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName );
if ( !aModName.Len() )
aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
@@ -254,9 +258,15 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const
if ( bSuccess )
{
- // new module window
- pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule );
- nKey = InsertWindowInTable( pWin );
+ pWin = FindBasWin( rDocument, aLibName, aModName, FALSE, TRUE );
+ if( !pWin )
+ {
+ // new module window
+ pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule );
+ nKey = InsertWindowInTable( pWin );
+ }
+ else // we've gotten called recursively ( via listener from createModule above ), get outta here
+ return pWin;
}
}
else
@@ -271,6 +281,17 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const
}
DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" );
}
+ if( nKey && xLib.is() && rDocument.isInVBAMode() )
+ {
+ // display a nice friendly name in the ObjectModule tab,
+ // combining the objectname and module name, e.g. Sheet1 ( Financials )
+ String sObjName;
+ ModuleInfoHelper::getObjectName( xLib, rModName, sObjName );
+ if( sObjName.Len() )
+ {
+ aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")");
+ }
+ }
pTabBar->InsertPage( (USHORT)nKey, aModName );
pTabBar->Sort();
pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 23978f4df10b..2f9303756e09 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -77,6 +77,9 @@
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/script/XLibraryContainer.hpp>
#include <svx/xmlsecctrl.hxx>
@@ -84,6 +87,71 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
using ::rtl::OUString;
+static const rtl::OUString sStandardLibName( rtl::OUString::createFromAscii("Standard") );
+
+typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListenerBASE;
+
+class ContainerListenerImpl : public ContainerListenerBASE
+{
+ BasicIDEShell* mpShell;
+public:
+
+ ContainerListenerImpl( BasicIDEShell* pShell ) : mpShell( pShell ) {}
+
+ ~ContainerListenerImpl()
+ {
+ }
+
+ void addContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName )
+ {
+ try
+ {
+ uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, FALSE ), uno::UNO_QUERY );
+ if ( xContainer.is() )
+ {
+ uno::Reference< container::XContainerListener > xContainerListener( this );
+ xContainer->addContainerListener( xContainerListener );
+ }
+ }
+ catch( uno::Exception& ) {}
+ }
+ void removeContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName )
+ {
+ try
+ {
+ uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, FALSE ), uno::UNO_QUERY );
+ if ( xContainer.is() )
+ {
+ uno::Reference< container::XContainerListener > xContainerListener( this );
+ xContainer->removeContainerListener( xContainerListener );
+ }
+ }
+ catch( uno::Exception& ) {}
+ }
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const lang::EventObject& ) throw( uno::RuntimeException ) {}
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const container::ContainerEvent& Event ) throw( uno::RuntimeException )
+ {
+ rtl::OUString sModuleName;
+ if( mpShell && ( Event.Accessor >>= sModuleName ) )
+ mpShell->FindBasWin( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, TRUE, FALSE );
+ }
+ virtual void SAL_CALL elementReplaced( const container::ContainerEvent& ) throw( com::sun::star::uno::RuntimeException ) { }
+ virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event ) throw( com::sun::star::uno::RuntimeException )
+ {
+ rtl::OUString sModuleName;
+ if( mpShell && ( Event.Accessor >>= sModuleName ) )
+ {
+ IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BASICIDE_TYPE_MODULE, TRUE );
+ if( pWin )
+ mpShell->RemoveWindow( pWin, TRUE, TRUE );
+ }
+ }
+
+};
TYPEINIT1( BasicIDEShell, SfxViewShell );
@@ -121,6 +189,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFrame* pFrame_, SfxViewShell* /* pOldShell
m_bAppBasicModified( FALSE ),
m_aNotifier( *this )
{
+ m_xLibListener = new ContainerListenerImpl( this );
Init();
GnBasicIDEShellCount++;
}
@@ -212,6 +281,12 @@ __EXPORT BasicIDEShell::~BasicIDEShell()
delete pTabBar;
delete pObjectCatalog;
DestroyModulWindowLayout();
+
+ ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() );
+ // Destroy all ContainerListeners for Basic Container.
+ if ( pListener )
+ pListener->removeContainerListener( m_aCurDocument, m_aCurLibName );
+
// MI: Das gab einen GPF im SDT beim Schliessen da dann der ViewFrame die
// ObjSh loslaesst. Es wusste auch keiner mehr wozu das gut war.
// GetViewFrame()->GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
@@ -828,9 +903,22 @@ void BasicIDEShell::RemoveWindow( IDEBaseWindow* pWindow_, BOOL bDestroy, BOOL b
{
pWindow_->AddStatus( BASWIN_TOBEKILLED );
pWindow_->Hide();
- StarBASIC::Stop();
- // Es kommt kein Notify...
- pWindow_->BasicStopped();
+ // In normal mode stop basic in windows to be deleted
+ // In VBA stop basic only if the running script is trying to delete
+ // its parent module
+ bool bStop = true;
+ if ( pWindow_->GetDocument().isInVBAMode() )
+ {
+ SbModule* pMod = StarBASIC::GetActiveModule();
+ if ( !pMod || ( pMod && ( pMod->GetName() != pWindow_->GetName() ) ) )
+ bStop = false;
+ }
+ if ( bStop )
+ {
+ StarBASIC::Stop();
+ // Es kommt kein Notify...
+ pWindow_->BasicStopped();
+ }
aIDEWindowTable.Insert( nKey, pWindow_ ); // wieder einhaegen
}
}
@@ -918,8 +1006,17 @@ void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, String aLibName,
{
if ( !bCheck || ( rDocument != m_aCurDocument || aLibName != m_aCurLibName ) )
{
+ ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() );
+
+ if ( pListener )
+ pListener->removeContainerListener( m_aCurDocument, m_aCurLibName );
+
m_aCurDocument = rDocument;
+
+ pListener->addContainerListener( m_aCurDocument, aLibName );
+
m_aCurLibName = aLibName;
+
if ( bUpdateWindows )
UpdateWindows();
diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src
index f0c0727cd22f..556211f690af 100644
--- a/basctl/source/basicide/basidesh.src
+++ b/basctl/source/basicide/basidesh.src
@@ -636,6 +636,22 @@ String RID_STR_TRANSLATION_DEFAULT
{
Text [ en-US ] = "[Default Language]" ;
};
+String RID_STR_DOCUMENT_OBJECTS
+{
+ Text [ en-US ] = "Document Objects" ;
+};
+String RID_STR_USERFORMS
+{
+ Text [ en-US ] = "Forms" ;
+};
+String RID_STR_NORMAL_MODULES
+{
+ Text [ en-US ] = "Modules" ;
+};
+String RID_STR_CLASS_MODULES
+{
+ Text [ en-US ] = "Class Modules" ;
+};
String RID_STR_DLGIMP_CLASH_RENAME
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index d2672f39928f..3604866b4202 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -191,7 +191,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const
BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
if ( pIDEShell )
{
- IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rOldName, BASICIDE_TYPE_MODULE, FALSE );
+ IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rNewName, BASICIDE_TYPE_MODULE, TRUE );
if ( pWin )
{
// set new name in window
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index a37eb752e2ea..0709fe38cbe2 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -50,10 +50,51 @@
#include <com/sun/star/frame/XModuleManager.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
+#include <map>
+#include <com/sun/star/script/ModuleType.hpp>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/container/XNamed.hpp>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
+void ModuleInfoHelper::getObjectName( const uno::Reference< container::XNameContainer >& rLib, const String& rModName, String& rObjName )
+{
+ try
+ {
+ uno::Reference< script::XVBAModuleInfo > xVBAModuleInfo( rLib, uno::UNO_QUERY );
+ if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( rModName ) )
+ {
+ script::ModuleInfo aModuleInfo = xVBAModuleInfo->getModuleInfo( rModName );
+ uno::Any aObject( aModuleInfo.ModuleObject );
+ uno::Reference< lang::XServiceInfo > xServiceInfo( aObject, uno::UNO_QUERY );
+ if( xServiceInfo.is() && xServiceInfo->supportsService( rtl::OUString::createFromAscii( "ooo.vba.excel.Worksheet" ) ) )
+ {
+ uno::Reference< container::XNamed > xNamed( aObject, uno::UNO_QUERY );
+ if( xNamed.is() )
+ rObjName = xNamed->getName();
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
+sal_Int32 ModuleInfoHelper::getModuleType( const uno::Reference< container::XNameContainer >& rLib, const String& rModName )
+{
+ sal_Int32 nType = com::sun::star::script::ModuleType::NORMAL;
+ uno::Reference< script::XVBAModuleInfo > xVBAModuleInfo( rLib, uno::UNO_QUERY );
+ if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( rModName ) )
+ {
+ script::ModuleInfo aModuleInfo = xVBAModuleInfo->getModuleInfo( rModName );
+ nType = aModuleInfo.ModuleType;
+ }
+ return nType;
+}
BasicEntry::~BasicEntry()
{
@@ -88,20 +129,22 @@ BasicEntryDescriptor::BasicEntryDescriptor()
{
}
-BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, BasicEntryType eType )
+BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, BasicEntryType eType )
:m_aDocument( rDocument )
,m_eLocation( eLocation )
,m_aLibName( rLibName )
+ ,m_aLibSubName( rLibSubName )
,m_aName( rName )
,m_eType( eType )
{
OSL_ENSURE( m_aDocument.isValid(), "BasicEntryDescriptor::BasicEntryDescriptor: invalid document!" );
}
-BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, const String& rMethodName, BasicEntryType eType )
+BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, const String& rMethodName, BasicEntryType eType )
:m_aDocument( rDocument )
,m_eLocation( eLocation )
,m_aLibName( rLibName )
+ ,m_aLibSubName( rLibSubName )
,m_aName( rName )
,m_aMethodName( rMethodName )
,m_eType( eType )
@@ -117,6 +160,7 @@ BasicEntryDescriptor::BasicEntryDescriptor( const BasicEntryDescriptor& rDesc )
:m_aDocument( rDesc.m_aDocument )
,m_eLocation( rDesc.m_eLocation )
,m_aLibName( rDesc.m_aLibName )
+ ,m_aLibSubName( rDesc.m_aLibSubName )
,m_aName( rDesc.m_aName )
,m_aMethodName( rDesc.m_aMethodName )
,m_eType( rDesc.m_eType )
@@ -128,6 +172,7 @@ BasicEntryDescriptor& BasicEntryDescriptor::operator=( const BasicEntryDescripto
m_aDocument = rDesc.m_aDocument;
m_eLocation = rDesc.m_eLocation;
m_aLibName = rDesc.m_aLibName;
+ m_aLibSubName = rDesc.m_aLibSubName;
m_aName = rDesc.m_aName;
m_aMethodName = rDesc.m_aMethodName;
m_eType = rDesc.m_eType;
@@ -140,6 +185,7 @@ bool BasicEntryDescriptor::operator==( const BasicEntryDescriptor& rDesc ) const
return m_aDocument == rDesc.m_aDocument &&
m_eLocation == rDesc.m_eLocation &&
m_aLibName == rDesc.m_aLibName &&
+ m_aLibSubName == rDesc.m_aLibSubName &&
m_aName == rDesc.m_aName &&
m_aMethodName == rDesc.m_aMethodName &&
m_eType == rDesc.m_eType;
@@ -284,41 +330,46 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const
{
try
{
- // get a sorted list of module names
- Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName );
- sal_Int32 nModCount = aModNames.getLength();
- const ::rtl::OUString* pModNames = aModNames.getConstArray();
-
- for ( sal_Int32 i = 0 ; i < nModCount ; i++ )
+ if( rDocument.isInVBAMode() )
+ ImpCreateLibSubEntriesInVBAMode( pLibRootEntry, rDocument, rLibName );
+ else
{
- String aModName = pModNames[ i ];
- SvLBoxEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE );
- if ( !pModuleEntry )
- pModuleEntry = AddEntry(
- aModName,
- Image( IDEResId( RID_IMG_MODULE ) ),
- Image( IDEResId( RID_IMG_MODULE_HC ) ),
- pLibRootEntry, false,
- std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) );
+ // get a sorted list of module names
+ Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName );
+ sal_Int32 nModCount = aModNames.getLength();
+ const ::rtl::OUString* pModNames = aModNames.getConstArray();
- // methods
- if ( nMode & BROWSEMODE_SUBS )
+ for ( sal_Int32 i = 0 ; i < nModCount ; i++ )
{
- Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName );
- sal_Int32 nCount = aNames.getLength();
- const ::rtl::OUString* pNames = aNames.getConstArray();
-
- for ( sal_Int32 j = 0 ; j < nCount ; j++ )
+ String aModName = pModNames[ i ];
+ SvLBoxEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE );
+ if ( !pModuleEntry )
+ pModuleEntry = AddEntry(
+ aModName,
+ Image( IDEResId( RID_IMG_MODULE ) ),
+ Image( IDEResId( RID_IMG_MODULE_HC ) ),
+ pLibRootEntry, false,
+ std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) );
+
+ // methods
+ if ( nMode & BROWSEMODE_SUBS )
{
- String aName = pNames[ j ];
- SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD );
- if ( !pEntry )
- pEntry = AddEntry(
- aName,
- Image( IDEResId( RID_IMG_MACRO ) ),
- Image( IDEResId( RID_IMG_MACRO_HC ) ),
- pModuleEntry, false,
- std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) );
+ Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName );
+ sal_Int32 nCount = aNames.getLength();
+ const ::rtl::OUString* pNames = aNames.getConstArray();
+
+ for ( sal_Int32 j = 0 ; j < nCount ; j++ )
+ {
+ String aName = pNames[ j ];
+ SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD );
+ if ( !pEntry )
+ pEntry = AddEntry(
+ aName,
+ Image( IDEResId( RID_IMG_MACRO ) ),
+ Image( IDEResId( RID_IMG_MACRO_HC ) ),
+ pModuleEntry, false,
+ std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) );
+ }
}
}
}
@@ -365,6 +416,140 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const
}
}
+void BasicTreeListBox::ImpCreateLibSubEntriesInVBAMode( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName )
+{
+
+ ::std::vector< std::pair< BasicEntryType, ::rtl::OUString > > aEntries;
+ aEntries.push_back( ::std::make_pair( OBJ_TYPE_DOCUMENT_OBJECTS, String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) );
+ aEntries.push_back( ::std::make_pair( OBJ_TYPE_USERFORMS, String( IDEResId( RID_STR_USERFORMS ) ) ) );
+ aEntries.push_back( ::std::make_pair( OBJ_TYPE_NORMAL_MODULES, String( IDEResId( RID_STR_NORMAL_MODULES ) ) ) );
+ aEntries.push_back( ::std::make_pair( OBJ_TYPE_CLASS_MODULES, String( IDEResId( RID_STR_CLASS_MODULES ) ) ) );
+
+ ::std::vector< std::pair< BasicEntryType, ::rtl::OUString > >::iterator iter;
+ for( iter = aEntries.begin(); iter != aEntries.end(); ++iter )
+ {
+ BasicEntryType eType = iter->first;
+ ::rtl::OUString aEntryName = iter->second;
+ SvLBoxEntry* pLibSubRootEntry = FindEntry( pLibRootEntry, aEntryName, eType );
+ if( pLibSubRootEntry )
+ {
+ SetEntryBitmaps( pLibSubRootEntry, Image( IDEResId( RID_IMG_MODLIB ) ), Image( IDEResId( RID_IMG_MODLIB_HC ) ) );
+ if ( IsExpanded( pLibSubRootEntry ) )
+ ImpCreateLibSubSubEntriesInVBAMode( pLibSubRootEntry, rDocument, rLibName );
+ }
+ else
+ {
+ pLibSubRootEntry = AddEntry(
+ aEntryName,
+ Image( IDEResId( RID_IMG_MODLIB ) ),
+ Image( IDEResId( RID_IMG_MODLIB_HC ) ),
+ pLibRootEntry, true,
+ std::auto_ptr< BasicEntry >( new BasicEntry( eType ) ) );
+ }
+ }
+}
+
+void BasicTreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvLBoxEntry* pLibSubRootEntry, const ScriptDocument& rDocument, const String& rLibName )
+{
+ uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, rLibName );
+ if( !xLib.is() )
+ return;
+
+ try
+ {
+ // get a sorted list of module names
+ Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName );
+ sal_Int32 nModCount = aModNames.getLength();
+ const ::rtl::OUString* pModNames = aModNames.getConstArray();
+
+ BasicEntryDescriptor aDesc( GetEntryDescriptor( pLibSubRootEntry ) );
+ BasicEntryType eCurrentType( aDesc.GetType() );
+
+ for ( sal_Int32 i = 0 ; i < nModCount ; i++ )
+ {
+ String aModName = pModNames[ i ];
+ BasicEntryType eType = OBJ_TYPE_UNKNOWN;
+ switch( ModuleInfoHelper::getModuleType( xLib, aModName ) )
+ {
+ case script::ModuleType::DOCUMENT:
+ eType = OBJ_TYPE_DOCUMENT_OBJECTS;
+ break;
+ case script::ModuleType::FORM:
+ eType = OBJ_TYPE_USERFORMS;
+ break;
+ case script::ModuleType::NORMAL:
+ eType = OBJ_TYPE_NORMAL_MODULES;
+ break;
+ case script::ModuleType::CLASS:
+ eType = OBJ_TYPE_CLASS_MODULES;
+ break;
+ }
+ if( eType != eCurrentType )
+ continue;
+
+ // display a nice friendly name in the ObjectModule tab,
+ // combining the objectname and module name, e.g. Sheet1 ( Financials )
+ String aEntryName( aModName );
+ if( eType == OBJ_TYPE_DOCUMENT_OBJECTS )
+ {
+ String sObjName;
+ ModuleInfoHelper::getObjectName( xLib, aModName, sObjName );
+ if( sObjName.Len() )
+ {
+ aEntryName.AppendAscii(" (").Append(sObjName).AppendAscii(")");
+ }
+ }
+ SvLBoxEntry* pModuleEntry = FindEntry( pLibSubRootEntry, aEntryName, OBJ_TYPE_MODULE );
+ if ( !pModuleEntry )
+ pModuleEntry = AddEntry(
+ aEntryName,
+ Image( IDEResId( RID_IMG_MODULE ) ),
+ Image( IDEResId( RID_IMG_MODULE_HC ) ),
+ pLibSubRootEntry, false,
+ std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) );
+
+ // methods
+ if ( nMode & BROWSEMODE_SUBS )
+ {
+ Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName );
+ sal_Int32 nCount = aNames.getLength();
+ const ::rtl::OUString* pNames = aNames.getConstArray();
+
+ for ( sal_Int32 j = 0 ; j < nCount ; j++ )
+ {
+ String aName = pNames[ j ];
+ SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD );
+ if ( !pEntry )
+ pEntry = AddEntry(
+ aName,
+ Image( IDEResId( RID_IMG_MACRO ) ),
+ Image( IDEResId( RID_IMG_MACRO_HC ) ),
+ pModuleEntry, false,
+ std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) );
+ }
+ }
+ }
+ }
+ catch ( const container::NoSuchElementException& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+SvLBoxEntry* BasicTreeListBox::ImpFindEntry( SvLBoxEntry* pParent, const String& rText )
+{
+ ULONG nRootPos = 0;
+ SvLBoxEntry* pEntry = pParent ? FirstChild( pParent ) : GetEntry( nRootPos );
+ while ( pEntry )
+ {
+ if ( GetEntryText( pEntry ) == rText )
+ return pEntry;
+
+ pEntry = pParent ? NextSibling( pEntry ) : GetEntry( ++nRootPos );
+ }
+ return 0;
+}
+
void BasicTreeListBox::onDocumentCreated( const ScriptDocument& /*_rDocument*/ )
{
UpdateEntries();
@@ -477,10 +662,11 @@ long BasicTreeListBox::ExpandingHdl()
if ( aDocument.isAlive() )
{
String aLibName( aDesc.GetLibName() );
+ String aLibSubName( aDesc.GetLibSubName() );
String aName( aDesc.GetName() );
String aMethodName( aDesc.GetMethodName() );
- if ( aLibName.Len() && !aName.Len() && !aMethodName.Len() )
+ if ( aLibName.Len() && !aLibSubName.Len() && !aName.Len() && !aMethodName.Len() )
{
// check password, if library is password protected and not verified
::rtl::OUString aOULibName( aLibName );
@@ -633,7 +819,7 @@ void BasicTreeListBox::SetCurrentEntry( BasicEntryDescriptor& rDesc )
aDesc = BasicEntryDescriptor(
ScriptDocument::getApplicationScriptDocument(),
LIBRARY_LOCATION_USER, String::CreateFromAscii( "Standard" ),
- String::CreateFromAscii( "." ), OBJ_TYPE_UNKNOWN );
+ String(), String::CreateFromAscii( "." ), OBJ_TYPE_UNKNOWN );
}
ScriptDocument aDocument( aDesc.GetDocument() );
OSL_ENSURE( aDocument.isValid(), "BasicTreeListBox::SetCurrentEntry: invalid document!" );
@@ -650,14 +836,24 @@ void BasicTreeListBox::SetCurrentEntry( BasicEntryDescriptor& rDesc )
if ( pLibEntry )
{
pCurEntry = pLibEntry;
+ String aLibSubName( aDesc.GetLibSubName() );
+ if( aLibSubName.Len() )
+ {
+ Expand( pLibEntry );
+ SvLBoxEntry* pLibSubEntry = ImpFindEntry( pLibEntry, aLibSubName );
+ if( pLibSubEntry )
+ {
+ pCurEntry = pLibSubEntry;
+ }
+ }
String aName( aDesc.GetName() );
if ( aName.Len() )
{
- Expand( pLibEntry );
+ Expand( pCurEntry );
BasicEntryType eType = OBJ_TYPE_MODULE;
if ( aDesc.GetType() == OBJ_TYPE_DIALOG )
eType = OBJ_TYPE_DIALOG;
- SvLBoxEntry* pEntry = FindEntry( pLibEntry, aName, eType );
+ SvLBoxEntry* pEntry = FindEntry( pCurEntry, aName, eType );
if ( pEntry )
{
pCurEntry = pEntry;
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index 401282f7e1bf..4b4d42f477d0 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -39,7 +39,7 @@
#include <sbxitem.hxx>
#include "basobj.hxx"
-enum BasicEntryType { OBJ_TYPE_UNKNOWN, OBJ_TYPE_DOCUMENT, OBJ_TYPE_LIBRARY, OBJ_TYPE_MODULE, OBJ_TYPE_DIALOG, OBJ_TYPE_METHOD };
+enum BasicEntryType { OBJ_TYPE_UNKNOWN, OBJ_TYPE_DOCUMENT, OBJ_TYPE_LIBRARY, OBJ_TYPE_MODULE, OBJ_TYPE_DIALOG, OBJ_TYPE_METHOD, OBJ_TYPE_DOCUMENT_OBJECTS, OBJ_TYPE_USERFORMS, OBJ_TYPE_NORMAL_MODULES, OBJ_TYPE_CLASS_MODULES };
#define BROWSEMODE_MODULES 0x01
#define BROWSEMODE_SUBS 0x02
@@ -98,14 +98,15 @@ class BasicEntryDescriptor
ScriptDocument m_aDocument;
LibraryLocation m_eLocation;
String m_aLibName;
+ String m_aLibSubName; // for vba entry: Document Objects, Class Modules, Forms and Normal Modules
String m_aName;
String m_aMethodName;
BasicEntryType m_eType;
public:
BasicEntryDescriptor();
- BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, BasicEntryType eType );
- BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, const String& rMethodName, BasicEntryType eType );
+ BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, BasicEntryType eType );
+ BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, const String& rMethodName, BasicEntryType eType );
virtual ~BasicEntryDescriptor();
BasicEntryDescriptor( const BasicEntryDescriptor& rDesc );
@@ -122,6 +123,9 @@ public:
const String& GetLibName() const { return m_aLibName; }
void SetLibName( const String& aLibName ) { m_aLibName = aLibName; }
+ const String& GetLibSubName() const { return m_aLibSubName; }
+ void SetLibSubName( const String& aLibSubName ) { m_aLibSubName = aLibSubName; }
+
const String& GetName() const { return m_aName; }
void SetName( const String& aName ) { m_aName = aName; }
@@ -161,6 +165,9 @@ protected:
void ImpCreateLibEntries( SvLBoxEntry* pShellRootEntry, const ScriptDocument& rDocument, LibraryLocation eLocation );
void ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName );
+ void ImpCreateLibSubEntriesInVBAMode( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName );
+ void ImpCreateLibSubSubEntriesInVBAMode( SvLBoxEntry* pLibSubRootEntry, const ScriptDocument& rDocument, const String& rLibName );
+ SvLBoxEntry* ImpFindEntry( SvLBoxEntry* pParent, const String& rText );
// DocumentEventListener
virtual void onDocumentCreated( const ScriptDocument& _rDocument );
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index a0320d89e88a..de9eff56ca24 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -131,6 +131,14 @@ void __EXPORT BasicTreeListBox::RequestingChilds( SvLBoxEntry* pEntry )
}
}
}
+ else if ( eType == OBJ_TYPE_DOCUMENT_OBJECTS
+ || eType == OBJ_TYPE_USERFORMS
+ || eType == OBJ_TYPE_NORMAL_MODULES
+ || eType == OBJ_TYPE_CLASS_MODULES )
+ {
+ String aLibName( aDesc.GetLibName() );
+ ImpCreateLibSubSubEntriesInVBAMode( pEntry, aDocument, aLibName );
+ }
else {
DBG_ERROR( "BasicTreeListBox::RequestingChilds: Unknown Type!" );
}
@@ -201,6 +209,7 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
}
SbxVariable* pVar = 0;
+ bool bDocumentObjects = false;
if ( aEntries.Count() )
{
for ( USHORT n = 0; n < aEntries.Count(); n++ )
@@ -223,6 +232,12 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
case OBJ_TYPE_MODULE:
{
DBG_ASSERT( pVar && pVar->IsA( TYPE(StarBASIC) ), "FindVariable: Ungueltiges Basic" );
+ // extract the module name from the string like "Sheet1 (Example1)"
+ if( bDocumentObjects )
+ {
+ sal_uInt16 nIndex = 0;
+ aName = aName.GetToken( 0, ' ', nIndex );
+ }
pVar = ((StarBASIC*)pVar)->FindModule( aName );
}
break;
@@ -237,6 +252,15 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
// sbx dialogs removed
}
break;
+ case OBJ_TYPE_DOCUMENT_OBJECTS:
+ bDocumentObjects = true;
+ case OBJ_TYPE_USERFORMS:
+ case OBJ_TYPE_NORMAL_MODULES:
+ case OBJ_TYPE_CLASS_MODULES:
+ {
+ // skip, to find the child entry.
+ continue;
+ }
default:
{
DBG_ERROR( "FindVariable: Unbekannter Typ!" );
@@ -257,12 +281,13 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry )
ScriptDocument aDocument( ScriptDocument::getApplicationScriptDocument() );
LibraryLocation eLocation = LIBRARY_LOCATION_UNKNOWN;
String aLibName;
+ String aLibSubName;
String aName;
String aMethodName;
BasicEntryType eType = OBJ_TYPE_UNKNOWN;
if ( !pEntry )
- return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType );
+ return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType );
EntryArray aEntries;
@@ -329,6 +354,15 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry )
eType = pBE->GetType();
}
break;
+ case OBJ_TYPE_DOCUMENT_OBJECTS:
+ case OBJ_TYPE_USERFORMS:
+ case OBJ_TYPE_NORMAL_MODULES:
+ case OBJ_TYPE_CLASS_MODULES:
+ {
+ aLibSubName = GetEntryText( pLE );
+ eType = pBE->GetType();
+ }
+ break;
default:
{
DBG_ERROR( "GetEntryDescriptor: Unbekannter Typ!" );
@@ -342,7 +376,7 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry )
}
}
- return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType );
+ return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType );
}
USHORT BasicTreeListBox::ConvertType( BasicEntryType eType )
@@ -424,6 +458,14 @@ bool BasicTreeListBox::IsValidEntry( SvLBoxEntry* pEntry )
bIsValid = BasicIDE::HasMethod( aDocument, aLibName, aName, aMethodName );
}
break;
+ case OBJ_TYPE_DOCUMENT_OBJECTS:
+ case OBJ_TYPE_USERFORMS:
+ case OBJ_TYPE_NORMAL_MODULES:
+ case OBJ_TYPE_CLASS_MODULES:
+ {
+ bIsValid = true;
+ }
+ break;
default: ;
}
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index af42503a5dae..150e10a5a76f 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -57,6 +57,7 @@
#include <com/sun/star/script/XLibraryContainer2.hpp>
#endif
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
@@ -584,8 +585,32 @@ void __EXPORT BasicIDETabBar::Command( const CommandEvent& rCEvt )
aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE );
aPopup.RemoveDisabledEntries();
}
+ if ( aDocument.isInVBAMode() )
+ {
+ // disable to delete or remove object modules in IDE
+ BasicManager* pBasMgr = aDocument.getBasicManager();
+ if ( pBasMgr )
+ {
+ StarBASIC* pBasic = pBasMgr->GetLib( aOULibName );
+ if( pBasic )
+ {
+ IDEWindowTable& aIDEWindowTable = pIDEShell->GetIDEWindowTable();
+ IDEBaseWindow* pWin = aIDEWindowTable.Get( GetCurPageId() );
+ if( pWin && pWin->ISA( ModulWindow ) )
+ {
+ SbModule* pActiveModule = (SbModule*)pBasic->FindModule( pWin->GetName() );
+ if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
+ {
+ aPopup.EnableItem( SID_BASICIDE_DELETECURRENT, FALSE );
+ aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE );
+ }
+ }
+ }
+ }
+ }
}
+
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
if ( pDispatcher )
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index f3e41e60d34b..41a5fa488950 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -382,7 +382,15 @@ SbMethod* MacroChooser::CreateMacro()
SbModule* pModule = 0;
String aModName( aDesc.GetName() );
if ( aModName.Len() )
+ {
+ // extract the module name from the string like "Sheet1 (Example1)"
+ if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) )
+ {
+ sal_uInt16 nIndex = 0;
+ aModName = aModName.GetToken( 0, ' ', nIndex );
+ }
pModule = pBasic->FindModule( aModName );
+ }
else if ( pBasic->GetModules()->Count() )
pModule = (SbModule*)pBasic->GetModules()->Get( 0 );
@@ -710,6 +718,12 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
BasicManager* pBasMgr = aDocument.getBasicManager();
String aLib( aDesc.GetLibName() );
String aMod( aDesc.GetName() );
+ // extract the module name from the string like "Sheet1 (Example1)"
+ if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) )
+ {
+ sal_uInt16 nIndex = 0;
+ aMod = aMod.GetToken( 0, ' ', nIndex );
+ }
String aSub( aDesc.GetMethodName() );
SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLib, aMod, aSub, String() );
if ( pButton == &aEditButton )
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 478d56546f41..0f66a6ebe120 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -84,7 +84,7 @@ BOOL __EXPORT ExtBasicTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection&
if ( pEntry )
{
USHORT nDepth = GetModel()->GetDepth( pEntry );
- if ( nDepth == 2 )
+ if ( nDepth >= 2 )
{
BasicEntryDescriptor aDesc( GetEntryDescriptor( pEntry ) );
ScriptDocument aDocument( aDesc.GetDocument() );
@@ -162,7 +162,7 @@ DragDropMode __EXPORT ExtBasicTreeListBox::NotifyStartDrag( TransferDataContaine
if ( pEntry )
{
USHORT nDepth = GetModel()->GetDepth( pEntry );
- if ( nDepth == 2 )
+ if ( nDepth >= 2 )
{
nMode_ = SV_DRAGDROP_CTRL_COPY;
BasicEntryDescriptor aDesc( GetEntryDescriptor( pEntry ) );
@@ -210,7 +210,7 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry )
// don't drop on a library, which is not loaded, readonly or password protected
// or which already has a module/dialog with this name
- if ( bValid && ( nDepth == 1 || nDepth == 2 ) )
+ if ( bValid && ( nDepth > 0 ) )
{
// get source module/dialog name
BasicEntryDescriptor aSourceDesc( GetEntryDescriptor( pSelected ) );
@@ -348,7 +348,7 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyCopyingMoving( SvLBoxEntry* pTarget, Sv
rpNewParent = pTarget;
rNewChildPos = 0;
}
- else if ( nDepth == 2 )
+ else if ( nDepth >= 2 )
{
// Target = Modul/Dialog => Modul/Dialog unter das uebergeordnete Basic haengen...
rpNewParent = GetParent( pTarget );
@@ -623,20 +623,29 @@ void ObjectPage::CheckButtons()
{
// enable/disable edit button
SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry();
+ BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) );
+ ScriptDocument aDocument( aDesc.GetDocument() );
+ ::rtl::OUString aOULibName( aDesc.GetLibName() );
+ String aLibSubName( aDesc.GetLibSubName() );
+ sal_Bool bVBAEnabled = aDocument.isInVBAMode();
+ USHORT nMode = aBasicBox.GetMode();
+
USHORT nDepth = pCurEntry ? aBasicBox.GetModel()->GetDepth( pCurEntry ) : 0;
- if ( nDepth == 2 )
+ if ( nDepth >= 2 )
+ {
+ if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( nDepth == 2 ) )
+ aEditButton.Disable();
+ else
aEditButton.Enable();
+ }
else
aEditButton.Disable();
// enable/disable new module/dialog buttons
- BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) );
LibraryLocation eLocation( aDesc.GetLocation() );
BOOL bReadOnly = FALSE;
- if ( nDepth == 1 || nDepth == 2 )
+ if ( nDepth > 0 )
{
- ScriptDocument aDocument( aDesc.GetDocument() );
- ::rtl::OUString aOULibName( aDesc.GetLibName() );
Reference< script::XLibraryContainer2 > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
Reference< script::XLibraryContainer2 > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY );
if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryReadOnly( aOULibName ) ) ||
@@ -657,8 +666,13 @@ void ObjectPage::CheckButtons()
}
// enable/disable delete button
- if ( nDepth == 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE )
+ if ( nDepth >= 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE )
+ {
+ if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( ( nDepth == 2 ) || aLibSubName.Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) )
+ aDelButton.Disable();
+ else
aDelButton.Enable();
+ }
else
aDelButton.Disable();
}
@@ -685,13 +699,20 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton )
SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL;
SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry();
DBG_ASSERT( pCurEntry, "Entry?!" );
- if ( aBasicBox.GetModel()->GetDepth( pCurEntry ) == 2 )
+ if ( aBasicBox.GetModel()->GetDepth( pCurEntry ) >= 2 )
{
BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) );
if ( pDispatcher )
{
+ String aModName( aDesc.GetName() );
+ // extract the module name from the string like "Sheet1 (Example1)"
+ if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) )
+ {
+ sal_uInt16 nIndex = 0;
+ aModName = aModName.GetToken( 0, ' ', nIndex );
+ }
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDesc.GetDocument(), aDesc.GetLibName(),
- aDesc.GetName(), aBasicBox.ConvertType( aDesc.GetType() ) );
+ aModName, aBasicBox.ConvertType( aDesc.GetType() ) );
pDispatcher->Execute( SID_BASICIDE_SHOWSBX, SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L );
}
}
@@ -973,14 +994,14 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument,
try
{
::rtl::OUString sModuleCode;
+ // the module has existed
+ if( rDocument.hasModule( aLibName, aModName ) )
+ return NULL;
rDocument.createModule( aLibName, aModName, bMain, sModuleCode );
BasicManager* pBasMgr = rDocument.getBasicManager();
- if ( pBasMgr )
- {
- StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
+ StarBASIC* pBasic = pBasMgr? pBasMgr->GetLib( aLibName ) : 0;
if ( pBasic )
pModule = pBasic->FindModule( aModName );
- }
SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BASICIDE_TYPE_MODULE );
BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
@@ -1002,14 +1023,27 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument,
{
if ( !rBasicBox.IsExpanded( pLibEntry ) )
rBasicBox.Expand( pLibEntry );
- SvLBoxEntry* pEntry = rBasicBox.FindEntry( pLibEntry, aModName, OBJ_TYPE_MODULE );
+ SvLBoxEntry* pSubRootEntry = pLibEntry;
+ if( pBasic && rDocument.isInVBAMode() )
+ {
+ // add the new module in the "Modules" entry
+ SvLBoxEntry* pLibSubEntry = rBasicBox.FindEntry( pLibEntry, String( IDEResId( RID_STR_NORMAL_MODULES ) ) , OBJ_TYPE_NORMAL_MODULES );
+ if( pLibSubEntry )
+ {
+ if( !rBasicBox.IsExpanded( pLibSubEntry ) )
+ rBasicBox.Expand( pLibSubEntry );
+ pSubRootEntry = pLibSubEntry;
+ }
+ }
+
+ SvLBoxEntry* pEntry = rBasicBox.FindEntry( pSubRootEntry, aModName, OBJ_TYPE_MODULE );
if ( !pEntry )
{
pEntry = rBasicBox.AddEntry(
aModName,
Image( IDEResId( RID_IMG_MODULE ) ),
Image( IDEResId( RID_IMG_MODULE_HC ) ),
- pLibEntry, false,
+ pSubRootEntry, false,
std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) );
DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" );
}
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index dd10a00e2bde..a8c6d24a3ff5 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -53,6 +53,8 @@
#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <com/sun/star/script/XVBACompat.hpp>
/** === end UNO includes === **/
#include <sfx2/objsh.hxx>
@@ -139,6 +141,9 @@ namespace basctl
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::document::XEventBroadcaster;
using ::com::sun::star::document::XEmbeddedScripts;
+ using ::com::sun::star::script::ModuleInfo;
+ using ::com::sun::star::script::XVBAModuleInfo;
+ using ::com::sun::star::script::XVBACompat;
/** === end UNO using === **/
namespace MacroExecMode = ::com::sun::star::document::MacroExecMode;
namespace FrameSearchFlag = ::com::sun::star::frame::FrameSearchFlag;
@@ -272,6 +277,7 @@ namespace basctl
// versions with the same signature/semantics as in ScriptDocument itself
bool isReadOnly() const;
+ bool isInVBAMode() const;
BasicManager*
getBasicManager() const;
Reference< XModel >
@@ -444,6 +450,20 @@ namespace basctl
return bIsReadOnly;
}
+ bool ScriptDocument_Impl::isInVBAMode() const
+ {
+ bool bResult = false;
+#ifdef FUTURE_VBA_CWS
+ if ( !isApplication() )
+ {
+ Reference< XVBACompat > xVBACompat( getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
+ if ( xVBACompat.is() )
+ bResult = xVBACompat->getVBACompatModeOn();
+ }
+#endif
+ return bResult;
+ }
+
//--------------------------------------------------------------------
BasicManager* ScriptDocument_Impl::getBasicManager() const
{
@@ -671,6 +691,16 @@ namespace basctl
}
// insert element by new name in container
+ else if ( _eType == E_SCRIPTS )
+ {
+ Reference< XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY );
+ if ( xVBAModuleInfo->hasModuleInfo( _rOldName ) )
+ {
+ ModuleInfo sModuleInfo = xVBAModuleInfo->getModuleInfo( _rOldName );
+ xVBAModuleInfo->removeModuleInfo( _rOldName );
+ xVBAModuleInfo->insertModuleInfo( _rNewName, sModuleInfo );
+ }
+ }
xLib->insertByName( _rNewName, aElement );
return true;
}
@@ -735,7 +765,6 @@ namespace basctl
Reference< XNameContainer > xLib( getOrCreateLibrary( E_SCRIPTS, _rLibName ), UNO_QUERY_THROW );
if ( !xLib->hasByName( _rModName ) )
return false;
-
xLib->replaceByName( _rModName, makeAny( _rModuleCode ) );
return true;
}
@@ -1351,6 +1380,11 @@ namespace basctl
return m_pImpl->isApplication();
}
+ bool ScriptDocument::isInVBAMode() const
+ {
+ return m_pImpl->isInVBAMode();
+ }
+
//--------------------------------------------------------------------
BasicManager* ScriptDocument::getBasicManager() const
{
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index cf21d3488dd3..07bc2dfa3149 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -46,6 +46,7 @@
#include <com/sun/star/io/XInputStreamProvider.hpp>
#endif
+#include <com/sun/star/container/XContainerListener.hpp>
//----------------------------------------------------------------------------
@@ -105,6 +106,8 @@ friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const Strin
BOOL m_bAppBasicModified;
::basctl::DocumentEventNotifier
m_aNotifier;
+friend class ContainerListenerImpl;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xLibListener;
#if _SOLAR__PRIVATE
void Init();
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index c9981001e456..bc588fccaf14 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -328,5 +328,13 @@ BOOL QueryDelModule( const String& rName, Window* pParent = 0 );
BOOL QueryDelLib( const String& rName, BOOL bRef = FALSE, Window* pParent = 0 );
BOOL QueryPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xLibContainer, const String& rLibName, String& rPassword, BOOL bRepeat = FALSE, BOOL bNewTitle = FALSE );
-
+class ModuleInfoHelper
+{
+ModuleInfoHelper();
+ModuleInfoHelper(const ModuleInfoHelper&);
+ModuleInfoHelper& operator = (const ModuleInfoHelper&);
+public:
+ static void getObjectName( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rLib, const String& rModName, String& rObjName );
+ static sal_Int32 getModuleType( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rLib, const String& rModName );
+};
#endif // _BASTYPES_HXX
diff --git a/basctl/source/inc/scriptdocument.hxx b/basctl/source/inc/scriptdocument.hxx
index 34d1a72963ce..9439c05f7249 100644
--- a/basctl/source/inc/scriptdocument.hxx
+++ b/basctl/source/inc/scriptdocument.hxx
@@ -212,6 +212,7 @@ namespace basctl
*/
bool isAlive() const;
+ bool isInVBAMode() const;
/// returns the BasicManager associated with this instance
BasicManager*
getBasicManager() const;
diff --git a/basic/inc/basic/sberrors.hxx b/basic/inc/basic/sberrors.hxx
index c21b3b0237b8..c34176e0bde7 100644
--- a/basic/inc/basic/sberrors.hxx
+++ b/basic/inc/basic/sberrors.hxx
@@ -287,6 +287,8 @@ typedef ULONG SbError;
#define ERRCODE_BASIC_LOOP_NOT_INIT ((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \
ERRCODE_CLASS_COMPILER) // For loop not initialized
+#define ERRCODE_BASIC_COMPAT ((LAST_SBX_ERROR_ID+103UL)| ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME)
+
// Map old codes to new codes
#define SbERR_SYNTAX ERRCODE_BASIC_SYNTAX
#define SbERR_NO_GOSUB ERRCODE_BASIC_NO_GOSUB
@@ -410,6 +412,7 @@ typedef ULONG SbError;
#define SbERR_PROG_TOO_LARGE ERRCODE_BASIC_PROG_TOO_LARGE
#define SbERR_NO_STRINGS_ARRAYS ERRCODE_BASIC_NO_STRINGS_ARRAYS
#define SbERR_BASIC_EXCEPTION ERRCODE_BASIC_EXCEPTION
+#define SbERR_BASIC_COMPAT ERRCODE_BASIC_COMPAT
#define SbERR_BASIC_ARRAY_FIX ERRCODE_BASIC_ARRAY_FIX
#define SbERR_BASIC_STRING_OVERFLOW ERRCODE_BASIC_STRING_OVERFLOW
#define SbERR_BASIC_EXPR_TOO_COMPLEX ERRCODE_BASIC_EXPR_TOO_COMPLEX
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index d73c9780b1bb..63ffef6cdd61 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -31,9 +31,7 @@
#include <basic/sbdef.hxx>
#include <basic/sbxobj.hxx>
#include <basic/sbxdef.hxx>
-#ifndef _RTL_USTRING_HXX
#include <rtl/ustring.hxx>
-#endif
class SbMethod;
class SbProperty;
@@ -63,6 +61,10 @@ protected:
SbiImage* pImage; // the Image
SbiBreakpoints* pBreaks; // Breakpoints
SbClassData* pClassData;
+ BOOL mbVBACompat;
+ INT32 mnType;
+ SbxObjectRef pDocObject; // an impl object ( used by Document Modules )
+ bool bIsProxyModule;
void StartDefinitions();
SbMethod* GetMethod( const String&, SbxDataType );
@@ -87,7 +89,7 @@ protected:
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2);
TYPEINFO();
- SbModule( const String& );
+ SbModule( const String&, BOOL bCompat = FALSE );
virtual void SetParent( SbxObject* );
virtual void Clear();
@@ -123,6 +125,11 @@ public:
BOOL LoadBinaryData( SvStream& );
BOOL ExceedsLegacyModuleSize();
void fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = NULL ) const;
+ BOOL IsVBACompat();
+ void SetVBACompat( BOOL bCompat );
+ INT32 GetModuleType() { return mnType; }
+ void SetModuleType( INT32 nType ) { mnType = nType; }
+ bool GetIsProxyModule() { return bIsProxyModule; }
};
#ifndef __SB_SBMODULEREF_HXX
diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx
new file mode 100644
index 000000000000..ad804dcfab38
--- /dev/null
+++ b/basic/inc/basic/sbobjmod.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sbobjmod.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: $ $Date: 2007/08/27 16:31:39 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SB_OBJMOD_HXX
+#define _SB_OBJMOD_HXX
+
+#include <basic/sbmod.hxx>
+#include <basic/sbstar.hxx>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/awt/XDialog.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
+namespace css = ::com::sun::star;
+
+// Basic-Module for excel object.
+
+class SbObjModule : public SbModule
+{
+ SbObjModule( const SbObjModule& );
+ SbObjModule();
+public:
+ TYPEINFO();
+ SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible );
+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
+ using SbxValue::GetObject;
+ SbxVariable* GetObject();
+ void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ;
+};
+
+class SbUserFormModule : public SbObjModule
+{
+ css::uno::Reference<css::lang::XEventListener> m_DialogListener;
+ css::uno::Reference<css::awt::XDialog> m_xDialog;
+ css::uno::Reference<css::frame::XModel> m_xModel;
+ String sFormName;
+ bool mbInit;
+ SbUserFormModule( const SbUserFormModule& );
+ SbUserFormModule();
+
+protected:
+ virtual void InitObject();
+public:
+ TYPEINFO();
+ SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
+ void ResetApiObj();
+ void Unload();
+ void load();
+ void triggerMethod( const String& );
+ void triggerMethod( const String&, css::uno::Sequence< css::uno::Any >& );
+ void triggerActivateEvent();
+ void triggerDeActivateEvent();
+ void triggerInitializeEvent();
+ void triggerTerminateEvent();
+};
+
+#ifndef __SB_SBOBJMODULEREF_HXX
+#define __SB_SBOBJMODULEREF_HXX
+
+SV_DECL_IMPL_REF(SbObjModule);
+
+#endif
+#endif
+
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index bdc4aa011cc9..a234dc206ec7 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -37,6 +37,7 @@
#include <basic/sbdef.hxx>
#include <basic/sberrors.hxx>
+#include <com/sun/star/script/ModuleInfo.hpp>
class SbModule; // completed module
class SbiInstance; // runtime instance
@@ -69,6 +70,7 @@ class StarBASIC : public SbxObject
BOOL bNoRtl; // if TRUE: do not search RTL
BOOL bBreak; // if TRUE: Break, otherwise Step
BOOL bDocBasic;
+ BOOL bVBAEnabled;
BasicLibInfo* pLibInfo; // Info block for basic manager
SbLanguageMode eLanguageMode; // LanguageMode of the basic object
BOOL bQuit;
@@ -117,6 +119,7 @@ public:
// Compiler-Interface
SbModule* MakeModule( const String& rName, const String& rSrc );
SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc );
+ SbModule* MakeModule32( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, const ::rtl::OUString& rSrc );
BOOL Compile( SbModule* );
BOOL Disassemble( SbModule*, String& rText );
static void Stop();
@@ -189,6 +192,8 @@ public:
( const String& rName, USHORT& rStatus );
static SbMethod* GetActiveMethod( USHORT nLevel = 0 );
static SbModule* GetActiveModule();
+ void SetVBAEnabled( BOOL bEnabled );
+ BOOL isVBAEnabled();
// #60175 TRUE: SFX-Resource is not displayed on basic errors
static void StaticSuppressSfxResource( BOOL bSuppress );
diff --git a/basic/inc/basic/sbuno.hxx b/basic/inc/basic/sbuno.hxx
index 68e2c6ab8778..d816d424313b 100644
--- a/basic/inc/basic/sbuno.hxx
+++ b/basic/inc/basic/sbuno.hxx
@@ -41,5 +41,7 @@ void createAllObjectProperties( SbxObject* pObj );
::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar );
+void unoToSbxValue( SbxVariable* pVar, const ::com::sun::star::uno::Any& aValue );
+
#endif
diff --git a/basic/prj/build.lst b/basic/prj/build.lst
index 994901580c86..2cd1d3dc0466 100644..100755
--- a/basic/prj/build.lst
+++ b/basic/prj/build.lst
@@ -1,4 +1,4 @@
-sb basic : l10n offuh svtools xmlscript framework NULL
+sb basic : l10n offuh oovbaapi svtools xmlscript framework 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/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 7646667bc277..c242165df825 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -41,6 +41,7 @@
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <basic/sbmod.hxx>
+#include <basic/sbobjmod.hxx>
#include <basic/sbuno.hxx>
#include <basic/basmgr.hxx>
@@ -65,6 +66,9 @@
#include <com/sun/star/script/XStarBasicDialogInfo.hpp>
#include <com/sun/star/script/XStarBasicLibraryInfo.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <com/sun/star/script/XVBACompat.hpp>
#include <cppuhelper/implbase1.hxx>
@@ -236,7 +240,15 @@ void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
Any aElement = xLibNameAccess->getByName( aModuleName );
::rtl::OUString aMod;
aElement >>= aMod;
- pLib->MakeModule32( aModuleName, aMod );
+ Reference< XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, UNO_QUERY );
+ if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aModuleName ) )
+ {
+ ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aModuleName );
+ OSL_TRACE("#addLibraryModulesImpl - aMod");
+ pLib->MakeModule32( aModuleName, mInfo, aMod );
+ }
+ else
+ pLib->MakeModule32( aModuleName, aMod );
}
}
@@ -270,11 +282,16 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
{
Reference< XLibraryContainer > xScriptCont( Event.Source, UNO_QUERY );
insertLibraryImpl( xScriptCont, mpMgr, Event.Element, aName );
+ StarBASIC* pLib = mpMgr->GetLib( aName );
+ if ( pLib )
+ {
+ Reference<XVBACompat> xVBACompat( xScriptCont, UNO_QUERY );
+ if ( xVBACompat.is() )
+ pLib->SetVBAEnabled( xVBACompat->getVBACompatModeOn() );
+ }
}
else
{
- ::rtl::OUString aMod;
- Event.Element >>= aMod;
StarBASIC* pLib = mpMgr->GetLib( maLibName );
DBG_ASSERT( pLib, "BasMgrContainerListenerImpl::elementInserted: Unknown lib!");
@@ -283,7 +300,16 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
SbModule* pMod = pLib->FindModule( aName );
if( !pMod )
{
- pLib->MakeModule32( aName, aMod );
+ ::rtl::OUString aMod;
+ Event.Element >>= aMod;
+ Reference< XVBAModuleInfo > xVBAModuleInfo( Event.Source, UNO_QUERY );
+ if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aName ) )
+ {
+ ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aName );
+ pLib->MakeModule32( aName, mInfo, aMod );
+ }
+ else
+ pLib->MakeModule32( aName, aMod );
pLib->SetModified( FALSE );
}
}
@@ -312,10 +338,11 @@ void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const ContainerEvent
SbModule* pMod = pLib->FindModule( aName );
::rtl::OUString aMod;
Event.Element >>= aMod;
+
if( pMod )
- pMod->SetSource32( aMod );
+ pMod->SetSource32( aMod );
else
- pLib->MakeModule32( aName, aMod );
+ pLib->MakeModule32( aName, aMod );
pLib->SetModified( FALSE );
}
diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx
new file mode 100644
index 000000000000..0ec0454e2bb5
--- /dev/null
+++ b/basic/source/classes/errobject.cxx
@@ -0,0 +1,225 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General 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 "errobject.hxx"
+
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/script/XDefaultProperty.hpp>
+#include "sbintern.hxx"
+#include "runtime.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::ooo;
+
+typedef ::cppu::WeakImplHelper2< vba::XErrObject, script::XDefaultProperty > ErrObjectImpl_BASE;
+
+class ErrObject : public ErrObjectImpl_BASE
+{
+ rtl::OUString m_sHelpFile;
+ rtl::OUString m_sSource;
+ rtl::OUString m_sDescription;
+ sal_Int32 m_nNumber;
+ sal_Int32 m_nHelpContext;
+
+public:
+ ErrObject();
+ ~ErrObject();
+ // Attributes
+ virtual ::sal_Int32 SAL_CALL getNumber() throw (uno::RuntimeException);
+ virtual void SAL_CALL setNumber( ::sal_Int32 _number ) throw (uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHelpContext() throw (uno::RuntimeException);
+ virtual void SAL_CALL setHelpContext( ::sal_Int32 _helpcontext ) throw (uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getHelpFile() throw (uno::RuntimeException);
+ virtual void SAL_CALL setHelpFile( const ::rtl::OUString& _helpfile ) throw (uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getDescription() throw (uno::RuntimeException);
+ virtual void SAL_CALL setDescription( const ::rtl::OUString& _description ) throw (uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getSource() throw (uno::RuntimeException);
+ virtual void SAL_CALL setSource( const ::rtl::OUString& _source ) throw (uno::RuntimeException);
+
+ // Methods
+ virtual void SAL_CALL Clear( ) throw (uno::RuntimeException);
+ virtual void SAL_CALL Raise( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description, const uno::Any& HelpFile, const uno::Any& HelpContext ) throw (uno::RuntimeException);
+ // XDefaultProperty
+ virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (uno::RuntimeException);
+
+ // Helper method
+ void setData( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description,
+ const uno::Any& HelpFile, const uno::Any& HelpContext ) throw (uno::RuntimeException);
+};
+
+
+ErrObject::~ErrObject()
+{
+}
+
+ErrObject::ErrObject() : m_nNumber(0), m_nHelpContext(0)
+{
+}
+
+sal_Int32 SAL_CALL
+ErrObject::getNumber() throw (uno::RuntimeException)
+{
+ return m_nNumber;
+}
+
+void SAL_CALL
+ErrObject::setNumber( ::sal_Int32 _number ) throw (uno::RuntimeException)
+{
+ pINST->setErrorVB( _number, String() );
+ ::rtl::OUString _description = pINST->GetErrorMsg();
+ setData( uno::makeAny( _number ), uno::Any(), uno::makeAny( _description ), uno::Any(), uno::Any() );
+}
+
+::sal_Int32 SAL_CALL
+ErrObject::getHelpContext() throw (uno::RuntimeException)
+{
+ return m_nHelpContext;
+}
+void SAL_CALL
+ErrObject::setHelpContext( ::sal_Int32 _helpcontext ) throw (uno::RuntimeException)
+{
+ m_nHelpContext = _helpcontext;
+}
+
+::rtl::OUString SAL_CALL
+ErrObject::getHelpFile() throw (uno::RuntimeException)
+{
+ return m_sHelpFile;
+}
+
+void SAL_CALL
+ErrObject::setHelpFile( const ::rtl::OUString& _helpfile ) throw (uno::RuntimeException)
+{
+ m_sHelpFile = _helpfile;
+}
+
+::rtl::OUString SAL_CALL
+ErrObject::getDescription() throw (uno::RuntimeException)
+{
+ return m_sDescription;
+}
+
+void SAL_CALL
+ErrObject::setDescription( const ::rtl::OUString& _description ) throw (uno::RuntimeException)
+{
+ m_sDescription = _description;
+}
+
+::rtl::OUString SAL_CALL
+ErrObject::getSource() throw (uno::RuntimeException)
+{
+ return m_sSource;
+}
+
+void SAL_CALL
+ErrObject::setSource( const ::rtl::OUString& _source ) throw (uno::RuntimeException)
+{
+ m_sSource = _source;
+}
+
+// Methods
+void SAL_CALL
+ErrObject::Clear( ) throw (uno::RuntimeException)
+{
+ m_sHelpFile = rtl::OUString();
+ m_sSource = m_sHelpFile;
+ m_sDescription = m_sSource;
+ m_nNumber = 0;
+ m_nHelpContext = 0;
+}
+
+void SAL_CALL
+ErrObject::Raise( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description, const uno::Any& HelpFile, const uno::Any& HelpContext ) throw (uno::RuntimeException)
+{
+ setData( Number, Source, Description, HelpFile, HelpContext );
+ if ( m_nNumber )
+ pINST->ErrorVB( m_nNumber, m_sDescription );
+}
+
+// XDefaultProperty
+::rtl::OUString SAL_CALL
+ErrObject::getDefaultPropertyName( ) throw (uno::RuntimeException)
+{
+ static rtl::OUString sDfltPropName( RTL_CONSTASCII_USTRINGPARAM("Number") );
+ return sDfltPropName;
+}
+
+void ErrObject::setData( const uno::Any& Number, const uno::Any& Source, const uno::Any& Description, const uno::Any& HelpFile, const uno::Any& HelpContext )
+ throw (uno::RuntimeException)
+{
+ if ( !Number.hasValue() )
+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Missing Required Paramater"), uno::Reference< uno::XInterface >() );
+ Number >>= m_nNumber;
+ Description >>= m_sDescription;
+ Source >>= m_sSource;
+ HelpFile >>= m_sHelpFile;
+ HelpContext >>= m_nHelpContext;
+}
+
+// SbxErrObject
+SbxErrObject::SbxErrObject( const String& rName, const Any& rUnoObj )
+ : SbUnoObject( rName, rUnoObj )
+ , m_pErrObject( NULL )
+{
+ OSL_TRACE("SbxErrObject::SbxErrObject ctor");
+ rUnoObj >>= m_xErr;
+ if ( m_xErr.is() )
+ {
+ SetDfltProperty( uno::Reference< script::XDefaultProperty >( m_xErr, uno::UNO_QUERY_THROW )->getDefaultPropertyName() ) ;
+ m_pErrObject = static_cast< ErrObject* >( m_xErr.get() );
+ }
+}
+
+SbxErrObject::~SbxErrObject()
+{
+ OSL_TRACE("SbxErrObject::~SbxErrObject dtor");
+}
+
+uno::Reference< vba::XErrObject >
+SbxErrObject::getUnoErrObject()
+{
+ SbxVariable* pVar = getErrObject();
+ SbxErrObject* pGlobErr = static_cast< SbxErrObject* >( pVar );
+ return pGlobErr->m_xErr;
+}
+
+SbxVariableRef
+SbxErrObject::getErrObject()
+{
+ static SbxVariableRef pGlobErr = new SbxErrObject( String( RTL_CONSTASCII_USTRINGPARAM("Err")), uno::makeAny( uno::Reference< vba::XErrObject >( new ErrObject() ) ) );
+ return pGlobErr;
+}
+
+void SbxErrObject::setNumberAndDescription( ::sal_Int32 _number, const ::rtl::OUString& _description )
+ throw (uno::RuntimeException)
+{
+ if( m_pErrObject != NULL )
+ m_pErrObject->setData( uno::makeAny( _number ), uno::Any(), uno::makeAny( _description ), uno::Any(), uno::Any() );
+}
+
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 5c57af5b6ce8..791e9fe5a8c1 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -55,13 +55,17 @@
#include <com/sun/star/awt/XDialogProvider.hpp>
#include <com/sun/star/frame/XModel.hpp>
-
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <basic/basicmanagerrepository.hxx>
+#include <basic/basmgr.hxx>
//==================================================================================================
#include <xmlscript/xmldlg_imexp.hxx>
#include <sbunoobj.hxx>
#include <basic/sbstar.hxx>
#include <basic/sbmeth.hxx>
+#include <basic/sbuno.hxx>
#include <runtime.hxx>
#include <sbintern.hxx>
@@ -85,11 +89,6 @@ using namespace ::osl;
-//===================================================================
-void unoToSbxValue( SbxVariable* pVar, const Any& aValue );
-Any sbxToUnoValue( SbxVariable* pVar );
-
-
Reference< frame::XModel > getModelFromBasic( SbxObject* pBasic )
{
OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" );
@@ -450,6 +449,43 @@ Any implFindDialogLibForDialog( const Any& rDlgAny, SbxObject* pBasic )
return aRetDlgLibAny;
}
+Any implFindDialogLibForDialogBasic( const Any& aAnyISP, SbxObject* pBasic, StarBASIC*& pFoundBasic )
+{
+ Any aDlgLibAny;
+ // Find dialog library for dialog, direct access is not possible here
+ StarBASIC* pStartedBasic = (StarBASIC*)pBasic;
+ SbxObject* pParentBasic = pStartedBasic ? pStartedBasic->GetParent() : NULL;
+ SbxObject* pParentParentBasic = pParentBasic ? pParentBasic->GetParent() : NULL;
+
+ SbxObject* pSearchBasic1 = NULL;
+ SbxObject* pSearchBasic2 = NULL;
+ if( pParentParentBasic )
+ {
+ pSearchBasic1 = pParentBasic;
+ pSearchBasic2 = pParentParentBasic;
+ }
+ else
+ {
+ pSearchBasic1 = pStartedBasic;
+ pSearchBasic2 = pParentBasic;
+ }
+ if( pSearchBasic1 )
+ {
+ aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic1 );
+
+ if ( aDlgLibAny.hasValue() )
+ pFoundBasic = (StarBASIC*)pSearchBasic1;
+
+ else if( pSearchBasic2 )
+ {
+ aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic2 );
+ if ( aDlgLibAny.hasValue() )
+ pFoundBasic = (StarBASIC*)pSearchBasic2;
+ }
+ }
+ return aDlgLibAny;
+}
+
static ::rtl::OUString aDecorationPropName =
::rtl::OUString::createFromAscii( "Decoration" );
static ::rtl::OUString aTitlePropName =
@@ -529,39 +565,54 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
{}
}
- // Find dialog library for dialog, direct access is not possible here
- StarBASIC* pStartedBasic = pINST->GetBasic();
- SbxObject* pParentBasic = pStartedBasic ? pStartedBasic->GetParent() : NULL;
- SbxObject* pParentParentBasic = pParentBasic ? pParentBasic->GetParent() : NULL;
-
- SbxObject* pSearchBasic1 = NULL;
- SbxObject* pSearchBasic2 = NULL;
- if( pParentParentBasic )
+ Any aDlgLibAny;
+ bool bDocDialog = false;
+ StarBASIC* pFoundBasic = NULL;
+ OSL_TRACE("About to try get a hold of ThisComponent");
+ Reference< frame::XModel > xModel = getModelFromBasic( pINST->GetBasic() ) ;
+ aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pINST->GetBasic(), pFoundBasic );
+ // If we found the dialog then it belongs to the Search basic
+ if ( !pFoundBasic )
{
- pSearchBasic1 = pParentBasic;
- pSearchBasic2 = pParentParentBasic;
- }
- else
+ Reference< frame::XDesktop > xDesktop( xMSF->createInstance
+ ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
+ UNO_QUERY );
+ Reference< container::XEnumeration > xModels;
+ if ( xDesktop.is() )
{
- pSearchBasic1 = pStartedBasic;
- pSearchBasic2 = pParentBasic;
- }
-
- Any aDlgLibAny;
- if( pSearchBasic1 )
+ Reference< container::XEnumerationAccess > xComponents( xDesktop->getComponents(), UNO_QUERY );
+ if ( xComponents.is() )
+ xModels.set( xComponents->createEnumeration(), UNO_QUERY );
+ if ( xModels.is() )
+ {
+ while ( xModels->hasMoreElements() )
+ {
+ Reference< frame::XModel > xNextModel( xModels->nextElement(), UNO_QUERY );
+ if ( xNextModel.is() )
+ {
+ BasicManager* pMgr = basic::BasicManagerRepository::getDocumentBasicManager( xNextModel );
+ if ( pMgr )
+ aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pMgr->GetLib(0), pFoundBasic );
+ if ( aDlgLibAny.hasValue() )
{
- aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic1 );
- if( pSearchBasic2 && aDlgLibAny.getValueType().getTypeClass() == TypeClass_VOID )
- aDlgLibAny = implFindDialogLibForDialog( aAnyISP, pSearchBasic2 );
+ bDocDialog = true;
+ xModel = xNextModel;
+ break;
}
-
-
- OSL_TRACE("About to try get a hold of ThisComponent");
- Reference< frame::XModel > xModel = getModelFromBasic( pStartedBasic ) ;
- Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pStartedBasic, xModel );
+ }
+ }
+ }
+ }
+ }
+ if ( pFoundBasic )
+ bDocDialog = pFoundBasic->IsDocBasic();
+ Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pINST->GetBasic(), xModel );
Sequence< Any > aArgs( 4 );
- aArgs[ 0 ] <<= xModel;
+ if( bDocDialog )
+ aArgs[ 0 ] <<= xModel;
+ else
+ aArgs[ 0 ] <<= uno::Reference< uno::XInterface >();
aArgs[ 1 ] <<= xInput;
aArgs[ 2 ] = aDlgLibAny;
aArgs[ 3 ] <<= xScriptListener;
diff --git a/basic/source/classes/makefile.mk b/basic/source/classes/makefile.mk
index eb5486f02abf..e00ed4674cc1 100644
--- a/basic/source/classes/makefile.mk
+++ b/basic/source/classes/makefile.mk
@@ -37,18 +37,28 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+ALLTAR .SEQUENTIAL : \
+ $(MISC)$/$(TARGET).don \
+ $(MISC)$/$(TARGET).slo
+
+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+ +$(CPPUMAKER) -O$(OUT)$/inc -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
+ echo $@
+
+$(MISC)$/$(TARGET).slo : $(SLOTARGET)
+ echo $@
+
# --- Allgemein -----------------------------------------------------------
-COMMON_SLOFILES= \
+SLOFILES= \
$(SLO)$/sb.obj \
$(SLO)$/sbxmod.obj \
$(SLO)$/image.obj \
$(SLO)$/sbintern.obj \
$(SLO)$/sbunoobj.obj \
$(SLO)$/propacc.obj \
- $(SLO)$/disas.obj
-
-SLOFILES= $(COMMON_SLOFILES) \
+ $(SLO)$/disas.obj \
+ $(SLO)$/errobject.obj \
$(SLO)$/eventatt.obj
OBJFILES= \
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 3373442e5eb2..4f2f90d5da1f 100755
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -49,12 +49,18 @@
#include "disas.hxx"
#include "runtime.hxx"
#include <basic/sbuno.hxx>
+#include <basic/sbobjmod.hxx>
#include "stdobj.hxx"
#include "filefmt.hxx"
#include "sb.hrc"
#include <basrid.hxx>
#include <vos/mutex.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include "errobject.hxx"
+
+#include <com/sun/star/script/ModuleType.hpp>
+#include <com/sun/star/script/ModuleInfo.hpp>
+using namespace ::com::sun::star::script;
// #pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE )
@@ -238,6 +244,7 @@ const SFX_VB_ErrorItem __FAR_DATA SFX_VB_ErrorTab[] =
{ 1004, SbERR_METHOD_FAILED },
{ 1005, SbERR_SETPROP_FAILED },
{ 1006, SbERR_GETPROP_FAILED },
+ { 1007, SbERR_BASIC_COMPAT },
{ 0xFFFF, 0xFFFFFFFFL } // End mark
};
@@ -508,6 +515,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
}
}
}
+ SetModuleType( ModuleType::CLASS );
}
SbClassModuleObject::~SbClassModuleObject()
@@ -705,6 +713,7 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic )
SetParent( p );
pLibInfo = NULL;
bNoRtl = bBreak = FALSE;
+ bVBAEnabled = FALSE;
pModules = new SbxArray;
if( !GetSbData()->nInst++ )
@@ -805,7 +814,34 @@ SbModule* StarBASIC::MakeModule( const String& rName, const String& rSrc )
SbModule* StarBASIC::MakeModule32( const String& rName, const ::rtl::OUString& rSrc )
{
- SbModule* p = new SbModule( rName );
+ ModuleInfo mInfo;
+ mInfo.ModuleType = ModuleType::NORMAL;
+ return MakeModule32( rName, mInfo, rSrc );
+}
+SbModule* StarBASIC::MakeModule32( const String& rName, const ModuleInfo& mInfo, const rtl::OUString& rSrc )
+{
+
+ OSL_TRACE("create module %s type mInfo %d", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), mInfo.ModuleType );
+ SbModule* p = NULL;
+ switch ( mInfo.ModuleType )
+ {
+ case ModuleType::DOCUMENT:
+ // In theory we should be able to create Object modules
+ // in ordinary basic ( in vba mode thought these are create
+ // by the application/basic and not by the user )
+ p = new SbObjModule( rName, mInfo, isVBAEnabled() );
+ break;
+ case ModuleType::CLASS:
+ p = new SbModule( rName, isVBAEnabled() );
+ p->SetModuleType( ModuleType::CLASS );
+ break;
+ case ModuleType::FORM:
+ p = new SbUserFormModule( rName, mInfo, isVBAEnabled() );
+ break;
+ default:
+ p = new SbModule( rName, isVBAEnabled() );
+
+ }
p->SetSource32( rSrc );
p->SetParent( this );
pModules->Insert( p, pModules->Count() );
@@ -981,6 +1017,12 @@ SbxVariable* StarBASIC::Find( const String& rName, SbxClassType t )
}
pNamed = p;
}
+ // Only variables qualified by the Module Name e.g. Sheet1.foo
+ // should work for Documant && Class type Modules
+ INT32 nType = p->GetModuleType();
+ if ( nType == ModuleType::DOCUMENT || nType == ModuleType::FORM )
+ continue;
+
// otherwise check if the element is available
// unset GBLSEARCH-Flag (due to Rekursion)
USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH;
@@ -1352,6 +1394,7 @@ void StarBASIC::MakeErrorText( SbError nId, const String& aMsg )
}
else
GetSbData()->aErrMsg = String::EmptyString();
+
}
BOOL StarBASIC::CError
@@ -1408,7 +1451,22 @@ BOOL StarBASIC::RTError( SbError code, const String& rMsg, USHORT l, USHORT c1,
// Umsetzung des Codes fuer String-Transport in SFX-Error
if( rMsg.Len() )
- code = (ULONG)*new StringErrorInfo( code, String(rMsg) );
+ {
+ // very confusing, even though MakeErrorText sets up the error text
+ // seems that this is not used ( if rMsg already has content )
+ // In the case of VBA MakeErrorText also formats the error to be alittle more
+ // like vba ( adds an error number etc )
+ if ( SbiRuntime::isVBAEnabled() && ( code == SbERR_BASIC_COMPAT ) )
+ {
+ String aTmp = '\'';
+ aTmp += String::CreateFromInt32( SbxErrObject::getUnoErrObject()->getNumber() );
+ aTmp += String( RTL_CONSTASCII_USTRINGPARAM("\'\n") );
+ aTmp += GetSbData()->aErrMsg.Len() ? GetSbData()->aErrMsg : rMsg;
+ code = (ULONG)*new StringErrorInfo( code, aTmp );
+ }
+ else
+ code = (ULONG)*new StringErrorInfo( code, String(rMsg) );
+ }
SetErrorData( code, l, c1, c2 );
if( GetSbData()->aErrHdl.IsSet() )
diff --git a/basic/source/classes/sb.src b/basic/source/classes/sb.src
index 926da0359d7e..73cc1c3a0b2c 100644
--- a/basic/source/classes/sb.src
+++ b/basic/source/classes/sb.src
@@ -588,6 +588,10 @@ Resource RID_BASIC_START
{
Text [ en-US ] = "For loop not initialized." ;
};
+ String ERRCODE_BASIC_COMPAT & ERRCODE_RES_MASK
+ {
+ Text [ en-US ] = "$(ARG1)" ;
+ };
};
// Hinweis: IDS_SBERR_TERMINATED = IDS_SBERR_START+2000.
String IDS_SBERR_TERMINATED
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 1c95b4f30de6..849fd839bfd1 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -567,7 +567,7 @@ SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass )
}
return eRetType;
}
-void unoToSbxValue( SbxVariable* pVar, const Any& aValue );
+
static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int32 >& indices, Sequence< sal_Int32 >& sizes, const Any& aValue, sal_Int32& dimension, sal_Bool bIsZeroIndex, Type* pType = NULL )
{
Type aType = aValue.getValueType();
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 092ef458041e..83c0ae9e65f4 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -52,7 +52,13 @@
#include <basic/basrdll.hxx>
#include <vos/mutex.hxx>
+#include <basic/sbobjmod.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
+#include <com/sun/star/script/XVBACompat.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+using namespace com::sun::star;
// for the bsearch
#ifdef WNT
@@ -72,6 +78,13 @@
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
+#include <com/sun/star/script/XLibraryContainer.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/awt/XDialogProvider.hpp>
+#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/anytostring.hxx>
TYPEINIT1(SbModule,SbxObject)
TYPEINIT1(SbMethod,SbxMethod)
@@ -79,6 +92,8 @@ TYPEINIT1(SbProperty,SbxProperty)
TYPEINIT1(SbProcedureProperty,SbxProperty)
TYPEINIT1(SbJScriptModule,SbModule)
TYPEINIT1(SbJScriptMethod,SbMethod)
+TYPEINIT1(SbObjModule,SbModule)
+TYPEINIT1(SbUserFormModule,SbObjModule)
SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4)
SV_IMPL_VARARR(SbiBreakpoints,USHORT)
@@ -86,6 +101,26 @@ SV_IMPL_VARARR(SbiBreakpoints,USHORT)
SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
+bool getDefaultVBAMode( StarBASIC* pb )
+{
+ bool bResult = false;
+ if ( pb && pb->IsDocBasic() )
+ {
+ uno::Any aDoc;
+ if ( pb->GetUNOConstant( "ThisComponent", aDoc ) )
+ {
+ uno::Reference< beans::XPropertySet > xProp( aDoc, uno::UNO_QUERY );
+ if ( xProp.is() )
+ {
+ uno::Reference< script::XVBACompat > xVBAMode( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY );
+ if ( xVBAMode.is() )
+ bResult = ( xVBAMode->getVBACompatModeOn() == sal_True );
+ }
+ }
+ }
+ return bResult;
+}
+
class AsyncQuitHandler
{
AsyncQuitHandler() {}
@@ -148,12 +183,13 @@ bool UnlockControllerHack( StarBASIC* pBasic )
// Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen
// Elemente von anderen Modulen aus gefunden werden koennen.
-SbModule::SbModule( const String& rName )
+SbModule::SbModule( const String& rName, BOOL bVBACompat )
: SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASICModule") ) ),
- pImage( NULL ), pBreaks( NULL ), pClassData( NULL )
+ pImage( NULL ), pBreaks( NULL ), pClassData( NULL ), mbVBACompat( bVBACompat ), pDocObject( NULL ), bIsProxyModule( false )
{
SetName( rName );
SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH );
+ SetModuleType( script::ModuleType::NORMAL );
}
SbModule::~SbModule()
@@ -328,7 +364,10 @@ void SbModule::Clear()
SbxVariable* SbModule::Find( const XubString& rName, SbxClassType t )
{
+ // make sure a search in an uninstatiated class module will fail
SbxVariable* pRes = SbxObject::Find( rName, t );
+ if ( bIsProxyModule )
+ return NULL;
if( !pRes && pImage )
{
SbiInstance* pInst = pINST;
@@ -427,6 +466,8 @@ void SbModule::SetSource( const String& r )
void SbModule::SetSource32( const ::rtl::OUString& r )
{
+ // Default basic mode to library container mode, but.. allow Option VBASupport 0/1 override
+ SetVBACompat( getDefaultVBAMode( static_cast< StarBASIC*>( GetParent() ) ) );
aOUSource = r;
StartDefinitions();
SbiTokenizer aTok( r );
@@ -457,9 +498,14 @@ void SbModule::SetSource32( const ::rtl::OUString& r )
if( eCurTok == OPTION )
{
eCurTok = aTok.Next();
- if( eCurTok == COMPATIBLE
- || ( ( eCurTok == VBASUPPORT ) && ( aTok.Next() == NUMBER ) && ( aTok.GetDbl()== 1 ) ) )
+ if( eCurTok == COMPATIBLE )
aTok.SetCompatible( true );
+ else if ( ( eCurTok == VBASUPPORT ) && ( aTok.Next() == NUMBER ) )
+ {
+ BOOL bIsVBA = ( aTok.GetDbl()== 1 );
+ SetVBACompat( bIsVBA );
+ aTok.SetCompatible( bIsVBA );
+ }
}
}
eLastTok = eCurTok;
@@ -600,7 +646,15 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic )
if( ((StarBASIC*)p) != pBasic )
ClearUnoObjectsInRTL_Impl_Rek( (StarBASIC*)p );
}
+BOOL SbModule::IsVBACompat()
+{
+ return mbVBACompat;
+}
+void SbModule::SetVBACompat( BOOL bCompat )
+{
+ mbVBACompat = bCompat;
+}
// Ausfuehren eines BASIC-Unterprogramms
USHORT SbModule::Run( SbMethod* pMeth )
{
@@ -695,10 +749,9 @@ USHORT SbModule::Run( SbMethod* pMeth )
if( pRt->pNext )
pRt->pNext->block();
pINST->pRun = pRt;
- if ( SbiRuntime ::isVBAEnabled() )
+ if ( mbVBACompat )
{
pINST->EnableCompatibility( TRUE );
- pRt->SetVBAEnabled( true );
}
while( pRt->Step() ) {}
if( pRt->pNext )
@@ -1483,6 +1536,389 @@ SbJScriptMethod::~SbJScriptMethod()
/////////////////////////////////////////////////////////////////////////
+SbObjModule::SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible )
+ : SbModule( rName, bIsVbaCompatible )
+{
+ SetModuleType( mInfo.ModuleType );
+ if ( mInfo.ModuleType == script::ModuleType::FORM )
+ {
+ SetClassName( rtl::OUString::createFromAscii( "Form" ) );
+ }
+ else if ( mInfo.ModuleObject.is() )
+ SetUnoObject( uno::makeAny( mInfo.ModuleObject ) );
+}
+void
+SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException )
+{
+ SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxVariable*)pDocObject);
+ if ( pUnoObj && pUnoObj->getUnoAny() == aObj ) // object is equal, nothing to do
+ return;
+ pDocObject = new SbUnoObject( GetName(), uno::makeAny( aObj ) );
+
+ com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( aObj, com::sun::star::uno::UNO_QUERY_THROW );
+ if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "ooo.vba.excel.Worksheet" ) ) )
+ {
+ SetClassName( rtl::OUString::createFromAscii( "Worksheet" ) );
+ }
+ else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "ooo.vba.excel.Workbook" ) ) )
+ {
+ SetClassName( rtl::OUString::createFromAscii( "Workbook" ) );
+ }
+}
+
+SbxVariable*
+SbObjModule::GetObject()
+{
+ return pDocObject;
+}
+SbxVariable*
+SbObjModule::Find( const XubString& rName, SbxClassType t )
+{
+ //OSL_TRACE("SbObjectModule find for %s", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SbxVariable* pVar = NULL;
+ if ( pDocObject)
+ pVar = pDocObject->Find( rName, t );
+ if ( !pVar )
+ pVar = SbModule::Find( rName, t );
+ return pVar;
+}
+
+typedef ::cppu::WeakImplHelper1< awt::XTopWindowListener > EventListener_BASE;
+
+class FormObjEventListenerImpl : public EventListener_BASE
+{
+ SbUserFormModule* mpUserForm;
+ uno::Reference< lang::XComponent > mxComponent;
+ bool mbDisposed;
+ sal_Bool mbOpened;
+ sal_Bool mbActivated;
+ sal_Bool mbShowing;
+ FormObjEventListenerImpl(); // not defined
+ FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined
+public:
+ FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False )
+ {
+ if ( mxComponent.is() )
+ {
+ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
+ OSL_TRACE("*********** Registering the listener");
+ xList->addTopWindowListener( this );
+ }
+ }
+
+ ~FormObjEventListenerImpl()
+ {
+ removeListener();
+ }
+ sal_Bool isShowing() { return mbShowing; }
+ void removeListener()
+ {
+ try
+ {
+ if ( mxComponent.is() && !mbDisposed )
+ {
+ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
+ OSL_TRACE("*********** Removing the listener");
+ xList->removeTopWindowListener( this );
+ mxComponent = NULL;
+ }
+ }
+ catch( uno::Exception& ) {}
+ }
+ virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ {
+ mbOpened = sal_True;
+ mbShowing = sal_True;
+ if ( mbActivated )
+ {
+ mbOpened = mbActivated = sal_False;
+ mpUserForm->triggerActivateEvent();
+ }
+ }
+ }
+
+ //liuchen 2009-7-21, support Excel VBA Form_QueryClose event
+ virtual void SAL_CALL windowClosing( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+#if IN_THE_FUTURE
+ uno::Reference< awt::XDialog > xDialog( e.Source, uno::UNO_QUERY );
+ if ( xDialog.is() )
+ {
+ uno::Reference< awt::XControl > xControl( xDialog, uno::UNO_QUERY );
+ if ( xControl->getPeer().is() )
+ {
+ uno::Reference< document::XVbaMethodParameter > xVbaMethodParameter( xControl->getPeer(), uno::UNO_QUERY );
+ if ( xVbaMethodParameter.is() )
+ {
+ sal_Int8 nCancel = 0;
+ sal_Int8 nCloseMode = 0;
+
+ Sequence< Any > aParams;
+ aParams.realloc(2);
+ aParams[0] <<= nCancel;
+ aParams[1] <<= nCloseMode;
+
+ mpUserForm->triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ),
+ aParams);
+ xVbaMethodParameter->setVbaMethodParameter( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cancel")), aParams[0]);
+ return;
+
+ }
+ }
+ }
+
+ mpUserForm->triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ) );
+#endif
+ }
+ //liuchen 2009-7-21
+
+ virtual void SAL_CALL windowClosed( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) { mbOpened = sal_False; mbShowing = sal_False; }
+ virtual void SAL_CALL windowMinimized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
+ virtual void SAL_CALL windowNormalized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException){}
+ virtual void SAL_CALL windowActivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ {
+ mbActivated = sal_True;
+ if ( mbOpened )
+ {
+ mbOpened = mbActivated = sal_False;
+ mpUserForm->triggerActivateEvent();
+ }
+ }
+ }
+
+ virtual void SAL_CALL windowDeactivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
+ {
+ if ( mpUserForm )
+ mpUserForm->triggerDeActivateEvent();
+ }
+
+
+ virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException)
+ {
+ OSL_TRACE("** Userform/Dialog disposing");
+ mbDisposed = true;
+ uno::Any aSource;
+ aSource <<= Source;
+ mxComponent = NULL;
+ if ( mpUserForm )
+ mpUserForm->ResetApiObj();
+ }
+};
+
+SbUserFormModule::SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsCompat )
+ :SbObjModule( rName, mInfo, bIsCompat ), mbInit( false )
+{
+ m_xModel.set( mInfo.ModuleObject, uno::UNO_QUERY_THROW );
+}
+
+void SbUserFormModule::ResetApiObj()
+{
+ if ( m_xDialog.is() ) // probably someone close the dialog window
+ {
+ triggerTerminateEvent();
+ }
+ pDocObject = NULL;
+ m_xDialog = NULL;
+}
+
+void SbUserFormModule::triggerMethod( const String& aMethodToRun )
+{
+ Sequence< Any > aArguments;
+ triggerMethod( aMethodToRun, aArguments );
+}
+void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any >& /*aArguments*/)
+{
+ OSL_TRACE("*** trigger %s ***", rtl::OUStringToOString( aMethodToRun, RTL_TEXTENCODING_UTF8 ).getStr() );
+ // Search method
+ SbxVariable* pMeth = SbObjModule::Find( aMethodToRun, SbxCLASS_METHOD );
+ if( pMeth )
+ {
+#if IN_THE_FUTURE
+ //liuchen 2009-7-21, support Excel VBA UserForm_QueryClose event with parameters
+ if ( aArguments.getLength() > 0 ) // Setup parameters
+ {
+ SbxArrayRef xArray = new SbxArray;
+ xArray->Put( pMeth, 0 ); // Method as parameter 0
+
+ for ( sal_Int32 i = 0; i < aArguments.getLength(); ++i )
+ {
+ SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT );
+ unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), aArguments[i] );
+ xArray->Put( xSbxVar, static_cast< USHORT >( i ) + 1 );
+
+ // Enable passing by ref
+ if ( xSbxVar->GetType() != SbxVARIANT )
+ xSbxVar->SetFlag( SBX_FIXED );
+ }
+ pMeth->SetParameters( xArray );
+
+ SbxValues aVals;
+ pMeth->Get( aVals );
+
+ for ( sal_Int32 i = 0; i < aArguments.getLength(); ++i )
+ {
+ aArguments[i] = sbxToUnoValue( xArray->Get( static_cast< USHORT >(i) + 1) );
+ }
+ pMeth->SetParameters( NULL );
+ }
+ else
+//liuchen 2009-7-21
+#endif
+ {
+ SbxValues aVals;
+ pMeth->Get( aVals );
+ }
+ }
+}
+
+void SbUserFormModule::triggerActivateEvent( void )
+{
+ OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
+ triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_activate") ) );
+ OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
+}
+
+void SbUserFormModule::triggerDeActivateEvent( void )
+{
+ OSL_TRACE("**** SbUserFormModule::triggerDeActivate");
+ triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_DeActivate") ) );
+}
+
+void SbUserFormModule::triggerInitializeEvent( void )
+
+{
+ if ( mbInit )
+ return;
+ OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
+ static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") );
+ triggerMethod( aInitMethodName );
+ mbInit = true;
+}
+
+void SbUserFormModule::triggerTerminateEvent( void )
+{
+ OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
+ static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") );
+ triggerMethod( aTermMethodName );
+ mbInit=false;
+}
+
+void SbUserFormModule::load()
+{
+ OSL_TRACE("** load() ");
+ // forces a load
+ if ( !pDocObject )
+ InitObject();
+}
+
+//liuchen 2009-7-21 change to accmordate VBA's beheavior
+void SbUserFormModule::Unload()
+{
+ OSL_TRACE("** Unload() ");
+
+ sal_Int8 nCancel = 0;
+ sal_Int8 nCloseMode = 1;
+
+ Sequence< Any > aParams;
+ aParams.realloc(2);
+ aParams[0] <<= nCancel;
+ aParams[1] <<= nCloseMode;
+
+ triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_QueryClose") ), aParams);
+
+ aParams[0] >>= nCancel;
+ if (nCancel == 1)
+ {
+ return;
+ }
+
+ if ( m_xDialog.is() )
+ {
+ triggerTerminateEvent();
+ }
+ // Search method
+ SbxVariable* pMeth = SbObjModule::Find( String( RTL_CONSTASCII_USTRINGPARAM( "UnloadObject" ) ), SbxCLASS_METHOD );
+ if( pMeth )
+ {
+ OSL_TRACE("Attempting too run the UnloadObjectMethod");
+ m_xDialog = NULL; //release ref to the uno object
+ SbxValues aVals;
+ FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() );
+ bool bWaitForDispose = true; // assume dialog is showing
+ if ( pFormListener )
+ {
+ bWaitForDispose = pFormListener->isShowing();
+ OSL_TRACE("Showing %d", bWaitForDispose );
+ }
+ pMeth->Get( aVals);
+ if ( !bWaitForDispose )
+ {
+ // we've either already got a dispose or we'er never going to get one
+ ResetApiObj();
+ } // else wait for dispose
+ OSL_TRACE("UnloadObject completed ( we hope )");
+ }
+}
+//liuchen
+
+void SbUserFormModule::InitObject()
+{
+ try
+ {
+
+ String aHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
+ SbUnoObject* pGlobs = (SbUnoObject*)GetParent()->Find( aHook, SbxCLASS_DONTCARE );
+ if ( m_xModel.is() && pGlobs )
+ {
+
+ uno::Reference< lang::XMultiServiceFactory > xVBAFactory( pGlobs->getUnoAny(), uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= m_xModel;
+ rtl::OUString sDialogUrl( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script:" ) );
+ rtl::OUString sProjectName( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+ if ( this->GetParent()->GetName().Len() )
+ sProjectName = this->GetParent()->GetName();
+ sDialogUrl = sDialogUrl.concat( sProjectName ).concat( rtl::OUString( '.') ).concat( GetName() ).concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?location=document") ) );
+
+ uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.DialogProvider")), aArgs ), uno::UNO_QUERY_THROW );
+ m_xDialog = xProvider->createDialog( sDialogUrl );
+
+ // create vba api object
+ aArgs.realloc( 4 );
+ aArgs[ 0 ] = uno::Any();
+ aArgs[ 1 ] <<= m_xDialog;
+ 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 );
+ // remove old listener if it exists
+ FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() );
+ if ( pFormListener )
+ pFormListener->removeListener();
+ m_DialogListener = new FormObjEventListenerImpl( this, xComponent );
+
+ triggerInitializeEvent();
+ }
+ }
+ catch( uno::Exception& e )
+ {
+ }
+
+}
+
+SbxVariable*
+SbUserFormModule::Find( const XubString& rName, SbxClassType t )
+{
+ if ( !pDocObject && !GetSbData()->bRunInit && pINST )
+ InitObject();
+ return SbObjModule::Find( rName, t );
+}
+/////////////////////////////////////////////////////////////////////////
SbProperty::SbProperty( const String& r, SbxDataType t, SbModule* p )
: SbxProperty( r, t ), pMod( p )
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index c7a63b6d7fbb..46f829b382e8 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -32,6 +32,7 @@
#include "sbcomp.hxx"
#include "image.hxx"
#include <limits>
+#include <com/sun/star/script/ModuleType.hpp>
// nInc ist die Inkrementgroesse der Puffer
@@ -127,12 +128,12 @@ void SbiCodeGen::Save()
// OPTION EXPLICIT-Flag uebernehmen
if( pParser->bExplicit )
p->SetFlag( SBIMG_EXPLICIT );
- if( pParser->IsVBASupportOn() )
- p->SetFlag( SBIMG_VBASUPPORT );
int nIfaceCount = 0;
- if( pParser->bClassModule )
+ if( rMod.mnType == com::sun::star::script::ModuleType::CLASS )
{
+ OSL_TRACE("COdeGen::save() classmodule processing");
+ rMod.bIsProxyModule = true;
p->SetFlag( SBIMG_CLASSMODULE );
pCLASSFAC->AddClassModule( &rMod );
@@ -155,6 +156,10 @@ void SbiCodeGen::Save()
else
{
pCLASSFAC->RemoveClassModule( &rMod );
+ // Only a ClassModule can revert to Normal
+ if ( rMod.mnType == com::sun::star::script::ModuleType::CLASS )
+ rMod.mnType = com::sun::star::script::ModuleType::NORMAL;
+ rMod.bIsProxyModule = false;
}
if( pParser->bText )
p->SetFlag( SBIMG_COMPARETEXT );
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 400e77a94b16..8770dc8539f0 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -29,6 +29,7 @@
#include "precompiled_basic.hxx"
#include <basic/sbx.hxx>
#include "sbcomp.hxx"
+#include <com/sun/star/script/ModuleType.hpp>
struct SbiParseStack { // "Stack" fuer Statement-Blocks
SbiParseStack* pNext; // Chain
@@ -140,7 +141,8 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
bNewGblDefs =
bSingleLineIf =
bExplicit = FALSE;
- bClassModule = FALSE;
+ bClassModule = ( pm->GetModuleType() == com::sun::star::script::ModuleType::CLASS );
+ OSL_TRACE("Parser - %s, bClassModule %d", rtl::OUStringToOString( pm->GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), bClassModule );
pPool = &aPublics;
for( short i = 0; i < 26; i++ )
eDefTypes[ i ] = SbxVARIANT; // Kein expliziter Defaulttyp
@@ -153,6 +155,10 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
rTypeArray = new SbxArray; // Array fuer Benutzerdefinierte Typen
rEnumArray = new SbxArray; // Array for Enum types
+ bVBASupportOn = pm->IsVBACompat();
+ if ( bVBASupportOn )
+ EnableCompatibility();
+
}
@@ -751,6 +757,7 @@ void SbiParser::Option()
case CLASSMODULE:
bClassModule = TRUE;
+ aGen.GetModule().SetModuleType( com::sun::star::script::ModuleType::CLASS );
break;
case VBASUPPORT:
if( Next() == NUMBER )
@@ -760,6 +767,10 @@ void SbiParser::Option()
bVBASupportOn = ( nVal == 1 );
if ( bVBASupportOn )
EnableCompatibility();
+ // if the module setting is different
+ // reset it to what the Option tells us
+ if ( bVBASupportOn != aGen.GetModule().IsVBACompat() )
+ aGen.GetModule().SetVBACompat( bVBASupportOn );
break;
}
}
diff --git a/basic/source/inc/codegen.hxx b/basic/source/inc/codegen.hxx
index d0a613eabebc..3d90d16bdcbe 100644
--- a/basic/source/inc/codegen.hxx
+++ b/basic/source/inc/codegen.hxx
@@ -53,6 +53,7 @@ public:
void GenStmnt(); // evtl. Statement-Opcode erzeugen
UINT32 GetPC();
UINT32 GetOffset() { return GetPC() + 1; }
+ SbModule& GetModule() { return rMod; }
void Save();
// #29955 for-Schleifen-Ebene pflegen
diff --git a/basic/source/inc/errobject.hxx b/basic/source/inc/errobject.hxx
new file mode 100644
index 000000000000..39e6e319caae
--- /dev/null
+++ b/basic/source/inc/errobject.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 ERROBJECT_HXX
+#define ERROBJECT_HXX
+#include "sbunoobj.hxx"
+#include <ooo/vba/XErrObject.hpp>
+
+
+class SbxErrObject : public SbUnoObject
+{
+ class ErrObject* m_pErrObject;
+ com::sun::star::uno::Reference< ooo::vba::XErrObject > m_xErr;
+
+ SbxErrObject( const String& aName_, const com::sun::star::uno::Any& aUnoObj_ );
+ ~SbxErrObject();
+
+ class ErrObject* getImplErrObject( void )
+ { return m_pErrObject; }
+
+public:
+ static SbxVariableRef getErrObject();
+ static com::sun::star::uno::Reference< ooo::vba::XErrObject > getUnoErrObject();
+
+ void setNumberAndDescription( ::sal_Int32 _number, const ::rtl::OUString& _description )
+ throw (com::sun::star::uno::RuntimeException);
+};
+#endif
diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx
index 7347efe288f3..d674b91faf71 100644
--- a/basic/source/inc/image.hxx
+++ b/basic/source/inc/image.hxx
@@ -106,6 +106,5 @@ public:
#define SBIMG_COMPARETEXT 0x0002 // OPTION COMPARE TEXT ist aktiv
#define SBIMG_INITCODE 0x0004 // Init-Code vorhanden
#define SBIMG_CLASSMODULE 0x0008 // OPTION ClassModule is active
-#define SBIMG_VBASUPPORT 0x0020 // OPTION VBASupport is 1
#endif
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 1f7e77170d44..1f4084db1d0d 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -58,19 +58,22 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/compbase6.hxx>
+#include <cppuhelper/compbase7.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <com/sun/star/script/XVBACompat.hpp>
class BasicManager;
namespace basic
{
-typedef ::cppu::WeakComponentImplHelper6<
+typedef ::cppu::WeakComponentImplHelper7<
::com::sun::star::lang::XInitialization,
::com::sun::star::script::XStorageBasedLibraryContainer,
::com::sun::star::script::XLibraryContainerPassword,
::com::sun::star::script::XLibraryContainerExport,
::com::sun::star::container::XContainer,
+ ::com::sun::star::script::XVBACompat,
::com::sun::star::lang::XServiceInfo > LibraryContainerHelper;
typedef ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameContainer,
@@ -216,6 +219,7 @@ public:
class SfxLibraryContainer :public LibraryContainerHelper
,public ::utl::OEventListenerAdapter
{
+ sal_Bool mbVBACompat;
protected:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > mxSFI;
@@ -493,6 +497,9 @@ public:
throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (::com::sun::star::uno::RuntimeException) = 0;
+ // Methods XVBACompat
+ virtual ::sal_Bool SAL_CALL getVBACompatModeOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (::com::sun::star::uno::RuntimeException);
};
class LibraryContainerMethodGuard
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 4a3f38c51027..c9a41110ad46 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -219,6 +219,8 @@ public:
void Error( SbError ); // trappable Error
void Error( SbError, const String& rMsg ); // trappable Error mit Message
+ void ErrorVB( sal_Int32 nVBNumber, const String& rMsg );
+ void setErrorVB( sal_Int32 nVBNumber, const String& rMsg );
void FatalError( SbError ); // non-trappable Error
void FatalError( SbError, const String& ); // non-trappable Error
void Abort(); // Abbruch mit aktuellem Fehlercode
@@ -433,7 +435,7 @@ class SbiRuntime
void StepFIND_CM( UINT32, UINT32 );
void StepFIND_STATIC( UINT32, UINT32 );
public:
- void SetVBAEnabled( bool bEnabled ) { bVBAEnabled = bEnabled; };
+ void SetVBAEnabled( bool bEnabled );
USHORT GetImageFlag( USHORT n ) const;
USHORT GetBase();
xub_StrLen nLine,nCol1,nCol2; // aktuelle Zeile, Spaltenbereich
@@ -441,10 +443,11 @@ public:
SbiRuntime( SbModule*, SbMethod*, UINT32 );
~SbiRuntime();
- void Error( SbError ); // Fehler setzen, falls != 0
+ void Error( SbError, bool bVBATranslationAlreadyDone = false ); // Fehler setzen, falls != 0
void Error( SbError, const String& ); // Fehler setzen, falls != 0
void FatalError( SbError ); // Fehlerbehandlung=Standard, Fehler setzen
void FatalError( SbError, const String& ); // Fehlerbehandlung=Standard, Fehler setzen
+ static sal_Int32 translateErrorToVba( SbError nError, String& rMsg );
void DumpPCode();
BOOL Step(); // Einzelschritt (ein Opcode)
void Stop() { bRun = FALSE; }
diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx
index 19b0698d22a9..31025c48c4a4 100644
--- a/basic/source/inc/scriptcont.hxx
+++ b/basic/source/inc/scriptcont.hxx
@@ -30,6 +30,8 @@
#include "namecont.hxx"
#include <basic/basmgr.hxx>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <comphelper/uno3.hxx>
class BasicManager;
@@ -134,13 +136,19 @@ public:
};
//============================================================================
+typedef std::hash_map< ::rtl::OUString, ::com::sun::star::script::ModuleInfo, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInfoMap;
+
+typedef ::cppu::ImplHelper1 < ::com::sun::star::script::XVBAModuleInfo
+ > SfxScriptLibrary_BASE;
class SfxScriptLibrary : public SfxLibrary
+ , public SfxScriptLibrary_BASE
{
friend class SfxScriptLibraryContainer;
sal_Bool mbLoadedSource;
sal_Bool mbLoadedBinary;
+ ModuleInfoMap mModuleInfos;
// Provide modify state including resources
virtual sal_Bool isModified( void );
@@ -167,6 +175,15 @@ public:
const ::rtl::OUString& aLibInfoFileURL, const ::rtl::OUString& aStorageURL, sal_Bool ReadOnly
);
+ DECLARE_XINTERFACE()
+ DECLARE_XTYPEPROVIDER()
+
+ // XVBAModuleInfo
+ virtual ::com::sun::star::script::ModuleInfo SAL_CALL getModuleInfo( const ::rtl::OUString& ModuleName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasModuleInfo( const ::rtl::OUString& ModuleName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL insertModuleInfo( const ::rtl::OUString& ModuleName, const ::com::sun::star::script::ModuleInfo& ModuleInfo ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModuleInfo( const ::rtl::OUString& ModuleName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
static bool containsValidModule( const ::com::sun::star::uno::Any& _rElement );
protected:
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 9a21e488d4aa..e963de871c32 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -61,6 +61,7 @@
#else
#include <osl/file.hxx>
#endif
+#include "errobject.hxx"
#ifdef _USE_UNO
#include <comphelper/processfactory.hxx>
@@ -120,6 +121,10 @@ using namespace com::sun::star::io;
#include <io.h>
#endif
+using namespace rtl;
+
+#include <basic/sbobjmod.hxx>
+
static void FilterWhiteSpace( String& rStr )
{
rStr.EraseAllChars( ' ' );
@@ -256,6 +261,7 @@ RTLFUNC(Error)
{
String aErrorMsg;
SbError nErr = 0L;
+ INT32 nCode = 0;
if( rPar.Count() == 1 )
{
nErr = StarBASIC::GetErrBasic();
@@ -263,14 +269,34 @@ RTLFUNC(Error)
}
else
{
- INT32 nCode = rPar.Get( 1 )->GetLong();
+ nCode = rPar.Get( 1 )->GetLong();
if( nCode > 65535L )
StarBASIC::Error( SbERR_CONVERSION );
else
nErr = StarBASIC::GetSfxFromVBError( (USHORT)nCode );
}
- pBasic->MakeErrorText( nErr, aErrorMsg );
- rPar.Get( 0 )->PutString( pBasic->GetErrorText() );
+
+ bool bVBA = SbiRuntime::isVBAEnabled();
+ String tmpErrMsg;
+ if( bVBA && aErrorMsg.Len() > 0 )
+ {
+ tmpErrMsg = aErrorMsg;
+ }
+ else
+ {
+ pBasic->MakeErrorText( nErr, aErrorMsg );
+ tmpErrMsg = pBasic->GetErrorText();
+ }
+ // If this rtlfunc 'Error' passed a errcode the same as the active Err Objects's
+ // current err then return the description for the error message if it is set
+ // ( complicated isn't it ? )
+ if ( bVBA && rPar.Count() > 1 )
+ {
+ com::sun::star::uno::Reference< ooo::vba::XErrObject > xErrObj( SbxErrObject::getUnoErrObject() );
+ if ( xErrObj.is() && xErrObj->getNumber() == nCode && xErrObj->getDescription().getLength() )
+ tmpErrMsg = xErrObj->getDescription();
+ }
+ rPar.Get( 0 )->PutString( tmpErrMsg );
}
}
@@ -4106,12 +4132,20 @@ RTLFUNC(Load)
// Diesen Call einfach an das Object weiterreichen
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
+ if ( pObj )
{
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
- if( pVar )
- pVar->GetInteger();
+ if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ {
+ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
+ pFormModule->load();
+ }
+ else if( pObj->IsA( TYPE( SbxObject ) ) )
+ {
+ SbxVariable* pVar = ((SbxObject*)pObj)->
+ Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
+ if( pVar )
+ pVar->GetInteger();
+ }
}
}
@@ -4129,12 +4163,20 @@ RTLFUNC(Unload)
// Diesen Call einfach an das Object weitereichen
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
+ if ( pObj )
{
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
- if( pVar )
- pVar->GetInteger();
+ if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ {
+ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
+ pFormModule->Unload();
+ }
+ else if( pObj->IsA( TYPE( SbxObject ) ) )
+ {
+ SbxVariable* pVar = ((SbxObject*)pObj)->
+ Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
+ if( pVar )
+ pVar->GetInteger();
+ }
}
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index e0501e5c0d94..b25c213a493d 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -61,6 +61,7 @@
#endif
#include <vcl/jobset.hxx>
+#include <basic/sbobjmod.hxx>
#include "sbintern.hxx"
#include "runtime.hxx"
@@ -2594,14 +2595,16 @@ RTLFUNC(Me)
SbModule* pActiveModule = pINST->GetActiveModule();
SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
+ SbxVariableRef refVar = rPar.Get(0);
if( pClassModuleObject == NULL )
{
- StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
+ SbObjModule* pMod = PTR_CAST(SbObjModule,pActiveModule);
+ if ( pMod )
+ refVar->PutObject( pMod );
+ else
+ StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
}
else
- {
- SbxVariableRef refVar = rPar.Get(0);
refVar->PutObject( pClassModuleObject );
- }
}
diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx
index 9b4b35f551e2..cec74444e7a2 100644
--- a/basic/source/runtime/props.cxx
+++ b/basic/source/runtime/props.cxx
@@ -31,6 +31,7 @@
#include "runtime.hxx"
#include "stdobj.hxx"
#include "rtlproto.hxx"
+#include "errobject.hxx"
// Properties und Methoden legen beim Get (bWrite = FALSE) den Returnwert
@@ -50,14 +51,21 @@ RTLFUNC(Err)
(void)pBasic;
(void)bWrite;
- if( bWrite )
+ if( SbiRuntime::isVBAEnabled() )
{
- INT32 nVal = rPar.Get( 0 )->GetLong();
- if( nVal <= 65535L )
- StarBASIC::Error( StarBASIC::GetSfxFromVBError( (USHORT) nVal ) );
+ rPar.Get( 0 )->PutObject( SbxErrObject::getErrObject() );
}
else
- rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
+ {
+ if( bWrite )
+ {
+ INT32 nVal = rPar.Get( 0 )->GetLong();
+ if( nVal <= 65535L )
+ StarBASIC::Error( StarBASIC::GetSfxFromVBError( (USHORT) nVal ) );
+ }
+ else
+ rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
+ }
}
RTLFUNC(False)
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 52aa76e2f2df..29e49b0ffde8 100644..100755
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -43,13 +43,16 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include "sbunoobj.hxx"
+#include "errobject.hxx"
+
+using namespace ::com::sun::star;
bool SbiRuntime::isVBAEnabled()
{
bool result = false;
SbiInstance* pInst = pINST;
if ( pInst && pINST->pRun )
- result = pInst->pRun->GetImageFlag( SBIMG_VBASUPPORT );
+ result = pInst->pRun->bVBAEnabled;
return result;
}
@@ -60,6 +63,24 @@ void StarBASIC::StaticEnableReschedule( BOOL bReschedule )
{
bStaticGlobalEnableReschedule = bReschedule;
}
+void StarBASIC::SetVBAEnabled( BOOL bEnabled )
+{
+ if ( bDocBasic )
+ {
+ bVBAEnabled = bEnabled;
+ }
+}
+
+BOOL StarBASIC::isVBAEnabled()
+{
+ if ( bDocBasic )
+ {
+ if( SbiRuntime::isVBAEnabled() )
+ return TRUE;
+ return bVBAEnabled;
+ }
+ return FALSE;
+}
struct SbiArgvStack { // Argv stack:
@@ -422,6 +443,35 @@ void SbiInstance::Error( SbError n, const String& rMsg )
}
}
+void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const String& rMsg )
+{
+ if( !bWatchMode )
+ {
+ SbError n = StarBASIC::GetSfxFromVBError( static_cast< USHORT >( nVBNumber ) );
+ if ( !n )
+ n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors
+
+ aErrorMsg = rMsg;
+ SbiRuntime::translateErrorToVba( n, aErrorMsg );
+
+ bool bVBATranslationAlreadyDone = true;
+ pRun->Error( SbERR_BASIC_COMPAT, bVBATranslationAlreadyDone );
+ }
+}
+
+void SbiInstance::setErrorVB( sal_Int32 nVBNumber, const String& rMsg )
+{
+ SbError n = StarBASIC::GetSfxFromVBError( static_cast< USHORT >( nVBNumber ) );
+ if( !n )
+ n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors
+
+ aErrorMsg = rMsg;
+ SbiRuntime::translateErrorToVba( n, aErrorMsg );
+
+ nErr = n;
+}
+
+
void SbiInstance::FatalError( SbError n )
{
pRun->FatalError( n );
@@ -520,6 +570,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart )
nForLvl = 0;
nOps = 0;
refExprStk = new SbxArray;
+ SetVBAEnabled( pMod->IsVBACompat() );
#if defined GCC
SetParameters( pe ? pe->GetParameters() : (class SbxArray *)NULL );
#else
@@ -527,7 +578,6 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart )
#endif
pRefSaveList = NULL;
pItemStoreList = NULL;
- bVBAEnabled = isVBAEnabled();
}
SbiRuntime::~SbiRuntime()
@@ -546,6 +596,11 @@ SbiRuntime::~SbiRuntime()
}
}
+void SbiRuntime::SetVBAEnabled(bool bEnabled )
+{
+ bVBAEnabled = bEnabled;
+}
+
// Aufbau der Parameterliste. Alle ByRef-Parameter werden direkt
// uebernommen; von ByVal-Parametern werden Kopien angelegt. Falls
// ein bestimmter Datentyp verlangt wird, wird konvertiert.
@@ -791,10 +846,24 @@ BOOL SbiRuntime::Step()
return bRun;
}
-void SbiRuntime::Error( SbError n )
+void SbiRuntime::Error( SbError n, bool bVBATranslationAlreadyDone )
{
if( n )
+ {
nError = n;
+ if( isVBAEnabled() && !bVBATranslationAlreadyDone )
+ {
+ String aMsg = pInst->GetErrorMsg();
+ sal_Int32 nVBAErrorNumber = translateErrorToVba( nError, aMsg );
+ SbxVariable* pSbxErrObjVar = SbxErrObject::getErrObject();
+ SbxErrObject* pGlobErr = static_cast< SbxErrObject* >( pSbxErrObjVar );
+ if( pGlobErr != NULL )
+ pGlobErr->setNumberAndDescription( nVBAErrorNumber, aMsg );
+
+ pInst->aErrorMsg = aMsg;
+ nError = SbERR_BASIC_COMPAT;
+ }
+ }
}
void SbiRuntime::Error( SbError _errCode, const String& _details )
@@ -826,6 +895,32 @@ void SbiRuntime::FatalError( SbError _errCode, const String& _details )
Error( _errCode, _details );
}
+sal_Int32 SbiRuntime::translateErrorToVba( SbError nError, String& rMsg )
+{
+ // If a message is defined use that ( in preference to
+ // the defined one for the error ) NB #TODO
+ // if there is an error defined it more than likely
+ // is not the one you want ( some are the same though )
+ // we really need a new vba compatible error list
+ if ( !rMsg.Len() )
+ {
+ // TEST, has to be vb here always
+#ifdef DBG_UTIL
+ SbError nTmp = StarBASIC::GetSfxFromVBError( nError );
+ DBG_ASSERT( nTmp, "No VB error!" );
+#endif
+
+ StarBASIC::MakeErrorText( nError, rMsg );
+ rMsg = StarBASIC::GetErrorText();
+ if ( !rMsg.Len() ) // no message for err no, need localized resource here
+ rMsg = String( RTL_CONSTASCII_USTRINGPARAM("Internal Object Error:") );
+ }
+ // no num? most likely then it *is* really a vba err
+ USHORT nVBErrorCode = StarBASIC::GetVBErrorCode( nError );
+ sal_Int32 nVBAErrorNumber = ( nVBErrorCode == 0 ) ? nError : nVBErrorCode;
+ return nVBAErrorNumber;
+}
+
//////////////////////////////////////////////////////////////////////////
//
// Parameter, Locals, Caller
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index c0b4ffa3cd59..13bc8810144a 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -230,7 +230,7 @@ static Methods aMethods[] = {
{ "EOF", SbxBOOL, 1 | _FUNCTION, RTLNAME(EOF),0 },
{ "Channel", SbxINTEGER, 0,NULL,0 },
{ "Erl", SbxLONG, _ROPROP, RTLNAME( Erl ),0 },
-{ "Err", SbxLONG, _RWPROP, RTLNAME( Err ),0 },
+{ "Err", SbxVARIANT, _RWPROP, RTLNAME( Err ),0 },
{ "Error", SbxSTRING, 1 | _FUNCTION, RTLNAME( Error ),0 },
{ "code", SbxLONG, 0,NULL,0 },
{ "Exp", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Exp),0 },
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 33df854a4499..39af5ea4adc3 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -30,6 +30,7 @@
#include <vcl/msgbox.hxx>
#include <tools/fsys.hxx>
+#include "errobject.hxx"
#include "runtime.hxx"
#include "sbintern.hxx"
#include "iosys.hxx"
@@ -1116,6 +1117,7 @@ void SbiRuntime::StepSTDERROR()
pInst->nErr = 0L;
pInst->nErl = 0;
nError = 0L;
+ SbxErrObject::getUnoErrObject()->Clear();
}
void SbiRuntime::StepNOERROR()
@@ -1124,6 +1126,7 @@ void SbiRuntime::StepNOERROR()
pInst->nErr = 0L;
pInst->nErl = 0;
nError = 0L;
+ SbxErrObject::getUnoErrObject()->Clear();
bError = FALSE;
}
@@ -1132,6 +1135,9 @@ void SbiRuntime::StepNOERROR()
void SbiRuntime::StepLEAVE()
{
bRun = FALSE;
+ // If VBA and we are leaving an ErrorHandler then clear the error ( it's been processed )
+ if ( bInError && pError )
+ SbxErrObject::getUnoErrObject()->Clear();
}
void SbiRuntime::StepCHANNEL() // TOS = Kanalnummer
@@ -1265,6 +1271,9 @@ void SbiRuntime::StepERROR()
SbxVariableRef refCode = PopVar();
USHORT n = refCode->GetUShort();
SbError error = StarBASIC::GetSfxFromVBError( n );
- Error( error );
+ if ( bVBAEnabled )
+ pInst->Error( error );
+ else
+ Error( error );
}
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index 399257cf6ad3..c6f090048bf2 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -30,11 +30,13 @@
#include <stdlib.h>
#include <rtl/math.hxx>
+#include <basic/sbuno.hxx>
#include "runtime.hxx"
#include "sbintern.hxx"
#include "iosys.hxx"
#include "image.hxx"
#include "sbunoobj.hxx"
+#include "errobject.hxx"
bool checkUnoObjectType( SbUnoObject* refVal,
const String& aClass );
@@ -230,8 +232,6 @@ void SbiRuntime::StepRETURN( UINT32 nOp1 )
// FOR-Variable testen (+Endlabel)
-void unoToSbxValue( SbxVariable* pVar, const Any& aValue );
-
void SbiRuntime::StepTESTFOR( UINT32 nOp1 )
{
if( !pForStk )
@@ -360,6 +360,7 @@ void SbiRuntime::StepERRHDL( UINT32 nOp1 )
pInst->nErr = 0;
pInst->nErl = 0;
nError = 0;
+ SbxErrObject::getUnoErrObject()->Clear();
}
// Resume nach Fehlern (+0=statement, 1=next or Label)
@@ -380,6 +381,8 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 )
}
else
pCode = pErrStmnt;
+ if ( pError ) // current in error handler ( and got a Resume Next statment )
+ SbxErrObject::getUnoErrObject()->Clear();
if( nOp1 > 1 )
StepJUMP( nOp1 );
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 14c84420dad6..90e7cb4cb4d5 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -73,7 +73,6 @@
#include <cppuhelper/exc_hlp.hxx>
#include <basic/sbmod.hxx>
-
namespace basic
{
@@ -327,6 +326,7 @@ DBG_NAME( SfxLibraryContainer )
// Ctor
SfxLibraryContainer::SfxLibraryContainer( void )
: LibraryContainerHelper( maMutex )
+ , mbVBACompat( sal_False )
, maModifiable( *this, maMutex )
, maNameContainer( getCppuType( (Reference< XNameAccess >*) NULL ) )
, mbOldInfoFormat( sal_False )
@@ -2785,6 +2785,28 @@ OUString SfxLibraryContainer::expand_url( const OUString& url )
}
}
+::sal_Bool SAL_CALL SfxLibraryContainer::getVBACompatModeOn() throw (RuntimeException)
+{
+ return mbVBACompat;
+}
+
+void SAL_CALL SfxLibraryContainer::setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (RuntimeException)
+{
+ BasicManager* pBasMgr = getBasicManager();
+ if( pBasMgr )
+ {
+ // get the standard library
+ String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
+ if ( pBasMgr->GetName().Len() )
+ aLibName = pBasMgr->GetName();
+
+ StarBASIC* pBasic = pBasMgr->GetLib( aLibName );
+ if( pBasic )
+ pBasic->SetVBAEnabled( _vbacompatmodeon );
+ }
+ mbVBACompat = _vbacompatmodeon;
+}
+
// Methods XServiceInfo
::sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const ::rtl::OUString& _rServiceName )
throw (RuntimeException)
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 096d497a4c50..4185b6f9579c 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -942,7 +942,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
try {
xElementRootStorage = ::comphelper::OStorageHelper::GetStorageFromURL(
aElementPath,
- embed::ElementModes::READWRITE );
+ embed::ElementModes::READ );
} catch( uno::Exception& )
{
// TODO: error handling
@@ -1166,6 +1166,45 @@ bool SAL_CALL SfxScriptLibrary::isLibraryElementValid( ::com::sun::star::uno::An
return SfxScriptLibrary::containsValidModule( aElement );
}
+IMPLEMENT_FORWARD_XINTERFACE2( SfxScriptLibrary, SfxLibrary, SfxScriptLibrary_BASE );
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( SfxScriptLibrary, SfxLibrary, SfxScriptLibrary_BASE );
+
+script::ModuleInfo SAL_CALL
+SfxScriptLibrary::getModuleInfo( const ::rtl::OUString& ModuleName ) throw (NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ if ( !hasModuleInfo( ModuleName ) )
+ throw NoSuchElementException();
+ return mModuleInfos[ ModuleName ];
+}
+
+sal_Bool SAL_CALL
+SfxScriptLibrary::hasModuleInfo( const ::rtl::OUString& ModuleName ) throw (RuntimeException)
+{
+ sal_Bool bRes = sal_False;
+ ModuleInfoMap::iterator it = mModuleInfos.find( ModuleName );
+
+ if ( it != mModuleInfos.end() )
+ bRes = sal_True;
+
+ return bRes;
+}
+
+void SAL_CALL SfxScriptLibrary::insertModuleInfo( const ::rtl::OUString& ModuleName, const script::ModuleInfo& ModuleInfo ) throw (IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
+{
+ if ( hasModuleInfo( ModuleName ) )
+ throw ElementExistException();
+ mModuleInfos[ ModuleName ] = ModuleInfo;
+}
+
+void SAL_CALL SfxScriptLibrary::removeModuleInfo( const ::rtl::OUString& ModuleName ) throw (NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ // #FIXME add NoSuchElementException to the spec
+ if ( !hasModuleInfo( ModuleName ) )
+ throw NoSuchElementException();
+ mModuleInfos.erase( mModuleInfos.find( ModuleName ) );
+}
+
+
//============================================================================
} // namespace basic
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S
new file mode 100644
index 000000000000..d5faf15eed6f
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S
@@ -0,0 +1,38 @@
+@ ARM support code for OpenOffice C++/UNO bridging
+@
+@ Written by Peter Naulls <peter@chocky.org>
+@ Modified by Caolan McNamara <caolanm@redhat.com>
+@ Fixed by Michael Casadevall <mcasadevall@kubuntu.org>
+
+#ifdef __ARM_EABI__
+# define UNWIND
+#else
+# define UNWIND @
+#endif
+
+ .file "armhelper.s"
+ .text
+ .align 4
+ .global privateSnippetExecutor
+ .type privateSnippetExecutor, %function
+privateSnippetExecutor:
+ UNWIND .fnstart @ start of unwinder entry
+
+ stmfd sp!, {r0-r3} @ follow other parameters on stack
+ UNWIND .pad #16 @ throw this data away on exception
+ mov r0, ip @ r0 points to functionoffset/vtable
+ mov r1, sp @ r1 points to this and params
+ @ (see cppuno.cxx:codeSnippet())
+ stmfd sp!, {r4,lr} @ save return address
+ @ (r4 pushed to preserve stack alignment)
+ UNWIND .save {r4,lr} @ restore these regs on exception
+
+ bl cpp_vtable_call(PLT)
+
+ add sp, sp, #4 @ no need to restore r4 (we didn't touch it)
+ ldr pc, [sp], #20 @ return, discarding function arguments
+
+ UNWIND .fnend @ end of unwinder entry
+
+ .size privateSnippetExecutor, . - privateSnippetExecutor
+ .section .note.GNU-stack,"",%progbits
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s
deleted file mode 100644
index 8fd1a38e4f51..000000000000
--- a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s
+++ /dev/null
@@ -1,22 +0,0 @@
-@ ARM support code for OpenOffice C++/UNO bridging
-@
-@ Written by Peter Naulls <peter@chocky.org>
-@ Modified by Caolan McNamara <caolanm@redhat.com>
- .file "armhelper.s"
- .text
- .align 4
- .global privateSnippetExecutor
- .type privateSnippetExecutor, %function
-privateSnippetExecutor:
- stmfd sp!, {r0-r3} @ follow other parameters on stack
- mov r0, ip @ r0 points to functionoffset/vtable
- mov ip, sp @ fix up the ip
- stmfd sp!, {fp,ip,lr,pc} @ 8 x 4 => stack remains 8 aligned
- sub fp, ip, #4 @ set frame pointer
-
- add r1, sp, #16 @ r1 points to this and params
- bl cpp_vtable_call(PLT)
-
- add sp, sp, #32 @ restore stack
- ldr fp, [sp, #-32] @ restore frame pointer
- ldr pc, [sp, #-24] @ return
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
index 98c213a53a83..0e801ab4433e 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
@@ -76,10 +76,8 @@ namespace
if (pReturnTypeDescr)
{
- if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
- {
+ if (!arm::return_in_hidden_param(pReturnTypeRef))
pUnoReturn = pRegisterReturn; // direct way for simple types
- }
else // complex return via ptr (pCppReturn)
{
pCppReturn = *(void **)pCppStack;
@@ -410,8 +408,30 @@ extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset,
void **pCallStack )
{
sal_Int64 nRegReturn;
- cpp_mediate( pFunctionAndOffset[0], pFunctionAndOffset[1], pCallStack,
+ typelib_TypeClass aType = cpp_mediate( pFunctionAndOffset[0], pFunctionAndOffset[1], pCallStack,
&nRegReturn );
+
+ switch( aType )
+ {
+ case typelib_TypeClass_BOOLEAN:
+ case typelib_TypeClass_BYTE:
+ nRegReturn = (unsigned long)(*(unsigned char *)&nRegReturn);
+ break;
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ case typelib_TypeClass_SHORT:
+ nRegReturn = (unsigned long)(*(unsigned short *)&nRegReturn);
+ break;
+ case typelib_TypeClass_ENUM:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_LONG:
+ nRegReturn = (unsigned long)(*(unsigned int *)&nRegReturn);
+ break;
+ case typelib_TypeClass_VOID:
+ default:
+ break;
+ }
+
return nRegReturn;
}
@@ -422,9 +442,9 @@ namespace
const int codeSnippetSize = 20;
unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex,
- sal_Int32 vtableOffset, bool simple_ret_type )
+ sal_Int32 vtableOffset, bool bHasHiddenParam)
{
- if (!simple_ret_type)
+ if (bHasHiddenParam)
functionIndex |= 0x80000000;
unsigned long * p = (unsigned long *)code;
@@ -478,24 +498,25 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
switch (member->eTypeClass)
{
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+ typelib_InterfaceAttributeTypeDescription *pAttrTD =
+ reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( member );
+
// Getter:
(s++)->fn = code + writetoexecdiff;
code = codeSnippet(
code, functionOffset++, vtableOffset,
- bridges::cpp_uno::shared::isSimpleType(
- reinterpret_cast<
- typelib_InterfaceAttributeTypeDescription * >(
- member)->pAttributeTypeRef));
+ arm::return_in_hidden_param( pAttrTD->pAttributeTypeRef ));
+
// Setter:
- if (!reinterpret_cast<
- typelib_InterfaceAttributeTypeDescription * >(
- member)->bReadOnly)
+ if (!pAttrTD->bReadOnly)
{
(s++)->fn = code + writetoexecdiff;
code = codeSnippet(
- code, functionOffset++, vtableOffset, true);
+ code, functionOffset++, vtableOffset, false);
}
break;
+ }
case typelib_TypeClass_INTERFACE_METHOD:
{
(s++)->fn = code + writetoexecdiff;
@@ -504,11 +525,8 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
reinterpret_cast<
typelib_InterfaceMethodTypeDescription * >(member);
- bool issimple = bridges::cpp_uno::shared::isSimpleType(
- pMethodTD->pReturnTypeRef);
-
code = codeSnippet(code, functionOffset++, vtableOffset,
- issimple);
+ arm::return_in_hidden_param(pMethodTD->pReturnTypeRef));
break;
}
default:
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
index df717fe1f279..ec1e671a72ba 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
@@ -162,8 +162,8 @@ namespace CPPU_CURRENT_NAMESPACE
else
{
// try to lookup the symbol in the generated rtti map
- t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) );
- if (iFind == m_generatedRttis.end())
+ t_rtti_map::const_iterator iFind2( m_generatedRttis.find( unoName ) );
+ if (iFind2 == m_generatedRttis.end())
{
// we must generate it !
// symbol and rtti-name is nearly identical,
@@ -192,7 +192,7 @@ namespace CPPU_CURRENT_NAMESPACE
}
else // taking already generated rtti
{
- rtti = iFind->second;
+ rtti = iFind2->second;
}
}
}
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk
index 44c557795510..0900ec11f41f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk
@@ -80,5 +80,5 @@ SHL1STDLIBS= \
.INCLUDE : target.mk
-$(SLO)$/%.obj: %.s
+$(SLO)$/%.obj: %.S
$(CXX) -c -o $(SLO)$/$(@:b).o $< -fPIC ; touch $@
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
index cfe220abaf17..fb72c360fd45 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
@@ -89,5 +89,12 @@ namespace CPPU_CURRENT_NAMESPACE
void fillUnoException(
__cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
}
+
+namespace arm
+{
+ enum armlimits { MAX_GPR_REGS = 4 };
+ bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef );
+}
+
#endif
/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index 154ae52027bb..be67ed8fd830 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -105,50 +105,94 @@ using namespace ::com::sun::star::uno;
namespace arm
{
- enum armlimits { MAX_GPR_REGS = 4 };
+ bool is_complex_struct(const typelib_TypeDescription * type)
+ {
+ const typelib_CompoundTypeDescription * p
+ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type);
+ for (sal_Int32 i = 0; i < p->nMembers; ++i)
+ {
+ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT ||
+ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * t = 0;
+ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]);
+ bool b = is_complex_struct(t);
+ TYPELIB_DANGER_RELEASE(t);
+ if (b) {
+ return true;
+ }
+ }
+ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass))
+ return true;
+ }
+ if (p->pBaseTypeDescription != 0)
+ return is_complex_struct(&p->pBaseTypeDescription->aBase);
+ return false;
+ }
+
+ bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef )
+ {
+ if (bridges::cpp_uno::shared::isSimpleType(pTypeRef))
+ return false;
+ else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * pTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
+
+ //A Composite Type not larger than 4 bytes is returned in r0
+ bool bRet = pTypeDescr->nSize > 4 || is_complex_struct(pTypeDescr);
+
+ TYPELIB_DANGER_RELEASE( pTypeDescr );
+ return bRet;
+ }
+ return true;
+ }
}
-void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterReturn)
+void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * pReturnType, sal_uInt32* pRegisterReturn)
{
#if !defined(__ARM_EABI__) && !defined(__SOFTFP__)
register float fret asm("f0");
register double dret asm("f0");
#endif
- switch( eReturnType )
+ switch( pReturnType->eTypeClass )
{
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
- ((long*)pRegisterReturn)[1] = r1;
+ pRegisterReturn[1] = r1;
case typelib_TypeClass_LONG:
case typelib_TypeClass_UNSIGNED_LONG:
case typelib_TypeClass_ENUM:
- ((long*)pRegisterReturn)[0] = r0;
- break;
case typelib_TypeClass_CHAR:
case typelib_TypeClass_SHORT:
case typelib_TypeClass_UNSIGNED_SHORT:
- *(unsigned short*)pRegisterReturn = (unsigned short)r0;
- break;
case typelib_TypeClass_BOOLEAN:
case typelib_TypeClass_BYTE:
- *(unsigned char*)pRegisterReturn = (unsigned char)r0;
+ pRegisterReturn[0] = r0;
break;
case typelib_TypeClass_FLOAT:
#if defined(__ARM_EABI__) || defined(__SOFTFP__)
- ((long*)pRegisterReturn)[0] = r0;
+ pRegisterReturn[0] = r0;
#else
*(float*)pRegisterReturn = fret;
#endif
break;
case typelib_TypeClass_DOUBLE:
#if defined(__ARM_EABI__) || defined(__SOFTFP__)
- ((long*)pRegisterReturn)[1] = r1;
- ((long*)pRegisterReturn)[0] = r0;
+ pRegisterReturn[1] = r1;
+ pRegisterReturn[0] = r0;
#else
*(double*)pRegisterReturn = dret;
#endif
break;
+ case typelib_TypeClass_STRUCT:
+ case typelib_TypeClass_EXCEPTION:
+ {
+ if (!arm::return_in_hidden_param(pReturnType))
+ pRegisterReturn[0] = r0;
+ break;
+ }
default:
break;
}
@@ -162,7 +206,7 @@ void callVirtualMethod(
void * pThis,
sal_Int32 nVtableIndex,
void * pRegisterReturn,
- typelib_TypeClass eReturnType,
+ typelib_TypeDescriptionReference * pReturnType,
sal_uInt32 *pStack,
sal_uInt32 nStack,
sal_uInt32 *pGPR,
@@ -172,7 +216,7 @@ void callVirtualMethod(
void * pThis,
sal_Int32 nVtableIndex,
void * pRegisterReturn,
- typelib_TypeClass eReturnType,
+ typelib_TypeDescriptionReference * pReturnType,
sal_uInt32 *pStack,
sal_uInt32 nStack,
sal_uInt32 *pGPR,
@@ -201,23 +245,10 @@ void callVirtualMethod(
typedef void (*FunctionCall )( sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32);
FunctionCall pFunc = (FunctionCall)pMethod;
- // fill registers
- __asm__ __volatile__ (
- "ldr r0, [%0, #0]\n\t"
- "ldr r1, [%0, #4]\n\t"
- "ldr r2, [%0, #8]\n\t"
- "ldr r3, [%0, #12]\n\t"
- : : "r" (pGPR)
- : "r0", "r1", "r2", "r3"
- );
-
- // tell gcc that r0 to r3 are not available to it
- register sal_uInt32 r0 asm("r0");
- register sal_uInt32 r1 asm("r1");
- register sal_uInt32 r2 asm("r2");
- register sal_uInt32 r3 asm("r3");
-
- (*pFunc)(r0, r1, r2, r3);
+ (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3]);
+
+ sal_uInt32 r0;
+ sal_uInt32 r1;
// get return value
__asm__ __volatile__ (
@@ -225,7 +256,7 @@ void callVirtualMethod(
"mov %1, r1\n\t"
: "=r" (r0), "=r" (r1) : );
- MapReturn(r0, r1, eReturnType, pRegisterReturn);
+ MapReturn(r0, r1, pReturnType, (sal_uInt32*)pRegisterReturn);
}
}
@@ -312,14 +343,14 @@ static void cpp_call(
void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
bool bOverFlow = false;
-
+ bool bSimpleReturn = true;
if (pReturnTypeDescr)
{
+ if (arm::return_in_hidden_param( pReturnTypeRef ) )
+ bSimpleReturn = false;
- if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
- {
+ if (bSimpleReturn)
pCppReturn = pUnoReturn; // direct way for simple types
- }
else
{
// complex return via ptr
@@ -390,6 +421,8 @@ static void cpp_call(
case typelib_TypeClass_DOUBLE:
INSERT_DOUBLE( pCppArgs[nPos], nGPR, pGPR, pStack, pStackStart, bOverFlow );
break;
+ default:
+ break;
}
// no longer needed
TYPELIB_DANGER_RELEASE( pParamTypeDescr );
@@ -431,7 +464,7 @@ static void cpp_call(
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
- pCppReturn, pReturnTypeDescr->eTypeClass,
+ pCppReturn, pReturnTypeRef,
pStackStart,
(pStack - pStackStart),
pGPR, nGPR);
@@ -504,15 +537,19 @@ void unoInterfaceProxyDispatch(
// is my surrogate
bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
= static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI);
+#if OSL_DEBUG_LEVEL > 0
typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
+#endif
switch (pMemberDescr->eTypeClass)
{
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
{
+#if OSL_DEBUG_LEVEL > 0
// determine vtable call index
sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition;
OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+#endif
VtableSlot aVtableSlot(
getVtableSlot(
@@ -557,9 +594,11 @@ void unoInterfaceProxyDispatch(
}
case typelib_TypeClass_INTERFACE_METHOD:
{
+#if OSL_DEBUG_LEVEL > 0
// determine vtable call index
sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition;
OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+#endif
VtableSlot aVtableSlot(
getVtableSlot(
diff --git a/comphelper/inc/comphelper/mediadescriptor.hxx b/comphelper/inc/comphelper/mediadescriptor.hxx
index ac9661c76ebc..e20440a3d30d 100644
--- a/comphelper/inc/comphelper/mediadescriptor.hxx
+++ b/comphelper/inc/comphelper/mediadescriptor.hxx
@@ -83,6 +83,7 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
static const ::rtl::OUString& PROP_FILTERNAME();
static const ::rtl::OUString& PROP_FILTEROPTIONS();
static const ::rtl::OUString& PROP_FORMAT();
+ static const ::rtl::OUString& PROP_FRAME();
static const ::rtl::OUString& PROP_FRAMENAME();
static const ::rtl::OUString& PROP_HIDDEN();
static const ::rtl::OUString& PROP_INPUTSTREAM();
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index 7e3be338992b..1710a43027cf 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -183,6 +183,12 @@ const ::rtl::OUString& MediaDescriptor::PROP_FORMAT()
return sProp;
}
+const ::rtl::OUString& MediaDescriptor::PROP_FRAME()
+{
+ static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Frame"));
+ return sProp;
+}
+
const ::rtl::OUString& MediaDescriptor::PROP_FRAMENAME()
{
static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("FrameName"));
diff --git a/dbaccess/uiconfig/dbapp/menubar/menubar.xml b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
index 629aa199f353..baafddcae8ad 100644
--- a/dbaccess/uiconfig/dbapp/menubar/menubar.xml
+++ b/dbaccess/uiconfig/dbapp/menubar/menubar.xml
@@ -59,10 +59,10 @@
<menu:menupopup>
<menu:menu menu:id=".uno:DBDatabaseObjectsMenu">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:DBViewTables"/>
- <menu:menuitem menu:id=".uno:DBViewQueries"/>
- <menu:menuitem menu:id=".uno:DBViewForms"/>
- <menu:menuitem menu:id=".uno:DBViewReports"/>
+ <menu:menuitem menu:id=".uno:DBViewTables" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:DBViewQueries" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:DBViewForms" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:DBViewReports" menu:style="radio"/>
</menu:menupopup>
</menu:menu>
<menu:menuseparator/>
@@ -70,9 +70,9 @@
<menu:menuitem menu:id=".uno:StatusBarVisible"/>
<menu:menu menu:id=".uno:DBPreview">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:DBDisablePreview"/>
- <menu:menuitem menu:id=".uno:DBShowDocInfoPreview"/>
- <menu:menuitem menu:id=".uno:DBShowDocPreview"/>
+ <menu:menuitem menu:id=".uno:DBDisablePreview" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:DBShowDocInfoPreview" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:DBShowDocPreview" menu:style="radio"/>
</menu:menupopup>
</menu:menu>
<menu:menuseparator/>
diff --git a/vbahelper/inc/vbahelper/msvbahelper.hxx b/filter/inc/filter/msfilter/msvbahelper.hxx
index 898c44c349bc..540097c054dc 100644
--- a/vbahelper/inc/vbahelper/msvbahelper.hxx
+++ b/filter/inc/filter/msfilter/msvbahelper.hxx
@@ -28,11 +28,11 @@
#define _MSVBAHELPER_HXX
#include <sfx2/objsh.hxx>
-#include <vbahelper/vbadllapi.h>
+#include "filter/msfilter/msfilterdllapi.h"
namespace ooo { namespace vba
{
- class VBAHELPER_DLLPUBLIC VBAMacroResolvedInfo
+ class MSFILTER_DLLPUBLIC VBAMacroResolvedInfo
{
SfxObjectShell* mpDocContext;
bool mbFound;
@@ -47,9 +47,9 @@ namespace ooo { namespace vba
void SetResolvedMacro(const String& sMacro ) { msResolvedMacro = sMacro; }
};
- VBAHELPER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
- VBAHELPER_DLLPUBLIC VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sMod, bool bSearchGlobalTemplates = false );
- VBAHELPER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
+ MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
+ MSFILTER_DLLPUBLIC VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sMod, bool bSearchGlobalTemplates = false );
+ MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
} }
#endif
diff --git a/filter/inc/filter/msfilter/svxmsbas.hxx b/filter/inc/filter/msfilter/svxmsbas.hxx
index f488017e4804..716c6788989c 100644
--- a/filter/inc/filter/msfilter/svxmsbas.hxx
+++ b/filter/inc/filter/msfilter/svxmsbas.hxx
@@ -64,6 +64,9 @@ public:
// bit 1 = 1 -> the VBA - storage is copy to the ObjectShell storage
int Import( const String& rStorageName, const String &rSubStorageName,
BOOL bAsComment=TRUE, BOOL bStripped=TRUE );
+ int Import( const String& rStorageName, const String &rSubStorageName,
+ const std::vector< String >& codeNames,
+ BOOL bAsComment=TRUE, BOOL bStripped=TRUE );
// only for the export - copy or delete the saved VBA-macro-storage
// form the ObjectShell
@@ -84,6 +87,7 @@ private:
MSFILTER_DLLPRIVATE BOOL ImportCode_Impl( const String& rStorageName,
const String &rSubStorageName,
+ const std::vector< String >& codeNames,
BOOL bAsComment, BOOL bStripped);
MSFILTER_DLLPRIVATE bool ImportForms_Impl(const String& rStorageName,
const String &rSubStorageName);
diff --git a/filter/prj/build.lst b/filter/prj/build.lst
index b4be1c83e63e..bed99e401b7f 100644
--- a/filter/prj/build.lst
+++ b/filter/prj/build.lst
@@ -1,4 +1,4 @@
-fl filter : vbahelper l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt NULL
+fl filter : l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt 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/config/tools/merge/pyAltFCFGMerge b/filter/source/config/tools/merge/pyAltFCFGMerge
index faf9b9c34cb7..d9a974eb9fec 100755
--- a/filter/source/config/tools/merge/pyAltFCFGMerge
+++ b/filter/source/config/tools/merge/pyAltFCFGMerge
@@ -11,7 +11,7 @@
import sys, string, os.path
-CFGFILE = "../../../../transex3/source/filter/merge/FCFGMerge.cfg"
+CFGFILE = "../../../../l10ntools/source/filter/merge/FCFGMerge.cfg"
PROP_XMLVERSION = "xmlversion" # // <= global cfg file
PROP_XMLENCODING = "xmlencoding" # // <= global cfg file
diff --git a/filter/source/msfilter/makefile.mk b/filter/source/msfilter/makefile.mk
index 6056213ddecf..7780529b5580 100644
--- a/filter/source/msfilter/makefile.mk
+++ b/filter/source/msfilter/makefile.mk
@@ -51,7 +51,8 @@ SLOFILES= \
$(SLO)$/mscodec.obj \
$(SLO)$/msfiltertracer.obj \
$(SLO)$/svdfppt.obj \
- $(SLO)$/svxmsbas2.obj
+ $(SLO)$/svxmsbas2.obj \
+ $(SLO)$/msvbahelper.obj \
SHL1TARGET= msfilter$(DLLPOSTFIX)
SHL1IMPLIB= i$(TARGET)
@@ -59,7 +60,6 @@ SHL1OBJS= $(SLOFILES)
SHL1USE_EXPORTS=name
SHL1STDLIBS= \
$(EDITENGLIB) \
- $(VBAHELPERLIB) \
$(SVXCORELIB) \
$(SFX2LIB) \
$(XMLOFFLIB) \
diff --git a/vbahelper/source/vbahelper/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index f0d721529b2c..97529c22eae6 100644
--- a/vbahelper/source/vbahelper/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -24,9 +24,10 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_filter.hxx"
-#define VBAHELPER_DLLIMPLEMENTATION
-#include <vbahelper/msvbahelper.hxx>
+#include <filter/msfilter/msvbahelper.hxx>
#include <basic/sbx.hxx>
#include <basic/sbstar.hxx>
#include <basic/basmgr.hxx>
diff --git a/filter/source/msfilter/msvbasic.cxx b/filter/source/msfilter/msvbasic.cxx
index 91348043b75f..be8ee6bd30e5 100644
--- a/filter/source/msfilter/msvbasic.cxx
+++ b/filter/source/msfilter/msvbasic.cxx
@@ -38,6 +38,10 @@
#include <rtl/tencinfo.h> //rtl_getTextEncodingFromWindowsCodePage
#include "msvbasic.hxx"
+#include <com/sun/star/script/ModuleType.hpp>
+
+using namespace ::com::sun::star::script;
+
/*
A few urls which may in the future be of some use
http://www.virusbtn.com/vb2000/Programme/papers/bontchev.pdf
@@ -429,7 +433,7 @@ int VBA_Impl::ReadVBAProject(const SvStorageRef &rxVBAStorage)
*
*/
-ModuleType VBA_Impl::GetModuleType( const UniString& rModuleName )
+ModType VBA_Impl::GetModuleType( const UniString& rModuleName )
{
ModuleTypeHash::iterator iter = mhModHash.find( rModuleName );
ModuleTypeHash::iterator iterEnd = mhModHash.end();
@@ -437,7 +441,7 @@ ModuleType VBA_Impl::GetModuleType( const UniString& rModuleName )
{
return iter->second;
}
- return Unknown;
+ return ModuleType::UNKNOWN;
}
bool VBA_Impl::Open( const String &rToplevel, const String &rSublevel )
@@ -480,7 +484,7 @@ bool VBA_Impl::Open( const String &rToplevel, const String &rSublevel )
static const String sClass( RTL_CONSTASCII_USTRINGPARAM( "Class" ) );
static const String sBaseClass( RTL_CONSTASCII_USTRINGPARAM( "BaseClass" ) );
static const String sDocument( RTL_CONSTASCII_USTRINGPARAM( "Document" ) );
- mhModHash[ sThisDoc ] = Class;
+ mhModHash[ sThisDoc ] = ModuleType::CLASS;
while ( pStp->ReadByteStringLine( tmp, meCharSet ) )
{
xub_StrLen index = tmp.Search( '=' );
@@ -490,14 +494,14 @@ bool VBA_Impl::Open( const String &rToplevel, const String &rSublevel )
String value = tmp.Copy( index + 1 );
if ( key == sClass )
{
- mhModHash[ value ] = Class;
+ mhModHash[ value ] = ModuleType::CLASS;
OSL_TRACE("Module %s is of type Class",
::rtl::OUStringToOString( value ,
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
}
else if ( key == sBaseClass )
{
- mhModHash[ value ] = Form;
+ mhModHash[ value ] = ModuleType::FORM;
OSL_TRACE("Module %s is of type Form",
::rtl::OUStringToOString( value ,
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
@@ -510,14 +514,14 @@ bool VBA_Impl::Open( const String &rToplevel, const String &rSublevel )
// value is of form <name>/&H<identifier>, strip the identifier
value.Erase( value.Search( '/' ) );
- mhModHash[ value ] = Document;
+ mhModHash[ value ] = ModuleType::DOCUMENT;
OSL_TRACE("Module %s is of type Document VBA",
::rtl::OUStringToOString( value ,
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
}
else if ( key == sModule )
{
- mhModHash[ value ] = Normal;
+ mhModHash[ value ] = ModuleType::NORMAL;
OSL_TRACE("Module %s is of type Normal VBA",
::rtl::OUStringToOString( value ,
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
diff --git a/filter/source/msfilter/msvbasic.hxx b/filter/source/msfilter/msvbasic.hxx
index 5b361518c0f5..171671e8cd5c 100644
--- a/filter/source/msfilter/msvbasic.hxx
+++ b/filter/source/msfilter/msvbasic.hxx
@@ -30,16 +30,12 @@
#ifndef _MSVBASIC_HXX
#define _MSVBASIC_HXX
-#ifdef _SOLAR_H
#include <tools/solar.h>
-#endif
#include <tools/debug.hxx>
#include <sot/storage.hxx>
#include <tools/dynary.hxx>
-#ifndef __SGI_STL_VECTOR
#include <vector>
-#endif
-#include<map>
+#include <map>
/* class VBA:
* The VBA class provides a set of methods to handle Visual Basic For
@@ -63,13 +59,12 @@ DECLARE_DYNARRAY(StringArray,String *)
// #117718# define internal types to distinguish between
// module types, form, class & normal
// #i37965# DR 2004-12-03: add "Document", used in Excel for macros attached to sheet
-enum ModuleType { Unknown = 0, Normal, Class, Form, Document };
// #117718# define map to hold types of module
//
-
+typedef sal_Int32 ModType;
typedef ::std::map< UniString,
- ModuleType > ModuleTypeHash;
+ ModType > ModuleTypeHash;
class VBA_Impl
{
@@ -90,8 +85,7 @@ public:
void Output(int len, const sal_uInt8 *data);
//
// #117718# member map of module names to types of module
- ModuleType GetModuleType( const UniString& rModuleName );
-
+ ModType GetModuleType( const UniString& rModuleName );
std::vector<String> maReferences;
private:
struct VBAOffset_Impl
diff --git a/filter/source/msfilter/svxmsbas.cxx b/filter/source/msfilter/svxmsbas.cxx
index e4305c2e4e65..55465850d8c8 100644
--- a/filter/source/msfilter/svxmsbas.cxx
+++ b/filter/source/msfilter/svxmsbas.cxx
@@ -50,6 +50,11 @@ using namespace com::sun::star::awt;
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
+#include <com/sun/star/script/XVBAModuleInfo.hpp>
+#include <com/sun/star/script/XVBACompat.hpp>
+
using namespace com::sun::star::container;
using namespace com::sun::star::script;
using namespace com::sun::star::uno;
@@ -58,12 +63,23 @@ using namespace com::sun::star;
using rtl::OUString;
+static ::rtl::OUString sVBAOption( RTL_CONSTASCII_USTRINGPARAM( "Option VBASupport 1\n" ) );
+
+int SvxImportMSVBasic::Import( const String& rStorageName,
+ const String &rSubStorageName,
+ BOOL bAsComment, BOOL bStripped )
+{
+ std::vector< String > codeNames;
+ return Import( rStorageName, rSubStorageName, codeNames, bAsComment, bStripped );
+}
+
int SvxImportMSVBasic::Import( const String& rStorageName,
const String &rSubStorageName,
+ const std::vector< String >& codeNames,
BOOL bAsComment, BOOL bStripped )
{
int nRet = 0;
- if( bImport && ImportCode_Impl( rStorageName, rSubStorageName,
+ if( bImport && ImportCode_Impl( rStorageName, rSubStorageName, codeNames,
bAsComment, bStripped ))
nRet |= 1;
@@ -225,6 +241,7 @@ BOOL SvxImportMSVBasic::CopyStorage_Impl( const String& rStorageName,
BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
const String &rSubStorageName,
+ const std::vector< String >& codeNames,
BOOL bAsComment, BOOL bStripped )
{
BOOL bRet = FALSE;
@@ -233,13 +250,18 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
{
SFX_APP()->EnterBasicCall();
Reference<XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer();
+ Reference<XVBACompat> xVBACompat( xLibContainer, UNO_QUERY );
+
+ if ( xVBACompat.is() && !bAsComment )
+ xVBACompat->setVBACompatModeOn( sal_True );
+
DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
UINT16 nStreamCount = aVBA.GetNoStreams();
Reference<XNameContainer> xLib;
+ String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
if( xLibContainer.is() && nStreamCount )
{
- String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
if( !xLibContainer->hasByName( aLibName ) )
xLibContainer->createLibrary( aLibName );
@@ -248,6 +270,28 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
}
if( xLib.is() )
{
+ Reference< script::XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY );
+ Reference< container::XNameAccess > xVBACodeNamedObjectAccess;
+ if ( !bAsComment )
+ {
+ Reference< XMultiServiceFactory> xSF(rDocSh.GetModel(), UNO_QUERY);
+ if ( xSF.is() )
+ {
+ try
+ {
+ xVBACodeNamedObjectAccess.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAObjectModuleObjectProvider"))), UNO_QUERY );
+ }
+ catch( Exception& ) { }
+ }
+ }
+ typedef std::hash_map< rtl::OUString, uno::Any, ::rtl::OUStringHash,
+::std::equal_to< ::rtl::OUString > > NameModuleDataHash;
+ typedef std::hash_map< rtl::OUString, script::ModuleInfo, ::rtl::OUStringHash,
+::std::equal_to< ::rtl::OUString > > NameModuleInfoHash;
+
+ NameModuleDataHash moduleData;
+ NameModuleInfoHash moduleInfos;
+
for( UINT16 i=0; i<nStreamCount;i++)
{
StringArray aDecompressed = aVBA.Decompress(i);
@@ -281,7 +325,7 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
// is the same as the encoding for the names
// that are keys in the map used by GetModuleType method
const String &sOrigVBAModName = aVBA.GetStreamName( i );
- ModuleType mType = aVBA.GetModuleType( sOrigVBAModName );
+ ModType mType = aVBA.GetModuleType( sOrigVBAModName );
rtl::OUString sClassRem( RTL_CONSTASCII_USTRINGPARAM( "Rem Attribute VBA_ModuleType=" ) );
@@ -289,23 +333,23 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
switch( mType )
{
- case Class:
+ case ModuleType::CLASS:
modeTypeComment = sClassRem +
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAClassModule\n" ) );
break;
- case Form:
+ case ModuleType::FORM:
modeTypeComment = sClassRem +
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAFormModule\n" ) );
break;
- case Document:
+ case ModuleType::DOCUMENT:
modeTypeComment = sClassRem +
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBADocumentModule\n" ) );
break;
- case Normal:
+ case ModuleType::NORMAL:
modeTypeComment = sClassRem +
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAModule\n" ) );
break;
- case Unknown:
+ case ModuleType::UNKNOWN:
modeTypeComment = sClassRem +
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBAUnknown\n" ) );
break;
@@ -313,12 +357,11 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
DBG_ERRORFILE( "SvxImportMSVBasic::ImportCode_Impl - unknown module type" );
break;
}
- static ::rtl::OUString sVBAOption( RTL_CONSTASCII_USTRINGPARAM( "Option VBASupport 1\n" ) );
static ::rtl::OUString sClassOption( RTL_CONSTASCII_USTRINGPARAM( "Option ClassModule\n" ) );
if ( !bAsComment )
{
modeTypeComment = modeTypeComment + sVBAOption;
- if ( mType == Class )
+ if ( mType == ModuleType::CLASS )
modeTypeComment = modeTypeComment + sClassOption;
}
@@ -380,20 +423,69 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
aSource += rtl::OUString::createFromAscii("\nEnd Sub");
}
::rtl::OUString aModName( sModule );
- if ( aSource.getLength() )
- {
- aSource = modeTypeComment + aSource;
+ aSource = modeTypeComment + aSource;
- Any aSourceAny;
+ Any aSourceAny;
+ OSL_TRACE("erm %d", mType );
aSourceAny <<= aSource;
- if( xLib->hasByName( aModName ) )
- xLib->replaceByName( aModName, aSourceAny );
- else
- xLib->insertByName( aModName, aSourceAny );
+ if ( !bAsComment )
+ {
+ OSL_TRACE("vba processing %d", mType );
+ script::ModuleInfo sModuleInfo;
+ sModuleInfo.ModuleType = mType;
+ moduleInfos[ aModName ] = sModuleInfo;
+ }
+ moduleData[ aModName ] = aSourceAny;
+ }
+ // Hack for missing codenames ( only know to happen in excel but... )
+ // only makes sense to do this if we are importing non-commented basic
+ if ( !bAsComment )
+ {
+ for ( std::vector< String >::const_iterator it = codeNames.begin(); it != codeNames.end(); ++it )
+ {
+ script::ModuleInfo sModuleInfo;
+ sModuleInfo.ModuleType = ModuleType::DOCUMENT;
+ moduleInfos[ *it ] = sModuleInfo;
+ moduleData[ *it ] = uno::makeAny( sVBAOption );
+ }
+ }
+ NameModuleDataHash::iterator it_end = moduleData.end();
+ for ( NameModuleDataHash::iterator it = moduleData.begin(); it != it_end; ++it )
+ {
+ NameModuleInfoHash::iterator it_info = moduleInfos.find( it->first );
+ if ( it_info != moduleInfos.end() )
+ {
+ ModuleInfo& sModuleInfo = it_info->second;
+ if ( sModuleInfo.ModuleType == ModuleType::FORM )
+ // hack, the module ( imo document basic should...
+ // know the XModel... ) but it doesn't
+ sModuleInfo.ModuleObject.set( rDocSh.GetModel(), UNO_QUERY );
+ // document modules, we should be able to access
+ // the api objects at this time
+ else if ( sModuleInfo.ModuleType == ModuleType::DOCUMENT )
+ {
+ if ( xVBACodeNamedObjectAccess.is() )
+ {
+ try
+ {
+ sModuleInfo.ModuleObject.set( xVBACodeNamedObjectAccess->getByName( it->first ), uno::UNO_QUERY );
+ OSL_TRACE("** Straight up creation of Module");
+ }
+ catch(uno::Exception& e)
+ {
+ OSL_TRACE("Failed to get documument object for %s", rtl::OUStringToOString( it->first, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+ }
+ xVBAModuleInfo->insertModuleInfo( it->first, sModuleInfo );
}
- bRet = true;
+ if( xLib->hasByName( it->first ) )
+ xLib->replaceByName( it->first, it->second );
+ else
+ xLib->insertByName( it->first, it->second );
}
+ bRet = true;
}
SFX_APP()->LeaveBasicCall();
}
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index 9c8e68e24734..f2c905f237e8 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -344,6 +344,9 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
std::map< sal_Int16, ::rtl::OUString > LangTable;
const ::rtl::OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*"));
+ bool bMultipleLanguages = (eMode != MODE_SetLanguageSelectionMenu) || m_aCurLang.compareToAscii( "*" ) == 0;
+ bool bNothingSelected = true;
+ MenuItemBits nItemBits = !bMultipleLanguages ? MIB_RADIOCHECK : 0;
for(std::map< ::rtl::OUString, ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it)
{
if(it->first != ::rtl::OUString( aLangTable.GetString( LANGUAGE_NONE ) )&&
@@ -351,12 +354,13 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
it->first.getLength())
{
++nItemId;
- pPopupMenu->InsertItem( nItemId,it->first);
+ pPopupMenu->InsertItem( nItemId,it->first,nItemBits );
LangTable[nItemId] = it->first;
if(it->first == m_aCurLang && eMode == MODE_SetLanguageSelectionMenu )
{
//make a sign for the current language
pPopupMenu->CheckItem(nItemId,TRUE);
+ bNothingSelected = false;
}
aCmd=aCmd_Language;
aCmd+=(String)it->first;
@@ -366,7 +370,9 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
//7--none
nItemId++;
- pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_NONE )) );
+ pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_NONE )), nItemBits );
+ if (bNothingSelected && !bMultipleLanguages)
+ pPopupMenu->CheckItem(nItemId,TRUE);
aCmd=aCmd_Language;
aCmd+=String::CreateFromAscii("LANGUAGE_NONE");
pPopupMenu->SetItemCommand(nItemId,aCmd);
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 953470314785..544597261852 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -272,6 +272,9 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
}
}
std::map< sal_Int16, ::rtl::OUString > LangTable;
+ bool bMultipleLanguages = m_aCurLang.compareToAscii( "*" ) == 0;
+ bool bNothingSelected = true;
+ sal_Int16 nMenuItemStyle = !bMultipleLanguages ? css::awt::MenuItemStyle::RADIOCHECK : 0;
for( std::set< ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it )
{
@@ -281,22 +284,26 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
{
//nItemId = xPopupMenu->getItemCount()+1;
nItemId++;
- xPopupMenu->insertItem( nItemId, *it, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ xPopupMenu->insertItem( nItemId, *it, nMenuItemStyle, nItemId );
LangTable[nItemId]=*it;
if( *it == m_aCurLang )
{
//make a sign for the current language
xPopupMenu->checkItem( nItemId, TRUE );
+ bNothingSelected = false;
}
}
}
//7--none
nItemId++;
- xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), nMenuItemStyle, nItemId );
+ if (bNothingSelected && !bMultipleLanguages)
+ xPopupMenu->checkItem( nItemId, TRUE );
+
//More...
nItemId++;
- xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ xPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), 0, nItemId );
for( ::std::set< ::rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it )
{
@@ -305,22 +312,22 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R
*it != ::rtl::OUString::createFromAscii( "" ))
{
nItemId++;
- subPopupMenu->insertItem( nItemId, *it, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ subPopupMenu->insertItem( nItemId, *it, 0, nItemId );
LangTable[nItemId]=*it;
}
}
//7--none
nItemId++;
- subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_NONE )), 0, nItemId );
//More
nItemId++;
- subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ subPopupMenu->insertItem( nItemId, String( FwkResId( STR_LANGSTATUS_MORE )), 0, nItemId );
nItemId++;
xPopupMenu->insertSeparator(nItemId);
nItemId++;
- xPopupMenu->insertItem( nItemId, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ xPopupMenu->insertItem( nItemId, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), 0, nItemId );
xPopupMenu->setPopupMenu( nItemId, subPopupMenu );
//display the popup menu and execute every command
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 9fbdf87336cc..9d8aa9205c90 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -548,11 +548,14 @@ throw ( RuntimeException )
if ( Event.State >>= bCheckmark )
{
- // Checkmark
+ // Checkmark or RadioButton
m_pVCLMenu->ShowItem( pMenuItemHandler->nItemId, TRUE );
m_pVCLMenu->CheckItem( pMenuItemHandler->nItemId, bCheckmark );
- m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId,
- m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId ) | MIB_CHECKABLE );
+
+ MenuItemBits nBits = m_pVCLMenu->GetItemBits( pMenuItemHandler->nItemId );
+ //If not already designated RadioButton set as CheckMark
+ if (!(nBits & MIB_RADIOCHECK))
+ m_pVCLMenu->SetItemBits( pMenuItemHandler->nItemId, nBits | MIB_CHECKABLE );
}
else if ( Event.State >>= aItemText )
{
@@ -1805,6 +1808,8 @@ void MenuBarManager::FillMenu(
nBits |= MIB_ICON;
if ( nStyle & ::com::sun::star::ui::ItemStyle::TEXT )
nBits |= MIB_TEXT;
+ if ( nStyle & ::com::sun::star::ui::ItemStyle::RADIO_CHECK )
+ nBits |= MIB_RADIOCHECK;
pMenu->SetItemBits( nId, nBits );
}
if ( xIndexContainer.is() )
diff --git a/framework/source/xml/menudocumenthandler.cxx b/framework/source/xml/menudocumenthandler.cxx
index 90f5fb25dec3..3fc5d1775be4 100644
--- a/framework/source/xml/menudocumenthandler.cxx
+++ b/framework/source/xml/menudocumenthandler.cxx
@@ -94,6 +94,7 @@
#define ATTRIBUTE_ITEMSTYLE_TEXT "text"
#define ATTRIBUTE_ITEMSTYLE_IMAGE "image"
+#define ATTRIBUTE_ITEMSTYLE_RADIO "radio"
// Property names of a menu/menu item ItemDescriptor
static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL";
@@ -134,6 +135,7 @@ struct MenuStyleItem
MenuStyleItem MenuItemStyles[ ] = {
{ ::com::sun::star::ui::ItemStyle::ICON, ATTRIBUTE_ITEMSTYLE_IMAGE },
{ ::com::sun::star::ui::ItemStyle::TEXT, ATTRIBUTE_ITEMSTYLE_TEXT },
+ { ::com::sun::star::ui::ItemStyle::RADIO_CHECK, ATTRIBUTE_ITEMSTYLE_RADIO }
};
@@ -437,8 +439,10 @@ throw( SAXException, RuntimeException )
{
if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT;
- if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::ICON;
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) )
+ nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK;
}
}
while ( nIndex >= 0 );
@@ -670,8 +674,10 @@ throw( SAXException, RuntimeException )
{
if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT;
- if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::ICON;
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) )
+ nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK;
}
}
while ( nIndex >= 0 );
@@ -725,8 +731,10 @@ throw( SAXException, RuntimeException )
{
if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_TEXT ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::TEXT;
- if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_IMAGE ) ) )
nItemBits |= ::com::sun::star::ui::ItemStyle::ICON;
+ else if ( aToken.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ITEMSTYLE_RADIO ) ) )
+ nItemBits |= ::com::sun::star::ui::ItemStyle::RADIO_CHECK;
}
}
while ( nIndex >= 0 );
diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index 5ce50111d519..30da95e51c97 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -213,7 +213,6 @@ OpenOffice_Dev
PACKAGEREVISION {milestone}
LICENSENAME LGPL
SERVICESPROJEKT 1
- WITHJREPRODUCT 1
GLOBALFILEGID gid_File_Lib_Vcl
GLOBALPATCHFILEGID gid_File_Txt_Patchfiles
SPELLCHECKERFILE spellchecker_selection.txt
@@ -565,7 +564,6 @@ BrOffice_Dev
PACKAGEREVISION {milestone}
LICENSENAME LGPL
SERVICESPROJEKT 1
- WITHJREPRODUCT 1
SETSTATICPATH 1
GLOBALFILEGID gid_File_Lib_Vcl
GLOBALPATCHFILEGID gid_File_Txt_Patchfiles
diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java
index 1245247c3c9a..2a49f964d48f 100644
--- a/l10ntools/source/help/HelpIndexerTool.java
+++ b/l10ntools/source/help/HelpIndexerTool.java
@@ -69,6 +69,7 @@ public class HelpIndexerTool
String aModule = "";
String aTargetZipFileStr = "";
String aCfsName = "";
+ String aSegmentName = "";
// Scan arguments
boolean bLang = false;
@@ -77,6 +78,7 @@ public class HelpIndexerTool
boolean bSrcDir = false;
boolean bOutput = false;
boolean bCfsName = false;
+ boolean bSegmentName = false;
int nArgCount = args.length;
for( int i = 0 ; i < nArgCount ; i++ )
@@ -126,7 +128,7 @@ public class HelpIndexerTool
}
i++;
}
- else if( "-checkcfsname".equals(args[i]) )
+ else if( "-checkcfsandsegname".equals(args[i]) )
{
if( i + 1 < nArgCount )
{
@@ -134,6 +136,17 @@ public class HelpIndexerTool
bCfsName = true;
}
i++;
+ if( i + 1 < nArgCount )
+ {
+ aSegmentName = "segments" + args[i + 1];
+ bSegmentName = true;
+ }
+ i++;
+ if (!(bCfsName && bSegmentName))
+ {
+ System.out.println("Usage: HelpIndexer -checkcfsandsegname _0 _3 (2 arguments needed)");
+ System.exit( -1 );
+ }
}
}
@@ -173,12 +186,17 @@ public class HelpIndexerTool
writer.close();
boolean bCfsFileOk = true;
- if( bCfsName && !bExtensionMode && nRet != -1 )
+ boolean bSegmentFileOk = true;
+ if( bCfsName && bSegmentName && !bExtensionMode && nRet != -1 )
{
String aCompleteCfsFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aCfsName;
+ String aCompleteSegmentFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aSegmentName;
File aCfsFile = new File( aCompleteCfsFileName );
+ File aSegmentFile = new File( aCompleteSegmentFileName );
bCfsFileOk = aCfsFile.exists();
+ bSegmentFileOk = aSegmentFile.exists();
System.out.println( "Checking cfs file " + aCfsName+ ": " + (bCfsFileOk ? "Found" : "Not found") );
+ System.out.println( "Checking segment file " + aSegmentName+ ": " + (bSegmentFileOk ? "Found" : "Not found") );
}
if( bExtensionMode )
@@ -194,7 +212,7 @@ public class HelpIndexerTool
if( nRet == -1 )
deleteRecursively( aIndexDir );
- if( bCfsFileOk )
+ if( bCfsFileOk && bSegmentFileOk )
System.out.println( "Zipping ..." );
File aDirToZipFile = new File( aDirToZipStr );
createZipFile( aDirToZipFile, aTargetZipFileStr );
@@ -207,6 +225,12 @@ public class HelpIndexerTool
System.exit( -1 );
}
+ if( !bSegmentFileOk )
+ {
+ System.out.println( "segment file check failed, terminating..." );
+ System.exit( -1 );
+ }
+
Date end = new Date();
if( !bExtensionMode )
System.out.println(end.getTime() - start.getTime() + " total milliseconds");
diff --git a/moz/makefile.mk b/moz/makefile.mk
index 9629f7138b74..967e29688a7e 100644
--- a/moz/makefile.mk
+++ b/moz/makefile.mk
@@ -88,6 +88,10 @@ PATCH_FILES = \
patches/arm_build_fix.patch \
patches/link_fontconfig.patch
+.IF "$(OUTPATH)"=="unxlngi6"
+PATCH_FILES += patches/linux_libc2.5.patch
+.ENDIF
+
# This file is needed for the W32 build when BUILD_MOZAB is set
# (currently only vc8/vs2005 is supported when BUILD_MOZAB is set)
.IF "$(COM)"=="GCC"
diff --git a/moz/patches/linux_libc2.5.patch b/moz/patches/linux_libc2.5.patch
new file mode 100644
index 000000000000..b7f18141f457
--- /dev/null
+++ b/moz/patches/linux_libc2.5.patch
@@ -0,0 +1,11 @@
+--- misc/mozilla/configure 2010-04-14 18:08:55.402759185 +0200
++++ misc/build/mozilla/configure 2010-04-14 18:07:13.036410334 +0200
+@@ -11886,7 +11886,7 @@
+ $(DIST)/lib/$(LIB_PREFIX)nss'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
+ $(DIST)/lib/$(LIB_PREFIX)softokn'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX)'
+ else
+- NSS_LIBS='-L$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lsoftokn$NSS_VERSION"
++ NSS_LIBS='-L$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
+ fi
+ fi
+
diff --git a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl
index 56f5305d10f2..db69a6b5d842 100644
--- a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl
+++ b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl
@@ -38,6 +38,7 @@
//=============================================================================
/** If you do not want to implement the <type>XGridColumnModel</type> yourself, use this service.
+ @since OOo 3.3.0
*/
service DefaultGridColumnModel
{
diff --git a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
index e823e451249c..c487afc79b49 100644
--- a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
+++ b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl
@@ -38,6 +38,8 @@
//=============================================================================
/** If you do not want to implement the <type>XGridDataModel</type> yourself, use this service.
+
+ @since OOo 3.3.0
*/
service DefaultGridDataModel
{
diff --git a/offapi/com/sun/star/awt/grid/GridColumn.idl b/offapi/com/sun/star/awt/grid/GridColumn.idl
index a38d6cafd903..a87aef84f7d3 100644
--- a/offapi/com/sun/star/awt/grid/GridColumn.idl
+++ b/offapi/com/sun/star/awt/grid/GridColumn.idl
@@ -38,6 +38,8 @@
//=============================================================================
/** Represents a column as used by the <type>DefaultGridColumnModel</type>
+
+ @since OOo 3.3.0
*/
service GridColumn
{
diff --git a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
index dfc6905d1148..caab721185a5 100644
--- a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl
@@ -31,24 +31,14 @@
#include <com/sun/star/lang/EventObject.idl>
#endif
-#ifndef __com_sun_star_awt_grid_XGridColumn_idl__
-#include <com/sun/star/awt/grid/XGridColumn.idl>
-#endif
-
//=============================================================================
module com { module sun { module star { module awt { module grid {
//=============================================================================
+/** An event used by a <type>XGridColumn</type> to notify changes in the column.
-/** An event used by a <type>XGridColumnModel</type> to notify changes in the column
- model to the <type>XGridControl</type>.
- You usually need to fill this event only if you implement the <type>XGridColumnModel</type>
- yourself.
-
- @see XGridColumnModel
- @see XGridControl
- @see XGridColumnListener
+ @since OOo 3.3.0
*/
struct GridColumnEvent: com::sun::star::lang::EventObject
{
@@ -63,9 +53,6 @@ struct GridColumnEvent: com::sun::star::lang::EventObject
/** Contains the index of the changed column**/
long index;
-
- /** Contains the changed column**/
- XGridColumn column;
//-------------------------------------------------------------------------
};
diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl
index 30d87a3f1c46..1e0afb610f16 100644
--- a/offapi/com/sun/star/awt/grid/GridDataEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl
@@ -27,10 +27,7 @@
#ifndef __com_sun_star_awt_grid_GridDataEvent_idl__
#define __com_sun_star_awt_grid_GridDataEvent_idl__
-#ifndef __com_sun_star_lang_EventObject_idl__
#include <com/sun/star/lang/EventObject.idl>
-#endif
-
//=============================================================================
@@ -46,6 +43,8 @@ module com { module sun { module star { module awt { module grid {
@see XGridDataModel
@see XGridControl
@see XGridDataListener
+
+ @sonce OOo 3.3.0
*/
struct GridDataEvent: com::sun::star::lang::EventObject
{
@@ -67,7 +66,7 @@ struct GridDataEvent: com::sun::star::lang::EventObject
string headerName;
/** Contains the changed row**/
- sequence<string> rowData;
+ sequence<any> rowData;
};
diff --git a/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl
new file mode 100644
index 000000000000..af1f90dfdc8b
--- /dev/null
+++ b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GridInvalidDataException.idl,v $
+ * $Revision: 1.0 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_GridInvalidDataException_idl__
+#define __com_sun_star_awt_grid_GridInvalidDataException_idl__
+
+#ifndef __com_sun_star_uno_RuntimeException_idl__
+#include <com/sun/star/uno/RuntimeException.idl>
+#endif
+
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module grid {
+
+//=============================================================================
+
+/** Exception is thrown to indicate that set data is invalid, e.g. type of data is unknown
+ or data count doesn't match with column count.
+
+ @since OOo 3.3.0
+ */
+exception GridInvalidDataException : com::sun::star::uno::RuntimeException
+{
+
+};
+
+//=============================================================================
+
+}; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl
new file mode 100644
index 000000000000..9d96daf624bb
--- /dev/null
+++ b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GridInvalidModelException.idl,v $
+ * $Revision: 1.0 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_GridInvalidModelException_idl__
+#define __com_sun_star_awt_grid_GridInvalidModelException_idl__
+
+#ifndef __com_sun_star_uno_RuntimeException_idl__
+#include <com/sun/star/uno/RuntimeException.idl>
+#endif
+
+
+//=============================================================================
+
+module com { module sun { module star { module awt { module grid {
+
+//=============================================================================
+
+/** Exception is thrown when data or column model isn't set.
+
+ @since OOo 3.3.0
+ */
+exception GridInvalidModelException : com::sun::star::uno::RuntimeException
+{
+
+};
+
+//=============================================================================
+
+}; }; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl
index 2475e59b5b26..e9b87c2fe7ed 100644
--- a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl
@@ -50,14 +50,17 @@ struct GridSelectionEvent: com::sun::star::lang::EventObject
{
//-------------------------------------------------------------------------
- /** Contains the x coordinate of the selected cell**/
- long x;
+ /** the selected row*/
+ long Row;
- /** Contains the y coordinate of the selected cell**/
- long y;
+ /** the selected column*/
+ long Column;
+
+ /**number of selected rows, if multiple rows selected*/
+ long Range;
/** Contains the action <type>SelectionEventType</types> that was performed **/
- SelectionEventType action;
+ SelectionEventType Action;
};
diff --git a/offapi/com/sun/star/awt/grid/SelectionEventType.idl b/offapi/com/sun/star/awt/grid/SelectionEventType.idl
index 8096ceceeb13..c7ee61498cc3 100644
--- a/offapi/com/sun/star/awt/grid/SelectionEventType.idl
+++ b/offapi/com/sun/star/awt/grid/SelectionEventType.idl
@@ -49,7 +49,13 @@ enum SelectionEventType
/** This value indicates that a selection was removed from the grid control
*/
- REMOVE
+ REMOVE,
+
+ //-------------------------------------------------------------------------
+
+ /** This value indicates that a selection was changed
+ */
+ CHANGE
};
diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
index 7de3eda02231..542c27085dcb 100644
--- a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
+++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
@@ -66,6 +66,7 @@
The <type>XGridSelection</type> interface provides a bunch of methods to set and get selection for the grid control.
</p>
+ @since OOo 3.3.0
*/
service UnoControlGrid
{
diff --git a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
index bcb28af294b8..7eea49624045 100644
--- a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
+++ b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl
@@ -37,6 +37,12 @@
#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>
+
//=============================================================================
module com { module sun { module star { module awt { module grid {
@@ -44,6 +50,8 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
/** specifies the standard model of a <type>UnoControlGridModel</type>.
+
+ @since OOo 3.3.0
*/
service UnoControlGridModel
{
@@ -84,11 +92,68 @@ service UnoControlGridModel
*/
[property] boolean VScroll;
+ /** Specifies that the control can be reached with the TAB key.
+ */
+ [property] boolean Tabstop;
+
/** Specifies the selection mode that is enabled for this grid control.
<p>The default value is <member scope="com::sun::star::view">SelectionType::SINGLE</member></p>
*/
[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.
+ */
+ [property] ::com::sun::star::util::Color RowBackgroundColor;
+
+ /** Specifies the background color of even rows. Default value is white.
+ */
+ [property] ::com::sun::star::util::Color EvenRowBackgroundColor;
+
+ /** Specifies the background color of header. Default value is white.
+ */
+ [property] ::com::sun::star::util::Color HeaderBackgroundColor;
+
+ /** Specifies the text color. Default value is black.
+ */
+ [property] ::com::sun::star::util::Color TextColor;
+
+ /** Specifies the line color. Default value is white.
+ */
+ [property] ::com::sun::star::util::Color LineColor;
+
+ /** specifies the vertical alignment of the content in the control.
+
+ <pre>
+ TOP
+ MIDDLE
+ BOTTOM
+ </pre>
+ */
+ [property] com::sun::star::style::VerticalAlignment VerticalAlign;
+
+ /** specifies the font attributes of the text in the control.
+ */
+ [property] com::sun::star::awt::FontDescriptor FontDescriptor;
+
+ /** specifies the <type scope="com::sun::star::text">FontEmphasis</type>
+ value of the text in the control.
+ */
+ [property] short FontEmphasisMark;
+
+ /** specifies the <type scope="com::sun::star::text">FontRelief</type>
+ value of the text in the control.
+ */
+ [property] short FontRelief;
+
+ /** specifies the help text of the control.
+ */
+ [property] string HelpText;
+
+ /** specifies the help URL of the control.
+ */
+ [property] string HelpURL;
+
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridCell.idl b/offapi/com/sun/star/awt/grid/XGridCell.idl
index b64c40a3dce4..08f3cfd1b2d5 100644
--- a/offapi/com/sun/star/awt/grid/XGridCell.idl
+++ b/offapi/com/sun/star/awt/grid/XGridCell.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
-interface XGridCell: com::sun::star::uno::XInterface
+interface XGridCell
{
[attribute] string Value;
diff --git a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl b/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl
index 825acd4af43a..7f9fa28c3307 100644
--- a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl
+++ b/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl
@@ -37,10 +37,9 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
-/** gives access to the items of a list box and makes it possible to
- register item and action event listeners.
+/** renderer for cells
*/
-interface XGridCellRenderer: com::sun::star::uno::XInterface
+interface XGridCellRenderer
{
//-------------------------------------------------------------------------
diff --git a/offapi/com/sun/star/awt/grid/XGridColumn.idl b/offapi/com/sun/star/awt/grid/XGridColumn.idl
index 9c9981959ed3..d217ff5d4ac6 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumn.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumn.idl
@@ -30,6 +30,9 @@
#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif
+#include <com/sun/star/style/HorizontalAlignment.idl>
+#include <com/sun/star/awt/grid/XGridColumnListener.idl>
+
//=============================================================================
@@ -38,28 +41,67 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
/** The <type>XGridColumn</types> defines the properties and behavior of a column in a grid control
+ @since OOo 3.3.0
*/
-interface XGridColumn: com::sun::star::uno::XInterface
+interface XGridColumn
{
/** Specifies the an idendifier of the colomn.**/
[attribute] any Identifier;
/** Specifies the default column witdth. **/
[attribute] long ColumnWidth;
- /*
+
+ /** Specifies the preferred column witdth. **/
[attribute] long PreferredWidth;
+ /** Specifies the min column witdth. **/
[attribute] long MinWidth;
+ /** Specifies the max column witdth. **/
[attribute] long MaxWidth;
- [attribute] boolean Resizable;
- */
+ /** Specifies whether column has fixed size or not. **/
+ [attribute] boolean Resizeable;
+
+ /** Specifies the horizontal alignment of the content in the control.
+
+ <pre>
+ LEFT
+ CENTER
+ RIGHT
+ </pre>
+ */
+ [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;
+ /** 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);
+ //-------------------------------------------------------------------------
+
+ /** Removes a listener previously added with <method>addColumnListener()</method>.
+ @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 );
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
index a9a0e50a34ed..8a2d044f33d5 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl
@@ -46,18 +46,20 @@ module com { module sun { module star { module awt { module grid {
<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: com::sun::star::uno::XInterface
+interface XGridColumnListener
{
- /**
- 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 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.
diff --git a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
index 51f290fcef0e..86e77680cd95 100644
--- a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
+++ b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl
@@ -30,6 +30,7 @@
#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/awt/grid/XGridColumn.idl>
+
#include <com/sun/star/awt/grid/XGridColumnListener.idl>
//=============================================================================
@@ -42,12 +43,18 @@ module com { module sun { module star { module awt { module grid {
retrieve the column structure that is displayed in the actual control.
If you do not need your own model implementation, you can also use the <type>DefaultGridColumnModel</type>.
+
+ @since OOo 3.3.0
*/
-interface XGridColumnModel: com::sun::star::uno::XInterface
+interface XGridColumnModel
{
- /** Specifies whether column selection is allowed
+ ///** Specifies whether column selection is allowed
+ //*/
+ //[attribute] boolean ColumnSelectionAllowed;
+
+ /**Specifies the height of column header.
*/
- [attribute] boolean ColumnSelectionAllowed;
+ [attribute] long ColumnHeaderHeight;
/** Returns the number of columns.
@returns
@@ -81,29 +88,28 @@ interface XGridColumnModel: com::sun::star::uno::XInterface
/** Returns a specific column.
@param index
- the position of the reuquested column.
+ the position of the requested column.
@returns
the requested column.
*/
XGridColumn getColumn( [in] long index);
- /*
- long getTotalColumnWidth();
+ /** Sets default columns to the column model.
+ @param elements
+ the number of default columns that should be set.
*/
+ void setDefaultColumns([in] long elements);
- /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes.
- @param Listener
- the listener to add.
+ /**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
*/
- [oneway] void addColumnListener( [in] XGridColumnListener listener);
-
- //-------------------------------------------------------------------------
+ XGridColumn copyColumn( [in] XGridColumn column );
- /** Removes a listener previously added with <method>addColumnListener()</method>.
- @param Listener
- the listener to remove.
+ /*
+ long getTotalColumnWidth();
*/
- [oneway] void removeColumnListener( [in] XGridColumnListener listener);
};
//=============================================================================
diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl
index 05c49aa1669d..5019a571663b 100644
--- a/offapi/com/sun/star/awt/grid/XGridControl.idl
+++ b/offapi/com/sun/star/awt/grid/XGridControl.idl
@@ -41,30 +41,25 @@ module com { module sun { module star { module awt { module grid {
/** An interface to a control that displays a tabular data.
@see UnoControlGrid
+
+ @since OOo 3.3.0
*/
interface XGridControl: XGridSelection
{
- /** Specifies the <type>XGridColumnModel</type> of the control.
- */
- [attribute] XGridColumnModel ColumnModel;
-
- /** Specifies the <type>XGridDataModel</type> of the control.
- */
- [attribute] XGridDataModel DataModel;
-
-
/** Converting
*/
long getItemIndexAtPoint( [in] long x, [in] long y);
- /** registers a listener for mouse events.
- */
- //[oneway] void addMouseListener( [in] com::sun::star::awt::XMouseListener listener );
-
- /** unregisters a listener for mouse events.
- */
- //[oneway] void removeMouseListener( [in] com::sun::star::awt::XMouseListener listener );
+ /** 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.
+ */
+ void setToolTip( [in] sequence< string > textForTooltip, [in] sequence< long > columnsForTooltip);
};
diff --git a/offapi/com/sun/star/awt/grid/XGridControlListener.idl b/offapi/com/sun/star/awt/grid/XGridControlListener.idl
index ac703e8516ee..6f4fdf68ccd4 100644
--- a/offapi/com/sun/star/awt/grid/XGridControlListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridControlListener.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module awt { module grid {
//=============================================================================
-interface XGridControlListener: com::sun::star::uno::XInterface
+interface XGridControlListener
{
};
diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl
index cee808a178f2..d6d0d930b331 100644
--- a/offapi/com/sun/star/awt/grid/XGridDataListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl
@@ -46,6 +46,8 @@ module com { module sun { module star { module awt { module grid {
<p>Usually you must not implement this interface yourself, but you must notify it correctly if
you implement the <type>XGridDataModel</type> yourself</p>.
+
+ @since OOo 3.3.0
*/
interface XGridDataListener: com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/awt/grid/XGridDataModel.idl b/offapi/com/sun/star/awt/grid/XGridDataModel.idl
index f41841cf8039..5cc4085807e1 100644
--- a/offapi/com/sun/star/awt/grid/XGridDataModel.idl
+++ b/offapi/com/sun/star/awt/grid/XGridDataModel.idl
@@ -1,5 +1,6 @@
/*************************************************************************
*
+ * $Revision: 1.8 $
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -41,6 +42,8 @@ module com { module sun { module star { module awt { module grid {
retrieve the content data that is displayed in the actual control.
If you do not need your own model implementation, you can also use the <type>DefaultGridDataModel</type>.
+
+ @since OOo 3.3.0
*/
interface XGridDataModel: ::com::sun::star::lang::XComponent
{
@@ -54,7 +57,11 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent
/** Returns the content of each row.
*/
- [attribute,readonly] sequence< sequence< string > > Data;
+ [attribute,readonly] sequence< sequence< any > > Data;
+
+ /**Specifies the width of row header.
+ */
+ [attribute] long RowHeaderWidth;
/** Returns the number of rows in in the model.
@returns
@@ -69,7 +76,7 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent
@param data
the content of the row.
*/
- void addRow( [in] string headername, [in] sequence< string > data );
+ void addRow( [in] string headername, [in] sequence< any > data );
/** Removes a row from the model.
@@ -82,6 +89,26 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent
*/
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.
+ */
+ void updateRow([in] long row, [in] sequence< long > columns, [in] sequence< any > values);
+
//-------------------------------------------------------------------------
/** Adds a listener for the <type>GridDataEvent</type> posted after the grid changes.
diff --git a/offapi/com/sun/star/awt/grid/XGridSelection.idl b/offapi/com/sun/star/awt/grid/XGridSelection.idl
index ecb760cb3277..5049426018b0 100644
--- a/offapi/com/sun/star/awt/grid/XGridSelection.idl
+++ b/offapi/com/sun/star/awt/grid/XGridSelection.idl
@@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid {
/** This interfaces provides access to the selection of row for <type>UnoControlGrid</type>.
*/
-interface XGridSelection: com::sun::star::uno::XInterface
+interface XGridSelection
{
/** Returns the lowest index of the selection.
@returns
@@ -53,21 +53,25 @@ interface XGridSelection: com::sun::star::uno::XInterface
*/
long getMaxSelectionIndex();
- /** Adds a selection intervall.
- @param start
- the start row index.
- @param length
- the number of rows to be selected.
+ /** Selects all rows.
*/
- [oneway] void insertIndexIntervall( [in] long start, [in] long length);
+ [oneway] void selectAllRows();
- /** Removes a selection intervall.
- @param start
- the start row index.
- @param length
- the number of rows to be selected.
+ /** Selects multiple rows. Previous selections will be removed.
+ @param rangeOfRows
+ array of rows indexes, which will be selected.
*/
- [oneway] void removeIndexIntervall( [in] long start, [in] long length);
+ [oneway] void selectRows( [in] sequence< long > rangeOfRows);
+
+ /** Deselects all selected rows.
+ */
+ [oneway] 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.
+ */
+ [oneway] void deselectRows( [in] sequence< long > rangeOfRows);
/** Returns the indicies of all selected rows.
@returns
@@ -90,17 +94,17 @@ interface XGridSelection: com::sun::star::uno::XInterface
boolean isSelectedIndex( [in] long index);
/** Marks a row as selected.
- @param
+ @param index
the index of a row.
*/
- [oneway] void selectRow( [in] long y);
+ [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
+ @param listener
the listener to add.
*/
[oneway] void addSelectionListener( [in] XGridSelectionListener listener);
@@ -108,7 +112,7 @@ interface XGridSelection: com::sun::star::uno::XInterface
//-------------------------------------------------------------------------
/** Removes a listener previously added with <method>addSelectionListener()</method>.
- @param Listener
+ @param listener
the listener to remove.
*/
[oneway] void removeSelectionListener( [in] XGridSelectionListener listener);
diff --git a/offapi/com/sun/star/awt/grid/makefile.mk b/offapi/com/sun/star/awt/grid/makefile.mk
index 3cfe6d83b3ba..02c159f8ffec 100644
--- a/offapi/com/sun/star/awt/grid/makefile.mk
+++ b/offapi/com/sun/star/awt/grid/makefile.mk
@@ -57,7 +57,9 @@ IDLFILES=\
ScrollBarMode.idl\
XGridControl.idl\
UnoControlGrid.idl\
- UnoControlGridModel.idl
+ UnoControlGridModel.idl\
+ GridInvalidDataException.idl\
+ GridInvalidModelException.idl
# ------------------------------------------------------------------
.INCLUDE : target.mk
diff --git a/offapi/com/sun/star/document/MediaDescriptor.idl b/offapi/com/sun/star/document/MediaDescriptor.idl
index 72690a45eccd..89a3141a443d 100644
--- a/offapi/com/sun/star/document/MediaDescriptor.idl
+++ b/offapi/com/sun/star/document/MediaDescriptor.idl
@@ -51,6 +51,10 @@
#include <com/sun/star/task/XStatusIndicator.idl>
#endif
+#ifndef __com_sun_star_frame_XFrame_idl__
+#include <com/sun/star/frame/XFrame.idl>
+#endif
+
//=============================================================================
module com { module sun { module star { module document {
@@ -594,6 +598,11 @@ published service MediaDescriptor
@since OOo 3.0
*/
[optional,property] string ViewControllerName;
+ //-------------------------------------------------------------------------
+
+ /** specifies the frame containing the document. May be empty.
+ */
+ [optional,property] com::sun::star::frame::XFrame Frame;
};
//=============================================================================
diff --git a/offapi/com/sun/star/script/ModuleInfo.idl b/offapi/com/sun/star/script/ModuleInfo.idl
new file mode 100644
index 000000000000..158ba387be6b
--- /dev/null
+++ b/offapi/com/sun/star/script/ModuleInfo.idl
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ModuleInfo.idl,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_script_ModuleInfo_idl__
+#define __com_sun_star_script_ModuleInfo_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+//=============================================================================
+module com { module sun { module star { module script {
+struct ModuleInfo
+{
+ com::sun::star::uno::XInterface ModuleObject;
+ long ModuleType;
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/script/ModuleType.idl b/offapi/com/sun/star/script/ModuleType.idl
new file mode 100644
index 000000000000..a9bde042fa5a
--- /dev/null
+++ b/offapi/com/sun/star/script/ModuleType.idl
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ModuleType.idl,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_script_ModuleType_idl__
+#define __com_sun_star_script_ModuleType_idl__
+
+//=============================================================================
+
+module com { module sun { module star { module script {
+
+published constants ModuleType
+{
+ // ------------------------------------------------------------------------
+
+ const long UNKNOWN = 0;
+
+ // ------------------------------------------------------------------------
+
+ const long NORMAL = 1;
+
+ // ------------------------------------------------------------------------
+
+ const long CLASS = 2;
+
+ // ------------------------------------------------------------------------
+
+ const long FORM = 3;
+
+ // ------------------------------------------------------------------------
+
+ const long DOCUMENT = 4;
+
+ // ------------------------------------------------------------------------
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/script/XVBACompat.idl b/offapi/com/sun/star/script/XVBACompat.idl
new file mode 100644
index 000000000000..09da54eb27cd
--- /dev/null
+++ b/offapi/com/sun/star/script/XVBACompat.idl
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XLibraryContainer.idl,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_script_XVBACompat_idl__
+#define __com_sun_star_script_XVBACompat_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+//=============================================================================
+
+module com { module sun { module star { module script {
+
+interface XVBACompat: com::sun::star::uno::XInterface
+{
+
+//=============================================================================
+ [attribute ] boolean VBACompatModeOn;
+
+}; }; }; };
+};
+#endif
diff --git a/offapi/com/sun/star/script/XVBAModuleInfo.idl b/offapi/com/sun/star/script/XVBAModuleInfo.idl
new file mode 100644
index 000000000000..f9c4e64223c3
--- /dev/null
+++ b/offapi/com/sun/star/script/XVBAModuleInfo.idl
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XLibraryContainer.idl,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public 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_script_XVBACompat_idl__
+#define __com_sun_star_script_XVBACompat_idl__
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+#ifndef __com_sun_star_script_ModuleInfo_idl__
+#include <com/sun/star/script/ModuleInfo.idl>
+#endif
+#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+#endif
+#ifndef __com_sun_star_container_ElementExistException_idl__
+#include <com/sun/star/container/ElementExistException.idl>
+#endif
+#ifndef __com_sun_star_lang_WrappedTargetException_idl__
+#include <com/sun/star/lang/WrappedTargetException.idl>
+#endif
+#ifndef __com_sun_star_container_NoSuchElementException_idl__
+#include <com/sun/star/container/NoSuchElementException.idl>
+#endif
+
+//=============================================================================
+
+module com { module sun { module star { module script {
+
+interface XVBAModuleInfo: com::sun::star::uno::XInterface
+{
+
+ com::sun::star::script::ModuleInfo getModuleInfo( [in] string ModuleName )
+ raises( com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException );
+ boolean hasModuleInfo( [in] string ModuleName );
+ void insertModuleInfo( [in] string ModuleName,
+ [in] com::sun::star::script::ModuleInfo ModuleInfo )
+ raises( com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::container::ElementExistException,
+ com::sun::star::lang::WrappedTargetException );
+ void removeModuleInfo( [in] string ModuleName )
+ raises( com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException );
+}; }; }; };
+};
+#endif
diff --git a/offapi/com/sun/star/script/makefile.mk b/offapi/com/sun/star/script/makefile.mk
index 579174390ec4..b694a753f7d7 100644
--- a/offapi/com/sun/star/script/makefile.mk
+++ b/offapi/com/sun/star/script/makefile.mk
@@ -48,6 +48,10 @@ IDLFILES=\
XPersistentLibraryContainer.idl\
XStorageBasedLibraryContainer.idl\
ModuleSizeExceededRequest.idl\
+ XVBACompat.idl\
+ XVBAModuleInfo.idl\
+ ModuleInfo.idl\
+ ModuleType.idl\
# ------------------------------------------------------------------
diff --git a/officecfg/registry/data/org/openoffice/Office/SFX.xcu b/officecfg/registry/data/org/openoffice/Office/SFX.xcu
index 5a576588c974..1fbf093170cf 100644
--- a/officecfg/registry/data/org/openoffice/Office/SFX.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/SFX.xcu
@@ -30,27 +30,27 @@
<node oor:name="Help">
<prop oor:name="HelpAgentStarterList">
<value xml:lang="x-no-translate"></value>
- <value xml:lang="de">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="en-US">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="zh-CN">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ja">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="zh-TW">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="el">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="es">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="pl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="pt">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ko">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="fr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ar">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ru">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="nl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="da">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="it">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="tr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="sv">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="fi">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="pt-BR">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
- <value xml:lang="ca">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34119,34120,33368,10296,54946</value>
+ <value xml:lang="de">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="en-US">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="zh-CN">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ja">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="zh-TW">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="el">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="es">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="pl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="pt">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ko">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="fr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ar">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ru">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="nl">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="da">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="it">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="tr">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="sv">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="fi">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="pt-BR">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
+ <value xml:lang="ca">956368385,956368385,26220,26235,2567291937,2567291938,26272,26273,26063,957028378,26153,26312,958170133,958186547,958202951,26320,26321,956419588,956433419,26323,26324,20309,20308,20226,10371,27015,10087,10156,10350,27002,700810288,700810324,700730881,703778354,700777567,701124116,701124158,541248011,541249030,541249032,700763681,34023,957235721,3388501505,3388501506,3388501507,3388501508,3388501509,3388501510,10416,10297,5573,5573,5573,34099,34100,34101,34102,34104,34106,34107,34108,34109,34110,34112,34114,34115,34116,34117,34118,34120,33368,10296,54946</value>
</prop>
</node>
</oor:component-data>
diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index 1a29a0d0c459..e4c063d161cf 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -61,10 +61,6 @@ interface XApplication : com::sun::star::uno::XInterface
[attribute, readonly] XWorksheet ActiveSheet;
[attribute, readonly] ooo::vba::XAssistant Assistant;
[attribute] long Calculation;
- //#TODO #FIXME this is more of a placeholder, will return
- // the value of activeworkbook, in xl 'ThisWorkbook' should return the
- // workbook in which the 'calling' macro is running. Should be possible
- // to determine this
[attribute, readonly] XWorkbook ThisWorkbook;
[attribute, readonly] string Name;
[attribute] boolean DisplayAlerts;
diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl
index 2f66b7d0826f..3620c899de83 100644
--- a/oovbaapi/ooo/vba/excel/XWorksheet.idl
+++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl
@@ -39,6 +39,9 @@
#include <com/sun/star/script/XInvocation.idl>
#endif
+#ifndef __com_sun_star_container_XNamed_idl__
+#include <com/sun/star/container/XNamed.idl>
+#endif
//=============================================================================
module ooo { module vba { module excel {
@@ -55,8 +58,8 @@ interface XWorksheet
{
interface ::ooo::vba::XHelperInterface;
interface ::com::sun::star::script::XInvocation;
+ interface ::com::sun::star::container::XNamed;
- [attribute] string Name;
[attribute] boolean Visible;
[attribute, readonly] long StandardHeight;
[attribute, readonly] long StandardWidth;
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx
index b086538db73e..31e26d38f590 100644
--- a/oox/inc/oox/core/filterbase.hxx
+++ b/oox/inc/oox/core/filterbase.hxx
@@ -49,6 +49,7 @@ namespace com { namespace sun { namespace star {
namespace frame { class XModel; }
namespace task { class XStatusIndicator; }
namespace task { class XInteractionHandler; }
+ namespace frame { class XFrame; }
namespace io { class XInputStream; }
namespace io { class XOutputStream; }
namespace io { class XStream; }
@@ -123,6 +124,10 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
getModelFactory() const;
+ /** Returns the frame that will contain the document model. */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
+ getTargetFrame() const;
+
/** Returns the status indicator (may be null). */
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >&
getStatusIndicator() const;
@@ -145,12 +150,12 @@ public:
@param rStorageName
The name of the embedded storage. The name may contain slashes to
open storages from embedded substorages.
- @param bCreate
+ @param bCreateMissing
True = create missing sub storages (for export filters).
*/
StorageRef openSubStorage(
const ::rtl::OUString& rStorageName,
- bool bCreate ) const;
+ bool bCreateMissing ) const;
/** Opens and returns the specified input stream from the base storage.
@@ -189,20 +194,6 @@ public:
/** Returns a helper for the handling of OLE obejcts. */
::oox::ole::OleObjectHelper& getOleObjectHelper() const;
- /** Returns information about the output device. */
- const ::com::sun::star::awt::DeviceInfo& getDeviceInfo() const;
- /** Converts the passed value from horizontal screen pixels to 1/100 mm. */
- sal_Int32 convertScreenPixelX( double fPixelX ) const;
- /** Converts the passed value from vertical screen pixels to 1/100 mm. */
- sal_Int32 convertScreenPixelY( double fPixelY ) const;
-
- /** Returns a system color specified by the passed XML token identifier. */
- sal_Int32 getSystemColor( sal_Int32 nToken, sal_Int32 nDefaultRgb = API_RGB_TRANSPARENT ) const;
- /** Derived classes may implement to resolve a scheme color from the passed XML token identifier. */
- virtual sal_Int32 getSchemeColor( sal_Int32 nToken ) const;
- /** Derived classes may implement to resolve a palette index to an RGB color. */
- virtual sal_Int32 getPaletteColor( sal_Int32 nPaletteIdx ) const;
-
/** Requests a password from the media descriptor or from the user. On
success, the password will be inserted into the media descriptor. */
::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
@@ -282,6 +273,10 @@ private:
void setMediaDescriptor(
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq );
+ /** Derived classes may create a specialized graphic helper, e.g. for
+ resolving palette colors. */
+ virtual GraphicHelper* implCreateGraphicHelper() const;
+
virtual ::rtl::OUString implGetImplementationName() const = 0;
virtual StorageRef implCreateStorage(
diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
index e38311394046..0b5a7f6374a4 100644
--- a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
+++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
@@ -2,14 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: chartdrawingfragment.hxx,v $
- *
- * $Revision: 1.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/oox/inc/oox/drawingml/color.hxx b/oox/inc/oox/drawingml/color.hxx
index 830959b77db9..51e9501205cf 100644
--- a/oox/inc/oox/drawingml/color.hxx
+++ b/oox/inc/oox/drawingml/color.hxx
@@ -35,7 +35,7 @@
#include <rtl/ustring.hxx>
#include "oox/helper/helper.hxx"
-namespace oox { namespace core { class FilterBase; } }
+namespace oox { class GraphicHelper; }
namespace oox {
namespace drawingml {
@@ -90,7 +90,7 @@ public:
bool isPlaceHolder() const { return meMode == COLOR_PH; }
/** Returns the final RGB color value.
@param nPhClr Actual color for the phClr placeholder color used in theme style lists. */
- sal_Int32 getColor( const ::oox::core::FilterBase& rFilter, sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
+ sal_Int32 getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
/** Returns true, if the color has a transparence set. */
bool hasTransparence() const;
diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx
index 4e4b82cd5acd..44e91d6e797b 100644
--- a/oox/inc/oox/drawingml/customshapeproperties.hxx
+++ b/oox/inc/oox/drawingml/customshapeproperties.hxx
@@ -43,9 +43,7 @@
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
-#ifndef __com_sun_star_beans_PropertyValues_hpp__
#include <com/sun/star/beans/PropertyValues.hpp>
-#endif
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/XShape.hpp>
@@ -69,8 +67,7 @@ public:
virtual ~CustomShapeProperties();
void apply( const CustomShapePropertiesPtr& );
- void pushToPropSet( const ::oox::core::FilterBase& rFilterBase,
- const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet,
+ void pushToPropSet( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet,
const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > & xShape) const;
void setShapePresetType( const rtl::OUString& rShapePresetType ){ maShapePresetType = rShapePresetType; };
diff --git a/oox/inc/oox/drawingml/fillproperties.hxx b/oox/inc/oox/drawingml/fillproperties.hxx
index be6561c970d3..42457e6f4dde 100644
--- a/oox/inc/oox/drawingml/fillproperties.hxx
+++ b/oox/inc/oox/drawingml/fillproperties.hxx
@@ -35,6 +35,7 @@
#include "oox/helper/helper.hxx"
namespace oox {
+ class GraphicHelper;
class ModelObjectHelper;
class PropertyMap;
class PropertySet;
@@ -156,8 +157,8 @@ struct FillProperties
/** Writes the properties to the passed property map. */
void pushToPropMap(
PropertyMap& rPropMap,
- const ::oox::core::FilterBase& rFilter,
ModelObjectHelper& rModelObjHelper,
+ const GraphicHelper& rGraphicHelper,
const FillPropertyIds& rPropIds = DEFAULT_IDS,
sal_Int32 nShapeRotation = 0,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
@@ -165,8 +166,8 @@ struct FillProperties
/** Writes the properties to the passed property set. */
void pushToPropSet(
PropertySet& rPropSet,
- const ::oox::core::FilterBase& rFilter,
ModelObjectHelper& rModelObjHelper,
+ const GraphicHelper& rGraphicHelper,
const FillPropertyIds& rPropIds = DEFAULT_IDS,
sal_Int32 nShapeRotation = 0,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
@@ -184,13 +185,13 @@ struct GraphicProperties
/** Writes the properties to the passed property map. */
void pushToPropMap(
PropertyMap& rPropMap,
- const ::oox::core::FilterBase& rFilter,
+ const GraphicHelper& rGraphicHelper,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
/** Writes the properties to the passed property set. */
void pushToPropSet(
PropertySet& rPropSet,
- const ::oox::core::FilterBase& rFilter,
+ const GraphicHelper& rGraphicHelper,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
};
diff --git a/oox/inc/oox/drawingml/lineproperties.hxx b/oox/inc/oox/drawingml/lineproperties.hxx
index 9a538db30156..0f034a89f65b 100644
--- a/oox/inc/oox/drawingml/lineproperties.hxx
+++ b/oox/inc/oox/drawingml/lineproperties.hxx
@@ -104,16 +104,16 @@ struct LineProperties
/** Writes the properties to the passed property map. */
void pushToPropMap(
PropertyMap& rPropMap,
- const ::oox::core::FilterBase& rFilter,
ModelObjectHelper& rModelObjHelper,
+ const GraphicHelper& rGraphicHelper,
const LinePropertyIds& rPropIds = DEFAULT_IDS,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
/** Writes the properties to the passed property map. */
void pushToPropSet(
PropertySet& rPropSet,
- const ::oox::core::FilterBase& rFilter,
ModelObjectHelper& rModelObjHelper,
+ const GraphicHelper& rGraphicHelper,
const LinePropertyIds& rPropIds = DEFAULT_IDS,
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
};
diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx
index 5a7e390d19a4..e9016fdf0b2b 100644
--- a/oox/inc/oox/dump/biffdumper.hxx
+++ b/oox/inc/oox/dump/biffdumper.hxx
@@ -217,7 +217,7 @@ protected:
void dumpDffClientRect();
void dumpEmbeddedDff();
- void dumpOcxControl();
+ void dumpControl();
private:
typedef ::boost::shared_ptr< BiffSharedData > BiffSharedDataRef;
@@ -242,7 +242,7 @@ void BiffObjectBase::writeRectItem( const String& rName,
Type nLeft, Type nTop, Type nWidth, Type nHeight,
const NameListWrapper& rListWrp, FormatType eFmtType )
{
- MultiItemsGuard aMultiGuard( out() );
+ MultiItemsGuard aMultiGuard( mxOut );
writeEmptyItem( rName );
writeValueItem( "x-pos", nLeft, eFmtType, rListWrp );
writeValueItem( "y-pos", nTop, eFmtType, rListWrp );
@@ -508,6 +508,10 @@ protected:
const StorageRef& rxStrg,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rSysPath );
+
+ virtual void implDumpBaseStream(
+ const BinaryInputStreamRef& rxStrm,
+ const ::rtl::OUString& rSysFileName );
};
// ============================================================================
diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index ecca5751c16c..f65eeceebf27 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -61,6 +61,7 @@ namespace comphelper {
namespace oox {
class BinaryOutputStream;
+ class TextInputStream;
}
namespace oox { namespace core {
@@ -576,43 +577,41 @@ protected:
// ============================================================================
// ============================================================================
-typedef ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream > ConfigInputStreamRef;
-
class ConfigItemBase
{
public:
virtual ~ConfigItemBase();
- void readConfigBlock( const ConfigInputStreamRef& rxStrm );
+ void readConfigBlock( TextInputStream& rStrm );
protected:
inline explicit ConfigItemBase() {}
virtual void implProcessConfigItemStr(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
const ::rtl::OUString& rKey,
const ::rtl::OUString& rData );
virtual void implProcessConfigItemInt(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
sal_Int64 nKey,
const ::rtl::OUString& rData );
void readConfigBlockContents(
- const ConfigInputStreamRef& rxStrm );
+ TextInputStream& rStrm );
private:
enum LineType { LINETYPE_DATA, LINETYPE_END };
LineType readConfigLine(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
::rtl::OUString& orKey,
::rtl::OUString& orData ) const;
LineType readConfigLine(
- const ConfigInputStreamRef& rxStrm ) const;
+ TextInputStream& rStrm ) const;
void processConfigItem(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
const ::rtl::OUString& rKey,
const ::rtl::OUString& rData );
};
@@ -673,12 +672,12 @@ protected:
virtual bool implIsValid() const;
virtual void implProcessConfigItemStr(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
const ::rtl::OUString& rKey,
const ::rtl::OUString& rData );
virtual void implProcessConfigItemInt(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
sal_Int64 nKey,
const ::rtl::OUString& rData );
@@ -721,7 +720,7 @@ public:
protected:
virtual void implProcessConfigItemStr(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
const ::rtl::OUString& rKey,
const ::rtl::OUString& rData );
@@ -750,7 +749,7 @@ public:
protected:
virtual void implProcessConfigItemStr(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
const ::rtl::OUString& rKey,
const ::rtl::OUString& rData );
@@ -777,7 +776,7 @@ public:
protected:
virtual void implProcessConfigItemStr(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
const ::rtl::OUString& rKey,
const ::rtl::OUString& rData );
@@ -917,14 +916,14 @@ public:
protected:
virtual bool implIsValid() const;
virtual void implProcessConfigItemStr(
- const ConfigInputStreamRef& rxStrm,
+ TextInputStream& rStrm,
const ::rtl::OUString& rKey,
const ::rtl::OUString& rData );
private:
bool readConfigFile( const ::rtl::OUString& rFileUrl );
template< typename ListType >
- void readNameList( const ConfigInputStreamRef& rxStrm, const ::rtl::OUString& rListName );
+ void readNameList( TextInputStream& rStrm, const ::rtl::OUString& rListName );
void createShortList( const ::rtl::OUString& rData );
void createUnitConverter( const ::rtl::OUString& rData );
@@ -960,11 +959,11 @@ template< typename ListType >
}
template< typename ListType >
-void SharedConfigData::readNameList( const ConfigInputStreamRef& rxStrm, const ::rtl::OUString& rListName )
+void SharedConfigData::readNameList( TextInputStream& rStrm, const ::rtl::OUString& rListName )
{
NameListRef xList = createNameList< ListType >( rListName );
if( xList.get() )
- xList->readConfigBlock( rxStrm );
+ xList->readConfigBlock( rStrm );
}
// ============================================================================
@@ -1182,7 +1181,7 @@ typedef ::boost::shared_ptr< Output > OutputRef;
class IndentGuard
{
public:
- inline explicit IndentGuard( Output& rOut ) : mrOut( rOut ) { mrOut.incIndent(); }
+ inline explicit IndentGuard( const OutputRef& rxOut ) : mrOut( *rxOut ) { mrOut.incIndent(); }
inline ~IndentGuard() { mrOut.decIndent(); }
private:
IndentGuard( const IndentGuard& );
@@ -1196,17 +1195,17 @@ private:
class TableGuard
{
public:
- inline explicit TableGuard( Output& rOut, sal_Int32 nW1 ) :
- mrOut( rOut ) { mrOut.startTable( nW1 ); }
- inline explicit TableGuard( Output& rOut, sal_Int32 nW1, sal_Int32 nW2 ) :
- mrOut( rOut ) { mrOut.startTable( nW1, nW2 ); }
- inline explicit TableGuard( Output& rOut, sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3 ) :
- mrOut( rOut ) { mrOut.startTable( nW1, nW2, nW3 ); }
- inline explicit TableGuard( Output& rOut, sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3, sal_Int32 nW4 ) :
- mrOut( rOut ) { mrOut.startTable( nW1, nW2, nW3, nW4 ); }
- inline explicit TableGuard( Output& rOut, size_t nColCount,
+ inline explicit TableGuard( const OutputRef& rxOut, sal_Int32 nW1 ) :
+ mrOut( *rxOut ) { mrOut.startTable( nW1 ); }
+ inline explicit TableGuard( const OutputRef& rxOut, sal_Int32 nW1, sal_Int32 nW2 ) :
+ mrOut( *rxOut ) { mrOut.startTable( nW1, nW2 ); }
+ inline explicit TableGuard( const OutputRef& rxOut, sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3 ) :
+ mrOut( *rxOut ) { mrOut.startTable( nW1, nW2, nW3 ); }
+ inline explicit TableGuard( const OutputRef& rxOut, sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3, sal_Int32 nW4 ) :
+ mrOut( *rxOut ) { mrOut.startTable( nW1, nW2, nW3, nW4 ); }
+ inline explicit TableGuard( const OutputRef& rxOut, size_t nColCount,
const sal_Int32* pnColWidths ) :
- mrOut( rOut ) { mrOut.startTable( nColCount, pnColWidths ); }
+ mrOut( *rxOut ) { mrOut.startTable( nColCount, pnColWidths ); }
inline ~TableGuard() { mrOut.endTable(); }
inline void tab() { mrOut.tab(); }
inline void tab( size_t nCol ) { mrOut.tab( nCol ); }
@@ -1222,8 +1221,8 @@ private:
class ItemGuard
{
public:
- inline explicit ItemGuard( Output& rOut, const String& rName = EMPTY_STRING ) :
- mrOut( rOut ) { mrOut.startItem( rName ); }
+ inline explicit ItemGuard( const OutputRef& rxOut, const String& rName = EMPTY_STRING ) :
+ mrOut( *rxOut ) { mrOut.startItem( rName ); }
inline ~ItemGuard() { mrOut.endItem(); }
inline void cont() { mrOut.contItem(); }
private:
@@ -1238,7 +1237,7 @@ private:
class MultiItemsGuard
{
public:
- inline explicit MultiItemsGuard( Output& rOut ) : mrOut( rOut ) { mrOut.startMultiItems(); }
+ inline explicit MultiItemsGuard( const OutputRef& rxOut ) : mrOut( *rxOut ) { mrOut.startMultiItems(); }
inline ~MultiItemsGuard() { mrOut.endMultiItems(); }
private:
MultiItemsGuard( const MultiItemsGuard& );
@@ -1280,7 +1279,8 @@ class ObjectBase : public Base
public:
virtual ~ObjectBase();
- inline const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& getFactory() const { return mxConfig->getFactory(); }
+ inline const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
+ getFactory() const { return mxConfig->getFactory(); }
void dump();
@@ -1333,6 +1333,10 @@ protected:
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rSysPath );
+ virtual void implDumpBaseStream(
+ const BinaryInputStreamRef& rxStrm,
+ const ::rtl::OUString& rSysFileName );
+
void addPreferredStream( const String& rStrmName );
void addPreferredStorage( const String& rStrgPath );
@@ -1355,7 +1359,7 @@ private:
const StorageRef& rxStrg,
const ::rtl::OUString& rStrgPath,
const ::rtl::OUString& rItemName,
- const ::rtl::OUString& rSysOutPath,
+ const ::rtl::OUString& rSysPath,
bool bIsStrg, bool bIsStrm );
private:
@@ -1397,10 +1401,6 @@ protected:
// ------------------------------------------------------------------------
- inline Output& out() const { return *mxOut; }
-
- // ------------------------------------------------------------------------
-
void writeEmptyItem( const String& rName );
void writeInfoItem( const String& rName, const String& rData );
void writeCharItem( const String& rName, sal_Unicode cData );
@@ -1451,7 +1451,7 @@ protected:
template< typename Type >
void writeHexPairItem( const String& rName, Type nData1, Type nData2, sal_Unicode cSep = ',' );
-private:
+protected:
OutputRef mxOut;
};
@@ -1472,14 +1472,14 @@ void OutputObjectBase::addNameToItem( Type nData, const NameListWrapper& rListWr
template< typename Type >
void OutputObjectBase::writeNameItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeName( cfg(), nData, rListWrp );
}
template< typename Type >
void OutputObjectBase::writeDecItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeDec( nData );
addNameToItem( nData, rListWrp );
}
@@ -1487,7 +1487,7 @@ void OutputObjectBase::writeDecItem( const String& rName, Type nData, const Name
template< typename Type >
void OutputObjectBase::writeHexItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeHex( nData );
addNameToItem( nData, rListWrp );
}
@@ -1495,7 +1495,7 @@ void OutputObjectBase::writeHexItem( const String& rName, Type nData, const Name
template< typename Type >
void OutputObjectBase::writeShortHexItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeShortHex( nData );
addNameToItem( nData, rListWrp );
}
@@ -1503,7 +1503,7 @@ void OutputObjectBase::writeShortHexItem( const String& rName, Type nData, const
template< typename Type >
void OutputObjectBase::writeBinItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeBin( nData );
addNameToItem( nData, rListWrp );
}
@@ -1511,7 +1511,7 @@ void OutputObjectBase::writeBinItem( const String& rName, Type nData, const Name
template< typename Type >
void OutputObjectBase::writeFixItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeFix( nData );
addNameToItem( nData, rListWrp );
}
@@ -1519,7 +1519,7 @@ void OutputObjectBase::writeFixItem( const String& rName, Type nData, const Name
template< typename Type >
void OutputObjectBase::writeDecBoolItem( const String& rName, Type nData, const NameListWrapper& rListWrp )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeDec( nData );
aItem.cont();
mxOut->writeBool( nData != 0 );
@@ -1533,7 +1533,7 @@ void OutputObjectBase::writeValueItem( const String& rName, Type nData, FormatTy
writeDecBoolItem( rName, nData, rListWrp );
else
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeValue( nData, eFmtType );
addNameToItem( nData, rListWrp );
}
@@ -1549,7 +1549,7 @@ void OutputObjectBase::writeValueItem( const ItemFormat& rItemFmt, Type nData )
template< typename Type >
void OutputObjectBase::writeDecPairItem( const String& rName, Type nData1, Type nData2, sal_Unicode cSep )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeDec( nData1 );
mxOut->writeChar( cSep );
mxOut->writeDec( nData2 );
@@ -1558,7 +1558,7 @@ void OutputObjectBase::writeDecPairItem( const String& rName, Type nData1, Type
template< typename Type >
void OutputObjectBase::writeHexPairItem( const String& rName, Type nData1, Type nData2, sal_Unicode cSep )
{
- ItemGuard aItem( *mxOut, rName );
+ ItemGuard aItem( mxOut, rName );
mxOut->writeHex( nData1 );
mxOut->writeChar( cSep );
mxOut->writeHex( nData2 );
@@ -1586,7 +1586,6 @@ protected:
// ------------------------------------------------------------------------
- inline BinaryInputStream& in() const { return *mxStrm; }
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
getXInputStream() const;
@@ -1655,7 +1654,7 @@ protected:
template< typename Type >
void dumpHexPair( const String& rName, sal_Unicode cSep = ',' );
-private:
+protected:
BinaryInputStreamRef mxStrm;
};
@@ -1822,16 +1821,12 @@ public:
rtl_TextEncoding eTextEnc );
protected:
+ virtual bool implIsValid() const;
virtual void implDump();
virtual void implDumpLine( const ::rtl::OUString& rLine, sal_uInt32 nLine );
private:
- bool readCharLine( ::rtl::OUString& orLine, sal_Unicode& orcNextLineChar );
- bool readUcs2Line( ::rtl::OUString& orLine, sal_Unicode& orcNextLineChar );
- bool readLine( ::rtl::OUString& orLine, sal_Unicode& orcNextLineChar );
-
-private:
- rtl_TextEncoding meTextEnc;
+ ::boost::shared_ptr< TextInputStream > mxTextStrm;
};
// ============================================================================
diff --git a/oox/inc/oox/dump/oledumper.hxx b/oox/inc/oox/dump/oledumper.hxx
index 539ca2a412d1..a0e9cd55e337 100644
--- a/oox/inc/oox/dump/oledumper.hxx
+++ b/oox/inc/oox/dump/oledumper.hxx
@@ -43,7 +43,26 @@ namespace dump {
// ============================================================================
// ============================================================================
-class StdFontObject : public InputObjectBase
+class OleInputObjectBase : public InputObjectBase
+{
+protected:
+ inline explicit OleInputObjectBase() {}
+
+ ::rtl::OUString dumpAnsiString32( const String& rName );
+ ::rtl::OUString dumpUniString32( const String& rName );
+
+ sal_Int32 dumpStdClipboardFormat( const String& rName = EMPTY_STRING );
+ ::rtl::OUString dumpAnsiString32OrStdClip( const String& rName );
+ ::rtl::OUString dumpUniString32OrStdClip( const String& rName );
+
+ void writeOleColorItem( const String& rName, sal_uInt32 nColor );
+ sal_uInt32 dumpOleColor( const String& rName );
+};
+
+// ============================================================================
+// ============================================================================
+
+class StdFontObject : public OleInputObjectBase
{
public:
explicit StdFontObject( const InputObjectBase& rParent );
@@ -54,7 +73,7 @@ protected:
// ============================================================================
-class StdPicObject : public InputObjectBase
+class StdPicObject : public OleInputObjectBase
{
public:
explicit StdPicObject( const InputObjectBase& rParent );
@@ -65,7 +84,7 @@ protected:
// ============================================================================
-class StdHlinkObject : public InputObjectBase
+class StdHlinkObject : public OleInputObjectBase
{
public:
explicit StdHlinkObject( const InputObjectBase& rParent );
@@ -87,7 +106,27 @@ private:
// ============================================================================
// ============================================================================
-class OlePropertyStreamObject : public BinaryStreamObject
+class OleStreamObject : public OleInputObjectBase
+{
+public:
+ explicit OleStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const ::rtl::OUString& rSysFileName );
+};
+
+// ============================================================================
+
+class OleCompObjObject : public OleStreamObject
+{
+public:
+ explicit OleCompObjObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const ::rtl::OUString& rSysFileName );
+
+protected:
+ virtual void implDump();
+};
+
+// ============================================================================
+// ============================================================================
+
+class OlePropertyStreamObject : public InputObjectBase
{
public:
explicit OlePropertyStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const ::rtl::OUString& rSysFileName );
@@ -146,35 +185,140 @@ protected:
// ============================================================================
// ============================================================================
-struct OcxFormSiteInfo
+class ComCtlObjectBase : public OleInputObjectBase
{
- ::rtl::OUString maProgId;
- sal_Int32 mnId;
- sal_uInt32 mnLength;
- bool mbInStream;
+protected:
+ explicit ComCtlObjectBase(
+ const InputObjectBase& rParent,
+ sal_uInt32 nDataId5, sal_uInt32 nDataId6, sal_uInt16 nVersion,
+ bool bCommonPart, bool bComplexPart );
+
+ virtual void implDump();
+ virtual void implDumpProperties() = 0;
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+ virtual void implDumpCommonTrailing();
+
+private:
+ bool dumpComCtlHeader( sal_uInt32 nExpId, sal_uInt16 nExpMajor = SAL_MAX_UINT16, sal_uInt16 nExpMinor = SAL_MAX_UINT16 );
+ bool dumpComCtlSize();
+ bool dumpComCtlData( sal_uInt32& ornCommonPartSize );
+ bool dumpComCtlCommon( sal_uInt32 nPartSize );
+ bool dumpComCtlComplex();
- inline explicit OcxFormSiteInfo() : mnId( 0 ), mnLength( 0 ), mbInStream( false ) {}
+protected:
+ sal_uInt32 mnDataId5;
+ sal_uInt32 mnDataId6;
+ sal_uInt16 mnVersion;
+ bool mbCommonPart;
+ bool mbComplexPart;
};
-typedef ::std::vector< OcxFormSiteInfo > OcxFormSiteInfoVector;
+// ============================================================================
-// ----------------------------------------------------------------------------
+class ComCtlScrollBarObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlScrollBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
-struct OcxFormSharedData
+protected:
+ virtual void implDumpProperties();
+};
+
+// ============================================================================
+
+class ComCtlProgressBarObject : public ComCtlObjectBase
{
- OUStringVector maClassInfoProgIds;
- OcxFormSiteInfoVector maSiteInfos;
+public:
+ explicit ComCtlProgressBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+};
+
+// ============================================================================
+
+class ComCtlSliderObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlSliderObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
};
// ============================================================================
+
+class ComCtlUpDownObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlUpDownObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+};
+
// ============================================================================
-class OcxPropertyObjectBase : public InputObjectBase
+class ComCtlImageListObject : public ComCtlObjectBase
{
+public:
+ explicit ComCtlImageListObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
protected:
- inline explicit OcxPropertyObjectBase() {}
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+ virtual void implDumpCommonTrailing();
+};
+
+// ============================================================================
+
+class ComCtlTabStripObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlTabStripObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+};
+
+// ============================================================================
+
+class ComCtlTreeViewObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlTreeViewObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+
+private:
+ sal_uInt32 mnStringFlags;
+};
+
+// ============================================================================
+
+class ComCtlStatusBarObject : public ComCtlObjectBase
+{
+public:
+ explicit ComCtlStatusBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion );
+
+protected:
+ virtual void implDumpProperties();
+ virtual void implDumpCommonExtra( sal_Int64 nEndPos );
+ virtual void implDumpCommonTrailing();
+};
- using InputObjectBase::construct;
+// ============================================================================
+// ============================================================================
+
+class AxPropertyObjectBase : public OleInputObjectBase
+{
+protected:
+ inline explicit AxPropertyObjectBase() {}
+
+ using OleInputObjectBase::construct;
void construct(
const ObjectBase& rParent,
const BinaryInputStreamRef& rxStrm,
@@ -213,19 +357,19 @@ protected:
inline bool dumpBoolProperty() { return startNextProperty(); }
inline sal_Int32 dumpHmmProperty() { return dumpDecProperty< sal_Int32 >( 0, "CONV-HMM-TO-CM" ); }
- inline sal_uInt8 dumpMousePtrProperty() { return dumpDecProperty< sal_uInt8 >( 0, "OCX-MOUSEPTR" ); }
+ inline sal_uInt8 dumpMousePtrProperty() { return dumpDecProperty< sal_uInt8 >( 0, "OLE-MOUSEPTR" ); }
template< typename Type >
- inline Type dumpBorderStyleProperty( Type nDefault ) { return dumpDecProperty< Type >( nDefault, "OCX-BORDERSTYLE" ); }
+ inline Type dumpBorderStyleProperty( Type nDefault ) { return dumpDecProperty< Type >( nDefault, "AX-BORDERSTYLE" ); }
template< typename Type >
- inline Type dumpSpecialEffectProperty( Type nDefault ) { return dumpDecProperty< Type >( nDefault, "OCX-SPECIALEFFECT" ); }
- inline sal_uInt32 dumpEnabledProperty() { return dumpDecProperty< sal_uInt32 >( 1, "OCX-ENABLED" ); }
- inline sal_Int32 dumpOrientationProperty() { return dumpDecProperty< sal_Int32 >( -1, "OCX-ORIENTATION" ); }
- inline sal_Int32 dumpDelayProperty() { return dumpDecProperty< sal_Int32 >( 50, "OCX-CONV-MS" ); }
- inline sal_uInt32 dumpImagePosProperty() { return dumpHexProperty< sal_uInt32 >( 0x00070001, "OCX-IMAGEPOS" ); }
- inline sal_uInt8 dumpImageSizeModeProperty() { return dumpDecProperty< sal_uInt8 >( 0, "OCX-IMAGESIZEMODE" ); }
- inline sal_uInt8 dumpImageAlignProperty() { return dumpDecProperty< sal_uInt8 >( 2, "OCX-IMAGEALIGN" ); }
-
- sal_uInt32 dumpFlagsProperty( sal_uInt32 nDefault, const sal_Char* pcNameList = "OCX-FLAGS" );
+ inline Type dumpSpecialEffectProperty( Type nDefault ) { return dumpDecProperty< Type >( nDefault, "AX-SPECIALEFFECT" ); }
+ inline sal_uInt32 dumpEnabledProperty() { return dumpDecProperty< sal_uInt32 >( 1, "AX-ENABLED" ); }
+ inline sal_Int32 dumpOrientationProperty() { return dumpDecProperty< sal_Int32 >( -1, "AX-ORIENTATION" ); }
+ inline sal_Int32 dumpDelayProperty() { return dumpDecProperty< sal_Int32 >( 50, "AX-CONV-MS" ); }
+ inline sal_uInt32 dumpImagePosProperty() { return dumpHexProperty< sal_uInt32 >( 0x00070001, "AX-IMAGEPOS" ); }
+ inline sal_uInt8 dumpImageSizeModeProperty() { return dumpDecProperty< sal_uInt8 >( 0, "AX-IMAGESIZEMODE" ); }
+ inline sal_uInt8 dumpImageAlignProperty() { return dumpDecProperty< sal_uInt8 >( 2, "AX-IMAGEALIGN" ); }
+
+ sal_uInt32 dumpFlagsProperty( sal_uInt32 nDefault, const sal_Char* pcNameList = "AX-FLAGS" );
sal_uInt32 dumpColorProperty( sal_uInt32 nDefault );
sal_Unicode dumpUnicodeProperty();
void dumpUnknownProperty();
@@ -241,7 +385,7 @@ protected:
void dumpToPosition( sal_Int64 nPos );
private:
- void constructOcxPropObj( const String& rPropNameList, bool b64BitPropFlags );
+ void constructAxPropObj( const String& rPropNameList, bool b64BitPropFlags );
void dumpVersion();
::rtl::OUString dumpString( const String& rName, sal_uInt32 nSize, bool bArray );
@@ -285,13 +429,13 @@ private:
// ----------------------------------------------------------------------------
template< typename Type >
-void OcxPropertyObjectBase::alignInput()
+void AxPropertyObjectBase::alignInput()
{
- in().skip( (sizeof( Type ) - ((in().tell() - mnPropertiesStart) % sizeof( Type ))) % sizeof( Type ) );
+ mxStrm->skip( (sizeof( Type ) - ((mxStrm->tell() - mnPropertiesStart) % sizeof( Type ))) % sizeof( Type ) );
}
template< typename Type >
-Type OcxPropertyObjectBase::dumpDecProperty( Type nDefault, const NameListWrapper& rListWrp )
+Type AxPropertyObjectBase::dumpDecProperty( Type nDefault, const NameListWrapper& rListWrp )
{
if( startNextProperty() )
{
@@ -302,7 +446,7 @@ Type OcxPropertyObjectBase::dumpDecProperty( Type nDefault, const NameListWrappe
}
template< typename Type >
-Type OcxPropertyObjectBase::dumpHexProperty( Type nDefault, const NameListWrapper& rListWrp )
+Type AxPropertyObjectBase::dumpHexProperty( Type nDefault, const NameListWrapper& rListWrp )
{
if( startNextProperty() )
{
@@ -314,10 +458,10 @@ Type OcxPropertyObjectBase::dumpHexProperty( Type nDefault, const NameListWrappe
// ============================================================================
-class OcxCFontNewObject : public OcxPropertyObjectBase
+class AxCFontNewObject : public AxPropertyObjectBase
{
public:
- explicit OcxCFontNewObject( const InputObjectBase& rParent );
+ explicit AxCFontNewObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -325,10 +469,10 @@ protected:
// ============================================================================
-class OcxColumnInfoObject : public OcxPropertyObjectBase
+class AxColumnInfoObject : public AxPropertyObjectBase
{
public:
- explicit OcxColumnInfoObject( const InputObjectBase& rParent );
+ explicit AxColumnInfoObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -336,10 +480,10 @@ protected:
// ============================================================================
-class OcxCommandButtonObject : public OcxPropertyObjectBase
+class AxCommandButtonObject : public AxPropertyObjectBase
{
public:
- explicit OcxCommandButtonObject( const InputObjectBase& rParent );
+ explicit AxCommandButtonObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -348,10 +492,10 @@ protected:
// ============================================================================
-class OcxMorphControlObject : public OcxPropertyObjectBase
+class AxMorphControlObject : public AxPropertyObjectBase
{
public:
- explicit OcxMorphControlObject( const InputObjectBase& rParent );
+ explicit AxMorphControlObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -367,10 +511,10 @@ private:
// ============================================================================
-class OcxLabelObject : public OcxPropertyObjectBase
+class AxLabelObject : public AxPropertyObjectBase
{
public:
- explicit OcxLabelObject( const InputObjectBase& rParent );
+ explicit AxLabelObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -379,10 +523,10 @@ protected:
// ============================================================================
-class OcxImageObject : public OcxPropertyObjectBase
+class AxImageObject : public AxPropertyObjectBase
{
public:
- explicit OcxImageObject( const InputObjectBase& rParent );
+ explicit AxImageObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -390,10 +534,10 @@ protected:
// ============================================================================
-class OcxScrollBarObject : public OcxPropertyObjectBase
+class AxScrollBarObject : public AxPropertyObjectBase
{
public:
- explicit OcxScrollBarObject( const InputObjectBase& rParent );
+ explicit AxScrollBarObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -401,10 +545,10 @@ protected:
// ============================================================================
-class OcxSpinButtonObject : public OcxPropertyObjectBase
+class AxSpinButtonObject : public AxPropertyObjectBase
{
public:
- explicit OcxSpinButtonObject( const InputObjectBase& rParent );
+ explicit AxSpinButtonObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -412,10 +556,10 @@ protected:
// ============================================================================
-class OcxTabStripObject : public OcxPropertyObjectBase
+class AxTabStripObject : public AxPropertyObjectBase
{
public:
- explicit OcxTabStripObject( const InputObjectBase& rParent );
+ explicit AxTabStripObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
@@ -426,181 +570,188 @@ private:
};
// ============================================================================
+// ============================================================================
-class OcxControlObject : public InputObjectBase
+class FormControlStreamObject : public OleInputObjectBase
{
public:
- explicit OcxControlObject(
- const InputObjectBase& rParent,
- const ::rtl::OUString& rProgId,
- sal_Int64 nLength );
+ explicit FormControlStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const ::rtl::OUString& rSysFileName,
+ const ::rtl::OUString* pProgId = 0 );
+ explicit FormControlStreamObject(
+ const OutputObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const ::rtl::OUString* pProgId = 0 );
protected:
virtual void implDump();
private:
+ void constructFormCtrlStrmObj( const ::rtl::OUString* pProgId );
+
+private:
::rtl::OUString maProgId;
- sal_Int64 mnLength;
+ bool mbReadGuid;
};
// ============================================================================
+// ============================================================================
-class OcxGuidControlObject : public InputObjectBase
+struct VbaFormSiteInfo
{
-public:
- explicit OcxGuidControlObject(
- const InputObjectBase& rParent,
- sal_Int64 nLength );
- explicit OcxGuidControlObject(
- const OutputObjectBase& rParent,
- const BinaryInputStreamRef& rxStrm );
- explicit OcxGuidControlObject(
- const ObjectBase& rParent,
- const BinaryInputStreamRef& rxStrm,
- const ::rtl::OUString& rSysFileName );
+ ::rtl::OUString maProgId;
+ sal_Int32 mnId;
+ sal_uInt32 mnLength;
+ bool mbInStream;
-protected:
- virtual void implDump();
+ inline explicit VbaFormSiteInfo() : mnId( 0 ), mnLength( 0 ), mbInStream( false ) {}
+};
-private:
- sal_Int64 mnLength;
+typedef ::std::vector< VbaFormSiteInfo > VbaFormSiteInfoVector;
+
+// ============================================================================
+
+struct VbaFormSharedData
+{
+ OUStringVector maClassInfoProgIds;
+ VbaFormSiteInfoVector maSiteInfos;
};
// ============================================================================
-class OcxControlsStreamObject : public InputObjectBase
+class VbaFormClassInfoObject : public AxPropertyObjectBase
{
public:
- explicit OcxControlsStreamObject(
- const ObjectBase& rParent,
- const BinaryInputStreamRef& rxStrm,
- const ::rtl::OUString& rSysFileName,
- OcxFormSharedData& rFormData );
+ explicit VbaFormClassInfoObject( const InputObjectBase& rParent, VbaFormSharedData& rFormData );
protected:
- virtual void implDump();
+ virtual void implDumpShortProperties();
private:
- OcxFormSharedData& mrFormData;
+ VbaFormSharedData& mrFormData;
};
// ============================================================================
-// ============================================================================
-class OcxPageObject : public OcxPropertyObjectBase
+class VbaFormSiteObject : public AxPropertyObjectBase
{
public:
- explicit OcxPageObject( const InputObjectBase& rParent );
+ explicit VbaFormSiteObject( const InputObjectBase& rParent, VbaFormSharedData& rFormData );
protected:
virtual void implDumpShortProperties();
+
+private:
+ VbaFormSharedData& mrFormData;
};
// ============================================================================
-class OcxMultiPageObject : public OcxPropertyObjectBase
+class VbaFormDesignExtObject : public AxPropertyObjectBase
{
public:
- explicit OcxMultiPageObject( const InputObjectBase& rParent );
+ explicit VbaFormDesignExtObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
- virtual void implDumpExtended();
-
-private:
- sal_Int32 mnPageCount;
};
// ============================================================================
-class OcxMultiPageStreamObject : public InputObjectBase
+class VbaFStreamObject : public AxPropertyObjectBase
{
public:
- explicit OcxMultiPageStreamObject(
+ explicit VbaFStreamObject(
const ObjectBase& rParent,
const BinaryInputStreamRef& rxStrm,
const ::rtl::OUString& rSysFileName,
- OcxFormSharedData& rFormData );
+ VbaFormSharedData& rFormData );
protected:
- virtual void implDump();
+ virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+
+private:
+ void dumpClassInfos();
+ void dumpFormSites( sal_uInt32 nCount );
+ void dumpSiteData();
+ void dumpDesignExtender();
private:
- OcxFormSharedData& mrFormData;
+ VbaFormSharedData& mrFormData;
+ sal_uInt32 mnFlags;
};
// ============================================================================
-// ============================================================================
-class OcxFormClassInfoObject : public OcxPropertyObjectBase
+class VbaOStreamObject : public OleInputObjectBase
{
public:
- explicit OcxFormClassInfoObject( const InputObjectBase& rParent, OcxFormSharedData& rFormData );
+ explicit VbaOStreamObject(
+ const ObjectBase& rParent,
+ const BinaryInputStreamRef& rxStrm,
+ const ::rtl::OUString& rSysFileName,
+ VbaFormSharedData& rFormData );
protected:
- virtual void implDumpShortProperties();
+ virtual void implDump();
private:
- OcxFormSharedData& mrFormData;
+ VbaFormSharedData& mrFormData;
};
// ============================================================================
-class OcxFormSiteObject : public OcxPropertyObjectBase
+class VbaPageObject : public AxPropertyObjectBase
{
public:
- explicit OcxFormSiteObject( const InputObjectBase& rParent, OcxFormSharedData& rFormData );
+ explicit VbaPageObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
-
-private:
- OcxFormSharedData& mrFormData;
};
// ============================================================================
-class OcxFormDesignExtObject : public OcxPropertyObjectBase
+class VbaMultiPageObject : public AxPropertyObjectBase
{
public:
- explicit OcxFormDesignExtObject( const InputObjectBase& rParent );
+ explicit VbaMultiPageObject( const InputObjectBase& rParent );
protected:
virtual void implDumpShortProperties();
+ virtual void implDumpExtended();
+
+private:
+ sal_Int32 mnPageCount;
};
// ============================================================================
-class OcxFormObject : public OcxPropertyObjectBase
+class VbaXStreamObject : public InputObjectBase
{
public:
- explicit OcxFormObject(
+ explicit VbaXStreamObject(
const ObjectBase& rParent,
const BinaryInputStreamRef& rxStrm,
const ::rtl::OUString& rSysFileName,
- OcxFormSharedData& rFormData );
+ VbaFormSharedData& rFormData );
protected:
- virtual void implDumpShortProperties();
- virtual void implDumpExtended();
-
-private:
- void dumpClassInfos();
- void dumpFormSites( sal_uInt32 nCount );
- void dumpSiteData();
- void dumpDesignExtender();
+ virtual void implDump();
private:
- OcxFormSharedData& mrFormData;
- sal_uInt32 mnFlags;
+ VbaFormSharedData& mrFormData;
};
// ============================================================================
-class OcxFormStorageObject : public OleStorageObject
+class VbaContainerStorageObject : public OleStorageObject
{
public:
- explicit OcxFormStorageObject(
+ explicit VbaContainerStorageObject(
const ObjectBase& rParent,
const StorageRef& rxStrg,
const ::rtl::OUString& rSysPath );
@@ -621,7 +772,7 @@ private:
bool isFormStorage( const ::rtl::OUString& rStrgPath ) const;
private:
- OcxFormSharedData maFormData;
+ VbaFormSharedData maFormData;
};
// ============================================================================
@@ -713,7 +864,7 @@ private:
// ============================================================================
-class VbaFormStorageObject : public OcxFormStorageObject
+class VbaFormStorageObject : public VbaContainerStorageObject
{
public:
explicit VbaFormStorageObject(
@@ -759,6 +910,23 @@ private:
// ============================================================================
// ============================================================================
+class ActiveXStorageObject : public VbaContainerStorageObject
+{
+public:
+ explicit ActiveXStorageObject(
+ const ObjectBase& rParent,
+ const StorageRef& rxStrg,
+ const ::rtl::OUString& rSysPath );
+
+protected:
+ virtual void implDumpBaseStream(
+ const BinaryInputStreamRef& rxStrm,
+ const ::rtl::OUString& rSysFileName );
+};
+
+// ============================================================================
+// ============================================================================
+
} // namespace dump
} // namespace oox
diff --git a/oox/inc/oox/dump/xlsbdumper.hxx b/oox/inc/oox/dump/xlsbdumper.hxx
index 95723f6b8d4e..345202f67a4a 100644
--- a/oox/inc/oox/dump/xlsbdumper.hxx
+++ b/oox/inc/oox/dump/xlsbdumper.hxx
@@ -98,7 +98,7 @@ private:
private:
typedef ::boost::shared_ptr< RecordInputStream > RecordInputStreamRef;
- RecordInputStreamRef mxStrm;
+ RecordInputStreamRef mxBiffStrm;
NameListRef mxErrCodes;
};
diff --git a/oox/inc/oox/helper/binaryinputstream.hxx b/oox/inc/oox/helper/binaryinputstream.hxx
index 19933ca03c04..8f58e2de4d9e 100644
--- a/oox/inc/oox/helper/binaryinputstream.hxx
+++ b/oox/inc/oox/helper/binaryinputstream.hxx
@@ -34,6 +34,8 @@
namespace oox {
+class BinaryOutputStream;
+
// ============================================================================
/** Interface for binary input stream classes.
@@ -108,6 +110,8 @@ public:
False = NUL characters are replaced by question marks (default). */
::rtl::OUString readUnicodeArray( sal_Int32 nChars, bool bAllowNulChars = false );
+ /** Copies nBytes bytes from the current position to the passed output stream. */
+ void copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes = SAL_MAX_INT64 );
private:
/** Used by the readValue() template functions to read built-in types.
@@ -216,6 +220,71 @@ typedef ::boost::shared_ptr< SequenceInputStream > SequenceInputStreamRef;
// ============================================================================
+/** Wraps a BinaryInputStream and provides access to a specific part of the
+ stream data.
+
+ @descr
+ Provides access to the stream data block starting at the current
+ position of the stream, and with a specific length. If the wrapped
+ stream is seekable, this wrapper will treat the position the wrapped
+ has at construction time as position "0" (therefore the class name).
+ */
+class RelativeInputStream : public BinaryInputStream
+{
+public:
+ /** Constructs the wrapper object for the passed stream.
+
+ @attention
+ The passed input stream MUST live at least as long as this stream
+ wrapper. The stream MUST NOT be changed from outside as long as
+ this stream wrapper is used to read from it.
+
+ @param nLength
+ If specified, restricts the amount of data that can be read from
+ the passed input stream.
+ */
+ explicit RelativeInputStream(
+ BinaryInputStream& rInStrm,
+ sal_Int64 nLength = SAL_MAX_INT64 );
+
+ /** Returns whether the wrapped stream is seekable. */
+ virtual bool isSeekable() const;
+ /** Returns the size of the data block in the wrapped stream offered by
+ this wrapper. */
+ virtual sal_Int64 getLength() const;
+ /** Returns the current relative stream position. */
+ virtual sal_Int64 tell() const;
+ /** Seeks the stream to the passed relative position, if the wrapped stream
+ is seekable. */
+ virtual void seek( sal_Int64 nPos );
+
+ /** Reads nBytes bytes to the passed sequence. Does not read out of the
+ data block whose size has been specified on construction.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ /** Reads nBytes bytes to the (existing) buffer opMem. Does not read out of
+ the data block whose size has been specified on construction.
+ @return Number of bytes really read. */
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ /** Seeks the stream forward by the passed number of bytes. This works for
+ non-seekable streams too. Does not seek out of the data block. */
+ virtual void skip( sal_Int32 nBytes );
+
+ /** Stream operator for integral and floating-point types. */
+ template< typename Type >
+ inline RelativeInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
+
+private:
+ BinaryInputStream& mrInStrm;
+ sal_Int64 mnStartPos;
+ sal_Int64 mnRelPos;
+ sal_Int64 mnLength;
+};
+
+typedef ::boost::shared_ptr< RelativeInputStream > RelativeInputStreamRef;
+
+// ============================================================================
+
} // namespace oox
#endif
diff --git a/oox/inc/oox/helper/binaryoutputstream.hxx b/oox/inc/oox/helper/binaryoutputstream.hxx
index b229dbd18901..d2f0f8b36ffa 100644
--- a/oox/inc/oox/helper/binaryoutputstream.hxx
+++ b/oox/inc/oox/helper/binaryoutputstream.hxx
@@ -34,8 +34,6 @@
namespace oox {
-class BinaryInputStream;
-
// ============================================================================
/** Interface for binary output stream classes.
@@ -50,9 +48,6 @@ public:
/** Derived classes implement writing from the (existing) buffer pMem. */
virtual void writeMemory( const void* pMem, sal_Int32 nBytes ) = 0;
- /** Copies nBytes bytes from the current position of the passed input stream. */
- void copyStream( BinaryInputStream& rInStrm, sal_Int64 nBytes = SAL_MAX_INT64 );
-
/** Writes a value to the stream and converts it to platform byte order.
Supported types: SAL integers (8 to 64 bit), float, double. */
template< typename Type >
diff --git a/oox/inc/oox/helper/binarystreambase.hxx b/oox/inc/oox/helper/binarystreambase.hxx
index 18d868660faa..abe4c5f1c274 100644
--- a/oox/inc/oox/helper/binarystreambase.hxx
+++ b/oox/inc/oox/helper/binarystreambase.hxx
@@ -38,7 +38,8 @@ typedef ::com::sun::star::uno::Sequence< sal_Int8 > StreamDataSequence;
// ============================================================================
-/** Base interface for seekable binary stream classes. */
+/** Base interface for binary stream classes. Implemenetations may or may not
+ support seeking the stream. */
class BinaryStreamBase
{
public:
@@ -46,11 +47,14 @@ public:
/** Derived classes return whether the stream is seekable. Default: false. */
virtual bool isSeekable() const;
- /** Derived classes returns the size of the stream, if seekable, otherwise/default: -1. */
+ /** Derived classes return the size of the stream, if possible,
+ otherwise/default: -1. May return something for unseekable streams. */
virtual sal_Int64 getLength() const;
- /** Derived classes return the current stream position, if seekable, otherwise/default: -1. */
+ /** Derived classes return the current stream position, if possible,
+ otherwise/default: -1. May return something for unseekable streams. */
virtual sal_Int64 tell() const;
- /** Derived classes implement seeking the stream to the passed position, if seekable. */
+ /** Derived classes implement seeking the stream to the passed position, if
+ the stream is seekable. */
virtual void seek( sal_Int64 nPos );
/** Returns true, if the stream position is invalid (EOF). This flag turns
@@ -63,6 +67,9 @@ public:
inline void seekToStart() { seek( 0 ); }
/** Seeks the stream to the end, if stream is seekable. */
inline void seekToEnd() { seek( getLength() ); }
+ /** Seeks the stream forward to a position that is a multiple of the passed
+ block size, relative to the passed stream position, if stream is seekable. */
+ void alignToBlock( sal_Int32 nBlockSize, sal_Int64 nAnchorPos = 0 );
protected:
inline explicit BinaryStreamBase() : mbEof( false ) {}
diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx
index a077c667ae4c..f4f3717eac3f 100644
--- a/oox/inc/oox/helper/containerhelper.hxx
+++ b/oox/inc/oox/helper/containerhelper.hxx
@@ -84,34 +84,86 @@ public:
Does *not* check whether the last element is an empty reference. */
inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; }
- /** Calls the passed member function of ObjType on every contained object. */
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
template< typename FunctorType >
- inline void forEach( const FunctorType& rFunctor ) const
+ inline void forEach( FunctorType aFunctor ) const
{
- ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) );
+ ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) );
}
- /** Calls the passed member function of ObjType on every contained object. */
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
template< typename FuncType >
inline void forEachMem( FuncType pFunc ) const
{
forEach( ::boost::bind( pFunc, _1 ) );
}
- /** Calls the passed member function of ObjType on every contained object. */
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
template< typename FuncType, typename ParamType >
inline void forEachMem( FuncType pFunc, ParamType aParam ) const
{
forEach( ::boost::bind( pFunc, _1, aParam ) );
}
- /** Calls the passed member function of ObjType on every contained object. */
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
template< typename FuncType, typename ParamType1, typename ParamType2 >
inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
{
forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
}
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Calls the passed functor for every contained object. Passes the index as
+ first argument and the object reference as second argument to rFunctor. */
+ template< typename FunctorType >
+ inline void forEachWithIndex( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index to the member function. */
+ template< typename FuncType >
+ inline void forEachMemWithIndex( FuncType pFunc ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
/** Searches for an element by using the passed functor that takes a
constant reference of the object type (const ObjType&). */
template< typename FunctorType >
@@ -125,17 +177,26 @@ private:
template< typename FunctorType >
struct ForEachFunctor
{
- const FunctorType& mrFunctor;
- inline explicit ForEachFunctor( const FunctorType& rFunctor ) : mrFunctor( rFunctor ) {}
- inline void operator()( const value_type& rxValue ) const { if( rxValue.get() ) mrFunctor( *rxValue ); }
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); }
+ };
+
+ template< typename FunctorType >
+ struct ForEachFunctorWithIndex
+ {
+ FunctorType maFunctor;
+ sal_Int32 mnIndex;
+ inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; }
};
template< typename FunctorType >
struct FindFunctor
{
- const FunctorType& mrFunctor;
- inline explicit FindFunctor( const FunctorType& rFunctor ) : mrFunctor( rFunctor ) {}
- inline bool operator()( const value_type& rxValue ) const { return rxValue.get() && mrFunctor( *rxValue ); }
+ FunctorType maFunctor;
+ inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); }
};
inline const value_type* getRef( sal_Int32 nIndex ) const
@@ -173,41 +234,53 @@ public:
return pxRef && pxRef->get();
}
- /** Returns a reference to the object accossiated to the passed key, or 0 on error. */
+ /** Returns a reference to the object accossiated to the passed key, or an
+ empty reference on error. */
inline mapped_type get( key_type nKey ) const
{
if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef;
return mapped_type();
}
- /** Calls the passed functor for every contained object. */
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
template< typename FunctorType >
inline void forEach( const FunctorType& rFunctor ) const
{
::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) );
}
- /** Calls the passed member function of ObjType on every contained object. */
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
template< typename FuncType >
inline void forEachMem( FuncType pFunc ) const
{
forEach( ::boost::bind( pFunc, _1 ) );
}
- /** Calls the passed member function of ObjType on every contained object. */
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
template< typename FuncType, typename ParamType >
inline void forEachMem( FuncType pFunc, ParamType aParam ) const
{
forEach( ::boost::bind( pFunc, _1, aParam ) );
}
- /** Calls the passed member function of ObjType on every contained object. */
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
template< typename FuncType, typename ParamType1, typename ParamType2 >
inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
{
forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
}
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
/** Calls the passed functor for every contained object. Passes the key as
first argument and the object reference as second argument to rFunctor. */
template< typename FunctorType >
@@ -240,21 +313,29 @@ public:
forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
}
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
private:
template< typename FunctorType >
struct ForEachFunctor
{
- const FunctorType& mrFunctor;
- inline explicit ForEachFunctor( const FunctorType& rFunctor ) : mrFunctor( rFunctor ) {}
- inline void operator()( const value_type& rValue ) const { if( rValue.second.get() ) mrFunctor( *rValue.second ); }
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); }
};
template< typename FunctorType >
struct ForEachFunctorWithKey
{
- const FunctorType& mrFunctor;
- inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : mrFunctor( rFunctor ) {}
- inline void operator()( const value_type& rValue ) const { if( rValue.second.get() ) mrFunctor( rValue.first, *rValue.second ); }
+ FunctorType maFunctor;
+ inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); }
};
inline const mapped_type* getRef( key_type nKey ) const
@@ -453,7 +534,7 @@ public:
/** Returns the reference to an existing element of the passed vector, or
the passed default value, if the passed index is out of bounds. */
template< typename Type >
- static Type& getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault );
+ static Type& getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault );
/** Returns the pointer to an existing element of the passed map, or a null
pointer, if an element with the passed key does not exist. */
@@ -522,7 +603,7 @@ const Type& ContainerHelper::getVectorElement( const ::std::vector< Type >& rVec
}
template< typename Type >
-Type& ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault )
+Type& ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault;
}
diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx
index d6e01d0fff6b..2d0964b37715 100644
--- a/oox/inc/oox/helper/graphichelper.hxx
+++ b/oox/inc/oox/helper/graphichelper.hxx
@@ -29,24 +29,31 @@
#define OOX_HELPER_GRAPHICHELPER_HXX
#include <deque>
+#include <map>
#include <rtl/ustring.hxx>
+#include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include "oox/helper/binarystreambase.hxx"
namespace com { namespace sun { namespace star {
- namespace uno { class XComponentContext; }
- namespace lang { class XMultiServiceFactory; }
+ namespace awt { struct Point; }
+ namespace awt { struct Size; }
+ namespace awt { class XUnitConversion; }
namespace io { class XInputStream; }
+ namespace frame { class XFrame; }
namespace graphic { class XGraphic; }
namespace graphic { class XGraphicObject; }
namespace graphic { class XGraphicProvider; }
+ namespace lang { class XMultiServiceFactory; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox {
// ============================================================================
-/** Provides helper functions for graphics and graphic objects handling.
+/** Provides helper functions for colors, device measurement conversion,
+ graphics, and graphic objects handling.
All createGraphicObject() and importGraphicObject() functions create
persistent graphic objects internally and store them in an internal
@@ -60,39 +67,84 @@ class GraphicHelper
{
public:
explicit GraphicHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
- ~GraphicHelper();
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxTargetFrame );
+ virtual ~GraphicHelper();
+
+ /** Returns a system color specified by the passed XML token identifier. */
+ sal_Int32 getSystemColor( sal_Int32 nToken, sal_Int32 nDefaultRgb = API_RGB_TRANSPARENT ) const;
+ /** Derived classes may implement to resolve a scheme color from the passed XML token identifier. */
+ virtual sal_Int32 getSchemeColor( sal_Int32 nToken ) const;
+ /** Derived classes may implement to resolve a palette index to an RGB color. */
+ virtual sal_Int32 getPaletteColor( sal_Int32 nPaletteIdx ) const;
+
+ /** Returns information about the output device. */
+ const ::com::sun::star::awt::DeviceInfo& getDeviceInfo() const;
+
+ /** Converts the passed value from horizontal screen pixels to 1/100 mm. */
+ sal_Int32 convertScreenPixelXToHmm( double fPixelX ) const;
+ /** Converts the passed value from vertical screen pixels to 1/100 mm. */
+ sal_Int32 convertScreenPixelYToHmm( double fPixelY ) const;
+ /** Converts the passed point from screen pixels to 1/100 mm. */
+ ::com::sun::star::awt::Point convertScreenPixelToHmm( const ::com::sun::star::awt::Point& rPixel ) const;
+ /** Converts the passed size from screen pixels to 1/100 mm. */
+ ::com::sun::star::awt::Size convertScreenPixelToHmm( const ::com::sun::star::awt::Size& rPixel ) const;
+
+ /** Converts the passed value from 1/100 mm to horizontal screen pixels. */
+ double convertHmmToScreenPixelX( sal_Int32 nHmmX ) const;
+ /** Converts the passed value from 1/100 mm to vertical screen pixels. */
+ double convertHmmToScreenPixelY( sal_Int32 nHmmY ) const;
+ /** Converts the passed point from 1/100 mm to screen pixels. */
+ ::com::sun::star::awt::Point convertHmmToScreenPixel( const ::com::sun::star::awt::Point& rHmm ) const;
+ /** Converts the passed size from 1/100 mm to screen pixels. */
+ ::com::sun::star::awt::Size convertHmmToScreenPixel( const ::com::sun::star::awt::Size& rHmm ) const;
+
+ /** Converts the passed point from AppFont units to 1/100 mm. */
+ ::com::sun::star::awt::Point convertAppFontToHmm( const ::com::sun::star::awt::Point& rAppFont ) const;
+ /** Converts the passed point from AppFont units to 1/100 mm. */
+ ::com::sun::star::awt::Size convertAppFontToHmm( const ::com::sun::star::awt::Size& rAppFont ) const;
+
+ /** Converts the passed point from 1/100 mm to AppFont units. */
+ ::com::sun::star::awt::Point convertHmmToAppFont( const ::com::sun::star::awt::Point& rHmm ) const;
+ /** Converts the passed size from 1/100 mm to AppFont units. */
+ ::com::sun::star::awt::Size convertHmmToAppFont( const ::com::sun::star::awt::Size& rHmm ) const;
/** Imports a graphic from the passed input stream. */
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
importGraphic(
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm ) const;
/** Imports a graphic from the passed binary memory block. */
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
- importGraphic( const StreamDataSequence& rGraphicData );
+ importGraphic( const StreamDataSequence& rGraphicData ) const;
/** Creates a persistent graphic object from the passed graphic.
@return The URL of the created and internally cached graphic object. */
::rtl::OUString createGraphicObject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic ) const;
/** Creates a persistent graphic object from the passed input stream.
@return The URL of the created and internally cached graphic object. */
::rtl::OUString importGraphicObject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm ) const;
/** Creates a persistent graphic object from the passed binary memory block.
@return The URL of the created and internally cached graphic object. */
- ::rtl::OUString importGraphicObject( const StreamDataSequence& rGraphicData );
+ ::rtl::OUString importGraphicObject( const StreamDataSequence& rGraphicData ) const;
private:
+ typedef ::std::map< sal_Int32, sal_Int32 > SystemPalette;
typedef ::std::deque< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > > GraphicObjectDeque;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCompContext;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicProvider > mxGraphicProvider;
- GraphicObjectDeque maGraphicObjects;
- const ::rtl::OUString maGraphicObjScheme;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XUnitConversion > mxUnitConversion;
+ ::com::sun::star::awt::DeviceInfo maDeviceInfo; /// Current output device info.
+ SystemPalette maSystemPalette; /// Maps system colors (XML tokens) to RGB color values.
+ mutable GraphicObjectDeque maGraphicObjects; /// Caches all created graphic objects to keep them alive.
+ const ::rtl::OUString maGraphicObjScheme; /// The URL scheme name for graphic objects.
+ double mfPixelPerHmmX; /// Number of screen pixels per 1/100 mm in X direction.
+ double mfPixelPerHmmY; /// Number of screen pixels per 1/100 mm in Y direction.
};
// ============================================================================
diff --git a/oox/inc/oox/helper/helper.hxx b/oox/inc/oox/helper/helper.hxx
index 5884855bc50d..c68fe9ce83f8 100644
--- a/oox/inc/oox/helper/helper.hxx
+++ b/oox/inc/oox/helper/helper.hxx
@@ -69,7 +69,29 @@ namespace oox {
#define OUSTRING_TO_CSTR( str ) \
::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ).getStr()
-// ============================================================================
+// Common constants ===========================================================
+
+const sal_uInt8 WINDOWS_CHARSET_ANSI = 0;
+const sal_uInt8 WINDOWS_CHARSET_DEFAULT = 1;
+const sal_uInt8 WINDOWS_CHARSET_SYMBOL = 2;
+const sal_uInt8 WINDOWS_CHARSET_APPLE_ROMAN = 77;
+const sal_uInt8 WINDOWS_CHARSET_SHIFTJIS = 128;
+const sal_uInt8 WINDOWS_CHARSET_HANGEUL = 129;
+const sal_uInt8 WINDOWS_CHARSET_JOHAB = 130;
+const sal_uInt8 WINDOWS_CHARSET_GB2312 = 134;
+const sal_uInt8 WINDOWS_CHARSET_BIG5 = 136;
+const sal_uInt8 WINDOWS_CHARSET_GREEK = 161;
+const sal_uInt8 WINDOWS_CHARSET_TURKISH = 162;
+const sal_uInt8 WINDOWS_CHARSET_VIETNAMESE = 163;
+const sal_uInt8 WINDOWS_CHARSET_HEBREW = 177;
+const sal_uInt8 WINDOWS_CHARSET_ARABIC = 178;
+const sal_uInt8 WINDOWS_CHARSET_BALTIC = 186;
+const sal_uInt8 WINDOWS_CHARSET_RUSSIAN = 204;
+const sal_uInt8 WINDOWS_CHARSET_THAI = 222;
+const sal_uInt8 WINDOWS_CHARSET_EASTERN = 238;
+const sal_uInt8 WINDOWS_CHARSET_OEM = 255;
+
+// ----------------------------------------------------------------------------
const sal_Int32 API_RGB_TRANSPARENT = -1; /// Transparent color for API calls.
const sal_Int32 API_RGB_BLACK = 0x00000; /// Black color for API calls.
diff --git a/oox/inc/oox/helper/modelobjecthelper.hxx b/oox/inc/oox/helper/modelobjecthelper.hxx
index cead2ad74fb1..a9ef27e8cb98 100644
--- a/oox/inc/oox/helper/modelobjecthelper.hxx
+++ b/oox/inc/oox/helper/modelobjecthelper.hxx
@@ -53,7 +53,7 @@ class ModelObjectHelper
{
public:
explicit ModelObjectHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory );
/** Returns true, if the model contains a line marker with the passed name. */
bool hasLineMarker( const ::rtl::OUString& rMarkerName ) const;
diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx
index bdb81c6c3e83..a1769374d959 100644
--- a/oox/inc/oox/helper/propertyset.hxx
+++ b/oox/inc/oox/helper/propertyset.hxx
@@ -92,6 +92,10 @@ public:
template< typename Type >
inline bool getProperty( Type& orValue, sal_Int32 nPropId ) const;
+ /** Gets the specified property from the property set.
+ @return the property value, or an empty Any, if the property is missing. */
+ ::com::sun::star::uno::Any getAnyProperty( sal_Int32 nPropId ) const;
+
/** Gets the specified boolean property from the property set.
@return true = property contains true; false = property contains false or error occured. */
bool getBoolProperty( sal_Int32 nPropId ) const;
diff --git a/oox/inc/oox/helper/storagebase.hxx b/oox/inc/oox/helper/storagebase.hxx
index b23032fe2ac0..5a179e73cf75 100644
--- a/oox/inc/oox/helper/storagebase.hxx
+++ b/oox/inc/oox/helper/storagebase.hxx
@@ -28,12 +28,8 @@
#ifndef OOX_HELPER_STORAGEBASE_HXX
#define OOX_HELPER_STORAGEBASE_HXX
-#include <vector>
-#include <map>
-#include <boost/shared_ptr.hpp>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <oox/dllapi.h>
+#include "oox/dllapi.h"
+#include "oox/helper/containerhelper.hxx"
namespace com { namespace sun { namespace star {
namespace embed { class XStorage; }
@@ -71,6 +67,13 @@ public:
/** Returns true, if the object represents a valid storage. */
bool isStorage() const;
+ /** Returns true, if the object represents the root storage. */
+ bool isRootStorage() const;
+
+ /** Returns true, if the storage operates in read-only mode (based on an
+ input stream). */
+ bool isReadOnly() const;
+
/** Returns the com.sun.star.embed.XStorage interface of the current storage. */
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
getXStorage() const;
@@ -81,7 +84,8 @@ public:
/** Returns the full path of this storage. */
::rtl::OUString getPath() const;
- /** Fills the passed vector with the names of all elements of this storage. */
+ /** Fills the passed vector with the names of all direct elements of this
+ storage. */
void getElementNames( ::std::vector< ::rtl::OUString >& orElementNames ) const;
/** Opens and returns the specified sub storage from the storage.
@@ -89,10 +93,11 @@ public:
@param rStorageName
The name of the embedded storage. The name may contain slashes to
open storages from embedded substorages.
- @param bCreate
- True = create missing sub storages (for export filters).
+ @param bCreateMissing
+ True = create missing sub storages (for export filters). Must be
+ false for storages based on input streams.
*/
- StorageRef openSubStorage( const ::rtl::OUString& rStorageName, bool bCreate );
+ StorageRef openSubStorage( const ::rtl::OUString& rStorageName, bool bCreateMissing );
/** Opens and returns the specified input stream from the storage.
@@ -116,13 +121,27 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
openOutputStream( const ::rtl::OUString& rStreamName );
- /** Commits the changes to the storage and all the substorages. (in case it is transacted object)
+ /** Copies the specified element from this storage to the passed
+ destination storage.
+
+ @param rElementName
+ The name of the embedded storage or stream. The name may contain
+ slashes to specify an element in an embedded substorage. In this
+ case, the element will be copied to the same substorage in the
+ destination storage.
*/
- void commit();
+ void copyToStorage( StorageBase& rDestStrg, const ::rtl::OUString& rElementName );
+
+ /** Copies all streams of this storage and of all substorages to the passed
+ destination. */
+ void copyStorageToStorage( StorageBase& rDestStrg );
+
+ /** Commits the changes to the storage and all substorages. */
+ void commit();
protected:
/** Special constructor for sub storage objects. */
- explicit StorageBase( const StorageBase& rParentStorage, const ::rtl::OUString& rStorageName );
+ explicit StorageBase( const StorageBase& rParentStorage, const ::rtl::OUString& rStorageName, bool bReadOnly );
private:
StorageBase( const StorageBase& );
@@ -149,19 +168,24 @@ private:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
implOpenOutputStream( const ::rtl::OUString& rElementName ) = 0;
- StorageRef getSubStorage( const ::rtl::OUString& rElementName, bool bCreate );
+ /** Commits the current storage. */
+ virtual void implCommit() const = 0;
+
+ /** Helper that opens and caches the specified direct substorage. */
+ StorageRef getSubStorage( const ::rtl::OUString& rElementName, bool bCreateMissing );
private:
- typedef ::std::map< ::rtl::OUString, StorageRef > SubStorageMap;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > XInputStreamRef;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > XStreamRef;
+ typedef RefMap< ::rtl::OUString, StorageBase > SubStorageMap;
SubStorageMap maSubStorages; /// Map of direct sub storages.
- XInputStreamRef mxInStream; /// Cached base input stream (to keep it alive).
- XStreamRef mxOutStream; /// Cached base output stream (to keep it alive).
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ mxInStream; /// Cached base input stream (to keep it alive).
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ mxOutStream; /// Cached base output stream (to keep it alive).
+ ::rtl::OUString maParentPath; /// Full path of parent storage.
::rtl::OUString maStorageName; /// Name of this storage, if it is a substorage.
- const StorageBase* mpParentStorage; /// Parent storage if this is a sub storage.
bool mbBaseStreamAccess; /// True = access base streams with empty stream name.
+ bool mbReadOnly; /// True = storage opened read-only (based on input stream).
};
// ============================================================================
@@ -169,4 +193,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/helper/textinputstream.hxx b/oox/inc/oox/helper/textinputstream.hxx
new file mode 100755
index 000000000000..1e74825ee713
--- /dev/null
+++ b/oox/inc/oox/helper/textinputstream.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_HELPER_RECORDINPUTSTREAM_HXX
+#define OOX_HELPER_RECORDINPUTSTREAM_HXX
+
+#include "oox/helper/binaryinputstream.hxx"
+
+namespace oox {
+
+// ============================================================================
+
+class TextInputStream
+{
+public:
+ explicit TextInputStream( BinaryInputStream& rInStrm, rtl_TextEncoding eTextEnc );
+
+ /** Returns true, if the wrapped input stream is in EOF state. */
+ bool isEof() const;
+ /** Reads a text line from the stream. */
+ ::rtl::OUString readLine();
+
+private:
+ BinaryInputStream& mrInStrm;
+ rtl_TextEncoding meTextEnc;
+ sal_Unicode mcLastEolChar;
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
+
diff --git a/oox/inc/oox/helper/zipstorage.hxx b/oox/inc/oox/helper/zipstorage.hxx
index b6eef63b47de..0c9a15c10077 100644
--- a/oox/inc/oox/helper/zipstorage.hxx
+++ b/oox/inc/oox/helper/zipstorage.hxx
@@ -69,7 +69,7 @@ private:
virtual void implGetElementNames( ::std::vector< ::rtl::OUString >& orElementNames ) const;
/** Opens and returns the specified sub storage from the storage. */
- virtual StorageRef implOpenSubStorage( const ::rtl::OUString& rElementName, bool bCreate );
+ virtual StorageRef implOpenSubStorage( const ::rtl::OUString& rElementName, bool bCreateMissing );
/** Opens and returns the specified input stream from the storage. */
virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
@@ -79,6 +79,9 @@ private:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
implOpenOutputStream( const ::rtl::OUString& rElementName );
+ /** Commits the current storage. */
+ virtual void implCommit() const;
+
private:
typedef ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > XStorageRef;
@@ -90,4 +93,3 @@ private:
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx
index 3db0bae7cee4..d036e958a446 100644..100755
--- a/oox/inc/oox/ole/axbinaryreader.hxx
+++ b/oox/inc/oox/ole/axbinaryreader.hxx
@@ -28,6 +28,7 @@
#ifndef OOX_OLE_AXBINARYREADER_HXX
#define OOX_OLE_AXBINARYREADER_HXX
+#include <utility>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/containerhelper.hxx"
@@ -36,15 +37,24 @@ namespace ole {
// ============================================================================
-/** A wrapper for an unseekable binary input stream. */
+/** A wrapper for a binary input stream that supports aligned read operations.
+
+ The implementation does not support seeking back the wrapped stream. All
+ seeking operations (tell, seek, align) are performed relative to the
+ position of the wrapped stream at construction time of this wrapper. It is
+ possible to construct this wrapper with an unseekable input stream without
+ loosing any functionality.
+ */
class AxAlignedInputStream : public BinaryInputStream
{
public:
explicit AxAlignedInputStream( BinaryInputStream& rInStrm );
- /** Return the current stream position (relative to position at construction time). */
+ /** Return the current relative stream position (relative to position of
+ the wrapped stream at construction time). */
virtual sal_Int64 tell() const;
- /** Seeks the stream to the passed position, if it is behind the current position. */
+ /** Seeks the stream to the passed relative position, if it is behind the
+ current position. */
virtual void seek( sal_Int64 nPos );
/** Reads nBytes bytes to the passed sequence.
@@ -56,7 +66,8 @@ public:
/** Seeks the stream forward by the passed number of bytes. */
virtual void skip( sal_Int32 nBytes );
- /** Aligns the stream to a multiple of the passed size. */
+ /** Aligns the stream to a multiple of the passed size (relative to the
+ position of the wrapped stream at construction time). */
void align( size_t nSize );
/** Aligns the stream according to the passed type and reads an atomar value. */
@@ -73,6 +84,50 @@ private:
// ============================================================================
+/** A pair of integer values as a property. */
+typedef ::std::pair< sal_Int32, sal_Int32 > AxPairData;
+
+// ============================================================================
+
+const sal_uInt32 AX_FONTDATA_BOLD = 0x00000001;
+const sal_uInt32 AX_FONTDATA_ITALIC = 0x00000002;
+const sal_uInt32 AX_FONTDATA_UNDERLINE = 0x00000004;
+const sal_uInt32 AX_FONTDATA_STRIKEOUT = 0x00000008;
+const sal_uInt32 AX_FONTDATA_DISABLED = 0x00002000;
+const sal_uInt32 AX_FONTDATA_AUTOCOLOR = 0x40000000;
+
+const sal_Int32 AX_FONTDATA_LEFT = 1;
+const sal_Int32 AX_FONTDATA_RIGHT = 2;
+const sal_Int32 AX_FONTDATA_CENTER = 3;
+
+/** All entries of a font property. */
+struct AxFontData
+{
+ ::rtl::OUString maFontName; /// Name of the used font.
+ sal_uInt32 mnFontEffects; /// Font effect flags.
+ sal_Int32 mnFontHeight; /// Height of the font (not really twips, see code).
+ sal_Int32 mnFontCharSet; /// Windows character set of the font.
+ sal_Int32 mnHorAlign; /// Horizontal text alignment.
+
+ explicit AxFontData();
+
+ /** Converts the internal representation of the font height to points. */
+ sal_Int16 getHeightPoints() const;
+ /** Converts the passed font height from points to the internal representation. */
+ void setHeightPoints( sal_Int16 nPoints );
+
+ /** Reads the font data settings from the passed input stream. */
+ bool importBinaryModel( BinaryInputStream& rInStrm );
+ /** Reads the font data settings from the passed input stream that contains
+ an OLE StdFont structure. */
+ bool importStdFont( BinaryInputStream& rInStrm );
+ /** Reads the font data settings from the passed input stream depending on
+ the GUID preceding the actual font data. */
+ bool importGuidAndFont( BinaryInputStream& rInStrm );
+};
+
+// ============================================================================
+
/** Import helper to read simple and complex ActiveX form control properties
from a binary input stream. */
class AxBinaryPropertyReader
@@ -90,10 +145,16 @@ public:
void readBoolProperty( bool& orbValue, bool bReverse = false );
/** Reads the next pair property from the stream, if the respective flag in
the property mask is set. */
- void readPairProperty( sal_Int32& ornValue1, sal_Int32& ornValue2 );
+ void readPairProperty( AxPairData& orPairData );
/** Reads the next string property from the stream, if the respective flag
in the property mask is set. */
void readStringProperty( ::rtl::OUString& orValue );
+ /** Reads the next GUID property from the stream, if the respective flag
+ in the property mask is set. The GUID will be enclosed in braces. */
+ void readGuidProperty( ::rtl::OUString& orGuid );
+ /** Reads the next font property from the stream, if the respective flag in
+ the property mask is set. */
+ void readFontProperty( AxFontData& orFontData );
/** Reads the next picture property from the stream, if the respective flag
in the property mask is set. */
void readPictureProperty( StreamDataSequence& orPicData );
@@ -105,9 +166,18 @@ public:
/** Skips the next boolean property value in the stream, if the respective
flag in the property mask is set. */
inline void skipBoolProperty() { startNextProperty(); }
+ /** Skips the next pair property in the stream, if the respective flag in
+ the property mask is set. */
+ void skipPairProperty() { readPairProperty( maDummyPairData ); }
/** Skips the next string property in the stream, if the respective flag in
the property mask is set. */
inline void skipStringProperty() { readStringProperty( maDummyString ); }
+ /** Skips the next GUID property in the stream, if the respective flag in
+ the property mask is set. */
+ inline void skipGuidProperty() { readGuidProperty( maDummyString ); }
+ /** Skips the next font property in the stream, if the respective flag in
+ the property mask is set. */
+ inline void skipFontProperty() { readFontProperty( maDummyFontData ); }
/** Skips the next picture property in the stream, if the respective flag
in the property mask is set. */
inline void skipPictureProperty() { readPictureProperty( maDummyPicData ); }
@@ -133,11 +203,10 @@ private:
/** Complex property for a 32-bit value pair, e.g. point or size. */
struct PairProperty : public ComplexProperty
{
- sal_Int32& mrnValue1;
- sal_Int32& mrnValue2;
+ AxPairData& mrPairData;
- inline explicit PairProperty( sal_Int32& rnValue1, sal_Int32& rnValue2 ) :
- mrnValue1( rnValue1 ), mrnValue2( rnValue2 ) {}
+ inline explicit PairProperty( AxPairData& rPairData ) :
+ mrPairData( rPairData ) {}
virtual bool readProperty( AxAlignedInputStream& rInStrm );
};
@@ -152,6 +221,26 @@ private:
virtual bool readProperty( AxAlignedInputStream& rInStrm );
};
+ /** Complex property for a GUID value. */
+ struct GuidProperty : public ComplexProperty
+ {
+ ::rtl::OUString& mrGuid;
+
+ inline explicit GuidProperty( ::rtl::OUString& rGuid ) :
+ mrGuid( rGuid ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
+ /** Stream property for a font structure. */
+ struct FontProperty : public ComplexProperty
+ {
+ AxFontData& mrFontData;
+
+ inline explicit FontProperty( AxFontData& rFontData ) :
+ mrFontData( rFontData ) {}
+ virtual bool readProperty( AxAlignedInputStream& rInStrm );
+ };
+
/** Stream property for a picture or mouse icon. */
struct PictureProperty : public ComplexProperty
{
@@ -168,6 +257,8 @@ private:
AxAlignedInputStream maInStrm; /// The input stream to read from.
ComplexPropVector maLargeProps; /// Stores info for all used large properties.
ComplexPropVector maStreamProps; /// Stores info for all used stream data properties.
+ AxPairData maDummyPairData; /// Dummy pair for unsupported properties.
+ AxFontData maDummyFontData; /// Dummy font for unsupported properties.
StreamDataSequence maDummyPicData; /// Dummy picture for unsupported properties.
::rtl::OUString maDummyString; /// Dummy string for unsupported properties.
sal_Int64 mnPropFlags; /// Flags specifying existing properties.
diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index b5a5741d134d..7c533334cc49 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -28,82 +28,389 @@
#ifndef OOX_OLE_AXCONTROL_HXX
#define OOX_OLE_AXCONTROL_HXX
-#include <memory>
+#include <boost/shared_ptr.hpp>
#include "oox/helper/binarystreambase.hxx"
+#include "oox/ole/axbinaryreader.hxx"
+#include "oox/ole/olehelper.hxx"
namespace com { namespace sun { namespace star {
namespace awt { class XControlModel; }
+ namespace container { class XIndexContainer; }
+ namespace drawing { class XDrawPage; }
+ namespace form { class XFormsSupplier; }
+ namespace lang { class XMultiServiceFactory; }
} } }
namespace oox {
class BinaryInputStream;
+ class GraphicHelper;
class PropertyMap;
}
namespace oox {
namespace ole {
-class AxControlHelper;
+// ============================================================================
+
+const sal_Char* const COMCTL_GUID_SCROLLBAR_60 = "{FE38753A-44A3-11D1-B5B7-0000C09000C4}";
+const sal_Char* const COMCTL_GUID_PROGRESSBAR_50 = "{0713E8D2-850A-101B-AFC0-4210102A8DA7}";
+const sal_Char* const COMCTL_GUID_PROGRESSBAR_60 = "{35053A22-8589-11D1-B16A-00C0F0283628}";
+
+// ----------------------------------------------------------------------------
+
+const sal_Char* const AX_GUID_COMMANDBUTTON = "{D7053240-CE69-11CD-A777-00DD01143C57}";
+const sal_Char* const AX_GUID_LABEL = "{978C9E23-D4B0-11CE-BF2D-00AA003F40D0}";
+const sal_Char* const AX_GUID_IMAGE = "{4C599241-6926-101B-9992-00000B65C6F9}";
+const sal_Char* const AX_GUID_TOGGLEBUTTON = "{8BD21D60-EC42-11CE-9E0D-00AA006002F3}";
+const sal_Char* const AX_GUID_CHECKBOX = "{8BD21D40-EC42-11CE-9E0D-00AA006002F3}";
+const sal_Char* const AX_GUID_OPTIONBUTTON = "{8BD21D50-EC42-11CE-9E0D-00AA006002F3}";
+const sal_Char* const AX_GUID_TEXTBOX = "{8BD21D10-EC42-11CE-9E0D-00AA006002F3}";
+const sal_Char* const AX_GUID_LISTBOX = "{8BD21D20-EC42-11CE-9E0D-00AA006002F3}";
+const sal_Char* const AX_GUID_COMBOBOX = "{8BD21D30-EC42-11CE-9E0D-00AA006002F3}";
+const sal_Char* const AX_GUID_SPINBUTTON = "{79176FB0-B7F2-11CE-97EF-00AA006D2776}";
+const sal_Char* const AX_GUID_SCROLLBAR = "{DFD181E0-5E2F-11CE-A449-00AA004A803D}";
+const sal_Char* const AX_GUID_FRAME = "{6E182020-F460-11CE-9BCD-00AA00608E01}";
+
+const sal_uInt32 AX_SYSCOLOR_WINDOWBACK = 0x80000005;
+const sal_uInt32 AX_SYSCOLOR_WINDOWFRAME = 0x80000006;
+const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT = 0x80000008;
+const sal_uInt32 AX_SYSCOLOR_BUTTONFACE = 0x8000000F;
+const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT = 0x80000012;
+
+const sal_Int32 AX_BORDERSTYLE_NONE = 0;
+const sal_Int32 AX_BORDERSTYLE_SINGLE = 1;
+
+const sal_Int32 AX_SPECIALEFFECT_FLAT = 0;
+const sal_Int32 AX_SPECIALEFFECT_RAISED = 1;
+const sal_Int32 AX_SPECIALEFFECT_SUNKEN = 2;
+const sal_Int32 AX_SPECIALEFFECT_ETCHED = 3;
+const sal_Int32 AX_SPECIALEFFECT_BUMPED = 6;
+
+const sal_Int32 AX_PICSIZE_CLIP = 0;
+const sal_Int32 AX_PICSIZE_STRETCH = 1;
+const sal_Int32 AX_PICSIZE_ZOOM = 3;
+
+const sal_Int32 AX_PICALIGN_TOPLEFT = 0;
+const sal_Int32 AX_PICALIGN_TOPRIGHT = 1;
+const sal_Int32 AX_PICALIGN_CENTER = 2;
+const sal_Int32 AX_PICALIGN_BOTTOMLEFT = 3;
+const sal_Int32 AX_PICALIGN_BOTTOMRIGHT = 4;
+
+// ----------------------------------------------------------------------------
+
+/** Enumerates all UNO API control types supported by these filters. */
+enum ApiControlType
+{
+ API_CONTROL_BUTTON,
+ API_CONTROL_FIXEDTEXT,
+ API_CONTROL_IMAGE,
+ API_CONTROL_CHECKBOX,
+ API_CONTROL_RADIOBUTTON,
+ API_CONTROL_EDIT,
+ API_CONTROL_LISTBOX,
+ API_CONTROL_COMBOBOX,
+ API_CONTROL_SPINBUTTON,
+ API_CONTROL_SCROLLBAR,
+ API_CONTROL_PROGRESSBAR,
+ API_CONTROL_GROUPBOX,
+ API_CONTROL_DIALOG
+};
+
+// ============================================================================
+
+/** Specifies how a form control supports transparent background. */
+enum ApiTransparencyMode
+{
+ API_TRANSPARENCY_NOTSUPPORTED, /// Control does not support transparency.
+ API_TRANSPARENCY_VOID, /// Transparency is enabled by missing fill color.
+ API_TRANSPARENCY_PAINTTRANSPARENT /// Transparency is enabled by the 'PaintTransparent' property.
+};
+
+/** Specifies how a form control supports the DefaultState property. */
+enum ApiDefaultStateMode
+{
+ API_DEFAULTSTATE_BOOLEAN, /// Control does not support tri-state, state is given as boolean.
+ API_DEFAULTSTATE_SHORT, /// Control does not support tri-state, state is given as short.
+ API_DEFAULTSTATE_TRISTATE /// Control supports tri-state, state is given as short.
+};
+
+// ----------------------------------------------------------------------------
+
+/** A base class with useful helper functions for something that is able to
+ convert ActiveX and ComCtl form controls.
+ */
+class ControlConverter
+{
+public:
+ explicit ControlConverter(
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr = true );
+ virtual ~ControlConverter();
+
+ // Generic conversion -----------------------------------------------------
+
+ /** Converts the passed position in 1/100 mm to UNO properties. */
+ void convertPosition(
+ PropertyMap& rPropMap,
+ const AxPairData& rPos ) const;
+
+ /** Converts the passed size in 1/100 mm to UNO properties. */
+ void convertSize(
+ PropertyMap& rPropMap,
+ const AxPairData& rSize ) const;
+
+ /** Converts the passed encoded OLE color to UNO properties. */
+ void convertColor(
+ PropertyMap& rPropMap,
+ sal_Int32 nPropId,
+ sal_uInt32 nOleColor ) const;
+
+ /** Converts the passed StdPic picture stream to UNO properties. */
+ void convertPicture(
+ PropertyMap& rPropMap,
+ const StreamDataSequence& rPicData ) const;
+
+ /** Converts the control orientation to UNO properties. */
+ void convertOrientation(
+ PropertyMap& rPropMap,
+ bool bHorizontal ) const;
+
+ /** Converts common scrollbar settings to UNO properties. */
+ void convertScrollBar(
+ PropertyMap& rPropMap,
+ sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
+ sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const;
+
+ // ActiveX (Forms 2.0) specific conversion --------------------------------
+
+ /** Converts the Forms 2.0 background formatting to UNO properties. */
+ void convertAxBackground(
+ PropertyMap& rPropMap,
+ sal_uInt32 nBackColor,
+ sal_uInt32 nFlags,
+ ApiTransparencyMode eTranspMode ) const;
+
+ /** Converts the Forms 2.0 border formatting to UNO properties. */
+ void convertAxBorder(
+ PropertyMap& rPropMap,
+ sal_uInt32 nBorderColor,
+ sal_Int32 nBorderStyle,
+ sal_Int32 nSpecialEffect ) const;
+
+ /** Converts the Forms 2.0 special effect to UNO properties. */
+ void convertAxVisualEffect(
+ PropertyMap& rPropMap,
+ sal_Int32 nSpecialEffect ) const;
+
+ /** Converts the passed picture stream and Forms 2.0 position to UNO
+ properties. */
+ void convertAxPicture(
+ PropertyMap& rPropMap,
+ const StreamDataSequence& rPicData,
+ sal_uInt32 nPicPos ) const;
+
+ /** Converts the passed picture stream and Forms 2.0 position to UNO
+ properties. */
+ void convertAxPicture(
+ PropertyMap& rPropMap,
+ const StreamDataSequence& rPicData,
+ sal_Int32 nPicSizeMode,
+ sal_Int32 nPicAlign,
+ bool bPicTiling ) const;
+
+ /** Converts the Forms 2.0 value for checked/unchecked/dontknow to UNO
+ properties. */
+ void convertAxState(
+ PropertyMap& rPropMap,
+ const ::rtl::OUString& rValue,
+ sal_Int32 nMultiSelect,
+ ApiDefaultStateMode eDefStateMode,
+ bool bAwtModel ) const;
+
+ /** Converts the Forms 2.0 control orientation to UNO properties. */
+ void convertAxOrientation(
+ PropertyMap& rPropMap,
+ const AxPairData& rSize,
+ sal_Int32 nOrientation ) const;
+
+private:
+ const GraphicHelper& mrGraphicHelper;
+ bool mbDefaultColorBgr;
+};
// ============================================================================
-/** Base class for all models of ActiveX form controls. */
-class AxControlModelBase
+/** Base class for all models of form controls. */
+class ControlModelBase
{
public:
- virtual ~AxControlModelBase();
+ explicit ControlModelBase();
+ virtual ~ControlModelBase();
+
+ /** Sets this control model to AWT model mode. */
+ inline void setAwtModelMode() { mbAwtModel = true; }
+ /** Sets this control model to form component mode. */
+ inline void setFormComponentMode() { mbAwtModel = false; }
+
+ /** Returns the UNO service name used to construct the AWT control model,
+ or the control form component. */
+ ::rtl::OUString getServiceName() const;
/** Derived classes set specific OOXML properties at the model structure. */
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
/** Derived classes set binary data (picture, mouse icon) at the model structure. */
virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
/** Derived classes import a form control model from the passed input stream. */
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm ) = 0;
- /** Derived classes return the UNO service name used to construct the control component. */
- virtual ::rtl::OUString getServiceName() const = 0;
+ /** Derived classes return the UNO control type enum value. */
+ virtual ApiControlType getControlType() const = 0;
/** Derived classes convert all control properties. */
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+ /** Converts the control size to UNO properties. */
+ void convertSize( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
protected:
- explicit AxControlModelBase();
+ AxPairData maSize; /// Size of the control in 1/100 mm.
+ bool mbAwtModel; /// True = AWT control model, false = form component.
+};
+
+typedef ::boost::shared_ptr< ControlModelBase > ControlModelRef;
+
+// ============================================================================
+
+/** Base class for all models of ComCtl form controls. */
+class ComCtlModelBase : public ControlModelBase
+{
+public:
+ explicit ComCtlModelBase(
+ sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6, sal_uInt16 nVersion,
+ bool bCommonPart, bool bComplexPart );
+
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+protected:
+ virtual void importControlData( BinaryInputStream& rInStrm ) = 0;
+ virtual void importCommonExtraData( BinaryInputStream& rInStrm );
+ virtual void importCommonTrailingData( BinaryInputStream& rInStrm );
+
+private:
+ /** Returns the data part identifier according to the model version. */
+ sal_uInt32 getDataPartId() const;
+
+ bool readPartHeader( BinaryInputStream& rInStrm,
+ sal_uInt32 nExpPartId,
+ sal_uInt16 nExpMajor = SAL_MAX_UINT16,
+ sal_uInt16 nExpMinor = SAL_MAX_UINT16 );
+
+ bool importSizePart( BinaryInputStream& rInStrm );
+ bool importCommonPart( BinaryInputStream& rInStrm, sal_uInt32 nPartSize );
+ bool importComplexPart( BinaryInputStream& rInStrm );
+
+protected:
+ StdFontInfo maFontData; /// Font formatting.
+ StreamDataSequence maMouseIcon; /// Binary picture stream for mouse icon.
+ sal_uInt32 mnFlags; /// Common flags for ComCtl controls.
+ const sal_uInt16 mnVersion; /// Current version of the ComCtl control model.
+
+private:
+ sal_uInt32 mnDataPartId5; /// Identifier for version 5.0 control data.
+ sal_uInt32 mnDataPartId6; /// Identifier for version 6.0 control data.
+ bool mbCommonPart; /// True = the COMCTL_COMMONDATA part exists.
+ bool mbComplexPart; /// True = the COMCTL_COMPLEXDATA part exists.
+};
+
+// ============================================================================
+
+/** Model for a ComCtl scroll bar. */
+class ComCtlScrollBarModel : public ComCtlModelBase
+{
+public:
+ explicit ComCtlScrollBarModel( sal_uInt16 nVersion );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+
+protected:
+ virtual void importControlData( BinaryInputStream& rInStrm );
+
+private:
+ sal_uInt32 mnScrollBarFlags; /// Special flags for scroll bar model.
+ sal_Int32 mnLargeChange; /// Increment step size (thumb).
+ sal_Int32 mnSmallChange; /// Increment step size (buttons).
+ sal_Int32 mnMin; /// Minimum of the value range.
+ sal_Int32 mnMax; /// Maximum of the value range.
+ sal_Int32 mnPosition; /// Value of the spin button.
+};
+
+// ============================================================================
+
+/** Model for a ComCtl progress bar. */
+class ComCtlProgressBarModel : public ComCtlModelBase
+{
+public:
+ explicit ComCtlProgressBarModel( sal_uInt16 nVersion );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
protected:
- sal_Int32 mnWidth;
- sal_Int32 mnHeight;
+ virtual void importControlData( BinaryInputStream& rInStrm );
+
+private:
+ float mfMin; /// Minimum of the value range.
+ float mfMax; /// Maximum of the value range.
+ sal_uInt16 mnVertical; /// 0 = horizontal, 1 = vertical.
+ sal_uInt16 mnSmooth; /// 0 = progress blocks, 1 = pixel resolution.
};
// ============================================================================
+/** Base class for all models of Form 2.0 form controls. */
+class AxControlModelBase : public ControlModelBase
+{
+public:
+ explicit AxControlModelBase();
+
+ virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
+};
+
+// ============================================================================
+
+/** Base class for Forms 2.0 controls supporting text formatting. */
class AxFontDataModel : public AxControlModelBase
{
public:
- explicit AxFontDataModel();
+ explicit AxFontDataModel( bool bSupportsAlign = true );
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
- ::rtl::OUString maFontName; /// Name of the used font.
- sal_uInt32 mnFontEffects; /// Font effect flags.
- sal_Int32 mnFontHeight; /// Height of the font (not really twips, see code).
- sal_Int32 mnFontCharSet; /// Windows character set of the font.
- sal_Int32 mnHorAlign; /// Horizontal text alignment.
+ /** Returns the font height in points. */
+ inline sal_Int16 getFontHeight() const { return maFontData.getHeightPoints(); }
+
+protected:
+ AxFontData maFontData; /// The font settings.
+ bool mbSupportsAlign; /// True = UNO model supports Align property.
};
// ============================================================================
+/** Model for a Forms 2.0 command button. */
class AxCommandButtonModel : public AxFontDataModel
{
public:
explicit AxCommandButtonModel();
- virtual ::rtl::OUString getServiceName() const;
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
private:
StreamDataSequence maPictureData; /// Binary picture stream.
@@ -117,15 +424,17 @@ private:
// ============================================================================
+/** Model for a Forms 2.0 label. */
class AxLabelModel : public AxFontDataModel
{
public:
explicit AxLabelModel();
- virtual ::rtl::OUString getServiceName() const;
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
private:
::rtl::OUString maCaption; /// Visible caption of the button.
@@ -139,16 +448,18 @@ private:
// ============================================================================
+/** Model for a Forms 2.0 image. */
class AxImageModel : public AxControlModelBase
{
public:
explicit AxImageModel();
- virtual ::rtl::OUString getServiceName() const;
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
private:
StreamDataSequence maPictureData; /// Binary picture stream.
@@ -164,15 +475,16 @@ private:
// ============================================================================
-class AxMorphDataModel : public AxFontDataModel
+/** Base class for a Forms 2.0 morph data control. */
+class AxMorphDataModelBase : public AxFontDataModel
{
public:
- explicit AxMorphDataModel();
+ explicit AxMorphDataModelBase();
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
virtual void importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm );
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
protected:
StreamDataSequence maPictureData; /// Binary picture stream.
@@ -198,81 +510,92 @@ protected:
// ============================================================================
-class AxToggleButtonModel : public AxMorphDataModel
+/** Model for a Forms 2.0 toggle button. */
+class AxToggleButtonModel : public AxMorphDataModelBase
{
public:
explicit AxToggleButtonModel();
- virtual ::rtl::OUString getServiceName() const;
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
};
// ============================================================================
-class AxCheckBoxModel : public AxMorphDataModel
+/** Model for a Forms 2.0 check box. */
+class AxCheckBoxModel : public AxMorphDataModelBase
{
public:
explicit AxCheckBoxModel();
- virtual ::rtl::OUString getServiceName() const;
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
};
// ============================================================================
-class AxOptionButtonModel : public AxMorphDataModel
+/** Model for a Forms 2.0 option button. */
+class AxOptionButtonModel : public AxMorphDataModelBase
{
public:
explicit AxOptionButtonModel();
- virtual ::rtl::OUString getServiceName() const;
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ /** Returns the group name used to goup several option buttons gogether. */
+ inline const ::rtl::OUString& getGroupName() const { return maGroupName; }
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
};
// ============================================================================
-class AxTextBoxModel : public AxMorphDataModel
+/** Model for a Forms 2.0 text box. */
+class AxTextBoxModel : public AxMorphDataModelBase
{
public:
explicit AxTextBoxModel();
- virtual ::rtl::OUString getServiceName() const;
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
};
// ============================================================================
-class AxListBoxModel : public AxMorphDataModel
+/** Model for a Forms 2.0 list box. */
+class AxListBoxModel : public AxMorphDataModelBase
{
public:
explicit AxListBoxModel();
- virtual ::rtl::OUString getServiceName() const;
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
};
// ============================================================================
-class AxComboBoxModel : public AxMorphDataModel
+/** Model for a Forms 2.0 combo box. */
+class AxComboBoxModel : public AxMorphDataModelBase
{
public:
explicit AxComboBoxModel();
- virtual ::rtl::OUString getServiceName() const;
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
};
// ============================================================================
+/** Model for a Forms 2.0 spin button. */
class AxSpinButtonModel : public AxControlModelBase
{
public:
explicit AxSpinButtonModel();
- virtual ::rtl::OUString getServiceName() const;
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
private:
sal_uInt32 mnArrowColor; /// Button arrow color.
@@ -288,15 +611,17 @@ private:
// ============================================================================
+/** Model for a Forms 2.0 scroll bar. */
class AxScrollBarModel : public AxControlModelBase
{
public:
explicit AxScrollBarModel();
- virtual ::rtl::OUString getServiceName() const;
virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
- virtual void importBinaryModel( BinaryInputStream& rInStrm );
- virtual void convertProperties( AxControlHelper& rHelper, PropertyMap& rPropMap ) const;
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
private:
sal_uInt32 mnArrowColor; /// Button arrow color.
@@ -314,39 +639,130 @@ private:
// ============================================================================
-/** Container for all ActiveX form control model implementations. */
-class AxControl
+typedef ::std::vector< ::rtl::OUString > AxClassTable;
+
+/** Base class for ActiveX container controls. */
+class AxContainerModelBase : public AxFontDataModel
{
public:
- explicit AxControl( const ::rtl::OUString& rName );
- ~AxControl();
+ explicit AxContainerModelBase();
+
+ /** Allows to set single properties specified by XML token identifier. */
+ virtual void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
+ /** Reads the leading structure in the 'f' stream containing the model for
+ this control. */
+ virtual bool importBinaryModel( BinaryInputStream& rInStrm );
+ /** Reads the class table structure for embedded controls following the own
+ model from the 'f' stream. */
+ bool importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable );
+
+protected:
+ StreamDataSequence maPictureData; /// Binary picture stream.
+ ::rtl::OUString maCaption; /// Visible caption of the form.
+ AxPairData maLogicalSize; /// Logical form size (scroll area).
+ AxPairData maScrollPos; /// Scroll position.
+ sal_uInt32 mnBackColor; /// Fill color.
+ sal_uInt32 mnTextColor; /// Text color.
+ sal_uInt32 mnFlags; /// Various flags.
+ sal_uInt32 mnBorderColor; /// Flat border color.
+ sal_Int32 mnBorderStyle; /// Flat border style.
+ sal_Int32 mnScrollBars; /// Horizontal/vertical scroll bar.
+ sal_Int32 mnCycleType; /// Cycle in all forms or in this form.
+ sal_Int32 mnSpecialEffect; /// 3D border effect.
+ sal_Int32 mnPicAlign; /// Anchor position of the picture.
+ sal_Int32 mnPicSizeMode; /// Clip, stretch, zoom.
+ bool mbPicTiling; /// True = picture is repeated.
+};
+
+typedef ::boost::shared_ptr< AxContainerModelBase > AxContainerModelRef;
+
+// ============================================================================
+
+/** Model for a Forms 2.0 frame (group box). */
+class AxFrameModel : public AxContainerModelBase
+{
+public:
+ explicit AxFrameModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+// ============================================================================
+
+/** Model for a Forms 2.0 user form. */
+class AxUserFormModel : public AxContainerModelBase
+{
+public:
+ explicit AxUserFormModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+// ============================================================================
+
+/** A form control embedded in a document draw page. Contains a specific model
+ structure according to the type of the control. */
+class EmbeddedControl
+{
+public:
+ explicit EmbeddedControl( const ::rtl::OUString& rName );
+ ~EmbeddedControl();
/** Creates and returns the internal control model according to the passed
MS class identifier. */
- AxControlModelBase* createModel( const ::rtl::OUString& rClassId );
- /** Imports a form control model from the passed input stream. */
- void importBinaryModel( BinaryInputStream& rInStrm );
+ ControlModelRef createModel( const ::rtl::OUString& rClassId );
- /** Returns the internal control model. */
- inline const AxControlModelBase* getModel() const { return mxModel.get(); }
- /** Returns the MS class identifier used to create the internal control model. */
- inline const ::rtl::OUString& getClassId() const { return maClassId; }
+ /** Returns true, if the internal control model exists. */
+ inline bool hasModel() const { return mxModel.get() != 0; }
+ /** Returns the UNO service name needed to construct the control model. */
+ ::rtl::OUString getServiceName() const;
- /** Creates and returns the UNO form component object for this control and
- inserts it into the form wrapped by the passed helper. */
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
- convertAndInsert( AxControlHelper& rHelper ) const;
+ /** Converts all control properties and inserts them into the passed model. */
+ bool convertProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const ControlConverter& rConv ) const;
private:
- ::std::auto_ptr< AxControlModelBase > mxModel;
- ::rtl::OUString maClassId; /// Class identifier of the control model.
+ ControlModelRef mxModel; /// Control model containing the properties.
::rtl::OUString maName; /// Name of the control.
};
// ============================================================================
+/** A wrapper for a control form embedded directly in a draw page. */
+class EmbeddedForm : public ControlConverter
+{
+public:
+ explicit EmbeddedForm(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr = true );
+
+ /** Converts the passed ActiveX control and inserts it into the form.
+ @return The API control model, if conversion was successful. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
+ convertAndInsert( const EmbeddedControl& rControl );
+
+private:
+ /** Tries to insert the passed control model into the form. */
+ bool insertControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel );
+
+ /** Creates the form that will hold the form controls. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
+ createForm();
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxModelFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormsSupplier > mxFormsSupp;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxFormIC;
+};
+
+// ============================================================================
+
} // namespace ole
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/axcontrolfragment.hxx b/oox/inc/oox/ole/axcontrolfragment.hxx
index 9bccbd11a0de..3c9aed61bd3e 100644
--- a/oox/inc/oox/ole/axcontrolfragment.hxx
+++ b/oox/inc/oox/ole/axcontrolfragment.hxx
@@ -33,8 +33,8 @@
namespace oox {
namespace ole {
-class AxControl;
-class AxControlModelBase;
+class ControlModelBase;
+class EmbeddedControl;
// ============================================================================
@@ -44,32 +44,32 @@ class AxControlPropertyContext : public ::oox::core::ContextHandler2
public:
explicit AxControlPropertyContext(
::oox::core::FragmentHandler2& rFragment,
- AxControlModelBase& rModel );
+ ControlModelBase& rModel );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
private:
- AxControlModelBase& mrModel;
+ ControlModelBase& mrModel;
sal_Int32 mnPropId; /// Identifier of currently processed property.
};
// ============================================================================
-/** Fragment handler for an ActiveX form control fragment. */
+/** Fragment handler for an embedded ActiveX form control fragment. */
class AxControlFragment : public ::oox::core::FragmentHandler2
{
public:
explicit AxControlFragment(
::oox::core::XmlFilterBase& rFilter,
const ::rtl::OUString& rFragmentPath,
- AxControl& rControl );
+ EmbeddedControl& rControl );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
private:
- AxControl& mrControl;
+ EmbeddedControl& mrControl;
};
// ============================================================================
diff --git a/oox/inc/oox/ole/axcontrolhelper.hxx b/oox/inc/oox/ole/axcontrolhelper.hxx
deleted file mode 100644
index d34cf45f3654..000000000000
--- a/oox/inc/oox/ole/axcontrolhelper.hxx
+++ /dev/null
@@ -1,118 +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 OOX_OLE_AXCONTROLHELPER_HXX
-#define OOX_OLE_AXCONTROLHELPER_HXX
-
-#include <com/sun/star/uno/Reference.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace graphic { class XGraphic; }
- namespace drawing { class XDrawPage; }
- namespace form { class XForm; }
-} } }
-
-namespace oox { namespace core { class FilterBase; } }
-
-namespace oox {
-namespace ole {
-
-// ============================================================================
-
-const sal_uInt32 AX_SYSCOLOR_WINDOWBACK = 0x80000005;
-const sal_uInt32 AX_SYSCOLOR_WINDOWFRAME = 0x80000006;
-const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT = 0x80000008;
-const sal_uInt32 AX_SYSCOLOR_BUTTONFACE = 0x8000000F;
-const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT = 0x80000012;
-
-// ============================================================================
-
-enum AxDefaultColorMode
-{
- AX_DEFAULTCOLORMODE_BGR, /// OLE default color type is interpreted as BGR color.
- AX_DEFAULTCOLORMODE_PALETTE /// OLE default color type is interpreted as palette color.
-};
-
-// ============================================================================
-
-/** Helper functions and callbacks for ActiveX form control filters. */
-class AxControlHelper
-{
-public:
- explicit AxControlHelper(
- const ::oox::core::FilterBase& rFilter,
- AxDefaultColorMode eColorMode = AX_DEFAULTCOLORMODE_BGR );
- virtual ~AxControlHelper();
-
- /** Returns the filter object that imports/exports the form controls. */
- inline const ::oox::core::FilterBase& getFilter() const { return mrFilter; }
- /** Returns the UNO form used to insert the control models. */
- ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
- getControlForm() const;
- /** Returns the UNO RGB color from the passed encoded OLE color. */
- sal_Int32 convertColor( sal_uInt32 nAxColor ) const;
-
-protected:
- /** Derived classes returns the UNO form of the current context. Called exactly once. */
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
- createControlForm() const = 0;
-
-private:
- const ::oox::core::FilterBase& mrFilter;
- const AxDefaultColorMode meColorMode;
- mutable ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > mxForm;
- mutable bool mbHasFormQuerried;
-};
-
-// ============================================================================
-
-/** Helper functions and callbacks for ActiveX form controls embedded in a
- document. */
-class AxEmbeddedControlHelper : public AxControlHelper
-{
-public:
- explicit AxEmbeddedControlHelper(
- const ::oox::core::FilterBase& rFilter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
- AxDefaultColorMode eColorMode = AX_DEFAULTCOLORMODE_BGR );
-
-protected:
- /** Creates and returns the standard UNO form in the wrapped draw page. */
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
- createControlForm() const;
-
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxDrawPage;
-};
-
-// ============================================================================
-
-} // namespace ole
-} // namespace oox
-
-#endif
-
diff --git a/oox/inc/oox/ole/olehelper.hxx b/oox/inc/oox/ole/olehelper.hxx
index 91ca73a38a67..ba46d3baf6df 100644
--- a/oox/inc/oox/ole/olehelper.hxx
+++ b/oox/inc/oox/ole/olehelper.hxx
@@ -31,13 +31,49 @@
#include <rtl/ustring.hxx>
#include "oox/helper/binarystreambase.hxx"
-namespace oox { class BinaryInputStream; }
+namespace oox {
+ class BinaryInputStream;
+ class GraphicHelper;
+}
namespace oox {
namespace ole {
// ============================================================================
+const sal_Char* const OLE_GUID_STDFONT = "{0BE35203-8F91-11CE-9DE3-00AA004BB851}";
+const sal_Char* const OLE_GUID_STDPIC = "{0BE35204-8F91-11CE-9DE3-00AA004BB851}";
+const sal_Char* const OLE_GUID_STDHLINK = "{79EAC9D0-BAF9-11CE-8C82-00AA004BA90B}";
+
+// ============================================================================
+
+const sal_uInt16 OLE_STDFONT_NORMAL = 400;
+const sal_uInt16 OLE_STDFONT_BOLD = 700;
+
+const sal_uInt8 OLE_STDFONT_ITALIC = 0x02;
+const sal_uInt8 OLE_STDFONT_UNDERLINE = 0x04;
+const sal_uInt8 OLE_STDFONT_STRIKE = 0x08;
+
+/** Stores data about a StdFont font structure. */
+struct StdFontInfo
+{
+ ::rtl::OUString maName; /// Font name.
+ sal_uInt32 mnHeight; /// Font height (1/10,000 points).
+ sal_uInt16 mnWeight; /// Font weight (normal/bold).
+ sal_uInt16 mnCharSet; /// Font charset.
+ sal_uInt8 mnFlags; /// Font flags.
+
+ explicit StdFontInfo();
+ explicit StdFontInfo(
+ const ::rtl::OUString& rName,
+ sal_uInt32 nHeight,
+ sal_uInt16 nWeight = OLE_STDFONT_NORMAL,
+ sal_uInt16 nCharSet = WINDOWS_CHARSET_ANSI,
+ sal_uInt8 nFlags = 0 );
+};
+
+// ============================================================================
+
/** Stores data about a StdHlink hyperlink. */
struct StdHlinkInfo
{
@@ -53,14 +89,45 @@ struct StdHlinkInfo
class OleHelper
{
public:
- /** Imports a GUID from the passed binary stream and returns its string representation. */
+ /** Returns the UNO RGB color from the passed encoded OLE color.
+
+ @param bDefaultColorBgr
+ True = OLE default color type is treated as BGR color.
+ False = OLE default color type is treated as palette color.
+ */
+ static sal_Int32 decodeOleColor(
+ const GraphicHelper& rGraphicHelper,
+ sal_uInt32 nOleColor,
+ bool bDefaultColorBgr = true );
+
+ /** Imports a GUID from the passed binary stream and returns its string
+ representation (in uppercase characters).
+ */
static ::rtl::OUString importGuid( BinaryInputStream& rInStrm );
- /** Imports an OLE StdPic picture from the current position of the passed binary stream. */
- static bool importStdPic( StreamDataSequence& orGraphicData, BinaryInputStream& rInStrm, bool bWithGuid );
+ /** Imports an OLE StdFont font structure from the current position of the
+ passed binary stream.
+ */
+ static bool importStdFont(
+ StdFontInfo& orFontInfo,
+ BinaryInputStream& rInStrm,
+ bool bWithGuid );
+
+ /** Imports an OLE StdPic picture from the current position of the passed
+ binary stream.
+ */
+ static bool importStdPic(
+ StreamDataSequence& orGraphicData,
+ BinaryInputStream& rInStrm,
+ bool bWithGuid );
- /** Imports an OLE StdHlink from the current position of the passed binary stream. */
- static bool importStdHlink( StdHlinkInfo& orHlinkInfo, BinaryInputStream& rInStrm, rtl_TextEncoding eTextEnc, bool bWithGuid );
+ /** Imports an OLE StdHlink from the current position of the passed binary
+ stream.
+ */
+ static bool importStdHlink(
+ StdHlinkInfo& orHlinkInfo,
+ BinaryInputStream& rInStrm,
+ bool bWithGuid );
private:
OleHelper(); // not implemented
diff --git a/oox/inc/oox/helper/olestorage.hxx b/oox/inc/oox/ole/olestorage.hxx
index a8174a167729..a84fadfadc92 100644..100755
--- a/oox/inc/oox/helper/olestorage.hxx
+++ b/oox/inc/oox/ole/olestorage.hxx
@@ -25,18 +25,18 @@
*
************************************************************************/
-#ifndef OOX_HELPER_OLESTORAGE_HXX
-#define OOX_HELPER_OLESTORAGE_HXX
+#ifndef OOX_OLE_OLESTORAGE_HXX
+#define OOX_OLE_OLESTORAGE_HXX
#include "oox/helper/storagebase.hxx"
namespace com { namespace sun { namespace star {
namespace lang { class XMultiServiceFactory; }
namespace container { class XNameContainer; }
- namespace container { class XNameAccess; }
} } }
namespace oox {
+namespace ole {
// ============================================================================
@@ -51,7 +51,7 @@ public:
explicit OleStorage(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxStream,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
bool bBaseStreamAccess );
virtual ~OleStorage();
@@ -59,9 +59,19 @@ public:
private:
explicit OleStorage(
const OleStorage& rParentStorage,
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& rxElementsAccess,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxStorage,
+ const ::rtl::OUString& rElementName,
+ bool bReadOnly );
+ explicit OleStorage(
+ const OleStorage& rParentStorage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
const ::rtl::OUString& rElementName );
+ /** Initializes the API storage object for input. */
+ void initStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream );
+ /** Initializes the API storage object for input/output. */
+ void initStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream );
+
/** Returns true, if the object represents a valid storage. */
virtual bool implIsStorage() const;
@@ -77,7 +87,7 @@ private:
virtual void implGetElementNames( ::std::vector< ::rtl::OUString >& orElementNames ) const;
/** Opens and returns the specified sub storage from the storage. */
- virtual StorageRef implOpenSubStorage( const ::rtl::OUString& rElementName, bool bCreate );
+ virtual StorageRef implOpenSubStorage( const ::rtl::OUString& rElementName, bool bCreateMissing );
/** Opens and returns the specified input stream from the storage. */
virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
@@ -87,17 +97,20 @@ private:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
implOpenOutputStream( const ::rtl::OUString& rElementName );
-private:
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > XNameContainerRef;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > XNameAccessRef;
+ /** Commits the current storage. */
+ virtual void implCommit() const;
- XNameContainerRef mxStorage; /// Complete storage based on input or output stream.
- XNameAccessRef mxElements; /// Access to elements of current sub storage.
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ mxFactory; /// Factory for storage/stream creation.
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxStorage; /// Access to elements of this sub storage.
+ const OleStorage* mpParentStorage; /// Parent OLE storage that contains this storage.
};
// ============================================================================
+} // namespace ole
} // namespace oox
#endif
-
diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx
new file mode 100755
index 000000000000..ec1c25be6952
--- /dev/null
+++ b/oox/inc/oox/ole/vbacontrol.hxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_OLE_VBACONTROL_HXX
+#define OOX_OLE_VBACONTROL_HXX
+
+#include "oox/ole/axcontrol.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XNameContainer; }
+} } }
+
+namespace oox { class StorageBase; }
+
+namespace oox {
+namespace ole {
+
+class VbaFormControl;
+
+// ============================================================================
+
+/** Common properties for all controls that are part of a VBA user form or of
+ another container control in a VBA user form. */
+class VbaSiteModel
+{
+public:
+ explicit VbaSiteModel();
+ virtual ~VbaSiteModel();
+
+ /** Allows to set single properties specified by XML token identifier. */
+ void importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
+ /** Imports the site model data from the passed input stream. */
+ bool importBinaryModel( BinaryInputStream& rInStrm );
+ /** Moves the control relative to its current position by the passed distance. */
+ void moveRelative( const AxPairData& rDistance );
+
+ /** Returns the programmatical name of the control. */
+ inline const ::rtl::OUString& getName() const { return maName; }
+ /** Returns the position of the control in its parent. */
+ inline const AxPairData& getPosition() const { return maPos; }
+ /** Returns true, if this control is a container control. */
+ bool isContainer() const;
+ /** Returns the length of the stream data for stream based controls. */
+ sal_uInt32 getStreamLength() const;
+ /** Returns the name of the substorage for the container control data. */
+ ::rtl::OUString getSubStorageName() const;
+ /** Returns the tab index of the control. */
+ inline sal_Int16 getTabIndex() const { return mnTabIndex; }
+
+ /** Tries to create the control model according to the site model. */
+ ControlModelRef createControlModel( const AxClassTable& rClassTable ) const;
+ /** Converts all form site properties. */
+ void convertProperties(
+ PropertyMap& rPropMap,
+ const ControlConverter& rConv,
+ ApiControlType eCtrlType,
+ sal_Int32 nCtrlIndex ) const;
+
+protected:
+ ::rtl::OUString maName; /// Name of the control.
+ ::rtl::OUString maTag; /// User defined tag.
+ ::rtl::OUString maToolTip; /// Tool tip for the control.
+ ::rtl::OUString maLinkedCell; /// Linked cell for the control value in a spreadsheet.
+ ::rtl::OUString maSourceRange; /// Source data for the control in a spreadsheet.
+ AxPairData maPos; /// Position in parent container.
+ sal_Int32 mnId; /// Control identifier.
+ sal_Int32 mnHelpContextId; /// Help context identifier.
+ sal_uInt32 mnFlags; /// Various flags.
+ sal_uInt32 mnStreamLen; /// Size of control stream data.
+ sal_Int16 mnTabIndex; /// Tab order index.
+ sal_uInt16 mnClassIdOrCache; /// Class name identifier or GUID cache index.
+ sal_uInt16 mnGroupId; /// Group identifier for grouped controls.
+};
+
+typedef ::boost::shared_ptr< VbaSiteModel > VbaSiteModelRef;
+
+// ============================================================================
+
+/** A control that is embedded in a VBA user form or in another container
+ control in a VBA user form.
+
+ The control may be a 'simple' control with its data stored in the 'o'
+ stream, or it may be a container control with its data stored in an own
+ substorage.
+ */
+class VbaFormControl
+{
+public:
+ explicit VbaFormControl();
+ virtual ~VbaFormControl();
+
+ /** Imports the model from the passed stream or storage, depending on the
+ control's type. Imports all embedded controls, if this is a container. */
+ void importModelOrStorage(
+ BinaryInputStream& rInStrm,
+ StorageBase& rStrg,
+ const AxClassTable& rClassTable );
+
+ /** Returns the programmatical name of the control. */
+ ::rtl::OUString getControlName() const;
+
+ /** Creates the UNO control model, inserts it into the passed container,
+ and converts all control properties. */
+ void createAndConvert(
+ sal_Int32 nCtrlIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxParentNC,
+ const ControlConverter& rConv ) const;
+
+protected:
+ /** Creates and imports the control model containing properties of the control. */
+ void importControlModel( BinaryInputStream& rInStrm, const AxClassTable& rClassTable );
+ /** Creates and imports the control model, and imports all embedded
+ controls from the passed substorage. */
+ void importStorage( StorageBase& rStrg, const AxClassTable& rClassTable );
+
+ /** Converts all control properties, and inserts and converts embedded controls. */
+ bool convertProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+ const ControlConverter& rConv,
+ sal_Int32 nCtrlIndex ) const;
+
+private:
+ typedef RefVector< VbaFormControl > VbaFormControlVector;
+ typedef VbaFormControlVector::value_type VbaFormControlRef;
+
+ /** Creates the control model according to the current site model. */
+ void createControlModel( const AxClassTable& rClassTable );
+ /** Imports the site model data containing common properties of the control. */
+ bool importSiteModel( BinaryInputStream& rInStrm );
+
+ /** Imports the site models of all embedded controls from the 'f' stream. */
+ bool importEmbeddedSiteModels( BinaryInputStream& rInStrm );
+ /* Final processing of all embedded controls after import. */
+ void finalizeEmbeddedControls();
+
+ /** Moves the control relative to its current position by the passed distance. */
+ void moveRelative( const AxPairData& rDistance );
+ /** Moves all embedded controls from their relative position in this
+ control to an absolute position in the parent of this control. */
+ void moveEmbeddedToAbsoluteParent();
+
+ /** Functor for comparing controls by their tab index. */
+ static bool compareByTabIndex( const VbaFormControlRef& rxLeft, const VbaFormControlRef& rxRight );
+
+protected:
+ VbaSiteModelRef mxSiteModel; /// Common control properties.
+ ControlModelRef mxCtrlModel; /// Specific control properties.
+
+private:
+ VbaFormControlVector maControls; /// All embedded form controls.
+ AxClassTable maClassTable; /// Class identifiers for exotic embedded controls.
+};
+
+// ============================================================================
+
+class VbaUserForm : public VbaFormControl, public ControlConverter
+{
+public:
+ explicit VbaUserForm(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const GraphicHelper& rGraphicHelper,
+ bool bDefaultColorBgr = true );
+
+ /** Imports the form and its embedded controls, and inserts the form with
+ all its controls into the passed dialog library. */
+ void importForm(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxDialogLib,
+ StorageBase& rVbaFormStrg,
+ const ::rtl::OUString& rModuleName,
+ rtl_TextEncoding eTextEnc );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxGlobalFactory;
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/ole/vbahelper.hxx b/oox/inc/oox/ole/vbahelper.hxx
new file mode 100755
index 000000000000..76dc1c736025
--- /dev/null
+++ b/oox/inc/oox/ole/vbahelper.hxx
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_OLE_VBAHELPER_HXX
+#define OOX_OLE_VBAHELPER_HXX
+
+#include "oox/helper/binarystreambase.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace container { class XNameContainer; }
+ namespace document { class XEventsSupplier; }
+} } }
+
+namespace oox { class BinaryInputStream; }
+
+namespace oox {
+namespace ole {
+
+// Directory stream record identifiers ========================================
+
+const sal_uInt16 VBA_ID_MODULECOOKIE = 0x002C;
+const sal_uInt16 VBA_ID_MODULEDOCSTRING = 0x001C;
+const sal_uInt16 VBA_ID_MODULEDOCSTRINGUNICODE = 0x0048;
+const sal_uInt16 VBA_ID_MODULEEND = 0x002B;
+const sal_uInt16 VBA_ID_MODULEHELPCONTEXT = 0x001E;
+const sal_uInt16 VBA_ID_MODULENAME = 0x0019;
+const sal_uInt16 VBA_ID_MODULENAMEUNICODE = 0x0047;
+const sal_uInt16 VBA_ID_MODULEOFFSET = 0x0031;
+const sal_uInt16 VBA_ID_MODULEPRIVATE = 0x0028;
+const sal_uInt16 VBA_ID_MODULEREADONLY = 0x0025;
+const sal_uInt16 VBA_ID_MODULESTREAMNAME = 0x001A;
+const sal_uInt16 VBA_ID_MODULESTREAMNAMEUNICODE = 0x0032;
+const sal_uInt16 VBA_ID_MODULETYPEDOCUMENT = 0x0022;
+const sal_uInt16 VBA_ID_MODULETYPEPROCEDURAL = 0x0021;
+const sal_uInt16 VBA_ID_PROJECTCODEPAGE = 0x0003;
+const sal_uInt16 VBA_ID_PROJECTEND = 0x0010;
+const sal_uInt16 VBA_ID_PROJECTMODULES = 0x000F;
+const sal_uInt16 VBA_ID_PROJECTVERSION = 0x0009;
+
+// ============================================================================
+
+/** Static helper functions for the VBA filters. */
+class VbaHelper
+{
+public:
+ /** Returns the full Basic script URL from a VBA module and macro name.
+ The script is assumed to be in a document library. */
+ static ::rtl::OUString getBasicScriptUrl(
+ const ::rtl::OUString& rLibraryName,
+ const ::rtl::OUString& rModuleName,
+ const ::rtl::OUString& rMacroName );
+
+ /** Reads the next record from the VBA directory stream 'dir'.
+
+ @param rnRecId (out parameter) The record identifier of the new record.
+ @param rRecData (out parameter) The contents of the new record.
+ @param rInStrm The 'dir' stream.
+
+ @return True = next record successfully read. False on any error, or
+ if the stream is EOF.
+ */
+ static bool readDirRecord(
+ sal_uInt16& rnRecId,
+ StreamDataSequence& rRecData,
+ BinaryInputStream& rInStrm );
+
+ /** Extracts a key/value pair from a string separated by an equality sign.
+
+ @param rKey (out parameter) The key before the separator.
+ @param rValue (out parameter) The value following the separator.
+ @param rCodeLine The source key/value pair.
+
+ @return True = Equality sign separator found, and the returned key and
+ value are not empty. False otherwise.
+ */
+ static bool extractKeyValue(
+ ::rtl::OUString& rKey,
+ ::rtl::OUString& rValue,
+ const ::rtl::OUString& rKeyValue );
+
+ /** Removes whitespace characters from the beginning of the passed string.
+
+ @param rCodeLine (in/out parameter) The string to be modified.
+
+ @return True = at least one whitespace character found and removed
+ from rCodeLine. False = rCodeLine is empty or does not start with
+ a whitespace character.
+ */
+ static bool eatWhitespace( ::rtl::OUString& rCodeLine );
+
+ /** Removes the passed keyword from the beginning of the passed string.
+
+ @param rCodeLine (in/out parameter) The string to be modified.
+
+ @param rKeyword The keyword to be removed from the beginning of the
+ rCodeLine string.
+
+ @return True = rCodeLine starts with the passed keyword (case
+ insensitive), and is followed by whitespace characters, or it ends
+ right after the keyword. The keyword and the following whitespace
+ characters have been removed from rCodeLine. False = rCodeLine is
+ empty or does not start with the specified keyword, or the keyword
+ is not followed by whitespace characters.
+ */
+ static bool eatKeyword( ::rtl::OUString& rCodeLine, const ::rtl::OUString& rKeyword );
+
+ /** Returns the VBA source code of the specified module, or an empty
+ string, if the module does not exist.
+
+ @param rxBasicLib The container for all VBA code modules.
+ @param rModuleName The name of the VBA code module.
+ */
+ static ::rtl::OUString getSourceCode(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib,
+ const ::rtl::OUString& rModuleName );
+
+ /** Checks, if a macro with the specified name exists in the passed VBA
+ source code.
+
+ @param rSourceCode The VBA source code.
+ @param rMacroName The name of the macro.
+ */
+ static bool hasMacro(
+ const ::rtl::OUString& rSourceCode,
+ const ::rtl::OUString& rMacroName );
+
+ /** Checks, if a macro with the specified name exists in the specified
+ module.
+
+ @param rxBasicLib The container for all VBA code modules.
+ @param rModuleName The name of the VBA module to check for the macro.
+ @param rMacroName The name of the macro.
+ */
+ static bool hasMacro(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib,
+ const ::rtl::OUString& rModuleName,
+ const ::rtl::OUString& rMacroName );
+
+ /** Tries to insert a VBA macro into the specified code module.
+
+ @descr If the specified macro does not exist, it will be generated as
+ following, using the passed parameters. If the parameter rMacroType
+ is left empty, a sub procedure macro will be generated:
+
+ Private Sub <rMacroName> ( <rMacroArgs> )
+ <rMacroCode>
+ End Sub
+
+ If the parameter rMacroType is not empty, a function macro
+ will be generated. Note that the parameter rMacroCode has to
+ provide the code that returns the function value.
+
+ Private Function <rMacroName> ( <rMacroArgs> ) As <rMacroType>
+ <rMacroCode>
+ End Function
+
+ The source code in rMacroCode may contain a special placeholder
+ $MACRO that will be replaced by the macro name passed in rMacroName
+ before the macro will be inserted into the module.
+
+ @param rModuleName The name of the VBA module to be used.
+ @param rMacroName The name of the VBA macro to be inserted.
+ @param rMacroArgs The argument list of the VBA macro.
+ @param rMacroType Macro return type (empty for sub procedure).
+ @param rMacroCode The VBA source code for the macro.
+
+ @return True, if the specified VBA macro has been inserted. False, if
+ there already exists a macro with the specified name, or if any
+ error has occurred, for example, Office configuration forbids to
+ generate executable VBA code or the specified module does not
+ exist.
+ */
+ static bool insertMacro(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxBasicLib,
+ const ::rtl::OUString& rModuleName,
+ const ::rtl::OUString& rMacroName,
+ const ::rtl::OUString& rMacroArgs,
+ const ::rtl::OUString& rMacroType,
+ const ::rtl::OUString& rMacroCode );
+
+ /** Tries to attach a VBA macro to an event of the passed events supplier.
+
+ @descr The function checks if the specified macro exists and attaches
+ it to the event of the passed events supplier.
+
+ @param rxEventsSupp The events supplier for the event to be attached.
+ @param rEventName The event name used in the office API.
+ @param rLibraryName The name of the Basic library containing the macro.
+ @param rModuleName The name of the VBA module containing the macro.
+ @param rMacroName The name of the VBA macro to attach to the event.
+ */
+ static bool attachMacroToEvent(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventsSupplier >& rxEventsSupp,
+ const ::rtl::OUString& rEventName,
+ const ::rtl::OUString& rLibraryName,
+ const ::rtl::OUString& rModuleName,
+ const ::rtl::OUString& rMacroName );
+
+private:
+ VbaHelper();
+ ~VbaHelper();
+};
+
+// ============================================================================
+
+} // namespace ole
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/ole/vbamodule.hxx b/oox/inc/oox/ole/vbamodule.hxx
new file mode 100755
index 000000000000..3b529ceee129
--- /dev/null
+++ b/oox/inc/oox/ole/vbamodule.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_OLE_VBAMODULE_HXX
+#define OOX_OLE_VBAMODULE_HXX
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+
+namespace com { namespace sun { namespace star {