[Libreoffice-bugs] [Bug 143464] New: Summary: SmartTag XStringKeyMaps not filled in lcl_FillRecognizerData

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Jul 20 20:13:01 UTC 2021


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

            Bug ID: 143464
           Summary: Summary: SmartTag XStringKeyMaps not filled in
                    lcl_FillRecognizerData
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: antalk2 at gmail.com

Created attachment 173720
  --> https://bugs.documentfoundation.org/attachment.cgi?id=173720&action=edit
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>
>::operator[](sal_Int32) const 
    [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>
>::operator[](sal_Int32) const [with E =
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>
>::operator[](int) const (this=0x55555b01adb0, nIndex=0)
    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
https://docs.libreoffice.org/sw/html/crsrsh_8cxx_source.html#l03692 

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210720/24290153/attachment.htm>


More information about the Libreoffice-bugs mailing list