Conflicts: avmedia/inc/avmedia/mediaitem.hxx avmedia/prj/build.lst avmedia/source/framework/mediaitem.cxx avmedia/source/gstreamer/gstcommon.hxx avmedia/source/gstreamer/gstframegrabber.cxx avmedia/source/gstreamer/gstframegrabber.hxx avmedia/source/gstreamer/gstmanager.cxx avmedia/source/gstreamer/gstmanager.hxx avmedia/source/gstreamer/gstplayer.cxx avmedia/source/gstreamer/gstplayer.hxx avmedia/source/gstreamer/gstuno.cxx avmedia/source/gstreamer/gstwindow.cxx avmedia/source/gstreamer/gstwindow.hxx avmedia/source/gstreamer/makefile.mk avmedia/source/quicktime/quicktimeuno.cxx avmedia/source/viewer/mediawindow.cxx avmedia/source/viewer/mediawindow_impl.cxx avmedia/source/viewer/mediawindow_impl.hxx avmedia/source/viewer/mediawindowbase_impl.cxx avmedia/source/win/winuno.cxx basic/inc/basic/basmgr.hxx basic/inc/basic/mybasic.hxx basic/inc/basic/process.hxx basic/inc/basic/sbmeth.hxx basic/inc/basic/sbmod.hxx basic/inc/basic/sbxdef.hxx basic/inc/basic/sbxvar.hxx basic/source/app/app.cxx basic/source/app/app.hxx basic/source/app/appbased.cxx basic/source/app/appedit.cxx basic/source/app/appwin.cxx basic/source/app/appwin.hxx basic/source/app/brkpnts.cxx basic/source/app/brkpnts.hxx basic/source/app/dialogs.cxx basic/source/app/dialogs.hxx basic/source/app/msgedit.cxx basic/source/app/mybasic.cxx basic/source/app/process.cxx basic/source/app/processw.hxx basic/source/app/textedit.cxx basic/source/basmgr/basicmanagerrepository.cxx basic/source/basmgr/basmgr.cxx basic/source/classes/disas.cxx basic/source/classes/eventatt.cxx basic/source/classes/image.cxx basic/source/classes/sb.cxx basic/source/classes/sbunoobj.cxx basic/source/classes/sbxmod.cxx basic/source/comp/codegen.cxx basic/source/comp/dim.cxx basic/source/comp/exprgen.cxx basic/source/comp/exprnode.cxx basic/source/comp/exprtree.cxx basic/source/comp/sbcomp.cxx basic/source/inc/expr.hxx basic/source/inc/object.hxx basic/source/inc/sbunoobj.hxx basic/source/runtime/dllmgr-x86.cxx basic/source/runtime/iosys.cxx basic/source/runtime/makefile.mk basic/source/runtime/methods.cxx basic/source/runtime/methods1.cxx basic/source/runtime/runtime.cxx basic/source/runtime/stdobj.cxx basic/source/runtime/step0.cxx basic/source/runtime/step1.cxx basic/source/runtime/step2.cxx basic/source/sbx/sbxarray.cxx basic/source/sbx/sbxbase.cxx basic/source/sbx/sbxbool.cxx basic/source/sbx/sbxbyte.cxx basic/source/sbx/sbxcoll.cxx basic/source/sbx/sbxconv.hxx basic/source/sbx/sbxcurr.cxx basic/source/sbx/sbxexec.cxx basic/source/sbx/sbxint.cxx basic/source/sbx/sbxobj.cxx basic/source/sbx/sbxscan.cxx basic/source/sbx/sbxstr.cxx basic/source/sbx/sbxvals.cxx basic/source/sbx/sbxvalue.cxx basic/source/sbx/sbxvar.cxx basic/workben/mgrtest.cxx configmgr/prj/build.lst configmgr/source/access.cxx configmgr/source/configurationprovider.cxx configmgr/source/defaultprovider.cxx configmgr/source/pad.cxx configmgr/source/services.cxx configmgr/source/update.cxx configmgr/source/xmlreader.cxx configmgr/source/xmlreader.hxx connectivity/prj/build.lst connectivity/qa/complex/connectivity/TestCase.java connectivity/source/cpool/Zregistration.cxx connectivity/source/drivers/adabas/Bservices.cxx connectivity/source/drivers/ado/Aservices.cxx connectivity/source/drivers/calc/Cservices.cxx connectivity/source/drivers/calc/makefile.mk connectivity/source/drivers/dbase/DIndex.cxx connectivity/source/drivers/dbase/DIndexIter.cxx connectivity/source/drivers/dbase/DNoException.cxx connectivity/source/drivers/dbase/DTable.cxx connectivity/source/drivers/dbase/Dservices.cxx connectivity/source/drivers/dbase/dindexnode.cxx connectivity/source/drivers/evoab/LNoException.cxx connectivity/source/drivers/evoab/LServices.cxx connectivity/source/drivers/evoab2/NServices.cxx connectivity/source/drivers/file/FNoException.cxx connectivity/source/drivers/file/FPreparedStatement.cxx connectivity/source/drivers/file/FResultSet.cxx connectivity/source/drivers/file/FStatement.cxx connectivity/source/drivers/file/quotedstring.cxx connectivity/source/drivers/flat/ETable.cxx connectivity/source/drivers/flat/Eservices.cxx connectivity/source/drivers/hsqldb/Hservices.cxx connectivity/source/drivers/jdbc/jservices.cxx connectivity/source/drivers/kab/KServices.cxx connectivity/source/drivers/macab/MacabServices.cxx connectivity/source/drivers/mozab/MResultSet.cxx connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx connectivity/source/drivers/mysql/Yservices.cxx connectivity/source/drivers/odbc/OFunctions.cxx connectivity/source/drivers/odbc/oservices.cxx connectivity/source/inc/dbase/DIndexPage.hxx connectivity/source/inc/file/FTable.hxx connectivity/source/manager/mregistration.cxx connectivity/source/parse/PColumn.cxx desktop/prj/build.lst desktop/qa/deployment_misc/test_dp_version.cxx desktop/source/app/app.cxx desktop/source/app/appfirststart.cxx desktop/source/app/cmdlineargs.cxx desktop/source/app/cmdlineargs.hxx desktop/source/app/sofficemain.cxx desktop/source/deployment/gui/dp_gui.hrc desktop/source/deployment/gui/dp_gui_dialog2.cxx desktop/source/deployment/gui/dp_gui_dialog2.hxx desktop/source/deployment/gui/dp_gui_updatedialog.cxx desktop/source/deployment/gui/dp_gui_updatedialog.hxx desktop/source/deployment/manager/dp_extensionmanager.cxx desktop/source/deployment/manager/dp_extensionmanager.hxx desktop/source/deployment/misc/dp_misc.src desktop/source/deployment/registry/component/dp_component.cxx desktop/source/deployment/registry/configuration/dp_configuration.cxx desktop/source/deployment/registry/dp_backend.cxx desktop/source/deployment/registry/help/dp_help.cxx desktop/source/deployment/registry/script/dp_script.cxx desktop/source/migration/pages.cxx desktop/source/migration/pages.hxx desktop/source/migration/wizard.cxx desktop/source/migration/wizard.hrc desktop/source/migration/wizard.hxx desktop/source/migration/wizard.src desktop/source/pkgchk/unopkg/unopkg_shared.h desktop/source/so_comp/services.cxx desktop/source/splash/makefile.mk desktop/source/splash/services_spl.cxx desktop/source/splash/splash.cxx drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx editeng/inc/editeng/adjitem.hxx editeng/inc/editeng/bolnitem.hxx editeng/inc/editeng/borderline.hxx editeng/inc/editeng/boxitem.hxx editeng/inc/editeng/brkitem.hxx editeng/inc/editeng/brshitem.hxx editeng/inc/editeng/bulitem.hxx editeng/inc/editeng/charreliefitem.hxx editeng/inc/editeng/charrotateitem.hxx editeng/inc/editeng/charscaleitem.hxx editeng/inc/editeng/cmapitem.hxx editeng/inc/editeng/colritem.hxx editeng/inc/editeng/crsditem.hxx editeng/inc/editeng/editdata.hxx editeng/inc/editeng/editeng.hxx editeng/inc/editeng/editobj.hxx editeng/inc/editeng/editstat.hxx editeng/inc/editeng/editview.hxx editeng/inc/editeng/emphitem.hxx editeng/inc/editeng/escpitem.hxx editeng/inc/editeng/fhgtitem.hxx editeng/inc/editeng/flstitem.hxx editeng/inc/editeng/fontitem.hxx editeng/inc/editeng/frmdiritem.hxx editeng/inc/editeng/fwdtitem.hxx editeng/inc/editeng/hyznitem.hxx editeng/inc/editeng/kernitem.hxx editeng/inc/editeng/langitem.hxx editeng/inc/editeng/lrspitem.hxx editeng/inc/editeng/lspcitem.hxx editeng/inc/editeng/numitem.hxx editeng/inc/editeng/outliner.hxx editeng/inc/editeng/paravertalignitem.hxx editeng/inc/editeng/pmdlitem.hxx editeng/inc/editeng/postitem.hxx editeng/inc/editeng/protitem.hxx editeng/inc/editeng/shaditem.hxx editeng/inc/editeng/sizeitem.hxx editeng/inc/editeng/svxacorr.hxx editeng/inc/editeng/svxfont.hxx editeng/inc/editeng/svxrtf.hxx editeng/inc/editeng/swafopt.hxx editeng/inc/editeng/tstpitem.hxx editeng/inc/editeng/twolinesitem.hxx editeng/inc/editeng/txtrange.hxx editeng/inc/editeng/udlnitem.hxx editeng/inc/editeng/ulspitem.hxx editeng/inc/editeng/wghtitem.hxx editeng/inc/editeng/writingmodeitem.hxx editeng/inc/editeng/xmlcnitm.hxx editeng/inc/helpid.hrc editeng/inc/pch/precompiled_editeng.hxx editeng/source/editeng/editdbg.cxx editeng/source/editeng/editdoc.cxx editeng/source/editeng/editdoc.hxx editeng/source/editeng/editdoc2.cxx editeng/source/editeng/editeng.cxx editeng/source/editeng/editobj.cxx editeng/source/editeng/editobj2.hxx editeng/source/editeng/editsel.cxx editeng/source/editeng/editundo.cxx editeng/source/editeng/editundo.hxx editeng/source/editeng/editview.cxx editeng/source/editeng/edtspell.hxx editeng/source/editeng/eehtml.cxx editeng/source/editeng/eehtml.hxx editeng/source/editeng/eeobj.cxx editeng/source/editeng/eerdll.cxx editeng/source/editeng/eertfpar.cxx editeng/source/editeng/impedit.cxx editeng/source/editeng/impedit.hxx editeng/source/editeng/impedit2.cxx editeng/source/editeng/impedit3.cxx editeng/source/editeng/impedit4.cxx editeng/source/editeng/impedit5.cxx editeng/source/editeng/makefile.mk editeng/source/items/bulitem.cxx editeng/source/items/charhiddenitem.cxx editeng/source/items/flditem.cxx editeng/source/items/frmitems.cxx editeng/source/items/makefile.mk editeng/source/items/numitem.cxx editeng/source/items/paraitem.cxx editeng/source/items/svxfont.cxx editeng/source/items/textitem.cxx editeng/source/items/writingmodeitem.cxx editeng/source/items/xmlcnitm.cxx editeng/source/misc/SvXMLAutoCorrectImport.cxx editeng/source/misc/svxacorr.cxx editeng/source/misc/txtrange.cxx editeng/source/misc/unolingu.cxx editeng/source/outliner/outleeng.cxx editeng/source/outliner/outliner.cxx editeng/source/outliner/outlundo.hxx editeng/source/outliner/outlvw.cxx editeng/source/outliner/paralist.cxx editeng/source/outliner/paralist.hxx editeng/source/rtf/rtfgrf.cxx editeng/source/rtf/rtfitem.cxx editeng/source/rtf/svxrtf.cxx editeng/source/uno/unoipset.cxx editeng/util/makefile.mk embeddedobj/prj/build.lst embeddedobj/source/commonembedding/miscobj.cxx eventattacher/prj/build.lst fileaccess/source/FileAccess.cxx formula/inc/formula/FormulaCompiler.hxx formula/inc/formula/token.hxx formula/inc/formula/tokenarray.hxx formula/source/core/api/FormulaCompiler.cxx formula/source/core/api/token.cxx formula/source/ui/dlg/FormulaHelper.cxx formula/source/ui/dlg/formula.cxx formula/source/ui/dlg/parawin.cxx formula/source/ui/dlg/structpg.cxx fpicker/prj/d.lst fpicker/source/aqua/FPentry.cxx fpicker/source/office/OfficeControlAccess.cxx fpicker/source/office/iodlg.cxx fpicker/source/office/iodlg.hxx fpicker/source/office/iodlg.src fpicker/source/office/iodlgimp.cxx fpicker/source/unx/gnome/FPentry.cxx fpicker/source/unx/gnome/SalGtkFilePicker.cxx fpicker/source/unx/gnome/SalGtkPicker.cxx fpicker/source/unx/kde4/KDE4FPEntry.cxx fpicker/source/win32/filepicker/FPentry.cxx framework/AllLangResTarget_fwe.mk framework/inc/dispatch/interaction.hxx framework/inc/framework/addonmenu.hxx framework/inc/framework/addonsoptions.hxx framework/inc/framework/bmkmenu.hxx framework/inc/framework/imageproducer.hxx framework/inc/framework/sfxhelperfunctions.hxx framework/inc/framework/statusbarconfiguration.hxx framework/inc/framework/titlehelper.hxx framework/inc/framework/toolboxconfiguration.hxx framework/inc/threadhelp/lockhelper.hxx framework/inc/xml/eventsdocumenthandler.hxx framework/inc/xml/statusbardocumenthandler.hxx framework/inc/xml/toolboxconfiguration.hxx framework/inc/xml/toolboxconfigurationdefines.hxx framework/inc/xml/toolboxdocumenthandler.hxx framework/prj/build.lst framework/qa/complex/ModuleManager/makefile.mk framework/qa/complex/accelerators/makefile.mk framework/qa/complex/framework/recovery/makefile.mk framework/qa/complex/imageManager/_XInitialization.java framework/source/classes/menumanager.cxx framework/source/dispatch/interaction.cxx framework/source/fwe/classes/bmkmenu.cxx framework/source/fwe/helper/actiontriggerhelper.cxx framework/source/fwe/helper/imageproducer.cxx framework/source/fwe/xml/menuconfiguration.cxx framework/source/fwe/xml/toolboxdocumenthandler.cxx framework/source/helper/uiconfigelementwrapperbase.cxx framework/source/helper/uielementwrapperbase.cxx framework/source/inc/pattern/window.hxx framework/source/jobs/jobdata.cxx framework/source/layoutmanager/layoutmanager.cxx framework/source/layoutmanager/panel.hxx framework/source/loadenv/loadenv.cxx framework/source/register/registerservices.cxx framework/source/services/menudocumenthandler.cxx framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx framework/source/uiconfiguration/uiconfigurationmanager.cxx framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx framework/source/uielement/addonstoolbarmanager.cxx framework/source/uielement/controlmenucontroller.cxx framework/source/uielement/fontsizemenucontroller.cxx framework/source/uielement/imagebuttontoolbarcontroller.cxx framework/source/uielement/macrosmenucontroller.cxx framework/source/uielement/menubarmanager.cxx framework/source/uielement/newmenucontroller.cxx framework/source/uielement/togglebuttontoolbarcontroller.cxx framework/source/uielement/toolbarmanager.cxx framework/source/uielement/toolbarsmenucontroller.cxx framework/test/makefile.mk framework/test/threadtest/makefile.mk framework/test/typecfg/makefile.mk framework/util/guiapps/makefile.mk framework/util/makefile.mk idl/inc/bastype.hxx idl/inc/hash.hxx idl/inc/lex.hxx idl/inc/module.hxx idl/inc/object.hxx idl/inc/slot.hxx idl/inc/types.hxx idl/source/cmptools/hash.cxx idl/source/cmptools/lex.cxx idl/source/objects/basobj.cxx idl/source/objects/bastype.cxx idl/source/objects/module.cxx idl/source/objects/object.cxx idl/source/objects/slot.cxx idl/source/objects/types.cxx idl/source/prj/command.cxx idl/source/prj/database.cxx idl/source/prj/globals.cxx idl/source/prj/svidl.cxx linguistic/inc/linguistic/misc.hxx linguistic/prj/build.lst linguistic/source/convdic.cxx linguistic/source/convdiclist.cxx linguistic/source/dicimp.cxx linguistic/source/dlistimp.cxx linguistic/source/gciterator.cxx linguistic/source/iprcache.cxx linguistic/source/lngopt.cxx linguistic/source/lngprophelp.cxx linguistic/source/lngsvcmgr.cxx linguistic/source/lngsvcmgr.hxx linguistic/source/misc2.cxx linguistic/workben/sprophelp.cxx officecfg/registry/data/org/openoffice/VCL.xcu officecfg/util/makefile.mk oovbaapi/ooo/vba/XApplicationBase.idl oovbaapi/ooo/vba/XVBAAppService.idl oovbaapi/ooo/vba/XVBADocService.idl oovbaapi/ooo/vba/excel/XApplication.idl oovbaapi/ooo/vba/excel/XRange.idl oovbaapi/ooo/vba/excel/XWorkbook.idl oovbaapi/ooo/vba/excel/XWorksheet.idl oovbaapi/ooo/vba/word/XApplication.idl oovbaapi/ooo/vba/word/XGlobals.idl oovbaapi/ooo/vba/word/XTableOfContents.idl readlicense_oo/prj/build.lst scripting/prj/build.lst scripting/prj/d.lst scripting/source/basprov/basprov.cxx scripting/source/basprov/basscript.cxx scripting/source/basprov/basscript.hxx scripting/source/dlgprov/dlgprov.cxx scripting/source/inc/util/util.hxx scripting/source/protocolhandler/scripthandler.cxx scripting/source/provider/ProviderCache.cxx scripting/source/pyprov/makefile.mk scripting/source/runtimemgr/ScriptNameResolverImpl.cxx scripting/source/runtimemgr/ScriptRuntimeManager.cxx scripting/source/runtimemgr/StorageBridge.cxx scripting/source/storage/ScriptMetadataImporter.cxx scripting/source/storage/ScriptSecurityManager.cxx scripting/source/storage/ScriptStorage.cxx scripting/source/storage/ScriptStorageManager.cxx sfx2/inc/about.hxx sfx2/inc/brokenpackageint.hxx sfx2/inc/docvor.hxx sfx2/inc/pch/precompiled_sfx2.hxx sfx2/inc/sfx2/app.hxx sfx2/inc/sfx2/basmgr.hxx sfx2/inc/sfx2/bindings.hxx sfx2/inc/sfx2/childwin.hxx sfx2/inc/sfx2/ctrlitem.hxx sfx2/inc/sfx2/dinfdlg.hxx sfx2/inc/sfx2/dispatch.hxx sfx2/inc/sfx2/docfilt.hxx sfx2/inc/sfx2/evntconf.hxx sfx2/inc/sfx2/fcontnr.hxx sfx2/inc/sfx2/frame.hxx sfx2/inc/sfx2/imagemgr.hxx sfx2/inc/sfx2/imgmgr.hxx sfx2/inc/sfx2/linksrc.hxx sfx2/inc/sfx2/macrconf.hxx sfx2/inc/sfx2/macropg.hxx sfx2/inc/sfx2/mnuitem.hxx sfx2/inc/sfx2/mnumgr.hxx sfx2/inc/sfx2/module.hxx sfx2/inc/sfx2/msg.hxx sfx2/inc/sfx2/objsh.hxx sfx2/inc/sfx2/passwd.hxx sfx2/inc/sfx2/prnmon.hxx sfx2/inc/sfx2/request.hxx sfx2/inc/sfx2/sfx.hrc sfx2/inc/sfx2/sfxbasemodel.hxx sfx2/inc/sfx2/sfxhtml.hxx sfx2/inc/sfx2/sfxresid.hxx sfx2/inc/sfx2/sfxsids.hrc sfx2/inc/sfx2/sfxuno.hxx sfx2/inc/sfx2/shell.hxx sfx2/inc/sfx2/stbitem.hxx sfx2/inc/sfx2/styfitem.hxx sfx2/inc/sfx2/tabdlg.hxx sfx2/inc/sfx2/tbxctrl.hxx sfx2/inc/sfx2/tplpitem.hxx sfx2/inc/sfx2/viewfrm.hxx sfx2/inc/sfx2/viewsh.hxx sfx2/inc/sfxbasic.hxx sfx2/inc/sorgitm.hxx sfx2/prj/build.lst sfx2/qa/complex/docinfo/makefile.mk sfx2/qa/cppunit/makefile.mk sfx2/sdi/makefile.mk sfx2/source/appl/app.cxx sfx2/source/appl/app.hrc sfx2/source/appl/app.src sfx2/source/appl/appbas.cxx sfx2/source/appl/appcfg.cxx sfx2/source/appl/appchild.cxx sfx2/source/appl/appmain.cxx sfx2/source/appl/appmisc.cxx sfx2/source/appl/appopen.cxx sfx2/source/appl/appquit.cxx sfx2/source/appl/appserv.cxx sfx2/source/appl/appuno.cxx sfx2/source/appl/childwin.cxx sfx2/source/appl/fileobj.cxx sfx2/source/appl/helpinterceptor.cxx sfx2/source/appl/imagemgr.cxx sfx2/source/appl/impldde.cxx sfx2/source/appl/impldde.hxx sfx2/source/appl/linkmgr2.cxx sfx2/source/appl/lnkbase2.cxx sfx2/source/appl/makefile.mk sfx2/source/appl/module.cxx sfx2/source/appl/newhelp.cxx sfx2/source/appl/opengrf.cxx sfx2/source/appl/sfxdll.cxx sfx2/source/appl/sfxhelp.cxx sfx2/source/appl/shutdownicon.cxx sfx2/source/appl/shutdowniconunx.cxx sfx2/source/appl/workwin.cxx sfx2/source/bastyp/fltfnc.cxx sfx2/source/bastyp/frmhtml.cxx sfx2/source/bastyp/frmhtmlw.cxx sfx2/source/bastyp/helper.cxx sfx2/source/bastyp/minarray.cxx sfx2/source/bastyp/progress.cxx sfx2/source/bastyp/sfxhtml.cxx sfx2/source/config/evntconf.cxx sfx2/source/control/bindings.cxx sfx2/source/control/ctrlitem.cxx sfx2/source/control/dispatch.cxx sfx2/source/control/macrconf.cxx sfx2/source/control/macro.cxx sfx2/source/control/makefile.mk sfx2/source/control/minfitem.cxx sfx2/source/control/msg.cxx sfx2/source/control/msgpool.cxx sfx2/source/control/objface.cxx sfx2/source/control/request.cxx sfx2/source/control/shell.cxx sfx2/source/control/sorgitm.cxx sfx2/source/dialog/about.cxx sfx2/source/dialog/basedlgs.cxx sfx2/source/dialog/dinfdlg.cxx sfx2/source/dialog/dinfedt.cxx sfx2/source/dialog/dockwin.cxx sfx2/source/dialog/filedlghelper.cxx sfx2/source/dialog/mailmodel.cxx sfx2/source/dialog/mailmodelapi.cxx sfx2/source/dialog/makefile.mk sfx2/source/dialog/mgetempl.cxx sfx2/source/dialog/passwd.cxx sfx2/source/dialog/passwd.hrc sfx2/source/dialog/printopt.cxx sfx2/source/dialog/securitypage.cxx sfx2/source/dialog/splitwin.cxx sfx2/source/dialog/styfitem.cxx sfx2/source/dialog/tabdlg.cxx sfx2/source/dialog/taskpane.cxx sfx2/source/dialog/templdlg.cxx sfx2/source/dialog/tplpitem.cxx sfx2/source/dialog/versdlg.cxx sfx2/source/doc/QuerySaveDocument.cxx sfx2/source/doc/SfxDocumentMetaData.cxx sfx2/source/doc/applet.cxx sfx2/source/doc/doc.hrc sfx2/source/doc/doc.src sfx2/source/doc/docfile.cxx sfx2/source/doc/docinf.cxx sfx2/source/doc/doctempl.cxx sfx2/source/doc/doctemplates.cxx sfx2/source/doc/docvor.cxx sfx2/source/doc/guisaveas.cxx sfx2/source/doc/makefile.mk sfx2/source/doc/objcont.cxx sfx2/source/doc/objitem.cxx sfx2/source/doc/objmisc.cxx sfx2/source/doc/objserv.cxx sfx2/source/doc/printhelper.cxx sfx2/source/doc/sfxacldetect.cxx sfx2/source/doc/sfxbasemodel.cxx sfx2/source/inc/applet.hxx sfx2/source/inc/fltoptint.hxx sfx2/source/inc/sfxlocal.hrc sfx2/source/inc/virtmenu.hxx sfx2/source/inc/workwin.hxx sfx2/source/menu/mnuitem.cxx sfx2/source/menu/objmnctl.cxx sfx2/source/menu/virtmenu.cxx sfx2/source/notify/eventsupplier.cxx sfx2/source/notify/makefile.mk sfx2/source/toolbox/imgmgr.cxx sfx2/source/toolbox/tbxitem.cxx sfx2/source/view/frame.cxx sfx2/source/view/orgmgr.cxx sfx2/source/view/printer.cxx sfx2/source/view/prnmon.cxx sfx2/source/view/viewfrm.cxx sfx2/source/view/viewprn.cxx sfx2/source/view/viewsh.cxx sfx2/util/makefile.mk sfx2/workben/custompanel/makefile.mk shell/source/backends/desktopbe/desktopbackend.cxx shell/source/backends/gconfbe/gconfbackend.cxx shell/source/backends/kde4be/kde4backend.cxx shell/source/backends/kdebe/kdebackend.cxx shell/source/win32/SysShentry.cxx shell/source/win32/shlxthandler/propsheets/propsheets.cxx shell/source/win32/simplemail/smplmailentry.cxx svx/inc/float3d.hrc svx/inc/fmhelp.hrc svx/inc/globlmn_tmpl.hrc svx/inc/helpid.hrc svx/inc/pch/precompiled_svx.hxx svx/inc/sjctrl.hxx svx/inc/srchitem.hxx svx/inc/svdibrow.hxx svx/inc/svx/SmartTagItem.hxx svx/inc/svx/algitem.hxx svx/inc/svx/camera3d.hxx svx/inc/svx/chrtitem.hxx svx/inc/svx/clipfmtitem.hxx svx/inc/svx/ctredlin.hxx svx/inc/svx/dbtoolsclient.hxx svx/inc/svx/deflt3d.hxx svx/inc/svx/dialogs.hrc svx/inc/svx/drawitem.hxx svx/inc/svx/e3ditem.hxx svx/inc/svx/extrud3d.hxx svx/inc/svx/flagsdef.hxx svx/inc/svx/float3d.hxx svx/inc/svx/frmsel.hxx svx/inc/svx/gallery.hxx svx/inc/svx/gallery1.hxx svx/inc/svx/galtheme.hxx svx/inc/svx/grfcrop.hxx svx/inc/svx/hdft.hxx svx/inc/svx/hlnkitem.hxx svx/inc/svx/hyprlink.hxx svx/inc/svx/itemwin.hxx svx/inc/svx/lathe3d.hxx svx/inc/svx/linkwarn.hxx svx/inc/svx/modctrl.hxx svx/inc/svx/msdffdef.hxx svx/inc/svx/obj3d.hxx svx/inc/svx/optgenrl.hxx svx/inc/svx/optgrid.hxx svx/inc/svx/pageitem.hxx svx/inc/svx/paraprev.hxx svx/inc/svx/postattr.hxx svx/inc/svx/rotmodit.hxx svx/inc/svx/ruler.hxx svx/inc/svx/rulritem.hxx svx/inc/svx/scene3d.hxx svx/inc/svx/sdasaitm.hxx svx/inc/svx/sdasitm.hxx svx/inc/svx/sdggaitm.hxx svx/inc/svx/sdmetitm.hxx svx/inc/svx/sdtaaitm.hxx svx/inc/svx/sdtaditm.hxx svx/inc/svx/sdtaitm.hxx svx/inc/svx/sdtakitm.hxx svx/inc/svx/sdtfchim.hxx svx/inc/svx/sdtfsitm.hxx svx/inc/svx/srchdlg.hxx svx/inc/svx/svddrag.hxx svx/inc/svx/svdetc.hxx svx/inc/svx/svdglue.hxx svx/inc/svx/svdhlpln.hxx svx/inc/svx/svdlayer.hxx svx/inc/svx/svdmark.hxx svx/inc/svx/svdmodel.hxx svx/inc/svx/svdoashp.hxx svx/inc/svx/svdobj.hxx svx/inc/svx/svdocirc.hxx svx/inc/svx/svdoedge.hxx svx/inc/svx/svdogrp.hxx svx/inc/svx/svdomeas.hxx svx/inc/svx/svdoole2.hxx svx/inc/svx/svdorect.hxx svx/inc/svx/svdotable.hxx svx/inc/svx/svdotext.hxx svx/inc/svx/svdovirt.hxx svx/inc/svx/svdpage.hxx svx/inc/svx/svdsnpv.hxx svx/inc/svx/svdtrans.hxx svx/inc/svx/svdundo.hxx svx/inc/svx/svimbase.hxx svx/inc/svx/svx3ditems.hxx svx/inc/svx/svxdlg.hxx svx/inc/svx/sxcikitm.hxx svx/inc/svx/sxekitm.hxx svx/inc/svx/sxelditm.hxx svx/inc/svx/sxenditm.hxx svx/inc/svx/sxmkitm.hxx svx/inc/svx/sxmtpitm.hxx svx/inc/svx/sxmuitm.hxx svx/inc/svx/tabarea.hxx svx/inc/svx/tabline.hxx svx/inc/svx/unoprov.hxx svx/inc/svx/viewlayoutitem.hxx svx/inc/svx/xbitmap.hxx svx/inc/svx/xbtmpit.hxx svx/inc/svx/xcolit.hxx svx/inc/svx/xfillit0.hxx svx/inc/svx/xflclit.hxx svx/inc/svx/xflftrit.hxx svx/inc/svx/xflgrit.hxx svx/inc/svx/xflhtit.hxx svx/inc/svx/xftadit.hxx svx/inc/svx/xftsfit.hxx svx/inc/svx/xftshit.hxx svx/inc/svx/xlineit0.hxx svx/inc/svx/xlinjoit.hxx svx/inc/svx/xlnclit.hxx svx/inc/svx/xlndsit.hxx svx/inc/svx/xlnedcit.hxx svx/inc/svx/xlnedit.hxx svx/inc/svx/xlnedwit.hxx svx/inc/svx/xlnstcit.hxx svx/inc/svx/xlnstit.hxx svx/inc/svx/xlnstwit.hxx svx/inc/svx/xlnwtit.hxx svx/inc/svx/xtextit0.hxx svx/inc/svx/zoomitem.hxx svx/inc/svx/zoomslideritem.hxx svx/inc/xpolyimp.hxx svx/inc/zoom_def.hxx svx/prj/d.lst svx/source/accessibility/AccessibleShape.cxx svx/source/accessibility/DescriptionGenerator.cxx svx/source/customshapes/EnhancedCustomShapeEngine.cxx svx/source/customshapes/EnhancedCustomShapeFontWork.cxx svx/source/dialog/_bmpmask.cxx svx/source/dialog/_contdlg.cxx svx/source/dialog/connctrl.cxx svx/source/dialog/contwnd.cxx svx/source/dialog/ctredlin.cxx svx/source/dialog/ctredlin.hrc svx/source/dialog/ctredlin.src svx/source/dialog/dialcontrol.cxx svx/source/dialog/dlgctrl.cxx svx/source/dialog/docrecovery.cxx svx/source/dialog/fntctrl.cxx svx/source/dialog/fontwork.cxx svx/source/dialog/frmsel.cxx svx/source/dialog/graphctl.cxx svx/source/dialog/grfflt.cxx svx/source/dialog/hdft.cxx svx/source/dialog/hyperdlg.cxx svx/source/dialog/hyprdlg.hxx svx/source/dialog/hyprlink.cxx svx/source/dialog/hyprlink.hxx svx/source/dialog/hyprlink.src svx/source/dialog/imapdlg.cxx svx/source/dialog/imapwnd.cxx svx/source/dialog/linkwarn.hrc svx/source/dialog/makefile.mk svx/source/dialog/optgrid.cxx svx/source/dialog/orienthelper.cxx svx/source/dialog/pagectrl.cxx svx/source/dialog/prtqry.cxx svx/source/dialog/rlrcitem.cxx svx/source/dialog/rubydialog.cxx svx/source/dialog/rulritem.cxx svx/source/dialog/simptabl.cxx svx/source/dialog/srchdlg.cxx svx/source/dialog/svxbmpnumvalueset.cxx svx/source/dialog/svxruler.cxx svx/source/dialog/swframeexample.cxx svx/source/engine3d/float3d.cxx svx/source/engine3d/float3d.src svx/source/engine3d/svx3ditems.cxx svx/source/fmcomp/gridctrl.cxx svx/source/fmcomp/trace.cxx svx/source/form/ParseContext.cxx svx/source/form/datanavi.cxx svx/source/form/filtnav.cxx svx/source/form/fmexch.cxx svx/source/form/fmexpl.cxx svx/source/form/fmobjfac.cxx svx/source/form/fmpage.cxx svx/source/form/fmshell.cxx svx/source/form/fmshimp.cxx svx/source/form/fmsrcimp.cxx svx/source/form/fmvwimp.cxx svx/source/form/makefile.mk svx/source/form/tabwin.cxx svx/source/form/tbxform.cxx svx/source/form/typemap.cxx svx/source/gallery2/galbrws1.cxx svx/source/gallery2/galbrws2.cxx svx/source/gallery2/galexpl.cxx svx/source/gallery2/gallery1.cxx svx/source/gallery2/galtheme.cxx svx/source/gallery2/makefile.mk svx/source/gengal/gengal.cxx svx/source/gengal/makefile.mk svx/source/inc/fmgroup.hxx svx/source/intro/about_ooo.hrc svx/source/intro/iso.src svx/source/intro/ooo.src svx/source/items/SmartTagItem.cxx svx/source/items/algitem.cxx svx/source/items/chrtitem.cxx svx/source/items/clipfmtitem.cxx svx/source/items/customshapeitem.cxx svx/source/items/drawitem.cxx svx/source/items/e3ditem.cxx svx/source/items/grfitem.cxx svx/source/items/hlnkitem.cxx svx/source/items/makefile.mk svx/source/items/pageitem.cxx svx/source/items/rotmodit.cxx svx/source/items/viewlayoutitem.cxx svx/source/items/zoomitem.cxx svx/source/items/zoomslideritem.cxx svx/source/src/app.hrc svx/source/stbctrls/makefile.mk svx/source/stbctrls/modctrl.cxx svx/source/stbctrls/xmlsecctrl.cxx svx/source/stbctrls/zoomctrl.cxx svx/source/svdraw/clonelist.cxx svx/source/svdraw/svdattr.cxx svx/source/svdraw/svdcrtv.cxx svx/source/svdraw/svdedtv1.cxx svx/source/svdraw/svdedtv2.cxx svx/source/svdraw/svdedxv.cxx svx/source/svdraw/svdetc.cxx svx/source/svdraw/svdfmtf.cxx svx/source/svdraw/svdfmtf.hxx svx/source/svdraw/svdglue.cxx svx/source/svdraw/svdhdl.cxx svx/source/svdraw/svdhlpln.cxx svx/source/svdraw/svdibrow.cxx svx/source/svdraw/svdlayer.cxx svx/source/svdraw/svdmodel.cxx svx/source/svdraw/svdoashp.cxx svx/source/svdraw/svdobj.cxx svx/source/svdraw/svdocapt.cxx svx/source/svdraw/svdocirc.cxx svx/source/svdraw/svdoedge.cxx svx/source/svdraw/svdograf.cxx svx/source/svdraw/svdogrp.cxx svx/source/svdraw/svdomeas.cxx svx/source/svdraw/svdomedia.cxx svx/source/svdraw/svdopath.cxx svx/source/svdraw/svdotext.cxx svx/source/svdraw/svdotxdr.cxx svx/source/svdraw/svdotxed.cxx svx/source/svdraw/svdotxfl.cxx svx/source/svdraw/svdotxln.cxx svx/source/svdraw/svdotxtr.cxx svx/source/svdraw/svdoutl.cxx svx/source/svdraw/svdpage.cxx svx/source/svdraw/svdpagv.cxx svx/source/svdraw/svdpntv.cxx svx/source/svdraw/svdpoev.cxx svx/source/svdraw/svdsnpv.cxx svx/source/svdraw/svdstr.src svx/source/svdraw/svdtrans.cxx svx/source/svdraw/svdundo.cxx svx/source/svdraw/svdview.cxx svx/source/svdraw/svdxcgv.cxx svx/source/table/svdotable.cxx svx/source/tbxctrls/colorwindow.hxx svx/source/tbxctrls/extrusioncontrols.cxx svx/source/tbxctrls/fillctrl.cxx svx/source/tbxctrls/grafctrl.cxx svx/source/tbxctrls/itemwin.cxx svx/source/tbxctrls/layctrl.cxx svx/source/tbxctrls/lboxctrl.cxx svx/source/tbxctrls/linectrl.cxx svx/source/tbxctrls/tbcontrl.cxx svx/source/tbxctrls/verttexttbxctrl.cxx svx/source/unodraw/unomod.cxx svx/source/unodraw/unopage.cxx svx/source/unodraw/unoprov.cxx svx/source/unodraw/unoshape.cxx svx/source/unodraw/unoshtxt.cxx svx/source/xml/xmlxtexp.cxx svx/source/xoutdev/_xpoly.cxx svx/source/xoutdev/xattr.cxx svx/source/xoutdev/xattr2.cxx svx/source/xoutdev/xattrbmp.cxx svx/source/xoutdev/xtabcolr.cxx svx/util/makefile.mk svx/workben/edittest.cxx sysui/desktop/productversion.mk ucb/prj/build.lst ucb/source/cacher/cacheserv.cxx ucb/source/core/ucb1.component ucb/source/core/ucbserv.cxx ucb/source/core/ucbstore.cxx ucb/source/core/ucbstore.hxx ucb/source/sorter/sortmain.cxx ucb/source/ucp/file/prov.cxx ucb/source/ucp/file/shell.cxx ucb/source/ucp/ftp/ftpservices.cxx ucb/source/ucp/gio/gio_provider.cxx ucb/source/ucp/gvfs/gvfs_provider.cxx ucb/source/ucp/hierarchy/hierarchyservices.cxx ucb/source/ucp/odma/odma_lib.cxx ucb/source/ucp/odma/odma_services.cxx ucb/source/ucp/package/pkgservices.cxx ucb/source/ucp/tdoc/tdoc_services.cxx ucb/source/ucp/webdav/ContentProperties.cxx ucb/source/ucp/webdav/NeonHeadRequest.cxx ucb/source/ucp/webdav/webdavcontent.cxx ucb/source/ucp/webdav/webdavservices.cxx uui/source/iahndl.cxx uui/source/iahndl.hxx uui/source/loginerr.hxx uui/source/nameclashdlg.hxx uui/source/passcrtdlg.cxx uui/source/passworddlg.cxx uui/source/passworddlg.hxx uui/source/services.cxx vbahelper/inc/vbahelper/vbahelper.hxx vbahelper/prj/build.lst vbahelper/prj/d.lst vbahelper/source/msforms/makefile.mk vbahelper/source/msforms/vbauserform.cxx vbahelper/source/vbahelper/makefile.mk vbahelper/source/vbahelper/vbaapplicationbase.cxx vbahelper/source/vbahelper/vbacommandbarcontrol.cxx vbahelper/source/vbahelper/vbadocumentbase.cxx vbahelper/source/vbahelper/vbadocumentsbase.cxx vbahelper/source/vbahelper/vbahelper.cxx vbahelper/util/makefile.mk xmlhelp/source/cxxhelp/provider/databases.cxx xmlhelp/source/cxxhelp/provider/services.cxx xmlhelp/source/treeview/tvfactory.cxx xmloff/JunitTest_xmloff_unoapi.mk xmloff/inc/functional.hxx xmloff/inc/xmloff/formlayerexport.hxx xmloff/inc/xmloff/formlayerimport.hxx xmloff/inc/xmloff/functional.hxx xmloff/inc/xmloff/shapeimport.hxx xmloff/inc/xmloff/xmlcnitm.hxx xmloff/inc/xmloff/xmlnumfi.hxx xmloff/prj/build.lst xmloff/source/chart/SchXMLChartContext.cxx xmloff/source/chart/SchXMLExport.cxx xmloff/source/chart/SchXMLImport.cxx xmloff/source/chart/SchXMLLegendContext.hxx xmloff/source/chart/SchXMLPlotAreaContext.cxx xmloff/source/core/xmluconv.cxx xmloff/source/draw/sdxmlexp.cxx xmloff/source/draw/shapeexport4.cxx xmloff/source/draw/ximp3dobject.cxx xmloff/source/draw/ximp3dscene.cxx xmloff/source/forms/formlayerexport.cxx xmloff/source/forms/formlayerimport.cxx xmloff/source/forms/handler/vcl_time_handler.hxx xmloff/source/forms/layerimport.cxx xmloff/source/forms/layerimport.hxx xmloff/source/forms/property_meta_data.hxx xmloff/source/style/PageHeaderFooterContext.cxx xmloff/source/style/PageMasterStyleMap.cxx xmloff/source/style/prstylei.cxx xmloff/source/style/xmlimppr.cxx xmloff/source/style/xmlnumfi.cxx xmloff/source/style/xmlstyle.cxx xmloff/source/table/tabledesignsimporter.cxx xmloff/source/text/XMLTextNumRuleInfo.cxx xmloff/source/text/XMLTextShapeStyleContext.cxx xmloff/source/text/txtstyle.cxx xmloff/source/transform/ChartOOoTContext.cxx xmloff/source/transform/EventOOoTContext.cxx xmloff/source/transform/TransformerBase.cxx xmloff/util/makefile.mk xmlscript/util/xcr.component
2299 lines
100 KiB
C++
Executable File
2299 lines
100 KiB
C++
Executable File
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||
/*************************************************************************
|
||
*
|
||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||
*
|
||
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
||
*
|
||
* OpenOffice.org - a multi-platform office productivity suite
|
||
*
|
||
* This file is part of OpenOffice.org.
|
||
*
|
||
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||
* it under the terms of the GNU Lesser General Public License version 3
|
||
* only, as published by the Free Software Foundation.
|
||
*
|
||
* OpenOffice.org is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU Lesser General Public License version 3 for more details
|
||
* (a copy is included in the LICENSE file that accompanied this code).
|
||
*
|
||
* You should have received a copy of the GNU Lesser General Public License
|
||
* version 3 along with OpenOffice.org. If not, see
|
||
* <http://www.openoffice.org/license.html>
|
||
* for a copy of the LGPLv3 License.
|
||
*
|
||
************************************************************************/
|
||
|
||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||
#include "precompiled_xmloff.hxx"
|
||
|
||
#include "elementexport.hxx"
|
||
#include "strings.hxx"
|
||
#include "xmloff/xmlnmspe.hxx"
|
||
#include "eventexport.hxx"
|
||
#include "formenums.hxx"
|
||
#include "formcellbinding.hxx"
|
||
#include "formcellbinding.hxx"
|
||
#include "xmloff/xformsexport.hxx"
|
||
#include "property_meta_data.hxx"
|
||
|
||
/** === begin UNO includes === **/
|
||
#include <com/sun/star/text/XText.hpp>
|
||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||
#include <com/sun/star/io/XPersistObject.hpp>
|
||
#include <com/sun/star/form/FormComponentType.hpp>
|
||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||
#include <com/sun/star/form/FormSubmitEncoding.hpp>
|
||
#include <com/sun/star/form/FormSubmitMethod.hpp>
|
||
#include <com/sun/star/sdb/CommandType.hpp>
|
||
#include <com/sun/star/form/NavigationBarMode.hpp>
|
||
#include <com/sun/star/form/TabulatorCycle.hpp>
|
||
#include <com/sun/star/form/FormButtonType.hpp>
|
||
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
|
||
#include <com/sun/star/awt/VisualEffect.hpp>
|
||
#include <com/sun/star/form/ListSourceType.hpp>
|
||
#include <com/sun/star/awt/ImagePosition.hpp>
|
||
/** === end UNO includes === **/
|
||
|
||
#include <tools/wintypes.hxx> // for check states
|
||
#include <xmloff/txtprmap.hxx>
|
||
#include <com/sun/star/form/binding/XBindableValue.hpp>
|
||
#include <com/sun/star/form/binding/XListEntrySink.hpp>
|
||
#include <tools/urlobj.hxx>
|
||
#include <xmloff/xmlexp.hxx>
|
||
#include <xmloff/nmspmap.hxx>
|
||
#include <xmloff/XMLEventExport.hxx>
|
||
#include <xmloff/xmluconv.hxx>
|
||
#include <xmloff/xmltoken.hxx>
|
||
#include <tools/time.hxx>
|
||
#include <tools/diagnose_ex.h>
|
||
#include <comphelper/extract.hxx>
|
||
#include <sal/macros.h>
|
||
|
||
#include <stdio.h>
|
||
#include <algorithm>
|
||
|
||
//.........................................................................
|
||
namespace xmloff
|
||
{
|
||
//.........................................................................
|
||
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
#define RESET_BIT( bitfield, bit ) \
|
||
bitfield = bitfield & ~bit
|
||
#else
|
||
#define RESET_BIT( bitfield, bit )
|
||
#endif
|
||
|
||
using namespace ::xmloff::token;
|
||
using namespace ::com::sun::star::uno;
|
||
using namespace ::com::sun::star::sdb;
|
||
using namespace ::com::sun::star::awt;
|
||
using namespace ::com::sun::star::form;
|
||
using namespace ::com::sun::star::lang;
|
||
using namespace ::com::sun::star::lang;
|
||
using namespace ::com::sun::star::beans;
|
||
using namespace ::com::sun::star::container;
|
||
using namespace ::com::sun::star::script;
|
||
using namespace ::com::sun::star::io;
|
||
using namespace ::com::sun::star::table;
|
||
using namespace ::com::sun::star::text;
|
||
using namespace ::com::sun::star::form::binding;
|
||
|
||
//=====================================================================
|
||
//= OElementExport
|
||
//=====================================================================
|
||
OElementExport::OElementExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxProps,
|
||
const Sequence< ScriptEventDescriptor >& _rEvents)
|
||
:OPropertyExport(_rContext, _rxProps)
|
||
,m_aEvents(_rEvents)
|
||
,m_pXMLElement(NULL)
|
||
{
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
OElementExport::~OElementExport()
|
||
{
|
||
implEndElement();
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::doExport()
|
||
{
|
||
// collect some general information about the element
|
||
examine();
|
||
|
||
// first add the attributes necessary for the element
|
||
m_rContext.getGlobalContext().ClearAttrList();
|
||
|
||
// add the attributes
|
||
exportAttributes();
|
||
|
||
// start the XML element
|
||
implStartElement(getXMLElementName());
|
||
|
||
// the sub elements (mostly control type dependent)
|
||
exportSubTags();
|
||
|
||
implEndElement();
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::examine()
|
||
{
|
||
// nothing to do here
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::exportAttributes()
|
||
{
|
||
// nothing to do here
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::exportSubTags()
|
||
{
|
||
// the properties which where not exported 'til now
|
||
exportRemainingProperties();
|
||
|
||
// the script:events sub tags
|
||
exportEvents();
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::implStartElement(const sal_Char* _pName)
|
||
{
|
||
m_pXMLElement = new SvXMLElementExport(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, _pName, sal_True, sal_True);
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::implEndElement()
|
||
{
|
||
delete m_pXMLElement;
|
||
m_pXMLElement = NULL;
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::exportServiceNameAttribute()
|
||
{
|
||
Reference< XPersistObject > xPersistence(m_xProps, UNO_QUERY);
|
||
if (!xPersistence.is())
|
||
{
|
||
OSL_ENSURE(sal_False, "OElementExport::exportServiceNameAttribute: no XPersistObject!");
|
||
return;
|
||
}
|
||
|
||
::rtl::OUString sServiceName = xPersistence->getServiceName();
|
||
// we don't want to write the old service name directly: it's a name used for compatibility reasons, but
|
||
// as we start some kind of new file format here (with this xml export), we don't care about
|
||
// compatibility ...
|
||
// So we translate the old persistence service name into new ones, if possible
|
||
|
||
::rtl::OUString sToWriteServiceName = sServiceName;
|
||
#define CHECK_N_TRANSLATE( name ) \
|
||
else if (0 == sServiceName.compareToAscii(SERVICE_PERSISTENT_COMPONENT_##name)) \
|
||
sToWriteServiceName = SERVICE_##name
|
||
|
||
if (sal_False)
|
||
;
|
||
CHECK_N_TRANSLATE( FORM );
|
||
CHECK_N_TRANSLATE( FORM );
|
||
CHECK_N_TRANSLATE( LISTBOX );
|
||
CHECK_N_TRANSLATE( COMBOBOX );
|
||
CHECK_N_TRANSLATE( RADIOBUTTON );
|
||
CHECK_N_TRANSLATE( GROUPBOX );
|
||
CHECK_N_TRANSLATE( FIXEDTEXT );
|
||
CHECK_N_TRANSLATE( COMMANDBUTTON );
|
||
CHECK_N_TRANSLATE( CHECKBOX );
|
||
CHECK_N_TRANSLATE( GRID );
|
||
CHECK_N_TRANSLATE( IMAGEBUTTON );
|
||
CHECK_N_TRANSLATE( FILECONTROL );
|
||
CHECK_N_TRANSLATE( TIMEFIELD );
|
||
CHECK_N_TRANSLATE( DATEFIELD );
|
||
CHECK_N_TRANSLATE( NUMERICFIELD );
|
||
CHECK_N_TRANSLATE( CURRENCYFIELD );
|
||
CHECK_N_TRANSLATE( PATTERNFIELD );
|
||
CHECK_N_TRANSLATE( HIDDENCONTROL );
|
||
CHECK_N_TRANSLATE( IMAGECONTROL );
|
||
CHECK_N_TRANSLATE( FORMATTEDFIELD );
|
||
else if (0 == sServiceName.compareToAscii(SERVICE_PERSISTENT_COMPONENT_EDIT))
|
||
{ // special handling for the edit field: we have two controls using this as persistence service name
|
||
sToWriteServiceName = SERVICE_EDIT;
|
||
Reference< XServiceInfo > xSI(m_xProps, UNO_QUERY);
|
||
if (xSI.is() && xSI->supportsService(SERVICE_FORMATTEDFIELD))
|
||
sToWriteServiceName = SERVICE_FORMATTEDFIELD;
|
||
}
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
Reference< XServiceInfo > xSI(m_xProps, UNO_QUERY);
|
||
OSL_ENSURE(xSI.is() && xSI->supportsService(sToWriteServiceName),
|
||
"OElementExport::exportServiceNameAttribute: wrong service name translation!");
|
||
|
||
#endif
|
||
sToWriteServiceName =
|
||
m_rContext.getGlobalContext().GetNamespaceMap().GetQNameByKey(
|
||
XML_NAMESPACE_OOO, sToWriteServiceName );
|
||
|
||
// now write this
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SERVICE_NAME),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_SERVICE_NAME),
|
||
sToWriteServiceName);
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OElementExport::exportEvents()
|
||
{
|
||
if (!m_aEvents.getLength())
|
||
// nothing to do
|
||
return;
|
||
|
||
Reference< XNameReplace > xWrapper = new OEventDescriptorMapper(m_aEvents);
|
||
m_rContext.getGlobalContext().GetEventExport().Export(xWrapper);
|
||
}
|
||
|
||
//=====================================================================
|
||
//= OControlExport
|
||
//=====================================================================
|
||
//---------------------------------------------------------------------
|
||
OControlExport::OControlExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxControl,
|
||
const ::rtl::OUString& _rControlId, const ::rtl::OUString& _rReferringControls,
|
||
const Sequence< ScriptEventDescriptor >& _rEvents)
|
||
:OElementExport(_rContext, _rxControl, _rEvents)
|
||
,m_sControlId(_rControlId)
|
||
,m_sReferringControls(_rReferringControls)
|
||
,m_nClassId(FormComponentType::CONTROL)
|
||
,m_eType( UNKNOWN )
|
||
,m_nIncludeCommon(0)
|
||
,m_nIncludeDatabase(0)
|
||
,m_nIncludeSpecial(0)
|
||
,m_nIncludeEvents(0)
|
||
,m_nIncludeBindings(0)
|
||
,m_pOuterElement(NULL)
|
||
{
|
||
OSL_ENSURE(m_xProps.is(), "OControlExport::OControlExport: invalid arguments!");
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
OControlExport::~OControlExport()
|
||
{
|
||
implEndElement();
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportOuterAttributes()
|
||
{
|
||
// the control id
|
||
if (CCA_NAME & m_nIncludeCommon)
|
||
{
|
||
exportStringPropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_NAME),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_NAME),
|
||
PROPERTY_NAME
|
||
);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_NAME;
|
||
#endif
|
||
}
|
||
|
||
// the service name
|
||
if (m_nIncludeCommon & CCA_SERVICE_NAME)
|
||
{
|
||
exportServiceNameAttribute();
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_SERVICE_NAME;
|
||
#endif
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportInnerAttributes()
|
||
{
|
||
// the control id
|
||
if (CCA_CONTROL_ID & m_nIncludeCommon)
|
||
{
|
||
OSL_ENSURE(m_sControlId.getLength(), "OControlExport::exportInnerAttributes: have no control id for the control!");
|
||
m_rContext.getGlobalContext().AddAttributeIdLegacy(
|
||
XML_NAMESPACE_FORM, m_sControlId);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_CONTROL_ID;
|
||
#endif
|
||
}
|
||
|
||
// "new-style" properties ...
|
||
exportGenericHandlerAttributes();
|
||
|
||
// common control attributes
|
||
exportCommonControlAttributes();
|
||
|
||
// common database attributes
|
||
exportDatabaseAttributes();
|
||
|
||
// attributes related to external bindings
|
||
exportBindingAtributes();
|
||
|
||
// attributes special to the respective control type
|
||
exportSpecialAttributes();
|
||
|
||
// add the style references to the attributes
|
||
flagStyleProperties();
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportAttributes()
|
||
{
|
||
exportOuterAttributes();
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportSubTags() throw (Exception)
|
||
{
|
||
// for the upcoming exportRemainingProperties:
|
||
// if a control has the LabelControl property, this is not stored with the control itself, but instead with
|
||
// the control which is referenced by this property. As the base class' exportRemainingProperties doesn't
|
||
// know anything about this, we need to prevent that it tries to export this property
|
||
exportedProperty(PROPERTY_CONTROLLABEL);
|
||
|
||
// if it's a control supporting XText, then we need to declare all text-related properties
|
||
// as "already exported". This prevents them from being exported as generic "form:property"-tags.
|
||
// *If* we would export them this way, they would be completely superfluous, and sometimes even
|
||
// disastrous, since they may, at import time, override paragraph properties which already have
|
||
// been set before
|
||
Reference< XText > xControlText( m_xProps, UNO_QUERY );
|
||
if ( xControlText.is() )
|
||
{
|
||
const XMLPropertyMapEntry* pCharAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TEXT_PROP_MAP_TEXT );
|
||
while ( pCharAttributeProperties->msApiName )
|
||
{
|
||
exportedProperty( ::rtl::OUString::createFromAscii( pCharAttributeProperties->msApiName ) );
|
||
++pCharAttributeProperties;
|
||
}
|
||
|
||
const XMLPropertyMapEntry* pParaAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TEXT_PROP_MAP_SHAPE_PARA );
|
||
while ( pParaAttributeProperties->msApiName )
|
||
{
|
||
exportedProperty( ::rtl::OUString::createFromAscii( pParaAttributeProperties->msApiName ) );
|
||
++pParaAttributeProperties;
|
||
}
|
||
|
||
// the RichText property is not exported. The presence of the text:p element
|
||
// will be used - upon reading - as indicator for the value of the RichText property
|
||
exportedProperty( PROPERTY_RICH_TEXT );
|
||
|
||
// strange thing: paragraphs support both a CharStrikeout and a CharCrossedOut property
|
||
// The former is a short/enum value, the latter a boolean. The former has a real meaning
|
||
// (the strikeout type), the latter hasn't. But, when the CharCrossedOut is exported and
|
||
// later on imported, it overwrites anything which has previously been imported for
|
||
// CharStrikeout.
|
||
// #i27729#
|
||
exportedProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharCrossedOut" ) ) );
|
||
}
|
||
|
||
if ( m_eType == LISTBOX )
|
||
{
|
||
// will be exported in exportListSourceAsElements:
|
||
if ( controlHasUserSuppliedListEntries() )
|
||
exportedProperty( PROPERTY_DEFAULT_SELECT_SEQ );
|
||
|
||
// will not be exported in a generic way. Either exportListSourceAsElements cares
|
||
// for them, or we don't need them
|
||
exportedProperty( PROPERTY_STRING_ITEM_LIST );
|
||
exportedProperty( PROPERTY_VALUE_SEQ );
|
||
exportedProperty( PROPERTY_SELECT_SEQ );
|
||
exportedProperty( PROPERTY_LISTSOURCE );
|
||
}
|
||
if ( m_eType == COMBOBOX )
|
||
exportedProperty( PROPERTY_STRING_ITEM_LIST );
|
||
|
||
// let the base class export the remaining properties and the events
|
||
OElementExport::exportSubTags();
|
||
|
||
// special sub tags for some controls
|
||
switch (m_eType)
|
||
{
|
||
case LISTBOX:
|
||
// don't export the list entries if the are not provided by the user, but obtained implicitly
|
||
// from other sources
|
||
// #i26944#
|
||
if ( controlHasUserSuppliedListEntries() )
|
||
exportListSourceAsElements();
|
||
break;
|
||
case GRID:
|
||
{ // a grid control requires us to store all columns as sub elements
|
||
Reference< XIndexAccess > xColumnContainer(m_xProps, UNO_QUERY);
|
||
OSL_ENSURE(xColumnContainer.is(), "OControlExport::exportSubTags: a grid control which is no IndexAccess?!!");
|
||
if (xColumnContainer.is())
|
||
m_rContext.exportCollectionElements(xColumnContainer);
|
||
}
|
||
break;
|
||
case COMBOBOX:
|
||
{ // a combox box description has sub elements: the items
|
||
DBG_CHECK_PROPERTY( PROPERTY_STRING_ITEM_LIST, Sequence< ::rtl::OUString > );
|
||
|
||
// don't export the list entries if the are not provided by the user, but obtained implicitly
|
||
// from other sources
|
||
// #i26944#
|
||
if ( controlHasUserSuppliedListEntries() )
|
||
{
|
||
// get the item list
|
||
Sequence< ::rtl::OUString > aListItems;
|
||
m_xProps->getPropertyValue(PROPERTY_STRING_ITEM_LIST) >>= aListItems;
|
||
// loop through it and write the sub elements
|
||
const ::rtl::OUString* pListItems = aListItems.getConstArray();
|
||
for (sal_Int32 i=0; i<aListItems.getLength(); ++i, ++pListItems)
|
||
{
|
||
m_rContext.getGlobalContext().ClearAttrList();
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_LABEL),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL),
|
||
*pListItems);
|
||
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "item", sal_True, sal_True);
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case TEXT_AREA:
|
||
{
|
||
// if we act as rich text control, we need to export some text:p elements
|
||
if ( xControlText.is() )
|
||
{
|
||
sal_Bool bActingAsRichText = sal_False;
|
||
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_RICH_TEXT ) )
|
||
{
|
||
OSL_VERIFY(m_xProps->getPropertyValue( PROPERTY_RICH_TEXT ) >>= bActingAsRichText );
|
||
}
|
||
|
||
if ( bActingAsRichText )
|
||
m_rContext.getGlobalContext().GetTextParagraphExport()->exportText( xControlText );
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
// nothing do to
|
||
break;
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportGenericHandlerAttributes()
|
||
{
|
||
const Sequence< Property > aProperties = m_xPropertyInfo->getProperties();
|
||
for ( const Property* prop = aProperties.getConstArray();
|
||
prop != aProperties.getConstArray() + aProperties.getLength();
|
||
++prop
|
||
)
|
||
{
|
||
try
|
||
{
|
||
// see if this property can already be handled with an IPropertyHandler (which, on the long
|
||
// term, should be the case for most, if not all, properties)
|
||
const PropertyDescription* propDescription = metadata::getPropertyDescription( prop->Name );
|
||
if ( propDescription == NULL )
|
||
continue;
|
||
|
||
// let the factory provide the concrete handler. Note that caching, if desired, is the task
|
||
// of the factory
|
||
PPropertyHandler handler = (*propDescription->factory)( propDescription->propertyId );
|
||
ENSURE_OR_CONTINUE( handler.get() != NULL,
|
||
"OControlExport::exportGenericHandlerAttributes: invalid property handler provided by the factory!" );
|
||
|
||
::rtl::OUString attributeValue;
|
||
if ( propDescription->propertyGroup == NO_GROUP )
|
||
{
|
||
// that's a property which has a direct mapping to an attribute
|
||
if ( !shouldExportProperty( prop->Name ) )
|
||
// TODO: in the future, we surely need a more sophisticated approach to this, involving the property
|
||
// handler, or the property description
|
||
{
|
||
exportedProperty( prop->Name );
|
||
continue;
|
||
}
|
||
|
||
const Any propValue = m_xProps->getPropertyValue( prop->Name );
|
||
attributeValue = handler->getAttributeValue( propValue );
|
||
}
|
||
else
|
||
{
|
||
// that's a property which is part of a group of properties, whose values, in their entity, comprise
|
||
// a single attribute value
|
||
|
||
// retrieve the descriptions of all other properties which add to the attribute value
|
||
PropertyDescriptionList descriptions;
|
||
metadata::getPropertyGroup( propDescription->propertyGroup, descriptions );
|
||
|
||
// retrieve the values for all those properties
|
||
PropertyValues aValues;
|
||
for ( PropertyDescriptionList::iterator desc = descriptions.begin();
|
||
desc != descriptions.end();
|
||
++desc
|
||
)
|
||
{
|
||
// TODO: XMultiPropertySet?
|
||
const Any propValue = m_xProps->getPropertyValue( (*desc)->propertyName );
|
||
aValues[ (*desc)->propertyId ] = propValue;
|
||
}
|
||
|
||
// let the handler translate into an XML attribute value
|
||
attributeValue = handler->getAttributeValue( aValues );
|
||
}
|
||
|
||
AddAttribute(
|
||
propDescription->attribute.namespacePrefix,
|
||
token::GetXMLToken( propDescription->attribute.attributeToken ),
|
||
attributeValue
|
||
);
|
||
|
||
exportedProperty( prop->Name );
|
||
}
|
||
catch( const Exception& )
|
||
{
|
||
DBG_UNHANDLED_EXCEPTION();
|
||
}
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportCommonControlAttributes()
|
||
{
|
||
size_t i=0;
|
||
|
||
// I decided to handle all the properties here with some static arrays describing the property-attribute
|
||
// relations. This leads to somewhat ugly code :), but the only alternative I can think of right now
|
||
// would require maps and O(log n) searches, which seems somewhat expensive as this code is used
|
||
// very frequently.
|
||
|
||
// the extra indents for the respective blocks are to ensure that there is no copy'n'paste error, using
|
||
// map identifiers from the wrong block
|
||
|
||
// --------------------------------------------------------------------
|
||
// some string properties
|
||
{
|
||
// the attribute ids of all properties which are expected to be of type string
|
||
static sal_Int32 nStringPropertyAttributeIds[] =
|
||
{
|
||
CCA_LABEL, CCA_TITLE
|
||
};
|
||
// the names of all properties which are expected to be of type string
|
||
static ::rtl::OUString aStringPropertyNames[] =
|
||
{
|
||
PROPERTY_LABEL, PROPERTY_TITLE
|
||
};
|
||
OSL_ENSURE( SAL_N_ELEMENTS(aStringPropertyNames) == SAL_N_ELEMENTS(nStringPropertyAttributeIds),
|
||
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (1)!");
|
||
|
||
for (i=0; i < SAL_N_ELEMENTS(nStringPropertyAttributeIds); ++i)
|
||
if (nStringPropertyAttributeIds[i] & m_nIncludeCommon)
|
||
{
|
||
exportStringPropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(nStringPropertyAttributeIds[i]),
|
||
OAttributeMetaData::getCommonControlAttributeName(nStringPropertyAttributeIds[i]),
|
||
aStringPropertyNames[i]
|
||
);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~nStringPropertyAttributeIds[i];
|
||
#endif
|
||
}
|
||
}
|
||
|
||
// --------------------------------------------------------------------
|
||
// some boolean properties
|
||
{
|
||
static sal_Int32 nBooleanPropertyAttributeIds[] =
|
||
{ // attribute flags
|
||
CCA_CURRENT_SELECTED, CCA_DISABLED, CCA_DROPDOWN, CCA_PRINTABLE, CCA_READONLY, CCA_SELECTED, CCA_TAB_STOP, CCA_ENABLEVISIBLE
|
||
};
|
||
static const ::rtl::OUString* pBooleanPropertyNames[] =
|
||
{ // property names
|
||
&PROPERTY_STATE, &PROPERTY_ENABLED, &PROPERTY_DROPDOWN, &PROPERTY_PRINTABLE, &PROPERTY_READONLY, &PROPERTY_DEFAULT_STATE, &PROPERTY_TABSTOP, &PROPERTY_ENABLEVISIBLE
|
||
};
|
||
static sal_Bool nBooleanPropertyAttrFlags[] =
|
||
{ // attribute defaults
|
||
BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE | BOOLATTR_INVERSE_SEMANTICS, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_VOID, BOOLATTR_DEFAULT_FALSE
|
||
};
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS(nBooleanPropertyAttributeIds);
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames);
|
||
sal_Int32 nFlagsCount = SAL_N_ELEMENTS(nBooleanPropertyAttrFlags);
|
||
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
|
||
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (2)!");
|
||
#endif
|
||
for (i=0; i < SAL_N_ELEMENTS(nBooleanPropertyAttributeIds); ++i)
|
||
if (nBooleanPropertyAttributeIds[i] & m_nIncludeCommon)
|
||
{
|
||
exportBooleanPropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(nBooleanPropertyAttributeIds[i]),
|
||
OAttributeMetaData::getCommonControlAttributeName(nBooleanPropertyAttributeIds[i]),
|
||
*(pBooleanPropertyNames[i]),
|
||
nBooleanPropertyAttrFlags[i]);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~nBooleanPropertyAttributeIds[i];
|
||
#endif
|
||
}
|
||
}
|
||
|
||
|
||
// --------------------------------------------------------------------
|
||
// some integer properties
|
||
{
|
||
// now the common handling
|
||
static sal_Int32 nIntegerPropertyAttributeIds[] =
|
||
{ // attribute flags
|
||
CCA_SIZE, CCA_TAB_INDEX
|
||
};
|
||
static const ::rtl::OUString* pIntegerPropertyNames[] =
|
||
{ // property names
|
||
&PROPERTY_LINECOUNT, &PROPERTY_TABINDEX
|
||
};
|
||
static const sal_Int16 nIntegerPropertyAttrDefaults[] =
|
||
{ // attribute defaults
|
||
5, 0
|
||
};
|
||
|
||
if ( m_nIncludeCommon & CCA_MAX_LENGTH )
|
||
exportedProperty(PROPERTY_MAXTEXTLENGTH);
|
||
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS(nIntegerPropertyAttributeIds);
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS(pIntegerPropertyNames);
|
||
sal_Int32 nDefaultCount = SAL_N_ELEMENTS(nIntegerPropertyAttrDefaults);
|
||
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount),
|
||
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (3)!");
|
||
#endif
|
||
for (i=0; i < SAL_N_ELEMENTS(nIntegerPropertyAttributeIds); ++i)
|
||
if (nIntegerPropertyAttributeIds[i] & m_nIncludeCommon)
|
||
{
|
||
exportInt16PropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(nIntegerPropertyAttributeIds[i]),
|
||
OAttributeMetaData::getCommonControlAttributeName(nIntegerPropertyAttributeIds[i]),
|
||
*(pIntegerPropertyNames[i]),
|
||
nIntegerPropertyAttrDefaults[i]);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~nIntegerPropertyAttributeIds[i];
|
||
#endif
|
||
}
|
||
|
||
|
||
}
|
||
|
||
// --------------------------------------------------------------------
|
||
// some enum properties
|
||
{
|
||
if (m_nIncludeCommon & CCA_BUTTON_TYPE)
|
||
{
|
||
exportEnumPropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_BUTTON_TYPE),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_BUTTON_TYPE),
|
||
PROPERTY_BUTTONTYPE,
|
||
OEnumMapper::getEnumMap(OEnumMapper::epButtonType),
|
||
FormButtonType_PUSH);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_BUTTON_TYPE;
|
||
#endif
|
||
}
|
||
if ( m_nIncludeCommon & CCA_ORIENTATION )
|
||
{
|
||
exportEnumPropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace( CCA_ORIENTATION ),
|
||
OAttributeMetaData::getCommonControlAttributeName( CCA_ORIENTATION ),
|
||
PROPERTY_ORIENTATION,
|
||
OEnumMapper::getEnumMap( OEnumMapper::epOrientation ),
|
||
ScrollBarOrientation::HORIZONTAL
|
||
);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_ORIENTATION;
|
||
#endif
|
||
}
|
||
|
||
if ( m_nIncludeCommon & CCA_VISUAL_EFFECT )
|
||
{
|
||
exportEnumPropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace( CCA_VISUAL_EFFECT ),
|
||
OAttributeMetaData::getCommonControlAttributeName( CCA_VISUAL_EFFECT ),
|
||
PROPERTY_VISUAL_EFFECT,
|
||
OEnumMapper::getEnumMap( OEnumMapper::epVisualEffect ),
|
||
VisualEffect::LOOK3D
|
||
);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_VISUAL_EFFECT;
|
||
#endif
|
||
}
|
||
}
|
||
|
||
// --------------------------------------------------------------------
|
||
// some properties which require a special handling
|
||
|
||
// the target frame
|
||
if (m_nIncludeCommon & CCA_TARGET_FRAME)
|
||
{
|
||
exportTargetFrameAttribute();
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_FRAME;
|
||
#endif
|
||
}
|
||
|
||
// max text length
|
||
if ( m_nIncludeCommon & CCA_MAX_LENGTH )
|
||
{
|
||
// normally, the respective property would be "MaxTextLen"
|
||
// However, if the model has a property "PersistenceMaxTextLength", then we prefer this
|
||
|
||
// determine the name of the property to export
|
||
::rtl::OUString sTextLenPropertyName( PROPERTY_MAXTEXTLENGTH );
|
||
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_PERSISTENCE_MAXTEXTLENGTH ) )
|
||
sTextLenPropertyName = PROPERTY_PERSISTENCE_MAXTEXTLENGTH;
|
||
|
||
// export it
|
||
exportInt16PropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace( CCA_MAX_LENGTH ),
|
||
OAttributeMetaData::getCommonControlAttributeName( CCA_MAX_LENGTH ),
|
||
sTextLenPropertyName,
|
||
0
|
||
);
|
||
|
||
// in either way, both properties count as "exported"
|
||
exportedProperty( PROPERTY_MAXTEXTLENGTH );
|
||
exportedProperty( PROPERTY_PERSISTENCE_MAXTEXTLENGTH );
|
||
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_MAX_LENGTH;
|
||
#endif
|
||
}
|
||
|
||
if (m_nIncludeCommon & CCA_TARGET_LOCATION)
|
||
{
|
||
exportTargetLocationAttribute(false);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_LOCATION;
|
||
#endif
|
||
}
|
||
|
||
// OJ #99721#
|
||
if (m_nIncludeCommon & CCA_IMAGE_DATA)
|
||
{
|
||
exportImageDataAttribute();
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_IMAGE_DATA;
|
||
#endif
|
||
}
|
||
|
||
// the for attribute
|
||
// the target frame
|
||
if (m_nIncludeCommon & CCA_FOR)
|
||
{
|
||
if (m_sReferringControls.getLength())
|
||
{ // there is at least one control referring to the one we're handling currently
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_FOR),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_FOR),
|
||
m_sReferringControls);
|
||
}
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~CCA_FOR;
|
||
#endif
|
||
}
|
||
|
||
if ((CCA_CURRENT_VALUE | CCA_VALUE) & m_nIncludeCommon)
|
||
{
|
||
const sal_Char* pCurrentValuePropertyName = NULL;
|
||
const sal_Char* pValuePropertyName = NULL;
|
||
|
||
// get the property names
|
||
getValuePropertyNames(m_eType, m_nClassId, pCurrentValuePropertyName, pValuePropertyName);
|
||
|
||
static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_VALUE);
|
||
static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_VALUE);
|
||
static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CURRENT_VALUE);
|
||
static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCA_VALUE);
|
||
|
||
// add the atrtributes if necessary and possible
|
||
if (pCurrentValuePropertyName && (CCA_CURRENT_VALUE & m_nIncludeCommon))
|
||
{
|
||
// don't export the current-value if this value originates from a data binding
|
||
// #i26944#
|
||
if ( controlHasActiveDataBinding() )
|
||
exportedProperty( ::rtl::OUString::createFromAscii( pCurrentValuePropertyName ) );
|
||
else
|
||
exportGenericPropertyAttribute(
|
||
nCurrentValueAttributeNamespaceKey,
|
||
pCurrentValueAttributeName,
|
||
pCurrentValuePropertyName
|
||
);
|
||
}
|
||
|
||
if (pValuePropertyName && (CCA_VALUE & m_nIncludeCommon))
|
||
exportGenericPropertyAttribute(
|
||
nValueAttributeNamespaceKey,
|
||
pValueAttributeName,
|
||
pValuePropertyName);
|
||
|
||
OSL_ENSURE((NULL == pValuePropertyName) == (0 == (CCA_VALUE & m_nIncludeCommon)),
|
||
"OControlExport::exportCommonControlAttributes: no property found for the value attribute!");
|
||
OSL_ENSURE((NULL == pCurrentValuePropertyName ) == (0 == (CCA_CURRENT_VALUE & m_nIncludeCommon)),
|
||
"OControlExport::exportCommonControlAttributes: no property found for the current-value attribute!");
|
||
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeCommon = m_nIncludeCommon & ~(CCA_CURRENT_VALUE | CCA_VALUE);
|
||
#endif
|
||
}
|
||
|
||
OSL_ENSURE(0 == m_nIncludeCommon,
|
||
"OControlExport::exportCommonControlAttributes: forgot some flags!");
|
||
// in the dbg_util version, we should have removed every bit we handled from the mask, so it should
|
||
// be 0 now ...
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportDatabaseAttributes()
|
||
{
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nIncludeDatabase = m_nIncludeDatabase;
|
||
#endif
|
||
// the only string property: DataField
|
||
if (DA_DATA_FIELD & m_nIncludeDatabase)
|
||
{
|
||
exportStringPropertyAttribute(
|
||
OAttributeMetaData::getDatabaseAttributeNamespace(DA_DATA_FIELD),
|
||
OAttributeMetaData::getDatabaseAttributeName(DA_DATA_FIELD),
|
||
PROPERTY_DATAFIELD);
|
||
RESET_BIT( nIncludeDatabase, DA_DATA_FIELD );
|
||
}
|
||
|
||
// InputRequired
|
||
if ( DA_INPUT_REQUIRED & m_nIncludeDatabase )
|
||
{
|
||
exportBooleanPropertyAttribute(
|
||
OAttributeMetaData::getDatabaseAttributeNamespace( DA_INPUT_REQUIRED ),
|
||
OAttributeMetaData::getDatabaseAttributeName( DA_INPUT_REQUIRED ),
|
||
PROPERTY_INPUT_REQUIRED,
|
||
BOOLATTR_DEFAULT_TRUE
|
||
);
|
||
RESET_BIT( nIncludeDatabase, DA_INPUT_REQUIRED );
|
||
}
|
||
|
||
// the only int16 property: BoundColumn
|
||
if (DA_BOUND_COLUMN & m_nIncludeDatabase)
|
||
{
|
||
exportInt16PropertyAttribute(
|
||
OAttributeMetaData::getDatabaseAttributeNamespace(DA_BOUND_COLUMN),
|
||
OAttributeMetaData::getDatabaseAttributeName(DA_BOUND_COLUMN),
|
||
PROPERTY_BOUNDCOLUMN,
|
||
0);
|
||
RESET_BIT( nIncludeDatabase, DA_BOUND_COLUMN );
|
||
}
|
||
|
||
// ConvertEmptyToNull
|
||
if (DA_CONVERT_EMPTY & m_nIncludeDatabase)
|
||
{
|
||
exportBooleanPropertyAttribute(
|
||
OAttributeMetaData::getDatabaseAttributeNamespace(DA_CONVERT_EMPTY),
|
||
OAttributeMetaData::getDatabaseAttributeName(DA_CONVERT_EMPTY),
|
||
PROPERTY_EMPTY_IS_NULL,
|
||
BOOLATTR_DEFAULT_FALSE
|
||
);
|
||
RESET_BIT( nIncludeDatabase, DA_CONVERT_EMPTY );
|
||
}
|
||
|
||
// the only enum property: ListSourceType
|
||
if (DA_LIST_SOURCE_TYPE & m_nIncludeDatabase)
|
||
{
|
||
exportEnumPropertyAttribute(
|
||
OAttributeMetaData::getDatabaseAttributeNamespace(DA_LIST_SOURCE_TYPE),
|
||
OAttributeMetaData::getDatabaseAttributeName(DA_LIST_SOURCE_TYPE),
|
||
PROPERTY_LISTSOURCETYPE,
|
||
OEnumMapper::getEnumMap(OEnumMapper::epListSourceType),
|
||
ListSourceType_VALUELIST
|
||
);
|
||
RESET_BIT( nIncludeDatabase, DA_LIST_SOURCE_TYPE );
|
||
}
|
||
|
||
if (m_nIncludeDatabase & DA_LIST_SOURCE)
|
||
{
|
||
exportListSourceAsAttribute();
|
||
RESET_BIT( nIncludeDatabase, DA_LIST_SOURCE );
|
||
}
|
||
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
OSL_ENSURE(0 == nIncludeDatabase,
|
||
"OControlExport::exportDatabaseAttributes: forgot some flags!");
|
||
// in the dbg_util version, we should have removed every bit we handled from the mask, so it should
|
||
// be 0 now ...
|
||
#endif
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportBindingAtributes()
|
||
{
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nIncludeBinding = m_nIncludeBindings;
|
||
#endif
|
||
|
||
// ....................................................
|
||
if ( m_nIncludeBindings & BA_LINKED_CELL )
|
||
{
|
||
exportCellBindingAttributes( ( m_nIncludeBindings & BA_LIST_LINKING_TYPE ) != 0 );
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
nIncludeBinding = nIncludeBinding & ~( BA_LINKED_CELL | BA_LIST_LINKING_TYPE );
|
||
#endif
|
||
}
|
||
|
||
// ....................................................
|
||
if ( m_nIncludeBindings & BA_LIST_CELL_RANGE )
|
||
{
|
||
exportCellListSourceRange();
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
nIncludeBinding = nIncludeBinding & ~BA_LIST_CELL_RANGE;
|
||
#endif
|
||
}
|
||
|
||
if ( m_nIncludeBindings & BA_XFORMS_BIND )
|
||
{
|
||
exportXFormsBindAttributes();
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
nIncludeBinding = nIncludeBinding & ~BA_XFORMS_BIND;
|
||
#endif
|
||
}
|
||
|
||
if ( m_nIncludeBindings & BA_XFORMS_LISTBIND )
|
||
{
|
||
exportXFormsListAttributes();
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
nIncludeBinding = nIncludeBinding & ~BA_XFORMS_LISTBIND;
|
||
#endif
|
||
}
|
||
|
||
if ( m_nIncludeBindings & BA_XFORMS_SUBMISSION )
|
||
{
|
||
exportXFormsSubmissionAttributes();
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
nIncludeBinding = nIncludeBinding & ~BA_XFORMS_SUBMISSION;
|
||
#endif
|
||
}
|
||
|
||
OSL_ENSURE( 0 == nIncludeBinding,
|
||
"OControlExport::exportBindingAtributes: forgot some flags!");
|
||
// in the debug version, we should have removed every bit we handled from the mask, so it should
|
||
// be 0 now ...
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportSpecialAttributes()
|
||
{
|
||
sal_Int32 i=0;
|
||
|
||
// ----------------------
|
||
// the boolean properties
|
||
{
|
||
static const sal_Int32 nBooleanPropertyAttributeIds[] =
|
||
{ // attribute flags
|
||
SCA_VALIDATION, SCA_MULTI_LINE, SCA_AUTOMATIC_COMPLETION, SCA_MULTIPLE, SCA_DEFAULT_BUTTON, SCA_IS_TRISTATE,
|
||
SCA_TOGGLE, SCA_FOCUS_ON_CLICK
|
||
};
|
||
static const ::rtl::OUString* pBooleanPropertyNames[] =
|
||
{ // property names
|
||
&PROPERTY_STRICTFORMAT, &PROPERTY_MULTILINE, &PROPERTY_AUTOCOMPLETE, &PROPERTY_MULTISELECTION, &PROPERTY_DEFAULTBUTTON, &PROPERTY_TRISTATE,
|
||
&PROPERTY_TOGGLE, &PROPERTY_FOCUS_ON_CLICK
|
||
};
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS(nBooleanPropertyAttributeIds);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames);
|
||
OSL_ENSURE((nIdCount == nNameCount),
|
||
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (1)!");
|
||
#endif
|
||
const sal_Int32* pAttributeId = nBooleanPropertyAttributeIds;
|
||
const ::rtl::OUString** pPropertyName = pBooleanPropertyNames;
|
||
for ( i = 0; i < nIdCount; ++i, ++pAttributeId, ++pPropertyName )
|
||
{
|
||
if ( *pAttributeId& m_nIncludeSpecial)
|
||
{
|
||
exportBooleanPropertyAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace( *pAttributeId ),
|
||
OAttributeMetaData::getSpecialAttributeName( *pAttributeId ),
|
||
*(*pPropertyName),
|
||
( *pAttributeId == SCA_FOCUS_ON_CLICK ) ? BOOLATTR_DEFAULT_TRUE : BOOLATTR_DEFAULT_FALSE
|
||
);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~*pAttributeId;
|
||
#endif
|
||
}
|
||
}
|
||
}
|
||
|
||
// ----------------------
|
||
// the integer properties
|
||
{
|
||
static sal_Int32 nIntegerPropertyAttributeIds[] =
|
||
{ // attribute flags
|
||
SCA_PAGE_STEP_SIZE
|
||
};
|
||
static const ::rtl::OUString* pIntegerPropertyNames[] =
|
||
{ // property names
|
||
&PROPERTY_BLOCK_INCREMENT
|
||
};
|
||
static const sal_Int32 nIntegerPropertyAttrDefaults[] =
|
||
{ // attribute defaults (XML defaults, not runtime defaults!)
|
||
10
|
||
};
|
||
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS( nIntegerPropertyAttributeIds );
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS( pIntegerPropertyNames );
|
||
OSL_ENSURE( ( nIdCount == nNameCount ),
|
||
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
|
||
sal_Int32 nDefaultCount = SAL_N_ELEMENTS( nIntegerPropertyAttrDefaults );
|
||
OSL_ENSURE( ( nIdCount == nDefaultCount ),
|
||
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (3)!" );
|
||
#endif
|
||
for ( i = 0; i < nIdCount; ++i )
|
||
if ( nIntegerPropertyAttributeIds[i] & m_nIncludeSpecial )
|
||
{
|
||
exportInt32PropertyAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace( nIntegerPropertyAttributeIds[i] ),
|
||
OAttributeMetaData::getSpecialAttributeName( nIntegerPropertyAttributeIds[i] ),
|
||
*( pIntegerPropertyNames[i] ),
|
||
nIntegerPropertyAttrDefaults[i]
|
||
);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~nIntegerPropertyAttributeIds[i];
|
||
#endif
|
||
}
|
||
|
||
if ( SCA_STEP_SIZE & m_nIncludeSpecial )
|
||
{
|
||
::rtl::OUString sPropertyName;
|
||
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_LINE_INCREMENT ) )
|
||
sPropertyName = PROPERTY_LINE_INCREMENT;
|
||
else if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_SPIN_INCREMENT ) )
|
||
sPropertyName = PROPERTY_SPIN_INCREMENT;
|
||
else
|
||
OSL_ENSURE( sal_False, "OControlExport::exportSpecialAttributes: not property which can be mapped to step-size attribute!" );
|
||
|
||
if ( sPropertyName.getLength() )
|
||
exportInt32PropertyAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace( SCA_STEP_SIZE ),
|
||
OAttributeMetaData::getSpecialAttributeName( SCA_STEP_SIZE ),
|
||
sPropertyName,
|
||
1
|
||
);
|
||
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_STEP_SIZE;
|
||
#endif
|
||
}
|
||
|
||
}
|
||
|
||
// -------------------
|
||
// the enum properties
|
||
{
|
||
if (SCA_STATE & m_nIncludeSpecial)
|
||
{
|
||
exportEnumPropertyAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace(SCA_STATE),
|
||
OAttributeMetaData::getSpecialAttributeName(SCA_STATE),
|
||
PROPERTY_DEFAULT_STATE,
|
||
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
||
STATE_NOCHECK);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_STATE;
|
||
#endif
|
||
}
|
||
|
||
if (SCA_CURRENT_STATE & m_nIncludeSpecial)
|
||
{
|
||
exportEnumPropertyAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace(SCA_CURRENT_STATE),
|
||
OAttributeMetaData::getSpecialAttributeName(SCA_CURRENT_STATE),
|
||
PROPERTY_STATE,
|
||
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
||
STATE_NOCHECK);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_CURRENT_STATE;
|
||
#endif
|
||
}
|
||
}
|
||
|
||
// --------------------------------------------------------------------
|
||
// some properties which require a special handling
|
||
// the repeat delay
|
||
{
|
||
if ( m_nIncludeSpecial & SCA_REPEAT_DELAY )
|
||
{
|
||
DBG_CHECK_PROPERTY( PROPERTY_REPEAT_DELAY, sal_Int32 );
|
||
|
||
sal_Int32 nRepeatDelay = 0;
|
||
m_xProps->getPropertyValue( PROPERTY_REPEAT_DELAY ) >>= nRepeatDelay;
|
||
Time aTime;
|
||
aTime.MakeTimeFromMS( nRepeatDelay );
|
||
|
||
AddAttribute(OAttributeMetaData::getSpecialAttributeNamespace( SCA_REPEAT_DELAY )
|
||
,OAttributeMetaData::getSpecialAttributeName( SCA_REPEAT_DELAY )
|
||
,SvXMLUnitConverter::convertTimeDuration( aTime, nRepeatDelay % 1000 ) );
|
||
|
||
exportedProperty( PROPERTY_REPEAT_DELAY );
|
||
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_REPEAT_DELAY;
|
||
#endif
|
||
}
|
||
}
|
||
|
||
// ----------------------------------
|
||
// the EchoChar property needs special handling, cause it's a Int16, but must be stored as one-character-string
|
||
{
|
||
if (SCA_ECHO_CHAR & m_nIncludeSpecial)
|
||
{
|
||
DBG_CHECK_PROPERTY( PROPERTY_ECHO_CHAR, sal_Int16 );
|
||
sal_Int16 nValue(0);
|
||
m_xProps->getPropertyValue(PROPERTY_ECHO_CHAR) >>= nValue;
|
||
if (nValue)
|
||
{
|
||
::rtl::OUString sCharacter(reinterpret_cast<const sal_Unicode*>(&nValue), 1);
|
||
AddAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace(SCA_ECHO_CHAR),
|
||
OAttributeMetaData::getSpecialAttributeName(SCA_ECHO_CHAR),
|
||
sCharacter);
|
||
}
|
||
exportedProperty(PROPERTY_ECHO_CHAR);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~SCA_ECHO_CHAR;
|
||
#endif
|
||
}
|
||
}
|
||
|
||
// ----------------------------------
|
||
// the string properties
|
||
{
|
||
static sal_Int32 nStringPropertyAttributeIds[] =
|
||
{ // attribute flags
|
||
SCA_GROUP_NAME
|
||
};
|
||
static const ::rtl::OUString* pStringPropertyNames[] =
|
||
{ // property names
|
||
&PROPERTY_GROUP_NAME
|
||
};
|
||
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS( nStringPropertyAttributeIds );
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS( pStringPropertyNames );
|
||
OSL_ENSURE( ( nIdCount == nNameCount ),
|
||
"OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
|
||
#endif
|
||
for ( i = 0; i < nIdCount; ++i )
|
||
if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial )
|
||
{
|
||
exportStringPropertyAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ),
|
||
OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ),
|
||
*( pStringPropertyNames[i] )
|
||
);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
|
||
#endif
|
||
}
|
||
}
|
||
|
||
// ----------------------------------
|
||
if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
|
||
{
|
||
// need to export the min value and the max value as attributes
|
||
// It depends on the real type (FormComponentType) of the control, which properties hold these
|
||
// values
|
||
const sal_Char* pMinValuePropertyName = NULL;
|
||
const sal_Char* pMaxValuePropertyName = NULL;
|
||
getValueLimitPropertyNames(m_nClassId, pMinValuePropertyName, pMaxValuePropertyName);
|
||
|
||
OSL_ENSURE((NULL == pMinValuePropertyName) == (0 == (SCA_MIN_VALUE & m_nIncludeSpecial)),
|
||
"OControlExport::exportCommonControlAttributes: no property found for the min value attribute!");
|
||
OSL_ENSURE((NULL == pMaxValuePropertyName) == (0 == (SCA_MAX_VALUE & m_nIncludeSpecial)),
|
||
"OControlExport::exportCommonControlAttributes: no property found for the max value attribute!");
|
||
|
||
// add the two attributes
|
||
static const sal_Char* pMinValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MIN_VALUE);
|
||
static const sal_Char* pMaxValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCA_MAX_VALUE);
|
||
static const sal_uInt16 nMinValueNamespaceKey = OAttributeMetaData::getSpecialAttributeNamespace(SCA_MIN_VALUE);
|
||
static const sal_uInt16 nMaxValueNamespaceKey = OAttributeMetaData::getSpecialAttributeNamespace(SCA_MAX_VALUE);
|
||
|
||
if (pMinValuePropertyName && (SCA_MIN_VALUE & m_nIncludeSpecial))
|
||
exportGenericPropertyAttribute(
|
||
nMinValueNamespaceKey,
|
||
pMinValueAttributeName,
|
||
pMinValuePropertyName);
|
||
|
||
if (pMaxValuePropertyName && (SCA_MAX_VALUE & m_nIncludeSpecial))
|
||
exportGenericPropertyAttribute(
|
||
nMaxValueNamespaceKey,
|
||
pMaxValueAttributeName,
|
||
pMaxValuePropertyName);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
// reset the bit for later checking
|
||
m_nIncludeSpecial = m_nIncludeSpecial & ~(SCA_MIN_VALUE | SCA_MAX_VALUE);
|
||
#endif
|
||
}
|
||
|
||
// ----------------------------------
|
||
if ( SCA_IMAGE_POSITION & m_nIncludeSpecial )
|
||
{
|
||
exportImagePositionAttributes();
|
||
RESET_BIT( m_nIncludeSpecial, SCA_IMAGE_POSITION );
|
||
}
|
||
|
||
OSL_ENSURE(0 == m_nIncludeSpecial,
|
||
"OControlExport::exportSpecialAttributes: forgot some flags!");
|
||
// in the dbg_util version, we should have removed every bit we handled from the mask, so it should
|
||
// be 0 now ...
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
::rtl::OUString OControlExport::getScalarListSourceValue() const
|
||
{
|
||
::rtl::OUString sListSource;
|
||
Any aListSource = m_xProps->getPropertyValue( PROPERTY_LISTSOURCE );
|
||
if ( !( aListSource >>= sListSource ) )
|
||
{
|
||
Sequence< ::rtl::OUString > aListSourceSequence;
|
||
aListSource >>= aListSourceSequence;
|
||
if ( aListSourceSequence.getLength() )
|
||
sListSource = aListSourceSequence[ 0 ];
|
||
}
|
||
return sListSource;
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportListSourceAsAttribute()
|
||
{
|
||
// DA_LIST_SOURCE needs some special handling
|
||
DBG_CHECK_PROPERTY_NO_TYPE( PROPERTY_LISTSOURCE );
|
||
|
||
::rtl::OUString sListSource = getScalarListSourceValue();
|
||
if ( sListSource.getLength() )
|
||
{ // the ListSource property needs to be exported as attribute, and it is not empty
|
||
AddAttribute(
|
||
OAttributeMetaData::getDatabaseAttributeNamespace(DA_LIST_SOURCE),
|
||
OAttributeMetaData::getDatabaseAttributeName(DA_LIST_SOURCE),
|
||
sListSource);
|
||
}
|
||
|
||
exportedProperty( PROPERTY_LISTSOURCE );
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::getSequenceInt16PropertyAsSet(const ::rtl::OUString& _rPropertyName, Int16Set& _rOut)
|
||
{
|
||
Sequence< sal_Int16 > aValueSequence;
|
||
DBG_CHECK_PROPERTY(_rPropertyName, Sequence< sal_Int16 >);
|
||
m_xProps->getPropertyValue(_rPropertyName) >>= aValueSequence;
|
||
|
||
const sal_Int16* pValues = aValueSequence.getConstArray();
|
||
for (sal_Int32 i=0; i<aValueSequence.getLength(); ++i, ++pValues)
|
||
_rOut.insert(*pValues);
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportListSourceAsElements()
|
||
{
|
||
// the string lists
|
||
Sequence< ::rtl::OUString > aItems, aValues;
|
||
DBG_CHECK_PROPERTY( PROPERTY_STRING_ITEM_LIST, Sequence< ::rtl::OUString > );
|
||
m_xProps->getPropertyValue(PROPERTY_STRING_ITEM_LIST) >>= aItems;
|
||
|
||
DBG_CHECK_PROPERTY( PROPERTY_LISTSOURCE, Sequence< ::rtl::OUString > );
|
||
if ( 0 == ( m_nIncludeDatabase & DA_LIST_SOURCE ) )
|
||
m_xProps->getPropertyValue(PROPERTY_LISTSOURCE) >>= aValues;
|
||
// if we exported the list source as attribute, we do not repeat it as sub elements
|
||
|
||
// the selection lists
|
||
Int16Set aSelection, aDefaultSelection;
|
||
getSequenceInt16PropertyAsSet(PROPERTY_SELECT_SEQ, aSelection);
|
||
getSequenceInt16PropertyAsSet(PROPERTY_DEFAULT_SELECT_SEQ, aDefaultSelection);
|
||
|
||
// the string for "true"
|
||
::rtl::OUString sTrue;
|
||
::rtl::OUStringBuffer sBuffer;
|
||
m_rContext.getGlobalContext().GetMM100UnitConverter().convertBool(sBuffer, sal_True);
|
||
sTrue = sBuffer.makeStringAndClear();
|
||
|
||
// loop through both lists ('til the maximum of both lengths)
|
||
const ::rtl::OUString* pItems = aItems.getConstArray();
|
||
const ::rtl::OUString* pValues = aValues.getConstArray();
|
||
|
||
sal_Int32 nItems = aItems.getLength();
|
||
sal_Int32 nValues = aValues.getLength();
|
||
|
||
sal_Int16 nMaxLen = (sal_Int16)std::max(nItems, nValues);
|
||
|
||
for (sal_Int16 i=0; i<nMaxLen; ++i )
|
||
{
|
||
m_rContext.getGlobalContext().ClearAttrList();
|
||
if (i < nItems)
|
||
{
|
||
// there is an item at this position
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_LABEL),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL),
|
||
*pItems);
|
||
++pItems;
|
||
}
|
||
if (i < nValues)
|
||
{
|
||
// there is an value at this position
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_VALUE),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_VALUE),
|
||
*pValues);
|
||
++pValues;
|
||
}
|
||
|
||
Int16SetIterator aSelectedPos = aSelection.find(i);
|
||
if (aSelection.end() != aSelectedPos)
|
||
{ // the item at this position is selected
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CURRENT_SELECTED),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_SELECTED),
|
||
sTrue
|
||
);
|
||
aSelection.erase(aSelectedPos);
|
||
}
|
||
|
||
Int16SetIterator aDefaultSelectedPos = aDefaultSelection.find(i);
|
||
if (aDefaultSelection.end() != aDefaultSelectedPos)
|
||
{ // the item at this position is selected as default
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SELECTED),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_SELECTED),
|
||
sTrue
|
||
);
|
||
aDefaultSelection.erase(aDefaultSelectedPos);
|
||
}
|
||
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "option", sal_True, sal_True);
|
||
}
|
||
|
||
// There may be more "selected" or "default-selected" items than there are in the lists in real,
|
||
// so we need to store some additional "form:option" items which have no name and no label, but
|
||
// one or both of the selected flags.
|
||
// 21.05.2001 - 85388 - frank.schoenheit@germany.sun.com
|
||
|
||
if ( !aSelection.empty() || !aDefaultSelection.empty() )
|
||
{
|
||
sal_Int16 nLastSelected = -1;
|
||
if ( !aSelection.empty() )
|
||
nLastSelected = *(--aSelection.end());
|
||
|
||
sal_Int16 nLastDefaultSelected = -1;
|
||
if ( !aDefaultSelection.empty() )
|
||
nLastDefaultSelected = *(--aDefaultSelection.end());
|
||
|
||
// the maximum element in both sets
|
||
sal_Int16 nLastReferredEntry = std::max(nLastSelected, nLastDefaultSelected);
|
||
OSL_ENSURE(nLastReferredEntry >= nMaxLen, "OControlExport::exportListSourceAsElements: inconsistence!");
|
||
// if the maximum (selected or default selected) entry number is less than the maximum item count
|
||
// in both lists, the entry number should have been removed from the set
|
||
|
||
for (sal_Int16 i=nMaxLen; i<=nLastReferredEntry; ++i)
|
||
{
|
||
if (aSelection.end() != aSelection.find(i))
|
||
{ // the (not existent) item at this position is selected
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_CURRENT_SELECTED),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_CURRENT_SELECTED),
|
||
sTrue
|
||
);
|
||
}
|
||
|
||
if (aDefaultSelection.end() != aDefaultSelection.find(i))
|
||
{ // the (not existent) item at this position is selected as default
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SELECTED),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_SELECTED),
|
||
sTrue
|
||
);
|
||
}
|
||
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, "option", sal_True, sal_True);
|
||
}
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::implStartElement(const sal_Char* _pName)
|
||
{
|
||
// before we let the base class start it's outer element, we add a wrapper element
|
||
const sal_Char *pOuterElementName = getOuterXMLElementName();
|
||
m_pOuterElement = pOuterElementName
|
||
? new SvXMLElementExport(
|
||
m_rContext.getGlobalContext(),
|
||
XML_NAMESPACE_FORM,
|
||
pOuterElementName, sal_True,
|
||
sal_True)
|
||
: 0;
|
||
|
||
// add the attributes for the inner element
|
||
exportInnerAttributes();
|
||
|
||
// and start the inner element
|
||
OElementExport::implStartElement(_pName);
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::implEndElement()
|
||
{
|
||
// end the inner element
|
||
OElementExport::implEndElement();
|
||
|
||
// end the outer element if it exists
|
||
delete m_pOuterElement;
|
||
m_pOuterElement = NULL;
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
const sal_Char* OControlExport::getOuterXMLElementName() const
|
||
{
|
||
return 0;
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
const sal_Char* OControlExport::getXMLElementName() const
|
||
{
|
||
return getElementName(m_eType);
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::examine()
|
||
{
|
||
OSL_ENSURE( ( m_nIncludeCommon == 0 ) && ( m_nIncludeSpecial == 0 ) && ( m_nIncludeDatabase == 0 )
|
||
&& ( m_nIncludeEvents == 0 ) && ( m_nIncludeBindings == 0),
|
||
"OControlExport::examine: called me twice? Not initialized?" );
|
||
|
||
// get the class id to decide which kind of element we need in the XML stream
|
||
m_nClassId = FormComponentType::CONTROL;
|
||
DBG_CHECK_PROPERTY( PROPERTY_CLASSID, sal_Int16 );
|
||
m_xProps->getPropertyValue(PROPERTY_CLASSID) >>= m_nClassId;
|
||
bool knownType = false;
|
||
switch (m_nClassId)
|
||
{
|
||
case FormComponentType::DATEFIELD:
|
||
m_eType = DATE;
|
||
knownType = true;
|
||
// NO BREAK
|
||
case FormComponentType::TIMEFIELD:
|
||
if ( !knownType )
|
||
{
|
||
m_eType = TIME;
|
||
knownType = true;
|
||
}
|
||
m_nIncludeSpecial |= SCA_VALIDATION;
|
||
// NO BREAK
|
||
case FormComponentType::NUMERICFIELD:
|
||
case FormComponentType::CURRENCYFIELD:
|
||
case FormComponentType::PATTERNFIELD:
|
||
if ( !knownType )
|
||
{
|
||
m_eType = FORMATTED_TEXT;
|
||
knownType = true;
|
||
}
|
||
// NO BREAK
|
||
case FormComponentType::TEXTFIELD:
|
||
{ // it's some kind of edit. To know which type we need further investigation
|
||
|
||
if ( !knownType )
|
||
{
|
||
// check if it's a formatted field
|
||
if (m_xPropertyInfo->hasPropertyByName(PROPERTY_FORMATKEY))
|
||
{
|
||
m_eType = FORMATTED_TEXT;
|
||
}
|
||
else
|
||
{
|
||
// all other controls are represented by an ordinary edit control, but which XML control type
|
||
// it is depends on the current values of some properties
|
||
|
||
// if the EchoChar string is not empty, it is a password field
|
||
sal_Int16 nEchoChar = 0;
|
||
if (m_xPropertyInfo->hasPropertyByName(PROPERTY_ECHOCHAR))
|
||
// grid columns do not have this property ....
|
||
m_xProps->getPropertyValue(PROPERTY_ECHOCHAR) >>= nEchoChar;
|
||
if (nEchoChar)
|
||
{
|
||
m_eType = PASSWORD;
|
||
m_nIncludeSpecial |= SCA_ECHO_CHAR;
|
||
}
|
||
else
|
||
{
|
||
// if the MultiLine property is sal_True, it is a TextArea
|
||
sal_Bool bMultiLine = sal_False;
|
||
if (m_xPropertyInfo->hasPropertyByName(PROPERTY_MULTILINE))
|
||
// grid columns do not have this property ....
|
||
bMultiLine = ::cppu::any2bool(m_xProps->getPropertyValue(PROPERTY_MULTILINE));
|
||
|
||
if ( bMultiLine )
|
||
m_eType = TEXT_AREA;
|
||
else
|
||
// the only case left is represented by a Text element
|
||
m_eType = TEXT;
|
||
}
|
||
}
|
||
knownType = true;
|
||
}
|
||
|
||
// attributes which are common to all the types:
|
||
// common attributes
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED |
|
||
CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
|
||
|
||
if ( ( m_nClassId != FormComponentType::DATEFIELD )
|
||
&& ( m_nClassId != FormComponentType::TIMEFIELD )
|
||
)
|
||
// date and time field values are handled differently nowadays
|
||
m_nIncludeCommon |= CCA_VALUE;
|
||
|
||
// database attributes
|
||
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
|
||
|
||
// event attributes
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
|
||
|
||
// only text and pattern fields have a ConvertEmptyToNull property
|
||
if ( ( m_nClassId == FormComponentType::TEXTFIELD )
|
||
|| ( m_nClassId == FormComponentType::PATTERNFIELD )
|
||
)
|
||
m_nIncludeDatabase |= DA_CONVERT_EMPTY;
|
||
|
||
// all controls but the file control fields have a readonly property
|
||
if ( m_nClassId != FormComponentType::FILECONTROL )
|
||
m_nIncludeCommon |= CCA_READONLY;
|
||
|
||
// a text field has a max text len
|
||
if ( m_nClassId == FormComponentType::TEXTFIELD )
|
||
m_nIncludeCommon |= CCA_MAX_LENGTH;
|
||
|
||
// max and min values and validation:
|
||
if (FORMATTED_TEXT == m_eType)
|
||
{ // in general all controls represented as formatted-text have these props
|
||
if ( FormComponentType::PATTERNFIELD != m_nClassId ) // except the PatternField
|
||
m_nIncludeSpecial |= SCA_MAX_VALUE | SCA_MIN_VALUE;
|
||
|
||
if (FormComponentType::TEXTFIELD != m_nClassId)
|
||
// and the FormattedField does not have a validation flag
|
||
m_nIncludeSpecial |= SCA_VALIDATION;
|
||
}
|
||
|
||
// if it's not a password field or rich text control, the CurrentValue needs to be stored, too
|
||
if ( ( PASSWORD != m_eType )
|
||
&& ( DATE != m_eType )
|
||
&& ( TIME != m_eType )
|
||
)
|
||
{
|
||
m_nIncludeCommon |= CCA_CURRENT_VALUE;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case FormComponentType::FILECONTROL:
|
||
m_eType = FILE;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_CURRENT_VALUE | CCA_DISABLED |
|
||
CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE |
|
||
CCA_VALUE;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
|
||
break;
|
||
|
||
case FormComponentType::FIXEDTEXT:
|
||
m_eType = FIXED_TEXT;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL |
|
||
CCA_PRINTABLE | CCA_TITLE | CCA_FOR;
|
||
m_nIncludeSpecial = SCA_MULTI_LINE;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
||
break;
|
||
|
||
case FormComponentType::COMBOBOX:
|
||
m_eType = COMBOBOX;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_CURRENT_VALUE |
|
||
CCA_DISABLED | CCA_DROPDOWN | CCA_MAX_LENGTH | CCA_PRINTABLE | CCA_READONLY | CCA_SIZE |
|
||
CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE | CCA_VALUE;
|
||
m_nIncludeSpecial = SCA_AUTOMATIC_COMPLETION;
|
||
m_nIncludeDatabase = DA_CONVERT_EMPTY | DA_DATA_FIELD | DA_INPUT_REQUIRED | DA_LIST_SOURCE | DA_LIST_SOURCE_TYPE;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_SELECT;
|
||
break;
|
||
|
||
case FormComponentType::LISTBOX:
|
||
m_eType = LISTBOX;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_DROPDOWN |
|
||
CCA_PRINTABLE | CCA_SIZE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
|
||
m_nIncludeSpecial = SCA_MULTIPLE;
|
||
m_nIncludeDatabase = DA_BOUND_COLUMN | DA_DATA_FIELD | DA_INPUT_REQUIRED | DA_LIST_SOURCE_TYPE;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE | EA_ON_CLICK | EA_ON_DBLCLICK;
|
||
// check if we need to export the ListSource as attribute
|
||
{
|
||
// for a list box, if the ListSourceType is VALUE_LIST, no ListSource is stored, but instead
|
||
// a sequence of pairs which is build from the StringItemList and the ValueList
|
||
ListSourceType eListSourceType = ListSourceType_VALUELIST;
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Bool bSuccess =
|
||
#endif
|
||
m_xProps->getPropertyValue(PROPERTY_LISTSOURCETYPE) >>= eListSourceType;
|
||
OSL_ENSURE(bSuccess, "OControlExport::examineControl: could not retrieve the ListSourceType!");
|
||
if (ListSourceType_VALUELIST != eListSourceType)
|
||
{
|
||
m_nIncludeDatabase |= DA_LIST_SOURCE;
|
||
}
|
||
}
|
||
|
||
break;
|
||
|
||
case FormComponentType::COMMANDBUTTON:
|
||
m_eType = BUTTON;
|
||
m_nIncludeCommon |= CCA_TAB_STOP | CCA_LABEL;
|
||
m_nIncludeSpecial = SCA_DEFAULT_BUTTON | SCA_TOGGLE | SCA_FOCUS_ON_CLICK | SCA_IMAGE_POSITION | SCA_REPEAT_DELAY;
|
||
// NO BREAK !
|
||
case FormComponentType::IMAGEBUTTON:
|
||
if (BUTTON != m_eType)
|
||
{
|
||
// not coming from the previous case
|
||
m_eType = IMAGE;
|
||
}
|
||
m_nIncludeCommon |=
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_BUTTON_TYPE | CCA_DISABLED |
|
||
CCA_IMAGE_DATA | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TARGET_FRAME |
|
||
CCA_TARGET_LOCATION | CCA_TITLE;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CLICK | EA_ON_DBLCLICK;
|
||
break;
|
||
|
||
case FormComponentType::CHECKBOX:
|
||
m_eType = CHECKBOX;
|
||
m_nIncludeSpecial = SCA_CURRENT_STATE | SCA_IS_TRISTATE | SCA_STATE;
|
||
// NO BREAK !
|
||
case FormComponentType::RADIOBUTTON:
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL | CCA_PRINTABLE |
|
||
CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE | CCA_VALUE | CCA_VISUAL_EFFECT;
|
||
if (CHECKBOX != m_eType)
|
||
{ // not coming from the previous case
|
||
m_eType = RADIO;
|
||
m_nIncludeCommon |= CCA_CURRENT_SELECTED | CCA_SELECTED;
|
||
}
|
||
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
|
||
m_nIncludeSpecial |= SCA_IMAGE_POSITION;
|
||
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) )
|
||
m_nIncludeSpecial |= SCA_GROUP_NAME;
|
||
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
|
||
break;
|
||
|
||
case FormComponentType::GROUPBOX:
|
||
m_eType = FRAME;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL |
|
||
CCA_PRINTABLE | CCA_TITLE | CCA_FOR;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
||
break;
|
||
|
||
case FormComponentType::IMAGECONTROL:
|
||
m_eType = IMAGE_FRAME;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_IMAGE_DATA |
|
||
CCA_PRINTABLE | CCA_READONLY | CCA_TITLE;
|
||
m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
||
break;
|
||
|
||
case FormComponentType::HIDDENCONTROL:
|
||
m_eType = HIDDEN;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_VALUE;
|
||
break;
|
||
|
||
case FormComponentType::GRIDCONTROL:
|
||
m_eType = GRID;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_PRINTABLE |
|
||
CCA_TAB_INDEX | CCA_TAB_STOP | CCA_TITLE;
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
||
break;
|
||
|
||
case FormComponentType::SCROLLBAR:
|
||
case FormComponentType::SPINBUTTON:
|
||
m_eType = VALUERANGE;
|
||
m_nIncludeCommon =
|
||
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_PRINTABLE |
|
||
CCA_TITLE | CCA_CURRENT_VALUE | CCA_VALUE | CCA_ORIENTATION;
|
||
m_nIncludeSpecial = SCA_MAX_VALUE | SCA_STEP_SIZE | SCA_MIN_VALUE | SCA_REPEAT_DELAY;
|
||
|
||
if ( m_nClassId == FormComponentType::SCROLLBAR )
|
||
m_nIncludeSpecial |= SCA_PAGE_STEP_SIZE ;
|
||
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
||
break;
|
||
|
||
default:
|
||
OSL_ENSURE(sal_False, "OControlExport::examineControl: unknown control type (class id)!");
|
||
// NO break!
|
||
|
||
case FormComponentType::NAVIGATIONBAR:
|
||
// TODO: should we have an own file format for this?
|
||
// NO break
|
||
|
||
case FormComponentType::CONTROL:
|
||
m_eType = GENERIC_CONTROL;
|
||
// unknown control type
|
||
m_nIncludeCommon = CCA_NAME | CCA_SERVICE_NAME;
|
||
// at least a name should be there, 'cause without a name the control could never have been
|
||
// inserted into it's parent container
|
||
// In addition, the service name is absolutely necessary to create the control upon reading.
|
||
m_nIncludeEvents = EA_CONTROL_EVENTS;
|
||
// we always should be able to export events - this is not control type dependent
|
||
break;
|
||
}
|
||
|
||
// in general, all control types need to export the control id
|
||
m_nIncludeCommon |= CCA_CONTROL_ID;
|
||
|
||
// is is a control bound to a calc cell?
|
||
if ( FormCellBindingHelper::livesInSpreadsheetDocument( m_xProps ) )
|
||
{
|
||
FormCellBindingHelper aHelper( m_xProps, NULL );
|
||
{
|
||
if ( aHelper.isCellBinding( aHelper.getCurrentBinding( ) ) )
|
||
{
|
||
m_nIncludeBindings |= BA_LINKED_CELL;
|
||
if ( m_nClassId == FormComponentType::LISTBOX )
|
||
m_nIncludeBindings |= BA_LIST_LINKING_TYPE;
|
||
}
|
||
}
|
||
|
||
// is it a list-like control which uses a calc cell range as list source?
|
||
{
|
||
if ( aHelper.isCellRangeListSource( aHelper.getCurrentListSource( ) ) )
|
||
m_nIncludeBindings |= BA_LIST_CELL_RANGE;
|
||
}
|
||
}
|
||
|
||
// is control bound to XForms?
|
||
if( getXFormsBindName( m_xProps ).getLength() > 0 )
|
||
{
|
||
m_nIncludeBindings |= BA_XFORMS_BIND;
|
||
}
|
||
|
||
// is (list-)control bound to XForms list?
|
||
if( getXFormsListBindName( m_xProps ).getLength() > 0 )
|
||
{
|
||
m_nIncludeBindings |= BA_XFORMS_LISTBIND;
|
||
}
|
||
|
||
// does the control have an XForms submission?
|
||
if( getXFormsSubmissionName( m_xProps ).getLength() > 0 )
|
||
{
|
||
m_nIncludeBindings |= BA_XFORMS_SUBMISSION;
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportCellBindingAttributes( bool _bIncludeListLinkageType )
|
||
{
|
||
try
|
||
{
|
||
FormCellBindingHelper aHelper( m_xProps, NULL );
|
||
Reference< XValueBinding > xBinding( aHelper.getCurrentBinding() );
|
||
OSL_ENSURE( xBinding.is(), "OControlExport::exportCellBindingAttributes: invalid bindable or invalid binding!" );
|
||
if ( xBinding.is() )
|
||
{
|
||
// ....................................................
|
||
AddAttribute(
|
||
OAttributeMetaData::getBindingAttributeNamespace( BA_LINKED_CELL ),
|
||
OAttributeMetaData::getBindingAttributeName( BA_LINKED_CELL ),
|
||
aHelper.getStringAddressFromCellBinding( xBinding )
|
||
);
|
||
|
||
// ....................................................
|
||
if ( _bIncludeListLinkageType )
|
||
{
|
||
sal_Int16 nLinkageType = aHelper.isCellIntegerBinding( xBinding ) ? 1 : 0;
|
||
|
||
::rtl::OUStringBuffer sBuffer;
|
||
m_rContext.getGlobalContext().GetMM100UnitConverter().convertEnum(
|
||
sBuffer,
|
||
(sal_uInt16)nLinkageType,
|
||
OEnumMapper::getEnumMap( OEnumMapper::epListLinkageType )
|
||
);
|
||
|
||
AddAttribute(
|
||
OAttributeMetaData::getBindingAttributeNamespace( BA_LIST_LINKING_TYPE ),
|
||
OAttributeMetaData::getBindingAttributeName( BA_LIST_LINKING_TYPE ),
|
||
sBuffer.makeStringAndClear()
|
||
);
|
||
}
|
||
|
||
}
|
||
}
|
||
catch( const Exception& )
|
||
{
|
||
OSL_ENSURE( sal_False, "OControlExport::exportCellBindingAttributes: caught an exception!" );
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportXFormsBindAttributes()
|
||
{
|
||
rtl::OUString sBindName = getXFormsBindName( m_xProps );
|
||
AddAttribute( XML_NAMESPACE_XFORMS, XML_BIND, sBindName );
|
||
}
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportXFormsListAttributes()
|
||
{
|
||
rtl::OUString sBindName = getXFormsListBindName( m_xProps );
|
||
AddAttribute( XML_NAMESPACE_FORM, XML_XFORMS_LIST_SOURCE, sBindName );
|
||
}
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportXFormsSubmissionAttributes()
|
||
{
|
||
rtl::OUString sSubmission = getXFormsSubmissionName( m_xProps );
|
||
AddAttribute( XML_NAMESPACE_FORM, XML_XFORMS_SUBMISSION, sSubmission );
|
||
}
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportCellListSourceRange( )
|
||
{
|
||
try
|
||
{
|
||
Reference< XListEntrySink > xSink( m_xProps, UNO_QUERY );
|
||
Reference< XListEntrySource > xSource;
|
||
if ( xSink.is() )
|
||
xSource = xSource.query( xSink->getListEntrySource() );
|
||
OSL_ENSURE( xSource.is(), "OControlExport::exportCellListSourceRange: list source or sink!" );
|
||
if ( xSource.is() )
|
||
{
|
||
FormCellBindingHelper aHelper( m_xProps, NULL );
|
||
|
||
AddAttribute(
|
||
OAttributeMetaData::getBindingAttributeNamespace( BA_LIST_CELL_RANGE ),
|
||
OAttributeMetaData::getBindingAttributeName( BA_LIST_CELL_RANGE ),
|
||
aHelper.getStringAddressFromCellListSource( xSource )
|
||
);
|
||
}
|
||
}
|
||
catch( const Exception& )
|
||
{
|
||
OSL_ENSURE( sal_False, "OControlExport::exportCellListSourceRange: caught an exception!" );
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OControlExport::exportImagePositionAttributes()
|
||
{
|
||
try
|
||
{
|
||
sal_Int16 nImagePosition = ImagePosition::Centered;
|
||
OSL_VERIFY( m_xProps->getPropertyValue( PROPERTY_IMAGE_POSITION ) >>= nImagePosition );
|
||
OSL_ENSURE( ( nImagePosition >= ImagePosition::LeftTop ) && ( nImagePosition <= ImagePosition::Centered ),
|
||
"OControlExport::exportImagePositionAttributes: don't know this image position!" );
|
||
|
||
if ( ( nImagePosition < ImagePosition::LeftTop ) || ( nImagePosition > ImagePosition::Centered ) )
|
||
// this is important to prevent potential buffer overflows below, so don't optimize
|
||
nImagePosition = ImagePosition::Centered;
|
||
|
||
if ( nImagePosition == ImagePosition::Centered )
|
||
{
|
||
AddAttribute( XML_NAMESPACE_FORM, GetXMLToken( XML_IMAGE_POSITION ), GetXMLToken( XML_CENTER ) );
|
||
}
|
||
else
|
||
{
|
||
XMLTokenEnum eXmlImagePositions[] =
|
||
{
|
||
XML_START, XML_END, XML_TOP, XML_BOTTOM
|
||
};
|
||
XMLTokenEnum eXmlImageAligns[] =
|
||
{
|
||
XML_START, XML_CENTER, XML_END
|
||
};
|
||
|
||
XMLTokenEnum eXmlImagePosition = eXmlImagePositions[ nImagePosition / 3 ];
|
||
XMLTokenEnum eXmlImageAlign = eXmlImageAligns [ nImagePosition % 3 ];
|
||
|
||
AddAttribute( XML_NAMESPACE_FORM, GetXMLToken( XML_IMAGE_POSITION ), GetXMLToken( eXmlImagePosition ) );
|
||
AddAttribute( XML_NAMESPACE_FORM, GetXMLToken( XML_IMAGE_ALIGN ), GetXMLToken( eXmlImageAlign ) );
|
||
}
|
||
|
||
exportedProperty( PROPERTY_IMAGE_POSITION );
|
||
// some of the controls which have an ImagePosition also have an ImageAlign for compatibility
|
||
// reasons. Since the ImageAlign values simply represent a sub set of the ImagePosition values,
|
||
// we don't need to export ImageAlign anymore
|
||
exportedProperty( PROPERTY_IMAGE_ALIGN );
|
||
}
|
||
catch( const Exception& )
|
||
{
|
||
DBG_UNHANDLED_EXCEPTION();
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
bool OControlExport::controlHasActiveDataBinding() const
|
||
{
|
||
try
|
||
{
|
||
// currently exchanging the data with a database column?
|
||
::rtl::OUString sBoundFieldPropertyName( RTL_CONSTASCII_USTRINGPARAM( "BoundField" ) );
|
||
if ( m_xPropertyInfo.is() && m_xPropertyInfo->hasPropertyByName( sBoundFieldPropertyName ) )
|
||
{
|
||
Reference< XPropertySet > xBoundField;
|
||
m_xProps->getPropertyValue( sBoundFieldPropertyName ) >>= xBoundField;
|
||
if ( xBoundField.is() )
|
||
return true;
|
||
}
|
||
|
||
// currently exchanging data with an external binding?
|
||
Reference< XBindableValue > xBindable( m_xProps, UNO_QUERY );
|
||
if ( xBindable.is() && xBindable->getValueBinding().is() )
|
||
return true;
|
||
}
|
||
catch( const Exception& )
|
||
{
|
||
OSL_ENSURE( sal_False, "OColumnExport::controlHasActiveDataBinding: caught an exception!" );
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
bool OControlExport::controlHasUserSuppliedListEntries() const
|
||
{
|
||
try
|
||
{
|
||
// an external list source?
|
||
Reference< XListEntrySink > xEntrySink( m_xProps, UNO_QUERY );
|
||
if ( xEntrySink.is() && xEntrySink->getListEntrySource().is() )
|
||
return false;
|
||
|
||
if ( m_xPropertyInfo.is() && m_xPropertyInfo->hasPropertyByName( PROPERTY_LISTSOURCETYPE ) )
|
||
{
|
||
ListSourceType eListSourceType = ListSourceType_VALUELIST;
|
||
OSL_VERIFY( m_xProps->getPropertyValue( PROPERTY_LISTSOURCETYPE ) >>= eListSourceType );
|
||
if ( eListSourceType == ListSourceType_VALUELIST )
|
||
// for value lists, the list entries as entered by the user are used
|
||
return true;
|
||
|
||
// for every other type, the list entries are filled with some data obtained
|
||
// from a database - if and only if the ListSource property is not empty
|
||
return ( 0 == getScalarListSourceValue().getLength() );
|
||
}
|
||
}
|
||
catch( const Exception& )
|
||
{
|
||
OSL_ENSURE( sal_False, "OControlExport::controlHasUserSuppliedListEntries: caught an exception!" );
|
||
}
|
||
|
||
OSL_ENSURE( sal_False, "OControlExport::controlHasUserSuppliedListEntries: unreachable code!" );
|
||
// this method should be called for list and combo boxes only
|
||
return true;
|
||
}
|
||
|
||
//=====================================================================
|
||
//= OColumnExport
|
||
//=====================================================================
|
||
//---------------------------------------------------------------------
|
||
OColumnExport::OColumnExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxControl, const ::rtl::OUString& _rControlId,
|
||
const Sequence< ScriptEventDescriptor >& _rEvents)
|
||
:OControlExport(_rContext, _rxControl, _rControlId, ::rtl::OUString(), _rEvents)
|
||
{
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
OColumnExport::~OColumnExport()
|
||
{
|
||
implEndElement();
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OColumnExport::exportServiceNameAttribute()
|
||
{
|
||
// the attribute "service name" (which has a slightly different meaning for columns
|
||
DBG_CHECK_PROPERTY( PROPERTY_COLUMNSERVICENAME, ::rtl::OUString );
|
||
::rtl::OUString sColumnServiceName;
|
||
m_xProps->getPropertyValue(PROPERTY_COLUMNSERVICENAME) >>= sColumnServiceName;
|
||
// the service name is a full qualified one (i.e. com.sun.star.form.TextField), but the
|
||
// real service name for the column (for use with the XGridColumnFactory) is only the last
|
||
// token of this complete name.
|
||
sal_Int32 nLastSep = sColumnServiceName.lastIndexOf('.');
|
||
OSL_ENSURE(-1 != nLastSep, "OColumnExport::startExportElement: invalid service name!");
|
||
sColumnServiceName = sColumnServiceName.copy(nLastSep + 1);
|
||
sColumnServiceName =
|
||
m_rContext.getGlobalContext().GetNamespaceMap().GetQNameByKey(
|
||
XML_NAMESPACE_OOO, sColumnServiceName );
|
||
// add the attribute
|
||
AddAttribute( OAttributeMetaData::getCommonControlAttributeNamespace(CCA_SERVICE_NAME)
|
||
, OAttributeMetaData::getCommonControlAttributeName(CCA_SERVICE_NAME)
|
||
, sColumnServiceName);
|
||
// flag the property as "handled"
|
||
exportedProperty(PROPERTY_COLUMNSERVICENAME);
|
||
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
const sal_Char* OColumnExport::getOuterXMLElementName() const
|
||
{
|
||
return "column";
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OColumnExport::exportAttributes()
|
||
{
|
||
OControlExport::exportAttributes();
|
||
|
||
// the attribute "label"
|
||
exportStringPropertyAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_LABEL),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL),
|
||
PROPERTY_LABEL);
|
||
|
||
// the style attribute
|
||
::rtl::OUString sStyleName = m_rContext.getObjectStyleName( m_xProps );
|
||
if ( sStyleName.getLength() )
|
||
{
|
||
AddAttribute(
|
||
OAttributeMetaData::getSpecialAttributeNamespace( SCA_COLUMN_STYLE_NAME ),
|
||
OAttributeMetaData::getSpecialAttributeName( SCA_COLUMN_STYLE_NAME ),
|
||
sStyleName
|
||
);
|
||
}
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OColumnExport::examine()
|
||
{
|
||
OControlExport::examine();
|
||
|
||
// grid columns miss some properties of the controls they're representing
|
||
m_nIncludeCommon &= ~(CCA_FOR | CCA_PRINTABLE | CCA_TAB_INDEX | CCA_TAB_STOP | CCA_LABEL);
|
||
m_nIncludeSpecial &= ~(SCA_ECHO_CHAR | SCA_AUTOMATIC_COMPLETION | SCA_MULTIPLE | SCA_MULTI_LINE);
|
||
|
||
if (FormComponentType::DATEFIELD != m_nClassId)
|
||
// except date fields, no column has the DropDown property
|
||
m_nIncludeCommon &= ~CCA_DROPDOWN;
|
||
}
|
||
|
||
//=====================================================================
|
||
//= OFormExport
|
||
//=====================================================================
|
||
//---------------------------------------------------------------------
|
||
OFormExport::OFormExport(IFormsExportContext& _rContext, const Reference< XPropertySet >& _rxForm,
|
||
const Sequence< ScriptEventDescriptor >& _rEvents)
|
||
:OElementExport(_rContext, _rxForm, _rEvents)
|
||
,m_bCreateConnectionResourceElement(sal_False)
|
||
{
|
||
OSL_ENSURE(m_xProps.is(), "OFormExport::OFormExport: invalid arguments!");
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
const sal_Char* OFormExport::getXMLElementName() const
|
||
{
|
||
return "form";
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OFormExport::exportSubTags()
|
||
{
|
||
if ( m_bCreateConnectionResourceElement && m_xProps.is() )
|
||
{
|
||
m_rContext.getGlobalContext().ClearAttrList();
|
||
::rtl::OUString sPropValue;
|
||
m_xProps->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sPropValue; // if set it is a file url
|
||
if ( !sPropValue.getLength() )
|
||
m_xProps->getPropertyValue( PROPERTY_URL ) >>= sPropValue;
|
||
if ( sPropValue.getLength() )
|
||
AddAttribute(
|
||
OAttributeMetaData::getCommonControlAttributeNamespace(CCA_TARGET_LOCATION),
|
||
OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_LOCATION),
|
||
sPropValue);
|
||
if ( m_rContext.getGlobalContext().GetAttrList().getLength() )
|
||
{
|
||
SvXMLElementExport aFormElement(m_rContext.getGlobalContext(), XML_NAMESPACE_FORM, xmloff::token::XML_CONNECTION_RESOURCE, sal_True, sal_True);
|
||
}
|
||
}
|
||
|
||
// let the base class export the remaining properties and the events
|
||
OElementExport::exportSubTags();
|
||
// loop through all children
|
||
Reference< XIndexAccess > xCollection(m_xProps, UNO_QUERY);
|
||
OSL_ENSURE(xCollection.is(), "OFormLayerXMLExport::implExportForm: a form which is not an index access? Suspic<69>ous!");
|
||
|
||
if (xCollection.is())
|
||
m_rContext.exportCollectionElements(xCollection);
|
||
}
|
||
|
||
//---------------------------------------------------------------------
|
||
void OFormExport::exportAttributes()
|
||
{
|
||
sal_Int32 i=0;
|
||
|
||
// ---------------------
|
||
// the string properties
|
||
{
|
||
static FormAttributes eStringPropertyIds[] =
|
||
{
|
||
faName, /*faAction,*/ faCommand, faFilter, faOrder
|
||
};
|
||
static ::rtl::OUString aStringPropertyNames[] =
|
||
{
|
||
PROPERTY_NAME, /*PROPERTY_TARGETURL,*/ PROPERTY_COMMAND, PROPERTY_FILTER, PROPERTY_ORDER
|
||
};
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS(eStringPropertyIds);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS(aStringPropertyNames);
|
||
OSL_ENSURE((nIdCount == nNameCount),
|
||
"OFormExport::exportAttributes: somebody tampered with the maps (1)!");
|
||
#endif
|
||
for (i=0; i<nIdCount; ++i)
|
||
exportStringPropertyAttribute(
|
||
OAttributeMetaData::getFormAttributeNamespace(eStringPropertyIds[i]),
|
||
OAttributeMetaData::getFormAttributeName(eStringPropertyIds[i]),
|
||
aStringPropertyNames[i]);
|
||
|
||
// #i112082# xlink:type is added as part of exportTargetLocationAttribute
|
||
|
||
// now export the data source name or databaselocation or connection resource
|
||
::rtl::OUString sPropValue;
|
||
m_xProps->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= sPropValue;
|
||
m_bCreateConnectionResourceElement = !sPropValue.getLength();
|
||
if ( !m_bCreateConnectionResourceElement )
|
||
{
|
||
INetURLObject aURL(sPropValue);
|
||
m_bCreateConnectionResourceElement = ( aURL.GetProtocol() == INET_PROT_FILE );
|
||
if ( !m_bCreateConnectionResourceElement )
|
||
exportStringPropertyAttribute(
|
||
OAttributeMetaData::getFormAttributeNamespace(faDatasource),
|
||
OAttributeMetaData::getFormAttributeName(faDatasource),
|
||
PROPERTY_DATASOURCENAME);
|
||
}
|
||
else
|
||
exportedProperty(PROPERTY_URL);
|
||
if ( m_bCreateConnectionResourceElement )
|
||
exportedProperty(PROPERTY_DATASOURCENAME);
|
||
}
|
||
|
||
// ----------------------
|
||
// the boolean properties
|
||
{
|
||
static FormAttributes eBooleanPropertyIds[] =
|
||
{
|
||
faAllowDeletes, faAllowInserts, faAllowUpdates, faApplyFilter, faEscapeProcessing, faIgnoreResult
|
||
};
|
||
static const ::rtl::OUString* pBooleanPropertyNames[] =
|
||
{
|
||
&PROPERTY_ALLOWDELETES, &PROPERTY_ALLOWINSERTS, &PROPERTY_ALLOWUPDATES, &PROPERTY_APPLYFILTER, &PROPERTY_ESCAPEPROCESSING, &PROPERTY_IGNORERESULT
|
||
};
|
||
static sal_Int8 nBooleanPropertyAttrFlags[] =
|
||
{
|
||
BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE, BOOLATTR_DEFAULT_TRUE, BOOLATTR_DEFAULT_FALSE
|
||
};
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS(eBooleanPropertyIds);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames);
|
||
sal_Int32 nFlagsCount = SAL_N_ELEMENTS(nBooleanPropertyAttrFlags);
|
||
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
|
||
"OFormExport::exportAttributes: somebody tampered with the maps (2)!");
|
||
#endif
|
||
for (i=0; i<nIdCount; ++i)
|
||
exportBooleanPropertyAttribute(
|
||
OAttributeMetaData::getFormAttributeNamespace(eBooleanPropertyIds[i]),
|
||
OAttributeMetaData::getFormAttributeName(eBooleanPropertyIds[i]),
|
||
*(pBooleanPropertyNames[i]),
|
||
nBooleanPropertyAttrFlags[i]
|
||
);
|
||
}
|
||
|
||
// -------------------
|
||
// the enum properties
|
||
{
|
||
static FormAttributes eEnumPropertyIds[] =
|
||
{
|
||
faEnctype, faMethod, faCommandType, faNavigationMode, faTabbingCycle
|
||
};
|
||
static const sal_Char* pEnumPropertyNames[] =
|
||
{
|
||
PROPERTY_SUBMIT_ENCODING, PROPERTY_SUBMIT_METHOD, PROPERTY_COMMAND_TYPE, PROPERTY_NAVIGATION, PROPERTY_CYCLE
|
||
};
|
||
static OEnumMapper::EnumProperties eEnumPropertyMaps[] =
|
||
{
|
||
OEnumMapper::epSubmitEncoding, OEnumMapper::epSubmitMethod, OEnumMapper::epCommandType, OEnumMapper::epNavigationType, OEnumMapper::epTabCyle
|
||
};
|
||
static sal_Int32 nEnumPropertyAttrDefaults[] =
|
||
{
|
||
FormSubmitEncoding_URL, FormSubmitMethod_GET, CommandType::COMMAND, NavigationBarMode_CURRENT, TabulatorCycle_RECORDS
|
||
};
|
||
static sal_Bool nEnumPropertyAttrDefaultFlags[] =
|
||
{
|
||
sal_False, sal_False, sal_False, sal_False, sal_True
|
||
};
|
||
sal_Int32 nIdCount = SAL_N_ELEMENTS(eEnumPropertyIds);
|
||
#if OSL_DEBUG_LEVEL > 0
|
||
sal_Int32 nNameCount = SAL_N_ELEMENTS(pEnumPropertyNames);
|
||
sal_Int32 nDefaultCount = SAL_N_ELEMENTS(nEnumPropertyAttrDefaults);
|
||
sal_Int32 nDefaultFlagCount = SAL_N_ELEMENTS(nEnumPropertyAttrDefaultFlags);
|
||
sal_Int32 nMapCount = SAL_N_ELEMENTS(eEnumPropertyMaps);
|
||
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount) && (nDefaultCount == nDefaultFlagCount) && (nDefaultFlagCount == nMapCount),
|
||
"OFormExport::exportAttributes: somebody tampered with the maps (3)!");
|
||
#endif
|
||
for (i=0; i<nIdCount; ++i)
|
||
exportEnumPropertyAttribute(
|
||
OAttributeMetaData::getFormAttributeNamespace(eEnumPropertyIds[i]),
|
||
OAttributeMetaData::getFormAttributeName(eEnumPropertyIds[i]),
|
||
pEnumPropertyNames[i],
|
||
OEnumMapper::getEnumMap(eEnumPropertyMaps[i]),
|
||
nEnumPropertyAttrDefaults[i],
|
||
nEnumPropertyAttrDefaultFlags[i]
|
||
);
|
||
}
|
||
|
||
// the service name
|
||
exportServiceNameAttribute();
|
||
// the target frame
|
||
exportTargetFrameAttribute();
|
||
// the target URL
|
||
exportTargetLocationAttribute(true); // #i110911# add type attribute (for form, but not for control)
|
||
|
||
// master fields
|
||
exportStringSequenceAttribute(
|
||
OAttributeMetaData::getFormAttributeNamespace(faMasterFields),
|
||
OAttributeMetaData::getFormAttributeName(faMasterFields),
|
||
PROPERTY_MASTERFIELDS);
|
||
// detail fields
|
||
exportStringSequenceAttribute(
|
||
OAttributeMetaData::getFormAttributeNamespace(faDetailFiels),
|
||
OAttributeMetaData::getFormAttributeName(faDetailFiels),
|
||
PROPERTY_DETAILFIELDS);
|
||
}
|
||
//.........................................................................
|
||
} // namespace xmloff
|
||
//.........................................................................
|
||
|
||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|