summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2014-10-09fdo#81356: convert Fraction to boost::rational<long> - wipJuan Picca
* 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 Vajna
Change-Id: I61a81bf1aab604d27441630dfb5d55f657211410
2014-10-08Use constants for ST_PresetColorVal valuesMiklos Vajna
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 Grandin
Change-Id: I99f3010e30f81786b938dc11736ea1597cd5530d
2014-10-08Use constants for ST_CombineBrackets valuesMiklos Vajna
Change-Id: I307d7833fb5556c5509edd698b4b5ecd7b7a5fb3
2014-10-07kde#52609 RTF import: fix memory leakMiklos Vajna
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 Vajna
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 Michaelsen
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 McNamara
Change-Id: I4635e974b7812ed5fbc95bd65b7108bb99235661
2014-10-07-Werror=sign-compareMiklos Vajna
Change-Id: Ic96b85c5c4995f47781eceb6a426a29d8b7679ea
2014-10-07Use constants for ST_Em valuesMiklos Vajna
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 McNamara
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 Vajna
Change-Id: If8fbccf946f589abead0803b7ecbc63ecfc656b2
2014-10-05Use constants for ST_Border valuesMiklos Vajna
Change-Id: Ie0f83fd7111942912b0abd61473e654cc2f02360
2014-10-04Use constants for ST_TabTlc valuesMiklos Vajna
Change-Id: Idd277a770a42d33a9c92f41f0452039eba60b6ce
2014-10-03WaE: implicit conversion of NULL constant to 'boost::detail::sp_nullptr_t'Tor Lillqvist
Change-Id: Id0f3345613ae3b9c19cc5f5845140fa1c067bee0
2014-10-03DOCX import: improve table style handling wrt. cell bordersMiklos Vajna
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ňák
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ňák
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 Vajna
Change-Id: I3ac385b8f21409b5083b1224652283fec8bb2fa4
2014-10-02writerfilter: that fallback appears necessary after all...Michael Stahl
Change-Id: Id4bc638c81d695745fc44bde16252e3040f0a03c
2014-10-02DOCX import: handle <w:tcPr> directly under <w:style>Miklos Vajna
Change-Id: I10dfb947bbd9e792c98932608acb2f0987fd8605
2014-10-02do not use number-of-enum-items as an enum item itselfLuboš Luňák
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 McNamara
Change-Id: Ifcb8078e3e52c1b3634ab1c6ad6d6121502950d9
2014-10-02coverity#735572 'Constant' variable guards dead codeCaolán McNamara
Change-Id: I07e350a87ee58ba1dd032f2e5cffc8a05ebce029
2014-10-02coverity#735571 'Constant' variable guards dead codeCaolán McNamara
Change-Id: Idd3654f45a9fe9c0a92aa88b494cdd9192baa966
2014-10-02Use constants for ST_PageOrientation valuesMiklos Vajna
Change-Id: Icbce660a7f6678ae6c48ec03d8fc63c67f169072
2014-10-01writerfilter: std::auto_ptr -> std::unique_ptrStephan Bergmann
Change-Id: I57f010076f73758bd5bdcf78b58553baa257df08
2014-10-01fdo#84536 RTF import: don't try to rotate TextFramesMiklos Vajna
Regression from 818d80eb0cee65d1bcc4fdb74b32a7c42cc1336e (RTF import: support shapes inside tables, 2013-06-28). Change-Id: I05eb2f4f2e3467e35f96b280e3a79f69906a56de
2014-10-01-Werror,-Wunused-private-fieldNoel Grandin
Change-Id: I6516c004f75e416f016042aa561a20642db70b57
2014-10-01Unused writerfilter::dmapper::StyleSheetPropertyMap::mnCT_TcPrBase_vAlignMiklos Vajna
Change-Id: I64a7c56da33d3d093fc63168671b157c44847b72
2014-10-01Use constants for ST_LineNumberRestart valuesMiklos Vajna
Change-Id: I9fe7909bb8f6174ac05edb340a7d5606f077679d
2014-09-30Use constants for ST_VerticalJc valuesMiklos Vajna
Change-Id: Ib7d2ecfa2c5bcbda55859144af6b55bc8ef09c3d
2014-09-29Use constants for ST_TabJc valuesMiklos Vajna
Change-Id: Idfb554f2ee77e0315b3ed69c4fae8ad4e8e87b3f
2014-09-28Resolves: fdo#73608 bail out on loop in style sheet hierarchyCaolán McNamara
Change-Id: I03975d1ce8eaceceb4d5c263eb11c1521bcd57eb
2014-09-28Related: fdo#73608 don't crash on missing table stylesCaolán McNamara
Change-Id: I340b43b7afc4c5c4d6dc8e4ed182279240306540
2014-09-28Use constants for ST_TextDirection valuesMiklos Vajna
Change-Id: I2c6576f8142a8fe3808a156f2047fe425f769cd9
2014-09-28WaE: implicit conversion of NULL constant to 'boost::detail::sp_nullptr_t'Tor Lillqvist
Change-Id: Icaf39aaedab9663353268ee56063f2ed0ebbe57d
2014-09-27DomainMapperTableManager::sprm: fix typoMiklos Vajna
Change-Id: I1cb23d8a1e6568046348377e1852dbadff37f9cc
2014-09-27Resolves: fdo#79130 Crash in DomainMapper_Impl::CloseFieldCommandCaolán McNamara
Change-Id: Ia59e0c79ec7f2066891b78657559f41eaeb80a09
2014-09-26DOCX drawingML import: fix remaining rotation / flip combinationsMiklos Vajna
With this, each rotation = 0 / 90 / 180 / 270 and flip = none / horizontal / vertical / horizontal+vertical combination (16 cases) are imported perfectly. Also adjust a few testcases -- now that in many cases we only set the position in oox, some rounding errors went away. Change-Id: I5567a7d6964775f2caf10a0e539f3eb84d10461e
2014-09-26DOCX drawingML import: fix handling of rotation in case of horizontal flipMiklos Vajna
Change-Id: I95f74c3d3222a4d713c8d71bcd3263ecb16dba54
2014-09-25fdo#83465 RTF import: handle font of numberingMiklos Vajna
Change-Id: If0da6e0e34ce50bbe7dceda089b6bb81b4a63f36
2014-09-25DOCX drawingML filter: avoid fake rotation on vertical flipMiklos Vajna
This also improves positioning a bit, in the changed testcase the perfect position would be 211.663888889, and reality is now 210 instead of 208 (100th millimeters). Change-Id: I5226f2165224a8bbfebfd11d9c612f72d83b8c69
2014-09-25fdo#83465 writerfilter: import font of numberingMiklos Vajna
Change-Id: I0afe389fa6ea8b4c701232c6ecb425d5fdcde5fe
2014-09-24DOCX import: make sure rotation does not affect shape positionMiklos Vajna
Change-Id: I7916a24d63bb7c995267059e9bedbf1f08adc152
2014-09-24add missing breakLuboš Luňák
Should have been included in 3891ba42a886fa85eb43da24d1badf44e765d54c. Change-Id: I22e5ba931a58c83efdbf996ce701c52dcf0bf9c5
2014-09-24Unused writerfilter::dmapper::ConversionHelper::MakeBorderLine() variantMiklos Vajna
Change-Id: Idbf7f6b8a1ec395c229e2ff6c173b8b0a6262977
2014-09-23DOCX filter: roundtrip SDT properties on Frame TextPortionsMiklos Vajna
Change-Id: Icb3dc9595a025c4386577d858c8ca96e2f9bbef7
2014-09-22Related: fdo#37691 \shptxt ... \jpegblipCaolán McNamara
text shape with jpeg data, should we throw away the text shape here or keep it ? Change-Id: I9e4463b5863bf68cdcd18ea5d1f6c831a0de8ec9