Commit graph

500723 commits

Author SHA1 Message Date
Xisco Fauli
c64ac05bed tdf#163486: PVS: variable is assigned values twice successively
V519 	The 'sNewUrl' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 527, 554.

Change-Id: I35e1b9e78f71958e99586385ba0c86e553e65997
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175140
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-20 10:32:47 +02:00
Bogdan Buzea
f17e930b0f tdf#163486: PVS: The variable was assign the same value.
V1048 The 'bDirectionForward' variable was assigned the same value.

Change-Id: I83343be3cfe93f0be97eae01869dd00cd0814c67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175203
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-20 10:31:03 +02:00
Bogdan Buzea
ca48b37054 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 856, 860
V1037 Two or more case-branches perform the same actions. Check lines: 918, 923, 958

Change-Id: I2ef4a1cbcbbc54496b896153f08ebd0049c4dfc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175232
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-20 10:30:22 +02:00
Bogdan Buzea
faafdec09a tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 976, 983

Change-Id: If40078b2a6ea2654d22f6cf559d19ed6c64bc44a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175218
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-20 10:29:25 +02:00
Bogdan Buzea
ff25df1804 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 92, 96

Change-Id: Ibf8ca692e5d7208d99280c14190bda35a0fd7022
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175231
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-20 10:28:56 +02:00
Bogdan Buzea
2005faca8c tdf#163486: PVS: The variable was assign the same value.
V1048 The 'bDifferentParents' variable was assigned the same value. See lines 478 and 539

Change-Id: Ieb29f0a089bedc3e52056f2b24284298b097fbc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175202
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-20 10:28:20 +02:00
Bogdan Buzea
005eda09ef tdf#163486: PVS: The variable was assign the same value.
V1048 The 'bDec' variable was assigned the same value. Lines 1787 and 1799.

Change-Id: Ia2acce92ee597d9ca801785e8c512d7351ead669
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175160
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-20 10:26:12 +02:00
Bogdan Buzea
2b2b1cc59a tdf#163486: PVS: The variable was assign the same value.
V1048 The 'bDeleteMark' variable was assigned the same value. See lines 983 and 1001.

Change-Id: I004d5fa043404a945498182d0a366c1e05158435
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175201
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-20 10:23:07 +02:00
Mike Kaganski
a9f55e37e5 Fix CppunitTest_sw_a11y crash: clear mxAccessBridge in DeInitVCL
I see the crash locally on Windows 11, in a 64-bit build. Debugging it,
I see this call stack:

  vcllo.dll!std::unique_ptr<comphelper::SolarMutex,std::default_delete<comphelper::SolarMutex>>::get() Line 3433
  vcllo.dll!SalInstance::GetYieldMutex() Line 142
  vcllo.dll!Application::GetSolarMutex() Line 492
  tklo.dll!SolarMutexGuard::SolarMutexGuard() Line 1340
  tklo.dll!VCLXDevice::~VCLXDevice() Line 45
  tklo.dll!cppu::ImplInheritanceHelper<VCLXDevice,com::sun::awt::XWindow2,com::sun::awt::XVclWindowPeer,com::sun::awt::XLayoutConstrains,com::sun::awt::XView,com::sun::awt::XDockableWindow,com::sun::accessibility::XAccessible,com::sun::lang::XEventListener,com::sun:🫘:XPropertySetInfo,com::sun::awt::XStyleSettingsSupplier>::~ImplInheritanceHelper<VCLXDevice,com::sun::awt::XWindow2,com::sun::awt::XVclWindowPeer,com::sun::awt::XLayoutConstrains,com::sun::awt::XView,com::sun::awt::XDockableWindow,com::sun::accessibility::XAccessible,com::sun::lang::XEventListener,com::sun:🫘:XPropertySetInfo,com::sun::awt::XStyleSettingsSupplier>() Line 155
  tklo.dll!VCLXWindow::~VCLXWindow() Line 336
  tklo.dll!cppu::ImplInheritanceHelper<VCLXWindow,com::sun::awt::XVclContainer,com::sun::awt::XVclContainerPeer>::~ImplInheritanceHelper<VCLXWindow,com::sun::awt::XVclContainer,com::sun::awt::XVclContainerPeer>() Line 155
  tklo.dll!VCLXContainer::~VCLXContainer() Line 42
  tklo.dll!cppu::ImplInheritanceHelper<VCLXContainer,com::sun::awt::XTopWindow3,com::sun::awt::XSystemDependentWindowPeer>::~ImplInheritanceHelper<VCLXContainer,com::sun::awt::XTopWindow3,com::sun::awt::XSystemDependentWindowPeer>() Line 155
  tklo.dll!VCLXTopWindow::~VCLXTopWindow() Line 240
  tklo.dll!VCLXTopWindow::`scalar deleting destructor'(unsigned int)
  cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 230
  tklo.dll!cppu::WeakImplHelper<com::sun::awt::XDevice,com::sun::awt::XUnitConversion>::release() Line 115
  tklo.dll!cppu::ImplInheritanceHelper<VCLXDevice,com::sun::awt::XWindow2,com::sun::awt::XVclWindowPeer,com::sun::awt::XLayoutConstrains,com::sun::awt::XView,com::sun::awt::XDockableWindow,com::sun::accessibility::XAccessible,com::sun::lang::XEventListener,com::sun:🫘:XPropertySetInfo,com::sun::awt::XStyleSettingsSupplier>::release() Line 171
  tklo.dll!cppu::ImplInheritanceHelper<VCLXWindow,com::sun::awt::XVclContainer,com::sun::awt::XVclContainerPeer>::release() Line 171
  tklo.dll!cppu::ImplInheritanceHelper<VCLXContainer,com::sun::awt::XTopWindow3,com::sun::awt::XSystemDependentWindowPeer>::release() Line 171
  winaccessibility.dll!com::sun::uno::Reference<com::sun::accessibility::XAccessible>::set(com::sun::accessibility::XAccessible * pInterface) Line 247
  winaccessibility.dll!com::sun::uno::Reference<com::sun::accessibility::XAccessible>::operator=(com::sun::accessibility::XAccessible * pInterface) Line 351
  winaccessibility.dll!AccObject::~AccObject() Line 283
  winaccessibility.dll!std::pair<com::sun::accessibility::XAccessible * const,AccObject>::~pair<com::sun::accessibility::XAccessible * const,AccObject>()
  winaccessibility.dll!std::pair<com::sun::accessibility::XAccessible * const,AccObject>::`scalar deleting destructor'(unsigned int)
  winaccessibility.dll!std::destroy_at<std::pair<com::sun::accessibility::XAccessible * const,AccObject>>(std::pair<com::sun::accessibility::XAccessible * const,AccObject> * const _Location) Line 306
  winaccessibility.dll!std::_Default_allocator_traits<std::allocator<std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *>>>::destroy<std::pair<com::sun::accessibility::XAccessible * const,AccObject>>(std::allocator<std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *>> & __formal, std::pair<com::sun::accessibility::XAccessible * const,AccObject> * const _Ptr) Line 707
  winaccessibility.dll!std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *>::_Freenode<std::allocator<std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *>>>(std::allocator<std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *>> & _Al, std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *> * _Ptr) Line 382
  winaccessibility.dll!std::_Tree_val<std::_Tree_simple_types<std::pair<com::sun::accessibility::XAccessible * const,AccObject>>>::_Erase_tree<std::allocator<std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *>>>(std::allocator<std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *>> & _Al, std::_Tree_node<std::pair<com::sun::accessibility::XAccessible * const,AccObject>,void *> * _Rootnode) Line 760
  winaccessibility.dll!std::_Tree<std::_Tmap_traits<com::sun::accessibility::XAccessible *,AccObject,std::less<com::sun::accessibility::XAccessible *>,std::allocator<std::pair<com::sun::accessibility::XAccessible * const,AccObject>>,0>>::clear() Line 1365
  winaccessibility.dll!AccObjectWinManager::~AccObjectWinManager() Line 67
  winaccessibility.dll!AccTopWindowListener::~AccTopWindowListener() Line 100
  winaccessibility.dll!AccTopWindowListener::`scalar deleting destructor'(unsigned int)
  cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 230
  winaccessibility.dll!cppu::WeakImplHelper<com::sun::awt::XTopWindowListener>::release() Line 115
  winaccessibility.dll!rtl::Reference<AccTopWindowListener>::~Reference<AccTopWindowListener>() Line 126
  winaccessibility.dll!my_sc_impl::`anonymous namespace'::MSAAServiceImpl::~MSAAServiceImpl()
  winaccessibility.dll!my_sc_impl::`anonymous namespace'::MSAAServiceImpl::`scalar deleting destructor'(unsigned int)
  cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 230
  winaccessibility.dll!cppu::WeakImplHelper<com::sun::accessibility::XMSAAService,com::sun::lang::XServiceInfo>::release() Line 115
  vcllo.dll!com::sun::uno::Reference<com::sun::lang::XComponent>::~Reference<com::sun::lang::XComponent>() Line 114
  vcllo.dll!ImplSVData::~ImplSVData() Line 509
  vcllo.dll!`rtl::Static<ImplSVData,`anonymous namespace'::private_aImplSVData>::get'::`2'::`dynamic atexit destructor for 'instance''()
  ucrtbased.dll!_execute_onexit_table::__l2::<lambda>() Line 206
  ucrtbased.dll!__crt_seh_guarded_call<int>::operator()<void <lambda>(void),int <lambda>(void) &,void <lambda>(void)>(__acrt_lock_and_call::__l2::void <lambda>(void) && setup, _execute_onexit_table::__l2::int <lambda>(void) & action, __acrt_lock_and_call::__l2::void <lambda>(void) && cleanup) Line 204
  ucrtbased.dll!__acrt_lock_and_call<int <lambda>(void)>(const __acrt_lock_id lock_id, _execute_onexit_table::__l2::int <lambda>(void) && action) Line 974
  ucrtbased.dll!_execute_onexit_table(_onexit_table_t * table) Line 231
  vcllo.dll!__scrt_dllmain_uninitialize_c() Line 398
  vcllo.dll!dllmain_crt_process_detach(const bool is_terminating) Line 182
  vcllo.dll!dllmain_crt_dispatch(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 220
  vcllo.dll!dllmain_dispatch(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 293
  vcllo.dll!_DllMainCRTStartup(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 335
  ntdll.dll!LdrpCallInitRoutine()
  ntdll.dll!LdrShutdownProcess()
  ntdll.dll!RtlExitUserProcess()
  kernel32.dll!ExitProcessImplementation()
  ucrtbased.dll!exit_or_terminate_process(const unsigned int return_code) Line 138
  ucrtbased.dll!common_exit(const int return_code, const _crt_exit_cleanup_mode cleanup_mode, const _crt_exit_return_mode return_mode) Line 274
  ucrtbased.dll!exit(int return_code) Line 288
  cppunittester.exe!__scrt_common_main_seh() Line 295
  cppunittester.exe!__scrt_common_main() Line 331
  cppunittester.exe!mainCRTStartup(void * __formal) Line 17
  kernel32.dll!BaseThreadInitThunk()
  ntdll.dll!RtlUserThreadStart()

where in Application::GetSolarMutex, pSVData->mpDefInst is nullptr,
so in the end, the message is:

  Exception thrown: read access violation.
  this was 0x10.

This change moves the hack introduced in commit
05d2a41565 (INTEGRATION: CWS vcl37
(1.52.38); FILE MERGED, 2005-03-29), which obviously solved the same
problem. The CppUnit case is different, because there ImplSVMain is
not used, but instead, DeInitVCL is called from Protector dtor
(test/source/vclbootstrapprotector.cxx). So doing it in the start of
DeInitVCL looks a reasonable solution to me.

Change-Id: I5ba740a6b94bbdabc28538dbbcf8cd211bb56f16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175198
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-20 07:59:48 +02:00
Aditya Sahu
33af9a8fa1 tdf#87605: Add new words to technical dictionary.
Change-Id: I02867aa8bce8b80cc905b8a1e1f80812bd84affe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175250
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-10-20 07:09:19 +02:00
Mike Kaganski
341f361886 tdf#163486: PVS: Numeric Truncation Error. Return value of the 'size' function is written to the 16-bit variable.
Change-Id: Id912987800b9d5794fb1ab81a108163c4750d409
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175213
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-19 22:14:52 +02:00
Miklos Vajna
d27f3cdfae sw: use frozen in SwXText::convertToTable()
Switch from linear search to a fast lookup.

Change-Id: Ie10435895c9a096fe0ae4bdda0a1a1eecf3c1bc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154284
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-10-19 20:39:11 +02:00
Bogdan Buzea
c2308be747 tdf#163486: PVS: Identical branches
Change-Id: I01aae9395213eb09c8bea990b2b6a811f7ab2ee2
V1037: Two or more case-branches perform the same actions. Check lines: 1249, 1277
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175150
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-10-19 19:52:19 +02:00
Bogdan Buzea
ba08d8f3a9 tdf#163486: PVS: Identical branches
Change-Id: If000f1e0bb01c6d551ef970edae8058e8020a202
V1037: Two or more case-branches perform the same actions. Check lines: 917, 945
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175152
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-10-19 19:49:40 +02:00
Justin Luth
424329bb0b tdf#158460 xls/x export: don't force wrap-text for imported single-line
Starting in LO 24.2, we started displaying imported XLS/X files
that had contents-with-newlines on a single line
if the cell did not have the wrap-text property - just like buggy Excel.

So, now we need to round-trip that without setting wrap-text,
so that we can continue to exhibit buggy behaviour
(instead of fixing the document so that the newlines aren't ignored).

A previous attempt to do this was reverted (for many reasons),
significantly because it failed to handle the situation
where a user entered new newline content (without forcing wrap-text).
So in LO the new content DISPLAYS on multiple lines,
but after a round-trip it was all squashed together.

So it is important to keep the traditional behaviour of forcing wrap-text,
and ONLY avoiding it when round-tripping imported content.
It also preserves ODS -> XLS/X conversions.

I also took the opportunity to rename mbWrapped.

make CppunitTest_sc_subsequent_export_test3 \
    CPPUNIT_TEST_NAME=testPreserveTextWhitespace2XLSX

Change-Id: Ia35b0679946b51626fabd4043779c1b43cc1ae37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174436
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2024-10-19 17:30:10 +02:00
Andrea Gelmini
28c456c9c1 Fix typo
Change-Id: I14a2953ec84d45844a3c83c47186cebef28feda6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175195
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:53:20 +02:00
Andrea Gelmini
aaf61a278a Fix typo
Change-Id: Ib3ee31656c5c9b99d77d359d28761713bb2479ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175193
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:53:05 +02:00
Andrea Gelmini
beae2f54f2 Fix typo
Change-Id: I14b77fc81781278925d9dab0133279eaa1acb726
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175194
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:52:43 +02:00
Andrea Gelmini
593cd3b3f5 Fix typo in code
Change-Id: I8f825d42024edc874e1f5aaff1de4eef2b3b1e24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175170
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:52:24 +02:00
Andrea Gelmini
fabb52a12d Fix typo
Change-Id: I06a0e9b697988f8d6ddd1d0d2be6ea4de8764a9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175168
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:50:52 +02:00
Andrea Gelmini
c9be66176f Removed duplicated includes
Change-Id: I2121743ddfca5994a7e7718cbbb9662b9029bc08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175169
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:50:38 +02:00
Andrea Gelmini
797e5314d9 Fix typo
Change-Id: I776bcd6a4fb7d5f38f1aa3b5814b5c7cd455aaf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175171
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:49:59 +02:00
Andrea Gelmini
cfa3292c81 Fix typo
Change-Id: Ib53d104b1600f23c8b50869ab37958829df63d1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175167
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-19 15:46:54 +02:00
Caolán McNamara
6fe9c3fb37 cid#1633260 COPY_INSTEAD_OF_MOVE
and

cid#1633259 COPY_INSTEAD_OF_MOVE

Change-Id: I3148eddfa78e0dbdeb8ff4f1a6391420e8a635d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175176
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-19 14:49:55 +02:00
Caolán McNamara
54f47ae4eb cid#1608219 silence Overflowed constant
and

cid#1608307 Overflowed constant
cid#1606687 Overflowed integer argument

Change-Id: I043f3e49810ca441453af88866a1156f47e6cd87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175177
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-19 14:48:58 +02:00
Vladislav Tarakanov
baf179188d tdf#156333 Adding a tint/shade values to the model
Before implementing text effects from the TextFill tag, their values
must be directly saved in ComplexColor, without saving in GrabBag.
To achieve this, DomainMapper has introduced separate processing
of the LN_textFill_textFill tag using the new TextFillHandler class.

TextFillHandler inherits from TextEffectsHandler. As a parameter in
the constructor, it receives a reference to the ComplexColor to which
changes will be added. This is done because some text effects
(ThemeTint, ThemeShade) can be specified in the <color> tag, so
TextFill must complement existing transformations. For the same
reason, when processing LN_EG_RPrBase_color, the ComplexColor
value is taken from the context if it was placed there previously.

In docx export, existing "Tint" and "Shade" transformations are
preserved only in <color ThemeTint=...> and <color ThemeShade=...>.
Because the Tint and Shade values from TextFill must be
distinguished from the values from color during export, the "Tint"
and "Shade" transforms have been renamed to "ThemeTint" and
"ThemeShade". Also added new "Tint" and "Shade" transformations,
which are currently only saved in TextFill.

Change-Id: I0ebba53eba83ccfc99fa812e60d6cebb2ff6bf0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157979
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-10-19 14:26:23 +02:00
Justin Luth
2bbd247f16 tdf#156505 sw: reset view options after export as graphic
When creating an export graphic,
the view options are changed to hide hidden stuff,
not show the formatting marks etc.

However, the user's view settings were not being restored
after the export was done.

Change-Id: I3e236e5ef47eddca487621c92ec639f7bac073de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175185
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2024-10-19 13:36:06 +02:00
Mike Kaganski
85a56048a0 Windows/--disable-skia: fix D2DWriteTextOutRenderer to properly set AA mode
This simplifies the process; in D2DWriteTextOutRenderer ctor, it
uses the final mode for the call to CreateRenderTarget, applying
the correct mode.

Also, pass the AA flag from SalGraphics, and check the setting of
GetUseFontAAFromSystem to use it, as done in e.g. CairoTextRender
after commit e6538f5bdd (tdf#118966
vcl: add a flag to determine if AA of fonts is used from the system,
2018-07-28).

This fixes the failures on Windows with --disable-skia, as seen in
https://lists.freedesktop.org/archives/libreoffice/2024-October/092541.html

VclCjkTextTest::testVerticalText needed to be fixed by a tweak in
getCharacterRightSideHeight, to use color's IsDark, instead of
comparing to the fixed black, because the correct AA mode that is
used now, makes the vertical part of the character not completely
black.

Change-Id: Iee8fe98e29a80a242f8e761c9a23c68b34a45699
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175188
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-19 12:29:02 +02:00
Michael Weghorn
a9be87a341 wina11y: Mention Accessibility Insights for Windows in README
... as a tool that can be useful for analysis/debugging.

Change-Id: I310b04abfd3cacd403e2cfafc67f2471fa673c22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175173
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-10-19 09:54:47 +02:00
Michael Weghorn
04a2ab7ccb tdf#130857 qt weld: Use native widgets for "Rename Sheet" dialog etc.
Add the .ui file used e.g. for the "Rename Sheet" dialog
in Calc to the list of .ui files supported by QtInstanceBuilder.

This means that a dialog using native Qt widgets gets
used by the qt5/qt6 VCL plugins now when e.g. starting
Calc, right-clicking the the tab for the current sheet at
the bottom and selecting the "Rename Sheet" menu entry.

Change-Id: Ie656e55cb2701596f6c6f1f7d395934eedf710fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175183
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-19 08:49:05 +02:00
Michael Weghorn
bfbaeb8192 tdf#160982 wina11y: Drop extra screen reader check to enable a11y bridge
When initializing the a11y bridge on Windows, no longer
check whether the screen reader parameter
`SPI_GETSCREENREADER` [1] is explicitly set or require
to explicitly enable by setting an
`SAL_FORCE_IACCESSIBLE2` environment variable.

For performance reasons, it of course makes sense to only
enable the a11y bridge when there is actually assistive
technology that makes use of it.

However, `ImplInitAccessBridge` already only gets called
when either support for assistive technology has explicitly
been enabled in the settings (i.e. in "Tools" -> "Options" -> "LibreOfficeDev"
-> "Accessibility", the "Support assistive technology tools (restart
required" checkbox was checked) or when a `WM_GETOBJECT` message
is received, whose documentation says [2]:

> Sent by both Microsoft Active Accessibility and Microsoft UI Automation
> to obtain information about an accessible object contained in a server
> application.
>
> Applications never send this message directly. Microsoft Active
> Accessibility sends this message in response to calls to
> AccessibleObjectFromPoint, AccessibleObjectFromEvent, or
> AccessibleObjectFromWindow. However, server applications handle this
> message. UI Automation sends this message in response to calls to
> IUIAutomation::ElementFromHandle, ElementFromPoint, and
> GetFocusedElement, and when handling events for which a client has
> registered.

Both of these cases (explicitly enabled, AT requests information) justify
enabling the a11y bridge by themselves, so drop the extra check.

Qt's UIA bridge for example also gets activated when a WM_GETOBJECT
message is received [3].

This makes both, Microsoft Narrator (screen reader shipped with
Windows, but which doesn't set the `SPI_GETSCREENREADER` parameter)
and Microsoft Accessibility Insights for Windows (a tool for a11y
analysis/debugging) work - at least to a certain degree - without
having to explicitly set the environment variable
`SAL_FORCE_IACCESSIBLE2`.

While LibreOffice doesn't have a UIA bridge at this point in time,
Windows provides an MSAA (IAccessible) to UIA proxy that provides
some basic information via UIA at least, see [4]:

> The LegacyIAccessible control pattern is supported by the Microsoft
> Active Accessibility to Microsoft UI Automation Proxy.

As expected, a breakpoint or assert in `ImplInitAccessBridge`
only got hit in my testing when either an AT was active or the
above-mentioned option was explicitly enabled, not otherwise when
starting or using LO.

[1] https://learn.microsoft.com/en-us/windows/win32/winauto/screen-reader-parameter
[2] https://learn.microsoft.com/en-us/windows/win32/winauto/wm-getobject
[3] https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp?id=e9662a4b665144a5eca418925d331024ec71fa2c#n40
[4] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-implementinglegacyiaccessible

Change-Id: Iddafb149b50771412ba59972d0401bada6a9f680
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175172
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-19 08:48:46 +02:00
Michael Weghorn
a2fab652b4 vcl: Use OUString literals in SalGetDesktopEnvironment
Change-Id: Ibd28148772fcdc64a9fe6ebca38706c0445d38fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175139
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-19 08:48:31 +02:00
Jonathan Clark
224fae69b2 tdf#163215: Enable kashida justification for AAT fonts
Currently, we use HarfBuzz-provided kashida insertion position
information to decide on positions to insert kashida. This data is used
both while ranking kashida insertion positions, and to avoid inserting
kashida in positions that would break shaping on a per-font basis.

Unfortunately, HarfBuzz cannot validate kashida insertion positions for
AAT fonts. As a result, kashida were previously not inserted for text
using AAT fonts.

This change updates kashida justification to skip validation against
HarfBuzz when AAT fonts are used.

Change-Id: If0d31512b1db0f1f8155963f9b1031eb01bacc45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175165
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-10-18 21:49:03 +02:00
Xisco Fauli
3cc367f426 tdf#163486: PVS: check mpViewShell
V595 	The 'mpViewShell' pointer was utilized before it was verified against nullptr. Check lines: 368, 380.

Change-Id: I5e8d53d3503ade1814d7436e89f0f407f1d9ccfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175164
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 21:46:19 +02:00
Bogdan Buzea
f48045f718 tdf#163486: PVS: Identical branches
Change-Id: Ibe65f4eca6009e8be4355974cdf33b5cabbe03e5
V1037: Two or more case-branches perform the same actions. Check lines: 54, 60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175144
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 19:54:48 +02:00
Xisco Fauli
0d04f4957a tdf#163486: PVS: The same value is assigned twice
V570 	The same value is assigned twice to the 'pEntry' variable.

Change-Id: I2c6a106f910a915065cdb3bc56a69e3873c3f3e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175163
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 19:49:26 +02:00
Xisco Fauli
3da6aee6a1 tdf#163486: PVS: variable is assigned values twice successively
V519 	The 'eResult' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1604, 1606.

Change-Id: I1f778153539ac126f47d502958179c32d41a5a59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175162
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 19:47:41 +02:00
Xisco Fauli
6250d512e5 tdf#163486: PVS: variable is assigned values twice successively
V519 	The 'bParserSuccess' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1941, 1944.

Change-Id: I4dac8d01533706a5423fd0d75e5ccdc0d3cf00c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175161
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 19:30:02 +02:00
Michael Weghorn
a84f4ef9a8 svtools a11y: Set underline/mnemonic char for "Restart" dialog
Set the "use-underline" property for the buttons in the
"Restart %PRODUCTNAME" dialog and specify the accelerators.

This way, the dialog can easily be closed using Alt+[accelerator]
with the gtk3 and qt5/qt6 VCL plugin as well.

Use those characters that the VCL logic was using as well.
(The VCL implementation seems to have some way to auto-generate
mnemonic characters if none is set automatically.)

This dialog is e.g. seen when toggling experimental mode in
"Tools" -> "Options" and closing the options dialog with the
"OK" button.

Change-Id: I50c3402fb89d5fbfc0e610c0e41f5f035cf0b0e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175137
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-18 18:59:30 +02:00
Michael Weghorn
ef7da29145 tdf#130857 qt weld: Use native widgets for "Restart LO" dialog
Add the .ui file of the "Restart %PRODUCTNAME"
dialog to the list of .ui files suported by
QtInstanceBuilder.

This means that a dialog using native Qt widgets gets
used by the qt5/qt6 VCL plugins now when e.g. toggling
experimental mode in "Tools" -> "Options" and closing the
options dialog with the "OK" button.

Change-Id: I617bcb4d0815aeae8a30d7765ff7b4c0cc6992e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175136
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-18 18:59:23 +02:00
Michael Weghorn
ea6c0c3aef tdf#130857 qt weld: Leave dialog response codes unchanged
Don't call `qtResponseTypeToVclResponseType` to convert
an alleged Qt response code to a VCL one in
QtInstanceDialog::run.

In fact, the return code is already the VCL one, see

    commit 08b55df5c9
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Sat Sep 28 00:32:15 2024 +0200

        tdf#130857 qt weld: Close dialog on button click

QDialog::Accepted and VCL's RET_OK both happen to be 1,
so that mapping didn't have any effect, but everything
else would be mapped to `RET_CANCEL` unconditionally.

This wasn't a problem so far, most likely because the few
non-message dialogs using native Qt widgets didn't use
the response codes yet.

For example, for the "Help" -> "License Information"
dialog, only `RET_OK` is explicitly handled in
`LicenseDialog::run` (sfx2/source/appl/appserv.cxx).

Change-Id: If0a7cbf291ad94b21d6bbeecb9793b4afaa2c76d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175135
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-10-18 18:59:17 +02:00
Michael Weghorn
8a4cb0af2c tdf#130857 qt weld: Implement QtInstanceDialog::response
Move the QtInstanceMessageDialog::response
implementation down into the base class
QtInstanceDialog and simplify a bit, and drop
the override in QtInstanceMessageDialog.

This will be needed e.g. by the
svtools/uiconfig/ui/restartdialog.ui
dialog shown when toggling experimental mode in
"Tools" -> "Options" and closing the dialog with
the "OK" button.

Change-Id: I147ea68554725a9d3b6bea6f77b15e7754cc962b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175132
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-18 18:59:11 +02:00
Michael Weghorn
8991553851 vcl: Drop indirection via lcl_get_desktop_environment
`lcl_get_desktop_environment` just calls
`get_desktop_environment` and returns the result.

Switch callers to use `get_desktop_environment`
right away and drop `lcl_get_desktop_environment`.

Change-Id: If18690a31c8b09631b3a1181e5eac3aad72a0037
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175138
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-18 18:58:42 +02:00
Mike Kaganski
60e8be7f9d tdf#163486: PVS: It's odd that this function always returns one and the same value.
The old implementation used a UB (signed integer overflow).

Change-Id: I1d8222b261f0db49c48b38defa2b58bc4770aae4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175143
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-18 18:17:34 +02:00
Xisco Fauli
70b9a979dd tdf#163486: PVS: check can be simplified
V728 	An excessive check can be simplified. The '||' operator is surrounded by opposite expressions '!p3DProperties' and 'p3DProperties'.

Change-Id: Iab3da21332f50a7414edff7283659106aa8d22e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175134
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 16:20:57 +02:00
Xisco Fauli
7f4a7af94c tdf#163486: PVS: redundant nullptr check
V668 	There is no sense in testing the 'xExtra' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error.

Change-Id: I1e0d02621808b7eda104d06afe8882f72da6d87f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175131
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 15:48:23 +02:00
Xisco Fauli
33f254b48a tdf#163486: PVS: redundant nullptr check
V668 	There is no sense in testing the 'xExtra' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error.

Change-Id: Ie851b98f15eac9e7d8118fb919438fbd389cfbf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175130
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-18 15:48:11 +02:00
Xisco Fauli
ed4c5e3beb tdf#163486: PVS: check GetMenu()
V595 	The 'GetMenu()' pointer was utilized before it was verified against nullptr. Check lines: 1582, 1612.

Change-Id: I085320d3a5467e4e2c158bf2683b3156cb103e8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175125
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-18 15:37:59 +02:00
Dr. David Alan Gilbert
af801eafd6 tdf#148526 sdext,pdfimport: Write clipToStrokePath
'clipToStrokePath' is a variant of 'clip' it sets up a clip
to a path that's been stroked with whatever width the current
pen is.  Now that we have all the rest of the code in, we can
start using it.

This fixes the white blobs on page 3 of tdf#148526 which
are clipped radial fills.  It has a separate problem with
text corruption which this doesn't fix.

It also fixes the geometry of the top left square in:
   https://gitlab.freedesktop.org/poppler/poppler/-/issues/178
(although it still has colour problems with that test case)

Change-Id: Ibe2c56927b45d44e90cfa2934fc905034a50e9c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172927
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
2024-10-18 15:31:42 +02:00
Caolán McNamara
2b9e6cfc8f Log using LOK_WARN instead of std::cerr
Change-Id: I3a3cabd90154cb7293949d6a21f599417c364b9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174370
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Attila Szűcs <attila.szucs@collabora.com>
(cherry picked from commit 4baad2222e36fe2a71b2030b1a1292310821e104)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175123
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-18 15:12:34 +02:00