summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2017-01-21coverity#704055 Unchecked return valueCaolán McNamara
Change-Id: Ie0c8155955ba975c913738adf40ef6ec092adba0
2017-01-21fix confusing function argumentsJochen Nitschke
cppcheck: funcArgOrderDifferent > Function 'CompareSequence' argument order different: > declaration 'rData1, rData2, rD1, rD2' > definition 'rD1, rD2, rMD1, rMD2' no logic change Change-Id: Ie43b66e867c6f5febd825d06380a27c736d6fded Reviewed-on: https://gerrit.libreoffice.org/33365 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-01-20Missing 'const'Stephan Bergmann
Change-Id: I2110b932f5e27141f137fecf5c2ff8a7f9665bf6
2017-01-20Revert "doesn't seem to be a reason start and end are swapped"Caolán McNamara
breaks tests apparently This reverts commit 92bfe7e3052a7540c81d9fa152f55920ad00b8ee.
2017-01-20doesn't seem to be a reason start and end are swappedCaolán McNamara
Change-Id: If1ccdd303bc7c6e69360295c599270c41d03f3f7
2017-01-20sw: fix remaining loplugin:cppunitassertequals warningsMiklos Vajna
Now only subsequentchecks are remaining, as far as I see. Change-Id: Id5e5a874f8de08c0fd3722aecdc02967ae5d421f Reviewed-on: https://gerrit.libreoffice.org/33346 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-20tdf#48658 writerfilter: only set THROUGH wraps as transparentJustin Luth
commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5 set transparency before the wrap type was known (which is good in case wrap type is never defined, and the default wrap type IS through, so that fits) but transparency was never re-evaluated once the wrap type was known. In MSWord, the header is at a lower zOrder than the body, so objects that are OVER the header text are still UNDER the body text. Writer emulates this by insisting that ALL through-wrapped header objects are UNDER the header text. (This ought to only apply to objects that spill into the body text area, but that’s pretty hard to calculate, so transparency was applied to any object anchored in the header.) Change-Id: Ie3916c6b7f3fa80caf5994fd910ba4d4d89ec702 Reviewed-on: https://gerrit.libreoffice.org/33152 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-01-20Related: tdf#100813 don't crash traversing table in page 43 master has...Caolán McNamara
align master with the more conservative 5-2/5-3 reproducible problem Change-Id: Ie7a53e94c062af894bee85ea05f1acf64bcb13f1
2017-01-20loplugin:staticaccessNoel Grandin
Change-Id: Ifed67e3c34663b056529719d78aa22f2a9f1da8d
2017-01-19Preserve whitespace with tiled rendering.Jan Holesovsky
Online is often used for taking minutes, and during that, people don't have time to play with the formatting - so it is annoying when autocorrect goes in the way. Change-Id: Ia1794c46d3003198764f666951821f693d710653
2017-01-19Revert "use rtl::Reference in SwPostItField"Noel Grandin
This reverts commit f7ee0054cf9da35f210d9043a68339415aba2284. until I can figure out how to make that miserable idiot of a Visual Studio 2013 compiler happy. Change-Id: I9206df8cbba52bf8aab242a1376f4b6598d2b739 Reviewed-on: https://gerrit.libreoffice.org/33325 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19New loplugin:dynexcspec: Add @throws documentation, swStephan Bergmann
Change-Id: I2da2ce4cd247e7b9f973150917b4ee7bd7a0e0c4
2017-01-19sw: try to fix MSVC build after a754294ac7a902fe96fbbd6b8b6824a360d6b248Michael Stahl
Change-Id: I20b381fd8dda3183df2034c481939b6318e64175
2017-01-19fix windows buildNoel Grandin
Change-Id: I64d03ac9ea616a66bd556ea61e2c70f4021a07ef
2017-01-19tdf#105417 sw hyphenation: avoid infinite loop on zero-length last lineMiklos Vajna
This hang happened when the user executed Tools -> Language -> Hyphenation -> Hyphenate All. This problem is visible only if all of these conditions are met: - a line in a paragraph has a word that already contains a soft-hyphen, but not at the position where the automatic hyphenation would insert it - the last line ends with a word that can be hyphenated - there is a fly frame in the document In this case it happens during hyphenation that the layout has an additional empty line at the end (which is removed by the time the layout finishes), so we hit the case when SwTextFormatter::Hyphenate() skips the "if( m_pCurr->PrtWidth() && m_pCurr->GetLen() )" block. Normally hyphenation terminates when it iterates over the portions of the line and no overrun nor any existing hyphen portion are seen, but in this case that never happened. Fix the problem by terminating not only when we reach the end of the portion iteration, but also when the portion list is non-existing (has zero length). Change-Id: I71d4b040a2d4692ae6eb92807dbbbb42b077a0f8 Reviewed-on: https://gerrit.libreoffice.org/33303 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-19use rtl::Reference in SwXTextFieldNoel Grandin
instead of manual acquire/release Change-Id: I15d151036f17641a7ac992feb4045b9e31df4dec
2017-01-19use rtl::Reference in SwPostItFieldNoel Grandin
instead of manual acquire/release Change-Id: Id14ac4731e513ae37f922db5d1e497aee10b3b35
2017-01-19use rtl::Reference in SwDocFacNoel Grandin
instead of manual acquire/release Change-Id: I40b4f6d2893fe0d4113032f638bce1793fc47cd7
2017-01-19use rtl::Reference in SwHTMLParserNoel Grandin
instead of manual acquire/release Change-Id: Ifdc04a9659d91d62da5715b24108927d1faf9c3e
2017-01-19use rtl::Reference in SwWriter::WriteNoel Grandin
rather than manual acquire/release Change-Id: Ic82e6528be66c2f4ff1248376285808c7323edf0
2017-01-19use rtl::Reference in ReaderNoel Grandin
rather than manual acquire/release Change-Id: If839bb45beb0d3573bff475a0b09ee4347c80c3e
2017-01-19use rtl::Reference in SwHTMLWriterNoel Grandin
instead of manual acquire/release Change-Id: I76176841738688dff9df2e7dc3077be7d32387e9
2017-01-19make SfxItemSet with SAL_WARN_UNUSEDNoel Grandin
Change-Id: Ia74ca329d8438f614169031acfbe0406faf7c281 Reviewed-on: https://gerrit.libreoffice.org/33268 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19tdf#35021 TAB_OVER_MARGIN pdf support for left/center/decJustin Luth
also related to tdf#93637 which first raised the issue of pdf support for right-tabovermargin. Change-Id: Icabe2d0ac2dfe9181edde9dadfb0ab85f9ed4402 Reviewed-on: https://gerrit.libreoffice.org/33279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2017-01-18tdf#105409 Use ScopedVclPtrMaxim Monastirsky
so disposeAndClear is called. Change-Id: I40da317ac03f815c8664e8a4648870c2066f9650
2017-01-18sw: Unify char highlight handlersMaxim Monastirsky
SID_ATTR_CHAR_COLOR_BACKGROUND code was mostly a copy-paste of SID_ATTR_CHAR_COLOR_BACKGROUND_EXT. Change-Id: I713bfd72a2f51f2d0ff10b36e9e0a9150b13a640
2017-01-18Drop SwEditWin:: prefixMaxim Monastirsky
Change-Id: I86b810a6ad94255a5f2a59392ba85775a488ba12
2017-01-18sw: load BitmapEx resources instead of Image onesCaolán McNamara
Change-Id: I77b5a892478d048decc2f5a018dbaf5a11b0194d
2017-01-18tdf#99074 sw: remove duplicate property "IsBrowseMode" againMichael Stahl
Commit e0f9bb795251d950b5dd960fcd030170c8eb67aa added the property "IsBrowseMode" to SwXDocumentSettings, but it is already available in the API as SwXViewSettings property "ShowOnlineLayout". The problem is that both of these properties get exported in ODF into settings.xml, so it contains "IsBrowseMode" twice. Unfortunately the SwXViewSettings are not available in writerfilter, because the XModel::getCurrentController() is null, the view is created after the import. But there is already a way to store ViewData in the SfxBaseModel, which is then used by SfxBaseController::ConnectSfxFrame_Impl() when creating the view. This applies the property at just the right time. Change-Id: I842845d09a7b3fe81e27a1ed8ac8a8594da7f4e8
2017-01-18sw: remove duplicate "MsWordCompTrailingBlanks" view settingMichael Stahl
This is already a document setting, no point in writing it twice into settings.xml. Change-Id: Idcc99a194df321e11e091a2388b919e11fe94316
2017-01-18we only need this image once, don't need to keep itCaolán McNamara
Change-Id: I4ab3fc515bb1484d00f3a690b9fe8ae9c9dca9fe
2017-01-18tdf#102142 : Disable edit paragraph style in the print preview modeSzymon Kłos
Before that patch clicking on the Edit button in the print preview mode was causing a crash. Change-Id: Idd6ab2f16f515caa1d5fd3ed4ccdf9ae681849b5 Reviewed-on: https://gerrit.libreoffice.org/33269 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <eszkadev@gmail.com>
2017-01-18tdf#104181 related: don't throw on this documentMike Kaganski
Change-Id: I53abf3267e1a75e944de82222c6ea80a72de0e7e Reviewed-on: https://gerrit.libreoffice.org/33245 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-01-18this SfxItemSet is unusedCaolán McNamara
Change-Id: I18b587aaef066c9558933d6d557219c1bad24656
2017-01-18don't need to use the va_args versionCaolán McNamara
Change-Id: I56e4a6817edac93dee9866b9ae009f0651a29b56
2017-01-18writer, type a, return, b return, ctrl+a, del, crashCaolán McNamara
#2 0x00007ffff7429da7 in __assert_fail_base () at /lib64/libc.so.6 #3 0x00007ffff7429e52 in () at /lib64/libc.so.6 #4 0x00007ffff1ce2dc9 in SfxItemPool::GetDefaultItem(unsigned short) const (this=0x1b147a0, nWhich=nWhich@entry=10023) at /home/caolan/LibreOffice/core/svl/source/items/itempool.cxx:817 #5 0x00007ffff1ce2da5 in SfxItemPool::GetDefaultItem(unsigned short) const (this=0x1b0eb30, nWhich=nWhich@entry=10023) at /home/caolan/LibreOffice/core/svl/source/items/itempool.cxx:816 #6 0x00007ffff1ce2da5 in SfxItemPool::GetDefaultItem(unsigned short) const (this=0x1b0dbe0, nWhich=nWhich@entry=10023) at /home/caolan/LibreOffice/core/svl/source/items/itempool.cxx:816 #7 0x00007ffff1d00ba8 in SfxItemSet::MergeValues(SfxItemSet const&) (this=this@entry=0x7fffffffd4d0, rSet=SfxItemSet of pool 0x1b0dbe0 with parent 0x0 and Which ranges: [(105, 105), (10023, 10023)] = {...}) at /home/caolan/LibreOffice/core/svl/source/items/itemset.cxx:1100 #8 0x00007fffa9118372 in SwEditShell::GetPaMAttr(SwPaM*, SfxItemSet&, bool) const (this=this@entry= 0x1be06c0, pPaM=<optimized out>, rSet=SfxItemSet of pool 0x1b0dbe0 with parent 0x0 and Which ranges: [(105, 105), (10023, 10023)] = {...}, bMergeIndentValuesOfNumRule=bMergeIndentValuesOfNumRule@entry=false) at /home/caolan/LibreOffice/core/sw/source/core/edit/edattr.cxx:158 #9 0x00007fffa911846f in SwEditShell::GetCurAttr(SfxItemSet&, bool) const (this=this@entry=0x1be06c0, rSet=SfxItemSet of pool 0x1b0dbe0 with parent 0x0 and Which ranges: [(105, 105), (10023, 10023)] = {...}, bMergeIndentValuesOfNumRule=bMergeIndentValuesOfNumRule@entry=false) at /home/caolan/LibreOffice/core/sw/source/core/edit/edattr.cxx:174 #10 0x00007fffa986caa5 in SwView::StateTabWin(SfxItemSet&) (this=0x1bd4120, this@entry=<error reading variable: value has been optimized out>, rSet=SfxItemSet of pool 0x1b0dbe0 with parent 0x0 and Which ranges: [(68, 68), (10042, 10042), (10080, 10080), (10082, 10082), (10084, 10084), (10284, 10285), (10415, 10415), (10935, 10935), (10946, 10948), (10952, 10952), (10992, 10993), (11145, 11146)] = {...}, rSet@entry=<error reading variable: value has been optimized out>) at /home/caolan/LibreOffice/core/sw/source/uibase/uiview/viewtab.cxx:1596 Change-Id: I460e004e6dfa8fa6460c167c6483f2b24502b775
2017-01-18sw: roundtrip test of OOXML decryption/encryptionTomaž Vajngerl
Change-Id: Idea2a46a692aed666eb8dbc6185ae001d30757c2 Reviewed-on: https://gerrit.libreoffice.org/33228 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-01-18new loplugin: useuniqueptr: sw part 2Noel Grandin
Change-Id: Ifa901f75072d8474d8a97ca57c2b5b48d8c6b79d Reviewed-on: https://gerrit.libreoffice.org/33250 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-18tdf#35021 TabOverMargin: support LEFT tabs alsoJustin Luth
Change-Id: Ifea8c7fcde82c9d45ce1d67a829555f5499feeb0 Reviewed-on: https://gerrit.libreoffice.org/32539 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-01-18tdf#104349, tdf#104668 MS Word compatibility trailing blanks option part 2Vitaliy Anderson
Create the option in Tools->Options->LibreOffice Writer->Compatibility Change-Id: I7c766138db9210d3e7a97eea48b9265ee9762199 Reviewed-on: https://gerrit.libreoffice.org/33148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-01-18tdf#92470 docxexport: add support for XML_numRestartJustin Luth
Although import handled whether footnote numbering restarted every page, chapter(section) or document, that information was not being exported in docx. Change-Id: If9e0a1d53c8610b18b949fd918c5dd7d7bd94682 Reviewed-on: https://gerrit.libreoffice.org/33183 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2017-01-17Refactor Scheduler to add Task classJan-Marek Glogowski
Moves all the "task-specific" stuff into a Task class and just keeps the "real" static Scheduler functions in the original Scheduler class. Change-Id: I9eb02d46e2bcf1abb06af5bab1fa0ee734d1984c
2017-01-17tdf#97087 GDB pretty print the Scheduler task listJan-Marek Glogowski
In addition to the GDB pretty printer, this annotates a lot more Timers and Idles. Change-Id: I5b93fab02161b23bb753e65ef92643a04fb0789c
2017-01-17MM change listener from friend to a nested classJan-Marek Glogowski
Change-Id: I245a27e02816d3c96ca7777059b99c42cb64cca5
2017-01-17use SolarMutexGuardNoel Grandin
instead of manual acquire/release Change-Id: Ieb0a2c269b46004a80f77c51ce947b0daf015644
2017-01-17tdf#104150 DOCX import: handle <w:displayBackgroundShape/>Miklos Vajna
Regression from commit 992da0d5cf04497bad55637f6a6ebfcdaec03e16 (bnc#817956 DOCX import of document background color, 2013-05-27), <w:background> should be ignored when <w:displayBackgroundShape/> is missing from settings.xml, it turns out. This also requires generating the ooxml:CT_Settings_displayBackgroundShape token from the RTF tokenizer. Change-Id: I6d7986904cedb952998a87e7648919ae34adc360 Reviewed-on: https://gerrit.libreoffice.org/33207 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-01-17tdf#104349, tdf#104668 MS Word compatibility trailing blanks optionVitaliy Anderson
The commits: 1c1747ac13a9d895df0fcba2fbb1bd266dccd74b and 4a410dd147f7160c1d62e3e0b67388a178d5136c make trailing spaces and their highlighting compatible with the Ms Word. The option is enabled by default for imported MS Word formats: .doc, .docx, .rtf For the ODF files the option is disabled by default Also it allows saving and loading the option state to the ODF UserData. It may be manually set in Tools->Options->LibreOffice Writer->Compatibility Change-Id: I5a86359c52d18e50bbb54b9f37c79b672591c369 Reviewed-on: https://gerrit.libreoffice.org/33046 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-01-17Set exception messageStephan Bergmann
Change-Id: I79ac4500817b31988096627056434771b5b38a59
2017-01-17tdf#105212: BASIC sets Delimiter prop to integer valueStephan Bergmann
LO's BASIC doesn't have first-class support for the UNO CHAR type, often uses integer values to represent such CHAR values (cf. <https://wiki.openoffice.org/ wiki/Documentation/DevGuide/ProUNO/Basic/Mapping_of_Simple_Types>). Since 0b07406f7147b9abbb2095d9e038b13293cb8b10 "Use C++11 char16_t for sal_Unicode" (for non-Windows, since LO 5.1) resp. e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle wchar_t as native C++11 type on windows" (for Windows, since LO 5.2), C++ css::uno::Any >>=, <<=, etc. with a sal_Unicode argument no longer silently treat the argument as sal_uInt16 instead. That means that BASIC code putting an integer value into a UNO ANY that shall hold a value of CHAR type may no longer work. (Arguably, such code only ever happened to work by coincidence. For example, if the ANY were processed by Java instead of C++ code, it would never have worked.) Luckily, the use of CHAR in the UNO API is rare (for a good reason, as a single UTF-16 code unit is hardly ever the right choice to represent "a character"). The only documented place I could find using a CHAR property is Delimiter in the css.text.TextSortDescriptor and css.text.TextSortDescriptor2 services. And the only processing of such a property that I could find across the LO code base is in the file modified here, which thus just takes a one-off special effort to take care of this problem. The direction from C++ to BASIC is left as-is. The value of the Delimiter property is now reported as a CHAR value (where in the past it was---arguably erroneously---reported as an UNSIGNED SHORT value), and BASIC is generally capable of handling such CHAR values it receives well. For example, in the BASIC code attached to tdf#105212, > MsgBox("Sort: " + SortDesc(1).Name + " = " + SortDesc(1).Value) SortDesc(1).Value will now print a (space) character instead of its numeric value (32). Also, any other uses of individual CHAR values in the UNO API apart from properties appear to already be handled well enough by BASIC, as the sample code > Sub Main > tk = createunoservice("com.sun.star.awt.Toolkit") > dev = tk.createScreenCompatibleDevice(100, 100) > descs = dev.getFontDescriptors() > msgbox("Font """ + descs(1).Name + """") > font = dev.getFont(descs(1)) > n = font.getCharWidth(97) ' 'a' > msgbox("Width 'a' = " + n) > met = font.getFontMetric() > msgbox("FirstChar = '" + met.FirstChar + "', LastChar = '" + met.LastChar + "'") > met.LastChar = 122 ' 'z' > msgbox("New LastChar = '" + met.LastChar + "'") > > trans = createunoservice("com.sun.star.i18n.Transliteration") > c1 = trans.transliterateChar2Char(97) ' 'a' > c2 = trans.transliterateChar2Char(c1) > msgbox("Transliterate, '" + c1 + "' '" + c2 + "'") > End Sub demonstrates. Change-Id: I2aec1ce374c024bfac61f6c832241dfeb561addc
2017-01-17tdf#35021 TabOverMargin: support center and decimal tabs alsoJustin Luth
TabOverMargin compatibility setting allows tabs placed beyond the right margin to function where they are instead of using the right margin as a hard limit. So far this has only been effective for right tabs (the most logical tab to use at the far right. This patch adds support for center and decimal tabs also. Left tabs are trickier, so they will be attempted separately. CAVEAT: Basically all of this stuff tricks the layout engine, so the amount of text allowed on a single line is still "controlled" by the right margin. So, even though the extended line could theoretically be very long, the amount of text still must fit within the limits set by the right margin. Thus large margins may cause wrapping in LibreOffice, instead of disappearing off of the end of the paper as it does in MSWord, and editing the text might get confusing - which matches the experience in MSWord. Change-Id: I1ff638eb3576ec221247e9a9823e7e082a1cba79 Reviewed-on: https://gerrit.libreoffice.org/32534 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>