This asserts on forum-mso-en-4208.docx because it creates a
`SwContentControlPortion` which calls its superclass `Paint()`.
Not sure how this should work; presumably the
`SwTextFormatter::WhichTextPor` should prioritize fieldmark chars higher
than it does; also, it would be helpful for the user to see something on
fieldmark chars, but what exactly?
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ifd16f6b38db10f17a9efd20e57fc4c49e39cf144
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7739
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f42e76165741add8fcd2b6677443b6d2a935fe00)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209275
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
The end condition `E.back() > (nRound - 32)` is using the wrong value of
`nRound` and so the loop can end too early.
This has caused a few CI builds to fail after pushing the padding fix,
as the input to `computeHashR6` includes a random IV it happened rarely.
Fix it by counting the iterations of the loop that have been done.
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I8bbdc85439789db3753942b1292ba48d39b76541
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8625
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 082e5a49669e2d9058c2b3675c829a495b2044f3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209277
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
The problem is that `$(...)` is evaluated by make while parsing, while
the assignments `python_arch_subdir=amd64/` etc are evaluated by `$(eval
...)` in a separate/later phase, so the first time
`gb_LinkTarget__use_python` is used it will be missing the subdirectory.
How this has ever worked is a mystery.
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I6a026a37f54eccaf65a4df71b30acd3389373b6b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2551
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit daf016a65c5f9d0ff7f9aaa55020c377a484b350)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208014
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
In Word only the first-page-shared flag is shared between header and
footer, while the existence of header and footer is independent.
Split into core flags `DisableFirstHeader` / `DisableFirstFooter`,
properties `HeaderNoFirst` / `FooterNoFirst` (which allows removing some
special checks as the name prefix checks now cover these).
`SectionPropertyMap::setHeaderFooterProperties()` had some special code
to turn off a header but not a footer, add that to do it consistently.
Also rename the ODF attributes, `is-first-page-header-enabled` better
describes the values than `is-first-page-header-shared`.
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ieee9cb7a8f7b4fb7e66352c95142d8ccb06f9cb5
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4383
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a443891f1a6480421fa08c311526c1a9d4bdd642)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206703
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
The problem with not having some but not all headers enabled on a page
style is that Word does page margins differently than Writer, and this
causes `testTdf116486` and `testFdo44176` to fail.
In Writer, it's always additive: page `fo:margin-top` + header
`fo:margin-bottom` gives the spacing from the top of the page to the
body text.
In Word, there is a `w:header` (from top of page to header) and `w:top`
(from top of page to body text) and the problem is, they're not
additive, both are measured from top of page.
If all headers are enabled,
`SectionPropertyMap::PrepareHeaderFooterProperties()` can map this to
`HeaderHeight` and `HeaderBodyDistance` properties, but of course those
won't be used if there's no header on the page.
So import `w:top` as a new property "MinTopBodyDistance" (and also
"MinBottomBodyDistance") implemented as new item
`RES_FRMATR_PAGE_MIN_TOP` (and also `RES_FRMATR_PAGE_MIN_BOTTOM`).
Use it in `SwLayoutFrame::Format()` to set the page frame margins, but
only if there is no header; else rely on the existing header properties.
Export this to ODF as
`coext:min-page-margin-top` and `coext:min-page-margin-bottom`.
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: I9d98bbf7138c9ef04d4ab1ddcb4c3183a12d9b11
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4310
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e065ba01c029cd01c9128afccdc953e2e3a49e65)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206702
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
`RTFDocumentImpl::getProperties` needs to check if the applied style is
actually a character style; in that case, the default paragraph style 0
is apparently used by Word.
And when merging character style properties into paragraph style
properties, it must not overwrite the `pPr` with a dummy one that
`RTFDocumentImpl::createStyleProperties` unhelpfully inserted into the
character style.
Change-Id: I2e5935879bc1f0c9a3c03366465080ad57056f28
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3453
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 325cd2b30649570404823013f8539ebae124380c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206201
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
The bugdoc has several consecutive table definitions before a table, and
the first one's borders are erroneously applied to the table cells,
instead of the last one's (no borders).
Create a new struct `TableRowDef` for the top-level table cells state,
and actually clear it on `\trowd`.
Also use it for both "backup" and "previous" table row.
Move the sending of `tblStart` from `\cellx` handling to `\par` and
`\cell` where it is determined if it is actually a table.
`m_nTopLevelCells` is redundant and can be removed.
Leave the table row properties as-is for now, could be added to
`TableRowDef` later...
Unfortunately UITest_sw_table sheetToTable.sheetToTable.test_tdf116685
fails with `~SwIndexReg` assert.
This is because previously, `tblStart` was sent from `\cellx`, and in
`DomainMapper::sprmWithProps()` the `rContext` did not exist yet, so
the whole `AddDummyParaForTableInSection` was skipped; now it is done
and the `pUndoPam` in `SwReader::Read()` points to the deleted node.
Change-Id: Iba60e871e6c3ac0bc2559c975358edc14a7e2d6b
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1254
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 4c7e5b5b5aeea37d06b17e7e82e6874cbed504b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204407
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
The document contains a table definition before 3 paragraphs, but Word
doesn't turn it into a table.
It looks like there's 3 ways to actually put a paragraph in a table:
\intbl \par
\itap1 \par
\cell
The following places were wrong to send a synthetic \intbl:
\cellx
\pard
Instead, send synthetic \intbl at:
\itapN, N>0
\cell - if there was no preceding \par, or if there was \intbl
in preceding paragraph in buffer
Adapt \itap handling to not force the value from 0 to 1, instead
pre-pend itso that \intbl always takes priority in TableManager.
On \par, if it turns out it's not in a table, replay the table buffer to
clear it and let the \cell handling work.
Start table buffering on \trowd, \intbl and \itapN, N>0, to ensure the
buffer is there on the first text run.
Stop table buffering on \row. This requires disabling the paragraph
marker properties on the *last* paragraph of the document; Word 2013
does some odd special handling there to set it to document defaults,
based on superficial testing. (Previously, the char properties were
buffered, and the buffer was discarded without replay.)
Change-Id: Id760cf031c901a54455c103cb7ffb110fdcf7969
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1058
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 054322ecaa2f9b0cc1ceb8af036ee7a8e236938f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204406
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(regression from commit 93fe03c059)
SwTextNode::Update() was changed to check the
getIDocumentLayoutAccess().GetCurrentViewShell() instead of
pDocShell->GetWrtShell() but apparently that was based partially on
incorrect assumptions.
getIDocumentLayoutAccess().GetCurrentViewShell() is updated on
SwView::GotFocus(), but that happens only in Classic.
SwDocShell::SetView() actually updates the other one and is actually
called from ChildSession before any sort of editing operation.
Unfortunately i don't remember what exactly failed in
CppunitTest_desktop_lib and the change was with experimental yrs feature
enabled so just revert this for now.
Change-Id: I6fececd1f85bd8ba347865a198845250a9946e2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202057
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 0194ef39a5f07d6152117994704d1d4f82072165)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204405
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Every error about an AutoText path is reported as "Inadmissible path",
which might imply that the path doesn't exist.
In the situation where the AutoText is on a WebDAV share that is mounted
by Windows Explorer, the path will be a file:// URL, and it is possible
that the user needs to authenticate before being able to access the
files, but it's not known how an authentication dialog could be shown in
LO (the Windows File Picker dialog is able to do this btw), so detect
this situation and show a more specific error message. (As far as
possible; we cannot tell if the problem is that the user is not
authenticated or if it is that the user is not authorised to access).
Use `PathIsNetworkPathW` to check if it is a mounted network location.
In case the network location is not reachable, the error code will be
different and the generic error dialog will be shown.
sw: fix -Werror=undef
(cherry picked from commit cee293d3ee4fef108790eed63c69eee40d37c0bf)
Change-Id: I633ea331f957edb4a943426464524a5decf0fe15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200856
Tested-by: allotropia jenkins <jenkins@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
(cherry picked from commit 7a2efe02293382374cd80f9d23215740e731c755)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201398
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 19e9e767145a5147bfee59f0b476c6a7dbf3ba12)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201468
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
The problem is that when the user inserts a paragraph break in the
yellow section on the first page, the table below this section
disappears.
Previously, one line of text of the table was on the first page, but it
must move to the next page now, and then what happens is that inside
SwTabFrame::Format() the CalcFlyOffsets() finds an overlap with the text
frame that was already on the 2nd page; at this time the table print
area height is 9711, and this causes the table frame to have the Y
position of the print area set to 10383.
Now the first row is positioned based on that, but then another
iteration of SwTabFrame::Format() sees its height as 7672 and thus the
table now fits before the text frame, the table frame upper margin is
reset to 0.
But the problem is, the first row's position is not invalidated, so all
the table content remains positioned outside the table frame.
Reportedly this started to happen since commit
8e3afdb598 and apparently the problem
doesn't happen when there isn't a fly anchored in the footer but there's
no obvious relation to the missing table invalidation.
Change-Id: I6552ef3340b47abcfa5eb3a70aa1dc27733da253
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200294
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 66723c13181e0e56a6a9e55862ece318c9d45f23)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200340
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
ShapeGroupContext::popGroupAndPostProcess() is called 2 times when
importing an ODF package file, once at the end of styles.xml, then at
the end of content.xml; in the 2nd case, all shapes of styles.xml end up
in maUnsortedList.
There are 2 problems with it:
1. in the XShapes3 branch, once maZOrderList is empty, any remaining
elements in maUnsortedList are ignored and thus the aNewOrder
contains duplicate 0s at the end which will cause sort() to throw
2. the XShapes3 branch removes elements from maUnsortedList, hence when
the exception is caught and the fallback path runs, it only moves
the elements that happened to remain in maUnsortedList
Effectively, what happens is that the z-order of everything in
headers/footers is rotated so that the last (topmost) N elements go
to the start (background).
3. In case the objects in content.xml happen to be sorted correctly
wrt each other, but there was an object with higher z-index in
styles.xml, sorting is skipped.
Turns out that testTdf159158_zOrder_headerBehind already tests this.
(regression from commit a8b1699ca9)
Change-Id: Ifdde6fc43af4c655b430d723b875dfd46e8533f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197475
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 66a1ad2163d5799a79b23554b22e08a07f693225)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197730
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
SetTextBoxes(true) is never called because it checks the shape's
SdrObject, while previously this code was in
SwFrameFormat::SetOtherTextBoxFormat() where it would be called a second
time for the text box SwFrameFormat which has the SwFlyDrawObj.
SwTextBoxHelper::getCount() can't ignore the text boxes if the flag is
never set; this ends up confusing
ShapeGroupContext::popGroupAndPostProcess() (and causes tests like
testTdf84695 to fail with the fixes in the next commit).
Because shapes with text boxes are sorted again with this, testTdf146272
and testTextBoxLoss need adapting.
(regression from commit 504d78acb8)
Change-Id: I80c375d900a10f1956cd112d60c3f25332c485ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197594
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 327e92c78603e011e7ddf8b57749dfd9e690addf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197729
Tested-by: Jenkins
Currently any object anchored in a Writer header / footer which isn't
actually used in the document isn't put on the SdrPage and thus doesn't
have a ZOrder; this results in a spurious z-index="0" attribute, where 0
is a perfectly valid value that is typically already used by a visible
shape and is thus duplicated, which is invalid.
Fix SvxShape::getPropertyValueImpl() and SwXFrame::getPropertyValue() to
check that it has a parent, and
XMLTextParagraphExport::addTextFrameAttributes() to properly check that
the property has a valid value.
There is one possible use case for producing a z-index for something
that isn't visible: when it's anchored in a delete tracked change, and
we want to preserve the order relative to other shapes in the document.
However, it turns out that in SdXMLShapeContext::AddShape() and
XMLTextFrameContext_Impl::Create() the z-index of anything anchored in a
delete redline is already explicitly ignored, so it's a non-issue.
Change-Id: I37e461ebcd3e4546c60f421054ee39c053919267
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197474
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 7ffd4f7a27b9b2bc55ac3ddb7333dbaf3d48109c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197622
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
Creating the service fails:
java.lang.ClassCastException: class com.sun.star.beans.NamedValue cannot be cast to class [Ljava.lang.Object; (com.sun.star.beans.NamedValue is in unnamed module of loader com.sun.star.lib.unoloader.UnoClassLoader @6ff3c5b5; [Ljava.lang.Object; is in module java.base of loader 'bootstrap')
at com.sun.star.comp.xsltfilter.XSLTransformer.initialize(XSLTransformer.java:143)
at com.sun.star.comp.loader.FactoryHelper$Factory.createInstanceWithArgumentsAndContext(FactoryHelper.java:271)
because initialize gets a sequence<any> where the anys are NamedValues,
but it expects a sequence<any> where the any is sequence<any> where the
anys are NamedValues.
(regression from commit d22f3b8c78)
Change-Id: I4fd13f3e04d79f7646e6bb31c8f0d35efd42ae69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197132
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reportedly it breaks if CC is set to anything sensible, let's just leave
it alone... also it turns out that the newer nss version builds with CC
containing an argument in config_host.mk anyway.
Change-Id: Ifecc68ffe582790134f91cbef459e2728d9202c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194963
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
setup_native assorted DLLs must have ASAN disabled.
ICU build doesn't work, so disable ASAN for that.
This built with MSVC 2022 and:
CC=...cl.exe -fsanitize=address
CXX=...cl.exe -fsanitize=address
--disable-firebird-sdbc
--disable-skia
--disable-pdfium
Change-Id: I296241e43b68579fdd9b6af9c98a5b541c8ae89a
(cherry picked from commit 98b92b339fa3c28319f3f6cec94abb04229f487a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194728
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 579956c4c54f498a22b8e5ed20468ceb9a6e0e30)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194866
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
When moving the cursor to a line with a footnote, JAWS tries to retrieve
the text attributes, gets an E_FAIL, but never gives up trying again.
The problem is that some entirely undocumented magic number is stuffed
into an uno::Any as `long` but the "CharEscapement" property is actually
`short` and thus reading the property in
AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes()
throws and this is caught by CAccTextBase::get_attributes() and E_FAIL
is returned.
> vcllo.dll!o3tl::doAccess<short>(const com::sun::star::uno::Any & any) Line 284
vcllo.dll!AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rUnoAttributes, IA2AttributeType eAttributeType) Line 271
vcllo.dll!AccessibleTextAttributeHelper::GetIAccessible2TextAttributes(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleText> xText, IA2AttributeType eAttributeType, long nOffset, long & rStartOffset, long & rEndOffset) Line 346
UAccCOM.dll!CAccTextBase::get_attributes(long offset, long * startOffset, long * endOffset, wchar_t * * textAttributes) Line 145
UAccCOM.dll!CAccText::get_attributes(long offset, long * startOffset, long * endOffset, wchar_t * * textAttributes) Line 54
FSDomNodeSymphony.dll!00007ff93f0fea12()
^ JAWS
Change-Id: I6c487f9d2db462b787034df3d5ba2f2822d14746
(cherry picked from commit 776662481583935ca148930de1e91ea499c53b3a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194737
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
stack:
UAccCOM.dll!ATL::CComObjectRootBase::OuterAddRef() Line 2631
UAccCOM.dll!ATL::CComContainedObject<CAccImage>::AddRef() Line 3719
AccEventCache.dll!00007ffd2039be28()
AccEventCache.dll!00007ffd20355677()
AccEventCache.dll!00007ffd20346d41()
AccEventCache.dll!00007ffd20347f9a()
AccEventCache.dll!00007ffd20338ba2()
AccEventCache.dll!00007ffd20380dd8()
AccEventCache.dll!00007ffd2037fd7b()
AccEventCache.dll!00007ffd2037f7ee()
AccEventCache.dll!00007ffd2037d9e6()
AccEventCache.dll!00007ffd2037d07f()
^ JAWS
GlobalHooksDispatcher.dll!00007ffd214daed4()
GlobalHooksDispatcher.dll!00007ffd214d8d84()
user32.dll!00007ffd492068ac()
ntdll.dll!00007ffd4ae71424()
win32u.dll!NtUserNotifyWinEvent()
winaccessibility.dll!AccObjectWinManager::NotifyAccEvent(com::sun::star::accessibility::XAccessible * pXAcc, UnoMSAAEvent eEvent) Line 182
^ selfAccObj looks very dead here but that is a red herring!
winaccessibility.dll!AccContainerEventListener::FireStateFocusedChange(bool enable) Line 351
winaccessibility.dll!AccContainerEventListener::SetComponentState(__int64 state, bool enable) Line 178
winaccessibility.dll!AccParagraphEventListener::SetComponentState(__int64 state, bool enable) Line 123
winaccessibility.dll!AccContainerEventListener::HandleStateChangedEvent(com::sun::star::uno::Any oldValue, com::sun::star::uno::Any newValue) Line 106
winaccessibility.dll!AccContainerEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 72
winaccessibility.dll!AccParagraphEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 77
comphelper.dll!comphelper::AccessibleEventNotifier::addEvent(const unsigned long _nClient, const com::sun::star::accessibility::AccessibleEventObject & _rEvent) Line 256
swlo.dll!SwAccessibleContext::FireAccessibleEvent(com::sun::star::accessibility::AccessibleEventObject & rEvent) Line 457
swlo.dll!SwAccessibleContext::FireStateChangedEvent(__int64 nState, bool bNewState) Line 478
swlo.dll!SwAccessibleParagraph::InvalidateFocus_() Line 397
swlo.dll!SwAccessibleContext::InvalidateFocus() Line 1314
swlo.dll!SwAccessibleMap::InvalidateFocus() Line 2695
swlo.dll!SwViewShell::InvalidateAccessibleFocus() Line 2597
swlo.dll!SwEditWin::GetFocus() Line 5569
vcllo.dll!vcl::Window::CompatGetFocus() Line 3891
vcllo.dll!vcl::Window::ImplGrabFocus(GetFocusFlags nFlags) Line 385
vcllo.dll!vcl::Window::GrabFocus() Line 2983
sfxlo.dll!SfxFrame::GrabFocusOnComponent_Impl() Line 650
The problem is quite simply that CMAccessible::SmartQI() returns a
pointer that is the result of querying the newly created COM aggregation
for IID_IUnknown instead of the requested `iid` interface.
Apparently the wrong result happens to work in many cases, but the
CAccTable actually has 2 interfaces IAccessibleTable and
IAccessibleTable2, and the COM aggravation for IAccessibleTable2 is the
one that crashes; in this case the correct pointer is an offset of 8 to
the start of CAccTable, while in the working cases there is no offset.
So likely the bug was introduced by commits
3b86569fcb and
d0e8e6e3cd but only started to crash with
839dbf9ecf.
Change-Id: I7c7d295c8032b95fe7f64b8da4dd9bc3212563f9
(cherry picked from commit 9502a9f76731afa0f5105e6d79b069222677f88d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194730
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
ooo30979-1.doc, converted to rtf, then loaded by writerfilter will
create a text frame anchored to its own 2nd paragraph, triggering:
sw/source/core/doc/doclay.cxx:1591: bool SwDoc::IsInHeaderFooter(const SwNode&) const: Assertion `pNd != rAnchor.GetAnchorNode()' failed.
Change-Id: I5d0ee2ea406273ca42a50047b40a6d8d8d759f0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194121
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tragically libxml2 2.14 changed the SONAME to libxml2.so.16, breaking 25
years of ABI compatibility.
Debian sid and Ubuntu 25.10 both appear to ship only libxml2.so.16 with
no compat package for libxml2.so.2
configure has always defaulted to preferring system libxml on
Linux/macOS but that used to be overridden for release builds before
commit b20f17ce082f30b0a2afd0d311f63f6b2ad8a99a
Change-Id: I7d9b27bd7334ae4ade8c9b58fcf2cd0f9f07fab4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193735
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
GCC 14 now mysteriously finds a -Wshadow here but not in the many other
SfxChildWindow subclass member functions that have a parameter named
"pParent":
sw/source/uibase/sidebar/QuickFindPanel.cxx: In constructor ‘sw::sidebar::QuickFindPanelWrapper::QuickFindPanelWrapper(vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*)’:
sw/source/uibase/sidebar/QuickFindPanel.cxx:115:59: error: declaration of ‘pParent’ shadows a member of ‘sw::sidebar::QuickFindPanelWrapper’ [-Werror=shadow]
115 | QuickFindPanelWrapper::QuickFindPanelWrapper(vcl::Window* pParent, sal_uInt16 nId,
| ~~~~~~~~~~~~~^~~~~~~
In file included from include/sfx2/quickfind.hxx:13,
from sw/source/uibase/inc/QuickFindPanel.hxx:13,
from sw/source/uibase/sidebar/QuickFindPanel.cxx:11:
include/sfx2/childwin.hxx:102:32: note: shadowed declaration is here
102 | VclPtr<vcl::Window> pParent; // parent window ( Topwindow )
| ^~~~~~~
Change-Id: I98228f312308ee69a17af34bb31a5d4109b06ad9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189017
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit a8c445bb1ecf5a68c3925e3ab19d08f0b44644c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193750
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
If the node is in a fly, this can only print:
sw/source/core/doc/doclay.cxx:1619: Found a FlySection but not a Format!
This is a regression from commit
e07feb9457 which used the wrong node's
anchored objects: of course the fly is never anchored to itself, so this
will never find anything.
It turns out that there is already a function SwNode::GetFlyFormat()
that can do most of the work, even using the layout to speed it up, so
just use that to get the anchor.
Change-Id: I7a22231f929175ed7c5c11724882b03890781cfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193476
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
SwXShape::setPropertyValue() allows anchoring a shape to its own
textbox; this actually happens in testTdf146955.
Detect this and throw IllegalArgumentException.
Also catch the exception in GraphicImport::lcl_attribute() so the test
doesn't fail.
Change-Id: I236e12384e07793e0cf3474fc92657967d9249f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193475
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
... when there is an anchored object in the footer, and the last field
fits only partially on the line.
This stopped working with commit 8e3afdb598
removing the IsFooterFrame() check in SwTextFly::GetTop().
Previously a new line below the last line that fits on the page started
with the field rest portion, when the not-fitting line is deleted in
SwTextIter::TruncLines() this caused pDel->IsRest() to be true and
setting SetFollowField(true) which later caused the mbFieldFollow to be
set in the follow text frame.
Now the pDel->IsRest() is false because the line contains only a big fly
portion due to the fly in the footer, and then SetFieldFollow(false) and
the follow doesn't start with the rest of the field.
There is a long standing bug in lcl_NeedsFieldRest() causing this, it
simply doesn't work if there are multiple fields in a line, it
erroneously considers the first field to be the last one in the line.
Change-Id: I99e9f68e8e9f8019e4d22ce5d7874d4cdac285e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193474
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
AutoCaption mostly isn't enabled for clipboard paste, except for one
special case.
For the case when the source is outside LO, let
SwTransferable::PasteGrf() set a flag that the caption should be
inserted (the SwPasteSdr::Insert case), which can then be handled at the
end.
PasteFileList() appears to be used when an image file is copied from
Nautilus.
For internal paste, it gets more complicated because SwFEShell::Paste()
knows what was inserted, but caption can only be added later, outside of
any StartAction()/EndAction(), because if an action is pending,
SwWrtShell::GetSelectionType() does not return useful results, and the
lcl_InsertLabel() ends up erroneously inserting a text node next to the
SwGrfNode.
Change-Id: I3e16f407fd409a0f315be139376ad9e5f0b526cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192165
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
This doesn't make a whole lot of sense.
Add compatibility setting "HiddenParagraphMarkPerLineProperties" for RTF
and DOCX compatibilityMode < 15.
Apparently what Word's "Compatibility Mode" is doing in case a paragraph
mark has hidden formatting is that it merges the last line of the first
paragraph and the first line of the second paragraph together, and
applies the first paragraph's properties to the line (and the preceding
lines); but for the second line of the second paragraph, it applies the
second paragraph's properties.
This is now implemented here; firstly, by adding a flag to the
MergedPara's Extents so that the situation can be distinguished (if the
paragraphs are joined by a delete redline, Word does something different
of course). Because it's possible that the hidden paragraph break is on
a paragraph that doesn't have any extents, but a preceding paragraph has
extents that are affected, this sometimes requires 0-length dummy
extents.
FindParaPropsNodeIgnoreHidden() sets the last paragraph as
pParaPropsNode, which is used for all non-per-line properties.
Note that it's somewhat likely that the various Update functions in
txtfrm.cxx don't maintain the isHiddenParaMerge flag on extents
correctly, so it may look different than Word when editing.
Currently it affects these properties:
* line spacing
* tab stops
These are now set per line by SwTextIter::Next() calling
SwAttrIter::GetTextNodeForLinePropsWordCompat() and a factored out
SwLineInfo::InitLineInfo().
Evidently Word also does adjustment this way, but it's not implemented
here.
Change-Id: I216d9e2afdac9ab6f97c0ea822d4d501689df7a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192077
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Can't locate Time/Piece.pm in @INC (you may need to install the Time::Piece module) (@INC entries checked: ...) at Makefile.in line 37.
Change-Id: Ia47eeb971f7bf91972f46be46330f10e64682799
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191735
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
... results in wrong conditional text fields.
First, add a testHiddenSectionPDFExport2 for the bug that was fixed with
commit 1e007e8f17 - and
testHiddenSectionPDFExport for a slightly different scenario that also
failed.
Investigating this, it turns out that the conditions are only evaluated
properly inside SwDBManager::Merge(), because this sets up its
m_pImpl->pMergeData, and without that SwCalc::VarLook() will not know
which record is currently selected and return SbxVoid (if there is no
xConnection) or a wrong record (if there is a xConnection).
There is even code in SwDBManager::Merge() that tries to store the new
state in m_DataSourceParams so that later SwCalc are able to use it, but
this broke in 2007 with commit d06a6d2c19
which changed SwNewDBMgr::FindDSData() to return the m_pImpl->pMergeData
instead of a m_DataSourceParams entry, and thus the *pTemp assignment
became self-assignment.
Also, FindDSData(bCreate=true) already does everything that this code
was doing anyway, so if we just call that *before* creating
m_pImpl->pMergeData we can delete all that code.
Now another problem becomes apparent: an obvious mismatch between how
SwDBManager::GetColumnCnt() and lcl_MoveAbsolute() treat
SwDSParam::aSelection - in the caller the nAbsRecordId is an index that
is *contained* in aSelection (see explicit search with std::any_of), in
the callee it is an index *into* aSelection.
Apparently this is a regression from commit
f5ccfd60c2 and testing reveals that for
tdf#73025 the lcl_MoveAbsolute() is never called from GetColumnCnt(),
but only from SwDBManager::ToRecordId(), so let's have 2 different
functions for callers expecting different behaviour.
Then revert 1e007e8f17 as this scenario
works with the above described fixes.
Add a testHiddenTextFieldPDFExport for the new bug.
Change-Id: Ibca38edec8782c06a61d4eb5c9065098de8562fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191104
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
It is only impossible during normal package parsing because of the added
consistency checks, but the inconsistency can happen during recovery.
Kind of arbitrary which size is used then?
Change-Id: I31ce9ae8b6fe3d1ca50a118ae6c1feaaaffe17ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191455
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
The place where it went wrong was in a second layout iteration when
after positioning some objects everything was moved down, in
SwSectionFrame::SimpleFormat(), where an empty section frame 72 of the
1st outer section was the prev of the 2nd outer section frame 73, and
was itself not positioned properly.
Apparently this empty section frame is inserted by InsertCnt_() but of
course empty section frames can happen in other ways too.
(reportedly regression from commit a85bd1bc9305af059d880ee422a656a3d9ce1b0b)
Change-Id: I7513a2171fe4f3763f7b73b2e4368032e015c495
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191410
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
This would be reported on reading as an 8-byte gap at the position where
a 32-bit DD for the entry would end.
The problem is that if flag bit 3 is set, and the uncompressed size
exceeds 2^32, writeDataDescriptor() will write 8-byte sizes, but the
Zip64 extension header is missing - the latter should also write 0 even
though the APPNOTE doens't appear to require it.
4.3.9.2 [...] When extracting, if
the zip64 extended information extra field is present for
the file the compressed and uncompressed sizes will be 8
byte values.
Also make sure that the ZipEntry nSize member actually contains the
uncompressed size, which is somewhat tricky, but is required in
writeLOC() to check if Zip64 is needed. (Assume that the DEFLATEd size
is never larger than uncompressed, which is true for every XML file).
Change-Id: I611e6ffda12d8e6953e9306dc4a4407be8e725a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191185
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
soffice.bin: vcl/source/gdi/pdfextoutdevdata.cxx:798: void vcl::PDFExtOutDevData::EndStructureElement(): Assertion `mpGlobalSyncData->mCurrentStructElement != 0' failed.
The problem is that the parent-opening code in
SwTaggedPDFHelper::BeginBlockStructureElements() when called for a
section in a table cell opens a section that is outside the table.
In this case, there are actually 2 section frames, one containing the
table and one in the table cell, so reopening the outer section frame
that is already on the stack ends up restoring a 0 parent SE and that
triggers the assert.
(regression from commit d5f68529a7)
Change-Id: Idd5be655345f96e1c2de84c5623f6e1dba4aae1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190781
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
The problem is that the Table Split feature on a floating table results
in 2 tables inside 1 frame, which then cannot be exported to DOCX as a
floating table.
Split the fly frame in this case, and add an anchor node because every
floating table needs its own anchor node.
Change-Id: I7444a75a953fcea60ffc92c2fa7eaca1b044f54b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190009
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 6f55b9a74f8fdd8609e1aa72388a5f8b97dfcea0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190075
Tested-by: Jenkins
Handle it in SwTransferable::PasteOLE() for embedded objects from
non-Writer applications, SwTransferable::PasteSdrFormat() for SdrObjects
from non-Writer applications, and SwTransferable::PasteGrf() for image
files from non-LO applications.
This is a bit more difficult because some of these call
SwTransferable::PasteTargetURL() after the SwFEShell function that
creates the anchored object, and this will only work if the anchored
object is selected at that time, so the deselection must be done later
in SwTransferable.
SwTransferable::PasteTargetURL() can also be called directly and would
need a check added in that case, but i couldn't figure out what to put
on the clipboard to get there (has to be INET_IMAGE or NETSCAPE_IMAGE).
Change-Id: If068622b0998893f016b84498d0618c112460db5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189629
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
DBUS_LIBS contains -L/usr/lib64/pkgconfig/../../lib64 which eventually
causes link failure:
desktop/source/lib/init.cxx:6451: error: undefined reference to 'ublock_getCode_77'
Reportedly realpath(1) is available even on macOS now so use it to
resolve these paths.
Change-Id: I754447ad23982918d6f8e80f839112db22b75205
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189864
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
This will eventually assert in SwTabPortion::Paint():
sal/rtl/strtmpl.hxx:801: void rtl::str::new_WithLength(rtl_tString**, sal_Int32): Assertion `nLen >= 0' failed.
Also move a comment from its current misleading position (this one is
using TAB_OVER_SPACING).
Change-Id: I0a8b347f7467fcd7176b75a5a7e5e672ad5e13d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189382
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 3bfa151d6f834ef46f1f112ab670cc2d8af6de5c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189682
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
Instead, leave the cursor in the text at the paste location, like
(reportedly) some version of Word does.
This can be configured with the new
Office::Writer::Cursor::Option::SelectPastedAnchoredObject
Change-Id: Id1ddeb0e17c5cd568100d5a8169d929487d16749
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189001
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins
During save to ODF this asserts, or later crashes:
atrfrm.cxx:3810: void sw::CheckAnchoredFlyConsistency(const SwDoc&): Assertion `std::find(rFlys.begin(), rFlys.end(), pSpz) != rFlys.end()' failed.
Initial idea was to fix this by changing SwWrtShell to not use the
ArtificialSelection mode when a hidden section is selected - this fixes
the initial problem but there is another one!
Because ArtificialSelection is now also set in
SwXTextRange::DeleteAndInsert() and SwXTextCursor::DeleteAndInsert(),
the crash can also be reproduced by calling setString("nonempty") on a
cursor that selects multiple nodes with an object anchored on a middle
node.
So better to fix this in SwUndoSaveContent::DelContentIndex() by moving
the Replace check into the IsSelected functions, and to ignore *only*
flys on the start and the end node of the selection, so flys anchored on
the middle nodes are now deleted.
In any case for Undo to work a SwHistoryHint must be created for these
which ExcludeFlyAtStartEnd prevents so it's a different case.
This covers all the initially intended use-cases of
DelContentType::Replace, which actually only were 1-2 node selections
anyway (limited by UI); the arbitrary-sized selection cases were from
later re-uses of the flag for other use cases, and in both the Backspace
and the API case the possibility of flys anchored on middle nodes was
unfortunately missed.
Currently SwUndoSaveContent::DelContentIndex() was the only caller of
the IsSelected functions that could see a DelContentType::Replace.
(regression from commit 85376a0234)
Change-Id: Ifc5aad47e80c638d4e7cb5f66c035fdf1e34b89f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188251
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@collabora.com>
It's not so obvious how the cell widths are set...
1. The table gets USHRT_MAX as initial width
2. All the cells in the table get USHRT_MAX/nCells as initial width
(this is SwFrameSizeItem in box item set)
3. Table property "Width" is set -> this scales all the box widths
4. Row property "TableColumnSeparators" is set; this is *relative* widths
to a hard-coded value of TableColumnRelativeSum=10000
Evidently the result is bad if the number of separators is too low.
(regression from commit 038473595e)
Change-Id: Ie71889a074bff43d8f0c34ccefb4d30ed0a9f0c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188153
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 23e308d5e02ee45ef589d3fddf53dabaa12aadfe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188207
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>