Commit Graph

82 Commits

Author SHA1 Message Date
Varun
9d9fbbdc1e Add test for tdf#75137 crsr movement b/w footnote
Change-Id: Ifd0ec1e7922c54fb3509824de13bb8f0b1c79279
Reviewed-on: https://gerrit.libreoffice.org/16391
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-22 11:07:38 +00:00
Varun
69295a44dc Added test for del of table redlines rhbz#1198848
Change-Id: I76f236adee86ffb75496bc36f0d6b0ac7d646afd
Reviewed-on: https://gerrit.libreoffice.org/16347
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-06-18 12:18:00 +00:00
Miklos Vajna
ddaca012d2 SwDocShell: re-store embedded data source def only when location changes
Change-Id: Ic667491026e9e88a72253aa079c77b8079cac588
2015-06-11 15:40:05 +02:00
Stephan Bergmann
808d401392 So assume SwUiWriterTest::testEmbeddedDataSource works on MACOSX now too
...similar to 6cca91f7ad "CppunitTest_sw_uiwriter:
enable on Windows," whatever the original problem was in
601ba26cb5 "Fix the Windows and OS X build
temporarily."

Change-Id: Ia1befff90d773637e01e6d88e398ae21a1d47108
2015-06-11 09:56:48 +02:00
Miklos Vajna
6cca91f7ad CppunitTest_sw_uiwriter: enable on Windows
I hope that the underlying problem is fixed now by commit
670100fcfb (Remove FastLoader
optimization, 2015-06-10).

Change-Id: I1cb577ec1f50a45b40683031e79c0999338a2926
2015-06-10 18:50:20 +02:00
Stephan Bergmann
7fd168ad47 loplugin:salbool
Change-Id: I030321e8cb905be78b68f9e404926e22723632ef
2015-06-10 18:29:26 +02:00
Varun
c979a944c7 Added Test for Export to Picture
Change-Id: I62d44e29cd4376f17270cef548d2cec6f4b621b9
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-06-10 16:51:04 +02:00
Varun
4deaf89bbe Added Test for tdf#91145 Set Cell Background Color
Change-Id: I7c41f1d596946706dde4adbeb5434ae0be58b04b

Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-06-10 16:51:04 +02:00
Stephan Bergmann
54253f382e Ensure single RTTI symbol instance
...to make typeid comparison in sw::UnoCursorPointer::SwClientNotify work also
under the Itanium C++ ABI/libc++ semantics (as used on Mac OS X), not only the
less strict GCC/libstc++ semantics (as typically used on Linux).  This caused
CppunitTest_sw_uiwriter's testUnoCursorPointer to fail on Mac OS X.
(DocDisposingHint and LegacyModifyHint need to be SW_DLLPUBLIC even though they
are nominally only used inside the sw library, because they are also used from
the CppunitTest_sw_uiwriter test code.)

Change-Id: Ideceade22ca3049ae287aea468de93c72bee5fdc
2015-06-10 15:31:54 +02:00
Stephan Bergmann
f9887ea014 loplugin:unreffun
Change-Id: Ibc1634886a85f4c7936ea175c754d31ea21eefe1
2015-06-10 09:29:28 +02:00
Caolán McNamara
0d754a386f Revert "re-enable test after fix up"
so much for that, still fails elsewhere

This reverts commit 50a1410f7a.
2015-06-09 17:09:31 +01:00
Caolán McNamara
50a1410f7a re-enable test after fix up
Change-Id: I138a7abb67aadb6c0edc52caf88cb9ce8adcdcf9
2015-06-09 16:54:45 +01:00
Caolán McNamara
3b397cb6cf kill SwNodeIndex before dispose to fix uiwriter failures
Change-Id: Ifbca76f10fadc96dc90e48a7222c40baae9b85c1
2015-06-09 16:41:55 +01:00
Bjoern Michaelsen
a8f0a18fb9 disable UnoCursorPointer test for now as it fails on OSX
Change-Id: If2eb492ad4be3c6d570874c6a2fabadc3c233dab
2015-06-09 17:41:14 +02:00
Bjoern Michaelsen
3e01e7d572 add smart pointer for managing SwUnoCrsrs
Change-Id: I9db71fb4be78b5d6fda64217287efea6abd7d771
2015-06-09 12:53:24 +02:00
Miklos Vajna
2d7ff7aabc SwDocShell: custom copy for embedded data source definition on save-as
If "EmbeddedDatabase" in test.odt refers test.ods in the same directory,
that will be "../../test.ods". Now if we save test.odt in a different
directory, we need to re-save the embedded data source definition,
otherwise the relative reference will resolve to a non-existing path.

Relative references are normally not supported for embedded objects, so
this is not a problem, but for data sources they are, that's why they
are a special case here.

Change-Id: Id138b9cdc38f2de589d9b80c66f1a61174699770
2015-06-09 12:08:18 +02:00
Miklos Vajna
335df40d28 Enable SwUiWriterTest::testEmbeddedDataSource() at least on Linux
Change-Id: I06f684349c774032cfab9a69862213e3077f88ac
Reviewed-on: https://gerrit.libreoffice.org/16149
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2015-06-08 14:16:02 +00:00
Jan Holesovsky
601ba26cb5 Fix the Windows and OS X build temporarily.
Change-Id: I3b02b9b09375867f7bbfac4f32f7747a0228581e
2015-06-08 12:56:43 +02:00
Miklos Vajna
df726c8b3e CppunitTest_sw_uiwriter: add embedded data source definition testcase
Fails with the last hunk of commit
4101949b2a (dbaccess: set correct BaseURI
for vnd.sun.star.pkg:// URLs on load, 2015-06-08) reverted.

Change-Id: Ieeaec3b0f925de0d5cf54e08b998038434686b3d
2015-06-08 12:02:13 +02:00
Christian Lohmaier
ab465b90f6 bin/rename-sw-abbreviations.sh
renames the most annoying abbreviations in Writer (and partially
in the shared code too).

Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-20 13:05:49 +02:00
Philippe Jung
d49242026e tdf#90883 WRITER: Insert button with multiple rows/columns selected
Compute the number of rows/columns to insert based on selected cells.

Change-Id: I489bca715dcf31d191f9a875ac5d59a6140a14d7
Reviewed-on: https://gerrit.libreoffice.org/15741
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-05-17 12:39:39 +00:00
Miklos Vajna
3c0805e1f4 tdf#86639 SwEditShell: when setting para style, reset char attrs if needed
The old internal RTF filter used to call SwTxtNode::SetAttr() without
setting SetAttrMode::NOFORMATATTR, so character attributes which cover
the whole node got converted to paragraph attributes.  The new UNO
filter goes through SwXText::insertTextPortion(), which sets
SetAttrMode::NOFORMATATTR, so this doesn't happen. The result of this is
that when the UI sets a new paragraph style on the text node, then such
character attributes are no longer removed.

Given that in RTF you can't really have character properties on a
paragraph, going back to the document model produced by the old internal
filter doesn't sound like the good direction -- not to mention that
changing SwXText::insertTextPortion() this way would be an implicit API
change.

Fix the problem by tweaking SwEditShell::SetTxtFmtColl() instead, so
that it removes these full-text-node character attributes, too. The
logic in SwTxtNode::RstTxtAttr() can be extended later if necessary to
delete more attributes, but to be on the safe side, just handle the bare
minimum necessary to fix the problem for now.

Change-Id: I5faa3226fc0f9c18e005da185fe0830d8c393256
2015-05-14 11:39:16 +02:00
Mike Kaganski
0ddd9f9ff4 tdf#70318: don't forget to clean up second fake paragraph
RTF insert is made into an empty paragraph. To do that, two splits
are made before the insert, but only one is reverted afterwards.
This patch removes the second.

Also fixes a memory leak from unreleased heap object

The corresponding unit test is corrected. It was incorrect
because \par doesn't begin new paragraph; it only ends paragraph.
If a RTF is ended with \par } then no newline is added to its end.
The old unit test only worked because of the bug fixed by this
patch. Correct way of inserting new paragraph in the end of a RTF
is \par \par}

Change-Id: I63d50a940d7960beb35f7d774c833ed8499acbef
2015-05-12 12:50:42 +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
Stephan Bergmann
fe1104e515 loplugin:cstylecast
Change-Id: I9dfde74fa7e5e3a651ea014e6cc335bac780cb4b
2015-04-21 20:45:09 +02:00
Austin Chen
f29e959c82 Applies CharAttribute to selected text and tests undo
Change-Id: Ibd171fda4ea38de4d76d8f252d6f6d37cf3b9a66
Reviewed-on: https://gerrit.libreoffice.org/15158
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-21 16:03:45 +00:00
Noel Grandin
a7b7c64afc convert SCRIPTTYPE_ constants to scoped enum
Change-Id: I5be3980ac865162d8d7626556ca47eca4b0ee433
Reviewed-on: https://gerrit.libreoffice.org/15344
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-04-17 07:21:08 +00:00
Miklos Vajna
4a59caddac tdf#90362 sw: config option for ignoring protected areas
Change-Id: Idfa62aa5bbccf62ee85f863150e13f80b8b5db90
Reviewed-on: https://gerrit.libreoffice.org/15181
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2015-04-07 11:44:37 +00:00
Michael Stahl
ba431cd20a sw: [loplugin:stringconstant]
Change-Id: Idb8a113254574ca5f998980ede91e42f9bd09277
2015-04-02 14:51:50 +02:00
Varun
c35bf9ef22 Added test function for Search-and-Replace with Transliteration
This test function checks the search-and-replace operation with some Transliteration Flags enabled.

Change-Id: I86e0068e9d91e4fe426f9d6c120baf66e59e2b7e
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-04-02 14:51:50 +02:00
Miklos Vajna
d8bb2a9705 tdf#90003 Revert "SwTxtFormatter::NewPortion: fix lost SwFlyPortion"
This reverts commit 25c50ff9fb. The
original commit fixed a corner-case, but also broke a much more frequent
use case. Revert till we have a better solution for the corner-case.

Conflicts:
	sw/qa/extras/inc/swmodeltestbase.hxx
	sw/qa/extras/uiwriter/uiwriter.cxx

Change-Id: I0f90459e9bc372eeba18bf81c5d1dfcccbe21753
2015-03-14 16:08:16 +01:00
Michael Stahl
0777231112 V803 decreased performance postfix increment
These are pretty silly anyway, but apparently it complains even about
integer variables which make this rather a waste of time.

Change-Id: I15e847d33d5decd2adcab04e4f1567d3997d28a2
2015-03-13 16:23:26 +01:00
Noel Grandin
d8a17866d6 fix build after my hasty commit
10a1b86185
"convert MarkType to enum class"

Change-Id: Iad1c294c4836ededea23c5edcb67dea54dd5357a
2015-03-11 14:16:08 +02:00
Miklos Vajna
7e33cce05b cp#1000115 SwTxtFrm: don't join follow just because it has no content
The problem was that the bugdoc had a table, and inside the table there
was a long paragraph that flows to the next page, but only the paragraph
mark of it does so. We first split the frame to have space for the
paragraph mark, but later decided that all the content would fit the
first frame, and this way the last hard line break and the paragraph
mark was painted on each other.

This is normally not a problem without tables, because
SwTxtFrm::FormatAdjust() just calls SplitFrm(), sets its nNew flag to
non-zero make sure that later SwTxtFrm::_AdjustFollow() doesn't try to
join it, and we're ready. However, when the paragraph is inside a table,
then the paragraph was formatted multiple times, and next time when we
already had a follow nNew was not set, so even if there was a correct
split first, the new frame was joined later.

Fix the problem by explicitly setting nNew for the "in a table and
paragraph ends with a hard line break" case, that way we don't blindly
join the frame, only in case there is enough space for the follow in the
master.

Change-Id: Iede654740dcb0d8aa768d742ee330208291a383a
2015-02-13 14:49:56 +01:00
Miklos Vajna
d334dd956a tdf#68183 sw: config option for disabling the creation of automatic RSID marks
It was a problem since the initial commit
062eaeffe7 (sw: Improved document
comparison based on RSIDs., 2011-12-22) that this new feature -- which
is annoying for some use-cases -- could not be disabled, let's allow
that.

Change-Id: I33fa77382919586fb00198246f737caa68dcbd85
Reviewed-on: https://gerrit.libreoffice.org/14277
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2015-02-02 13:24:51 +00:00
Noel Grandin
7f8f277b94 fdo#84938: convert STREAM_ #defines to 'enum class'
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
2015-01-07 11:20:44 +02:00
Miklos Vajna
fa39e79704 fdo#72486 SwWrtShell::SelAll: if in table, then call extended select all ...
... only in case the whole table is already selected

Change-Id: If7626954460e16945af6b21402a84e90c71ae138
2015-01-03 13:09:26 +01:00
Miklos Vajna
93bb210119 Let MetafileXmlDump::dumpAndParse() take a const GDIMetaFile
So the const_cast<> in CppunitTest_sw_uiwriter can go away.

Change-Id: Id7d4234154cd6bed43cb5270b50208061038dcf7
2014-12-19 09:05:09 +01:00
Miklos Vajna
20f8006e21 fdo#87448 EnhancedCustomShape2d: fix handling of scaled ARCANGLETO commands
Change-Id: I7daf52a60e3fac8d9f86b464e86af60e0495fcb1
2014-12-18 19:28:19 +01:00
Stephan Bergmann
b1fab4ab32 sw: Use appropriate OUString functions on string constants
Change-Id: I9c3e03324c69beb5af4c43da208086600876f875
2014-12-18 14:12:34 +01:00
Bjoern Michaelsen
e57b0ebeb7 fdo#85876: add unittest
rather uglyish unittest, but still worth it as cutting nothing needing
to have sideeffects is really kind of non-obvious and prone to return

Change-Id: I02bbfb05f019874d873670cdae060ac3183f5ca6
2014-12-18 02:41:29 +01:00
Matúš Kukan
9338bea6e8 Add undo operation for deleting a bookmark + unit test, related fdo#51741
Change-Id: I79d8d3c30b6b0b2cc253963fdd50019aec033e12
2014-12-11 15:31:26 +01:00
Matúš Kukan
4a3328a98f sw: Unit test for cycle in lcl_CreatePortions
Reviewed on:
	https://gerrit.libreoffice.org/13413
Conflicts:
	sw/qa/extras/uiwriter/uiwriter.cxx

Change-Id: I26a8707046d7f30381fb51c41e49f8dee4796ba7
2014-12-10 16:22:14 +01:00
Bjoern Michaelsen
6091274708 test for document merge
Change-Id: Ic6d10a611d9e9351eb9403e1405ec7b17293e816
2014-12-08 14:52:14 +01:00
Miklos Vajna
25c50ff9fb fdo#87005 SwTxtFormatter::NewPortion: fix lost SwFlyPortion
In case there are two flys anchored to the paragraph and it's empty,
then the situation is that SwTxtFormatter::BuildPortions() calls
NewPortion() two times, second time the SwTxtFormatInfo has no fly set
initially, only after NewPortion() calls CalcFlyWidth(). When that
happens, we used to return pPor, even in case it was 0, and we the
SwTxtFormatInfo had a fly portion.

Fix the problem by checking if SwTxtFormatInfo has a fly portion after
CalcFlyWidth(), and in case otherwise we would return 0, return the fly
portion of SwTxtFormatInfo instead. As a result, the paragraph delimiter
in the bugdoc will be positioned at the correct position, as the
SwTxtFrm will properly have two layout portions, just like non-empty
SwTxtFrms.

Change-Id: I51e5ba61e79b4353c7b11c6d76b8c370ac3d4d37
2014-12-05 13:33:06 +01:00
Noel Grandin
64a70d8cf5 loplugin: cstylecast
Change-Id: Id61218433add142e109bfc858549b8d2d8d1c28f
2014-12-04 11:15:54 +02:00
Kohei Yoshida
8093e86ebe Revert "loplugin: cstylecast"
This reverts commit 8dba4716d2.

<:: is not a legal syntax at least with gcc 4.7.
2014-12-02 23:17:30 -05:00
Noel Grandin
8dba4716d2 loplugin: cstylecast
Change-Id: I922fe2b4177687863d9749c2f46aab9ddd86621a
2014-12-02 14:34:10 +02:00
Takeshi Abe
cbbe0e5051 add mode lines
Change-Id: Id7825ecd076a5d8cbe926a26bc74fc7d0da1d621
2014-12-02 18:28:57 +09:00
Daniel Sikeler
94bcfb0419 Unittest for autocorrect in writer
At first we test normal replacement of wrong words.
Second part of the test is about style changes during autocorrection.
And at the end we replace a word with a table.

The rules for the autocorrection are in
test/user-template/user/autocorr/acor_fr.dat
I needed to make SwAutoCorrect public for my test.

Conflicts:
	sw/qa/extras/uiwriter/uiwriter.cxx

Change-Id: Ie753c2187c1f4eddaefe0cc428a605107112c24f
Reviewed-on: https://gerrit.libreoffice.org/13131
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-28 11:18:11 +00:00