// all error checking was already done by the MM job execution if (rName == UNO_NAME_OUTPUT_URL)
bOk &= rValue >>= msMailMergeOutputURL; elseif (rName == UNO_NAME_FILE_NAME_PREFIX)
bOk &= rValue >>= msMailMergeOutputPrefix; elseif (rName == UNO_NAME_OUTPUT_TYPE)
bOk &= rValue >>= mnCurOutputType; elseif (rName == UNO_NAME_FILE_NAME_FROM_COLUMN)
bOk &= rValue >>= bMMFilenameFromColumn; elseif (rName == UNO_NAME_DOCUMENT_URL)
bOk &= rValue >>= msMailMergeDocumentURL;
}
CPPUNIT_ASSERT(bOk);
// MM via UNO just works with file names. If we load the file on // Windows before MM uses it, MM won't work, as it's already open. // Don't move the load before the mail merge execution! // (see gb_CppunitTest_use_instdir_configuration)
createSwDoc(maMMtestFilename);
void loadMailMergeDocument(const OUString& filename)
{
assert(mnCurOutputType == text::MailMergeType::FILE); // Output name early, so in the case of a hang, the name of the hanging input file is visible.
std::cout << filename << ",";
loadFromURL(msMailMergeOutputURL + "/" + filename);
calcLayout();
}
/** Loadsnumber-thdocumentfrommailmerge.Requiresfileoutputfrommailmerge.
*/ void loadMailMergeDocument(int number, charconst* const ext = ".odt")
{
OUString name; if (!msMailMergeOutputPrefix.isEmpty())
name = msMailMergeOutputPrefix; else
{
INetURLObject aURLObj;
aURLObj.SetSmartProtocol(INetProtocol::File);
aURLObj.SetSmartURL(msMailMergeDocumentURL);
name = aURLObj.GetBase();
}
name += OUString::number(number)
+ OStringToOUString(std::string_view(ext, strlen(ext)), RTL_TEXTENCODING_ASCII_US);
loadMailMergeDocument(name);
}
// Returns page number of the first page of a MM document inside the large MM document (used in the SHELL case). int documentStartPageNumber(int document) const
{ // See documentStartPageNumber() .
CPPUNIT_ASSERT(mxSwTextDocument);
SwWrtShell* shell = mxSwTextDocument->GetDocShell()->GetWrtShell();
IDocumentMarkAccess* marks = shell->GetDoc()->getIDocumentMarkAccess(); // Unfortunately, the pages are marked using UNO bookmarks, which have internals names, so they cannot be referred to by their names. // Assume that there are no other UNO bookmarks than the ones used by mail merge, and that they are in the sorted order.
IDocumentMarkAccess::const_iterator mark; int pos = 0; for (mark = marks->getAllMarksBegin(); mark != marks->getAllMarksEnd() && pos < document;
++mark)
{ if (IDocumentMarkAccess::GetType(**mark) == IDocumentMarkAccess::MarkType::UNO_BOOKMARK)
++pos;
}
CPPUNIT_ASSERT_EQUAL(document, pos);
sal_uInt16 page, dummy;
shell->Push();
shell->GotoMark(*mark);
shell->GetPageNum(page, dummy);
shell->Pop(SwCursorShell::PopMode::DeleteCurrent); return page;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet am 2026-06-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.