summaryrefslogtreecommitdiff
path: root/sw/source/core/text/inftxt.cxx
AgeCommit message (Collapse)Author
2023-11-16tdf#119908 sw smart justify: fix justification by shrinkingLászló Németh
Shrink the exceeding lines by shrinking the spaces between the words. Because the negative spacing values are used for the extra space between the characters in the main data structure of the justified line layout, and not for the space between the words, like the positive values, the negative space values for shrinking are stored over LONG_MAX/2 as absolute values to avoid of bigger changes of the data structure before designing a better justification algorithm, where it's possible to mix different methods for the more visible text layout. Note: the text cursor doesn't follow the new word positions yet. Follow-up to commit 7d08767b890e723cd502b1c61d250924f695eb98 "tdf#130088 tdf#119908 smart justify: fix DOCX line count + compat opt." Change-Id: I9a63b5a93d6bce230e963ebc88ea2d0f9aa8fffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159511 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2023-09-18use more concrete UNO types in swNoel Grandin
Change-Id: I446cf00ac7e320586da2dd0837cf873ca9ab0ca6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157013 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-30Related tdf#58434 - Treat ZWSP and WJ as hard spaceHeiko Tietze
U+200B ZERO WIDTH SPACE and U+2060 WORD JOINER are not highlighted anymore if Formatting Aids > Non-breaking spaces is off Change-Id: Id35fb725bbfa14683ceb31d2043848a66328b364 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155019 Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: خالد حسني <khaled@libreoffice.org> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-06-10ofz#59696 AbrtCaolán McNamara
Change-Id: I4cf6043f55a7aae23b6a801dd41b0912b68e1d3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152836 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-09Related: CollaboraOnline#6511 cairo backend can do transparent textCaolán McNamara
and avoid the extra work required here for the generic case. keep the transparency helper for the other backends, or any case where we may be recording to metafile, or pdf export etc Change-Id: Ic01b8b69f2d59e585605ce1e981298fda9185824 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152719 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-06-08ofz#59696 AbrtCaolán McNamara
Change-Id: I8ef148ab96e2fedd6b464bff87b43d9736300f6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152738 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-07tdf#155376 partially convert SvCTLOptions to officecfgNoel Grandin
When accessibility is enabled, Calc will add tens of thousands of listeners. We then spend a significant chunk of time creating SvCTLOptions objects (attached to ImpEditEngine) and adding and removing those objects from the related listener lists. But the required information is already globally cached by the officecfg module, so we can avoid that overhead and just fetch it directly from officecfg. Change-Id: I7ff55fd7c4926866eb7086812275ba8bd6e84c75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152645 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-13tdf#130363 sw layout: MS Word compatibility trailing blanks option part 4Justin Luth
There are also margins to be considered. Granted, the previous approach DID seem to get the right width, since MS Word doesn't paint the left border spacing either. However, since the existing situation doesn't cover that case, just remove the excess amount. Although not perfect (and this whole thing is a total hack, so perfection can hardly be expected) it is better than before. Change-Id: I9dd1e801d8fe0000de020d59c7463138e2ad9f6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151716 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-05-13NFC tdf#130363 sw layout: cleanup MS Word compatibility trailing blanksJustin Luth
Cleaning up the code separately so my change can be better understood. Change-Id: Ib756eb8c86f0c515056fba3e9af61cf645a19365 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151715 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-04-25tdf#38194 tdf#106556 Enhancement to highlight direct formatting,Jim Raykowski
paragraph style, and character style use in Writer documents Initial commit to realize direct formatting, paragraph style, and character style highlighting enhancement requests. Highlighting of character direct formatting is turned on/off using .uno:HighlightCharDF. Highlighting of paragraph styles and character styles is turned on/off using a check box in the Sidebar Styles panel. Closing the Sidebar also turns paragraph and character style highlighting off. Paragraph direct formatting is indicated by a hatch pattern over the paragraph style highlight bar and also by "+ Paragraph Direct Formatting" appended to the tooltip that appears showing the name of the paragraph style when the mouse pointer is over the style highlight bar. Colors used for styles highlighting are determined by a hash of the style name. Lightgray is used for character direct formatting. Known issue: Tooltip doesn't show for paragraph style highlighting in tables and in frames where the highlighting bar is drawn outside of the frame. Change-Id: I6e00ee38c1c169bc7c6542a1782c03b2593e1891 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150451 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-04-21MCGR: Reduce diverse GradientStyle enums to single UNO API oneArmin Le Grand (allotropia)
Change-Id: Ie0cd26a308a75ddead9451c53e874a39cc6eeb63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150705 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-16De-static-izing colors in SwViewOptionParis Oplopoios
The view colors in SwViewOption were static which means that two separate views couldn't have different colors Change-Id: Id595b00ba56bdb210ad1a784cf76e99ead0d6014 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-02-11sw: rename getFieldmarkFor() to getInnerFieldmarkFor()Justin Luth
The same change was made for getBookmarkFor() in https://gerrit.libreoffice.org/c/core/+/145412 Because otherwise it's quite confusing that we have a For() and an At() which could only be differentiated by a code read. Also improve getInnerFieldmarkFor() a tiny bit, so we process the first hit only once. Suggested at <https://gerrit.libreoffice.org/c/core/+/145348/1#message-286262286f234823b390e8f962e3ba11f5fa71b2>. Change-Id: I47e815eea0b8ac0df4957ac0d224acb6c5975b8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145486 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-12-07tdf#152413: Revert "tdf#67669 - Make narrow no-break space visible by drawingKhaled Hosny
... a gray background" This is breaking text layout involving Narrow No-Break Space because now it goes into a portion of its own and gets laid out independent of the surrounding text. Lets revert this until we have a way to highlight text without breaking text layout (e.g. tdf#61444). This reverts: commit bbb57e8198863ee7bdadd3f2aac4420c08da94a3 Author: Andreas Heinisch <andreas.heinisch@yahoo.de> Date: Wed Jul 27 08:53:11 2022 +0200 tdf#67669 - Make narrow no-break space visible by drawing a gray background and its followup commit: commit 01e3c998e63fbf456e7f624adb1cae3d89ed7bb2 Author: Andreas Heinisch <andreas.heinisch@yahoo.de> Date: Mon Aug 22 23:02:48 2022 +0200 tdf#67669 - Make narrow no-break space visible by drawing a gray background Change-Id: I040a4f17d51cfea4f1e9bdcd3bc14a3bfc56b245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143802 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-10-14sw: tables have frames, not portionsMiklos Vajna
Went wrong in commit 60b0526ea4929ce273de499f552a4d478a973d10 (convert POR constants to scoped enum, 2019-01-17), which changed POR_TAB to PortionType::Table. Change-Id: I27131f2ab42f7c53310ee8e61b8481e07ed77da7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141379 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-31tdf#30731: Improve caret travelling in WriterKhaled Hosny
Previously, when measuring caret position, Writer would measure the width of the substring before the caret (i.e. layout it independent of the text after the caret and measure its width). This is incorrect, though. It assumes cutting the string laying it out would result in the same width as when laid out as part of a bigger string, which is invalid assumption when e.g. cutting inside a ligature or between letters that have different shapes when next to each other, etc. This appears to work when the width of the substring laid out alone is close enough to its width when laid out with the full text. But in cases where is widths are largely different, like the extreme case in the bug report, the caret will be jumping around as it is positioned based on the unligated glyphs not the ligated, rendered glyphs. This change introduces a special mode of measuring text width for caret positioning, that will layout the whole string that return the width of the requested substring. Fields and small caps text are trickier to handle, so old behaviour is retained for them. Now one will probably notice but if they do, it can be dealt with then. This also tries to be conservative and keep other pleases using the existing behaviour which might be desirable (e.g. when measuring text width for line breaking, we want the unligated width), but there might be other places that should use the new behaviour. To handle caret inside ligatures, the grapheme clusters in the ligature are counted and the width of the whole ligature is distributed on them evenly. A further improvement would be using HarfBuzz API to get ligature caret positions for fonts that provide them, which helps when the ligature components have different widths. Change-Id: I02062e2e2e1b1a35c8f84307c0a8f5d743059ab5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138889 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-23tdf#67669 - Make narrow no-break space visible by drawing a gray backgroundAndreas Heinisch
Change-Id: I7a80fe6ceab6b3693241db4fda77ce6712624321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138710 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-06-02tdf#149420 sw offapi xmloff: add hyphenation zoneLászló Németh
Add hyphenation zone support, i.e. allow the specified amount of extra space in lines instead of forcing hyphenation. It's for limiting hyphenation, used especially with not justified paragraph alignment. Note: this is an OOXML interoperability feature, used also in DTP software and CSS. * Add checkbox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationZone) * Add ODF import/export * Add ODF unit test * Add layout test Note: extend SvxHyphenZoneItem::GetPresentation() with missing No CAPS and No last word hyphenation options. Note: fix OSL_ENSURE condition in SwTextFormatInfo::GetHyphValues(). Follow-up to commit 29359fc15c435cec17987fd6221ab6833d38746e "tdf#149324 sw offapi xmloff: add option to not hyphenate short words". Change-Id: Ib8eff6ea98a9aa5ca6cb9d17faa0bbb789687ce9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135247 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-26tdf#149324 sw offapi xmloff: add option to not hyphenate short wordsLászló Németh
Add paragraph property to disable automatic hyphenation of short words based on a minimum character count. Note: there is a (broken) global option for Minimum Word Length at hyphenation, see "Minimal number of characters for hyphenation" in Tools->Options->Language Settings->Writing Aids), but for better/comfortable paragraph-level adjustment of typesetting, add a paragraph property for it. The same option is available e.g. in Adobe InDesign and in CSS Text Module Level 4 (hyphenate-limit-chars). * Add checkbox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationMinWordLength) * Add ODF import/export * Add ODF unit test * Add layout test Follow-up to commit 8c018910ae4d8701b1ce2a95727b9baed4016da3 "tdf#149248 sw offapi xmloff: add option to not hyphenate last word". Change-Id: I68715f47d17b5c022430bd0e74c88a97bc7f81f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135028 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-26tdf#149248 sw offapi xmloff: add option to not hyphenate last wordLászló Németh
Add option to disable automatic hyphenation of the last word of paragraphs for better typography. Note: the same option used e.g. in Adobe InDesign, and a similar one in CSS Text Module Level 4 (hyphenate-limit-last). * Add checkbox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationNoLastWord) * Add ODF import/export * Add ODF unit test * Add layout test Follow-up to commit 72bd0df107ee47c4d54fa88b4960d32ea03e9f69 "tdf#121658 Add option to not hyphenate words in CAPS". Change-Id: Ida29c65b5a7cbfd7c399c342781531a6fb86f639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134985 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-04-05sw content controls: add initial layout supportMiklos Vajna
- portions inside content controls are not text portions but content control portions - teach SwTextPaintInfo::DrawViewOpt() to paint field shadings for content control portions - teach the attribute stack code about RES_TXTATR_CONTENTCONTROL, so if the whole document is just a content control, then adding text before/after the content control is properly text portions, not content control portions Change-Id: Ia9f955a5f7c7a4fd633899fafa8fc723e7c0d050 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132556 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-28Recheck sw/ cxx files with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I8a8df68946297fad517b753d73e4373203a45ed6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132150 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-25sw clearing breaks: add clearing indicator during renderingMiklos Vajna
A left / right line around the break portion now allows seeing if the clearing is none, left, right or all (somewhat familiar from Word). No test for this, SwBreakPortion::Paint() is a NOP unless rendering on a window, so the metafile-based rendering used for testing won't detect the difference. Change-Id: I3ff0c89bc4bb45deb03bea43c3ee4589887dee7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132093 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-01-19print out a debug warning when we ignore dodgy processingNoel Grandin
Change-Id: I92d758caea3942e6a2fccdf9eb1f8019c5acae14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128614 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-17tdf#145321 Crash scrolling DOCX to bottomNoel Grandin
this is a consequence of commit d4dc6b5cfdb02ad00a06ad32650948648abe010d use std::vector for fetching DX array data which made pre-existing bugs easier to see. This crash made apparent that we have bad data ending up in SwDrawTextInfo. So I added some asserts there to catch that. However, that simply made apparent that there are bug(s) at a higher level that I have no idea how to to fix. So at the primary problem site in SwTextCursor::GetModelPositionForViewPoint I clamp the values to sane ones. Change-Id: Ic74f6944932bbfc22e8cf9addf9e7511755b18be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-07tdf#146084 Don't warn for languages without hyphenationHossein
Upon opening a Writer document containing some languages that do not use hyphen, an alert is created with the text: 'Missing hyphenation data Please install the hyphenation package for locale "ab_CD".' in which 'ab_CD' is the locale. This patch removes the warning for these languages, that do not use hyphenation: * Arabic script languages (except Uighur) + Persian (Farsi) + Kashmiri + Kurdish (Central Kurdish and Southern Kurdish with Arabic script) + Punjabi + Sindhi + Malai + Somali + Swahili + Urdu "Words are not hyphenated in Arabic language text, however hyphenation is possible for Uighur text written in the Arabic script" https://www.w3.org/International/i18n-tests/results/word-break-shaping The list from MS documents is lenghty, but some of the languages are were not available in LibreOffice, so they are ommited: https://docs.microsoft.com/en-us/typography/script-development/arabic There were languages like Hausa and Kanuri from Nigeria that use both Latin and Arabic script, but only Latin script was listed in the LibreOffice languages, so they were also ommited. * CJK languages + Japanese + Korean + Chinese + Yue Chinese "CJK languages differ from European languages in that there are no hyphenation rules" https://tug.org/TUGboat/tb25-0/cho.pdf * Vietnamese "In Vietnamese all words consist of single syllables, so they are often very short; hyphenation is not allowed at all." https://tug.org/TUGboat/tb29-1/tb91thanh-vntex.pdf Hyphenation is declined in Vietnamese orthography since 1975 https://www.quora.com/When-did-hyphenation-decline-in-Vietnamese-orthography The fix for Japanese (tdf#143422) was previously done in: 53d5555f13371252874ec962dee4643168d26780 and the functionality is preserverd with the current patch. An alternate approach would be adding all the unicode scripts, specifying the script for each langauge, and decide upon the script (mostly) and not (only) the language. More information about the hyphenation usage of many scripts can be found in: https://r12a.github.io/scripts/ This is the list of Unicode scripts: https://unicode.org/standard/supported.html https://en.wikipedia.org/wiki/Script_(Unicode)#List_of_scripts_in_Unicode Change-Id: I7d2b4ee55a0893d1f0d1f9cd3b7cc037a49589b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126435 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2021-12-06tdf#143422 Hide "Hyphenation data not found" in JapaneseJun Nogata
When I open a document with mixed English and Japanese, I get a warning "Missing hyphenation data Please install the hyphenation package for locale "ja"". English needs hyphenation, but Japanese does not need hyphenation. However, the hyphenation check only checks for unknown language or no language. Change-Id: I559e1b1eec8089f50aadad2710a33d0268ab13f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120497 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-10-12Try to fix Ubsan TBJulien Nabet
/sw/source/core/text/inftxt.cxx:651:37: runtime error: downcast of address 0x6060006542c0 which does not point to an object of type ´const SwTextPortion´ 0x6060006542c0: note: object is of type ´SwBookmarkPortion´ 3f 07 00 26 d0 ca 08 e3 2b 2b 00 00 2d 00 00 00 00 00 00 00 49 01 00 00 00 00 00 00 60 42 65 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for ´SwBookmarkPortion´ 0x2b2bda76d6b7 in SwTextPaintInfo::DrawText_(rtl::OUString const&, SwLinePortion const&, o3tl::strong_int<int, Tag_TextFrameIndex>, o3tl::strong_int<int, Tag_TextFrameIndex>, bool, bool, bool, bool) /sw/source/core/text/inftxt.cxx:651:37 Taking a look at some other locations in the same file, it seems we need to test "rPor.InTextGrp()" to consider rPor as a SwTextPortion Change-Id: I1739182a65f6738dad8623ec22950d797c59a6c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123356 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-06tdf#144122 Use signed type to avoid stealthy underflowAron Budea
301278b656e76b6f42af5cf8a6f5c6c02acfffeb and 6fdd0a3f8b3448a9a246496191908c92156cc38b switched some sal_uInt16 types to sal_uInt32. Additional commits related to the change: 9e075acf2bf1ce6c43fdf5b601507ee0663bd691 and 2634bc59092b24217d984a5845365d703bdb08d2. A fallout from this change was tdf#144305, fixed via 0c3e47cc2f0570a7cd8ff4889763991a86b29f26. Instead of adding further casts to force conversion to signed to avoid unsigned types underflowing into large positive numbers, convert these types to signed SwTwips. Change-Id: Icb7fbae79621d452cd03bb01dc620f60a26f1db0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123014 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-09-28no need to allocate SvxTabStopItem separately in SwLineInfoNoel Grandin
Change-Id: Ia2cbf997427a2450a576436d7c0159b7bbe34578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122774 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28vcl: rename OutDevState to StackChris Sherlock
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-01Resolves tdf#142116 - Respect field shading color on dark backgroundHeiko Tietze
This reverts #100366# commit ce057f404b7b39df4a9259eecd90e28cf9a75fbd Change-Id: I50872e38a154f5d24bcfaafd11488508e3c52356 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121359 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-08-30vcl: move TextLayoutCache into vcl::text namespaceChris Sherlock
Placed TextLayoutCache function into own source file and moved it into the new vcl::text namespace. With this patch we will have these vcl::* namespaces: namespace vcl::bitmap namespace vcl::CommandInfoProvider namespace vcl::detail namespace vcl::drawmode namespace vcl::fileregistration namespace vcl::filter namespace vcl::font namespace vcl::graphic namespace vcl::lok namespace vcl::pdf namespace vcl::table namespace vcl::test namespace vcl::text namespace vcl::unohelper namespace vcl::unotools Change-Id: Ia38c2d73715676a924cdbb0de6308a72a40ec3b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121206 Reviewed-by: Hossein <hossein@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-18undo changes to TextAlignCaolán McNamara
revert commit 8689bd5490b473a7ffb149bbe5f7f0683f679c72 Author: Caolán McNamara <caolanm@redhat.com> Date: Thu Jul 29 20:49:29 2021 +0100 convert TextAlign to scoped enum lets leave this as it always was Change-Id: Id4d2a5644974cdd2b0ed6d361d5c52629674d057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120626 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-30convert TextAlign to scoped enumCaolán McNamara
Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-16Fix lang::Locale.Language usage, tdf#128191 follow-upEike Rathke
Using plain lang::Locale.Language is always wrong, it may even be 'qlt' for a more complex language tag. As the InfoBar message is "Please install the hyphenation package for locale “%1”." actually use the BCP 47 language tag of that character/paragraph attribution. Spotted in https://ask.libreoffice.org/en/question/280102/install-the-hyphenation-package-for-locale-ka/ https://ask.libreoffice.org/en/question/238764/error-message-reads-install-the-hyphenation-package-for-locale-zh/ Change-Id: I5805d4d711989a9d0260940666d3eb33eae830af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119020 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-06-08tdf#142404 DOCX c15: add compat flag TabOverSpacingJustin Luth
DOCX in 2013 (compatibilityMode 15) no longer supports TabOverMargin (i.e. the text margin), but it does a similar kind of thing if the tab goes into the spacing-after of a paragraph. So add a compat flag to handle this in-between kind of situation. I grepped -i "tab_*over_*margin" to see if I was missing anything. Decimal/Center proved to be only tabOverMargin. IsInSect shouldn't matter since it fits inside the printing range. The other places where I didn't insert TabOverSpacing didn't seem relevant based on a code read. Tab-after-tab still doesn't work great, but what we have is already a massive house of cards that will just collapse if changed. No real provision for handling tabs-over-paragraph-end. -auto-tabs are created instead of "beyond nMyRight" tab, unless it is the first tab defined. -doesn't allow auto-tabs to fill the remaining space. But on the other hand, MS Word's implementation of tabs follows some kind of incomprehensible bizarre logic, so just ignore the tabs completely, please. Change-Id: I3723107b29ec3e287ea8661544711c13eee3ca48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116667 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-05-26make SwRect(Rectangle) constructor explicitNoel Grandin
Change-Id: I715aa9499598c483ccf907f829c9ba3540edf216 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116120 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-23tdf#142448 sw offapi: add custom color metadata field shadingLászló Németh
using the new com::sun::star::rdf::URIs::LO_EXT_SHADING URI (modelled after odf:prefix and odf:suffix). Custom color field shading of text:meta annotated text ranges and text:meta-field metadata fields allows quick visual check of metadata categories. For example, RDF triple content.xml#id1753384014 urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0odf#shading FF0000 sets red (FF0000) shading color for the text span with xml:id="id1753384014". Pressing Ctrl-F8 or View->Field Shadings can disable custom color metadata field shading on the UI. Note: neither LO_EXT_SHADING, nor odf:prefix and odf:suffix changes invalidate the View (MetaPortion), but run-time update of shading color can be triggered without save and reload of the document e.g. by using (temporary) bookmarks on the annotated text spans. To run unit test with enabled visibility, use (cd sw && make UITest_sw_styleInspector UITEST_TEST_NAME="styleInspector.styleNavigator.test_metadata_shading_color" SAL_USE_VCLPLUGIN=gen) in Linux command line. Change-Id: I5de93cfa32ac6793d7dbdc7b64e6f4beacb2e8d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116015 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-21sw: replace most static_cast<sal_uInt16>() calls with o3tl::narrowing()Miklos Vajna
o3tl::narrowing() is a better way to handle this, as that way the integer conversion is still implicit, which allows detecting integer truncation at runtime (with suitable compiler flags). Change-Id: I499abda3be6943e8c111c56df390e72939586221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115948 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-05-21sw: eliminate recently added static_cast<SwTwips>() callsMiklos Vajna
This was added in commit 301278b656e76b6f42af5cf8a6f5c6c02acfffeb (sw: allow the height of a line to be larger than 65536 twips, 2021-05-20) to fix -Werror,-Wsign-compare problems, but o3tl::narrowing() is a better way to handle this, as that way the integer conversion is still implicit, which allows detecting integer truncation at runtime (with suitable compiler flags). Change-Id: I2f62420457e3d053e6fbc3b787b3c224c6f0586c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115903 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-05-20sw: allow the height of a line to be larger than 65536 twipsMiklos Vajna
The line height can be quite large if the line contains an as-char image. Found by temporarily changing static_cast<sal_uInt16>() in sw/ to a template function to make these conversions implicit (excluding cases where the input and output types can't convert implicitly), then asking -fsanitize=implicit-unsigned-integer-truncation -fsanitize=implicit-signed-integer-truncation to flag the problematic conversions. The first hit was in SwFlyCntPortion::SetBase() (that's where 67408 turns into 1872), then the same pattern at many other places. Change-Id: Ie12f490ed8dd5c531f11506c97598ce4f7610e2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115873 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-08tdf#140796: Wrong English string for U+2060 characterJulien Nabet
Rename "No-width No ~Break" to "Word ~Joiner" + replace pattern "ZWNBSP" variable names by "WJ" Change-Id: I95a874a9d2d20a30d2c4c3add6041adbe72d872c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112055 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-01-18sw: prefix members of SwCombinedPortion, SwEnhancedPDFExportHelper, ...Miklos Vajna
... SwSetToRightMargin and SwTextPaintInfo See tdf#94879 for motivation. Change-Id: I05ef098d16d186782aba8200bddee5b15533dc01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109509 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-12transparency->alpha in tools::ColorNoel
this just changes the Get/Set methods, the constructor and internal representation of Color is not changed. Change-Id: Idb6e07cc08bbaa5bd55b6bd4b585e648aef507b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-04sw: prefix members of SwCharRange, SwEmbedObjectLink, SwHolePortion and ...Miklos Vajna
... SwLineInfo See tdf#94879 for motivation. Change-Id: I6d397ea717161ad435af903cc236c87731f8a419 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108654 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-12-26vcl: use Color:IsTransparent() where appropriateChris Sherlock
Change-Id: I37bbab5f22f91faad65be8ef79734ce1ee6355d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108249 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-24custom literal for Degree10Noel Grandin
Change-Id: Id13869138a622e62d9ffebf2c89bddccda6aff01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-26std::unique_ptr -> std::optionalNoel
Change-Id: I48195e5bd61f9b662481da0efc6165ced794600c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104801 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21new tools::Degree10 strong typedefNoel Grandin
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>