summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2022-06-07sw layout: allow negative page border distancesMiklos Vajna
Writer follows the CSS box model when it comes to page borders: there can be a positive distance between the edge of the page and the border, and again a positive distance between the border and the body frame. This ensures that the page border never intersect with the body frame, which is usually what users expect. Word, however, can work with 2 distances for border and text, both measured from the edge of the page, leading to a page border, which is inside the body text. This is described at great detail at <https://wiki.openoffice.org/wiki/Writer/MSInteroperability/PageBorder#Importing_case_3:>. Fix the problem by allowing negative border distances: this doesn't influence the position or the size of the body frame, but it gives us a way to position the border more towards the center of the page, leading the matching layout between Writer and Word. The doc model (to allow negative border distances), UNO API and DOCX filter is updated in this commit. The ODT filter works without explicit effort. Other filters are not yet updated in this commit. Change-Id: I723e1bdb8dc6391129f1686f88826cc089f6fd67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135462 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-06-02tdf#149389 Crash when closing document in dead key mode while adding commentNoel Grandin
blind fix Change-Id: I79405cf36ce664024626ca7f348885a3dc91a593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135304 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02tdf#148087 assert editing a cell with OnSelectionChange macro breakpointNoel Grandin
assert was introduced in commit e1972743d692c8d8611912c31aae2cb08ae7636d Author: Noel Grandin <noelgrandin@gmail.com> Date: Sun Sep 5 15:01:44 2021 +0200 be more disciplined with SetUpdateLayout on editengine We want to restore UpdateLayout when we're done doing layout, we should not just leave it FALSE Change-Id: Ic0431ffc3c66d0d02bfd10c323b18383f52dbc95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132209 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02tdf#143964 insert/overwrite cursor shape lags in formula editingNoel Grandin
Revert "tdf#132740 bypass work if selection has not changed" This reverts commit 865641047be4a693f7a51635ce06eab15675126d. Change-Id: I69244a1e57ce979bf21946e31df7165f8791423c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02tdf#145603 Drag-n-drop in formula bar creates mismatchNoel Grandin
Revert commit 60d35f767781de4b8f1e7b264b12015f655c647d tdf#132740 don't broadcast if modified status has not changed Change-Id: I5a0292499522e21708a2d5607966e4c2b3a18ba0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135301 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02std::move SfxPoolItem into SfxItemSet where possibleNoel Grandin
found with the help of a temporary loplugin (which i have put into the store/ folder) Change-Id: Ide40d09bef6993ace50039a8fd0439b7e29c09a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135288 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-28add ClearItem to the SfxItemSet iteratorsNoel Grandin
to speed up operations when iterating over SfxItemSets Change-Id: Ie40327ffaf7faa801ccc12d2b05c546a7fe49802 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135079 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-28use the new SfxWhichIter::GetItemState featureNoel Grandin
to speed up other places that are iterating over SfxItemSets Change-Id: I646bae12420d15e67effdd279e071cdf8a8afffd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-05-24Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-20new loplugin:unnecessary lockingNoel Grandin
off by default, since each warning needs careful inspection Change-Id: I805c1d1cdde531a1afdc76e87b22f879fc3c9753 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134641 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-19use the std::function type for this lambda to prevent allocationNoel Grandin
other std::function will heap allocate Change-Id: Ia1fdb20142613e757fbdc6a4e133b530c6cd3682 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-18elide some OUString allocation in SvxNumberType::GetNumStrNoel Grandin
Change-Id: Ia552796cfe99e7886f4b716e717643269b570c38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134530 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-14tdf#149079 don't skip disposing DnDListenerCaolán McNamara
even if there is no longer a DropTarget don't return early and omit to inform listeners of the disposing Change-Id: I6ce7fe1664049a9e0a88b549b1c8c94ec8072c1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134322 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-14reserve space in vector in ImpEditEngine::CreateTextObjectNoel Grandin
Change-Id: I4fd49ab81808b3912445b4037a50a5cd85c74144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134308 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-13Pick a better type for the GetAttrib nAttr parameterStephan Bergmann
...which indexes into a std::vector. To avoid the blemish of accompanying std::size_t variables potentially getting decremented past zero (even though that would be technically OK and not UB), rework some accompanying code to avoid that. Change-Id: Ie1ab2d079a7d8d34fceda1da2d31fa6a8c4fad6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134255 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-12tdf#121740 std::set->o3tl::sorted_vector in ImpEditEngine::FormatDocNoel Grandin
we're almost always adding to the end, and we can size the vector up-front, a perfect application for sorted_vector Shaves 2% off load time. Change-Id: I708ff1451b91635b54eaea0355a03a84bd775754 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11tdf#148148: Applying Title Case when selection contains only spacesMichael Warner
Previously, if the user's selection does not contain any word characters, but the node does contain characters outside of the user's selection, then searching for the word boundaries when applying title case could result in start and end points that were incorrect. In Writer this results in title case being applied to non-selected characters. In Calc this results in a debug assertion being hit. This commit prevents those issues by skipping transliteration on the node in this case. Change-Id: I20c5ef44793741c5863f838c13ba222452346a97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132801 Tested-by: Jenkins Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-07tdf#107765: Check the updated language and apply it to the cell.Kohei Yoshida
During the normal spell-checking in Calc, the user may change the language on the string segment with a spelling error, which is supposed to be applied back to that segment in the cell, but was not. This change should fix it. In case the new language is applied to the entire cell string, we will set the new lanuage to the cell as a cell attribute and keep the string as a simple string. Otherwise, the new language gets applied to the edit engine string. This commit also changes the return value of EditEngine::GetLanguage() to include the string span information in addition to the language value. Change-Id: I713ec7aefe571f721321cd8ea687f616ab4dd61a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133966 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2022-05-05use more o3tl::getTokenNoel Grandin
found by inspecting call sites of OUString::getToken Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in editengStephan Bergmann
Change-Id: Ic6a392ce006c9348abc28a5940c4ee0425e5b990 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03ofz#24932 TimeoutCaolán McNamara
Change-Id: I1055c5b7db23693817221fe213ab96c9f29a11f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133734 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-01use more string_view in variousNoel Grandin
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-30split comphelper::string::strip functions into String and view versionNoel Grandin
which is more obvious, from the perspective of the caller, and lets us avoid creating a new String if nothing needs to be stripped Change-Id: I66a980eaf4aa818251bec49bdb16c2dddb0745e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27Fix typosAndrea Gelmini
Change-Id: I04c9c441a7e93cd998e99e4ede7d9894e14c364e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133519 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-27ofz#24932 TimeoutCaolán McNamara
Change-Id: I8eff4cee1ba06c7ad69cb6ec8e483a84cfd3a347 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133451 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-25use string_view in CompareProtocolSchemeNoel Grandin
Change-Id: I3584042d0341d5c1b4f4e742e25e9eb0aa26f1da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-20tdf#148630 fix text layout and cursor position for IVS+spacingMark Hung
in Impress. This involves: 1. SvxFont::QuickGetTextSize() and SvxFont::GetPhysTxtSize(): insert space only when text array value changes. Same value indicates diffferent characters of the same glyph item (e.x. surrogate pairs, unicode IVS that is made of a base character and a selector. ). 2. ImpEditEngine::GetChar(): fix a logical mistake that tried to increase the index by 1 than checking the value of character position. To advance the index we always need to check the position first. Change-Id: I4e3547413ce361ae7801c957e6d589776ebed114 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133102 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-04-18tdf#148620 Crash in Draw using Format > Lists > Move DownNoel Grandin
This reverts commit 35f03f26799747894d1534796b6cb227bd4f233b speed up loading large ODS a little since ImpEditEngine::ImpMoveParagraphs wants to manipulate ParaPortion's and also identify them by pointer Also convert the OSL_ASSERT in this method to an assert to catch such problems earlier Change-Id: Id924d00c9524223db9a96e487b331ce60e3a4fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133128 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-14use more string_view in editengNoel Grandin
Change-Id: I5104dc8ce24089b110f9cd73e0f5e62ad5b44a0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132983 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-12don't FormatDoc() a whole long text if not necessary (tdf#144515)Luboš Luňák
The testcase has a very long text in a cell that is really high enough to hold only one line of text, yet EditEngine formats and wraps the entire string. Which can be expensive because of calling into text layout to find out width of a text portion, and this is done repeatedly for the yet-unformatted text, so pretty much O(N^2). For top-aligned text it's enough to format only as much as will fit and ignore the rest, so implement that and add EditEngine::EnableSkipOutsideFormat() to enable the optimization. Change-Id: Ida87a1843737a368798ba2b3e60eedc99ee0f611 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132932 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08use just one shared global SalLayoutGlyphsCacheLuboš Luňák
Now the cache should be capable of detecting what needs to stay the same for having the same result, so it should be enough to have just one cache that can reuse results even between callers from different places. Change-Id: Ibdc0303f5b727d1a1d7be91d61db9465ed95e1c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132673 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08move comphelper::string::toInt32 to o3tlNoel Grandin
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08use more subView when converting to Int32Noel Grandin
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-24tdf#114441: Convert use of sal_uLong into better integer typesTushar Jham
Change-Id: Ic564411644f9021825f8523af3ec1505352187bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131948 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-03-18tdf#145614 Convert #define to enum or constexprDeep17
Change-Id: Ie039a828b09aacc68ef2f95f495284d554122940 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131510 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-18a11y: Drop vcl::unohelper::NotifyAccessibleStateEventGloballyMichael Weghorn
As mentioned in Change-Id I4681c28c9d18cf1953be5127765f4aa94563662d ("chart a11y: Drop bSendGlobally param from AccessibleBase::BroadcastAccEvent"), calling it has no effect, the `fireFocusGained` and `fireFocusLost` methods of the `XExtendedToolkit` interface in its only implementation in `VCLXToolkit` do nothing, so just drop it. Change-Id: Ie9352a4e4021d7bf0b35de71f55afc660795b906 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131736 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-03-17use actual type in AccessibleImageBulletNoel Grandin
instead of casting everywhere Change-Id: I954f6f1ef18baa7888d7447d64e8e7a8e5141a13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131709 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-17use actual type in AccessibleEditableTextParaNoel Grandin
instead of casting everywhere Change-Id: I98b654fd93eb8cea49f2e6a399a986e45ed8381d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-17use actual type in AccessibleContextBaseNoel Grandin
instead of casting everywhere Change-Id: I547ad294e612488aef11788bb54e086897c19f93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-15use SalLayoutGlyphsCache in EditEngine/SvxFont (tdf#94677)Luboš Luňák
Change-Id: I4c7c94c10b9184ad1d3348e7b364748b4e7c34de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131611 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-15Better CreateRomanString() to create Roman numbersHossein
The previous implementation of CreateRomanString() was complex and was using various tricks and pointers to create Roman representation of the integers. The new implementation is simpler, and easier to understand. Change-Id: Ibda4f8cfab02fd360e718736c957b3e04110c57a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131573 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-11new loplugin:trivialdestructorNoel Grandin
look for potentially trivial destructors that can then be elided Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-02cid#1500415 Explicit null dereferencedCaolán McNamara
Change-Id: Ifcb4eb0c453f5d39ac9d44a40df060b16b33c462 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130886 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-01use OUStringBuffer for a string that's modified often (tdf#145862)Luboš Luňák
SvParser::aToken was OUString despite being a buffer where the parsed result is collected. Change-Id: Id24c842738ea0f6f1836f77d855069963ac5ae55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130763 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-01use SfxItemSet::GetItemIfSet in desktop..reportdesignNoel Grandin
Change-Id: Iaa0ddf4e97866d537a478e668e3c651a9eabc465 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-27use more SfxItemSet::CloneAsValueNoel Grandin
to reduce heap allocations Change-Id: Ia755c3e7f9610a5441a447cc74ea38ebcef068bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130066 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>