Commit Graph

251 Commits

Author SHA1 Message Date
365b075e84 sw: why is swdll.hxx included everywhere?
Change-Id: Ic401ca83666a887be9e5efe8369440e78fa4eeac
2014-08-28 22:08:41 +02:00
7c02c7b021 DOCX import: list styles don't support automatic updates
The problem was the following: setPropertyValue("IsAutoUpdate") on the
style failed -> a number of styles was not imported in
StyleSheetTable::ApplyStyleSheets() due to the exception, then when we
tried to use one of the not imported styles, we also got an exception in
DomainMapper_Impl::finishParagraph(), which resulted in not calling
DomainMapperTableManager::handle(), so multiple cells of the same table
wanted the same range for cell contents, and that resulted in a crash.

Regression from cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle
w:gridBefore by faking cells (fdo#38414), 2014-04-23), but that commit
just made the previously hidden problem visible.

Change-Id: I788cb6b4a2c7b7efbfa48297c658bb26450bf583
2014-08-22 14:13:31 +02: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
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
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
1e61e18169 warning C4245: 'initializing' : conversion from 'int' to 'sal_uLong'...
...signed/unsigned mismatch

In history this was sal_Long and then converted to sal_uLong, but the
test never got aligned.

Fix it by adding arbitrary element counts starting from 30.

old: getCount():
{-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9}

(With -5 silently converted to SAL_MAX_UINT32 - 5)

new: getCount():
{30,31,32,33,34,0,1,2,3,4,5,6,7,8,9}

Change-Id: Ic13678094c7bb4dcd122727f028c910513609cef
2014-08-13 10:10:51 +02:00
5494954b26 Refactored IDocumentLayoutAccess out of SwDoc.
Into the new class DocumentLayoutManager.

Change-Id: I02d0cfcc63633d0bdab380508b2ef563187fd269
2014-08-12 23:26:38 +02:00
9cc617afcd Refactored IDocumentStatistics our of SwDoc.
Into the new class DocumentStatisticsManager.

Change-Id: I281232dc09dbd79c2faf3c2a78ae49625bbe88ee
2014-08-12 23:26:37 +02:00
69e5f335ab Refactored IDocumentFieldsAccess out of SwDoc.
Into the new class DocumentFieldsManager.
Removed SwDoc::_MakeFldList because it is not defined anywhere.
Also moved a few non interface methods that belong to the manager.

Change-Id: Icefd7ca7adcbb05a18d6fae0529fc54150b862fd
2014-08-12 23:26:36 +02:00
274f1811b9 Refactored IDocumentRedlineAccess out of SwDoc.
Into the new class DocumentRedlineManager.
Added an non const version of GetRedlineTbl to the interface.
Also Moved SetAutoFmtRedlineComment which is not part of interface.

Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295
2014-08-12 23:26:36 +02:00
a47b51b415 Avoid fn ptr casts in SwNodes::ForEeach
...by moving ForEach from BigPtrArray down to its sole user SwNodes.

Change-Id: I6d326d3e1ac9dc6ac820e600973af420785d5a50
2014-08-05 16:30:31 +02:00
9a73339851 fdo#81491 FILEOPEN DOCX Assert Fails while Deleting Para (FramePr)
SwXText::convertToTextFrame is called for a Para with FramePr.
convertToTextFrame in turn calls DelFullPara which throws an assert
as a few Bookmarks are still registered to the paragraph.

In  MarkManager::correctMarksAbsolute,  pMark->GetMarkPos().nNode.GetNode()
is checked if it is pOldNode, and then the Mark Position is shifted to aNewPos.
In the following condition pMark->GetOtherMarkPos().nNode.GetNode()
if it is the pOldNode, and still the Mark Position is changed.
However the Other Mark Position must be changed as now the Othe Mark is in pOldNode.

Change-Id: I4507f6b2906d33bc65c922fffe12db2110de651b
Reviewed-on: https://gerrit.libreoffice.org/10536
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-08-01 10:00:00 +00:00
26b33fc2f2 fdo#80580: LO crashes while opening the document on ubuntu build
Problem Description:
This issue is reproducible.

Step to reproduce :
1. Create .docx contains page break on first page.
2. Second page contains '&'(ampersand) with some character like 'x','z','#' etc.
3. Changes the size or font of '&character' which is on second page.
4. Precaution will be take all this i.e page break and '&character' contains in single paragraph'.

Solution:
Added a check for Context Type which must be CONTEXT_CHARACTER for deferring character.

Change-Id: I27989d2ca8d62fbd9efafe5ba7f4a65d56467c1e
Reviewed-on: https://gerrit.libreoffice.org/10532
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Luboš Luňák <l.lunak@collabora.com>
2014-07-29 14:27:08 +00:00
c73cb50cdd fdo#81380: LO crashes while opening the document
LO crashes while opening the document because PropertySet interface
is null and check for this condition was missing, so added the check.

Change-Id: I04dd873ea0923a662e27f9eb2013cde31edc912b
Reviewed-on: https://gerrit.libreoffice.org/10379
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Luboš Luňák <l.lunak@collabora.com>
2014-07-21 14:12:40 +00:00
083b2b1471 fdo#80924: writerfilter: RTF import: fix shapeType PictureFrame import
For shapeType PictureFrame, a default CustomShape was created and then
RTFDocumentImpl::resolvePict() crashes because it actually operates on a
previous shape, because in this special case RTFSdrImport::m_xShape
is never actually set to the new shape, so contains the previous one.

Also the new shape needs to be added to the draw-page, at least
otherwise the assertion of the supported service fails because
some SvxShape::mpObj weak-reference is dead?

This essentially reverts commit 3cab1adf19d553663685e8198f0ec3f258a37c36
(except for the added testcase, which was slightly different because
it did not have a "pib" property).

(regression from ba9b63d8101197d3fd8612193b1ca188271dfc1a)

Change-Id: I6539c4286850dff2d8564006487cc765f1d117be
2014-07-16 11:15:34 +02:00
f634ec520f Refactored IDocumentContentOperations out of SwDoc.
Into the new class DocumentContentOperationsManager.

Made SwNodes in sw/inc/ndarr.hxx friend class to
DocumentContentOperationsManager so it can call DelNodes at end of
DocumentContentOperationsManager::DeleteSection .

Added DeleteAutoCorrExceptWord to SwDoc, its needed in the Manager.

Added a non const version of SwDoc::GetDfltGrfFmtColl() to SwDoc
because its needed in the Manager.

Made SwDoc a friend class to DocumentContentOperationsManager so it
can call SwDoc::checkRedlining and SwDocL::_MakeFlySection.

Moved SwDoc::CopyImpl_ , SwDoc::CopyWithFlyInFly and
SwDoc::CopyFlyInFlyImpl into the Manager.

Moved "struct ParaRstFmt" and "lcl_RstTxtAttr" from docfmt.cxx
in DocumentContentOperationsManager.hxx .

Change-Id: Icaab57f4a8c158a85e549ecb4aacc752bc95bbc9
2014-07-15 15:44:04 +02:00
0459e43ae6 fdo#79838 : DOCX : File crashes on open
Issue :
	DOCX containing nested form fields FORMCHECKBOX inside
	FORMTEXT crashes at open.

	Implementation :
	- Handled case for FORMTEXT.
	- Added issue file isnide sw/qa/core/data/ooxml/pass/

NOTE : This is a due to regression. Issue file opened
       successfully on LO-3.5 and LO-4.1.
       Code changes that caused regression is : https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=a52ee51269a47e52d68405caf8507e1abaa6fd8f

Change-Id: I59dbe7bb2d58c1bcb0ddd144cf7891cbec5cdb24
Reviewed-on: https://gerrit.libreoffice.org/9932
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-07-02 21:51:20 +00:00
b00a59287e fdo#80514 LO crashes on opening; tries to remove a para with NumPicBullet
LO crashes while opening the issue file as, an extra Num Pic Bullets is
attached to the dummy para. All NumPicBullets were disposed in
dtor of ListsManager.
LO tries to remove dummy para after the section, while the pic bullet is still attached to it.
This causes Lo to crash while removing the paragraph.

Added a 'ListsManager::DisposeNumPicBullets( )' to remove the extra bullets from the document
Added the issue file in sw/qa/core/data/ooxml/pass/

Change-Id: I578f48364dcb4ff939fa3800e90db88a99d5ca1a
Reviewed-on: https://gerrit.libreoffice.org/9897
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-06-30 14:56:08 +00:00
d92aa2f445 remove SFX_APP() macro that was a mer wrapper for SfxGetApp()
Change-Id: I480a789c767dd671775c9d70d96bf71908f21f5b
2014-06-27 17:08:04 +02:00
9fbdb02c9a fdo#79940 LO crashes on opening; tries to remove a para with bookmarks
LO crashes while opening the issue file as, DomainMapper_Impl::RemoveLastParagraph
tries to dispose a paragraph which has bookmarks attached.

If A para finishes and a new para has not been started as yet,
which means the current cursor position is outside a paragraph.  In such a case move the
Bookmark-End to the earlier paragraph.
Added the issue file in sw/qa/core/data/ooxml/pass/

Change-Id: I62cf94718add943d042d770ab5337a0dae70d9e8
Reviewed-on: https://gerrit.libreoffice.org/9764
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-06-26 07:41:44 +00:00
e2080e70fe new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
   class A {
     struct X x;
     public X* getX() { return &x; }
   }
which can be:
     public X& getX() { return x; }

Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
2014-06-24 11:34:21 +02:00
077121eb0d fdo#79973 : LO crashes while opening the document.
Description:
- If the equation ends with two dots(.) then file get crash.
- In SmParser::NextToken()
  the file get crash because string index is out of bound.

Change-Id: I5f25814220d556d53c10d4ca33a38b4d0d451438
Reviewed-on: https://gerrit.libreoffice.org/9840
Reviewed-by: Muthu Subramanian K <muthusuba@gmail.com>
Tested-by: Muthu Subramanian K <muthusuba@gmail.com>
2014-06-20 14:38:14 +00:00
75fc9e669f fdo#78904 : LO hangs while saving the document.
- In case of framePr attributes being omitted in original xml, LO defaults
  such attributes to incorrect values.
- Correcting these values in this fix.
- This fix stops LO from getting hang while saving the document, the actual
  fix needs to be somewhere in the table layout. We need to restrict the
  frame from being considered as part of the table as MSO does not allow
  frame to be part of a table.

Change-Id: I4c35f7eff6ca1122901f5667fc26b849df527f60
Reviewed-on: https://gerrit.libreoffice.org/9774
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-06-20 08:48:36 +00:00
3cab1adf19 abi#2720 RTF import: handle non-graphic object after a graphic one
Change-Id: I9416b6e7cf3677006215fcbde458ed341c4e3e9e
2014-06-19 18:01:16 +02:00
887b3a3562 loplugin:staticcall
Change-Id: I26e1e0f66dad5ed4e8351fc7509449b312559166
2014-06-13 17:54:35 +02:00
63d1aa4dc8 fdo#78885 : File crashed while opening in LO
- File attached to issue contains footnote between a table and reference
    of footnote is in field.
  - In PopFieldContext code was throwing exception due to null value of
    footnotestartnode.

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

Change-Id: I467e234a7daa6a5f724087c2cc959e4c9d76f4d2
2014-06-11 11:21:35 +02:00
14ce4b3372 fdo#78906 : File crashes while opening.
Handled a memory corruption.

Change-Id: I195d17bcd0a9a86bcc96cc7ad14f1d5f2908cf8c
Reviewed-on: https://gerrit.libreoffice.org/9545
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-06-05 09:21:15 +00:00
d71387ca81 fdo#79384: replace the work-around with a different one
Word will reject Shift-JIS following \loch, but apparently OOo could read
and (worse) write such documents, so accept Shift-JIS regardless of run
charset type.

Change-Id: Ib181956e9f218548a52037dd76fa1d3ecdc006bd
2014-06-03 20:48:44 +02:00
6092e2eba3 fdo#79384 RTF import: allow { without } in style names
This is not valid, but LO 3.4 supported it, so add a workaround...

Change-Id: Ib8eefdf41fe9801db6f7e5873eaa1436518912fb
2014-06-02 20:29:00 +02:00
21c11ffe25 fdo#78900 RTF import: allow \dpxsize inside \dptxbxtext
Previously we assumed that they always appear under \do directly.

Change-Id: Ie3a978da856986f604a3815d6127abb4191323c0
2014-05-26 15:39:52 +02:00
6878f0debf coverity#1209381 Unchecked dynamic_cast
Change-Id: Idab888e866fa08e184b51b8209a4154062d61041
2014-05-23 20:37:36 +01:00
73f65ac3ef WaE: unused variable 'aFileNameBase'
Change-Id: I26cf27c7edc51d0a28e228c56465c3ec2ad7d35e
2014-05-22 16:12:09 +03:00
b01b171fbf sw: why the heck is that #ifdef'd out?
Change-Id: I213ad0f0ab853aec5cb523474218dfad2c44d11b
2014-05-22 14:21:29 +02:00
5246fa2624 fdo#68983: basic: if the library is not loaded fully, copy source storage
Also fixes fdo#42899 and fdo#67685 in a different way; the previous fix
for fdo#42899 caused the problem with password-protected libraries for
which the password is not known: only the binary representation of the
BAISC module was stored, not the source code; by simply copying from the
source storage the problem can be avoided.

It would be possible to ask for the password when storing, but that
would not work when non-interactive (called via API).

An alternative fix would be to pass in the
SfxObjectShell::IsSetModifyEnabled() flag and actually reset the BASIC
library's modify flag correctly, but that requires adding a
parameter to XStorageBasedLibraryContainer::storeLibrariesToStorage().

(regression from af34774d260a68fc02cd78ba90dd8d4afaf1a2a4 )

Change-Id: I4701401f35171139fc2fe8d225d13d4e533091a0
2014-05-22 13:12:55 +02:00
3124c25871 coverity#738881 Uninitialized pointer field
Change-Id: Iecf88297963bd4bf0a5f69f7090ed0bbeb393c89
2014-04-30 21:02:47 +01:00
1de73df9cb cp#1000068 testcase
Change-Id: I0dbbfd9c82600fbc5c98c5107639e1714b220c71
2014-04-30 15:07:22 +02:00
d77dec325e Blind fix attempt for error: no matching function for call to 'assertEquals'
Change-Id: Icd90d8e765af4bce6e4c56068fcdf40ff2ed3af4
2014-04-24 22:39:22 +03:00
66b1b690ab add unittest for moving around the marks
Change-Id: I31849e655ab9e9c9acc62f1fdc124d40342deb49
Reviewed-on: https://gerrit.libreoffice.org/9069
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-04-24 16:15:20 +00:00
c79a5f87b1 remove executable bit
Change-Id: I91f6e861f6d0dbea1b57ac73857e0c706b27f681
2014-04-17 15:11:14 +02:00
1f742c520d Properly #ifdef some per-platform test code
Change-Id: I286fb35e223f205ecc649aa388471ef1b0823d86
2014-04-15 23:29:14 +02:00
0cc8a2bb7e Remove dead code
Change-Id: I6034174b2273def43d176c3f463c1161757c8f70
2014-04-15 16:10:54 +02:00
2afe4c170d Clean up function declarations and some unused functions
Change-Id: I58c425ab9d2c01f8844226aff820dd56d88ec09c
2014-04-15 13:56:21 +02:00
36532778a6 sw: initialize FieldResult::m_eType
Change-Id: Ia41ceb42b360a17021a30b5ed420d36759116255
2014-04-08 15:47:51 +02:00
c65a70c444 another workaround for C++'s lack of proper overloading
Change-Id: I83f39c12a26e8acfe9a60d2ce9bd1b4b1b7c8c02
2014-04-08 12:42:51 +02:00
d477ff4a81 fdo#69416: make footnote positions available to XProofreader
- ModelToViewHelper: add new flag REPLACEMODE, which causes fields and
  footnotes to be replaced with ZWSP instead of expanding them
- SwXFlatParagraph: add FootnotePositions and FieldPositions properties
- GrammarCheckingIterator: invoke XProofreader::doProofreading with
  properties FootnotePositions and FieldPositions

Change-Id: I9b66a37aac94f940546e812d8b85a35aebd8181a
2014-04-08 12:12:24 +02:00
bda01cf116 convert testModelToViewHelper to CPPUNIT_ASSERT_EQUALS
Change-Id: I27cd49adeb5b7bcf1e793b230bf0b41e46527702
2014-04-08 12:12:24 +02:00
8f6c55a839 Replace SV_DECL/IMPL_REF macros with SvRef template
Change-Id: I0ef2e67f6d61e0ce118c0f5e926b8194ef9d8058
2014-04-07 12:38:27 +02:00
362d4f0cd4 Explicitly mark overriding destructors as "virtual"
It appears that the C++ standard allows overriding destructors to be marked
"override," but at least some MSVC versions complain about it, so at least make
sure such destructors are explicitly marked "virtual."

Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-04-01 19:22:54 +02:00