Bug document: fdo67478-1.doc
The replace-spaces template consumed one pair of spaces per recursion
level. WordML documents with very long space runs (e.g. 61000
consecutive spaces) exceeded libxslt's 3000 depth limit, causing an
import error.
Consume the entire consecutive space run in a single call by using
translate() to find the first non-space character, counting all leading
spaces at once, and emitting a single <text:s text:c="N"/> element.
Recursion depth is now bounded by the number of separate space runs,
not the total number of spaces.
Change-Id: Ifb11a61a2e89274684e1d6d38920c8792598fa43
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/62
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 7ba970bce9e1200e5712afe76ec3a85056be9263)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204666
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This fixes a 25.8.5 regression from
tdf#169843 math: OOXML set letter not interpreted correctly
make CppunitTest_sw_ooxmlexport27 \
CPPUNIT_TEST_NAME=testTdf171433_equation
make CppunitTest_sw_ooxmlimport2 \
CPPUNIT_TEST_NAME=testTdf169843_set_letter_formula
Change-Id: I5f2757e1b9023f226f6c8dc14376e170f41f4c3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202320
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
where adding a new cjk font to the bundled fonts triggers
an abort from:
gb_CppunitTest_set_non_application_font_use,...,abort
because the docs require glyph fallback to render, but without a CJK
font in the application fonts glyph fallback doesn't actually happen.
But once one is added, then the fallback is detected and the check
fires.
Change-Id: If02a2c1eefd6f5b6e4a19ca46f359cce466662f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195597
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
In case of Writer the grid has a different origion, than for other
applications (Impress, Calc, Draw). For writer there are multiple grids
(one grid per page). Replicate the behavior of the grid drawing code
to identify the proper grid origin. See SdrPageView::DrawPageViewGrid().
The grid is drawn in the user area, but use the wider "paper rect"
to identify the correct grid frame for snapping. So there isn't an
abrupt change in snapping behavior when an object moves outside the
printing area (partly or entirely).
Do some extensive testing of snap to grid functionality. There were
no tests for it yet.
Change-Id: I844024be411d7b90dfc288a056187f003995f019
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192280
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
Problem: applying any para style
was removing all numbering or bullets.
This fixes a 25.2 regression from
commit 075560420a
tdf#162326 reset paragraph list attributes on style apply
The problem is that bResetListAttrs was already set to true,
but the conditions under which bResetListAttrs applies
were changed by the above commit
so now it affects situations it was never intended to match.
Specifically, this was the condition that changed:
- && pFormat->GetItemState(RES_PARATR_NUMRULE) == SfxItemState::SET
+ && pCNd->GetTextNode()->IsInList()
So two changes need to happen here:
1.) bResetListAttrs needs to only be set
under the existing comment's stated condition (docst.cxx/doc.hxx)
that the para style itself contains a numbering rule.
2.) When the control key is held down,
then bRestListAttrs needs to be set to true
(which is the stated intention of the above commit).
Possibly #1 should also be done for SwDocShell::MakeInlineHeading,
but that entire concept is just weird... so who knows.
make CppunitTest_sw_uiwriter11 \
CPPUNIT_TEST_NAME=testTdf167760_numberedPara
Change-Id: Iae646124a8a434dd3b49a75caeae4bb360396a49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190309
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
As a result of e45f187870362ed4448f4a9fb96883b8431887fb the StyleRef
field needs to use the modified style name with (suffix " (user)")
The related JUnit test requires a German locale to detect the
related issue. Otherwise there is no suffix that needs to be
applied to the field.
Change-Id: Iad4257568ad05900df63a6098ba81e926df701e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186150
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Tested-by: Jenkins
For compat14, page breaks that are not the first run
do not apply the top margin after the page break.
That makes sense. The top margin has already been applied
before the break.
The end marker of a field (ToC, legacy text form field, hyperlinks...)
must be treated as one of these character runs,
since MS Word doesn't apply the top margn in these instances.
The bug report contains examples for ToC and formfield,
so I used the hyperlink example as my unit test.
make CppunitTest_sw_ooxmlexport25 \
CPPUNIT_TEST_NAME=testTdf166544_noTopMargin_fields
Change-Id: Ia3efced0d301c2345667937521beb8e7c895d326
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185375
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
uiwriter5 is so large that trying to build it by now fails with:
{standard input}: Assembler messages:
{standard input}:327871: Warning: end of file not at end of a line; newline inserted
{standard input}:328313: Error: no such instruction: `_zn11__gnu_debug16_error_formatter10_parameterc2in9__gnu_cxx17__normal_iteratoripkpn2sw4mark8markbaseenst9__cxx19986vectoris8_sais8_eeeeenst7__debug6'
g++-12: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[1]: *** [/home/vmiklos/git/libreoffice/core/solenv/gbuild/LinkTarget.mk:339: /home/vmiklos/git/libreoffice/core/workdir/CxxObject/sw/qa/extras/uiwriter/uiwriter5.o] Error 1
Change-Id: Iede9ef1e4302af7b1d84c35c88b371a57f28b2d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182777
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
settings.xml might refer to endnotePr
(in which case there must be an endnotes.xml file)
and / or footnotePr
(in which case there must be a footnotes.xml file)
so round-trip these 2 files also if they exist in the glossary folder.
Otherwise MS Word complains about invalid content.
For this particular unit test it went bad in LO 7.4.4,
but in other circumstances, it already goes bad in LO 4.3.
make CppunitTest_sw_ooxmlexport22 \
CPPUNIT_TEST_NAME=testTdf165642_glossaryFootnote
Change-Id: Ib4c2513fa915fc4de4aee056b67a5936be5c52a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182674
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
sw ascii filter
- check for table nodes, output them seperately with formating
to be displayed as a matrix when copy/pasted to a text file
sw qa filter ascii
- add new test suite along with test to check for correct output
Change-Id: I8ca31bced3860e8e9752db8530ea6caaf31f2e5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164833
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
The bugdoc has a shape which should be on the right page margin, but it
was on the left page margin.
Use the new compat flag to have a layout that matches Word.
This way we don't need to unmap the tweaked position at export time (a
limitation that the DOC filter has).
Change-Id: I38dfae370f275d9f0897198e7b0569f2d91dd352
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166993
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
writerfilter wants to convert incoming RTF and OOXML files into
writer's document model. But it currently has to do so by
manipulating the limited subset that we expose through the UNO
API.
This is both slower and less accurate than having access
to the full document model.
So move it inside, and then we can strip out various hacks, and
optimise imports.
Change-Id: Ie1114d28130ef5f9a786531bc552cb8ee7768015
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165953
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Not a split, to avoid too many conflicts while cherry-picking, but at
least create a new suite where next tests can be added without too much
build time after source code edits.
Change-Id: I0fb95e91ca9289aad25f72b0faa5f8eca3c6c06a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163582
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This resolves a NISZ 6.4.0 regression from
commit 27d04f6dbf
tdf#119038 DOCX: fix FollowTextFlow handling
MSO is all over the place in how they implement layoutInCell
(aka FollowTextFlow in LO). There are lots of compat15 differences
for this, but I don't notice compat coming into play with this bug.
For reference, see commit e993638d5e
Author: Miklos Vajna on Mon Jan 24 12:53:25 2022 +0100
DOCX import: fix <wp:anchor layoutInCell="1"> with <wp:wrapNone>
I'm sure this is the WRONG code spot for handling FollowTextFlow,
but anywhere else and we lose the "it came from a vml shape"
limiting information, so I'm not going to try to relocate this code.
Inline (as-character) shapes ignore layoutInCell,
so the type of anchor (floating or inline) shouldn't matter
and therefore doesn't need to be part of the if () clause.
The header can be special (in compat14 it means everything
is wrap through), but at least in this case it is not limited
to IsInHeaderHeader. Using a non-header as the unit test.
make CppunitTest_sw_ooxmlexport21 \
CPPUNIT_TEST_NAME=testTdf153909_followTextFlow
The first patchset contains a list of all of the unit tests
that were impacted by this patch: nothing interesting.
Change-Id: I0c4c7924833550533ad1b0b7609840a666d4d589
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162324
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
... at the end of text"
This reverts lpranam's 7.2.0 regressive
commit 3233db0913.
The character after a hyperlink should not offer
to CTRL-click or jump to the hyperlink target.
make CppunitTest_sw_uiwriter9 CPPUNIT_TEST_NAME=testTdf158785
Change-Id: I3f5398cc3a4f29ddf1c50764c311046713d39439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161042
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This fixes a LO 7.6.4 regression of a lost page break,
as well as another example where part of the paragraph moves to next page,
from mstahl's commit 4e2f2489c4
It seems likely that the run should only be checked
when we know that there is a real frame here,
which essentially becomes a run for most purposes
(except perhaps for page breaks - as seen for DOCX).
This code block was introduced with
commit 0d9132c504
Author: Miklos Vajna on Sat Mar 24 13:04:54 2012 +0100
fdo#47036 fix RTF import of shapes inside text frames
at the start of the doc
and in the other block of touched code, it did test inFrame.
The unit test works when compiling right after the regression,
but has broken because of tdf#153194.
Since this will get backported way back and all over,
it is a good time to introduce rtfexport8.
make CppunitTest_sw_rtfexport8 CPPUNIT_TEST_NAME=testTdf158586_0
make CppunitTest_sw_rtfexport8 CPPUNIT_TEST_NAME=testTdf158586_1
Change-Id: Ib4b75efb8422d96e693da337cbef97520e975f3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160655
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
In addition add some more basic header/footer tests.
This makes refactoring of header and footer OOXML import
much easier.
Change-Id: I5b3b3714656ba2f7b1dda8d8f067c3bfe68857a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159946
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This change removes the "-1" from the code
that applies the autocorrection so that the entire
string to be autocorrected is replaced, instead
of leaving off the last character. Also,
the starting character of the string is
preserved (i.e. non-bold if changing to bold)
by adding 1 to the start position; this is
for the case when the user cancels the
autocorrect dialog.
Change-Id: Ibe500a1ba0ca5b12ec9c918b51353074b8dd12ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154685
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
The problem was that the A5 cell on page 2 used to have a solid
background, but this was lost after commit
1001dbaef4 (ODT import: handle style name
of covered cells, 2021-03-19).
Covered cell formatting was interesting for cell borders, in Word compat
mode the covered cell can have its own border style, so e.g. there is
left border on a vertically merged cell till its center, but not after
its center.
Fix the problem by limiting the import of covered cell formatting to the
case when the TABLE_ROW_KEEP compat flag is on, to keep both native ODT
and ODT-from-Word documents happy.
If there is a need, some smarter way of merging properties could be
implemented in the future.
Change-Id: Icc1e6f48d9f5a0379d9a9052a1f5b9ae3f294477
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155957
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Don't store values from grab bag when exporting character theme
colors and tint/shade values. The values could be wrong now and
aren't needed anyway as we support the values in the model.
Add proper export support for char color theme information with
correct conversion of values into tint/shade values in 0-255
inverted interval.
This also fixes the import of tint/shade values whcih calculation
was slightly off. We divided by 256 instead of 255, which
introduced an error.
In addition introduce ThemeColorUsage enum, which marks if the
theme color type has a specific "usage" - text or background. This
is determined on import if the theme type is background{1,2} or
text{1,2}. This is then taken into account on export, so the
exact type is preserved.
Change-Id: I0022a159397fd0c3d39a118a7149bb2488dfc149
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152705
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
- in SwFramePage, add a new m_xFlySplitCB and bind it to the flysplit
from the UI description
- map RES_FLY_SPLIT from the doc model to this new weld::CheckButton
- disable the widget for anchor types other than to-para, also
completely hide it, unless a frame contains a single table, which
simplifies Word filters
- add UITest for this
Change-Id: I9ef44b5c66679b04c4818dc343870b92f1b6386d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148030
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Mapping DOCX floating tables to Writer split flys is still disabled by
default, but now the environment variable affects the DOCX import
instead of affecting the Writer item pool's default.
This allows mixing ImportFloatingTableAsSplitFly=true and =false tests
in the same suite, so the sw/CppunitTest_sw_core_layout_flycnt.mk
boilerplate can be dropped.
It also allows overwriting this default from an xcu file (expert config,
or the XCU file in online.git) for testing / demo purposes.
Also extend the layout representation comment / doc a bit.
Change-Id: I239e9c6e9d9c8748ed0846ae336c9c818d59f180
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147191
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Trying to lay out a split fly that contains a table resulted in a stack
overflow.
The reason for this was that SwObjectFormatter::FormatObjsAtFrame_() has
a loop that will format all objects of the current fly frame, but we
managed to anchor the follow fly into itself.
Fix the problem by improving SwFrame::GetNextFlyLeaf(), somewhat based
on how SwFrame::GetNextSctLeaf() has special cases for tables. This way
once we split the fly frame, we'll try to move the follow anchor frame
to the next page's body frame, and not to a child of the follow fly
itself.
Also add a first floattable testcase, we can already assert that the
table is split correctly. Do this in a separate suite for now, since the
pool's default SwFormatFlySplit is only created once, so
SwFormatFlySplit::SetForce(false) doesn't have the wanted effect. The
anchor's text is still on both pages, should be on page 2 only.
Change-Id: Ie2ce75dbace5d9716008351aedb6a8989036badb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146854
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
When Zotero uses refmarks to represent citations, then a section is used
for the bibliography. While it was possible to insert refmarks with a
given name & content, inserting a section with a provided HTML content
was not possible.
A section (and not a refmark) is needed for the bibliography, as a
refmark is a text attribute, so it must start and end in the same
paragraph.
Fix this by adding a new, optional Content parameter to
.uno:InsertSection, which allows providing multi-paragraph, formatted
text.
This is somewhat similar to what commit
fa82e151d8 (sw, .uno:InsertBookmark: add a
new BookmarkText parameter and accept HTML there, 2022-12-06) did for
the bookmark case.
Change-Id: I0ccbc8a765fed4e019783d0b743c1cd2d0596093
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145188
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
OOXML supports theme colors and tint/shade value that additionally
changed the theme color. Read back which theme color + tint/shade
value was applied in the resulting color and add this attributes
as properties to be used by writer.
In sidebar theme panel the changing the theme colors now doesn't
takes this into account and changes the colors correctly.
Change-Id: I3a2d49d485fd37a1611483ee0bb5e6034ac5f88e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143697
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
- add a new SwFrameMenuButtonBase subclass to show the title/alias of
the content control under the cursor, if it's non-empty
- hide it when leaving the content control
- set its label to the alias from SwContentControl
- set the position similar to footer frame menu buttons, at the first
text portion of the content control
- make the label clickable and bind the handler to the content control
properties dialog
Change-Id: Ia35f0cc59c70910fb88719b207ef9e498d6760d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141441
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins