summaryrefslogtreecommitdiff
path: root/sw/qa/core/text/text.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-11-04 10:45:08 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-11-04 17:14:38 +0100
commitc44f64621fe11d6a46c79b9793c7c67c60bb66e8 (patch)
treeba47a4bb6dc4ecb47dd4e77209df8f0fa7f4d956 /sw/qa/core/text/text.cxx
parent20d5763b2b56b4e3d7569fe9e5cdad87657f6808 (diff)
SwModelTestBase: make mpTestDocumentPath private
in preparation for future inheritance from UnoApiTest Change-Id: Ie5dee5af3609d8490d7d7bad0d6dbc4c8fc17bb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142280 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/core/text/text.cxx')
-rw-r--r--sw/qa/core/text/text.cxx36
1 files changed, 19 insertions, 17 deletions
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 0bece6e95f2b..4127a3c1c108 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -41,16 +41,19 @@
#include <txatbase.hxx>
#include <textcontentcontrol.hxx>
-constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/";
-
/// Covers sw/source/core/text/ fixes.
class SwCoreTextTest : public SwModelTestBase
{
+public:
+ SwCoreTextTest()
+ : SwModelTestBase("/sw/qa/core/text/data/")
+ {
+ }
};
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testFootnoteConnect)
{
- SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "footnote-connect.fodt");
+ SwDoc* pDoc = createSwDoc("footnote-connect.fodt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
// Jump to the start of the next page.
pWrtShell->SttNxtPg();
@@ -134,7 +137,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTabOverMarginSection)
{
- createSwDoc(DATA_DIRECTORY, "tabovermargin-section.fodt");
+ createSwDoc("tabovermargin-section.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
sal_Int32 nWidth
= getXPath(pXmlDoc, "//Text[@nType='PortionType::TabRight']", "nWidth").toInt32();
@@ -149,7 +152,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTabOverMarginSection)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineHeight)
{
// Given a document with an as-char image, height in twips not fitting into sal_uInt16:
- createSwDoc(DATA_DIRECTORY, "line-height.fodt");
+ createSwDoc("line-height.fodt");
// When laying out that document:
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
@@ -165,7 +168,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineHeight)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testLineWidth)
{
// Given a document with an as-char image, width in twips not fitting into sal_uInt16:
- SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "line-width.fodt");
+ SwDoc* pDoc = createSwDoc("line-width.fodt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
sal_Int32 nOldLeft = pWrtShell->GetCharRect().Left();
@@ -186,7 +189,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testChineseAutoFirstLineIndent)
// The test document contains two simple multi-line paragraph. For both paragraphs, the first line indent
// is set to 'auto'. Line spacing is 100% for the 1st paragraph and 200% for the 2nd paragraph.
// Also, there is a "AutoFirstLineIndentDisregardLineSpace" capability flag set in the document.
- createSwDoc(DATA_DIRECTORY, "firstLineIndent-withFlag.fodt");
+ createSwDoc("firstLineIndent-withFlag.fodt");
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
@@ -205,7 +208,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testChineseAutoFirstLineIndent)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRuby)
{
// Given a document with multiple ruby portions:
- SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "ruby.fodt");
+ SwDoc* pDoc = createSwDoc("ruby.fodt");
// When laying out that document:
SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
@@ -246,13 +249,12 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testEmptyNumberingPageSplit)
{
// Given a document with 2 pages: the only para on page 1 is a numbering without a number
// portion:
- createSwDoc(DATA_DIRECTORY, "empty-numbering-page-split.fodt");
+ createSwDoc("empty-numbering-page-split.fodt");
// When inserting an image that doesn't fit the body frame:
// Then make sure that the layout update after insertion finishes:
uno::Sequence<beans::PropertyValue> aArgs = {
- comphelper::makePropertyValue("FileName",
- m_directories.getURLFromSrc(DATA_DIRECTORY) + "image.png"),
+ comphelper::makePropertyValue("FileName", createFileURL(u"image.png")),
};
// Without the accompanying fix in place, this never finished.
dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs);
@@ -261,7 +263,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testEmptyNumberingPageSplit)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreak)
{
// Given a document with a fly frame and two characters wrapped around it:
- createSwDoc(DATA_DIRECTORY, "clearing-break.fodt");
+ createSwDoc("clearing-break.fodt");
// Insert a clearing break between "A" and "B":
uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XText> xText = xDocument->getText();
@@ -291,7 +293,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreak)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakAtStart)
{
// Given a document with a fly frame and a character wrapped around it:
- createSwDoc(DATA_DIRECTORY, "clearing-break-start.fodt");
+ createSwDoc("clearing-break-start.fodt");
// Insert a clearing break before "X":
uno::Reference<text::XTextDocument> xDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XText> xText = xDocument->getText();
@@ -457,7 +459,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakVertical)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testClearingLineBreakHeader)
{
// Given a document with a shape in the header and a clearing break in the body text:
- createSwDoc(DATA_DIRECTORY, "clearing-break-header.fodt");
+ createSwDoc("clearing-break-header.fodt");
// When laying out that document:
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
@@ -556,7 +558,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete)
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf120715_CursorMoveWhenTypingSpaceAtCenteredLineEnd)
{
- SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx");
+ SwDoc* pDoc = createSwDoc("tdf43100_tdf120715_cursorOnSpacesOverMargin.docx");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
// Make a paint to force the call of AddExtraBlankWidth, that calculate width for holePortions.
@@ -578,7 +580,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf43100_CursorMoveToSpacesOverMargin)
// These differences are based on its paragraphs
// - alignment (left, center, right, justified),
// - line count (1 line, 2 lines, blank line containing only spaces)
- SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx");
+ SwDoc* pDoc = createSwDoc("tdf43100_tdf120715_cursorOnSpacesOverMargin.docx");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
// Make a paint to force the call of AddExtraBlankWidth, that calculate width for holePortions.
@@ -827,7 +829,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testNumberPortionFormat)
{
// Given a document with a single paragraph, direct formatting asks 24pt font size for the
// numbering and the text portion:
- createSwDoc(DATA_DIRECTORY, "number-portion-format.odt");
+ createSwDoc("number-portion-format.odt");
// When laying out that document:
xmlDocUniquePtr pXmlDoc = parseLayoutDump();