Commit graph

67744 commits

Author SHA1 Message Date
Justin Luth
a366cd34a8 tdf#125969 cui: add in-use area image to bitmap list
This fixes a five year old (non-)easyhack with 3 duplicates.
Note the nice-to-have dependencies in the bug report(s).

When the document has a unique background (area) image,
it is now added to the list of available images
IF/WHEN the user looks in the area tab.
This allows the user to switch back after changing,
or re-use it in other places in the document.

Most of this patch ended up being plumbing to ensure that
this added image is ONLY available to the current document,
because it MUST NOT be saved to the user profile.

This change affects all apps and all types of areas: NICE
  -tested Writer pages, paragraphs, headers, textbox, sidebar(page)
  -tested Calc page style
  -tested Draw page, sidebar(page), textbox

Caveats:
-the bitmap list is NOT updated at the time of document import,
 only when area property inspected.
 (The bug requesting inclusion at the time of import is tdf#100832).

make -srj1 UITest_writer_tests8 \
    UITEST_TEST_NAME=tdf125969.tdf125969.test_tdf125969 \
    SAL_USE_VCLPLUGIN=gen

Change-Id: Ic9fea9b199602c4df1376e781d5df019526473d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176253
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2024-12-10 00:07:59 +01:00
Justin Luth
d97085cc6c tdf#164201 docx import: compat14+ cannot be ECMA_376_1ST_EDITION
This fixes a 7.6 regression
from commit e66ddcd4b6.

At import, the base filter was treating too many documents
as if they were limited to Word 2007 format,
and thus reducing their compatibilityMode to 12 on export.

This import case is matched in a LOT of unit tests.
However, it doesn't manifest itself in
    saveAndReload(mpFilter) (or DECLARE_OOXMLEXPORT_TEST)
because the mpFilter string set in the Test class with
    SwModelTestBase(..."ooxmlexport/data/", "Office Open XML Text"),
forces saving in ISOIEC_29500_2008 mode
and thus unit tests basically NEVER round-trip as "MS Word 2007 XML".

However, the general user was almost always round-tripping
these as MS Word 2007 XML / compat12 since LO 7.6.

make CppunitTest_sw_ooxmlexport20 CPPUNIT_TEST_NAME=testTdf158855

Change-Id: If635866cc816e7b4734443f87b30410ac3bba951
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178048
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-12-10 00:07:27 +01:00
Michael Weghorn
a4b03fce93 tdf#164247 sw a11y check: Adhere to WCAG contrast threshold for large text
Quoting WCAG 2.2 "Success Criterion 1.4.3 Contrast (Minimum)" [1]:

> The visual presentation of text and images of text has a contrast
> ratio of at least 4.5:1, except for the following:
>
> Large Text
>
>     Large-scale text and images of large-scale text have a contrast
>     ratio of at least 3:1;

Regarding large text, the corresponding "Understanding SC 1.4.3" [2]
clarifies:

> Text that is larger and has wider character strokes is easier to read at
> lower contrast. The contrast requirement for larger text is therefore
> lower. This allows authors to use a wider range of color choices for
> large text, which is helpful for design of pages, particularly titles.
> 18 point text or 14 point bold text is judged to be large enough to
> require a lower contrast ratio.

Therefore, lower the text contrast requirement in
Writer's accessibility check from 4.5 to 3.0 for
text that is considered large according to that
specification.

Add a unit test with 2 test documents:

* one that adheres to the requirements and would have triggered false
  positives without this change in place
  (sw/qa/core/accessibilitycheck/data/ContrastTestOK.odt)
* one that doesn't adhere to the requirements and still fails the
  check, as it should
  (sw/qa/core/accessibilitycheck/data/ContrastTestFail.odt)

[1] https://www.w3.org/TR/WCAG22/#contrast-minimum
[2] https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html

Change-Id: I398f72aa5bdcd77c42834632575d6465a5ecd586
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178127
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-12-09 18:21:46 +01:00
Michael Stahl
bfdba3c863 tdf#159549 sw: add unit test
Change-Id: I8b964d4436835b66f25acece9562516ed70473eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178148
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
2024-12-09 17:35:50 +01:00
Michael Stahl
2b8d794e44 tdf#159549 sw: fix style name in SwXStyle::getParentStyle()
For a style that isn't inserted yet, the m_sParentStyleName is converted
to UIName by setParentStyle() but isn't converted back to ProgName in
getParentStyle().

This caused all of the writerfilter test failures in commit
c166d112381f195a171425d1f9c1d38ce579319a.

Change-Id: Ib5495785996807a8f3d9339ed2740f286b04d716
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177998
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-12-09 14:44:37 +01:00
Noel Grandin
ba16fd8e74 no need to do repeated lookups here
Change-Id: Iec30aa6bbd1bcb8bb22cfb002f81ea04458755b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178116
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-09 10:45:33 +01:00
Noel Grandin
29c32bf317 make conversion operator explicit
so less invisible behaviour

Change-Id: I497763cb4be554ddbd00831458f162d9d975742e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178115
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-09 07:11:32 +01:00
Mike Kaganski
045a98c9ee Simplify SwAccessible*
Change-Id: I2994161bfa8fa3a88b3e66a9f4f12e4de6d5b025
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178096
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-08 20:19:47 +01:00
Caolán McNamara
46cfd8d2a7 cid#1636664 Dereference after null check
Change-Id: I916212471a80417a582192920427999ee6a425d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178078
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-12-08 16:55:53 +01:00
Caolán McNamara
18399240f2 cid#1607671 Data race condition
Change-Id: Id2e87001b77087a072705ba7ffa1a2190220a082
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178074
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-08 14:02:45 +01:00
Andreas Heinisch
813f34d672 tdf#79298 - FORMATTING: Copy/paste: import strikethrough attribute
Change-Id: I0539e87f2a87f869e234ed7c944b9da6bd0e82bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177847
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Jenkins
2024-12-08 12:00:37 +01:00
Mike Kaganski
a35f0aee62 Simplify a bit
Change-Id: Ie2b96e099a0507e14ad8e79276abdbe0f21d35f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178040
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-07 17:20:22 +01:00
Caolán McNamara
5528f9c8b8 cid#1635776 Overflowed constant
there is intended to be no logic change here, just rearrangement
and acknowledgement that SwOutlineNodesInline::Seek_Entry always
sets nEndPosInline to some value.

Change-Id: I10d694e20c8619ae297a61f612590556c9a9effa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178037
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-12-07 15:37:26 +01:00
Caolán McNamara
e92db94e19 cid#1636579 Dereference after null check
and

cid#1636580 Dereference after null check
cid#1636581 Dereference after null check

Change-Id: I856876a99a0bbccf27055d2db0dd24f7f040d3af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178036
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-07 15:20:25 +01:00
Michael Weghorn
57d532057b weld: Rename weld::Treeview selection signal/connect
Rename weld::TreeView member + methods to clarify
that these are about selection changes:

* m_aChangeHdl to m_aSelectionChangedHdl,
* signal_changed to signal_selection_changed
* connect_changed to connect_selection_changed

In GtkInstanceTreeview, also rename the
related methods calling signal_selection_changed
accordingly for consistency.

Change-Id: I299d7930484677395a0bdd0ff105df18688f2e04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178023
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-07 11:15:03 +01:00
Bogdan Buzea
18b55add5e tdf#152299 - Remove unused define(s) from C/C++ files
Change-Id: I54460a95759ab8e2073c8ecab4e37ff15193a4e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177176
Tested-by: Jenkins
Reviewed-by: Simon Chenery <simon_chenery@yahoo.com>
Reviewed-by: Hossein   <hossein@libreoffice.org>
2024-12-07 02:37:15 +01:00
Caolán McNamara
5a251b6f55 crashtesting: failure to reimport forum-it-2308.odt rtf export
Change-Id: I9908dea4aa822b7793ece91874de0282239bd17b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177988
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-06 21:25:51 +01:00
Michael Stahl
afab0fa906 sw: layout: ignore Keep-With-Next on hidden frames, part3
SwTabFrame: :MakeAll(), SwRowFrame::ShouldRowKeepWithNext()
Change-Id: I7cb6e558dc05736658a9bc75d6c735e6a47062b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177977
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
2024-12-06 18:07:45 +01:00
Michael Stahl
a08b8fa2d0 sw: layout: ignore Keep-With-Next on hidden frames, part2
SwFrame::PrepareMake(), SwContentFrame::MakeAll(),
SwContentFrame::WouldFit_()

Change-Id: I2a909ac6d147668dddece97bd99e31fdddcf20eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177976
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-12-06 18:07:39 +01:00
Michael Stahl
cd8468bcba sw: layout: ignore Keep-With-Next on hidden frames, part1
When a frame is hidden, don't consider it when evaluating keep-with-next
attributes - this was the case for content in hidden sections before
commit 0c96119895

~SwFrameNotify() invalidating position of hidden frame with keep
attribute causes layout loops.

Also skip hidden frames in SwFlowFrame::IsKeepFwdMoveAllowed(),
SwFlowFrame::CheckKeep(), SwFlowFrame::IsPrevObjMove(),
SwFlowFrame::MoveBwd(), CalcContent().

Change-Id: I68556ba0a8e016d962399f3ce199e5eda0378867
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177975
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-12-06 18:07:35 +01:00
Miklos Vajna
ae7900dd42 tdf#164095 sw: fix missing top margin on paragraph after changing page style
Open the bugdoc, go to the page after the section break, there is a top
margin for the first paragraph there in Word, but not in Writer.

This went wrong in commit abd90828cf
(tdf#160952 sw: ignore top margin of para on non-first pages with newer
DOCX, 2024-05-14), where it seemed that all implicit and explicit page
breaks want to ignore that top margin for the first paragraph.

Turns out this is more complex: implicit breaks and page breaks should
be followed by an ignore, but not paragraphs after "section break (next
page)". So restore the margins for the RES_PAGEDESC, but continue to
have them for RES_BREAK & implicit breaks.

Change-Id: If1fcf3077b81a705d3587bdae422dcfa16f1c17c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177973
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-12-06 16:16:18 +01:00
Oliver Specht
add6efb409 tdf#160621 Variable field dialog size of value field
The size of the value field is now set to 5 rows.

Change-Id: I808ffbb64d71a0707857cf80d1c0b73419ac7b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177893
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-12-06 14:26:03 +01:00
Michael Stahl
bd727654ec tdf#159549 sw: fix ODF import of newly colliding Body Text styles
Commit c83d241eff "tdf#154933 Rename "Text
Body" para style to "Body Text"" introduced a regression when importing
certain ODF documents, but the problem is actually pre-existing.

What happens is that first the built-in "Text body" style is created,
and then a non-built-in style with the same translated name as "Text
body" is imported, and instead of creating a new style, the built-in one
is found and used, and so its properties are overwritten.

The root cause is that SwStyleNameMapper::FillProgName() and in
particular SwStyleNameMapper::FillUIName() are defined poorly, ever
since they were introduced in 2001 in commit
4fbc9dd48b

It becomes obvious relatively quickly that the way style names work is
that at the UNO API level, the "ProgName" (internal, non-localised)
names are used, and at the core document level, the "UIName" (localised)
names are used.

This is in itself questionable - why is the translation from ProgName to
UIName not done in the UI? - but also very expensive to change now.

So then the UNO services are responsible for translating between
ProgName and UIName.

But the 2 functions don't do that properly; both need to check if the
given name is a known ProgName *or* a known UIName, and rename it in
case it collides with a known target name; also the 2 functions need to
cancel each other out, not add " (user)" at the end in both directions.

Fixing this causes numerous tests to fail, due to:

1. the UNO services calling themselves with already converted style
   names, which are then translated a second time, which fails now.
   (or calling the wrong function like SwXStyleFamily::getByIndex())

2. many tests call the UNO API with UINames instead of ProgNames

3. somehow the writerfilter import is also changed, causing failures in
   e.g. testTdf113182 and testTdf104492

4. buggy code elsewhere (lcl_getUsedPageStyles()), problem similar to
   1., for PageDescs

5. potentially more buggy code yet to be discovered (definitely table
   styles, forgot which test that was)

So limit this fix for now to only paragraph styles, and don't do it in
writerfilter import, now at least sw.check passes.

Change-Id: I5cbdf3e174622e83f9af8787c3671b88c0e37bac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177858
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Tested-by: Jenkins
2024-12-06 14:24:32 +01:00
Noel Grandin
31d0c99c31 add assert in SwNodes::ForEach
to catch any dodgy code

Change-Id: Iffd0612b28871c864f103634a40d13b82160d1ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177955
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-06 12:14:11 +01:00
Noel Grandin
e7268b7d9e tdf#119840 small tweaks
Change-Id: Ie2c7a9633ee62bc1c4c0ad821d5ff1ace71fc15d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177928
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-06 12:14:02 +01:00
Caolán McNamara
f232952e72 crashtesting: HLINK_MARK embedded null import from forum-mso-en4-7137.doc
which causes problems on export to docx. Sanitize at the original
import.

Change-Id: I8b9fa86465c455fe872c41386889dc54e38eb9ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177904
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-05 22:34:11 +01:00
Pranam Lashkari
c9763a9f16 LOK: don't recreate the dialogs of an old view when loading new views
follow up for f5ebf512ccd3d5ae3af5fe706b411a85fa19182d

now same actions are performed on all the dialogs

Change-Id: I6531a766327dda106770a2c513ebd492dea7c655
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176933
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 2fba6df7242586870988b62909156538b42c2bc0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177892
Tested-by: Jenkins
2024-12-05 18:49:58 +01:00
Caolán McNamara
acd9e2165c crashtesting: HLINK embedded null import from ooo98294-1.doc
which causes problems on export to docx. Sanitize at the original
import.

Change-Id: I3b5521dac6a2b6926db6362d33500b11f0a69098
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177869
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-05 16:18:42 +01:00
Mike Kaganski
a81c1e1651 Get SwFieldType after broadcast
A crash was reported in HasOnlyOneListener, with the following call stack:

 ntdll.dll!KiUserExceptionDispatch()
 swlo.dll!SwModify::HasOnlyOneListener() Line 204
 swlo.dll!SwFormatField::~SwFormatField() Line 142
 swlo.dll!SwHistorySetTextField::`scalar deleting destructor'(unsigned int)
 swlo.dll!std::default_delete<SwHistoryHint>::operator()(SwHistoryHint *) Line 3090
 swlo.dll!std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>::{dtor}() Line 3198
 swlo.dll!std::destroy_at(std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>> * const) Line 311
 swlo.dll!std::_Default_allocator_traits<std::allocator<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>>>::destroy(std::allocator<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>> &) Line 688
 swlo.dll!std::_Destroy_range(std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>> * _First, std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>> * const) Line 905
 swlo.dll!std::vector<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>,std::allocator<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>>>::_Destroy(std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>> * _Last, std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>> *) Line 1667
 swlo.dll!std::vector<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>,std::allocator<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>>>::_Tidy() Line 1751
 swlo.dll!std::vector<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>,std::allocator<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>>>::~vector<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>,std::allocator<std::unique_ptr<SwHistoryHint,std::default_delete<SwHistoryHint>>>>() Line 699
 swlo.dll!SwUndoSaveContent::~SwUndoSaveContent() Line 740
 swlo.dll!SwUndoDelete::~SwUndoDelete() Line 633
 swlo.dll!SwUndoDelete::`scalar deleting destructor'(unsigned int)
 svllo.dll!std::default_delete<SfxUndoAction>::operator()(SfxUndoAction *) Line 3090
 svllo.dll!std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>::{dtor}() Line 3198
 svllo.dll!std::destroy_at(MarkedUndoAction * const) Line 311
 svllo.dll!std::_Default_allocator_traits<std::allocator<MarkedUndoAction>>::destroy(std::allocator<MarkedUndoAction> &) Line 688
 svllo.dll!std::_Destroy_range(MarkedUndoAction * _First, MarkedUndoAction * const) Line 905
 svllo.dll!std::vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>::_Destroy(MarkedUndoAction * _Last, MarkedUndoAction *) Line 1667
 svllo.dll!std::vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>::_Tidy() Line 1751
 svllo.dll!std::vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>::~vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>() Line 699
 svllo.dll!SfxUndoArray::{dtor}() Line 1389
 svllo.dll!SfxListUndoAction::~SfxListUndoAction() Line 1318
 svllo.dll!SfxListUndoAction::`vector deleting destructor'(unsigned int)
 svllo.dll!std::default_delete<SfxUndoAction>::operator()(SfxUndoAction *) Line 3090
 svllo.dll!std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>::{dtor}() Line 3198
 svllo.dll!std::destroy_at(MarkedUndoAction * const) Line 311
 svllo.dll!std::_Default_allocator_traits<std::allocator<MarkedUndoAction>>::destroy(std::allocator<MarkedUndoAction> &) Line 688
 svllo.dll!std::_Destroy_range(MarkedUndoAction * _First, MarkedUndoAction * const) Line 905
 svllo.dll!std::vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>::_Destroy(MarkedUndoAction * _Last, MarkedUndoAction *) Line 1667
 svllo.dll!std::vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>::_Tidy() Line 1751
 svllo.dll!std::vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>::~vector<MarkedUndoAction,std::allocator<MarkedUndoAction>>() Line 699
 svllo.dll!SfxUndoArray::{dtor}() Line 1389
 svllo.dll!SfxListUndoAction::~SfxListUndoAction() Line 1318
 svllo.dll!SfxListUndoAction::`vector deleting destructor'(unsigned int)
 svllo.dll!std::default_delete<SfxUndoAction>::operator()(SfxUndoAction *) Line 3090
 svllo.dll!std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>::{dtor}() Line 3198
 svllo.dll!std::destroy_at(std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>> * const) Line 311
 svllo.dll!std::_Default_allocator_traits<std::allocator<std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>>>::destroy(std::allocator<std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>> &) Line 688
 svllo.dll!std::_Destroy_range(std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>> * _First, std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>> * const) Line 905
 svllo.dll!std::vector<std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>,std::allocator<std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>>>::_Destroy(std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>> * _Last, std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>> *) Line 1667
 svllo.dll!std::vector<std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>,std::allocator<std::unique_ptr<SfxUndoAction,std::default_delete<SfxUndoAction>>>>::clear() Line 1442
 svllo.dll!svl::undo::impl::UndoManagerGuard::~UndoManagerGuard() Line 325
 svllo.dll!SfxUndoManager::ImplClearRedo_NoLock(const bool i_currentLevel) Line 468
 swlo.dll!sw::DocumentContentOperationsManager::InsertPoolItem(const SwPaM & rRg, const SfxPoolItem & rHt, const SetAttrMode nFlags, const SwRootFrame * pLayout, SwTextAttr * * ppNewTextAttr) Line 3694
 swlo.dll!SwXTextField::attach(const com::sun::uno::Reference<com::sun::text::XTextRange> & xTextRange) Line 1972
 swlo.dll!SwXText::insertTextContent(const com::sun::uno::Reference<com::sun::text::XTextRange> & xRange, const com::sun::uno::Reference<com::sun::text::XTextContent> & xContent, unsigned char bAbsorb) Line 606
 mscx_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 214
 mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430
 binaryurplo.dll!binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny * returnValue, std::vector<binaryurp::BinaryAny,std::allocator<binaryurp::BinaryAny>> * outArguments) Line 239
 binaryurplo.dll!binaryurp::IncomingRequest::execute() Line 79
 binaryurplo.dll!request(void * pThreadSpecificData) Line 84
 cppu3.dll!cppu_threadpool::JobQueue::enter(const void * nDisposeId, bool bReturnWhenNoJob) Line 101
 cppu3.dll!cppu_threadpool::ORequestThread::run() Line 169
 cppu3.dll!threadFunc(void * param) Line 190
 sal3.dll!oslWorkerWrapperFunction(void * pData) Line 67

I don't know why pType->Which() succeeded before the broadcast and reset,
and pType->HasOnlyOneListener() crashed; field destructors themselves do
not seem to destroy their types (except SwDBField, which is handled here
explicitly). My blind guess is, that a change could happen in broadcast.

Change-Id: I5c7f07da2e1283510bce3a3e3e80b6f8d849f38b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177854
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-05 14:03:05 +01:00
Noel Grandin
73a46895c5 tdf#119840 speed up SearchForStyleAnchor
no need to copy things to a std::deque, it is quite straightforward to
just iterate over the SwNodes structure.

Shaves off about 30% of the time spent processing post-load.

Change-Id: I852079c18738299be04cec52b82e0f6949f2d81c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177837
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-05 12:41:49 +01:00
Heiko Tietze
139bb786bb Resolves tdf#164034 - Rename Non-breaking Spaces
The option also affects hyphen and the label should reflect this

Change-Id: I5e092f8c5d67c1c039de709d024c89481b40a82d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177841
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-12-05 10:22:17 +01:00
Jonathan Clark
dfa81bdb3a tdf#162750 sw: Fix layout with small caps inside ligatures
Previously, Writer was not correctly terminating layout contexts at the
starts of small caps spans. This could cause incorrect character
placement in certain cases.

Regression since:

Commit 30d376fb7d
    "tdf#61444 Correct Writer text layout across formatting changes"

and

Commit ab0a4543ca
    "tdf#124116 Correct Writer text shaping across formatting changes"

Change-Id: I863b9b66356eb0a9efb5bbdc75e80b43d56aaaf0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177839
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Tested-by: Jenkins
2024-12-05 09:57:49 +01:00
Xisco Fauli
393565203e sw: static_cast after dynamic_cast
Change-Id: Ie50fd8bb2bbb26962ead459fe8014828c99fd755
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177789
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-12-04 21:09:32 +01:00
Michael Weghorn
3d780e72b9 Move helpers for css::awt/VCL point/rect/size to vcl::unohelper
Move helpers to convert between the Rectangle, Point and Size
classes in vcl and in css::awt from VCLUnoHelper (in the toolkit module)
to vcl::unohelper (in the vcl module), for reuse in vcl in upcoming
commits.

Change-Id: I7b11c8a6b8c843a01ce25b1e4c0fb1869ad1e6ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177816
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-04 20:47:14 +01:00
Noel Grandin
75d7346983 split up SwGetRefFieldType::FindAnchor method some more
To make it easier to see the modifications I want to do to improve
performance here.

Change-Id: Icbb663b39905ce0fe82544bac7afd21314d4c7c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177801
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-12-04 19:41:16 +01:00
Noel Grandin
285b664433 split up SwGetRefFieldType::FindAnchor method
to make it easier to read

Change-Id: Ifaece90d4fb18be3caae9fd4afbbbdf64ff9d18a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177800
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-04 17:06:19 +01:00
Caolán McNamara
d775d637b9 crashtesting: failure to reimport forum-es-2526.odt after export to odt
2nd arg to copy is len, not index. Probably a problem since:

commit 12a7a3d57d
CommitDate: Thu Sep 3 15:33:36 2020 +0200

    Fix crashtest fdo77855.odt

in forum-es-2526.odt the input has:

fo:border-=".009cm solid #595959"

where 'fo:border-' is an unknown attr and "fo" ends up truncated to "f".
On export and reimport the 'f' is further truncated to '' and we assert
on this oddness.

Change-Id: Ie85d81947504bf15b9caefb92477c7f977eb5cb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177788
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-04 15:34:45 +01:00
Johann Lorber
1ad425812a tdf#143148: Use pragma once instead of include guards
Change-Id: Iac334c822ab0699b5cc5122e5f2b1a2b9662f58e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177784
Reviewed-by: Skyler Grey <skyler.grey@collabora.com>
Tested-by: Jenkins
2024-12-04 15:30:31 +01:00
Caolán McNamara
e90ebdde41 cid#1636561 Dereference after null check
Change-Id: I7a4c19d9344dba9c09861fe78b864a8651c3286f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177771
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-12-04 13:29:36 +01:00
Xisco Fauli
53110dd25e Revert "PVS: V614 Potentially null smart pointer 'pFillData' used"
This reverts commit 60df7e1052.

Reason for revert:
Michael Stahl: "the PVS warning is wrong, checking bChgFillData is already enough"

Change-Id: I7d963e2b2ebbb30195af05b70ad36ab8d78e7c25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177760
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-12-04 00:16:23 +01:00
László Németh
bfb8f9cae7 tdf#48459 sw inline heading: don't apply inside frames or over 120 chars
Don't apply inline heading 1) in a text frame
2) or if the selected text is over 120 characters.

1) It would be enough to limit this for inline heading
frames, but the recent FN_INSERT_FRAME – which is used
for creating the Inline Heading frame, cannot handle the
insertion inside a frame: the new frame is anchored outside
of the frame, not inside the actual paragraph, resulting
bad layout.

2) Increase also the limit of applying the inline heading
to 120 characters (very upper limit for a long line) from 75.

Follow-up to commit 7a35f3dc74
"tdf#48459 sw inline heading: apply it on the selected words",

Change-Id: I05de4be3a08926fdabad2e601d4bbe57ae25f7c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177739
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
2024-12-03 21:13:54 +01:00
Michael Stahl
1b4bf7effc sw: HTML import: apply hard formatting at insert position ...
... even if there is a character format hint there - in this case, a
RES_TXTATR_AUTOFMT attribute will not be converted to the SwTextNode's
item set.

Also add a test that uses the XDocumentInsertable interface to insert
the HTML, which is closer to the real use case.

(follow-up to commit f45d2fa85b)

Change-Id: Idbf7efceabca8d43d3e32d0b29fb37a9322c184c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177740
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
2024-12-03 19:25:02 +01:00
Balazs Varga
16b2cae80e tdf#164090: a11y sw: add new warning for non numbered empty paragraph
Add new warning for empty paragraph between numbering paragraphs.

Change-Id: Ib85b376da77a72a87ab05a3e8271be43e223f129
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177493
Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
2024-12-03 17:21:46 +01:00
Caolán McNamara
3e6ad944ac don't bother passing const std::[u16]string_view by reference
Change-Id: I49477c20849dd99118d5935c0f1576429648bfca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177734
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-03 15:18:31 +01:00
Caolán McNamara
db40f96f61 Resolves: tdf#139700 use WB_FLATVALUESET to get tracking highlights
a problem since:

commit 53d2a03904
CommitDate: Tue Jan 14 13:45:44 2020 +0100

    weld PageSizePopup

Change-Id: I5e55d1972a205b7bf1ec6f6bdfd2d8cd22e13eca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177728
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-03 13:49:27 +01:00
Mohit Marathe
e3dd37ce0c tdf#163403 fix comments not showing in generic backend
Change-Id: I21345049d8137e43cc3e50b0b1bcc8d41a123458
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177582
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
2024-12-03 12:45:32 +01:00
Balazs Varga
1699d29fca tdf#164137 - Fix Accessibility sidebar gives no warnings
We need to check rather the update button is visible instead of the
expanders.

Regression from commit: 13ac356a32
(tdf#164048 sw a11y: improve error/warning levels with...)

Change-Id: I63fb5906ad2f7bb13bc5822c284861a419897c4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177723
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-12-03 12:22:11 +01:00
Jonathan Clark
94afced019 tdf#164098 sw: Fix word overflow kashida justification crash
This change fixes an infinite recursion crash while updating kashida
insertion positions. This crash could occur if a word is too long to fit
on a page and is broken onto another line, with the best-fit valid
kashida insertion position on the previous line, and the following line
also containing valid kashida insertion positions.

Change-Id: Ifc3320765f35ccdc49bbf179446bc03654e2596d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177709
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-12-02 22:18:02 +01:00
Michael Stahl
654e3134ad unotest,sw: introduce queryDispatchStatus()
... and reset the view options that are toggled in
testHiddenParagraphFollowFrame and testHiddenParagraphFlys.

Backporting these tests to the libreoffice-24-8 branch broke 2 unrelated
tests because of the changed view settings:

Test name: (anonymous namespace)::testHiddenSectionPageDescs::TestBody
equality assertion failed
- Expected: 532
- Actual  : 798
- In <>, attribute 'height' of '/root/page[2]/body/section[1]/infos/bounds' incorrect value.

xmltesttools.cxx:203:Assertion
Test name: (anonymous namespace)::testTable0HeightRows::TestBody
equality assertion failed
- Expected: 28
- Actual  : 22
- In <>, XPath '/root/page[1]/body/tab/row' number of nodes is incorrect

Change-Id: Ie58242348fecabe163e54048f3896c6d427d2608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177691
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-12-02 18:46:39 +01:00
Caolán McNamara
9a730cd079 crashtesting: failure to import rtf output of forum-en-44797.odt
field text ended in \ so next } was escaped

Change-Id: I2129f410a1d1c3d507a223c3576f02b78f7aac63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177681
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-02 15:33:40 +01:00