From 7e42394ecbf921ee53160b495aa12c1cba158604 Mon Sep 17 00:00:00 2001 From: Ilmari Lauhakangas Date: Tue, 6 Dec 2022 14:05:20 +0200 Subject: tdf#152323 drop name attribute from elements Replacement done with find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \ 's#(]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g' (note some inconsistencies with space between name and = and also having empty value, and some more complicated expression to also clear up double space before/after the attribute) translation files will be prepped with: find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \ $'s#(]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/' (note that not all languages use the " as quote character for the attributes, but that also single quotes appera in the po file. Hence the use of the shell $'string' syntax to be able to quote ' as \' It also requires to quote the backslash, so that it needs to be escaped once for the shell, then another time for perl. Also don't work on obsolete strings (those are prefixed with #~ in the po files) Also note that gets turned into during translation extraction (along with removal of the space between the attribute name and the value), so the pattern needs to be slightly different here) Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- source/text/sbasic/guide/access2base.xhp | 2 +- source/text/sbasic/guide/basic_2_python.xhp | 10 +++++----- source/text/sbasic/guide/basic_examples.xhp | 2 +- source/text/sbasic/guide/calc_borders.xhp | 12 ++++++------ source/text/sbasic/guide/control_properties.xhp | 2 +- source/text/sbasic/guide/create_dialog.xhp | 2 +- source/text/sbasic/guide/insert_control.xhp | 2 +- source/text/sbasic/guide/read_write_values.xhp | 2 +- source/text/sbasic/guide/sample_code.xhp | 4 ++-- source/text/sbasic/guide/show_dialog.xhp | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) (limited to 'source/text/sbasic/guide') diff --git a/source/text/sbasic/guide/access2base.xhp b/source/text/sbasic/guide/access2base.xhp index 507a63c9dd..afb44b345f 100644 --- a/source/text/sbasic/guide/access2base.xhp +++ b/source/text/sbasic/guide/access2base.xhp @@ -45,7 +45,7 @@ Access2Base is a %PRODUCTNAME BASIC library of macros for (business or personal) application developers and advanced users. It is one of the libraries stored in "Application macros and dialogs". The functionalities provided by the implemented macros are all directly inspired by Microsoft Access. The macros are callable mainly from a %PRODUCTNAME Base application, but also from any %PRODUCTNAME document (Writer, Calc, ...) where access to data stored in a database makes sense. The API provided by Access2Base is intended to be more concise, intuitive and easy to learn than the standard UNO API (API = Application Programming Interface). - The library is documented online on http://www.access2base.com. + The library is documented online on http://www.access2base.com. The implemented macros include: diff --git a/source/text/sbasic/guide/basic_2_python.xhp b/source/text/sbasic/guide/basic_2_python.xhp index 4ea2d89f4e..0022270329 100644 --- a/source/text/sbasic/guide/basic_2_python.xhp +++ b/source/text/sbasic/guide/basic_2_python.xhp @@ -21,17 +21,17 @@ API;PathSettings API;XScript -

Calling Python Scripts from Basic

+

Calling Python Scripts from Basic

Calling Python scripts from %PRODUCTNAME Basic macros is possible, and valuable features can be obtained such as: ComputerName identification or OSName detection are possible, - Basic FileLen() function and com.sun.star.ucb.SimpleFileAccess.getSize() API function exhibit a 2 Gigabytes file size upper limit that Python helps to overcome, - com.sun.star.util.PathSettings can be normalized, + Basic FileLen() function and com.sun.star.ucb.SimpleFileAccess.getSize() API function exhibit a 2 Gigabytes file size upper limit that Python helps to overcome, + com.sun.star.util.PathSettings can be normalized, and many more. - A reasonable exposure to %PRODUCTNAME Basic and to Application Programming Interface (API) features is recommended prior to perform inter-language calls from Basic to Python, to JavaScript or any other script engine. + A reasonable exposure to %PRODUCTNAME Basic and to Application Programming Interface (API) features is recommended prior to perform inter-language calls from Basic to Python, to JavaScript or any other script engine.

Retrieving Python Scripts

- Python scripts can be personal, shared, or embedded in documents. In order to execute them, %PRODUCTNAME Basic needs to be provided with Python script locations. Locating com.sun.star.script.provider.XScript interface compliant UNO objects allows the execution of Python scripts: + Python scripts can be personal, shared, or embedded in documents. In order to execute them, %PRODUCTNAME Basic needs to be provided with Python script locations. Locating com.sun.star.script.provider.XScript interface compliant UNO objects allows the execution of Python scripts: Option Explicit diff --git a/source/text/sbasic/guide/basic_examples.xhp b/source/text/sbasic/guide/basic_examples.xhp index 97b11c0659..9a21e1cf32 100644 --- a/source/text/sbasic/guide/basic_examples.xhp +++ b/source/text/sbasic/guide/basic_examples.xhp @@ -19,7 +19,7 @@ Basic;programming examples
-

Basic Programming Examples

+

Basic Programming Examples

diff --git a/source/text/sbasic/guide/calc_borders.xhp b/source/text/sbasic/guide/calc_borders.xhp index 23fa7b885a..8295c0ad98 100644 --- a/source/text/sbasic/guide/calc_borders.xhp +++ b/source/text/sbasic/guide/calc_borders.xhp @@ -20,7 +20,7 @@ macros;format borders -

Formatting Borders in Calc with Macros

+

Formatting Borders in Calc with Macros

By using Basic or Python programming languages it is possible to write macros that apply formats to ranges of cells in Calc.

Formatting Borders in Ranges of Cells

@@ -48,13 +48,13 @@ cellAddress is a string denoting the range to be formatted in the format "A1".
- newStyle is an integer value that corresponds to the border line style (see Line Styles below). + newStyle is an integer value that corresponds to the border line style (see Line Styles below). newWidth is an integer value that defines the line width. - newColor is an integer value corresponding to a color defined using the RGB function. + newColor is an integer value corresponding to a color defined using the RGB function.
To call FormatCellBorder create a new macro and pass the desired arguments, as shown below: @@ -97,7 +97,7 @@ formatCellBorder("B5", cStyle.SOLID, 20, bas.RGB(0, 0, 255)) formatCellBorder("D2:F6", cStyle.DOTTED, 20, bas.RGB(255, 0, 0)) - The Python code presented above uses the ScriptForge library that is available since %PRODUCTNAME 7.2. + The Python code presented above uses the ScriptForge library that is available since %PRODUCTNAME 7.2.

Line Styles

@@ -193,7 +193,7 @@ - Refer to the BorderLineStyle Constant Reference in the LibreOffice API documentation to learn more about line style constants. + Refer to the BorderLineStyle Constant Reference in the LibreOffice API documentation to learn more about line style constants.

Formatting Borders Using TableBorder2

Range objects have a property named TableBorder2 that can be used to format range borders as it is done in the Format - Cells - Borders dialog in the Line Arrangement section. @@ -239,7 +239,7 @@ cell = doc.XCellRange("B2:E5") cell.TableBorder2 = table_format - Refer to the TableBorder2 Struct Reference in the LibreOffice API documentation to learn more about its attributes. + Refer to the TableBorder2 Struct Reference in the LibreOffice API documentation to learn more about its attributes.
diff --git a/source/text/sbasic/guide/control_properties.xhp b/source/text/sbasic/guide/control_properties.xhp index 7d8ff2c3eb..3de28c42df 100644 --- a/source/text/sbasic/guide/control_properties.xhp +++ b/source/text/sbasic/guide/control_properties.xhp @@ -35,7 +35,7 @@ controls;changing properties dialog editor;changing control properties -Changing the Properties of Controls in the Dialog Editor +Changing the Properties of Controls in the Dialog Editor You can set the properties of control that you add to a dialog. For example, you can change the color, name, and size of a button that you added. You can change most control properties when you create or edit a dialog. However, you can only change some properties at runtime. To change the properties of a control in design mode, right-click the control, and then choose Properties. diff --git a/source/text/sbasic/guide/create_dialog.xhp b/source/text/sbasic/guide/create_dialog.xhp index e948d44672..434cc6647b 100644 --- a/source/text/sbasic/guide/create_dialog.xhp +++ b/source/text/sbasic/guide/create_dialog.xhp @@ -30,7 +30,7 @@ dialogs;creating Basic dialogs -Creating a Basic Dialog +Creating a Basic Dialog diff --git a/source/text/sbasic/guide/insert_control.xhp b/source/text/sbasic/guide/insert_control.xhp index cbc6fdbdbd..605040b8a9 100644 --- a/source/text/sbasic/guide/insert_control.xhp +++ b/source/text/sbasic/guide/insert_control.xhp @@ -33,7 +33,7 @@ controls; creating in the dialog editor dialog editor;creating controls -Creating Controls in the Dialog Editor +Creating Controls in the Dialog Editor Use the tools on the Toolbox of the BASIC dialog editor to add controls to your dialog. diff --git a/source/text/sbasic/guide/read_write_values.xhp b/source/text/sbasic/guide/read_write_values.xhp index b8dab321c1..2ac928a2d6 100644 --- a/source/text/sbasic/guide/read_write_values.xhp +++ b/source/text/sbasic/guide/read_write_values.xhp @@ -21,7 +21,7 @@ macros;read values from cells macros;write values to cells -

Reading and Writing values to Ranges

+

Reading and Writing values to Ranges

Macros in %PRODUCTNAME Calc often need to read and write values from/to sheets. This help page describes the various approaches to accessing sheets and ranges to read or write their values. All examples presented in this page can be implemented both in Basic and Python. diff --git a/source/text/sbasic/guide/sample_code.xhp b/source/text/sbasic/guide/sample_code.xhp index cdb79e3837..3b38f6946c 100644 --- a/source/text/sbasic/guide/sample_code.xhp +++ b/source/text/sbasic/guide/sample_code.xhp @@ -38,10 +38,10 @@ Tools;LoadDialog
- Programming Examples for Controls in the Dialog Editor + Programming Examples for Controls in the Dialog Editor
-The following examples are for a new dialog called "Dialog1". Use the tools on the Toolbox bar in the dialog editor to create the dialog and add the following controls: a Check Box called "CheckBox1", a Label Field called "Label1", a Button called "CommandButton1", and a List Box called "ListBox1". +The following examples are for a new dialog called "Dialog1". Use the tools on the Toolbox bar in the dialog editor to create the dialog and add the following controls: a Check Box called "CheckBox1", a Label Field called "Label1", a Button called "CommandButton1", and a List Box called "ListBox1". Be consistent with uppercase and lowercase letter when you attach a control to an object variable. Global Function for Loading Dialogs diff --git a/source/text/sbasic/guide/show_dialog.xhp b/source/text/sbasic/guide/show_dialog.xhp index 117ff796c2..00872c9732 100644 --- a/source/text/sbasic/guide/show_dialog.xhp +++ b/source/text/sbasic/guide/show_dialog.xhp @@ -30,7 +30,7 @@ examples; showing a dialog with Basic Tools;LoadDialog -Opening a Dialog With Basic +Opening a Dialog With Basic In the %PRODUCTNAME BASIC window for a dialog that you created, leave the dialog editor by clicking the name tab of the Module that the dialog is assigned to. The name tab is at the bottom of the window. Enter the following code for a subroutine called Dialog1Show. In this example, the name of the dialog that you created is "Dialog1": -- cgit