summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-11-29 17:12:54 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-11-29 17:31:43 +0100
commit049933c035157129cc0409bb100dfc5353847a63 (patch)
tree16908dfee4f95d47751db72cbfc39fbf30c73361 /sw/qa
parentc506650b21c628e603ce7dc3dc30238c480342d2 (diff)
sw: fix RTF export of text frames anchored to empty paragraphs
Regression from d4069372484f18b242a42a1996767f57b031fff6 Change-Id: I28e095819e0c2f1a4b110741ace366329937f863 Reported-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfexport/data/textframes.odtbin0 -> 8853 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx10
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/textframes.odt b/sw/qa/extras/rtfexport/data/textframes.odt
new file mode 100644
index 000000000000..301744af3ebd
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/textframes.odt
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index c2d88301988f..f79b13f5bd4e 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -66,6 +66,7 @@ public:
void testMathRuns();
void testFdo53113();
void testFdo55939();
+ void testTextFrames();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -107,6 +108,7 @@ void Test::run()
{"math-runs.rtf", &Test::testMathRuns},
{"fdo53113.odt", &Test::testFdo53113},
{"fdo55939.odt", &Test::testFdo55939},
+ {"textframes.odt", &Test::testTextFrames},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -439,6 +441,14 @@ void Test::testFdo55939()
getRun(xParagraph, 3, " Text after the footnote."); // However, this leading space is intentional and OK.
}
+void Test::testTextFrames()
+{
+ // The output was simply invalid, so let's check if all 3 frames were imported back.
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
ange.hxx?id=635448a996714a81cb15b41ac4bb0c73cabfb74f'>XUnoTunnel->dynamic_cast in SwXTextRangeNoel Grandin Change-Id: I87e635f371278132be9da4e6a60ba90180d25522 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2023-01-19XUnoTunnel->dynamic_cast in SwXTextRangesNoel Grandin Change-Id: I12565dcdd1437c461762688ed3bf0e1adad828ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145827 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2022-10-31tdf#126788 inline CreateXTextRange into this call siteNoel Grandin Change-Id: Iba3c0a35ebd9e1c6e639cde79225c3ab896bc97f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142037 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2022-10-31tdf#126788 return concrete type from CreateXTextRangeNoel Grandin to make it easier to optimise call sites unnecessarily creates tons of these Change-Id: I39bced82ae03fe33dbf0592f384332ab49f914fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2022-10-11use more string_view in swNoel Grandin Change-Id: Ibefb8549834ba5011286e3221f1ae276e2c0c0bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141153 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2022-07-27sw: delete bookmark if paragraph is fully selectedMichael Stahl testTdf96479 requires inserting with absorb=true to be treated as Replace, and there is of course no string in insertTextContent(). testDeleteFlyAtCharAtStart requires setString("") to be treated as Delete. Annoyingly this requires API setString() call to be replaced with internal call, do this for SwXTextRange and SwXTextCursor which are the 2 classes typically used in practice. Change-Id: I87caa1aa11abe298cdd3d9a9bbb602e547c7b443 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137370 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins 2021-08-25tdf#143384 DOCX import: fix SAXException at header with tableAttila Szűcs Regression from commit d656191ec308d4280b93c7169372e543a255d108 "tdf#119952 DOCX import: fix negative page margins". Add SwXHeadFootText::CreateTextCursor(bool bIgnoreTables = false) (modeled after SwXBodyText::CreateTextCursor) to create text cursor for copying the header/footer also started with table during fly frame creation in convertoToTextFrame(). Note: add hidden property PROP_CURSOR_NOT_IGNORE_TABLES_IN_HF to use the new feature in domainmapper (followed commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43 "tdf#97128 DOCX import: fix frame direction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I96e2cf2dddcecd146c53c12d7fdb44fc4d90fa0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119549 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> 2021-03-02loplugin:refcounting in swNoel Change-Id: I5d3768503effa002c4a308bfad30d9b56d5365f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-11-30loplugin:stringviewparam include comparisons with string literalsNoel Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-11-24sw: fix copying and deleting of section content via APIMichael Stahl The problem happens if a section starts or ends with a table: SwXTextSection::getAnchor() may return a SwXTextRange with one position in a table cell and another position in a different table cell, or outside the table, neither of which is valid to set the cursor via SwXTextViewCurosor::gotoRange(). Introduce a new special mode for SwXTextRange, RANGE_IS_SECTION, analogous to RANGE_IS_TABLE but actually working. Only SwXTextView can be used to create XTransferables, and it requires selecting first via either the SwXTextViewCursor or select(). It's currently not possible to select the content of a section in the ViewShell in these problematic cases, and would be some effort to add. So add a new interface XTransferableTextSupplier that can be used to create XTransferable from the SwXTextRange with RANGE_IS_SECTION. The core CopyRange() and DeleteRange() functions can deal with SwPaMs that start or end in non-text-nodes, so pass the whole section content to these in SwXTextRange::setString() and in SwXTextView::getTransferableFromTextRange(). Change-Id: If7e3210e8a26f5618317c294f2b2f3ed5c217f1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106293 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> 2019-11-04loplugin:finalclasses in sw/incNoel Grandin Change-Id: I084502d8c5607f103ef987b54252ef95341f0bef Reviewed-on: https://gerrit.libreoffice.org/81981 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2017-10-23loplugin:includeform: swStephan Bergmann Change-Id: Ifc3c4c31a31ee7189eeab6f1af30b94d64f2f92a 2017-08-04loplugin:constparams in sw part5Noel Grandin Change-Id: I6c33709aa407ccb3eee7026ab9b40dc4257de209 Reviewed-on: https://gerrit.libreoffice.org/40769 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2017-01-26Remove dynamic exception specificationsStephan Bergmann ...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2017-01-19New loplugin:dynexcspec: Add @throws documentation, swStephan Bergmann Change-Id: I2da2ce4cd247e7b9f973150917b4ee7bd7a0e0c4 2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e