summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
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>
2019-02-22ofz#13250 Direct-leakCaolán McNamara
Change-Id: Idf5984399f2d8bdf4751667e01f170bed15a4443 Reviewed-on: https://gerrit.libreoffice.org/68205 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-22sw btlr writing mode shell: fix up/down cursor travellingMiklos Vajna
By teaching SwEditWin::KeyInput() about 2 vertical modes: the existing tbrl one and the new btlr one. Up now correctly goes to the next character and down to the previous one. Change-Id: I71faebe62e5fa3892b37e8bea6c15d1fb84df5d1 Reviewed-on: https://gerrit.libreoffice.org/68183 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-22Remove confusing commentMatteo Casalin
Change-Id: I0e19228b50a19085c9eee70372b34a07e7255091 Reviewed-on: https://gerrit.libreoffice.org/68115 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-02-22loplugin:unusedfields in swNoel Grandin
Change-Id: Id68a01042f8398d7d4803a9ce7eb03620732f1ce Reviewed-on: https://gerrit.libreoffice.org/68163 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-21Set maLayoutSize also for non-RES_FLYFRMFMT, like RES_DRAWFRMFMTStephan Bergmann
Running CppunitTest_sw_ww8export2's testTdf111480 under Clang's -fsanitize=implicit-signed-integer-truncation fails in SwWW8WrGrf::WritePICFHeader (sw/source/filter/ww8/wrtww8gr.cxx) when the passed- in nHeight, where both nWidth and nHeight are zero, is reduced to below zero when subtracting nThick for the borders. In turn, nWidth and nHeight being zero is caused by SwWW8WrGrf::Insert (sw/source/filter/ww8/wrtww8gr.cxx) calling rFly.GetLayoutSize(), and that ww8::Frame::maLayoutSize being left initialized to zero in the Frame::Frame(const SwFrameFormat &rFormat, const SwPosition &rPos) ctor (sw/source/filter/ww8/writerhelper.cxx) unless it is a RES_FLYFRMFMT (while in this scenario it is a RES_DRAWFRMFMT). The additional maLayoutSize, and SwWW8WrGrf::Insert calling GetLayoutSize() instead of GetSize(), were added with CWS ww8export01_SRC680 commits in 2007 (e.g., a79a54b255481f31db2c530278c2deee97625769 "INTEGRATION: CWS ww8export01_SRC680"), to fix <https://bz.apache.org/ooo/show_bug.cgi?id=43447> "export to .doc of images with captions if image had been resized". It looks like those commits didn't take into account that GetLayoutSize() could also be called for non-RES_FLYFRMFMT while it would erroneously be left initialized to zero for those. Change-Id: I7455ab43268d132dc23958185a48a1e73214c7ca Reviewed-on: https://gerrit.libreoffice.org/68151 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-21Make sure that mark does not exceed the length of the textMike Kaganski
Change-Id: I685d3ac7f7038ef91463b2a0f012e23f0d6a422e Reviewed-on: https://gerrit.libreoffice.org/68147 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-21sw: fix warning in SwTextShell::GetState()Miklos Vajna
warn:sw.core:31398:31398:sw/source/core/bastyp/index.cxx:322: SwIndex::operator--() wraps around Change-Id: I5c37a6b5e1fe24bc3b6b84e762bad6577583f3d8 Reviewed-on: https://gerrit.libreoffice.org/68127 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-21weld HangulHanjaConversionDialogCaolán McNamara
Change-Id: Ia41f1a03581a0a48d59706ac5b3c569fc39c7f4d Reviewed-on: https://gerrit.libreoffice.org/68099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-21tdf#123434 FILEOPEN: RTF: missing content in cellsLászló Németh
Revert "tdf#122424 RTF import: ignore table row text outside the cells" This reverts commit dc8fa612054363e1a871b0e413a59889fbdb156a. Change-Id: Id68dc7ae55df013de64fb2d4955a412e4c046781 Reviewed-on: https://gerrit.libreoffice.org/68086 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-02-21sifr icon theme update and writer tabbed compact toolbar updateandreas kainz
Change-Id: I031f7ce7e63c9bf7ebda55c2742004f642ba8e5a Reviewed-on: https://gerrit.libreoffice.org/68129 Tested-by: Jenkins Reviewed-by: andreas_kainz <kainz.a@gmail.com>
2019-02-20Avoid meaningless string<->integer conversionsMike Kaganski
Change-Id: I4b86636cc4e4884459d59d1df9949505274bde9e Reviewed-on: https://gerrit.libreoffice.org/68069 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-20sw: fix buildMiklos Vajna
Change-Id: Icb3ba2658442b1218ac039d0a5a6d5dc77b94434
2019-02-20Revert "uitest for bug tdf#101873"Miklos Vajna
This reverts commit 92849660e21d5a13fb671339e52cbc30335ab842. The original commit already contained a test, so this one is redundant. And when there is a possibility to choose, then it's better to test something from fast cppunit tests than from slow uitests. Change-Id: I1d8849da242ee6c8e5d7729b26a71e495a2d394e Reviewed-on: https://gerrit.libreoffice.org/68062 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-20tdf#123433 ww8import: end same attribute as what startedJustin Luth
This resolves the regression from the bugfix for tdf#116071 from commit 3539a1efb41a787237e4333ebc715db96ffacb5b Change-Id: I59929401d84e3ad201bffc8aa9b50057ac716e71 Reviewed-on: https://gerrit.libreoffice.org/68011 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-20tdf#123293 sfx2: fix metadata loss when loading from streamMichael Stahl
The problem is that when loading from a stream, there is no BaseURL and also no storage for the document. Due to the lack of BaseURL, the sfx2::createBaseURI() throws and loading RDF metadata fails, which also pops up an annoying warning dialog. Try to handle this in a similar way than a newly created document (see GetDMA()), by using the vnd.sun.star.tdoc scheme URL for the document; this however currently requires that the document has a XStorage, which is also not the case here. So add another UNO method to tdoc UCP's tdoc_ucp::ContentProvider, to split out the creation of the tdoc schema URL from the creation of the ucb Content, to get rid of the XStorage requirement. Change-Id: Ica62743f9d21db0b1464b70db1a62ebc61989ef8 Reviewed-on: https://gerrit.libreoffice.org/67882 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-02-19weld ChineseDictionaryDialogCaolán McNamara
and ChineseTranslationDialog Change-Id: I3b754c405c8379fc0c5fa94437cc0464a1dea999 Reviewed-on: https://gerrit.libreoffice.org/67991 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-19uitest for bug tdf#101873Zdeněk Crhonek
Change-Id: I2b01767b94a7c63fac725d2f6e943e589e232822 Reviewed-on: https://gerrit.libreoffice.org/68023 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2019-02-19tdf#110987: Don't mis-detect .doc files as .dotTor Lillqvist
Also add a unit test for that. Change-Id: I86c195cebbe12b2bdf498954956db882f6f0d12b Reviewed-on: https://gerrit.libreoffice.org/68005 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-02-19tdf#123057 Correct page count in mail merge if sections are hiddenIlhan Yesil
Remove of invisible content has influence on page count and therefore on fields for page count. So straight after removing invisible content in the mail merge process, the layout has to be updated before fields are converted to text. Change-Id: If43f9921b6797c7ceb112860cda4baf4978c36bc Reviewed-on: https://gerrit.libreoffice.org/67343 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-02-19set parent for chinese dictionary dialogCaolán McNamara
Change-Id: I29fce67b32a5c632eb12210f707f13b995bd58d3 Reviewed-on: https://gerrit.libreoffice.org/68007 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-19UNO_NAME_FILTER_NAME is not used anywhereTor Lillqvist
Change-Id: I135359d9cce4a3195a8e2099545ffafa5b767cdb Reviewed-on: https://gerrit.libreoffice.org/68013 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-02-19use boost::optional in EditFieldInfoNoel Grandin
it is inefficient to allocate a tiny object like Color separately on the heap Change-Id: I2f03538f987ff032857f3316ed2d8c2c8d731549 Reviewed-on: https://gerrit.libreoffice.org/67968 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-19tdf#101873 sw: fix search for second term after double not foundMiklos Vajna
Regression from commit 8d2fe8d7e5f374f3a106a4fc58ef597a52815ad0 (SwView::SearchAndWrap: fix WrapAround search in fly frames, 2015-06-03). The search implementation looks in the body text, then in case searching in extra content was not enabled already, it attempts to search there. The problem was that while the wrap-around implementation intended to do the same, it failed to unset the "search in extra" flag in case nothing was found, fix that now. Change-Id: Idf078e464824cad69c9709309435f2db207503b8 Reviewed-on: https://gerrit.libreoffice.org/67986 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-19tdf#122624 XLSX OLE in DOCX: export view positionsLászló Németh
of the visible sheet of an embedded spreadsheet, instead of exporting always the first column and row. Change-Id: Iaf87bfc5b7658cd4d64cb9c83c50bbf66fd6e7f0 Reviewed-on: https://gerrit.libreoffice.org/67982 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2019-02-18use clear() instead of erase(begin, end)Noel Grandin
Change-Id: Ie1dcff4c2e5f52521b4172ef5726413a9d048214 Reviewed-on: https://gerrit.libreoffice.org/67961 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-18Resolves tdf#121596 - Include a key combination to insert thin spacesheiko tietze
uno:InsertNarrowNobreakSpace/ FN_INSERT_NNBSP added and asigned to shift+alt+space Change-Id: I20dd4159bc35ee378bee75af9734b1f25dfd8b1a Reviewed-on: https://gerrit.libreoffice.org/66776 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
2019-02-18sw: remove not needed condition in SwTextFrame::SwitchHorizontalToVertical()Miklos Vajna
The distance of the content from the left edge of the parent frame (in vertical mode) is the same in both the top-to-bottom and in the bottom-to-top cases. Change-Id: I9dff075276b884cb8742584cbd4b8310e7cea553 Reviewed-on: https://gerrit.libreoffice.org/67955 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins