summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2020-02-06the "grouped" notebook svtlo-FontSizeBox's are all hiddenCaolán McNamara
they don't appear in the notebook and there is nothing actually using them Change-Id: I570f156e937f1cbc12620da17d684e66c063425f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88062 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-02-06rename SetOfst -> SetOffsetNoel Grandin
Change-Id: Ic33454dbbbe9c189eb5eebda2c25c6cff3251c84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88027 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-06find more symbols that can be privateNoel Grandin
Change-Id: Ief2538fb61f4519e733ce7592cc7c441b94ac124 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88030 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-05sw: set uniqe name and style to grouped shapesVasily Melenchuk
Unique name is required to dsiplay object in Navigator, style is used by undo/redo code. Change-Id: Id2417cbee3f92c0ee555eb093e1e9bbbc0a83e0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87996 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-02-05Fix typoAndrea Gelmini
Change-Id: Ie0506b80850b17571517653ca05f474ead033161 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88002 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2020-02-05sw: fix crash in SwFrame::dumpAsXml()Michael Stahl
when called from SfxObjectShell::GetPreviewMetaFile(), GetSfxViewShell() is null apparently. Change-Id: Id9f6b14fc044b97eb96f671dfded26f9cb96db22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87984 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-05tdf#129568 Rename the default table styleMaxim Monastirsky
As it turns out, UI names of table styles are leaking into documents, and changing those names actually breaks the import of documents from previous versions. The problem is that a table style itself is saved using its programmatic name, but is referenced by tables using its UI name. So after changing the UI name, these no longer map. It's still possible to manually reapply the style, but if not doing this and just saving, the style and its child cell styles will be silently lost. Moreover, if the given document is of fodt type, it's not even possible to save it (even not as "save as" to odt). Obviously, the issue isn't just with renaming. The same happens also with documents created with a different UI language (even English). Fortunately, up to now English UI names were identical to the programmatic ones. So the first thing we can do is to accept both kinds of names for table:template-name. This way, we solved the problem for documents created in an English UI, and in addition made them work in non-English UI (unlike before). As for export, we want to always writes programmatic names, so newly edited documents will continue to work regardless of future UI changes or UI language switching (and also stay compatible with older versions). For the fodt export failure, changed the order of things in SwXTextTableStyle::replaceByName, as setting a new box breaks SwXTextCellStyle::getName in this specific case. Also changed cell styles to be named using the parent style's programmatic name, so new documents won't have this problem when opened in older versions. This also fixed part of the PythonTest_sw_python failure. The remaining PythonTest_sw_python failure was about the "TableTemplateName" UNO API property of a table, which didn't work with programmatic names. That's a real bug by itself, and was fixed. Also an explicit test was added, to make sure the API always returns the programmatic name. Finally, an odf export test was added. It tests files with both old-style UI names, and new-style programmatic names. Styles should be correctly imported, used by the table, and survive export. Change-Id: I45dfda193813fea184dc42e5e75544ebc05d4a92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87826 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-02-05tdf#130167 writerfilter: while bDiscardHeaderFooter, ignore inlinesJustin Luth
Inline objects from unused headers/footers were being loaded and then ignored, with the result that they were added to the next text section. Similar to git log -p -w 5510f5635021 An earlier commit attempted to do the same thing I think. git log -p -w da0c3b50c7969 My guess is that in this case we have MULTIPLE uses of the same image file, so ultimately it wasn't deleted from DrawObjects - and therefore could still be referenced. I found this fix by randomly trying to shut stuff off. It seems to make sense, but shapes are not my area of understanding. Change-Id: I748c0e59638bb83de8461c498e1676bbae47df92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87909 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-05sw: convert CopyRange boolean parameters to enumMichael Stahl
Change-Id: Ic65753e1c6f5ef45494c1925cf2a5427427e5fe7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87985 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-05tdf#128814 Add delete to Hyperlinks Navigator context menuJim Raykowski
Change-Id: I401ea84aa32e7d01f9fe157eac4d51981550fc76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87945 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-05correct cast used for type id of contentJim Raykowski
A not always reproducible crash occurs when delete key is used in the Navigator. I have only noticed it for table delete. I believe this is caused by casting user data to SwContentType when it is actually SwContent. This patch changes the cast to SwContent. Change-Id: Ia7f59b3e8141c7dee7188276d6cd6722a3678922 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87992 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-05tdf#129912 correctly stop unstyled footnote parsingJan-Marek Glogowski
The bug document somehow manages to generated a footnote, which never terminates the format loop in SwTextFrame::Format_. It contains an unstyled footnote, which I wasn't able to reproduce to create in Word. So I manually edited the XML of the included unit test document, which I used to develop the original patch, and which reproduces the broken parsing behaviour. This patch correctly stops the parsing of the custom footnote reference, if the text run containing the footnote reference is finished, which also fixes loading the bug document. The unit test checks various footnote variants, which represent different problems I found when developing the custom footnote parsing in commit a991ad93dcd6807d0eacd11a50c2ae43a2cfb882 ("tdf#121441 improve DOCX footnote import") and now also includes an unstyled one. It also contains a (still?) broken footnote test, with a complex differing footnote. Change-Id: I748955285d76b6f3122d1da5d8823068f3d7633f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87981 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-02-04rename Get/SetPropTextFirstLineOfst -> Get/SetPropTextFirstLineOffsetNoel Grandin
Change-Id: Ib963dccf0f803534c741eacc31a44dc5c90889fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87958 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-04tdf#130362 sw: fix anchoring of inline math objectsMiklos Vajna
Regression from a7528cd6f17ea5c5b29e7d607e54c62de0d9e7db (sw: insert image: set anchor to at-char by default, 2019-11-18), that defaulted to at-char anchoring for charts and images. What was not considered is that math objects had a previous as-char default (not to-para), and that is supposed to be unchanged. Change-Id: I2a91af6425035b48a0e47ad9b10939945855cd16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87976 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-02-04rename GetCursorOfst -> GetModelPositionForViewPointNoel Grandin
Change-Id: Ia7202e009f635032178e5467a1ac0ab43f82ccf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87953 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins
2020-02-04rename Set/GetTextFirstLineOfst->Set/GetTextFirstLineOffsetNoel Grandin
Change-Id: Iaeb3c17fe157dec82cd70991122c08ee1e215752 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87955 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-04rename GetOfst -> GetOffsetNoel Grandin
Change-Id: I9c0968bd93f41f983468ee7ba8a20e27c4866b32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87954 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-04std::set<T*> -> o3tl::sorted_vector in sw/Noel Grandin
Change-Id: I7b8e221b9e76f98efdbed9ee1c83e32379fde73f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-04tdf#130242 chart: default center label placement in stacked area chartsTünde Tóth
instead of top label placement, like MSO does (or LO has already done in stacked bar charts) for readability. Change-Id: Icac6e8703d0d04122f9cc28254b053ee9fd434ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87846 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2020-02-04tdf#108272 DOCX table-only header: fix SAX parser errorLászló Németh
Floating tables in table-only headers are imported as non-floating ones after a SAX parser error. Now we import them as non-floating ones from the beginning to avoid of the parser error. Change-Id: I0a816a7af642f402a25ed53d9766b1e8b82db789 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87874 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-02-04tdf#42695 Fix a couple Writer Navigator "List Box" related bugsJim Raykowski
This patch resolves: 1) content not shown when Navigator is docked from a floating zoomed-in ("List Box" item unchecked) state 2) "List Box" item is visible when the Navigator is in docked state on document open. Change-Id: Id1fcaf0b581e26aabd4fd897ff142a60d6761e1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87758 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2020-02-03DOCX export: fix table style config handling wrt nested tablesMiklos Vajna
The bugdoc had 2 tables: both using the TableGrid table style, but one had a direct formatting to disable all borders. The second was in the A1 cell of the first, and given that the table style config state was not separated for nested tables, the border settings of the inner table affected the settings of the later cells of the outer table. Change-Id: Ie7897bc661d9f47ca9f5c1b3ed1c439ef0406037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87899 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-02-03Related: tdf#130143 freeze/thaw around bulk insertCaolán McNamara
Change-Id: Iedb1229b56b5e7f1af1779b830cf324bcc8735e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87862 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-03sw: set unique name for fontwork object and style on insertionVasily Melenchuk
Unique name for fontwork is required to be displayed in Navigator pane, unique style name is important for correct undo/redo work. Change-Id: If633d0fda9bb98558a311dd1dd9324f9d6d04616 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87056 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-02-03sw: Optionally disable bookmark manipulation GUIsKatarina Behrens
If the ProtectBookmarks bit is set, don't allow bookmark changes, neither via the bookmark dialog nor the navigator. Change-Id: I035faaf3871c7107dd1aac38c4e6867291827346 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87361 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-03sw: implement protection of bookmarks and fieldsMichael Stahl
SwPaM::HasReadonlySel() checks PROTECT_BOOKMARKS / PROTECT_FIELDS setting and checks if bookmarks or fields are selected for deletion. This should already be called by the UI code in all the right places, for the other content protection features, and cause a dialog to pop up. What's not ideal about this is that it's impossible to delete a character immediately before or after a point bookmark because that would delete the point bookmark too. The bookmark check is done by extracting a function out of MarkManager::deleteMarks() so both will use the same logic. The problem of DelContentIndex() duplicating that logic remains... Apparently the status bar at the bottom already displays "read-only" for such a selection. Change-Id: Id87999198a03ba847ef0eff5651fef3bd2517fae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87778 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-03sw: split into 2 settings ProtectBookmarks and ProtectFieldsMichael Stahl
On second thought, let's have 2 settings because there might be some use-case for protecting one but not the other. Change-Id: If8442b64adeeed80b25c8b69f607f2d4993786e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87777 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-03Add ProtectBookmarksAndFields per-document optionKatarina Behrens
Change-Id: I8dac403ddea59026b5f52c132c8accc1bd0ada92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87360 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-03loplugin:constantparamNoel Grandin
Change-Id: If2dee122bf07dc179fd8f6e766442ec1891a5f3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87845 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-03Unit test for stable at-page anchored fly positionJan-Marek Glogowski
This is the unit test for commit 5cee586a97a11c23dd252accc42099bd5e9b4187 ("sw: fix moving of at-page anchored flys to different page"). Originally the error was just triggered by toggling "View -> Field Names". Luckily it's also triggered by adding some text to page four, so no need for some UI test. Change-Id: I3a63b50dd898788607c3d24a848d8f43ae966377 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87776 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-03sw: prefix members of StgWriter, SwAsciiOptions, SwReader and SwTextBlocksMiklos Vajna
See tdf#94879 for motivation. Change-Id: I5e77069f678f39d52b3ece825bd2c0444fa40584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87843 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-02rename RelativeField back to SvxRelativeFieldCaolán McNamara
Change-Id: Iadac47f83aae0f7403f3391e3dd45bef52ad347a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87832 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-02-02tdf#129568 Rename Default Style to Default Paragraph/Page/Table Styleayhanyalcinsoy
Change-Id: I21672c9b78e52c3c9b2687cb2c0ab21dcf67f19a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86538 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-02-02std::set->o3tl::sorted_vector in SwDocNoel Grandin
Change-Id: Id8f6df99245aeb25e1c32ef4d7c06187c8ab353e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87823 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-02std::set->o3tl::sorted_vector in SwAccessibleMapNoel Grandin
Change-Id: Ic05a160e91a435a540c95c23c9759f667376d61a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87822 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-02Fix typoAndrea Gelmini
Change-Id: I9aac347c76e3b5612151a5c644c86199ff23f113 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87814 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-02-02 tdf#129423: Make export tests export-only where applicableYusuf Keten
Change-Id: I5754534c4bd77d2b5f406b12e994427924e89e27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87812 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-01tdf#128814 Navigator content context menu relatedJim Raykowski
Adds Select menu item to Chapter, Table, and Section content context menus to make document selection of content. Document selection made for collapsed chapters includes all sub chapters. Multi chapter selections can be made from the headings content navigation view. Reworks chapter delete to follow chapter selection behavior. Adds accelerator keys to context menu items Delete and Chapter/Level Promote/Demote. Makes chapter delete undo/redo entries show as 'Delete chapter' or 'Delete chapters' depending on single or multiselected chapter delete. Renames 'Select Chapter' and 'Delete Chapter' menu items to 'Select' and 'Delete'. Reworks an assert so as not to assert fail when delete key is pressed on content type entry Change-Id: I68c725bbf5c6d561615cf10a0a75d4284b698ace Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87168 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-01std::unordered_set<T*> -> o3tl::sorted_vectorNoel Grandin
which is much better for CPU cache, since the representation is more compact, and since we almost always do insert() in pointer order, there is surprisingly little sorting Also add a count() method for compatibility with std::set and the proposed std::flat_set Change-Id: I2a3211dc59919cfec5cac1497530a4c3600d50ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87793 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-31tdf#45589 offapi,officecfg,sw: add option to toggle bookmark displayMichael Stahl
Create specific option to toggle display of the bookmark positions instead of relying on generic IsViewMetaChars(). Add a Bookmarks checkbox to Writer->Formatting Aids page in Options. Add property ShowBookmarks to com::sun::star::text::ViewSettings. Add config setting: org/openoffice/Office/Writer/Content/NonprintingCharacter/Bookmarks Change-Id: I998ecdc16d8e4a5baeeb1bbcff0bf5f1f5636692 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87774 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-31new loplugin:namespaceindentationNoel Grandin
check indentation of braces in namespace decls, and the comments that often appear with them. This is my penance for messing up the indentation with clang-tidy-modernize-namespaces. As such I have limited it to new-style namespaces for now, and the check is off by default. Change-Id: I4db7f10a81c79bc0eece8f8e3ee564da8bc7f168 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-31tdf#130287 disable orphan/widow control in Table ContentsLászló Németh
paragraph style to avoid missing text lines later in vertically merged table cells at page break. From commit 49f453755b72654ba454acc321210e8b040df714 ("tdf#89714 - enable Widow/Orphan in default style"), Table Contents got unnecessary orphan/window control. Unfortunately, recent table layout code cannot ignore these settings completely, causing known problems, see for example tdf#128959 (FILEOPEN DOCX Table row content disappears when broken between pages). Change-Id: Idd570f17b0a11af85072a65f3422535b993db306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87730 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2020-01-30DOCX export: write document variablesMiklos Vajna
This means that in case a user field is exported to DOCX and the user updates the field, the result will be still correct, not empty. Change-Id: I2b52292c70aa6f597f92af95e16c773839247efa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87748 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-01-30cid#1458033 Dereference after null checkCaolán McNamara
pEntry isn't goint to be null, drop the null check Change-Id: I41447afe17fc69d6ca30387f1b74f23f86f6d109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87753 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-30tdf#130219 change labels in Case dropdown box in Font Effects tabSeth Chaiklin
- change "Title" to "Capitalize Every Word" - change "Lowercase" to "lowercase" - change "Capitals" to "UPPERCASE" Change-Id: I67145a384b0220924184b8bc279fb702d8c9f379 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87684 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2020-01-30tdf#129237: Add unittestXisco Fauli
Change-Id: Ica8942e6f165afad1ed40457ec86bd20713a1a59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87744 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-01-30loplugin:unusedfieldsNoel Grandin
Change-Id: Ifb9c91b3e8d6c2dd3a639a239fa41e7d5c7a4ee6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87735 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-30tdf#129659 DOCX check global footnote contextJan-Marek Glogowski
Since tdf#121441 we parse custom footnotes to get at least the DOCX footnote text, even if we can't represent the formating. This might push additional contexts to the parser stack. Therefore it's now not sufficient to check the current context for a footnote, but one has to check the global parser for a footnote context. The actual bug is the unsupported footnote page break, which was not correctly ignored and added a paragraph context to the stack, resulting in the async substream input and output stack size. Change-Id: I143254e7df37a619cb4efb542b58d3eff3afffa7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87114 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-01-30tdf#45589 sw: create and paint text portions for bookmarksMichael Stahl
Add a new SwBookmarkPortion, derived from SwControlCharPortion. There is no character for the bookmark in the text so the portion has length of 0, which makes things quite a bit more tricky. Formatting: * SwBookmarkPortion is created last in WhichFirstPortion(). * In an empty paragraph the SwTextFrame::FormatEmpty() must be disabled. * If there's a bookmark at the end of a paragraph, SwTextFormatter::CalcAscent() must use the font of the previous character, not the paragraph font, because that could grow the line if it's higher. * The SwMultiPortion complicates matters, because it uses a nested SwTextFormatInfo and thus we need some extra steps to prevent duplicate SwBookmarkPortions; this is particluarly a problem for rotated text portions. - SwTextFormatter::BuildPortions() must advance the outer SwTextFormatInfo's bookmark position because BuildMultiPortion() has already created the SwBookmarkPortion. - If a SwBookmarkPortion is at the start of a SwMultiPortion, it will be created before the SwMultiPortion but must be painted inside the SwMultiPortion because its font is going to be initialised as inside the SwMultiPortion (e.g. it will be rotated) so its position must also be adapted to be inside, and only SwTextPainter::PaintMultiPortion() does the setup for that; add a hack to move it in SwTextFormatter::BuildMultiPortion(). Painting: * Using the original font seems rather difficult, hard to predict what some character is going to look like, and how it scales if the size is increased; use OpenSymbol instead. Unfortunately OpenSymbol doesn't have a good glyph that could be used for both the end of a bookmark and start of another bookmark at the same position. * SwLinePortion::PrePaint() wants to avoid moving the portion half-outside the frame but often it looks better that way (previously it was misaligned, now it's half-outside). * Not sure if it makes sense to draw a field shading in SwTextPaintInfo::DrawViewOpt() too; let's try it out, but dependent on the same IsViewMetaChars() setting as the bookmark character itself, not on the field shading setting. Change-Id: I1ab94afb417221e278dbb3afd6c978a05fc78497 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87364 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Michael Stahl <michael.stahl@cib.de>