summaryrefslogtreecommitdiff
path: root/sw/source/core/text/portxt.cxx
AgeCommit message (Collapse)AuthorFilesLines
2019-03-22tdf#124109: Revert "Only do kashida insertion with fonts that have non-zero ↵Khaled Hosny1-2/+1
width kashidas" This reverts commit c45b23377bb2fe44c26f1287ff38495344e4ca50. This commit breaks Kashida justification when a document is first opened (the kashida justification will be disabled and spaces will be used untill the text is changed). Probably it is checking for width of Kashida glyph too early. Also I'm not sure what the reverted commit was trying to fix since we already do kashida justification in fonts that has non-zero width Kashida and it has been the case for a long time. This does not fix the original issue in the document attched with the bug report, but if fixes kashida not being applied when opening the document. Change-Id: Ic95859bca94fa792793e3223d2adb465bc6d880f Reviewed-on: https://gerrit.libreoffice.org/69509 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 0a8e9cc5c1782f1cd50ef338ec2aa4f6776a4c0e) Reviewed-on: https://gerrit.libreoffice.org/69519 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-06-14sw_redlinehide: use WrongListIterator in text formatting codeMichael Stahl1-3/+3
Change-Id: Ie13119d456fa6fe3919871cc541a9ad927b5982e
2018-06-14sw_redlinehide: add SwTextFrame::GetLangOfChar()Michael Stahl1-3/+3
The text formatting calls SwTextNode::GetLang(), which is a bit of a problem now, but fortunately it calls it only for 0 or 1 character, and in that case we can easily indirect this to a single call to SwTextNode::Lang() in the right node. Change-Id: Id151cd6ae277bd2880fc8fc63305110ec2bf88c2
2018-06-14sw_redlinehide: portxt.cxxMichael Stahl1-8/+8
Not sure if these space-counting functions should use TextFrameIndex or not, but there's quite a lot of them and half already converted... Change-Id: I27adbd752eada7cfe8b4782a6e183563b4c057f3
2018-06-14sw_redlinehide: more portxt.cxxMichael Stahl1-12/+14
Change-Id: I0400794e30231d98e69569306aeaf9e43a5d5907
2018-06-14sw_redlinehide: SwDrawTextInfo conversion in frmpaint.cxx etc.Michael Stahl1-3/+3
Change-Id: I64bb3478b11888373d9b5e0c8d4716065a625f6c
2018-06-14sw_redlinehide: trivial conversions in portxt.cxxMichael Stahl1-37/+35
Change-Id: I88206586f89f9a799ee23b1d48922e06f74953f2
2018-06-14sw_redlinehide: convert headers to TextFrameIndexMichael Stahl1-3/+3
Only convert the interfaces now, convert the implementations later. Change-Id: I8a84f239d59a5fe21c62615d9ff8e2defa07badc
2018-04-12sw: fix some IWYU warningsMiklos Vajna1-0/+1
Change-Id: I0241707fcdf1d22131ce35fb64488fcf6d669675 Reviewed-on: https://gerrit.libreoffice.org/52750 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-24Fix some IWYU warningsMiklos Vajna1-0/+1
Change-Id: I4b6e799c1afc2a762a3729ee89f3226c59a6eef8 Reviewed-on: https://gerrit.libreoffice.org/48462 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-12More loplugin:cstylecast: swStephan Bergmann1-5/+5
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
2017-11-21loplugin:flatten in swNoel Grandin1-26/+29
Change-Id: I64176f48d90303f078e326c8838da9eb2daf8126 Reviewed-on: https://gerrit.libreoffice.org/44937 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-14Only do kashida insertion with fonts that have non-zero width kashidasMartin Hosken1-1/+2
Change-Id: I54f51432531072a8ec3cde832003369b23cb6eaf Reviewed-on: https://gerrit.libreoffice.org/44704 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Martin Hosken <martin_hosken@sil.org>
2017-10-07sw: always use "" for includes in current source's directoryMike Kaganski1-6/+6
Change-Id: Ida715fad0c4587a9566184180bf159da12470dd7 Reviewed-on: https://gerrit.libreoffice.org/43207 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-08-28Translate German comments/debug strings (leftovers in dirs starmath to sysui)Johnny_M1-1/+1
Translates leftovers found using a custom regex. Additionally translated: - One randomly found comment in /reportdesign - Test strings in /stoc/test (let's see if it works) Change-Id: I5f893c194c4b56b5365700928a3b8b63936d03e2 Reviewed-on: https://gerrit.libreoffice.org/41583 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-08-04loplugin:constparams in sw part4Noel Grandin1-1/+1
Change-Id: Ic42b2691869b61ba906222db893e284d8b9c39c1 Reviewed-on: https://gerrit.libreoffice.org/40767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-05Improved loplugin:cstylecast to reference types: swStephan Bergmann1-6/+6
Change-Id: I7206d3325b4bfedb852d559b68dc1678da524b41
2017-04-19SwBreakIt::m_xBreak is always availableCaolán McNamara1-2/+2
this all is a hold over from the initial tentitive changeover to using it in the first place Change-Id: I70e28023798d8ea637c61f9fac252bc698e8100d Reviewed-on: https://gerrit.libreoffice.org/36683 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-15tdf#106639 Don't add space if Snap To Chars of text grid is effective.Mark Hung1-0/+17
SwFntObj::DrawText() don't process added space of justified text if Snap to Chars is effective when text grid is Lines and Chars, however SwTextCursor::GetCursorOfst and SwTextCursor::GetCharRect count them despite that and make the cursor movement irregular. Change-Id: Ic31577e207b5a033298970a831016221f99d3499 Reviewed-on: https://gerrit.libreoffice.org/36291 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2017-03-23Remove unused #include <ctype.h>Stephan Bergmann1-2/+0
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-01-15crashtesting: fix a badzillion writer layout crashesCaolán McNamara1-2/+1
e.g. fdo80788-1.odt Invalid read of size 2 at 0x3C031438: SwLinePortion::IsParaPortion() const (porlin.hxx:132) by 0x3C05EC56: SwTextFormatter::BuildPortions(SwTextFormatInfo&) (itrform2.cxx:679) by 0x3C05F2A2: SwTextFormatter::FormatLine(int) (itrform2.cxx:1550) Address 0x3576189e is 30 bytes inside a block of size 40 free'd at 0x4C2ED4A: free (vg_replace_malloc.c:530) by 0x4E56939: rtl_freeMemory_SYSTEM(void*) (alloc_global.cxx:279) by 0x4E56978: rtl_freeMemory (alloc_global.cxx:349) by 0x4E5501B: rtl_cache_free (alloc_cache.cxx:1230) by 0xDACE741: FixedMemPool::Free(void*) (mempool.cxx:49) by 0x3C043AB8: SwTextPortion::operator delete(void*, unsigned long) (portxt.hxx:55) by 0x3C043B05: SwHangingPortion::~SwHangingPortion() (porrst.hxx:98) by 0x3C043F47: std::default_delete<SwHangingPortion>::operator()(SwHangingPortion*) const (unique_ptr.h:76) by 0x3C044070: std::unique_ptr<SwHangingPortion, std::default_delete<SwHangingPortion> >::reset(SwHangingPortion*) (unique_ptr.h:344) by 0x3C0888C3: std::unique_ptr<SwHangingPortion, std::default_delete<SwHangingPortion> >::operator=(decltype(nullptr)) (unique_ptr.h:280) by 0x3C0888DB: SwTextGuess::ClearHangingPortion() (guess.hxx:51) since... commit a706bb06d5326e7a997dd1d71f3f947bd0ad28e6 Date: Wed Jan 11 14:26:47 2017 +0200 new loplugin: useuniqueptr: sw part 1 Change-Id: I614029474d684ddcccd4f4a5e9787fe6c19d8fd2
2016-10-15tdf#43740 Count CJK characters to distribute spaces.Mark Hung1-1/+1
lcl_AddSpace determine the amount of space to distribute to a portion based on its text length. Counting the number of CJK characters prevent including codepoints that are not visible, such as surrogate pairs or Unicode variance selectors, by mistake. Change-Id: Ia20a7f76ea1ea3c1f4638db865721eaa26a8c82c Reviewed-on: https://gerrit.libreoffice.org/29616 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-05loplugin:unnecessaryoverride in swNoel Grandin1-5/+0
Change-Id: I641175c9c17fcc46b582b6487b8207deb343e645
2016-06-27loplugin:singlevalfields in sw(part3)Noel Grandin1-20/+1
Change-Id: Ie971a1483f4fedda61c81a097399d3d562862891 Reviewed-on: https://gerrit.libreoffice.org/26677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-22Avoid reserved identifiersStephan Bergmann1-2/+2
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-03-22loplugin:constantparam in swNoel Grandin1-1/+1
Change-Id: I56925a8fd776b3ee787cc26adbaa08c58dd022c0
2016-01-31tools: rename FontUnderline to FontLineStyleChris Sherlock1-4/+4
Change-Id: I4750ad8569a1003b2f8c29052f3e25003ee433ca Reviewed-on: https://gerrit.libreoffice.org/21892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon1-10/+10
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-11/+11
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-10-12tdf#77014 fix input field breaking of words at new lineTomaž Vajngerl1-51/+2
SwTextInputFieldPortion::Format has previously tried to erase the input field special chars, which caused the words not breaking as expected or in the same way as normal text. It appears that it is actually not necessary to do this at all so just calling the super class method SwTextPortion::Format does the job and fixes the problem. After testing I could not find anything that is obviously wrong. Change-Id: Ie763f55ad55863dd224425dc481b7100deb639fa
2015-08-20loplugin: defaultparamsNoel Grandin1-4/+4
Change-Id: I4c6b966a54e18cdbb0c64b6e93804a306b5d2638
2015-07-08Fix typosAndrea Gelmini1-1/+1
Change-Id: I020c7ce4d9aa93cb0292378a410cdb9f7788e920 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-05-29loplugin:redundantcast: const_cast to same typeStephan Bergmann1-1/+1
Change-Id: I7cb919140539d0d573b5fbf786a6041843c2388a
2015-05-20bin/rename-sw-abbreviations.shlibreoffice-5-0-branch-pointChristian Lohmaier1-89/+89
renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-12sw: replace that awful constructor that overloads SwTxtPortion copy-ctorMichael Stahl1-3/+5
... with a CopyLinePortion function; how can you even... Change-Id: Ie7d459ee317522e35fdbbd3974afabe7a136fe62
2015-05-05loplugin:staticmethodsNoel Grandin1-2/+1
Change-Id: I90dd921077bbfc57200e398e7959306f26c65cfe
2015-04-22fix export of ooo63048-1.sxw to .docCaolán McNamara1-1/+1
I can't see that nCutPos = rInf.GetLen() makes a lot of sense, perhaps nCutPos = rInf.GetIdx or nCutPos = rInf.GetLen() + rInf.GetIdx() makes more sense, but nCutPos is only used in SwTxtPortion::BreakCut and the nLen has to be >= 0 to be useful in there, so might as well straight-out flat invalidate it as -1 and test for positive values in SwTxtPortion::BreakCut Change-Id: Iad0c26efc47990cf2ffed54dc91207c3b8551096
2015-03-18convert DocumentSettingId to an enum classNoel Grandin1-1/+1
Change-Id: Ia4f135c64e6b6b5bd7a522e4a1e9ca63738ff3ef
2014-11-25loplugin: cstylecastNoel Grandin1-1/+1
Change-Id: I49d14ec4247984e78aafe90528c2919488233fe7
2014-11-24loplugin: cstylecastNoel Grandin1-4/+4
Change-Id: Ia3dc8efc8c8803597cbf226780bdb7e1c9681ee0
2014-09-06Use more proper types, constify, avoid magic numbersMatteo Casalin1-1/+1
Change-Id: I15d0fd7de815398ae7323209c5e1d3613b722401
2014-08-12-Werror,-Wundefined-bool-conversionStephan Bergmann1-1/+1
Change-Id: Iff8db4c82abeeed0789d7012223a846f1058c353
2014-07-24fdo#81502: sw: fix spurious "[" being painted for field marksMichael Stahl1-0/+2
There is a special SwFieldMarkPortion sub-class that is supposed to be created for these, which overrides Paint() to do nothing; unfortunately at least for the CH_TXT_ATR_FIELDSTART at beginning of a paragraph a plain SwTxtPortion is created, because the check of rInf.Len() is checking the length of the _previous_ text portion; the call to rInf.SetLen() only happens after creation, in last line of SwTxtFormatter::NewTxtPortion(). This problem affects RTF and DOCX files since commit c6b99eedda03461202f9bf012a422dfd81da72ec. Change-Id: I447b21e841d22558d689f0f244d811c32e4923ec
2014-07-22Massive KSHORT/MSHORT to sal_uInt16Matteo Casalin1-6/+6
Change-Id: I82a899ef0cad19d62c41753ffdce07d8e33d6c9d
2014-04-19Finish removing ASCII art from sw/source/core/textChris Laplante1-72/+4
Change-Id: If845234120236f35edb57c767b5debc046e85864 Reviewed-on: https://gerrit.libreoffice.org/9101 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-04-16Do not pass bad pointers to strlenStephan Bergmann1-4/+3
...neither a pointer to a lone char nor null Change-Id: I08a4f6b80310e23edd614490633b677bd50323a4
2014-03-28Resolves: fdo#73936 make FormFieldDropDowns a real fieldportionCaolán McNamara1-69/+13
split the checkbox and list and use a field portion for the list. That way it knows how to line break correctly wrt hardspaces and doesn't hang when the situation arises. Change-Id: I46d73f19ef8e51e7c21c8783ce70bb80d98a784c
2014-03-11"underflow" is one wordTor Lillqvist1-3/+3
Change-Id: I31db021b916b64e9fc0c02f62bdfe7e7f6aa7b9e
2014-03-11Bin noise "SMARTTAG" comments from 2006Tor Lillqvist1-1/+0
Change-Id: I43e948fc7895e4dbd5ea4e3e5aeefd298ee40007
2014-02-27Remove visual noise from swAlexander Wilms1-17/+2
Conflicts: sw/inc/unodraw.hxx sw/inc/unoframe.hxx sw/sdi/swriter.sdi sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unoparagraph.cxx sw/source/filter/ww8/rtfexportfilter.cxx sw/source/ui/inc/unotxvw.hxx sw/source/ui/lingu/hyp.cxx sw/source/ui/lingu/sdrhhcwrap.cxx sw/source/ui/uno/swdetect.hxx Change-Id: Ic0a3fb2392187c277c9b36915ffb10dcf0317908 Reviewed-on: https://gerrit.libreoffice.org/8322 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>