![Page 1: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/1.jpg)
A year in LibreOffice’sRTF supportBy Miklos Vajna
Senior Software Engineer at Collabora Productivity
2016-09-08
@CollaboraOffice www.CollaboraOffice.com
![Page 2: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/2.jpg)
2 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
About Miklos
● From Hungary● More blurb: http://vmiklos.hu/
● Google Summer of Code 2010/2011● Rewrite of the Writer RTF import/export
● Writer developer since Feb 2012● Contractor at Collabora since Sept 2013
![Page 3: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/3.jpg)
Writer RTFfilter maintenance
![Page 4: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/4.jpg)
4 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
New features #1
● Maintenance is mostly about bug-fixing, but…
● User-defined properties:● Both RTF import and
export
![Page 5: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/5.jpg)
5 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
New features #2
● Classification support: copy&paste
● Provide the info on export
● Parse and limit on import
![Page 6: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/6.jpg)
6 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #1
● tdf#92521 RTF export: handle section break right after a tableOriginal
Before / bad
After / good
![Page 7: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/7.jpg)
7 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #2
● tdf#94043 RTF filter: implement column separator handling
Original
Before / bad
After / good
![Page 8: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/8.jpg)
8 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #3
● tdf#94377 RTF export: support comment formatting
Original Before / bad After / good
![Page 9: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/9.jpg)
9 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #4
● tdf#61511 RTF export: handle page background solid color fill
Original Before / bad After / good
![Page 10: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/10.jpg)
10 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #5
● tdf#59699 RTF import: handle INCLUDEPICTURE field
Before / bad After / good
![Page 11: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/11.jpg)
11 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #6
● tdf#65642 RTF filter: import \pgnrestart and \pgnucltr + \pgnlcltr + \pgnucrm + \pgnlcrm + \pgndec
Before / bad
After / good
![Page 12: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/12.jpg)
12 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #7
● tdf#90097 RTF import: handle fRelFlipV property for line shapes
Original Before / bad After / good
![Page 13: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/13.jpg)
13 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #8
● tdf#91684 RTF import: fix scaling of group shape children
Original Before / bad Fixed scaling
![Page 14: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/14.jpg)
14 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #9
● tdf#91684 RTF import: handle fFlipH and fFlipV shape props
Original Fixed scaling
After / good
![Page 15: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/15.jpg)
15 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Bugfixes #10
● tdf#100507 RTF import: don't set default para style to the 0th character style
Original Before / bad After / good
![Page 16: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/16.jpg)
Technical details
![Page 17: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/17.jpg)
17 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Show me the code!
● Code is mostly at:● sw/source/filter/{rtf,ww8/rtf*} – export● writerfilter/source/rtftok/ – import
● 69 commits:● 31 bugfixes● 38 new feature / refactor
![Page 18: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/18.jpg)
18 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Testing
● 37 new tests● No single bugfix without a matching unit
test in the last year!● 0 regressions in the bugzilla:
● RTF in the summary, keywords: regression● And no resolution
● Sample one-liner regression test:
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6618), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin"));
![Page 19: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/19.jpg)
19 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Refactor
● std::lround()● Consistent prefixes● Cross-directory includes● C++11 auto
vs
for (std::vector<std::pair<Id, RTFValue::Pointer_t>>::const_iterator i = m_pSprms→begin(); i != m_pSprms->end(); ++i)
for (auto& rSprm : *m_pSprms)
![Page 20: A year in LibreOffice’s RTF support · LibreOffice Conference 2016, Brno | Miklos Vajna 18 / 20 Testing 37 new tests No single bugfix without a matching unit test in the last year!](https://reader034.vdocument.in/reader034/viewer/2022051909/5ffd0c48fa3faa5cdc082d4f/html5/thumbnails/20.jpg)
20 / 20 LibreOffice Conference 2016, Brno | Miklos Vajna
Summary
● The LibreOffice Writer RTF filter keeps improving● New features from time to time● Regular bugfixes● 0 known regressions
● Thanks for listening! :-)● Slides: http://vmiklos.hu/odp