https://bugs.documentfoundation.org/show_bug.cgi?id=172289

            Bug ID: 172289
           Summary: Dictionary extensions with no compatible version
                    specified are not displayed in the extensions dialog
           Product: LibreOffice
           Version: 26.8.0.0 alpha0+ master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Extensions
          Assignee: [email protected]
          Reporter: [email protected]

Description:
The dictionary extension installation dialog currently doesn't display all
possible extensions. Some aren't displayed due to an exception in the
parseResponse method in cui/source/dialogs/AdditionsDialog.cxx. The following
note is left in this method:

// This usually happens when one of the values ​​is null (type() ==
orcus::json::node_t::null)
// TODO: Allow null values ​​in additions.

It appears that some extensions aren't displayed due to an unspecified
compatibility value, which causes an exception. Perhaps it would be worth
adding a method that returns a default value for cases where no values ​​are
specified in "releases." Something like this:

OUString lcl_readReleaseDetails(orcus::json::node& node, std::string_view key,
const OUString& fallback)
{
  OUString ret;
  try 
  { 
    ret = OStringToOUString( 
      node.child("releases").child(0).child(key).string_value(), 
      RTL_TEXTENCODING_UTF8); 
  } 
  catch (...) 
  { 
    ret = fallback; 
  } 
  return ret;
}

And then in the code use calls like this for "compatibility", "releaseName" and
"license":
lcl_readReleaseDetails(arrayElement, "compatibility", u"undefined"_ustr)

Instead of:
OStringToOUString(arrayElement.child("releases").child(0).child("compatibility").string_value(),
RTL_TEXTENCODING_UTF8)

Steps to Reproduce:
1. Launch LibreOffice, open the "Tools" -> "Options..."
2. Expand the "Languages ​​and Locales" tab, then select "Writing Aids"
3. At the bottom of the settings area, click "Get more dictionaries online..."

Actual Results:
Some extensions (e.g. "British English spell checker",
https://extensions.libreoffice.org/en/extensions/show/99294, without the
"Compatibility" value in Version 5.0) do not appear in the resulting list of
available dictionaries

Expected Results:
All available dictionary extensions are displayed, marked undefined /
unspecified or similar for problematic fields


Reproducible: Always


User Profile Reset: No

Additional Info:
Still repro with:
Version: 26.8.0.0.alpha1+ (X86_64)
Build ID: f3099242a353bb445e1b907191d58d9a4e265380
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: CL threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to