summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2019-03-04sw: prefix members of SwBlockCursor, SwAutoCompleteWord and TransWrpMiklos Vajna
Change-Id: I993ee72f9e162a72b1d4e89d98763fe0d2dee4d4 Reviewed-on: https://gerrit.libreoffice.org/68662 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-03-04simplify UNO getTypes methodsNoel Grandin
Change-Id: Ia8b07edec54527fb4904536fabb03a18e8452550 Reviewed-on: https://gerrit.libreoffice.org/68659 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-04Revert "new loplugin typedefparam"Noel Grandin
This reverts commit 9865440d217d975206a3f91612f0666312bc8fd8. This is not ready to land yet, seems like the latest update of the logic reveals a bunch more places I need to fix before it can land.
2019-03-04new loplugin typedefparamNoel Grandin
verify that parameters use the exact same typedef-names (if any) in definition and declaration Change-Id: I55d2817f599b0253904dce2d35a1a93967e15a77 Reviewed-on: https://gerrit.libreoffice.org/68439 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-03tdf#123821: Correct accidental overlap with IIDs used in CalcTor Lillqvist
These are used for functionality that hasn't really been tested yet, that I added right before moving on to other things last Spring, I guess, which is why I hadn't noticed. Change-Id: I1df26c5dff62269315b1a7eaaf574f7e38c452f6
2019-03-02sync swxform ui files with swriter ui filesandreas kainz
Change-Id: Ie1e4a843e72351fabefba6f3a3c3fc9c35b40c46 Reviewed-on: https://gerrit.libreoffice.org/68606 Tested-by: Jenkins Reviewed-by: andreas_kainz <kainz.a@gmail.com>
2019-03-02filter\ww8 export: don't spam RTL if ParaStyle definedJustin Luth
If the paragraph itself inherits BiDi from the environment, this just means that it gets the value of the paragraph style. If paraStyle is defined, then we don't need to spam the bidi property, since it ought to naturally inherit it. I can only see two possible problems. Either my logic is wrong, or else import might not always take the paragraph style into account (for determining the meaning of justify for example). I want to start spamming justify in the case where the BiDi is not specified but is inherited from the environment (page style or AppLanguage). Separating this into multiple patches will help for debugging in case of any regressive tendencies. related to tdf#98620. Change-Id: I36bc63e6659a4b491b5c6f2c99c72ba5bb715a07 Reviewed-on: https://gerrit.libreoffice.org/66921 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2019-03-02tdf#116084 DOCX track changes: fix w:del within w:insLászló Németh
Instead of showing the tracked deletion as tracked insertion, losing the original and actual text contents, now w:del within w:ins is imported as tracked deletion correctly. Change-Id: I40694a3a73ad4cd443254167462520c17b1bd484 Reviewed-on: https://gerrit.libreoffice.org/68478 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-03-02weld SwInsertAbstractDlgCaolán McNamara
Change-Id: Ib3e9d0a7ff7e0fd3b0cf7bf492ca2bf59788fa2a Reviewed-on: https://gerrit.libreoffice.org/68594 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-02tdf#123705: avoid duplicate themeColorJulien Nabet
See http://bugs.documentfoundation.org/attachment.cgi?id=149585 + https://bugs.documentfoundation.org/show_bug.cgi?id=123705#c4 Change-Id: I3c6fb0a1ac46a62c75bb9daeaded1633889416eb Reviewed-on: https://gerrit.libreoffice.org/68398 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-03-01weld SwInsertDBColAutoPilotCaolán McNamara
Change-Id: I5e46a88de2ff11ecd38667338b84babee24a2a11 Reviewed-on: https://gerrit.libreoffice.org/68591 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-01weld SwChangeDBDlgCaolán McNamara
Change-Id: Ie0fc6a6346f9c777b7172a0b641a2783cf633c1d Reviewed-on: https://gerrit.libreoffice.org/68544 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-01Avoid explicit narrowing castsStephan Bergmann
They had been added back in the day with 0c0c6f2727e2b0e954e5ab7afcafe6738ddb9e98 "INTEGRATION: CWS swwarnings" (adressing "#i69287# warning-free code"), but don't seem to actually silence any warnings, at least nowadays. Better to keep such narrowing casts implicit, so that tools like Clang's -fsanitize=implicit-integer-truncation can detect cases at runtime where a too-large value erroneously gets truncated by such a cast. Change-Id: I3bba6fff034e544cd935c0c4dbc98989052add5e Reviewed-on: https://gerrit.libreoffice.org/68541 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-01weld SwCreateAddressListDialogCaolán McNamara
Change-Id: I3ae15af8a2c7475394dfc5f6e54b89950d2238c0 Reviewed-on: https://gerrit.libreoffice.org/68511 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-01weld SwSelectDBTableDialogCaolán McNamara
Change-Id: I3759d4da18a7cb5a8fce500bd15e7a004e36c605 Reviewed-on: https://gerrit.libreoffice.org/68507 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-01Avoid unnecessary truncation to sal_uInt16Stephan Bergmann
At least when CppunitTest_sw_filters_test tries to load sw/qa/core/data/ww6/pass/crash-2.doc, Clang's -fsanitize=implicit-signed-integer-truncation flags an "implicit conversion from type 'unsigned int' of value 49197 (32-bit, unsigned) to type 'short' changed the value to -16339 (16-bit, signed)" when multiplying nFSize by 10. That document is obviously broken, LO emits lots of SAL_WARN like "sw/source/filter/ww8/ww8scan.cxx:802: Unknown ww7- sprm, dangerous, report to development", and at least MS Word for Mac Version 16.21 refuses to open it at all. But even if the value of nFSize computed here is obviously way too large, that variable is only passed into SvxFontHeightItem's sal_uLong nSz parameter, so it can just as well be of type sal_uLong too. Change-Id: I2e3b9152adce9c928df2276ebb2e9d526553e541 Reviewed-on: https://gerrit.libreoffice.org/68538 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-01weld SwAddressListDialogCaolán McNamara
Change-Id: I0a62f2c03b5c8acef9d4231be1a1d5f0b83e81fb Reviewed-on: https://gerrit.libreoffice.org/68501 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-01tdf#123516 Speed up insert of large tables with auto format table styleJim Raykowski
This patch replaces SwFEShell::SetTableStyle use to resolve tdf#108227 with SwTable::SetTableStyleName. The gain in insert speed is a result of eliminating SwFEShell::SetTableStyle call to the time consuming SwFEShell::UpdateTableStyleFormatting function which is somewhat redundant when inserting a table. Change-Id: Ide1e003d9709a6758e021b52fcf9e40a7b0fcba0 Reviewed-on: https://gerrit.libreoffice.org/68372 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2019-02-28tdf#116382 Replace old dialog in header and footer drop-down menuAditya
Remove the Background tabpage in "Border/Background" dialog accessed from Border and Background menu item in Header/Footer drop-down list and replace it with the tabpages "Area" and "Transparency" of the dialog accessed from Page Style > Header > "More.." button. The old dialog does not have the tabpages "Area" and "Transparency". In simpler words, the patch is to match both the dialogs when accessed in two different ways. Change-Id: Ib84435854389360eba41aecb8578a9a67a92ca1e Reviewed-on: https://gerrit.libreoffice.org/67483 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2019-02-28use the xmlTextWriterPtr typedef consistentlyNoel Grandin
this is the single biggest chunk of stuff my upcoming paramtypedef loplugin will warn about, so do it separately Change-Id: I412e69e76406d6d947101885d4cd92c65e021508 Reviewed-on: https://gerrit.libreoffice.org/68486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-28address list doesn't refresh on pressing 'delete'Caolán McNamara
m_nCurrentDataSet doesn't change, so it doesn't refill it, even though m_nCurrentDataSet was deleted so it no refers to a new entry Change-Id: I0c68f407a23a28a7e55fb3cf691e5f07e5ed6729 Reviewed-on: https://gerrit.libreoffice.org/68497 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-28remove some unused definesNoel Grandin
Change-Id: I5304e85cd3fd2edc48147f1297caa57417a3d038 Reviewed-on: https://gerrit.libreoffice.org/68496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-28tdf#121440 writerfilter: do not use imported style for foot/endnotesVasily Melenchuk
Extra style is causing editing problem near footnote/endnote references. This behavior is a side effect of eaa9cf6a3069fba3d82c046f0041bfb537d9e648, allowing emission of these "technical" styles. Change-Id: I1885b92814746e7b5cd19f3ddd7bc22eb691615e Reviewed-on: https://gerrit.libreoffice.org/68304 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-02-28sw: fix some borked commentsMichael Stahl
Change-Id: I18edeff43fcae98514c80d9f2c1594cc2f866e75 Reviewed-on: https://gerrit.libreoffice.org/68401 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-02-28sw: dump SwCellFrame rowspan in layout.xmlMichael Stahl
Change-Id: I4477874116e8059cf0a82b9b3106c9e26a641947 Reviewed-on: https://gerrit.libreoffice.org/68400 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-02-28In FitToAcutalSize, keep SwColumn's width >= left + right bordersStephan Bergmann
Given SwColumn::m_nWish is documented as "Desired width, borders included." (sw/inc/fmtclds.hxx), it appears that the invariant GetWishWidth() >= GetLeft() + GetRight() should always hold for SwColumn instances. However, during UITest_writer_tests4's test_tdf113284 loading of sw/qa/uitest/writer_tests/data/tdf113284.odt, it appears that some five-column table is created for which initially all SwColumns' GetWishWidth() = 13107 GetLeft() = 144 (except for first SwColumn, where it's 0) GetRight() = 144 (except for last SwColumn, where it's 0) and later FitToActualSize is called reducing each SwColunn to GetWishWidth() = 286 so that for most SwColumns (except first and last), GetLeft() + GetRight() = 288 would exceed GetWishWidth(). And then (still during loading of the test's document), SwFormatCol::CalcPrtColWidth (sw/source/core/layout/atrfrm.cxx) is called for such a problematic SwColumn, trying to subtract from its GetWishWidth() (the result of SwFormatCol::CalcColWidth) both GetLeft() and GetRight(), and store that into sal_uInt16 nRet. Which triggers Clang's -fsanitize=implicit-signed-integer-truncation "runtime error: implicit conversion from type 'int' of value -2 (32-bit, signed) to type 'sal_uInt16' (aka 'unsigned short') changed the value to 65534 (16-bit, unsigned)". So make sure that FitToAcutalSize upholds that presumed SwColumns invariant, shrinking the borders as necessary. Change-Id: I3f6fc07e65a0fc5d5f58c99f1dcdea4467b825f0 Reviewed-on: https://gerrit.libreoffice.org/68463 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-28sw btlr writing mode shell: left/right cursor travelling, fix dest paraMiklos Vajna
Fix aVerticalLeftToRightBottomToTop: - fnXDiff takes "logically larger, logically smaller" arguments, so it's first - second for top to bottom text (existing directions) but it's second - first for btlr - fnXInc was effectively unused before, but it probably meant to provide logical left + width, so set that to physical left - width for btlr And then port 3 places in lcl_UpDown() to use aRectFnSet, so we get correct behavior for both ttb and btt directions. With this, pressing the left/right arrow jumps to the previous / next paragraph correctly. Change-Id: I1323e95e2ce0ab2d66a3ea6e02bd50df2cebf232 Reviewed-on: https://gerrit.libreoffice.org/68462 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-27weld LicenseDialogImplCaolán McNamara
Change-Id: I4b2dbd2446779e7179d2b79bf81cc2ff879377bf Reviewed-on: https://gerrit.libreoffice.org/68389 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-27loplugin:unnecessaryoverride look for more patternsNoel Grandin
like bool Foo::bar() { b = Super::bar(); return b; } Change-Id: I5e4c8005a3da7d7487c9039c35dcbb1d17e65bd7 Reviewed-on: https://gerrit.libreoffice.org/68418 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-27UNO SwXCellRange: uso SvtListener instead of SwClientBjoern Michaelsen
Change-Id: Id4fbe6e16bb63e3df2768ce38161847ea6ff7eec Reviewed-on: https://gerrit.libreoffice.org/68406 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-02-27loplugin:simplifybool improve search for negated operatorNoel Grandin
Change-Id: Id6ac35fefa5c3e1f64c222713791e849b3cb4d34 Reviewed-on: https://gerrit.libreoffice.org/68379 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin
fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-27simplify lcl_SendChartEvent messBjoern Michaelsen
Change-Id: I2476cbabbb3625ab0d562218102fbbcfbb08f4e6 Reviewed-on: https://gerrit.libreoffice.org/68404 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-02-26tdf#116404 RTF: check locale if BiDi inherits EnvironmentJustin Luth
RTF is a bit simplistic compared to the others, but at least we can handle the Environment situation similarly. Change-Id: I87bc389373275d19f1229e11ffd742836a0fd498 Reviewed-on: https://gerrit.libreoffice.org/66966 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2019-02-26UNO redline: uno SvtListener instead of SwClientBjoern Michaelsen
Change-Id: Ic580df179c6aa1dedc866cf0882c124d5b13fcb3 Reviewed-on: https://gerrit.libreoffice.org/68360 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-02-26UNO redlines: uno SvtListener instead of SwClientBjoern Michaelsen
Change-Id: Ie07147c9d6af469ed1088148dd8b9bdb64ae8590 Reviewed-on: https://gerrit.libreoffice.org/68362 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-02-26svdtrans: nPi -> M_PI; nPi180 -> F_PI18000 to remove duplicatesMike Kaganski
Change-Id: Ia2c103a5b530d007f750e4a034b253b3ec5406ec Reviewed-on: https://gerrit.libreoffice.org/68368 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-26SwGluePortion::GetPrtGlue() can legitimately be larger than 'short`Stephan Bergmann
At least during JunitTest_sw_unoapi_4 sw.SwXTextTable::com::sun::star::text::TextTable::TableColumnSeparators, some SwFormatFrameSize is created with a width of USHRT_MAX ("Set USHRT_MAX as the Table's default SSize") in SwDoc::InsertTable (sw/source/core/docnode/ndtbl.cxx). In SwTabFrame::Format (sw/source/core/layout/tabfrm.cxx) that leads to nWishedTableWidth with a value near USHRT_MAX and substantially larger than nMax, causing nLeftSpacing to be a large negative value in the text::HoriOrientation::CENTER case. That in turn causes SwTextAdjuster::CalcRightMargin (sw/source/core/text/itradj.cxx) to set pRight->PrtWidth( sal_uInt16( nRealWidth - nPrtWidth ) ); with a value of 32768 (where pRight is a SwGluePortion). And a later call to that SwGluePortion's GetPrtGlue would try to convert that 32768 to 'short', getting flagged by Clang's -fsanitize=implicit-signed-integer-truncation. In addition to changing GetPrtGlue (and MoveGlue) to use 'long' instead of 'short', drop some unncessary narrowing casts from client code. Change-Id: I6a0d763acfad1fc3b550ec6107adf9f5429dd005 Reviewed-on: https://gerrit.libreoffice.org/68253 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-26tdf#123393 RTF import: fix too big font size in table cellMiklos Vajna
The reason was that A2 had an explicit paragraph style reference, but A1 did not, so table buffering caused A2 style to affect A1 style as well. Combine this with style deduplication, and then A2 style considered the direct formatting (font size) in A1 to be redundant, so it was lost on import. Fix the problem by moving the copy&pasted properties buffering to a single function, and there buffering not only the properties, but also the active style index. Change-Id: I99f2020b8bef237849fd622b25ac5ef0516d69e4 Reviewed-on: https://gerrit.libreoffice.org/68361 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-25sync swform ui files with swriter ui filesandreas kainz
Change-Id: I1657c495928f8c7b86032c974a218f8db4f9b6ba Reviewed-on: https://gerrit.libreoffice.org/68170 Tested-by: Jenkins Reviewed-by: andreas_kainz <kainz.a@gmail.com>
2019-02-25remove obsolete includes of calbckBjoern Michaelsen
Change-Id: I8d9b1ea3bad07ccaf18de5621e4788940dc33c61 Reviewed-on: https://gerrit.libreoffice.org/68294 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-02-25UNO paragraph iterator: uno SvtListener instead of SwClientBjoern Michaelsen
Change-Id: Ic428cf9b1d7f3aed60b941445d4ddf52a8c2415c Reviewed-on: https://gerrit.libreoffice.org/68289 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-02-25sw: prefix members in usrfld.hxxMiklos Vajna
Change-Id: I8859e0e7b58d630eafcd6cfa3b34ef9466747765 Reviewed-on: https://gerrit.libreoffice.org/68300 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-25Fix: Use correct relative table width in docx exportPatrick Jaap
It removes the HACK where the doc model was changed. We introduce a pointer to a surrounding frame: an indicator telling us that the table was placed in a frame to make it floating. During export, remove the frame and use the relative width of the surrounding frame. Change-Id: I43b45d9a9e67ee755782c9f18df22ae1d4014689 Reviewed-on: https://gerrit.libreoffice.org/67775 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-25sync sglobal UI files with swriter UI filesandreas kainz
Change-Id: Icd326ab025ffb74f36dba880261ed3638bcdfd5c Reviewed-on: https://gerrit.libreoffice.org/68191 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Reviewed-by: andreas_kainz <kainz.a@gmail.com>
2019-02-25tdf#116404 DOC: check locale if BiDi inherits EnvironmentJustin Luth
In addition to the general patch, DOC needs to check the locale setting when it "bails out". The functions were identical other than that, so use the shared function instead. Change-Id: I705c5ed39cd07d0df4abb40c622da499375ce7b1 Reviewed-on: https://gerrit.libreoffice.org/66965 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2019-02-23tdf#116404 filter\ww8: use bidi for default style in RTL localeJustin Luth
A new document uses the default value of ::Environment for the RES_FRAMEDIR property. On export, of course a default value does nothing, and for MS formats a nothing means LTR, even though in Writer the styles setting was determined by the Locale. So RTL users were finding their new documents switch to LTR style values when round-tripping to MS formats. Since this is properly handled when the property is ::SET (as it normally is when a document is imported), make sure the the default paragraph style's RES_FRAMEDIR is ::SET, and the export should take care of it. This works out of the box for DOCX. The export for the other formats needs a bit of extra tweaking in addition to this general patch. The tweaking will be done separately. Change-Id: I5134a636ee3374bb2c1081fd0f3f6d9e79634cd3 Reviewed-on: https://gerrit.libreoffice.org/66964 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2019-02-22weld SvxScriptSelectorDialogCaolán McNamara
Change-Id: I885acfcdfd9544d7f4eb0e602a7acf0215cb9d92 Reviewed-on: https://gerrit.libreoffice.org/68220 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-22SfxProgress:SetStateText is deadNoel Grandin
since commit 83ee1bccf9899bb5c1913389b9a26a73a515ad82 Date: Fri Jul 22 09:19:52 2011 +0100 callcatcher: remove unused methods and even following the history back before that only shows one previous actual place where the state text was being displayed. Change-Id: Ib520cb6e999c1e11caf7348821bb274cdd785a44 Reviewed-on: https://gerrit.libreoffice.org/68198 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-22Avoid uncontrolled overflow in SwTable::GetBoxNumStephan Bergmann
...where bad input like "WRONG CELL NAME" (in PythonTest_sw_python's sw/qa/python/check_xtexttable.py) could wrap around to a valid but wrong nRet. Instead, return SAL_MAX_UINT16 upon overflow. At least the call to GetBoxNum in SwTable::GetTableBox (sw/source/core/table/swtable.cxx) with bFirstPart potentially true, assigning to nBox, then later checks if( nBox >= pBoxes->size() ) return nullptr; so returning SAL_MAX_UINT16 upon overflow appears to be the best choice. (Found with Clang's -fsanitize=implicit-signed-integer-truncation.) Change-Id: I12822a6bd4f0269adb14c04eefbd1cde4d288728 Reviewed-on: https://gerrit.libreoffice.org/68203 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>