<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Summary: SmartTag XStringKeyMaps not filled in lcl_FillRecognizerData"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=143464">143464</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Summary: SmartTag XStringKeyMaps not filled in  lcl_FillRecognizerData
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>antalk2@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="https://bugs.documentfoundation.org/attachment.cgi?id=173720" name="attach_173720" title="use NULL for missing XStringKeyMap entries">attachment 173720</a> <a href="https://bugs.documentfoundation.org/attachment.cgi?id=173720&action=edit" title="use NULL for missing XStringKeyMap entries">[details]</a></span>
use NULL for missing XStringKeyMap entries

While trying to use SmartTags, the development version (commit
f81871ccbbe118b4ac93325a29f7c6b26765cb6e)
(but not Version: 6.4.7.2 Build ID: 1:6.4.7-0ubuntu0.20.04.1)
reports 

soffice.bin: file:libo/include/com/sun/star/uno/Sequence.hxx::190

    const E& com::sun::star::uno::Sequence< <template-parameter-1-1>
<span class="quote">>::operator[](sal_Int32) const </span >
    [with E =
com::sun::star::uno::Reference<com::sun::star::container::XStringKeyMap>;
sal_Int32 = int]:
    Assertion `nIndex >= 0 && static_cast<sal_uInt32>(nIndex) <
static_cast<sal_uInt32>(getLength())' failed.

Stack trace (partial)

#3  0x00007ffff7a59f36 in __GI___assert_fail
    (assertion=0x7ffff3fc4920 "nIndex >= 0 && static_cast<sal_uInt32>(nIndex) <
static_cast<sal_uInt32>(getLength())", file=0x7ffff3fc48c8
"libo/include/com/sun/star/uno/Sequence.hxx", line=190, function=0x7ffff3fc4800
"const E& com::sun::star::uno::Sequence< <template-parameter-1-1>
<span class="quote">>::operator[](sal_Int32) const [with E =</span >
com::sun::star::uno::Reference<com::sun::star::container::XStringKeyMap>;
sal_Int32 = int]") at assert.c:101
#4  0x00007ffff3d6a443 in
com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::container::XStringKeyMap>
<span class="quote">>::operator[](int) const (this=0x55555b01adb0, nIndex=0)</span >
    at libo/include/com/sun/star/uno/Sequence.hxx:190
#5  0x00007ffff3d67990 in (anonymous
namespace)::SmartTagMenuController::FillMenu() (this=0x55555bdc1400) at
libo/svx/source/mnuctrls/smarttagmenu.cxx:128
#6  0x00007ffff3d675f3 in (anonymous
namespace)::SmartTagMenuController::statusChanged(com::sun::star::frame::FeatureStateEvent
const&) (this=0x55555bdc1400, rEvent=...)
    at libo/svx/source/mnuctrls/smarttagmenu.cxx:103

I believe this arises because  lcl_FillRecognizerData at
<a href="https://docs.libreoffice.org/sw/html/crsrsh_8cxx_source.html#l03692">https://docs.libreoffice.org/sw/html/crsrsh_8cxx_source.html#l03692</a> 

file:libo/sw/source/core/crsr/crsrsh.cxx::3663

does not fill aStringKeyMaps, yielding an empty rStringKeyMaps

---

How to reproduce

- install a smarttags extension
- control-click on marked smart tag

---

The attached patch avoids the failure by using NULL for missing XStringKeyMap
entries.
It results in passing NULL to xAction->getActionCount(),
xAction->getActionCaptionFromID()
and InvokeAction aEntry( xAction, xSmartTagProperties, nActionID );

This seems to match earlier behaviour.
It would be nice to be able to pass some info in XStringKeyMap.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>