translation available thanks to .
Example: To undefine the defintion of gid_File_Abc you only need to add
in the scp project the following code line:
UnFile gid_File_Abc
and the file defined with gid_File_Abc is no longer part of the product.
There is another big advantage. Because of the undefining mechanism it is no longer necessary to use product defines like #ifdef OSL_PRODUCT inside the scp files. Therefore every scp file will only be built once, leading to a dramatic decrease of build time for the scp2 project compared with the old scp project. The removal of product defines inside scp files also leads to more simplicity of this files.
A more detailed documentation of the new scp can be found here
So, say for example I want to add an entry, "Script organizer", below the entry "macro..." in the Tools->Macro sub-menu.
The first step is define a new "slot" that links the menu entry to the code that it will execute. these are defined in sfx2/inc/sfxsids.hrc. I define a new slot SID_SCRIPTORGANIZER to be same value as the existing SID_SFX_free_START, and incremented the SID_SFX_free_START by one.
Next I define the link between the slot, and the code that handles it. For my slot, the application code should handle the execution so this is done in sfx2/sdi/appslots.sdi. See also other files in this directory, or similar sdi directories in other modules (eg basctl).
In the section that starts "shell SfxApplication" I add the lines:
SID_SCRIPTORGANIZER [ ExecMethod = OfaExec_Impl; ]which means that my slot will be handled by the method
SfxApplication::OfaExec_Impl.Then in sfx2/source/appl/appserv.cxx I add code to the method SfxApplication::OfaExec_Impl to handle the case for the new slot.
In sfx2/sdi/sfx.sdi, I duplicate the SID_BASICCHOOSER entry, and change
"MacroDialog" to "ScriptOrganizer", and SID_BASICCHOOSER to
SID_SCRIPTORGANIZER.
This is the slot definition file
where attributes for a slot can be defined, like this is a user
interface command which can be customized to tool bars, menus and
accelerators. You can define if the slot is a state, a function or both.
You can add parameters and define the type of a state slot. Don't ask me
what the entries mean!!
In sfx2/sdi/sfxslots.src, added an SfxSlotInfo for the slot. These are the localized names for the slot.
Build & delivered in sfx2. We now have the back end, handling the execution.
The actual menu entries are defined in a number of places. For things that are duplicated across several apps, such as the Tools->Macros submenu, we find the definition in svx/inc/globlmn.hrc. Here I add a new menuItem for the new slot to the ITEM_TOOLS_MACROS (using the existing entries as a template). The identifier and helpid are the SID, the command is .uno:ScriptOrganizer. The command name is what we will see if we record a macro that uses this slot.
Run the built & deliver commands in svx. The globlnm.hrc is included in offmgr/inc/offmenu.hrc, so we must build & deliver this project too. And then rebuild each of the application projects (sw, sc...). This is necessary to deliver the slot.ilb files which are merged from lower libraries. And finally build in instsetoo and install the rebuild app with your new menu entry!!
(steps 1 and 2 would make it easier to develop for OOo).
No this week | Change from last week | |
---|---|---|
Total issues submitted in the week | 2434 |
0 |
Issues submitted in the week resolved or closed | 261 |
-42 |
Issues which have the status UNCONFIRMED | 257 |
-22 |
Issues which have the status NEW | 1080 |
34 |
Issues which have the status STARTED | 1087 |
5 |
Issues which have the status FIXED | 7994 |
88 |