Commit Graph

135 Commits

Author SHA1 Message Date
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
d5d29accb7 targeted string re-work
Change-Id: I910a508722a309d7916377a7e2df2093070809ad
2012-06-02 14:55:58 -05:00
a360d59015 hide progress bar even if loading failed
Change-Id: Ia330e70e393309dbbad025fc2ede8f4ab41a674c
2012-05-14 15:02:03 +02:00
da07d3a7bd rtftok: make it possible to see the time spent in the filter 2012-04-21 19:16:38 +02:00
39ba666f80 Fix "Same expression..." reported by cppcheck 2012-04-08 22:20:20 +02:00
d6bc02f8c4 Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator 2012-04-06 20:03:42 +02:00
743f22045c Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator
Pattern used:

find . -name "*.cxx" -exec sed -i 's/\( *\)\(else if\|if\) *( *\([^!()|&]*\)\.equalsAsciiL( *RTL_CONSTASCII_STRINGPARAM *( *\([^)]*\)) *) *)$/\1\2 ( \3 == \4 )/' \{\} \;
2012-04-06 15:07:41 +02:00
8a01ee6243 Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator
Pattern used:

find . -name "*.cxx" -exec sed -i 's/\( *\)\(else if\|if\) *( *\([^!()|&]*\)\.equalsAsciiL( *RTL_CONSTASCII_STRINGPARAM *( *\([^)]*\) ) *) *)$/\1\2 ( \3 == \4 )/' \{\} \;
2012-04-06 14:30:05 +02:00
39c2a52d19 Avoid temporary rtl::OUString 2012-03-03 14:57:01 +01:00
f94399ef80 Fix for fdo43460 Part XLV getLength() to isEmpty()
Part XLV
Modules
writerfilter, writerperfect
2012-01-23 19:17:18 -02:00
92c7b6733e fdo#38057 implement RTF import progressbar 2012-01-11 01:53:18 +01:00
1a6853e422 writerfilter: fix build breakers 2011-12-09 16:44:08 +01:00
2075a648ac Removed useless code due to the move to SAL_INFO 2011-12-09 15:16:09 +01:00
52422457d4 Writerfilter: replace OSL_TRACE(...) by SAL_INFO("writerfilter",...) 2011-12-08 21:43:56 +01:00
a45c82f930 Show some exception message when getting one in RtfFilter 2011-11-23 11:24:06 +01:00
74b6759ee8 n#707157: Word doesn't break the numberings and prefers hiding them
Added a compatibility option to reproduce Word's behavior when importing
Doc, docx and RTF files. The default behavior isn't changed.
2011-11-12 14:25:11 +01:00
d1340a6e4d WaE: unused variable 2011-08-29 09:56:09 +01:00
13c00ce322 Enable the writerfilter-based RTF import in non-experimental mode
Disable the unit tests in sw, as that would duplicate the unit test in
writerfilter now.

Do not remove the old filter yet, so this commit can be reverted later
if needed.
2011-08-18 12:11:03 +02:00
0b4df1d83d a control word's name cannot be longer than 32 letters 2011-08-03 20:18:18 +02:00
735dea2d93 the old filter does not support parsing without a destination document 2011-08-03 16:36:13 +02:00
8560e419af RtfFilter::filter: always do an import, unless a source document is given 2011-08-03 16:27:13 +02:00
88efc04329 revert to old writerfilter gbuilization
* gnumake4's writerfilter gbuildization got pushed in a seperate branch
 * it might or might not be merged to master later
2011-07-23 03:12:47 +02:00
112be98c92 resyncing to master 2011-07-21 18:38:50 +02:00
a9137707c4 Remove component_getImplementationEnvironment 2011-07-12 17:58:59 +02:00
8268ca0b75 Enable rtftok on experimental mode only 2011-06-27 11:06:04 +02:00
65f918d8c9 Merge remote-tracking branch 'origin/master' 2011-06-26 00:39:17 +02:00