On 2013/02/19 2:56 AM, Alan Eduardo Puc Pech wrote:
Hi team!
I'm Alan. I'm building the module writer "sw"
In one part of the tutorial I want insert the following code:
--- sw/source/ui/app/mn.src 2004-11-29 14:29:10.000000000 +0530
+++ sw/source/ui/app/mn.src 2004-12-21 20:28:27.000000000 +0530
@@ -945,6 +945,13 @@ Menu MN_GRF_POPUPMENU
SEPARATOR ;
MenuItem
{
+ Identifier = FN_SAVE_GRAPHIC ;
+ HelpID = FN_SAVE_GRAPHIC ;
+ Text [ de ] = "~Grafik speichern..." ;
+ Text [ en-US ] = "Save ~Graphic..." ;
+ };
+ MenuItem
+ {
Identifier = FN_FORMAT_GRAFIC_DLG ;
HelpID = FN_FORMAT_GRAFIC_DLG ;
Text [ de ] = "~Grafik..." ;
------------------------------------------------------------------------------------
and I did so:
Menu MN_GRF_POPUPMENU
{
ItemList =
{
MN_ALIGN_FRAME
MN_MOUSE_FRAME_WITH_CONTOUR
// --> OD 2009-07-14 #i73249#
SEPARATOR ;
MN_TITLE_DESCRIPTION_SHAPE
// <--
SEPARATOR ;
MenuItem
{
Identifier = FN_FORMAT_GRAFIC_DLG ;
HelpId = CMD_FN_FORMAT_GRAFIC_DLG ;
Text [ en-US ] = "~Picture..." ;
};
MenuItem
{
Identifier = FN_SAVE_GRAPHIC;
Identifier = FN_SAVE_GRAPHIC ;
HelpId = CMD_FN_SAVE_GRAPHIC;
HelpID = FN_SAVE_GRAPHIC ;
Text [ de ] = "~Grafik speichern..." ;
Text [ en-US ] = "Save Graphics..." ;
};
MenuItem
{
Identifier = FN_FORMAT_GRAFIC_DLG ;
HelpID = FN_FORMAT_GRAFIC_DLG ;
Text [ de ] = "~Grafik..." ;
};
MN_FRM_CAPTION_ITEM
MenuItem
{
ITEM_EDIT_IMAP
};
};
};
------------------------------------------------------------------
but when I building the module, I have the following error:
[...]
Apparently I'm not inserting the code well, I need you help. how inserting
the code in the archive mn.src very well.
Yes, the merge result you pasted above doesn't look right. In the patch
the lines marked with a "+" at the start mean that they are to be
inserted. So the resulting code for your example would look like this:
MenuItem
{
Identifier = FN_SAVE_GRAPHIC ;
HelpID = FN_SAVE_GRAPHIC ;
Text [ de ] = "~Grafik speichern..." ;
Text [ en-US ] = "Save ~Graphic..." ;
};
MenuItem
{
Identifier = FN_FORMAT_GRAFIC_DLG ;
HelpID = FN_FORMAT_GRAFIC_DLG ;
Text [ de ] = "~Grafik..." ;
The patch with the '+' is a so called "unified diff" [1]. Lines with a
'+' at the start are added, lines with a '-' at the start are removed.
Once you get used to it you'll see that they are quite easy to read.
[1] http://en.wikipedia.org/wiki/Unified_diff#Unified_format
Usually one doesn't need to apply a patch by hand. There are tools for
this that make it quite easy. The most prominent one is accidentally
called "patch" [2]
[2] http://en.wikipedia.org/wiki/Patch_%28Unix%29
Hope this helps,
Herbert