summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2014-10-14fdo#82071 RTF import: get rid of unexpected underlining in TOC fieldMiklos Vajna1-0/+5
Regression from commit 9679e9c23216decb5f9f25f85b04cb3f25211111 (fdo#69649 Fix for pre-rendered Table Of Contents, 2013-12-30), now that we handle hand-edited TOC, it's necessary to properly track correctly if a property came from a style or as a direct formatting. Fix RTFDocumentImpl::getProperties() to detect direct formatting that cames from a char style and would result in attribute tokens. Change-Id: Iab5a14770de43249961c280a5dc698200abc8f49
2014-10-13Use comphelper::SequenceAsVectorMiklos Vajna1-16/+6
Change-Id: I0af333551bdd32400b795d37de0d6240e68dd6b6
2014-10-13create a macro library for implementing bit-flags typesNoel Grandin1-1/+1
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, changed from a macro- to a template-based solution. (Unfortunately MSVC 2012 does not support explicit conversion operators. Worked around that with explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a baseline that requires unconditional support for them.) Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
2014-10-13Avoid manual realloc, use comphelper::SequenceAsVector insteadMiklos Vajna2-18/+21
Change-Id: I26c6bcf7361bbb787fcb4133d05b0a668fd72d01
2014-10-12Remove dead codeMiklos Vajna1-35/+0
Only doctok produced these tokens, so no need to handle them anymore. Change-Id: Ied7df2515ac86562dd5ce782a1f01158fe3f684e
2014-10-12Clean up now unnecessary boost::bind() magic in RTFSdrImport::initShape()Miklos Vajna1-6/+4
Change-Id: Ie373098959f8b3e04fe955a08031a4221faab3cc
2014-10-12RTF filter: fix \acc* handlingMiklos Vajna1-5/+5
The exporter didn't write circle and underdot at all. Change-Id: Ia8f45f2b03fb14e9a0027ec24ee7f36adc8c018d
2014-10-12DOCX filter: fix <w:em> handlingMiklos Vajna1-4/+4
The real news here is that "comma" and "dot" was swapped on export, the rest is just a fixup of recent breakage. Change-Id: I54045f5837652dc38a30361e21ced25aeaf58257
2014-10-12Typo: compatability->compatibilityJulien Nabet1-1/+1
Change-Id: If0b98a30452a9d1fcc340173deb6856755926471
2014-10-11error C2677: binary '*' : no global operator foundMiklos Vajna1-1/+1
Change-Id: I13899545421fa710a590cde042e142cdb3293c7c
2014-10-11writerfilter: drop support for simple list types without constantsMiklos Vajna1-5/+2
In other words, from now it's a must to map ST_Foo simple types to NS_ooxml::LN_something constants, and raw integers (which are hard to grep and hard to track down where are they used) are no longer an option. Change-Id: I968b27bca3f64f6f4a382b87e2dbc499a3132ea2
2014-10-10indentation fixesMiklos Vajna2-6/+6
Change-Id: I56664b455383f69137399e4c5fb28521ef813287
2014-10-10fdo#84679 RTF import: fix paragraph spacing handling in tablesMiklos Vajna1-4/+5
Regression from commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), we failed to do the proper deduplication in buffered content, like tables. Fix this by adapting RTFDocumentImpl::replayBuffer() to RTFDocumentImpl::checkNeedPap(), which already did the proper deduplication. To be fair, the inconsistency was there earlier since 9f5263c477b82fef5aa9c3e79fb6af92aa049e24 (fdo#44736 RTF import: ignore direct formatting which equals to style, 2012-11-25), but it caused no real harm earlier. Change-Id: I0673408088d9d83768f0780ea92ece87913d03f3
2014-10-10DOCX import: map <wp:effectExtent>Miklos Vajna1-7/+34
Change-Id: Ibdfdca37009df3f518133e85d1daef3a4fea9073
2014-10-10writerfilter: tokenize <wp:effectExtent> attributesMiklos Vajna1-0/+4
Change-Id: Ie4f4182e92dfd06b283dc86f5bfd611d7842a504
2014-10-10cid#1244941 Invalid iterator comparisonNoel Grandin1-4/+10
this is just a false+, but creating a local var will likely fix it Change-Id: Ia02e04098a70102c70f5fe5ecd156eea6f40d2af
2014-10-10Use constants for ST_StyleType valuesMiklos Vajna3-12/+13
Change-Id: I57ca4ef567126321ab745c8d1d7290b66df23c05
2014-10-09fdo#81356: convert Fraction to boost::rational<long> - wipJuan Picca2-11/+11
* Added rational util functions used by Fraction class not available in the boost::rational class. * Replaced usage of Fraction by boost::rational<long> * Removed code that relies on: 1. fraction.IsValid() -- rational only allow valid values, ie denominator() != 0 2. rational.denominator() == 0 -- always false 3. rational.denominator() < 0 -- always false but implementation detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation * Simplified code that relies on: 1. rational.denominator() != 0 -- always true * BUGS EXIST because Fraction allows the creation of invalid values but boost::rational throws the exception boost::bad_rational Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9 Reviewed-on: https://gerrit.libreoffice.org/11551 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09Use constants for ST_TblStyleOverrideType valuesMiklos Vajna2-16/+55
Change-Id: I61a81bf1aab604d27441630dfb5d55f657211410
2014-10-08Use constants for ST_PresetColorVal valuesMiklos Vajna1-140/+140
Again no need to adapt dmapper/rtftok for these, see commit 020f46d17065b8b00365eab7a809ce980ebfb59a (Use constants for ST_Em values, 2014-10-07). Change-Id: Ie67f7a4d251525b5f8799cf613bea56ad82f7a57
2014-10-08spelling: instanciated -> instantiatedNoel Grandin1-1/+1
Change-Id: I99f3010e30f81786b938dc11736ea1597cd5530d
2014-10-08Use constants for ST_CombineBrackets valuesMiklos Vajna3-12/+31
Change-Id: I307d7833fb5556c5509edd698b4b5ecd7b7a5fb3
2014-10-07kde#52609 RTF import: fix memory leakMiklos Vajna1-0/+16
This is similar to f7ef84640258e4ee6ddc4cc5cbf58a2d89860afa (abi#2128 RTF import: fix memory leak, 2013-11-28). Change-Id: Id57320466e6fb302ec8616ccc9f4f9429b8eff21
2014-10-07DOCX import: handle section break right after a ToC fieldMiklos Vajna2-0/+36
The symptom was that during the handling of the XE field, we tried to access the top of the text append stack, but the stack was empty. The situation is the following: 1) There is a multi-page TOC field. 2) The page break inside the field is described using a section break, featuring headers, and the header contains a field that we map to a fieldmark. 3) There is an XE field after all this. The root cause was that during parsing of the header, some of the state should be stashed away and restored when we're done. The new HeaderFooterContext does exactly this, and now the number of push/pop calls on the text append context match again. Change-Id: I10f259fd9edb8bd719ae5bc8a43ed5ef8c708071
2014-10-07fix nullptr/boost compile errorBjoern Michaelsen1-1/+3
error: no match for ternary ‘operator?:’ in ‘((writerfilter::dmapper::DomainMapper_Impl*)this)->writerfilter::dmapper::DomainMapper_Impl::m_aFieldStack.std::stack<_Tp, _Sequence>::empty<boost::shared_ptr<writerfilter::dmapper::FieldContext>, std::deque<boost::shared_ptr<writerfilter::dmapper::FieldContext>, std::allocator<boost::shared_ptr<writerfilter::dmapper::FieldContext> > > >() ? nullptr : ((writerfilter::dmapper::DomainMapper_Impl*)this)->writerfilter::dmapper::DomainMapper_Impl::m_aFieldStack.std::stack<_Tp, _Sequence>::top<boost::shared_ptr<writerfilter::dmapper::FieldContext>, std::deque<boost::shared_ptr<writerfilter::dmapper::FieldContext>, std::allocator<boost::shared_ptr<writerfilter::dmapper::FieldContext> > > >()’ Change-Id: I76c7507390bcf80f6ca722c4eedfd65c9a46952f
2014-10-07coverity#735573 Logically dead codeCaolán McNamara1-1/+1
Change-Id: I4635e974b7812ed5fbc95bd65b7108bb99235661
2014-10-07-Werror=sign-compareMiklos Vajna7-14/+14
Change-Id: Ic96b85c5c4995f47781eceb6a426a29d8b7679ea
2014-10-07Use constants for ST_Em valuesMiklos Vajna1-5/+5
No need to adapt dmapper/rtftok for this one, as those do not handle <w:em> ATM. Change-Id: I88da1d0dae804e3d054b7d4158a81cb64cc4b600
2014-10-06encrypt sf_508f4e1..rtf to avoid it triggering virus detectionCaolán McNamara2-0/+0
use name CVE-pseudo-2009-0238-1.rtf to record its detected as Virus:Trojan.Mdropper and pseudo because its just a fuzzed file from some random .rtf and not an original reproducer for CVE-2009-0238 Change-Id: I85f6a72e0d32c14ea27cbe03bc4da3c2306fd1f5
2014-10-06Use constants for ST_Shd valuesMiklos Vajna3-235/+180
Change-Id: If8fbccf946f589abead0803b7ecbc63ecfc656b2
2014-10-05Use constants for ST_Border valuesMiklos Vajna4-400/+601
Change-Id: Ie0f83fd7111942912b0abd61473e654cc2f02360
2014-10-04Use constants for ST_TabTlc valuesMiklos Vajna3-15/+15
Change-Id: Idd277a770a42d33a9c92f41f0452039eba60b6ce
2014-10-03WaE: implicit conversion of NULL constant to 'boost::detail::sp_nullptr_t'Tor Lillqvist1-2/+2
Change-Id: Id0f3345613ae3b9c19cc5f5845140fa1c067bee0
2014-10-03DOCX import: improve table style handling wrt. cell bordersMiklos Vajna1-0/+42
The symptom was that some cell borders were missing. It's because in Word, cell borders are additions to table borders, so if a table border is single, but the cell border is none, then the outcome should be single, not none. In Writer, this is a single UNO property, so if it's set to SOLID then to NONE, the latter wins. There are two situations where we now do the right thing: 1) style-cell-border is set, direct-cell-border is none -> outcome is now inheriting (style-table-border, direct-table-border, etc.) 2) style-cell-border is none, direct-cell-border is none, but direct-table-border is set -> outcome is now direct-table-border. Change-Id: I320ae908c61221c8020e3b5323c31dec11c15b2f
2014-10-03handle scope of w:pPrChange and w:rPrChange properly (bnc#821804)Luboš Luňák5-89/+103
Redlines changing formatting of runs and paragraphs are valid for the entire run/paragraph, not just their existence in the XML. So store them in the matching contexts, which will care of it, instead of the endtrackchange stuff. Change-Id: Ie583e4be14e8df95829852bfbbbe25aa0684f02e
2014-10-03proper scoping for docx redline import (bnc#821804)Luboš Luňák1-4/+5
propagateCharacterPropertiesAsSet sends the properties only when ending a text run (or maybe starting another one, I'm not quite sure), so it breaks ordering by sending them later then expected (although it worked in many cases). It's a question if propagateCharacterPropertiesAsSet is to be used by anything actually, since it seems rather broken to use it in the ooxml frontend. Using sendPropertiesWithId sends the properties properly at the right time, as one would expect. I don't know why dmapper can't simply handle this on its own, as I think it does handle entering and leaving other elements, but spending more time on it with this overdesigned abomination, oh well. Change-Id: Ie36c5f933ea3e6d789ea8f9e4ee3b60a5d1c920c
2014-10-03Use constants for ST_SectionMark valuesMiklos Vajna4-20/+19
Change-Id: I3ac385b8f21409b5083b1224652283fec8bb2fa4
2014-10-02writerfilter: that fallback appears necessary after all...Michael Stahl1-3/+6
Change-Id: Id4bc638c81d695745fc44bde16252e3040f0a03c
2014-10-02DOCX import: handle <w:tcPr> directly under <w:style>Miklos Vajna1-0/+3
Change-Id: I10dfb947bbd9e792c98932608acb2f0987fd8605
2014-10-02do not use number-of-enum-items as an enum item itselfLuboš Luňák1-2/+2
Because that breaks warning about all cases (not) being handled in switch. Change-Id: I8fadccd4e5d125cc37b8e10087e9170f07e65440
2014-10-02coverity#735574 'Constant' variable guards dead codeCaolán McNamara1-1/+1
Change-Id: Ifcb8078e3e52c1b3634ab1c6ad6d6121502950d9
2014-10-02coverity#735572 'Constant' variable guards dead codeCaolán McNamara1-1/+1
Change-Id: I07e350a87ee58ba1dd032f2e5cffc8a05ebce029
2014-10-02coverity#735571 'Constant' variable guards dead codeCaolán McNamara1-1/+1
Change-Id: Idd3654f45a9fe9c0a92aa88b494cdd9192baa966
2014-10-02Use constants for ST_PageOrientation valuesMiklos Vajna3-5/+8
Change-Id: Icbce660a7f6678ae6c48ec03d8fc63c67f169072
2014-10-01writerfilter: std::auto_ptr -> std::unique_ptrStephan Bergmann1-6/+2
Change-Id: I57f010076f73758bd5bdcf78b58553baa257df08
2014-10-01fdo#84536 RTF import: don't try to rotate TextFramesMiklos Vajna1-1/+4
Regression from 818d80eb0cee65d1bcc4fdb74b32a7c42cc1336e (RTF import: support shapes inside tables, 2013-06-28). Change-Id: I05eb2f4f2e3467e35f96b280e3a79f69906a56de
2014-10-01-Werror,-Wunused-private-fieldNoel Grandin2-2/+0
Change-Id: I6516c004f75e416f016042aa561a20642db70b57
2014-10-01Unused writerfilter::dmapper::StyleSheetPropertyMap::mnCT_TcPrBase_vAlignMiklos Vajna2-10/+0
Change-Id: I64a7c56da33d3d093fc63168671b157c44847b72
2014-10-01Use constants for ST_LineNumberRestart valuesMiklos Vajna5-8/+7
Change-Id: I9fe7909bb8f6174ac05edb340a7d5606f077679d
2014-09-30Use constants for ST_VerticalJc valuesMiklos Vajna3-14/+14
Change-Id: Ib7d2ecfa2c5bcbda55859144af6b55bc8ef09c3d