Commit Graph

160 Commits

Author SHA1 Message Date
acd5d5fc92 writerfilter: put w:compatSettings into a document level GrabBag
Change-Id: Iefb8ef14c61e7966098754b8f3395f994bb9bda7
2014-02-28 20:24:37 +01:00
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
15535e32dd convert SvStream::operator>> methods to ReadXXX methods
First, I updated the clang rewriter to do the conversion.
Then I lightly hand-tweaked the output for the few places where
the rewriter messed up, mostly when dealing with calls on "this".

Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9
Reviewed-on: https://gerrit.libreoffice.org/7879
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-12 15:31:40 +00:00
25d089e09d fdo#63154 Removed unused solar.h ref. in basic, cui, forms and writerfilter.
Change-Id: I09cca73d8d77af259965e74e1b29a88aa5c315ab
Reviewed-on: https://gerrit.libreoffice.org/7731
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-01-30 10:48:40 +00:00
bef6f6ebe2 writerfilter: whitespace fixes in RtfFilter
Change-Id: Ic275ce70318d56010d40e483b299c8b1b13bf902
2014-01-28 21:09:04 +01:00
946f6132f9 bool improvements
Change-Id: If3d99591d9da95c5c64de416e4d2e72ec4295d69
2014-01-28 20:26:19 +01:00
d803483f6a convert more SvStream::operator<< calls
.. to more explicit SvStream::Write* calls
This was done using another run of the clang rewriter, and then
a lot of hand tweaking to fix all the places where the rewriter
did not play nice with various macros.

Change-Id: I7bcab93851c8dfb59cde6bc76290c6484d88fb18
Reviewed-on: https://gerrit.libreoffice.org/7494
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-01-22 22:00:39 +00:00
0e114b9967 fdo#72520 : Added embedded data of docx file to InteropGrabBag.
- Added embedded exel sheet data for charts to grab bag.

Change-Id: I7f52b56de2306671fea9247c8a789c0e2a5a8874
Reviewed-on: https://gerrit.libreoffice.org/7211
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-01-10 12:15:50 +00:00
148e7763f3 writerfilter: remove unused WW8Stream
Change-Id: I375b4768bc4474f78f6857176c8b77856609aeaa
2013-12-13 22:15:19 +01:00
88b9e7f391 fdo#71786 : Implemented Glossary folder
1. Glosary folder is imported as Intrograb and exported.
   2. Added unit test case

Reviewed on:
	https://gerrit.libreoffice.org/6825

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
	writerfilter/source/filter/ImportFilter.cxx

Change-Id: Ifd51a75a65e030d44d30e02cd7ab51fb088186b3
2013-12-13 11:19:42 +01:00
629706f24d writerfilter: refactor code to fill document grab bag
There were several chunks of identical code to add attributes to the
document grab bag. I have refactored the common code to a method.

Change-Id: Ia1de75280a7725ab9703b08b1b08e7a7d1e0a8f2
2013-12-12 19:48:25 +01:00
ece66b11bd fdo#64232: export w:themeFontLang setting to docx
We store the values of themeFontLang tag to the document grab bag so
we can save it back to the document on export time.

Added unit tests to check that the attribute is properly set back and
also that the theme fonts are correctly applied to the text.

Change-Id: Ia54c513796ba38a571396ca7b72dfd28463c15fd
2013-12-11 17:39:02 +01:00
fb9d14f6a6 RTF: use "InsertMode" insead of "IsNewDoc" for consistency
... with other filters.

Change-Id: I563d6f7713d882b834978699c492a43a70e072cd
2013-12-05 13:00:28 +01:00
610b2b94b3 remove unnecessary use of OUString constructor when assigning
change code like
   aStr = OUString("xxxx");
to
   aStr = "xxxx";

Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4
2013-11-19 10:29:31 +02:00
b8a4abdda4 [docx] activeX reference files (.bin) saved in InteropGrabBag and exported.
The XInputStream for activeX.bin files is stored as the PropertyValue
  "OOXActiveXBin" into the "InteropGraBag"

  Added mxActiveXBinList object which holds XInputStreams for each
  activeX.bin from activeX folder.

  Added .bin files entry to respective acivex.xml's .rels file.

  Added Unit Test to test all .bin files are stores properly.

Reviewed on:
	https://gerrit.libreoffice.org/6679

Change-Id: I3a0e9462a6cc53d8cbb9c7d59ed24631d77d4d30
2013-11-15 18:40:33 +01:00
f471422090 [docx] activeX files saved in InteropGrabBag and exported.
The XDocuments representing the DOM of an OOXML's activex document
  is stored as the PropertyValue "OOXActiveX" into the "InteropGraBag".

  Added mxActiveXDomList object which holds xDocument for each
  activeX.xml from activeX folder.

  This changeset stores only activeX[n].xml files.
  Relationship files (example activeX.bin) from activex are not stored
  yet. (Working on it.)

Reviewed on:
	https://gerrit.libreoffice.org/6654

Change-Id: I658e361211e1446ed095a73b0422da0c4f74df1c
2013-11-14 17:50:06 +01:00
24cad6a649 Move MediaDescriptor from comphelper to unotools
...so it will be able to use SvtSecurityOptions internally.

Change-Id: Id7433247e8fc53651935578510bedbcca5aa2ac9
2013-11-14 11:13:24 +01:00
52ee03760e [docx] CustomXml relationship files saved in InteropGrabBag and exported.
The XDocuments representing the DOM of an OOXML's customxml property
  document is stored as the PropertyValue "OOXCustomXmlProps" into the
  "InteropGraBag".

  Added mxCustomXmlDomPropList object which holds xDocument for each
  itemProps.xml from relationship of item.xml.

  Exporting all itemprops files from customxml.

Reviewed on:
	https://gerrit.libreoffice.org/6603

Change-Id: I3973e6ce40382bbc4da247b5b27d99b03e851744
2013-11-13 10:27:28 +01:00
8bfbd27f8d remove unnecessary use of OUString constructor in WRITERFILTER module
Change-Id: Iba6fd6e2bb9b2a9e937149f3e3465b0817208a58
2013-11-07 13:22:56 +02:00
8ab553117e [docx] CustomXml saved in InteropGrabBag and exported customxml when saving.
The XDocuments representing the DOM of an OOXML's customxml document is
  stored as the PropertyValue "OOXCustomXml" into the "InteropGraBag".

  Added mxCustomXmlDomList object which holds xDocuments for
  each item.xml from CustomXml.

  Exporting all items dom tree from customxml that has been parsed
  when loading the file.
  This is necessary in order to properly reopen docx files that
  contain data like citation.

  This fix grab bags only item[n].xml's files from CustomXml folder.
  itemProps[n].xml's and item.xml's .rels are not preserved and exported yet.
  (Working on this part)

Change-Id: I330f34f38a7aa4cd39094371bff15ebbc0318167
Reviewed-on: https://gerrit.libreoffice.org/6519
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-11-05 09:07:07 -06:00
9e5132290b remove further external include guards
Change-Id: I23ec3b7372425fb35d4b0c50c5719a2170251ffc
2013-11-05 09:28:54 +01:00
0865c446c2 fdo#54938: Convert package, writerfilter and writerperfect
Change-Id: I5220e172bf9722ad86eef3bc557c30779f07201c
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-10-30 16:27:50 +01:00
a5097b664a writerfilter: remove dead WW8DocumentFactory
Change-Id: I9896c3b221d2ec4766b9ee63aadc90bff9c33ea6
2013-09-25 09:56:41 +02:00
290f03e8bb writerfilter: OOXML theme saved in InteropGrabBag
The XDocuments representing the DOM of an OOXML's theme document is
now stored as the PropertyValue "OOXTheme" into the "InteropGraBag"
property of the SwXTextDocument.

Added the importSubStream() method to the
writerfilter::ooxml::OOXMLDocumentImpl class in order to create the
XDocument for the theme XML fragment stream and invoked it during the
resolve() method.

Modified the writerfilter::ooxml::OOXMLDocument abstract class to be
able to hold the OOXML's theme XDocument. Added the set/getTheme()
methods to store and obtain the XDocument directly.

Modified the WriterFilter::filter() method to store the OOXML's theme
XDocument in the "InteropGrabBag" property of the TextDocument service
SwXTextDocument implementation.

Updated the UTs accordingly.

Change-Id: I3960590fcf4856caf770908b983ffb6898f061c0
Reviewed-on: https://gerrit.libreoffice.org/6002
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-09-20 08:51:37 +00:00
396534403b Mark as const / static
Change-Id: I9bcf02b270200fd146d2bfee6f15ff1f9ad8888b
2013-09-10 02:50:04 +09:00
bdfc6363d6 n#793998 sw: add TabOverMargin compat mode
In case the right margin is larger then the tab position (e.g. the right
margin of 7cm, there is a tab position at 16cm and right margin begins
at 9cm), we have a conflicting case.  In Word, the tab has priority, so
in this conflicting case, the text can be outside the specified margin.
In Writer, the right margin has priority. Add a compat flag to let
the tab have priority in Writer as well for Word formats.

This is similar to TabOverflow, but that was only applied to left tabs
and only in case there were no characters after the tabs in the
paragraph.
2013-01-08 14:17:27 +01:00
53d335910f fdo#45533 make it easier to debug RTF copy&paste
Previously there was only a compile-time switch to dump contents of RTF
paste. Remove this, and add two environment variables instead:

- SW_DEBUG_RTF_PASTE_TO: to dump what would be pasted
- SW_DEBUG_RTF_PASTE_FROM: to paste contents of a file, instead of the
  real clipboard

Change-Id: I65f89417ec1cf781ace41df7916791f2199fe104
2012-12-28 15:54:24 +01:00
0816202184 sw: remove unused UNO wrapper around old internal RTF import
Change-Id: I460f75d03a0af53da7523e290136126e95e01192
2012-12-01 11:01:53 +01:00
232ad2f258 API CHANGE: add a "position" parameter to XParagraph/TextPortionAppend methods
So we can use the new RTF import for clipboard pastes in Writer without
inserting text content to the end of the document only.

Notes:

- SwXText::insertTextPortion: the MovePara() call is removed, as all it did was
trying to move the cursor beyond the end of the document.
- SwRTFReader::Read: the double fake paragraph insertion / deletion is
motivated by the ODT filter.
- RtfFilter::filter: if TextInsertModeRange is not passed, then the behaviour
is not changed.

v2:

- added missing @since tags
- added insertTextContentWithProperties() method
- removed unused appendParagraph() method

Change-Id: I24cddb00a78e3b798e7d88764e59e6a77a6e98a4
Helped-by: Michael Stahl <mstahl@redhat.com>
2012-11-28 21:33:54 +01:00
68338abfd6 DOCX: w:doNotUseHTMLParagraphAutoSpacing should affect AddParaTableSpacing
commit 5d4bd2f97128adecc5b11699e98c934be3c3a462 unconditionally enabled
AddParaTableSpacing doc setting, which broke the layout of some
documents, e.g. n#778836. Fix this by doing what the WW8 importer does:
enable the setting only in case the w:doNotUseHTMLParagraphAutoSpacing
tag is present.

Change-Id: I104259a1f37f28e3c4362eb638a134b593fcb851
2012-10-29 14:37:04 +01:00
5944eba64a writerfilter: make it easy to debug the old RTF filter
Change-Id: Ifc1d6b78f55e7f202f5cc391f1401de5b65ed395
2012-10-27 13:04:18 +02:00
48c9586e07 RtfFilter::filter: not allowed to throw WrongFormatException:
throw a WrappedTargetRuntimeException instead :(

Change-Id: Iebf2b709beea738ba513ec5ce884874b76fbf243
2012-10-23 15:12:43 +02:00
49e003177d fdo#51145 give better error message on import invalid RTF
Change-Id: Idd81e58b8b0b95b1027b7ece434cb362a689f124
2012-10-23 09:42:52 +02:00
074bb52292 RtfFilter::filter: add code to dump input stream for copy&paste
This is especially useful when creating testcases for handling
copy&paste input.

Change-Id: I11be65484e7ac4dfac3d28576249143b7532a976
2012-10-16 18:17:28 +02:00
4f1ba04862 fdo#46669 sw: RTF paste should not change page styles
Change-Id: Ic163a639fae9de838258b3cca9567a29ab875a35
2012-10-15 16:54:10 +02:00
2a777a1014 writerfilter: fix new clang warnings
Change-Id: I0f7cec0f300290fe3ea465f344cfda642824ed0b
2012-10-13 12:31:13 +02:00
13ec17ce63 Use prefix
Change-Id: I128623b27bd88795e21de13d7a6fc960de3b6ea8
2012-10-02 13:02:37 +03:00
ff300e59e7 fdo#49819 - allow slightly inconsistent docx files to be repaired 2012-09-21 21:33:59 +01:00
355d25eac7 n#779627: added quite some compat options from the ww8 filter on writerfilter
Change-Id: I9e8dee39f63a08517eb654e33747bd8c95d84b59
2012-09-20 18:20:18 +02:00
b854de954f deprecate oustringostreaminserter.hxx
the intent of this header has canged over time. now it is already
systematically included with ustring.hxx and the operator overload it
provide fit nicely there...

Just to be safe, since that include as been added to the api during the
3.5 timeframe and therefore is already in 'production'
the header remain and simply attempt to include ustring.hxx
but a warning is issued indicating that this header should not be used
anymore... in a couple of major release we will thenr emove it completely

All internal users of that header are converted.

Change-Id: I8934c55f089e29d78c0f5649b7c87b2ecf024bad
Reviewed-on: https://gerrit.libreoffice.org/634
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-09-18 10:10:06 +00:00
5d4bd2f971 n#778140 enable AddParaTableSpacing for docx, as it's enabled for ww8 as well
Change-Id: I7523be9f07d378e1c4d88468077653d3fa4161d3
2012-09-14 15:38:41 +02:00
18b3feb8be n#778133 sw: add BackgroundParaOverDrawings compat flag
In Word, the layer that contains a background image is behind the layer
that contains the paragraph background. In Writer, the paragraph
background is painted before the hell layer. Add a compat flag to change
the order, so the DOCX importer can trigger that.

To reproduce, create an XShape, send it to the background, set some
color for a paragraph background, and notice that the background color
is missing where the shape is behind the text.

Change-Id: I9b1fffd9ac9a6e5a1c3d1f65371440047d125b38
2012-09-12 10:03:18 +02:00
e598ab0447 n#775270: clip pictures instead of scaling they don't fit
Word clips pictures that are bigger than a page instead of scaling them
down. This patch introduces a new compatibility option to allow clipping
a picture in Writer instead of scaling it down.

Change-Id: I4defbee05be81e23ec28a2ed272eaf4e4cc6faf5
2012-09-04 12:59:52 +02:00
93cdd851ee n#775899 docx import of w:usePrinterMetrics compat option
This was set unconditionally, but it turns out it's not the default for
docx, it's triggered by a compat flag there as well.

Change-Id: I84dccfe7ffd49fbc6878b19ff4276f8a36b827a3
2012-08-27 14:09:14 +02:00
926fe8298b n#775899 docx import: set PrinterIndependentLayout like ww8 does
Change-Id: I32869aa3d7b6b25c7eb9756d79ea7126130afc4b
2012-08-27 13:09:09 +02:00
50a1df360c n#775899 sw: add FloattableNomargins compat flag
The DOCX filter imports floating tables as frames containing a table.
Word ignores the margins of paragraphs next to such a table, Writer does
not. Add a compatibility flag the import filter can set that triggers
this weird behaviour.

Change-Id: Iaaa1d2a2e2f9d0eaea17832b2e418f9a845efffd
2012-08-23 12:56:41 +02:00
b95d203bc1 fdo#53175: Don't load the default values of the styles in writerfilter
...or we may have some additional properties set on some styles.

Change-Id: I5a5d307931a2a6c1f25bd2da93381d8de65c2480
2012-08-20 11:32:57 +02:00
75c0acd024 writerfilter: rtl::OUString -> OUString
Change-Id: I1577c1bb8a3dc498b647b930d405c90f80eafaf9
2012-07-21 19:22:18 +02:00
dcc030cc8d writerfilter/filter: kill remaining CONSTASCII madness
Change-Id: I2f51f4709e8f92fd6779e8e59227e82ac335050b
2012-07-02 21:44:02 +02:00
bd18cf5274 re-base on ALv2 code. Includes:
Avoid some uses of non portable #!/bin/bash in shell scripts.
    Patch contributed by Pedro Giffuni
    http://svn.apache.org/viewvc?view=revision&revision=1235297
2012-06-28 19:59:06 +01:00