This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch openformula in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 14e11afe751f35251c38fb4d5ca440a8f4a16d9c Author: Pedro Giffuni <[email protected]> AuthorDate: Tue Nov 17 17:19:14 2026 -0500 H.5.1: Priority 1 consistency fixes for H.1/H.2 functions - Add missing help .xhp files: func_numbervalue, func_findb, func_searchb, func_replaceb - Register help in makefile.mk and 04060110.xhp index - Add missing interpre.hxx declarations: ScNumberValue, ScFindB, ScSearchB, ScReplaceB - Fix NUMBERVALUE ExtraData flag (1→0, implementation complete) --- .../helpcontent2/source/text/scalc/01/04060110.xhp | 36 +++++++++++++++ .../source/text/scalc/01/func_findb.xhp | 50 +++++++++++++++++++++ .../source/text/scalc/01/func_numbervalue.xhp | 50 +++++++++++++++++++++ .../source/text/scalc/01/func_replaceb.xhp | 51 ++++++++++++++++++++++ .../source/text/scalc/01/func_searchb.xhp | 50 +++++++++++++++++++++ main/helpcontent2/source/text/scalc/01/makefile.mk | 4 ++ main/sc/source/core/inc/interpre.hxx | 4 ++ main/sc/source/ui/src/scfuncs.src | 16 +++---- 8 files changed, 253 insertions(+), 8 deletions(-) diff --git a/main/helpcontent2/source/text/scalc/01/04060110.xhp b/main/helpcontent2/source/text/scalc/01/04060110.xhp index ba9dc330fe..c786603184 100644 --- a/main/helpcontent2/source/text/scalc/01/04060110.xhp +++ b/main/helpcontent2/source/text/scalc/01/04060110.xhp @@ -258,6 +258,15 @@ <paragraph xml-lang="en-US" id="par_id3156375" role="paragraph" l10n="U"> <item type="input">=FIND(76;998877665544)</item> returns 6.</paragraph> </section> +<section id="findb"> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155611"> +<bookmark_value>FINDB function</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_FINDB" id="bm_id3155612" localize="false"/> +<paragraph role="paragraph" id="par_id3155613" xml-lang="en-US" l10n="NEW"> +<embedvar href="text/scalc/01/func_findb.xhp#findb"/> +</paragraph> +</section> <section id="fixed"> <bookmark xml-lang="en-US" branch="index" id="bm_id3149268"> <bookmark_value>FIXED function</bookmark_value> @@ -361,6 +370,15 @@ <paragraph xml-lang="en-US" id="par_id3158407" role="paragraph" l10n="U"> <item type="input">=MID("office";2;2)</item> returns ff.</paragraph> </section> +<section id="numbervalue"> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155591"> +<bookmark_value>NUMBERVALUE function</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_NUMBERVALUE" id="bm_id3155592" localize="false"/> +<paragraph role="paragraph" id="par_id3155593" xml-lang="en-US" l10n="NEW"> +<embedvar href="text/scalc/01/func_numbervalue.xhp#numbervalue"/> +</paragraph> +</section> <section id="proper"> <bookmark xml-lang="en-US" branch="index" id="bm_id3159143"> <bookmark_value>PROPER function</bookmark_value> @@ -398,6 +416,15 @@ <paragraph xml-lang="en-US" id="par_id3154096" role="paragraph" l10n="U"> <item type="input">=REPLACE("1234567";1;1;"444")</item> returns "444234567". One character at position 1 is replaced by the complete <item type="literal">NewText</item>.</paragraph> </section> +<section id="replaceb"> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155651"> +<bookmark_value>REPLACEB function</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_REPLACEB" id="bm_id3155652" localize="false"/> +<paragraph role="paragraph" id="par_id3155653" xml-lang="en-US" l10n="NEW"> +<embedvar href="text/scalc/01/func_replaceb.xhp#replaceb"/> +</paragraph> +</section> <section id="rept"> <bookmark xml-lang="en-US" branch="index" id="bm_id3149741"> <bookmark_value>REPT function</bookmark_value> @@ -480,6 +507,15 @@ <paragraph xml-lang="en-US" id="par_id3154564" role="paragraph" l10n="U"> <item type="input">=SEARCH(54;998877665544)</item> returns 10.</paragraph> </section> +<section id="searchb"> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155631"> +<bookmark_value>SEARCHB function</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_SEARCHB" id="bm_id3155632" localize="false"/> +<paragraph role="paragraph" id="par_id3155633" xml-lang="en-US" l10n="NEW"> +<embedvar href="text/scalc/01/func_searchb.xhp#searchb"/> +</paragraph> +</section> <section id="substitute"> <bookmark xml-lang="en-US" branch="index" id="bm_id3154830"> <bookmark_value>SUBSTITUTE function</bookmark_value> diff --git a/main/helpcontent2/source/text/scalc/01/func_findb.xhp b/main/helpcontent2/source/text/scalc/01/func_findb.xhp new file mode 100644 index 0000000000..2d8c67cb29 --- /dev/null +++ b/main/helpcontent2/source/text/scalc/01/func_findb.xhp @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!--*********************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + ***********************************************************--> + +<helpdocument version="1.0"> +<meta> +<topic id="textscalc01func_findbxml" indexer="include" status="PUBLISH"> +<title id="tit" xml-lang="en-US">FINDB</title> +<filename>/text/scalc/01/func_findb.xhp</filename> +</topic> +</meta> +<body> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155611"> +<bookmark_value>FINDB function</bookmark_value> +<bookmark_value>find text; byte position</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_FINDB" id="bm_id3155612" localize="false"/> +<paragraph role="heading" id="hd_id3155610" xml-lang="en-US" level="2" l10n="U"><variable id="findb"><link href="text/scalc/01/func_findb.xhp">FINDB</link> +</variable></paragraph> +<paragraph role="paragraph" id="par_id3155613" xml-lang="en-US" l10n="U"><ahelp hid="HID_FUNC_FINDB">Finds a text string within another text string and returns the starting position as a byte count. The search is case-sensitive.</ahelp></paragraph> +<paragraph role="heading" id="hd_id3155614" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph> +<paragraph role="code" id="par_id3155615" xml-lang="en-US" l10n="U">FINDB(FindText; Text; StartPosition)</paragraph> +<paragraph role="paragraph" id="par_id3155616" xml-lang="en-US" l10n="U"><emph>FindText</emph> is the text to search for.</paragraph> +<paragraph role="paragraph" id="par_id3155617" xml-lang="en-US" l10n="U"><emph>Text</emph> is the text in which to search.</paragraph> +<paragraph role="paragraph" id="par_id3155618" xml-lang="en-US" l10n="U"><emph>StartPosition</emph> (optional) is the byte position in Text at which to start the search. Default is 1.</paragraph> +<paragraph role="paragraph" id="par_id3155619" xml-lang="en-US" l10n="U">Returns a byte position (1-based). Double-byte characters count as 2 bytes; single-byte characters count as 1 byte.</paragraph> +<paragraph role="heading" id="hd_id3155620" xml-lang="en-US" level="3" l10n="U">Examples</paragraph> +<paragraph role="paragraph" id="par_id3155621" xml-lang="en-US" l10n="U"><item type="input">=FINDB("b";"abc")</item> returns 2.</paragraph> +<paragraph role="paragraph" id="par_id3155622" xml-lang="en-US" l10n="U"><item type="input">=FINDB("B";"abc")</item> returns #VALUE! (case-sensitive).</paragraph> +</body> +</helpdocument> diff --git a/main/helpcontent2/source/text/scalc/01/func_numbervalue.xhp b/main/helpcontent2/source/text/scalc/01/func_numbervalue.xhp new file mode 100644 index 0000000000..87d1d4a765 --- /dev/null +++ b/main/helpcontent2/source/text/scalc/01/func_numbervalue.xhp @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!--*********************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + ***********************************************************--> + +<helpdocument version="1.0"> +<meta> +<topic id="textscalc01func_numbervaluexml" indexer="include" status="PUBLISH"> +<title id="tit" xml-lang="en-US">NUMBERVALUE</title> +<filename>/text/scalc/01/func_numbervalue.xhp</filename> +</topic> +</meta> +<body> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155591"> +<bookmark_value>NUMBERVALUE function</bookmark_value> +<bookmark_value>text to number conversion</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_NUMBERVALUE" id="bm_id3155592" localize="false"/> +<paragraph role="heading" id="hd_id3155590" xml-lang="en-US" level="2" l10n="U"><variable id="numbervalue"><link href="text/scalc/01/func_numbervalue.xhp">NUMBERVALUE</link> +</variable></paragraph> +<paragraph role="paragraph" id="par_id3155593" xml-lang="en-US" l10n="U"><ahelp hid="HID_FUNC_NUMBERVALUE">Converts text to a number, using explicitly specified decimal and group separators.</ahelp></paragraph> +<paragraph role="heading" id="hd_id3155594" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph> +<paragraph role="code" id="par_id3155595" xml-lang="en-US" l10n="U">NUMBERVALUE(Text; DecimalSeparator; GroupSeparator)</paragraph> +<paragraph role="paragraph" id="par_id3155596" xml-lang="en-US" l10n="U"><emph>Text</emph> is the text to be converted to a number.</paragraph> +<paragraph role="paragraph" id="par_id3155597" xml-lang="en-US" l10n="U"><emph>DecimalSeparator</emph> is the character used as the decimal separator. If omitted, the system locale default is used.</paragraph> +<paragraph role="paragraph" id="par_id3155598" xml-lang="en-US" l10n="U"><emph>GroupSeparator</emph> is the character used as the group (thousands) separator. If omitted, the system locale default is used.</paragraph> +<paragraph role="heading" id="hd_id3155599" xml-lang="en-US" level="3" l10n="U">Examples</paragraph> +<paragraph role="paragraph" id="par_id3155600" xml-lang="en-US" l10n="U"><item type="input">=NUMBERVALUE("1.234";".";",")</item> returns 1.234.</paragraph> +<paragraph role="paragraph" id="par_id3155601" xml-lang="en-US" l10n="U"><item type="input">=NUMBERVALUE("1.234,56";",";".")</item> returns 1234.56.</paragraph> +<paragraph role="paragraph" id="par_id3155602" xml-lang="en-US" l10n="U"><item type="input">=NUMBERVALUE("123%")</item> returns 1.23.</paragraph> +</body> +</helpdocument> diff --git a/main/helpcontent2/source/text/scalc/01/func_replaceb.xhp b/main/helpcontent2/source/text/scalc/01/func_replaceb.xhp new file mode 100644 index 0000000000..e696da912d --- /dev/null +++ b/main/helpcontent2/source/text/scalc/01/func_replaceb.xhp @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!--*********************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + ***********************************************************--> + +<helpdocument version="1.0"> +<meta> +<topic id="textscalc01func_replacebxml" indexer="include" status="PUBLISH"> +<title id="tit" xml-lang="en-US">REPLACEB</title> +<filename>/text/scalc/01/func_replaceb.xhp</filename> +</topic> +</meta> +<body> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155651"> +<bookmark_value>REPLACEB function</bookmark_value> +<bookmark_value>replace text; byte position</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_REPLACEB" id="bm_id3155652" localize="false"/> +<paragraph role="heading" id="hd_id3155650" xml-lang="en-US" level="2" l10n="U"><variable id="replaceb"><link href="text/scalc/01/func_replaceb.xhp">REPLACEB</link> +</variable></paragraph> +<paragraph role="paragraph" id="par_id3155653" xml-lang="en-US" l10n="U"><ahelp hid="HID_FUNC_REPLACEB">Replaces part of a text string, based on byte positions, with a different text string.</ahelp></paragraph> +<paragraph role="heading" id="hd_id3155654" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph> +<paragraph role="code" id="par_id3155655" xml-lang="en-US" l10n="U">REPLACEB(OldText; StartPosition; ByteCount; NewText)</paragraph> +<paragraph role="paragraph" id="par_id3155656" xml-lang="en-US" l10n="U"><emph>OldText</emph> is the text in which to replace characters.</paragraph> +<paragraph role="paragraph" id="par_id3155657" xml-lang="en-US" l10n="U"><emph>StartPosition</emph> is the byte position at which to start replacing. The first byte is position 1.</paragraph> +<paragraph role="paragraph" id="par_id3155658" xml-lang="en-US" l10n="U"><emph>ByteCount</emph> is the number of bytes to replace.</paragraph> +<paragraph role="paragraph" id="par_id3155659" xml-lang="en-US" l10n="U"><emph>NewText</emph> is the text to insert.</paragraph> +<paragraph role="paragraph" id="par_id3155660" xml-lang="en-US" l10n="U">Double-byte characters count as 2 bytes; single-byte characters count as 1 byte.</paragraph> +<paragraph role="heading" id="hd_id3155661" xml-lang="en-US" level="3" l10n="U">Examples</paragraph> +<paragraph role="paragraph" id="par_id3155662" xml-lang="en-US" l10n="U"><item type="input">=REPLACEB("abc";2;1;"x")</item> returns "axc".</paragraph> +<paragraph role="paragraph" id="par_id3155663" xml-lang="en-US" l10n="U"><item type="input">=REPLACEB("abc";4;0;"d")</item> returns "abcd".</paragraph> +</body> +</helpdocument> diff --git a/main/helpcontent2/source/text/scalc/01/func_searchb.xhp b/main/helpcontent2/source/text/scalc/01/func_searchb.xhp new file mode 100644 index 0000000000..5df4266f9d --- /dev/null +++ b/main/helpcontent2/source/text/scalc/01/func_searchb.xhp @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!--*********************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + ***********************************************************--> + +<helpdocument version="1.0"> +<meta> +<topic id="textscalc01func_searchbxml" indexer="include" status="PUBLISH"> +<title id="tit" xml-lang="en-US">SEARCHB</title> +<filename>/text/scalc/01/func_searchb.xhp</filename> +</topic> +</meta> +<body> +<bookmark xml-lang="en-US" branch="index" id="bm_id3155631"> +<bookmark_value>SEARCHB function</bookmark_value> +<bookmark_value>search text; byte position</bookmark_value> +</bookmark> +<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_SEARCHB" id="bm_id3155632" localize="false"/> +<paragraph role="heading" id="hd_id3155630" xml-lang="en-US" level="2" l10n="U"><variable id="searchb"><link href="text/scalc/01/func_searchb.xhp">SEARCHB</link> +</variable></paragraph> +<paragraph role="paragraph" id="par_id3155633" xml-lang="en-US" l10n="U"><ahelp hid="HID_FUNC_SEARCHB">Finds a text string within another text string and returns the starting position as a byte count. The search is not case-sensitive and supports wildcards.</ahelp></paragraph> +<paragraph role="heading" id="hd_id3155634" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph> +<paragraph role="code" id="par_id3155635" xml-lang="en-US" l10n="U">SEARCHB(FindText; Text; StartPosition)</paragraph> +<paragraph role="paragraph" id="par_id3155636" xml-lang="en-US" l10n="U"><emph>FindText</emph> is the text to search for. Wildcard characters ? (any single character) and * (any sequence of characters) are supported.</paragraph> +<paragraph role="paragraph" id="par_id3155637" xml-lang="en-US" l10n="U"><emph>Text</emph> is the text in which to search.</paragraph> +<paragraph role="paragraph" id="par_id3155638" xml-lang="en-US" l10n="U"><emph>StartPosition</emph> (optional) is the byte position in Text at which to start the search. Default is 1.</paragraph> +<paragraph role="paragraph" id="par_id3155639" xml-lang="en-US" l10n="U">Returns a byte position (1-based). Double-byte characters count as 2 bytes; single-byte characters count as 1 byte.</paragraph> +<paragraph role="heading" id="hd_id3155640" xml-lang="en-US" level="3" l10n="U">Examples</paragraph> +<paragraph role="paragraph" id="par_id3155641" xml-lang="en-US" l10n="U"><item type="input">=SEARCHB("B";"abc")</item> returns 2.</paragraph> +<paragraph role="paragraph" id="par_id3155642" xml-lang="en-US" l10n="U"><item type="input">=SEARCHB("a?c";"abc")</item> returns 1.</paragraph> +</body> +</helpdocument> diff --git a/main/helpcontent2/source/text/scalc/01/makefile.mk b/main/helpcontent2/source/text/scalc/01/makefile.mk index d8d7782d0e..08644f62de 100644 --- a/main/helpcontent2/source/text/scalc/01/makefile.mk +++ b/main/helpcontent2/source/text/scalc/01/makefile.mk @@ -207,6 +207,7 @@ XHPFILES = \ func_eomonth.xhp \ func_errortype.xhp \ func_hour.xhp \ + func_numbervalue.xhp \ func_iferror.xhp \ func_ifna.xhp \ func_minute.xhp \ @@ -214,6 +215,9 @@ XHPFILES = \ func_networkdays.xhp \ func_now.xhp \ func_second.xhp \ + func_findb.xhp \ + func_replaceb.xhp \ + func_searchb.xhp \ func_skewp.xhp \ func_time.xhp \ func_timevalue.xhp \ diff --git a/main/sc/source/core/inc/interpre.hxx b/main/sc/source/core/inc/interpre.hxx index 550cfee27e..62dd94330b 100644 --- a/main/sc/source/core/inc/interpre.hxx +++ b/main/sc/source/core/inc/interpre.hxx @@ -611,6 +611,10 @@ void ScGetDay(); void ScGetDayOfWeek(); void ScGetWeekOfYear(); void ScIsoWeekNum(); +void ScNumberValue(); +void ScFindB(); +void ScSearchB(); +void ScReplaceB(); void ScEasterSunday(); void ScGetHour(); void ScGetMin(); diff --git a/main/sc/source/ui/src/scfuncs.src b/main/sc/source/ui/src/scfuncs.src index 4a37984b18..668aa677c9 100644 --- a/main/sc/source/ui/src/scfuncs.src +++ b/main/sc/source/ui/src/scfuncs.src @@ -9394,14 +9394,14 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 { Text [ en-US ] = "Converts text to a number using explicitly specified decimal and group separators." ; }; - ExtraData = - { - 1; // TODO: implementation and unsuppress - ID_FUNCTION_GRP_TEXT; - U2S( HID_FUNC_NUMBERVALUE ); - 3; 0; 0; - 0; - }; +ExtraData = + { + 0; + ID_FUNCTION_GRP_TEXT; + U2S( HID_FUNC_NUMBERVALUE ); + 3; 0; 0; + 0; + }; String 2 // Name of Parameter 1 { Text [ en-US ] = "text" ;
