Commit Graph

6831 Commits

Author SHA1 Message Date
cb01957aa0 fdo#32613 RTF export: implemented anchored picture export
RTF originally didn't support anchored pictures: they were always
inline. Then it was invented that pictures can be exported anchored, if
they are in fact shapes, but their "pib" property is set to the hexdump
of the picture contents.

The RTF importer handled this situation for quite some time, but not the
exporter -- this commit implements that.

Change-Id: I173ad9f4f2e24620508ca63c0b892b7d5da4e5b2
2014-08-29 15:23:06 +02:00
96dc17221c fdo#83044:Fix for corruption of file with SDT content.
Issue:
  w:text has a wrong child w:docPartGallery and w:docPartUnique.

Change-Id: If1dd6ff15cbba2868c93795051a5328a074721d0
Reviewed-on: https://gerrit.libreoffice.org/11146
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-29 03:07:55 -05:00
365b075e84 sw: why is swdll.hxx included everywhere?
Change-Id: Ic401ca83666a887be9e5efe8369440e78fa4eeac
2014-08-28 22:08:41 +02:00
2c8b1d7611 SwHTMLWriter::MakeHeader: indent conditional block
Change-Id: If401b798eca9a60c50669070dfb0a038f0710b3a
2014-08-28 08:07:44 +02:00
8760b2b05c sw HTML export: avoid invalid output for embedded documents
When an sw document is embedded inside an sw one, then the inner sw HTML export
should just write what's inside the <body>. Add a filter option for that in sw,
similar to the one already existing in sc.

Change-Id: Id2cef966c1022ba45a3540bff234029c1d396778
2014-08-27 16:21:22 +02:00
8d670c9452 sw HTML export: handle embedded text documents
Change-Id: Ib7e55e3c82b1a1115335b68c317f5fcb084f6d28
2014-08-27 16:21:21 +02:00
a2e70c0a32 nInfo is RTL_TEXTTOUNICODE_INFO not RTL_TEXTTOUNICODE_FLAGS
Change-Id: If5e0a2bbfbd56a2d647dac608643411eefa1ed73
2014-08-27 15:10:03 +01:00
47b84f7e51 Resolves: fdo#82904 non-Japanese ww95 documents claiming ms932 encoding
Change-Id: I62f8d5c3cac71f83f5cdde114f66e8554a780538
2014-08-27 15:05:49 +01:00
4143d7bc70 sync GetCurrentCJKCharSet with GetCurrentCharSet
Change-Id: Ibcf1fa35617ee8d7fab6b66e3e8c8881ad55c3e5
2014-08-27 15:05:48 +01:00
56c9850145 refactor into GetCharSetFromLanguage
Change-Id: I54382b0dd0f6b6f21f635d75cb3ee3cefc1eb203
2014-08-27 15:05:48 +01:00
804d60d2ee duplicate with getBestTextEncodingFromLocale
Change-Id: I73a69fdfee0b0f3af5bf6b4e52629dba7ed69630
2014-08-27 15:05:48 +01:00
2fb876d85d Don't pointlessly make it harder to git grep for this message
Change-Id: Ia2777d61678f511c1e604c55b4e349d2ab938b24
2014-08-27 13:26:10 +03:00
d6078b0843 OutlineStyles can only be Paragraph Styles
Change-Id: Ia4089023ff1b9a18ed44f599dc7382fc3dcbbd36
2014-08-27 09:19:56 +01:00
35e954149d sw HTML export: don't crash on embedded object without native data
Change-Id: I26fa823b987b2edfbb1be054a5f4d03bbe95a308
2014-08-26 18:47:17 +02:00
d71aff6c47 Avoid undefined null pointer dereferences
...as observed during CppunitTest_sw_rtfexport under -fsanitize=undefined

Change-Id: I8f488188e233c1814a7b4bb3d21e7398d7d7c15a
2014-08-26 18:43:14 +02:00
7c82d8a5c7 Avoid undefined left shift of negative value
Change-Id: I8678215526990158215544c17aa9cf3aa178da01
2014-08-26 18:19:13 +02:00
ea1bb8be79 grapic->graphic
Change-Id: I81bf188d1dc53783f5f9a3826497aba6c52d3f29
2014-08-26 13:34:42 +01:00
58fc5c6a51 sw HTML export: avoid <table> directly inside <p>
Wrapping the embedded object output in a <span> at least makes the
parser errors go away.

Change-Id: I010d0257b5386a36f40103e3531737db6937ce85
2014-08-26 10:13:45 +02:00
1ee98159f7 HTML export: avoid invalid output for embedded spreadsheets
When the sc document is embedded inside an sw one, then the sc HTML
export should just write what's inside the <body>. Add a filter option
for that in sc and use it from sw.

Change-Id: I3a9605bd62f0628b78cd782c11661f12bc2c3ae4
2014-08-25 17:46:16 +02:00
971ffe1058 sw HTML export: avoid loosing embedded objects when skipping images
Change-Id: If795af5430b319922cd8242ca82352e148dd680b
2014-08-25 14:51:46 +02:00
30ae83c268 fdo#82577: Handle KeyCode
Put the VCL KeyCode class in the vcl namespace. Avoids clash with the X11
KeyCode typedef.

Change-Id: I624c9d937f7c5f5986d313b6c5f060bd8bb7e028
2014-08-23 22:33:30 +03:00
53ce805b43 Avoid unnecessary invalid downcasts
...to SwFmtFtnAtTxtEnd instead of SwFmtEndAtTxtEnd, both derived from
SwFmtFtnEndAtTxtEnd

Change-Id: I4b909f136268058bedeacd6b47d3f4cd88522ad5
2014-08-22 17:01:51 +02:00
e6fdd7ad0a The bLastBoxInChain fields are unused
Change-Id: I741733a053c8b0123be8efbcb9fde39f53f6d83c
2014-08-22 14:48:25 +03:00
db12d9042c bHasUDefProp is unused
Change-Id: I8eae6f1ed791ba92c3b4679d1b9f8041f16678d1
2014-08-22 14:48:25 +03:00
2e13f4e3df RES_PARATR_ORPHANS comes before RES_PARATR_WIDOWS
Change-Id: Iaf1891738fb3673c41b3af724f8494306578c512
2014-08-21 18:42:57 +02:00
60974f5643 DOCX export: prevent multiple paragraphs in some SDT containers
E.g. Word doesn't do anything if you hit return in the middle of a
title; if that's so, then we should handle this situation on export as
well.

Change-Id: Ib5b52a59250b09c97023b53906b8046f530d0e31
2014-08-21 15:28:20 +02:00
5a2123376d avoid crash on document ending before contained table ends
Change-Id: I003b7e00673cd5a4b4f0ed5218e2d30cfef04ffb
2014-08-21 13:07:03 +01:00
f97583711b DOCX export: handle anchored TextFrames inside shapes
The exporter already handled TextFrames inside TextFrames, a feature
supported by Writer, and not by Word.

Similarly, if DocxSdrExport::writeDMLAndVMLDrawing() starts a shape,
then anchored TextFrames should be posponed till the end of that shape.

Change-Id: I597a8a46b1cf2348a8ccb9af668ea5afab27541b
2014-08-21 12:02:36 +02:00
00b5f1ef2e i#105557: thread-safe caching of SwXFrame instances
Replace SwXFrames::GetObject() with factory functions that use the
WeakReference SwFrmFmt::m_wXObject to cache the instance in a thread-safe
way.

Change-Id: If56e4d7f95cb4f2e112139f228fb832ae9bf7d76
2014-08-20 16:40:08 +02:00
404f16e97f sw: ww8: fix another ~SwIndexReg() assertion
If the position is the same as the body text anchor position, don't
delete the node.  Probably something should have inserted more nodes
between StartApo() and StopApo().

Change-Id: I41110a47d840e764f6d2a24e43bf6938b1282972
2014-08-20 16:40:07 +02:00
be4320f32a sw: ww8: avoid ~SwIndexReg() assertion
In SwWW8ImplReader::StopApo() the JoinNext() may delete the node that
pPaM points to.  It is probably a bad idea to use a non-correctable
SwPaM in an import filter; sadly this filter uses the core API directly,
let's use a SwUnoCrsr which should avoid the problem.

Change-Id: I120a481883b7ecbfa59cc998153fec0e6b9bafe5
2014-08-20 16:40:07 +02:00
9acd707d73 fix crashing on exit in static SvxBrushItem dtor
site of second ctor

Change-Id: Ic319bd36f207a0f1939482a7b4c729b519bb5ce1
2014-08-20 14:06:33 +01:00
df4bd415c0 fix crashing on exit in static SvxBrushItem dtor
site of first ctor

Change-Id: I3316e91bc54439b74df30fdf02ff264a39489c29
2014-08-20 14:06:33 +01:00
15295ab6db Refactored SwDoc::GetEditShell .
Removed its output paramater as GetCurrentViewShell should be
used instead and added a const version.

Change-Id: Iad8b57553b6e93e3472ce8c6905d08e8d49af770
2014-08-19 21:57:06 +02:00
788632dcb0 DOCX export: handle SDT end right before a section break introducing headers
Change-Id: I0fab5ae4335ed6016d31aa243b131899c3154388
2014-08-19 18:19:04 +02:00
b3f4709d73 DOCX export: handle SDT around floating tables
Change-Id: I07fedc201c51008baca3254dcc099f0182aa4c72
2014-08-19 13:03:33 +02:00
914431e165 DOCX export: handle multi-para SDT's ending right before a table
Change-Id: I47ea5fd6e1b4d9d5a2893112efdcd810c4c84cfb
2014-08-19 10:34:52 +02:00
759f5d24b0 Consistency around XColorItem in svx/sdshcitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: I7ecf827a0713efaecb4b0eb49f9f8c06f8c59091
2014-08-18 18:18:08 +02:00
f6b681a136 DOCX export: don't forget to close SDT elements inside the TextBoxes of shapes
A usual problem with SDT is that in case it should end after the last
paragrah of a container, there is no "next" paragraph that could have
the relevant "EndSdtBefore" property. This is usually handled by closing
the SDT tag before the container is closed.

The problem here was that DocxAttributeOutput::WriteSdtBlock() did not
notify DocxSdrExport about opening the SDT, as it thought there is no
draw export in progress. This is because in case of "shape with a
TextBox", the common writeDMLAndVMLDrawing() method is not called,
instead the separate writeDMLTextFrame() and writeVMLTextFrame() methods
are invoked.

Fix the problem by adjusting these methods to writeDMLAndVMLDrawing(),
so that they also set m_bDMLAndVMLDrawingOpen to true during the TextBox
export.

Change-Id: Ie08b0b955cd2d6a645970da3d485e447abfd6495
2014-08-18 15:51:16 +02:00
08edafa656 Consistency around SdrOnOffItem in svx/sdtcfitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: Ib461b5d3702e00a9d7cef3229c44e3328c776e1d
2014-08-18 14:56:55 +02:00
d21d5a7261 drop unnecessary shl.hxx includes
Change-Id: Ieb984987c4a4f888a563377e0500444b12f43506
2014-08-18 12:59:49 +01:00
8b9988163c fdo#82492 : DOCX: Corruption: File was getting corrupt fafter RT
Issue :
	- In issue file there were two runs(first run=SDT, second run=Shape).
	- These two runs were consecutive(no text/space/tab was there in between two runs).
	- Due to such scenario, "SdtEndBefore" was not getting set on Shape.
	- Hence at Export EndSdtBlock() was getting called from EndParagraph().
	  Due to this SDT was not getting end after first run.
	  In order to end SDT after run, EndSdtBlock() should get called from EndRun()
	  (as in Original file)

	Implementation :
	- Set "SdtEndBefore" on Shape in DomainMapper_Impl::PushShapeContext()
	- Retrieved same property at export.
	- Added export unit test case.

	Note :
	Added common functions at Import and Export with reference to
	https://gerrit.libreoffice.org/#/c/10827/

Conflicts:
	sw/source/filter/ww8/docxattributeoutput.cxx
Reviewed on:
	https://gerrit.libreoffice.org/10912

Change-Id: I357d77cd179c83b8ae976db331ee46c8993b6cb8
2014-08-18 12:52:30 +02:00
be515af4d9 DOCX filter: improve qFormat export handling
The old rule was: write qFormat for everything that's not a custom
style.

The new rule: write qFormat for everything that's a custom style + have
a whitelist of non-custom, but qFormat styles.

This matches better what Word does (whitelist is from the latent style
section of an empty document, created by Word).

Change-Id: Ie7a0802e886c41b8d26ca9aa154913aa2f3ff87a
2014-08-18 11:58:30 +02:00
f1095b41c6 Fix missing prefix
Change-Id: I0a9df00f90b63059e6446278d7a98d1cd902de4b
2014-08-18 11:58:30 +02:00
a51c423743 Consistency around SdrMetricItem in svx/sdsxyitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."

Change-Id: I3734cb14b6ed8f556af85b234968682a55ac8a4c
2014-08-18 10:55:36 +02:00
4a1888a97e fix reading a .doc that has frame anchored to the end of page (bnc#787942)
MSWord, unlike Writer, can anchor even to a page break (i.e. after the last
paragraph). When this document was read, what happended was:
- the last paragraph was read and the current position PaM was set to point
  after it
- frame was read and anchored to the PaM
- page break was read, making everything following be moved to the next page;
  including whatever ended up at the PaM position
Handle this by checking for this case and inserting an extra empty paragraph
before the break. This shouldn't affect layout of the page itself anyway,
since the break should leave room for it (and MSWord shows a page break
there if control characters are enabled, so there is room).

Change-Id: Ia2a13bf5cf1c959b5aa228254365019a00a22679
2014-08-17 18:16:42 +02:00
47e2fd0dc8 Consistently use size_t and SAL_MAX_SIZE
Change-Id: Ibab89984ec94556ec368653b6db50c6c2e380dec
2014-08-16 21:52:32 +02:00
0606ab6a73 SwTextBoxHelper::findTextBoxes: return a set of const pointers
Change-Id: I8e3ea996959bad72e6d15dc9c980ea9d18d31fb3
2014-08-15 16:48:57 +02:00
ffdc8780eb fix indentation
Change-Id: I93fffff150e76a20decf2dd418f4cbd2b7418735
2014-08-14 15:55:44 +02:00
d5642fe00c warning C4702: unreachable code
that's a real bug in f6e7b94042070241cd1cfb1d7f8610fe1801b4f2

Change-Id: I46b9f6000b4c5e3b4aec44d96100cb41b6a8b41e
2014-08-14 00:04:26 +02:00