summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapperTableManager.cxx
AgeCommit message (Collapse)AuthorFilesLines
2019-03-09loplugin:singlevalfieldsNoel Grandin1-4/+0
Change-Id: I7f9ff0fc58adf51eae7fef5ce925b91b8d1f4922 Reviewed-on: https://gerrit.libreoffice.org/68940 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05re-land "new loplugin typedefparam""Noel Grandin1-3/+3
This reverts commit c9bb48386bad7d2a40e6958883328145ae439cad, and adds a bunch more fixes. Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a Reviewed-on: https://gerrit.libreoffice.org/68680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-04Revert "new loplugin typedefparam"Noel Grandin1-3/+3
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 Grandin1-3/+3
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-02-15sw btlr writing mode: implement DOCX filterMiklos Vajna1-14/+1
Replace the old trick with character-level rotation with the usage of the new writing direction. This means that finally table cells with btlr text direction and multiple paragraphs show all content, not only the first paragraph, as before (seen as data loss by users). Change-Id: I094f36fa6ba0701579e487e8e0212707987b1b2f Reviewed-on: https://gerrit.libreoffice.org/67870 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-11loplugin:indentation in writerfilter..xmloffNoel Grandin1-11/+11
Change-Id: Ibda157508e92ab5fb222daf79a38941c30a8057e Reviewed-on: https://gerrit.libreoffice.org/67611 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-08convert "*xxx.get()" to "*xxx"Noel Grandin1-4/+4
Change-Id: Ic307226591ff9702957ccdec486ccf70357eb6d9 Reviewed-on: https://gerrit.libreoffice.org/65951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-01tdf#58944: comment DOCX table header row limit betterLászló Németh1-10/+10
Change-Id: I725dce3754d5234c4f1398ef5392e72e0249d70f Reviewed-on: https://gerrit.libreoffice.org/64388 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2018-11-10Replace deprecated boost::optional::reset(val) with operator =Mike Kaganski1-2/+2
Change-Id: I7340a561e0df0c781fd834388deb4b9f83800f9b Reviewed-on: https://gerrit.libreoffice.org/63221 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin1-2/+2
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-08tdf#58944 DOCX import: workaround for hidden table headersLászló Németh1-2/+20
Repeating table headers consisted of more than 10 table rows switch off table header repetition during DOCX table import to fix non-visible table content and broken tables. Repeating header lines are not visible in MSO, if there is no space for them. OOXML (and ODF) standards don't specify this exception, and unfortunately, it's easy to create tables with invisible repeating headers in MSO, resulting OOXML files with non-standardized layout. To show the same or a similar layout in LibreOffice (instead of a broken table with invisible content), we use a reasonable 10-row limit to apply header repetition, as a workaround. Later it's still possible to switch on header repetition or create a better compatible repeating table header in Writer for (pretty unlikely) tables with really repeating headers consisted of more than 10 table rows. Note: This workaround could help to create standard and more portable OOXML files in a mixed environment. Change-Id: I17fbc0173ec1c4f188a46227b99dde5726530da3 Reviewed-on: https://gerrit.libreoffice.org/60689 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-09-29Simplify containers iterations in w*Arkadiy Illarionov1-16/+7
Use range-based loop or replace with STL functions. Change-Id: Ie1e169f9d2d44e188180164bd1f93af43740425d Reviewed-on: https://gerrit.libreoffice.org/61141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-20tdf#64264 DOCX import: fix row count of repeating table headerLászló Németh1-1/+1
by ignoring isolated tblHeader settings, according to the standard. (OOXML 17.4.49 tblHeader (Repeat Table Row on Every New Page) "...if this row [with tblHeader property] is not contiguously connected with the first row of the table (that is, if this table row is not either the first row, or all rows between this row and the first row are not marked as header rows) then this property shall be ignored.") Note: with this fix, in a mixed environment, LibreOffice is able to fix the known problems of MS Word 2013/2016 by removing the isolated tblHeaders during DOCX import/export (such problems in MSO: missing repeating headers in a few pages or in the whole table, despite the correct settings; and non-modifiable repeat header row property in the table settings). Change-Id: I73e8394a75b77c937a4bac37d99ff747ad95a06e Reviewed-on: https://gerrit.libreoffice.org/60765 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-09-11ofz#10228 Integer-overflowCaolán McNamara1-2/+2
Change-Id: Ifb7e6ad6f5ffe71c3c5bb7cca9cb3b27bff7943a Reviewed-on: https://gerrit.libreoffice.org/60308 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-06ofz#10228 Integer-overflowCaolán McNamara1-1/+2
Change-Id: I09cb2e8f4af7d34c32accf2590695799d0613d62 Reviewed-on: https://gerrit.libreoffice.org/60070 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-23loplugin:unusedfieldsNoel Grandin1-1/+0
Change-Id: I1827262ad95942cacff589929f9436f8383cf142 Reviewed-on: https://gerrit.libreoffice.org/57642 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-12Add missing sal/log.hxx headersGabor Kelemen1-0/+1
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories w* x* Change-Id: I27bff44da3d34d24262031c7489e755311599bc5 Reviewed-on: https://gerrit.libreoffice.org/57307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-10tdf#79877 perf loading docx file, writerfilter/ improvementsNoel Grandin1-4/+4
this improves load time by 20%. We switch from shared_ptr to tools::SvRef to manage the objects I noticed some double inheritance like this: DomainMapper LoggedProperties Properties SvRefBase LoggedTable Table SvRefBase so to be safe I made all the ref-count-base-class inheritance virtual. Change-Id: Ia3de9733f5c6966e8171f43d083dcc087040b8cd Reviewed-on: https://gerrit.libreoffice.org/57022 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-12forcepoint #24 back() on empty vectorCaolán McNamara1-0/+7
Thanks to Antti Levomäki and Christian Jalio from Forcepoint. Change-Id: Idb6723b53a1ae8aaca80847bfe643bc4abaedd21 Reviewed-on: https://gerrit.libreoffice.org/51121 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-26forcepoint #10 pop empty stackCaolán McNamara1-0/+6
Change-Id: I96452a86187a6b03251614625445d1b18a5ee218 Reviewed-on: https://gerrit.libreoffice.org/50357 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-12More loplugin:cstylecast: writerfilterStephan Bergmann1-7/+7
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: I94d069b3605b45de958c3541ff93d3ae70955ea3
2017-12-31loplugin:passstuffbyref improved return in emfio,writerfilterNoel Grandin1-3/+3
Change-Id: I237936d62d0f1b17574dd88b5c9de932dc03238e Reviewed-on: https://gerrit.libreoffice.org/47214 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-27loplugin:unnecessaryparen check for (f1()).f2Noel Grandin1-1/+1
Change-Id: I93257b0ddd41c649875124d6d5c5faeaa431bae3 Reviewed-on: https://gerrit.libreoffice.org/45218 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-05writerfilter: consistently use "" and <> in include directivesMike Kaganski1-8/+8
[cpp.include] tells that includes in <> are searched in implementation-defined places; includes in "" are searched in other implementation-defined places, and is unsuccessful, then as if they were in <>. MS VisualStudio IDE uses paths configured for the project for includes in <>, and starts with current file paths for includes in "". So, using <> for includes in current source file's directory missing from configured project paths makes IDE show unsuccessful includes and unknown identifiers. This fixes includes in writerfilter source directory. Change-Id: I0bc1147aa68c305afd0c119418f07b655783a466 Reviewed-on: https://gerrit.libreoffice.org/43138 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-07-31loplugin:constparams in writerfilterNoel Grandin1-1/+1
Change-Id: Ic0455f0a61825ec649ecbb78244f78a20df2787a Reviewed-on: https://gerrit.libreoffice.org/40595 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-25DomainMapperTableManager::sprm: use std::findMike Kaganski1-10/+1
Change-Id: Iaad2fe950372ecd5261d83554015dc771b3abbf8 Reviewed-on: https://gerrit.libreoffice.org/40403 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-06-30loplugin:unusedfields in toolkit..xmloffNoel Grandin1-3/+1
Change-Id: I4964ff97e0a1735dc08c6ad204cae0b08e9ffc2c Reviewed-on: https://gerrit.libreoffice.org/39406 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30teach redundantcast plugin about functional castsNoel Grandin1-3/+3
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0 Reviewed-on: https://gerrit.libreoffice.org/37910 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-27writerfilter: SvxFrameDirectionItem::PutValue() wants an UNO shortMiklos Vajna1-1/+1
And not an UNO com.sun.star.text.WritingMode. This fixes the following warnings during DOCX import: warn:legacy.osl:12884:1:writerfilter/source/dmapper/PropertyMap.cxx:1484: Exception in SectionPropertyMap::ApplyProperties_ warn:legacy.osl:12884:1:writerfilter/source/dmapper/PropertyMap.cxx:1496: Exception in SectionPropertyMap::ApplyProperties_ Change-Id: Ib4f392b3e4328311baa5767b5a2079730218fca3 Reviewed-on: https://gerrit.libreoffice.org/37028 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-02-28new loplugin unoanyNoel Grandin1-7/+7
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89 Reviewed-on: https://gerrit.libreoffice.org/34714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-02tdf#104876 writerfilter: m_bTableSizeTypeInserted = false hereJustin Luth1-1/+3
fixes commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d which removed the insertion code with the explanation saying we should simply not do anything, and that'll lead to the right behavior, don't try to be smart and try to set TABLE_WIDTH here but still left the flag set, falsely indicating that the tableSizeType had been inserted. Change-Id: I0720083c992d1d03a5fe259d5b4b177a0c8108f8 TODO: the table size still isn't correct. Reviewed-on: https://gerrit.libreoffice.org/32385 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-06-27loplugin:singlevalfields in writerfilter and xmlsecNoel Grandin1-3/+0
Change-Id: I51305ce4a6929b36f41eb7c7c83606ca8c5c89b8 Reviewed-on: https://gerrit.libreoffice.org/26691 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-13clang-tidy modernize-loop-convert in writerfilter to xmlsecurityNoel Grandin1-2/+2
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3 Reviewed-on: https://gerrit.libreoffice.org/24923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann1-2/+2
Change-Id: I5f38167cc2fd0104ad388c63f766bda6acae96e2
2015-12-09tdf#95755: Don't discard table properties in endOfRowAction()Mike Kaganski1-14/+12
In the beginning of endOfRowAction(), the current value of m_aTmpTableProperties.back( ) is stored in a temporary variable. Then, the width of table may be put into m_aTmpTableProperties.back( ). In the end, this temp variable is assigned to TableManager::mState.mTableProps and the m_aTmpTableProperties.back( ) is reset. In the middle, the m_aTmpTableProperties.back( ) may be replaced in endLevel()/startLevel() sequence (if new table is started). In that case, the width calculations go to a different object than stored in temp var. Consequently, that value will be discarded and replaced with initial stored in temp var. Fixed that by directly operating with temp var instead of m_aTmpTableProperties.back( ). Also, the value of m_nCell was not kept over endLevel()/startLevel() sequence and that prevented from calculating width. Fixed that. Also, removed leftovers from commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d. Change-Id: If85dbb715e7c60f60043f9d60d6a3c3d02277add Reviewed-on: https://gerrit.libreoffice.org/20052 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-07-28writerfilter: use std::unique_ptr<> in DomainMapperTableManagerMiklos Vajna1-2/+0
Change-Id: Ib5910d3198824d625a96b53a30ad67c69c622642
2015-05-29loplugin:loopvartoosmallNoel Grandin1-4/+4
Change-Id: I5518e40a30bdad53470cc52b59eff04ab6d873d4
2015-05-19TagLogger can be staticNoel Grandin1-35/+30
since we only ever instantiate one of them Change-Id: I48b3b976b4f33044c4bf6542ac5cce58f26e6244 Reviewed-on: https://gerrit.libreoffice.org/15759 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-18writerfilter: clean up remaining doctok bits in DomainMapperTableManagerMiklos Vajna1-90/+5
Change-Id: Ibbd0404c88a4086b9583a430e8c6fa4d0bc558eb Reviewed-on: https://gerrit.libreoffice.org/15377 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2015-04-15writerfilter: TDefTableHandler's bOOXML was always trueMiklos Vajna1-1/+1
Change-Id: I9efcb32f742aa7a0549ceb246a1b75fa3af662be
2015-04-15writerfilter: TablePropertiesHandler's bOOXML was always trueMiklos Vajna1-1/+1
Change-Id: I8b1e05c6f685ea32a3c29a4636be4bc4894d7de0
2014-12-30writerfilter: boost::shared_ptr -> c++11 std::shared_ptrMiklos Vajna1-3/+3
Change-Id: Ib5649d8979093bb147c61eebcf95a472ad899672
2014-12-22writerfilter: fold single remaining header of resourcemodel into dmapperMiklos Vajna1-1/+0
Change-Id: I54cc8ebda18c8ca7071c39210687f28adbc4790a
2014-12-13writerfilter: only dmapper needs DomainMapper.hxxMiklos Vajna1-1/+1
Change-Id: I9508938754cf353ecc210eb13d7063ac7ef437bf
2014-12-02DomainMapperTableManager::m_bOOXML was always trueMiklos Vajna1-5/+4
Change-Id: Icfbd0d779fac949484b37ee861e083a449b225c2
2014-11-30Avoid having TableManager as a template classMiklos Vajna1-4/+4
It was always used with T=css::uno::Reference<css::text::XTextRange> Change-Id: If79413cf68ad5d5f6fc7aba1c065f49e5781d71d
2014-11-28DOCX import: ignore <w:tblpPr> in shape textMiklos Vajna1-1/+8
Floating tables are kind of anchored objects, which are not supported in shape text by Word, so we should ignore their flotation on import as well. Note that there is no need for a setIsInShape(false) in PopShapeContext() as we pop the whole table manager from the stack anyway. Change-Id: Ie9e88d2c83c0c34a01922e6e89f69f6089585b4b
2014-11-14fdo#86023 - O[U]String needs a 'clear' methodBrij Mohan Lal Srivastava1-1/+1
Added clear() method to OString and OUString class, Updated appropriate call-sites. Change-Id: I0ba97fa6dc7af3e31b605953089a4e8e9c3e61ac Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-11-07writerfilter: handle ooxml:CT_TblPrBase_bidiVisualMiklos Vajna1-0/+7
Change-Id: I619a6b161e5ed7e902406b288552b06fe7da487e
2014-11-07DOCX import: fix rounding error in table cell widthsMiklos Vajna1-2/+2
Change-Id: I733fd4b998ba4d0bde2f91f2b3d76205f0dc8020