summaryrefslogtreecommitdiff
path: root/editeng/source
AgeCommit message (Collapse)AuthorFilesLines
2020-05-18Resolves: tdf#129620 crash because there is no associated windowCaolán McNamara1-4/+9
only an outputdevice in this editeng-in-a-widget case Change-Id: Idf054872a48befba652012cd511e4f9df4437166 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94415 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-13Related tdf#132945: fix warningJulien Nabet1-5/+0
I noticed this log: warn:sw.uno:555419:555419:sw/source/core/unocore/unostyle.cxx:2303: error getting attribute from RES_BACKGROUND Git history provides: https://cgit.freedesktop.org/libreoffice/core/commit/?id=7a8ed362eb163ac15a000ba1cfc74b58315800a1 [API CHANGE] revert and deprecate *BackGraphicURL add *BackGraphic *BackGraphicURL include the following properties: - BackGraphicURL - FooterBackGraphicURL - HeaderBackGraphicURL - ParaBackGraphicURL This were removed, but for backwards compatibility this commit adds them back again and depreactes them in the UNO API. The behaviour also changes as internal vnd.sun.star.GraphicObject scheme URLs aren't supported so this properties can only be set and only if a external URL is provided. If getting such a property then a RuntimeException will be thrown. But why "MID_GRAPHIC_URL" wouldn't be dealt in SvxBrushItem::QueryValue whereas: 1) we got this code 2892 case MID_GRAPHIC: 2893 { 2894 uno::Reference<graphic::XGraphic> xGraphic; 2895 if (!maStrLink.isEmpty()) 2896 { 2897 Graphic aGraphic(vcl::graphic::loadFromURL(maStrLink)); 2898 xGraphic = aGraphic.GetXGraphic(); 2899 } 2900 else if (xGraphicObject) 2901 { 2902 xGraphic = xGraphicObject->GetGraphic().GetXGraphic(); 2903 } 2904 rVal <<= xGraphic; 2905 } => so dealt in 2895 "if" block See https://opengrok.libreoffice.org/xref/core/editeng/source/items/frmitems.cxx?r=e12fa18c#2892 2) MID_GRAPHIC_URL is dealt in SvxBrushItem::PutValue 2974 case MID_GRAPHIC_URL: 2975 case MID_GRAPHIC: 2976 { 2977 Graphic aGraphic; 2978 2979 if (rVal.getValueType() == ::cppu::UnoType<OUString>::get()) 2980 { 2981 OUString aURL = rVal.get<OUString>(); 2982 aGraphic = vcl::graphic::loadFromURL(aURL); 2983 } 2984 else if (rVal.getValueType() == cppu::UnoType<graphic::XGraphic>::get()) 2985 { 2986 auto xGraphic = rVal.get<uno::Reference<graphic::XGraphic>>(); 2987 aGraphic = Graphic(xGraphic); 2988 } ... See https://opengrok.libreoffice.org/xref/core/editeng/source/items/frmitems.cxx?r=e12fa18c#2974 Change-Id: I3ad42c4343d9875647cc8f01504da91b68fe220f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94010 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin1-6/+6
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10lok: calc: formula bar: improve selection handlingMarco Cecchetti1-0/+16
This patch provides some improvements for the single input line case with a multi-line text selection: - selection rectangles are correct when selection is expanded to the previous or the next line - two flag parameters for notifying the client if the start/end selection handles should be visible or they don't Change-Id: Ica0428786183c4b5a15870c43490bc69452c2a49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92121 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93344 Tested-by: Jenkins
2020-05-10lok: set device form factor of the client on view creationMarco Cecchetti1-2/+3
This patch allows the lok core to know about the device form facor of the client requesting the creation of new view, immediately instead of a later time. When a new view is needed a "DeviceFormFactor" parameter is forwarded to lo_documentLoadWithOptions and doc_createViewWithOptions from the client. This parameter can have one of the following values: 'desktop', 'tablet','mobile' and it is used to set a global variable accessible by SfxLokHelper::setDeviceFormFactor and SfxLokHelper::getDeviceFormFactor. This global variable is retrived in the SfxViewShell constructor for setting SfxViewShell::maLOKDeviceFormFactor attribute. In SfxViewShell we have the following 3 methods: - bool isLOKDesktop() - bool isLOKTablet() - bool isLOKMobilePhone() which replace the following boolean functions: - comphelper::LibreOfficeKit::isTablet - comphelper::LibreOfficeKit::::isMobilePhone Change-Id: I9b36f354278df8c216fcb90f6a9da8256ec9c1e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93340 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-05-08tdf#102625: fix Formula editor breaks surrogate pairsJulien Nabet1-0/+9
Change-Id: I616cda97367a8fdfb6ae10eb687ca7490a943692 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07tdf#118418 implement scrollSubstringTo() for gtkColomban Wendling2-0/+10
Define & use new accessibility scroll type compatible with IAccessible2 and extend the XAccessibleText interface to require scrollSubstringTo(). Co-authored-by: Martin Pieuchot <mpi@grenadille.net> Change-Id: Id3b2e8616892d7dcbfb41a14b72a8a457fd1dbf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89851 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-05use SfxStyleSheetIterator::Count directlyCaolán McNamara1-2/+2
Change-Id: I0715066cfbbf3457b3e000506d312b9cc0aea2d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93445 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-27tdf#116883: sw: support for lists level format stringVasily Melenchuk1-3/+5
Multilevel lists are more flexible in case of DOCX. There is supported custom format for any level in DOCX unlike in LO and ODT where we are limited only with prefix and suffix for hardcoded list levels separated by dot. At the same time DOCX can have lists not only "1.2.3.4", but "1/2/3/4" or even "1!2>3)4" and such format can vary on each list level. Here is basic implementation for list format as a core feature for all documents and old way (prefix-suffix + ".") is left as fallback. Practically its usage is currently implemented only in DOCX import/export. Some RTF/OOXML unittests were redesigned: since we are not creating prefix/suffix for these formats conditions should be checked in a different way. Change-Id: I1ec58bcc5874d4fa19aee6a1f42bf1671d853b14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92106 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-04-25make FastParser always take a FastTokenHandlerBase subclassNoel Grandin1-2/+1
since most of the call sites already do, and we can skip the slow path this way. Change-Id: I64ed30c51324e0510818f42ef838f97c401bb6dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90326 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-24Typo: LANGUAGE_ENGLISH_CARRIBEAN->LANGUAGE_ENGLISH_CARIBBEANJulien Nabet1-2/+2
Change-Id: Ibae29e8f0c083991ee66cc32113025d0cc8a6891 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92877 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-24Resolves: tdf#132288 don't merge adjacent properties for spell checkingCaolán McNamara2-1/+15
spell checking relies on each attribute chunk being unmerged with identical adjacent chunks Change-Id: Ia835fa054cad0dee4304f16724b9eb0c29b46102 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92866 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-23lokit: fix edit-text/view-cursor positionDennis Francis3-31/+88
in case of views with heterogeneous zooms. 1. EditText render position fix The EditView has an 'output-area' which is used to clip the rectangle we pass to the Paint() call. It also holds on to the ScGridWindow instance where the edit started. The 'output-area' of the EditView is in the coordinates/units of the MapMode of the ScGridWindow it holds. So we need to temporarily change the MapMode and 'output-area' of the EditView in agreement to the device(with the current view's zoom settings) where we are going to paint to. After we call the Paint(), we rollback the original settings of the EditView. 2. EditViewCursor position fix Before this change the cursor position in twips (calculated based on pixel aligned cell position in the view where editing occurred) is broadcasted to all the client-views. If the clients have different zooms, then simply scaling this common cursor position in the client for its zoom is not going to be accurate enough (due to the non-linear Logic->Pixel->Logic transformation involving pixel rounding). This is very visible if you are editing far away from A1 (like Z50). The fix is to turn off this broadcast for calc-cell editing and send view specific edit-cursor invalidation messages. This is accompanied by a online.git patch that removes unnessecary broadcast of view-cursor invalidation messages which messes up things again. "Do not broadcast view-cursor invalidation messages" (cherry picked from commit d58f1e334245f9e136750fbba267c2a941a213cc) Conflicts: editeng/source/editeng/impedit.cxx editeng/source/editeng/impedit.hxx Change-Id: Ib2fbbe4b6f93f26fc85d6adaa8684dd4397d886f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92631 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92721 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
2020-04-22tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/Gabor Kelemen5-0/+5
Turns out we can save about 500Mb of preprocessor input if we use rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper rtl::math::approxEqual from rtl/math.hxx and manage the fallout accordingly. Before: bin/includebloat.awk | head sum total bytes included (excluding system headers): 19017296671 After: $ bin/includebloat.awk | head sum total bytes included (excluding system headers): 18535432672 Change-Id: I1691171f3a309405a7099882ad9989d147f59118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-15loplugin:buriedassign in e*Noel Grandin5-22/+42
Change-Id: Ibbf5b576296bb73e7066f2426bf2fa28739bb761 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14loplugin:flatten in editengNoel Grandin30-2585/+2580
Change-Id: I5c83183d1f9d2d8f5a25b976ead1a7598a75c641 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92197 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-12small cleanups in TextRangerNoel Grandin2-15/+15
- no need for mpPolyPolygon to be allocated out of line. - expand out LongDqPtr typedef, not much longer and makes the code easier to read - allocate mpBound inline using std::optional - rename RangeCache to RangeCacheItem Change-Id: I55032a31eaefa844059edb5f0ee599f1b813ac80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92079 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-11rename vcl::Window::Update to PaintImmediatelyNoel Grandin1-2/+2
To make the code easier to read. Change-Id: Iebc648150391939fba5d1cd815c72dbcf02ceec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-07new loplugin:unusedvariableplusNoel Grandin1-1/+0
a particularly aggressive checker, which is why it is off by default Change-Id: Id5a0faa50b3ecc75e01f4aedc6579c5209e585da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91643 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-03tdf#80194 autoEsc: use fontmetrics in calculationJustin Luth4-13/+46
This replaces the previous 7.0 patch in commit 2940d1905b921d9909b08b1e32014d3c44474ef0 where the following is still true: THIS WILL CHANGE THE POSITION OF EDITENG SUBSCRIPTS AND SUPERSCRIPTS IN EXISTING DOCUMENTS! That is because they were very poorly placed before - using a formula that is very different from how Writer does it. Everyone in the bug reports indicates that Writer does it good, but Impress does it really bad. (tdf#89849, tdf#63083). Instead of using the previous patch's 80%/20% generalization, copy Writer's use of the actual ascent and descent of the font to determine the best position for the subscript or superscript. Change-Id: I0f10f6174b0709f3bc3b9acdc54b7b1fd59c5ee2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90489 Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Justin Luth <justin_luth@sil.org>
2020-03-30Translate German variable namesJohnny_M1-5/+5
Ende -> End Change-Id: Idfcc563c461b604892f6a24c62677e8069bee28f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91208 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-03-20tdf#114441: Convert use of sal_uLong to better integer typesBugra2-4/+4
Change-Id: I9b062372f394021140bedc65e7f2e3827eb84716 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89964 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-03-20Rename isMobile to isMobilePhone and introduce a separate isTabletTor Lillqvist1-3/+3
The intended semantics of isMobile() has been to say whether the device is a mobile phone ot not. Not whether it is a mobile device in general. So make that explicit. Adjust call sites as necessary. Also, in a couple of places where it is likely that what is relevant is whether it is a mobile device in general, not just whether it is a mobile phone, check both isMobile() and isTablet(). For stable interoperability with current Online, keep accepting also the .uno:LOKSetMobile "command" (and .uno:LOKUnSetMobile, except that Online never sends that). Online will eventually be changed to use .uno:LOKSetMobilePhone or .uno:LOGSetTablet only (and never the UnSet variants). Also drop the default value for the bool parameter to setMobilePhone(). Default bool parameters can be quite confusing, and it was especially silly in this case as there is one (1) call site. This is a work in progress and will be improved. Currently there are undefined corner cases. Change-Id: I2a71c37323ee151cbc671bd8e714e1dee10f8b1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90560 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90778 Tested-by: Jenkins
2020-03-18Fix typoAndrea Gelmini1-1/+1
Change-Id: I0ca59400c9e9bff95df437536a5ebdac9af1a855 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90676 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-03-17sd lok: Implement execution of SID_SPELLCHECK_IGNORE_ALLTamás Zolnai1-0/+5
Used by online spellchecking context menu. Change-Id: Iad3dafedbfed1605ba06f7f87ed91117c9b1a8e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90597 Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2020-03-17lok: Send spelling popup menu structure for mobile (calc and impress).Tamás Zolnai1-1/+48
Similar to how writer behaves. Instead of using tunneling, we send the menu structure with the commands. By now this commands are not executed by the document shell of calc / impress. I'll implement that in separate commits. Change-Id: If342c83143a9a7c2ec74b99027f6d4ba8b44ef08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90595 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2020-03-15editeng: lok: send cursor visibility event when restoring update modeAshod Nakashian4-10/+14
When the default text is removed from a TextBox within a slide, the cursor visibility is inadvertendly set to false and never restored (because the LOK notification is disabled due to treating the ShowCursor during SetUpdateMode as an activation of the TextBox, and that is supressed to avoid messing up the cursor when creating a new view). We add a new flag to SetUpdateMode to flag whether this is an activation or we are restoring a previously active window (TextBox) due to a temporary disabling (to clear the default text). Four unit-tests added not just to check and validate the fix, but to also simulate two different ways of entering edit mode, first by single-clicking on the text and then double-clicking outside the text, but within the TextBox. Change-Id: Icaaabc2a897f614f5ce162b71fadccff22ecda02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90301 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 6b84dfabbb5f6930f9ac582f8c1dd9f467fd068c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90298 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-03-13tdf#80194 proof search: assert to find proof of code correctness.Justin Luth1-0/+8
I'm sure that these functions need to change because they just seem very wrong. I think these are fall-back, safety sections because usually the nEsc is already converted away from _AUTO_ prior to reaching this point. But this is all just based on code-reading. It would be nice to have proof of this - especially since the values for subscript are unexpected. I would have expected it to use a value comparable to DFLT_ESC_SUB, and not some random/magical -20. (Note: the _AUTO_SUPER historically refered to an absolute 33 and not DFLT_ESC_SUPER until I recently changed that...) Change-Id: I3bef0841f9a20f09994b2372e9a7db5941b29c9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88997 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-03-11tdf#89849 editeng: adjust escapement before resetting ProprJustin Luth1-0/+7
THIS IS A LAYOUT REGRESSION FIX FOR SUBSCRIPTS/SUPERSCRIPTS. The position of subscripts and superscripts is a percentage based on the 100% fontsize. When LO 4.1 tricked the font into thinking it was 100%, it failed to adjust the escapement to be relative to the new fake size. In the default case, this meant that the superscript was only raised about half as much as it should have. THIS CHANGE WILL AFFECT EXISTING DOCUMENTS WHERE THE TEXTBOX IS SET TO "AUTOFIT THE TEXT". This will primarily be Impress documents, since many of the templates enable autofit text. As a result of this bug, users creating new documents since 4.1 using autofit-text will have specified highly exaggerated subscript/superscript positioning in order to look nice. This fix will expose the exaggerated percentages and make the document look poor. I don't know how that can be avoided. Nor do I know how to create a unit test for a layout bug. I guess QA's PDF compare tests will suffice for this. A clearly exaggerated unit test is attached to the bug report. The new ability to have a larger-than-100% escapement in LO 6.3 comes in handy here, so that small superscripts can gain a fake escapment big enough to put them in the proper position. Change-Id: I0f8dcff8741eb05d8657235930a4eb684629b9d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89214 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-03-09improve loplugin:unusedfieldsNoel Grandin1-12/+10
noticed something that wasn't being picked up, wrote some tests, and found an unhandled case in Plugin::getParentFunctionDecl Change-Id: I52b4ea273be6614e197392dfc4d6053bbc1704de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-06lok: avoid to send visible cursor msg for formula bar edit viewMarco Cecchetti1-0/+8
Cursor visible msg should be sent only if the window linked to the edit view is the document window. Change-Id: Ib4001dbddd191b06fa02d5b8ddab14460270b327 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87680 Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com> Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90070 Tested-by: Jenkins
2020-03-06lok: calc: send text selection rectangles for the input barMarco Cecchetti1-0/+40
Change-Id: I3caeaddd7a5ddc6e496650539b88e2fd81b37e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86790 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90069 Tested-by: Jenkins Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2020-03-05use more FastParser in SvxXMLTextImportContexNoel Grandin1-2/+6
Change-Id: I3d9586ec11538193fd0b8eb410d2a56202e666d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90010 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-04use FastParser in SvxXMLTextImportContextNoel Grandin1-2/+16
Change-Id: I5af3c5cc17e838cc9c856d1a24c1a7cd3e350345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89955 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-03tdf#80194 editeng: fix auto subscript calculationsJustin Luth3-6/+6
...and auto superscript too (although not as noticably). THIS WILL CHANGE THE POSITION OF EDITENG SUBSCRIPTS AND SUPERSCRIPTS IN EXISTING DOCUMENTS! That is because they were very poorly placed before - using a formula that is very different from how Writer does it. Everyone in the bug reports indicates that Writer does it good, but Impress does it really bad. (tdf#89849, tdf#63083) FOR EXAMPLE, when the char-size is reduced to the default OF 58%, it will now be raised by 33%, not 42%. Likewise, the subscript will now be lowered by 8%, not 42%. THIS AFFECTS/FIXES Writer textboxes, Calc, Draw/Impress. "Automatic" indicates that there is not a "correct" answer, but that the computer should make it "look good", so the user should be able to accept this change in positioning, as long as it looks good. The number of documents affected might be less than one would expect. By default .uno:SuperScript does NOT set auto mode (although Format-Character does). Since most people would use the toolbar instead of the format menu to create a superscript, auto will be rare. So there will be relatively few cases where subscripts are automatic in editeng, especially since it looks so poor that most people probably turned automatic off... This patch has no effect on non-automatic escapement. It uses the same fomula that calculated DFLT_ESC_SUB (since it isn't an arbitrarily chosen value). This is an approximation of the formula that Writer uses (since Writer does exact calculations based on each font's metrics). This Writer-inspired formula was introduced in LO 6.4 for more accurate exporting to MSO word processing formats (tdf#127316). Change-Id: I0267810efe31a2b3be41bf2d39e2278ce9bc99e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88911 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-03-03move some headers inside their moduleNoel Grandin4-4/+4
Change-Id: I026f920d475c4ce56a12d6b29a702673e8bd7a1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89866 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-03sw doc model xml dump: show numbering typeMiklos Vajna1-0/+7
Change-Id: I6d2145469b8153c86294c40e1b3dfcc9d65ced60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89819 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-29lok: Resolves: Calc - selecting a hyperlink doesn't show link in dialogMuhammet Kara1-6/+35
Change-Id: Ic4264fad8035029ba6593c91fa57efa772d394ca Reviewed-on: https://gerrit.libreoffice.org/85468 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89705 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-28lok: send hyperlink info also in editengGrzegorz Araminowicz1-1/+16
Change-Id: I64691497778a59b519cafd656772d5e79cb132f3 Reviewed-on: https://gerrit.libreoffice.org/81719 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89679 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-26new loplugin:xmlimportNoel Grandin1-0/+6
to help me maintain the invariants when updating code to use the FastParser APIs. One weird invariant is that you need to override startFastElement or the createFastChildContext will not get called. Not all of these changes are probably necessary - some of the classes are never constructured themselves, only their subclasses are constructed, and their subclasses maintain the invariants, but it is just easier to scatter a few more startFastElement around Change-Id: I3f70fb5a1e44c311cf4926fa7b0fcda605709eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-24tdf#130760 Fix crash when clicking link to other slideSamuel Mehrbrodt1-1/+1
Change-Id: Ie8b0cfb852fe1abc49b80b1d2d9d2c3be1241701 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89332 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-02-21Drop o3tl::optional wrapperStephan Bergmann10-17/+17
...now that macOS builds are guaranteed to have std::optional since 358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to Xcode 11.3 and macOS 10.14.4". The change is done mostly mechanically with > for i in $(git grep -Fl optional); do > sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \ > -e 's/\<o3tl::optional\>/std::optional/g' \ > -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i" > done > for i in $(git grep -Flw o3tl::nullopt); do > sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i" > done (though that causes some of the resulting #include <optional> to appear at different places relative to other includes than if they had been added manually), plus a few manual modifications: * adapt bin/find-unneeded-includes * adapt desktop/IwyuFilter_desktop.yaml * remove include/o3tl/optional.hxx * quote resulting "<"/">" as "&lt;"/"&gt;" in officecfg/registry/cppheader.xsl * and then solenv/clang-format/reformat-formatted-files Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-19related tdf#80194 editeng RTF: set automatic subscript for \subJustin Luth1-8/+8
The RTF specs say that \sub means "Subscripts text and shrinks point size according to font information." while \up is unambiguous with "Subscript position in half-points (the default is 6)." So, \sub leaves it up to the program to set the best values for subscripting or superscripting. That would correspond to the auto values. Previously, this translated into a 26% superscript (close to the default of 33%) and a 26% subscript (which is way too low). For unit tests: although I managed to open an RTF file in draw, it had no text in it, so I couldn't write a test. In the UI, you use the Page menu to "Insert page from file". Change-Id: I06003dbe2177fc87237624438b4daaaaf2482631 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89020 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-02-12clang-analyzer-deadcode.DeadStoresNoel Grandin1-1/+1
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-06rename nFirstLineOfst -> nFirstLineOffsetNoel Grandin1-12/+12
Change-Id: Ic56453d5bffe5b0c0edd354bbaa2c3e78db52a13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88026 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-06rename nPropFirstLineOfst->nPropFirstLineOffsetNoel Grandin1-11/+11
Change-Id: I4a51d84131eda55f80e9e3932a8bf8290e1c27c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88025 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-04rename Get/SetPropTextFirstLineOfst -> Get/SetPropTextFirstLineOffsetNoel Grandin1-3/+3
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-04rename Set/GetTextFirstLineOfst->Set/GetTextFirstLineOffsetNoel Grandin9-17/+17
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-03make some headers privateCaolán McNamara3-2/+203
as shown with ./bin/find-headers-to-move-inside-modules.py Change-Id: I7662417e76fe00c0fc352957560e104b6c2a3d61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87850 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-28New loplugin:unsignedcompareStephan Bergmann12-38/+50
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>