Commit Graph
260 Commits
Author SHA1 Message Date
Ashod Nakashian e26a95360e oox: move putPropertiesToDocumentGrabBag to XmlFilterBase
Change-Id: Ic3cbabc420c7856682b889528043563622997c14
Reviewed-on: https://gerrit.libreoffice.org/49235
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-14 01:03:19 +01:00
Miklos Vajna 67e1e2ee40 tdf#42949 Fix some more Include What You Use warnings
Change-Id: I2040315707674dc99a37aedb96ac61dca274c13a
Reviewed-on: https://gerrit.libreoffice.org/47348
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2018-01-04 15:51:39 +01:00
Patrick Jaap 8d62b79f16 tdf#112443 disable off-page content positioning
Disable the positioning for objects that are completely off-page.
During import, LO writer forces content always back to the page
and causes unwanted content on the page in constrast to MSO.

To achive this the top/left position of the content is compared to the bottom/right border of the clipping region.

A new compatibility flag OFF_PAGE_POSITIONING is introduced for
legacy rendering of legacy documents.

A unit test demonstrates the issue.

It resolves tdf#112443.

Change-Id: I263c129f9f09ed909ad777a34f8b9ffc84d871e4
Reviewed-on: https://gerrit.libreoffice.org/43313
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-12-11 15:39:10 +01:00
Noel Grandin 3af500580b loplugin:salcall fix functions
since cdecl is the default calling convention on Windows for
such functions, the annotation is redundant.

Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d
Reviewed-on: https://gerrit.libreoffice.org/46164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11 12:13:46 +01:00
Noel Grandin 2c05d758b2 add << operator for css::uno::Exception
Change-Id: Ia23dafd07133779144965682df3b7125a3214235
Reviewed-on: https://gerrit.libreoffice.org/43046
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-04 15:18:00 +02:00
Noel Grandin 4791e60615 loplugin:finalclasses in writerfilter
Change-Id: I590de2fd15c630d5ea5e706ce9421ee8bfe19db7
Reviewed-on: https://gerrit.libreoffice.org/43116
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-04 12:26:08 +02:00
Miklos Vajna 105b9ce13c writerfilter: size() > 0 -> !empty() and other small cleanups
Change-Id: I808a3ed8180b6f2164f14d736e2c8dc4bb8948bc
Reviewed-on: https://gerrit.libreoffice.org/42037
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-09-07 10:07:43 +02:00
Miklos Vajna 329213cb24 writerfilter: fix inconsistent param naming in interface/implementation
Talking about names when those are numbers is confusing.

Change-Id: Icfeed8924daeb1d6f658118515f9d4a76229106e
Reviewed-on: https://gerrit.libreoffice.org/41540
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-08-25 09:23:35 +02:00
Julien Nabet 4d21d4ceee Typo about "document"
Change-Id: Id12718b5b80b08f18fa9a0370c1991d94b2892ec
Reviewed-on: https://gerrit.libreoffice.org/41353
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-20 12:51:00 +02:00
Tamás Zolnai c0cc02e293 tdf#50097: DOCX: export form controls as MSO ActiveX controls
* Use the same structure for export what MSO uses
** Position and size information are exported as VML shape properties
** Different handling of inline and floating controls (pict or object)
** Do some changes on VML shape export to match how MSO exports these controls
** Write out activeX.xml and activeX.bin to store control properties
** Use persistStorage storage type defined in activeX.xml
* Drop grabbaging of activex.XML and activeX.bin
* Cleanup control related test code

Change-Id: I38bb2b2ffd2676c5459b61ec2549c31348bab41c
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/41256
Tested-by: Jenkins <ci@libreoffice.org>
2017-08-17 23:11:15 +02:00
Miklos Vajna 75bb1926c5 writerfilter: fix indentation
Change-Id: Ibc258a02ddb6385fb50206a6cc694f169432bd22
2017-07-03 08:02:44 +02:00
Noel Grandin bdabb4c07d loplugin:oncevar in writerfilter..xmlhelp
Change-Id: I1319494e16586f7e0b5149faecd3d1c36e336b1b
Reviewed-on: https://gerrit.libreoffice.org/39343
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28 12:37:31 +02:00
Miklos Vajna 5ea13cb3b9 writerfilter: remove unused WriterFilterDetector
DOCX/DOCM uses com.sun.star.comp.oox.FormatDetector for filter
detection, this one is unused.

Change-Id: I01776d130b0f8f0a75ee39a0cfbf974639c94216
Reviewed-on: https://gerrit.libreoffice.org/38800
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-06-15 09:01:50 +02:00
Miklos Vajna 0129c2cd9d Related: tdf#108269 DOCM filter: reuse oox code for VBA data preservation
Which means the DOCM-specific code to roundtrip VBA things (project,
data) can be removed. The oox part has to be extended a bit, as at least
for this DOCM bugdoc there is an XML relation of the binary data, while
existing shared code assumed the full VBA project is just a single OLE
blob.

Change-Id: I4085e4dba24475e6fd555e5f34fe7ad0f305c57d
Reviewed-on: https://gerrit.libreoffice.org/38504
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-06-07 19:08:20 +02:00
Miklos Vajna 8a59b30bb1 Related: tdf#108269 DOCM filter: preserve VBA stream
This means 2 new streams when roundtripping DOCM files that actually
have macros: word/vbaProject.bin and word/vbaData.xml (+ the relation
pointing to the second from the first).

Change-Id: Iba24eea4c5bca8f743a53027c71ed2aae48f1934
Reviewed-on: https://gerrit.libreoffice.org/38360
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-02 21:31:01 +02:00
Arnaud Versini 1fdb0e1897 Replace all OUString("") with OUString()
Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0
Reviewed-on: https://gerrit.libreoffice.org/37146
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-04 08:39:18 +02:00
Noel Grandin 198c41c4fe new loplugin unoany
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-02-28 10:17:47 +00:00
Miklos Vajna 31f4400ea5 writerfilter: can use std::move() here
Change-Id: I48980ae44cd68b9526d915f877a37f6a559910e5
2017-02-15 12:34:52 +01:00
Stephan Bergmann 6dce9c6757 Add missing #includes
...and remove some unncessary using directives/declarations, in preparation of
removing now-unnecessary #includes from cppumaker-generated files, post
e57ca02849 "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01:00
Stephan Bergmann e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Stephan Bergmann 6cf68af560 New loplugin:dynexcspec: Add @throws documentation, writerfilter
Change-Id: I7e84da00d943d2849e6d94011f349d064fb658cb
2017-01-19 18:03:09 +01:00
Miklos Vajna af313fc149 tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat option
Because that's what Word does to show only part of the shape in the
bugdoc.

Change-Id: Ic5cb84cace9237671d71eda0c64e9dadfe244cb9
Reviewed-on: https://gerrit.libreoffice.org/32782
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-01-06 15:14:50 +00:00
Miklos Vajna 51b6a7c87b writerfilter: various small cleanups
Change-Id: I258a03909e2a166b8f1c077cf758974a06ad3403
Reviewed-on: https://gerrit.libreoffice.org/32215
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-12-20 09:42:44 +00:00
Justin Luth 8a34ff14f1 tdf#41542 globally allow padding without borders: UI
This is the final fix for tdf#41542 - enabling the UI to adjust the
padding without requiring an enabled border line.

Because almost every document edited by LO5.3 will gain the setting
ALLOW_PADDING_WITHOUT_BORDERS = false, it cannot be kept as a
preventative compatibility setting. Otherwise any document edited
in 5.3 would act differently from any other document - not being
allowed to modify borderless padding for frames, even in 5.4+.
That would be a very confusing corner-case that is best avoided,
so removing all compatibility code (which currently has no use).

So, if an AllowPaddingWithoutBorders=false compatibility
situation is ever required in the future, do not
resurrect the name ALLOW_PADDING_WITHOUT_BORDRES. Additionally, code
will also be needed to send the compatibility setting for
each type of border (page, paragraph, character, header, frames, image).
See commit f013d4a1f4 as an example
of how to implement that for frames.

This commit means there is a lot of dead code now (m_bBorderDist and
mbAllowPaddingWithoutBorders are always true). LO5.7 seems like a good
target to clean that up - to allow time to easily fix any regressions.

Change-Id: I2d2091fa34f8b178a59347b35a81c944c9b24ed7
Reviewed-on: https://gerrit.libreoffice.org/31105
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-11-24 11:08:57 +00:00
Stephan Bergmann 5ebfc3ad9b loplugin:unnecessaryoverride (dtors) in writerfilter
Change-Id: I2d21d47e8471daf3125a6c81b5b3919820caef46
2016-11-24 11:27:53 +01:00
Justin Luth bb615bc146 tdf#41542 rename variable to match LO5.4 terminology
Changing /Allow_*Spacing_*Without_*Borders/I
       to AllowPaddingWithoutBorders

related to tdf#103275 where "spacing to contents" is to be changed to
Padding. Rename this already in LO53 to simplify potential backports
and laying other groundwork for fixing this bug.

Also, I can easily see setting AllowPaddingWithoutBorders globally in 5.3
for the purpose of being able to share documents when
the UI in LO5.4 permits creation of padding without borders.
Otherwise older versions will display significantly different formatting.

Change-Id: I253173274f824a019ebc09a039c471d170c1be73
Reviewed-on: https://gerrit.libreoffice.org/30372
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
2016-10-29 12:17:28 +00:00
Miklos Vajna c761df1e42 tdf#84678 DOCX import: fix handling of textbox margins
Regression from commit d379d18666 (oox:
import WPS shape with text as shape with textbox, 2014-06-18), the
problem for a long time was that in Writer text frames without borders
couldn't have text margins, either.

Recently a compat setting was added in the WW8 filter for this
situation, so use that in the DOCX import as well, and improve
SwTextBoxHelper to handle the margin properties.

Change-Id: I472bbc414f21f2ec7334482c460a5c3be3e95e94
Reviewed-on: https://gerrit.libreoffice.org/30255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-10-25 09:32:01 +00:00
Justin Luth 79054f270a Formatting: consistent spot for TreatSingleColumnBreakAsPageBreak
I failed to keep this instance in a consistent position earlier.

Change-Id: I098e5e3f4c3d562d986ae9233cfd62d29fd0f4dd
Reviewed-on: https://gerrit.libreoffice.org/28600
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
2016-09-01 19:41:01 +00:00
Justin Luth 93d7fc90b5 tdf#76349 writer: make 1column-as-page break a compatibility option
Unable to find/create a proof .doc document, so only implementing this
for .docx

Change-Id: I3a0cb2ddf7b3aeecc9200e595f70d8c88af4b122
Reviewed-on: https://gerrit.libreoffice.org/28501
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-08-30 20:00:31 +00:00
Miklos Vajna 637371d4d9 writerfilter: clean up virtual keywords where override already implies that
Change-Id: I04938ceba4e4740535caee396ca8e13ca50a003c
Reviewed-on: https://gerrit.libreoffice.org/26288
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-15 07:37:49 +00:00
Noel Grandin 0b23eec200 teach refcounting clang plugin about uno::Reference
uno::Reference is only allowed to used with classes that have a
::static_type member.
So convert all those places to rtl::Reference.

Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and
uno::Reference to make this a little smoother?

Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3
Reviewed-on: https://gerrit.libreoffice.org/25516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-31 06:25:45 +00:00
Miklos Vajna 1b89a57aa5 writerfilter: use '= default;'
Replace default bodies of these trivial special member functions. Also
remove RTFSprms::operator=() as it matches what the compiler would
generate anyway.

Change-Id: Ib5e30dfdd9b428a6d7800cec056c3f55ca92f4a4
Reviewed-on: https://gerrit.libreoffice.org/25187
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-05-20 07:34:53 +00:00
Stephan Bergmann d88ad8b99d loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I5f38167cc2fd0104ad388c63f766bda6acae96e2
2016-04-20 17:27:31 +02:00
Miklos Vajna 50223ea6e2 tdf#98987 sw: add AddVerticalFrameOffsets compat mode
The situation is the following: we have a text frame, with at least two
anchored objects: one is wrapped not-wrap-through, the other is. In case
the non-wrap-though one shifts the text content of the text frame right or
down, then layout may or may not want to re-consider what is the top
left corner of the text frame for anchoring purposes.

Regarding the x position, sw layout repositioned the anchor point
depending on the AddFrameOffsets compat mode: it's enabled for documents
imported from Word, disabled otherwise.  Regarding the y position, no
repositioning was done, however the bugdoc shows that Word does the same
repositioning on the vertical axis as well.

Add a new AddVerticalFrameOffsets compat mode that enables vertical
repositioning as well, and enable that mode for documents imported from
DOCX.

Change-Id: Idc5cad7d86662008a92ff3bf5fbb3806aa2c7b07
Reviewed-on: https://gerrit.libreoffice.org/23702
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-03-31 17:49:00 +00:00
Miklos Vajna 6f94cab9c4 tdf#59699 RTF import: handle INCLUDEPICTURE field
On one hand, don't handle a fieldmark for it in dmapper.

On the other hand, handle the field in the RTF tokenizer as it would be
{\pict ...hexdump... }, that will result in an inline picture, as
wanted.

Change-Id: I554fdf017920350144300fd86617bf74eed8995b
2016-02-23 09:14:36 +01:00
Miklos Vajna 6083a8f188 Related: tdf#59699 DOCX import: fix linked graphics with relative URLs
Because the writerfilter::ooxml::OOXMLFastContextHandlerShape
constructor only sent the input stream (and not the full media
descriptor) to oox::shape::ShapeContextHandler, it's startFastElement()
tried to reconstruct a media descriptor from just the input stream. As a
result, the base URL of the document got lost at the time the
oox::drawingml::BlipContext constructor tried to call getAbsoluteUrl(),
to convert the relative URL to an absolute one.

Fix the problem by sending not only the input stream, but the full media
descriptor to the shape importer. As a bonus that makes code simpler,
too.

Change-Id: I1f06c04d0745aa7e2e06d4848cf454790d5073ca
2016-02-16 09:16:43 +01:00
Miklos Vajna 8a83527119 writerfilter: DOCX signature is read in xmlsecurity already, remove TODO
Change-Id: Ibae2fdd0d56f68ab3401b5215b9b67000d05a3ca
2016-02-10 13:45:45 +01:00
Miklos Vajna 585f637c24 Remove unused includes
Change-Id: I38784900d5b4fcf99d5fc881f0ec7a9833fe2d5b
Reviewed-on: https://gerrit.libreoffice.org/21917
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-01-30 16:46:41 +00:00
Noel Grandin 8ee52d72f5 loplugin:unusedfields writerfilter,writerperfect
Change-Id: I8863fcdb0751d2f1becea5b2487d4070e4fd4195
2015-12-21 12:45:49 +02:00
Michael Stahl 8338e2783f writerfilter: set a BaseURL on embedded math objects
Change-Id: I9a500e079c892e281bdfee9627641f118261e0f8
2015-12-15 17:44:37 +01:00
Miklos Vajna 8396bffef7 writerfilter: dmapper ctor can read TextInsertModeRange directly
Change-Id: If17ae09266134b4bc410eab1a1b2f5139ba93a12
2015-10-19 09:23:42 +02:00
Miklos Vajna 50d48709af tdf#94374 DOCX import: allow insert -> object -> document
Change-Id: I977930d59ef1ae9ae8bd2dfa9a7f3816c46d982c
2015-10-19 09:21:03 +02:00
Stephan Bergmann b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02:00
Caolán McNamara cfa853c07f this debugging code can definitely use osl
Change-Id: I420e7f242868a25a2f9a473c23c67dfd9a285b7c
2015-08-18 14:06:56 +01:00
Noel Grandin 2660d24a07 new loplugin: refcounting
This was a feature requested by mmeeks, as a result of
tdf#92611.

It validates that things that extend XInterface are not
directly heap/stack-allocated, but have their lifecycle managed
via css::uno::Reference or rtl::Reference.

Change-Id: I28e3b8b236f6a4a56d0a6d6f26ad54e44b36e692
Reviewed-on: https://gerrit.libreoffice.org/16924
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-03 06:37:16 +00:00
Miklos Vajna f89deaaf9a Unused includes
Change-Id: Id8aa8edf775d27ad3ed9fd2370268faf2d7325a6
2015-06-08 07:58:12 +02:00
Miklos Vajna e702c78843 tdf#90260 writerfilter: pasted RTF documents may contain no \par
sw core is not yet adapted, will be done in the next commit.

Change-Id: If8da12427e0cdaced4c1c1776b9f0b8cbde5c57c
2015-05-12 12:50:25 +02:00
Miklos Vajna a21a0b6dce writerfilter: noExplicitConstructor cppcheck fixes
Change-Id: I4195fc8a7736a29a6f08d0745f39a0907a5545e8
2015-05-04 09:04:36 +02:00
László Németh 9b0e09dedc SkipImages option for document import
This option allows images and drawings to be skipped while importing
DOC and DOCX, for text-only conversion or indexing.

Change-Id: Id4bfbbe48d8a8e970b1cb5922187768bf94dc918
Reviewed-on: https://gerrit.libreoffice.org/14733
Reviewed-by: Németh László <nemeth@numbertext.org>
Tested-by: Németh László <nemeth@numbertext.org>
2015-03-24 07:38:04 +00:00
Miklos Vajna 05aa02a85d Unused includes
Change-Id: Ie273e88bd12321726f1717e4e09b1928fcadb6f9
2015-03-14 11:45:55 +01:00